From 28fa1f7ef049304693b8ba793e36c501ff8f645b Mon Sep 17 00:00:00 2001 From: wdf Date: Sun, 16 Aug 2026 14:03:59 +0800 Subject: [PATCH] feat: add ECharts integration for advanced chart rendering Add a new 'echart' node type that renders full ECharts charts with theme-aware colors, tooltips, and legends. Two modes: - Preset shorthand: 'preset: bar|line|area|pie|scatter' + 'data'/'series' for quick upgrade from the 'chart' node - Full option: 'option' field for custom chart types (radar, combo, heatmap, dataZoom, visualMap, etc.) Implementation: - EChartNode.tsx: React component with ResizeObserver for responsive charts - echarts-lazy.ts: on-demand engine loader (echarts ~1MB never enters main bundle) - asset-echarts.ts: standalone asset bundle registered on window.__GenuiAssets__ - spec.ts: GenuiEChart type with preset/option/data/series fields - guard.ts: spec validation for echart nodes (option depth cap, preset whitelist) - render-node.tsx: wire echart into the component dispatcher - GenuiBlock.module.css: chart container, title, loading and fallback styles - tsdown.config.ts: add echarts asset build target - plugin/index.ts: register echarts asset route Docs: - README.md / README.zh-CN.md: ECharts feature description, example, FAQ update - SKILL.md: echart node syntax documentation The echarts engine loads lazily via the plugin's HTTP asset route only when an 'echart' node appears in a spec. Conversations without echart nodes never download it. --- README.md | 19 ++- README.zh-CN.md | 19 ++- SKILL.md | 5 +- lib/assets/echarts.js | 64 +++++++++ lib/client.js | 6 +- lib/index.js | 64 ++++++++- lib/types/client/EChartNode.d.ts | 4 + lib/types/client/asset-echarts.d.ts | 15 ++ lib/types/client/asset-loader.d.ts | 2 +- lib/types/client/blocks/charts.d.ts | 1 + lib/types/client/echarts-lazy.d.ts | 17 +++ lib/types/client/guard.d.ts | 3 + lib/types/client/spec.d.ts | 40 +++++- lib/types/plugin/index.d.ts | 2 +- package.json | 2 + pnpm-lock.yaml | 23 +++ src/client/EChartNode.tsx | 210 ++++++++++++++++++++++++++++ src/client/GenuiBlock.module.css | 38 +++++ src/client/asset-echarts.ts | 25 ++++ src/client/asset-loader.ts | 2 +- src/client/blocks/charts.tsx | 2 +- src/client/blocks/render-node.tsx | 2 + src/client/echarts-lazy.ts | 35 +++++ src/client/guard.ts | 74 ++++++++++ src/client/spec.ts | 39 ++++++ src/plugin/index.ts | 3 +- tsdown.config.ts | 1 + 27 files changed, 700 insertions(+), 17 deletions(-) create mode 100644 lib/assets/echarts.js create mode 100644 lib/types/client/EChartNode.d.ts create mode 100644 lib/types/client/asset-echarts.d.ts create mode 100644 lib/types/client/echarts-lazy.d.ts create mode 100644 src/client/EChartNode.tsx create mode 100644 src/client/asset-echarts.ts create mode 100644 src/client/echarts-lazy.ts diff --git a/README.md b/README.md index acd0066..524bec6 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,7 @@ dsh plugin --profile web add link:$PWD - **Answer-as-UI**: components are embedded in the reply and appear as they stream — no waiting for the whole message - **30+ components**: cards, tables, charts, forms, tabs, accordions, file trees, timelines, diffs… +- **ECharts integration**: the `echart` node renders full ECharts charts with theme-aware colors, tooltips, and legends. Two modes: **preset shorthand** (`preset: 'bar' | 'line' | 'area' | 'pie' | 'scatter'` + `data`/`series`) for quick upgrade from the `chart` node, or **full option** (`option` field) for custom chart types, dataZoom, visualMap, and other advanced ECharts features. The echarts engine (~1 MB) is lazy-loaded on demand — the main bundle never carries it, and conversations without `echart` nodes never download it - **Function plots**: `plot` draws curves; parameter sliders redraw in real time, with optional auto-animation

@@ -121,11 +122,25 @@ The model outputs this fence (written for the browser — you don't need to read What you see: two stat cards. +### ECharts example + +```dsh-ui +{"title":"Q1 Revenue","items":[ + {"type":"echart","title":"Monthly Revenue","preset":"bar","data":[ + {"label":"Jan","value":98}, + {"label":"Feb","value":112}, + {"label":"Mar","value":128} + ]} +]} +``` + +What you see: a themed bar chart with tooltips and axis labels — rendered by ECharts, lazy-loaded on demand. + ## 🔧 How it works The model writes the interface description as JSON inside a `dsh-ui` fence; the browser-side renderer (`src/client`) claims this language through the main repo's `fence-registry` interface and renders it. Components are whitelisted — the model can't smuggle in HTML/scripts; function expressions go through a standalone parser, never `eval`. -The core render package stays light (≈110 KB min / 28 KB gzip); the mermaid and three.js engines are bundled separately as on-demand assets (loaded through the plugin's self-registered HTTP routes the first time they're used), so startup only downloads the rendering core. +The core render package stays light (≈110 KB min / 28 KB gzip); the mermaid, three.js, and echarts engines are bundled separately as on-demand assets (loaded through the plugin's self-registered HTTP routes the first time they're used), so startup only downloads the rendering core. ## ❓ FAQ @@ -133,7 +148,7 @@ The core render package stays light (≈110 KB min / 28 KB gzip); the mermaid an - **Chat UI goes blank when rendering a dsh-ui fence?** Your dsh is too old — update dsh first, then reinstall the plugin. - **`dsh: pnpm not found on PATH`?** Install pnpm, then **open a new terminal** and retry (`corepack enable` or `npm i -g pnpm`). - **Stuck on git credentials / 404 during install?** The repo is public (`omdsh-dev/dsh-genui`) — the git URL above needs no login; a 404 for `@omdsh-dev/dsh-genui` means the npm package has not been published yet. -- **Installed but scene3d/mermaid don't render?** The engines (mermaid / three) are no longer inlined in client.js — they load on demand the first time they're used (`/plugins/@omdsh-dev/dsh-genui/assets/*.js`, hosted by the plugin's own HTTP routes). First restart dsh web + hard refresh (Cmd+Shift+R); still broken, remove and reinstall (`dsh plugin --profile web remove @omdsh-dev/dsh-genui`, then add again). Hosts without the asset routes degrade to source/load-error hints — update dsh. +- **Installed but scene3d/mermaid/echarts don't render?** The engines (mermaid / three / echarts) are no longer inlined in client.js — they load on demand the first time they're used (`/plugins/@omdsh-dev/dsh-genui/assets/*.js`, hosted by the plugin's own HTTP routes). First restart dsh web + hard refresh (Cmd+Shift+R); still broken, remove and reinstall (`dsh plugin --profile web remove @omdsh-dev/dsh-genui`, then add again). Hosts without the asset routes degrade to source/load-error hints — update dsh. - **Model not outputting fences?** New sessions pick it up after a restart; or just say "output it with dsh-ui". - **No lib/ after cloning?** Build it yourself: `pnpm install && pnpm run check`. diff --git a/README.zh-CN.md b/README.zh-CN.md index 5bad45f..aa078a1 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -85,6 +85,7 @@ dsh plugin --profile web add link:$PWD - **回答即界面**:组件嵌在回答里,边生成边出现,不用等整段写完 - **30+ 组件**:卡片、表格、图表、表单、标签页、折叠面板、文件树、时间线、diff…… +- **ECharts 集成**:`echart` 节点渲染完整的 ECharts 图表,自动适配主题色、提示框和图例。两种模式:**预设简写**(`preset: 'bar' | 'line' | 'area' | 'pie' | 'scatter'` + `data`/`series`)可从 `chart` 节点快速升级;**完整选项**(`option` 字段)支持自定义图表类型、dataZoom、visualMap 等高级 ECharts 功能。echarts 引擎(~1 MB)按需懒加载——主包不含引擎,没有 `echart` 节点的对话不会下载它 - **函数图**:`plot` 画曲线,参数滑块拖动实时重绘,支持自动动画

@@ -121,11 +122,25 @@ dsh plugin --profile web add link:$PWD 你看到的是两张统计卡片。 +### ECharts 示例 + +```dsh-ui +{"title":"Q1 收入","items":[ + {"type":"echart","title":"月度收入","preset":"bar","data":[ + {"label":"1月","value":98}, + {"label":"2月","value":112}, + {"label":"3月","value":128} + ]} +]} +``` + +你看到的是一张带提示框和坐标轴的主题色柱状图——由 ECharts 渲染,按需懒加载。 + ## 🔧 原理 模型把界面描述写成 JSON 放进 `dsh-ui` 围栏,浏览器端渲染器(`src/client`)通过主仓 `fence-registry` 接口认领这门语言并渲染。组件是白名单的,模型塞不进 HTML/脚本;函数表达式走独立解析器,不用 eval。 -主渲染包保持轻量(≈110 KB min / 28 KB gzip),mermaid 与 three.js 引擎单独打包为按需资产(首次用到时经插件自注册的 HTTP 路由加载),启动时只下载渲染核心。 +主渲染包保持轻量(≈110 KB min / 28 KB gzip),mermaid、three.js 与 echarts 引擎单独打包为按需资产(首次用到时经插件自注册的 HTTP 路由加载),启动时只下载渲染核心。 ## ❓ 常见问题 @@ -133,7 +148,7 @@ dsh plugin --profile web add link:$PWD - **渲染 dsh-ui fence 时聊天界面白屏?** dsh 版本太旧——先更新 dsh 再重装插件。 - **`dsh: pnpm not found on PATH`?** 装 pnpm 后**新开终端**再试(`corepack enable` 或 `npm i -g pnpm`)。 - **安装时卡在 git 凭据/404?** 仓库是公开的(`omdsh-dev/dsh-genui`),上面的 git URL 无需登录;`@omdsh-dev/dsh-genui` 返回 404,表示 npm 包尚未发布。 -- **装了但 scene3d/mermaid 不渲染?** 引擎(mermaid / three)不再内联进 client.js——它们在首次用到时按需加载(`/plugins/@omdsh-dev/dsh-genui/assets/*.js`,插件自带 HTTP 路由托管)。先重启 dsh web + 硬刷新(Cmd+Shift+R);仍不渲染就卸掉重装(`dsh plugin --profile web remove @omdsh-dev/dsh-genui` 后再 add)。旧版宿主缺少资产路由时会降级显示源码/加载失败提示,更新 dsh 即可。 +- **装了但 scene3d/mermaid/echarts 不渲染?** 引擎(mermaid / three / echarts)不再内联进 client.js——它们在首次用到时按需加载(`/plugins/@omdsh-dev/dsh-genui/assets/*.js`,插件自带 HTTP 路由托管)。先重启 dsh web + 硬刷新(Cmd+Shift+R);仍不渲染就卸掉重装(`dsh plugin --profile web remove @omdsh-dev/dsh-genui` 后再 add)。旧版宿主缺少资产路由时会降级显示源码/加载失败提示,更新 dsh 即可。 - **模型不主动输出?** 重启后新会话生效;或直接说"用 dsh-ui 输出"。 - **clone 后没有 lib/?** `pnpm install && pnpm run check` 自己构建。 diff --git a/SKILL.md b/SKILL.md index 221c8f6..cdd1eb3 100644 --- a/SKILL.md +++ b/SKILL.md @@ -15,7 +15,7 @@ description: "Render structured interactive UI inline in your reply via the dsh- 布局:`text` `row` `col` `grid` `card` `divider` `spacer` 展示:`stat` `badge` `progress` `list` `table` `keyvalue` `avatar` `timeline` `file-tree` `breadcrumb` `diff` `json` `code` `callout` `steps` -图表:`chart`(bars/line/donut,可多序列)`plot`(数学函数图) +图表:`chart`(bars/line/donut,可多序列)`plot`(数学函数图)`echart`(ECharts 全功能图表) 交互:`button` `input` `select` `checkbox` `radio` `switch` `textarea` `tabs` `accordion` `copy` 高级:`mermaid`(流程图/时序/甘特等)`scene3d`(3D WebGL)`quiz`(点选判题 + 解析 + 重试) @@ -45,6 +45,7 @@ description: "Render structured interactive UI inline in your reply via the dsh- ### 图表 - chart: `{"type":"chart","kind":"bars|line|donut","data":[{"label":"...","value":n,"color":"#hex?"}],"series":[...]?}` — bars 默认;line 趋势;donut 占比;series 字段 = 分组柱状图;负值数据:柱高为 0 但数值标注照显、donut 负值记 0 弧长(line 正常画负区间) - plot: `{"type":"plot","series":[{"expr":"a*sin(b*x)","label":"...","color":"#hex?","params":[{"name":"a","value":1,"min":0,"max":5,"animateTo":3,"durationMs":4000,"loop":true},{"name":"b","value":1,"min":0.5,"max":5}]}],"xMin":-6.28,"xMax":6.28,"title":"..."}` — SVG 函数图;**series 可带 `"kind":"line|area|scatter"`**(缺省 line;area 填色到基线;scatter 散点);**params 渲染成实时滑块**(拖动即时重绘,**y 轴锁定**=只变曲线不变数轴);**animateTo 参数会显示播放按钮**(自动动画演示);SVG 可拖拽平移、滚轮缩放;表达式支持 sin/cos/tan/asin/acos/atan/sqrt/cbrt/exp/log/ln/abs/floor/ceil/round/min/max/pow,常量 pi/e/tau,变量 x(其他字母=参数) +- echart: `{"type":"echart","title":"...","height":300,"preset":"bar|line|area|pie|scatter","data":[{"label":"...","value":n}],"series":[...]?}` — **ECharts 全功能图表**,视觉效果远超 `chart`(渐变、tooltip、动画、图例交互);**preset 模式**:用和 `chart` 一样的 `data`/`series` 格式,自动构建主题化的 ECharts 配置(颜色跟随宿主主题);**full option 模式**:传 `"option":{...}` 直接写 ECharts 原生配置(支持 dataZoom/visualMap/radar/gauge/heatmap 等所有图表类型),option 中的函数会被过滤(只接受数据);推荐用 echart 替代 chart 获得更好视觉效果 ### 交互 **本地优先(v2.6)**:UI 自己能做的状态变化——判卷、判题、重置、展开、选中——一律本地即时完成,**零模型往返**。action 只用于必须模型参与的事(生成新内容、执行工具、下一步建议)。**交互组件必须带 action:不带 action 的按钮渲染为禁用态,用户点不了;带 action 的按钮点击后有「已触发」本地反馈。** @@ -80,7 +81,7 @@ description: "Render structured interactive UI inline in your reply via the dsh- |---|---| | 关键结论 / 要点罗列(≥2 条) | `list`、`keyvalue`、`callout` | | 重点强调 / 警告 / 注意事项 | `callout`(info/success/warning/error)、`badge`、`stat` | -| 数据对比 / 趋势 / 占比 | `chart`(bars/line/donut)、`table` | +| 数据对比 / 趋势 / 占比 | `chart`(bars/line/donut)、`echart`(ECharts 全功能)、`table` | | 关键指标数字 / 进度状态 | `stat`、`progress`、`badge` | | 流程 / 步骤 / 阶段 / 时间线 | `steps`、`timeline`、`mermaid`(flowchart/sequence/gantt) | | 目录 / 文件结构 / 层级关系 | `file-tree`、`mermaid`、`accordion` | diff --git a/lib/assets/echarts.js b/lib/assets/echarts.js new file mode 100644 index 0000000..cfbe592 --- /dev/null +++ b/lib/assets/echarts.js @@ -0,0 +1,64 @@ +(function(){var e=Object.defineProperty,t=(t,n)=>{let r={};for(var i in t)e(r,i,{get:t[i],enumerable:!0});return n||e(r,Symbol.toStringTag,{value:`Module`}),r},n=function(e,t){ +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. + +Permission to use, copy, modify, and/or distribute this software for any +purpose with or without fee is hereby granted. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH +REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY +AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, +INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM +LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR +OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +***************************************************************************** */ +return n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},n(e,t)};function r(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);n(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var i=function(){function e(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return e}(),a=new(function(){function e(){this.browser=new i,this.node=!1,this.wxa=!1,this.worker=!1,this.svgSupported=!1,this.touchEventsSupported=!1,this.pointerEventsSupported=!1,this.domSupported=!1,this.transformSupported=!1,this.transform3dSupported=!1,this.hasGlobalWindow=typeof window<`u`}return e}());typeof wx==`object`&&typeof wx.getSystemInfoSync==`function`?(a.wxa=!0,a.touchEventsSupported=!0):typeof document>`u`&&typeof self<`u`?a.worker=!0:!a.hasGlobalWindow||`Deno`in window?(a.node=!0,a.svgSupported=!0):o(navigator.userAgent,a);function o(e,t){var n=t.browser,r=e.match(/Firefox\/([\d.]+)/),i=e.match(/MSIE\s([\d.]+)/)||e.match(/Trident\/.+?rv:(([\d.]+))/),a=e.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(e);r&&(n.firefox=!0,n.version=r[1]),i&&(n.ie=!0,n.version=i[1]),a&&(n.edge=!0,n.version=a[1],n.newEdge=+a[1].split(`.`)[0]>18),o&&(n.weChat=!0),t.svgSupported=typeof SVGRect<`u`,t.touchEventsSupported=`ontouchstart`in window&&!n.ie&&!n.edge,t.pointerEventsSupported=`onpointerdown`in window&&(n.edge||n.ie&&+n.version>=11),t.domSupported=typeof document<`u`;var s=document.documentElement.style;t.transform3dSupported=(n.ie&&`transition`in s||n.edge||`WebKitCSSMatrix`in window&&`m11`in new WebKitCSSMatrix||`MozPerspective`in s)&&!(`OTransition`in s),t.transformSupported=t.transform3dSupported||n.ie&&+n.version>=9}var s=`12px sans-serif`,c=20,l=100,u=`007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N`;function d(e){var t={};if(typeof JSON>`u`)return t;for(var n=0;n=0)s=o*n.length;else for(var c=0;c>1)%2;s.cssText=[`position: absolute`,`visibility: hidden`,`padding: 0`,`margin: 0`,`border-width: 0`,`user-select: none`,`width:0`,`height:0`,r[c]+`:0`,i[l]+`:0`,r[1-c]+`:auto`,i[1-l]+`:auto`,``].join(`!important;`),e.appendChild(o),n.push(o)}return n}function ct(e,t,n){for(var r=n?`invTrans`:`trans`,i=t[r],a=t.srcCoords,o=[],s=[],c=!0,l=0;l<4;l++){var u=e[l].getBoundingClientRect(),d=2*l,f=u.left,p=u.top;o.push(f,p),c=c&&a&&f===a[d]&&p===a[d+1],s.push(e[l].offsetLeft,e[l].offsetTop)}return c&&i?i:(t.srcCoords=o,t[r]=n?nt(s,o):nt(o,s))}function lt(e){return e.nodeName.toUpperCase()===`CANVAS`}var ut=/([&<>"'])/g,dt={"&":`&`,"<":`<`,">":`>`,'"':`"`,"'":`'`};function ft(e){return e==null?``:(e+``).replace(ut,function(e,t){return dt[t]})}var pt=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,mt=[],ht=a.browser.firefox&&+a.browser.version.split(`.`)[0]<39;function gt(e,t,n,r){return n||={},r?_t(e,t,n):ht&&t.layerX!=null&&t.layerX!==t.offsetX?(n.zrX=t.layerX,n.zrY=t.layerY):t.offsetX==null?_t(e,t,n):(n.zrX=t.offsetX,n.zrY=t.offsetY),n}function _t(e,t,n){if(a.domSupported&&e.getBoundingClientRect){var r=t.clientX,i=t.clientY;if(lt(e)){var o=e.getBoundingClientRect();n.zrX=r-o.left,n.zrY=i-o.top;return}if(ot(mt,e,r,i)){n.zrX=mt[0],n.zrY=mt[1];return}}n.zrX=n.zrY=0}function vt(e){return e||window.event}function yt(e,t,n){if(t=vt(t),t.zrX!=null)return t;var r=t.type;if(r&&r.indexOf(`touch`)>=0){var i=r===`touchend`?t.changedTouches[0]:t.targetTouches[0];i&>(e,i,t,n)}else{gt(e,t,t,n);var a=bt(t);t.zrDelta=a?a/120:-(t.detail||0)/3}var o=t.button;return t.which==null&&o!==void 0&&pt.test(t.type)&&(t.which=o&1?1:o&2?3:o&4?2:0),t}function bt(e){var t=e.wheelDelta;if(t)return t;var n=e.deltaX,r=e.deltaY;if(n==null||r==null)return t;var i=Math.abs(r===0?n:r),a=r>0?-1:r<0?1:n>0?-1:1;return 3*i*a}function xt(e,t,n,r){e.addEventListener(t,n,r)}function St(e,t,n,r){e.removeEventListener(t,n,r)}var Ct=function(e){e.preventDefault(),e.stopPropagation(),e.cancelBubble=!0};function wt(e){return e.which===2||e.which===3}var Tt=function(){function e(){this._track=[]}return e.prototype.recognize=function(e,t,n){return this._doTrack(e,t,n),this._recognize(e)},e.prototype.clear=function(){return this._track.length=0,this},e.prototype._doTrack=function(e,t,n){var r=e.touches;if(r){for(var i={points:[],touches:[],target:t,event:e},a=0,o=r.length;a1&&r&&r.length>1){var a=Et(r)/Et(i);!isFinite(a)&&(a=1),t.pinchScale=a;var o=Dt(r);return t.pinchX=o[0],t.pinchY=o[1],{type:`pinch`,target:e[0].target,event:t}}}}};function kt(){return[1,0,0,1,0,0]}function At(e){return e[0]=1,e[1]=0,e[2]=0,e[3]=1,e[4]=0,e[5]=0,e}function jt(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4],e[5]=t[5],e}function Mt(e,t,n){var r=t[0]*n[0]+t[2]*n[1],i=t[1]*n[0]+t[3]*n[1],a=t[0]*n[2]+t[2]*n[3],o=t[1]*n[2]+t[3]*n[3],s=t[0]*n[4]+t[2]*n[5]+t[4],c=t[1]*n[4]+t[3]*n[5]+t[5];return e[0]=r,e[1]=i,e[2]=a,e[3]=o,e[4]=s,e[5]=c,e}function Nt(e,t,n){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e[4]=t[4]+n[0],e[5]=t[5]+n[1],e}function Pt(e,t,n,r){r===void 0&&(r=[0,0]);var i=t[0],a=t[2],o=t[4],s=t[1],c=t[3],l=t[5],u=Math.sin(n),d=Math.cos(n);return e[0]=i*d+s*u,e[1]=-i*u+s*d,e[2]=a*d+c*u,e[3]=-a*u+d*c,e[4]=d*(o-r[0])+u*(l-r[1])+r[0],e[5]=d*(l-r[1])-u*(o-r[0])+r[1],e}function Ft(e,t,n){var r=n[0],i=n[1];return e[0]=t[0]*r,e[1]=t[1]*i,e[2]=t[2]*r,e[3]=t[3]*i,e[4]=t[4]*r,e[5]=t[5]*i,e}function It(e,t){var n=t[0],r=t[2],i=t[4],a=t[1],o=t[3],s=t[5],c=n*o-a*r;return c?(c=1/c,e[0]=o*c,e[1]=-a*c,e[2]=-r*c,e[3]=n*c,e[4]=(r*s-o*i)*c,e[5]=(a*i-n*s)*c,e):null}function Lt(e){var t=kt();return jt(t,e),t}var J=function(){function e(e,t){this.x=e||0,this.y=t||0}return e.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},e.prototype.clone=function(){return new e(this.x,this.y)},e.prototype.set=function(e,t){return this.x=e,this.y=t,this},e.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},e.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},e.prototype.scale=function(e){this.x*=e,this.y*=e},e.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},e.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},e.prototype.dot=function(e){return this.x*e.x+this.y*e.y},e.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},e.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},e.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},e.prototype.distance=function(e){var t=this.x-e.x,n=this.y-e.y;return Math.sqrt(t*t+n*n)},e.prototype.distanceSquare=function(e){var t=this.x-e.x,n=this.y-e.y;return t*t+n*n},e.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},e.prototype.transform=function(e){if(e){var t=this.x,n=this.y;return this.x=e[0]*t+e[2]*n+e[4],this.y=e[1]*t+e[3]*n+e[5],this}},e.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},e.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},e.set=function(e,t,n){e.x=t,e.y=n},e.copy=function(e,t){e.x=t.x,e.y=t.y},e.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},e.lenSquare=function(e){return e.x*e.x+e.y*e.y},e.dot=function(e,t){return e.x*t.x+e.y*t.y},e.add=function(e,t,n){e.x=t.x+n.x,e.y=t.y+n.y},e.sub=function(e,t,n){e.x=t.x-n.x,e.y=t.y-n.y},e.scale=function(e,t,n){e.x=t.x*n,e.y=t.y*n},e.scaleAndAdd=function(e,t,n,r){e.x=t.x+n.x*r,e.y=t.y+n.y*r},e.lerp=function(e,t,n,r){var i=1-r;e.x=i*t.x+r*n.x,e.y=i*t.y+r*n.y},e}(),Rt=Math.min,zt=Math.max,Bt=new J,Vt=new J,Ht=new J,Ut=new J,Wt=new J,Gt=new J,Y=function(){function e(e,t,n,r){n<0&&(e+=n,n=-n),r<0&&(t+=r,r=-r),this.x=e,this.y=t,this.width=n,this.height=r}return e.prototype.union=function(e){var t=Rt(e.x,this.x),n=Rt(e.y,this.y);this.width=isFinite(this.x)&&isFinite(this.width)?zt(e.x+e.width,this.x+this.width)-t:e.width,this.height=isFinite(this.y)&&isFinite(this.height)?zt(e.y+e.height,this.y+this.height)-n:e.height,this.x=t,this.y=n},e.prototype.applyTransform=function(t){e.applyTransform(this,this,t)},e.prototype.calculateTransform=function(e){var t=this,n=e.width/t.width,r=e.height/t.height,i=kt();return Nt(i,i,[-t.x,-t.y]),Ft(i,i,[n,r]),Nt(i,i,[e.x,e.y]),i},e.prototype.intersect=function(t,n){if(!t)return!1;t instanceof e||(t=e.create(t));var r=this,i=r.x,a=r.x+r.width,o=r.y,s=r.y+r.height,c=t.x,l=t.x+t.width,u=t.y,d=t.y+t.height,f=!(am&&(m=y,hm&&(m=b,_=n.x&&e<=n.x+n.width&&t>=n.y&&t<=n.y+n.height},e.prototype.clone=function(){return new e(this.x,this.y,this.width,this.height)},e.prototype.copy=function(t){e.copy(this,t)},e.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},e.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},e.prototype.isZero=function(){return this.width===0||this.height===0},e.create=function(t){return new e(t.x,t.y,t.width,t.height)},e.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},e.applyTransform=function(t,n,r){if(!r){t!==n&&e.copy(t,n);return}if(r[1]<1e-5&&r[1]>-1e-5&&r[2]<1e-5&&r[2]>-1e-5){var i=r[0],a=r[3],o=r[4],s=r[5];t.x=n.x*i+o,t.y=n.y*a+s,t.width=n.width*i,t.height=n.height*a,t.width<0&&(t.x+=t.width,t.width=-t.width),t.height<0&&(t.y+=t.height,t.height=-t.height);return}Bt.x=Ht.x=n.x,Bt.y=Ut.y=n.y,Vt.x=Ut.x=n.x+n.width,Vt.y=Ht.y=n.y+n.height,Bt.transform(r),Ut.transform(r),Vt.transform(r),Ht.transform(r),t.x=Rt(Bt.x,Vt.x,Ht.x,Ut.x),t.y=Rt(Bt.y,Vt.y,Ht.y,Ut.y);var c=zt(Bt.x,Vt.x,Ht.x,Ut.x),l=zt(Bt.y,Vt.y,Ht.y,Ut.y);t.width=c-t.x,t.height=l-t.y},e}(),Kt=`silent`;function qt(e,t,n){return{type:e,event:n,target:t.target,topTarget:t.topTarget,cancelBubble:!1,offsetX:n.zrX,offsetY:n.zrY,gestureEvent:n.gestureEvent,pinchX:n.pinchX,pinchY:n.pinchY,pinchScale:n.pinchScale,wheelDelta:n.zrDelta,zrByTouch:n.zrByTouch,which:n.which,stop:Jt}}function Jt(){Ct(this.event)}var Yt=function(e){r(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.handler=null,t}return t.prototype.dispose=function(){},t.prototype.setCursor=function(){},t}($e),Xt=function(){function e(e,t){this.x=e,this.y=t}return e}(),Zt=[`click`,`dblclick`,`mousewheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],Qt=new Y(0,0,0,0),$t=function(e){r(t,e);function t(t,n,r,i,a){var o=e.call(this)||this;return o._hovered=new Xt(0,0),o.storage=t,o.painter=n,o.painterRoot=i,o._pointerSize=a,r||=new Yt,o.proxy=null,o.setHandlerProxy(r),o._draggingMgr=new Qe(o),o}return t.prototype.setHandlerProxy=function(e){this.proxy&&this.proxy.dispose(),e&&(F(Zt,function(t){e.on&&e.on(t,this[t],this)},this),e.handler=this),this.proxy=e},t.prototype.mousemove=function(e){var t=e.zrX,n=e.zrY,r=nn(this,t,n),i=this._hovered,a=i.target;a&&!a.__zr&&(i=this.findHover(i.x,i.y),a=i.target);var o=this._hovered=r?new Xt(t,n):this.findHover(t,n),s=o.target,c=this.proxy;c.setCursor&&c.setCursor(s?s.cursor:`default`),a&&s!==a&&this.dispatchToElement(i,`mouseout`,e),this.dispatchToElement(o,`mousemove`,e),s&&s!==a&&this.dispatchToElement(o,`mouseover`,e)},t.prototype.mouseout=function(e){var t=e.zrEventControl;t!==`only_globalout`&&this.dispatchToElement(this._hovered,`mouseout`,e),t!==`no_globalout`&&this.trigger(`globalout`,{type:`globalout`,event:e})},t.prototype.resize=function(){this._hovered=new Xt(0,0)},t.prototype.dispatch=function(e,t){var n=this[e];n&&n.call(this,t)},t.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},t.prototype.setCursorStyle=function(e){var t=this.proxy;t.setCursor&&t.setCursor(e)},t.prototype.dispatchToElement=function(e,t,n){e||={};var r=e.target;if(!(r&&r.silent)){for(var i=`on`+t,a=qt(t,e,n);r&&(r[i]&&(a.cancelBubble=!!r[i].call(r,a)),r.trigger(t,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(t,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(e){typeof e[i]==`function`&&e[i].call(e,a),e.trigger&&e.trigger(t,a)}))}},t.prototype.findHover=function(e,t,n){var r=this.storage.getDisplayList(),i=new Xt(e,t);if(tn(r,i,e,t,n),this._pointerSize&&!i.target){for(var a=[],o=this._pointerSize,s=o/2,c=new Y(e-s,t-s,o,o),l=r.length-1;l>=0;l--){var u=r[l];u!==n&&!u.ignore&&!u.ignoreCoarsePointer&&(!u.parent||!u.parent.ignoreCoarsePointer)&&(Qt.copy(u.getBoundingRect()),u.transform&&Qt.applyTransform(u.transform),Qt.intersect(c)&&a.push(u))}if(a.length){for(var d=4,f=Math.PI/12,p=Math.PI*2,m=0;m4)return;this._downPoint=null}this.dispatchToElement(a,e,t)}});function en(e,t,n){if(e[e.rectHover?`rectContain`:`contain`](t,n)){for(var r=e,i=void 0,a=!1;r;){if(r.ignoreClip&&(a=!0),!a){var o=r.getClipPath();if(o&&!o.contain(t,n))return!1}r.silent&&(i=!0),r=r.__hostTarget||r.parent}return!i||Kt}return!1}function tn(e,t,n,r,i){for(var a=e.length-1;a>=0;a--){var o=e[a],s=void 0;if(o!==i&&!o.ignore&&(s=en(o,n,r))&&(!t.topTarget&&(t.topTarget=o),s!==Kt)){t.target=o;break}}}function nn(e,t,n){var r=e.painter;return t<0||t>r.getWidth()||n<0||n>r.getHeight()}var rn=32,an=7;function on(e){for(var t=0;e>=rn;)t|=e&1,e>>=1;return e+t}function sn(e,t,n,r){var i=t+1;if(i===n)return 1;if(r(e[i++],e[t])<0){for(;i=0;)i++;return i-t}function cn(e,t,n){for(n--;t>>1,i(a,e[c])<0?s=c:o=c+1;var l=r-o;switch(l){case 3:e[o+3]=e[o+2];case 2:e[o+2]=e[o+1];case 1:e[o+1]=e[o];break;default:for(;l>0;)e[o+l]=e[o+l-1],l--}e[o]=a}}function un(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])>0){for(s=r-i;c0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}else{for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}for(o++;o>>1);a(e,t[n+u])>0?o=u+1:c=u}return c}function dn(e,t,n,r,i,a){var o=0,s=0,c=1;if(a(e,t[n+i])<0){for(s=i+1;cs&&(c=s);var l=o;o=i-c,c=i-l}else{for(s=r-i;c=0;)o=c,c=(c<<1)+1,c<=0&&(c=s);c>s&&(c=s),o+=i,c+=i}for(o++;o>>1);a(e,t[n+u])<0?c=u:o=u+1}return c}function fn(e,t){var n=an,r,i,a=0,o=[];r=[],i=[];function s(e,t){r[a]=e,i[a]=t,a+=1}function c(){for(;a>1;){var e=a-2;if(e>=1&&i[e-1]<=i[e]+i[e+1]||e>=2&&i[e-2]<=i[e]+i[e-1])i[e-1]i[e+1])break;u(e)}}function l(){for(;a>1;){var e=a-2;e>0&&i[e-1]=an||m>=an);if(h)break;f<0&&(f=0),f+=2}if(n=f,n<1&&(n=1),i===1){for(c=0;c=0;c--)e[p+c]=e[f+c];e[d]=o[u];return}for(var m=n;;){var h=0,g=0,_=!1;do if(t(o[u],e[l])<0){if(e[d--]=e[l--],h++,g=0,--i===0){_=!0;break}}else if(e[d--]=o[u--],g++,h=0,--s===1){_=!0;break}while((h|g)=0;c--)e[p+c]=e[f+c];if(i===0){_=!0;break}}if(e[d--]=o[u--],--s===1){_=!0;break}if(g=s-un(e[l],o,0,s,s-1,t),g!==0){for(d-=g,u-=g,s-=g,p=d+1,f=u+1,c=0;c=an||g>=an);if(_)break;m<0&&(m=0),m+=2}if(n=m,n<1&&(n=1),s===1){for(d-=i,l-=i,p=d+1,f=l+1,c=i-1;c>=0;c--)e[p+c]=e[f+c];e[d]=o[u]}else if(s===0)throw Error();else for(f=d-(s-1),c=0;cs&&(c=s),ln(e,n,n+c,n+a,t),a=c}o.pushRun(n,a),o.mergeRuns(),i-=a,n+=a}while(i!==0);o.forceMergeRuns()}}var mn=!1;function hn(){mn||(mn=!0,console.warn(`z / z2 / zlevel of displayable is invalid, which may cause unexpected errors`))}function gn(e,t){return e.zlevel===t.zlevel?e.z===t.z?e.z2-t.z2:e.z-t.z:e.zlevel-t.zlevel}var _n=function(){function e(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=gn}return e.prototype.traverse=function(e,t){for(var n=0;n0&&(l.__clipPaths=[]),isNaN(l.z)&&(hn(),l.z=0),isNaN(l.z2)&&(hn(),l.z2=0),isNaN(l.zlevel)&&(hn(),l.zlevel=0),this._displayList[this._displayListLen++]=l}var u=e.getDecalElement&&e.getDecalElement();u&&this._updateAndAddDisplayable(u,t,n);var d=e.getTextGuideLine();d&&this._updateAndAddDisplayable(d,t,n);var f=e.getTextContent();f&&this._updateAndAddDisplayable(f,t,n)}},e.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},e.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,n=e.length;t=0&&this._roots.splice(r,1)},e.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},e.prototype.getRoots=function(){return this._roots},e.prototype.dispose=function(){this._displayList=null,this._roots=null},e}(),vn=a.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(e){return setTimeout(e,16)},yn={linear:function(e){return e},quadraticIn:function(e){return e*e},quadraticOut:function(e){return e*(2-e)},quadraticInOut:function(e){return(e*=2)<1?.5*e*e:-.5*(--e*(e-2)-1)},cubicIn:function(e){return e*e*e},cubicOut:function(e){return--e*e*e+1},cubicInOut:function(e){return(e*=2)<1?.5*e*e*e:.5*((e-=2)*e*e+2)},quarticIn:function(e){return e*e*e*e},quarticOut:function(e){return 1- --e*e*e*e},quarticInOut:function(e){return(e*=2)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2)},quinticIn:function(e){return e*e*e*e*e},quinticOut:function(e){return--e*e*e*e*e+1},quinticInOut:function(e){return(e*=2)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2)},sinusoidalIn:function(e){return 1-Math.cos(e*Math.PI/2)},sinusoidalOut:function(e){return Math.sin(e*Math.PI/2)},sinusoidalInOut:function(e){return .5*(1-Math.cos(Math.PI*e))},exponentialIn:function(e){return e===0?0:1024**(e-1)},exponentialOut:function(e){return e===1?1:1-2**(-10*e)},exponentialInOut:function(e){return e===0?0:e===1?1:(e*=2)<1?.5*1024**(e-1):.5*(-(2**(-10*(e-1)))+2)},circularIn:function(e){return 1-Math.sqrt(1-e*e)},circularOut:function(e){return Math.sqrt(1- --e*e)},circularInOut:function(e){return(e*=2)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1)},elasticIn:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),-(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)))},elasticOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),n*2**(-10*e)*Math.sin((e-t)*(2*Math.PI)/r)+1)},elasticInOut:function(e){var t,n=.1,r=.4;return e===0?0:e===1?1:(!n||n<1?(n=1,t=r/4):t=r*Math.asin(1/n)/(2*Math.PI),(e*=2)<1?-.5*(n*2**(10*--e)*Math.sin((e-t)*(2*Math.PI)/r)):n*2**(-10*--e)*Math.sin((e-t)*(2*Math.PI)/r)*.5+1)},backIn:function(e){var t=1.70158;return e*e*((t+1)*e-t)},backOut:function(e){var t=1.70158;return--e*e*((t+1)*e+t)+1},backInOut:function(e){var t=2.5949095;return(e*=2)<1?.5*(e*e*((t+1)*e-t)):.5*((e-=2)*e*((t+1)*e+t)+2)},bounceIn:function(e){return 1-yn.bounceOut(1-e)},bounceOut:function(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},bounceInOut:function(e){return e<.5?yn.bounceIn(e*2)*.5:yn.bounceOut(e*2-1)*.5+.5}},bn=Math.pow,xn=Math.sqrt,Sn=1e-8,Cn=1e-4,wn=xn(3),Tn=1/3,En=Me(),Dn=Me(),On=Me();function kn(e){return e>-Sn&&eSn||e<-Sn}function jn(e,t,n,r,i){var a=1-i;return a*a*(a*e+3*i*t)+i*i*(i*r+3*a*n)}function Mn(e,t,n,r,i){var a=1-i;return 3*(((t-e)*a+2*(n-t)*i)*a+(r-n)*i*i)}function Nn(e,t,n,r,i,a){var o=r+3*(t-n)-e,s=3*(n-t*2+e),c=3*(t-e),l=e-i,u=s*s-3*o*c,d=s*c-9*o*l,f=c*c-3*s*l,p=0;if(kn(u)&&kn(d)){if(kn(s))a[0]=0;else{var m=-c/s;m>=0&&m<=1&&(a[p++]=m)}}else{var h=d*d-4*u*f;if(kn(h)){var g=d/u,m=-s/o+g,_=-g/2;m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_)}else if(h>0){var v=xn(h),y=u*s+1.5*o*(-d+v),b=u*s+1.5*o*(-d-v);y=y<0?-bn(-y,Tn):bn(y,Tn),b=b<0?-bn(-b,Tn):bn(b,Tn);var m=(-s-(y+b))/(3*o);m>=0&&m<=1&&(a[p++]=m)}else{var x=(2*u*s-3*o*d)/(2*xn(u*u*u)),S=Math.acos(x)/3,C=xn(u),w=Math.cos(S),m=(-s-2*C*w)/(3*o),_=(-s+C*(w+wn*Math.sin(S)))/(3*o),T=(-s+C*(w-wn*Math.sin(S)))/(3*o);m>=0&&m<=1&&(a[p++]=m),_>=0&&_<=1&&(a[p++]=_),T>=0&&T<=1&&(a[p++]=T)}}return p}function Pn(e,t,n,r,i){var a=6*n-12*t+6*e,o=9*t+3*r-3*e-9*n,s=3*t-3*e,c=0;if(kn(o)){if(An(a)){var l=-s/a;l>=0&&l<=1&&(i[c++]=l)}}else{var u=a*a-4*o*s;if(kn(u))i[0]=-a/(2*o);else if(u>0){var d=xn(u),l=(-a+d)/(2*o),f=(-a-d)/(2*o);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Fn(e,t,n,r,i,a){var o=(t-e)*i+e,s=(n-t)*i+t,c=(r-n)*i+n,l=(s-o)*i+o,u=(c-s)*i+s,d=(u-l)*i+l;a[0]=e,a[1]=o,a[2]=l,a[3]=d,a[4]=d,a[5]=u,a[6]=c,a[7]=r}function In(e,t,n,r,i,a,o,s,c,l,u){var d,f=.005,p=1/0,m,h,g,_;En[0]=c,En[1]=l;for(var v=0;v<1;v+=.05)Dn[0]=jn(e,n,i,o,v),Dn[1]=jn(t,r,a,s,v),g=Ke(En,Dn),g=0&&g=0&&l<=1&&(i[c++]=l)}}else{var u=o*o-4*a*s;if(kn(u)){var l=-o/(2*a);l>=0&&l<=1&&(i[c++]=l)}else if(u>0){var d=xn(u),l=(-o+d)/(2*a),f=(-o-d)/(2*a);l>=0&&l<=1&&(i[c++]=l),f>=0&&f<=1&&(i[c++]=f)}}return c}function Vn(e,t,n){var r=e+n-2*t;return r===0?.5:(e-t)/r}function Hn(e,t,n,r,i){var a=(t-e)*r+e,o=(n-t)*r+t,s=(o-a)*r+a;i[0]=e,i[1]=a,i[2]=s,i[3]=s,i[4]=o,i[5]=n}function Un(e,t,n,r,i,a,o,s,c){var l,u=.005,d=1/0;En[0]=o,En[1]=s;for(var f=0;f<1;f+=.05){Dn[0]=Rn(e,n,i,f),Dn[1]=Rn(t,r,a,f);var p=Ke(En,Dn);p=0&&p=1?1:Nn(0,r,a,1,e,s)&&jn(0,i,o,1,s[0])}}}var qn=function(){function e(e){this._inited=!1,this._startTime=0,this._pausedTime=0,this._paused=!1,this._life=e.life||1e3,this._delay=e.delay||0,this.loop=e.loop||!1,this.onframe=e.onframe||Ae,this.ondestroy=e.ondestroy||Ae,this.onrestart=e.onrestart||Ae,e.easing&&this.setEasing(e.easing)}return e.prototype.step=function(e,t){if(this._inited||=(this._startTime=e+this._delay,!0),this._paused){this._pausedTime+=t;return}var n=this._life,r=e-this._startTime-this._pausedTime,i=r/n;i<0&&(i=0),i=Math.min(i,1);var a=this.easingFunc,o=a?a(i):i;if(this.onframe(o),i===1){if(this.loop){var s=r%n;this._startTime=e-s,this._pausedTime=0,this.onrestart()}else return!0}return!1},e.prototype.pause=function(){this._paused=!0},e.prototype.resume=function(){this._paused=!1},e.prototype.setEasing=function(e){this.easing=e,this.easingFunc=H(e)?e:yn[e]||Kn(e)},e}(),Jn=function(){function e(e){this.value=e}return e}(),Yn=function(){function e(){this._len=0}return e.prototype.insert=function(e){var t=new Jn(e);return this.insertEntry(t),t},e.prototype.insertEntry=function(e){this.head?(this.tail.next=e,e.prev=this.tail,e.next=null,this.tail=e):this.head=this.tail=e,this._len++},e.prototype.remove=function(e){var t=e.prev,n=e.next;t?t.next=n:this.head=n,n?n.prev=t:this.tail=t,e.next=e.prev=null,this._len--},e.prototype.len=function(){return this._len},e.prototype.clear=function(){this.head=this.tail=null,this._len=0},e}(),Xn=function(){function e(e){this._list=new Yn,this._maxSize=10,this._map={},this._maxSize=e}return e.prototype.put=function(e,t){var n=this._list,r=this._map,i=null;if(r[e]==null){var a=n.len(),o=this._lastRemovedEntry;if(a>=this._maxSize&&a>0){var s=n.head;n.remove(s),delete r[s.key],i=s.value,this._lastRemovedEntry=s}o?o.value=t:o=new Jn(t),o.key=e,n.insertEntry(o),r[e]=o}return i},e.prototype.get=function(e){var t=this._map[e],n=this._list;if(t!=null)return t!==n.tail&&(n.remove(t),n.insertEntry(t)),t.value},e.prototype.clear=function(){this._list.clear(),this._map={}},e.prototype.len=function(){return this._list.len()},e}(),Zn={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function Qn(e){return e=Math.round(e),e<0?0:e>255?255:e}function $n(e){return e=Math.round(e),e<0?0:e>360?360:e}function er(e){return e<0?0:e>1?1:e}function tr(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?Qn(parseFloat(t)/100*255):Qn(parseInt(t,10))}function nr(e){var t=e;return t.length&&t.charAt(t.length-1)===`%`?er(parseFloat(t)/100):er(parseFloat(t))}function rr(e,t,n){return n<0?n+=1:n>1&&--n,n*6<1?e+(t-e)*n*6:n*2<1?t:n*3<2?e+(t-e)*(2/3-n)*6:e}function ir(e,t,n){return e+(t-e)*n}function ar(e,t,n,r,i){return e[0]=t,e[1]=n,e[2]=r,e[3]=i,e}function or(e,t){return e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e}var sr=new Xn(20),cr=null;function lr(e,t){cr&&or(cr,t),cr=sr.put(e,cr||t.slice())}function ur(e,t){if(e){t||=[];var n=sr.get(e);if(n)return or(t,n);e+=``;var r=e.replace(/ /g,``).toLowerCase();if(r in Zn)return or(t,Zn[r]),lr(e,t),t;var i=r.length;if(r.charAt(0)===`#`){if(i===4||i===5){var a=parseInt(r.slice(1,4),16);if(!(a>=0&&a<=4095)){ar(t,0,0,0,1);return}return ar(t,(a&3840)>>4|(a&3840)>>8,a&240|(a&240)>>4,a&15|(a&15)<<4,i===5?parseInt(r.slice(4),16)/15:1),lr(e,t),t}if(i===7||i===9){var a=parseInt(r.slice(1,7),16);if(!(a>=0&&a<=16777215)){ar(t,0,0,0,1);return}return ar(t,(a&16711680)>>16,(a&65280)>>8,a&255,i===9?parseInt(r.slice(7),16)/255:1),lr(e,t),t}return}var o=r.indexOf(`(`),s=r.indexOf(`)`);if(o!==-1&&s+1===i){var c=r.substr(0,o),l=r.substr(o+1,s-(o+1)).split(`,`),u=1;switch(c){case`rgba`:if(l.length!==4)return l.length===3?ar(t,+l[0],+l[1],+l[2],1):ar(t,0,0,0,1);u=nr(l.pop());case`rgb`:if(l.length>=3)return ar(t,tr(l[0]),tr(l[1]),tr(l[2]),l.length===3?u:nr(l[3])),lr(e,t),t;ar(t,0,0,0,1);return;case`hsla`:if(l.length!==4){ar(t,0,0,0,1);return}return l[3]=nr(l[3]),dr(l,t),lr(e,t),t;case`hsl`:if(l.length!==3){ar(t,0,0,0,1);return}return dr(l,t),lr(e,t),t;default:return}}ar(t,0,0,0,1)}}function dr(e,t){var n=(parseFloat(e[0])%360+360)%360/360,r=nr(e[1]),i=nr(e[2]),a=i<=.5?i*(r+1):i+r-i*r,o=i*2-a;return t||=[],ar(t,Qn(rr(o,a,n+1/3)*255),Qn(rr(o,a,n)*255),Qn(rr(o,a,n-1/3)*255),1),e.length===4&&(t[3]=e[3]),t}function fr(e){if(e){var t=e[0]/255,n=e[1]/255,r=e[2]/255,i=Math.min(t,n,r),a=Math.max(t,n,r),o=a-i,s=(a+i)/2,c,l;if(o===0)c=0,l=0;else{l=s<.5?o/(a+i):o/(2-a-i);var u=((a-t)/6+o/2)/o,d=((a-n)/6+o/2)/o,f=((a-r)/6+o/2)/o;t===a?c=f-d:n===a?c=1/3+u-f:r===a&&(c=2/3+d-u),c<0&&(c+=1),c>1&&--c}var p=[c*360,l,s];return e[3]!=null&&p.push(e[3]),p}}function pr(e,t){var n=ur(e);if(n){for(var r=0;r<3;r++)t<0?n[r]=n[r]*(1-t)|0:n[r]=(255-n[r])*t+n[r]|0,n[r]>255?n[r]=255:n[r]<0&&(n[r]=0);return vr(n,n.length===4?`rgba`:`rgb`)}}function mr(e,t,n){if(!(!(t&&t.length)||!(e>=0&&e<=1))){n||=[];var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=t[i],s=t[a],c=r-i;return n[0]=Qn(ir(o[0],s[0],c)),n[1]=Qn(ir(o[1],s[1],c)),n[2]=Qn(ir(o[2],s[2],c)),n[3]=er(ir(o[3],s[3],c)),n}}function hr(e,t,n){if(!(!(t&&t.length)||!(e>=0&&e<=1))){var r=e*(t.length-1),i=Math.floor(r),a=Math.ceil(r),o=ur(t[i]),s=ur(t[a]),c=r-i,l=vr([Qn(ir(o[0],s[0],c)),Qn(ir(o[1],s[1],c)),Qn(ir(o[2],s[2],c)),er(ir(o[3],s[3],c))],`rgba`);return n?{color:l,leftIndex:i,rightIndex:a,value:r}:l}}function gr(e,t,n,r){var i=ur(e);if(e)return i=fr(i),t!=null&&(i[0]=$n(t)),n!=null&&(i[1]=nr(n)),r!=null&&(i[2]=nr(r)),vr(dr(i),`rgba`)}function _r(e,t){var n=ur(e);if(n&&t!=null)return n[3]=er(t),vr(n,`rgba`)}function vr(e,t){if(!(!e||!e.length)){var n=e[0]+`,`+e[1]+`,`+e[2];return(t===`rgba`||t===`hsva`||t===`hsla`)&&(n+=`,`+e[3]),t+`(`+n+`)`}}function yr(e,t){var n=ur(e);return n?(.299*n[0]+.587*n[1]+.114*n[2])*n[3]/255+(1-n[3])*t:0}var br=new Xn(100);function xr(e){if(U(e)){var t=br.get(e);return t||(t=pr(e,-.1),br.put(e,t)),t}if(ue(e)){var n=j({},e);return n.colorStops=I(e.colorStops,function(e){return{offset:e.offset,color:pr(e.color,-.1)}}),n}return e}var Sr=Math.round;function Cr(e){var t;if(!e||e===`transparent`)e=`none`;else if(typeof e==`string`&&e.indexOf(`rgba`)>-1){var n=ur(e);n&&(e=`rgb(`+n[0]+`,`+n[1]+`,`+n[2]+`)`,t=n[3])}return{color:e,opacity:t??1}}var wr=1e-4;function Tr(e){return e-wr}function Er(e){return Sr(e*1e3)/1e3}function Dr(e){return Sr(e*1e4)/1e4}function Or(e){return`matrix(`+Er(e[0])+`,`+Er(e[1])+`,`+Er(e[2])+`,`+Er(e[3])+`,`+Dr(e[4])+`,`+Dr(e[5])+`)`}var kr={left:`start`,right:`end`,center:`middle`,middle:`middle`};function Ar(e,t,n){return n===`top`?e+=t/2:n===`bottom`&&(e-=t/2),e}function jr(e){return e&&(e.shadowBlur||e.shadowOffsetX||e.shadowOffsetY)}function Mr(e){var t=e.style,n=e.getGlobalScale();return[t.shadowColor,(t.shadowBlur||0).toFixed(2),(t.shadowOffsetX||0).toFixed(2),(t.shadowOffsetY||0).toFixed(2),n[0],n[1]].join(`,`)}function Nr(e){return e&&!!e.image}function Pr(e){return e&&!!e.svgElement}function Fr(e){return Nr(e)||Pr(e)}function Ir(e){return e.type===`linear`}function Lr(e){return e.type===`radial`}function Rr(e){return e&&(e.type===`linear`||e.type===`radial`)}function zr(e){return`url(#`+e+`)`}function Br(e){var t=e.getGlobalScale(),n=Math.max(t[0],t[1]);return Math.max(Math.ceil(Math.log(n)/Math.log(10)),1)}function Vr(e){var t=e.x||0,n=e.y||0,r=(e.rotation||0)*je,i=G(e.scaleX,1),a=G(e.scaleY,1),o=e.skewX||0,s=e.skewY||0,c=[];return(t||n)&&c.push(`translate(`+t+`px,`+n+`px)`),r&&c.push(`rotate(`+r+`)`),(i!==1||a!==1)&&c.push(`scale(`+i+`,`+a+`)`),(o||s)&&c.push(`skew(`+Sr(o*je)+`deg, `+Sr(s*je)+`deg)`),c.join(` `)}var Hr=(function(){return a.hasGlobalWindow&&H(window.btoa)?function(e){return window.btoa(unescape(encodeURIComponent(e)))}:typeof Buffer<`u`?function(e){return Buffer.from(e).toString(`base64`)}:function(e){return null}})(),Ur=Array.prototype.slice;function Wr(e,t,n){return(t-e)*n+e}function Gr(e,t,n,r){for(var i=t.length,a=0;ar?t:e,a=Math.min(n,r),o=i[a-1]||{color:[0,0,0,0],offset:0},s=a;so)r.length=o;else for(var s=a;s=1},e.prototype.getAdditiveTrack=function(){return this._additiveTrack},e.prototype.addKeyframe=function(e,t,n){this._needsSort=!0;var r=this.keyframes,i=r.length,a=!1,o=oi,s=t;if(te(t)){var c=$r(t);o=c,(c===1&&!oe(t[0])||c===2&&!oe(t[0][0]))&&(a=!0)}else if(oe(t)&&!pe(t))o=ei;else if(U(t)){if(!isNaN(+t))o=ei;else{var l=ur(t);l&&(s=l,o=ri)}}else if(ue(t)){var u=j({},s);u.colorStops=I(t.colorStops,function(e){return{offset:e.offset,color:ur(e.color)}}),Ir(t)?o=ii:Lr(t)&&(o=ai),s=u}i===0?this.valType=o:(o!==this.valType||o===oi)&&(a=!0),this.discrete=this.discrete||a;var d={time:e,value:s,rawValue:t,percent:0};return n&&(d.easing=n,d.easingFunc=H(n)?n:yn[n]||Kn(n)),r.push(d),d},e.prototype.prepare=function(e,t){var n=this.keyframes;this._needsSort&&n.sort(function(e,t){return e.time-t.time});for(var r=this.valType,i=n.length,a=n[i-1],o=this.discrete,s=ci(r),c=si(r),l=0;l=0&&!(a[l].percent<=t);l--);l=d(l,o-2)}else{for(l=u;lt);l++);l=d(l-1,o-2)}p=a[l+1],f=a[l]}if(f&&p){this._lastFr=l,this._lastFrP=t;var m=p.percent-f.percent,h=m===0?1:d((t-f.percent)/m,1);p.easingFunc&&(h=p.easingFunc(h));var g=n?this._additiveValue:c?li:e[s];if((ci(i)||c)&&!g&&(g=this._additiveValue=[]),this.discrete)e[s]=h<1?f.rawValue:p.rawValue;else if(ci(i))i===ti?Gr(g,f[r],p[r],h):Kr(g,f[r],p[r],h);else if(si(i)){var _=f[r],v=p[r],y=i===ii;e[s]={type:y?`linear`:`radial`,x:Wr(_.x,v.x,h),y:Wr(_.y,v.y,h),colorStops:I(_.colorStops,function(e,t){var n=v.colorStops[t];return{offset:Wr(e.offset,n.offset,h),color:Qr(Gr([],e.color,n.color,h))}}),global:v.global},y?(e[s].x2=Wr(_.x2,v.x2,h),e[s].y2=Wr(_.y2,v.y2,h)):e[s].r=Wr(_.r,v.r,h)}else if(c)Gr(g,f[r],p[r],h),n||(e[s]=Qr(g));else{var b=Wr(f[r],p[r],h);n?this._additiveValue=b:e[s]=b}n&&this._addToTarget(e)}}},e.prototype._addToTarget=function(e){var t=this.valType,n=this.propName,r=this._additiveValue;t===ei?e[n]=e[n]+r:t===ri?(ur(e[n],li),qr(li,li,r,1),e[n]=Qr(li)):t===ti?qr(e[n],e[n],r,1):t===ni&&Jr(e[n],e[n],r,1)},e}(),di=function(){function e(e,t,n,r){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&r){D(`Can' use additive animation on looped animation.`);return}this._additiveAnimators=r,this._allowDiscrete=n}return e.prototype.getMaxTime=function(){return this._maxTime},e.prototype.getDelay=function(){return this._delay},e.prototype.getLoop=function(){return this._loop},e.prototype.getTarget=function(){return this._target},e.prototype.changeTarget=function(e){this._target=e},e.prototype.when=function(e,t,n){return this.whenWithKeys(e,t,R(t),n)},e.prototype.whenWithKeys=function(e,t,n,r){for(var i=this._tracks,a=0;a0&&s.addKeyframe(0,Zr(c),r),this._trackKeys.push(o)}s.addKeyframe(e,Zr(t[o]),r)}return this._maxTime=Math.max(this._maxTime,e),this},e.prototype.pause=function(){this._clip.pause(),this._paused=!0},e.prototype.resume=function(){this._clip.resume(),this._paused=!1},e.prototype.isPaused=function(){return!!this._paused},e.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},e.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,n=0;n0)){this._started=1;for(var t=this,n=[],r=this._maxTime||0,i=0;i1){var o=a.pop();i.addKeyframe(o.time,e[r]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},e}();function fi(){return new Date().getTime()}var pi=function(e){r(t,e);function t(t){var n=e.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,t||={},n.stage=t.stage||{},n}return t.prototype.addClip=function(e){e.animation&&this.removeClip(e),this._head?(this._tail.next=e,e.prev=this._tail,e.next=null,this._tail=e):this._head=this._tail=e,e.animation=this},t.prototype.addAnimator=function(e){e.animation=this;var t=e.getClip();t&&this.addClip(t)},t.prototype.removeClip=function(e){if(e.animation){var t=e.prev,n=e.next;t?t.next=n:this._head=n,n?n.prev=t:this._tail=t,e.next=e.prev=e.animation=null}},t.prototype.removeAnimator=function(e){var t=e.getClip();t&&this.removeClip(t),e.animation=null},t.prototype.update=function(e){for(var t=fi()-this._pausedTime,n=t-this._time,r=this._head;r;){var i=r.next;r.step(t,n)?(r.ondestroy(),this.removeClip(r),r=i):r=i}this._time=t,e||(this.trigger(`frame`,n),this.stage.update&&this.stage.update())},t.prototype._startLoop=function(){var e=this;this._running=!0;function t(){e._running&&(vn(t),!e._paused&&e.update())}vn(t)},t.prototype.start=function(){this._running||(this._time=fi(),this._pausedTime=0,this._startLoop())},t.prototype.stop=function(){this._running=!1},t.prototype.pause=function(){this._paused||=(this._pauseStart=fi(),!0)},t.prototype.resume=function(){this._paused&&=(this._pausedTime+=fi()-this._pauseStart,!1)},t.prototype.clear=function(){for(var e=this._head;e;){var t=e.next;e.prev=e.next=e.animation=null,e=t}this._head=this._tail=null},t.prototype.isFinished=function(){return this._head==null},t.prototype.animate=function(e,t){t||={},this.start();var n=new di(e,t.loop);return this.addAnimator(n),n},t}($e),mi=300,hi=a.domSupported,gi=(function(){var e=[`click`,`dblclick`,`mousewheel`,`wheel`,`mouseout`,`mouseup`,`mousedown`,`mousemove`,`contextmenu`],t=[`touchstart`,`touchend`,`touchmove`],n={pointerdown:1,pointerup:1,pointermove:1,pointerout:1};return{mouse:e,touch:t,pointer:I(e,function(e){var t=e.replace(`mouse`,`pointer`);return n.hasOwnProperty(t)?t:e})}})(),_i={mouse:[`mousemove`,`mouseup`],pointer:[`pointermove`,`pointerup`]},vi=!1;function yi(e){var t=e.pointerType;return t===`pen`||t===`touch`}function bi(e){e.touching=!0,e.touchTimer!=null&&(clearTimeout(e.touchTimer),e.touchTimer=null),e.touchTimer=setTimeout(function(){e.touching=!1,e.touchTimer=null},700)}function xi(e){e&&(e.zrByTouch=!0)}function Si(e,t){return yt(e.dom,new wi(e,t),!0)}function Ci(e,t){for(var n=t,r=!1;n&&n.nodeType!==9&&!(r=n.domBelongToZr||n!==t&&n===e.painterRoot);)n=n.parentNode;return r}var wi=function(){function e(e,t){this.stopPropagation=Ae,this.stopImmediatePropagation=Ae,this.preventDefault=Ae,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return e}(),Ti={mousedown:function(e){e=yt(this.dom,e),this.__mayPointerCapture=[e.zrX,e.zrY],this.trigger(`mousedown`,e)},mousemove:function(e){e=yt(this.dom,e);var t=this.__mayPointerCapture;t&&(e.zrX!==t[0]||e.zrY!==t[1])&&this.__togglePointerCapture(!0),this.trigger(`mousemove`,e)},mouseup:function(e){e=yt(this.dom,e),this.__togglePointerCapture(!1),this.trigger(`mouseup`,e)},mouseout:function(e){e=yt(this.dom,e);var t=e.toElement||e.relatedTarget;Ci(this,t)||(this.__pointerCapturing&&(e.zrEventControl=`no_globalout`),this.trigger(`mouseout`,e))},wheel:function(e){vi=!0,e=yt(this.dom,e),this.trigger(`mousewheel`,e)},mousewheel:function(e){vi||(e=yt(this.dom,e),this.trigger(`mousewheel`,e))},touchstart:function(e){e=yt(this.dom,e),xi(e),this.__lastTouchMoment=new Date,this.handler.processGesture(e,`start`),Ti.mousemove.call(this,e),Ti.mousedown.call(this,e)},touchmove:function(e){e=yt(this.dom,e),xi(e),this.handler.processGesture(e,`change`),Ti.mousemove.call(this,e)},touchend:function(e){e=yt(this.dom,e),xi(e),this.handler.processGesture(e,`end`),Ti.mouseup.call(this,e),new Date-+this.__lastTouchMomentBi||e<-Bi}var Hi=[],Ui=[],Wi=kt(),Gi=Math.abs,Ki=function(){function e(){}return e.prototype.getLocalTransform=function(t){return e.getLocalTransform(this,t)},e.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},e.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},e.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},e.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},e.prototype.needLocalTransform=function(){return Vi(this.rotation)||Vi(this.x)||Vi(this.y)||Vi(this.scaleX-1)||Vi(this.scaleY-1)||Vi(this.skewX)||Vi(this.skewY)},e.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),n=this.transform;if(!(t||e)){n&&(zi(n),this.invTransform=null);return}n||=kt(),t?this.getLocalTransform(n):zi(n),e&&(t?Mt(n,e,n):jt(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},e.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Hi);var n=Hi[0]<0?-1:1,r=Hi[1]<0?-1:1,i=((Hi[0]-n)*t+n)/Hi[0]||0,a=((Hi[1]-r)*t+r)/Hi[1]||0;e[0]*=i,e[1]*=i,e[2]*=a,e[3]*=a}this.invTransform=this.invTransform||kt(),It(this.invTransform,e)},e.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},e.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],r=Math.atan2(e[1],e[0]),i=Math.PI/2+r-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),t=Math.sqrt(t),this.skewX=i,this.skewY=0,this.rotation=-r,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=n,this.originX=0,this.originY=0}},e.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||kt(),Mt(Ui,e.invTransform,t),t=Ui);var n=this.originX,r=this.originY;(n||r)&&(Wi[4]=n,Wi[5]=r,Mt(Ui,t,Wi),Ui[4]-=n,Ui[5]-=r,t=Ui),this.setLocalTransform(t)}},e.prototype.getGlobalScale=function(e){var t=this.transform;return e||=[],t?(e[0]=Math.sqrt(t[0]*t[0]+t[1]*t[1]),e[1]=Math.sqrt(t[2]*t[2]+t[3]*t[3]),t[0]<0&&(e[0]=-e[0]),t[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},e.prototype.transformCoordToLocal=function(e,t){var n=[e,t],r=this.invTransform;return r&&Je(n,n,r),n},e.prototype.transformCoordToGlobal=function(e,t){var n=[e,t],r=this.transform;return r&&Je(n,n,r),n},e.prototype.getLineScale=function(){var e=this.transform;return e&&Gi(e[0]-1)>1e-10&&Gi(e[3]-1)>1e-10?Math.sqrt(Gi(e[0]*e[3]-e[2]*e[1])):1},e.prototype.copyTransform=function(e){Ji(this,e)},e.getLocalTransform=function(e,t){t||=[];var n=e.originX||0,r=e.originY||0,i=e.scaleX,a=e.scaleY,o=e.anchorX,s=e.anchorY,c=e.rotation||0,l=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(n||r||o||s){var p=n+o,m=r+s;t[4]=-p*i-d*m*a,t[5]=-m*a-f*p*i}else t[4]=t[5]=0;return t[0]=i,t[3]=a,t[1]=f*i,t[2]=d*a,c&&Pt(t,t,c),t[4]+=n+l,t[5]+=r+u,t},e.initDefaultProps=(function(){var t=e.prototype;t.scaleX=t.scaleY=t.globalScaleRatio=1,t.x=t.y=t.originX=t.originY=t.skewX=t.skewY=t.rotation=t.anchorX=t.anchorY=0})(),e}(),qi=[`x`,`y`,`originX`,`originY`,`anchorX`,`anchorY`,`rotation`,`scaleX`,`scaleY`,`skewX`,`skewY`];function Ji(e,t){for(var n=0;n=0?parseFloat(e)/100*t:parseFloat(e):e}function ra(e,t,n){var r=t.position||`inside`,i=t.distance==null?5:t.distance,a=n.height,o=n.width,s=a/2,c=n.x,l=n.y,u=`left`,d=`top`;if(r instanceof Array)c+=na(r[0],n.width),l+=na(r[1],n.height),u=null,d=null;else switch(r){case`left`:c-=i,l+=s,u=`right`,d=`middle`;break;case`right`:c+=i+o,l+=s,d=`middle`;break;case`top`:c+=o/2,l-=i,u=`center`,d=`bottom`;break;case`bottom`:c+=o/2,l+=a+i,u=`center`;break;case`inside`:c+=o/2,l+=s,u=`center`,d=`middle`;break;case`insideLeft`:c+=i,l+=s,d=`middle`;break;case`insideRight`:c+=o-i,l+=s,u=`right`,d=`middle`;break;case`insideTop`:c+=o/2,l+=i,u=`center`;break;case`insideBottom`:c+=o/2,l+=a-i,u=`center`,d=`bottom`;break;case`insideTopLeft`:c+=i,l+=i;break;case`insideTopRight`:c+=o-i,l+=i,u=`right`;break;case`insideBottomLeft`:c+=i,l+=a-i,d=`bottom`;break;case`insideBottomRight`:c+=o-i,l+=a-i,u=`right`,d=`bottom`}return e||={},e.x=c,e.y=l,e.align=u,e.verticalAlign=d,e}var ia=`__zr_normal__`,aa=qi.concat([`ignore`]),oa=ne(qi,function(e,t){return e[t]=!0,e},{ignore:!1}),sa={},ca=new Y(0,0,0,0),la=function(){function e(e){this.id=E(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return e.prototype._init=function(e){this.attr(e)},e.prototype.drift=function(e,t,n){switch(this.draggable){case`horizontal`:t=0;break;case`vertical`:e=0}var r=this.transform;r||=this.transform=[1,0,0,1,0,0],r[4]+=e,r[5]+=t,this.decomposeTransform(),this.markRedraw()},e.prototype.beforeUpdate=function(){},e.prototype.afterUpdate=function(){},e.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},e.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||={};var n=this.textConfig,r=n.local,i=t.innerTransformable,a=void 0,o=void 0,s=!1;i.parent=r?this:null;var c=!1;if(i.copyTransform(t),n.position!=null){var l=ca;n.layoutRect?l.copy(n.layoutRect):l.copy(this.getBoundingRect()),r||l.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(sa,n,l):ra(sa,n,l),i.x=sa.x,i.y=sa.y,a=sa.align,o=sa.verticalAlign;var u=n.origin;if(u&&n.rotation!=null){var d=void 0,f=void 0;u===`center`?(d=l.width*.5,f=l.height*.5):(d=na(u[0],l.width),f=na(u[1],l.height)),c=!0,i.originX=-i.x+d+(r?0:l.x),i.originY=-i.y+f+(r?0:l.y)}}n.rotation!=null&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],c||(i.originX=-p[0],i.originY=-p[1]));var m=n.inside==null?typeof n.position==`string`&&n.position.indexOf(`inside`)>=0:n.inside,h=this._innerTextDefaultStyle||={},g=void 0,_=void 0,v=void 0;m&&this.canBeInsideText()?(g=n.insideFill,_=n.insideStroke,(g==null||g===`auto`)&&(g=this.getInsideTextFill()),(_==null||_===`auto`)&&(_=this.getInsideTextStroke(g),v=!0)):(g=n.outsideFill,_=n.outsideStroke,(g==null||g===`auto`)&&(g=this.getOutsideFill()),(_==null||_===`auto`)&&(_=this.getOutsideStroke(g),v=!0)),g||=`#000`,(g!==h.fill||_!==h.stroke||v!==h.autoStroke||a!==h.align||o!==h.verticalAlign)&&(s=!0,h.fill=g,h.stroke=_,h.autoStroke=v,h.align=a,h.verticalAlign=o,t.setDefaultTextStyle(h)),t.__dirty|=1,s&&t.dirtyStyle(!0)}},e.prototype.canBeInsideText=function(){return!0},e.prototype.getInsideTextFill=function(){return`#fff`},e.prototype.getInsideTextStroke=function(e){return`#000`},e.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Li:Ii},e.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),n=typeof t==`string`&&ur(t);n||=[255,255,255,1];for(var r=n[3],i=this.__zr.isDarkMode(),a=0;a<3;a++)n[a]=n[a]*r+(i?0:255)*(1-r);return n[3]=1,vr(n,`rgba`)},e.prototype.traverse=function(e,t){},e.prototype.attrKV=function(e,t){e===`textConfig`?this.setTextConfig(t):e===`textContent`?this.setTextContent(t):e===`clipPath`?this.setClipPath(t):e===`extra`?(this.extra=this.extra||{},j(this.extra,t)):this[e]=t},e.prototype.hide=function(){this.ignore=!0,this.markRedraw()},e.prototype.show=function(){this.ignore=!1,this.markRedraw()},e.prototype.attr=function(e,t){if(typeof e==`string`)this.attrKV(e,t);else if(W(e))for(var n=R(e),r=0;r0},e.prototype.getState=function(e){return this.states[e]},e.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},e.prototype.clearStates=function(e){this.useState(ia,!1,e)},e.prototype.useState=function(e,t,n,r){var i=e===ia;if(!(!this.hasState()&&i)){var a=this.currentStates,o=this.stateTransition;if(!(N(a,e)>=0&&(t||a.length===1))){var s;if(this.stateProxy&&!i&&(s=this.stateProxy(e)),s||=this.states&&this.states[e],!s&&!i){D(`State `+e+` not exists.`);return}i||this.saveCurrentToNormalState(s);var c=!!(s&&s.hoverLayer||r);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,s,this._normalState,t,!n&&!this.__inHover&&o&&o.duration>0,o);var l=this._textContent,u=this._textGuide;return l&&l.useState(e,t,n,c),u&&u.useState(e,t,n,c),i?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2),s}}},e.prototype.useStates=function(e,t,n){if(!e.length)this.clearStates();else{var r=[],i=this.currentStates,a=e.length,o=a===i.length;if(o){for(var s=0;s0,p);var m=this._textContent,h=this._textGuide;m&&m.useStates(e,t,d),h&&h.useStates(e,t,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=-2)}},e.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},e.prototype._updateAnimationTargets=function(){for(var e=0;e=0){var n=this.currentStates.slice();n.splice(t,1),this.useStates(n)}},e.prototype.replaceState=function(e,t,n){var r=this.currentStates.slice(),i=N(r,e),a=N(r,t)>=0;i>=0?a?r.splice(i,1):r[i]=t:n&&!a&&r.push(t),this.useStates(r)},e.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},e.prototype._mergeStates=function(e){for(var t={},n,r=0;r=0&&t.splice(n,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},e.prototype.updateDuringAnimation=function(e){this.markRedraw()},e.prototype.stopAnimation=function(e,t){for(var n=this.animators,r=n.length,i=[],a=0;a0&&n.during&&a[0].during(function(e,t){n.during(t)});for(var f=0;f0||i.force&&!o.length){var C=void 0,w=void 0,T=void 0;if(s){w={},f&&(C={});for(var b=0;b=0&&(n.splice(r,0,e),this._doAdd(e))}return this},t.prototype.replace=function(e,t){var n=N(this._children,e);return n>=0&&this.replaceAt(t,n),this},t.prototype.replaceAt=function(e,t){var n=this._children,r=n[t];if(e&&e!==this&&e.parent!==this&&e!==r){n[t]=e,r.parent=null;var i=this.__zr;i&&r.removeSelfFromZr(i),this._doAdd(e)}return this},t.prototype._doAdd=function(e){e.parent&&e.parent.remove(e),e.parent=this;var t=this.__zr;t&&t!==e.__zr&&e.addSelfToZr(t),t&&t.refresh()},t.prototype.remove=function(e){var t=this.__zr,n=this._children,r=N(n,e);return r<0?this:(n.splice(r,1),e.parent=null,t&&e.removeSelfFromZr(t),t&&t.refresh(),this)},t.prototype.removeAll=function(){for(var e=this._children,t=this.__zr,n=0;n0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},e.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},e.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},e.prototype.refreshHover=function(){this._needsRefreshHover=!0},e.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()===`canvas`&&this.painter.refreshHover())},e.prototype.resize=function(e){this._disposed||(e||={},this.painter.resize(e.width,e.height),this.handler.resize())},e.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},e.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},e.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},e.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},e.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},e.prototype.on=function(e,t,n){return this._disposed||this.handler.on(e,t,n),this},e.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},e.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},e.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t0){if(e<=i)return o;if(e>=a)return s}else if(e>=i)return o;else if(e<=a)return s}else{if(e===i)return o;if(e===a)return s}return(e-i)/c*l+o}function Z(e,t){switch(e){case`center`:case`middle`:e=`50%`;break;case`left`:case`top`:e=`0%`;break;case`right`:case`bottom`:e=`100%`}return U(e)?ka(e).match(/%$/)?parseFloat(e)/100*t:parseFloat(e):e==null?NaN:+e}function ja(e,t,n){return t??=10,t=Math.min(Math.max(0,t),Oa),e=(+e).toFixed(t),n?e:+e}function Ma(e){return e.sort(function(e,t){return e-t}),e}function Na(e){if(e=+e,isNaN(e))return 0;if(e>1e-14){for(var t=1,n=0;n<15;n++,t*=10)if(Math.round(e*t)/t===e)return n}return Pa(e)}function Pa(e){var t=e.toString().toLowerCase(),n=t.indexOf(`e`),r=n>0?+t.slice(n+1):0,i=n>0?n:t.length,a=t.indexOf(`.`),o=a<0?0:i-1-a;return Math.max(0,o-r)}function Fa(e,t){var n=Math.log,r=Math.LN10,i=Math.floor(n(e[1]-e[0])/r),a=Math.round(n(Math.abs(t[1]-t[0]))/r),o=Math.min(Math.max(-i+a,0),20);return isFinite(o)?o:20}function Ia(e,t){var n=ne(e,function(e,t){return e+(isNaN(t)?0:t)},0);if(n===0)return[];for(var r=10**t,i=I(e,function(e){return(isNaN(e)?0:e)/n*r*100}),a=r*100,o=I(i,function(e){return Math.floor(e)}),s=ne(o,function(e,t){return e+t},0),c=I(i,function(e,t){return e-o[t]});sl&&(l=c[d],u=d);++o[u],c[u]=0,++s}return I(o,function(e){return e/r})}function La(e,t){var n=Math.max(Na(e),Na(t)),r=e+t;return n>Oa?r:ja(r,n)}function Ra(e){var t=Math.PI*2;return(e%t+t)%t}function za(e){return e>-Da&&e=10&&t++,t}function Wa(e,t){var n=Ua(e),r=10**n,i=e/r;return e=(t?i<1.5?1:i<2.5?2:i<4?3:i<7?5:10:i<1?1:i<2?2:i<3?3:i<5?5:10)*r,n>=-20?+e.toFixed(n<0?-n:0):e}function Ga(e,t){var n=(e.length-1)*t+1,r=Math.floor(n),i=+e[r-1],a=n-r;return a?i+a*(e[r]-i):i}function Ka(e){e.sort(function(e,t){return s(e,t,0)?-1:1});for(var t=-1/0,n=1,r=0;r=0||i&&N(i,s)<0)){var c=n.getShallow(s,t);c!=null&&(a[e[o][0]]=c)}}return a}}var Qo=Zo([[`fill`,`color`],[`shadowBlur`],[`shadowOffsetX`],[`shadowOffsetY`],[`opacity`],[`shadowColor`]]),$o=function(){function e(){}return e.prototype.getAreaStyle=function(e,t){return Qo(this,e,t)},e}(),es=new Xn(50);function ts(e){if(typeof e==`string`){var t=es.get(e);return t&&t.image}return e}function ns(e,t,n,r,i){if(!e)return t;if(typeof e==`string`){if(t&&t.__zrImageSrc===e||!n)return t;var a=es.get(e),o={hostEl:n,cb:r,cbPayload:i};return a?(t=a.image,!is(t)&&a.pending.push(o)):(t=p.loadImage(e,rs,rs),t.__zrImageSrc=e,es.put(e,t.__cachedImgObj={image:t,pending:[o]})),t}return e}function rs(){var e=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var t=0;t=o;c++)s-=o;var l=Xi(n,t);return l>s&&(n=``,l=0),s=e-l,i.ellipsis=n,i.ellipsisWidth=l,i.contentWidth=s,i.containerWidth=e,i}function cs(e,t,n){var r=n.containerWidth,i=n.font,a=n.contentWidth;if(!r){e.textLine=``,e.isTruncated=!1;return}var o=Xi(t,i);if(o<=r){e.textLine=t,e.isTruncated=!1;return}for(var s=0;;s++){if(o<=a||s>=n.maxIterations){t+=n.ellipsis;break}var c=s===0?ls(t,a,n.ascCharWidth,n.cnCharWidth):o>0?Math.floor(t.length*a/o):0;t=t.substr(0,c),o=Xi(t,i)}t===``&&(t=n.placeholder),e.textLine=t,e.isTruncated=!0}function ls(e,t,n,r){for(var i=0,a=0,o=e.length;am&&l){var h=Math.floor(m/s);u||=f.length>h,f=f.slice(0,h)}if(e&&a&&d!=null)for(var g=ss(d,i,t.ellipsis,{minChar:t.truncateMinChar,placeholder:t.placeholder}),_={},v=0;vs&&hs(n,e.substring(s,l),t,o),hs(n,c[2],t,o,c[1]),s=as.lastIndex}si){var k=n.lines.length;S>0?(y.tokens=y.tokens.slice(0,S),_(y,x,b),n.lines=n.lines.slice(0,v+1)):n.lines=n.lines.slice(0,v),n.isTruncated=n.isTruncated||n.lines.length0&&m+r.accumWidth>r.width&&(u=t.split(` +`),l=!0),r.accumWidth=m}else{var h=ys(t,c,r.width,r.breakAll,r.accumWidth);r.accumWidth=h.accumWidth+p,d=h.linesWidths,u=h.lines}}else u=t.split(` +`);for(var g=0;g=32&&t<=591||t>=880&&t<=4351||t>=4608&&t<=5119||t>=7680&&t<=8303}var _s=ne(`,&?/;] `.split(``),function(e,t){return e[t]=!0,e},{});function vs(e){return!gs(e)||!!_s[e]}function ys(e,t,n,r,i){for(var a=[],o=[],s=``,c=``,l=0,u=0,d=0;dn:i+u+p>n){u?(s||c)&&(m?(s||(s=c,c=``,l=0,u=l),a.push(s),o.push(u-l),c+=f,l+=p,s=``,u=l):(c&&(s+=c,c=``,l=0),a.push(s),o.push(u),s=f,u=p)):m?(a.push(c),o.push(l),c=f,l=p):(a.push(f),o.push(p));continue}u+=p,m?(c+=f,l+=p):(c&&(s+=c,c=``,l=0),s+=f)}return!a.length&&!s&&(s=e,c=``,l=0),c&&(s+=c),s&&(a.push(s),o.push(u)),a.length===1&&(u+=i),{accumWidth:u,lines:a,linesWidths:o}}var bs=`__zr_style_`+Math.round(Math.random()*10),xs={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:`#000`,opacity:1,blend:`source-over`},Ss={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};xs[bs]=!0;var Cs=[`z`,`z2`,`invisible`],ws=[`invisible`],Ts=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype._init=function(t){for(var n=R(t),r=0;r1e-4){s[0]=e-n,s[1]=t-r,c[0]=e+n,c[1]=t+r;return}if(Ps[0]=Ms(i)*n+e,Ps[1]=js(i)*r+t,Fs[0]=Ms(a)*n+e,Fs[1]=js(a)*r+t,l(s,Ps,Fs),u(c,Ps,Fs),i%=Ns,i<0&&(i+=Ns),a%=Ns,a<0&&(a+=Ns),i>a&&!o?a+=Ns:ii&&(Is[0]=Ms(p)*n+e,Is[1]=js(p)*r+t,l(s,Is,s),u(c,Is,c))}var Ws={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Gs=[],Ks=[],qs=[],Js=[],Ys=[],Xs=[],Zs=Math.min,Qs=Math.max,$s=Math.cos,ec=Math.sin,tc=Math.abs,nc=Math.PI,rc=nc*2,ic=typeof Float32Array<`u`,ac=[];function oc(e){return Math.round(e/nc*1e8)/1e8%2*nc}function sc(e,t){var n=oc(e[0]);n<0&&(n+=rc);var r=n-e[0],i=e[1];i+=r,!t&&i-n>=rc?i=n+rc:t&&n-i>=rc?i=n-rc:!t&&n>i?i=n+(rc-oc(n-i)):t&&n0&&(this._ux=tc(n/Pi/e)||0,this._uy=tc(n/Pi/t)||0)},e.prototype.setDPR=function(e){this.dpr=e},e.prototype.setContext=function(e){this._ctx=e},e.prototype.getContext=function(){return this._ctx},e.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},e.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},e.prototype.moveTo=function(e,t){return this._drawPendingPt(),this.addData(Ws.M,e,t),this._ctx&&this._ctx.moveTo(e,t),this._x0=e,this._y0=t,this._xi=e,this._yi=t,this},e.prototype.lineTo=function(e,t){var n=tc(e-this._xi),r=tc(t-this._yi),i=n>this._ux||r>this._uy;if(this.addData(Ws.L,e,t),this._ctx&&i&&this._ctx.lineTo(e,t),i)this._xi=e,this._yi=t,this._pendingPtDist=0;else{var a=n*n+r*r;a>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=t,this._pendingPtDist=a)}return this},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){return this._drawPendingPt(),this.addData(Ws.C,e,t,n,r,i,a),this._ctx&&this._ctx.bezierCurveTo(e,t,n,r,i,a),this._xi=i,this._yi=a,this},e.prototype.quadraticCurveTo=function(e,t,n,r){return this._drawPendingPt(),this.addData(Ws.Q,e,t,n,r),this._ctx&&this._ctx.quadraticCurveTo(e,t,n,r),this._xi=n,this._yi=r,this},e.prototype.arc=function(e,t,n,r,i,a){this._drawPendingPt(),ac[0]=r,ac[1]=i,sc(ac,a),r=ac[0],i=ac[1];var o=i-r;return this.addData(Ws.A,e,t,n,n,r,o,0,+!a),this._ctx&&this._ctx.arc(e,t,n,r,i,a),this._xi=$s(i)*n+e,this._yi=ec(i)*n+t,this},e.prototype.arcTo=function(e,t,n,r,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,t,n,r,i),this},e.prototype.rect=function(e,t,n,r){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,t,n,r),this.addData(Ws.R,e,t,n,r),this},e.prototype.closePath=function(){this._drawPendingPt(),this.addData(Ws.Z);var e=this._ctx,t=this._x0,n=this._y0;return e&&e.closePath(),this._xi=t,this._yi=n,this},e.prototype.fill=function(e){e&&e.fill(),this.toStatic()},e.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},e.prototype.len=function(){return this._len},e.prototype.setData=function(e){var t=e.length;!(this.data&&this.data.length===t)&&ic&&(this.data=new Float32Array(t));for(var n=0;nl.length&&(this._expandData(),l=this.data);for(var u=0;u0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},e.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],t=0;t11&&(this.data=new Float32Array(e)))}},e.prototype.getBoundingRect=function(){qs[0]=qs[1]=Ys[0]=Ys[1]=Number.MAX_VALUE,Js[0]=Js[1]=Xs[0]=Xs[1]=-Number.MAX_VALUE;var e=this.data,t=0,n=0,r=0,i=0,a;for(a=0;an||tc(v)>r||d===t-1)&&(m=Math.sqrt(_*_+v*v),i=h,a=g);break;case Ws.C:var y=e[d++],b=e[d++],h=e[d++],g=e[d++],x=e[d++],S=e[d++];m=Ln(i,a,y,b,h,g,x,S,10),i=x,a=S;break;case Ws.Q:var y=e[d++],b=e[d++],h=e[d++],g=e[d++];m=Wn(i,a,y,b,h,g,10),i=h,a=g;break;case Ws.A:var C=e[d++],w=e[d++],T=e[d++],E=e[d++],D=e[d++],O=e[d++],k=O+D;d+=1,p&&(o=$s(D)*T+C,s=ec(D)*E+w),m=Qs(T,E)*Zs(rc,Math.abs(O)),i=$s(k)*T+C,a=ec(k)*E+w;break;case Ws.R:o=i=e[d++],s=a=e[d++];var A=e[d++],j=e[d++];m=A*2+j*2;break;case Ws.Z:var _=o-i,v=s-a;m=Math.sqrt(_*_+v*v),i=o,a=s}m>=0&&(c[u++]=m,l+=m)}return this._pathLen=l,l},e.prototype.rebuildPath=function(e,t){var n=this.data,r=this._ux,i=this._uy,a=this._len,o,s,c,l,u,d,f=t<1,p,m,h=0,g=0,_,v=0,y,b;if(!(f&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,_=t*m,!_)))lo:for(var x=0;x0&&(e.lineTo(y,b),v=0),S){case Ws.M:o=c=n[x++],s=l=n[x++],e.moveTo(c,l);break;case Ws.L:u=n[x++],d=n[x++];var w=tc(u-c),T=tc(d-l);if(w>r||T>i){if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+u*D,l*(1-D)+d*D);break lo}h+=E}e.lineTo(u,d),c=u,l=d,v=0}else{var O=w*w+T*T;O>v&&(y=u,b=d,v=O)}break;case Ws.C:var k=n[x++],A=n[x++],j=n[x++],M=n[x++],N=n[x++],ee=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Fn(c,k,j,N,D,Gs),Fn(l,A,M,ee,D,Ks),e.bezierCurveTo(Gs[1],Ks[1],Gs[2],Ks[2],Gs[3],Ks[3]);break lo}h+=E}e.bezierCurveTo(k,A,j,M,N,ee),c=N,l=ee;break;case Ws.Q:var k=n[x++],A=n[x++],j=n[x++],M=n[x++];if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;Hn(c,k,j,D,Gs),Hn(l,A,M,D,Ks),e.quadraticCurveTo(Gs[1],Ks[1],Gs[2],Ks[2]);break lo}h+=E}e.quadraticCurveTo(k,A,j,M),c=j,l=M;break;case Ws.A:var P=n[x++],te=n[x++],F=n[x++],I=n[x++],ne=n[x++],L=n[x++],re=n[x++],R=!n[x++],ie=F>I?F:I,z=tc(F-I)>.001,B=ne+L,V=!1;if(f){var E=p[g++];h+E>_&&(B=ne+L*(_-h)/E,V=!0),h+=E}if(z&&e.ellipse?e.ellipse(P,te,F,I,re,ne,B,R):e.arc(P,te,ie,ne,B,R),V)break lo;C&&(o=$s(ne)*F+P,s=ec(ne)*I+te),c=$s(B)*F+P,l=ec(B)*I+te;break;case Ws.R:o=c=n[x],s=l=n[x+1],u=n[x++],d=n[x++];var H=n[x++],U=n[x++];if(f){var E=p[g++];if(h+E>_){var ae=_-h;e.moveTo(u,d),e.lineTo(u+Zs(ae,H),d),ae-=H,ae>0&&e.lineTo(u+H,d+Zs(ae,U)),ae-=U,ae>0&&e.lineTo(u+Qs(H-ae,0),d+U),ae-=H,ae>0&&e.lineTo(u,d+Qs(U-ae,0));break lo}h+=E}e.rect(u,d,H,U);break;case Ws.Z:if(f){var E=p[g++];if(h+E>_){var D=(_-h)/E;e.lineTo(c*(1-D)+o*D,l*(1-D)+s*D);break lo}h+=E}e.closePath(),c=o,l=s}}},e.prototype.clone=function(){var t=new e,n=this.data;return t.data=n.slice?n.slice():Array.prototype.slice.call(n),t._len=this._len,t},e.CMD=Ws,e.initDefaultProps=(function(){var t=e.prototype;t._saveData=!0,t._ux=0,t._uy=0,t._pendingPtDist=0,t._version=0})(),e}();function lc(e,t,n,r,i,a,o){if(i===0)return!1;var s=i,c=0,l=e;if(o>t+s&&o>r+s||oe+s&&a>n+s||at+d&&u>r+d&&u>a+d&&u>s+d||ue+d&&l>n+d&&l>i+d&&l>o+d||lt+l&&c>r+l&&c>a+l||ce+l&&s>n+l&&s>i+l||sn||u+li&&(i+=mc);var f=Math.atan2(c,s);return f<0&&(f+=mc),f>=r&&f<=i||f+mc>=r&&f+mc<=i}function gc(e,t,n,r,i,a){if(a>t&&a>r||ai?s:0}var _c=cc.CMD,vc=Math.PI*2,yc=1e-4;function bc(e,t){return Math.abs(e-t)t&&l>r&&l>a&&l>s||l1&&Cc(),p=jn(t,r,a,s,Sc[0]),f>1&&(m=jn(t,r,a,s,Sc[1]))),f===2?gt&&s>r&&s>a||s=0&&l<=1){for(var u=0,d=Rn(t,r,a,l),f=0;fn||s<-n)return 0;var c=Math.sqrt(n*n-s*s);xc[0]=-c,xc[1]=c;var l=Math.abs(r-i);if(l<1e-4)return 0;if(l>=vc-1e-4){r=0,i=vc;var u=a?1:-1;return o>=xc[0]+e&&o<=xc[1]+e?u:0}if(r>i){var d=r;r=i,i=d}r<0&&(r+=vc,i+=vc);for(var f=0,p=0;p<2;p++){var m=xc[p];if(m+e>o){var h=Math.atan2(s,m),u=a?1:-1;h<0&&(h=vc+h),(h>=r&&h<=i||h+vc>=r&&h+vc<=i)&&(h>Math.PI/2&&h1&&(n||(s+=gc(c,l,u,d,r,i))),g&&(c=a[m],l=a[m+1],u=c,d=l),h){case _c.M:u=a[m++],d=a[m++],c=u,l=d;break;case _c.L:if(n){if(lc(c,l,a[m],a[m+1],t,r,i))return!0}else s+=gc(c,l,a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case _c.C:if(n){if(uc(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=wc(c,l,a[m++],a[m++],a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case _c.Q:if(n){if(dc(c,l,a[m++],a[m++],a[m],a[m+1],t,r,i))return!0}else s+=Tc(c,l,a[m++],a[m++],a[m],a[m+1],r,i)||0;c=a[m++],l=a[m++];break;case _c.A:var _=a[m++],v=a[m++],y=a[m++],b=a[m++],x=a[m++],S=a[m++];m+=1;var C=!!(1-a[m++]);f=Math.cos(x)*y+_,p=Math.sin(x)*b+v,g?(u=f,d=p):s+=gc(c,l,f,p,r,i);var w=(r-_)*b/y+_;if(n){if(hc(_,v,b,x,x+S,C,t,w,i))return!0}else s+=Ec(_,v,b,x,x+S,C,w,i);c=Math.cos(x+S)*y+_,l=Math.sin(x+S)*b+v;break;case _c.R:u=c=a[m++],d=l=a[m++];var T=a[m++],E=a[m++];if(f=u+T,p=d+E,n){if(lc(u,d,f,d,t,r,i)||lc(f,d,f,p,t,r,i)||lc(f,p,u,p,t,r,i)||lc(u,p,u,d,t,r,i))return!0}else s+=gc(f,d,f,p,r,i),s+=gc(u,p,u,d,r,i);break;case _c.Z:if(n){if(lc(c,l,u,d,t,r,i))return!0}else s+=gc(c,l,u,d,r,i);c=u,l=d}}return!n&&!bc(l,d)&&(s+=gc(c,l,u,d,r,i)||0),s!==0}function Oc(e,t,n){return Dc(e,0,!1,t,n)}function kc(e,t,n,r){return Dc(e,t,!0,n,r)}var Ac=M({fill:`#000`,stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:`butt`,miterLimit:10,strokeNoScale:!1,strokeFirst:!1},xs),jc={style:M({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Ss.style)},Mc=qi.concat([`invisible`,`culling`,`z`,`z2`,`zlevel`,`parent`]),Nc=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype.update=function(){var n=this;e.prototype.update.call(this);var r=this.style;if(r.decal){var i=this._decalEl=this._decalEl||new t;i.buildPath===t.prototype.buildPath&&(i.buildPath=function(e){n.buildPath(e,n.shape)}),i.silent=!0;var a=i.style;for(var o in r)a[o]!==r[o]&&(a[o]=r[o]);a.fill=r.fill?r.decal:null,a.decal=null,a.shadowColor=null,r.strokeFirst&&(a.stroke=null);for(var s=0;s.5?Ii:t>.2?Ri:Li}if(e)return Li}return Ii},t.prototype.getInsideTextStroke=function(e){var t=this.style.fill;if(U(t)){var n=this.__zr;if(!!(n&&n.isDarkMode())==yr(e,0)<.4)return t}},t.prototype.buildPath=function(e,t,n){},t.prototype.pathUpdated=function(){this.__dirty&=-5},t.prototype.getUpdatedPathProxy=function(e){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,e),this.path},t.prototype.createPathProxy=function(){this.path=new cc(!1)},t.prototype.hasStroke=function(){var e=this.style,t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.getBoundingRect=function(){var e=this._rect,t=this.style,n=!e;if(n){var r=!1;this.path||(r=!0,this.createPathProxy());var i=this.path;(r||this.__dirty&4)&&(i.beginPath(),this.buildPath(i,this.shape,!1),this.pathUpdated()),e=i.getBoundingRect()}if(this._rect=e,this.hasStroke()&&this.path&&this.path.len()>0){var a=this._rectStroke||=e.clone();if(this.__dirty||n){a.copy(e);var o=t.strokeNoScale?this.getLineScale():1,s=t.lineWidth;if(!this.hasFill()){var c=this.strokeContainThreshold;s=Math.max(s,c??4)}o>1e-10&&(a.width+=s/o,a.height+=s/o,a.x-=s/o/2,a.y-=s/o/2)}return a}return e},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect(),i=this.style;if(e=n[0],t=n[1],r.contain(e,t)){var a=this.path;if(this.hasStroke()){var o=i.lineWidth,s=i.strokeNoScale?this.getLineScale():1;if(s>1e-10&&(this.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),kc(a,o/s,e,t)))return!0}if(this.hasFill())return Oc(a,e,t)}return!1},t.prototype.dirtyShape=function(){this.__dirty|=4,this._rect&&=null,this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},t.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},t.prototype.animateShape=function(e){return this.animate(`shape`,e)},t.prototype.updateDuringAnimation=function(e){e===`style`?this.dirtyStyle():e===`shape`?this.dirtyShape():this.markRedraw()},t.prototype.attrKV=function(t,n){t===`shape`?this.setShape(n):e.prototype.attrKV.call(this,t,n)},t.prototype.setShape=function(e,t){var n=this.shape;return n||=this.shape={},typeof e==`string`?n[e]=t:j(n,e),this.dirtyShape(),this},t.prototype.shapeChanged=function(){return!!(this.__dirty&4)},t.prototype.createStyle=function(e){return Oe(Ac,e)},t.prototype._innerSaveToNormal=function(t){e.prototype._innerSaveToNormal.call(this,t);var n=this._normalState;t.shape&&!n.shape&&(n.shape=j({},this.shape))},t.prototype._applyStateObj=function(t,n,r,i,a,o){e.prototype._applyStateObj.call(this,t,n,r,i,a,o);var s=!(n&&i),c;if(n&&n.shape?a?i?c=n.shape:(c=j({},r.shape),j(c,n.shape)):(c=j({},i?this.shape:r.shape),j(c,n.shape)):s&&(c=r.shape),c){if(a){this.shape=j({},this.shape);for(var l={},u=R(c),d=0;d0},t.prototype.hasFill=function(){var e=this.style.fill;return e!=null&&e!==`none`},t.prototype.createStyle=function(e){return Oe(Pc,e)},t.prototype.setBoundingRect=function(e){this._rect=e},t.prototype.getBoundingRect=function(){var e=this.style;if(!this._rect){var t=e.text;t==null?t=``:t+=``;var n=Qi(t,e.font,e.textAlign,e.textBaseline);if(n.x+=e.x||0,n.y+=e.y||0,this.hasStroke()){var r=e.lineWidth;n.x-=r/2,n.y-=r/2,n.width+=r,n.height+=r}this._rect=n}return this._rect},t.initDefaultProps=(function(){var e=t.prototype;e.dirtyRectTolerance=10})(),t}(Ts);Fc.prototype.type=`tspan`;var Ic=M({x:0,y:0},xs),Lc={style:M({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Ss.style)};function Rc(e){return!!(e&&typeof e!=`string`&&e.width&&e.height)}var zc=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.createStyle=function(e){return Oe(Ic,e)},t.prototype._getSize=function(e){var t=this.style,n=t[e];if(n!=null)return n;var r=Rc(t.image)?t.image:this.__image;if(!r)return 0;var i=e===`width`?`height`:`width`,a=t[i];return a==null?r[e]:r[e]/r[i]*a},t.prototype.getWidth=function(){return this._getSize(`width`)},t.prototype.getHeight=function(){return this._getSize(`height`)},t.prototype.getAnimationStyleProps=function(){return Lc},t.prototype.getBoundingRect=function(){var e=this.style;return this._rect||=new Y(e.x||0,e.y||0,this.getWidth(),this.getHeight()),this._rect},t}(Ts);zc.prototype.type=`image`;function Bc(e,t){var n=t.x,r=t.y,i=t.width,a=t.height,o=t.r,s,c,l,u;i<0&&(n+=i,i=-i),a<0&&(r+=a,a=-a),typeof o==`number`?s=c=l=u=o:o instanceof Array?o.length===1?s=c=l=u=o[0]:o.length===2?(s=l=o[0],c=u=o[1]):o.length===3?(s=o[0],c=u=o[1],l=o[2]):(s=o[0],c=o[1],l=o[2],u=o[3]):s=c=l=u=0;var d;s+c>i&&(d=s+c,s*=i/d,c*=i/d),l+u>i&&(d=l+u,l*=i/d,u*=i/d),c+l>a&&(d=c+l,c*=a/d,l*=a/d),s+u>a&&(d=s+u,s*=a/d,u*=a/d),e.moveTo(n+s,r),e.lineTo(n+i-c,r),c!==0&&e.arc(n+i-c,r+c,c,-Math.PI/2,0),e.lineTo(n+i,r+a-l),l!==0&&e.arc(n+i-l,r+a-l,l,0,Math.PI/2),e.lineTo(n+u,r+a),u!==0&&e.arc(n+u,r+a-u,u,Math.PI/2,Math.PI),e.lineTo(n,r+s),s!==0&&e.arc(n+s,r+s,s,Math.PI,Math.PI*1.5)}var Vc=Math.round;function Hc(e,t,n){if(t){var r=t.x1,i=t.x2,a=t.y1,o=t.y2;e.x1=r,e.x2=i,e.y1=a,e.y2=o;var s=n&&n.lineWidth;return s?(Vc(r*2)===Vc(i*2)&&(e.x1=e.x2=Wc(r,s,!0)),Vc(a*2)===Vc(o*2)&&(e.y1=e.y2=Wc(a,s,!0)),e):e}}function Uc(e,t,n){if(t){var r=t.x,i=t.y,a=t.width,o=t.height;e.x=r,e.y=i,e.width=a,e.height=o;var s=n&&n.lineWidth;return s?(e.x=Wc(r,s,!0),e.y=Wc(i,s,!0),e.width=Math.max(Wc(r+a,s,!1)-e.x,a===0?0:1),e.height=Math.max(Wc(i+o,s,!1)-e.y,o===0?0:1),e):e}}function Wc(e,t,n){if(!t)return e;var r=Vc(e*2);return(r+Vc(t))%2==0?r/2:(r+(n?1:-1))/2}var Gc=function(){function e(){this.x=0,this.y=0,this.width=0,this.height=0}return e}(),Kc={},qc=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new Gc},t.prototype.buildPath=function(e,t){var n,r,i,a;if(this.subPixelOptimize){var o=Uc(Kc,t,this.style);n=o.x,r=o.y,i=o.width,a=o.height,o.r=t.r,t=o}else n=t.x,r=t.y,i=t.width,a=t.height;t.r?Bc(e,t):e.rect(n,r,i,a)},t.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},t}(Nc);qc.prototype.type=`rect`;var Jc={fill:`#000`},Yc=2,Xc={style:M({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Ss.style)},Zc=function(e){r(t,e);function t(t){var n=e.call(this)||this;return n.type=`text`,n._children=[],n._defaultStyle=Jc,n.attr(t),n}return t.prototype.childrenRef=function(){return this._children},t.prototype.update=function(){e.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var t=0;t0,T=e.width!=null&&(e.overflow===`truncate`||e.overflow===`break`||e.overflow===`breakAll`),E=r.calculatedLineHeight,D=0;D=0&&(D=y[E],D.align===`right`);)this._placeToken(D,e,x,m,T,`right`,g),S-=D.width,T-=D.width,E--;for(w+=(n-(w-p)-(h-T)-S)/2;C<=E;)D=y[C],this._placeToken(D,e,x,m,w+D.width/2,`center`,g),w+=D.width,C++;m+=x}},t.prototype._placeToken=function(e,t,n,r,i,a,o){var s=t.rich[e.styleName]||{};s.text=e.text;var c=e.verticalAlign,l=r+n/2;c===`top`?l=r+e.height/2:c===`bottom`&&(l=r+n-e.height/2),!e.isLineHolder&&ul(s)&&this._renderBackground(s,t,a===`right`?i-e.width:a===`center`?i-e.width/2:i,l-e.height/2,e.width,e.height);var u=!!s.backgroundColor,d=e.textPadding;d&&(i=cl(i,a,d),l-=e.height/2-d[0]-e.innerHeight/2);var f=this._getOrCreateChild(Fc),p=f.createStyle();f.useStyle(p);var m=this._defaultStyle,h=!1,g=0,_=sl(`fill`in s?s.fill:`fill`in t?t.fill:(h=!0,m.fill)),v=ol(`stroke`in s?s.stroke:`stroke`in t?t.stroke:!u&&!o&&(!m.autoStroke||h)?(g=Yc,m.stroke):null),y=s.textShadowBlur>0||t.textShadowBlur>0;p.text=e.text,p.x=i,p.y=l,y&&(p.shadowBlur=s.textShadowBlur||t.textShadowBlur||0,p.shadowColor=s.textShadowColor||t.textShadowColor||`transparent`,p.shadowOffsetX=s.textShadowOffsetX||t.textShadowOffsetX||0,p.shadowOffsetY=s.textShadowOffsetY||t.textShadowOffsetY||0),p.textAlign=a,p.textBaseline=`middle`,p.font=e.font||`12px sans-serif`,p.opacity=he(s.opacity,t.opacity,1),nl(p,s),v&&(p.lineWidth=he(s.lineWidth,t.lineWidth,g),p.lineDash=G(s.lineDash,t.lineDash),p.lineDashOffset=t.lineDashOffset||0,p.stroke=v),_&&(p.fill=_);var b=e.contentWidth,x=e.contentHeight;f.setBoundingRect(new Y($i(p.x,b,p.textAlign),ea(p.y,x,p.textBaseline),b,x))},t.prototype._renderBackground=function(e,t,n,r,i,a){var o=e.backgroundColor,s=e.borderWidth,c=e.borderColor,l=o&&o.image,u=o&&!l,d=e.borderRadius,f=this,p,m;if(u||e.lineHeight||s&&c){p=this._getOrCreateChild(qc),p.useStyle(p.createStyle()),p.style.fill=null;var h=p.shape;h.x=n,h.y=r,h.width=i,h.height=a,h.r=d,p.dirtyShape()}if(u){var g=p.style;g.fill=o||null,g.fillOpacity=G(e.fillOpacity,1)}else if(l){m=this._getOrCreateChild(zc),m.onload=function(){f.dirtyStyle()};var _=m.style;_.image=o.image,_.x=n,_.y=r,_.width=i,_.height=a}if(s&&c){var g=p.style;g.lineWidth=s,g.stroke=c,g.strokeOpacity=G(e.strokeOpacity,1),g.lineDash=e.borderDash,g.lineDashOffset=e.borderDashOffset||0,p.strokeContainThreshold=0,p.hasFill()&&p.hasStroke()&&(g.strokeFirst=!0,g.lineWidth*=2)}var v=(p||m).style;v.shadowBlur=e.shadowBlur||0,v.shadowColor=e.shadowColor||`transparent`,v.shadowOffsetX=e.shadowOffsetX||0,v.shadowOffsetY=e.shadowOffsetY||0,v.opacity=he(e.opacity,t.opacity,1)},t.makeFont=function(e){var t=``;return rl(e)&&(t=[e.fontStyle,e.fontWeight,tl(e.fontSize),e.fontFamily||`sans-serif`].join(` `)),t&&ye(t)||e.textFont||e.font},t}(Ts),Qc={left:!0,right:1,center:1},$c={top:1,bottom:1,middle:1},el=[`fontStyle`,`fontWeight`,`fontSize`,`fontFamily`];function tl(e){return typeof e==`string`&&(e.indexOf(`px`)!==-1||e.indexOf(`rem`)!==-1||e.indexOf(`em`)!==-1)?e:isNaN(+e)?`12px`:e+`px`}function nl(e,t){for(var n=0;n=0,a=!1;if(e instanceof Nc){var o=ml(e),s=i&&o.selectFill||o.normalFill,c=i&&o.selectStroke||o.normalStroke;if(Cl(s)||Cl(c)){r||={};var l=r.style||{};l.fill===`inherit`?(a=!0,r=j({},r),l=j({},l),l.fill=s):!Cl(l.fill)&&Cl(s)?(a=!0,r=j({},r),l=j({},l),l.fill=xr(s)):!Cl(l.stroke)&&Cl(c)&&(a||(r=j({},r),l=j({},l)),l.stroke=xr(c)),r.style=l}}if(r&&r.z2==null){a||(r=j({},r));var u=e.z2EmphasisLift;r.z2=e.z2+(u??10)}return r}function Il(e,t,n){if(n&&n.z2==null){n=j({},n);var r=e.z2SelectLift;n.z2=e.z2+(r??9)}return n}function Ll(e,t,n){var r=N(e.currentStates,t)>=0,i=e.style.opacity,a=r?null:Pl(e,[`opacity`],t,{opacity:1});n||={};var o=n.style||{};return o.opacity??(n=j({},n),o=j({opacity:r?i:a.opacity*.1},o),n.style=o),n}function Rl(e,t){var n=this.states[e];if(this.style){if(e===`emphasis`)return Fl(this,e,t,n);if(e===`blur`)return Ll(this,e,n);if(e===`select`)return Il(this,e,n)}return n}function zl(e){e.stateProxy=Rl;var t=e.getTextContent(),n=e.getTextGuideLine();t&&(t.stateProxy=Rl),n&&(n.stateProxy=Rl)}function Bl(e,t){!Jl(e,t)&&!e.__highByOuter&&Ml(e,Tl)}function Vl(e,t){!Jl(e,t)&&!e.__highByOuter&&Ml(e,El)}function Hl(e,t){e.__highByOuter|=1<<(t||0),Ml(e,Tl)}function Ul(e,t){!(e.__highByOuter&=~(1<<(t||0)))&&Ml(e,El)}function Wl(e){Ml(e,Dl)}function Gl(e){Ml(e,Ol)}function Kl(e){Ml(e,kl)}function ql(e){Ml(e,Al)}function Jl(e,t){return e.__highDownSilentOnTouch&&t.zrByTouch}function Yl(e){var t=e.getModel(),n=[],r=[];t.eachComponent(function(t,i){var a=hl(i),o=t===`series`,s=o?e.getViewOfSeriesModel(i):e.getViewOfComponentModel(i);!o&&r.push(s),a.isBlured&&(s.group.traverse(function(e){Ol(e)}),o&&n.push(i)),a.isBlured=!1}),F(r,function(e){e&&e.toggleBlurSeries&&e.toggleBlurSeries(n,!1,t)})}function Xl(e,t,n,r){var i=r.getModel();n||=`coordinateSystem`;function a(e,t){for(var n=0;n0){var a={dataIndex:i,seriesIndex:e.seriesIndex};r!=null&&(a.dataType=r),t.push(a)}})}),t}function au(e,t,n){fu(e,!0),Ml(e,zl),cu(e,t,n)}function ou(e){fu(e,!1)}function su(e,t,n,r){r?ou(e):au(e,t,n)}function cu(e,t,n){var r=Q(e);t==null?r.focus&&=null:(r.focus=t,r.blurScope=n)}var lu=[`emphasis`,`blur`,`select`],uu={itemStyle:`getItemStyle`,lineStyle:`getLineStyle`,areaStyle:`getAreaStyle`};function du(e,t,n,r){n||=`itemStyle`;for(var i=0;i1&&(o*=wu(m),s*=wu(m));var h=(i===a?-1:1)*wu((o*o*(s*s)-o*o*(p*p)-s*s*(f*f))/(o*o*(p*p)+s*s*(f*f)))||0,g=h*o*p/s,_=h*-s*f/o,v=(e+n)/2+Eu(d)*g-Tu(d)*_,y=(t+r)/2+Tu(d)*g+Eu(d)*_,b=Au([1,0],[(f-g)/o,(p-_)/s]),x=[(f-g)/o,(p-_)/s],S=[(-1*f-g)/o,(-1*p-_)/s],C=Au(x,S);if(ku(x,S)<=-1&&(C=Du),ku(x,S)>=1&&(C=0),C<0){var w=Math.round(C/Du*1e6)/1e6;C=Du*2+w%2*Du}u.addData(l,v,y,o,s,b,C,d,a)}var Mu=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,Nu=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Pu(e){var t=new cc;if(!e)return t;var n=0,r=0,i=n,a=r,o,s=cc.CMD,c=e.match(Mu);if(!c)return t;for(var l=0;lA*A+j*j&&(w=E,T=D),{cx:w,cy:T,x0:-u,y0:-d,x1:w*(i/x-1),y1:T*(i/x-1)}}function ad(e){var t;if(V(e)){var n=e.length;if(!n)return e;t=n===1?[e[0],e[0],0,0]:n===2?[e[0],e[0],e[1],e[1]]:n===3?e.concat(e[2]):e}else t=[e,e,e,e];return t}function od(e,t){var n,r=ed(t.r,0),i=ed(t.r0||0,0),a=r>0;if(!(!a&&!(i>0))){if(a||(r=i,i=0),i>r){var o=r;r=i,i=o}var s=t.startAngle,c=t.endAngle;if(!(isNaN(s)||isNaN(c))){var l=t.cx,u=t.cy,d=!!t.clockwise,f=Qu(c-s),p=f>qu&&f%qu;if(p>nd&&(f=p),!(r>nd))e.moveTo(l,u);else if(f>qu-nd)e.moveTo(l+r*Yu(s),u+r*Ju(s)),e.arc(l,u,r,s,c,!d),i>nd&&(e.moveTo(l+i*Yu(c),u+i*Ju(c)),e.arc(l,u,i,c,s,d));else{var m=void 0,h=void 0,g=void 0,_=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,C=void 0,w=void 0,T=void 0,E=void 0,D=void 0,O=void 0,k=void 0,A=r*Yu(s),j=r*Ju(s),M=i*Yu(c),N=i*Ju(c),ee=f>nd;if(ee){var P=t.cornerRadius;P&&(n=ad(P),m=n[0],h=n[1],g=n[2],_=n[3]);var te=Qu(r-i)/2;if(v=td(te,g),y=td(te,_),b=td(te,m),x=td(te,h),w=S=ed(v,y),T=C=ed(b,x),(S>nd||C>nd)&&(E=r*Yu(c),D=r*Ju(c),O=i*Yu(s),k=i*Ju(s),fnd){var z=td(g,w),B=td(_,w),V=id(O,k,A,j,r,z,d),H=id(E,D,M,N,r,B,d);e.moveTo(l+V.cx+V.x0,u+V.cy+V.y0),w0&&e.arc(l+V.cx,u+V.cy,z,Zu(V.y0,V.x0),Zu(V.y1,V.x1),!d),e.arc(l,u,r,Zu(V.cy+V.y1,V.cx+V.x1),Zu(H.cy+H.y1,H.cx+H.x1),!d),B>0&&e.arc(l+H.cx,u+H.cy,B,Zu(H.y1,H.x1),Zu(H.y0,H.x0),!d))}else e.moveTo(l+A,u+j),e.arc(l,u,r,s,c,!d);if(!(i>nd)||!ee)e.lineTo(l+M,u+N);else if(T>nd){var z=td(m,T),B=td(h,T),V=id(M,N,E,D,i,-B,d),H=id(A,j,O,k,i,-z,d);e.lineTo(l+V.cx+V.x0,u+V.cy+V.y0),T0&&e.arc(l+V.cx,u+V.cy,B,Zu(V.y0,V.x0),Zu(V.y1,V.x1),!d),e.arc(l,u,i,Zu(V.cy+V.y1,V.cx+V.x1),Zu(H.cy+H.y1,H.cx+H.x1),d),z>0&&e.arc(l+H.cx,u+H.cy,z,Zu(H.y1,H.x1),Zu(H.y0,H.x0),!d))}else e.lineTo(l+M,u+N),e.arc(l,u,i,c,s,d)}e.closePath()}}}var sd=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return e}(),cd=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new sd},t.prototype.buildPath=function(e,t){od(e,t)},t.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},t}(Nc);cd.prototype.type=`sector`;var ld=function(){function e(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return e}(),ud=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new ld},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.PI*2;e.moveTo(n+t.r,r),e.arc(n,r,t.r,0,i,!1),e.moveTo(n+t.r0,r),e.arc(n,r,t.r0,0,i,!0)},t}(Nc);ud.prototype.type=`ring`;function dd(e,t,n,r){var i=[],a=[],o=[],s=[],c,l,u,d;if(r){u=[1/0,1/0],d=[-1/0,-1/0];for(var f=0,p=e.length;f=2){if(r){var a=dd(i,r,n,t.smoothConstraint);e.moveTo(i[0][0],i[0][1]);for(var o=i.length,s=0;s<(n?o:o-1);s++){var c=a[s*2],l=a[s*2+1],u=i[(s+1)%o];e.bezierCurveTo(c[0],c[1],l[0],l[1],u[0],u[1])}}else{e.moveTo(i[0][0],i[0][1]);for(var s=1,d=i.length;sjd[1]){if(o=!1,i)return o;var l=Math.abs(jd[0]-Ad[1]),u=Math.abs(Ad[0]-jd[1]);Math.min(l,u)>r.len()&&(l0){var d=u.duration,f=u.delay,p=u.easing,m={duration:d,delay:f||0,easing:p,done:a,force:!!a||!!o,setToFinal:!l,scope:e,during:o};s?t.animateFrom(n,m):t.animateTo(n,m)}else t.stopAnimation(),!s&&t.attr(n),o&&o(1),a&&a()}function Bd(e,t,n,r,i,a){zd(`update`,e,t,n,r,i,a)}function Vd(e,t,n,r,i,a){zd(`enter`,e,t,n,r,i,a)}function Hd(e){if(!e.__zr)return!0;for(var t=0;tTd,BezierCurve:()=>Cd,BoundingRect:()=>Y,Circle:()=>Uu,CompoundPath:()=>Ed,Ellipse:()=>Gu,Group:()=>X,Image:()=>zc,IncrementalDisplayable:()=>Id,Line:()=>yd,LinearGradient:()=>Od,OrientedBoundingRect:()=>Pd,Path:()=>Nc,Point:()=>J,Polygon:()=>md,Polyline:()=>gd,RadialGradient:()=>kd,Rect:()=>qc,Ring:()=>ud,Sector:()=>cd,Text:()=>Zc,applyTransform:()=>pf,clipPointsByRect:()=>vf,clipRectByRect:()=>yf,createIcon:()=>bf,extendPath:()=>ef,extendShape:()=>Qd,getShapeClass:()=>nf,getTransform:()=>ff,groupTransition:()=>_f,initProps:()=>Vd,isElementRemoved:()=>Hd,lineLineIntersect:()=>Sf,linePolygonIntersect:()=>xf,makeImage:()=>af,makePath:()=>rf,mergePath:()=>sf,registerShape:()=>tf,removeElement:()=>Ud,removeElementWithFadeOut:()=>Gd,resizePath:()=>cf,setTooltipConfig:()=>Tf,subPixelOptimize:()=>df,subPixelOptimizeLine:()=>lf,subPixelOptimizeRect:()=>uf,transformDirection:()=>mf,traverseElements:()=>Df,updateProps:()=>Bd}),Yd=Math.max,Xd=Math.min,Zd={};function Qd(e){return Nc.extend(e)}var $d=zu;function ef(e,t){return $d(e,t)}function tf(e,t){Zd[e]=t}function nf(e){if(Zd.hasOwnProperty(e))return Zd[e]}function rf(e,t,n,r){var i=Ru(e,t);return n&&(r===`center`&&(n=of(n,i.getBoundingRect())),cf(i,n)),i}function af(e,t,n){var r=new zc({style:{image:e,x:t.x,y:t.y,width:t.width,height:t.height},onload:function(e){if(n===`center`){var i={width:e.width,height:e.height};r.setStyle(of(t,i))}}});return r}function of(e,t){var n=t.width/t.height,r=e.height*n,i;r<=e.width?i=e.height:(r=e.width,i=r/n);var a=e.x+e.width/2,o=e.y+e.height/2;return{x:a-r/2,y:o-i/2,width:r,height:i}}var sf=Bu;function cf(e,t){if(e.applyTransform){var n=e.getBoundingRect().calculateTransform(t);e.applyTransform(n)}}function lf(e,t){return Hc(e,e,{lineWidth:t}),e}function uf(e){return Uc(e.shape,e.shape,e.style),e}var df=Wc;function ff(e,t){for(var n=At([]);e&&e!==t;)Mt(n,e.getLocalTransform(),n),e=e.parent;return n}function pf(e,t,n){return t&&!te(t)&&(t=Ki.getLocalTransform(t)),n&&(t=It([],t)),Je([],e,t)}function mf(e,t,n){var r=t[4]===0||t[5]===0||t[0]===0?1:Math.abs(2*t[4]/t[0]),i=t[4]===0||t[5]===0||t[2]===0?1:Math.abs(2*t[4]/t[2]),a=[e===`left`?-r:e===`right`?r:0,e===`top`?-i:e===`bottom`?i:0];return a=pf(a,t,n),Math.abs(a[0])>Math.abs(a[1])?a[0]>0?`right`:`left`:a[1]>0?`bottom`:`top`}function hf(e){return!e.isGroup}function gf(e){return e.shape!=null}function _f(e,t,n){if(!e||!t)return;function r(e){var t={};return e.traverse(function(e){hf(e)&&e.anid&&(t[e.anid]=e)}),t}function i(e){var t={x:e.x,y:e.y,rotation:e.rotation};return gf(e)&&(t.shape=j({},e.shape)),t}var a=r(e);t.traverse(function(e){if(hf(e)&&e.anid){var t=a[e.anid];if(t){var r=i(e);e.attr(i(t)),Bd(e,r,n,Q(e).dataIndex)}}})}function vf(e,t){return I(e,function(e){var n=e[0];n=Yd(n,t.x),n=Xd(n,t.x+t.width);var r=e[1];return r=Yd(r,t.y),r=Xd(r,t.y+t.height),[n,r]})}function yf(e,t){var n=Yd(e.x,t.x),r=Xd(e.x+e.width,t.x+t.width),i=Yd(e.y,t.y),a=Xd(e.y+e.height,t.y+t.height);if(r>=n&&a>=i)return{x:n,y:i,width:r-n,height:a-i}}function bf(e,t,n){var r=j({rectHover:!0},t),i=r.style={strokeNoScale:!0};if(n||={x:-1,y:-1,width:2,height:2},e)return e.indexOf(`image://`)===0?(i.image=e.slice(8),M(i,n),new zc(r)):rf(e.replace(`path://`,``),r,n,`center`)}function xf(e,t,n,r,i){for(var a=0,o=i[i.length-1];a1)return!1;var g=Cf(p,m,u,d)/f;return!(g<0||g>1)}function Cf(e,t,n,r){return e*r-n*t}function wf(e){return e<=1e-6&&e>=-1e-6}function Tf(e){var t=e.itemTooltipOption,n=e.componentModel,r=e.itemName,i=U(t)?{formatter:t}:t,a=n.mainType,o=n.componentIndex,s={componentType:a,name:r,$vars:[`name`]};s[a+`Index`]=o;var c=e.formatterParamsExtra;c&&F(R(c),function(e){q(s,e)||(s[e]=c[e],s.$vars.push(e))});var l=Q(e.el);l.componentMainType=a,l.componentIndex=o,l.tooltipConfig={name:r,option:M({content:r,encodeHTMLContent:!0,formatterParams:s},i)}}function Ef(e,t){var n;e.isGroup&&(n=t(e)),n||e.traverse(t)}function Df(e,t){if(e){if(V(e))for(var n=0;n=0&&n.push(e)}),n}}function op(e,t){return k(k({},e,!0),t,!0)}var sp={time:{month:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],monthAbbr:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],dayOfWeek:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],dayOfWeekAbbr:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`]},legend:{selector:{all:`All`,inverse:`Inv`}},toolbox:{brush:{title:{rect:`Box Select`,polygon:`Lasso Select`,lineX:`Horizontally Select`,lineY:`Vertically Select`,keep:`Keep Selections`,clear:`Clear Selections`}},dataView:{title:`Data View`,lang:[`Data View`,`Close`,`Refresh`]},dataZoom:{title:{zoom:`Zoom`,back:`Zoom Reset`}},magicType:{title:{line:`Switch to Line Chart`,bar:`Switch to Bar Chart`,stack:`Stack`,tiled:`Tile`}},restore:{title:`Restore`},saveAsImage:{title:`Save as Image`,lang:[`Right Click to Save Image`]}},series:{typeNames:{pie:`Pie chart`,bar:`Bar chart`,line:`Line chart`,scatter:`Scatter plot`,effectScatter:`Ripple scatter plot`,radar:`Radar chart`,tree:`Tree`,treemap:`Treemap`,boxplot:`Boxplot`,candlestick:`Candlestick`,k:`K line chart`,heatmap:`Heat map`,map:`Map`,parallel:`Parallel coordinate map`,lines:`Line graph`,graph:`Relationship graph`,sankey:`Sankey diagram`,funnel:`Funnel chart`,gauge:`Gauge`,pictorialBar:`Pictorial bar`,themeRiver:`Theme River Map`,sunburst:`Sunburst`,custom:`Custom chart`,chart:`Chart`}},aria:{general:{withTitle:`This is a chart about "{title}"`,withoutTitle:`This is a chart`},series:{single:{prefix:``,withName:` with type {seriesType} named {seriesName}.`,withoutName:` with type {seriesType}.`},multiple:{prefix:`. It consists of {seriesCount} series count.`,withName:` The {seriesId} series is a {seriesType} representing {seriesName}.`,withoutName:` The {seriesId} series is a {seriesType}.`,separator:{middle:``,end:``}}},data:{allData:`The data is as follows: `,partialData:`The first {displayCnt} items are: `,withName:`the data for {name} is {value}`,withoutName:`{value}`,separator:{middle:`, `,end:`. `}}}},cp={time:{month:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],monthAbbr:[`1月`,`2月`,`3月`,`4月`,`5月`,`6月`,`7月`,`8月`,`9月`,`10月`,`11月`,`12月`],dayOfWeek:[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`],dayOfWeekAbbr:[`日`,`一`,`二`,`三`,`四`,`五`,`六`]},legend:{selector:{all:`全选`,inverse:`反选`}},toolbox:{brush:{title:{rect:`矩形选择`,polygon:`圈选`,lineX:`横向选择`,lineY:`纵向选择`,keep:`保持选择`,clear:`清除选择`}},dataView:{title:`数据视图`,lang:[`数据视图`,`关闭`,`刷新`]},dataZoom:{title:{zoom:`区域缩放`,back:`区域缩放还原`}},magicType:{title:{line:`切换为折线图`,bar:`切换为柱状图`,stack:`切换为堆叠`,tiled:`切换为平铺`}},restore:{title:`还原`},saveAsImage:{title:`保存为图片`,lang:[`右键另存为图片`]}},series:{typeNames:{pie:`饼图`,bar:`柱状图`,line:`折线图`,scatter:`散点图`,effectScatter:`涟漪散点图`,radar:`雷达图`,tree:`树图`,treemap:`矩形树图`,boxplot:`箱型图`,candlestick:`K线图`,k:`K线图`,heatmap:`热力图`,map:`地图`,parallel:`平行坐标图`,lines:`线图`,graph:`关系图`,sankey:`桑基图`,funnel:`漏斗图`,gauge:`仪表盘图`,pictorialBar:`象形柱图`,themeRiver:`主题河流图`,sunburst:`旭日图`,custom:`自定义图表`,chart:`图表`}},aria:{general:{withTitle:`这是一个关于“{title}”的图表。`,withoutTitle:`这是一个图表,`},series:{single:{prefix:``,withName:`图表类型是{seriesType},表示{seriesName}。`,withoutName:`图表类型是{seriesType}。`},multiple:{prefix:`它由{seriesCount}个图表系列组成。`,withName:`第{seriesId}个系列是一个表示{seriesName}的{seriesType},`,withoutName:`第{seriesId}个系列是一个{seriesType},`,separator:{middle:`;`,end:`。`}}},data:{allData:`其数据是——`,partialData:`其中,前{displayCnt}项是——`,withName:`{name}的数据是{value}`,withoutName:`{value}`,separator:{middle:`,`,end:``}}}},lp=`ZH`,up=`EN`,dp=up,fp={},pp={},mp=a.domSupported?function(){return(document.documentElement.lang||navigator.language||navigator.browserLanguage||dp).toUpperCase().indexOf(lp)>-1?lp:dp}():dp;function hp(e,t){e=e.toUpperCase(),pp[e]=new tp(t),fp[e]=t}function gp(e){if(U(e)){var t=fp[e.toUpperCase()]||{};return e===lp||e===up?O(t):k(O(t),O(fp[dp]),!1)}return k(O(e),O(fp[dp]),!1)}function _p(e){return pp[e]}function vp(){return pp[dp]}hp(up,sp),hp(lp,cp);var yp=1e3,bp=yp*60,xp=bp*60,Sp=xp*24,Cp=Sp*365,wp={year:`{yyyy}`,month:`{MMM}`,day:`{d}`,hour:`{HH}:{mm}`,minute:`{HH}:{mm}`,second:`{HH}:{mm}:{ss}`,millisecond:`{HH}:{mm}:{ss} {SSS}`,none:`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}`},Tp=`{yyyy}-{MM}-{dd}`,Ep={year:`{yyyy}`,month:`{yyyy}-{MM}`,day:Tp,hour:Tp+` `+wp.hour,minute:Tp+` `+wp.minute,second:Tp+` `+wp.second,millisecond:wp.none},Dp=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],Op=[`year`,`half-year`,`quarter`,`month`,`week`,`half-week`,`day`,`half-day`,`quarter-day`,`hour`,`minute`,`second`,`millisecond`];function kp(e,t){return e+=``,`0000`.substr(0,t-e.length)+e}function Ap(e){switch(e){case`half-year`:case`quarter`:return`month`;case`week`:case`half-week`:return`day`;case`half-day`:case`quarter-day`:return`hour`;default:return e}}function jp(e){return e===Ap(e)}function Mp(e){switch(e){case`year`:case`month`:return`day`;case`millisecond`:return`millisecond`;default:return`second`}}function Np(e,t,n,r){var i=Va(e),a=i[Lp(n)](),o=i[Rp(n)]()+1,s=Math.floor((o-1)/3)+1,c=i[zp(n)](),l=i[`get`+(n?`UTC`:``)+`Day`](),u=i[Bp(n)](),d=(u-1)%12+1,f=i[Vp(n)](),p=i[Hp(n)](),m=i[Up(n)](),h=u>=12?`pm`:`am`,g=h.toUpperCase(),_=(r instanceof tp?r:_p(r||mp)||vp()).getModel(`time`),v=_.get(`month`),y=_.get(`monthAbbr`),b=_.get(`dayOfWeek`),x=_.get(`dayOfWeekAbbr`);return(t||``).replace(/{a}/g,h+``).replace(/{A}/g,g+``).replace(/{yyyy}/g,a+``).replace(/{yy}/g,kp(a%100+``,2)).replace(/{Q}/g,s+``).replace(/{MMMM}/g,v[o-1]).replace(/{MMM}/g,y[o-1]).replace(/{MM}/g,kp(o,2)).replace(/{M}/g,o+``).replace(/{dd}/g,kp(c,2)).replace(/{d}/g,c+``).replace(/{eeee}/g,b[l]).replace(/{ee}/g,x[l]).replace(/{e}/g,l+``).replace(/{HH}/g,kp(u,2)).replace(/{H}/g,u+``).replace(/{hh}/g,kp(d+``,2)).replace(/{h}/g,d+``).replace(/{mm}/g,kp(f,2)).replace(/{m}/g,f+``).replace(/{ss}/g,kp(p,2)).replace(/{s}/g,p+``).replace(/{SSS}/g,kp(m,3)).replace(/{S}/g,m+``)}function Pp(e,t,n,r,i){var a=null;if(U(n))a=n;else if(H(n))a=n(e.value,t,{level:e.level});else{var o=j({},wp);if(e.level>0)for(var s=0;s=0;--s)if(c[l]){a=c[l];break}a||=o.none}if(V(a)){var u=e.level==null?0:e.level>=0?e.level:a.length+e.level;u=Math.min(u,a.length-1),a=a[u]}}return Np(new Date(e.value),a,i,r)}function Fp(e,t){var n=Va(e),r=n[Rp(t)]()+1,i=n[zp(t)](),a=n[Bp(t)](),o=n[Vp(t)](),s=n[Hp(t)](),c=n[Up(t)]()===0,l=c&&s===0,u=l&&o===0,d=u&&a===0,f=d&&i===1;return f&&r===1?`year`:f?`month`:d?`day`:u?`hour`:l?`minute`:c?`second`:`millisecond`}function Ip(e,t,n){var r=oe(e)?Va(e):e;switch(t||=Fp(e,n),t){case`year`:return r[Lp(n)]();case`half-year`:return+(r[Rp(n)]()>=6);case`quarter`:return Math.floor((r[Rp(n)]()+1)/4);case`month`:return r[Rp(n)]();case`day`:return r[zp(n)]();case`half-day`:return r[Bp(n)]()/24;case`hour`:return r[Bp(n)]();case`minute`:return r[Vp(n)]();case`second`:return r[Hp(n)]();case`millisecond`:return r[Up(n)]()}}function Lp(e){return e?`getUTCFullYear`:`getFullYear`}function Rp(e){return e?`getUTCMonth`:`getMonth`}function zp(e){return e?`getUTCDate`:`getDate`}function Bp(e){return e?`getUTCHours`:`getHours`}function Vp(e){return e?`getUTCMinutes`:`getMinutes`}function Hp(e){return e?`getUTCSeconds`:`getSeconds`}function Up(e){return e?`getUTCMilliseconds`:`getMilliseconds`}function Wp(e){return e?`setUTCFullYear`:`setFullYear`}function Gp(e){return e?`setUTCMonth`:`setMonth`}function Kp(e){return e?`setUTCDate`:`setDate`}function qp(e){return e?`setUTCHours`:`setHours`}function Jp(e){return e?`setUTCMinutes`:`setMinutes`}function Yp(e){return e?`setUTCSeconds`:`setSeconds`}function Xp(e){return e?`setUTCMilliseconds`:`setMilliseconds`}function Zp(e){if(!Ja(e))return U(e)?e:`-`;var t=(e+``).split(`.`);return t[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,`$1,`)+(t.length>1?`.`+t[1]:``)}function Qp(e,t){return e=(e||``).toLowerCase().replace(/-(.)/g,function(e,t){return t.toUpperCase()}),t&&e&&(e=e.charAt(0).toUpperCase()+e.slice(1)),e}var $p=_e;function em(e,t,n){var r=`{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}`;function i(e){return e&&ye(e)?e:`-`}function a(e){return!!(e!=null&&!isNaN(e)&&isFinite(e))}var o=t===`time`,s=e instanceof Date;if(o||s){var c=o?Va(e):e;if(!isNaN(+c))return Np(c,r,n);if(s)return`-`}if(t===`ordinal`)return ae(e)?i(e):oe(e)&&a(e)?e+``:`-`;var l=qa(e);return a(l)?Zp(l):ae(e)?i(e):typeof e==`boolean`?e+``:`-`}var tm=[`a`,`b`,`c`,`d`,`e`,`f`,`g`],nm=function(e,t){return`{`+e+(t??``)+`}`};function rm(e,t,n){V(t)||(t=[t]);var r=t.length;if(!r)return``;for(var i=t[0].$vars||[],a=0;a`:``:{renderMode:a,content:`{`+(n.markerId||`markerX`)+`|} `,style:i===`subItem`?{width:4,height:4,borderRadius:2,backgroundColor:r}:{width:10,height:10,borderRadius:5,backgroundColor:r}}:``}function om(e,t){return t||=`transparent`,U(e)?e:W(e)&&e.colorStops&&(e.colorStops[0]||{}).color||t}function sm(e,t){if(t===`_blank`||t===`blank`){var n=window.open();n.opener=null,n.location.href=e}else window.open(e,t)}var cm=F,lm=[`left`,`right`,`top`,`bottom`,`width`,`height`],um=[[`width`,`left`,`right`],[`height`,`top`,`bottom`]];function dm(e,t,n,r,i){var a=0,o=0;r??=1/0,i??=1/0;var s=0;t.eachChild(function(c,l){var u=c.getBoundingRect(),d=t.childAt(l+1),f=d&&d.getBoundingRect(),p,m;if(e===`horizontal`){var h=u.width+(f?-f.x+u.x:0);p=a+h,p>r||c.newline?(a=0,p=h,o+=s+n,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(f?-f.y+u.y:0);m=o+g,m>i||c.newline?(a+=s+n,o=0,m=g,s=u.width):s=Math.max(s,u.width)}c.newline||(c.x=a,c.y=o,c.markRedraw(),e===`horizontal`?a=p+n:o=m+n)})}var fm=dm;B(dm,`vertical`),B(dm,`horizontal`);function pm(e,t,n){var r=t.width,i=t.height,a=Z(e.left,r),o=Z(e.top,i),s=Z(e.right,r),c=Z(e.bottom,i);return(isNaN(a)||isNaN(parseFloat(e.left)))&&(a=0),(isNaN(s)||isNaN(parseFloat(e.right)))&&(s=r),(isNaN(o)||isNaN(parseFloat(e.top)))&&(o=0),(isNaN(c)||isNaN(parseFloat(e.bottom)))&&(c=i),n=$p(n||0),{width:Math.max(s-a-n[1]-n[3],0),height:Math.max(c-o-n[0]-n[2],0)}}function mm(e,t,n){n=$p(n||0);var r=t.width,i=t.height,a=Z(e.left,r),o=Z(e.top,i),s=Z(e.right,r),c=Z(e.bottom,i),l=Z(e.width,r),u=Z(e.height,i),d=n[2]+n[0],f=n[1]+n[3],p=e.aspect;switch(isNaN(l)&&(l=r-s-f-a),isNaN(u)&&(u=i-c-d-o),p!=null&&(isNaN(l)&&isNaN(u)&&(p>r/i?l=r*.8:u=i*.8),isNaN(l)&&(l=p*u),isNaN(u)&&(u=l/p)),isNaN(a)&&(a=r-s-l-f),isNaN(o)&&(o=i-c-u-d),e.left||e.right){case`center`:a=r/2-l/2-n[3];break;case`right`:a=r-l-f}switch(e.top||e.bottom){case`middle`:case`center`:o=i/2-u/2-n[0];break;case`bottom`:o=i-u-d}a||=0,o||=0,isNaN(l)&&(l=r-f-a-(s||0)),isNaN(u)&&(u=i-d-o-(c||0));var m=new Y(a+n[3],o+n[0],l,u);return m.margin=n,m}function hm(e,t,n,r,i,a){var o=!i||!i.hv||i.hv[0],s=!i||!i.hv||i.hv[1],c=i&&i.boundingMode||`all`;if(a||=e,a.x=e.x,a.y=e.y,!o&&!s)return!1;var l;if(c===`raw`)l=e.type===`group`?new Y(0,0,+t.width||0,+t.height||0):e.getBoundingRect();else if(l=e.getBoundingRect(),e.needLocalTransform()){var u=e.getLocalTransform();l=l.clone(),l.applyTransform(u)}var d=mm(M({width:l.width,height:l.height},t),n,r),f=o?d.x-l.x:0,p=s?d.y-l.y:0;return c===`raw`?(a.x=f,a.y=p):(a.x+=f,a.y+=p),a===e&&e.markRedraw(),!0}function gm(e,t){return e[um[t][0]]!=null||e[um[t][1]]!=null&&e[um[t][2]]!=null}function _m(e){var t=e.layoutMode||e.constructor.layoutMode;return W(t)?t:t?{type:t}:null}function vm(e,t,n){var r=n&&n.ignoreSize;!V(r)&&(r=[r,r]);var i=o(um[0],0),a=o(um[1],1);l(um[0],e,i),l(um[1],e,a);function o(n,i){var a={},o=0,l={},u=0,d=2;if(cm(n,function(t){l[t]=e[t]}),cm(n,function(e){s(t,e)&&(a[e]=l[e]=t[e]),c(a,e)&&o++,c(l,e)&&u++}),r[i])return c(t,n[1])?l[n[2]]=null:c(t,n[2])&&(l[n[1]]=null),l;if(u===d||!o)return l;if(o>=d)return a;for(var f=0;f=0;o--)a=k(a,n[o],!0);t.defaultOption=a}return t.defaultOption},t.prototype.getReferringComponents=function(e,t){var n=e+`Index`,r=e+`Id`;return jo(this.ecModel,e,{index:this.get(n,!0),id:this.get(r,!0)},t)},t.prototype.getBoxLayoutParams=function(){var e=this;return{left:e.get(`left`),top:e.get(`top`),right:e.get(`right`),bottom:e.get(`bottom`),width:e.get(`width`),height:e.get(`height`)}},t.prototype.getZLevelKey=function(){return``},t.prototype.setZLevel=function(e){this.option.zlevel=e},t.protoInitialize=function(){var e=t.prototype;e.type=`component`,e.id=``,e.name=``,e.mainType=``,e.subType=``,e.componentIndex=0}(),t}(tp);Go(Sm,tp),Xo(Sm),ip(Sm),ap(Sm,Cm);function Cm(e){var t=[];return F(Sm.getClassesByMainType(e),function(e){t=t.concat(e.dependencies||e.prototype.dependencies||[])}),t=I(t,function(e){return Bo(e).main}),e!==`dataset`&&N(t,`dataset`)<=0&&t.unshift(`dataset`),t}var wm=``;typeof navigator<`u`&&(wm=navigator.platform||``);var Tm=`rgba(0, 0, 0, 0.2)`,Em={darkMode:`auto`,colorBy:`series`,color:[`#5470c6`,`#91cc75`,`#fac858`,`#ee6666`,`#73c0de`,`#3ba272`,`#fc8452`,`#9a60b4`,`#ea7ccc`],gradientColor:[`#f6efa6`,`#d88273`,`#bf444c`],aria:{decal:{decals:[{color:Tm,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:Tm,symbol:`circle`,dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:Tm,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:Tm,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:Tm,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:Tm,symbol:`triangle`,dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:wm.match(/^Win/)?`Microsoft YaHei`:`sans-serif`,fontSize:12,fontStyle:`normal`,fontWeight:`normal`},blendMode:null,stateAnimation:{duration:300,easing:`cubicOut`},animation:`auto`,animationDuration:1e3,animationDurationUpdate:500,animationEasing:`cubicInOut`,animationEasingUpdate:`cubicInOut`,animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1},Dm=K([`tooltip`,`label`,`itemName`,`itemId`,`itemGroupId`,`itemChildGroupId`,`seriesName`]),Om=`original`,km=`arrayRows`,Am=`objectRows`,jm=`keyedColumns`,Mm=`typedArray`,Nm=`unknown`,Pm=`column`,Fm={Must:1,Might:2,Not:3},Im=To();function Lm(e){Im(e).datasetMap=K()}function Rm(e,t,n){var r={},i=Bm(t);if(!i||!e)return r;var a=[],o=[],s=t.ecModel,c=Im(s).datasetMap,l=i.uid+`_`+n.seriesLayoutBy,u,d;e=e.slice(),F(e,function(t,n){var i=W(t)?t:e[n]={name:t};i.type===`ordinal`&&u==null&&(u=n,d=m(i)),r[i.name]=[]});var f=c.get(l)||c.set(l,{categoryWayDim:d,valueWayDim:0});F(e,function(e,t){var n=e.name,i=m(e);if(u==null){var s=f.valueWayDim;p(r[n],s,i),p(o,s,i),f.valueWayDim+=i}else if(u===t)p(r[n],0,i),p(a,0,i);else{var s=f.categoryWayDim;p(r[n],s,i),p(o,s,i),f.categoryWayDim+=i}});function p(e,t,n){for(var r=0;rt)return e[r];return e[n-1]}function Qm(e,t,n,r,i,a,o){a||=e;var s=t(a),c=s.paletteIdx||0,l=s.paletteNameMap=s.paletteNameMap||{};if(l.hasOwnProperty(i))return l[i];var u=o==null||!r?n:Zm(r,o);if(u||=n,!(!u||!u.length)){var d=u[c];return i&&(l[i]=d),s.paletteIdx=(c+1)%u.length,d}}function $m(e,t){t(e).paletteIdx=0,t(e).paletteNameMap={}}var eh,th,nh,rh=`\0_ec_inner`,ih=1,ah=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(e,t,n,r,i,a){r||={},this.option=null,this._theme=new tp(r),this._locale=new tp(i),this._optionManager=a},t.prototype.setOption=function(e,t,n){var r=uh(t);this._optionManager.setOption(e,n,r),this._resetOption(null,r)},t.prototype.resetOption=function(e,t){return this._resetOption(e,uh(t))},t.prototype._resetOption=function(e,t){var n=!1,r=this._optionManager;if(!e||e===`recreate`){var i=r.mountOption(e===`recreate`);!this.option||e===`recreate`?nh(this,i):(this.restoreData(),this._mergeOption(i,t)),n=!0}if((e===`timeline`||e===`media`)&&this.restoreData(),!e||e===`recreate`||e===`timeline`){var a=r.getTimelineOption(this);a&&(n=!0,this._mergeOption(a,t))}if(!e||e===`recreate`||e===`media`){var o=r.getMediaOption(this);o.length&&F(o,function(e){n=!0,this._mergeOption(e,t)},this)}return n},t.prototype.mergeOption=function(e){this._mergeOption(e,null)},t.prototype._mergeOption=function(e,t){var n=this.option,r=this._componentsMap,i=this._componentsCount,a=[],o=K(),s=t&&t.replaceMergeMainTypeMap;Lm(this),F(e,function(e,t){e!=null&&(Sm.hasClass(t)?t&&(a.push(t),o.set(t,!0)):n[t]=n[t]==null?O(e):k(n[t],e,!0))}),s&&s.each(function(e,t){Sm.hasClass(t)&&!o.get(t)&&(a.push(t),o.set(t,!0))}),Sm.topologicalTravel(a,Sm.getAllClassMainTypes(),c,this);function c(t){var a=Km(this,t,no(e[t])),o=r.get(t),c=so(o,a,o?s&&s.get(t)?`replaceMerge`:`normalMerge`:`replaceAll`);xo(c,t,Sm),n[t]=null,r.set(t,null),i.set(t,0);var l=[],u=[],d=0,f;F(c,function(e,n){var r=e.existing,i=e.newOption;if(!i)r&&(r.mergeOption({},this),r.optionUpdated({},!1));else{var a=t===`series`,o=Sm.getClass(t,e.keyInfo.subType,!a);if(!o)return;if(t===`tooltip`){if(f)return;f=!0}if(r&&r.constructor===o)r.name=e.keyInfo.name,r.mergeOption(i,this),r.optionUpdated(i,!1);else{var s=j({componentIndex:n},e.keyInfo);r=new o(i,this,this,s),j(r,s),e.brandNew&&(r.__requireNewView=!0),r.init(i,this,this),r.optionUpdated(null,!0)}}r?(l.push(r.option),u.push(r),d++):(l.push(void 0),u.push(void 0))},this),n[t]=l,r.set(t,u),i.set(t,d),t===`series`&&eh(this)}this._seriesIndices||eh(this)},t.prototype.getOption=function(){var e=O(this.option);return F(e,function(t,n){if(Sm.hasClass(n)){for(var r=no(t),i=r.length,a=!1,o=i-1;o>=0;o--)r[o]&&!yo(r[o])?a=!0:(r[o]=null,!a&&i--);r.length=i,e[n]=r}}),delete e[rh],e},t.prototype.getTheme=function(){return this._theme},t.prototype.getLocaleModel=function(){return this._locale},t.prototype.setUpdatePayload=function(e){this._payload=e},t.prototype.getUpdatePayload=function(){return this._payload},t.prototype.getComponent=function(e,t){var n=this._componentsMap.get(e);if(n){var r=n[t||0];if(r)return r;if(t==null){for(var i=0;i=t:n===`max`?e<=t:e===t}function bh(e,t){return e.join(`,`)===t.join(`,`)}var xh=F,Sh=W,Ch=[`areaStyle`,`lineStyle`,`nodeStyle`,`linkStyle`,`chordStyle`,`label`,`labelLine`];function wh(e){var t=e&&e.itemStyle;if(t)for(var n=0,r=Ch.length;n=0;h--){var g=e[h];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,f)),p>=0){var _=g.data.getByRawIndex(g.stackResultDimension,p);if(c===`all`||c===`positive`&&_>0||c===`negative`&&_<0||c===`samesign`&&d>=0&&_>0||c===`samesign`&&d<=0&&_<0){d=La(d,_),m=_;break}}}return r[0]=d,r[1]=m,r})})}var qh=function(){function e(e){this.data=e.data||(e.sourceFormat===`keyedColumns`?{}:[]),this.sourceFormat=e.sourceFormat||`unknown`,this.seriesLayoutBy=e.seriesLayoutBy||`column`,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var t=this.dimensionsDefine=e.dimensionsDefine;if(t)for(var n=0;nl&&(l=p)}s[0]=c,s[1]=l}},r=function(){return this._data?this._data.length/this._dimSize:0};sg=(e={},e[km+`_`+Pm]={pure:!0,appendData:i},e[km+`_row`]={pure:!0,appendData:function(){throw Error(`Do not support appendData when set seriesLayoutBy: "row".`)}},e[Am]={pure:!0,appendData:i},e[jm]={pure:!0,appendData:function(e){var t=this._data;F(e,function(e,n){for(var r=t[n]||(t[n]=[]),i=0;i<(e||[]).length;i++)r.push(e[i])})}},e[Om]={appendData:i},e[Mm]={persistent:!1,pure:!0,appendData:function(e){this._data=e},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(e){for(var t=0;t=0&&(s=a.interpolatedValue[c])}return s==null?``:s+``})},e.prototype.getRawValue=function(e,t){return bg(this.getData(t),e)},e.prototype.formatTooltip=function(e,t,n){},e}();function Cg(e){var t,n;return W(e)?e.type&&(n=e):t=e,{text:t,frag:n}}function wg(e){return new Tg(e)}var Tg=function(){function e(e){e||={},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return e.prototype.perform=function(e){var t=this._upstream,n=e&&e.skip;if(this._dirty&&t){var r=this.context;r.data=r.outputData=t.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var a=l(this._modBy),o=this._modDataCount||0,s=l(e&&e.modBy),c=e&&e.modDataCount||0;(a!==s||o!==c)&&(i=`reset`);function l(e){return!(e>=1)&&(e=1),e}var u;(this._dirty||i===`reset`)&&(this._dirty=!1,u=this._doReset(n)),this._modBy=s,this._modDataCount=c;var d=e&&e.step;if(this._dueEnd=t?t._outputDueEnd:this._count?this._count(this.context):1/0,this._progress){var f=this._dueIndex,p=Math.min(d==null?1/0:this._dueIndex+d,this._dueEnd);if(!n&&(u||f1&&r>0?s:o}};return a;function o(){return t=e?null:at},gte:function(e,t){return e>=t}},jg=function(){function e(e,t){oe(t)||Qa(``),this._opFn=Ag[e],this._rvalFloat=qa(t)}return e.prototype.evaluate=function(e){return oe(e)?this._opFn(e,this._rvalFloat):this._opFn(qa(e),this._rvalFloat)},e}(),Mg=function(){function e(e,t){var n=e===`desc`;this._resultLT=n?1:-1,t??=n?`min`:`max`,this._incomparable=t===`min`?-1/0:1/0}return e.prototype.evaluate=function(e,t){var n=oe(e)?e:qa(e),r=oe(t)?t:qa(t),i=isNaN(n),a=isNaN(r);if(i&&(n=this._incomparable),a&&(r=this._incomparable),i&&a){var o=U(e),s=U(t);o&&(n=s?e:0),s&&(r=o?t:0)}return nr?-this._resultLT:0},e}(),Ng=function(){function e(e,t){this._rval=t,this._isEQ=e,this._rvalTypeof=typeof t,this._rvalFloat=qa(t)}return e.prototype.evaluate=function(e){var t=e===this._rval;if(!t){var n=typeof e;n!==this._rvalTypeof&&(n===`number`||this._rvalTypeof===`number`)&&(t=qa(e)===this._rvalFloat)}return this._isEQ?t:!t},e}();function Pg(e,t){return e===`eq`||e===`ne`?new Ng(e===`eq`,t):q(Ag,e)?new jg(e,t):null}var Fg=function(){function e(){}return e.prototype.getRawData=function(){throw Error(`not supported`)},e.prototype.getRawDataItem=function(e){throw Error(`not supported`)},e.prototype.cloneRawData=function(){},e.prototype.getDimensionInfo=function(e){},e.prototype.cloneAllDimensionInfo=function(){},e.prototype.count=function(){},e.prototype.retrieveValue=function(e,t){},e.prototype.retrieveValueFromItem=function(e,t){},e.prototype.convertValue=function(e,t){return Dg(e,t)},e}();function Ig(e,t){var n=new Fg,r=e.data,i=n.sourceFormat=e.sourceFormat,a=e.startIndex;e.seriesLayoutBy!==`column`&&Qa(``);var o=[],s={},c=e.dimensionsDefine;if(c)F(c,function(e,t){var n=e.name,r={index:t,name:n,displayName:e.displayName};o.push(r),n!=null&&(q(s,n)&&Qa(``),s[n]=r)});else for(var l=0;l65535?qg:Jg}function e_(){return[1/0,-1/0]}function t_(e){var t=e.constructor;return t===Array?e.slice():new t(e)}function n_(e,t,n,r,i){var a=Zg[n||`float`];if(i){var o=e[t],s=o&&o.length;if(s!==r){for(var c=new a(r),l=0;lh[1]&&(h[1]=m)}return this._rawCount=this._count=s,{start:o,end:s}},e.prototype._initDataFromProvider=function(e,t,n){for(var r=this._provider,i=this._chunks,a=this._dimensions,o=a.length,s=this._rawExtent,c=I(a,function(e){return e.property}),l=0;lg[1]&&(g[1]=h)}}!r.persistent&&r.clean&&r.clean(),this._rawCount=this._count=t,this._extent=[]},e.prototype.count=function(){return this._count},e.prototype.get=function(e,t){if(!(t>=0&&t=0&&t=this._rawCount||e<0)return-1;if(!this._indices)return e;var t=this._indices,n=t[e];if(n!=null&&ne)i=a-1;else return a}return-1},e.prototype.indicesOfNearest=function(e,t,n){var r=this._chunks[e],i=[];if(!r)return i;n??=1/0;for(var a=1/0,o=-1,s=0,c=0,l=this.count();c=0&&o<0)&&(a=d,o=u,s=0),u===o&&(i[s++]=c))}return i.length=s,i},e.prototype.getIndices=function(){var e,t=this._indices;if(t){var n=t.constructor,r=this._count;if(n===Array){e=new n(r);for(var i=0;i=l&&g<=u||isNaN(g))&&(o[s++]=p),p++}f=!0}else if(i===2){for(var m=d[r[0]],_=d[r[1]],v=e[r[1]][0],y=e[r[1]][1],h=0;h=l&&g<=u||isNaN(g))&&(b>=v&&b<=y||isNaN(b))&&(o[s++]=p),p++}f=!0}}if(!f){if(i===1)for(var h=0;h=l&&g<=u||isNaN(g))&&(o[s++]=x)}else for(var h=0;he[w][1])&&(S=!1)}S&&(o[s++]=t.getRawIndex(h))}}return sg[1]&&(g[1]=h)}}}},e.prototype.lttbDownSample=function(e,t){var n=this.clone([e],!0),r=n._chunks[e],i=this.count(),a=0,o=Math.floor(1/t),s=this.getRawIndex(0),c,l,u,d=new($g(this._rawCount))(Math.min((Math.ceil(i/o)+2)*2,i));d[a++]=s;for(var f=1;fc&&(c=l,u=v)}T>0&&To&&(m=o-l);for(var h=0;hp&&(p=g,f=l+h)}var _=this.getRawIndex(u),v=this.getRawIndex(f);ul-p&&(s=l-p,o.length=s);for(var m=0;mu[1]&&(u[1]=g),d[f++]=_}return i._count=f,i._indices=d,i._updateGetRawIdx(),i},e.prototype.each=function(e,t){if(this._count)for(var n=e.length,r=this._chunks,i=0,a=this.count();is&&(s=l)}return a=[o,s],this._extent[e]=a,a},e.prototype.getRawDataItem=function(e){var t=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(t);for(var n=[],r=this._chunks,i=0;i=0?this._indices[e]:-1},e.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},e.internalField=function(){function e(e,t,n,r){return Dg(e[r],this._dimensions[r])}Qg={arrayRows:e,objectRows:function(e,t,n,r){return Dg(e[t],this._dimensions[r])},keyedColumns:e,original:function(e,t,n,r){var i=e&&(e.value==null?e:e.value);return Dg(i instanceof Array?i[r]:i,this._dimensions[r])},typedArray:function(e,t,n,r){return e[r]}}}(),e}(),i_=function(){function e(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return e.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},e.prototype._setLocalSource=function(e,t){this._sourceList=e,this._upstreamSignList=t,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},e.prototype._getVersionSign=function(){return this._sourceHost.uid+`_`+this._versionSignBase},e.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},e.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,t=this._getUpstreamSourceManagers(),n=!!t.length,r,i;if(o_(e)){var a=e,o=void 0,s=void 0,c=void 0;if(n){var l=t[0];l.prepareSource(),c=l.getSource(),o=c.data,s=c.sourceFormat,i=[l._getVersionSign()]}else o=a.get(`data`,!0),s=ce(o)?Mm:Om,i=[];var u=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},f=G(u.seriesLayoutBy,d.seriesLayoutBy)||null,p=G(u.sourceHeader,d.sourceHeader),m=G(u.dimensions,d.dimensions);r=f!==d.seriesLayoutBy||!!p!=!!d.sourceHeader||m?[Yh(o,{seriesLayoutBy:f,sourceHeader:p,dimensions:m},s)]:[]}else{var h=e;if(n){var g=this._applyTransform(t);r=g.sourceList,i=g.upstreamSignList}else r=[Yh(h.get(`source`,!0),this._getSourceMetaRawOption(),null)],i=[]}this._setLocalSource(r,i)},e.prototype._applyTransform=function(e){var t=this._sourceHost,n=t.get(`transform`,!0),r=t.get(`fromTransformResult`,!0);r!=null&&e.length!==1&&s_(``);var i,a=[],o=[];return F(e,function(e){e.prepareSource();var t=e.getSource(r||0);r!=null&&!t&&s_(``),a.push(t),o.push(e._getVersionSign())}),n?i=Ug(n,a,{datasetIndex:t.componentIndex}):r!=null&&(i=[Zh(a[0])]),{sourceList:i,upstreamSignList:o}},e.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),t=0;t1||n>0&&!e.noHeader;return F(e.blocks,function(e){var n=g_(e);n>=t&&(t=n+ +(r&&(!n||m_(e)&&!e.noHeader)))}),t}return 0}function __(e,t,n,r){var i=t.noHeader,a=b_(g_(t)),o=[],s=t.blocks||[];ve(!s||V(s)),s||=[];var c=e.orderMode;if(t.sortBlocks&&c){s=s.slice();var l={valueAsc:`asc`,valueDesc:`desc`};if(q(l,c)){var u=new Mg(l[c],null);s.sort(function(e,t){return u.evaluate(e.sortParam,t.sortParam)})}else c===`seriesDesc`&&s.reverse()}F(s,function(n,i){var s=t.valueFormatter,c=h_(n)(s?j(j({},e),{valueFormatter:s}):e,n,i>0?a.html:0,r);c!=null&&o.push(c)});var d=e.renderMode===`richText`?o.join(a.richText):x_(r,o.join(``),i?n:a.html);if(i)return d;var f=em(t.header,`ordinal`,e.useUTC),p=u_(r,e.renderMode).nameStyle,m=l_(r);return e.renderMode===`richText`?w_(e,f,p)+a.richText+d:x_(r,`

`+ft(f)+`
`+d,n)}function v_(e,t,n,r){var i=e.renderMode,a=t.noName,o=t.noValue,s=!t.markerType,c=t.name,l=e.useUTC,u=t.valueFormatter||e.valueFormatter||function(e){return e=V(e)?e:[e],I(e,function(e,t){return em(e,V(p)?p[t]:p,l)})};if(!(a&&o)){var d=s?``:e.markupStyleCreator.makeTooltipMarker(t.markerType,t.markerColor||`#333`,i),f=a?``:em(c,`ordinal`,l),p=t.valueType,m=o?[]:u(t.value,t.dataIndex),h=!s||!a,g=!s&&a,_=u_(r,i),v=_.nameStyle,y=_.valueStyle;return i===`richText`?(s?``:d)+(a?``:w_(e,f,v))+(o?``:T_(e,m,h,g,y)):x_(r,(s?``:d)+(a?``:S_(f,!s,v))+(o?``:C_(m,h,g,y)),n)}}function y_(e,t,n,r,i,a){if(e)return h_(e)({useUTC:i,renderMode:n,orderMode:r,markupStyleCreator:t,valueFormatter:e.valueFormatter},e,0,a)}function b_(e){return{html:d_[e],richText:f_[e]}}function x_(e,t,n){var r=`
`,i=`margin: `+n+`px 0 0`,a=l_(e);return`
`+t+r+`
`}function S_(e,t,n){var r=t?`margin-left:2px`:``;return``+ft(e)+``}function C_(e,t,n,r){var i=t?`float:right;margin-left:`+(n?`10px`:`20px`):``;return e=V(e)?e:[e],``+I(e,function(e){return ft(e)}).join(`  `)+``}function w_(e,t,n){return e.markupStyleCreator.wrapRichTextStyle(t,n)}function T_(e,t,n,r,i){var a=[i],o=r?10:20;return n&&a.push({padding:[0,0,0,o],align:`right`}),e.markupStyleCreator.wrapRichTextStyle(V(t)?t.join(` `):t,a)}function E_(e,t){var n=e.getData().getItemVisual(t,`style`)[e.visualDrawType];return om(n)}function D_(e,t){return e.get(`padding`)??(t===`richText`?[8,10]:10)}var O_=function(){function e(){this.richTextStyles={},this._nextStyleNameId=Ya()}return e.prototype._generateStyleName=function(){return`__EC_aUTo_`+this._nextStyleNameId++},e.prototype.makeTooltipMarker=function(e,t,n){var r=n===`richText`?this._generateStyleName():null,i=am({color:t,type:e,renderMode:n,markerId:r});return U(i)?i:(this.richTextStyles[r]=i.style,i.content)},e.prototype.wrapRichTextStyle=function(e,t){var n={};V(t)?F(t,function(e){return j(n,e)}):j(n,t);var r=this._generateStyleName();return this.richTextStyles[r]=n,`{`+r+`|`+e+`}`},e}();function k_(e){var t=e.series,n=e.dataIndex,r=e.multipleSeries,i=t.getData(),a=i.mapDimensionsAll(`defaultedTooltip`),o=a.length,s=t.getRawValue(n),c=V(s),l=E_(t,n),u,d,f,p;if(o>1||c&&!o){var m=A_(s,t,n,a,l);u=m.inlineValues,d=m.inlineValueTypes,f=m.blocks,p=m.inlineValues[0]}else if(o){var h=i.getDimensionInfo(a[0]);p=u=bg(i,n,a[0]),d=h.type}else p=u=c?s[0]:s;var g=vo(t),_=g&&t.name||``,v=i.getName(n),y=r?_:v;return p_(`section`,{header:_,noHeader:r||!g,sortParam:p,blocks:[p_(`nameValue`,{markerType:`item`,markerColor:l,name:y,noName:!ye(y),value:u,valueType:d,dataIndex:n})].concat(f||[])})}function A_(e,t,n,r,i){var a=t.getData(),o=ne(e,function(e,t,n){var r=a.getDimensionInfo(n);return e||=r&&r.tooltip!==!1&&r.displayName!=null},!1),s=[],c=[],l=[];r.length?F(r,function(e){u(bg(a,n,e),e)}):F(e,u);function u(e,t){var n=a.getDimensionInfo(t);!n||n.otherDims.tooltip===!1||(o?l.push(p_(`nameValue`,{markerType:`subItem`,markerColor:i,name:n.displayName,value:e,valueType:n.type})):(s.push(e),c.push(n.type)))}return{inlineValues:s,inlineValueTypes:c,blocks:l}}var j_=To();function M_(e,t){return e.getName(t)||e.getId(t)}var N_=`__universalTransitionEnabled`,P_=function(e){r(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t._selectedDataIndicesMap={},t}return t.prototype.init=function(e,t,n){this.seriesIndex=this.componentIndex,this.dataTask=wg({count:L_,reset:R_}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(e,n),(j_(this).sourceManager=new i_(this)).prepareSource();var r=this.getInitialData(e,n);B_(r,this),this.dataTask.context.data=r,j_(this).dataBeforeProcessed=r,F_(this),this._initSelectedMapFromData(r)},t.prototype.mergeDefaultAndTheme=function(e,t){var n=_m(this),r=n?ym(e):{},i=this.subType;Sm.hasClass(i)&&(i+=`Series`),k(e,t.getTheme().get(this.subType)),k(e,this.getDefaultOption()),ro(e,`label`,[`show`]),this.fillDataTextStyle(e.data),n&&vm(e,r,n)},t.prototype.mergeOption=function(e,t){e=k(this.option,e,!0),this.fillDataTextStyle(e.data);var n=_m(this);n&&vm(this.option,e,n);var r=j_(this).sourceManager;r.dirty(),r.prepareSource();var i=this.getInitialData(e,t);B_(i,this),this.dataTask.dirty(),this.dataTask.context.data=i,j_(this).dataBeforeProcessed=i,F_(this),this._initSelectedMapFromData(i)},t.prototype.fillDataTextStyle=function(e){if(e&&!ce(e))for(var t=[`show`],n=0;nthis.getShallow(`animationThreshold`)&&(t=!1),!!t},t.prototype.restoreData=function(){this.dataTask.dirty()},t.prototype.getColorFromPalette=function(e,t,n){var r=this.ecModel,i=Ym.prototype.getColorFromPalette.call(this,e,t,n);return i||=r.getColorFromPalette(e,t,n),i},t.prototype.coordDimToDataDim=function(e){return this.getRawData().mapDimensionsAll(e)},t.prototype.getProgressive=function(){return this.get(`progressive`)},t.prototype.getProgressiveThreshold=function(){return this.get(`progressiveThreshold`)},t.prototype.select=function(e,t){this._innerSelect(this.getData(t),e)},t.prototype.unselect=function(e,t){var n=this.option.selectedMap;if(n){var r=this.option.selectedMode,i=this.getData(t);if(r===`series`||n===`all`){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var a=0;a=0&&n.push(i)}return n},t.prototype.isSelected=function(e,t){var n=this.option.selectedMap;if(!n)return!1;var r=this.getData(t);return(n===`all`||n[M_(r,e)])&&!r.getItemModel(e).get([`select`,`disabled`])},t.prototype.isUniversalTransitionEnabled=function(){if(this.__universalTransitionEnabled)return!0;var e=this.option.universalTransition;return e?e===!0||e&&e.enabled:!1},t.prototype._innerSelect=function(e,t){var n,r,i=this.option,a=i.selectedMode,o=t.length;if(!(!a||!o)){if(a===`series`)i.selectedMap=`all`;else if(a===`multiple`){W(i.selectedMap)||(i.selectedMap={});for(var s=i.selectedMap,c=0;c0&&this._innerSelect(e,t)}},t.registerClass=function(e){return Sm.registerClass(e)},t.protoInitialize=function(){var e=t.prototype;e.type=`series.__base__`,e.seriesIndex=0,e.ignoreStyleOnData=!1,e.hasSymbolVisual=!1,e.defaultSymbol=`circle`,e.visualStyleAccessPath=`itemStyle`,e.visualDrawType=`fill`}(),t}(Sm);P(P_,Sg),P(P_,Ym),Go(P_,Sm);function F_(e){var t=e.name;vo(e)||(e.name=I_(e)||t)}function I_(e){var t=e.getRawData(),n=t.mapDimensionsAll(`seriesName`),r=[];return F(n,function(e){var n=t.getDimensionInfo(e);n.displayName&&r.push(n.displayName)}),r.join(` `)}function L_(e){return e.model.getRawData().count()}function R_(e){var t=e.model;return t.setData(t.getRawData().cloneShallow()),z_}function z_(e,t){t.outputData&&e.end>t.outputData.count()&&t.model.getRawData().cloneShallow(t.outputData)}function B_(e,t){F(De(e.CHANGABLE_METHODS,e.DOWNSAMPLE_METHODS),function(n){e.wrapMethod(n,B(V_,t))})}function V_(e,t){var n=H_(e);return n&&n.setOutputEnd((t||this).count()),t}function H_(e){var t=(e.ecModel||{}).scheduler,n=t&&t.getPipeline(e.uid);if(n){var r=n.currentTask;if(r){var i=r.agentStubMap;i&&(r=i.get(e.uid))}return r}}var U_=function(){function e(){this.group=new X,this.uid=rp(`viewComponent`)}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){},e.prototype.updateLayout=function(e,t,n,r){},e.prototype.updateVisual=function(e,t,n,r){},e.prototype.toggleBlurSeries=function(e,t,n){},e.prototype.eachRendered=function(e){var t=this.group;t&&t.traverse(e)},e}();Uo(U_),Xo(U_);function W_(){var e=To();return function(t){var n=e(t),r=t.pipelineContext,i=!!n.large,a=!!n.progressiveRender,o=n.large=!!(r&&r.large),s=n.progressiveRender=!!(r&&r.progressiveRender);return(i!==o||a!==s)&&`reset`}}var G_=To(),K_=W_(),q_=function(){function e(){this.group=new X,this.uid=rp(`viewChart`),this.renderTask=wg({plan:X_,reset:Z_}),this.renderTask.context={view:this}}return e.prototype.init=function(e,t){},e.prototype.render=function(e,t,n,r){},e.prototype.highlight=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&Y_(i,r,`emphasis`)},e.prototype.downplay=function(e,t,n,r){var i=e.getData(r&&r.dataType);i&&Y_(i,r,`normal`)},e.prototype.remove=function(e,t){this.group.removeAll()},e.prototype.dispose=function(e,t){},e.prototype.updateView=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateLayout=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.updateVisual=function(e,t,n,r){this.render(e,t,n,r)},e.prototype.eachRendered=function(e){Df(this.group,e)},e.markUpdateMethod=function(e,t){G_(e).updateMethod=t},e.protoInitialize=function(){var t=e.prototype;t.type=`chart`}(),e}();function J_(e,t,n){e&&pu(e)&&(t===`emphasis`?Hl:Ul)(e,n)}function Y_(e,t,n){var r=wo(e,t),i=t&&t.highlightKey!=null?hu(t.highlightKey):null;r==null?e.eachItemGraphicEl(function(e){J_(e,n,i)}):F(no(r),function(t){J_(e.getItemGraphicEl(t),n,i)})}Uo(q_,[`dispose`]),Xo(q_);function X_(e){return K_(e.model)}function Z_(e){var t=e.model,n=e.ecModel,r=e.api,i=e.payload,a=t.pipelineContext.progressiveRender,o=e.view,s=i&&G_(i).updateMethod,c=a?`incrementalPrepareRender`:s&&o[s]?s:`render`;return c!==`render`&&o[c](t,n,r,i),Q_[c]}var Q_={incrementalPrepareRender:{progress:function(e,t){t.view.incrementalRender(e,t.model,t.ecModel,t.api,t.payload)}},render:{forceFirstProgress:!0,progress:function(e,t){t.view.render(t.model,t.ecModel,t.api,t.payload)}}},$_=`\0__throttleOriginMethod`,ev=`\0__throttleRate`,tv=`\0__throttleType`;function nv(e,t,n){var r,i=0,a=0,o=null,s,c,l,u;t||=0;function d(){a=new Date().getTime(),o=null,e.apply(c,l||[])}var f=function(){for(var e=[],f=0;f=0?d():o=setTimeout(d,-s),i=r};return f.clear=function(){o&&=(clearTimeout(o),null)},f.debounceNextCall=function(e){u=e},f}function rv(e,t,n,r){var i=e[t];if(i){var a=i[$_]||i,o=i[tv];if(i[ev]!==n||o!==r){if(n==null||!r)return e[t]=a;i=e[t]=nv(a,n,r===`debounce`),i[$_]=a,i[tv]=r,i[ev]=n}return i}}function iv(e,t){var n=e[t];n&&n[$_]&&(n.clear&&n.clear(),e[t]=n[$_])}var av=To(),ov={itemStyle:Zo(Qf,!0),lineStyle:Zo(Yf,!0)},sv={lineStyle:`stroke`,itemStyle:`fill`};function cv(e,t){return e.visualStyleMapper||ov[t]||(console.warn(`Unknown style type '`+t+`'.`),ov.itemStyle)}function lv(e,t){return e.visualDrawType||sv[t]||(console.warn(`Unknown style type '`+t+`'.`),`fill`)}var uv={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=e.getModel(r),a=cv(e,r)(i),o=i.getShallow(`decal`);o&&(n.setVisual(`decal`,o),o.dirty=!0);var s=lv(e,r),c=a[s],l=H(c)?c:null,u=a.fill===`auto`||a.stroke===`auto`;if(!a[s]||l||u){var d=e.getColorFromPalette(e.name,null,t.getSeriesCount());a[s]||(a[s]=d,n.setVisual(`colorFromPalette`,!0)),a.fill=a.fill===`auto`||H(a.fill)?d:a.fill,a.stroke=a.stroke===`auto`||H(a.stroke)?d:a.stroke}if(n.setVisual(`style`,a),n.setVisual(`drawType`,s),!t.isSeriesFiltered(e)&&l)return n.setVisual(`colorFromPalette`,!1),{dataEach:function(t,n){var r=e.getDataParams(n),i=j({},a);i[s]=l(r),t.setItemVisual(n,`style`,i)}}}},dv=new tp,fv={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){if(!(e.ignoreStyleOnData||t.isSeriesFiltered(e))){var n=e.getData(),r=e.visualStyleAccessPath||`itemStyle`,i=cv(e,r),a=n.getVisual(`drawType`);return{dataEach:n.hasItemOption?function(e,t){var n=e.getRawDataItem(t);if(n&&n[r]){dv.option=n[r];var o=i(dv);j(e.ensureUniqueItemVisual(t,`style`),o),dv.option.decal&&(e.setItemVisual(t,`decal`,dv.option.decal),dv.option.decal.dirty=!0),a in o&&e.setItemVisual(t,`colorFromPalette`,!1)}}:null}}}},pv={performRawSeries:!0,overallReset:function(e){var t=K();e.eachSeries(function(e){var n=e.getColorBy();if(!e.isColorBySeries()){var r=e.type+`-`+n,i=t.get(r);i||(i={},t.set(r,i)),av(e).scope=i}}),e.eachSeries(function(t){if(!(t.isColorBySeries()||e.isSeriesFiltered(t))){var n=t.getRawData(),r={},i=t.getData(),a=av(t).scope,o=lv(t,t.visualStyleAccessPath||`itemStyle`);i.each(function(e){var t=i.getRawIndex(e);r[t]=e}),n.each(function(e){var s=r[e];if(i.getItemVisual(s,`colorFromPalette`)){var c=i.ensureUniqueItemVisual(s,`style`),l=n.getName(e)||e+``,u=n.count();c[o]=t.getColorFromPalette(l,a,u)}})}})}},mv=Math.PI;function hv(e,t){t||={},M(t,{text:`loading`,textColor:`#000`,fontSize:12,fontWeight:`normal`,fontStyle:`normal`,fontFamily:`sans-serif`,maskColor:`rgba(255, 255, 255, 0.8)`,showSpinner:!0,color:`#5470c6`,spinnerRadius:10,lineWidth:5,zlevel:0});var n=new X,r=new qc({style:{fill:t.maskColor},zlevel:t.zlevel,z:1e4});n.add(r);var i=new Zc({style:{text:t.text,fill:t.textColor,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,fontFamily:t.fontFamily},zlevel:t.zlevel,z:10001}),a=new qc({style:{fill:`none`},textContent:i,textConfig:{position:`right`,distance:10},zlevel:t.zlevel,z:10001});n.add(a);var o;return t.showSpinner&&(o=new Td({shape:{startAngle:-mv/2,endAngle:-mv/2+.1,r:t.spinnerRadius},style:{stroke:t.color,lineCap:`round`,lineWidth:t.lineWidth},zlevel:t.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:mv*3/2}).start(`circularInOut`),o.animateShape(!0).when(1e3,{startAngle:mv*3/2}).delay(300).start(`circularInOut`),n.add(o)),n.resize=function(){var n=i.getBoundingRect().width,s=t.showSpinner?t.spinnerRadius:0,c=(e.getWidth()-s*2-(t.showSpinner&&n?10:0)-n)/2-(t.showSpinner&&n?0:5+n/2)+(t.showSpinner?0:n/2)+(n?0:s),l=e.getHeight()/2;t.showSpinner&&o.setShape({cx:c,cy:l}),a.setShape({x:c-s,y:l-s,width:s*2,height:s*2}),r.setShape({x:0,y:0,width:e.getWidth(),height:e.getHeight()})},n.resize(),n}var gv=function(){function e(e,t,n,r){this._stageTaskMap=K(),this.ecInstance=e,this.api=t,n=this._dataProcessorHandlers=n.slice(),r=this._visualHandlers=r.slice(),this._allHandlers=n.concat(r)}return e.prototype.restoreData=function(e,t){e.restoreData(t),this._stageTaskMap.each(function(e){var t=e.overallTask;t&&t.dirty()})},e.prototype.getPerformArgs=function(e,t){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),r=n.context,i=!t&&n.progressiveEnabled&&(!r||r.progressiveRender)&&e.__idxInPipeline>n.blockIndex?n.step:null,a=r&&r.modDataCount;return{step:i,modBy:a==null?null:Math.ceil(a/i),modDataCount:a}}},e.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},e.prototype.updateStreamModes=function(e,t){var n=this._pipelineMap.get(e.uid),r=e.getData().count(),i=n.progressiveEnabled&&t.incrementalPrepareRender&&r>=n.threshold,a=e.get(`large`)&&r>=e.get(`largeThreshold`);e.pipelineContext=n.context={progressiveRender:i,modDataCount:e.get(`progressiveChunkMode`)===`mod`?r:null,large:a}},e.prototype.restorePipelines=function(e){var t=this,n=t._pipelineMap=K();e.eachSeries(function(e){var r=e.getProgressive(),i=e.uid;n.set(i,{id:i,head:null,tail:null,threshold:e.getProgressiveThreshold(),progressiveEnabled:r&&!(e.preventIncremental&&e.preventIncremental()),blockIndex:-1,step:Math.round(r||700),count:0}),t._pipe(e,e.dataTask)})},e.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,t=this.api.getModel(),n=this.api;F(this._allHandlers,function(r){var i=e.get(r.uid)||e.set(r.uid,{});ve(!(r.reset&&r.overallReset),``),r.reset&&this._createSeriesStageTask(r,i,t,n),r.overallReset&&this._createOverallStageTask(r,i,t,n)},this)},e.prototype.prepareView=function(e,t,n,r){var i=e.renderTask,a=i.context;a.model=t,a.ecModel=n,a.api=r,i.__block=!e.incrementalPrepareRender,this._pipe(t,i)},e.prototype.performDataProcessorTasks=function(e,t){this._performStageTasks(this._dataProcessorHandlers,e,t,{block:!0})},e.prototype.performVisualTasks=function(e,t,n){this._performStageTasks(this._visualHandlers,e,t,n)},e.prototype._performStageTasks=function(e,t,n,r){r||={};var i=!1,a=this;F(e,function(e,s){if(!(r.visualType&&r.visualType!==e.visualType)){var c=a._stageTaskMap.get(e.uid),l=c.seriesTaskMap,u=c.overallTask;if(u){var d,f=u.agentStubMap;f.each(function(e){o(r,e)&&(e.dirty(),d=!0)}),d&&u.dirty(),a.updatePayload(u,n);var p=a.getPerformArgs(u,r.block);f.each(function(e){e.perform(p)}),u.perform(p)&&(i=!0)}else l&&l.each(function(s,c){o(r,s)&&s.dirty();var l=a.getPerformArgs(s,r.block);l.skip=!e.performRawSeries&&t.isSeriesFiltered(s.context.model),a.updatePayload(s,n),s.perform(l)&&(i=!0)})}});function o(e,t){return e.setDirty&&(!e.dirtyMap||e.dirtyMap.get(t.__pipeline.id))}this.unfinished=i||this.unfinished},e.prototype.performSeriesTasks=function(e){var t;e.eachSeries(function(e){t=e.dataTask.perform()||t}),this.unfinished=t||this.unfinished},e.prototype.plan=function(){this._pipelineMap.each(function(e){var t=e.tail;do{if(t.__block){e.blockIndex=t.__idxInPipeline;break}t=t.getUpstream()}while(t)})},e.prototype.updatePayload=function(e,t){t!==`remain`&&(e.context.payload=t)},e.prototype._createSeriesStageTask=function(e,t,n,r){var i=this,a=t.seriesTaskMap,o=t.seriesTaskMap=K(),s=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(l):s?n.eachRawSeriesByType(s,l):c&&c(n,r).each(l);function l(t){var s=t.uid,c=o.set(s,a&&a.get(s)||wg({plan:xv,reset:Sv,count:Tv}));c.context={model:t,ecModel:n,api:r,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(t,c)}},e.prototype._createOverallStageTask=function(e,t,n,r){var i=this,a=t.overallTask=t.overallTask||wg({reset:_v});a.context={ecModel:n,api:r,overallReset:e.overallReset,scheduler:i};var o=a.agentStubMap,s=a.agentStubMap=K(),c=e.seriesType,l=e.getTargetSeries,u=!0,d=!1;ve(!e.createOnAllSeries,``),c?n.eachRawSeriesByType(c,f):l?l(n,r).each(f):(u=!1,F(n.getSeries(),f));function f(e){var t=e.uid,n=s.set(t,o&&o.get(t)||(d=!0,wg({reset:vv,onDirty:bv})));n.context={model:e,overallProgress:u},n.agent=a,n.__block=u,i._pipe(e,n)}d&&a.dirty()},e.prototype._pipe=function(e,t){var n=e.uid,r=this._pipelineMap.get(n);!r.head&&(r.head=t),r.tail&&r.tail.pipe(t),r.tail=t,t.__idxInPipeline=r.count++,t.__pipeline=r},e.wrapStageHandler=function(e,t){return H(e)&&(e={overallReset:e,seriesType:Ev(e)}),e.uid=rp(`stageHandler`),t&&(e.visualType=t),e},e}();function _v(e){e.overallReset(e.ecModel,e.api,e.payload)}function vv(e){return e.overallProgress&&yv}function yv(){this.agent.dirty(),this.getDownstream().dirty()}function bv(){this.agent&&this.agent.dirty()}function xv(e){return e.plan?e.plan(e.model,e.ecModel,e.api,e.payload):null}function Sv(e){e.useClearVisual&&e.data.clearAllVisual();var t=e.resetDefines=no(e.reset(e.model,e.ecModel,e.api,e.payload));return t.length>1?I(t,function(e,t){return wv(t)}):Cv}var Cv=wv(0);function wv(e){return function(t,n){var r=n.data,i=n.resetDefines[e];if(i&&i.dataEach)for(var a=t.start;a0&&u===i.length-l.length){var d=i.slice(0,u);d!==`data`&&(t.mainType=d,t[l.toLowerCase()]=e,s=!0)}}o.hasOwnProperty(i)&&(n[i]=e,s=!0),s||(r[i]=e)})}return{cptQuery:t,dataQuery:n,otherQuery:r}},e.prototype.filter=function(e,t){var n=this.eventInfo;if(!n)return!0;var r=n.targetEl,i=n.packedEvent,a=n.model,o=n.view;if(!a||!o)return!0;var s=t.cptQuery,c=t.dataQuery;return l(s,a,`mainType`)&&l(s,a,`subType`)&&l(s,a,`index`,`componentIndex`)&&l(s,a,`name`)&&l(s,a,`id`)&&l(c,i,`name`)&&l(c,i,`dataIndex`)&&l(c,i,`dataType`)&&(!o.filterForExposedEvent||o.filterForExposedEvent(e,t.otherQuery,r,i));function l(e,t,n,r){return e[n]==null||t[r||n]===e[n]}},e.prototype.afterTrigger=function(){this.eventInfo=null},e}(),zv=[`symbol`,`symbolSize`,`symbolRotate`,`symbolOffset`],Bv=zv.concat([`symbolKeepAspect`]),Vv={createOnAllSeries:!0,performRawSeries:!0,reset:function(e,t){var n=e.getData();if(e.legendIcon&&n.setVisual(`legendIcon`,e.legendIcon),!e.hasSymbolVisual)return;for(var r={},i={},a=!1,o=0;o=0&&cy(c)?c:.5,e.createRadialGradient(o,s,0,o,s,c)}function dy(e,t,n){for(var r=t.type===`radial`?uy(e,t,n):ly(e,t,n),i=t.colorStops,a=0;a0)?null:e===`dashed`?[4*t,2*t]:e===`dotted`?[t]:oe(e)?[e]:V(e)?e:null}function gy(e){var t=e.style,n=t.lineDash&&t.lineWidth>0&&hy(t.lineDash,t.lineWidth),r=t.lineDashOffset;if(n){var i=t.strokeNoScale&&e.getLineScale?e.getLineScale():1;i&&i!==1&&(n=I(n,function(e){return e/i}),r/=i)}return[n,r]}var _y=new cc(!0);function vy(e){var t=e.stroke;return!(t==null||t===`none`||!(e.lineWidth>0))}function yy(e){return typeof e==`string`&&e!==`none`}function by(e){var t=e.fill;return t!=null&&t!==`none`}function xy(e,t){if(t.fillOpacity!=null&&t.fillOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.fillOpacity*t.opacity,e.fill(),e.globalAlpha=n}else e.fill()}function Sy(e,t){if(t.strokeOpacity!=null&&t.strokeOpacity!==1){var n=e.globalAlpha;e.globalAlpha=t.strokeOpacity*t.opacity,e.stroke(),e.globalAlpha=n}else e.stroke()}function Cy(e,t,n){var r=ns(t.image,t.__image,n);if(is(r)){var i=e.createPattern(r,t.repeat||`repeat`);if(typeof DOMMatrix==`function`&&i&&i.setTransform){var a=new DOMMatrix;a.translateSelf(t.x||0,t.y||0),a.rotateSelf(0,0,(t.rotation||0)*je),a.scaleSelf(t.scaleX||1,t.scaleY||1),i.setTransform(a)}return i}}function wy(e,t,n,r){var i,a=vy(n),o=by(n),s=n.strokePercent,c=s<1,l=!t.path;(!t.silent||c)&&l&&t.createPathProxy();var u=t.path||_y,d=t.__dirty;if(!r){var f=n.fill,p=n.stroke,m=o&&!!f.colorStops,h=a&&!!p.colorStops,g=o&&!!f.image,_=a&&!!p.image,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0;(m||h)&&(S=t.getBoundingRect()),m&&(v=d?dy(e,f,S):t.__canvasFillGradient,t.__canvasFillGradient=v),h&&(y=d?dy(e,p,S):t.__canvasStrokeGradient,t.__canvasStrokeGradient=y),g&&(b=d||!t.__canvasFillPattern?Cy(e,f,t):t.__canvasFillPattern,t.__canvasFillPattern=b),_&&(x=d||!t.__canvasStrokePattern?Cy(e,p,t):t.__canvasStrokePattern,t.__canvasStrokePattern=b),m?e.fillStyle=v:g&&(b?e.fillStyle=b:o=!1),h?e.strokeStyle=y:_&&(x?e.strokeStyle=x:a=!1)}var C=t.getGlobalScale();u.setScale(C[0],C[1],t.segmentIgnoreThreshold);var w,T;e.setLineDash&&n.lineDash&&(i=gy(t),w=i[0],T=i[1]);var E=!0;(l||d&4)&&(u.setDPR(e.dpr),c?u.setContext(null):(u.setContext(e),E=!1),u.reset(),t.buildPath(u,t.shape,r),u.toStatic(),t.pathUpdated()),E&&u.rebuildPath(e,c?s:1),w&&(e.setLineDash(w),e.lineDashOffset=T),r||(n.strokeFirst?(a&&Sy(e,n),o&&xy(e,n)):(o&&xy(e,n),a&&Sy(e,n))),w&&e.setLineDash([])}function Ty(e,t,n){var r=t.__image=ns(n.image,t.__image,t,t.onload);if(!(!r||!is(r))){var i=n.x||0,a=n.y||0,o=t.getWidth(),s=t.getHeight(),c=r.width/r.height;if(o==null&&s!=null?o=s*c:s==null&&o!=null?s=o/c:o==null&&s==null&&(o=r.width,s=r.height),n.sWidth&&n.sHeight){var l=n.sx||0,u=n.sy||0;e.drawImage(r,l,u,n.sWidth,n.sHeight,i,a,o,s)}else if(n.sx&&n.sy){var l=n.sx,u=n.sy,d=o-l,f=s-u;e.drawImage(r,l,u,d,f,i,a,o,s)}else e.drawImage(r,i,a,o,s)}}function Ey(e,t,n){var r,i=n.text;if(i!=null&&(i+=``),i){e.font=n.font||`12px sans-serif`,e.textAlign=n.textAlign,e.textBaseline=n.textBaseline;var a=void 0,o=void 0;e.setLineDash&&n.lineDash&&(r=gy(t),a=r[0],o=r[1]),a&&(e.setLineDash(a),e.lineDashOffset=o),n.strokeFirst?(vy(n)&&e.strokeText(i,n.x,n.y),by(n)&&e.fillText(i,n.x,n.y)):(by(n)&&e.fillText(i,n.x,n.y),vy(n)&&e.strokeText(i,n.x,n.y)),a&&e.setLineDash([])}}var Dy=[`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`],Oy=[[`lineCap`,`butt`],[`lineJoin`,`miter`],[`miterLimit`,10]];function ky(e,t,n,r,i){var a=!1;if(!r&&(n||={},t===n))return!1;if(r||t.opacity!==n.opacity){By(e,i),a=!0;var o=Math.max(Math.min(t.opacity,1),0);e.globalAlpha=isNaN(o)?xs.opacity:o}(r||t.blend!==n.blend)&&(a||=(By(e,i),!0),e.globalCompositeOperation=t.blend||xs.blend);for(var s=0;s0&&e.unfinished);e.unfinished||this._zr.flush()}}},t.prototype.getDom=function(){return this._dom},t.prototype.getId=function(){return this.id},t.prototype.getZr=function(){return this._zr},t.prototype.isSSR=function(){return this._ssr},t.prototype.setOption=function(e,t,n){if(!this[Sb]){if(this._disposed){this.id;return}var r,i,a;if(W(t)&&(n=t.lazyUpdate,r=t.silent,i=t.replaceMerge,a=t.transition,t=t.notMerge),this[Sb]=!0,!this._model||t){var o=new gh(this._api),s=this._theme,c=this._model=new ah;c.scheduler=this._scheduler,c.ssr=this._ssr,c.init(null,null,null,s,this._locale,o)}this._model.setOption(e,{replaceMerge:i},ax);var l={seriesTransition:a,optionChanged:!0};if(n)this[Cb]={silent:r,updateParams:l},this[Sb]=!1,this.getZr().wakeUp();else{try{Fb(this),Rb.update.call(this,null,l)}catch(e){throw this[Cb]=null,this[Sb]=!1,e}this._ssr||this._zr.flush(),this[Cb]=null,this[Sb]=!1,Hb.call(this,r),Ub.call(this,r)}}},t.prototype.setTheme=function(){},t.prototype.getModel=function(){return this._model},t.prototype.getOption=function(){return this._model&&this._model.getOption()},t.prototype.getWidth=function(){return this._zr.getWidth()},t.prototype.getHeight=function(){return this._zr.getHeight()},t.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||a.hasGlobalWindow&&window.devicePixelRatio||1},t.prototype.getRenderedCanvas=function(e){return this.renderToCanvas(e)},t.prototype.renderToCanvas=function(e){return e||={},this._zr.painter.getRenderedCanvas({backgroundColor:e.backgroundColor||this._model.get(`backgroundColor`),pixelRatio:e.pixelRatio||this.getDevicePixelRatio()})},t.prototype.renderToSVGString=function(e){return e||={},this._zr.painter.renderToString({useViewBox:e.useViewBox})},t.prototype.getSvgDataURL=function(){if(a.svgSupported){var e=this._zr;return F(e.storage.getDisplayList(),function(e){e.stopAnimation(null,!0)}),e.painter.toDataURL()}},t.prototype.getDataURL=function(e){if(this._disposed){this.id;return}e||={};var t=e.excludeComponents,n=this._model,r=[],i=this;F(t,function(e){n.eachComponent({mainType:e},function(e){var t=i._componentsMap[e.__viewId];t.group.ignore||(r.push(t),t.group.ignore=!0)})});var a=this._zr.painter.getType()===`svg`?this.getSvgDataURL():this.renderToCanvas(e).toDataURL(`image/`+(e&&e.type||`png`));return F(r,function(e){e.group.ignore=!1}),a},t.prototype.getConnectedDataURL=function(e){if(this._disposed){this.id;return}var t=e.type===`svg`,n=this.group,r=Math.min,i=Math.max,a=1/0;if(ux[n]){var o=a,s=a,c=-a,l=-a,u=[],d=e&&e.pixelRatio||this.getDevicePixelRatio();F(lx,function(a,d){if(a.group===n){var f=t?a.getZr().painter.getSvgDom().innerHTML:a.renderToCanvas(O(e)),p=a.getDom().getBoundingClientRect();o=r(p.left,o),s=r(p.top,s),c=i(p.right,c),l=i(p.bottom,l),u.push({dom:f,left:p.left,top:p.top})}}),o*=d,s*=d,c*=d,l*=d;var f=c-o,m=l-s,h=p.createCanvas(),g=Sa(h,{renderer:t?`svg`:`canvas`});if(g.resize({width:f,height:m}),t){var _=``;return F(u,function(e){var t=e.left-o,n=e.top-s;_+=``+e.dom+``}),g.painter.getSvgRoot().innerHTML=_,e.connectedBackgroundColor&&g.painter.setBackgroundColor(e.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}return e.connectedBackgroundColor&&g.add(new qc({shape:{x:0,y:0,width:f,height:m},style:{fill:e.connectedBackgroundColor}})),F(u,function(e){var t=new zc({style:{x:e.left*d-o,y:e.top*d-s,image:e.dom}});g.add(t)}),g.refreshImmediately(),h.toDataURL(`image/`+(e&&e.type||`png`))}return this.getDataURL(e)},t.prototype.convertToPixel=function(e,t){return zb(this,`convertToPixel`,e,t)},t.prototype.convertFromPixel=function(e,t){return zb(this,`convertFromPixel`,e,t)},t.prototype.containPixel=function(e,t){if(this._disposed){this.id;return}var n=this._model,r;return F(Do(n,e),function(e,n){n.indexOf(`Models`)>=0&&F(e,function(e){var i=e.coordinateSystem;if(i&&i.containPoint)r||=!!i.containPoint(t);else if(n===`seriesModels`){var a=this._chartsMap[e.__viewId];a&&a.containPoint&&(r||=a.containPoint(t,e))}},this)},this),!!r},t.prototype.getVisual=function(e,t){var n=this._model,r=Do(n,e,{defaultMainType:`series`}),i=r.seriesModel.getData(),a=r.hasOwnProperty(`dataIndexInside`)?r.dataIndexInside:r.hasOwnProperty(`dataIndex`)?i.indexOfRawIndex(r.dataIndex):null;return a==null?Wv(i,t):Uv(i,a,t)},t.prototype.getViewOfComponentModel=function(e){return this._componentsMap[e.__viewId]},t.prototype.getViewOfSeriesModel=function(e){return this._chartsMap[e.__viewId]},t.prototype._initEvents=function(){var e=this;F(tx,function(t){var n=function(n){var r=e.getModel(),i=n.target,a;if(t===`globalout`?a={}:i&&Yv(i,function(e){var t=Q(e);if(t&&t.dataIndex!=null){var n=t.dataModel||r.getSeriesByIndex(t.seriesIndex);return a=n&&n.getDataParams(t.dataIndex,t.dataType,i)||{},!0}if(t.eventData)return a=j({},t.eventData),!0},!0),a){var o=a.componentType,s=a.componentIndex;(o===`markLine`||o===`markPoint`||o===`markArea`)&&(o=`series`,s=a.seriesIndex);var c=o&&s!=null&&r.getComponent(o,s),l=c&&e[c.mainType===`series`?`_chartsMap`:`_componentsMap`][c.__viewId];a.event=n,a.type=t,e._$eventProcessor.eventInfo={targetEl:i,packedEvent:a,model:c,view:l},e.trigger(t,a)}};n.zrEventfulCallAtLast=!0,e._zr.on(t,n,e)}),F(rx,function(t,n){e._messageCenter.on(n,function(e){this.trigger(n,e)},e)}),F([`selectchanged`],function(t){e._messageCenter.on(t,function(e){this.trigger(t,e)},e)}),Jv(this._messageCenter,this,this._api)},t.prototype.isDisposed=function(){return this._disposed},t.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},t.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0,this.getDom()&&Mo(this.getDom(),fx,``);var e=this,t=e._api,n=e._model;F(e._componentsViews,function(e){e.dispose(n,t)}),F(e._chartsViews,function(e){e.dispose(n,t)}),e._zr.dispose(),e._dom=e._model=e._chartsMap=e._componentsMap=e._chartsViews=e._componentsViews=e._scheduler=e._api=e._zr=e._throttledZrFlush=e._theme=e._coordSysMgr=e._messageCenter=null,delete lx[e.id]},t.prototype.resize=function(e){if(!this[Sb]){if(this._disposed){this.id;return}this._zr.resize(e);var t=this._model;if(this._loadingFX&&this._loadingFX.resize(),t){var n=t.resetOption(`media`),r=e&&e.silent;this[Cb]&&(r??=this[Cb].silent,n=!0,this[Cb]=null),this[Sb]=!0;try{n&&Fb(this),Rb.update.call(this,{type:`resize`,animation:j({duration:0},e&&e.animation)})}catch(e){throw this[Sb]=!1,e}this[Sb]=!1,Hb.call(this,r),Ub.call(this,r)}}},t.prototype.showLoading=function(e,t){if(this._disposed){this.id;return}if(W(e)&&(t=e,e=``),e||=`default`,this.hideLoading(),cx[e]){var n=cx[e](this._api,t),r=this._zr;this._loadingFX=n,r.add(n)}},t.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},t.prototype.makeActionFromEvent=function(e){var t=j({},e);return t.type=rx[e.type],t},t.prototype.dispatchAction=function(e,t){if(this._disposed){this.id;return}if(W(t)||(t={silent:!!t}),nx[e.type]&&this._model){if(this[Sb]){this._pendingActions.push(e);return}var n=t.silent;Vb.call(this,e,n);var r=t.flush;r?this._zr.flush():r!==!1&&a.browser.weChat&&this._throttledZrFlush(),Hb.call(this,n),Ub.call(this,n)}},t.prototype.updateLabelLayout=function(){tb.trigger(`series:layoutlabels`,this._model,this._api,{updatedSeries:[]})},t.prototype.appendData=function(e){if(this._disposed){this.id;return}var t=e.seriesIndex;this.getModel().getSeriesByIndex(t).appendData(e),this._scheduler.unfinished=!0,this.getZr().wakeUp()},t.internalField=function(){Fb=function(e){var t=e._scheduler;t.restorePipelines(e._model),t.prepareStageTasks(),Ib(e,!0),Ib(e,!1),t.plan()},Ib=function(e,t){for(var n=e._model,r=e._scheduler,i=t?e._componentsViews:e._chartsViews,a=t?e._componentsMap:e._chartsMap,o=e._zr,s=e._api,c=0;ct.get(`hoverLayerThreshold`)&&!a.node&&!a.worker&&t.eachSeries(function(t){if(!t.preventUsingHoverLayer){var n=e._chartsMap[t.__viewId];n.__alive&&n.eachRendered(function(e){e.states.emphasis&&(e.states.emphasis.hoverLayer=!0)})}})}function o(e,t){var n=e.get(`blendMode`)||null;t.eachRendered(function(e){e.isGroup||(e.style.blend=n)})}function s(e,t){if(!e.preventAutoZ){var n=e.get(`z`)||0,r=e.get(`zlevel`)||0;t.eachRendered(function(e){return c(e,n,r,-1/0),!0})}}function c(e,t,n,r){var i=e.getTextContent(),a=e.getTextGuideLine();if(e.isGroup)for(var o=e.childrenRef(),s=0;s0?{duration:a,delay:r.get(`delay`),easing:r.get(`easing`)}:null;t.eachRendered(function(e){if(e.states&&e.states.emphasis){if(Hd(e))return;if(e instanceof Nc&&vu(e),e.__dirty){var t=e.prevStates;t&&e.useStates(t)}if(i){e.stateTransition=o;var r=e.getTextContent(),a=e.getTextGuideLine();r&&(r.stateTransition=o),a&&(a.stateTransition=o)}e.__dirty&&n(e)}})}Yb=function(e){return new(function(t){r(n,t);function n(){return t!==null&&t.apply(this,arguments)||this}return n.prototype.getCoordinateSystems=function(){return e._coordSysMgr.getCoordinateSystems()},n.prototype.getComponentByElement=function(t){for(;t;){var n=t.__ecComponentInfo;if(n!=null)return e._model.getComponent(n.mainType,n.index);t=t.parent}},n.prototype.enterEmphasis=function(t,n){Hl(t,n),Zb(e)},n.prototype.leaveEmphasis=function(t,n){Ul(t,n),Zb(e)},n.prototype.enterBlur=function(t){Wl(t),Zb(e)},n.prototype.leaveBlur=function(t){Gl(t),Zb(e)},n.prototype.enterSelect=function(t){Kl(t),Zb(e)},n.prototype.leaveSelect=function(t){ql(t),Zb(e)},n.prototype.getModel=function(){return e.getModel()},n.prototype.getViewOfComponentModel=function(t){return e.getViewOfComponentModel(t)},n.prototype.getViewOfSeriesModel=function(t){return e.getViewOfSeriesModel(t)},n}(fh))(e)},Xb=function(e){function t(e,t){for(var n=0;n=0)){Ex.push(n);var a=gv.wrapStageHandler(n,i);a.__prio=t,a.__raw=n,e.push(a)}}function Ox(e,t){cx[e]=t}function kx(e,t,n){var r=ib(`registerMap`);r&&r(e,t,n)}var Ax=Hg;Tx(pb,uv),Tx(gb,fv),Tx(gb,pv),Tx(pb,Vv),Tx(gb,Hv),Tx(bb,eb),gx(Wh),_x(sb,Gh),Ox(`default`,hv),xx({type:vl,event:vl,update:vl},Ae),xx({type:yl,event:yl,update:yl},Ae),xx({type:bl,event:bl,update:bl},Ae),xx({type:xl,event:xl,update:xl},Ae),xx({type:Sl,event:Sl,update:Sl},Ae),hx(`light`,Mv),hx(`dark`,Lv);var jx=[],Mx={registerPreprocessor:gx,registerProcessor:_x,registerPostInit:vx,registerPostUpdate:yx,registerUpdateLifecycle:bx,registerAction:xx,registerCoordinateSystem:Sx,registerLayout:Cx,registerVisual:Tx,registerTransform:Ax,registerLoading:Ox,registerMap:kx,registerImpl:rb,PRIORITY:xb,ComponentModel:Sm,ComponentView:U_,SeriesModel:P_,ChartView:q_,registerComponentModel:function(e){Sm.registerClass(e)},registerComponentView:function(e){U_.registerClass(e)},registerSeriesModel:function(e){P_.registerClass(e)},registerChartView:function(e){q_.registerClass(e)},registerSubTypeDefaulter:function(e,t){Sm.registerSubTypeDefaulter(e,t)},registerPainter:function(e,t){Ca(e,t)}};function $(e){if(V(e)){F(e,function(e){$(e)});return}N(jx,e)>=0||(jx.push(e),H(e)&&(e={install:e}),e.install(Mx))}function Nx(e){return e==null?0:e.length||1}function Px(e){return e}var Fx=function(){function e(e,t,n,r,i,a){this._old=e,this._new=t,this._oldKeyGetter=n||Px,this._newKeyGetter=r||Px,this.context=i,this._diffModeMultiple=a===`multiple`}return e.prototype.add=function(e){return this._add=e,this},e.prototype.update=function(e){return this._update=e,this},e.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},e.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},e.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},e.prototype.remove=function(e){return this._remove=e,this},e.prototype.execute=function(){this[this._diffModeMultiple?`_executeMultiple`:`_executeOneToOne`]()},e.prototype._executeOneToOne=function(){var e=this._old,t=this._new,n={},r=Array(e.length),i=Array(t.length);this._initIndexMap(e,null,r,`_oldKeyGetter`),this._initIndexMap(t,n,i,`_newKeyGetter`);for(var a=0;a1){var l=s.shift();s.length===1&&(n[o]=s[0]),this._update&&this._update(l,a)}else c===1?(n[o]=null,this._update&&this._update(s,a)):this._remove&&this._remove(a)}this._performRestAdd(i,n)},e.prototype._executeMultiple=function(){var e=this._old,t=this._new,n={},r={},i=[],a=[];this._initIndexMap(e,n,i,`_oldKeyGetter`),this._initIndexMap(t,r,a,`_newKeyGetter`);for(var o=0;o1&&d===1)this._updateManyToOne&&this._updateManyToOne(l,c),r[s]=null;else if(u===1&&d>1)this._updateOneToMany&&this._updateOneToMany(l,c),r[s]=null;else if(u===1&&d===1)this._update&&this._update(l,c),r[s]=null;else if(u>1&&d>1)this._updateManyToMany&&this._updateManyToMany(l,c),r[s]=null;else if(u>1)for(var f=0;f1)for(var o=0;o30}var Yx=W,Xx=I,Zx=typeof Int32Array>`u`?Array:Int32Array,Qx=`e\0\0`,$x=-1,eS=[`hasItemOption`,`_nameList`,`_idList`,`_invertedIndicesMap`,`_dimSummary`,`userOutput`,`_rawData`,`_dimValueGetter`,`_nameDimIdx`,`_idDimIdx`,`_nameRepeatCount`],tS=[`_approximateExtent`],nS,rS,iS,aS,oS,sS,cS,lS=function(){function e(e,t){this.type=`list`,this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=[`cloneShallow`,`downSample`,`minmaxDownSample`,`lttbDownSample`,`map`],this.CHANGABLE_METHODS=[`filterSelf`,`selectRange`],this.DOWNSAMPLE_METHODS=[`downSample`,`minmaxDownSample`,`lttbDownSample`];var n,r=!1;Gx(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(r=!0,n=e),n||=[`x`,`y`];for(var i={},a=[],o={},s=!1,c={},l=0;l=t)){var n=this._store.getProvider();this._updateOrdinalMeta();var r=this._nameList,i=this._idList;if(n.getSource().sourceFormat===`original`&&!n.pure)for(var a=[],o=e;o0},e.prototype.ensureUniqueItemVisual=function(e,t){var n=this._itemVisuals,r=n[e];r||=n[e]={};var i=r[t];return i??(i=this.getVisual(t),V(i)?i=i.slice():Yx(i)&&(i=j({},i)),r[t]=i),i},e.prototype.setItemVisual=function(e,t,n){var r=this._itemVisuals[e]||{};this._itemVisuals[e]=r,Yx(t)?j(r,t):r[t]=n},e.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},e.prototype.setLayout=function(e,t){Yx(e)?j(this._layout,e):this._layout[e]=t},e.prototype.getLayout=function(e){return this._layout[e]},e.prototype.getItemLayout=function(e){return this._itemLayouts[e]},e.prototype.setItemLayout=function(e,t,n){this._itemLayouts[e]=n?j(this._itemLayouts[e]||{},t):t},e.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},e.prototype.setItemGraphicEl=function(e,t){dl(this.hostModel&&this.hostModel.seriesIndex,this.dataType,e,t),this._graphicEls[e]=t},e.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},e.prototype.eachItemGraphicEl=function(e,t){F(this._graphicEls,function(n,r){n&&e&&e.call(t,n,r)})},e.prototype.cloneShallow=function(t){return t||=new e(this._schema?this._schema:Xx(this.dimensions,this._getDimInfo,this),this.hostModel),oS(t,this),t._store=this._store,t},e.prototype.wrapMethod=function(e,t){var n=this[e];H(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var e=n.apply(this,arguments);return t.apply(this,[e].concat(ge(arguments)))})},e.internalField=function(){nS=function(e){var t=e._invertedIndicesMap;F(t,function(n,r){var i=e._dimInfos[r],a=i.ordinalMeta,o=e._store;if(a){n=t[r]=new Zx(a.categories.length);for(var s=0;s1&&(s+=`__ec__`+l),r[t]=s}}}(),e}();function uS(e,t){Jh(e)||(e=Xh(e)),t||={};var n=t.coordDimensions||[],r=t.dimensionsDefine||e.dimensionsDefine||[],i=K(),a=[],o=fS(e,n,r,t.dimensionsCount),s=t.canOmitUnusedDimensions&&Jx(o),c=r===e.dimensionsDefine,l=c?qx(e):Kx(r),u=t.encodeDefine;!u&&t.encodeDefaulter&&(u=t.encodeDefaulter(e,o));for(var d=K(u),f=new Yg(o),p=0;p0&&(r.name=i+(a-1)),a++,t.set(i,a)}}function fS(e,t,n,r){var i=Math.max(e.dimensionsDetectedCount||1,t.length,n.length,r||0);return F(t,function(e){var t;W(e)&&(t=e.dimsDef)&&(i=Math.max(i,t.length))}),i}function pS(e,t,n){if(n||t.hasKey(e)){for(var r=0;t.hasKey(e+r);)r++;e+=r}return t.set(e,!0),e}var mS=function(){function e(e){this.coordSysDims=[],this.axisMap=K(),this.categoryAxisMap=K(),this.coordSysName=e}return e}();function hS(e){var t=e.get(`coordinateSystem`),n=new mS(t),r=gS[t];if(r)return r(e,n,n.axisMap,n.categoryAxisMap),n}var gS={cartesian2d:function(e,t,n,r){var i=e.getReferringComponents(`xAxis`,ko).models[0],a=e.getReferringComponents(`yAxis`,ko).models[0];t.coordSysDims=[`x`,`y`],n.set(`x`,i),n.set(`y`,a),_S(i)&&(r.set(`x`,i),t.firstCategoryDimIndex=0),_S(a)&&(r.set(`y`,a),t.firstCategoryDimIndex??=1)},singleAxis:function(e,t,n,r){var i=e.getReferringComponents(`singleAxis`,ko).models[0];t.coordSysDims=[`single`],n.set(`single`,i),_S(i)&&(r.set(`single`,i),t.firstCategoryDimIndex=0)},polar:function(e,t,n,r){var i=e.getReferringComponents(`polar`,ko).models[0],a=i.findAxisModel(`radiusAxis`),o=i.findAxisModel(`angleAxis`);t.coordSysDims=[`radius`,`angle`],n.set(`radius`,a),n.set(`angle`,o),_S(a)&&(r.set(`radius`,a),t.firstCategoryDimIndex=0),_S(o)&&(r.set(`angle`,o),t.firstCategoryDimIndex??=1)},geo:function(e,t,n,r){t.coordSysDims=[`lng`,`lat`]},parallel:function(e,t,n,r){var i=e.ecModel,a=i.getComponent(`parallel`,e.get(`parallelIndex`)),o=t.coordSysDims=a.dimensions.slice();F(a.parallelAxisIndex,function(e,a){var s=i.getComponent(`parallelAxis`,e),c=o[a];n.set(c,s),_S(s)&&(r.set(c,s),t.firstCategoryDimIndex??=a)})}};function _S(e){return e.get(`type`)===`category`}function vS(e,t,n){n||={};var r=n.byIndex,i=n.stackedCoordDimension,a,o,s;yS(t)?a=t:(o=t.schema,a=o.dimensions,s=t.store);var c=!!(e&&e.get(`stack`)),l,u,d,f;if(F(a,function(e,t){U(e)&&(a[t]=e={name:e}),c&&!e.isExtraCoord&&(!r&&!l&&e.ordinalMeta&&(l=e),!u&&e.type!==`ordinal`&&e.type!==`time`&&(!i||i===e.coordDim)&&(u=e))}),u&&!r&&!l&&(r=!0),u){d=`__\0ecstackresult_`+e.id,f=`__\0ecstackedover_`+e.id,l&&(l.createInvertedIndices=!0);var p=u.coordDim,m=u.type,h=0;F(a,function(e){e.coordDim===p&&h++});var g={name:d,coordDim:p,coordDimIndex:h,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length},_={name:f,coordDim:f,coordDimIndex:h+1,type:m,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:a.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(f,m),_.storeDimIndex=s.ensureCalculationDimension(d,m)),o.appendCalculationDimension(g),o.appendCalculationDimension(_)):(a.push(g),a.push(_))}return{stackedDimension:u&&u.name,stackedByDimension:l&&l.name,isStackedByIndex:r,stackedOverDimension:f,stackResultDimension:d}}function yS(e){return!Gx(e.schema)}function bS(e,t){return!!t&&t===e.getCalculationInfo(`stackedDimension`)}function xS(e,t){return bS(e,t)?e.getCalculationInfo(`stackResultDimension`):t}function SS(e,t){var n=e.get(`coordinateSystem`),r=mh.get(n),i;return t&&t.coordSysDims&&(i=I(t.coordSysDims,function(e){var n={name:e},r=t.axisMap.get(e);return r&&(n.type=zx(r.get(`type`))),n})),i||=r&&(r.getDimensionsInfo?r.getDimensionsInfo():r.dimensions.slice())||[`x`,`y`],i}function CS(e,t,n){var r,i;return n&&F(e,function(e,a){var o=e.coordDim,s=n.categoryAxisMap.get(o);s&&(r??=a,e.ordinalMeta=s.getOrdinalMeta(),t&&(e.createInvertedIndices=!0)),e.otherDims.itemName!=null&&(i=!0)}),!i&&r!=null&&(e[r].otherDims.itemName=0),r}function wS(e,t,n){n||={};var r=t.getSourceManager(),i,a=!1;e?(a=!0,i=Xh(e)):(i=r.getSource(),a=i.sourceFormat===Om);var o=hS(t),s=SS(t,o),c=n.useEncodeDefaulter,l=H(c)?c:c?B(Rm,s,t):null,u={coordDimensions:s,generateCoord:n.generateCoord,encodeDefine:t.getEncode(),encodeDefaulter:l,canOmitUnusedDimensions:!a},d=uS(i,u),f=CS(d.dimensions,n.createInvertedIndices,o),p=a?null:r.getSharedDataStore(d),m=vS(t,{schema:d,store:p}),h=new lS(d,t);h.setCalculationInfo(m);var g=f!=null&&TS(i)?function(e,t,n,r){return r===f?n:this.defaultDimValueGetter(e,t,n,r)}:null;return h.hasItemOption=!1,h.initData(a?i:p,null,g),h}function TS(e){if(e.sourceFormat===`original`)return!V(ao(ES(e.data||[])))}function ES(e){for(var t=0;tt[1]&&(t[1]=e[1])},e.prototype.unionExtentFromData=function(e,t){this.unionExtent(e.getApproximateExtent(t))},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(t)||(n[1]=t)},e.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},e.prototype.isBlank=function(){return this._isBlank},e.prototype.setBlank=function(e){this._isBlank=e},e}();Xo(DS);var OS=0,kS=function(){function e(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++OS}return e.createByAxisModel=function(t){var n=t.option,r=n.data,i=r&&I(r,AS);return new e({categories:i,needCollect:!i,deduplication:n.dedplication!==!1})},e.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},e.prototype.parseAndCollect=function(e){var t,n=this._needCollect;if(!U(e)&&!n)return e;if(n&&!this._deduplication)return t=this.categories.length,this.categories[t]=e,t;var r=this._getOrCreateMap();return t=r.get(e),t??(n?(t=this.categories.length,this.categories[t]=e,r.set(e,t)):t=NaN),t},e.prototype._getOrCreateMap=function(){return this._map||=K(this.categories)},e}();function AS(e){return W(e)&&e.value!=null?e.value:e+``}function jS(e){return e.type===`interval`||e.type===`log`}function MS(e,t,n,r){var i={},a=i.interval=Wa((e[1]-e[0])/t,!0);n!=null&&ar&&(a=i.interval=r);var o=i.intervalPrecision=PS(a);return IS(i.niceTickExtent=[ja(Math.ceil(e[0]/a)*a,o),ja(Math.floor(e[1]/a)*a,o)],e),i}function NS(e){var t=10**Ua(e),n=e/t;return n?n===2?n=3:n===3?n=5:n*=2:n=1,ja(n*t)}function PS(e){return Na(e)+2}function FS(e,t,n){e[t]=Math.max(Math.min(e[t],n[1]),n[0])}function IS(e,t){!isFinite(e[0])&&(e[0]=t[0]),!isFinite(e[1])&&(e[1]=t[1]),FS(e,0,t),FS(e,1,t),e[0]>e[1]&&(e[0]=e[1])}function LS(e,t){return e>=t[0]&&e<=t[1]}function RS(e,t){return t[1]===t[0]?.5:(e-t[0])/(t[1]-t[0])}function zS(e,t){return e*(t[1]-t[0])+t[0]}var BS=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;n.type=`ordinal`;var r=n.getSetting(`ordinalMeta`);return r||=new kS({}),V(r)&&(r=new kS({categories:I(r,function(e){return W(e)?e.value:e})})),n._ordinalMeta=r,n._extent=n.getSetting(`extent`)||[0,r.categories.length-1],n}return t.prototype.parse=function(e){return e==null?NaN:U(e)?this._ordinalMeta.getOrdinal(e):Math.round(e)},t.prototype.contain=function(e){return e=this.parse(e),LS(e,this._extent)&&this._ordinalMeta.categories[e]!=null},t.prototype.normalize=function(e){return e=this._getTickNumber(this.parse(e)),RS(e,this._extent)},t.prototype.scale=function(e){return e=Math.round(zS(e,this._extent)),this.getRawOrdinalNumber(e)},t.prototype.getTicks=function(){for(var e=[],t=this._extent,n=t[0];n<=t[1];)e.push({value:n}),n++;return e},t.prototype.getMinorTicks=function(e){},t.prototype.setSortInfo=function(e){if(e==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var t=e.ordinalNumbers,n=this._ordinalNumbersByTick=[],r=this._ticksByOrdinalNumber=[],i=0,a=this._ordinalMeta.categories.length,o=Math.min(a,t.length);i=0&&e=0&&e=e},t.prototype.getOrdinalMeta=function(){return this._ordinalMeta},t.prototype.calcNiceTicks=function(){},t.prototype.calcNiceExtent=function(){},t.type=`ordinal`,t}(DS);DS.registerClass(BS);var VS=ja,HS=function(e){r(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`interval`,t._interval=0,t._intervalPrecision=2,t}return t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return LS(e,this._extent)},t.prototype.normalize=function(e){return RS(e,this._extent)},t.prototype.scale=function(e){return zS(e,this._extent)},t.prototype.setExtent=function(e,t){var n=this._extent;isNaN(e)||(n[0]=parseFloat(e)),isNaN(t)||(n[1]=parseFloat(t))},t.prototype.unionExtent=function(e){var t=this._extent;e[0]t[1]&&(t[1]=e[1]),this.setExtent(t[0],t[1])},t.prototype.getInterval=function(){return this._interval},t.prototype.setInterval=function(e){this._interval=e,this._niceExtent=this._extent.slice(),this._intervalPrecision=PS(e)},t.prototype.getTicks=function(e){var t=this._interval,n=this._extent,r=this._niceExtent,i=this._intervalPrecision,a=[];if(!t)return a;var o=1e4;n[0]o)return[];var c=a.length?a[a.length-1].value:r[1];return n[1]>c&&(e?a.push({value:VS(c+t,i)}):a.push({value:n[1]})),a},t.prototype.getMinorTicks=function(e){for(var t=this.getTicks(!0),n=[],r=this.getExtent(),i=1;ir[0]&&u0&&(a=a===null?s:Math.min(a,s))}n[r]=a}}return n}function QS(e){var t=ZS(e),n=[];return F(e,function(e){var r=e.coordinateSystem.getBaseAxis(),i=r.getExtent(),a;if(r.type===`category`)a=r.getBandWidth();else if(r.type===`value`||r.type===`time`){var o=t[r.dim+`_`+r.index],s=Math.abs(i[1]-i[0]),c=r.scale.getExtent(),l=Math.abs(c[1]-c[0]);a=o?s/l*o:s}else{var u=e.getData();a=Math.abs(i[1]-i[0])/u.count()}var d=Z(e.get(`barWidth`),a),f=Z(e.get(`barMaxWidth`),a),p=Z(e.get(`barMinWidth`)||(iC(e)?.5:1),a),m=e.get(`barGap`),h=e.get(`barCategoryGap`);n.push({bandWidth:a,barWidth:d,barMaxWidth:f,barMinWidth:p,barGap:m,barCategoryGap:h,axisKey:JS(r),stackId:qS(e)})}),$S(n)}function $S(e){var t={};F(e,function(e,n){var r=e.axisKey,i=e.bandWidth,a=t[r]||{bandWidth:i,remainedWidth:i,autoWidthCount:0,categoryGap:null,gap:`20%`,stacks:{}},o=a.stacks;t[r]=a;var s=e.stackId;o[s]||a.autoWidthCount++,o[s]=o[s]||{width:0,maxWidth:0};var c=e.barWidth;c&&!o[s].width&&(o[s].width=c,c=Math.min(a.remainedWidth,c),a.remainedWidth-=c);var l=e.barMaxWidth;l&&(o[s].maxWidth=l);var u=e.barMinWidth;u&&(o[s].minWidth=u);var d=e.barGap;d!=null&&(a.gap=d);var f=e.barCategoryGap;f!=null&&(a.categoryGap=f)});var n={};return F(t,function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,a=e.categoryGap;if(a==null){var o=R(r).length;a=Math.max(35-o*4,15)+`%`}var s=Z(a,i),c=Z(e.gap,1),l=e.remainedWidth,u=e.autoWidthCount,d=(l-s)/(u+(u-1)*c);d=Math.max(d,0),F(r,function(e){var t=e.maxWidth,n=e.minWidth;if(e.width){var r=e.width;t&&(r=Math.min(r,t)),n&&(r=Math.max(r,n)),e.width=r,l-=r+c*r,u--}else{var r=d;t&&tr&&(r=n),r!==d&&(e.width=r,l-=r+c*r,u--)}}),d=(l-s)/(u+(u-1)*c),d=Math.max(d,0);var f=0,p;F(r,function(e,t){e.width||=d,p=e,f+=e.width*(1+c)}),p&&(f-=p.width*c);var m=-f/2;F(r,function(e,r){n[t][r]=n[t][r]||{bandWidth:i,offset:m,width:e.width},m+=e.width*(1+c)})}),n}function eC(e,t,n){if(e&&t){var r=e[JS(t)];return r!=null&&n!=null?r[qS(n)]:r}}function tC(e,t){var n=XS(e,t),r=QS(n);F(n,function(e){var t=e.getData(),n=e.coordinateSystem.getBaseAxis(),i=qS(e),a=r[JS(n)][i],o=a.offset,s=a.width;t.setLayout({bandWidth:a.bandWidth,offset:o,size:s})})}function nC(e){return{seriesType:e,plan:W_(),reset:function(e){if(rC(e)){var t=e.getData(),n=e.coordinateSystem,r=n.getBaseAxis(),i=n.getOtherAxis(r),a=t.getDimensionIndex(t.mapDimension(i.dim)),o=t.getDimensionIndex(t.mapDimension(r.dim)),s=e.get(`showBackground`,!0),c=t.mapDimension(i.dim),l=t.getCalculationInfo(`stackResultDimension`),u=bS(t,c)&&!!t.getCalculationInfo(`stackedOnSeries`),d=i.isHorizontal(),f=aC(r,i),p=iC(e),m=e.get(`barMinHeight`)||0,h=l&&t.getDimensionIndex(l),g=t.getLayout(`size`),_=t.getLayout(`offset`);return{progress:function(e,t){for(var r=e.count,i=p&&GS(r*3),c=p&&s&&GS(r*3),l=p&&GS(r),v=n.master.getRect(),y=d?v.width:v.height,b,x=t.getStore(),S=0;(b=e.next())!=null;){var C=x.get(u?h:a,b),w=x.get(o,b),T=f,E=void 0;u&&(E=+C-x.get(a,b));var D=void 0,O=void 0,k=void 0,A=void 0;if(d){var j=n.dataToPoint([C,w]);if(u){var M=n.dataToPoint([E,w]);T=M[0]}D=T,O=j[1]+_,k=j[0]-T,A=g,Math.abs(k)0?n:1:n))}var oC=function(e,t,n,r){for(;n>>1;e[i][1]n&&(this._approxInterval=n);var a=cC.length,o=Math.min(oC(cC,this._approxInterval,0,a),a-1);this._interval=cC[o][1],this._minLevelUnit=cC[Math.max(o-1,0)][0]},t.prototype.parse=function(e){return oe(e)?e:+Va(e)},t.prototype.contain=function(e){return LS(this.parse(e),this._extent)},t.prototype.normalize=function(e){return RS(this.parse(e),this._extent)},t.prototype.scale=function(e){return zS(e,this._extent)},t.type=`time`,t}(HS),cC=[[`second`,yp],[`minute`,bp],[`hour`,xp],[`quarter-day`,xp*6],[`half-day`,xp*12],[`day`,Sp*1.2],[`half-week`,Sp*3.5],[`week`,Sp*7],[`month`,Sp*31],[`quarter`,Sp*95],[`half-year`,Cp/2],[`year`,Cp]];function lC(e,t,n,r){var i=Va(t),a=Va(n),o=function(e){return Ip(i,e,r)===Ip(a,e,r)},s=function(){return o(`year`)},c=function(){return s()&&o(`month`)},l=function(){return c()&&o(`day`)},u=function(){return l()&&o(`hour`)},d=function(){return u()&&o(`minute`)},f=function(){return d()&&o(`second`)},p=function(){return f()&&o(`millisecond`)};switch(e){case`year`:return s();case`month`:return c();case`day`:return l();case`hour`:return u();case`minute`:return d();case`second`:return f();case`millisecond`:return p()}}function uC(e,t){return e/=Sp,e>16?16:e>7.5?7:e>3.5?4:e>1.5?2:1}function dC(e){var t=30*Sp;return e/=t,e>6?6:e>3?3:e>2?2:1}function fC(e){return e/=xp,e>12?12:e>6?6:e>3.5?4:e>2?2:1}function pC(e,t){return e/=t?bp:yp,e>30?30:e>20?20:e>15?15:e>10?10:e>5?5:e>2?2:1}function mC(e){return Wa(e,!0)}function hC(e,t,n){var r=new Date(e);switch(Ap(t)){case`year`:case`month`:r[Gp(n)](0);case`day`:r[Kp(n)](1);case`hour`:r[qp(n)](0);case`minute`:r[Jp(n)](0);case`second`:r[Yp(n)](0),r[Xp(n)](0)}return r.getTime()}function gC(e,t,n,r){var i=1e4,a=Op,o=0;function s(e,t,n,i,a,o,s){for(var c=new Date(t),l=t,u=c[i]();l1&&l===0&&a.unshift({value:a[0].value-f})}}for(var l=0;l=r[0]&&_<=r[1]&&d++)}var v=(r[1]-r[0])/t;if(d>v*1.5&&f>v/1.5||(l.push(h),d>v||e===a[p]))break}u=[]}}for(var y=L(I(l,function(e){return L(e,function(e){return e.value>=r[0]&&e.value<=r[1]&&!e.notAdd})}),function(e){return e.length>0}),b=[],x=y.length-1,p=0;p0;)r*=10;var i=[ja(xC(t[0]/r)*r),ja(bC(t[1]/r)*r)];this._interval=r,this._niceExtent=i}},t.prototype.calcNiceExtent=function(e){vC.calcNiceExtent.call(this,e),this._fixMin=e.fixMin,this._fixMax=e.fixMax},t.prototype.parse=function(e){return e},t.prototype.contain=function(e){return e=CC(e)/CC(this.base),LS(e,this._extent)},t.prototype.normalize=function(e){return e=CC(e)/CC(this.base),RS(e,this._extent)},t.prototype.scale=function(e){return e=zS(e,this._extent),SC(this.base,e)},t.type=`log`,t}(DS),TC=wC.prototype;TC.getMinorTicks=vC.getMinorTicks,TC.getLabel=vC.getLabel;function EC(e,t){return yC(e,Na(t))}DS.registerClass(wC);var DC=function(){function e(e,t,n){this._prepareParams(e,t,n)}return e.prototype._prepareParams=function(e,t,n){n[1]0&&s>0&&!c&&(o=0),o<0&&s<0&&!l&&(s=0));var d=this._determinedMin,f=this._determinedMax;return d!=null&&(o=d,c=!0),f!=null&&(s=f,l=!0),{min:o,max:s,minFixed:c,maxFixed:l,isBlank:u}},e.prototype.modifyDataMinMax=function(e,t){this[kC[e]]=t},e.prototype.setDeterminedMinMax=function(e,t){var n=OC[e];this[n]=t},e.prototype.freeze=function(){this.frozen=!0},e}(),OC={min:`_determinedMin`,max:`_determinedMax`},kC={min:`_dataMin`,max:`_dataMax`};function AC(e,t,n){var r=e.rawExtentInfo;return r||(r=new DC(e,t,n),e.rawExtentInfo=r,r)}function jC(e,t){return t==null?null:pe(t)?NaN:e.parse(t)}function MC(e,t){var n=e.type,r=AC(e,t,e.getExtent()).calculate();e.setBlank(r.isBlank);var i=r.min,a=r.max,o=t.ecModel;if(o&&n===`time`){var s=XS(`bar`,o),c=!1;if(F(s,function(e){c||=e.getBaseAxis()===t.axis}),c){var l=QS(s),u=NC(i,a,t,l);i=u.min,a=u.max}}return{extent:[i,a],fixMin:r.minFixed,fixMax:r.maxFixed}}function NC(e,t,n,r){var i=n.axis.getExtent(),a=Math.abs(i[1]-i[0]),o=eC(r,n.axis);if(o===void 0)return{min:e,max:t};var s=1/0;F(o,function(e){s=Math.min(e.offset,s)});var c=-1/0;F(o,function(e){c=Math.max(e.offset+e.width,c)}),s=Math.abs(s),c=Math.abs(c);var l=s+c,u=t-e,d=u/(1-(s+c)/a)-u;return t+=c/l*d,e-=s/l*d,{min:e,max:t}}function PC(e,t){var n=t,r=MC(e,n),i=r.extent,a=n.get(`splitNumber`);e instanceof wC&&(e.base=n.get(`logBase`));var o=e.type,s=n.get(`interval`),c=o===`interval`||o===`time`;e.setExtent(i[0],i[1]),e.calcNiceExtent({splitNumber:a,fixMin:r.fixMin,fixMax:r.fixMax,minInterval:c?n.get(`minInterval`):null,maxInterval:c?n.get(`maxInterval`):null}),s!=null&&e.setInterval&&e.setInterval(s)}function FC(e,t){if(t||=e.get(`type`),t)switch(t){case`category`:return new BS({ordinalMeta:e.getOrdinalMeta?e.getOrdinalMeta():e.getCategories(),extent:[1/0,-1/0]});case`time`:return new sC({locale:e.ecModel.getLocaleModel(),useUTC:e.ecModel.get(`useUTC`)});default:return new((DS.getClass(t))||HS)}}function IC(e){var t=e.scale.getExtent(),n=t[0],r=t[1];return!(n>0&&r>0||n<0&&r<0)}function LC(e){var t=e.getLabelModel().get(`formatter`),n=e.type===`category`?e.scale.getExtent()[0]:null;return e.scale.type===`time`?function(t){return function(n,r){return e.scale.getFormattedLabel(n,r,t)}}(t):U(t)?function(t){return function(n){var r=e.scale.getLabel(n);return t.replace(`{value}`,r??``)}}(t):H(t)?function(t){return function(r,i){return n!=null&&(i=r.value-n),t(RC(e,r),i,r.level==null?null:{level:r.level})}}(t):function(t){return e.scale.getLabel(t)}}function RC(e,t){return e.type===`category`?e.scale.getLabel(t):t.value}function zC(e){var t=e.model,n=e.scale;if(!(!t.get([`axisLabel`,`show`])||n.isBlank())){var r,i,a=n.getExtent();n instanceof BS?i=n.count():(r=n.getTicks(),i=r.length);var o=e.getLabelModel(),s=LC(e),c,l=1;i>40&&(l=Math.ceil(i/40));for(var u=0;ue[1]&&(e[1]=r[1])})}var GC=function(){function e(){}return e.prototype.getNeedCrossZero=function(){return!this.option.scale},e.prototype.getCoordSysModel=function(){},e}(),KC=1e-8;function qC(e,t){return Math.abs(e-t)n&&(t=i,n=o)}if(t)return QC(t.exterior);var s=this.getBoundingRect();return[s.x+s.width/2,s.y+s.height/2]},t.prototype.getBoundingRect=function(e){var t=this._rect;if(t&&!e)return t;var n=[1/0,1/0],r=[-1/0,-1/0],i=this.geometries;return F(i,function(t){t.type===`polygon`?ZC(t.exterior,n,r,e):F(t.points,function(t){ZC(t,n,r,e)})}),isFinite(n[0])&&isFinite(n[1])&&isFinite(r[0])&&isFinite(r[1])||(n[0]=n[1]=r[0]=r[1]=0),t=new Y(n[0],n[1],r[0]-n[0],r[1]-n[1]),e||(this._rect=t),t},t.prototype.contain=function(e){var t=this.getBoundingRect(),n=this.geometries;if(!t.contain(e[0],e[1]))return!1;loopGeo:for(var r=0,i=n.length;r>1^-(s&1),c=c>>1^-(c&1),s+=i,c+=a,i=s,a=c,r.push([s/n,c/n])}return r}function sw(e,t){return e=iw(e),I(L(e.features,function(e){return e.geometry&&e.properties&&e.geometry.coordinates.length>0}),function(e){var n=e.properties,r=e.geometry,i=[];switch(r.type){case`Polygon`:var a=r.coordinates;i.push(new ew(a[0],a.slice(1)));break;case`MultiPolygon`:F(r.coordinates,function(e){e[0]&&i.push(new ew(e[0],e.slice(1)))});break;case`LineString`:i.push(new tw([r.coordinates]));break;case`MultiLineString`:i.push(new tw(r.coordinates))}var o=new nw(n[t||`name`],i,n.cp);return o.properties=n,o})}var cw=To();function lw(e,t){var n=I(t,function(t){return e.scale.parse(t)});return e.type===`time`&&n.length>0&&(n.sort(),n.unshift(n[0]),n.push(n[n.length-1])),n}function uw(e){var t=e.getLabelModel().get(`customValues`);if(t){var n=LC(e),r=e.scale.getExtent();return{labels:I(L(lw(e,t),function(e){return e>=r[0]&&e<=r[1]}),function(t){var r={value:t};return{formattedLabel:n(r),rawLabel:e.scale.getLabel(r),tickValue:t}})}}return e.type===`category`?fw(e):hw(e)}function dw(e,t){var n=e.getTickModel().get(`customValues`);if(n){var r=e.scale.getExtent();return{ticks:L(lw(e,n),function(e){return e>=r[0]&&e<=r[1]})}}return e.type===`category`?mw(e,t):{ticks:I(e.scale.getTicks(),function(e){return e.value})}}function fw(e){var t=e.getLabelModel(),n=pw(e,t);return!t.get(`show`)||e.scale.isBlank()?{labels:[],labelCategoryInterval:n.labelCategoryInterval}:n}function pw(e,t){var n=gw(e,`labels`),r=VC(t),i=_w(n,r);if(i)return i;var a,o;return H(r)?a=Cw(e,r):(o=r===`auto`?yw(e):r,a=Sw(e,o)),vw(n,r,{labels:a,labelCategoryInterval:o})}function mw(e,t){var n=gw(e,`ticks`),r=VC(t),i=_w(n,r);if(i)return i;var a,o;if((!t.get(`show`)||e.scale.isBlank())&&(a=[]),H(r))a=Cw(e,r,!0);else if(r===`auto`){var s=pw(e,e.getLabelModel());o=s.labelCategoryInterval,a=I(s.labels,function(e){return e.tickValue})}else o=r,a=Sw(e,o,!0);return vw(n,r,{ticks:a,tickCategoryInterval:o})}function hw(e){var t=e.scale.getTicks(),n=LC(e);return{labels:I(t,function(t,r){return{level:t.level,formattedLabel:n(t,r),rawLabel:e.scale.getLabel(t),tickValue:t.value}})}}function gw(e,t){return cw(e)[t]||(cw(e)[t]=[])}function _w(e,t){for(var n=0;n40&&(s=Math.max(1,Math.floor(o/40)));for(var c=a[0],l=e.dataToCoord(c+1)-e.dataToCoord(c),u=Math.abs(l*Math.cos(r)),d=Math.abs(l*Math.sin(r)),f=0,p=0;c<=a[1];c+=s){var m=0,h=0,g=Qi(n({value:c}),t.font,`center`,`top`);m=g.width*1.3,h=g.height*1.3,f=Math.max(f,m,7),p=Math.max(p,h,7)}var _=f/u,v=p/d;isNaN(_)&&(_=1/0),isNaN(v)&&(v=1/0);var y=Math.max(0,Math.floor(Math.min(_,v))),b=cw(e.model),x=e.getExtent(),S=b.lastAutoInterval,C=b.lastTickCount;return S!=null&&C!=null&&Math.abs(S-y)<=1&&Math.abs(C-o)<=1&&S>y&&b.axisExtent0===x[0]&&b.axisExtent1===x[1]?y=S:(b.lastTickCount=o,b.lastAutoInterval=y,b.axisExtent0=x[0],b.axisExtent1=x[1]),y}function xw(e){var t=e.getLabelModel();return{axisRotate:e.getRotate?e.getRotate():e.isHorizontal&&!e.isHorizontal()?90:0,labelRotate:t.get(`rotate`)||0,font:t.getFont()}}function Sw(e,t,n){var r=LC(e),i=e.scale,a=i.getExtent(),o=e.getLabelModel(),s=[],c=Math.max((t||0)+1,1),l=a[0],u=i.count();l!==0&&c>1&&u/c>2&&(l=Math.round(Math.ceil(l/c)*c));var d=HC(e),f=o.get(`showMinLabel`)||d,p=o.get(`showMaxLabel`)||d;f&&l!==a[0]&&h(a[0]);for(var m=l;m<=a[1];m+=c)h(m);p&&m-c!==a[1]&&h(a[1]);function h(e){var t={value:e};s.push(n?e:{formattedLabel:r(t),rawLabel:i.getLabel(t),tickValue:e})}return s}function Cw(e,t,n){var r=e.scale,i=LC(e),a=[];return F(r.getTicks(),function(e){var o=r.getLabel(e),s=e.value;t(e.value,o)&&a.push(n?s:{formattedLabel:i(e),rawLabel:o,tickValue:s})}),a}var ww=[0,1],Tw=function(){function e(e,t,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=t,this._extent=n||[0,0]}return e.prototype.contain=function(e){var t=this._extent,n=Math.min(t[0],t[1]),r=Math.max(t[0],t[1]);return e>=n&&e<=r},e.prototype.containData=function(e){return this.scale.contain(e)},e.prototype.getExtent=function(){return this._extent.slice()},e.prototype.getPixelPrecision=function(e){return Fa(e||this.scale.getExtent(),this._extent)},e.prototype.setExtent=function(e,t){var n=this._extent;n[0]=e,n[1]=t},e.prototype.dataToCoord=function(e,t){var n=this._extent,r=this.scale;return e=r.normalize(e),this.onBand&&r.type===`ordinal`&&(n=n.slice(),Ew(n,r.count())),Aa(e,ww,n,t)},e.prototype.coordToData=function(e,t){var n=this._extent,r=this.scale;this.onBand&&r.type===`ordinal`&&(n=n.slice(),Ew(n,r.count()));var i=Aa(e,n,ww,t);return this.scale.scale(i)},e.prototype.pointToData=function(e,t){},e.prototype.getTicksCoords=function(e){e||={};var t=e.tickModel||this.getTickModel(),n=dw(this,t).ticks,r=I(n,function(e){return{coord:this.dataToCoord(this.scale.type===`ordinal`?this.scale.getRawOrdinalNumber(e):e),tickValue:e}},this),i=t.get(`alignWithLabel`);return Dw(this,r,i,e.clamp),r},e.prototype.getMinorTicksCoords=function(){if(this.scale.type===`ordinal`)return[];var e=this.model.getModel(`minorTick`).get(`splitNumber`);return e>0&&e<100||(e=5),I(this.scale.getMinorTicks(e),function(e){return I(e,function(e){return{coord:this.dataToCoord(e),tickValue:e}},this)},this)},e.prototype.getViewLabels=function(){return uw(this).labels},e.prototype.getLabelModel=function(){return this.model.getModel(`axisLabel`)},e.prototype.getTickModel=function(){return this.model.getModel(`axisTick`)},e.prototype.getBandWidth=function(){var e=this._extent,t=this.scale.getExtent(),n=t[1]-t[0]+ +!!this.onBand;n===0&&(n=1);var r=Math.abs(e[1]-e[0]);return Math.abs(r)/n},e.prototype.calculateCategoryInterval=function(){return bw(this)},e}();function Ew(e,t){var n=(e[1]-e[0])/t/2;e[0]+=n,e[1]-=n}function Dw(e,t,n,r){var i=t.length;if(!e.onBand||n||!i)return;var a=e.getExtent(),o,s;if(i===1)t[0].coord=a[0],o=t[1]={coord:a[1],tickValue:t[0].tickValue};else{var c=t[i-1].tickValue-t[0].tickValue,l=(t[i-1].coord-t[0].coord)/c;F(t,function(e){e.coord-=l/2});var u=e.scale.getExtent();s=1+u[1]-t[i-1].tickValue,o={coord:t[i-1].coord+l*s,tickValue:u[1]+1},t.push(o)}var d=a[0]>a[1];f(t[0].coord,a[0])&&(r?t[0].coord=a[0]:t.shift()),r&&f(a[0],t[0].coord)&&t.unshift({coord:a[0]}),f(a[1],o.coord)&&(r?o.coord=a[1]:t.pop()),r&&f(o.coord,a[1])&&t.push({coord:a[1]});function f(e,t){return e=ja(e),t=ja(t),d?e>t:ei&&(i+=Ow);var p=Math.atan2(s,o);if(p<0&&(p+=Ow),p>=r&&p<=i||p+Ow>=r&&p+Ow<=i)return c[0]=u,c[1]=d,l-n;var m=n*Math.cos(r)+e,h=n*Math.sin(r)+t,g=n*Math.cos(i)+e,_=n*Math.sin(i)+t,v=(m-o)*(m-o)+(h-s)*(h-s),y=(g-o)*(g-o)+(_-s)*(_-s);return v0){t=t/180*Math.PI,Rw.fromArray(e[0]),zw.fromArray(e[1]),Bw.fromArray(e[2]),J.sub(Vw,Rw,zw),J.sub(Hw,Bw,zw);var n=Vw.len(),r=Hw.len();if(!(n<.001||r<.001)){Vw.scale(1/n),Hw.scale(1/r);var i=Vw.dot(Hw);if(Math.cos(t)1&&J.copy(Gw,Bw),Gw.toArray(e[1])}}}}function qw(e,t,n){if(n<=180&&n>0){n=n/180*Math.PI,Rw.fromArray(e[0]),zw.fromArray(e[1]),Bw.fromArray(e[2]),J.sub(Vw,zw,Rw),J.sub(Hw,Bw,zw);var r=Vw.len(),i=Hw.len();if(!(r<.001||i<.001)&&(Vw.scale(1/r),Hw.scale(1/i),Vw.dot(t)=o)J.copy(Gw,Bw);else{Gw.scaleAndAdd(Hw,a/Math.tan(Math.PI/2-s));var c=Bw.x===zw.x?(Gw.y-zw.y)/(Bw.y-zw.y):(Gw.x-zw.x)/(Bw.x-zw.x);if(isNaN(c))return;c<0?J.copy(Gw,zw):c>1&&J.copy(Gw,Bw)}Gw.toArray(e[1])}}}function Jw(e,t,n,r){var i=n===`normal`,a=i?e:e.ensureState(n);a.ignore=t;var o=r.get(`smooth`);o&&o===!0&&(o=.3),a.shape=a.shape||{},o>0&&(a.shape.smooth=o);var s=r.getModel(`lineStyle`).getLineStyle();i?e.useStyle(s):a.style=s}function Yw(e,t){var n=t.smooth,r=t.points;if(r){if(e.moveTo(r[0][0],r[0][1]),n>0&&r.length>=3){var i=We(r[0],r[1]),a=We(r[1],r[2]);if(!i||!a){e.lineTo(r[1][0],r[1][1]),e.lineTo(r[2][0],r[2][1]);return}var o=Math.min(i,a)*n,s=qe([],r[1],r[0],o/i),c=qe([],r[1],r[2],o/a),l=qe([],s,c,.5);e.bezierCurveTo(s[0],s[1],s[0],s[1],l[0],l[1]),e.bezierCurveTo(c[0],c[1],c[0],c[1],r[2][0],r[2][1])}else for(var u=1;u0&&a&&S(-d/o,0,o);var g=e[0],_=e[o-1],v,y;b(),v<0&&C(-v,.8),y<0&&C(y,.8),b(),x(v,y,1),x(y,v,-1),b(),v<0&&w(-v),y<0&&w(y);function b(){v=g.rect[t]-r,y=i-_.rect[t]-_.rect[n]}function x(e,t,n){if(e<0){var r=Math.min(t,-e);if(r>0){S(r*n,0,o);var i=r+e;i<0&&C(-i*n,1)}else C(-e*n,1)}}function S(n,r,i){n!==0&&(l=!0);for(var a=r;a0)for(var c=0;c0;c--){var f=a[c-1]*d;S(-f,c,o)}}}function w(e){var t=e<0?-1:1;e=Math.abs(e);for(var n=Math.ceil(e/(o-1)),r=0;r0?S(n,0,r+1):S(-n,o-r-1,o),e-=n,e<=0)return}return l}function eT(e,t,n,r){return $w(e,`x`,`width`,t,n,r)}function tT(e,t,n,r){return $w(e,`y`,`height`,t,n,r)}function nT(e){var t=[];e.sort(function(e,t){return t.priority-e.priority});var n=new Y(0,0,0,0);function r(e){if(!e.ignore){var t=e.ensureState(`emphasis`);t.ignore??=!1}e.ignore=!0}for(var i=0;i=0&&n.attr(i.oldLayoutSelect),N(u,`emphasis`)>=0&&n.attr(i.oldLayoutEmphasis)),Bd(n,c,t,s)}else if(n.attr(c),!Hf(n).valueAnimation){var d=G(n.style.opacity,1);n.style.opacity=0,Vd(n,{style:{opacity:d}},t,s)}if(i.oldLayout=c,n.states.select){var f=i.oldLayoutSelect={};lT(f,c,uT),lT(f,n.states.select,uT)}if(n.states.emphasis){var p=i.oldLayoutEmphasis={};lT(p,c,uT),lT(p,n.states.emphasis,uT)}Wf(n,s,l,t,t)}if(r&&!r.ignore&&!r.invisible){var i=cT(r),a=i.oldLayout,m={points:r.shape.points};a?(r.attr({shape:a}),Bd(r,{shape:m},t)):(r.setShape(m),r.style.strokePercent=0,Vd(r,{style:{strokePercent:1}},t)),i.oldLayout=m}},e}(),fT=To();function pT(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){var r=fT(t).labelManager;r||=fT(t).labelManager=new dT,r.clearLabels()}),e.registerUpdateLifecycle(`series:layoutlabels`,function(e,t,n){var r=fT(t).labelManager;n.updatedSeries.forEach(function(e){r.addLabelsOfSeries(t.getViewOfSeriesModel(e))}),r.updateLayoutConfig(t),r.layout(t),r.processLabelsOverall()})}var mT=Math.sin,hT=Math.cos,gT=Math.PI,_T=Math.PI*2,vT=180/gT,yT=function(){function e(){}return e.prototype.reset=function(e){this._start=!0,this._d=[],this._str=``,this._p=10**(e||4)},e.prototype.moveTo=function(e,t){this._add(`M`,e,t)},e.prototype.lineTo=function(e,t){this._add(`L`,e,t)},e.prototype.bezierCurveTo=function(e,t,n,r,i,a){this._add(`C`,e,t,n,r,i,a)},e.prototype.quadraticCurveTo=function(e,t,n,r){this._add(`Q`,e,t,n,r)},e.prototype.arc=function(e,t,n,r,i,a){this.ellipse(e,t,n,n,0,r,i,a)},e.prototype.ellipse=function(e,t,n,r,i,a,o,s){var c=o-a,l=!s,u=Math.abs(c),d=Tr(u-_T)||(l?c>=_T:-c>=_T),f=c>0?c%_T:c%_T+_T,p=!1;p=d?!0:!Tr(u)&&f>=gT==!!l;var m=e+n*hT(a),h=t+r*mT(a);this._start&&this._add(`M`,m,h);var g=Math.round(i*vT);if(d){var _=1/this._p,v=(l?1:-1)*(_T-_);this._add(`A`,n,r,g,1,+l,e+n*hT(a+v),t+r*mT(a+v)),_>.01&&this._add(`A`,n,r,g,0,+l,m,h)}else{var y=e+n*hT(o),b=t+r*mT(o);this._add(`A`,n,r,g,+p,+l,y,b)}},e.prototype.rect=function(e,t,n,r){this._add(`M`,e,t),this._add(`l`,n,0),this._add(`l`,0,r),this._add(`l`,-n,0),this._add(`Z`)},e.prototype.closePath=function(){this._d.length>0&&this._add(`Z`)},e.prototype._add=function(e,t,n,r,i,a,o,s,c){for(var l=[],u=this._p,d=1;d`}function FT(e){return``}function IT(e,t){t||={};var n=t.newline?` +`:``;function r(e){var t=e.children,i=e.tag,a=e.attrs,o=e.text;return PT(i,a)+(i===`style`?o||``:ft(o))+(t?``+n+I(t,function(e){return r(e)}).join(n)+n:``)+FT(i)}return r(e)}function LT(e,t,n){n||={};var r=n.newline?` +`:``,i=` {`+r,a=r+`}`,o=I(R(e),function(t){return t+i+I(R(e[t]),function(n){return n+`:`+e[t][n]+`;`}).join(r)+a}).join(r),s=I(R(t),function(e){return`@keyframes `+e+i+I(R(t[e]),function(n){return n+i+I(R(t[e][n]),function(r){var i=t[e][n][r];return r===`d`&&(i=`path("`+i+`")`),r+`:`+i+`;`}).join(r)+a}).join(r)+a}).join(r);return!o&&!s?``:[``].join(r)}function RT(e){return{zrId:e,shadowCache:{},patternCache:{},gradientCache:{},clipPathCache:{},defs:{},cssNodes:{},cssAnims:{},cssStyleCache:{},cssAnimIdx:0,shadowIdx:0,gradientIdx:0,patternIdx:0,clipPathIdx:0}}function zT(e,t,n,r){return NT(`svg`,`root`,{width:e,height:t,xmlns:DT,"xmlns:xlink":OT,version:`1.1`,baseProfile:`full`,viewBox:r?`0 0 `+e+` `+t:!1},n)}var BT=0;function VT(){return BT++}var HT={cubicIn:`0.32,0,0.67,0`,cubicOut:`0.33,1,0.68,1`,cubicInOut:`0.65,0,0.35,1`,quadraticIn:`0.11,0,0.5,0`,quadraticOut:`0.5,1,0.89,1`,quadraticInOut:`0.45,0,0.55,1`,quarticIn:`0.5,0,0.75,0`,quarticOut:`0.25,1,0.5,1`,quarticInOut:`0.76,0,0.24,1`,quinticIn:`0.64,0,0.78,0`,quinticOut:`0.22,1,0.36,1`,quinticInOut:`0.83,0,0.17,1`,sinusoidalIn:`0.12,0,0.39,0`,sinusoidalOut:`0.61,1,0.88,1`,sinusoidalInOut:`0.37,0,0.63,1`,exponentialIn:`0.7,0,0.84,0`,exponentialOut:`0.16,1,0.3,1`,exponentialInOut:`0.87,0,0.13,1`,circularIn:`0.55,0,1,0.45`,circularOut:`0,0.55,0.45,1`,circularInOut:`0.85,0,0.15,1`},UT=`transform-origin`;function WT(e,t,n){var r=j({},e.shape);j(r,t),e.buildPath(n,r);var i=new yT;return i.reset(Br(e)),n.rebuildPath(i,1),i.generateStr(),i.getStr()}function GT(e,t){var n=t.originX,r=t.originY;(n||r)&&(e[UT]=n+`px `+r+`px`)}var KT={fill:`fill`,opacity:`opacity`,lineWidth:`stroke-width`,lineDashOffset:`stroke-dashoffset`};function qT(e,t){var n=t.zrId+`-ani-`+t.cssAnimIdx++;return t.cssAnims[n]=e,n}function JT(e,t,n){var r=e.shape.paths,i={},a,o;if(F(r,function(e){var t=RT(n.zrId);t.animation=!0,XT(e,{},t,!0);var r=t.cssAnims,s=t.cssNodes,c=R(r),l=c.length;if(l){o=c[l-1];var u=r[o];for(var d in u){var f=u[d];i[d]=i[d]||{d:``},i[d].d+=f.d||``}for(var p in s){var m=s[p].animation;m.indexOf(o)>=0&&(a=m)}}}),a){t.d=!1;var s=qT(i,n);return a.replace(o,s)}}function YT(e){return U(e)?HT[e]?`cubic-bezier(`+HT[e]+`)`:Kn(e)?e:``:``}function XT(e,t,n,r){var i=e.animators,a=i.length,o=[];if(e instanceof Ed){var s=JT(e,t,n);if(s)o.push(s);else if(!a)return}else if(!a)return;for(var c={},l=0;l0}).length)return qT(l,n)+` `+i[0]+` both`}for(var g in c){var s=h(c[g]);s&&o.push(s)}if(o.length){var _=n.zrId+`-cls-`+VT();n.cssNodes[`.`+_]={animation:o.join(`,`)},t.class=_}}function ZT(e,t,n){if(!e.ignore){if(e.isSilent()){var r={"pointer-events":`none`};QT(r,t,n,!0)}else{var i=e.states.emphasis&&e.states.emphasis.style?e.states.emphasis.style:{},a=i.fill;if(!a){var o=e.style&&e.style.fill,s=e.states.select&&e.states.select.style&&e.states.select.style.fill,c=e.currentStates.indexOf(`select`)>=0&&s||o;c&&(a=xr(c))}var l=i.lineWidth;if(l){var u=!i.strokeNoScale&&e.transform?e.transform[0]:1;l/=u}var r={cursor:`pointer`};a&&(r.fill=a),i.stroke&&(r.stroke=i.stroke),l&&(r[`stroke-width`]=l),QT(r,t,n,!0)}}}function QT(e,t,n,r){var i=JSON.stringify(e),a=n.cssStyleCache[i];a||(a=n.zrId+`-cls-`+VT(),n.cssStyleCache[i]=a,n.cssNodes[`.`+a+(r?`:hover`:``)]=e),t.class=t.class?t.class+` `+a:a}var $T=Math.round;function eE(e){return e&&U(e.src)}function tE(e){return e&&H(e.toDataURL)}function nE(e,t,n,r){ET(function(i,a){var o=i===`fill`||i===`stroke`;o&&Rr(a)?_E(t,e,i,r):o&&Fr(a)?vE(n,e,i,r):e[i]=a,o&&r.ssr&&a===`none`&&(e[`pointer-events`]=`visible`)},t,n,!1),gE(n,e,r)}function rE(e,t){var n=Ta(t);n&&(n.each(function(t,n){t!=null&&(e[(`ecmeta_`+n).toLowerCase()]=t+``)}),t.isSilent()&&(e[jT+`silent`]=`true`))}function iE(e){return Tr(e[0]-1)&&Tr(e[1])&&Tr(e[2])&&Tr(e[3]-1)}function aE(e){return Tr(e[4])&&Tr(e[5])}function oE(e,t,n){if(t&&!(aE(t)&&iE(t))){var r=n?10:1e4;e.transform=iE(t)?`translate(`+$T(t[4]*r)/r+` `+$T(t[5]*r)/r+`)`:Or(t)}}function sE(e,t,n){for(var r=e.points,i=[],a=0;a`u`){var g=`Image width/height must been given explictly in svg-ssr renderer.`;ve(f,g),ve(p,g)}else if(f==null||p==null){var _=function(e,t){if(e){var n=e.elm,r=f||t.width,i=p||t.height;e.tag===`pattern`&&(l?(i=1,r/=a.width):u&&(r=1,i/=a.height)),e.attrs.width=r,e.attrs.height=i,n&&(n.setAttribute(`width`,r),n.setAttribute(`height`,i))}},v=ns(m,null,e,function(e){c||_(S,e),_(d,e)});v&&v.width&&v.height&&(f||=v.width,p||=v.height)}d=NT(`image`,`img`,{href:m,width:f,height:p}),o.width=f,o.height=p}else i.svgElement&&(d=O(i.svgElement),o.width=i.svgWidth,o.height=i.svgHeight);if(d){var y,b;c?y=b=1:l?(b=1,y=o.width/a.width):u?(y=1,b=o.height/a.height):o.patternUnits=`userSpaceOnUse`,y!=null&&!isNaN(y)&&(o.width=y),b!=null&&!isNaN(b)&&(o.height=b);var x=Vr(i);x&&(o.patternTransform=x);var S=NT(`pattern`,``,o,[d]),C=IT(S),w=r.patternCache,T=w[C];T||(T=r.zrId+`-p`+r.patternIdx++,w[C]=T,o.id=T,S=r.defs[T]=NT(`pattern`,T,o,[d])),t[n]=zr(T)}}function yE(e,t,n){var r=n.clipPathCache,i=n.defs,a=r[e.id];if(!a){a=n.zrId+`-c`+n.clipPathIdx++;var o={id:a};r[e.id]=a,i[a]=NT(`clipPath`,a,o,[fE(e,n)])}t[`clip-path`]=zr(a)}function bE(e){return document.createTextNode(e)}function xE(e,t,n){e.insertBefore(t,n)}function SE(e,t){e.removeChild(t)}function CE(e,t){e.appendChild(t)}function wE(e){return e.parentNode}function TE(e){return e.nextSibling}function EE(e,t){e.textContent=t}var DE=58,OE=120,kE=NT(``,``);function AE(e){return e===void 0}function jE(e){return e!==void 0}function ME(e,t,n){for(var r={},i=t;i<=n;++i){var a=e[i].key;a!==void 0&&(r[a]=i)}return r}function NE(e,t){var n=e.key===t.key;return e.tag===t.tag&&n}function PE(e){var t,n=e.children,r=e.tag;if(jE(r)){var i=e.elm=MT(r);if(LE(kE,e),V(n))for(t=0;ta?(m=n[c+1]==null?null:n[c+1].elm,FE(e,m,n,i,c)):IE(e,t,r,a))}function zE(e,t){var n=t.elm=e.elm,r=e.children,i=t.children;e!==t&&(LE(e,t),AE(t.text)?jE(r)&&jE(i)?r!==i&&RE(n,r,i):jE(i)?(jE(e.text)&&EE(n,``),FE(n,null,i,0,i.length-1)):jE(r)?IE(n,r,0,r.length-1):jE(e.text)&&EE(n,``):e.text!==t.text&&(jE(r)&&IE(n,r,0,r.length-1),EE(n,t.text)))}function BE(e,t){if(NE(e,t))zE(e,t);else{var n=e.elm,r=wE(n);PE(t),r!==null&&(xE(r,t.elm,TE(n)),IE(r,[e],0,0))}return t}var VE=0,HE=function(){function e(e,t,n){if(this.type=`svg`,this.refreshHover=UE(`refreshHover`),this.configLayer=UE(`configLayer`),this.storage=t,this._opts=n=j({},n),this.root=e,this._id=`zr`+VE++,this._oldVNode=zT(n.width,n.height),e&&!n.ssr){var r=this._viewport=document.createElement(`div`);r.style.cssText=`position:relative;overflow:hidden`;var i=this._svgDom=this._oldVNode.elm=MT(`svg`);LE(null,this._oldVNode),r.appendChild(i),e.appendChild(r)}this.resize(n.width,n.height)}return e.prototype.getType=function(){return this.type},e.prototype.getViewportRoot=function(){return this._viewport},e.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},e.prototype.getSvgDom=function(){return this._svgDom},e.prototype.refresh=function(){if(this.root){var e=this.renderToVNode({willUpdate:!0});e.attrs.style=`position:absolute;left:0;top:0;user-select:none`,BE(this._oldVNode,e),this._oldVNode=e}},e.prototype.renderOneToVNode=function(e){return hE(e,RT(this._id))},e.prototype.renderToVNode=function(e){e||={};var t=this.storage.getDisplayList(!0),n=this._width,r=this._height,i=RT(this._id);i.animation=e.animation,i.willUpdate=e.willUpdate,i.compress=e.compress,i.emphasis=e.emphasis,i.ssr=this._opts.ssr;var a=[],o=this._bgVNode=WE(n,r,this._backgroundColor,i);o&&a.push(o);var s=e.compress?null:this._mainVNode=NT(`g`,`main`,{},[]);this._paintList(t,i,s?s.children:a),s&&a.push(s);var c=I(R(i.defs),function(e){return i.defs[e]});if(c.length&&a.push(NT(`defs`,`defs`,{},c)),e.animation){var l=LT(i.cssNodes,i.cssAnims,{newline:!0});if(l){var u=NT(`style`,`stl`,{},[],l);a.push(u)}}return zT(n,r,a,e.useViewBox)},e.prototype.renderToString=function(e){return e||={},IT(this.renderToVNode({animation:G(e.cssAnimation,!0),emphasis:G(e.cssEmphasis,!0),willUpdate:!1,compress:!0,useViewBox:G(e.useViewBox,!0)}),{newline:!0})},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e},e.prototype.getSvgRoot=function(){return this._mainVNode&&this._mainVNode.elm},e.prototype._paintList=function(e,t,n){for(var r=e.length,i=[],a=0,o,s,c=0,l=0;l=0&&!(d&&s&&d[m]===s[m]);m--);for(var h=p-1;h>m;h--)a--,o=i[a-1];for(var g=m+1;g=a}}}for(var l=this.__startIndex;l15)break}n.prevElClipPaths&&c.restore()};if(l){if(l.length===0)v=s.__endIndex;else for(var b=p.dpr,x=0;x0&&e>r[0]){for(s=0;se);s++);o=n[r[s]]}if(r.splice(s+1,0,e),n[e]=t,!t.virtual){if(o){var c=o.dom;c.nextSibling?a.insertBefore(t.dom,c.nextSibling):a.appendChild(t.dom)}else a.firstChild?a.insertBefore(t.dom,a.firstChild):a.appendChild(t.dom)}t.painter||=this}},e.prototype.eachLayer=function(e,t){for(var n=this._zlevelList,r=0;r0?XE:0),this._needsManuallyCompositing),l.__builtin__||D(`ZLevel `+c+` has been used by unkown layer `+l.id),l!==i&&(l.__used=!0,l.__startIndex!==s&&(l.__dirty=!0),l.__startIndex=s,l.incremental?l.__drawIndex=-1:l.__drawIndex=s,t(s),i=l),r.__dirty&1&&!r.__inHover&&(l.__dirty=!0,l.incremental&&l.__drawIndex<0&&(l.__drawIndex=s))}t(s),this.eachBuiltinLayer(function(e,t){!e.__used&&e.getElementCount()>0&&(e.__dirty=!0,e.__startIndex=e.__endIndex=e.__drawIndex=0),e.__dirty&&e.__drawIndex<0&&(e.__drawIndex=e.__startIndex)})},e.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},e.prototype._clearLayer=function(e){e.clear()},e.prototype.setBackgroundColor=function(e){this._backgroundColor=e,F(this._layers,function(e){e.setUnpainted()})},e.prototype.configLayer=function(e,t){if(t){var n=this._layerConfig;n[e]?k(n[e],t,!0):n[e]=t;for(var r=0;r-1&&(s.style.stroke=s.style.fill,s.style.fill=`#fff`,s.style.lineWidth=2),t},t.type=`series.line`,t.dependencies=[`grid`,`polar`],t.defaultOption={z:3,coordinateSystem:`cartesian2d`,legendHoverLink:!0,clip:!0,label:{position:`top`},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:`solid`},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:`emptyCircle`,symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:`auto`,connectNulls:!1,sampling:`none`,animationEasing:`linear`,progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:`clone`},triggerLineEvent:!1},t}(P_);function rD(e,t){var n=e.mapDimensionsAll(`defaultedLabel`),r=n.length;if(r===1){var i=bg(e,t,n[0]);return i==null?null:i+``}if(r){for(var a=[],o=0;o=0&&r.push(t[a])}return r.join(` `)}var aD=function(e){r(t,e);function t(t,n,r,i){var a=e.call(this)||this;return a.updateData(t,n,r,i),a}return t.prototype._createSymbol=function(e,t,n,r,i){this.removeAll();var a=ay(e,-1,-1,2,2,null,i);a.attr({z2:100,culling:!0,scaleX:r[0]/2,scaleY:r[1]/2}),a.drift=oD,this._symbolType=e,this.add(a)},t.prototype.stopSymbolAnimation=function(e){this.childAt(0).stopAnimation(null,e)},t.prototype.getSymbolType=function(){return this._symbolType},t.prototype.getSymbolPath=function(){return this.childAt(0)},t.prototype.highlight=function(){Hl(this.childAt(0))},t.prototype.downplay=function(){Ul(this.childAt(0))},t.prototype.setZ=function(e,t){var n=this.childAt(0);n.zlevel=e,n.z=t},t.prototype.setDraggable=function(e,t){var n=this.childAt(0);n.draggable=e,n.cursor=!t&&e?`move`:n.cursor},t.prototype.updateData=function(e,n,r,i){this.silent=!1;var a=e.getItemVisual(n,`symbol`)||`circle`,o=e.hostModel,s=t.getSymbolSize(e,n),c=a!==this._symbolType,l=i&&i.disableAnimation;if(c){var u=e.getItemVisual(n,`symbolKeepAspect`);this._createSymbol(a,e,n,s,u)}else{var d=this.childAt(0);d.silent=!1;var f={scaleX:s[0]/2,scaleY:s[1]/2};l?d.attr(f):Bd(d,f,o,n),Kd(d)}if(this._updateCommon(e,n,s,r,i),c){var d=this.childAt(0);if(!l){var f={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Vd(d,f,o,n)}}l&&this.childAt(0).stopAnimation(`leave`)},t.prototype._updateCommon=function(e,t,n,r,i){var a=this.childAt(0),o=e.hostModel,s,c,l,u,d,f,p,m,h;if(r&&(s=r.emphasisItemStyle,c=r.blurItemStyle,l=r.selectItemStyle,u=r.focus,d=r.blurScope,p=r.labelStatesModels,m=r.hoverScale,h=r.cursorStyle,f=r.emphasisDisabled),!r||e.hasItemOption){var g=r&&r.itemModel?r.itemModel:e.getItemModel(t),_=g.getModel(`emphasis`);s=_.getModel(`itemStyle`).getItemStyle(),l=g.getModel([`select`,`itemStyle`]).getItemStyle(),c=g.getModel([`blur`,`itemStyle`]).getItemStyle(),u=_.get(`focus`),d=_.get(`blurScope`),f=_.get(`disabled`),p=Mf(g),m=_.getShallow(`scale`),h=g.getShallow(`cursor`)}var v=e.getItemVisual(t,`symbolRotate`);a.attr(`rotation`,(v||0)*Math.PI/180||0);var y=sy(e.getItemVisual(t,`symbolOffset`),n);y&&(a.x=y[0],a.y=y[1]),h&&a.attr(`cursor`,h);var b=e.getItemVisual(t,`style`),x=b.fill;if(a instanceof zc){var S=a.style;a.useStyle(j({image:S.image,x:S.x,y:S.y,width:S.width,height:S.height},b))}else a.__isEmptyBrush?a.useStyle(j({},b)):a.useStyle(b),a.style.decal=null,a.setColor(x,i&&i.symbolInnerColor),a.style.strokeNoScale=!0;var C=e.getItemVisual(t,`liftZ`),w=this._z2;C==null?w!=null&&(a.z2=w,this._z2=null):w??(this._z2=a.z2,a.z2+=C);var T=i&&i.useNameLabel;jf(a,p,{labelFetcher:o,labelDataIndex:t,defaultText:E,inheritColor:x,defaultOpacity:b.opacity});function E(t){return T?e.getName(t):rD(e,t)}this._sizeX=n[0]/2,this._sizeY=n[1]/2;var D=a.ensureState(`emphasis`);D.style=s,a.ensureState(`select`).style=l,a.ensureState(`blur`).style=c;var O=m==null||m===!0?Math.max(1.1,3/this._sizeY):isFinite(m)&&m>0?+m:1;D.scaleX=this._sizeX*O,D.scaleY=this._sizeY*O,this.setSymbolScale(1),su(this,u,d,f)},t.prototype.setSymbolScale=function(e){this.scaleX=this.scaleY=e},t.prototype.fadeOut=function(e,t,n){var r=this.childAt(0),i=Q(this).dataIndex,a=n&&n.animation;if(this.silent=r.silent=!0,n&&n.fadeLabel){var o=r.getTextContent();o&&Ud(o,{style:{opacity:0}},t,{dataIndex:i,removeOpt:a,cb:function(){r.removeTextContent()}})}else r.removeTextContent();Ud(r,{style:{opacity:0},scaleX:0,scaleY:0},t,{dataIndex:i,cb:e,removeOpt:a})},t.getSymbolSize=function(e,t){return oy(e.getItemVisual(t,`symbolSize`))},t}(X);function oD(e,t){this.parent.drift(e,t)}function sD(e,t,n,r){return t&&!isNaN(t[0])&&!isNaN(t[1])&&!(r.isIgnore&&r.isIgnore(n))&&!(r.clipShape&&!r.clipShape.contain(t[0],t[1]))&&e.getItemVisual(n,`symbol`)!==`none`}function cD(e){return e!=null&&!W(e)&&(e={isIgnore:e}),e||{}}function lD(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{emphasisItemStyle:n.getModel(`itemStyle`).getItemStyle(),blurItemStyle:t.getModel([`blur`,`itemStyle`]).getItemStyle(),selectItemStyle:t.getModel([`select`,`itemStyle`]).getItemStyle(),focus:n.get(`focus`),blurScope:n.get(`blurScope`),emphasisDisabled:n.get(`disabled`),hoverScale:n.get(`scale`),labelStatesModels:Mf(t),cursorStyle:t.get(`cursor`)}}var uD=function(){function e(e){this.group=new X,this._SymbolCtor=e||aD}return e.prototype.updateData=function(e,t){this._progressiveEls=null,t=cD(t);var n=this.group,r=e.hostModel,i=this._data,a=this._SymbolCtor,o=t.disableAnimation,s=lD(e),c={disableAnimation:o},l=t.getSymbolPoint||function(t){return e.getItemLayout(t)};i||n.removeAll(),e.diff(i).add(function(r){var i=l(r);if(sD(e,i,r,t)){var o=new a(e,r,s,c);o.setPosition(i),e.setItemGraphicEl(r,o),n.add(o)}}).update(function(u,d){var f=i.getItemGraphicEl(d),p=l(u);if(!sD(e,p,u,t)){n.remove(f);return}var m=e.getItemVisual(u,`symbol`)||`circle`,h=f&&f.getSymbolType&&f.getSymbolType();if(!f||h&&h!==m)n.remove(f),f=new a(e,u,s,c),f.setPosition(p);else{f.updateData(e,u,s,c);var g={x:p[0],y:p[1]};o?f.attr(g):Bd(f,g,r)}n.add(f),e.setItemGraphicEl(u,f)}).remove(function(e){var t=i.getItemGraphicEl(e);t&&t.fadeOut(function(){n.remove(t)},r)}).execute(),this._getSymbolPoint=l,this._data=e},e.prototype.updateLayout=function(){var e=this,t=this._data;t&&t.eachItemGraphicEl(function(t,n){var r=e._getSymbolPoint(n);t.setPosition(r),t.markRedraw()})},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=lD(e),this._data=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t,n){this._progressiveEls=[],n=cD(n);function r(e){e.isGroup||(e.incremental=!0,e.ensureState(`emphasis`).hoverLayer=!0)}for(var i=e.start;i0?n=r[0]:r[1]<0&&(n=r[1]),n}function pD(e,t,n,r){var i=NaN;e.stacked&&(i=n.get(n.getCalculationInfo(`stackedOverDimension`),r)),isNaN(i)&&(i=e.valueStart);var a=e.baseDataOffset,o=[];return o[a]=n.get(e.baseDim,r),o[1-a]=i,t.dataToPoint(o)}function mD(e,t){var n=[];return t.diff(e).add(function(e){n.push({cmd:`+`,idx:e})}).update(function(e,t){n.push({cmd:`=`,idx:t,idx1:e})}).remove(function(e){n.push({cmd:`-`,idx:e})}).execute(),n}function hD(e,t,n,r,i,a,o,s){for(var c=mD(e,t),l=[],u=[],d=[],f=[],p=[],m=[],h=[],g=dD(i,t,o),_=e.getLayout(`points`)||[],v=t.getLayout(`points`)||[],y=0;y=i||h<0)break;if(vD(_,v)){if(c){h+=a;continue}break}if(h===n)e[a>0?`moveTo`:`lineTo`](_,v),d=_,f=v;else{var y=_-l,b=v-u;if(y*y+b*b<.5){h+=a;continue}if(o>0){for(var x=h+a,S=t[x*2],C=t[x*2+1];S===_&&C===v&&g=r||vD(S,C))p=_,m=v;else{E=S-l,D=C-u;var A=_-l,j=S-_,M=v-u,N=C-v,ee=void 0,P=void 0;if(s===`x`){ee=Math.abs(A),P=Math.abs(j);var te=E>0?1:-1;p=_-te*ee*o,m=v,O=_+te*P*o,k=v}else if(s===`y`){ee=Math.abs(M),P=Math.abs(N);var F=D>0?1:-1;p=_,m=v-F*ee*o,O=_,k=v+F*P*o}else ee=Math.sqrt(A*A+M*M),P=Math.sqrt(j*j+N*N),T=P/(P+ee),p=_-E*o*(1-T),m=v-D*o*(1-T),O=_+E*o*T,k=v+D*o*T,O=gD(O,_D(S,_)),k=gD(k,_D(C,v)),O=_D(O,gD(S,_)),k=_D(k,gD(C,v)),E=O-_,D=k-v,p=_-E*ee/P,m=v-D*ee/P,p=gD(p,_D(l,_)),m=gD(m,_D(u,v)),p=_D(p,gD(l,_)),m=_D(m,gD(u,v)),E=_-p,D=v-m,O=_+E*P/ee,k=v+D*P/ee}e.bezierCurveTo(d,f,p,m,_,v),d=O,f=k}else e.lineTo(_,v)}l=_,u=v,h+=a}return g}var bD=function(){function e(){this.smooth=0,this.smoothConstraint=!0}return e}(),xD=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polyline`,n}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new bD},t.prototype.buildPath=function(e,t){var n=t.points,r=0,i=n.length/2;if(t.connectNulls){for(;i>0&&vD(n[i*2-2],n[i*2-1]);i--);for(;r=0){var _=o?(d-a)*g+a:(u-i)*g+i;return o?[e,_]:[_,e]}i=u,a=d;break;case r.C:u=n[c++],d=n[c++],f=n[c++],p=n[c++],m=n[c++],h=n[c++];var v=o?Nn(i,u,f,m,e,s):Nn(a,d,p,h,e,s);if(v>0)for(var y=0;y=0){var _=o?jn(a,d,p,h,b):jn(i,u,f,m,b);return o?[e,_]:[_,e]}}i=m,a=h}}},t}(Nc),SD=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t}(bD),CD=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`ec-polygon`,n}return t.prototype.getDefaultShape=function(){return new SD},t.prototype.buildPath=function(e,t){var n=t.points,r=t.stackedOnPoints,i=0,a=n.length/2,o=t.smoothMonotone;if(t.connectNulls){for(;a>0&&vD(n[a*2-2],n[a*2-1]);a--);for(;it){a?n.push(o(a,c,t)):i&&n.push(o(i,c,0),o(i,c,t));break}else i&&=(n.push(o(i,c,0)),null),n.push(c),a=c}return n}function FD(e,t,n){var r=e.getVisual(`visualMeta`);if(!(!r||!r.length||!e.count())&&t.type===`cartesian2d`){for(var i,a,o=r.length-1;o>=0;o--){var s=e.getDimensionInfo(r[o].dimension);if(i=s&&s.coordDim,i===`x`||i===`y`){a=r[o];break}}if(a){var c=t.getAxis(i),l=I(a.stops,function(e){return{coord:c.toGlobalCoord(c.dataToCoord(e.value)),color:e.color}}),u=l.length,d=a.outerColors.slice();u&&l[0].coord>l[u-1].coord&&(l.reverse(),d.reverse());var f=PD(l,i===`x`?n.getWidth():n.getHeight()),p=f.length;if(!p&&u)return l[0].coord<0?d[1]?d[1]:l[u-1].color:d[0]?d[0]:l[0].color;var m=10,h=f[0].coord-m,g=f[p-1].coord+m,_=g-h;if(_<.001)return`transparent`;F(f,function(e){e.offset=(e.coord-h)/_}),f.push({offset:p?f[p-1].offset:.5,color:d[1]||`transparent`}),f.unshift({offset:p?f[0].offset:.5,color:d[0]||`transparent`});var v=new Od(0,0,0,0,f,!0);return v[i]=h,v[i+`2`]=g,v}}}function ID(e,t,n){var r=e.get(`showAllSymbol`),i=r===`auto`;if(!(r&&!i)){var a=n.getAxesByScale(`ordinal`)[0];if(a&&!(i&&LD(a,t))){var o=t.mapDimension(a.dim),s={};return F(a.getViewLabels(),function(e){var t=a.scale.getRawOrdinalNumber(e.tickValue);s[t]=1}),function(e){return!s.hasOwnProperty(t.get(o,e))}}}}function LD(e,t){var n=e.getExtent(),r=Math.abs(n[1]-n[0])/e.scale.count();isNaN(r)&&(r=0);for(var i=t.count(),a=Math.max(1,Math.round(i/5)),o=0;or)return!1;return!0}function RD(e,t){return isNaN(e)||isNaN(t)}function zD(e){for(var t=e.length/2;t>0&&RD(e[t*2-2],e[t*2-1]);t--);return t-1}function BD(e,t){return[e[t*2],e[t*2+1]]}function VD(e,t,n){for(var r=e.length/2,i=n===`x`?0:1,a,o,s=0,c=-1,l=0;l=t||a>=t&&o<=t){c=l;break}s=l,a=o}return{range:[s,c],t:(t-a)/(o-a)}}function HD(e){if(e.get([`endLabel`,`show`]))return!0;for(var t=0;t0&&e.get([`emphasis`,`lineStyle`,`width`])===`bolder`){var N=f.getState(`emphasis`).style;N.lineWidth=+f.style.lineWidth+1}Q(f).seriesIndex=e.seriesIndex,su(f,k,A,j);var ee=jD(e.get(`smooth`)),P=e.get(`smoothMonotone`);if(f.setShape({smooth:ee,smoothMonotone:P,connectNulls:x}),p){var te=a.getCalculationInfo(`stackedOnSeries`),F=0;p.useStyle(M(s.getAreaStyle(),{fill:E,opacity:.7,lineJoin:`bevel`,decal:a.getVisual(`style`).decal})),te&&(F=jD(te.get(`smooth`))),p.setShape({smooth:ee,stackedOnSmooth:F,smoothMonotone:P,connectNulls:x}),du(p,e,`areaStyle`),Q(p).seriesIndex=e.seriesIndex,su(p,k,A,j)}var I=this._changePolyState;a.eachItemGraphicEl(function(e){e&&(e.onHoverStateChange=I)}),this._polyline.onHoverStateChange=I,this._data=a,this._coordSys=r,this._stackedOnPoints=y,this._points=c,this._step=w,this._valueOrigin=_,e.get(`triggerLineEvent`)&&(this.packEventData(e,f),p&&this.packEventData(e,p))},t.prototype.packEventData=function(e,t){Q(t).eventData={componentType:`series`,componentSubType:`line`,componentIndex:e.componentIndex,seriesIndex:e.seriesIndex,seriesName:e.name,seriesType:`line`}},t.prototype.highlight=function(e,t,n,r){var i=e.getData(),a=wo(i,r);if(this._changePolyState(`emphasis`),!(a instanceof Array)&&a!=null&&a>=0){var o=i.getLayout(`points`),s=i.getItemGraphicEl(a);if(!s){var c=o[a*2],l=o[a*2+1];if(isNaN(c)||isNaN(l)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(c,l))return;var u=e.get(`zlevel`)||0,d=e.get(`z`)||0;s=new aD(i,a),s.x=c,s.y=l,s.setZ(u,d);var f=s.getSymbolPath().getTextContent();f&&(f.zlevel=u,f.z=d,f.z2=this._polyline.z2+1),s.__temp=!0,i.setItemGraphicEl(a,s),s.stopSymbolAnimation(!0),this.group.add(s)}s.highlight()}else q_.prototype.highlight.call(this,e,t,n,r)},t.prototype.downplay=function(e,t,n,r){var i=e.getData(),a=wo(i,r);if(this._changePolyState(`normal`),a!=null&&a>=0){var o=i.getItemGraphicEl(a);o&&(o.__temp?(i.setItemGraphicEl(a,null),this.group.remove(o)):o.downplay())}else q_.prototype.downplay.call(this,e,t,n,r)},t.prototype._changePolyState=function(e){var t=this._polygon;Nl(this._polyline,e),t&&Nl(t,e)},t.prototype._newPolyline=function(e){var t=this._polyline;return t&&this._lineGroup.remove(t),t=new xD({shape:{points:e},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(t),this._polyline=t,t},t.prototype._newPolygon=function(e,t){var n=this._polygon;return n&&this._lineGroup.remove(n),n=new CD({shape:{points:e,stackedOnPoints:t},segmentIgnoreThreshold:2}),this._lineGroup.add(n),this._polygon=n,n},t.prototype._initSymbolLabelAnimation=function(e,t,n){var r,i,a=t.getBaseAxis(),o=a.inverse;t.type===`cartesian2d`?(r=a.isHorizontal(),i=!1):t.type===`polar`&&(r=a.dim===`angle`,i=!0);var s=e.hostModel,c=s.get(`animationDuration`);H(c)&&(c=c(null));var l=s.get(`animationDelay`)||0,u=H(l)?l(null):l;e.eachItemGraphicEl(function(e,a){var s=e;if(s){var d=[e.x,e.y],f=void 0,p=void 0,m=void 0;if(n){if(i){var h=n,g=t.pointToCoord(d);r?(f=h.startAngle,p=h.endAngle,m=-g[1]/180*Math.PI):(f=h.r0,p=h.r,m=g[0])}else{var _=n;r?(f=_.x,p=_.x+_.width,m=e.x):(f=_.y+_.height,p=_.y,m=e.y)}}var v=p===f?0:(m-f)/(p-f);o&&(v=1-v);var y=H(l)?l(a):c*v+u,b=s.getSymbolPath(),x=b.getTextContent();s.attr({scaleX:0,scaleY:0}),s.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:y}),x&&x.animateFrom({style:{opacity:0}},{duration:300,delay:y}),b.disableLabelAnimation=!0}})},t.prototype._initOrUpdateEndLabel=function(e,t,n){var r=e.getModel(`endLabel`);if(HD(e)){var i=e.getData(),a=this._polyline,o=i.getLayout(`points`);if(!o){a.removeTextContent(),this._endLabel=null;return}var s=this._endLabel;s||(s=this._endLabel=new Zc({z2:200}),s.ignoreClip=!0,a.setTextContent(this._endLabel),a.disableLabelAnimation=!0);var c=zD(o);c>=0&&(jf(a,Mf(e,`endLabel`),{inheritColor:n,labelFetcher:e,labelDataIndex:c,defaultText:function(e,t,n){return n==null?rD(i,e):iD(i,n)},enableTextSetter:!0},WD(r,t)),a.textConfig.position=null)}else this._endLabel&&=(this._polyline.removeTextContent(),null)},t.prototype._endLabelOnDuring=function(e,t,n,r,i,a,o){var s=this._endLabel,c=this._polyline;if(s){e<1&&r.originalX==null&&(r.originalX=s.x,r.originalY=s.y);var l=n.getLayout(`points`),u=n.hostModel,d=u.get(`connectNulls`),f=a.get(`precision`),p=a.get(`distance`)||0,m=o.getBaseAxis(),h=m.isHorizontal(),g=m.inverse,_=t.shape,v=g?h?_.x:_.y+_.height:h?_.x+_.width:_.y,y=(h?p:0)*(g?-1:1),b=(h?0:-p)*(g?-1:1),x=h?`x`:`y`,S=VD(l,v,x),C=S.range,w=C[1]-C[0],T=void 0;if(w>=1){if(w>1&&!d){var E=BD(l,C[0]);s.attr({x:E[0]+y,y:E[1]+b}),i&&(T=u.getRawValue(C[0]))}else{var E=c.getPointOn(v,x);E&&s.attr({x:E[0]+y,y:E[1]+b});var D=u.getRawValue(C[0]),O=u.getRawValue(C[1]);i&&(T=Io(n,f,D,O,S.t))}r.lastFrameIndex=C[0]}else{var k=e===1||r.lastFrameIndex>0?C[0]:0,E=BD(l,k);i&&(T=u.getRawValue(k)),s.attr({x:E[0]+y,y:E[1]+b})}if(i){var A=Hf(s);typeof A.setLabelText==`function`&&A.setLabelText(T)}}},t.prototype._doUpdateAnimation=function(e,t,n,r,i,a,o){var s=this._polyline,c=this._polygon,l=e.hostModel,u=hD(this._data,e,this._stackedOnPoints,t,this._coordSys,n,this._valueOrigin,a),d=u.current,f=u.stackedOnCurrent,p=u.next,m=u.stackedOnNext;if(i&&(f=ND(u.stackedOnCurrent,u.current,n,i,o),d=ND(u.current,null,n,i,o),m=ND(u.stackedOnNext,u.next,n,i,o),p=ND(u.next,null,n,i,o)),AD(d,p)>3e3||c&&AD(f,m)>3e3){s.stopAnimation(),s.setShape({points:p}),c&&(c.stopAnimation(),c.setShape({points:p,stackedOnPoints:m}));return}s.shape.__points=u.current,s.shape.points=d;var h={shape:{points:p}};u.current!==d&&(h.shape.__points=u.next),s.stopAnimation(),Bd(s,h,l),c&&(c.setShape({points:d,stackedOnPoints:f}),c.stopAnimation(),Bd(c,{shape:{stackedOnPoints:m}},l),s.shape.points!==c.shape.points&&(c.shape.points=s.shape.points));for(var g=[],_=u.status,v=0;v<_.length;v++)if(_[v].cmd===`=`){var y=e.getItemGraphicEl(_[v].idx1);y&&g.push({el:y,ptIdx:v})}s.animators&&s.animators.length&&s.animators[0].during(function(){c&&c.dirtyShape();for(var e=s.shape.__points,t=0;tt&&(t=e[n]);return isFinite(t)?t:NaN},min:function(e){for(var t=1/0,n=0;n10&&a.type===`cartesian2d`&&i){var s=a.getBaseAxis(),c=a.getOtherAxis(s),l=s.getExtent(),u=n.getDevicePixelRatio(),d=Math.abs(l[1]-l[0])*(u||1),f=Math.round(o/d);if(isFinite(f)&&f>1){i===`lttb`?e.setData(r.lttbDownSample(r.mapDimension(c.dim),1/f)):i===`minmax`&&e.setData(r.minmaxDownSample(r.mapDimension(c.dim),1/f));var p=void 0;U(i)?p=qD[i]:H(i)&&(p=i),p&&e.setData(r.downSample(r.mapDimension(c.dim),1/f,p,JD))}}}}}function XD(e){e.registerChartView(GD),e.registerSeriesModel(nD),e.registerLayout(KD(`line`,!0)),e.registerVisual({seriesType:`line`,reset:function(e){var t=e.getData(),n=e.getModel(`lineStyle`).getLineStyle();n&&!n.stroke&&(n.stroke=t.getVisual(`style`).fill),t.setVisual(`legendLineStyle`,n)}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,YD(`line`))}var ZD=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return wS(null,this,{useEncodeDefaulter:!0})},t.prototype.getMarkerPosition=function(e,t,n){var r=this.coordinateSystem;if(r&&r.clampData){var i=r.clampData(e),a=r.dataToPoint(i);if(n)F(r.getAxes(),function(e,n){if(e.type===`category`&&t!=null){var r=e.getTicksCoords(),o=e.getTickModel().get(`alignWithLabel`),s=i[n],c=t[n]===`x1`||t[n]===`y1`;if(c&&!o&&(s+=1),r.length<2)return;if(r.length===2){a[n]=e.toGlobalCoord(e.getExtent()[+!!c]);return}for(var l=void 0,u=void 0,d=1,f=0;fs){u=(p+l)/2;break}f===1&&(d=m-r[0].tickValue)}u??(l?l&&(u=r[r.length-1].coord):u=r[0].coord),a[n]=e.toGlobalCoord(u)}});else{var o=this.getData(),s=o.getLayout(`offset`),c=o.getLayout(`size`),l=+!r.getBaseAxis().isHorizontal();a[l]+=s+c/2}return a}return[NaN,NaN]},t.type=`series.__base_bar__`,t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:`mod`},t}(P_);P_.registerClass(ZD);var QD=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(){return wS(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get(`realtimeSort`,!0)||null})},t.prototype.getProgressive=function(){return this.get(`large`)?this.get(`progressive`):!1},t.prototype.getProgressiveThreshold=function(){var e=this.get(`progressiveThreshold`),t=this.get(`largeThreshold`);return t>e&&(e=t),e},t.prototype.brushSelector=function(e,t,n){return n.rect(t.getItemLayout(e))},t.type=`series.bar`,t.dependencies=[`grid`,`polar`],t.defaultOption=op(ZD.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:`rgba(180, 180, 180, 0.2)`,borderColor:null,borderWidth:0,borderType:`solid`,borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:`#212121`}},realtimeSort:!1}),t}(ZD),$D=function(){function e(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return e}(),eO=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`sausage`,n}return t.prototype.getDefaultShape=function(){return new $D},t.prototype.buildPath=function(e,t){var n=t.cx,r=t.cy,i=Math.max(t.r0||0,0),a=Math.max(t.r,0),o=(a-i)*.5,s=i+o,c=t.startAngle,l=t.endAngle,u=t.clockwise,d=Math.PI*2,f=u?l-cMath.PI/2&&ua)return!0;a=l}return!1},t.prototype._isOrderDifferentInView=function(e,t){for(var n=t.scale,r=n.getExtent(),i=Math.max(0,r[0]),a=Math.min(r[1],n.getOrdinalMeta().categories.length-1);i<=a;++i)if(e.ordinalNumbers[i]!==n.getRawOrdinalNumber(i))return!0},t.prototype._updateSortWithinSameData=function(e,t,n,r){if(this._isOrderChangedWithinSameData(e,t,n)){var i=this._dataSort(e,n,t);this._isOrderDifferentInView(i,n)&&(this._removeOnRenderedListener(r),r.dispatchAction({type:`changeAxisOrder`,componentType:n.dim+`Axis`,axisId:n.index,sortInfo:i}))}},t.prototype._dispatchInitSort=function(e,t,n){var r=t.baseAxis,i=this._dataSort(e,r,function(n){return e.get(e.mapDimension(t.otherAxis.dim),n)});n.dispatchAction({type:`changeAxisOrder`,componentType:r.dim+`Axis`,isInitSort:!0,axisId:r.index,sortInfo:i})},t.prototype.remove=function(e,t){this._clear(this._model),this._removeOnRenderedListener(t)},t.prototype.dispose=function(e,t){this._removeOnRenderedListener(t)},t.prototype._removeOnRenderedListener=function(e){this._onRendered&&=(e.getZr().off(`rendered`,this._onRendered),null)},t.prototype._clear=function(e){var t=this.group,n=this._data;e&&e.isAnimationEnabled()&&n&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],n.eachItemGraphicEl(function(t){Gd(t,e,Q(t).dataIndex)})):t.removeAll(),this._data=null,this._isFirstFrame=!0},t.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},t.type=`bar`,t}(q_),uO={cartesian2d:function(e,t){var n=t.width<0?-1:1,r=t.height<0?-1:1;n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height);var i=e.x+e.width,a=e.y+e.height,o=oO(t.x,e.x),s=sO(t.x+t.width,i),c=oO(t.y,e.y),l=sO(t.y+t.height,a),u=si?s:o,t.y=d&&c>a?l:c,t.width=u?0:s-o,t.height=d?0:l-c,n<0&&(t.x+=t.width,t.width=-t.width),r<0&&(t.y+=t.height,t.height=-t.height),u||d},polar:function(e,t){var n=t.r0<=t.r?1:-1;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}var i=sO(t.r,e.r),a=oO(t.r0,e.r0);t.r=i,t.r0=a;var o=i-a<0;if(n<0){var r=t.r;t.r=t.r0,t.r0=r}return o}},dO={cartesian2d:function(e,t,n,r,i,a,o,s,c){var l=new qc({shape:j({},r),z2:1});if(l.__dataIndex=n,l.name=`item`,a){var u=l.shape,d=i?`height`:`width`;u[d]=0}return l},polar:function(e,t,n,r,i,a,o,s,c){var l=!i&&c?eO:cd,u=new l({shape:r,z2:1});if(u.name=`item`,u.calculateTextPosition=tO(bO(i),{isRoundCap:l===eO}),a){var d=u.shape,f=i?`r`:`endAngle`,p={};d[f]=i?r.r0:r.startAngle,p[f]=r[f],(s?Bd:Vd)(u,{shape:p},a)}return u}};function fO(e,t){var n=e.get(`realtimeSort`,!0),r=t.getBaseAxis();if(n&&r.type===`category`&&t.type===`cartesian2d`)return{baseAxis:r,otherAxis:t.getOtherAxis(r)}}function pO(e,t,n,r,i,a,o,s){var c,l;a?(l={x:r.x,width:r.width},c={y:r.y,height:r.height}):(l={y:r.y,height:r.height},c={x:r.x,width:r.width}),s||(o?Bd:Vd)(n,{shape:c},t,i,null);var u=t?e.baseAxis.model:null;(o?Bd:Vd)(n,{shape:l},u,i)}function mO(e,t){for(var n=0;n0?1:-1,o=r.height>0?1:-1;return{x:r.x+a*i/2,y:r.y+o*i/2,width:r.width-a*i,height:r.height-o*i}},polar:function(e,t,n){var r=e.getItemLayout(t);return{cx:r.cx,cy:r.cy,r0:r.r0,r:r.r,startAngle:r.startAngle,endAngle:r.endAngle,clockwise:r.clockwise}}};function yO(e){return e.startAngle!=null&&e.endAngle!=null&&e.startAngle===e.endAngle}function bO(e){return function(e){var t=e?`Arc`:`Angle`;return function(e){switch(e){case`start`:case`insideStart`:case`end`:case`insideEnd`:return e+t;default:return e}}}(e)}function xO(e,t,n,r,i,a,o,s){var c=t.getItemVisual(n,`style`);if(!s){var l=r.get([`itemStyle`,`borderRadius`])||0;e.setShape(`r`,l)}else if(!a.get(`roundCap`)){var u=e.shape;j(u,aO(r.getModel(`itemStyle`),u,!0)),e.setShape(u)}e.useStyle(c);var d=r.getShallow(`cursor`);d&&e.attr(`cursor`,d);var f=s?o?i.r>=i.r0?`endArc`:`startArc`:i.endAngle>=i.startAngle?`endAngle`:`startAngle`:o?i.height>=0?`bottom`:`top`:i.width>=0?`right`:`left`,p=Mf(r);jf(e,p,{labelFetcher:a,labelDataIndex:n,defaultText:rD(a.getData(),n),inheritColor:c.fill,defaultOpacity:c.opacity,defaultOutsidePosition:f});var m=e.getTextContent();if(s&&m){var h=r.get([`label`,`position`]);e.textConfig.inside=h===`middle`||null,nO(e,h===`outside`?f:h,bO(o),r.get([`label`,`rotate`]))}Uf(m,p,a.getRawValue(n),function(e){return iD(t,e)});var g=r.getModel([`emphasis`]);su(e,g.get(`focus`),g.get(`blurScope`),g.get(`disabled`)),du(e,r),yO(i)&&(e.style.fill=`none`,e.style.stroke=`none`,F(e.states,function(e){e.style&&(e.style.fill=e.style.stroke=`none`)}))}function SO(e,t){var n=e.get([`itemStyle`,`borderColor`]);if(!n||n===`none`)return 0;var r=e.get([`itemStyle`,`borderWidth`])||0,i=isNaN(t.width)?Number.MAX_VALUE:Math.abs(t.width),a=isNaN(t.height)?Number.MAX_VALUE:Math.abs(t.height);return Math.min(r,i,a)}var CO=function(){function e(){}return e}(),wO=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`largeBar`,n}return t.prototype.getDefaultShape=function(){return new CO},t.prototype.buildPath=function(e,t){for(var n=t.points,r=this.baseDimIdx,i=1-this.baseDimIdx,a=[],o=[],s=this.barWidth,c=0;c=0?n:null},30,!1);function DO(e,t,n){for(var r=e.baseDimIdx,i=1-r,a=e.shape.points,o=e.largeDataIndices,s=[],c=[],l=e.barWidth,u=0,d=a.length/3;u=s[0]&&t<=s[0]+c[0]&&n>=s[1]&&n<=s[1]+c[1])return o[u]}return-1}function OO(e,t,n){if(DD(n,`cartesian2d`)){var r=t,i=n.getArea();return{x:e?r.x:i.x,y:e?i.y:r.y,width:e?r.width:i.width,height:e?i.height:r.height}}var i=n.getArea(),a=t;return{cx:i.cx,cy:i.cy,r0:e?i.r0:a.r0,r:e?i.r:a.r,startAngle:e?a.startAngle:0,endAngle:e?a.endAngle:Math.PI*2}}function kO(e,t,n){return new(e.type===`polar`?cd:qc)({shape:OO(t,n,e),silent:!0,z2:0})}function AO(e){e.registerChartView(lO),e.registerSeriesModel(QD),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,B(tC,`bar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,nC(`bar`)),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,YD(`bar`)),e.registerAction({type:`changeAxisOrder`,event:`changeAxisOrder`,update:`update`},function(e,t){var n=e.componentType||`series`;t.eachComponent({mainType:n,query:e},function(t){e.sortInfo&&t.axis.setCategorySortInfo(e.sortInfo)})})}var jO=Math.PI*2,MO=Math.PI/180;function NO(e,t){return mm(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function PO(e,t){var n=NO(e,t),r=e.get(`center`),i=e.get(`radius`);V(i)||(i=[0,i]);var a=Z(n.width,t.getWidth()),o=Z(n.height,t.getHeight()),s=Math.min(a,o),c=Z(i[0],s/2),l=Z(i[1],s/2),u,d,f=e.coordinateSystem;if(f){var p=f.dataToPoint(r);u=p[0]||0,d=p[1]||0}else V(r)||(r=[r,r]),u=Z(r[0],a)+n.x,d=Z(r[1],o)+n.y;return{cx:u,cy:d,r0:c,r:l}}function FO(e,t,n){t.eachSeriesByType(e,function(e){var t=e.getData(),r=t.mapDimension(`value`),i=NO(e,n),a=PO(e,n),o=a.cx,s=a.cy,c=a.r,l=a.r0,u=-e.get(`startAngle`)*MO,d=e.get(`endAngle`),f=e.get(`padAngle`)*MO;d=d===`auto`?u-jO:-d*MO;var p=e.get(`minAngle`)*MO+f,m=0;t.each(r,function(e){!isNaN(e)&&m++});var h=t.getSum(r),g=Math.PI/(h||m)*2,_=e.get(`clockwise`),v=e.get(`roseType`),y=e.get(`stillShowZeroSum`),b=t.getDataExtent(r);b[0]=0;var x=_?1:-1,S=[u,d],C=x*f/2;sc(S,!_),u=S[0],d=S[1];var w=IO(e);w.startAngle=u,w.endAngle=d,w.clockwise=_;var T=Math.abs(d-u),E=T,D=0,O=u;if(t.setLayout({viewRect:i,r:c}),t.each(r,function(e,n){var r;if(isNaN(e)){t.setItemLayout(n,{angle:NaN,startAngle:NaN,endAngle:NaN,clockwise:_,cx:o,cy:s,r0:l,r:v?NaN:c});return}r=v===`area`?T/m:h===0&&y?g:e*g,rr?(a=O+x*r/2,u=a):(a=O+C,u=i-C),t.setItemLayout(n,{angle:r,startAngle:a,endAngle:u,clockwise:_,cx:o,cy:s,r0:l,r:v?Aa(e,b,[l,c]):c}),O=i}),En?o:a,d=Math.abs(c.label.y-n);if(d>=l.maxY){var f=c.label.x-t-c.len2*i,p=r+c.len;l.rB=Math.abs(f)e.unconstrainedWidth?null:p:null;r.setStyle(`width`,m)}var h=r.getBoundingRect();a.width=h.width;var g=(r.style.margin||0)+2.1;a.height=h.height+g,a.y-=(a.height-d)/2}}}function HO(e){return e.position===`center`}function UO(e){var t=e.getData(),n=[],r,i,a=!1,o=(e.get(`minShowLabelAngle`)||0)*RO,s=t.getLayout(`viewRect`),c=t.getLayout(`r`),l=s.width,u=s.x,d=s.y,f=s.height;function p(e){e.ignore=!0}function m(e){if(!e.ignore)return!0;for(var t in e.states)if(e.states[t].ignore===!1)return!0;return!1}t.each(function(e){var s=t.getItemGraphicEl(e),d=s.shape,f=s.getTextContent(),h=s.getTextGuideLine(),g=t.getItemModel(e),_=g.getModel(`label`),v=_.get(`position`)||g.get([`emphasis`,`label`,`position`]),y=_.get(`distanceToLabelLine`),b=_.get(`alignTo`),x=Z(_.get(`edgeDistance`),l),S=_.get(`bleedMargin`),C=g.getModel(`labelLine`),w=C.get(`length`);w=Z(w,l);var T=C.get(`length2`);if(T=Z(T,l),Math.abs(d.endAngle-d.startAngle)0?`right`:`left`:D>0?`left`:`right`}var re=Math.PI,R=0,ie=_.get(`rotate`);if(oe(ie))R=re/180*ie;else if(v===`center`)R=0;else if(ie===`radial`||ie===!0)R=D<0?-E+re:-E;else if(ie===`tangential`&&v!==`outside`&&v!==`outer`){var z=Math.atan2(D,O);z<0&&(z=re*2+z),O>0&&(z=re+z),R=z-re}if(a=!!R,f.x=k,f.y=A,f.rotation=R,f.setStyle({verticalAlign:`middle`}),N){f.setStyle({align:M});var B=f.states.select;B&&(B.x+=f.x,B.y+=f.y)}else{var V=f.getBoundingRect().clone();V.applyTransform(f.getComputedTransform());var H=(f.style.margin||0)+2.1;V.y-=H/2,V.height+=H,n.push({label:f,labelLine:h,position:v,len:w,len2:T,minTurnAngle:C.get(`minTurnAngle`),maxSurfaceAngle:C.get(`maxSurfaceAngle`),surfaceNormal:new J(D,O),linePoints:j,textAlign:M,labelDistance:y,labelAlignTo:b,edgeDistance:x,bleedMargin:S,rect:V,unconstrainedWidth:V.width,labelStyleWidth:f.style.width})}s.setTextConfig({inside:N})}}),!a&&e.get(`avoidLabelOverlap`)&&BO(n,r,i,c,l,f,u,d);for(var h=0;h0){for(var c=i.getItemLayout(0),l=1;isNaN(c&&c.startAngle)&&l=n.r0}},t.type=`pie`,t}(q_);function KO(e,t,n){t=V(t)&&{coordDimensions:t}||j({encodeDefine:e.getEncode()},t);var r=e.getSource(),i=uS(r,t).dimensions,a=new lS(i,e);return a.initData(r,n),a}var qO=function(){function e(e,t){this._getDataWithEncodedVisual=e,this._getRawData=t}return e.prototype.getAllNames=function(){var e=this._getRawData();return e.mapArray(e.getName)},e.prototype.containName=function(e){return this._getRawData().indexOfName(e)>=0},e.prototype.indexOfName=function(e){return this._getDataWithEncodedVisual().indexOfName(e)},e.prototype.getItemVisual=function(e,t){return this._getDataWithEncodedVisual().getItemVisual(e,t)},e}(),JO=To(),YO=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new qO(z(this.getData,this),z(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.mergeOption=function(){e.prototype.mergeOption.apply(this,arguments)},t.prototype.getInitialData=function(){return KO(this,{coordDimensions:[`value`],encodeDefaulter:B(zm,this)})},t.prototype.getDataParams=function(t){var n=this.getData(),r=JO(n),i=r.seats;if(!i){var a=[];n.each(n.mapDimension(`value`),function(e){a.push(e)}),i=r.seats=Ia(a,n.hostModel.get(`percentPrecision`))}var o=e.prototype.getDataParams.call(this,t);return o.percent=i[t]||0,o.$vars.push(`percent`),o},t.prototype._defaultLabelLine=function(e){ro(e,`labelLine`,[`show`]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.type=`series.pie`,t.defaultOption={z:2,legendHoverLink:!0,colorBy:`data`,center:[`50%`,`50%`],radius:[0,`75%`],clockwise:!0,startAngle:90,endAngle:`auto`,padAngle:0,minAngle:0,minShowLabelAngle:0,selectedOffset:10,percentPrecision:2,stillShowZeroSum:!0,left:0,top:0,right:0,bottom:0,width:null,height:null,label:{rotate:0,show:!0,overflow:`truncate`,position:`outer`,alignTo:`none`,edgeDistance:`25%`,bleedMargin:10,distanceToLabelLine:5},labelLine:{show:!0,length:15,length2:15,smooth:!1,minTurnAngle:90,maxSurfaceAngle:90,lineStyle:{width:1,type:`solid`}},itemStyle:{borderWidth:1,borderJoin:`round`},showEmptyCircle:!0,emptyCircleStyle:{color:`lightgray`,opacity:1},labelLayout:{hideOverlap:!0},emphasis:{scale:!0,scaleSize:5},avoidLabelOverlap:!0,animationType:`expansion`,animationDuration:1e3,animationTypeUpdate:`transition`,animationEasingUpdate:`cubicInOut`,animationDurationUpdate:500,animationEasing:`cubicInOut`},t}(P_);function XO(e){return{seriesType:e,reset:function(e,t){var n=e.getData();n.filterSelf(function(e){var t=n.mapDimension(`value`),r=n.get(t,e);return!(oe(r)&&!isNaN(r)&&r<0)})}}}function ZO(e){e.registerChartView(GO),e.registerSeriesModel(YO),Kv(`pie`,e.registerAction),e.registerLayout(B(FO,`pie`)),e.registerProcessor(LO(`pie`)),e.registerProcessor(XO(`pie`))}var QO=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.getInitialData=function(e,t){return wS(null,this,{useEncodeDefaulter:!0})},t.prototype.getProgressive=function(){return this.option.progressive??(this.option.large?5e3:this.get(`progressive`))},t.prototype.getProgressiveThreshold=function(){return this.option.progressiveThreshold??(this.option.large?1e4:this.get(`progressiveThreshold`))},t.prototype.brushSelector=function(e,t,n){return n.point(t.getItemLayout(e))},t.prototype.getZLevelKey=function(){return this.getData().count()>this.getProgressiveThreshold()?this.id:``},t.type=`series.scatter`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,symbolSize:10,large:!1,largeThreshold:2e3,itemStyle:{opacity:.8},emphasis:{scale:!0},clip:!0,select:{itemStyle:{borderColor:`#212121`}},universalTransition:{divideShape:`clone`}},t}(P_),$O=4,ek=function(){function e(){}return e}(),tk=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.getDefaultShape=function(){return new ek},t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.buildPath=function(e,t){var n=t.points,r=t.size,i=this.symbolProxy,a=i.shape,o=e.getContext?e.getContext():e,s=o&&r[0]<$O,c=this.softClipShape,l;if(s){this._ctx=o;return}for(this._ctx=null,l=this._off;l=0;s--){var c=s*2,l=r[c]-a/2,u=r[c+1]-o/2;if(e>=l&&t>=u&&e<=l+a&&t<=u+o)return s}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape,n=t.points,r=t.size,i=r[0],a=r[1],o=1/0,s=1/0,c=-1/0,l=-1/0,u=0;u=0&&(c.dataIndex=n+(e.startIndex||0))})},e.prototype.remove=function(){this._clear()},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),rk=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).updateData(r,{clipShape:this._getClipShape(e)}),this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateSymbolDraw(r,e).incrementalPrepareUpdate(r),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._symbolDraw.incrementalUpdate(e,t.getData(),{clipShape:this._getClipShape(t)}),this._finished=e.end===t.getData().count()},t.prototype.updateTransform=function(e,t,n){var r=e.getData();if(this.group.dirty(),!this._finished||r.count()>1e4)return{update:!0};var i=KD(``).reset(e,t,n);i.progress&&i.progress({start:0,end:r.count(),count:r.count()},r),this._symbolDraw.updateLayout(r)},t.prototype.eachRendered=function(e){this._symbolDraw&&this._symbolDraw.eachRendered(e)},t.prototype._getClipShape=function(e){if(e.get(`clip`,!0)){var t=e.coordinateSystem;return t&&t.getArea&&t.getArea(.1)}},t.prototype._updateSymbolDraw=function(e,t){var n=this._symbolDraw,r=t.pipelineContext.large;return(!n||r!==this._isLargeDraw)&&(n&&n.remove(),n=this._symbolDraw=r?new nk:new uD,this._isLargeDraw=r,this.group.removeAll()),this.group.add(n.group),n},t.prototype.remove=function(e,t){this._symbolDraw&&this._symbolDraw.remove(!0),this._symbolDraw=null},t.prototype.dispose=function(){},t.type=`scatter`,t}(q_),ik=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.type=`grid`,t.dependencies=[`xAxis`,`yAxis`],t.layoutMode=`box`,t.defaultOption={show:!1,z:0,left:`10%`,top:60,right:`10%`,bottom:70,containLabel:!1,backgroundColor:`rgba(0,0,0,0)`,borderWidth:1,borderColor:`#ccc`},t}(Sm),ak=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`grid`,ko).models[0]},t.type=`cartesian2dAxis`,t}(Sm);P(ak,GC);var ok={show:!0,z:0,inverse:!1,name:``,nameLocation:`end`,nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:`...`,placeholder:`.`},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:`#6E7079`,width:1,type:`solid`},symbol:[`none`,`none`],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:[`#E0E6F1`],width:1,type:`solid`}},splitArea:{show:!1,areaStyle:{color:[`rgba(250,250,250,0.2)`,`rgba(210,219,238,0.2)`]}}},sk=k({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:`auto`},axisLabel:{interval:`auto`}},ok),ck=k({boundaryGap:[0,0],axisLine:{show:`auto`},axisTick:{show:`auto`},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:`#F4F7FD`,width:1}}},ok),lk={category:sk,value:ck,time:k({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:`bold`}}},splitLine:{show:!1}},ck),log:M({logBase:10},ck)},uk={value:1,category:1,time:1,log:1};function dk(e,t,n,i){F(uk,function(a,o){var s=k(k({},lk[o],!0),i,!0),c=function(e){r(n,e);function n(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t+`Axis.`+o,n}return n.prototype.mergeDefaultAndTheme=function(e,t){var n=_m(this),r=n?ym(e):{};k(e,t.getTheme().get(o+`Axis`)),k(e,this.getDefaultOption()),e.type=fk(e),n&&vm(e,r,n)},n.prototype.optionUpdated=function(){this.option.type===`category`&&(this.__ordinalMeta=kS.createByAxisModel(this))},n.prototype.getCategories=function(e){var t=this.option;if(t.type===`category`)return e?t.data:this.__ordinalMeta.categories},n.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},n.type=t+`Axis.`+o,n.defaultOption=s,n}(n);e.registerComponentModel(c)}),e.registerSubTypeDefaulter(t+`Axis`,fk)}function fk(e){return e.type||(e.data?`category`:`value`)}var pk=function(){function e(e){this.type=`cartesian`,this._dimList=[],this._axes={},this.name=e||``}return e.prototype.getAxis=function(e){return this._axes[e]},e.prototype.getAxes=function(){return I(this._dimList,function(e){return this._axes[e]},this)},e.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),L(this.getAxes(),function(t){return t.scale.type===e})},e.prototype.addAxis=function(e){var t=e.dim;this._axes[t]=e,this._dimList.push(t)},e}(),mk=[`x`,`y`];function hk(e){return e.type===`interval`||e.type===`time`}var gk=function(e){r(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`cartesian2d`,t.dimensions=mk,t}return t.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var e=this.getAxis(`x`).scale,t=this.getAxis(`y`).scale;if(!(!hk(e)||!hk(t))){var n=e.getExtent(),r=t.getExtent(),i=this.dataToPoint([n[0],r[0]]),a=this.dataToPoint([n[1],r[1]]),o=n[1]-n[0],s=r[1]-r[0];if(!(!o||!s)){var c=(a[0]-i[0])/o,l=(a[1]-i[1])/s,u=i[0]-n[0]*c,d=i[1]-r[0]*l,f=this._transform=[c,0,0,l,u,d];this._invTransform=It([],f)}}},t.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAxis(`x`)},t.prototype.containPoint=function(e){var t=this.getAxis(`x`),n=this.getAxis(`y`);return t.contain(t.toLocalCoord(e[0]))&&n.contain(n.toLocalCoord(e[1]))},t.prototype.containData=function(e){return this.getAxis(`x`).containData(e[0])&&this.getAxis(`y`).containData(e[1])},t.prototype.containZone=function(e,t){var n=this.dataToPoint(e),r=this.dataToPoint(t),i=this.getArea(),a=new Y(n[0],n[1],r[0]-n[0],r[1]-n[1]);return i.intersect(a)},t.prototype.dataToPoint=function(e,t,n){n||=[];var r=e[0],i=e[1];if(this._transform&&r!=null&&isFinite(r)&&i!=null&&isFinite(i))return Je(n,e,this._transform);var a=this.getAxis(`x`),o=this.getAxis(`y`);return n[0]=a.toGlobalCoord(a.dataToCoord(r,t)),n[1]=o.toGlobalCoord(o.dataToCoord(i,t)),n},t.prototype.clampData=function(e,t){var n=this.getAxis(`x`).scale,r=this.getAxis(`y`).scale,i=n.getExtent(),a=r.getExtent(),o=n.parse(e[0]),s=r.parse(e[1]);return t||=[],t[0]=Math.min(Math.max(Math.min(i[0],i[1]),o),Math.max(i[0],i[1])),t[1]=Math.min(Math.max(Math.min(a[0],a[1]),s),Math.max(a[0],a[1])),t},t.prototype.pointToData=function(e,t){var n=[];if(this._invTransform)return Je(n,e,this._invTransform);var r=this.getAxis(`x`),i=this.getAxis(`y`);return n[0]=r.coordToData(r.toLocalCoord(e[0]),t),n[1]=i.coordToData(i.toLocalCoord(e[1]),t),n},t.prototype.getOtherAxis=function(e){return this.getAxis(e.dim===`x`?`y`:`x`)},t.prototype.getArea=function(e){e||=0;var t=this.getAxis(`x`).getGlobalExtent(),n=this.getAxis(`y`).getGlobalExtent(),r=Math.min(t[0],t[1])-e,i=Math.min(n[0],n[1])-e;return new Y(r,i,Math.max(t[0],t[1])-r+e,Math.max(n[0],n[1])-i+e)},t}(pk),_k=function(e){r(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.index=0,o.type=i||`value`,o.position=a||`bottom`,o}return t.prototype.isHorizontal=function(){var e=this.position;return e===`top`||e===`bottom`},t.prototype.getGlobalExtent=function(e){var t=this.getExtent();return t[0]=this.toGlobalCoord(t[0]),t[1]=this.toGlobalCoord(t[1]),e&&t[0]>t[1]&&t.reverse(),t},t.prototype.pointToData=function(e,t){return this.coordToData(this.toLocalCoord(e[this.dim===`x`?0:1]),t)},t.prototype.setCategorySortInfo=function(e){if(this.type!==`category`)return!1;this.model.option.categorySortInfo=e,this.scale.setSortInfo(e)},t}(Tw);function vk(e,t,n){n||={};var r=e.coordinateSystem,i=t.axis,a={},o=i.getAxesOnZeroOf()[0],s=i.position,c=o?`onZero`:s,l=i.dim,u=r.getRect(),d=[u.x,u.x+u.width,u.y,u.y+u.height],f={left:0,right:1,top:0,bottom:1,onZero:2},p=t.get(`offset`)||0,m=l===`x`?[d[2]-p,d[3]+p]:[d[0]-p,d[1]+p];if(o){var h=o.toGlobalCoord(o.dataToCoord(0));m[f.onZero]=Math.max(Math.min(h,m[1]),m[0])}a.position=[l===`y`?m[f[c]]:d[0],l===`x`?m[f[c]]:d[3]],a.rotation=Math.PI/2*(l===`x`?0:1),a.labelDirection=a.tickDirection=a.nameDirection={top:-1,bottom:1,left:-1,right:1}[s],a.labelOffset=o?m[f[s]]-m[f.onZero]:0,t.get([`axisTick`,`inside`])&&(a.tickDirection=-a.tickDirection),me(n.labelInside,t.get([`axisLabel`,`inside`]))&&(a.labelDirection=-a.labelDirection);var g=t.get([`axisLabel`,`rotate`]);return a.labelRotate=c===`top`?-g:g,a.z2=1,a}function yk(e){return e.get(`coordinateSystem`)===`cartesian2d`}function bk(e){var t={xAxisModel:null,yAxisModel:null};return F(t,function(n,r){var i=r.replace(/Model$/,``);t[r]=e.getReferringComponents(i,ko).models[0]}),t}var xk=Math.log;function Sk(e,t,n){var r=HS.prototype,i=r.getTicks.call(n),a=r.getTicks.call(n,!0),o=i.length-1,s=r.getInterval.call(n),c=MC(e,t),l=c.extent,u=c.fixMin,d=c.fixMax;if(e.type===`log`){var f=xk(e.base);l=[xk(l[0])/f,xk(l[1])/f]}e.setExtent(l[0],l[1]),e.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:d});var p=r.getExtent.call(e);u&&(l[0]=p[0]),d&&(l[1]=p[1]);var m=r.getInterval.call(e),h=l[0],g=l[1];if(u&&d)m=(g-h)/o;else if(u)for(g=l[0]+m*o;gl[0]&&isFinite(h)&&isFinite(l[0]);)m=NS(m),h=l[1]-m*o;else{e.getTicks().length-1>o&&(m=NS(m));var _=m*o;g=Math.ceil(l[1]/m)*m,h=ja(g-_),h<0&&l[0]>=0?(h=0,g=ja(_)):g>0&&l[1]<=0&&(g=0,h=-ja(_))}var v=(i[0].value-a[0].value)/s,y=(i[o].value-a[o].value)/s;r.setExtent.call(e,h+m*v,g+m*y),r.setInterval.call(e,m),(v||y)&&r.setNiceExtent.call(e,h+m,g-m)}var Ck=function(){function e(e,t,n){this.type=`grid`,this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=mk,this._initCartesian(e,t,n),this.model=e}return e.prototype.getRect=function(){return this._rect},e.prototype.update=function(e,t){var n=this._axesMap;this._updateScale(e,this.model);function r(e){var t,n=R(e),r=n.length;if(r){for(var i=[],a=r-1;a>=0;a--){var o=e[+n[a]],s=o.model,c=o.scale;jS(c)&&s.get(`alignTicks`)&&s.get(`interval`)==null?i.push(o):(PC(c,s),jS(c)&&(t=o))}i.length&&(t||(t=i.pop(),PC(t.scale,t.model)),F(i,function(e){Sk(e.scale,e.model,t.scale)}))}}r(n.x),r(n.y);var i={};F(n.x,function(e){Tk(n,`y`,e,i)}),F(n.y,function(e){Tk(n,`x`,e,i)}),this.resize(this.model,t)},e.prototype.resize=function(e,t,n){var r=e.getBoxLayoutParams(),i=!n&&e.get(`containLabel`),a=mm(r,{width:t.getWidth(),height:t.getHeight()});this._rect=a;var o=this._axesList;s(),i&&(F(o,function(e){if(!e.model.get([`axisLabel`,`inside`])){var t=zC(e);if(t){var n=e.isHorizontal()?`height`:`width`,r=e.model.get([`axisLabel`,`margin`]);a[n]-=t[n]+r,e.position===`top`?a.y+=t.height+r:e.position===`left`&&(a.x+=t.width+r)}}}),s()),F(this._coordsList,function(e){e.calcAffineTransform()});function s(){F(o,function(e){var t=e.isHorizontal(),n=t?[0,a.width]:[0,a.height],r=+!!e.inverse;e.setExtent(n[r],n[1-r]),Dk(e,t?a.x:a.y)})}},e.prototype.getAxis=function(e,t){var n=this._axesMap[e];if(n!=null)return n[t||0]},e.prototype.getAxes=function(){return this._axesList.slice()},e.prototype.getCartesian=function(e,t){if(e!=null&&t!=null){var n=`x`+e+`y`+t;return this._coordsMap[n]}W(e)&&(t=e.yAxisIndex,e=e.xAxisIndex);for(var r=0,i=this._coordsList;r0?`top`:`bottom`,i=`center`):za(r-Ok)?(a=n>0?`bottom`:`top`,i=`center`):(a=`middle`,i=r>0&&r0?`right`:`left`:n>0?`left`:`right`),{rotation:r,textAlign:i,textVerticalAlign:a}},e.makeAxisEventDataBase=function(e){var t={componentType:e.mainType,componentIndex:e.componentIndex};return t[e.mainType+`Index`]=e.componentIndex,t},e.isLabelSilent=function(e){var t=e.get(`tooltip`);return e.get(`silent`)||!(e.get(`triggerEvent`)||t&&t.show)},e}(),Ak={axisLine:function(e,t,n,r){var i=t.get([`axisLine`,`show`]);if(i===`auto`&&e.handleAutoShown&&(i=e.handleAutoShown(`axisLine`)),i){var a=t.axis.getExtent(),o=r.transform,s=[a[0],0],c=[a[1],0],l=s[0]>c[0];o&&(Je(s,s,o),Je(c,c,o));var u=j({lineCap:`round`},t.getModel([`axisLine`,`lineStyle`]).getLineStyle()),d=new yd({shape:{x1:s[0],y1:s[1],x2:c[0],y2:c[1]},style:u,strokeContainThreshold:e.strokeContainThreshold||5,silent:!0,z2:1});lf(d.shape,d.style.lineWidth),d.anid=`line`,n.add(d);var f=t.get([`axisLine`,`symbol`]);if(f!=null){var p=t.get([`axisLine`,`symbolSize`]);U(f)&&(f=[f,f]),(U(p)||oe(p))&&(p=[p,p]);var m=sy(t.get([`axisLine`,`symbolOffset`])||0,p),h=p[0],g=p[1];F([{rotate:e.rotation+Math.PI/2,offset:m[0],r:0},{rotate:e.rotation-Math.PI/2,offset:m[1],r:Math.sqrt((s[0]-c[0])*(s[0]-c[0])+(s[1]-c[1])*(s[1]-c[1]))}],function(t,r){if(f[r]!==`none`&&f[r]!=null){var i=ay(f[r],-h/2,-g/2,h,g,u.stroke,!0),a=t.r+t.offset,o=l?c:s;i.attr({rotation:t.rotate,x:o[0]+a*Math.cos(e.rotation),y:o[1]-a*Math.sin(e.rotation),silent:!0,z2:11}),n.add(i)}})}}},axisTickLabel:function(e,t,n,r){var i=Lk(n,r,t,e),a=zk(n,r,t,e);Mk(t,a,i),Rk(n,r,t,e.tickDirection),t.get([`axisLabel`,`hideOverlap`])&&nT(Qw(I(a,function(e){return{label:e,priority:e.z2,defaultAttr:{ignore:e.ignore}}})))},axisName:function(e,t,n,r){var i=me(e.axisName,t.get(`name`));if(i){var a=t.get(`nameLocation`),o=e.nameDirection,s=t.getModel(`nameTextStyle`),c=t.get(`nameGap`)||0,l=t.axis.getExtent(),u=l[0]>l[1]?-1:1,d=[a===`start`?l[0]-u*c:a===`end`?l[1]+u*c:(l[0]+l[1])/2,Fk(a)?e.labelOffset+o*c:0],f,p=t.get(`nameRotate`);p!=null&&(p=p*Ok/180);var m;Fk(a)?f=kk.innerTextLayout(e.rotation,p??e.rotation,o):(f=jk(e.rotation,a,p||0,l),m=e.axisNameAvailableWidth,m!=null&&(m=Math.abs(m/Math.sin(f.rotation)),!isFinite(m)&&(m=null)));var h=s.getFont(),g=t.get(`nameTruncate`,!0)||{},_=g.ellipsis,v=me(e.nameTruncateMaxWidth,g.maxWidth,m),y=new Zc({x:d[0],y:d[1],rotation:f.rotation,silent:kk.isLabelSilent(t),style:Nf(s,{text:i,font:h,overflow:`truncate`,width:v,ellipsis:_,fill:s.getTextColor()||t.get([`axisLine`,`lineStyle`,`color`]),align:s.get(`align`)||f.textAlign,verticalAlign:s.get(`verticalAlign`)||f.textVerticalAlign}),z2:1});if(Tf({el:y,componentModel:t,itemName:i}),y.__fullText=i,y.anid=`name`,t.get(`triggerEvent`)){var b=kk.makeAxisEventDataBase(t);b.targetType=`axisName`,b.name=i,Q(y).eventData=b}r.add(y),y.updateTransform(),n.add(y),y.decomposeTransform()}}};function jk(e,t,n,r){var i=Ra(n-e),a,o,s=r[0]>r[1],c=t===`start`&&!s||t!==`start`&&s;return za(i-Ok/2)?(o=c?`bottom`:`top`,a=`center`):za(i-Ok*1.5)?(o=c?`top`:`bottom`,a=`center`):(o=`middle`,a=iOk/2?c?`left`:`right`:c?`right`:`left`),{rotation:i,textAlign:a,textVerticalAlign:o}}function Mk(e,t,n){if(!HC(e.axis)){var r=e.get([`axisLabel`,`showMinLabel`]),i=e.get([`axisLabel`,`showMaxLabel`]);t||=[],n||=[];var a=t[0],o=t[1],s=t[t.length-1],c=t[t.length-2],l=n[0],u=n[1],d=n[n.length-1],f=n[n.length-2];r===!1?(Nk(a),Nk(l)):Pk(a,o)&&(r?(Nk(o),Nk(u)):(Nk(a),Nk(l))),i===!1?(Nk(s),Nk(d)):Pk(c,s)&&(i?(Nk(c),Nk(f)):(Nk(s),Nk(d)))}}function Nk(e){e&&(e.ignore=!0)}function Pk(e,t){var n=e&&e.getBoundingRect().clone(),r=t&&t.getBoundingRect().clone();if(!(!n||!r)){var i=At([]);return Pt(i,i,-e.rotation),n.applyTransform(Mt([],i,e.getLocalTransform())),r.applyTransform(Mt([],i,t.getLocalTransform())),n.intersect(r)}}function Fk(e){return e===`middle`||e===`center`}function Ik(e,t,n,r,i){for(var a=[],o=[],s=[],c=0;c=0||e===t}function Kk(e){var t=qk(e);if(t){var n=t.axisPointerModel,r=t.axis.scale,i=n.option,a=n.get(`status`),o=n.get(`value`);o!=null&&(o=r.parse(o));var s=Yk(n);a??(i.status=s?`show`:`hide`);var c=r.getExtent().slice();c[0]>c[1]&&c.reverse(),(o==null||o>c[1])&&(o=c[1]),o0&&!d.min?d.min=0:d.min!=null&&d.min<0&&!d.max&&(d.max=0);var f=o;d.color!=null&&(f=M({color:d.color},o));var p=k(O(d),{boundaryGap:e,splitNumber:t,scale:n,axisLine:r,axisTick:i,axisLabel:a,name:d.text,showName:s,nameLocation:`end`,nameGap:l,nameTextStyle:f,triggerEvent:u},!1);if(U(c)){var m=p.name;p.name=c.replace(`{value}`,m??``)}else H(c)&&(p.name=c(p.name,p));var h=new tp(p,null,this.ecModel);return P(h,GC.prototype),h.mainType=`radar`,h.componentIndex=this.componentIndex,h},this);this._indicatorModels=d},t.prototype.getIndicatorModels=function(){return this._indicatorModels},t.type=`radar`,t.defaultOption={z:0,center:[`50%`,`50%`],radius:`75%`,startAngle:90,axisName:{show:!0},boundaryGap:[0,0],splitNumber:5,axisNameGap:15,scale:!1,shape:`polygon`,axisLine:k({lineStyle:{color:`#bbb`}},vA.axisLine),axisLabel:yA(vA.axisLabel,!1),axisTick:yA(vA.axisTick,!1),splitLine:yA(vA.splitLine,!0),splitArea:yA(vA.splitArea,!0),indicator:[]},t}(Sm),xA=[`axisLine`,`axisTickLabel`,`axisName`],SA=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeAll(),this._buildAxes(e),this._buildSplitLineAndArea(e)},t.prototype._buildAxes=function(e){var t=e.coordinateSystem;F(I(t.getIndicatorAxes(),function(e){var n=e.model.get(`showName`)?e.name:``;return new kk(e.model,{axisName:n,position:[t.cx,t.cy],rotation:e.angle,labelDirection:-1,tickDirection:-1,nameDirection:1})}),function(e){F(xA,e.add,e),this.group.add(e.getGroup())},this)},t.prototype._buildSplitLineAndArea=function(e){var t=e.coordinateSystem,n=t.getIndicatorAxes();if(!n.length)return;var r=e.get(`shape`),i=e.getModel(`splitLine`),a=e.getModel(`splitArea`),o=i.getModel(`lineStyle`),s=a.getModel(`areaStyle`),c=i.get(`show`),l=a.get(`show`),u=o.get(`color`),d=s.get(`color`),f=V(u)?u:[u],p=V(d)?d:[d],m=[],h=[];function g(e,t,n){var r=n%t.length;return e[r]=e[r]||[],r}if(r===`circle`)for(var _=n[0].getTicksCoords(),v=t.cx,y=t.cy,b=0;b<_.length;b++){if(c){var x=g(m,f,b);m[x].push(new Uu({shape:{cx:v,cy:y,r:_[b].coord}}))}if(l&&b<_.length-1){var x=g(h,p,b);h[x].push(new ud({shape:{cx:v,cy:y,r0:_[b].coord,r:_[b+1].coord}}))}}else for(var S,C=I(n,function(e,n){var r=e.getTicksCoords();return S=S==null?r.length-1:Math.min(r.length-1,S),I(r,function(e){return t.coordToPoint(e.coord,n)})}),w=[],b=0;b<=S;b++){for(var T=[],E=0;E3?1.4:i>1?1.2:1.1,c=r>0?s:1/s;NA(this,`zoom`,`zoomOnMouseWheel`,e,{scale:c,originX:a,originY:o,isAvailableBehavior:null})}if(n){var l=Math.abs(r),u=(r>0?1:-1)*(l>3?.4:l>1?.15:.05);NA(this,`scrollMove`,`moveOnMouseWheel`,e,{scrollDelta:u,originX:a,originY:o,isAvailableBehavior:null})}}},t.prototype._pinchHandler=function(e){if(!AA(this._zr,`globalPan`)){var t=e.pinchScale>1?1.1:1/1.1;NA(this,`zoom`,null,e,{scale:t,originX:e.pinchX,originY:e.pinchY,isAvailableBehavior:null})}},t}($e);function NA(e,t,n,r,i){e.pointerChecker&&e.pointerChecker(r,i.originX,i.originY)&&(Ct(r.event),PA(e,t,n,r,i))}function PA(e,t,n,r,i){i.isAvailableBehavior=z(FA,null,n,r),e.trigger(t,i)}function FA(e,t,n){var r=n[e];return!e||r&&(!U(r)||t.event[r+`Key`])}function IA(e,t,n){var r=e.target;r.x+=t,r.y+=n,r.dirty()}function LA(e,t,n,r){var i=e.target,a=e.zoomLimit,o=e.zoom=e.zoom||1;if(o*=t,a){var s=a.min||0,c=a.max||1/0;o=Math.max(Math.min(c,o),s)}var l=o/e.zoom;e.zoom=o,i.x-=(n-i.x)*(l-1),i.y-=(r-i.y)*(l-1),i.scaleX*=l,i.scaleY*=l,i.dirty()}var RA={axisPointer:1,tooltip:1,brush:1};function zA(e,t,n){var r=t.getComponentByElement(e.topTarget),i=r&&r.coordinateSystem;return r&&r!==n&&!RA.hasOwnProperty(r.mainType)&&i&&i.model!==n}function BA(e){U(e)&&(e=new DOMParser().parseFromString(e,`text/xml`));var t=e;for(t.nodeType===9&&(t=t.firstChild);t.nodeName.toLowerCase()!==`svg`||t.nodeType!==1;)t=t.nextSibling;return t}var VA,HA={fill:`fill`,stroke:`stroke`,"stroke-width":`lineWidth`,opacity:`opacity`,"fill-opacity":`fillOpacity`,"stroke-opacity":`strokeOpacity`,"stroke-dasharray":`lineDash`,"stroke-dashoffset":`lineDashOffset`,"stroke-linecap":`lineCap`,"stroke-linejoin":`lineJoin`,"stroke-miterlimit":`miterLimit`,"font-family":`fontFamily`,"font-size":`fontSize`,"font-style":`fontStyle`,"font-weight":`fontWeight`,"text-anchor":`textAlign`,visibility:`visibility`,display:`display`},UA=R(HA),WA={"alignment-baseline":`textBaseline`,"stop-color":`stopColor`},GA=R(WA),KA=function(){function e(){this._defs={},this._root=null}return e.prototype.parse=function(e,t){t||={};var n=BA(e);this._defsUsePending=[];var r=new X;this._root=r;var i=[],a=n.getAttribute(`viewBox`)||``,o=parseFloat(n.getAttribute(`width`)||t.width),s=parseFloat(n.getAttribute(`height`)||t.height);isNaN(o)&&(o=null),isNaN(s)&&(s=null),QA(n,r,null,!0,!1);for(var c=n.firstChild;c;)this._parseNode(c,r,i,null,!1,!1),c=c.nextSibling;nj(this._defs,this._defsUsePending),this._defsUsePending=[];var l,u;if(a){var d=ij(a);d.length>=4&&(l={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(l&&o!=null&&s!=null&&(u=dj(l,{x:0,y:0,width:o,height:s}),!t.ignoreViewBox)){var f=r;r=new X,r.add(f),f.scaleX=f.scaleY=u.scale,f.x=u.x,f.y=u.y}return!t.ignoreRootClip&&o!=null&&s!=null&&r.setClipPath(new qc({shape:{x:0,y:0,width:o,height:s}})),{root:r,width:o,height:s,viewBoxRect:l,viewBoxTransform:u,named:i}},e.prototype._parseNode=function(e,t,n,r,i,a){var o=e.nodeName.toLowerCase(),s,c=r;if(o===`defs`&&(i=!0),o===`text`&&(a=!0),o===`defs`||o===`switch`)s=t;else{if(!i){var l=VA[o];if(l&&q(VA,o)){s=l.call(this,e,t);var u=e.getAttribute(`name`);if(u){var d={name:u,namedFrom:null,svgNodeTagLower:o,el:s};n.push(d),o===`g`&&(c=d)}else r&&n.push({name:r.name,namedFrom:r,svgNodeTagLower:o,el:s});t.add(s)}}var f=qA[o];if(f&&q(qA,o)){var p=f.call(this,e),m=e.getAttribute(`id`);m&&(this._defs[m]=p)}}if(s&&s.isGroup)for(var h=e.firstChild;h;)h.nodeType===1?this._parseNode(h,s,n,c,i,a):h.nodeType===3&&a&&this._parseText(h,s),h=h.nextSibling},e.prototype._parseText=function(e,t){var n=new Fc({style:{text:e.textContent},silent:!0,x:this._textX||0,y:this._textY||0});XA(t,n),QA(e,n,this._defsUsePending,!1,!1),$A(n,t);var r=n.style,i=r.fontSize;i&&i<9&&(r.fontSize=9,n.scaleX*=i/9,n.scaleY*=i/9),r.font=(r.fontSize||r.fontFamily)&&[r.fontStyle,r.fontWeight,(r.fontSize||12)+`px`,r.fontFamily||`sans-serif`].join(` `);var a=n.getBoundingRect();return this._textX+=a.width,t.add(n),n},e.internalField=(function(){VA={g:function(e,t){var n=new X;return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n},rect:function(e,t){var n=new qc;return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n.setShape({x:parseFloat(e.getAttribute(`x`)||`0`),y:parseFloat(e.getAttribute(`y`)||`0`),width:parseFloat(e.getAttribute(`width`)||`0`),height:parseFloat(e.getAttribute(`height`)||`0`)}),n.silent=!0,n},circle:function(e,t){var n=new Uu;return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute(`cx`)||`0`),cy:parseFloat(e.getAttribute(`cy`)||`0`),r:parseFloat(e.getAttribute(`r`)||`0`)}),n.silent=!0,n},line:function(e,t){var n=new yd;return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n.setShape({x1:parseFloat(e.getAttribute(`x1`)||`0`),y1:parseFloat(e.getAttribute(`y1`)||`0`),x2:parseFloat(e.getAttribute(`x2`)||`0`),y2:parseFloat(e.getAttribute(`y2`)||`0`)}),n.silent=!0,n},ellipse:function(e,t){var n=new Gu;return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n.setShape({cx:parseFloat(e.getAttribute(`cx`)||`0`),cy:parseFloat(e.getAttribute(`cy`)||`0`),rx:parseFloat(e.getAttribute(`rx`)||`0`),ry:parseFloat(e.getAttribute(`ry`)||`0`)}),n.silent=!0,n},polygon:function(e,t){var n=e.getAttribute(`points`),r;n&&(r=ZA(n));var i=new md({shape:{points:r||[]},silent:!0});return XA(t,i),QA(e,i,this._defsUsePending,!1,!1),i},polyline:function(e,t){var n=e.getAttribute(`points`),r;n&&(r=ZA(n));var i=new gd({shape:{points:r||[]},silent:!0});return XA(t,i),QA(e,i,this._defsUsePending,!1,!1),i},image:function(e,t){var n=new zc;return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n.setStyle({image:e.getAttribute(`xlink:href`)||e.getAttribute(`href`),x:+e.getAttribute(`x`),y:+e.getAttribute(`y`),width:+e.getAttribute(`width`),height:+e.getAttribute(`height`)}),n.silent=!0,n},text:function(e,t){var n=e.getAttribute(`x`)||`0`,r=e.getAttribute(`y`)||`0`,i=e.getAttribute(`dx`)||`0`,a=e.getAttribute(`dy`)||`0`;this._textX=parseFloat(n)+parseFloat(i),this._textY=parseFloat(r)+parseFloat(a);var o=new X;return XA(t,o),QA(e,o,this._defsUsePending,!1,!0),o},tspan:function(e,t){var n=e.getAttribute(`x`),r=e.getAttribute(`y`);n!=null&&(this._textX=parseFloat(n)),r!=null&&(this._textY=parseFloat(r));var i=e.getAttribute(`dx`)||`0`,a=e.getAttribute(`dy`)||`0`,o=new X;return XA(t,o),QA(e,o,this._defsUsePending,!1,!0),this._textX+=parseFloat(i),this._textY+=parseFloat(a),o},path:function(e,t){var n=Ru(e.getAttribute(`d`)||``);return XA(t,n),QA(e,n,this._defsUsePending,!1,!1),n.silent=!0,n}}})(),e}(),qA={lineargradient:function(e){var t=new Od(parseInt(e.getAttribute(`x1`)||`0`,10),parseInt(e.getAttribute(`y1`)||`0`,10),parseInt(e.getAttribute(`x2`)||`10`,10),parseInt(e.getAttribute(`y2`)||`0`,10));return JA(e,t),YA(e,t),t},radialgradient:function(e){var t=new kd(parseInt(e.getAttribute(`cx`)||`0`,10),parseInt(e.getAttribute(`cy`)||`0`,10),parseInt(e.getAttribute(`r`)||`0`,10));return JA(e,t),YA(e,t),t}};function JA(e,t){e.getAttribute(`gradientUnits`)===`userSpaceOnUse`&&(t.global=!0)}function YA(e,t){for(var n=e.firstChild;n;){if(n.nodeType===1&&n.nodeName.toLocaleLowerCase()===`stop`){var r=n.getAttribute(`offset`),i=void 0;i=r&&r.indexOf(`%`)>0?parseInt(r,10)/100:r?parseFloat(r):0;var a={};lj(n,a,a);var o=a.stopColor||n.getAttribute(`stop-color`)||`#000000`;t.colorStops.push({offset:i,color:o})}n=n.nextSibling}}function XA(e,t){e&&e.__inheritedStyle&&(t.__inheritedStyle||={},M(t.__inheritedStyle,e.__inheritedStyle))}function ZA(e){for(var t=ij(e),n=[],r=0;r0;a-=2){var o=r[a],s=r[a-1],c=ij(o);switch(i||=kt(),s){case`translate`:Nt(i,i,[parseFloat(c[0]),parseFloat(c[1]||`0`)]);break;case`scale`:Ft(i,i,[parseFloat(c[0]),parseFloat(c[1]||c[0])]);break;case`rotate`:Pt(i,i,-parseFloat(c[0])*oj,[parseFloat(c[1]||`0`),parseFloat(c[2]||`0`)]);break;case`skewX`:var l=Math.tan(parseFloat(c[0])*oj);Mt(i,[1,0,l,1,0,0],i);break;case`skewY`:var u=Math.tan(parseFloat(c[0])*oj);Mt(i,[1,u,0,1,0,0],i);break;case`matrix`:i[0]=parseFloat(c[0]),i[1]=parseFloat(c[1]),i[2]=parseFloat(c[2]),i[3]=parseFloat(c[3]),i[4]=parseFloat(c[4]),i[5]=parseFloat(c[5])}}t.setLocalTransform(i)}}var cj=/([^\s:;]+)\s*:\s*([^:;]+)/g;function lj(e,t,n){var r=e.getAttribute(`style`);if(r){cj.lastIndex=0;for(var i;(i=cj.exec(r))!=null;){var a=i[1],o=q(HA,a)?HA[a]:null;o&&(t[o]=i[2]);var s=q(WA,a)?WA[a]:null;s&&(n[s]=i[2])}}}function uj(e,t,n){for(var r=0;r0,m={api:n,geo:s,mapOrGeoModel:e,data:o,isVisualEncodedByVisualMap:p,isGeo:a,transformInfoRaw:d};s.resourceType===`geoJSON`?this._buildGeoJSON(m):s.resourceType===`geoSVG`&&this._buildSVG(m),this._updateController(e,t,n),this._updateMapSelectHandler(e,c,n,r)},e.prototype._buildGeoJSON=function(e){var t=this._regionsGroupByName=K(),n=K(),r=this._regionsGroup,i=e.transformInfoRaw,a=e.mapOrGeoModel,o=e.data,s=e.geo.projection,c=s&&s.stream;function l(e,t){return t&&(e=t(e)),e&&[e[0]*i.scaleX+i.x,e[1]*i.scaleY+i.y]}function u(e){for(var t=[],n=!c&&s&&s.project,r=0;r=0)&&(f=i);var p=o?{normal:{align:`center`,verticalAlign:`middle`}}:null;jf(t,Mf(r),{labelFetcher:f,labelDataIndex:d,defaultText:n},p);var m=t.getTextContent();if(m&&(Lj(m).ignore=m.ignore,t.textConfig&&o)){var h=t.getBoundingRect().clone();t.textConfig.layoutRect=h,t.textConfig.position=[(o[0]-h.x)/h.width*100+`%`,(o[1]-h.y)/h.height*100+`%`]}t.disableLabelAnimation=!0}else t.removeTextContent(),t.removeTextConfig(),t.disableLabelAnimation=null}function Uj(e,t,n,r,i,a){e.data?e.data.setItemGraphicEl(a,t):Q(t).eventData={componentType:`geo`,componentIndex:i.componentIndex,geoIndex:i.componentIndex,name:n,region:r&&r.option||{}}}function Wj(e,t,n,r,i){e.data||Tf({el:t,componentModel:i,itemName:n,itemTooltipOption:r.get(`tooltip`)})}function Gj(e,t,n,r,i){t.highDownSilentOnTouch=!!i.get(`selectedMode`);var a=r.getModel(`emphasis`),o=a.get(`focus`);return su(t,o,a.get(`blurScope`),a.get(`disabled`)),e.isGeo&&mu(t,i,n),o}function Kj(e,t,n){var r=[],i;function a(){i=[]}function o(){i.length&&(r.push(i),i=[])}var s=t({polygonStart:a,polygonEnd:o,lineStart:a,lineEnd:o,point:function(e,t){isFinite(e)&&isFinite(t)&&i.push([e,t])},sphere:function(){}});return!n&&s.polygonStart(),F(e,function(e){s.lineStart();for(var t=0;t-1&&(n.style.stroke=n.style.fill,n.style.fill=`#fff`,n.style.lineWidth=2),n},t.type=`series.map`,t.dependencies=[`geo`],t.layoutMode=`box`,t.defaultOption={z:2,coordinateSystem:`geo`,map:``,left:`center`,top:`center`,aspectScale:null,showLegendSymbol:!0,boundingCoords:null,center:null,zoom:1,scaleLimit:null,selectedMode:!0,label:{show:!1,color:`#000`},itemStyle:{borderWidth:.5,borderColor:`#444`,areaColor:`#eee`},emphasis:{label:{show:!0,color:`rgb(100,0,0)`},itemStyle:{areaColor:`rgba(255,215,0,0.8)`}},select:{label:{show:!0,color:`rgb(100,0,0)`},itemStyle:{color:`rgba(255,215,0,0.8)`}},nameProperty:`name`},t}(P_);function Yj(e,t){var n={};return F(e,function(e){e.each(e.mapDimension(`value`),function(t,r){var i=`ec-`+e.getName(r);n[i]=n[i]||[],isNaN(t)||n[i].push(t)})}),e[0].map(e[0].mapDimension(`value`),function(r,i){for(var a=`ec-`+e[0].getName(i),o=0,s=1/0,c=-1/0,l=n[a].length,u=0;u1?(b.width=y,b.height=y/g):(b.height=y,b.width=y*g),b.y=v[1]-b.height/2,b.x=v[0]-b.width/2;else{var x=e.getBoxLayoutParams();x.aspect=g,b=mm(x,{width:m,height:h})}this.setViewRect(b.x,b.y,b.width,b.height),this.setCenter(e.get(`center`),t),this.setZoom(e.get(`zoom`))}function oM(e,t){F(t.get(`geoCoord`),function(t,n){e.addGeoCoord(n,t)})}var sM=new(function(){function e(){this.dimensions=nM}return e.prototype.create=function(e,t){var n=[];function r(e){return{nameProperty:e.get(`nameProperty`),aspectScale:e.get(`aspectScale`),projection:e.get(`projection`)}}e.eachComponent(`geo`,function(e,i){var a=e.get(`map`),o=new rM(a+i,a,j({nameMap:e.get(`nameMap`)},r(e)));o.zoomLimit=e.get(`scaleLimit`),n.push(o),e.coordinateSystem=o,o.model=e,o.resize=aM,o.resize(e,t)}),e.eachSeries(function(e){e.get(`coordinateSystem`)===`geo`&&(e.coordinateSystem=n[e.get(`geoIndex`)||0])});var i={};return e.eachSeriesByType(`map`,function(e){if(!e.getHostGeoModel()){var t=e.getMapType();i[t]=i[t]||[],i[t].push(e)}}),F(i,function(e,i){var a=new rM(i,i,j({nameMap:A(I(e,function(e){return e.get(`nameMap`)}))},r(e[0])));a.zoomLimit=me.apply(null,I(e,function(e){return e.get(`scaleLimit`)})),n.push(a),a.resize=aM,a.resize(e[0],t),F(e,function(e){e.coordinateSystem=a,oM(a,e)})}),n},e.prototype.getFilledRegions=function(e,t,n,r){for(var i=(e||[]).slice(),a=K(),o=0;o=0;a--){var o=i[a];o.hierNode={defaultAncestor:null,ancestor:o,prelim:0,modifier:0,change:0,shift:0,i:a,thread:null},n.push(o)}}function gM(e,t){var n=e.isExpand?e.children:[],r=e.parentNode.children,i=e.hierNode.i?r[e.hierNode.i-1]:null;if(n.length){xM(e);var a=(n[0].hierNode.prelim+n[n.length-1].hierNode.prelim)/2;i?(e.hierNode.prelim=i.hierNode.prelim+t(e,i),e.hierNode.modifier=e.hierNode.prelim-a):e.hierNode.prelim=a}else i&&(e.hierNode.prelim=i.hierNode.prelim+t(e,i));e.parentNode.hierNode.defaultAncestor=SM(e,i,e.parentNode.hierNode.defaultAncestor||r[0],t)}function _M(e){var t=e.hierNode.prelim+e.parentNode.hierNode.modifier;e.setLayout({x:t},!0),e.hierNode.modifier+=e.parentNode.hierNode.modifier}function vM(e){return arguments.length?e:DM}function yM(e,t){return e-=Math.PI/2,{x:t*Math.cos(e),y:t*Math.sin(e)}}function bM(e,t){return mm(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function xM(e){for(var t=e.children,n=t.length,r=0,i=0;--n>=0;){var a=t[n];a.hierNode.prelim+=r,a.hierNode.modifier+=r,i+=a.hierNode.change,r+=a.hierNode.shift+i}}function SM(e,t,n,r){if(t){for(var i=e,a=e,o=a.parentNode.children[0],s=t,c=i.hierNode.modifier,l=a.hierNode.modifier,u=o.hierNode.modifier,d=s.hierNode.modifier;s=CM(s),a=wM(a),s&&a;){i=CM(i),o=wM(o),i.hierNode.ancestor=e;var f=s.hierNode.prelim+d-a.hierNode.prelim-l+r(s,a);f>0&&(EM(TM(s,e,n),e,f),l+=f,c+=f),d+=s.hierNode.modifier,l+=a.hierNode.modifier,c+=i.hierNode.modifier,u+=o.hierNode.modifier}s&&!CM(i)&&(i.hierNode.thread=s,i.hierNode.modifier+=d-c),a&&!wM(o)&&(o.hierNode.thread=a,o.hierNode.modifier+=l-u,n=e)}return n}function CM(e){var t=e.children;return t.length&&e.isExpand?t[t.length-1]:e.hierNode.thread}function wM(e){var t=e.children;return t.length&&e.isExpand?t[0]:e.hierNode.thread}function TM(e,t,n){return e.hierNode.ancestor.parentNode===t.parentNode?e.hierNode.ancestor:n}function EM(e,t,n){var r=n/(t.hierNode.i-e.hierNode.i);t.hierNode.change-=r,t.hierNode.shift+=n,t.hierNode.modifier+=n,t.hierNode.prelim+=n,e.hierNode.change+=r}function DM(e,t){return e.parentNode===t.parentNode?1:2}var OM=function(){function e(){this.parentPoint=[],this.childPoints=[]}return e}(),kM=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new OM},t.prototype.buildPath=function(e,t){var n=t.childPoints,r=n.length,i=t.parentPoint,a=n[0],o=n[r-1];if(r===1){e.moveTo(i[0],i[1]),e.lineTo(a[0],a[1]);return}var s=t.orient,c=s===`TB`||s===`BT`?0:1,l=1-c,u=Z(t.forkPosition,1),d=[];d[c]=i[c],d[l]=i[l]+(o[l]-i[l])*u,e.moveTo(i[0],i[1]),e.lineTo(d[0],d[1]),e.moveTo(a[0],a[1]),d[c]=a[c],e.lineTo(d[0],d[1]),d[c]=o[c],e.lineTo(d[0],d[1]),e.lineTo(o[0],o[1]);for(var f=1;fv.x,x||(b-=Math.PI));var C=x?`left`:`right`,w=s.getModel(`label`),T=w.get(`rotate`),E=Math.PI/180*T,D=g.getTextContent();D&&(g.setTextConfig({position:w.get(`position`)||C,rotation:T==null?-b:E,origin:`center`}),D.setStyle(`verticalAlign`,`middle`))}var O=s.get([`emphasis`,`focus`]),k=O===`relative`?De(o.getAncestorsIndices(),o.getDescendantIndices()):O===`ancestor`?o.getAncestorsIndices():O===`descendant`?o.getDescendantIndices():null;k&&(Q(n).focus=k),NM(i,o,u,n,m,p,h,r),n.__edge&&(n.onHoverStateChange=function(t){if(t!==`blur`){var r=o.parentNode&&e.getItemGraphicEl(o.parentNode.dataIndex);r&&r.hoverState===1||Nl(n.__edge,t)}})}function NM(e,t,n,r,i,a,o,s){var c=t.getModel(),l=e.get(`edgeShape`),u=e.get(`layout`),d=e.getOrient(),f=e.get([`lineStyle`,`curveness`]),p=e.get(`edgeForkPosition`),m=c.getModel(`lineStyle`).getLineStyle(),h=r.__edge;if(l===`curve`)t.parentNode&&t.parentNode!==n&&(h||=r.__edge=new Cd({shape:LM(u,d,f,i,i)}),Bd(h,{shape:LM(u,d,f,a,o)},e));else if(l===`polyline`&&u===`orthogonal`&&t!==n&&t.children&&t.children.length!==0&&t.isExpand===!0){for(var g=t.children,_=[],v=0;vt&&(t=r.height)}this.height=t+1},e.prototype.getNodeById=function(e){if(this.getId()===e)return this;for(var t=0,n=this.children,r=n.length;t=0&&this.hostTree.data.setItemLayout(this.dataIndex,e,t)},e.prototype.getLayout=function(){return this.hostTree.data.getItemLayout(this.dataIndex)},e.prototype.getModel=function(e){if(!(this.dataIndex<0))return this.hostTree.data.getItemModel(this.dataIndex).getModel(e)},e.prototype.getLevelModel=function(){return(this.hostTree.levelModels||[])[this.depth]},e.prototype.setVisual=function(e,t){this.dataIndex>=0&&this.hostTree.data.setItemVisual(this.dataIndex,e,t)},e.prototype.getVisual=function(e){return this.hostTree.data.getItemVisual(this.dataIndex,e)},e.prototype.getRawIndex=function(){return this.hostTree.data.getRawIndex(this.dataIndex)},e.prototype.getId=function(){return this.hostTree.data.getId(this.dataIndex)},e.prototype.getChildIndex=function(){if(this.parentNode){for(var e=this.parentNode.children,t=0;t=0){var r=n.getData().tree.root,i=e.targetNode;if(U(i)&&(i=r.getNodeById(i)),i&&r.contains(i))return{node:i};var a=e.targetNodeId;if(a!=null&&(i=r.getNodeById(a)))return{node:i}}}function QM(e){for(var t=[];e;)e=e.parentNode,e&&t.push(e);return t.reverse()}function $M(e,t){return N(QM(e),t)>=0}function eN(e,t){for(var n=[];e;){var r=e.dataIndex;n.push({name:e.name,dataIndex:r,value:t.getRawValue(r)}),e=e.parentNode}return n.reverse(),n}var tN=function(e){r(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.hasSymbolVisual=!0,t.ignoreStyleOnData=!0,t}return t.prototype.getInitialData=function(e){var t={name:e.name,children:e.data},n=new tp(e.leaves||{},this,this.ecModel),r=YM.createTree(t,this,i);function i(e){e.wrapMethod(`getItemModel`,function(e,t){var i=r.getNodeByDataIndex(t);return i&&i.children.length&&i.isExpand||(e.parentModel=n),e})}var a=0;r.eachNode(`preorder`,function(e){e.depth>a&&(a=e.depth)});var o=e.expandAndCollapse&&e.initialTreeDepth>=0?e.initialTreeDepth:a;return r.root.eachNode(`preorder`,function(e){var t=e.hostTree.data.getRawDataItem(e.dataIndex);e.isExpand=t&&t.collapsed!=null?!t.collapsed:e.depth<=o}),r.data},t.prototype.getOrient=function(){var e=this.get(`orient`);return e===`horizontal`?e=`LR`:e===`vertical`&&(e=`TB`),e},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.formatTooltip=function(e,t,n){for(var r=this.getData().tree,i=r.root.children[0],a=r.getNodeByDataIndex(e),o=a.getValue(),s=a.name;a&&a!==i;)s=a.parentNode.name+`.`+s,a=a.parentNode;return p_(`nameValue`,{name:s,value:o,noValue:isNaN(o)||o==null})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments),r=this.getData().tree.getNodeByDataIndex(t);return n.treeAncestors=eN(r,this),n.collapsed=!r.isExpand,n},t.type=`series.tree`,t.layoutMode=`box`,t.defaultOption={z:2,coordinateSystem:`view`,left:`12%`,top:`12%`,right:`12%`,bottom:`12%`,layout:`orthogonal`,edgeShape:`curve`,edgeForkPosition:`50%`,roam:!1,nodeScaleRatio:.4,center:null,zoom:1,orient:`LR`,symbol:`emptyCircle`,symbolSize:7,expandAndCollapse:!0,initialTreeDepth:2,lineStyle:{color:`#ccc`,width:1.5,curveness:.5},itemStyle:{color:`lightsteelblue`,borderWidth:1.5},label:{show:!0},animationEasing:`linear`,animationDuration:700,animationDurationUpdate:500},t}(P_);function nN(e,t,n){for(var r=[e],i=[],a;a=r.pop();)if(i.push(a),a.isExpand){var o=a.children;if(o.length)for(var s=0;s=0;a--)n.push(i[a])}}function iN(e,t){e.eachSeriesByType(`tree`,function(e){aN(e,t)})}function aN(e,t){var n=bM(e,t);e.layoutInfo=n;var r=e.get(`layout`),i=0,a=0,o=null;r===`radial`?(i=2*Math.PI,a=Math.min(n.height,n.width)/2,o=vM(function(e,t){return(e.parentNode===t.parentNode?1:2)/e.depth})):(i=n.width,a=n.height,o=vM());var s=e.getData().tree.root,c=s.children[0];if(c){hM(s),nN(c,gM,o),s.hierNode.modifier=-c.hierNode.prelim,rN(c,_M);var l=c,u=c,d=c;rN(c,function(e){var t=e.getLayout().x;tu.getLayout().x&&(u=e),e.depth>d.depth&&(d=e)});var f=l===u?1:o(l,u)/2,p=f-l.getLayout().x,m=0,h=0,g=0,_=0;if(r===`radial`)m=i/(u.getLayout().x+f+p),h=a/(d.depth-1||1),rN(c,function(e){g=(e.getLayout().x+p)*m,_=(e.depth-1)*h;var t=yM(g,_);e.setLayout({x:t.x,y:t.y,rawX:g,rawY:_},!0)});else{var v=e.getOrient();v===`RL`||v===`LR`?(h=a/(u.getLayout().x+f+p),m=i/(d.depth-1||1),rN(c,function(e){_=(e.getLayout().x+p)*h,g=v===`LR`?(e.depth-1)*m:i-(e.depth-1)*m,e.setLayout({x:g,y:_},!0)})):(v===`TB`||v===`BT`)&&(m=i/(u.getLayout().x+f+p),h=a/(d.depth-1||1),rN(c,function(e){g=(e.getLayout().x+p)*m,_=v===`TB`?(e.depth-1)*h:a-(e.depth-1)*h,e.setLayout({x:g,y:_},!0)}))}}}function oN(e){e.eachSeriesByType(`tree`,function(e){var t=e.getData();t.tree.eachNode(function(e){var n=e.getModel().getModel(`itemStyle`).getItemStyle();j(t.ensureUniqueItemVisual(e.dataIndex,`style`),n)})})}function sN(e){e.registerAction({type:`treeExpandAndCollapse`,event:`treeExpandAndCollapse`,update:`update`},function(e,t){t.eachComponent({mainType:`series`,subType:`tree`,query:e},function(t){var n=e.dataIndex,r=t.getData().tree.getNodeByDataIndex(n);r.isExpand=!r.isExpand})}),e.registerAction({type:`treeRoam`,event:`treeRoam`,update:`none`},function(e,t,n){t.eachComponent({mainType:`series`,subType:`tree`,query:e},function(t){var r=t.coordinateSystem,i=uM(r,e,void 0,n);t.setCenter&&t.setCenter(i.center),t.setZoom&&t.setZoom(i.zoom)})})}function cN(e){e.registerChartView(AM),e.registerSeriesModel(tN),e.registerLayout(iN),e.registerVisual(oN),sN(e)}var lN=[`treemapZoomToNode`,`treemapRender`,`treemapMove`];function uN(e){for(var t=0;t1;)r=r.parentNode;var i=Xm(e.ecModel,r.name||r.dataIndex+``,n);t.setVisual(`decal`,i)})}var fN=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.preventUsingHoverLayer=!0,n}return t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};pN(n);var r=e.levels||[],i=new tp({itemStyle:this.designatedVisualItemStyle={}},this,t);r=e.levels=mN(r,t);var a=I(r||[],function(e){return new tp(e,i,t)},this),o=YM.createTree(n,this,s);function s(e){e.wrapMethod(`getItemModel`,function(e,t){var n=o.getNodeByDataIndex(t);return e.parentModel=(n?a[n.depth]:null)||i,e})}return o.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.formatTooltip=function(e,t,n){var r=this.getData(),i=this.getRawValue(e);return p_(`nameValue`,{name:r.getName(e),value:i})},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments);return n.treeAncestors=eN(this.getData().tree.getNodeByDataIndex(t),this),n.treePathInfo=n.treeAncestors,n},t.prototype.setLayoutInfo=function(e){this.layoutInfo=this.layoutInfo||{},j(this.layoutInfo,e)},t.prototype.mapIdToIndex=function(e){var t=this._idIndexMap;t||(t=this._idIndexMap=K(),this._idIndexMapCount=0);var n=t.get(e);return n??t.set(e,n=this._idIndexMapCount++),n},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;(!e||e!==t&&!t.contains(e))&&(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){dN(this)},t.type=`series.treemap`,t.layoutMode=`box`,t.defaultOption={progressive:0,left:`center`,top:`middle`,width:`80%`,height:`80%`,sort:!0,clipWindow:`origin`,squareRatio:.5*(1+Math.sqrt(5)),leafDepth:null,drillDownIcon:`▶`,zoomToNodeRatio:.1024,scaleLimit:null,roam:!0,nodeClick:`zoomToNode`,animation:!0,animationDurationUpdate:900,animationEasing:`quinticInOut`,breadcrumb:{show:!0,height:22,left:`center`,top:`bottom`,emptyItemWidth:25,itemStyle:{color:`rgba(0,0,0,0.7)`,textStyle:{color:`#fff`}},emphasis:{itemStyle:{color:`rgba(0,0,0,0.9)`}}},label:{show:!0,distance:0,padding:5,position:`inside`,color:`#fff`,overflow:`truncate`},upperLabel:{show:!1,position:[0,`50%`],height:20,overflow:`truncate`,verticalAlign:`middle`},itemStyle:{color:null,colorAlpha:null,colorSaturation:null,borderWidth:0,gapWidth:0,borderColor:`#fff`,borderColorSaturation:null},emphasis:{upperLabel:{show:!0,position:[0,`50%`],overflow:`truncate`,verticalAlign:`middle`}},visualDimension:0,visualMin:null,visualMax:null,color:[],colorAlpha:null,colorSaturation:null,colorMappingBy:`index`,visibleMin:10,childrenVisibleMin:null,levels:[]},t}(P_);function pN(e){var t=0;F(e.children,function(e){pN(e);var n=e.value;V(n)&&(n=n[0]),t+=n});var n=e.value;V(n)&&(n=n[0]),(n==null||isNaN(n))&&(n=t),n<0&&(n=0),V(e.value)?e.value[0]=n:e.value=n}function mN(e,t){var n=no(t.get(`color`)),r=no(t.get([`aria`,`decal`,`decals`]));if(n){e||=[];var i,a;F(e,function(e){var t=new tp(e),n=t.get(`color`),r=t.get(`decal`);(t.get([`itemStyle`,`color`])||n&&n!==`none`)&&(i=!0),(t.get([`itemStyle`,`decal`])||r&&r!==`none`)&&(a=!0)});var o=e[0]||(e[0]={});return i||(o.color=n.slice()),!a&&r&&(o.decal=r.slice()),e}}var hN=8,gN=8,_N=5,vN=function(){function e(e){this.group=new X,e.add(this.group)}return e.prototype.render=function(e,t,n,r){var i=e.getModel(`breadcrumb`),a=this.group;if(a.removeAll(),!(!i.get(`show`)||!n)){var o=i.getModel(`itemStyle`),s=i.getModel(`emphasis`),c=o.getModel(`textStyle`),l=s.getModel([`itemStyle`,`textStyle`]),u={pos:{left:i.get(`left`),right:i.get(`right`),top:i.get(`top`),bottom:i.get(`bottom`)},box:{width:t.getWidth(),height:t.getHeight()},emptyItemWidth:i.get(`emptyItemWidth`),totalWidth:0,renderList:[]};this._prepare(n,u,c),this._renderContent(e,u,o,s,c,l,r),hm(a,u.pos,u.box)}},e.prototype._prepare=function(e,t,n){for(var r=e;r;r=r.parentNode){var i=_o(r.getModel().get(`name`),``),a=n.getTextRect(i),o=Math.max(a.width+hN*2,t.emptyItemWidth);t.totalWidth+=o+gN,t.renderList.push({node:r,text:i,width:o})}},e.prototype._renderContent=function(e,t,n,r,i,a,o){for(var s=0,c=t.emptyItemWidth,l=e.get([`breadcrumb`,`height`]),u=pm(t.pos,t.box),d=t.totalWidth,f=t.renderList,p=r.getModel(`itemStyle`).getItemStyle(),m=f.length-1;m>=0;m--){var h=f[m],g=h.node,_=h.width,v=h.text;d>u.width&&(d-=_-c,_=c,v=null);var y=new md({shape:{points:yN(s,0,_,l,m===f.length-1,m===0)},style:M(n.getItemStyle(),{lineJoin:`bevel`}),textContent:new Zc({style:Nf(i,{text:v})}),textConfig:{position:`inside`},z2:1e5,onclick:B(o,g)});y.disableLabelAnimation=!0,y.getTextContent().ensureState(`emphasis`).style=Nf(a,{text:v}),y.ensureState(`emphasis`).style=p,su(y,r.get(`focus`),r.get(`blurScope`),r.get(`disabled`)),this.group.add(y),bN(y,e,g),s+=_+gN}},e.prototype.remove=function(){this.group.removeAll()},e}();function yN(e,t,n,r,i,a){var o=[[i?e:e-_N,t],[e+n,t],[e+n,t+r],[i?e:e-_N,t+r]];return!a&&o.splice(2,0,[e+n+_N,t+r/2]),!i&&o.push([e,t+r/2]),o}function bN(e,t,n){Q(e).eventData={componentType:`series`,componentSubType:`treemap`,componentIndex:t.componentIndex,seriesIndex:t.seriesIndex,seriesName:t.name,seriesType:`treemap`,selfType:`breadcrumb`,nodeData:{dataIndex:n&&n.dataIndex,name:n&&n.name},treePathInfo:n&&eN(n,t)}}var xN=function(){function e(){this._storage=[],this._elExistsMap={}}return e.prototype.add=function(e,t,n,r,i){return!this._elExistsMap[e.id]&&(this._elExistsMap[e.id]=!0,this._storage.push({el:e,target:t,duration:n,delay:r,easing:i}),!0)},e.prototype.finished=function(e){return this._finishedCallback=e,this},e.prototype.start=function(){for(var e=this,t=this._storage.length,n=function(){t--,t<=0&&(e._storage.length=0,e._elExistsMap={},e._finishedCallback&&e._finishedCallback())},r=0,i=this._storage.length;rTN||Math.abs(e.dy)>TN)){var t=this.seriesModel.getData().tree.root;if(!t)return;var n=t.getLayout();if(!n)return;this.api.dispatchAction({type:`treemapMove`,from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:n.x+e.dx,y:n.y+e.dy,width:n.width,height:n.height}})}},t.prototype._onZoom=function(e){var t=e.originX,n=e.originY,r=e.scale;if(this._state!==`animating`){var i=this.seriesModel.getData().tree.root;if(!i)return;var a=i.getLayout();if(!a)return;var o=new Y(a.x,a.y,a.width,a.height),s=null,c=this._controllerHost;s=c.zoomLimit;var l=c.zoom=c.zoom||1;if(l*=r,s){var u=s.min||0,d=s.max||1/0;l=Math.max(Math.min(d,l),u)}var f=l/c.zoom;c.zoom=l;var p=this.seriesModel.layoutInfo;t-=p.x,n-=p.y;var m=kt();Nt(m,m,[-t,-n]),Ft(m,m,[f,f]),Nt(m,m,[t,n]),o.applyTransform(m),this.api.dispatchAction({type:`treemapRender`,from:this.uid,seriesId:this.seriesModel.id,rootRect:{x:o.x,y:o.y,width:o.width,height:o.height}})}},t.prototype._initEvents=function(e){var t=this;e.on(`click`,function(e){if(t._state===`ready`){var n=t.seriesModel.get(`nodeClick`,!0);if(n){var r=t.findTarget(e.offsetX,e.offsetY);if(r){var i=r.node;if(i.getLayout().isLeafRoot)t._rootToNode(r);else if(n===`zoomToNode`)t._zoomToNode(r);else if(n===`link`){var a=i.hostTree.data.getItemModel(i.dataIndex),o=a.get(`link`,!0),s=a.get(`target`,!0)||`blank`;o&&sm(o,s)}}}}},this)},t.prototype._renderBreadcrumb=function(e,t,n){var r=this;n||(n=e.get(`leafDepth`,!0)==null?this.findTarget(t.getWidth()/2,t.getHeight()/2):{node:e.getViewRoot()},n||={node:e.getData().tree.root}),(this._breadcrumb||=new vN(this.group)).render(e,t,n.node,function(t){r._state!==`animating`&&($M(e.getViewRoot(),t)?r._rootToNode({node:t}):r._zoomToNode({node:t}))})},t.prototype.remove=function(){this._clearController(),this._containerGroup&&this._containerGroup.removeAll(),this._storage=FN(),this._state=`ready`,this._breadcrumb&&this._breadcrumb.remove()},t.prototype.dispose=function(){this._clearController()},t.prototype._zoomToNode=function(e){this.api.dispatchAction({type:`treemapZoomToNode`,from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype._rootToNode=function(e){this.api.dispatchAction({type:`treemapRootToNode`,from:this.uid,seriesId:this.seriesModel.id,targetNode:e.node})},t.prototype.findTarget=function(e,t){var n;return this.seriesModel.getViewRoot().eachNode({attr:`viewChildren`,order:`preorder`},function(r){var i=this._storage.background[r.getRawIndex()];if(i){var a=i.transformCoordToLocal(e,t),o=i.shape;if(o.x<=a[0]&&a[0]<=o.x+o.width&&o.y<=a[1]&&a[1]<=o.y+o.height)n={node:r,offsetX:a[0],offsetY:a[1]};else return!1}},this),n},t.type=`treemap`,t}(q_);function FN(){return{nodeGroup:[],background:[],content:[]}}function IN(e,t,n,r,i,a,o,s,c,l){if(!o)return;var u=o.getLayout(),d=e.getData(),f=o.getModel();if(d.setItemGraphicEl(o.dataIndex,null),!u||!u.isInView)return;var p=u.width,m=u.height,h=u.borderWidth,g=u.invisible,_=o.getRawIndex(),v=s&&s.getRawIndex(),y=o.viewChildren,b=u.upperHeight,x=y&&y.length,S=f.getModel(`itemStyle`),C=f.getModel([`emphasis`,`itemStyle`]),w=f.getModel([`blur`,`itemStyle`]),T=f.getModel([`select`,`itemStyle`]),E=S.get(`borderRadius`)||0,D=R(`nodeGroup`,CN);if(!D)return;if(c.add(D),D.x=u.x||0,D.y=u.y||0,D.markRedraw(),NN(D).nodeWidth=p,NN(D).nodeHeight=m,u.isAboveViewRoot)return D;var O=R(`background`,wN,l,kN);O&&F(D,O,x&&u.upperLabelHeight);var k=f.getModel(`emphasis`),A=k.get(`focus`),M=k.get(`blurScope`),N=k.get(`disabled`),ee=A===`ancestor`?o.getAncestorsIndices():A===`descendant`?o.getDescendantIndices():A;if(x)pu(D)&&fu(D,!1),O&&(fu(O,!N),d.setItemGraphicEl(o.dataIndex,O),cu(O,ee,M));else{var P=R(`content`,wN,l,AN);P&&I(D,P),O.disableMorphing=!0,O&&pu(O)&&fu(O,!1),fu(D,!N),d.setItemGraphicEl(o.dataIndex,D);var te=f.getShallow(`cursor`);te&&P.attr(`cursor`,te),cu(D,ee,M)}return D;function F(t,n,r){var i=Q(n);if(i.dataIndex=o.dataIndex,i.seriesIndex=e.seriesIndex,n.setShape({x:0,y:0,width:p,height:m,r:E}),g)ne(n);else{n.invisible=!1;var a=o.getVisual(`style`),s=a.stroke,c=MN(S);c.fill=s;var l=jN(C);l.fill=C.get(`borderColor`);var u=jN(w);u.fill=w.get(`borderColor`);var d=jN(T);if(d.fill=T.get(`borderColor`),r){var f=p-2*h;L(n,s,a.opacity,{x:h,y:0,width:f,height:b})}else n.removeTextContent();n.setStyle(c),n.ensureState(`emphasis`).style=l,n.ensureState(`blur`).style=u,n.ensureState(`select`).style=d,zl(n)}t.add(n)}function I(t,n){var r=Q(n);r.dataIndex=o.dataIndex,r.seriesIndex=e.seriesIndex;var i=Math.max(p-2*h,0),a=Math.max(m-2*h,0);if(n.culling=!0,n.setShape({x:h,y:h,width:i,height:a,r:E}),g)ne(n);else{n.invisible=!1;var s=o.getVisual(`style`),c=s.fill,l=MN(S);l.fill=c,l.decal=s.decal;var u=jN(C),d=jN(w),f=jN(T);L(n,c,s.opacity,null),n.setStyle(l),n.ensureState(`emphasis`).style=u,n.ensureState(`blur`).style=d,n.ensureState(`select`).style=f,zl(n)}t.add(n)}function ne(e){!e.invisible&&a.push(e)}function L(t,n,r,i){var a=f.getModel(i?DN:EN),s=_o(f.get(`name`),null),c=a.getShallow(`show`);jf(t,Mf(f,i?DN:EN),{defaultText:c?s:null,inheritColor:n,defaultOpacity:r,labelFetcher:e,labelDataIndex:o.dataIndex});var l=t.getTextContent();if(l){var d=l.style,p=_e(d.padding||0);i&&(t.setTextConfig({layoutRect:i}),l.disableLabelLayout=!0),l.beforeUpdate=function(){var e=Math.max((i?i.width:t.shape.width)-p[1]-p[3],0),n=Math.max((i?i.height:t.shape.height)-p[0]-p[2],0);(d.width!==e||d.height!==n)&&l.setStyle({width:e,height:n})},d.truncateMinChar=2,d.lineOverflow=`truncate`,re(d,i,u);var m=l.getState(`emphasis`);re(m?m.style:null,i,u)}}function re(t,n,r){var i=t?t.text:null;if(!n&&r.isLeafRoot&&i!=null){var a=e.get(`drillDownIcon`,!0);t.text=a?a+` `+i:i}}function R(e,r,a,o){var s=v!=null&&n[e][v],c=i[e];return s?(n[e][v]=null,ie(c,s)):g||(s=new r,s instanceof Ts&&(s.z2=LN(a,o)),z(c,s)),t[e][_]=s}function ie(e,t){var n=e[_]={};t instanceof CN?(n.oldX=t.x,n.oldY=t.y):n.oldShape=j({},t.shape)}function z(e,t){var n=e[_]={},a=o.parentNode,s=t instanceof X;if(a&&(!r||r.direction===`drillDown`)){var c=0,l=0,u=i.background[a.getRawIndex()];!r&&u&&u.oldShape&&(c=u.oldShape.width,l=u.oldShape.height),s?(n.oldX=0,n.oldY=l):n.oldShape={x:c,y:l,width:0,height:0}}n.fadein=!s}}function LN(e,t){return e*ON+t}var RN=F,zN=W,BN=-1,VN=function(){function e(t){var n=t.mappingMethod,r=t.type,i=this.option=O(t);this.type=r,this.mappingMethod=n,this._normalizeData=$N[n];var a=e.visualHandlers[r];this.applyVisual=a.applyVisual,this.getColorMapper=a.getColorMapper,this._normalizedToVisual=a._normalizedToVisual[n],n===`piecewise`?(WN(i),HN(i)):n===`category`?i.categories?UN(i):WN(i,!0):(ve(n!==`linear`||i.dataExtent),WN(i))}return e.prototype.mapValueToVisual=function(e){var t=this._normalizeData(e);return this._normalizedToVisual(t,e)},e.prototype.getNormalizer=function(){return z(this._normalizeData,this)},e.listVisualTypes=function(){return R(e.visualHandlers)},e.isValidType=function(t){return e.visualHandlers.hasOwnProperty(t)},e.eachVisual=function(e,t,n){W(e)?F(e,t,n):t.call(n,e)},e.mapVisual=function(t,n,r){var i,a=V(t)?[]:W(t)?{}:(i=!0,null);return e.eachVisual(t,function(e,t){var o=n.call(r,e,t);i?a=o:a[t]=o}),a},e.retrieveVisuals=function(t){var n={},r;return t&&RN(e.visualHandlers,function(e,i){t.hasOwnProperty(i)&&(n[i]=t[i],r=!0)}),r?n:null},e.prepareVisualTypes=function(e){if(V(e))e=e.slice();else if(zN(e)){var t=[];RN(e,function(e,n){t.push(n)}),e=t}else return[];return e.sort(function(e,t){return t===`color`&&e!==`color`&&e.indexOf(`color`)===0?1:-1}),e},e.dependsOn=function(e,t){return t===`color`?!!(e&&e.indexOf(t)===0):e===t},e.findPieceIndex=function(e,t,n){for(var r,i=1/0,a=0,o=t.length;a=0;a--)r[a]??(delete n[t[a]],t.pop())}function WN(e,t){var n=e.visual,r=[];W(n)?RN(n,function(e){r.push(e)}):n!=null&&r.push(n),!t&&r.length===1&&!{color:1,symbol:1}.hasOwnProperty(e.type)&&(r[1]=r[0]),QN(e,r)}function GN(e){return{applyVisual:function(t,n,r){var i=this.mapValueToVisual(t);r(`color`,e(n(`color`),i))},_normalizedToVisual:XN([0,1])}}function KN(e){var t=this.option.visual;return t[Math.round(Aa(e,[0,1],[0,t.length-1],!0))]||{}}function qN(e){return function(t,n,r){r(e,this.mapValueToVisual(t))}}function JN(e){var t=this.option.visual;return t[this.option.loop&&e!==BN?e%t.length:e]}function YN(){return this.option.visual[0]}function XN(e){return{linear:function(t){return Aa(t,e,this.option.visual,!0)},category:JN,piecewise:function(t,n){var r=ZN.call(this,n);return r??=Aa(t,e,this.option.visual,!0),r},fixed:YN}}function ZN(e){var t=this.option,n=t.pieceList;if(t.hasSpecialVisual){var r=n[VN.findPieceIndex(e,n)];if(r&&r.visual)return r.visual[this.type]}}function QN(e,t){return e.visual=t,e.type===`color`&&(e.parsedVisual=I(t,function(e){return ur(e)||[0,0,0,1]})),t}var $N={linear:function(e){return Aa(e,this.option.dataExtent,[0,1],!0)},piecewise:function(e){var t=this.option.pieceList,n=VN.findPieceIndex(e,t,!0);if(n!=null)return Aa(n,[0,t.length-1],[0,1],!0)},category:function(e){return(this.option.categories?this.option.categoryMap[e]:e)??BN},fixed:Ae};function eP(e,t,n){return e?t<=n:t=n.length||e===n[e.depth])&&iP(e,dP(i,c,e,t,m,r),n,r)})}}}function aP(e,t,n){var r=j({},t),i=n.designatedVisualItemStyle;return F([`color`,`colorAlpha`,`colorSaturation`],function(n){i[n]=t[n];var a=e.get(n);i[n]=null,a!=null&&(r[n]=a)}),r}function oP(e){var t=cP(e,`color`);if(t){var n=cP(e,`colorAlpha`),r=cP(e,`colorSaturation`);return r&&(t=gr(t,null,null,r)),n&&(t=_r(t,n)),t}}function sP(e,t){return t==null?null:gr(t,null,null,e)}function cP(e,t){var n=e[t];if(n!=null&&n!==`none`)return n}function lP(e,t,n,r,i,a){if(!(!a||!a.length)){var o=uP(t,`color`)||i.color!=null&&i.color!==`none`&&(uP(t,`colorAlpha`)||uP(t,`colorSaturation`));if(o){var s=t.get(`visualMin`),c=t.get(`visualMax`),l=n.dataExtent.slice();s!=null&&sl[1]&&(l[1]=c);var u=t.get(`colorMappingBy`),d={type:o.name,dataExtent:l,visual:o.range};d.type===`color`&&(u===`index`||u===`id`)?(d.mappingMethod=`category`,d.loop=!0):d.mappingMethod=`linear`;var f=new VN(d);return nP(f).drColorMappingBy=u,f}}}function uP(e,t){var n=e.get(t);return V(n)&&n.length?{name:t,range:n}:null}function dP(e,t,n,r,i,a){var o=j({},t);if(i){var s=i.type,c=s===`color`&&nP(i).drColorMappingBy,l=c===`index`?r:c===`id`?a.mapIdToIndex(n.getId()):n.getValue(e.get(`visualDimension`));o[s]=i.mapValueToVisual(l)}return o}var fP=Math.max,pP=Math.min,mP=me,hP=F,gP=[`itemStyle`,`borderWidth`],_P=[`itemStyle`,`gapWidth`],vP=[`upperLabel`,`show`],yP=[`upperLabel`,`height`],bP={seriesType:`treemap`,reset:function(e,t,n,r){var i=n.getWidth(),a=n.getHeight(),o=e.option,s=mm(e.getBoxLayoutParams(),{width:n.getWidth(),height:n.getHeight()}),c=o.size||[],l=Z(mP(s.width,c[0]),i),u=Z(mP(s.height,c[1]),a),d=r&&r.type,f=ZM(r,[`treemapZoomToNode`,`treemapRootToNode`],e),p=d===`treemapRender`||d===`treemapMove`?r.rootRect:null,m=e.getViewRoot(),h=QM(m);if(d!==`treemapMove`){var g=d===`treemapZoomToNode`?OP(e,f,m,l,u):p?[p.width,p.height]:[l,u],_=o.sort;_&&_!==`asc`&&_!==`desc`&&(_=`desc`);var v={squareRatio:o.squareRatio,sort:_,leafDepth:o.leafDepth};m.hostTree.clearLayouts();var y={x:0,y:0,width:g[0],height:g[1],area:g[0]*g[1]};m.setLayout(y),xP(m,v,!1,0),y=m.getLayout(),hP(h,function(e,t){var n=(h[t+1]||m).getValue();e.setLayout(j({dataExtent:[n,n],borderWidth:0,upperHeight:0},y))})}var b=e.getData().tree.root;b.setLayout(kP(s,p,f),!0),e.setLayoutInfo(s),AP(b,new Y(-s.x,-s.y,i,a),h,m,0)}};function xP(e,t,n,r){var i,a;if(!e.isRemoved()){var o=e.getLayout();i=o.width,a=o.height;var s=e.getModel(),c=s.get(gP),l=s.get(_P)/2,u=jP(s),d=Math.max(c,u),f=c-l,p=d-l;e.setLayout({borderWidth:c,upperHeight:d,upperLabelHeight:u},!0),i=fP(i-2*f,0),a=fP(a-f-p,0);var m=i*a,h=SP(e,s,m,t,n,r);if(h.length){var g={x:f,y:p,width:i,height:a},_=pP(i,a),v=1/0,y=[];y.area=0;for(var b=0,x=h.length;b=0;c--){var l=i[r===`asc`?o-c-1:c].getValue();l/n*ts[1]&&(s[1]=t)})),{sum:r,dataExtent:s}}function EP(e,t,n){for(var r=0,i=1/0,a=0,o=void 0,s=e.length;ar&&(r=o));var c=e.area*e.area,l=t*t*n;return c?fP(l*r/c,c/(l*i)):1/0}function DP(e,t,n,r,i){var a=t===n.width?0:1,o=1-a,s=[`x`,`y`],c=[`width`,`height`],l=n[s[a]],u=t?e.area/t:0;(i||u>n[c[o]])&&(u=n[c[o]]);for(var d=0,f=e.length;d9007199254740991&&(l=9007199254740991),a=s}l`,RP=function(e){return e.get(`autoCurveness`)||null},zP=function(e,t){var n=RP(e),r=20,i=[];if(oe(n))r=n;else if(V(n)){e.__curvenessList=n;return}t>r&&(r=t);var a=r%2?r+2:r+3;i=[];for(var o=0;o0&&(y[0]=-y[0],y[1]=-y[1]);var x=v[0]<0?-1:1;if(r.__position!==`start`&&r.__position!==`end`){var S=-Math.atan2(v[1],v[0]);l[0].8?`left`:u[0]<-.8?`right`:`center`,p=u[1]>.8?`top`:u[1]<-.8?`bottom`:`middle`;break;case`start`:r.x=-u[0]*h+c[0],r.y=-u[1]*g+c[1],f=u[0]>.8?`right`:u[0]<-.8?`left`:`center`,p=u[1]>.8?`bottom`:u[1]<-.8?`top`:`middle`;break;case`insideStartTop`:case`insideStart`:case`insideStartBottom`:r.x=h*x+c[0],r.y=c[1]+C,f=v[0]<0?`right`:`left`,r.originX=-h*x,r.originY=-C;break;case`insideMiddleTop`:case`insideMiddle`:case`insideMiddleBottom`:case`middle`:r.x=b[0],r.y=b[1]+C,f=`center`,r.originY=-C;break;case`insideEndTop`:case`insideEnd`:case`insideEndBottom`:r.x=-h*x+l[0],r.y=l[1]+C,f=v[0]>=0?`right`:`left`,r.originX=h*x,r.originY=-C}r.scaleX=r.scaleY=i,r.setStyle({verticalAlign:r.__verticalAlign||p,align:r.__align||f})}},t}(X),SF=function(){function e(e){this.group=new X,this._LineCtor=e||xF}return e.prototype.updateData=function(e){var t=this;this._progressiveEls=null;var n=this,r=n.group,i=n._lineData;n._lineData=e,i||r.removeAll();var a=wF(e);e.diff(i).add(function(n){t._doAdd(e,n,a)}).update(function(n,r){t._doUpdate(i,e,r,n,a)}).remove(function(e){r.remove(i.getItemGraphicEl(e))}).execute()},e.prototype.updateLayout=function(){var e=this._lineData;e&&e.eachItemGraphicEl(function(t,n){t.updateLayout(e,n)},this)},e.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=wF(e),this._lineData=null,this.group.removeAll()},e.prototype.incrementalUpdate=function(e,t){this._progressiveEls=[];function n(e){!e.isGroup&&!CF(e)&&(e.incremental=!0,e.ensureState(`emphasis`).hoverLayer=!0)}for(var r=e.start;r0}function wF(e){var t=e.hostModel,n=t.getModel(`emphasis`);return{lineStyle:t.getModel(`lineStyle`).getLineStyle(),emphasisLineStyle:n.getModel([`lineStyle`]).getLineStyle(),blurLineStyle:t.getModel([`blur`,`lineStyle`]).getLineStyle(),selectLineStyle:t.getModel([`select`,`lineStyle`]).getLineStyle(),emphasisDisabled:n.get(`disabled`),blurScope:n.get(`blurScope`),focus:n.get(`focus`),labelStatesModels:Mf(t)}}function TF(e){return isNaN(e[0])||isNaN(e[1])}function EF(e){return e&&!TF(e[0])&&!TF(e[1])}var DF=[],OF=[],kF=[],AF=Rn,jF=Ke,MF=Math.abs;function NF(e,t,n){for(var r=e[0],i=e[1],a=e[2],o=1/0,s,c=n*n,l=.1,u=.1;u<=.9;u+=.1){DF[0]=AF(r[0],i[0],a[0],u),DF[1]=AF(r[1],i[1],a[1],u);var d=MF(jF(DF,t)-c);d=0?s+=l:s-=l:m>=0?s-=l:s+=l}return s}function PF(e,t){var n=[],r=Hn,i=[[],[],[]],a=[[],[]],o=[];t/=2,e.eachEdge(function(e,s){var c=e.getLayout(),l=e.getVisual(`fromSymbol`),u=e.getVisual(`toSymbol`);c.__original||(c.__original=[Pe(c[0]),Pe(c[1])],c[2]&&c.__original.push(Pe(c[2])));var d=c.__original;if(c[2]!=null){if(Ne(i[0],d[0]),Ne(i[1],d[2]),Ne(i[2],d[1]),l&&l!==`none`){var f=QP(e.node1),p=NF(i,d[0],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[0][0]=n[3],i[1][0]=n[4],r(i[0][1],i[1][1],i[2][1],p,n),i[0][1]=n[3],i[1][1]=n[4]}if(u&&u!==`none`){var f=QP(e.node2),p=NF(i,d[1],f*t);r(i[0][0],i[1][0],i[2][0],p,n),i[1][0]=n[1],i[2][0]=n[2],r(i[0][1],i[1][1],i[2][1],p,n),i[1][1]=n[1],i[2][1]=n[2]}Ne(c[0],i[0]),Ne(c[1],i[2]),Ne(c[2],i[1])}else{if(Ne(a[0],d[0]),Ne(a[1],d[1]),Re(o,a[1],a[0]),He(o,o),l&&l!==`none`){var f=QP(e.node1);Le(a[0],a[0],o,f*t)}if(u&&u!==`none`){var f=QP(e.node2);Le(a[1],a[1],o,-f*t)}Ne(c[0],a[0]),Ne(c[1],a[1])}})}function FF(e){return e.type===`view`}var IF=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){var n=new uD,r=new SF,i=this.group;this._controller=new MA(t.getZr()),this._controllerHost={target:i},i.add(n.group),i.add(r.group),this._symbolDraw=n,this._lineDraw=r,this._firstRender=!0},t.prototype.render=function(e,t,n){var r=this,i=e.coordinateSystem;this._model=e;var a=this._symbolDraw,o=this._lineDraw,s=this.group;if(FF(i)){var c={x:i.x,y:i.y,scaleX:i.scaleX,scaleY:i.scaleY};this._firstRender?s.attr(c):Bd(s,c,e)}PF(e.getGraph(),ZP(e));var l=e.getData();a.updateData(l);var u=e.getEdgeData();o.updateData(u),this._updateNodeAndLinkScale(),this._updateController(e,t,n),clearTimeout(this._layoutTimeout);var d=e.forceLayout,f=e.get([`force`,`layoutAnimation`]);d&&this._startForceLayoutIteration(d,f);var p=e.get(`layout`);l.graph.eachNode(function(t){var n=t.dataIndex,i=t.getGraphicEl(),a=t.getModel();if(i){i.off(`drag`).off(`dragend`);var o=a.get(`draggable`);o&&i.on(`drag`,function(a){switch(p){case`force`:d.warmUp(),!r._layouting&&r._startForceLayoutIteration(d,f),d.setFixed(n),l.setItemLayout(n,[i.x,i.y]);break;case`circular`:l.setItemLayout(n,[i.x,i.y]),t.setLayout({fixed:!0},!0),tF(e,`symbolSize`,t,[a.offsetX,a.offsetY]),r.updateLayout(e);break;default:l.setItemLayout(n,[i.x,i.y]),YP(e.getGraph(),e),r.updateLayout(e)}}).on(`dragend`,function(){d&&d.setUnfixed(n)}),i.setDraggable(o,!!a.get(`cursor`)),a.get([`emphasis`,`focus`])===`adjacency`&&(Q(i).focus=t.getAdjacentDataIndices())}}),l.graph.eachEdge(function(e){var t=e.getGraphicEl(),n=e.getModel().get([`emphasis`,`focus`]);t&&n===`adjacency`&&(Q(t).focus={edge:[e.dataIndex],node:[e.node1.dataIndex,e.node2.dataIndex]})});var m=e.get(`layout`)===`circular`&&e.get([`circular`,`rotateLabel`]),h=l.getLayout(`cx`),g=l.getLayout(`cy`);l.graph.eachNode(function(e){rF(e,m,h,g)}),this._firstRender=!1},t.prototype.dispose=function(){this.remove(),this._controller&&this._controller.dispose(),this._controllerHost=null},t.prototype._startForceLayoutIteration=function(e,t){var n=this;(function r(){e.step(function(e){n.updateLayout(n._model),(n._layouting=!e)&&(t?n._layoutTimeout=setTimeout(r,16):r())})})()},t.prototype._updateController=function(e,t,n){var r=this,i=this._controller,a=this._controllerHost,o=this.group;if(i.setPointerChecker(function(t,r,i){var a=o.getBoundingRect();return a.applyTransform(o.transform),a.contain(r,i)&&!zA(t,n,e)}),!FF(e.coordinateSystem)){i.disable();return}i.enable(e.get(`roam`)),a.zoomLimit=e.get(`scaleLimit`),a.zoom=e.coordinateSystem.getZoom(),i.off(`pan`).off(`zoom`).on(`pan`,function(t){IA(a,t.dx,t.dy),n.dispatchAction({seriesId:e.id,type:`graphRoam`,dx:t.dx,dy:t.dy})}).on(`zoom`,function(t){LA(a,t.scale,t.originX,t.originY),n.dispatchAction({seriesId:e.id,type:`graphRoam`,zoom:t.scale,originX:t.originX,originY:t.originY}),r._updateNodeAndLinkScale(),PF(e.getGraph(),ZP(e)),r._lineDraw.updateLayout(),n.updateLabelLayout()})},t.prototype._updateNodeAndLinkScale=function(){var e=this._model,t=e.getData(),n=ZP(e);t.eachItemGraphicEl(function(e,t){e&&e.setSymbolScale(n)})},t.prototype.updateLayout=function(e){PF(e.getGraph(),ZP(e)),this._symbolDraw.updateLayout(),this._lineDraw.updateLayout()},t.prototype.remove=function(){clearTimeout(this._layoutTimeout),this._layouting=!1,this._layoutTimeout=null,this._symbolDraw&&this._symbolDraw.remove(),this._lineDraw&&this._lineDraw.remove()},t.type=`graph`,t}(q_);function LF(e){return`_EC_`+e}var RF=function(){function e(e){this.type=`graph`,this.nodes=[],this.edges=[],this._nodesMap={},this._edgesMap={},this._directed=e||!1}return e.prototype.isDirected=function(){return this._directed},e.prototype.addNode=function(e,t){e=e==null?``+t:``+e;var n=this._nodesMap;if(!n[LF(e)]){var r=new zF(e,t);return r.hostGraph=this,this.nodes.push(r),n[LF(e)]=r,r}},e.prototype.getNodeByIndex=function(e){var t=this.data.getRawIndex(e);return this.nodes[t]},e.prototype.getNodeById=function(e){return this._nodesMap[LF(e)]},e.prototype.addEdge=function(e,t,n){var r=this._nodesMap,i=this._edgesMap;if(oe(e)&&(e=this.nodes[e]),oe(t)&&(t=this.nodes[t]),e instanceof zF||(e=r[LF(e)]),t instanceof zF||(t=r[LF(t)]),!(!e||!t)){var a=e.id+`-`+t.id,o=new BF(e,t,n);return o.hostGraph=this,this._directed&&(e.outEdges.push(o),t.inEdges.push(o)),e.edges.push(o),e!==t&&t.edges.push(o),this.edges.push(o),i[a]=o,o}},e.prototype.getEdgeByIndex=function(e){var t=this.edgeData.getRawIndex(e);return this.edges[t]},e.prototype.getEdge=function(e,t){e instanceof zF&&(e=e.id),t instanceof zF&&(t=t.id);var n=this._edgesMap;return this._directed?n[e+`-`+t]:n[e+`-`+t]||n[t+`-`+e]},e.prototype.eachNode=function(e,t){for(var n=this.nodes,r=n.length,i=0;i=0&&e.call(t,n[i],i)},e.prototype.eachEdge=function(e,t){for(var n=this.edges,r=n.length,i=0;i=0&&n[i].node1.dataIndex>=0&&n[i].node2.dataIndex>=0&&e.call(t,n[i],i)},e.prototype.breadthFirstTraverse=function(e,t,n,r){if(t instanceof zF||(t=this._nodesMap[LF(t)]),t){for(var i=n===`out`?`outEdges`:n===`in`?`inEdges`:`edges`,a=0;a=0&&n.node2.dataIndex>=0});for(var i=0,a=r.length;i=0&&this[e][t].setItemVisual(this.dataIndex,n,r)},getVisual:function(n){return this[e][t].getItemVisual(this.dataIndex,n)},setLayout:function(n,r){this.dataIndex>=0&&this[e][t].setItemLayout(this.dataIndex,n,r)},getLayout:function(){return this[e][t].getItemLayout(this.dataIndex)},getGraphicEl:function(){return this[e][t].getItemGraphicEl(this.dataIndex)},getRawIndex:function(){return this[e][t].getRawIndex(this.dataIndex)}}}P(zF,VF(`hostGraph`,`data`)),P(BF,VF(`hostGraph`,`edgeData`));function HF(e,t,n,r,i){for(var a=new RF(r),o=0;o `+f)),l++)}var p=n.get(`coordinateSystem`),m;if(p===`cartesian2d`||p===`polar`)m=wS(e,n);else{var h=mh.get(p),g=h&&h.dimensions||[];N(g,`value`)<0&&g.concat([`value`]);var _=uS(e,{coordDimensions:g,encodeDefine:n.getEncode()}).dimensions;m=new lS(_,n),m.initData(e)}var v=new lS([`value`],n);return v.initData(c,s),i&&i(m,v),zM({mainData:m,struct:a,structAttr:`graph`,datas:{node:m,edge:v},datasAttr:{node:`data`,edge:`edgeData`}}),a.update(),a}var UF=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments);var n=this;function r(){return n._categoriesData}this.legendVisualProvider=new qO(r,r),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this.fillDataTextStyle(t.edges||t.links),this._updateCategoriesData()},t.prototype.mergeDefaultAndTheme=function(t){e.prototype.mergeDefaultAndTheme.apply(this,arguments),ro(t,`edgeLabel`,[`show`])},t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=this;if(r&&n){GP(this);var a=HF(r,n,this,!0,o);return F(a.edges,function(e){KP(e.node1,e.node2,this,e.dataIndex)},this),a.data}function o(e,t){e.wrapMethod(`getItemModel`,function(e){var t=i._categoriesModels[e.getShallow(`category`)];return t&&(t.parentModel=e.parentModel,e.parentModel=t),e});var n=tp.prototype.getModel;function r(e,t){var r=n.call(this,e,t);return r.resolveParentPath=a,r}t.wrapMethod(`getItemModel`,function(e){return e.resolveParentPath=a,e.getModel=r,e});function a(e){if(e&&(e[0]===`label`||e[1]===`label`)){var t=e.slice();return e[0]===`label`?t[0]=`edgeLabel`:e[1]===`label`&&(t[1]=`edgeLabel`),t}return e}}},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.getCategoriesData=function(){return this._categoriesData},t.prototype.formatTooltip=function(e,t,n){if(n===`edge`){var r=this.getData(),i=this.getDataParams(e,n),a=r.graph.getEdgeByIndex(e),o=r.getName(a.node1.dataIndex),s=r.getName(a.node2.dataIndex),c=[];return o!=null&&c.push(o),s!=null&&c.push(s),p_(`nameValue`,{name:c.join(` > `),value:i.value,noValue:i.value==null})}return k_({series:this,dataIndex:e,multipleSeries:t})},t.prototype._updateCategoriesData=function(){var e=I(this.option.categories||[],function(e){return e.value==null?j({value:0},e):e}),t=new lS([`value`],this);t.initData(e),this._categoriesData=t,this._categoriesModels=t.mapArray(function(e){return t.getItemModel(e)})},t.prototype.setZoom=function(e){this.option.zoom=e},t.prototype.setCenter=function(e){this.option.center=e},t.prototype.isAnimationEnabled=function(){return e.prototype.isAnimationEnabled.call(this)&&!(this.get(`layout`)===`force`&&this.get([`force`,`layoutAnimation`]))},t.type=`series.graph`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`],t.defaultOption={z:2,coordinateSystem:`view`,legendHoverLink:!0,layout:null,circular:{rotateLabel:!1},force:{initLayout:null,repulsion:[0,50],gravity:.1,friction:.6,edgeLength:30,layoutAnimation:!0},left:`center`,top:`center`,symbol:`circle`,symbolSize:10,edgeSymbol:[`none`,`none`],edgeSymbolSize:10,edgeLabel:{position:`middle`,distance:5},draggable:!1,roam:!1,center:null,zoom:1,nodeScaleRatio:.6,label:{show:!1,formatter:`{b}`},itemStyle:{},lineStyle:{color:`#aaa`,width:1,opacity:.5},emphasis:{scale:!0,label:{show:!0}},select:{itemStyle:{borderColor:`#212121`}}},t}(P_),WF={type:`graphRoam`,event:`graphRoam`,update:`none`};function GF(e){e.registerChartView(IF),e.registerSeriesModel(UF),e.registerProcessor(NP),e.registerVisual(PP),e.registerVisual(IP),e.registerLayout(XP),e.registerLayout(e.PRIORITY.VISUAL.POST_CHART_LAYOUT,iF),e.registerLayout(sF),e.registerCoordinateSystem(`graphView`,{dimensions:$j.dimensions,create:lF}),e.registerAction({type:`focusNodeAdjacency`,event:`focusNodeAdjacency`,update:`series:focusNodeAdjacency`},Ae),e.registerAction({type:`unfocusNodeAdjacency`,event:`unfocusNodeAdjacency`,update:`series:unfocusNodeAdjacency`},Ae),e.registerAction(WF,function(e,t,n){t.eachComponent({mainType:`series`,query:e},function(t){var r=t.coordinateSystem,i=uM(r,e,void 0,n);t.setCenter&&t.setCenter(i.center),t.setZoom&&t.setZoom(i.zoom)})})}var KF=function(){function e(){this.angle=0,this.width=10,this.r=10,this.x=0,this.y=0}return e}(),qF=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`pointer`,n}return t.prototype.getDefaultShape=function(){return new KF},t.prototype.buildPath=function(e,t){var n=Math.cos,r=Math.sin,i=t.r,a=t.width,o=t.angle,s=t.x-n(o)*a*(a>=i/3?1:2),c=t.y-r(o)*a*(a>=i/3?1:2);o=t.angle-Math.PI/2,e.moveTo(s,c),e.lineTo(t.x+n(o)*a,t.y+r(o)*a),e.lineTo(t.x+n(t.angle)*i,t.y+r(t.angle)*i),e.lineTo(t.x-n(o)*a,t.y-r(o)*a),e.lineTo(s,c)},t}(Nc);function JF(e,t){var n=e.get(`center`),r=t.getWidth(),i=t.getHeight(),a=Math.min(r,i);return{cx:Z(n[0],t.getWidth()),cy:Z(n[1],t.getHeight()),r:Z(e.get(`radius`),a/2)}}function YF(e,t){var n=e==null?``:e+``;return t&&(U(t)?n=t.replace(`{value}`,n):H(t)&&(n=t(e))),n}var XF=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeAll();var r=e.get([`axisLine`,`lineStyle`,`color`]),i=JF(e,n);this._renderMain(e,t,n,r,i),this._data=e.getData()},t.prototype.dispose=function(){},t.prototype._renderMain=function(e,t,n,r,i){var a=this.group,o=e.get(`clockwise`),s=-e.get(`startAngle`)/180*Math.PI,c=-e.get(`endAngle`)/180*Math.PI,l=e.getModel(`axisLine`),u=l.get(`roundCap`)?eO:cd,d=l.get(`show`),f=l.getModel(`lineStyle`),p=f.get(`width`),m=[s,c];sc(m,!o),s=m[0],c=m[1];for(var h=c-s,g=s,_=[],v=0;d&&v=e&&(t===0?0:r[t-1][0])Math.PI/2&&(I+=Math.PI)):F===`tangential`?I=-S-Math.PI/2:oe(F)&&(I=F*Math.PI/180),I===0?l.add(new Zc({style:Nf(_,{text:N,x:P,y:te,verticalAlign:k<-.8?`top`:k>.8?`bottom`:`middle`,align:O<-.4?`left`:O>.4?`right`:`center`},{inheritColor:ee}),silent:!0})):l.add(new Zc({style:Nf(_,{text:N,x:P,y:te,verticalAlign:`middle`,align:`center`},{inheritColor:ee}),silent:!0,originX:P,originY:te,rotation:I}))}if(g.get(`show`)&&A!==v){var j=g.get(`distance`);j=j?j+c:c;for(var ne=0;ne<=y;ne++){O=Math.cos(S),k=Math.sin(S);var L=new yd({shape:{x1:O*(f-j)+u,y1:k*(f-j)+d,x2:O*(f-x-j)+u,y2:k*(f-x-j)+d},silent:!0,style:E});E.stroke===`auto`&&L.setStyle({stroke:r((A+ne/y)/v)}),l.add(L),S+=w}S-=w}else S+=C}},t.prototype._renderPointer=function(e,t,n,r,i,a,o,s,c){var l=this.group,u=this._data,d=this._progressEls,f=[],p=e.get([`pointer`,`show`]),m=e.getModel(`progress`),h=m.get(`show`),g=e.getData(),_=g.mapDimension(`value`),v=+e.get(`min`),y=+e.get(`max`),b=[v,y],x=[a,o];function S(t,n){var r=g.getItemModel(t).getModel(`pointer`),a=Z(r.get(`width`),i.r),o=Z(r.get(`length`),i.r),s=e.get([`pointer`,`icon`]),c=r.get(`offsetCenter`),l=Z(c[0],i.r),u=Z(c[1],i.r),d=r.get(`keepAspect`),f=s?ay(s,l-a/2,u-o,a,o,null,d):new qF({shape:{angle:-Math.PI/2,width:a,r:o,x:l,y:u}});return f.rotation=-(n+Math.PI/2),f.x=i.cx,f.y=i.cy,f}function C(e,t){var n=m.get(`roundCap`)?eO:cd,r=m.get(`overlap`),o=r?m.get(`width`):c/g.count(),l=r?i.r-o:i.r-(e+1)*o,u=r?i.r:i.r-e*o,d=new n({shape:{startAngle:a,endAngle:t,cx:i.cx,cy:i.cy,clockwise:s,r0:l,r:u}});return r&&(d.z2=Aa(g.get(_,e),[v,y],[100,0],!0)),d}(h||p)&&(g.diff(u).add(function(t){var n=g.get(_,t);if(p){var r=S(t,a);Vd(r,{rotation:-((isNaN(+n)?x[0]:Aa(n,b,x,!0))+Math.PI/2)},e),l.add(r),g.setItemGraphicEl(t,r)}if(h){var i=C(t,a);Vd(i,{shape:{endAngle:Aa(n,b,x,m.get(`clip`))}},e),l.add(i),dl(e.seriesIndex,g.dataType,t,i),f[t]=i}}).update(function(t,n){var r=g.get(_,t);if(p){var i=u.getItemGraphicEl(n),o=i?i.rotation:a,s=S(t,o);s.rotation=o,Bd(s,{rotation:-((isNaN(+r)?x[0]:Aa(r,b,x,!0))+Math.PI/2)},e),l.add(s),g.setItemGraphicEl(t,s)}if(h){var c=d[n],v=C(t,c?c.shape.endAngle:a);Bd(v,{shape:{endAngle:Aa(r,b,x,m.get(`clip`))}},e),l.add(v),dl(e.seriesIndex,g.dataType,t,v),f[t]=v}}).execute(),g.each(function(e){var t=g.getItemModel(e),n=t.getModel(`emphasis`),i=n.get(`focus`),a=n.get(`blurScope`),o=n.get(`disabled`);if(p){var s=g.getItemGraphicEl(e),c=g.getItemVisual(e,`style`),l=c.fill;if(s instanceof zc){var u=s.style;s.useStyle(j({image:u.image,x:u.x,y:u.y,width:u.width,height:u.height},c))}else s.useStyle(c),s.type!==`pointer`&&s.setColor(l);s.setStyle(t.getModel([`pointer`,`itemStyle`]).getItemStyle()),s.style.fill===`auto`&&s.setStyle(`fill`,r(Aa(g.get(_,e),b,[0,1],!0))),s.z2EmphasisLift=0,du(s,t),su(s,i,a,o)}if(h){var d=f[e];d.useStyle(g.getItemVisual(e,`style`)),d.setStyle(t.getModel([`progress`,`itemStyle`]).getItemStyle()),d.z2EmphasisLift=0,du(d,t),su(d,i,a,o)}}),this._progressEls=f)},t.prototype._renderAnchor=function(e,t){var n=e.getModel(`anchor`);if(n.get(`show`)){var r=n.get(`size`),i=n.get(`icon`),a=n.get(`offsetCenter`),o=n.get(`keepAspect`),s=ay(i,t.cx-r/2+Z(a[0],t.r),t.cy-r/2+Z(a[1],t.r),r,r,null,o);s.z2=+!!n.get(`showAbove`),s.setStyle(n.getModel(`itemStyle`).getItemStyle()),this.group.add(s)}},t.prototype._renderTitleAndDetail=function(e,t,n,r,i){var a=this,o=e.getData(),s=o.mapDimension(`value`),c=+e.get(`min`),l=+e.get(`max`),u=new X,d=[],f=[],p=e.isAnimationEnabled(),m=e.get([`pointer`,`showAbove`]);o.diff(this._data).add(function(e){d[e]=new Zc({silent:!0}),f[e]=new Zc({silent:!0})}).update(function(e,t){d[e]=a._titleEls[t],f[e]=a._detailEls[t]}).execute(),o.each(function(t){var n=o.getItemModel(t),a=o.get(s,t),h=new X,g=r(Aa(a,[c,l],[0,1],!0)),_=n.getModel(`title`);if(_.get(`show`)){var v=_.get(`offsetCenter`),y=i.cx+Z(v[0],i.r),b=i.cy+Z(v[1],i.r),x=d[t];x.attr({z2:m?0:2,style:Nf(_,{x:y,y:b,text:o.getName(t),align:`center`,verticalAlign:`middle`},{inheritColor:g})}),h.add(x)}var S=n.getModel(`detail`);if(S.get(`show`)){var C=S.get(`offsetCenter`),w=i.cx+Z(C[0],i.r),T=i.cy+Z(C[1],i.r),E=Z(S.get(`width`),i.r),D=Z(S.get(`height`),i.r),O=e.get([`progress`,`show`])?o.getItemVisual(t,`style`).fill:g,x=f[t],k=S.get(`formatter`);x.attr({z2:m?0:2,style:Nf(S,{x:w,y:T,text:YF(a,k),width:isNaN(E)?null:E,height:isNaN(D)?null:D,align:`center`,verticalAlign:`middle`},{inheritColor:O})}),Uf(x,{normal:S},a,function(e){return YF(e,k)}),p&&Wf(x,t,o,e,{getFormattedLabel:function(e,t,n,r,i,o){return YF(o?o.interpolatedValue:a,k)}}),h.add(x)}u.add(h)}),this.group.add(u),this._titleEls=d,this._detailEls=f},t.type=`gauge`,t}(q_),ZF=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath=`itemStyle`,n}return t.prototype.getInitialData=function(e,t){return KO(this,[`value`])},t.type=`series.gauge`,t.defaultOption={z:2,colorBy:`data`,center:[`50%`,`50%`],legendHoverLink:!0,radius:`75%`,startAngle:225,endAngle:-45,clockwise:!0,min:0,max:100,splitNumber:10,axisLine:{show:!0,roundCap:!1,lineStyle:{color:[[1,`#E6EBF8`]],width:10}},progress:{show:!1,overlap:!0,width:10,roundCap:!1,clip:!0},splitLine:{show:!0,length:10,distance:10,lineStyle:{color:`#63677A`,width:3,type:`solid`}},axisTick:{show:!0,splitNumber:5,length:6,distance:10,lineStyle:{color:`#63677A`,width:1,type:`solid`}},axisLabel:{show:!0,distance:15,color:`#464646`,fontSize:12,rotate:0},pointer:{icon:null,offsetCenter:[0,0],show:!0,showAbove:!0,length:`60%`,width:6,keepAspect:!1},anchor:{show:!1,showAbove:!1,size:6,icon:`circle`,offsetCenter:[0,0],keepAspect:!1,itemStyle:{color:`#fff`,borderWidth:0,borderColor:`#5470c6`}},title:{show:!0,offsetCenter:[0,`20%`],color:`#464646`,fontSize:16,valueAnimation:!1},detail:{show:!0,backgroundColor:`rgba(0,0,0,0)`,borderWidth:0,borderColor:`#ccc`,width:100,height:null,padding:[5,10],offsetCenter:[0,`40%`],color:`#464646`,fontSize:30,fontWeight:`bold`,lineHeight:30,valueAnimation:!1}},t}(P_);function QF(e){e.registerChartView(XF),e.registerSeriesModel(ZF)}var $F=[`itemStyle`,`opacity`],eI=function(e){r(t,e);function t(t,n){var r=e.call(this)||this,i=r,a=new gd,o=new Zc;return i.setTextContent(o),r.setTextGuideLine(a),r.updateData(t,n,!0),r}return t.prototype.updateData=function(e,t,n){var r=this,i=e.hostModel,a=e.getItemModel(t),o=e.getItemLayout(t),s=a.getModel(`emphasis`),c=a.get($F);c??=1,n||Kd(r),r.useStyle(e.getItemVisual(t,`style`)),r.style.lineJoin=`round`,n?(r.setShape({points:o.points}),r.style.opacity=0,Vd(r,{style:{opacity:c}},i,t)):Bd(r,{style:{opacity:c},shape:{points:o.points}},i,t),du(r,a),this._updateLabel(e,t),su(this,s.get(`focus`),s.get(`blurScope`),s.get(`disabled`))},t.prototype._updateLabel=function(e,t){var n=this,r=this.getTextGuideLine(),i=n.getTextContent(),a=e.hostModel,o=e.getItemModel(t),s=e.getItemLayout(t).label,c=e.getItemVisual(t,`style`),l=c.fill;jf(i,Mf(o),{labelFetcher:e.hostModel,labelDataIndex:t,defaultOpacity:c.opacity,defaultText:e.getName(t)},{normal:{align:s.textAlign,verticalAlign:s.verticalAlign}}),n.setTextConfig({local:!0,inside:!!s.inside,insideStroke:l,outsideFill:l});var u=s.linePoints;r.setShape({points:u}),n.textGuideLineConfig={anchor:u?new J(u[0][0],u[0][1]):null},Bd(i,{style:{x:s.x,y:s.y}},a,t),i.attr({rotation:s.rotation,originX:s.x,originY:s.y,z2:10}),Xw(n,Zw(o),{stroke:l})},t}(md),tI=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreLabelLineUpdate=!0,n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this._data,a=this.group;r.diff(i).add(function(e){var t=new eI(r,e);r.setItemGraphicEl(e,t),a.add(t)}).update(function(e,t){var n=i.getItemGraphicEl(t);n.updateData(r,e),a.add(n),r.setItemGraphicEl(e,n)}).remove(function(t){Gd(i.getItemGraphicEl(t),e,t)}).execute(),this._data=r},t.prototype.remove=function(){this.group.removeAll(),this._data=null},t.prototype.dispose=function(){},t.type=`funnel`,t}(q_),nI=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t){e.prototype.init.apply(this,arguments),this.legendVisualProvider=new qO(z(this.getData,this),z(this.getRawData,this)),this._defaultLabelLine(t)},t.prototype.getInitialData=function(e,t){return KO(this,{coordDimensions:[`value`],encodeDefaulter:B(zm,this)})},t.prototype._defaultLabelLine=function(e){ro(e,`labelLine`,[`show`]);var t=e.labelLine,n=e.emphasis.labelLine;t.show=t.show&&e.label.show,n.show=n.show&&e.emphasis.label.show},t.prototype.getDataParams=function(t){var n=this.getData(),r=e.prototype.getDataParams.call(this,t),i=n.mapDimension(`value`),a=n.getSum(i);return r.percent=a?+(n.get(i,t)/a*100).toFixed(2):0,r.$vars.push(`percent`),r},t.type=`series.funnel`,t.defaultOption={z:2,legendHoverLink:!0,colorBy:`data`,left:80,top:60,right:80,bottom:60,minSize:`0%`,maxSize:`100%`,sort:`descending`,orient:`vertical`,gap:0,funnelAlign:`center`,label:{show:!0,position:`outer`},labelLine:{show:!0,length:20,lineStyle:{width:1}},itemStyle:{borderColor:`#fff`,borderWidth:1},emphasis:{label:{show:!0}},select:{itemStyle:{borderColor:`#212121`}}},t}(P_);function rI(e,t){return mm(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function iI(e,t){for(var n=e.mapDimension(`value`),r=e.mapArray(n,function(e){return e}),i=[],a=t===`ascending`,o=0,s=e.count();owI)return;var r=this._model.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]);r.behavior!==`none`&&this._dispatchExpand({axisExpandWindow:r.axisExpandWindow})}this._mouseDownPoint=null},mousemove:function(e){if(!(this._mouseDownPoint||!DI(this,`mousemove`))){var t=this._model,n=t.coordinateSystem.getSlidedAxisExpandWindow([e.offsetX,e.offsetY]),r=n.behavior;r===`jump`&&this._throttledDispatchExpand.debounceNextCall(t.get(`axisExpandDebounce`)),this._throttledDispatchExpand(r===`none`?null:{axisExpandWindow:n.axisExpandWindow,animation:r===`jump`?null:{duration:0}})}}};function DI(e,t){var n=e._model;return n.get(`axisExpandable`)&&n.get(`axisExpandTriggerOn`)===t}var OI=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){e.prototype.init.apply(this,arguments),this.mergeOption({})},t.prototype.mergeOption=function(e){var t=this.option;e&&k(t,e,!0),this._initDimensions()},t.prototype.contains=function(e,t){var n=e.get(`parallelIndex`);return n!=null&&t.getComponent(`parallel`,n)===this},t.prototype.setAxisExpand=function(e){F([`axisExpandable`,`axisExpandCenter`,`axisExpandCount`,`axisExpandWidth`,`axisExpandWindow`],function(t){e.hasOwnProperty(t)&&(this.option[t]=e[t])},this)},t.prototype._initDimensions=function(){var e=this.dimensions=[],t=this.parallelAxisIndex=[];F(L(this.ecModel.queryComponents({mainType:`parallelAxis`}),function(e){return(e.get(`parallelIndex`)||0)===this.componentIndex},this),function(n){e.push(`dim`+n.get(`dim`)),t.push(n.componentIndex)})},t.type=`parallel`,t.dependencies=[`parallelAxis`],t.layoutMode=`box`,t.defaultOption={z:0,left:80,top:60,right:80,bottom:60,layout:`horizontal`,axisExpandable:!1,axisExpandCenter:null,axisExpandCount:0,axisExpandWidth:50,axisExpandRate:17,axisExpandDebounce:50,axisExpandSlideTriggerArea:[-.15,.05,.4],axisExpandTriggerOn:`click`,parallelAxisDefault:null},t}(Sm),kI=function(e){r(t,e);function t(t,n,r,i,a){var o=e.call(this,t,n,r)||this;return o.type=i||`value`,o.axisIndex=a,o}return t.prototype.isHorizontal=function(){return this.coordinateSystem.getModel().get(`layout`)!==`horizontal`},t}(Tw);function AI(e,t,n,r,i,a){e||=0;var o=n[1]-n[0];if(i!=null&&(i=MI(i,[0,o])),a!=null&&(a=Math.max(a,i??0)),r===`all`){var s=Math.abs(t[1]-t[0]);s=MI(s,[0,o]),i=a=MI(s,[i,a]),r=0}t[0]=MI(t[0],n),t[1]=MI(t[1],n);var c=jI(t,r);t[r]+=e;var l=i||0,u=n.slice();c.sign<0?u[0]+=l:u[1]-=l,t[r]=MI(t[r],u);var d=jI(t,r);return i!=null&&(d.sign!==c.sign||d.spana&&(t[1-r]=t[r]+d.sign*a),t}function jI(e,t){var n=e[t]-e[1-t];return{span:Math.abs(n),sign:n>0?-1:n<0?1:t?-1:1}}function MI(e,t){return Math.min(t[1]==null?1/0:t[1],Math.max(t[0]==null?-1/0:t[0],e))}var NI=F,PI=Math.min,FI=Math.max,II=Math.floor,LI=Math.ceil,RI=ja,zI=Math.PI,BI=function(){function e(e,t,n){this.type=`parallel`,this._axesMap=K(),this._axesLayout={},this.dimensions=e.dimensions,this._model=e,this._init(e,t,n)}return e.prototype._init=function(e,t,n){var r=e.dimensions,i=e.parallelAxisIndex;NI(r,function(e,n){var r=i[n],a=t.getComponent(`parallelAxis`,r),o=this._axesMap.set(e,new kI(e,FC(a),[0,0],a.get(`type`),r));o.onBand=o.type===`category`&&a.get(`boundaryGap`),o.inverse=a.get(`inverse`),a.axis=o,o.model=a,o.coordinateSystem=a.coordinateSystem=this},this)},e.prototype.update=function(e,t){this._updateAxesFromSeries(this._model,e)},e.prototype.containPoint=function(e){var t=this._makeLayoutInfo(),n=t.axisBase,r=t.layoutBase,i=t.pixelDimIndex,a=e[1-i],o=e[i];return a>=n&&a<=n+t.axisLength&&o>=r&&o<=r+t.layoutLength},e.prototype.getModel=function(){return this._model},e.prototype._updateAxesFromSeries=function(e,t){t.eachSeries(function(n){if(e.contains(n,t)){var r=n.getData();NI(this.dimensions,function(e){var t=this._axesMap.get(e);t.scale.unionExtentFromData(r,r.mapDimension(e)),PC(t.scale,t.model)},this)}},this)},e.prototype.resize=function(e,t){this._rect=mm(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()}),this._layoutAxes()},e.prototype.getRect=function(){return this._rect},e.prototype._makeLayoutInfo=function(){var e=this._model,t=this._rect,n=[`x`,`y`],r=[`width`,`height`],i=e.get(`layout`),a=i===`horizontal`?0:1,o=t[r[a]],s=[0,o],c=this.dimensions.length,l=VI(e.get(`axisExpandWidth`),s),u=VI(e.get(`axisExpandCount`)||0,[0,c]),d=e.get(`axisExpandable`)&&c>3&&c>u&&u>1&&l>0&&o>0,f=e.get(`axisExpandWindow`),p;f?(p=VI(f[1]-f[0],s),f[1]=f[0]+p):(p=VI(l*(u-1),s),f=[l*(e.get(`axisExpandCenter`)||II(c/2))-p/2],f[1]=f[0]+p);var m=(o-p)/(c-u);m<3&&(m=0);var h=[II(RI(f[0]/l,1))+1,LI(RI(f[1]/l,1))-1],g=m/l*f[0];return{layout:i,pixelDimIndex:a,layoutBase:t[n[a]],layoutLength:o,axisBase:t[n[1-a]],axisLength:t[r[1-a]],axisExpandable:d,axisExpandWidth:l,axisCollapseWidth:m,axisExpandWindow:f,axisCount:c,winInnerIndices:h,axisExpandWindow0Pos:g}},e.prototype._layoutAxes=function(){var e=this._rect,t=this._axesMap,n=this.dimensions,r=this._makeLayoutInfo(),i=r.layout;t.each(function(e){var t=[0,r.axisLength],n=+!!e.inverse;e.setExtent(t[n],t[1-n])}),NI(n,function(t,n){var a=(r.axisExpandable?UI:HI)(n,r),o={horizontal:{x:a.position,y:r.axisLength},vertical:{x:0,y:a.position}},s={horizontal:zI/2,vertical:0},c=[o[i].x+e.x,o[i].y+e.y],l=s[i],u=kt();Pt(u,u,l),Nt(u,u,c),this._axesLayout[t]={position:c,rotation:l,transform:u,axisNameAvailableWidth:a.axisNameAvailableWidth,axisLabelShow:a.axisLabelShow,nameTruncateMaxWidth:a.nameTruncateMaxWidth,tickDirection:1,labelDirection:1}},this)},e.prototype.getAxis=function(e){return this._axesMap.get(e)},e.prototype.dataToPoint=function(e,t){return this.axisCoordToPoint(this._axesMap.get(t).dataToCoord(e),t)},e.prototype.eachActiveState=function(e,t,n,r){n??=0,r??=e.count();var i=this._axesMap,a=this.dimensions,o=[],s=[];F(a,function(t){o.push(e.mapDimension(t)),s.push(i.get(t).model)});for(var c=this.hasAxisBrushed(),l=n;li*(1-u[0])?(c=`jump`,s=o-i*(1-u[2])):(s=o-i*u[1])>=0&&(s=o-i*(1-u[1]))<=0&&(s=0),s*=t.axisExpandWidth/l,s?AI(s,r,a,`all`):c=`none`;else{var f=r[1]-r[0];r=[FI(0,a[1]*o/f-f/2)],r[1]=PI(a[1],r[0]+f),r[0]=r[1]-f}return{axisExpandWindow:r,behavior:c}},e}();function VI(e,t){return PI(FI(e,t[0]),t[1])}function HI(e,t){var n=t.layoutLength/(t.axisCount-1);return{position:n*e,axisNameAvailableWidth:n,axisLabelShow:!0}}function UI(e,t){var n=t.layoutLength,r=t.axisExpandWidth,i=t.axisCount,a=t.axisCollapseWidth,o=t.winInnerIndices,s,c=a,l=!1,u;return e=0;n--)Ma(t[n])},t.prototype.getActiveState=function(e){var t=this.activeIntervals;if(!t.length)return`normal`;if(e==null||isNaN(+e))return`inactive`;if(t.length===1){var n=t[0];if(n[0]<=e&&e<=n[1])return`active`}else for(var r=0,i=t.length;rQI}function _L(e){var t=e.length-1;return t<0&&(t=0),[e[0],e[t]]}function vL(e,t,n,r){var i=new X;return i.add(new qc({name:`main`,style:SL(n),silent:!0,draggable:!0,cursor:`move`,drift:B(DL,e,t,i,[`n`,`s`,`w`,`e`]),ondragend:B(hL,t,{isEnd:!0})})),F(r,function(n){i.add(new qc({name:n.join(``),style:{opacity:0},draggable:!0,silent:!0,invisible:!0,drift:B(DL,e,t,i,n),ondragend:B(hL,t,{isEnd:!0})}))}),i}function yL(e,t,n,r){var i=r.brushStyle.lineWidth||0,a=YI(i,$I),o=n[0][0],s=n[1][0],c=o-i/2,l=s-i/2,u=n[0][1],d=n[1][1],f=u-a+i/2,p=d-a+i/2,m=u-o,h=d-s,g=m+i,_=h+i;xL(e,t,`main`,o,s,m,h),r.transformable&&(xL(e,t,`w`,c,l,a,_),xL(e,t,`e`,f,l,a,_),xL(e,t,`n`,c,l,g,a),xL(e,t,`s`,c,p,g,a),xL(e,t,`nw`,c,l,a,a),xL(e,t,`ne`,f,l,a,a),xL(e,t,`sw`,c,p,a,a),xL(e,t,`se`,f,p,a,a))}function bL(e,t){var n=t.__brushOption,r=n.transformable,i=t.childAt(0);i.useStyle(SL(n)),i.attr({silent:!r,cursor:r?`move`:`default`}),F([[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]],function(n){var i=t.childOfName(n.join(``)),a=n.length===1?TL(e,n[0]):EL(e,n);i&&i.attr({silent:!r,invisible:!r,cursor:r?nL[a]+`-resize`:null})})}function xL(e,t,n,r,i,a,o){var s=t.childOfName(n);s&&s.setShape(jL(AL(e,t,[[r,i],[r+a,i+o]])))}function SL(e){return M({strokeNoScale:!0},e.brushStyle)}function CL(e,t,n,r){var i=[JI(e,n),JI(t,r)],a=[YI(e,n),YI(t,r)];return[[i[0],a[0]],[i[1],a[1]]]}function wL(e){return ff(e.group)}function TL(e,t){return{left:`w`,right:`e`,top:`n`,bottom:`s`}[mf({w:`left`,e:`right`,n:`top`,s:`bottom`}[t],wL(e))]}function EL(e,t){var n=[TL(e,t[0]),TL(e,t[1])];return(n[0]===`e`||n[0]===`w`)&&n.reverse(),n.join(``)}function DL(e,t,n,r,i,a){var o=n.__brushOption,s=e.toRectRange(o.range),c=kL(t,i,a);F(r,function(e){var t=tL[e];s[t[0]][t[1]]+=c[t[0]]}),o.range=e.fromRectRange(CL(s[0][0],s[1][0],s[0][1],s[1][1])),uL(t,n),hL(t,{isEnd:!1})}function OL(e,t,n,r){var i=t.__brushOption.range,a=kL(e,n,r);F(i,function(e){e[0]+=a[0],e[1]+=a[1]}),uL(e,t),hL(e,{isEnd:!1})}function kL(e,t,n){var r=e.group,i=r.transformCoordToLocal(t,n),a=r.transformCoordToLocal(0,0);return[i[0]-a[0],i[1]-a[1]]}function AL(e,t,n){var r=pL(e,t);return r&&r!==qI?r.clipPath(n,e._transform):O(n)}function jL(e){var t=JI(e[0][0],e[1][0]),n=JI(e[0][1],e[1][1]),r=YI(e[0][0],e[1][0]),i=YI(e[0][1],e[1][1]);return{x:t,y:n,width:r-t,height:i-n}}function ML(e,t,n){if(!(!e._brushType||zL(e,t.offsetX,t.offsetY))){var r=e._zr,i=e._covers,a=fL(e,t,n);if(!e._dragging)for(var o=0;or.getWidth()||n<0||n>r.getHeight()}var BL={lineX:VL(0),lineY:VL(1),rect:{createCover:function(e,t){function n(e){return e}return vL({toRectRange:n,fromRectRange:n},e,t,[[`w`],[`e`],[`n`],[`s`],[`s`,`e`],[`s`,`w`],[`n`,`e`],[`n`,`w`]])},getCreatingRange:function(e){var t=_L(e);return CL(t[1][0],t[1][1],t[0][0],t[0][1])},updateCoverShape:function(e,t,n,r){yL(e,t,n,r)},updateCommon:bL,contain:PL},polygon:{createCover:function(e,t){var n=new X;return n.add(new gd({name:`main`,style:SL(t),silent:!0})),n},getCreatingRange:function(e){return e},endCreating:function(e,t){t.remove(t.childAt(0)),t.add(new md({name:`main`,draggable:!0,drift:B(OL,e,t),ondragend:B(hL,e,{isEnd:!0})}))},updateCoverShape:function(e,t,n,r){t.childAt(0).setShape({points:AL(e,t,n)})},updateCommon:bL,contain:PL}};function VL(e){return{createCover:function(t,n){return vL({toRectRange:function(t){var n=[t,[0,100]];return e&&n.reverse(),n},fromRectRange:function(t){return t[e]}},t,n,[[[`w`],[`e`]],[[`n`],[`s`]]][e])},getCreatingRange:function(t){var n=_L(t);return[JI(n[0][e],n[1][e]),YI(n[0][e],n[1][e])]},updateCoverShape:function(t,n,r,i){var a,o=pL(t,n);if(o!==qI&&o.getLinearBrushOtherExtent)a=o.getLinearBrushOtherExtent(e);else{var s=t._zr;a=[0,[s.getWidth(),s.getHeight()][1-e]]}var c=[r,a];e&&c.reverse(),yL(t,n,c,i)},updateCommon:bL,contain:PL}}function HL(e){return e=GL(e),function(t){return vf(t,e)}}function UL(e,t){return e=GL(e),function(n){var r=t??n,i=r?e.width:e.height,a=r?e.x:e.y;return[a,a+(i||0)]}}function WL(e,t,n){var r=GL(e);return function(e,i){return r.contain(i[0],i[1])&&!zA(e,t,n)}}function GL(e){return Y.create(e)}var KL=[`axisLine`,`axisTickLabel`,`axisName`],qL=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n){e.prototype.init.apply(this,arguments),(this._brushController=new aL(n.getZr())).on(`brush`,z(this._onBrush,this))},t.prototype.render=function(e,t,n,r){if(!JL(e,t,r)){this.axisModel=e,this.api=n,this.group.removeAll();var i=this._axisGroup;if(this._axisGroup=new X,this.group.add(this._axisGroup),e.get(`show`)){var a=XL(e,t),o=a.coordinateSystem,s=e.getAreaSelectStyle(),c=s.width,l=e.axis.dim,u=o.getAxisLayout(l),d=j({strokeContainThreshold:c},u),f=new kk(e,d);F(KL,f.add,f),this._axisGroup.add(f.getGroup()),this._refreshBrushController(d,s,e,a,c,n),_f(i,this._axisGroup,e)}}},t.prototype._refreshBrushController=function(e,t,n,r,i,a){var o=n.axis.getExtent(),s=o[1]-o[0],c=Math.min(30,Math.abs(s)*.1),l=Y.create({x:o[0],y:-i/2,width:s,height:i});l.x-=c,l.width+=2*c,this._brushController.mount({enableGlobalPan:!0,rotation:e.rotation,x:e.position[0],y:e.position[1]}).setPanels([{panelId:`pl`,clipPath:HL(l),isTargetByCursor:WL(l,a,r),getLinearBrushOtherExtent:UL(l,0)}]).enableBrush({brushType:`lineX`,brushStyle:t,removeOnClick:!0}).updateCovers(YL(n))},t.prototype._onBrush=function(e){var t=e.areas,n=this.axisModel,r=n.axis,i=I(t,function(e){return[r.coordToData(e.range[0],!0),r.coordToData(e.range[1],!0)]});(!n.option.realtime===e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:`axisAreaSelect`,parallelAxisId:n.id,intervals:i})},t.prototype.dispose=function(){this._brushController.dispose()},t.type=`parallelAxis`,t}(U_);function JL(e,t,n){return n&&n.type===`axisAreaSelect`&&t.findComponents({mainType:`parallelAxis`,query:n})[0]===e}function YL(e){var t=e.axis;return I(e.activeIntervals,function(e){return{brushType:`lineX`,panelId:`pl`,range:[t.dataToCoord(e[0],!0),t.dataToCoord(e[1],!0)]}})}function XL(e,t){return t.getComponent(`parallel`,e.get(`parallelIndex`))}var ZL={type:`axisAreaSelect`,event:`axisAreaSelected`};function QL(e){e.registerAction(ZL,function(e,t){t.eachComponent({mainType:`parallelAxis`,query:e},function(t){t.axis.model.setActiveIntervals(e.intervals)})}),e.registerAction(`parallelAxisExpand`,function(e,t){t.eachComponent({mainType:`parallel`,query:e},function(t){t.setAxisExpand(e)})})}var $L={type:`value`,areaSelectStyle:{width:20,borderWidth:1,borderColor:`rgba(160,197,232)`,color:`rgba(160,197,232)`,opacity:.3},realtime:!0,z:10};function eR(e){e.registerComponentView(TI),e.registerComponentModel(OI),e.registerCoordinateSystem(`parallel`,GI),e.registerPreprocessor(xI),e.registerComponentModel(KI),e.registerComponentView(qL),dk(e,`parallel`,KI,$L),QL(e)}function tR(e){$(eR),e.registerChartView(lI),e.registerSeriesModel(gI),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,bI)}var nR=function(){function e(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.cpx2=0,this.cpy2=0,this.extent=0}return e}(),rR=function(e){r(t,e);function t(t){return e.call(this,t)||this}return t.prototype.getDefaultShape=function(){return new nR},t.prototype.buildPath=function(e,t){var n=t.extent;e.moveTo(t.x1,t.y1),e.bezierCurveTo(t.cpx1,t.cpy1,t.cpx2,t.cpy2,t.x2,t.y2),t.orient===`vertical`?(e.lineTo(t.x2+n,t.y2),e.bezierCurveTo(t.cpx2+n,t.cpy2,t.cpx1+n,t.cpy1,t.x1+n,t.y1)):(e.lineTo(t.x2,t.y2+n),e.bezierCurveTo(t.cpx2,t.cpy2+n,t.cpx1,t.cpy1+n,t.x1,t.y1+n)),e.closePath()},t.prototype.highlight=function(){Hl(this)},t.prototype.downplay=function(){Ul(this)},t}(Nc),iR=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._focusAdjacencyDisabled=!1,n}return t.prototype.render=function(e,t,n){var r=this,i=e.getGraph(),a=this.group,o=e.layoutInfo,s=o.width,c=o.height,l=e.getData(),u=e.getData(`edge`),d=e.get(`orient`);this._model=e,a.removeAll(),a.x=o.x,a.y=o.y,i.eachEdge(function(t){var n=new rR,r=Q(n);r.dataIndex=t.dataIndex,r.seriesIndex=e.seriesIndex,r.dataType=`edge`;var i=t.getModel(),o=i.getModel(`lineStyle`),l=o.get(`curveness`),f=t.node1.getLayout(),p=t.node1.getModel(),m=p.get(`localX`),h=p.get(`localY`),g=t.node2.getLayout(),_=t.node2.getModel(),v=_.get(`localX`),y=_.get(`localY`),b=t.getLayout(),x,S,C,w,T,E,D,O;n.shape.extent=Math.max(1,b.dy),n.shape.orient=d,d===`vertical`?(x=(m==null?f.x:m*s)+b.sy,S=(h==null?f.y:h*c)+f.dy,C=(v==null?g.x:v*s)+b.ty,w=y==null?g.y:y*c,T=x,E=S*(1-l)+w*l,D=C,O=S*l+w*(1-l)):(x=(m==null?f.x:m*s)+f.dx,S=(h==null?f.y:h*c)+b.sy,C=v==null?g.x:v*s,w=(y==null?g.y:y*c)+b.ty,T=x*(1-l)+C*l,E=S,D=x*l+C*(1-l),O=w),n.setShape({x1:x,y1:S,x2:C,y2:w,cpx1:T,cpy1:E,cpx2:D,cpy2:O}),n.useStyle(o.getItemStyle()),aR(n.style,d,t);var k=``+i.get(`value`),A=Mf(i,`edgeLabel`);jf(n,A,{labelFetcher:{getFormattedLabel:function(t,n,r,i,a,o){return e.getFormattedLabel(t,n,`edge`,i,he(a,A.normal&&A.normal.get(`formatter`),k),o)}},labelDataIndex:t.dataIndex,defaultText:k}),n.setTextConfig({position:`inside`});var j=i.getModel(`emphasis`);du(n,i,`lineStyle`,function(e){var n=e.getItemStyle();return aR(n,d,t),n}),a.add(n),u.setItemGraphicEl(t.dataIndex,n);var M=j.get(`focus`);su(n,M===`adjacency`?t.getAdjacentDataIndices():M===`trajectory`?t.getTrajectoryDataIndices():M,j.get(`blurScope`),j.get(`disabled`))}),i.eachNode(function(t){var n=t.getLayout(),r=t.getModel(),i=r.get(`localX`),o=r.get(`localY`),u=r.getModel(`emphasis`),d=r.get([`itemStyle`,`borderRadius`])||0,f=new qc({shape:{x:i==null?n.x:i*s,y:o==null?n.y:o*c,width:n.dx,height:n.dy,r:d},style:r.getModel(`itemStyle`).getItemStyle(),z2:10});jf(f,Mf(r),{labelFetcher:{getFormattedLabel:function(t,n){return e.getFormattedLabel(t,n,`node`)}},labelDataIndex:t.dataIndex,defaultText:t.id}),f.disableLabelAnimation=!0,f.setStyle(`fill`,t.getVisual(`color`)),f.setStyle(`decal`,t.getVisual(`style`).decal),du(f,r),a.add(f),l.setItemGraphicEl(t.dataIndex,f),Q(f).dataType=`node`;var p=u.get(`focus`);su(f,p===`adjacency`?t.getAdjacentDataIndices():p===`trajectory`?t.getTrajectoryDataIndices():p,u.get(`blurScope`),u.get(`disabled`))}),l.eachItemGraphicEl(function(t,i){l.getItemModel(i).get(`draggable`)&&(t.drift=function(t,a){r._focusAdjacencyDisabled=!0,this.shape.x+=t,this.shape.y+=a,this.dirty(),n.dispatchAction({type:`dragNode`,seriesId:e.id,dataIndex:l.getRawIndex(i),localX:this.shape.x/s,localY:this.shape.y/c})},t.ondragend=function(){r._focusAdjacencyDisabled=!1},t.draggable=!0,t.cursor=`move`)}),!this._data&&e.isAnimationEnabled()&&a.setClipPath(oR(a.getBoundingRect(),e,function(){a.removeClipPath()})),this._data=e.getData()},t.prototype.dispose=function(){},t.type=`sankey`,t}(q_);function aR(e,t,n){switch(e.fill){case`source`:e.fill=n.node1.getVisual(`color`),e.decal=n.node1.getVisual(`style`).decal;break;case`target`:e.fill=n.node2.getVisual(`color`),e.decal=n.node2.getVisual(`style`).decal;break;case`gradient`:var r=n.node1.getVisual(`color`),i=n.node2.getVisual(`color`);U(r)&&U(i)&&(e.fill=new Od(0,0,+(t===`horizontal`),+(t===`vertical`),[{color:r,offset:0},{color:i,offset:1}]))}}function oR(e,t,n){var r=new qc({shape:{x:e.x-10,y:e.y-10,width:0,height:e.height+20}});return Vd(r,{shape:{width:e.width+20}},t,n),r}var sR=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){var n=e.edges||e.links||[],r=e.data||e.nodes||[],i=e.levels||[];this.levelModels=[];for(var a=this.levelModels,o=0;o=0&&(a[i[o].depth]=new tp(i[o],this,t));return HF(r,n,this,!0,s).data;function s(e,t){e.wrapMethod(`getItemModel`,function(e,t){var n=e.parentModel,r=n.getData().getItemLayout(t);if(r){var i=r.depth,a=n.levelModels[i];a&&(e.parentModel=a)}return e}),t.wrapMethod(`getItemModel`,function(e,t){var n=e.parentModel,r=n.getGraph().getEdgeByIndex(t).node1.getLayout();if(r){var i=r.depth,a=n.levelModels[i];a&&(e.parentModel=a)}return e})}},t.prototype.setNodePosition=function(e,t){var n=(this.option.data||this.option.nodes)[e];n.localX=t[0],n.localY=t[1]},t.prototype.getGraph=function(){return this.getData().graph},t.prototype.getEdgeData=function(){return this.getGraph().edgeData},t.prototype.formatTooltip=function(e,t,n){function r(e){return isNaN(e)||e==null}if(n===`edge`){var i=this.getDataParams(e,n),a=i.data,o=i.value;return p_(`nameValue`,{name:a.source+` -- `+a.target,value:o,noValue:r(o)})}var s=this.getGraph().getNodeByIndex(e).getLayout().value,c=this.getDataParams(e,n).data.name;return p_(`nameValue`,{name:c==null?null:c+``,value:s,noValue:r(s)})},t.prototype.optionUpdated=function(){},t.prototype.getDataParams=function(t,n){var r=e.prototype.getDataParams.call(this,t,n);return r.value==null&&n===`node`&&(r.value=this.getGraph().getNodeByIndex(t).getLayout().value),r},t.type=`series.sankey`,t.defaultOption={z:2,coordinateSystem:`view`,left:`5%`,top:`5%`,right:`20%`,bottom:`5%`,orient:`horizontal`,nodeWidth:20,nodeGap:8,draggable:!0,layoutIterations:32,label:{show:!0,position:`right`,fontSize:12},edgeLabel:{show:!1,fontSize:12},levels:[],nodeAlign:`justify`,lineStyle:{color:`#314656`,opacity:.2,curveness:.5},emphasis:{label:{show:!0},lineStyle:{opacity:.5}},select:{itemStyle:{borderColor:`#212121`}},animationEasing:`linear`,animationDuration:1e3},t}(P_);function cR(e,t){e.eachSeriesByType(`sankey`,function(e){var n=e.get(`nodeWidth`),r=e.get(`nodeGap`),i=lR(e,t);e.layoutInfo=i;var a=i.width,o=i.height,s=e.getGraph(),c=s.nodes,l=s.edges;dR(c),uR(c,l,n,r,a,o,L(c,function(e){return e.getLayout().value===0}).length===0?e.get(`layoutIterations`):0,e.get(`orient`),e.get(`nodeAlign`))})}function lR(e,t){return mm(e.getBoxLayoutParams(),{width:t.getWidth(),height:t.getHeight()})}function uR(e,t,n,r,i,a,o,s,c){fR(e,t,n,i,a,s,c),_R(e,t,a,i,r,o,s),AR(e,s)}function dR(e){F(e,function(e){var t=OR(e.outEdges,DR),n=OR(e.inEdges,DR),r=e.getValue()||0,i=Math.max(t,n,r);e.setLayout({value:i},!0)})}function fR(e,t,n,r,i,a,o){for(var s=[],c=[],l=[],u=[],d=0,f=0;f=0;_&&g.depth>p&&(p=g.depth),h.setLayout({depth:_?g.depth:d},!0),a===`vertical`?h.setLayout({dy:n},!0):h.setLayout({dx:n},!0);for(var v=0;vd-1?p:d-1;o&&o!==`left`&&mR(e,o,a,C),gR(e,a===`vertical`?(i-n)/C:(r-n)/C,a)}function pR(e){var t=e.hostGraph.data.getRawDataItem(e.dataIndex);return t.depth!=null&&t.depth>=0}function mR(e,t,n,r){if(t===`right`){for(var i=[],a=e,o=0;a.length;){for(var s=0;s0;a--)c*=.99,xR(s,c,o),bR(s,i,n,r,o),kR(s,c,o),bR(s,i,n,r,o)}function vR(e,t){var n=[],r=t===`vertical`?`y`:`x`,i=Fo(e,function(e){return e.getLayout()[r]});return i.keys.sort(function(e,t){return e-t}),F(i.keys,function(e){n.push(i.buckets.get(e))}),n}function yR(e,t,n,r,i,a){var o=1/0;F(e,function(e){var t=e.length,s=0;F(e,function(e){s+=e.getLayout().value});var c=a===`vertical`?(r-(t-1)*i)/s:(n-(t-1)*i)/s;c0&&(o=s.getLayout()[a]+c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),l=s.getLayout()[a]+s.getLayout()[d]+t;var p=i===`vertical`?r:n;if(c=l-t-p,c>0){o=s.getLayout()[a]-c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0),l=o;for(var f=u-2;f>=0;--f)s=e[f],c=s.getLayout()[a]+s.getLayout()[d]+t-l,c>0&&(o=s.getLayout()[a]-c,i===`vertical`?s.setLayout({x:o},!0):s.setLayout({y:o},!0)),l=s.getLayout()[a]}})}function xR(e,t,n){F(e.slice().reverse(),function(e){F(e,function(e){if(e.outEdges.length){var r=OR(e.outEdges,SR,n)/OR(e.outEdges,DR);if(isNaN(r)){var i=e.outEdges.length;r=i?OR(e.outEdges,CR,n)/i:0}if(n===`vertical`){var a=e.getLayout().x+(r-ER(e,n))*t;e.setLayout({x:a},!0)}else{var o=e.getLayout().y+(r-ER(e,n))*t;e.setLayout({y:o},!0)}}})})}function SR(e,t){return ER(e.node2,t)*e.getValue()}function CR(e,t){return ER(e.node2,t)}function wR(e,t){return ER(e.node1,t)*e.getValue()}function TR(e,t){return ER(e.node1,t)}function ER(e,t){return t===`vertical`?e.getLayout().x+e.getLayout().dx/2:e.getLayout().y+e.getLayout().dy/2}function DR(e){return e.getValue()}function OR(e,t,n){for(var r=0,i=e.length,a=-1;++aa&&(a=t)}),F(n,function(t){var n=new VN({type:`color`,mappingMethod:`linear`,dataExtent:[i,a],visual:e.get(`color`)}).mapValueToVisual(t.getLayout().value),r=t.getModel().get([`itemStyle`,`color`]);r==null?(t.setVisual(`color`,n),t.setVisual(`style`,{fill:n})):(t.setVisual(`color`,r),t.setVisual(`style`,{fill:r}))})}r.length&&F(r,function(e){var t=e.getModel().get(`lineStyle`);e.setVisual(`style`,t)})})}function MR(e){e.registerChartView(iR),e.registerSeriesModel(sR),e.registerLayout(cR),e.registerVisual(jR),e.registerAction({type:`dragNode`,event:`dragnode`,update:`update`},function(e,t){t.eachComponent({mainType:`series`,subType:`sankey`,query:e},function(t){t.setNodePosition(e.dataIndex,[e.localX,e.localY])})})}var NR=function(){function e(){}return e.prototype._hasEncodeRule=function(e){var t=this.getEncode();return t&&t.get(e)!=null},e.prototype.getInitialData=function(e,t){var n,r=t.getComponent(`xAxis`,this.get(`xAxisIndex`)),i=t.getComponent(`yAxis`,this.get(`yAxisIndex`)),a=r.get(`type`),o=i.get(`type`),s;a===`category`?(e.layout=`horizontal`,n=r.getOrdinalMeta(),s=!this._hasEncodeRule(`x`)):o===`category`?(e.layout=`vertical`,n=i.getOrdinalMeta(),s=!this._hasEncodeRule(`y`)):e.layout=e.layout||`horizontal`;var c=[`x`,`y`],l=e.layout===`horizontal`?0:1,u=this._baseAxisDim=c[l],d=c[1-l],f=[r,i],p=f[l].get(`type`),m=f[1-l].get(`type`),h=e.data;if(h&&s){var g=[];F(h,function(e,t){var n;V(e)?(n=e.slice(),e.unshift(t)):V(e.value)?(n=j({},e),n.value=n.value.slice(),e.value.unshift(t)):n=e,g.push(n)}),e.data=g}var _=this.defaultValueDimensions,v=[{name:u,type:zx(p),ordinalMeta:n,otherDims:{tooltip:!1,itemName:0},dimsDef:[`base`]},{name:d,type:zx(m),dimsDef:_.slice()}];return KO(this,{coordDimensions:v,dimensionsCount:_.length+1,encodeDefaulter:B(Rm,v,this)})},e.prototype.getBaseAxis=function(){var e=this._baseAxisDim;return this.ecModel.getComponent(e+`Axis`,this.get(e+`AxisIndex`)).axis},e}(),PR=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.defaultValueDimensions=[{name:`min`,defaultTooltip:!0},{name:`Q1`,defaultTooltip:!0},{name:`median`,defaultTooltip:!0},{name:`Q3`,defaultTooltip:!0},{name:`max`,defaultTooltip:!0}],n.visualDrawType=`stroke`,n}return t.type=`series.boxplot`,t.dependencies=[`xAxis`,`yAxis`,`grid`],t.defaultOption={z:2,coordinateSystem:`cartesian2d`,legendHoverLink:!0,layout:null,boxWidth:[7,50],itemStyle:{color:`#fff`,borderWidth:1},emphasis:{scale:!0,itemStyle:{borderWidth:2,shadowBlur:5,shadowOffsetX:1,shadowOffsetY:1,shadowColor:`rgba(0,0,0,0.2)`}},animationDuration:800},t}(P_);P(PR,NR,!0);var FR=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this.group,a=this._data;this._data||i.removeAll();var o=+(e.get(`layout`)===`horizontal`);r.diff(a).add(function(e){if(r.hasValue(e)){var t=RR(r.getItemLayout(e),r,e,o,!0);r.setItemGraphicEl(e,t),i.add(t)}}).update(function(e,t){var n=a.getItemGraphicEl(t);if(!r.hasValue(e)){i.remove(n);return}var s=r.getItemLayout(e);n?(Kd(n),zR(s,n,r,e)):n=RR(s,r,e,o),i.add(n),r.setItemGraphicEl(e,n)}).remove(function(e){var t=a.getItemGraphicEl(e);t&&i.remove(t)}).execute(),this._data=r},t.prototype.remove=function(e){var t=this.group,n=this._data;this._data=null,n&&n.eachItemGraphicEl(function(e){e&&t.remove(e)})},t.type=`boxplot`,t}(q_),IR=function(){function e(){}return e}(),LR=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`boxplotBoxPath`,n}return t.prototype.getDefaultShape=function(){return new IR},t.prototype.buildPath=function(e,t){var n=t.points,r=0;for(e.moveTo(n[r][0],n[r][1]),r++;r<4;r++)e.lineTo(n[r][0],n[r][1]);for(e.closePath();rh){var b=[_,y];r.push(b)}}}return{boxData:n,outliers:r}}var qR={type:`echarts:boxplot`,transform:function(e){var t=e.upstream;t.sourceFormat!==`arrayRows`&&Qa(``);var n=KR(t.getRawData(),e.config);return[{dimensions:[`ItemName`,`Low`,`Q1`,`Q2`,`Q3`,`High`],data:n.boxData},{data:n.outliers}]}};function JR(e){e.registerSeriesModel(PR),e.registerChartView(FR),e.registerLayout(HR),e.registerTransform(qR)}var YR=[`itemStyle`,`borderColor`],XR=[`itemStyle`,`borderColor0`],ZR=[`itemStyle`,`borderColorDoji`],QR=[`itemStyle`,`color`],$R=[`itemStyle`,`color0`];function ez(e,t){return t.get(e>0?QR:$R)}function tz(e,t){return t.get(e===0?ZR:e>0?YR:XR)}var nz={seriesType:`candlestick`,plan:W_(),performRawSeries:!0,reset:function(e,t){if(!t.isSeriesFiltered(e))return!e.pipelineContext.large&&{progress:function(e,t){for(var n;(n=e.next())!=null;){var r=t.getItemModel(n),i=t.getItemLayout(n).sign,a=r.getItemStyle();a.fill=ez(i,r),a.stroke=tz(i,r)||a.fill,j(t.ensureUniqueItemVisual(n,`style`),a)}}}}},rz=[`color`,`borderColor`],iz=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){this.group.removeClipPath(),this._progressiveEls=null,this._updateDrawMode(e),this._isLargeDraw?this._renderLarge(e):this._renderNormal(e)},t.prototype.incrementalPrepareRender=function(e,t,n){this._clear(),this._updateDrawMode(e)},t.prototype.incrementalRender=function(e,t,n,r){this._progressiveEls=[],this._isLargeDraw?this._incrementalRenderLarge(e,t):this._incrementalRenderNormal(e,t)},t.prototype.eachRendered=function(e){Df(this._progressiveEls||this.group,e)},t.prototype._updateDrawMode=function(e){var t=e.pipelineContext.large;(this._isLargeDraw==null||t!==this._isLargeDraw)&&(this._isLargeDraw=t,this._clear())},t.prototype._renderNormal=function(e){var t=e.getData(),n=this._data,r=this.group,i=t.getLayout(`isSimpleBox`),a=e.get(`clip`,!0),o=e.coordinateSystem,s=o.getArea&&o.getArea();this._data||r.removeAll(),t.diff(n).add(function(n){if(t.hasValue(n)){var o=t.getItemLayout(n);if(a&&cz(s,o))return;var c=sz(o,n,!0);Vd(c,{shape:{points:o.ends}},e,n),lz(c,t,n,i),r.add(c),t.setItemGraphicEl(n,c)}}).update(function(o,c){var l=n.getItemGraphicEl(c);if(!t.hasValue(o)){r.remove(l);return}var u=t.getItemLayout(o);if(a&&cz(s,u)){r.remove(l);return}l?(Bd(l,{shape:{points:u.ends}},e,o),Kd(l)):l=sz(u,o),lz(l,t,o,i),r.add(l),t.setItemGraphicEl(o,l)}).remove(function(e){var t=n.getItemGraphicEl(e);t&&r.remove(t)}).execute(),this._data=t},t.prototype._renderLarge=function(e){this._clear(),pz(e,this.group);var t=e.get(`clip`,!0)?ED(e.coordinateSystem,!1,e):null;t?this.group.setClipPath(t):this.group.removeClipPath()},t.prototype._incrementalRenderNormal=function(e,t){for(var n=t.getData(),r=n.getLayout(`isSimpleBox`),i;(i=e.next())!=null;){var a=sz(n.getItemLayout(i),i);lz(a,n,i,r),a.incremental=!0,this.group.add(a),this._progressiveEls.push(a)}},t.prototype._incrementalRenderLarge=function(e,t){pz(t,this.group,this._progressiveEls,!0)},t.prototype.remove=function(e){this._clear()},t.prototype._clear=function(){this.group.removeAll(),this._data=null},t.type=`candlestick`,t}(q_),az=function(){function e(){}return e}(),oz=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n.type=`normalCandlestickBox`,n}return t.prototype.getDefaultShape=function(){return new az},t.prototype.buildPath=function(e,t){var n=t.points;this.__simpleBox?(e.moveTo(n[4][0],n[4][1]),e.lineTo(n[6][0],n[6][1])):(e.moveTo(n[0][0],n[0][1]),e.lineTo(n[1][0],n[1][1]),e.lineTo(n[2][0],n[2][1]),e.lineTo(n[3][0],n[3][1]),e.closePath(),e.moveTo(n[4][0],n[4][1]),e.lineTo(n[5][0],n[5][1]),e.moveTo(n[6][0],n[6][1]),e.lineTo(n[7][0],n[7][1]))},t}(Nc);function sz(e,t,n){var r=e.ends;return new oz({shape:{points:n?uz(r,e):r},z2:100})}function cz(e,t){for(var n=!0,r=0;rh?x[a]:b[a],ends:w,brushRect:O(g,_,p)})}function E(e,n){var r=[];return r[i]=n,r[a]=e,isNaN(n)||isNaN(e)?[NaN,NaN]:t.dataToPoint(r)}function D(e,t,n){var a=t.slice(),o=t.slice();a[i]=df(a[i]+r/2,1,!1),o[i]=df(o[i]-r/2,1,!0),n?e.push(a,o):e.push(o,a)}function O(e,t,n){var o=E(e,n),s=E(t,n);return o[i]-=r/2,s[i]-=r/2,{x:o[0],y:o[1],width:a?r:s[0]-o[0],height:a?s[1]-o[1]:r}}function k(e){return e[i]=df(e[i],1),e}}function m(n,r){for(var o=GS(n.count*4),c=0,p,m=[],h=[],g,_=r.getStore(),v=!!e.get([`itemStyle`,`borderColorDoji`]);(g=n.next())!=null;){var y=_.get(s,g),b=_.get(l,g),x=_.get(u,g),S=_.get(d,g),C=_.get(f,g);if(isNaN(y)||isNaN(S)||isNaN(C)){o[c++]=NaN,c+=3;continue}o[c++]=vz(_,g,b,x,u,v),m[i]=y,m[a]=S,p=t.dataToPoint(m,null,h),o[c++]=p?p[0]:NaN,o[c++]=p?p[1]:NaN,m[a]=C,p=t.dataToPoint(m,null,h),o[c++]=p?p[1]:NaN}r.setLayout(`largePoints`,o)}}};function vz(e,t,n,r,i,a){return n>r?-1:n0?e.get(i,t-1)<=r?1:-1:1}function yz(e,t){var n=e.getBaseAxis(),r,i=n.type===`category`?n.getBandWidth():(r=n.getExtent(),Math.abs(r[1]-r[0])/t.count()),a=Z(G(e.get(`barMaxWidth`),i),i),o=Z(G(e.get(`barMinWidth`),1),i),s=e.get(`barWidth`);return s==null?Math.max(Math.min(i/2,a),o):Z(s,i)}function bz(e){e.registerChartView(iz),e.registerSeriesModel(hz),e.registerPreprocessor(gz),e.registerVisual(nz),e.registerLayout(_z)}function xz(e,t){var n=t.rippleEffectColor||t.color;e.eachChild(function(e){e.attr({z:t.z,zlevel:t.zlevel,style:{stroke:t.brushType===`stroke`?n:null,fill:t.brushType===`fill`?n:null}})})}var Sz=function(e){r(t,e);function t(t,n){var r=e.call(this)||this,i=new aD(t,n),a=new X;return r.add(i),r.add(a),r.updateData(t,n),r}return t.prototype.stopEffectAnimation=function(){this.childAt(1).removeAll()},t.prototype.startEffectAnimation=function(e){for(var t=e.symbolType,n=e.color,r=e.rippleNumber,i=this.childAt(1),a=0;a0&&(a=this._getLineLength(r)/c*1e3),a!==this._period||o!==this._loop||s!==this._roundTrip){r.stopAnimation();var u=void 0;u=H(l)?l(n):l,r.__t>0&&(u=-a*r.__t),this._animateSymbol(r,a,u,o,s)}this._period=a,this._loop=o,this._roundTrip=s}},t.prototype._animateSymbol=function(e,t,n,r,i){if(t>0){e.__t=0;var a=this,o=e.animate(``,r).when(i?t*2:t,{__t:i?2:1}).delay(n).during(function(){a._updateSymbolPosition(e)});r||o.done(function(){a.remove(e)}),o.start()}},t.prototype._getLineLength=function(e){return We(e.__p1,e.__cp1)+We(e.__cp1,e.__p2)},t.prototype._updateAnimationPoints=function(e,t){e.__p1=t[0],e.__p2=t[1],e.__cp1=t[2]||[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]},t.prototype.updateData=function(e,t,n){this.childAt(0).updateData(e,t,n),this._updateEffectSymbol(e,t)},t.prototype._updateSymbolPosition=function(e){var t=e.__p1,n=e.__p2,r=e.__cp1,i=e.__t<1?e.__t:2-e.__t,a=[e.x,e.y],o=a.slice(),s=Rn,c=zn;a[0]=s(t[0],r[0],n[0],i),a[1]=s(t[1],r[1],n[1],i);var l=e.__t<1?c(t[0],r[0],n[0],i):c(n[0],r[0],t[0],1-i),u=e.__t<1?c(t[1],r[1],n[1],i):c(n[1],r[1],t[1],1-i);e.rotation=-Math.atan2(u,l)-Math.PI/2,(this._symbolType===`line`||this._symbolType===`rect`||this._symbolType===`roundRect`)&&(e.__lastT!==void 0&&e.__lastT=0&&!(r[o]<=t);o--);o=Math.min(o,i-2)}else{for(o=a;ot);o++);o=Math.min(o-1,i-2)}var s=(t-r[o])/(r[o+1]-r[o]),c=n[o],l=n[o+1];e.x=c[0]*(1-s)+s*l[0],e.y=c[1]*(1-s)+s*l[1];var u=e.__t<1?l[0]-c[0]:c[0]-l[0],d=e.__t<1?l[1]-c[1]:c[1]-l[1];e.rotation=-Math.atan2(d,u)-Math.PI/2,this._lastFrame=o,this._lastFramePercent=t,e.ignore=!1}},t}(Ez),kz=function(){function e(){this.polyline=!1,this.curveness=0,this.segs=[]}return e}(),Az=function(e){r(t,e);function t(t){var n=e.call(this,t)||this;return n._off=0,n.hoverDataIdx=-1,n}return t.prototype.reset=function(){this.notClear=!1,this._off=0},t.prototype.getDefaultStyle=function(){return{stroke:`#000`,fill:null}},t.prototype.getDefaultShape=function(){return new kz},t.prototype.buildPath=function(e,t){var n=t.segs,r=t.curveness,i;if(t.polyline)for(i=this._off;i0){e.moveTo(n[i++],n[i++]);for(var o=1;o0){var d=(s+l)/2-(c-u)*r,f=(c+u)/2-(l-s)*r;e.quadraticCurveTo(d,f,l,u)}else e.lineTo(l,u)}this.incremental&&(this._off=i,this.notClear=!0)},t.prototype.findDataIndex=function(e,t){var n=this.shape,r=n.segs,i=n.curveness,a=this.style.lineWidth;if(n.polyline)for(var o=0,s=0;s0)for(var l=r[s++],u=r[s++],d=1;d0){if(dc(l,u,(l+f)/2-(u-p)*i,(u+p)/2-(f-l)*i,f,p,a,e,t))return o}else if(lc(l,u,f,p,a,e,t))return o;o++}return-1},t.prototype.contain=function(e,t){var n=this.transformCoordToLocal(e,t),r=this.getBoundingRect();return e=n[0],t=n[1],r.contain(e,t)?(this.hoverDataIdx=this.findDataIndex(e,t))>=0:(this.hoverDataIdx=-1,!1)},t.prototype.getBoundingRect=function(){var e=this._rect;if(!e){for(var t=this.shape.segs,n=1/0,r=1/0,i=-1/0,a=-1/0,o=0;o0&&(a.dataIndex=n+e.__startIndex)})},e.prototype._clear=function(){this._newAdded=[],this.group.removeAll()},e}(),Mz={seriesType:`lines`,plan:W_(),reset:function(e){var t=e.coordinateSystem;if(t){var n=e.get(`polyline`),r=e.pipelineContext.large;return{progress:function(i,a){var o=[];if(r){var s=void 0,c=i.end-i.start;if(n){for(var l=0,u=i.start;u0&&(c||s.configLayer(a,{motionBlur:!0,lastFrameAlpha:Math.max(Math.min(o/10+.9,1),0)})),i.updateData(r);var l=e.get(`clip`,!0)&&ED(e.coordinateSystem,!1,e);l?this.group.setClipPath(l):this.group.removeClipPath(),this._lastZlevel=a,this._finished=!0},t.prototype.incrementalPrepareRender=function(e,t,n){var r=e.getData();this._updateLineDraw(r,e).incrementalPrepareUpdate(r),this._clearLayer(n),this._finished=!1},t.prototype.incrementalRender=function(e,t,n){this._lineDraw.incrementalUpdate(e,t.getData()),this._finished=e.end===t.getData().count()},t.prototype.eachRendered=function(e){this._lineDraw&&this._lineDraw.eachRendered(e)},t.prototype.updateTransform=function(e,t,n){var r=e.getData(),i=e.pipelineContext;if(!this._finished||i.large||i.progressiveRender)return{update:!0};var a=Mz.reset(e,t,n);a.progress&&a.progress({start:0,end:r.count(),count:r.count()},r),this._lineDraw.updateLayout(),this._clearLayer(n)},t.prototype._updateLineDraw=function(e,t){var n=this._lineDraw,r=this._showEffect(t),i=!!t.get(`polyline`),a=t.pipelineContext.large;return(!n||r!==this._hasEffet||i!==this._isPolyline||a!==this._isLargeDraw)&&(n&&n.remove(),n=this._lineDraw=a?new jz:new SF(i?r?Oz:Dz:r?Ez:xF),this._hasEffet=r,this._isPolyline=i,this._isLargeDraw=a),this.group.add(n.group),n},t.prototype._showEffect=function(e){return!!e.get([`effect`,`show`])},t.prototype._clearLayer=function(e){var t=e.getZr();t.painter.getType()!==`svg`&&this._lastZlevel!=null&&t.painter.getLayer(this._lastZlevel).clear(!0)},t.prototype.remove=function(e,t){this._lineDraw&&this._lineDraw.remove(),this._lineDraw=null,this._clearLayer(t)},t.prototype.dispose=function(e,t){this.remove(e,t)},t.type=`lines`,t}(q_),Pz=typeof Uint32Array>`u`?Array:Uint32Array,Fz=typeof Float64Array>`u`?Array:Float64Array;function Iz(e){var t=e.data;t&&t[0]&&t[0][0]&&t[0][0].coord&&(e.data=I(t,function(e){var t={coords:[e[0].coord,e[1].coord]};return e[0].name&&(t.fromName=e[0].name),e[1].name&&(t.toName=e[1].name),A([t,e[0],e[1]])}))}var Lz=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.visualStyleAccessPath=`lineStyle`,n.visualDrawType=`stroke`,n}return t.prototype.init=function(t){t.data=t.data||[],Iz(t);var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count)),e.prototype.init.apply(this,arguments)},t.prototype.mergeOption=function(t){if(Iz(t),t.data){var n=this._processFlatCoordsArray(t.data);this._flatCoords=n.flatCoords,this._flatCoordsOffset=n.flatCoordsOffset,n.flatCoords&&(t.data=new Float32Array(n.count))}e.prototype.mergeOption.apply(this,arguments)},t.prototype.appendData=function(e){var t=this._processFlatCoordsArray(e.data);t.flatCoords&&(this._flatCoords?(this._flatCoords=De(this._flatCoords,t.flatCoords),this._flatCoordsOffset=De(this._flatCoordsOffset,t.flatCoordsOffset)):(this._flatCoords=t.flatCoords,this._flatCoordsOffset=t.flatCoordsOffset),e.data=new Float32Array(t.count)),this.getRawData().appendData(e.data)},t.prototype._getCoordsFromItemModel=function(e){var t=this.getData().getItemModel(e);return t.option instanceof Array?t.option:t.getShallow(`coords`)},t.prototype.getLineCoordsCount=function(e){return this._flatCoordsOffset?this._flatCoordsOffset[e*2+1]:this._getCoordsFromItemModel(e).length},t.prototype.getLineCoords=function(e,t){if(this._flatCoordsOffset){for(var n=this._flatCoordsOffset[e*2],r=this._flatCoordsOffset[e*2+1],i=0;i `)})},t.prototype.preventIncremental=function(){return!!this.get([`effect`,`show`])},t.prototype.getProgressive=function(){return this.option.progressive??(this.option.large?1e4:this.get(`progressive`))},t.prototype.getProgressiveThreshold=function(){return this.option.progressiveThreshold??(this.option.large?2e4:this.get(`progressiveThreshold`))},t.prototype.getZLevelKey=function(){var e=this.getModel(`effect`),t=e.get(`trailLength`);return this.getData().count()>this.getProgressiveThreshold()?this.id:e.get(`show`)&&t>0?t+``:``},t.type=`series.lines`,t.dependencies=[`grid`,`polar`,`geo`,`calendar`],t.defaultOption={coordinateSystem:`geo`,z:2,legendHoverLink:!0,xAxisIndex:0,yAxisIndex:0,symbol:[`none`,`none`],symbolSize:[10,10],geoIndex:0,effect:{show:!1,period:4,constantSpeed:0,symbol:`circle`,symbolSize:3,loop:!0,trailLength:.2},large:!1,largeThreshold:2e3,polyline:!1,clip:!0,label:{show:!1,position:`end`},lineStyle:{opacity:.5}},t}(P_);function Rz(e){return e instanceof Array||(e=[e,e]),e}var zz={seriesType:`lines`,reset:function(e){var t=Rz(e.get(`symbol`)),n=Rz(e.get(`symbolSize`)),r=e.getData();r.setVisual(`fromSymbol`,t&&t[0]),r.setVisual(`toSymbol`,t&&t[1]),r.setVisual(`fromSymbolSize`,n&&n[0]),r.setVisual(`toSymbolSize`,n&&n[1]);function i(e,t){var n=e.getItemModel(t),r=Rz(n.getShallow(`symbol`,!0)),i=Rz(n.getShallow(`symbolSize`,!0));r[0]&&e.setItemVisual(t,`fromSymbol`,r[0]),r[1]&&e.setItemVisual(t,`toSymbol`,r[1]),i[0]&&e.setItemVisual(t,`fromSymbolSize`,i[0]),i[1]&&e.setItemVisual(t,`toSymbolSize`,i[1])}return{dataEach:r.hasItemOption?i:null}}};function Bz(e){e.registerChartView(Nz),e.registerSeriesModel(Lz),e.registerLayout(Mz),e.registerVisual(zz)}var Vz=256,Hz=function(){function e(){this.blurSize=30,this.pointSize=20,this.maxOpacity=1,this.minOpacity=0,this._gradientPixels={inRange:null,outOfRange:null};var e=p.createCanvas();this.canvas=e}return e.prototype.update=function(e,t,n,r,i,a){var o=this._getBrush(),s=this._getGradient(i,`inRange`),c=this._getGradient(i,`outOfRange`),l=this.pointSize+this.blurSize,u=this.canvas,d=u.getContext(`2d`),f=e.length;u.width=t,u.height=n;for(var p=0;p0){var E=a(v)?s:c;v>0&&(v=v*w+C),b[x++]=E[T],b[x++]=E[T+1],b[x++]=E[T+2],b[x++]=E[T+3]*v*256}else x+=4}return d.putImageData(y,0,0),u},e.prototype._getBrush=function(){var e=this._brushCanvas||=p.createCanvas(),t=this.pointSize+this.blurSize,n=t*2;e.width=n,e.height=n;var r=e.getContext(`2d`);return r.clearRect(0,0,n,n),r.shadowOffsetX=n,r.shadowBlur=this.blurSize,r.shadowColor=`#000`,r.beginPath(),r.arc(-t,t,this.pointSize,0,Math.PI*2,!0),r.closePath(),r.fill(),e},e.prototype._getGradient=function(e,t){for(var n=this._gradientPixels,r=n[t]||(n[t]=new Uint8ClampedArray(1024)),i=[0,0,0,0],a=0,o=0;o<256;o++)e[t](o/255,!0,i),r[a++]=i[0],r[a++]=i[1],r[a++]=i[2],r[a++]=i[3];return r},e}();function Uz(e,t,n){var r=e[1]-e[0];t=I(t,function(t){return{interval:[(t.interval[0]-e[0])/r,(t.interval[1]-e[0])/r]}});var i=t.length,a=0;return function(e){var r;for(r=a;r=0;r--){var o=t[r].interval;if(o[0]<=e&&e<=o[1]){a=r;break}}return r>=0&&r=t[0]&&e<=t[1]}}function Gz(e){var t=e.dimensions;return t[0]===`lng`&&t[1]===`lat`}var Kz=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r;t.eachComponent(`visualMap`,function(t){t.eachTargetSeries(function(n){n===e&&(r=t)})}),this._progressiveEls=null,this.group.removeAll();var i=e.coordinateSystem;i.type===`cartesian2d`||i.type===`calendar`?this._renderOnCartesianAndCalendar(e,n,0,e.getData().count()):Gz(i)&&this._renderOnGeo(i,e,r,n)},t.prototype.incrementalPrepareRender=function(e,t,n){this.group.removeAll()},t.prototype.incrementalRender=function(e,t,n,r){var i=t.coordinateSystem;i&&(Gz(i)?this.render(t,n,r):(this._progressiveEls=[],this._renderOnCartesianAndCalendar(t,r,e.start,e.end,!0)))},t.prototype.eachRendered=function(e){Df(this._progressiveEls||this.group,e)},t.prototype._renderOnCartesianAndCalendar=function(e,t,n,r,i){var a=e.coordinateSystem,o=DD(a,`cartesian2d`),s,c,l,u;if(o){var d=a.getAxis(`x`),f=a.getAxis(`y`);s=d.getBandWidth()+.5,c=f.getBandWidth()+.5,l=d.scale.getExtent(),u=f.scale.getExtent()}for(var p=this.group,m=e.getData(),h=e.getModel([`emphasis`,`itemStyle`]).getItemStyle(),g=e.getModel([`blur`,`itemStyle`]).getItemStyle(),_=e.getModel([`select`,`itemStyle`]).getItemStyle(),v=e.get([`itemStyle`,`borderRadius`]),y=Mf(e),b=e.getModel(`emphasis`),x=b.get(`focus`),S=b.get(`blurScope`),C=b.get(`disabled`),w=o?[m.mapDimension(`x`),m.mapDimension(`y`),m.mapDimension(`value`)]:[m.mapDimension(`time`),m.mapDimension(`value`)],T=n;Tl[1]||ku[1])continue;var A=a.dataToPoint([O,k]);E=new qc({shape:{x:A[0]-s/2,y:A[1]-c/2,width:s,height:c},style:D})}else{if(isNaN(m.get(w[1],T)))continue;E=new qc({z2:1,shape:a.dataToRect([m.get(w[0],T)]).contentShape,style:D})}if(m.hasItemOption){var j=m.getItemModel(T),M=j.getModel(`emphasis`);h=M.getModel(`itemStyle`).getItemStyle(),g=j.getModel([`blur`,`itemStyle`]).getItemStyle(),_=j.getModel([`select`,`itemStyle`]).getItemStyle(),v=j.get([`itemStyle`,`borderRadius`]),x=M.get(`focus`),S=M.get(`blurScope`),C=M.get(`disabled`),y=Mf(j)}E.shape.r=v;var N=e.getRawValue(T),ee=`-`;N&&N[2]!=null&&(ee=N[2]+``),jf(E,y,{labelFetcher:e,labelDataIndex:T,defaultOpacity:D.opacity,defaultText:ee}),E.ensureState(`emphasis`).style=h,E.ensureState(`blur`).style=g,E.ensureState(`select`).style=_,su(E,x,S,C),E.incremental=i,i&&(E.states.emphasis.hoverLayer=!0),p.add(E),m.setItemGraphicEl(T,E),this._progressiveEls&&this._progressiveEls.push(E)}},t.prototype._renderOnGeo=function(e,t,n,r){var i=n.targetVisuals.inRange,a=n.targetVisuals.outOfRange,o=t.getData(),s=this._hmLayer||this._hmLayer||new Hz;s.blurSize=t.get(`blurSize`),s.pointSize=t.get(`pointSize`),s.minOpacity=t.get(`minOpacity`),s.maxOpacity=t.get(`maxOpacity`);var c=e.getViewRect().clone(),l=e.getRoamTransform();c.applyTransform(l);var u=Math.max(c.x,0),d=Math.max(c.y,0),f=Math.min(c.width+c.x,r.getWidth()),p=Math.min(c.height+c.y,r.getHeight()),m=f-u,h=p-d,g=[o.mapDimension(`lng`),o.mapDimension(`lat`),o.mapDimension(`value`)],_=o.mapArray(g,function(t,n,r){var i=e.dataToPoint([t,n]);return i[0]-=u,i[1]-=d,i.push(r),i}),v=n.getExtent(),y=n.type===`visualMap.continuous`?Wz(v,n.option.range):Uz(v,n.getPieceList(),n.option.selected);s.update(_,m,h,i.color.getNormalizer(),{inRange:i.color.getColorMapper(),outOfRange:a.color.getColorMapper()},y);var b=new zc({style:{width:m,height:h,x:u,y:d,image:s.canvas},silent:!0});this.group.add(b)},t.type=`heatmap`,t}(q_),qz=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.getInitialData=function(e,t){return wS(null,this,{generateCoord:`value`})},t.prototype.preventIncremental=function(){var e=mh.get(this.get(`coordinateSystem`));if(e&&e.dimensions)return e.dimensions[0]===`lng`&&e.dimensions[1]===`lat`},t.type=`series.heatmap`,t.dependencies=[`grid`,`geo`,`calendar`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,geoIndex:0,blurSize:30,pointSize:20,maxOpacity:1,minOpacity:0,select:{itemStyle:{borderColor:`#212121`}}},t}(P_);function Jz(e){e.registerChartView(Kz),e.registerSeriesModel(qz)}var Yz=[`itemStyle`,`borderWidth`],Xz=[{xy:`x`,wh:`width`,index:0,posDesc:[`left`,`right`]},{xy:`y`,wh:`height`,index:1,posDesc:[`top`,`bottom`]}],Zz=new Uu,Qz=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=this.group,i=e.getData(),a=this._data,o=e.coordinateSystem,s=o.getBaseAxis().isHorizontal(),c=o.master.getRect(),l={ecSize:{width:n.getWidth(),height:n.getHeight()},seriesModel:e,coordSys:o,coordSysExtent:[[c.x,c.x+c.width],[c.y,c.y+c.height]],isHorizontal:s,valueDim:Xz[+s],categoryDim:Xz[1-s]};i.diff(a).add(function(e){if(i.hasValue(e)){var t=$z(i,e,uB(i,e),l),n=pB(i,l,t);i.setItemGraphicEl(e,n),r.add(n),yB(n,l,t)}}).update(function(e,t){var n=a.getItemGraphicEl(t);if(!i.hasValue(e)){r.remove(n);return}var o=$z(i,e,uB(i,e),l),s=gB(i,o);n&&s!==n.__pictorialShapeStr&&(r.remove(n),i.setItemGraphicEl(e,null),n=null),n?mB(n,l,o):n=pB(i,l,o,!0),i.setItemGraphicEl(e,n),n.__pictorialSymbolMeta=o,r.add(n),yB(n,l,o)}).remove(function(e){var t=a.getItemGraphicEl(e);t&&hB(a,e,t.__pictorialSymbolMeta.animationModel,t)}).execute();var u=e.get(`clip`,!0)?ED(e.coordinateSystem,!1,e):null;return u?r.setClipPath(u):r.removeClipPath(),this._data=i,this.group},t.prototype.remove=function(e,t){var n=this.group,r=this._data;e.get(`animation`)?r&&r.eachItemGraphicEl(function(t){hB(r,Q(t).dataIndex,e,t)}):n.removeAll()},t.type=`pictorialBar`,t}(q_);function $z(e,t,n,r){var i=e.getItemLayout(t),a=n.get(`symbolRepeat`),o=n.get(`symbolClip`),s=n.get(`symbolPosition`)||`start`,c=(n.get(`symbolRotate`)||0)*Math.PI/180||0,l=n.get(`symbolPatternSize`)||2,u=n.isAnimationEnabled(),d={dataIndex:t,layout:i,itemModel:n,symbolType:e.getItemVisual(t,`symbol`)||`circle`,style:e.getItemVisual(t,`style`),symbolClip:o,symbolRepeat:a,symbolRepeatDirection:n.get(`symbolRepeatDirection`),symbolPatternSize:l,rotation:c,animationModel:u?n:null,hoverScale:u&&n.get([`emphasis`,`scale`]),z2:n.getShallow(`z`,!0)||0};eB(n,a,i,r,d),nB(e,t,i,a,o,d.boundingLength,d.pxSign,l,r,d),rB(n,d.symbolScale,c,r,d);var f=d.symbolSize;return iB(n,f,i,a,o,sy(n.get(`symbolOffset`),f),s,d.valueLineWidth,d.boundingLength,d.repeatCutLength,r,d),d}function eB(e,t,n,r,i){var a=r.valueDim,o=e.get(`symbolBoundingData`),s=r.coordSys.getOtherAxis(r.coordSys.getBaseAxis()),c=s.toGlobalCoord(s.dataToCoord(0)),l=1-(n[a.wh]<=0),u;if(V(o)){var d=[tB(s,o[0])-c,tB(s,o[1])-c];d[1]=0?1:-1:u>0?1:-1}function tB(e,t){return e.toGlobalCoord(e.dataToCoord(e.scale.parse(t)))}function nB(e,t,n,r,i,a,o,s,c,l){var u=c.valueDim,d=c.categoryDim,f=Math.abs(n[d.wh]),p=e.getItemVisual(t,`symbolSize`),m=V(p)?p.slice():p==null?[`100%`,`100%`]:[p,p];m[d.index]=Z(m[d.index],f),m[u.index]=Z(m[u.index],r?f:Math.abs(a)),l.symbolSize=m;var h=l.symbolScale=[m[0]/s,m[1]/s];h[u.index]*=(c.isHorizontal?-1:1)*o}function rB(e,t,n,r,i){var a=e.get(Yz)||0;a&&(Zz.attr({scaleX:t[0],scaleY:t[1],rotation:n}),Zz.updateTransform(),a/=Zz.getLineScale(),a*=t[r.valueDim.index]),i.valueLineWidth=a||0}function iB(e,t,n,r,i,a,o,s,c,l,u,d){var f=u.categoryDim,p=u.valueDim,m=d.pxSign,h=Math.max(t[p.index]+s,0),g=h;if(r){var _=Math.abs(c),v=me(e.get(`symbolMargin`),`15%`)+``,y=!1;v.lastIndexOf(`!`)===v.length-1&&(y=!0,v=v.slice(0,v.length-1));var b=Z(v,t[p.index]),x=Math.max(h+b*2,0),S=y?0:b*2,C=Ja(r),w=C?r:bB((_+S)/x);b=(_-w*h)/2/(y?w:Math.max(w-1,1)),x=h+b*2,S=y?0:b*2,!C&&r!==`fixed`&&(w=l?bB((Math.abs(l)+S)/x):0),g=w*x-S,d.repeatTimes=w,d.symbolMargin=b}var T=g/2*m,E=d.pathPosition=[];E[f.index]=n[f.wh]/2,E[p.index]=o===`start`?T:o===`end`?c-T:c/2,a&&(E[0]+=a[0],E[1]+=a[1]);var D=d.bundlePosition=[];D[f.index]=n[f.xy],D[p.index]=n[p.xy];var O=d.barRectShape=j({},n);O[p.wh]=m*Math.max(Math.abs(n[p.wh]),Math.abs(E[p.index]+T)),O[f.wh]=n[f.wh];var k=d.clipShape={};k[f.xy]=-n[f.xy],k[f.wh]=u.ecSize[f.wh],k[p.xy]=0,k[p.wh]=n[p.wh]}function aB(e){var t=e.symbolPatternSize,n=ay(e.symbolType,-t/2,-t/2,t,t);return n.attr({culling:!0}),n.type!==`image`&&n.setStyle({strokeNoScale:!0}),n}function oB(e,t,n,r){var i=e.__pictorialBundle,a=n.symbolSize,o=n.valueLineWidth,s=n.pathPosition,c=t.valueDim,l=n.repeatTimes||0,u=0,d=a[t.valueDim.index]+o+n.symbolMargin*2;for(_B(e,function(e){e.__pictorialAnimationIndex=u,e.__pictorialRepeatTimes=l,u0:r<0)&&(i=l-1-e),t[c.index]=d*(i-l/2+.5)+s[c.index],{x:t[0],y:t[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation}}}function sB(e,t,n,r){var i=e.__pictorialBundle,a=e.__pictorialMainPath;a?vB(a,null,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:n.symbolScale[0],scaleY:n.symbolScale[1],rotation:n.rotation},n,r):(a=e.__pictorialMainPath=aB(n),i.add(a),vB(a,{x:n.pathPosition[0],y:n.pathPosition[1],scaleX:0,scaleY:0,rotation:n.rotation},{scaleX:n.symbolScale[0],scaleY:n.symbolScale[1]},n,r))}function cB(e,t,n){var r=j({},t.barRectShape),i=e.__pictorialBarRect;i?vB(i,null,{shape:r},t,n):(i=e.__pictorialBarRect=new qc({z2:2,shape:r,silent:!0,style:{stroke:`transparent`,fill:`transparent`,lineWidth:0}}),i.disableMorphing=!0,e.add(i))}function lB(e,t,n,r){if(n.symbolClip){var i=e.__pictorialClipPath,a=j({},n.clipShape),o=t.valueDim,s=n.animationModel,c=n.dataIndex;if(i)Bd(i,{shape:a},s,c);else{a[o.wh]=0,i=new qc({shape:a}),e.__pictorialBundle.setClipPath(i),e.__pictorialClipPath=i;var l={};l[o.wh]=n.clipShape[o.wh],Jd[r?`updateProps`:`initProps`](i,{shape:l},s,c)}}}function uB(e,t){var n=e.getItemModel(t);return n.getAnimationDelayParams=dB,n.isAnimationEnabled=fB,n}function dB(e){return{index:e.__pictorialAnimationIndex,count:e.__pictorialRepeatTimes}}function fB(){return this.parentModel.isAnimationEnabled()&&!!this.getShallow(`animation`)}function pB(e,t,n,r){var i=new X,a=new X;return i.add(a),i.__pictorialBundle=a,a.x=n.bundlePosition[0],a.y=n.bundlePosition[1],n.symbolRepeat?oB(i,t,n):sB(i,t,n),cB(i,n,r),lB(i,t,n,r),i.__pictorialShapeStr=gB(e,n),i.__pictorialSymbolMeta=n,i}function mB(e,t,n){var r=n.animationModel,i=n.dataIndex,a=e.__pictorialBundle;Bd(a,{x:n.bundlePosition[0],y:n.bundlePosition[1]},r,i),n.symbolRepeat?oB(e,t,n,!0):sB(e,t,n,!0),cB(e,n,!0),lB(e,t,n,!0)}function hB(e,t,n,r){var i=r.__pictorialBarRect;i&&i.removeTextContent();var a=[];_B(r,function(e){a.push(e)}),r.__pictorialMainPath&&a.push(r.__pictorialMainPath),r.__pictorialClipPath&&(n=null),F(a,function(e){Ud(e,{scaleX:0,scaleY:0},n,t,function(){r.parent&&r.parent.remove(r)})}),e.setItemGraphicEl(t,null)}function gB(e,t){return[e.getItemVisual(t.dataIndex,`symbol`)||`none`,!!t.symbolRepeat,!!t.symbolClip].join(`:`)}function _B(e,t,n){F(e.__pictorialBundle.children(),function(r){r!==e.__pictorialBarRect&&t.call(n,r)})}function vB(e,t,n,r,i,a){t&&e.attr(t),r.symbolClip&&!i?n&&e.attr(n):n&&Jd[i?`updateProps`:`initProps`](e,n,r.animationModel,r.dataIndex,a)}function yB(e,t,n){var r=n.dataIndex,i=n.itemModel,a=i.getModel(`emphasis`),o=a.getModel(`itemStyle`).getItemStyle(),s=i.getModel([`blur`,`itemStyle`]).getItemStyle(),c=i.getModel([`select`,`itemStyle`]).getItemStyle(),l=i.getShallow(`cursor`),u=a.get(`focus`),d=a.get(`blurScope`),f=a.get(`scale`);_B(e,function(e){if(e instanceof zc){var t=e.style;e.useStyle(j({image:t.image,x:t.x,y:t.y,width:t.width,height:t.height},n.style))}else e.useStyle(n.style);var r=e.ensureState(`emphasis`);r.style=o,f&&(r.scaleX=e.scaleX*1.1,r.scaleY=e.scaleY*1.1),e.ensureState(`blur`).style=s,e.ensureState(`select`).style=c,l&&(e.cursor=l),e.z2=n.z2});var p=t.valueDim.posDesc[+(n.boundingLength>0)],m=e.__pictorialBarRect;m.ignoreClip=!0,jf(m,Mf(i),{labelFetcher:t.seriesModel,labelDataIndex:r,defaultText:rD(t.seriesModel.getData(),r),inheritColor:n.style.fill,defaultOpacity:n.style.opacity,defaultOutsidePosition:p}),su(e,u,d,a.get(`disabled`))}function bB(e){var t=Math.round(e);return Math.abs(e-t)<1e-4?t:Math.ceil(e)}var xB=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.hasSymbolVisual=!0,n.defaultSymbol=`roundRect`,n}return t.prototype.getInitialData=function(t){return t.stack=null,e.prototype.getInitialData.apply(this,arguments)},t.type=`series.pictorialBar`,t.dependencies=[`grid`],t.defaultOption=op(ZD.defaultOption,{symbol:`circle`,symbolSize:null,symbolRotate:null,symbolPosition:null,symbolOffset:null,symbolMargin:null,symbolRepeat:!1,symbolRepeatDirection:`end`,symbolClip:!1,symbolBoundingData:null,symbolPatternSize:400,barGap:`-100%`,clip:!1,progressive:0,emphasis:{scale:!1},select:{itemStyle:{borderColor:`#212121`}}}),t}(ZD);function SB(e){e.registerChartView(Qz),e.registerSeriesModel(xB),e.registerLayout(e.PRIORITY.VISUAL.LAYOUT,B(tC,`pictorialBar`)),e.registerLayout(e.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,nC(`pictorialBar`))}var CB=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._layers=[],n}return t.prototype.render=function(e,t,n){var r=e.getData(),i=this,a=this.group,o=e.getLayerSeries(),s=r.getLayout(`layoutInfo`),c=s.rect,l=s.boundaryGap;a.x=0,a.y=c.y+l[0];function u(e){return e.name}var d=new Fx(this._layersSeries||[],o,u,u),f=[];d.add(z(p,this,`add`)).update(z(p,this,`update`)).remove(z(p,this,`remove`)).execute();function p(t,n,s){var c=i._layers;if(t===`remove`){a.remove(c[n]);return}for(var l=[],u=[],d,p=o[n].indices,m=0;ma&&(a=s),r.push(s)}for(var l=0;la&&(a=d)}return{y0:i,max:a}}function AB(e){e.registerChartView(CB),e.registerSeriesModel(EB),e.registerLayout(DB),e.registerProcessor(LO(`themeRiver`))}var jB=2,MB=4,NB=function(e){r(t,e);function t(t,n,r,i){var a=e.call(this)||this;a.z2=jB,a.textConfig={inside:!0},Q(a).seriesIndex=n.seriesIndex;var o=new Zc({z2:MB,silent:t.getModel().get([`label`,`silent`])});return a.setTextContent(o),a.updateData(!0,t,n,r,i),a}return t.prototype.updateData=function(e,t,n,r,i){this.node=t,t.piece=this,n||=this._seriesModel,r||=this._ecModel;var a=this;Q(a).dataIndex=t.dataIndex;var o=t.getModel(),s=o.getModel(`emphasis`),c=t.getLayout(),l=j({},c);l.label=null;var u=t.getVisual(`style`);u.lineJoin=`bevel`;var d=t.getVisual(`decal`);d&&(u.decal=Jy(d,i)),j(l,aO(o.getModel(`itemStyle`),l,!0)),F(gl,function(e){var t=a.ensureState(e),n=o.getModel([e,`itemStyle`]);t.style=n.getItemStyle();var r=aO(n,l);r&&(t.shape=r)}),e?(a.setShape(l),a.shape.r=c.r0,Vd(a,{shape:{r:c.r}},n,t.dataIndex)):(Bd(a,{shape:l},n),Kd(a)),a.useStyle(u),this._updateLabel(n);var f=o.getShallow(`cursor`);f&&a.attr(`cursor`,f),this._seriesModel=n||this._seriesModel,this._ecModel=r||this._ecModel;var p=s.get(`focus`),m=p===`relative`?De(t.getAncestorsIndices(),t.getDescendantIndices()):p===`ancestor`?t.getAncestorsIndices():p===`descendant`?t.getDescendantIndices():p;su(this,m,s.get(`blurScope`),s.get(`disabled`))},t.prototype._updateLabel=function(e){var t=this,n=this.node.getModel(),r=n.getModel(`label`),i=this.node.getLayout(),a=i.endAngle-i.startAngle,o=(i.startAngle+i.endAngle)/2,s=Math.cos(o),c=Math.sin(o),l=this,u=l.getTextContent(),d=this.node.dataIndex,f=r.get(`minAngle`)/180*Math.PI;u.ignore=!(r.get(`show`)&&!(f!=null&&Math.abs(a)T&&!za(D-T)&&D0?(i.virtualPiece?i.virtualPiece.updateData(!1,r,e,t,n):(i.virtualPiece=new NB(r,e,t,n),c.add(i.virtualPiece)),a.piece.off(`click`),i.virtualPiece.on(`click`,function(e){i._rootToNode(a.parentNode)})):i.virtualPiece&&=(c.remove(i.virtualPiece),null)}},t.prototype._initEvents=function(){var e=this;this.group.off(`click`),this.group.on(`click`,function(t){var n=!1;e.seriesModel.getViewRoot().eachNode(function(r){if(!n&&r.piece&&r.piece===t.target){var i=r.getModel().get(`nodeClick`);if(i===`rootToNode`)e._rootToNode(r);else if(i===`link`){var a=r.getModel(),o=a.get(`link`);o&&sm(o,a.get(`target`,!0)||`_blank`)}n=!0}})})},t.prototype._rootToNode=function(e){e!==this.seriesModel.getViewRoot()&&this.api.dispatchAction({type:PB,from:this.uid,seriesId:this.seriesModel.id,targetNode:e})},t.prototype.containPoint=function(e,t){var n=t.getData().getItemLayout(0);if(n){var r=e[0]-n.cx,i=e[1]-n.cy,a=Math.sqrt(r*r+i*i);return a<=n.r&&a>=n.r0}},t.type=`sunburst`,t}(q_),zB=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.ignoreStyleOnData=!0,n}return t.prototype.getInitialData=function(e,t){var n={name:e.name,children:e.data};BB(n);var r=this._levelModels=I(e.levels||[],function(e){return new tp(e,this,t)},this),i=YM.createTree(n,this,a);function a(e){e.wrapMethod(`getItemModel`,function(e,t){var n=r[i.getNodeByDataIndex(t).depth];return n&&(e.parentModel=n),e})}return i.data},t.prototype.optionUpdated=function(){this.resetViewRoot()},t.prototype.getDataParams=function(t){var n=e.prototype.getDataParams.apply(this,arguments);return n.treePathInfo=eN(this.getData().tree.getNodeByDataIndex(t),this),n},t.prototype.getLevelModel=function(e){return this._levelModels&&this._levelModels[e.depth]},t.prototype.getViewRoot=function(){return this._viewRoot},t.prototype.resetViewRoot=function(e){e?this._viewRoot=e:e=this._viewRoot;var t=this.getRawData().tree.root;(!e||e!==t&&!t.contains(e))&&(this._viewRoot=t)},t.prototype.enableAriaDecal=function(){dN(this)},t.type=`series.sunburst`,t.defaultOption={z:2,center:[`50%`,`50%`],radius:[0,`75%`],clockwise:!0,startAngle:90,minAngle:0,stillShowZeroSum:!0,nodeClick:`rootToNode`,renderLabelForZeroData:!1,label:{rotate:`radial`,show:!0,opacity:1,align:`center`,position:`inside`,distance:5,silent:!0},itemStyle:{borderWidth:1,borderColor:`white`,borderType:`solid`,shadowBlur:0,shadowColor:`rgba(0, 0, 0, 0.2)`,shadowOffsetX:0,shadowOffsetY:0,opacity:1},emphasis:{focus:`descendant`},blur:{itemStyle:{opacity:.2},label:{opacity:.1}},animationType:`expansion`,animationDuration:1e3,animationDurationUpdate:500,data:[],sort:`desc`},t}(P_);function BB(e){var t=0;F(e.children,function(e){BB(e);var n=e.value;V(n)&&(n=n[0]),t+=n});var n=e.value;V(n)&&(n=n[0]),(n==null||isNaN(n))&&(n=t),n<0&&(n=0),V(e.value)?e.value[0]=n:e.value=n}var VB=Math.PI/180;function HB(e,t,n){t.eachSeriesByType(e,function(e){var t=e.get(`center`),r=e.get(`radius`);V(r)||(r=[0,r]),V(t)||(t=[t,t]);var i=n.getWidth(),a=n.getHeight(),o=Math.min(i,a),s=Z(t[0],i),c=Z(t[1],a),l=Z(r[0],o/2),u=Z(r[1],o/2),d=-e.get(`startAngle`)*VB,f=e.get(`minAngle`)*VB,p=e.getData().tree.root,m=e.getViewRoot(),h=m.depth,g=e.get(`sort`);g!=null&&UB(m,g);var _=0;F(m.children,function(e){!isNaN(e.getValue())&&_++});var v=m.getValue(),y=Math.PI/(v||_)*2,b=m.depth>0,x=m.height-(b?-1:1),S=(u-l)/(x||1),C=e.get(`clockwise`),w=e.get(`stillShowZeroSum`),T=C?1:-1,E=function(t,n){if(t){var r=n;if(t!==p){var i=t.getValue(),a=v===0&&w?y:i*y;a1;)i=i.parentNode;var a=n.getColorFromPalette(i.name||i.dataIndex+``,t);return e.depth>1&&U(a)&&(a=pr(a,(e.depth-1)/(r-1)*.5)),a}e.eachSeriesByType(`sunburst`,function(e){var t=e.getData(),r=t.tree;r.eachNode(function(i){var a=i.getModel().getModel(`itemStyle`).getItemStyle();a.fill||=n(i,e,r.root.height),j(t.ensureUniqueItemVisual(i.dataIndex,`style`),a)})})}function KB(e){e.registerChartView(RB),e.registerSeriesModel(zB),e.registerLayout(B(HB,`sunburst`)),e.registerProcessor(B(LO,`sunburst`)),e.registerVisual(GB),LB(e)}var qB={color:`fill`,borderColor:`stroke`},JB={symbol:1,symbolSize:1,symbolKeepAspect:1,legendIcon:1,visualMeta:1,liftZ:1,decal:1},YB=To(),XB=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){this.currentZLevel=this.get(`zlevel`,!0),this.currentZ=this.get(`z`,!0)},t.prototype.getInitialData=function(e,t){return wS(null,this)},t.prototype.getDataParams=function(t,n,r){var i=e.prototype.getDataParams.call(this,t,n);return r&&(i.info=YB(r).info),i},t.type=`series.custom`,t.dependencies=[`grid`,`polar`,`geo`,`singleAxis`,`calendar`],t.defaultOption={coordinateSystem:`cartesian2d`,z:2,legendHoverLink:!0,clip:!1},t}(P_);function ZB(e,t){return t||=[0,0],I([`x`,`y`],function(n,r){var i=this.getAxis(n),a=t[r],o=e[r]/2;return i.type===`category`?i.getBandWidth():Math.abs(i.dataToCoord(a-o)-i.dataToCoord(a+o))},this)}function QB(e){var t=e.master.getRect();return{coordSys:{type:`cartesian2d`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:z(ZB,e)}}}function $B(e,t){return t||=[0,0],I([0,1],function(n){var r=t[n],i=e[n]/2,a=[],o=[];return a[n]=r-i,o[n]=r+i,a[1-n]=o[1-n]=t[1-n],Math.abs(this.dataToPoint(a)[n]-this.dataToPoint(o)[n])},this)}function eV(e){var t=e.getBoundingRect();return{coordSys:{type:`geo`,x:t.x,y:t.y,width:t.width,height:t.height,zoom:e.getZoom()},api:{coord:function(t){return e.dataToPoint(t)},size:z($B,e)}}}function tV(e,t){var n=this.getAxis(),r=t instanceof Array?t[0]:t,i=(e instanceof Array?e[0]:e)/2;return n.type===`category`?n.getBandWidth():Math.abs(n.dataToCoord(r-i)-n.dataToCoord(r+i))}function nV(e){var t=e.getRect();return{coordSys:{type:`singleAxis`,x:t.x,y:t.y,width:t.width,height:t.height},api:{coord:function(t){return e.dataToPoint(t)},size:z(tV,e)}}}function rV(e,t){return t||=[0,0],I([`Radius`,`Angle`],function(n,r){var i=`get`+n+`Axis`,a=this[i](),o=t[r],s=e[r]/2,c=a.type===`category`?a.getBandWidth():Math.abs(a.dataToCoord(o-s)-a.dataToCoord(o+s));return n===`Angle`&&(c=c*Math.PI/180),c},this)}function iV(e){var t=e.getRadiusAxis(),n=e.getAngleAxis(),r=t.getExtent();return r[0]>r[1]&&r.reverse(),{coordSys:{type:`polar`,cx:e.cx,cy:e.cy,r:r[1],r0:r[0]},api:{coord:function(r){var i=t.dataToRadius(r[0]),a=n.dataToAngle(r[1]),o=e.coordToPoint([i,a]);return o.push(i,a*Math.PI/180),o},size:z(rV,e)}}}function aV(e){var t=e.getRect(),n=e.getRangeInfo();return{coordSys:{type:`calendar`,x:t.x,y:t.y,width:t.width,height:t.height,cellWidth:e.getCellWidth(),cellHeight:e.getCellHeight(),rangeInfo:{start:n.start,end:n.end,weeks:n.weeks,dayCount:n.allDay}},api:{coord:function(t,n){return e.dataToPoint(t,n)}}}}function oV(e,t,n,r){return e&&(e.legacy||e.legacy!==!1&&!n&&!r&&t!==`tspan`&&(t===`text`||q(e,`text`)))}function sV(e,t,n){var r=e,i,a,o;if(t===`text`)o=r;else{o={},q(r,`text`)&&(o.text=r.text),q(r,`rich`)&&(o.rich=r.rich),q(r,`textFill`)&&(o.fill=r.textFill),q(r,`textStroke`)&&(o.stroke=r.textStroke),q(r,`fontFamily`)&&(o.fontFamily=r.fontFamily),q(r,`fontSize`)&&(o.fontSize=r.fontSize),q(r,`fontStyle`)&&(o.fontStyle=r.fontStyle),q(r,`fontWeight`)&&(o.fontWeight=r.fontWeight),a={type:`text`,style:o,silent:!0},i={};var s=q(r,`textPosition`);n?i.position=s?r.textPosition:`inside`:s&&(i.position=r.textPosition),q(r,`textPosition`)&&(i.position=r.textPosition),q(r,`textOffset`)&&(i.offset=r.textOffset),q(r,`textRotation`)&&(i.rotation=r.textRotation),q(r,`textDistance`)&&(i.distance=r.textDistance)}return cV(o,e),F(o.rich,function(e){cV(e,e)}),{textConfig:i,textContent:a}}function cV(e,t){t&&(t.font=t.textFont||t.font,q(t,`textStrokeWidth`)&&(e.lineWidth=t.textStrokeWidth),q(t,`textAlign`)&&(e.align=t.textAlign),q(t,`textVerticalAlign`)&&(e.verticalAlign=t.textVerticalAlign),q(t,`textLineHeight`)&&(e.lineHeight=t.textLineHeight),q(t,`textWidth`)&&(e.width=t.textWidth),q(t,`textHeight`)&&(e.height=t.textHeight),q(t,`textBackgroundColor`)&&(e.backgroundColor=t.textBackgroundColor),q(t,`textPadding`)&&(e.padding=t.textPadding),q(t,`textBorderColor`)&&(e.borderColor=t.textBorderColor),q(t,`textBorderWidth`)&&(e.borderWidth=t.textBorderWidth),q(t,`textBorderRadius`)&&(e.borderRadius=t.textBorderRadius),q(t,`textBoxShadowColor`)&&(e.shadowColor=t.textBoxShadowColor),q(t,`textBoxShadowBlur`)&&(e.shadowBlur=t.textBoxShadowBlur),q(t,`textBoxShadowOffsetX`)&&(e.shadowOffsetX=t.textBoxShadowOffsetX),q(t,`textBoxShadowOffsetY`)&&(e.shadowOffsetY=t.textBoxShadowOffsetY))}function lV(e,t,n){var r=e;r.textPosition=r.textPosition||n.position||`inside`,n.offset!=null&&(r.textOffset=n.offset),n.rotation!=null&&(r.textRotation=n.rotation),n.distance!=null&&(r.textDistance=n.distance);var i=r.textPosition.indexOf(`inside`)>=0,a=e.fill||`#000`;uV(r,t);var o=r.textFill==null;return i?o&&(r.textFill=n.insideFill||`#fff`,!r.textStroke&&n.insideStroke&&(r.textStroke=n.insideStroke),!r.textStroke&&(r.textStroke=a),r.textStrokeWidth??=2):(o&&(r.textFill=e.fill||n.outsideFill||`#000`),!r.textStroke&&n.outsideStroke&&(r.textStroke=n.outsideStroke)),r.text=t.text,r.rich=t.rich,F(t.rich,function(e){uV(e,e)}),r}function uV(e,t){t&&(q(t,`fill`)&&(e.textFill=t.fill),q(t,`stroke`)&&(e.textStroke=t.fill),q(t,`lineWidth`)&&(e.textStrokeWidth=t.lineWidth),q(t,`font`)&&(e.font=t.font),q(t,`fontStyle`)&&(e.fontStyle=t.fontStyle),q(t,`fontWeight`)&&(e.fontWeight=t.fontWeight),q(t,`fontSize`)&&(e.fontSize=t.fontSize),q(t,`fontFamily`)&&(e.fontFamily=t.fontFamily),q(t,`align`)&&(e.textAlign=t.align),q(t,`verticalAlign`)&&(e.textVerticalAlign=t.verticalAlign),q(t,`lineHeight`)&&(e.textLineHeight=t.lineHeight),q(t,`width`)&&(e.textWidth=t.width),q(t,`height`)&&(e.textHeight=t.height),q(t,`backgroundColor`)&&(e.textBackgroundColor=t.backgroundColor),q(t,`padding`)&&(e.textPadding=t.padding),q(t,`borderColor`)&&(e.textBorderColor=t.borderColor),q(t,`borderWidth`)&&(e.textBorderWidth=t.borderWidth),q(t,`borderRadius`)&&(e.textBorderRadius=t.borderRadius),q(t,`shadowColor`)&&(e.textBoxShadowColor=t.shadowColor),q(t,`shadowBlur`)&&(e.textBoxShadowBlur=t.shadowBlur),q(t,`shadowOffsetX`)&&(e.textBoxShadowOffsetX=t.shadowOffsetX),q(t,`shadowOffsetY`)&&(e.textBoxShadowOffsetY=t.shadowOffsetY),q(t,`textShadowColor`)&&(e.textShadowColor=t.textShadowColor),q(t,`textShadowBlur`)&&(e.textShadowBlur=t.textShadowBlur),q(t,`textShadowOffsetX`)&&(e.textShadowOffsetX=t.textShadowOffsetX),q(t,`textShadowOffsetY`)&&(e.textShadowOffsetY=t.textShadowOffsetY))}var dV={position:[`x`,`y`],scale:[`scaleX`,`scaleY`],origin:[`originX`,`originY`]},fV=R(dV);ne(qi,function(e,t){return e[t]=1,e},{}),qi.join(`, `);var pV=[``,`style`,`shape`,`extra`],mV=To();function hV(e,t,n,r,i){var a=e+`Animation`,o=Rd(e,r,i)||{},s=mV(t).userDuring;return o.duration>0&&(o.during=s?z(TV,{el:t,userDuring:s}):null,o.setToFinal=!0,o.scope=e),j(o,n[a]),o}function gV(e,t,n,r){r||={};var i=r.dataIndex,a=r.isInit,o=r.clearStyle,s=n.isAnimationEnabled(),c=mV(e),l=t.style;c.userDuring=t.during;var u={},d={};if(kV(e,t,d),DV(`shape`,t,d),DV(`extra`,t,d),!a&&s&&(OV(e,t,u),EV(`shape`,e,t,u),EV(`extra`,e,t,u),AV(e,t,l,u)),d.style=l,bV(e,d,o),SV(e,t),s){if(a){var f={};F(pV,function(e){var n=e?t[e]:t;n&&n.enterFrom&&(e&&(f[e]=f[e]||{}),j(e?f[e]:f,n.enterFrom))});var p=hV(`enter`,e,t,n,i);p.duration>0&&e.animateFrom(f,p)}else xV(e,t,i||0,n,u)}_V(e,t),l?e.dirty():e.markRedraw()}function _V(e,t){for(var n=mV(e).leaveToProps,r=0;r0&&e.animateFrom(i,a)}}function SV(e,t){q(t,`silent`)&&(e.silent=t.silent),q(t,`ignore`)&&(e.ignore=t.ignore),e instanceof Ts&&q(t,`invisible`)&&(e.invisible=t.invisible),e instanceof Nc&&q(t,`autoBatch`)&&(e.autoBatch=t.autoBatch)}var CV={},wV={setTransform:function(e,t){return CV.el[e]=t,this},getTransform:function(e){return CV.el[e]},setShape:function(e,t){var n=CV.el,r=n.shape||={};return r[e]=t,n.dirtyShape&&n.dirtyShape(),this},getShape:function(e){var t=CV.el.shape;if(t)return t[e]},setStyle:function(e,t){var n=CV.el,r=n.style;return r&&(r[e]=t,n.dirtyStyle&&n.dirtyStyle()),this},getStyle:function(e){var t=CV.el.style;if(t)return t[e]},setExtra:function(e,t){var n=CV.el.extra||(CV.el.extra={});return n[e]=t,this},getExtra:function(e){var t=CV.el.extra;if(t)return t[e]}};function TV(){var e=this,t=e.el;if(t){var n=mV(t).userDuring,r=e.userDuring;if(n!==r){e.el=e.userDuring=null;return}CV.el=t,r(wV)}}function EV(e,t,n,r){var i=n[e];if(i){var a=t[e],o;if(a){var s=n.transition,c=i.transition;if(c){if(!o&&(o=r[e]={}),yV(c))j(o,a);else for(var l=no(c),u=0;u=0){!o&&(o=r[e]={});for(var p=R(a),u=0;u=0)){var f=e.getAnimationStyleProps(),p=f?f.style:null;if(p){!a&&(a=r.style={});for(var m=R(n),l=0;l=0?t.getStore().get(i,n):void 0}var a=t.get(r.name,n),o=r&&r.ordinalMeta;return o?o.categories[a]:a}function S(n,r){r??=l;var i=t.getItemVisual(r,`style`),a=i&&i.fill,o=i&&i.opacity,s=v(r,LV).getItemStyle();a!=null&&(s.fill=a),o!=null&&(s.opacity=o);var c={inheritColor:U(a)?a:`#000`},u=y(r,LV),d=Nf(u,null,c,!1,!0);d.text=u.getShallow(`show`)?G(e.getFormattedLabel(r,LV),rD(t,r)):null;var f=Pf(u,c,!1);return T(n,s),s=lV(s,d,f),n&&w(s,n),s.legacy=!0,s}function C(n,r){r??=l;var i=v(r,IV).getItemStyle(),a=y(r,IV),o=Nf(a,null,null,!0,!0);o.text=a.getShallow(`show`)?he(e.getFormattedLabel(r,IV),e.getFormattedLabel(r,LV),rD(t,r)):null;var s=Pf(a,null,!0);return T(n,i),i=lV(i,o,s),n&&w(i,n),i.legacy=!0,i}function w(e,t){for(var n in t)q(t,n)&&(e[n]=t[n])}function T(e,t){e&&(e.textFill&&(t.textFill=e.textFill),e.textPosition&&(t.textPosition=e.textPosition))}function E(e,n){if(n??=l,q(qB,e)){var r=t.getItemVisual(n,`style`);return r?r[qB[e]]:null}if(q(JB,e))return t.getItemVisual(n,e)}function D(e){if(a.type===`cartesian2d`)return YS(M({axis:a.getBaseAxis()},e))}function O(){return n.getCurrentSeriesIndices()}function k(e){return Vf(e,n)}}function rH(e){var t={};return F(e.dimensions,function(n){var r=e.getDimensionInfo(n);if(!r.isExtraCoord){var i=r.coordDim,a=t[i]=t[i]||[];a[r.coordDimIndex]=e.getDimensionIndex(n)}}),t}function iH(e,t,n,r,i,a,o){if(!r){a.remove(t);return}var s=aH(e,t,n,r,i,a);return s&&o.setItemGraphicEl(n,s),s&&su(s,r.focus,r.blurScope,r.emphasisDisabled),s}function aH(e,t,n,r,i,a){var o=-1,s=t;t&&oH(t,r,i)&&(o=N(a.childrenRef(),t),t=null);var c=!t,l=t;l?l.clearStates():(l=ZV(r),s&&YV(s,l)),r.morph===!1?l.disableMorphing=!0:l.disableMorphing&&(l.disableMorphing=!1),GV.normal.cfg=GV.normal.conOpt=GV.emphasis.cfg=GV.emphasis.conOpt=GV.blur.cfg=GV.blur.conOpt=GV.select.cfg=GV.select.conOpt=null,GV.isLegacy=!1,cH(l,n,r,i,c,GV),sH(l,n,r,i,c),QV(e,l,n,r,GV,i,c),q(r,`info`)&&(YB(l).info=r.info);for(var u=0;u=0?a.replaceAt(l,o):a.add(l),l}function oH(e,t,n){var r=YB(e),i=t.type,a=t.shape,o=t.style;return n.isUniversalTransitionEnabled()||i!=null&&i!==r.customGraphicType||i===`path`&&yH(a)&&vH(a)!==r.customPathData||i===`image`&&q(o,`image`)&&o.image!==r.customImagePath}function sH(e,t,n,r,i){var a=n.clipPath;if(a===!1)e&&e.getClipPath()&&e.removeClipPath();else if(a){var o=e.getClipPath();o&&oH(o,a,r)&&(o=null),o||(o=ZV(a),e.setClipPath(o)),QV(null,o,t,a,null,r,i)}}function cH(e,t,n,r,i,a){if(!e.isGroup){lH(n,null,a),lH(n,IV,a);var o=a.normal.conOpt,s=a.emphasis.conOpt,c=a.blur.conOpt,l=a.select.conOpt;if(o!=null||s!=null||l!=null||c!=null){var u=e.getTextContent();if(o===!1)u&&e.removeTextContent();else{o=a.normal.conOpt=o||{type:`text`},u?u.clearStates():(u=ZV(o),e.setTextContent(u)),QV(null,u,t,o,null,r,i);for(var d=o&&o.style,f=0;f=u;p--)pH(t,t.childAt(p),i)}}function pH(e,t,n){t&&vV(t,YB(e).option,n)}function mH(e){new Fx(e.oldChildren,e.newChildren,hH,hH,e).add(gH).update(gH).remove(_H).execute()}function hH(e,t){return(e&&e.name)??WV+t}function gH(e,t){var n=this.context,r=e==null?null:n.newChildren[e],i=t==null?null:n.oldChildren[t];aH(n.api,i,n.dataIndex,r,n.seriesModel,n.group)}function _H(e){var t=this.context,n=t.oldChildren[e];n&&vV(n,YB(n).option,t.seriesModel)}function vH(e){return e&&(e.pathData||e.d)}function yH(e){return e&&(q(e,`pathData`)||q(e,`d`))}function bH(e){e.registerChartView(XV),e.registerSeriesModel(XB)}var xH=To(),SH=O,CH=z,wH=function(){function e(){this._dragging=!1,this.animationThreshold=15}return e.prototype.render=function(e,t,n,r){var i=t.get(`value`),a=t.get(`status`);if(this._axisModel=e,this._axisPointerModel=t,this._api=n,!(!r&&this._lastValue===i&&this._lastStatus===a)){this._lastValue=i,this._lastStatus=a;var o=this._group,s=this._handle;if(!a||a===`hide`){o&&o.hide(),s&&s.hide();return}o&&o.show(),s&&s.show();var c={};this.makeElOption(c,i,e,t,n);var l=c.graphicKey;l!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=l;var u=this._moveAnimation=this.determineAnimation(e,t);if(!o)o=this._group=new X,this.createPointerEl(o,c,e,t),this.createLabelEl(o,c,e,t),n.getZr().add(o);else{var d=B(TH,t,u);this.updatePointerEl(o,c,d),this.updateLabelEl(o,c,d,t)}kH(o,t,!0),this._renderHandle(i)}},e.prototype.remove=function(e){this.clear(e)},e.prototype.dispose=function(e){this.clear(e)},e.prototype.determineAnimation=function(e,t){var n=t.get(`animation`),r=e.axis,i=r.type===`category`,a=t.get(`snap`);if(!a&&!i)return!1;if(n===`auto`||n==null){var o=this.animationThreshold;if(i&&r.getBandWidth()>o)return!0;if(a){var s=qk(e).seriesDataCount,c=r.getExtent();return Math.abs(c[0]-c[1])/s>o}return!1}return n===!0},e.prototype.makeElOption=function(e,t,n,r,i){},e.prototype.createPointerEl=function(e,t,n,r){var i=t.pointer;if(i){var a=xH(e).pointerEl=new Jd[i.type](SH(t.pointer));e.add(a)}},e.prototype.createLabelEl=function(e,t,n,r){if(t.label){var i=xH(e).labelEl=new Zc(SH(t.label));e.add(i),DH(i,r)}},e.prototype.updatePointerEl=function(e,t,n){var r=xH(e).pointerEl;r&&t.pointer&&(r.setStyle(t.pointer.style),n(r,{shape:t.pointer.shape}))},e.prototype.updateLabelEl=function(e,t,n,r){var i=xH(e).labelEl;i&&(i.setStyle(t.label.style),n(i,{x:t.label.x,y:t.label.y}),DH(i,r))},e.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var t=this._axisPointerModel,n=this._api.getZr(),r=this._handle,i=t.getModel(`handle`),a=t.get(`status`);if(!i.get(`show`)||!a||a===`hide`){r&&n.remove(r),this._handle=null;return}var o;this._handle||(o=!0,r=this._handle=bf(i.get(`icon`),{cursor:`move`,draggable:!0,onmousemove:function(e){Ct(e.event)},onmousedown:CH(this._onHandleDragMove,this,0,0),drift:CH(this._onHandleDragMove,this),ondragend:CH(this._onHandleDragEnd,this)}),n.add(r)),kH(r,t,!1),r.setStyle(i.getItemStyle(null,[`color`,`borderColor`,`borderWidth`,`opacity`,`shadowColor`,`shadowBlur`,`shadowOffsetX`,`shadowOffsetY`]));var s=i.get(`size`);V(s)||(s=[s,s]),r.scaleX=s[0]/2,r.scaleY=s[1]/2,rv(this,`_doDispatchAxisPointer`,i.get(`throttle`)||0,`fixRate`),this._moveHandleToValue(e,o)}},e.prototype._moveHandleToValue=function(e,t){TH(this._axisPointerModel,!t&&this._moveAnimation,this._handle,OH(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},e.prototype._onHandleDragMove=function(e,t){var n=this._handle;if(n){this._dragging=!0;var r=this.updateHandleTransform(OH(n),[e,t],this._axisModel,this._axisPointerModel);this._payloadInfo=r,n.stopAnimation(),n.attr(OH(r)),xH(n).lastProp=null,this._doDispatchAxisPointer()}},e.prototype._doDispatchAxisPointer=function(){if(this._handle){var e=this._payloadInfo,t=this._axisModel;this._api.dispatchAction({type:`updateAxisPointer`,x:e.cursorPoint[0],y:e.cursorPoint[1],tooltipOption:e.tooltipOption,axesInfo:[{axisDim:t.axis.dim,axisIndex:t.componentIndex}]})}},e.prototype._onHandleDragEnd=function(){if(this._dragging=!1,this._handle){var e=this._axisPointerModel.get(`value`);this._moveHandleToValue(e),this._api.dispatchAction({type:`hideTip`})}},e.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var t=e.getZr(),n=this._group,r=this._handle;t&&n&&(this._lastGraphicKey=null,n&&t.remove(n),r&&t.remove(r),this._group=null,this._handle=null,this._payloadInfo=null),iv(this,`_doDispatchAxisPointer`)},e.prototype.doClear=function(){},e.prototype.buildLabel=function(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}},e}();function TH(e,t,n,r){EH(xH(n).lastProp,r)||(xH(n).lastProp=r,t?Bd(n,r,e):(n.stopAnimation(),n.attr(r)))}function EH(e,t){if(W(e)&&W(t)){var n=!0;return F(t,function(t,r){n&&=EH(e[r],t)}),!!n}return e===t}function DH(e,t){e[t.get([`label`,`show`])?`show`:`hide`]()}function OH(e){return{x:e.x||0,y:e.y||0,rotation:e.rotation||0}}function kH(e,t,n){var r=t.get(`z`),i=t.get(`zlevel`);e&&e.traverse(function(e){e.type!==`group`&&(r!=null&&(e.z=r),i!=null&&(e.zlevel=i),e.silent=n)})}function AH(e){var t=e.get(`type`),n=e.getModel(t+`Style`),r;return t===`line`?(r=n.getLineStyle(),r.fill=null):t===`shadow`&&(r=n.getAreaStyle(),r.stroke=null),r}function jH(e,t,n,r,i){var a=NH(n.get(`value`),t.axis,t.ecModel,n.get(`seriesDataIndices`),{precision:n.get([`label`,`precision`]),formatter:n.get([`label`,`formatter`])}),o=n.getModel(`label`),s=$p(o.get(`padding`)||0),c=o.getFont(),l=Qi(a,c),u=i.position,d=l.width+s[1]+s[3],f=l.height+s[0]+s[2],p=i.align;p===`right`&&(u[0]-=d),p===`center`&&(u[0]-=d/2);var m=i.verticalAlign;m===`bottom`&&(u[1]-=f),m===`middle`&&(u[1]-=f/2),MH(u,d,f,r);var h=o.get(`backgroundColor`);(!h||h===`auto`)&&(h=t.get([`axisLine`,`lineStyle`,`color`])),e.label={x:u[0],y:u[1],style:Nf(o,{text:a,font:c,fill:o.getTextColor(),padding:s,backgroundColor:h}),z2:10}}function MH(e,t,n,r){var i=r.getWidth(),a=r.getHeight();e[0]=Math.min(e[0]+t,i)-t,e[1]=Math.min(e[1]+n,a)-n,e[0]=Math.max(e[0],0),e[1]=Math.max(e[1],0)}function NH(e,t,n,r,i){e=t.scale.parse(e);var a=t.scale.getLabel({value:e},{precision:i.precision}),o=i.formatter;if(o){var s={value:RC(t,{value:e}),axisDimension:t.dim,axisIndex:t.index,seriesData:[]};F(r,function(e){var t=n.getSeriesByIndex(e.seriesIndex),r=e.dataIndexInside,i=t&&t.getDataParams(r);i&&s.seriesData.push(i)}),U(o)?a=o.replace(`{value}`,a):H(o)&&(a=o(s))}return a}function PH(e,t,n){var r=kt();return Pt(r,r,n.rotation),Nt(r,r,n.position),pf([e.dataToCoord(t),(n.labelOffset||0)+(n.labelDirection||1)*(n.labelMargin||0)],r)}function FH(e,t,n,r,i,a){var o=kk.innerTextLayout(n.rotation,0,n.labelDirection);n.labelMargin=i.get([`label`,`margin`]),jH(t,r,i,a,{position:PH(r.axis,e,n),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function IH(e,t,n){return n||=0,{x1:e[n],y1:e[1-n],x2:t[n],y2:t[1-n]}}function LH(e,t,n){return n||=0,{x:e[n],y:e[1-n],width:t[n],height:t[1-n]}}function RH(e,t,n,r,i,a){return{cx:e,cy:t,r0:n,r,startAngle:i,endAngle:a,clockwise:!0}}var zH=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.grid,s=r.get(`type`),c=BH(o,a).getOtherAxis(a).getGlobalExtent(),l=a.toGlobalCoord(a.dataToCoord(t,!0));if(s&&s!==`none`){var u=AH(r),d=VH[s](a,l,c);d.style=u,e.graphicKey=d.type,e.pointer=d}FH(t,e,vk(o.model,n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=vk(t.axis.grid.model,t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=PH(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.grid,o=i.getGlobalExtent(!0),s=BH(a,i).getOtherAxis(i).getGlobalExtent(),c=i.dim===`x`?0:1,l=[e.x,e.y];l[c]+=t[c],l[c]=Math.min(o[1],l[c]),l[c]=Math.max(o[0],l[c]);var u=(s[1]+s[0])/2,d=[u,u];return d[c]=l[c],{x:l[0],y:l[1],rotation:e.rotation,cursorPoint:d,tooltipOption:[{verticalAlign:`middle`},{align:`center`}][c]}},t}(wH);function BH(e,t){var n={};return n[t.dim+`AxisIndex`]=t.index,e.getCartesian(n)}var VH={line:function(e,t,n){return{type:`Line`,subPixelOptimize:!0,shape:IH([t,n[0]],[t,n[1]],HH(e))}},shadow:function(e,t,n){var r=Math.max(1,e.getBandWidth()),i=n[1]-n[0];return{type:`Rect`,shape:LH([t-r/2,n[0]],[r,i],HH(e))}}};function HH(e){return e.dim===`x`?0:1}var UH=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`axisPointer`,t.defaultOption={show:`auto`,z:50,type:`line`,snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:`#B9BEC9`,width:1,type:`dashed`},shadowStyle:{color:`rgba(210,219,238,0.2)`},label:{show:!0,formatter:null,precision:`auto`,margin:3,color:`#fff`,padding:[5,7,5,7],backgroundColor:`auto`,borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:`M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z`,size:45,margin:50,color:`#333`,shadowBlur:3,shadowColor:`#aaa`,shadowOffsetX:0,shadowOffsetY:2,throttle:40}},t}(Sm),WH=To(),GH=F;function KH(e,t,n){if(!a.node){var r=t.getZr();WH(r).records||(WH(r).records={}),qH(r,t);var i=WH(r).records[e]||(WH(r).records[e]={});i.handler=n}}function qH(e,t){if(WH(e).initialized)return;WH(e).initialized=!0,n(`click`,B(XH,`click`)),n(`mousemove`,B(XH,`mousemove`)),n(`globalout`,YH);function n(n,r){e.on(n,function(n){var i=ZH(t);GH(WH(e).records,function(e){e&&r(e,n,i.dispatchAction)}),JH(i.pendings,t)})}}function JH(e,t){var n=e.showTip.length,r=e.hideTip.length,i;n?i=e.showTip[n-1]:r&&(i=e.hideTip[r-1]),i&&(i.dispatchAction=null,t.dispatchAction(i))}function YH(e,t,n){e.handler(`leave`,null,n)}function XH(e,t,n,r){t.handler(e,n,r)}function ZH(e){var t={showTip:[],hideTip:[]},n=function(r){var i=t[r.type];i?i.push(r):(r.dispatchAction=n,e.dispatchAction(r))};return{dispatchAction:n,pendings:t}}function QH(e,t){if(!a.node){var n=t.getZr();(WH(n).records||{})[e]&&(WH(n).records[e]=null)}}var $H=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=t.getComponent(`tooltip`),i=e.get(`triggerOn`)||r&&r.get(`triggerOn`)||`mousemove|click`;KH(`axisPointer`,n,function(e,t,n){i!==`none`&&(e===`leave`||i.indexOf(e)>=0)&&n({type:`updateAxisPointer`,currTrigger:e,x:t&&t.offsetX,y:t&&t.offsetY})})},t.prototype.remove=function(e,t){QH(`axisPointer`,t)},t.prototype.dispose=function(e,t){QH(`axisPointer`,t)},t.type=`axisPointer`,t}(U_);function eU(e,t){var n=[],r=e.seriesIndex,i;if(r==null||!(i=t.getSeriesByIndex(r)))return{point:[]};var a=i.getData(),o=wo(a,e);if(o==null||o<0||V(o))return{point:[]};var s=a.getItemGraphicEl(o),c=i.coordinateSystem;if(i.getTooltipPosition)n=i.getTooltipPosition(o)||[];else if(c&&c.dataToPoint){if(e.isStacked){var l=c.getBaseAxis(),u=c.getOtherAxis(l).dim,d=l.dim,f=+(u===`x`||u===`radius`),p=a.mapDimension(d),m=[];m[f]=a.get(p,o),m[1-f]=a.get(a.getCalculationInfo(`stackResultDimension`),o),n=c.dataToPoint(m)||[]}else n=c.dataToPoint(a.getValues(I(c.dimensions,function(e){return a.mapDimension(e)}),o))||[]}else if(s){var h=s.getBoundingRect().clone();h.applyTransform(s.transform),n=[h.x+h.width/2,h.y+h.height/2]}return{point:n,el:s}}var tU=To();function nU(e,t,n){var r=e.currTrigger,i=[e.x,e.y],a=e,o=e.dispatchAction||z(n.dispatchAction,n),s=t.getComponent(`axisPointer`).coordSysAxesInfo;if(s){fU(i)&&(i=eU({seriesIndex:a.seriesIndex,dataIndex:a.dataIndex},t).point);var c=fU(i),l=a.axesInfo,u=s.axesInfo,d=r===`leave`||fU(i),f={},p={},m={list:[],map:{}},h={showPointer:B(aU,p),showTooltip:B(oU,m)};F(s.coordSysMap,function(e,t){var n=c||e.containPoint(i);F(s.coordSysAxesInfo[t],function(e,t){var r=e.axis,a=uU(l,e);if(!d&&n&&(!l||a)){var o=a&&a.value;o==null&&!c&&(o=r.pointToData(i)),o!=null&&rU(e,o,h,!1,f)}})});var g={};return F(u,function(e,t){var n=e.linkGroup;n&&!p[t]&&F(n.axesInfo,function(t,r){var i=p[r];if(t!==e&&i){var a=i.value;n.mapper&&(a=e.axis.scale.parse(n.mapper(a,dU(t),dU(e)))),g[e.key]=a}})}),F(g,function(e,t){rU(u[t],e,h,!0,f)}),sU(p,u,f),cU(m,i,e,o),lU(u,o,n),f}}function rU(e,t,n,r,i){var a=e.axis;if(!(a.scale.isBlank()||!a.containData(t))){if(!e.involveSeries){n.showPointer(e,t);return}var o=iU(t,e),s=o.payloadBatch,c=o.snapToValue;s[0]&&i.seriesIndex==null&&j(i,s[0]),!r&&e.snap&&a.containData(c)&&c!=null&&(t=c),n.showPointer(e,t,s),n.showTooltip(e,o,c)}}function iU(e,t){var n=t.axis,r=n.dim,i=e,a=[],o=Number.MAX_VALUE,s=-1;return F(t.seriesModels,function(t,c){var l=t.getData().mapDimensionsAll(r),u,d;if(t.getAxisTooltipData){var f=t.getAxisTooltipData(l,e,n);d=f.dataIndices,u=f.nestestValue}else{if(d=t.getData().indicesOfNearest(l[0],e,n.type===`category`?.5:null),!d.length)return;u=t.getData().get(l[0],d[0])}if(!(u==null||!isFinite(u))){var p=e-u,m=Math.abs(p);m<=o&&((m=0&&s<0)&&(o=m,s=p,i=u,a.length=0),F(d,function(e){a.push({seriesIndex:t.seriesIndex,dataIndexInside:e,dataIndex:t.getData().getRawIndex(e)})}))}}),{payloadBatch:a,snapToValue:i}}function aU(e,t,n,r){e[t.key]={value:n,payloadBatch:r}}function oU(e,t,n,r){var i=n.payloadBatch,a=t.axis,o=a.model,s=t.axisPointerModel;if(!(!t.triggerTooltip||!i.length)){var c=t.coordSys.model,l=Xk(c),u=e.map[l];u||(u=e.map[l]={coordSysId:c.id,coordSysIndex:c.componentIndex,coordSysType:c.type,coordSysMainType:c.mainType,dataByAxis:[]},e.list.push(u)),u.dataByAxis.push({axisDim:a.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:r,valueLabelOpt:{precision:s.get([`label`,`precision`]),formatter:s.get([`label`,`formatter`])},seriesDataIndices:i.slice()})}}function sU(e,t,n){var r=n.axesInfo=[];F(t,function(t,n){var i=t.axisPointerModel.option,a=e[n];a?(!t.useHandle&&(i.status=`show`),i.value=a.value,i.seriesDataIndices=(a.payloadBatch||[]).slice()):!t.useHandle&&(i.status=`hide`),i.status===`show`&&r.push({axisDim:t.axis.dim,axisIndex:t.axis.model.componentIndex,value:i.value})})}function cU(e,t,n,r){if(fU(t)||!e.list.length){r({type:`hideTip`});return}var i=((e.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};r({type:`showTip`,escapeConnect:!0,x:t[0],y:t[1],tooltipOption:n.tooltipOption,position:n.position,dataIndexInside:i.dataIndexInside,dataIndex:i.dataIndex,seriesIndex:i.seriesIndex,dataByCoordSys:e.list})}function lU(e,t,n){var r=n.getZr(),i=`axisPointerLastHighlights`,a=tU(r)[i]||{},o=tU(r)[i]={};F(e,function(e,t){var n=e.axisPointerModel.option;n.status===`show`&&e.triggerEmphasis&&F(n.seriesDataIndices,function(e){var t=e.seriesIndex+` | `+e.dataIndex;o[t]=e})});var s=[],c=[];F(a,function(e,t){!o[t]&&c.push(e)}),F(o,function(e,t){!a[t]&&s.push(e)}),c.length&&n.dispatchAction({type:`downplay`,escapeConnect:!0,notBlur:!0,batch:c}),s.length&&n.dispatchAction({type:`highlight`,escapeConnect:!0,notBlur:!0,batch:s})}function uU(e,t){for(var n=0;n<(e||[]).length;n++){var r=e[n];if(t.axis.dim===r.axisDim&&t.axis.model.componentIndex===r.axisIndex)return r}}function dU(e){var t=e.axis.model,n={},r=n.axisDim=e.axis.dim;return n.axisIndex=n[r+`AxisIndex`]=t.componentIndex,n.axisName=n[r+`AxisName`]=t.name,n.axisId=n[r+`AxisId`]=t.id,n}function fU(e){return!e||e[0]==null||isNaN(e[0])||e[1]==null||isNaN(e[1])}function pU(e){Qk.registerAxisPointerClass(`CartesianAxisPointer`,zH),e.registerComponentModel(UH),e.registerComponentView($H),e.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var t=e.axisPointer.link;t&&!V(t)&&(e.axisPointer.link=[t])}}),e.registerProcessor(e.PRIORITY.PROCESSOR.STATISTIC,function(e,t){e.getComponent(`axisPointer`).coordSysAxesInfo=Bk(e,t)}),e.registerAction({type:`updateAxisPointer`,event:`updateAxisPointer`,update:`:updateAxisPointer`},nU)}function mU(e){$(uA),$(pU)}var hU=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis;a.dim===`angle`&&(this.animationThreshold=Math.PI/18);var o=a.polar,s=o.getOtherAxis(a).getExtent(),c=a.dataToCoord(t),l=r.get(`type`);if(l&&l!==`none`){var u=AH(r),d=_U[l](a,o,c,s);d.style=u,e.graphicKey=d.type,e.pointer=d}jH(e,n,r,i,gU(t,n,r,o,r.get([`label`,`margin`])))},t}(wH);function gU(e,t,n,r,i){var a=t.axis,o=a.dataToCoord(e),s=r.getAngleAxis().getExtent()[0];s=s/180*Math.PI;var c=r.getRadiusAxis().getExtent(),l,u,d;if(a.dim===`radius`){var f=kt();Pt(f,f,s),Nt(f,f,[r.cx,r.cy]),l=pf([o,-i],f);var p=t.getModel(`axisLabel`).get(`rotate`)||0,m=kk.innerTextLayout(s,p*Math.PI/180,-1);u=m.textAlign,d=m.textVerticalAlign}else{var h=c[1];l=r.coordToPoint([h+i,o]);var g=r.cx,_=r.cy;u=Math.abs(l[0]-g)/h<.3?`center`:l[0]>g?`left`:`right`,d=Math.abs(l[1]-_)/h<.3?`middle`:l[1]>_?`top`:`bottom`}return{position:l,align:u,verticalAlign:d}}var _U={line:function(e,t,n,r){return e.dim===`angle`?{type:`Line`,shape:IH(t.coordToPoint([r[0],n]),t.coordToPoint([r[1],n]))}:{type:`Circle`,shape:{cx:t.cx,cy:t.cy,r:n}}},shadow:function(e,t,n,r){var i=Math.max(1,e.getBandWidth()),a=Math.PI/180;return e.dim===`angle`?{type:`Sector`,shape:RH(t.cx,t.cy,r[0],r[1],(-n-i/2)*a,(-n+i/2)*a)}:{type:`Sector`,shape:RH(t.cx,t.cy,n-i/2,n+i/2,0,Math.PI*2)}}},vU=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.findAxisModel=function(e){var t;return this.ecModel.eachComponent(e,function(e){e.getCoordSysModel()===this&&(t=e)},this),t},t.type=`polar`,t.dependencies=[`radiusAxis`,`angleAxis`],t.defaultOption={z:0,center:[`50%`,`50%`],radius:`80%`},t}(Sm),yU=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getCoordSysModel=function(){return this.getReferringComponents(`polar`,ko).models[0]},t.type=`polarAxis`,t}(Sm);P(yU,GC);var bU=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`angleAxis`,t}(yU),xU=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`radiusAxis`,t}(yU),SU=function(e){r(t,e);function t(t,n){return e.call(this,`radius`,t,n)||this}return t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)[this.dim===`radius`?0:1]},t}(Tw);SU.prototype.dataToRadius=Tw.prototype.dataToCoord,SU.prototype.radiusToData=Tw.prototype.coordToData;var CU=To(),wU=function(e){r(t,e);function t(t,n){return e.call(this,`angle`,t,n||[0,360])||this}return t.prototype.pointToData=function(e,t){return this.polar.pointToData(e,t)[this.dim===`radius`?0:1]},t.prototype.calculateCategoryInterval=function(){var e=this,t=e.getLabelModel(),n=e.scale,r=n.getExtent(),i=n.count();if(r[1]-r[0]<1)return 0;var a=r[0],o=e.dataToCoord(a+1)-e.dataToCoord(a),s=Math.abs(o),c=Qi(a==null?``:a+``,t.getFont(),`center`,`top`),l=Math.max(c.height,7)/s;isNaN(l)&&(l=1/0);var u=Math.max(0,Math.floor(l)),d=CU(e.model),f=d.lastAutoInterval,p=d.lastTickCount;return f!=null&&p!=null&&Math.abs(f-u)<=1&&Math.abs(p-i)<=1&&f>u?u=f:(d.lastTickCount=i,d.lastAutoInterval=u),u},t}(Tw);wU.prototype.dataToAngle=Tw.prototype.dataToCoord,wU.prototype.angleToData=Tw.prototype.coordToData;var TU=[`radius`,`angle`],EU=function(){function e(e){this.dimensions=TU,this.type=`polar`,this.cx=0,this.cy=0,this._radiusAxis=new SU,this._angleAxis=new wU,this.axisPointerEnabled=!0,this.name=e||``,this._radiusAxis.polar=this._angleAxis.polar=this}return e.prototype.containPoint=function(e){var t=this.pointToCoord(e);return this._radiusAxis.contain(t[0])&&this._angleAxis.contain(t[1])},e.prototype.containData=function(e){return this._radiusAxis.containData(e[0])&&this._angleAxis.containData(e[1])},e.prototype.getAxis=function(e){var t=`_`+e+`Axis`;return this[t]},e.prototype.getAxes=function(){return[this._radiusAxis,this._angleAxis]},e.prototype.getAxesByScale=function(e){var t=[],n=this._angleAxis,r=this._radiusAxis;return n.scale.type===e&&t.push(n),r.scale.type===e&&t.push(r),t},e.prototype.getAngleAxis=function(){return this._angleAxis},e.prototype.getRadiusAxis=function(){return this._radiusAxis},e.prototype.getOtherAxis=function(e){var t=this._angleAxis;return e===t?this._radiusAxis:t},e.prototype.getBaseAxis=function(){return this.getAxesByScale(`ordinal`)[0]||this.getAxesByScale(`time`)[0]||this.getAngleAxis()},e.prototype.getTooltipAxes=function(e){var t=e!=null&&e!==`auto`?this.getAxis(e):this.getBaseAxis();return{baseAxes:[t],otherAxes:[this.getOtherAxis(t)]}},e.prototype.dataToPoint=function(e,t){return this.coordToPoint([this._radiusAxis.dataToRadius(e[0],t),this._angleAxis.dataToAngle(e[1],t)])},e.prototype.pointToData=function(e,t){var n=this.pointToCoord(e);return[this._radiusAxis.radiusToData(n[0],t),this._angleAxis.angleToData(n[1],t)]},e.prototype.pointToCoord=function(e){var t=e[0]-this.cx,n=e[1]-this.cy,r=this.getAngleAxis(),i=r.getExtent(),a=Math.min(i[0],i[1]),o=Math.max(i[0],i[1]);r.inverse?a=o-360:o=a+360;var s=Math.sqrt(t*t+n*n);t/=s,n/=s;for(var c=Math.atan2(-n,t)/Math.PI*180,l=co;)c+=l*360;return[s,c]},e.prototype.coordToPoint=function(e){var t=e[0],n=e[1]/180*Math.PI;return[Math.cos(n)*t+this.cx,-Math.sin(n)*t+this.cy]},e.prototype.getArea=function(){var e=this.getAngleAxis(),t=this.getRadiusAxis().getExtent().slice();t[0]>t[1]&&t.reverse();var n=e.getExtent(),r=Math.PI/180,i=1e-4;return{cx:this.cx,cy:this.cy,r0:t[0],r:t[1],startAngle:-n[0]*r,endAngle:-n[1]*r,clockwise:e.inverse,contain:function(e,t){var n=e-this.cx,r=t-this.cy,a=n*n+r*r,o=this.r,s=this.r0;return o!==s&&a-i<=o*o&&a+i>=s*s}}},e.prototype.convertToPixel=function(e,t,n){return DU(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return DU(t)===this?this.pointToData(n):null},e}();function DU(e){var t=e.seriesModel,n=e.polarModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function OU(e,t,n){var r=t.get(`center`),i=n.getWidth(),a=n.getHeight();e.cx=Z(r[0],i),e.cy=Z(r[1],a);var o=e.getRadiusAxis(),s=Math.min(i,a)/2,c=t.get(`radius`);c==null?c=[0,`100%`]:V(c)||(c=[0,c]);var l=[Z(c[0],s),Z(c[1],s)];o.inverse?o.setExtent(l[1],l[0]):o.setExtent(l[0],l[1])}function kU(e,t){var n=this,r=n.getAngleAxis(),i=n.getRadiusAxis();if(r.scale.setExtent(1/0,-1/0),i.scale.setExtent(1/0,-1/0),e.eachSeries(function(e){if(e.coordinateSystem===n){var t=e.getData();F(UC(t,`radius`),function(e){i.scale.unionExtentFromData(t,e)}),F(UC(t,`angle`),function(e){r.scale.unionExtentFromData(t,e)})}}),PC(r.scale,r.model),PC(i.scale,i.model),r.type===`category`&&!r.onBand){var a=r.getExtent(),o=360/r.scale.count();r.inverse?a[1]+=o:a[1]-=o,r.setExtent(a[0],a[1])}}function AU(e){return e.mainType===`angleAxis`}function jU(e,t){if(e.type=t.get(`type`),e.scale=FC(t),e.onBand=t.get(`boundaryGap`)&&e.type===`category`,e.inverse=t.get(`inverse`),AU(t)){e.inverse=e.inverse!==t.get(`clockwise`);var n=t.get(`startAngle`),r=t.get(`endAngle`)??n+(e.inverse?-360:360);e.setExtent(n,r)}t.axis=e,e.model=t}var MU={dimensions:TU,create:function(e,t){var n=[];return e.eachComponent(`polar`,function(e,r){var i=new EU(r+``);i.update=kU;var a=i.getRadiusAxis(),o=i.getAngleAxis(),s=e.findAxisModel(`radiusAxis`),c=e.findAxisModel(`angleAxis`);jU(a,s),jU(o,c),OU(i,e,t),n.push(i),e.coordinateSystem=i,i.model=e}),e.eachSeries(function(e){e.get(`coordinateSystem`)===`polar`&&(e.coordinateSystem=e.getReferringComponents(`polar`,ko).models[0].coordinateSystem)}),n}},NU=[`axisLine`,`axisLabel`,`axisTick`,`minorTick`,`splitLine`,`minorSplitLine`,`splitArea`];function PU(e,t,n){t[1]>t[0]&&(t=t.slice().reverse());var r=e.coordToPoint([t[0],n]),i=e.coordToPoint([t[1],n]);return{x1:r[0],y1:r[1],x2:i[0],y2:i[1]}}function FU(e){return+!e.getRadiusAxis().inverse}function IU(e){var t=e[0],n=e[e.length-1];t&&n&&Math.abs(Math.abs(t.coord-n.coord)-360)<1e-4&&e.pop()}var LU=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.axisPointerClass=`PolarAxisPointer`,n}return t.prototype.render=function(e,t){if(this.group.removeAll(),e.get(`show`)){var n=e.axis,r=n.polar,i=r.getRadiusAxis().getExtent(),a=n.getTicksCoords(),o=n.getMinorTicksCoords(),s=I(n.getViewLabels(),function(e){e=O(e);var t=n.scale,r=t.type===`ordinal`?t.getRawOrdinalNumber(e.tickValue):e.tickValue;return e.coord=n.dataToCoord(r),e});IU(s),IU(a),F(NU,function(t){e.get([t,`show`])&&(!n.scale.isBlank()||t===`axisLine`)&&RU[t](this.group,e,r,a,o,i,s)},this)}},t.type=`angleAxis`,t}(Qk),RU={axisLine:function(e,t,n,r,i,a){var o=t.getModel([`axisLine`,`lineStyle`]),s=n.getAngleAxis(),c=Math.PI/180,l=s.getExtent(),u=FU(n),d=+!u,f,p=Math.abs(l[1]-l[0])===360?`Circle`:`Arc`;f=a[d]===0?new Jd[p]({shape:{cx:n.cx,cy:n.cy,r:a[u],startAngle:-l[0]*c,endAngle:-l[1]*c,clockwise:s.inverse},style:o.getLineStyle(),z2:1,silent:!0}):new ud({shape:{cx:n.cx,cy:n.cy,r:a[u],r0:a[d]},style:o.getLineStyle(),z2:1,silent:!0}),f.style.fill=null,e.add(f)},axisTick:function(e,t,n,r,i,a){var o=t.getModel(`axisTick`),s=(o.get(`inside`)?-1:1)*o.get(`length`),c=a[FU(n)],l=I(r,function(e){return new yd({shape:PU(n,[c,c+s],e.coord)})});e.add(sf(l,{style:M(o.getModel(`lineStyle`).getLineStyle(),{stroke:t.get([`axisLine`,`lineStyle`,`color`])})}))},minorTick:function(e,t,n,r,i,a){if(i.length){for(var o=t.getModel(`axisTick`),s=t.getModel(`minorTick`),c=(o.get(`inside`)?-1:1)*s.get(`length`),l=a[FU(n)],u=[],d=0;dm?`left`:`right`,_=Math.abs(p[1]-h)/f<.3?`middle`:p[1]>h?`top`:`bottom`;if(s&&s[d]){var v=s[d];W(v)&&v.textStyle&&(o=new tp(v.textStyle,c,c.ecModel))}var y=new Zc({silent:kk.isLabelSilent(t),style:Nf(o,{x:p[0],y:p[1],fill:o.getTextColor()||t.get([`axisLine`,`lineStyle`,`color`]),text:r.formattedLabel,align:g,verticalAlign:_})});if(e.add(y),u){var b=kk.makeAxisEventDataBase(t);b.targetType=`axisLabel`,b.value=r.rawLabel,Q(y).eventData=b}},this)},splitLine:function(e,t,n,r,i,a){var o=t.getModel(`splitLine`).getModel(`lineStyle`),s=o.get(`color`),c=0;s=s instanceof Array?s:[s];for(var l=[],u=0;u=0?`p`:`n`,D=x;v&&(r[s][T]||(r[s][T]={p:x,n:x}),D=r[s][T][E]);var O=void 0,k=void 0,A=void 0,j=void 0;if(d.dim===`radius`){var M=d.dataToCoord(w)-x,N=a.dataToCoord(T);Math.abs(M)=j})}}})}function qU(e){var t={};F(e,function(e,n){var r=e.getData(),i=e.coordinateSystem,a=i.getBaseAxis(),o=GU(i,a),s=a.getExtent(),c=a.type===`category`?a.getBandWidth():Math.abs(s[1]-s[0])/r.count(),l=t[o]||{bandWidth:c,remainedWidth:c,autoWidthCount:0,categoryGap:`20%`,gap:`30%`,stacks:{}},u=l.stacks;t[o]=l;var d=WU(e);u[d]||l.autoWidthCount++,u[d]=u[d]||{width:0,maxWidth:0};var f=Z(e.get(`barWidth`),c),p=Z(e.get(`barMaxWidth`),c),m=e.get(`barGap`),h=e.get(`barCategoryGap`);f&&!u[d].width&&(f=Math.min(l.remainedWidth,f),u[d].width=f,l.remainedWidth-=f),p&&(u[d].maxWidth=p),m!=null&&(l.gap=m),h!=null&&(l.categoryGap=h)});var n={};return F(t,function(e,t){n[t]={};var r=e.stacks,i=e.bandWidth,a=Z(e.categoryGap,i),o=Z(e.gap,1),s=e.remainedWidth,c=e.autoWidthCount,l=(s-a)/(c+(c-1)*o);l=Math.max(l,0),F(r,function(e,t){var n=e.maxWidth;n&&n=t.y&&e[1]<=t.y+t.height:n.contain(n.toLocalCoord(e[1]))&&e[0]>=t.y&&e[0]<=t.y+t.height},e.prototype.pointToData=function(e){var t=this.getAxis();return[t.coordToData(t.toLocalCoord(e[t.orient===`horizontal`?0:1]))]},e.prototype.dataToPoint=function(e){var t=this.getAxis(),n=this.getRect(),r=[],i=t.orient===`horizontal`?0:1;return e instanceof Array&&(e=e[0]),r[i]=t.toGlobalCoord(t.dataToCoord(+e)),r[1-i]=i===0?n.y+n.height/2:n.x+n.width/2,r},e.prototype.convertToPixel=function(e,t,n){return sW(t)===this?this.dataToPoint(n):null},e.prototype.convertFromPixel=function(e,t,n){return sW(t)===this?this.pointToData(n):null},e}();function sW(e){var t=e.seriesModel,n=e.singleAxisModel;return n&&n.coordinateSystem||t&&t.coordinateSystem}function cW(e,t){var n=[];return e.eachComponent(`singleAxis`,function(r,i){var a=new oW(r,e,t);a.name=`single_`+i,a.resize(r,t),r.coordinateSystem=a,n.push(a)}),e.eachSeries(function(e){if(e.get(`coordinateSystem`)===`singleAxis`){var t=e.getReferringComponents(`singleAxis`,ko).models[0];e.coordinateSystem=t&&t.coordinateSystem}}),n}var lW={create:cW,dimensions:aW},uW=[`x`,`y`],dW=[`width`,`height`],fW=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.makeElOption=function(e,t,n,r,i){var a=n.axis,o=a.coordinateSystem,s=hW(o,1-mW(a)),c=o.dataToPoint(t)[0],l=r.get(`type`);if(l&&l!==`none`){var u=AH(r),d=pW[l](a,c,s);d.style=u,e.graphicKey=d.type,e.pointer=d}FH(t,e,QU(n),n,r,i)},t.prototype.getHandleTransform=function(e,t,n){var r=QU(t,{labelInside:!1});r.labelMargin=n.get([`handle`,`margin`]);var i=PH(t.axis,e,r);return{x:i[0],y:i[1],rotation:r.rotation+(r.labelDirection<0?Math.PI:0)}},t.prototype.updateHandleTransform=function(e,t,n,r){var i=n.axis,a=i.coordinateSystem,o=mW(i),s=hW(a,o),c=[e.x,e.y];c[o]+=t[o],c[o]=Math.min(s[1],c[o]),c[o]=Math.max(s[0],c[o]);var l=hW(a,1-o),u=(l[1]+l[0])/2,d=[u,u];return d[o]=c[o],{x:c[0],y:c[1],rotation:e.rotation,cursorPoint:d,tooltipOption:{verticalAlign:`middle`}}},t}(wH),pW={line:function(e,t,n){return{type:`Line`,subPixelOptimize:!0,shape:IH([t,n[0]],[t,n[1]],mW(e))}},shadow:function(e,t,n){var r=e.getBandWidth(),i=n[1]-n[0];return{type:`Rect`,shape:LH([t-r/2,n[0]],[r,i],mW(e))}}};function mW(e){return+!e.isHorizontal()}function hW(e,t){var n=e.getRect();return[n[uW[t]],n[uW[t]]+n[dW[t]]]}var gW=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`single`,t}(U_);function _W(e){$(pU),Qk.registerAxisPointerClass(`SingleAxisPointer`,fW),e.registerComponentView(gW),e.registerComponentView(tW),e.registerComponentModel(rW),dk(e,`single`,rW,rW.defaultOption),e.registerCoordinateSystem(`single`,lW)}var vW=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(t,n,r){var i=ym(t);e.prototype.init.apply(this,arguments),yW(t,i)},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),yW(this.option,t)},t.prototype.getCellSize=function(){return this.option.cellSize},t.type=`calendar`,t.defaultOption={z:2,left:80,top:60,cellSize:20,orient:`horizontal`,splitLine:{show:!0,lineStyle:{color:`#000`,width:1,type:`solid`}},itemStyle:{color:`#fff`,borderWidth:1,borderColor:`#ccc`},dayLabel:{show:!0,firstDay:0,position:`start`,margin:`50%`,color:`#000`},monthLabel:{show:!0,position:`start`,margin:5,align:`center`,formatter:null,color:`#000`},yearLabel:{show:!0,position:null,margin:30,formatter:null,color:`#ccc`,fontFamily:`sans-serif`,fontWeight:`bolder`,fontSize:20}},t}(Sm);function yW(e,t){var n=e.cellSize,r=V(n)?n:e.cellSize=[n,n];r.length===1&&(r[1]=r[0]),vm(e,t,{type:`box`,ignoreSize:I([0,1],function(e){return gm(t,e)&&(r[e]=`auto`),r[e]!=null&&r[e]!==`auto`})})}var bW=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){var r=this.group;r.removeAll();var i=e.coordinateSystem,a=i.getRangeInfo(),o=i.getOrient(),s=t.getLocaleModel();this._renderDayRect(e,a,r),this._renderLines(e,a,o,r),this._renderYearText(e,a,o,r),this._renderMonthText(e,s,o,r),this._renderWeekText(e,s,a,o,r)},t.prototype._renderDayRect=function(e,t,n){for(var r=e.coordinateSystem,i=e.getModel(`itemStyle`).getItemStyle(),a=r.getCellWidth(),o=r.getCellHeight(),s=t.start.time;s<=t.end.time;s=r.getNextNDay(s,1).time){var c=r.dataToRect([s],!1).tl,l=new qc({shape:{x:c[0],y:c[1],width:a,height:o},cursor:`default`,style:i});n.add(l)}},t.prototype._renderLines=function(e,t,n,r){var i=this,a=e.coordinateSystem,o=e.getModel([`splitLine`,`lineStyle`]).getLineStyle(),s=e.get([`splitLine`,`show`]),c=o.lineWidth;this._tlpoints=[],this._blpoints=[],this._firstDayOfMonth=[],this._firstDayPoints=[];for(var l=t.start,u=0;l.time<=t.end.time;u++){f(l.formatedDate),u===0&&(l=a.getDateInfo(t.start.y+`-`+t.start.m));var d=l.date;d.setMonth(d.getMonth()+1),l=a.getDateInfo(d)}f(a.getNextNDay(t.end.time,1).formatedDate);function f(t){i._firstDayOfMonth.push(a.getDateInfo(t)),i._firstDayPoints.push(a.dataToRect([t],!1).tl);var c=i._getLinePointsOfOneWeek(e,t,n);i._tlpoints.push(c[0]),i._blpoints.push(c[c.length-1]),s&&i._drawSplitline(c,o,r)}s&&this._drawSplitline(i._getEdgesPoints(i._tlpoints,c,n),o,r),s&&this._drawSplitline(i._getEdgesPoints(i._blpoints,c,n),o,r)},t.prototype._getEdgesPoints=function(e,t,n){var r=[e[0].slice(),e[e.length-1].slice()],i=n===`horizontal`?0:1;return r[0][i]=r[0][i]-t/2,r[1][i]=r[1][i]+t/2,r},t.prototype._drawSplitline=function(e,t,n){var r=new gd({z2:20,shape:{points:e},style:t});n.add(r)},t.prototype._getLinePointsOfOneWeek=function(e,t,n){for(var r=e.coordinateSystem,i=r.getDateInfo(t),a=[],o=0;o<7;o++){var s=r.getNextNDay(i.time,o),c=r.dataToRect([s.time],!1);a[2*s.day]=c.tl,a[2*s.day+1]=c[n===`horizontal`?`bl`:`tr`]}return a},t.prototype._formatterLabel=function(e,t){return U(e)&&e?im(e,t):H(e)?e(t):t.nameMap},t.prototype._yearTextPositionControl=function(e,t,n,r,i){var a=t[0],o=t[1],s=[`center`,`bottom`];r===`bottom`?(o+=i,s=[`center`,`top`]):r===`left`?a-=i:r===`right`?(a+=i,s=[`center`,`top`]):o-=i;var c=0;return(r===`left`||r===`right`)&&(c=Math.PI/2),{rotation:c,x:a,y:o,style:{align:s[0],verticalAlign:s[1]}}},t.prototype._renderYearText=function(e,t,n,r){var i=e.getModel(`yearLabel`);if(i.get(`show`)){var a=i.get(`margin`),o=i.get(`position`);o||=n===`horizontal`?`left`:`top`;var s=[this._tlpoints[this._tlpoints.length-1],this._blpoints[0]],c=(s[0][0]+s[1][0])/2,l=(s[0][1]+s[1][1])/2,u=n===`horizontal`?0:1,d={top:[c,s[u][1]],bottom:[c,s[1-u][1]],left:[s[1-u][0],l],right:[s[u][0],l]},f=t.start.y;+t.end.y>+t.start.y&&(f=f+`-`+t.end.y);var p=i.get(`formatter`),m={start:t.start.y,end:t.end.y,nameMap:f},h=new Zc({z2:30,style:Nf(i,{text:this._formatterLabel(p,m)}),silent:i.get(`silent`)});h.attr(this._yearTextPositionControl(h,d[o],n,o,a)),r.add(h)}},t.prototype._monthTextPositionControl=function(e,t,n,r,i){var a=`left`,o=`top`,s=e[0],c=e[1];return n===`horizontal`?(c+=i,t&&(a=`center`),r===`start`&&(o=`bottom`)):(s+=i,t&&(o=`middle`),r===`start`&&(a=`right`)),{x:s,y:c,align:a,verticalAlign:o}},t.prototype._renderMonthText=function(e,t,n,r){var i=e.getModel(`monthLabel`);if(i.get(`show`)){var a=i.get(`nameMap`),o=i.get(`margin`),s=i.get(`position`),c=i.get(`align`),l=[this._tlpoints,this._blpoints];(!a||U(a))&&(a&&(t=_p(a)||t),a=t.get([`time`,`monthAbbr`])||[]);var u=s===`start`?0:1,d=n===`horizontal`?0:1;o=s===`start`?-o:o;for(var f=c===`center`,p=i.get(`silent`),m=0;m=r.start.time&&n.timeo.end.time&&t.reverse(),t},e.prototype._getRangeInfo=function(e){var t=[this.getDateInfo(e[0]),this.getDateInfo(e[1])],n;t[0].time>t[1].time&&(n=!0,t.reverse());var r=Math.floor(t[1].time/xW)-Math.floor(t[0].time/xW)+1,i=new Date(t[0].time),a=i.getDate(),o=t[1].date.getDate();i.setDate(a+r-1);var s=i.getDate();if(s!==o)for(var c=i.getTime()-t[1].time>0?1:-1;(s=i.getDate())!==o&&(i.getTime()-t[1].time)*c>0;)r-=c,i.setDate(s-c);var l=Math.floor((r+t[0].day+6)/7),u=n?-l+1:l-1;return n&&t.reverse(),{range:[t[0].formatedDate,t[1].formatedDate],start:t[0],end:t[1],allDay:r,weeks:l,nthWeek:u,fweek:t[0].day,lweek:t[1].day}},e.prototype._getDateByWeeksAndDay=function(e,t,n){var r=this._getRangeInfo(n);if(e>r.weeks||e===0&&tr.lweek)return null;var i=(e-1)*7-r.fweek+t,a=new Date(r.start.time);return a.setDate(+r.start.d+i),this.getDateInfo(a)},e.create=function(t,n){var r=[];return t.eachComponent(`calendar`,function(i){var a=new e(i,t,n);r.push(a),i.coordinateSystem=a}),t.eachSeries(function(e){e.get(`coordinateSystem`)===`calendar`&&(e.coordinateSystem=r[e.get(`calendarIndex`)||0])}),r},e.dimensions=[`time`,`value`],e}();function CW(e){var t=e.calendarModel,n=e.seriesModel;return t?t.coordinateSystem:n?n.coordinateSystem:null}function wW(e){e.registerComponentModel(vW),e.registerComponentView(bW),e.registerCoordinateSystem(`calendar`,SW)}function TW(e,t){var n=e.existing;if(t.id=e.keyInfo.id,!t.type&&n&&(t.type=n.type),t.parentId==null){var r=t.parentOption;r?t.parentId=r.id:n&&(t.parentId=n.parentId)}t.parentOption=null}function EW(e,t){var n;return F(t,function(t){e[t]!=null&&e[t]!==`auto`&&(n=!0)}),n}function DW(e,t,n){var r=j({},n),i=e[t],a=n.$action||`merge`;a===`merge`?i?(k(i,r,!0),vm(i,r,{ignoreSize:!0}),bm(n,i),AW(n,i),AW(n,i,`shape`),AW(n,i,`style`),AW(n,i,`extra`),n.clipPath=i.clipPath):e[t]=r:a===`replace`?e[t]=r:a===`remove`&&i&&(e[t]=null)}var OW=[`transition`,`enterFrom`,`leaveTo`],kW=OW.concat([`enterAnimation`,`updateAnimation`,`leaveAnimation`]);function AW(e,t,n){if(n&&(!e[n]&&t[n]&&(e[n]={}),e=e[n],t=t[n]),!(!e||!t))for(var r=n?OW:kW,i=0;i=0;c--){var l=n[c],u=_o(l.id,null),d=u==null?null:i.get(u);if(d){var f=d.parent,h=PW(f),g=f===r?{width:a,height:o}:{width:h.width,height:h.height},_={},v=hm(d,l,g,null,{hv:l.hv,boundingMode:l.bounding},_);if(!PW(d).isNew&&v){for(var y=l.transition,b={},x=0;x=0)?b[S]=C:d[S]=C}Bd(d,b,e,0)}else d.attr(_)}}},t.prototype._clear=function(){var e=this,t=this._elMap;t.each(function(n){RW(n,PW(n).option,t,e._lastGraphicModel)}),this._elMap=K()},t.prototype.dispose=function(){this._clear()},t.type=`graphic`,t}(U_);function IW(e){var t=new(q(NW,e)?NW[e]:nf(e))({});return PW(t).type=e,t}function LW(e,t,n,r){var i=IW(n);return t.add(i),r.set(e,i),PW(i).id=e,PW(i).isNew=!0,i}function RW(e,t,n,r){e&&e.parent&&(e.type===`group`&&e.traverse(function(e){RW(e,t,n,r)}),vV(e,t,r),n.removeKey(PW(e).id))}function zW(e,t,n,r){e.isGroup||F([[`cursor`,Ts.prototype.cursor],[`zlevel`,r||0],[`z`,n||0],[`z2`,0]],function(n){var r=n[0];q(t,r)?e[r]=G(t[r],n[1]):e[r]??(e[r]=n[1])}),F(R(t),function(n){if(n.indexOf(`on`)===0){var r=t[n];e[n]=H(r)?r:null}}),q(t,`draggable`)&&(e.draggable=t.draggable),t.name!=null&&(e.name=t.name),t.id!=null&&(e.id=t.id)}function BW(e){return e=j({},e),F([`id`,`parentId`,`$action`,`hv`,`bounding`,`textContent`,`clipPath`].concat(lm),function(t){delete e[t]}),e}function VW(e,t,n){var r=Q(e).eventData;!e.silent&&!e.ignore&&!r&&(r=Q(e).eventData={componentType:`graphic`,componentIndex:t.componentIndex,name:e.name}),r&&(r.info=n.info)}function HW(e){e.registerComponentModel(MW),e.registerComponentView(FW),e.registerPreprocessor(function(e){var t=e.graphic;V(t)?e.graphic=!t[0]||!t[0].elements?[{elements:t}]:[e.graphic[0]]:t&&!t.elements&&(e.graphic=[{elements:[t]}])})}var UW=[`x`,`y`,`radius`,`angle`,`single`],WW=[`cartesian2d`,`polar`,`singleAxis`];function GW(e){return N(WW,e.get(`coordinateSystem`))>=0}function KW(e){return e+`Axis`}function qW(e,t){var n=K(),r=[],i=K();e.eachComponent({mainType:`dataZoom`,query:t},function(e){i.get(e.uid)||s(e)});var a;do a=!1,e.eachComponent(`dataZoom`,o);while(a);function o(e){!i.get(e.uid)&&c(e)&&(s(e),a=!0)}function s(e){i.set(e.uid,!0),r.push(e),l(e)}function c(e){var t=!1;return e.eachTargetAxis(function(e,r){var i=n.get(e);i&&i[r]&&(t=!0)}),t}function l(e){e.eachTargetAxis(function(e,t){(n.get(e)||n.set(e,[]))[t]=!0})}return r}function JW(e){var t=e.ecModel,n={infoList:[],infoMap:K()};return e.eachTargetAxis(function(e,r){var i=t.getComponent(KW(e),r);if(i){var a=i.getCoordSysModel();if(a){var o=a.uid,s=n.infoMap.get(o);s||(s={model:a,axisModels:[]},n.infoList.push(s),n.infoMap.set(o,s)),s.axisModels.push(i)}}}),n}var YW=function(){function e(){this.indexList=[],this.indexMap=[]}return e.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},e}(),XW=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._autoThrottle=!0,n._noTarget=!0,n._rangePropMode=[`percent`,`percent`],n}return t.prototype.init=function(e,t,n){var r=ZW(e);this.settledOption=r,this.mergeDefaultAndTheme(e,n),this._doInit(r)},t.prototype.mergeOption=function(e){var t=ZW(e);k(this.option,e,!0),k(this.settledOption,t,!0),this._doInit(t)},t.prototype._doInit=function(e){var t=this.option;this._setDefaultThrottle(e),this._updateRangeUse(e);var n=this.settledOption;F([[`start`,`startValue`],[`end`,`endValue`]],function(e,r){this._rangePropMode[r]===`value`&&(t[e[0]]=n[e[0]]=null)},this),this._resetTarget()},t.prototype._resetTarget=function(){var e=this.get(`orient`,!0),t=this._targetAxisInfoMap=K();this._fillSpecifiedTargetAxis(t)?this._orient=e||this._makeAutoOrientByTargetAxis():(this._orient=e||`horizontal`,this._fillAutoTargetAxisByOrient(t,this._orient)),this._noTarget=!0,t.each(function(e){e.indexList.length&&(this._noTarget=!1)},this)},t.prototype._fillSpecifiedTargetAxis=function(e){var t=!1;return F(UW,function(n){var r=this.getReferringComponents(KW(n),Ao);if(r.specified){t=!0;var i=new YW;F(r.models,function(e){i.add(e.componentIndex)}),e.set(n,i)}},this),t},t.prototype._fillAutoTargetAxisByOrient=function(e,t){var n=this.ecModel,r=!0;if(r){var i=t===`vertical`?`y`:`x`,a=n.findComponents({mainType:i+`Axis`});o(a,i)}if(r){var a=n.findComponents({mainType:`singleAxis`,filter:function(e){return e.get(`orient`,!0)===t}});o(a,`single`)}function o(t,n){var i=t[0];if(i){var a=new YW;if(a.add(i.componentIndex),e.set(n,a),r=!1,n===`x`||n===`y`){var o=i.getReferringComponents(`grid`,ko).models[0];o&&F(t,function(e){i.componentIndex!==e.componentIndex&&o===e.getReferringComponents(`grid`,ko).models[0]&&a.add(e.componentIndex)})}}}r&&F(UW,function(t){if(r){var i=n.findComponents({mainType:KW(t),filter:function(e){return e.get(`type`,!0)===`category`}});if(i[0]){var a=new YW;a.add(i[0].componentIndex),e.set(t,a),r=!1}}},this)},t.prototype._makeAutoOrientByTargetAxis=function(){var e;return this.eachTargetAxis(function(t){!e&&(e=t)},this),e===`y`?`vertical`:`horizontal`},t.prototype._setDefaultThrottle=function(e){if(e.hasOwnProperty(`throttle`)&&(this._autoThrottle=!1),this._autoThrottle){var t=this.ecModel.option;this.option.throttle=t.animation&&t.animationDurationUpdate>0?100:20}},t.prototype._updateRangeUse=function(e){var t=this._rangePropMode,n=this.get(`rangeMode`);F([[`start`,`startValue`],[`end`,`endValue`]],function(r,i){var a=e[r[0]]!=null,o=e[r[1]]!=null;a&&!o?t[i]=`percent`:!a&&o?t[i]=`value`:n?t[i]=n[i]:a&&(t[i]=`percent`)})},t.prototype.noTarget=function(){return this._noTarget},t.prototype.getFirstTargetAxisModel=function(){var e;return this.eachTargetAxis(function(t,n){e??=this.ecModel.getComponent(KW(t),n)},this),e},t.prototype.eachTargetAxis=function(e,t){this._targetAxisInfoMap.each(function(n,r){F(n.indexList,function(n){e.call(t,r,n)})})},t.prototype.getAxisProxy=function(e,t){var n=this.getAxisModel(e,t);if(n)return n.__dzAxisProxy},t.prototype.getAxisModel=function(e,t){var n=this._targetAxisInfoMap.get(e);if(n&&n.indexMap[t])return this.ecModel.getComponent(KW(e),t)},t.prototype.setRawRange=function(e){var t=this.option,n=this.settledOption;F([[`start`,`startValue`],[`end`,`endValue`]],function(r){(e[r[0]]!=null||e[r[1]]!=null)&&(t[r[0]]=n[r[0]]=e[r[0]],t[r[1]]=n[r[1]]=e[r[1]])},this),this._updateRangeUse(e)},t.prototype.setCalculatedRange=function(e){var t=this.option;F([`start`,`startValue`,`end`,`endValue`],function(n){t[n]=e[n]})},t.prototype.getPercentRange=function(){var e=this.findRepresentativeAxisProxy();if(e)return e.getDataPercentWindow()},t.prototype.getValueRange=function(e,t){if(e==null&&t==null){var n=this.findRepresentativeAxisProxy();if(n)return n.getDataValueWindow()}else return this.getAxisProxy(e,t).getDataValueWindow()},t.prototype.findRepresentativeAxisProxy=function(e){if(e)return e.__dzAxisProxy;for(var t,n=this._targetAxisInfoMap.keys(),r=0;ra[1];if(u&&!d&&!f)return!0;u&&(i=!0),d&&(t=!0),f&&(n=!0)}return i&&t&&n})}else tG(r,function(n){if(i===`empty`)e.setData(t=t.map(n,function(e){return o(e)?e:NaN}));else{var r={};r[n]=a,t.selectRange(r)}});tG(r,function(e){t.setApproximateExtent(a,e)})}});function o(e){return e>=a[0]&&e<=a[1]}},e.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},t=this._dataZoomModel,n=this._dataExtent;tG([`min`,`max`],function(r){var i=t.get(r+`Span`),a=t.get(r+`ValueSpan`);a!=null&&(a=this.getAxisModel().axis.scale.parse(a)),a==null?i!=null&&(a=Aa(i,[0,100],n,!0)-n[0]):i=Aa(n[0]+a,n,[0,100],!0),e[r+`Span`]=i,e[r+`ValueSpan`]=a},this)},e.prototype._setAxisModel=function(){var e=this.getAxisModel(),t=this._percentWindow,n=this._valueWindow;if(t){var r=Fa(n,[0,500]);r=Math.min(r,20);var i=e.axis.scale.rawExtentInfo;t[0]!==0&&i.setDeterminedMinMax(`min`,+n[0].toFixed(r)),t[1]!==100&&i.setDeterminedMinMax(`max`,+n[1].toFixed(r)),i.freeze()}},e}();function iG(e,t,n){var r=[1/0,-1/0];tG(n,function(e){WC(r,e.getData(),t)});var i=e.getAxisModel(),a=AC(i.axis.scale,i,r).calculate();return[a.min,a.max]}var aG={getTargetSeries:function(e){function t(t){e.eachComponent(`dataZoom`,function(n){n.eachTargetAxis(function(r,i){t(r,i,e.getComponent(KW(r),i),n)})})}t(function(e,t,n,r){n.__dzAxisProxy=null});var n=[];t(function(t,r,i,a){i.__dzAxisProxy||(i.__dzAxisProxy=new rG(t,r,a,e),n.push(i.__dzAxisProxy))});var r=K();return F(n,function(e){F(e.getTargetSeriesModels(),function(e){r.set(e.uid,e)})}),r},overallReset:function(e,t){e.eachComponent(`dataZoom`,function(e){e.eachTargetAxis(function(t,n){e.getAxisProxy(t,n).reset(e)}),e.eachTargetAxis(function(n,r){e.getAxisProxy(n,r).filterData(e,t)})}),e.eachComponent(`dataZoom`,function(e){var t=e.findRepresentativeAxisProxy();if(t){var n=t.getDataPercentWindow(),r=t.getDataValueWindow();e.setCalculatedRange({start:n[0],end:n[1],startValue:r[0],endValue:r[1]})}})}};function oG(e){e.registerAction(`dataZoom`,function(e,t){F(qW(t,e),function(t){t.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var sG=!1;function cG(e){sG||(sG=!0,e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,aG),oG(e),e.registerSubTypeDefaulter(`dataZoom`,function(){return`slider`}))}function lG(e){e.registerComponentModel(QW),e.registerComponentView(eG),cG(e)}var uG=function(){function e(){}return e}(),dG={};function fG(e,t){dG[e]=t}function pG(e){return dG[e]}var mG=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(){e.prototype.optionUpdated.apply(this,arguments);var t=this.ecModel;F(this.option.feature,function(e,n){var r=pG(n);r&&(r.getDefaultOption&&(r.defaultOption=r.getDefaultOption(t)),k(e,r.defaultOption))})},t.type=`toolbox`,t.layoutMode={type:`box`,ignoreSize:!0},t.defaultOption={show:!0,z:6,orient:`horizontal`,left:`right`,top:`top`,backgroundColor:`transparent`,borderColor:`#ccc`,borderRadius:0,borderWidth:0,padding:5,itemSize:15,itemGap:8,showTitle:!0,iconStyle:{borderColor:`#666`,color:`none`},emphasis:{iconStyle:{borderColor:`#3E98C5`}},tooltip:{show:!1,position:`bottom`}},t}(Sm);function hG(e,t,n){var r=t.getBoxLayoutParams(),i=t.get(`padding`),a={width:n.getWidth(),height:n.getHeight()},o=mm(r,a,i);fm(t.get(`orient`),e,t.get(`itemGap`),o.width,o.height),hm(e,r,a,i)}function gG(e,t){var n=$p(t.get(`padding`)),r=t.getItemStyle([`color`,`opacity`]);return r.fill=t.get(`backgroundColor`),e=new qc({shape:{x:e.x-n[3],y:e.y-n[0],width:e.width+n[1]+n[3],height:e.height+n[0]+n[2],r:t.get(`borderRadius`)},style:r,silent:!0,z2:-1}),e}var _G=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){var i=this.group;if(i.removeAll(),!e.get(`show`))return;var a=+e.get(`itemSize`),o=e.get(`orient`)===`vertical`,s=e.get(`feature`)||{},c=this._features||={},l=[];F(s,function(e,t){l.push(t)}),new Fx(this._featureNames||[],l).add(u).update(u).remove(B(u,null)).execute(),this._featureNames=l;function u(i,a){var o=l[i],u=l[a],f=s[o],p=new tp(f,e,e.ecModel),m;if(r&&r.newTitle!=null&&r.featureName===o&&(f.title=r.newTitle),o&&!u){if(vG(o))m={onclick:p.option.onclick,featureName:o};else{var h=pG(o);if(!h)return;m=new h}c[o]=m}else if(m=c[u],!m)return;m.uid=rp(`toolbox-feature`),m.model=p,m.ecModel=t,m.api=n;var g=m instanceof uG;if(!o&&u){g&&m.dispose&&m.dispose(t,n);return}if(!p.get(`show`)||g&&m.unusable){g&&m.remove&&m.remove(t,n);return}d(p,m,o),p.setIconStatus=function(e,t){var n=this.option,r=this.iconPaths;n.iconStatus=n.iconStatus||{},n.iconStatus[e]=t,r[e]&&(t===`emphasis`?Hl:Ul)(r[e])},m instanceof uG&&m.render&&m.render(p,t,n,r)}function d(r,s,c){var l=r.getModel(`iconStyle`),u=r.getModel([`emphasis`,`iconStyle`]),d=s instanceof uG&&s.getIcons?s.getIcons():r.get(`icon`),f=r.get(`title`)||{},p,m;U(d)?(p={},p[c]=d):p=d,U(f)?(m={},m[c]=f):m=f;var h=r.iconPaths={};F(p,function(c,d){var f=bf(c,{},{x:-a/2,y:-a/2,width:a,height:a});f.setStyle(l.getItemStyle());var p=f.ensureState(`emphasis`);p.style=u.getItemStyle();var g=new Zc({style:{text:m[d],align:u.get(`textAlign`),borderRadius:u.get(`textBorderRadius`),padding:u.get(`textPadding`),fill:null,font:Vf({fontStyle:u.get(`textFontStyle`),fontFamily:u.get(`textFontFamily`),fontSize:u.get(`textFontSize`),fontWeight:u.get(`textFontWeight`)},t)},ignore:!0});f.setTextContent(g),Tf({el:f,componentModel:e,itemName:d,formatterParamsExtra:{title:m[d]}}),f.__title=m[d],f.on(`mouseover`,function(){var t=u.getItemStyle(),r=o?e.get(`right`)==null&&e.get(`left`)!==`right`?`right`:`left`:e.get(`bottom`)==null&&e.get(`top`)!==`bottom`?`bottom`:`top`;g.setStyle({fill:u.get(`textFill`)||t.fill||t.stroke||`#000`,backgroundColor:u.get(`textBackgroundColor`)}),f.setTextConfig({position:u.get(`textPosition`)||r}),g.ignore=!e.get(`showTitle`),n.enterEmphasis(this)}).on(`mouseout`,function(){r.get([`iconStatus`,d])!==`emphasis`&&n.leaveEmphasis(this),g.hide()}),(r.get([`iconStatus`,d])===`emphasis`?Hl:Ul)(f),i.add(f),f.on(`click`,z(s.onclick,s,t,n,d)),h[d]=f})}hG(i,e,n),i.add(gG(i.getBoundingRect(),e)),o||i.eachChild(function(e){var t=e.__title,r=e.ensureState(`emphasis`),o=r.textConfig||={},s=e.getTextContent(),c=s&&s.ensureState(`emphasis`);if(c&&!H(c)&&t){var l=c.style||={},u=Qi(t,Zc.makeFont(l)),d=e.x+i.x,f=e.y+i.y+a,p=!1;f+u.height>n.getHeight()&&(o.position=`top`,p=!0);var m=p?-5-u.height:a+10;d+u.width/2>n.getWidth()?(o.position=[`100%`,m],l.align=`right`):d-u.width/2<0&&(o.position=[0,m],l.align=`left`)}})},t.prototype.updateView=function(e,t,n,r){F(this._features,function(e){e instanceof uG&&e.updateView&&e.updateView(e.model,t,n,r)})},t.prototype.remove=function(e,t){F(this._features,function(n){n instanceof uG&&n.remove&&n.remove(e,t)}),this.group.removeAll()},t.prototype.dispose=function(e,t){F(this._features,function(n){n instanceof uG&&n.dispose&&n.dispose(e,t)})},t.type=`toolbox`,t}(U_);function vG(e){return e.indexOf(`my`)===0}var yG=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){var n=this.model,r=n.get(`name`)||e.get(`title.0.text`)||`echarts`,i=t.getZr().painter.getType()===`svg`,o=i?`svg`:n.get(`type`,!0)||`png`,s=t.getConnectedDataURL({type:o,backgroundColor:n.get(`backgroundColor`,!0)||e.get(`backgroundColor`)||`#fff`,connectedBackgroundColor:n.get(`connectedBackgroundColor`),excludeComponents:n.get(`excludeComponents`),pixelRatio:n.get(`pixelRatio`)}),c=a.browser;if(typeof MouseEvent==`function`&&(c.newEdge||!c.ie&&!c.edge)){var l=document.createElement(`a`);l.download=r+`.`+o,l.target=`_blank`,l.href=s;var u=new MouseEvent(`click`,{view:document.defaultView,bubbles:!0,cancelable:!1});l.dispatchEvent(u)}else if(window.navigator.msSaveOrOpenBlob||i){var d=s.split(`,`),f=d[0].indexOf(`base64`)>-1,p=i?decodeURIComponent(d[1]):d[1];f&&(p=window.atob(p));var m=r+`.`+o;if(window.navigator.msSaveOrOpenBlob){for(var h=p.length,g=new Uint8Array(h);h--;)g[h]=p.charCodeAt(h);var _=new Blob([g]);window.navigator.msSaveOrOpenBlob(_,m)}else{var v=document.createElement(`iframe`);document.body.appendChild(v);var y=v.contentWindow,b=y.document;b.open(`image/svg+xml`,`replace`),b.write(p),b.close(),y.focus(),b.execCommand(`SaveAs`,!0,m),document.body.removeChild(v)}}else{var x=n.get(`lang`),S=``,C=window.open();C.document.write(S),C.document.title=r}},t.getDefaultOption=function(e){return{show:!0,icon:`M4.7,22.9L29.3,45.5L54.7,23.4M4.6,43.6L4.6,58L53.8,58L53.8,43.6M29.2,45.1L29.2,0`,title:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`title`]),type:`png`,connectedBackgroundColor:`#fff`,name:``,excludeComponents:[`toolbox`],lang:e.getLocaleModel().get([`toolbox`,`saveAsImage`,`lang`])}},t}(uG),bG=`__ec_magicType_stack__`,xG=[[`line`,`bar`],[`stack`]],SG=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`),n={};return F(e.get(`type`),function(e){t[e]&&(n[e]=t[e])}),n},t.getDefaultOption=function(e){return{show:!0,type:[],icon:{line:`M4.1,28.9h7.1l9.3-22l7.4,38l9.7-19.7l3,12.8h14.9M4.1,58h51.4`,bar:`M6.7,22.9h10V48h-10V22.9zM24.9,13h10v35h-10V13zM43.2,2h10v46h-10V2zM3.1,58h53.7`,stack:`M8.2,38.4l-8.4,4.1l30.6,15.3L60,42.5l-8.1-4.1l-21.5,11L8.2,38.4z M51.9,30l-8.1,4.2l-13.4,6.9l-13.9-6.9L8.2,30l-8.4,4.2l8.4,4.2l22.2,11l21.5-11l8.1-4.2L51.9,30z M51.9,21.7l-8.1,4.2L35.7,30l-5.3,2.8L24.9,30l-8.4-4.1l-8.3-4.2l-8.4,4.2L8.2,30l8.3,4.2l13.9,6.9l13.4-6.9l8.1-4.2l8.1-4.1L51.9,21.7zM30.4,2.2L-0.2,17.5l8.4,4.1l8.3,4.2l8.4,4.2l5.5,2.7l5.3-2.7l8.1-4.2l8.1-4.2l8.1-4.1L30.4,2.2z`},title:e.getLocaleModel().get([`toolbox`,`magicType`,`title`]),option:{},seriesIndex:{}}},t.prototype.onclick=function(e,t,n){var r=this.model,i=r.get([`seriesIndex`,n]);if(CG[n]){var a={series:[]};F(xG,function(e){N(e,n)>=0&&F(e,function(e){r.setIconStatus(e,`normal`)})}),r.setIconStatus(n,`emphasis`),e.eachComponent({mainType:`series`,query:i==null?null:{seriesIndex:i}},function(e){var t=e.subType,i=e.id,o=CG[n](t,i,e,r);o&&(M(o,e.option),a.series.push(o));var s=e.coordinateSystem;if(s&&s.type===`cartesian2d`&&(n===`line`||n===`bar`)){var c=s.getAxesByScale(`ordinal`)[0];if(c){var l=c.dim+`Axis`,u=e.getReferringComponents(l,ko).models[0].componentIndex;a[l]=a[l]||[];for(var d=0;d<=u;d++)a[l][u]=a[l][u]||{};a[l][u].boundaryGap=n===`bar`}}});var o,s=n;n===`stack`&&(o=k({stack:r.option.title.tiled,tiled:r.option.title.stack},r.option.title),r.get([`iconStatus`,n])!==`emphasis`&&(s=`tiled`)),t.dispatchAction({type:`changeMagicType`,currentType:s,newOption:a,newTitle:o,featureName:`magicType`})}},t}(uG),CG={line:function(e,t,n,r){if(e===`bar`)return k({id:t,type:`line`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`line`])||{},!0)},bar:function(e,t,n,r){if(e===`line`)return k({id:t,type:`bar`,data:n.get(`data`),stack:n.get(`stack`),markPoint:n.get(`markPoint`),markLine:n.get(`markLine`)},r.get([`option`,`bar`])||{},!0)},stack:function(e,t,n,r){var i=n.get(`stack`)===bG;if(e===`line`||e===`bar`)return r.setIconStatus(`stack`,i?`normal`:`emphasis`),k({id:t,stack:i?``:bG},r.get([`option`,`stack`])||{},!0)}};xx({type:`changeMagicType`,event:`magicTypeChanged`,update:`prepareAndUpdate`},function(e,t){t.mergeOption(e.newOption)});var wG=Array(60).join(`-`),TG=` `;function EG(e){var t={},n=[],r=[];return e.eachRawSeries(function(e){var i=e.coordinateSystem;if(i&&(i.type===`cartesian2d`||i.type===`polar`)){var a=i.getBaseAxis();if(a.type===`category`){var o=a.dim+`_`+a.index;t[o]||(t[o]={categoryAxis:a,valueAxis:i.getOtherAxis(a),series:[]},r.push({axisDim:a.dim,axisIndex:a.index})),t[o].series.push(e)}else n.push(e)}else n.push(e)}),{seriesGroupByCategoryAxis:t,other:n,meta:r}}function DG(e){var t=[];return F(e,function(e,n){var r=e.categoryAxis,i=e.valueAxis.dim,a=[` `].concat(I(e.series,function(e){return e.name})),o=[r.model.getCategories()];F(e.series,function(e){var t=e.getRawData();o.push(e.getRawData().mapArray(t.mapDimension(i),function(e){return e}))});for(var s=[a.join(TG)],c=0;c=0)return!0}var MG=RegExp(`[`+TG+`]+`,`g`);function NG(e){for(var t=e.split(/\n+/g),n=AG(t.shift()).split(MG),r=[],i=I(n,function(e){return{name:e,data:[]}}),a=0;a=0&&!n[i][r];i--);if(i<0){var a=e.queryComponents({mainType:`dataZoom`,subType:`select`,id:r})[0];if(a){var o=a.getPercentRange();n[0][r]={dataZoomId:r,start:o[0],end:o[1]}}}}),n.push(t)}function VG(e){var t=WG(e),n=t[t.length-1];t.length>1&&t.pop();var r={};return RG(n,function(e,n){for(var i=t.length-1;i>=0;i--)if(e=t[i][n],e){r[n]=e;break}}),r}function HG(e){zG(e).snapshots=null}function UG(e){return WG(e).length}function WG(e){var t=zG(e);return t.snapshots||=[{}],t.snapshots}var GG=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.onclick=function(e,t){HG(e),t.dispatchAction({type:`restore`,from:this.uid})},t.getDefaultOption=function(e){return{show:!0,icon:`M3.8,33.4 M47,18.9h9.8V8.7 M56.3,20.1 C52.1,9,40.5,0.6,26.8,2.1C12.6,3.7,1.6,16.2,2.1,30.6 M13,41.1H3.1v10.2 M3.7,39.9c4.2,11.1,15.8,19.5,29.5,18 c14.2-1.6,25.2-14.1,24.7-28.5`,title:e.getLocaleModel().get([`toolbox`,`restore`,`title`])}},t}(uG);xx({type:`restore`,event:`restore`,update:`prepareAndUpdate`},function(e,t){t.resetOption(`recreate`)});var KG=[`grid`,`xAxis`,`yAxis`,`geo`,`graph`,`polar`,`radiusAxis`,`angleAxis`,`bmap`],qG=function(){function e(e,t,n){var r=this;this._targetInfoList=[];var i=YG(t,e);F(XG,function(e,t){(!n||!n.include||N(n.include,t)>=0)&&e(i,r._targetInfoList)})}return e.prototype.setOutputRanges=function(e,t){return this.matchOutputRanges(e,t,function(e,t,n){if((e.coordRanges||=[]).push(t),!e.coordRange){e.coordRange=t;var r=$G[e.brushType](0,n,t);e.__rangeOffset={offset:tK[e.brushType](r.values,e.range,[1,1]),xyMinMax:r.xyMinMax}}}),e},e.prototype.matchOutputRanges=function(e,t,n){F(e,function(e){var r=this.findTargetInfo(e,t);r&&r!==!0&&F(r.coordSyses,function(r){n(e,$G[e.brushType](1,r,e.range,!0).values,r,t)})},this)},e.prototype.setInputRanges=function(e,t){F(e,function(e){var n=this.findTargetInfo(e,t);if(e.range=e.range||[],n&&n!==!0){e.panelId=n.panelId;var r=$G[e.brushType](0,n.coordSys,e.coordRange),i=e.__rangeOffset;e.range=i?tK[e.brushType](r.values,i.offset,rK(r.xyMinMax,i.xyMinMax)):r.values}},this)},e.prototype.makePanelOpts=function(e,t){return I(this._targetInfoList,function(n){var r=n.getPanelRect();return{panelId:n.panelId,defaultBrushType:t?t(n):null,clipPath:HL(r),isTargetByCursor:WL(r,e,n.coordSysModel),getLinearBrushOtherExtent:UL(r)}})},e.prototype.controlSeries=function(e,t,n){var r=this.findTargetInfo(e,n);return r===!0||r&&N(r.coordSyses,t.coordinateSystem)>=0},e.prototype.findTargetInfo=function(e,t){for(var n=this._targetInfoList,r=YG(t,e),i=0;ie[1]&&e.reverse(),e}function YG(e,t){return Do(e,t,{includeMainTypes:KG})}var XG={grid:function(e,t){var n=e.xAxisModels,r=e.yAxisModels,i=e.gridModels,a=K(),o={},s={};!n&&!r&&!i||(F(n,function(e){var t=e.axis.grid.model;a.set(t.id,t),o[t.id]=!0}),F(r,function(e){var t=e.axis.grid.model;a.set(t.id,t),s[t.id]=!0}),F(i,function(e){a.set(e.id,e),o[e.id]=!0,s[e.id]=!0}),a.each(function(e){var i=e.coordinateSystem,a=[];F(i.getCartesians(),function(e,t){(N(n,e.getAxis(`x`).model)>=0||N(r,e.getAxis(`y`).model)>=0)&&a.push(e)}),t.push({panelId:`grid--`+e.id,gridModel:e,coordSysModel:e,coordSys:a[0],coordSyses:a,getPanelRect:QG.grid,xAxisDeclared:o[e.id],yAxisDeclared:s[e.id]})}))},geo:function(e,t){F(e.geoModels,function(e){var n=e.coordinateSystem;t.push({panelId:`geo--`+e.id,geoModel:e,coordSysModel:e,coordSys:n,coordSyses:[n],getPanelRect:QG.geo})})}},ZG=[function(e,t){var n=e.xAxisModel,r=e.yAxisModel,i=e.gridModel;return!i&&n&&(i=n.axis.grid.model),!i&&r&&(i=r.axis.grid.model),i&&i===t.gridModel},function(e,t){var n=e.geoModel;return n&&n===t.geoModel}],QG={grid:function(){return this.coordSys.master.getRect().clone()},geo:function(){var e=this.coordSys,t=e.getBoundingRect().clone();return t.applyTransform(ff(e)),t}},$G={lineX:B(eK,0),lineY:B(eK,1),rect:function(e,t,n,r){var i=e?t.pointToData([n[0][0],n[1][0]],r):t.dataToPoint([n[0][0],n[1][0]],r),a=e?t.pointToData([n[0][1],n[1][1]],r):t.dataToPoint([n[0][1],n[1][1]],r),o=[JG([i[0],a[0]]),JG([i[1],a[1]])];return{values:o,xyMinMax:o}},polygon:function(e,t,n,r){var i=[[1/0,-1/0],[1/0,-1/0]];return{values:I(n,function(n){var a=e?t.pointToData(n,r):t.dataToPoint(n,r);return i[0][0]=Math.min(i[0][0],a[0]),i[1][0]=Math.min(i[1][0],a[1]),i[0][1]=Math.max(i[0][1],a[0]),i[1][1]=Math.max(i[1][1],a[1]),a}),xyMinMax:i}}};function eK(e,t,n,r){var i=n.getAxis([`x`,`y`][e]),a=JG(I([0,1],function(e){return t?i.coordToData(i.toLocalCoord(r[e]),!0):i.toGlobalCoord(i.dataToCoord(r[e]))})),o=[];return o[e]=a,o[1-e]=[NaN,NaN],{values:a,xyMinMax:o}}var tK={lineX:B(nK,0),lineY:B(nK,1),rect:function(e,t,n){return[[e[0][0]-n[0]*t[0][0],e[0][1]-n[0]*t[0][1]],[e[1][0]-n[1]*t[1][0],e[1][1]-n[1]*t[1][1]]]},polygon:function(e,t,n){return I(e,function(e,r){return[e[0]-n[0]*t[r][0],e[1]-n[1]*t[r][1]]})}};function nK(e,t,n,r){return[t[0]-r[e]*n[0],t[1]-r[e]*n[1]]}function rK(e,t){var n=iK(e),r=iK(t),i=[n[0]/r[0],n[1]/r[1]];return isNaN(i[0])&&(i[0]=1),isNaN(i[1])&&(i[1]=1),i}function iK(e){return e?[e[0][1]-e[0][0],e[1][1]-e[1][0]]:[NaN,NaN]}var aK=F,oK=bo(`toolbox-dataZoom_`),sK=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n,r){this._brushController||(this._brushController=new aL(n.getZr()),this._brushController.on(`brush`,z(this._onBrush,this)).mount()),dK(e,t,this,r,n),uK(e,t)},t.prototype.onclick=function(e,t,n){cK[n].call(this)},t.prototype.remove=function(e,t){this._brushController&&this._brushController.unmount()},t.prototype.dispose=function(e,t){this._brushController&&this._brushController.dispose()},t.prototype._onBrush=function(e){var t=e.areas;if(!e.isEnd||!t.length)return;var n={},r=this.ecModel;this._brushController.updateCovers([]),new qG(lK(this.model),r,{include:[`grid`]}).matchOutputRanges(t,r,function(e,t,n){if(n.type===`cartesian2d`){var r=e.brushType;r===`rect`?(i(`x`,n,t[0]),i(`y`,n,t[1])):i({lineX:`x`,lineY:`y`}[r],n,t)}}),BG(r,n),this._dispatchZoomAction(n);function i(e,t,i){var o=t.getAxis(e),s=o.model,c=a(e,s,r),l=c.findRepresentativeAxisProxy(s).getMinMaxSpan();(l.minValueSpan!=null||l.maxValueSpan!=null)&&(i=AI(0,i.slice(),o.scale.getExtent(),0,l.minValueSpan,l.maxValueSpan)),c&&(n[c.id]={dataZoomId:c.id,startValue:i[0],endValue:i[1]})}function a(e,t,n){var r;return n.eachComponent({mainType:`dataZoom`,subType:`select`},function(n){n.getAxisModel(e,t.componentIndex)&&(r=n)}),r}},t.prototype._dispatchZoomAction=function(e){var t=[];aK(e,function(e,n){t.push(O(e))}),t.length&&this.api.dispatchAction({type:`dataZoom`,from:this.uid,batch:t})},t.getDefaultOption=function(e){return{show:!0,filterMode:`filter`,icon:{zoom:`M0,13.5h26.9 M13.5,26.9V0 M32.1,13.5H58V58H13.5 V32.1`,back:`M22,1.4L9.9,13.5l12.3,12.3 M10.3,13.5H54.9v44.6 H10.3v-26`},title:e.getLocaleModel().get([`toolbox`,`dataZoom`,`title`]),brushStyle:{borderWidth:0,color:`rgba(210,219,238,0.2)`}}},t}(uG),cK={zoom:function(){var e=!this._isZoomActive;this.api.dispatchAction({type:`takeGlobalCursor`,key:`dataZoomSelect`,dataZoomSelectActive:e})},back:function(){this._dispatchZoomAction(VG(this.ecModel))}};function lK(e){var t={xAxisIndex:e.get(`xAxisIndex`,!0),yAxisIndex:e.get(`yAxisIndex`,!0),xAxisId:e.get(`xAxisId`,!0),yAxisId:e.get(`yAxisId`,!0)};return t.xAxisIndex==null&&t.xAxisId==null&&(t.xAxisIndex=`all`),t.yAxisIndex==null&&t.yAxisId==null&&(t.yAxisIndex=`all`),t}function uK(e,t){e.setIconStatus(`back`,UG(t)>1?`emphasis`:`normal`)}function dK(e,t,n,r,i){var a=n._isZoomActive;r&&r.type===`takeGlobalCursor`&&(a=r.key===`dataZoomSelect`&&r.dataZoomSelectActive),n._isZoomActive=a,e.setIconStatus(`zoom`,a?`emphasis`:`normal`);var o=new qG(lK(e),t,{include:[`grid`]}).makePanelOpts(i,function(e){return e.xAxisDeclared&&!e.yAxisDeclared?`lineX`:!e.xAxisDeclared&&e.yAxisDeclared?`lineY`:`rect`});n._brushController.setPanels(o).enableBrush(a&&o.length?{brushType:`auto`,brushStyle:e.getModel(`brushStyle`).getItemStyle()}:!1)}Gm(`dataZoom`,function(e){var t=e.getComponent(`toolbox`,0),n=[`feature`,`dataZoom`];if(!t||t.get(n)==null)return;var r=t.getModel(n),i=[],a=Do(e,lK(r));aK(a.xAxisModels,function(e){return o(e,`xAxis`,`xAxisIndex`)}),aK(a.yAxisModels,function(e){return o(e,`yAxis`,`yAxisIndex`)});function o(e,t,n){var a=e.componentIndex,o={type:`select`,$fromToolbox:!0,filterMode:r.get(`filterMode`,!0)||`filter`,id:oK+t+a};o[n]=a,i.push(o)}return i});function fK(e){e.registerComponentModel(mG),e.registerComponentView(_G),fG(`saveAsImage`,yG),fG(`magicType`,SG),fG(`dataView`,IG),fG(`dataZoom`,sK),fG(`restore`,GG),$(lG)}var pK=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`tooltip`,t.dependencies=[`axisPointer`],t.defaultOption={z:60,show:!0,showContent:!0,trigger:`item`,triggerOn:`mousemove|click`,alwaysShowContent:!1,displayMode:`single`,renderMode:`auto`,confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:`#fff`,shadowBlur:10,shadowColor:`rgba(0, 0, 0, .2)`,shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:``,axisPointer:{type:`line`,axis:`auto`,animation:`auto`,animationDurationUpdate:200,animationEasingUpdate:`exponentialOut`,crossStyle:{color:`#999`,width:1,type:`dashed`,textStyle:{}}},textStyle:{color:`#666`,fontSize:14}},t}(Sm);function mK(e){var t=e.get(`confine`);return t==null?e.get(`renderMode`)===`richText`:!!t}function hK(e){if(a.domSupported){for(var t=document.documentElement.style,n=0,r=e.length;n-1?(s+=`top:50%`,c+=`translateY(-50%) rotate(`+(l=a===`left`?-225:-45)+`deg)`):(s+=`left:50%`,c+=`translateX(-50%) rotate(`+(l=a===`top`?225:45)+`deg)`);var u=l*Math.PI/180,d=o+i,f=d*Math.abs(Math.cos(u))+d*Math.abs(Math.sin(u)),p=Math.round(((f-Math.SQRT2*i)/2+Math.SQRT2*i-(f-d)/2)*100)/100;s+=`;`+a+`:-`+p+`px`;var m=t+` solid `+i+`px;`;return`
`}function TK(e,t){var n=`cubic-bezier(0.23,1,0.32,1)`,r=` `+e/2+`s `+n,i=`opacity`+r+`,visibility`+r;return t||(r=` `+e+`s `+n,i+=a.transformSupported?`,`+xK+r:`,left`+r+`,top`+r),bK+`:`+i}function EK(e,t,n){var r=e.toFixed(0)+`px`,i=t.toFixed(0)+`px`;if(!a.transformSupported)return n?`top:`+i+`;left:`+r+`;`:[[`top`,i],[`left`,r]];var o=a.transform3dSupported,s=`translate`+(o?`3d`:``)+`(`+r+`,`+i+(o?`,0`:``)+`)`;return n?`top:0;left:0;`+xK+`:`+s+`;`:[[`top`,0],[`left`,0],[gK,s]]}function DK(e){var t=[],n=e.get(`fontSize`),r=e.getTextColor();r&&t.push(`color:`+r),t.push(`font:`+e.getFont());var i=G(e.get(`lineHeight`),Math.round(n*3/2));n&&t.push(`line-height:`+i+`px`);var a=e.get(`textShadowColor`),o=e.get(`textShadowBlur`)||0,s=e.get(`textShadowOffsetX`)||0,c=e.get(`textShadowOffsetY`)||0;return a&&o&&t.push(`text-shadow:`+s+`px `+c+`px `+o+`px `+a),F([`decoration`,`align`],function(n){var r=e.get(n);r&&t.push(`text-`+n+`:`+r)}),t.join(`;`)}function OK(e,t,n){var r=[],i=e.get(`transitionDuration`),a=e.get(`backgroundColor`),o=e.get(`shadowBlur`),s=e.get(`shadowColor`),c=e.get(`shadowOffsetX`),l=e.get(`shadowOffsetY`),u=e.getModel(`textStyle`),d=D_(e,`html`),f=c+`px `+l+`px `+o+`px `+s;return r.push(`box-shadow:`+f),t&&i&&r.push(TK(i,n)),a&&r.push(`background-color:`+a),F([`width`,`color`,`radius`],function(t){var n=`border-`+t,i=Qp(n),a=e.get(i);a!=null&&r.push(n+`:`+a+(t===`color`?``:`px`))}),r.push(DK(u)),d!=null&&r.push(`padding:`+$p(d).join(`px `)+`px`),r.join(`;`)+`;`}function kK(e,t,n,r,i){var a=t&&t.painter;if(n){var o=a&&a.getViewportRoot();o&&at(e,o,n,r,i)}else{e[0]=r,e[1]=i;var s=a&&a.getViewportRootOffset();s&&(e[0]+=s.offsetLeft,e[1]+=s.offsetTop)}e[2]=e[0]/t.getWidth(),e[3]=e[1]/t.getHeight()}var AK=function(){function e(e,t){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,a.wxa)return null;var n=document.createElement(`div`);n.domBelongToZr=!0,this.el=n;var r=this._zr=e.getZr(),i=t.appendTo,o=i&&(U(i)?document.querySelector(i):le(i)?i:H(i)&&i(e.getDom()));kK(this._styleCoord,r,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(e){if(e||=window.event,!s._enterable){var t=r.handler;yt(r.painter.getViewportRoot(),e,!0),t.dispatch(`mousemove`,e)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return e.prototype.update=function(e){if(!this._container){var t=this._api.getDom(),n=yK(t,`position`),r=t.style;r.position!==`absolute`&&n!==`absolute`&&(r.position=`relative`)}var i=e.get(`alwaysShowContent`);i&&this._moveIfResized(),this._alwaysShowContent=i,this.el.className=e.get(`className`)||``},e.prototype.show=function(e,t){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,r=n.style,i=this._styleCoord;n.innerHTML?r.cssText=SK+OK(e,!this._firstShow,this._longHide)+EK(i[0],i[1],!0)+(`border-color:`+om(t)+`;`)+(e.get(`extraCssText`)||``)+(`;pointer-events:`+(this._enterable?`auto`:`none`)):r.display=`none`,this._show=!0,this._firstShow=!1,this._longHide=!1},e.prototype.setContent=function(e,t,n,r,i){var a=this.el;if(e==null){a.innerHTML=``;return}var o=``;if(U(i)&&n.get(`trigger`)===`item`&&!mK(n)&&(o=wK(n,r,i)),U(e))a.innerHTML=e+o;else if(e){a.innerHTML=``,V(e)||(e=[e]);for(var s=0;s=0?this._tryShow(n,r):t===`leave`&&this._hide(r))},this))},t.prototype._keepShow=function(){var e=this._tooltipModel,t=this._ecModel,n=this._api,r=e.get(`triggerOn`);if(this._lastX!=null&&this._lastY!=null&&r!==`none`&&r!==`click`){var i=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!n.isDisposed()&&i.manuallyShowTip(e,t,n,{x:i._lastX,y:i._lastY,dataByCoordSys:i._lastDataByCoordSys})})}},t.prototype.manuallyShowTip=function(e,t,n,r){if(!(r.from===this.uid||a.node||!n.getDom())){var i=RK(r,n);this._ticket=``;var o=r.dataByCoordSys,s=UK(r,t,n);if(s){var c=s.el.getBoundingRect().clone();c.applyTransform(s.el.transform),this._tryShow({offsetX:c.x+c.width/2,offsetY:c.y+c.height/2,target:s.el,position:r.position,positionDefault:`bottom`},i)}else if(r.tooltip&&r.x!=null&&r.y!=null){var l=FK;l.x=r.x,l.y=r.y,l.update(),Q(l).tooltipConfig={name:null,option:r.tooltip},this._tryShow({offsetX:r.x,offsetY:r.y,target:l},i)}else if(o)this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,dataByCoordSys:o,tooltipOption:r.tooltipOption},i);else if(r.seriesIndex!=null){if(this._manuallyAxisShowTip(e,t,n,r))return;var u=eU(r,t),d=u.point[0],f=u.point[1];d!=null&&f!=null&&this._tryShow({offsetX:d,offsetY:f,target:u.el,position:r.position,positionDefault:`bottom`},i)}else r.x!=null&&r.y!=null&&(n.dispatchAction({type:`updateAxisPointer`,x:r.x,y:r.y}),this._tryShow({offsetX:r.x,offsetY:r.y,position:r.position,target:n.getZr().findHover(r.x,r.y).target},i))}},t.prototype.manuallyHideTip=function(e,t,n,r){var i=this._tooltipContent;this._tooltipModel&&i.hideLater(this._tooltipModel.get(`hideDelay`)),this._lastX=this._lastY=this._lastDataByCoordSys=null,r.from!==this.uid&&this._hide(RK(r,n))},t.prototype._manuallyAxisShowTip=function(e,t,n,r){var i=r.seriesIndex,a=r.dataIndex,o=t.getComponent(`axisPointer`).coordSysAxesInfo;if(i!=null&&a!=null&&o!=null){var s=t.getSeriesByIndex(i);if(s&&LK([s.getData().getItemModel(a),s,(s.coordinateSystem||{}).model],this._tooltipModel).get(`trigger`)===`axis`)return n.dispatchAction({type:`updateAxisPointer`,seriesIndex:i,dataIndex:a,position:r.position}),!0}},t.prototype._tryShow=function(e,t){var n=e.target;if(this._tooltipModel){this._lastX=e.offsetX,this._lastY=e.offsetY;var r=e.dataByCoordSys;if(r&&r.length)this._showAxisTooltip(r,e);else if(n){if(Q(n).ssrType===`legend`)return;this._lastDataByCoordSys=null;var i,a;Yv(n,function(e){if(Q(e).dataIndex!=null)return i=e,!0;if(Q(e).tooltipConfig!=null)return a=e,!0},!0),i?this._showSeriesItemTooltip(e,i,t):a?this._showComponentItemTooltip(e,a,t):this._hide(t)}else this._lastDataByCoordSys=null,this._hide(t)}},t.prototype._showOrMove=function(e,t){var n=e.get(`showDelay`);t=z(t,this),clearTimeout(this._showTimout),n>0?this._showTimout=setTimeout(t,n):t()},t.prototype._showAxisTooltip=function(e,t){var n=this._ecModel,r=this._tooltipModel,i=[t.offsetX,t.offsetY],a=LK([t.tooltipOption],r),o=this._renderMode,s=[],c=p_(`section`,{blocks:[],noHeader:!0}),l=[],u=new O_;F(e,function(e){F(e.dataByAxis,function(e){var t=n.getComponent(e.axisDim+`Axis`,e.axisIndex),i=e.value;if(!(!t||i==null)){var a=NH(i,t.axis,n,e.seriesDataIndices,e.valueLabelOpt),d=p_(`section`,{header:a,noHeader:!ye(a),sortBlocks:!0,blocks:[]});c.blocks.push(d),F(e.seriesDataIndices,function(c){var f=n.getSeriesByIndex(c.seriesIndex),p=c.dataIndexInside,m=f.getDataParams(p);if(!(m.dataIndex<0)){m.axisDim=e.axisDim,m.axisIndex=e.axisIndex,m.axisType=e.axisType,m.axisId=e.axisId,m.axisValue=RC(t.axis,{value:i}),m.axisValueLabel=a,m.marker=u.makeTooltipMarker(`item`,om(m.color),o);var h=Cg(f.formatTooltip(p,!0,null)),g=h.frag;if(g){var _=LK([f],r).get(`valueFormatter`);d.blocks.push(_?j({valueFormatter:_},g):g)}h.text&&l.push(h.text),s.push(m)}})}})}),c.blocks.reverse(),l.reverse();var d=t.position,f=y_(c,u,o,a.get(`order`),n.get(`useUTC`),a.get(`textStyle`));f&&l.unshift(f);var p=o===`richText`?` + +`:`
`,m=l.join(p);this._showOrMove(a,function(){this._updateContentNotChangedOnAxis(e,s)?this._updatePosition(a,d,i[0],i[1],this._tooltipContent,s):this._showTooltipContent(a,m,s,Math.random()+``,i[0],i[1],d,null,u)})},t.prototype._showSeriesItemTooltip=function(e,t,n){var r=this._ecModel,i=Q(t),a=i.seriesIndex,o=r.getSeriesByIndex(a),s=i.dataModel||o,c=i.dataIndex,l=i.dataType,u=s.getData(l),d=this._renderMode,f=e.positionDefault,p=LK([u.getItemModel(c),s,o&&(o.coordinateSystem||{}).model],this._tooltipModel,f?{position:f}:null),m=p.get(`trigger`);if(m==null||m===`item`){var h=s.getDataParams(c,l),g=new O_;h.marker=g.makeTooltipMarker(`item`,om(h.color),d);var _=Cg(s.formatTooltip(c,!1,l)),v=p.get(`order`),y=p.get(`valueFormatter`),b=_.frag,x=b?y_(y?j({valueFormatter:y},b):b,g,d,v,r.get(`useUTC`),p.get(`textStyle`)):_.text,S=`item_`+s.name+`_`+c;this._showOrMove(p,function(){this._showTooltipContent(p,x,h,S,e.offsetX,e.offsetY,e.position,e.target,g)}),n({type:`showTip`,dataIndexInside:c,dataIndex:u.getRawIndex(c),seriesIndex:a,from:this.uid})}},t.prototype._showComponentItemTooltip=function(e,t,n){var r=this._renderMode===`html`,i=Q(t),a=i.tooltipConfig.option||{},o=a.encodeHTMLContent;if(U(a)){var s=a;a={content:s,formatter:s},o=!0}o&&r&&a.content&&(a=O(a),a.content=ft(a.content));var c=[a],l=this._ecModel.getComponent(i.componentMainType,i.componentIndex);l&&c.push(l),c.push({formatter:a.content});var u=e.positionDefault,d=LK(c,this._tooltipModel,u?{position:u}:null),f=d.get(`content`),p=Math.random()+``,m=new O_;this._showOrMove(d,function(){var n=O(d.get(`formatterParams`)||{});this._showTooltipContent(d,f,n,p,e.offsetX,e.offsetY,e.position,t,m)}),n({type:`showTip`,from:this.uid})},t.prototype._showTooltipContent=function(e,t,n,r,i,a,o,s,c){if(this._ticket=``,!(!e.get(`showContent`)||!e.get(`show`))){var l=this._tooltipContent;l.setEnterable(e.get(`enterable`));var u=e.get(`formatter`);o||=e.get(`position`);var d=t,f=this._getNearestPoint([i,a],n,e.get(`trigger`),e.get(`borderColor`)).color;if(u){if(U(u)){var p=e.ecModel.get(`useUTC`),m=V(n)?n[0]:n,h=m&&m.axisType&&m.axisType.indexOf(`time`)>=0;d=u,h&&(d=Np(m.axisValue,d,p)),d=rm(d,n,!0)}else if(H(u)){var g=z(function(t,r){t===this._ticket&&(l.setContent(r,c,e,f,o),this._updatePosition(e,o,i,a,l,n,s))},this);this._ticket=r,d=u(n,r,g)}else d=u}l.setContent(d,c,e,f,o),l.show(e,f),this._updatePosition(e,o,i,a,l,n,s)}},t.prototype._getNearestPoint=function(e,t,n,r){if(n===`axis`||V(t))return{color:r||(this._renderMode===`html`?`#fff`:`none`)};if(!V(t))return{color:r||t.color||t.borderColor}},t.prototype._updatePosition=function(e,t,n,r,i,a,o){var s=this._api.getWidth(),c=this._api.getHeight();t||=e.get(`position`);var l=i.getSize(),u=e.get(`align`),d=e.get(`verticalAlign`),f=o&&o.getBoundingRect().clone();if(o&&f.applyTransform(o.transform),H(t)&&(t=t([n,r],a,i.el,f,{viewSize:[s,c],contentSize:l.slice()})),V(t))n=Z(t[0],s),r=Z(t[1],c);else if(W(t)){var p=t;p.width=l[0],p.height=l[1];var m=mm(p,{width:s,height:c});n=m.x,r=m.y,u=null,d=null}else if(U(t)&&o){var h=VK(t,f,l,e.get(`borderWidth`));n=h[0],r=h[1]}else{var h=zK(n,r,i,s,c,u?null:20,d?null:20);n=h[0],r=h[1]}if(u&&(n-=HK(u)?l[0]/2:u===`right`?l[0]:0),d&&(r-=HK(d)?l[1]/2:d===`bottom`?l[1]:0),mK(e)){var h=BK(n,r,i,s,c);n=h[0],r=h[1]}i.moveTo(n,r)},t.prototype._updateContentNotChangedOnAxis=function(e,t){var n=this._lastDataByCoordSys,r=this._cbParamsList,i=!!n&&n.length===e.length;return i&&F(n,function(n,a){var o=n.dataByAxis||[],s=(e[a]||{}).dataByAxis||[];i&&=o.length===s.length,i&&F(o,function(e,n){var a=s[n]||{},o=e.seriesDataIndices||[],c=a.seriesDataIndices||[];i=i&&e.value===a.value&&e.axisType===a.axisType&&e.axisId===a.axisId&&o.length===c.length,i&&F(o,function(e,t){var n=c[t];i=i&&e.seriesIndex===n.seriesIndex&&e.dataIndex===n.dataIndex}),r&&F(e.seriesDataIndices,function(e){var n=e.seriesIndex,a=t[n],o=r[n];a&&o&&o.data!==a.data&&(i=!1)})})}),this._lastDataByCoordSys=e,this._cbParamsList=t,!!i},t.prototype._hide=function(e){this._lastDataByCoordSys=null,e({type:`hideTip`,from:this.uid})},t.prototype.dispose=function(e,t){a.node||!t.getDom()||(iv(this,`_updatePosition`),this._tooltipContent.dispose(),QH(`itemTooltip`,t))},t.type=`tooltip`,t}(U_);function LK(e,t,n){var r=t.ecModel,i;n?(i=new tp(n,r,r),i=new tp(t.option,i,r)):i=t;for(var a=e.length-1;a>=0;a--){var o=e[a];o&&(o instanceof tp&&(o=o.get(`tooltip`,!0)),U(o)&&(o={formatter:o}),o&&(i=new tp(o,i,r)))}return i}function RK(e,t){return e.dispatchAction||z(t.dispatchAction,t)}function zK(e,t,n,r,i,a,o){var s=n.getSize(),c=s[0],l=s[1];return a!=null&&(e+c+a+2>r?e-=c+a:e+=a),o!=null&&(t+l+o>i?t-=l+o:t+=o),[e,t]}function BK(e,t,n,r,i){var a=n.getSize(),o=a[0],s=a[1];return e=Math.min(e+o,r)-o,t=Math.min(t+s,i)-s,e=Math.max(e,0),t=Math.max(t,0),[e,t]}function VK(e,t,n,r){var i=n[0],a=n[1],o=Math.ceil(Math.SQRT2*r)+8,s=0,c=0,l=t.width,u=t.height;switch(e){case`inside`:s=t.x+l/2-i/2,c=t.y+u/2-a/2;break;case`top`:s=t.x+l/2-i/2,c=t.y-a-o;break;case`bottom`:s=t.x+l/2-i/2,c=t.y+u+o;break;case`left`:s=t.x-i-o,c=t.y+u/2-a/2;break;case`right`:s=t.x+l+o,c=t.y+u/2-a/2}return[s,c]}function HK(e){return e===`center`||e===`middle`}function UK(e,t,n){var r=Oo(e).queryOptionMap,i=r.keys()[0];if(!(!i||i===`series`)){var a=jo(t,i,r.get(i),{useDefault:!1,enableAll:!1,enableNone:!1}).models[0];if(a){var o=n.getViewOfComponentModel(a),s;if(o.group.traverse(function(t){var n=Q(t).tooltipConfig;if(n&&n.name===e.name)return s=t,!0}),s)return{componentMainType:i,componentIndex:a.componentIndex,el:s}}}}function WK(e){$(pU),e.registerComponentModel(pK),e.registerComponentView(IK),e.registerAction({type:`showTip`,event:`showTip`,update:`tooltip:manuallyShowTip`},Ae),e.registerAction({type:`hideTip`,event:`hideTip`,update:`tooltip:manuallyHideTip`},Ae)}var GK=[`rect`,`polygon`,`keep`,`clear`];function KK(e,t){var n=no(e?e.brush:[]);if(n.length){var r=[];F(n,function(e){var t=e.hasOwnProperty(`toolbox`)?e.toolbox:[];t instanceof Array&&(r=r.concat(t))});var i=e&&e.toolbox;V(i)&&(i=i[0]),i||(i={feature:{}},e.toolbox=[i]);var a=i.feature||(i.feature={}),o=a.brush||={},s=o.type||=[];s.push.apply(s,r),qK(s),t&&!s.length&&s.push.apply(s,GK)}}function qK(e){var t={};F(e,function(e){t[e]=1}),e.length=0,F(t,function(t,n){e.push(n)})}var JK=F;function YK(e){if(e){for(var t in e)if(e.hasOwnProperty(t))return!0}}function XK(e,t,n){var r={};return JK(t,function(t){var a=r[t]=i();JK(e[t],function(e,r){if(VN.isValidType(r)){var i={type:r,visual:e};n&&n(i,t),a[r]=new VN(i),r===`opacity`&&(i=O(i),i.type=`colorAlpha`,a.__hidden.__alphaForOpacity=new VN(i))}})}),r;function i(){var e=function(){};return e.prototype.__hidden=e.prototype,new e}}function ZK(e,t,n){var r;F(n,function(e){t.hasOwnProperty(e)&&YK(t[e])&&(r=!0)}),r&&F(n,function(n){t.hasOwnProperty(n)&&YK(t[n])?e[n]=O(t[n]):delete e[n]})}function QK(e,t,n,r,i,a){var o={};F(e,function(e){o[e]=VN.prepareVisualTypes(t[e])});var s;function c(e){return Uv(n,s,e)}function l(e,t){Gv(n,s,e,t)}a==null?n.each(u):n.each([a],u);function u(e,u){s=a==null?e:u;var d=n.getRawDataItem(s);if(!(d&&d.visualMap===!1))for(var f=r.call(i,e),p=t[f],m=o[f],h=0,g=m.length;ht[0][1]&&(t[0][1]=a[0]),a[1]t[1][1]&&(t[1][1]=a[1])}return t&&mq(t)}};function mq(e){return new Y(e[0][0],e[1][0],e[0][1]-e[0][0],e[1][1]-e[1][0])}var hq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){this.ecModel=e,this.api=t,this.model,(this._brushController=new aL(t.getZr())).on(`brush`,z(this._onBrush,this)).mount()},t.prototype.render=function(e,t,n,r){this.model=e,this._updateController(e,t,n,r)},t.prototype.updateTransform=function(e,t,n,r){sq(t),this._updateController(e,t,n,r)},t.prototype.updateVisual=function(e,t,n,r){this.updateTransform(e,t,n,r)},t.prototype.updateView=function(e,t,n,r){this._updateController(e,t,n,r)},t.prototype._updateController=function(e,t,n,r){(!r||r.$from!==e.id)&&this._brushController.setPanels(e.brushTargetManager.makePanelOpts(n)).enableBrush(e.brushOption).updateCovers(e.areas.slice())},t.prototype.dispose=function(){this._brushController.dispose()},t.prototype._onBrush=function(e){var t=this.model.id,n=this.model.brushTargetManager.setOutputRanges(e.areas,this.ecModel);(!e.isEnd||e.removeOnClick)&&this.api.dispatchAction({type:`brush`,brushId:t,areas:O(n),$from:t}),e.isEnd&&this.api.dispatchAction({type:`brushEnd`,brushId:t,areas:O(n),$from:t})},t.type=`brush`,t}(U_),gq=`#ddd`,_q=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.areas=[],n.brushOption={},n}return t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&ZK(n,e,[`inBrush`,`outOfBrush`]);var r=n.inBrush=n.inBrush||{};n.outOfBrush=n.outOfBrush||{color:gq},r.hasOwnProperty(`liftZ`)||(r.liftZ=5)},t.prototype.setAreas=function(e){e&&(this.areas=I(e,function(e){return vq(this.option,e)},this))},t.prototype.setBrushOption=function(e){this.brushOption=vq(this.option,e),this.brushType=this.brushOption.brushType},t.type=`brush`,t.dependencies=[`geo`,`grid`,`xAxis`,`yAxis`,`parallel`,`series`],t.defaultOption={seriesIndex:`all`,brushType:`rect`,brushMode:`single`,transformable:!0,brushStyle:{borderWidth:1,color:`rgba(210,219,238,0.3)`,borderColor:`#D2DBEE`},throttleType:`fixRate`,throttleDelay:0,removeOnClick:!0,z:1e4},t}(Sm);function vq(e,t){return k({brushType:e.brushType,brushMode:e.brushMode,transformable:e.transformable,brushStyle:new tp(e.brushStyle).getItemStyle(),removeOnClick:e.removeOnClick,z:e.z},t,!0)}var yq=[`rect`,`polygon`,`lineX`,`lineY`,`keep`,`clear`],bq=function(e){r(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.render=function(e,t,n){var r,i,a;t.eachComponent({mainType:`brush`},function(e){r=e.brushType,i=e.brushOption.brushMode||`single`,a||=!!e.areas.length}),this._brushType=r,this._brushMode=i,F(e.get(`type`,!0),function(t){e.setIconStatus(t,(t===`keep`?i===`multiple`:t===`clear`?a:t===r)?`emphasis`:`normal`)})},t.prototype.updateView=function(e,t,n){this.render(e,t,n)},t.prototype.getIcons=function(){var e=this.model,t=e.get(`icon`,!0),n={};return F(e.get(`type`,!0),function(e){t[e]&&(n[e]=t[e])}),n},t.prototype.onclick=function(e,t,n){var r=this._brushType,i=this._brushMode;n===`clear`?(t.dispatchAction({type:`axisAreaSelect`,intervals:[]}),t.dispatchAction({type:`brush`,command:`clear`,areas:[]})):t.dispatchAction({type:`takeGlobalCursor`,key:`brush`,brushOption:{brushType:n===`keep`?r:r!==n&&n,brushMode:n===`keep`?i===`multiple`?`single`:`multiple`:i}})},t.getDefaultOption=function(e){return{show:!0,type:yq.slice(),icon:{rect:`M7.3,34.7 M0.4,10V-0.2h9.8 M89.6,10V-0.2h-9.8 M0.4,60v10.2h9.8 M89.6,60v10.2h-9.8 M12.3,22.4V10.5h13.1 M33.6,10.5h7.8 M49.1,10.5h7.8 M77.5,22.4V10.5h-13 M12.3,31.1v8.2 M77.7,31.1v8.2 M12.3,47.6v11.9h13.1 M33.6,59.5h7.6 M49.1,59.5 h7.7 M77.5,47.6v11.9h-13`,polygon:`M55.2,34.9c1.7,0,3.1,1.4,3.1,3.1s-1.4,3.1-3.1,3.1 s-3.1-1.4-3.1-3.1S53.5,34.9,55.2,34.9z M50.4,51c1.7,0,3.1,1.4,3.1,3.1c0,1.7-1.4,3.1-3.1,3.1c-1.7,0-3.1-1.4-3.1-3.1 C47.3,52.4,48.7,51,50.4,51z M55.6,37.1l1.5-7.8 M60.1,13.5l1.6-8.7l-7.8,4 M59,19l-1,5.3 M24,16.1l6.4,4.9l6.4-3.3 M48.5,11.6 l-5.9,3.1 M19.1,12.8L9.7,5.1l1.1,7.7 M13.4,29.8l1,7.3l6.6,1.6 M11.6,18.4l1,6.1 M32.8,41.9 M26.6,40.4 M27.3,40.2l6.1,1.6 M49.9,52.1l-5.6-7.6l-4.9-1.2`,lineX:`M15.2,30 M19.7,15.6V1.9H29 M34.8,1.9H40.4 M55.3,15.6V1.9H45.9 M19.7,44.4V58.1H29 M34.8,58.1H40.4 M55.3,44.4 V58.1H45.9 M12.5,20.3l-9.4,9.6l9.6,9.8 M3.1,29.9h16.5 M62.5,20.3l9.4,9.6L62.3,39.7 M71.9,29.9H55.4`,lineY:`M38.8,7.7 M52.7,12h13.2v9 M65.9,26.6V32 M52.7,46.3h13.2v-9 M24.9,12H11.8v9 M11.8,26.6V32 M24.9,46.3H11.8v-9 M48.2,5.1l-9.3-9l-9.4,9.2 M38.9-3.9V12 M48.2,53.3l-9.3,9l-9.4-9.2 M38.9,62.3V46.4`,keep:`M4,10.5V1h10.3 M20.7,1h6.1 M33,1h6.1 M55.4,10.5V1H45.2 M4,17.3v6.6 M55.6,17.3v6.6 M4,30.5V40h10.3 M20.7,40 h6.1 M33,40h6.1 M55.4,30.5V40H45.2 M21,18.9h62.9v48.6H21V18.9z`,clear:`M22,14.7l30.9,31 M52.9,14.7L22,45.7 M4.7,16.8V4.2h13.1 M26,4.2h7.8 M41.6,4.2h7.8 M70.3,16.8V4.2H57.2 M4.7,25.9v8.6 M70.3,25.9v8.6 M4.7,43.2v12.6h13.1 M26,55.8h7.8 M41.6,55.8h7.8 M70.3,43.2v12.6H57.2`},title:e.getLocaleModel().get([`toolbox`,`brush`,`title`])}},t}(uG);function xq(e){e.registerComponentView(hq),e.registerComponentModel(_q),e.registerPreprocessor(KK),e.registerVisual(e.PRIORITY.VISUAL.BRUSH,cq),e.registerAction({type:`brush`,event:`brush`,update:`updateVisual`},function(e,t){t.eachComponent({mainType:`brush`,query:e},function(t){t.setAreas(e.areas)})}),e.registerAction({type:`brushSelect`,event:`brushSelected`,update:`none`},Ae),e.registerAction({type:`brushEnd`,event:`brushEnd`,update:`none`},Ae),fG(`brush`,bq)}var Sq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode={type:`box`,ignoreSize:!0},n}return t.type=`title`,t.defaultOption={z:6,show:!0,text:``,target:`blank`,subtext:``,subtarget:`blank`,left:0,top:0,backgroundColor:`rgba(0,0,0,0)`,borderColor:`#ccc`,borderWidth:0,padding:5,itemGap:10,textStyle:{fontSize:18,fontWeight:`bold`,color:`#464646`},subtextStyle:{fontSize:12,color:`#6E7079`}},t}(Sm),Cq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.render=function(e,t,n){if(this.group.removeAll(),e.get(`show`)){var r=this.group,i=e.getModel(`textStyle`),a=e.getModel(`subtextStyle`),o=e.get(`textAlign`),s=G(e.get(`textBaseline`),e.get(`textVerticalAlign`)),c=new Zc({style:Nf(i,{text:e.get(`text`),fill:i.getTextColor()},{disableBox:!0}),z2:10}),l=c.getBoundingRect(),u=e.get(`subtext`),d=new Zc({style:Nf(a,{text:u,fill:a.getTextColor(),y:l.height+e.get(`itemGap`),verticalAlign:`top`},{disableBox:!0}),z2:10}),f=e.get(`link`),p=e.get(`sublink`),m=e.get(`triggerEvent`,!0);c.silent=!f&&!m,d.silent=!p&&!m,f&&c.on(`click`,function(){sm(f,`_`+e.get(`target`))}),p&&d.on(`click`,function(){sm(p,`_`+e.get(`subtarget`))}),Q(c).eventData=Q(d).eventData=m?{componentType:`title`,componentIndex:e.componentIndex}:null,r.add(c),u&&r.add(d);var h=r.getBoundingRect(),g=e.getBoxLayoutParams();g.width=h.width,g.height=h.height;var _=mm(g,{width:n.getWidth(),height:n.getHeight()},e.get(`padding`));o||(o=e.get(`left`)||e.get(`right`),o===`middle`&&(o=`center`),o===`right`?_.x+=_.width:o===`center`&&(_.x+=_.width/2)),s||(s=e.get(`top`)||e.get(`bottom`),s===`center`&&(s=`middle`),s===`bottom`?_.y+=_.height:s===`middle`&&(_.y+=_.height/2),s||=`top`),r.x=_.x,r.y=_.y,r.markRedraw();var v={align:o,verticalAlign:s};c.setStyle(v),d.setStyle(v),h=r.getBoundingRect();var y=_.margin,b=e.getItemStyle([`color`,`opacity`]);b.fill=e.get(`backgroundColor`);var x=new qc({shape:{x:h.x-y[3],y:h.y-y[0],width:h.width+y[1]+y[3],height:h.height+y[0]+y[2],r:e.get(`borderRadius`)},style:b,subPixelOptimize:!0,silent:!0});r.add(x)}},t.type=`title`,t}(U_);function wq(e){e.registerComponentModel(Sq),e.registerComponentView(Cq)}var Tq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.layoutMode=`box`,n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n),this._initData()},t.prototype.mergeOption=function(t){e.prototype.mergeOption.apply(this,arguments),this._initData()},t.prototype.setCurrentIndex=function(e){e??=this.option.currentIndex;var t=this._data.count();this.option.loop?e=(e%t+t)%t:(e>=t&&(e=t-1),e<0&&(e=0)),this.option.currentIndex=e},t.prototype.getCurrentIndex=function(){return this.option.currentIndex},t.prototype.isIndexMax=function(){return this.getCurrentIndex()>=this._data.count()-1},t.prototype.setPlayState=function(e){this.option.autoPlay=!!e},t.prototype.getPlayState=function(){return!!this.option.autoPlay},t.prototype._initData=function(){var e=this.option,t=e.data||[],n=e.axisType,r=this._names=[],i;n===`category`?(i=[],F(t,function(e,t){var n=_o(ao(e),``),a;W(e)?(a=O(e),a.value=t):a=t,i.push(a),r.push(n)})):i=t;var a={category:`ordinal`,time:`time`,value:`number`}[n]||`number`;(this._data=new lS([{name:`value`,type:a}],this)).initData(i,r)},t.prototype.getData=function(){return this._data},t.prototype.getCategories=function(){if(this.get(`axisType`)===`category`)return this._names.slice()},t.type=`timeline`,t.defaultOption={z:4,show:!0,axisType:`time`,realtime:!0,left:`20%`,top:null,right:`20%`,bottom:0,width:null,height:40,padding:5,controlPosition:`left`,autoPlay:!1,rewind:!1,loop:!0,playInterval:2e3,currentIndex:0,itemStyle:{},label:{color:`#000`},data:[]},t}(Sm),Eq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`timeline.slider`,t.defaultOption=op(Tq.defaultOption,{backgroundColor:`rgba(0,0,0,0)`,borderColor:`#ccc`,borderWidth:0,orient:`horizontal`,inverse:!1,tooltip:{trigger:`item`},symbol:`circle`,symbolSize:12,lineStyle:{show:!0,width:2,color:`#DAE1F5`},label:{position:`auto`,show:!0,interval:`auto`,rotate:0,color:`#A4B1D7`},itemStyle:{color:`#A4B1D7`,borderWidth:1},checkpointStyle:{symbol:`circle`,symbolSize:15,color:`#316bf3`,borderColor:`#fff`,borderWidth:2,shadowBlur:2,shadowOffsetX:1,shadowOffsetY:1,shadowColor:`rgba(0, 0, 0, 0.3)`,animation:!0,animationDuration:300,animationEasing:`quinticInOut`},controlStyle:{show:!0,showPlayBtn:!0,showPrevBtn:!0,showNextBtn:!0,itemSize:24,itemGap:12,position:`left`,playIcon:`path://M31.6,53C17.5,53,6,41.5,6,27.4S17.5,1.8,31.6,1.8C45.7,1.8,57.2,13.3,57.2,27.4S45.7,53,31.6,53z M31.6,3.3 C18.4,3.3,7.5,14.1,7.5,27.4c0,13.3,10.8,24.1,24.1,24.1C44.9,51.5,55.7,40.7,55.7,27.4C55.7,14.1,44.9,3.3,31.6,3.3z M24.9,21.3 c0-2.2,1.6-3.1,3.5-2l10.5,6.1c1.899,1.1,1.899,2.9,0,4l-10.5,6.1c-1.9,1.1-3.5,0.2-3.5-2V21.3z`,stopIcon:`path://M30.9,53.2C16.8,53.2,5.3,41.7,5.3,27.6S16.8,2,30.9,2C45,2,56.4,13.5,56.4,27.6S45,53.2,30.9,53.2z M30.9,3.5C17.6,3.5,6.8,14.4,6.8,27.6c0,13.3,10.8,24.1,24.101,24.1C44.2,51.7,55,40.9,55,27.6C54.9,14.4,44.1,3.5,30.9,3.5z M36.9,35.8c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H36c0.5,0,0.9,0.4,0.9,1V35.8z M27.8,35.8 c0,0.601-0.4,1-0.9,1h-1.3c-0.5,0-0.9-0.399-0.9-1V19.5c0-0.6,0.4-1,0.9-1H27c0.5,0,0.9,0.4,0.9,1L27.8,35.8L27.8,35.8z`,nextIcon:`M2,18.5A1.52,1.52,0,0,1,.92,18a1.49,1.49,0,0,1,0-2.12L7.81,9.36,1,3.11A1.5,1.5,0,1,1,3,.89l8,7.34a1.48,1.48,0,0,1,.49,1.09,1.51,1.51,0,0,1-.46,1.1L3,18.08A1.5,1.5,0,0,1,2,18.5Z`,prevIcon:`M10,.5A1.52,1.52,0,0,1,11.08,1a1.49,1.49,0,0,1,0,2.12L4.19,9.64,11,15.89a1.5,1.5,0,1,1-2,2.22L1,10.77A1.48,1.48,0,0,1,.5,9.68,1.51,1.51,0,0,1,1,8.58L9,.92A1.5,1.5,0,0,1,10,.5Z`,prevBtnSize:18,nextBtnSize:18,color:`#A4B1D7`,borderColor:`#A4B1D7`,borderWidth:1},emphasis:{label:{show:!0,color:`#6f778d`},itemStyle:{color:`#316BF3`},controlStyle:{color:`#316BF3`,borderColor:`#316BF3`,borderWidth:2}},progress:{lineStyle:{color:`#316BF3`},itemStyle:{color:`#316BF3`},label:{color:`#6f778d`}},data:[]}),t}(Tq);P(Eq,Sg.prototype);var Dq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`timeline`,t}(U_),Oq=function(e){r(t,e);function t(t,n,r,i){var a=e.call(this,t,n,r)||this;return a.type=i||`value`,a}return t.prototype.getLabelModel=function(){return this.model.getModel(`label`)},t.prototype.isHorizontal=function(){return this.model.get(`orient`)===`horizontal`},t}(Tw),kq=Math.PI,Aq=To(),jq=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(e,t){this.api=t},t.prototype.render=function(e,t,n){if(this.model=e,this.api=n,this.ecModel=t,this.group.removeAll(),e.get(`show`,!0)){var r=this._layout(e,n),i=this._createGroup(`_mainGroup`),a=this._createGroup(`_labelGroup`),o=this._axis=this._createAxis(r,e);e.formatTooltip=function(e){return p_(`nameValue`,{noName:!0,value:o.scale.getLabel({value:e})})},F([`AxisLine`,`AxisTick`,`Control`,`CurrentPointer`],function(t){this[`_render`+t](r,i,o,e)},this),this._renderAxisLabel(r,a,o,e),this._position(r,e)}this._doPlayStop(),this._updateTicksStatus()},t.prototype.remove=function(){this._clearTimer(),this.group.removeAll()},t.prototype.dispose=function(){this._clearTimer()},t.prototype._layout=function(e,t){var n=e.get([`label`,`position`]),r=e.get(`orient`),i=Nq(e,t),a=n==null||n===`auto`?r===`horizontal`?i.y+i.height/2=0||a===`+`?`left`:`right`},s={horizontal:a>=0||a===`+`?`top`:`bottom`,vertical:`middle`},c={horizontal:0,vertical:kq/2},l=r===`vertical`?i.height:i.width,u=e.getModel(`controlStyle`),d=u.get(`show`,!0),f=d?u.get(`itemSize`):0,p=d?u.get(`itemGap`):0,m=f+p,h=e.get([`label`,`rotate`])||0;h=h*kq/180;var g,_,v,y=u.get(`position`,!0),b=d&&u.get(`showPlayBtn`,!0),x=d&&u.get(`showPrevBtn`,!0),S=d&&u.get(`showNextBtn`,!0),C=0,w=l;y===`left`||y===`bottom`?(b&&(g=[0,0],C+=m),x&&(_=[C,0],C+=m),S&&(v=[w-f,0],w-=m)):(b&&(g=[w-f,0],w-=m),x&&(_=[0,0],C+=m),S&&(v=[w-f,0],w-=m));var T=[C,w];return e.get(`inverse`)&&T.reverse(),{viewRect:i,mainLength:l,orient:r,rotation:c[r],labelRotation:h,labelPosOpt:a,labelAlign:e.get([`label`,`align`])||o[r],labelBaseline:e.get([`label`,`verticalAlign`])||e.get([`label`,`baseline`])||s[r],playPosition:g,prevBtnPosition:_,nextBtnPosition:v,axisExtent:T,controlSize:f,controlGap:p}},t.prototype._position=function(e,t){var n=this._mainGroup,r=this._labelGroup,i=e.viewRect;if(e.orient===`vertical`){var a=kt(),o=i.x,s=i.y+i.height;Nt(a,a,[-o,-s]),Pt(a,a,-kq/2),Nt(a,a,[o,s]),i=i.clone(),i.applyTransform(a)}var c=g(i),l=g(n.getBoundingRect()),u=g(r.getBoundingRect()),d=[n.x,n.y],f=[r.x,r.y];f[0]=d[0]=c[0][0];var p=e.labelPosOpt;if(p==null||U(p)){var m=p===`+`?0:1;_(d,l,c,1,m),_(f,u,c,1,1-m)}else{var m=p>=0?0:1;_(d,l,c,1,m),f[1]=d[1]+p}n.setPosition(d),r.setPosition(f),n.rotation=r.rotation=e.rotation,h(n),h(r);function h(e){e.originX=c[0][0]-e.x,e.originY=c[1][0]-e.y}function g(e){return[[e.x,e.x+e.width],[e.y,e.y+e.height]]}function _(e,t,n,r,i){e[r]+=n[r][i]-t[r][i]}},t.prototype._createAxis=function(e,t){var n=t.getData(),r=t.get(`axisType`),i=Mq(t,r);i.getTicks=function(){return n.mapArray([`value`],function(e){return{value:e}})};var a=n.getDataExtent(`value`);i.setExtent(a[0],a[1]),i.calcNiceTicks();var o=new Oq(`value`,i,e.axisExtent,r);return o.model=t,o},t.prototype._createGroup=function(e){var t=this[e]=new X;return this.group.add(t),t},t.prototype._renderAxisLine=function(e,t,n,r){var i=n.getExtent();if(r.get([`lineStyle`,`show`])){var a=new yd({shape:{x1:i[0],y1:0,x2:i[1],y2:0},style:j({lineCap:`round`},r.getModel(`lineStyle`).getLineStyle()),silent:!0,z2:1});t.add(a);var o=this._progressLine=new yd({shape:{x1:i[0],x2:this._currentPointer?this._currentPointer.x:i[0],y1:0,y2:0},style:M({lineCap:`round`,lineWidth:a.style.lineWidth},r.getModel([`progress`,`lineStyle`]).getLineStyle()),silent:!0,z2:1});t.add(o)}},t.prototype._renderAxisTick=function(e,t,n,r){var i=this,a=r.getData(),o=n.scale.getTicks();this._tickSymbols=[],F(o,function(e){var o=n.dataToCoord(e.value),s=a.getItemModel(e.value),c=s.getModel(`itemStyle`),l=s.getModel([`emphasis`,`itemStyle`]),u=s.getModel([`progress`,`itemStyle`]),d=Fq(s,c,t,{x:o,y:0,onclick:z(i._changeTimeline,i,e.value)});d.ensureState(`emphasis`).style=l.getItemStyle(),d.ensureState(`progress`).style=u.getItemStyle(),au(d);var f=Q(d);s.get(`tooltip`)?(f.dataIndex=e.value,f.dataModel=r):f.dataIndex=f.dataModel=null,i._tickSymbols.push(d)})},t.prototype._renderAxisLabel=function(e,t,n,r){var i=this;if(n.getLabelModel().get(`show`)){var a=r.getData(),o=n.getViewLabels();this._tickLabels=[],F(o,function(r){var o=r.tickValue,s=a.getItemModel(o),c=s.getModel(`label`),l=s.getModel([`emphasis`,`label`]),u=s.getModel([`progress`,`label`]),d=new Zc({x:n.dataToCoord(r.tickValue),y:0,rotation:e.labelRotation-e.rotation,onclick:z(i._changeTimeline,i,o),silent:!1,style:Nf(c,{text:r.formattedLabel,align:e.labelAlign,verticalAlign:e.labelBaseline})});d.ensureState(`emphasis`).style=Nf(l),d.ensureState(`progress`).style=Nf(u),t.add(d),au(d),Aq(d).dataIndex=o,i._tickLabels.push(d)})}},t.prototype._renderControl=function(e,t,n,r){var i=e.controlSize,a=e.rotation,o=r.getModel(`controlStyle`).getItemStyle(),s=r.getModel([`emphasis`,`controlStyle`]).getItemStyle(),c=r.getPlayState(),l=r.get(`inverse`,!0);u(e.nextBtnPosition,`next`,z(this._changeTimeline,this,l?`-`:`+`)),u(e.prevBtnPosition,`prev`,z(this._changeTimeline,this,l?`+`:`-`)),u(e.playPosition,c?`stop`:`play`,z(this._handlePlayClick,this,!c),!0);function u(e,n,c,l){if(e){var u=na(G(r.get([`controlStyle`,n+`BtnSize`]),i),i),d=[0,-u/2,u,u],f=Pq(r,n+`Icon`,d,{x:e[0],y:e[1],originX:i/2,originY:0,rotation:l?-a:0,rectHover:!0,style:o,onclick:c});f.ensureState(`emphasis`).style=s,t.add(f),au(f)}}},t.prototype._renderCurrentPointer=function(e,t,n,r){var i=r.getData(),a=r.getCurrentIndex(),o=i.getItemModel(a).getModel(`checkpointStyle`),s=this,c={onCreate:function(e){e.draggable=!0,e.drift=z(s._handlePointerDrag,s),e.ondragend=z(s._handlePointerDragend,s),Iq(e,s._progressLine,a,n,r,!0)},onUpdate:function(e){Iq(e,s._progressLine,a,n,r)}};this._currentPointer=Fq(o,o,this._mainGroup,{},this._currentPointer,c)},t.prototype._handlePlayClick=function(e){this._clearTimer(),this.api.dispatchAction({type:`timelinePlayChange`,playState:e,from:this.uid})},t.prototype._handlePointerDrag=function(e,t,n){this._clearTimer(),this._pointerChangeTimeline([n.offsetX,n.offsetY])},t.prototype._handlePointerDragend=function(e){this._pointerChangeTimeline([e.offsetX,e.offsetY],!0)},t.prototype._pointerChangeTimeline=function(e,t){var n=this._toAxisCoord(e)[0],r=this._axis,i=Ma(r.getExtent().slice());n>i[1]&&(n=i[1]),n=0&&(o[a]=+o[a].toFixed(d)),[o,u]}var Zq={min:B(Xq,`min`),max:B(Xq,`max`),average:B(Xq,`average`),median:B(Xq,`median`)};function Qq(e,t){if(t){var n=e.getData(),r=e.coordinateSystem,i=r&&r.dimensions;if(!Yq(t)&&!V(t.coord)&&V(i)){var a=$q(t,n,r,e);if(t=O(t),t.type&&Zq[t.type]&&a.baseAxis&&a.valueAxis){var o=N(i,a.baseAxis.dim),s=N(i,a.valueAxis.dim),c=Zq[t.type](n,a.baseDataDim,a.valueDataDim,o,s);t.coord=c[0],t.value=c[1]}else t.coord=[t.xAxis==null?t.radiusAxis:t.xAxis,t.yAxis==null?t.angleAxis:t.yAxis]}if(t.coord==null||!V(i))t.coord=[];else for(var l=t.coord,u=0;u<2;u++)Zq[l[u]]&&(l[u]=iJ(n,n.mapDimension(i[u]),l[u]));return t}}function $q(e,t,n,r){var i={};return e.valueIndex!=null||e.valueDim!=null?(i.valueDataDim=e.valueIndex==null?e.valueDim:t.getDimension(e.valueIndex),i.valueAxis=n.getAxis(eJ(r,i.valueDataDim)),i.baseAxis=n.getOtherAxis(i.valueAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim)):(i.baseAxis=r.getBaseAxis(),i.valueAxis=n.getOtherAxis(i.baseAxis),i.baseDataDim=t.mapDimension(i.baseAxis.dim),i.valueDataDim=t.mapDimension(i.valueAxis.dim)),i}function eJ(e,t){var n=e.getData().getDimensionInfo(t);return n&&n.coordDim}function tJ(e,t){return e&&e.containData&&t.coord&&!Jq(t)?e.containData(t.coord):!0}function nJ(e,t,n){return e&&e.containZone&&t.coord&&n.coord&&!Jq(t)&&!Jq(n)?e.containZone(t.coord,n.coord):!0}function rJ(e,t){return e?function(e,n,r,i){return Dg(i<2?e.coord&&e.coord[i]:e.value,t[i])}:function(e,n,r,i){return Dg(e.value,t[i])}}function iJ(e,t,n){if(n===`average`){var r=0,i=0;return e.each(t,function(e,t){isNaN(e)||(r+=e,i++)}),r/i}return n===`median`?e.getMedian(t):e.getDataExtent(t)[+(n===`max`)]}var aJ=To(),oJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.init=function(){this.markerGroupMap=K()},t.prototype.render=function(e,t,n){var r=this,i=this.markerGroupMap;i.each(function(e){aJ(e).keep=!1}),t.eachSeries(function(e){var i=Kq.getMarkerModelFromSeries(e,r.type);i&&r.renderSeries(e,i,t,n)}),i.each(function(e){!aJ(e).keep&&r.group.remove(e.group)})},t.prototype.markKeep=function(e){aJ(e).keep=!0},t.prototype.toggleBlurSeries=function(e,t){var n=this;F(e,function(e){var r=Kq.getMarkerModelFromSeries(e,n.type);r&&r.getData().eachItemGraphicEl(function(e){e&&(t?Wl(e):Gl(e))})})},t.type=`marker`,t}(U_);function sJ(e,t,n){var r=t.coordinateSystem;e.each(function(i){var a=e.getItemModel(i),o,s=Z(a.get(`x`),n.getWidth()),c=Z(a.get(`y`),n.getHeight());if(!isNaN(s)&&!isNaN(c))o=[s,c];else if(t.getMarkerPosition)o=t.getMarkerPosition(e.getValues(e.dimensions,i));else if(r){var l=e.get(r.dimensions[0],i),u=e.get(r.dimensions[1],i);o=r.dataToPoint([l,u])}isNaN(s)||(o[0]=s),isNaN(c)||(o[1]=c),e.setItemLayout(i,o)})}var cJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Kq.getMarkerModelFromSeries(e,`markPoint`);t&&(sJ(t.getData(),e,n),this.markerGroupMap.get(e.id).updateLayout())},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new uD),l=lJ(i,e,t);t.setData(l),sJ(t.getData(),e,r),l.each(function(e){var n=l.getItemModel(e),r=n.getShallow(`symbol`),i=n.getShallow(`symbolSize`),a=n.getShallow(`symbolRotate`),s=n.getShallow(`symbolOffset`),c=n.getShallow(`symbolKeepAspect`);if(H(r)||H(i)||H(a)||H(s)){var u=t.getRawValue(e),d=t.getDataParams(e);H(r)&&(r=r(u,d)),H(i)&&(i=i(u,d)),H(a)&&(a=a(u,d)),H(s)&&(s=s(u,d))}var f=n.getModel(`itemStyle`).getItemStyle(),p=Wv(o,`color`);f.fill||=p,l.setItemVisual(e,{symbol:r,symbolSize:i,symbolRotate:a,symbolOffset:s,symbolKeepAspect:c,style:f})}),c.updateData(l),this.group.add(c.group),l.eachItemGraphicEl(function(e){e.traverse(function(e){Q(e).dataModel=t})}),this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markPoint`,t}(oJ);function lJ(e,t,n){var r=e?I(e&&e.dimensions,function(e){return j(j({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new lS(r,n),a=I(n.get(`data`),B(Qq,t));e&&(a=L(a,B(tJ,e)));var o=rJ(!!e,r);return i.initData(a,null,o),i}function uJ(e){e.registerComponentModel(qq),e.registerComponentView(cJ),e.registerPreprocessor(function(e){Uq(e.series,`markPoint`)&&(e.markPoint=e.markPoint||{})})}var dJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markLine`,t.defaultOption={z:5,symbol:[`circle`,`arrow`],symbolSize:[8,16],symbolOffset:0,precision:2,tooltip:{trigger:`item`},label:{show:!0,position:`end`,distance:5},lineStyle:{type:`dashed`},emphasis:{label:{show:!0},lineStyle:{width:3}},animationEasing:`linear`},t}(Kq),fJ=To(),pJ=function(e,t,n,r){var i=e.getData(),a;if(V(r))a=r;else{var o=r.type;if(o===`min`||o===`max`||o===`average`||o===`median`||r.xAxis!=null||r.yAxis!=null){var s=void 0,c=void 0;if(r.yAxis!=null||r.xAxis!=null)s=t.getAxis(r.yAxis==null?`x`:`y`),c=me(r.yAxis,r.xAxis);else{var l=$q(r,i,t,e);s=l.valueAxis,c=iJ(i,xS(i,l.valueDataDim),o)}var u=s.dim===`x`?0:1,d=1-u,f=O(r),p={coord:[]};f.type=null,f.coord=[],f.coord[d]=-1/0,p.coord[d]=1/0;var m=n.get(`precision`);m>=0&&oe(c)&&(c=+c.toFixed(Math.min(m,20))),f.coord[u]=p.coord[u]=c,a=[f,p,{type:o,valueIndex:r.valueIndex,value:c}]}else a=[]}var h=[Qq(e,a[0]),Qq(e,a[1]),j({},a[2])];return h[2].type=h[2].type||null,k(h[2],h[0]),k(h[2],h[1]),h};function mJ(e){return!isNaN(e)&&!isFinite(e)}function hJ(e,t,n,r){var i=1-e,a=r.dimensions[e];return mJ(t[i])&&mJ(n[i])&&t[e]===n[e]&&r.getAxis(a).containData(t[e])}function gJ(e,t){if(e.type===`cartesian2d`){var n=t[0].coord,r=t[1].coord;if(n&&r&&(hJ(1,n,r,e)||hJ(0,n,r,e)))return!0}return tJ(e,t[0])&&tJ(e,t[1])}function _J(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Z(o.get(`x`),i.getWidth()),l=Z(o.get(`y`),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition)s=r.getMarkerPosition(e.getValues(e.dimensions,t));else{var u=a.dimensions,d=e.get(u[0],t),f=e.get(u[1],t);s=a.dataToPoint([d,f])}if(DD(a,`cartesian2d`)){var p=a.getAxis(`x`),m=a.getAxis(`y`),u=a.dimensions;mJ(e.get(u[0],t))?s[0]=p.toGlobalCoord(p.getExtent()[+!n]):mJ(e.get(u[1],t))&&(s[1]=m.toGlobalCoord(m.getExtent()[+!n]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}e.setItemLayout(t,s)}var vJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Kq.getMarkerModelFromSeries(e,`markLine`);if(t){var r=t.getData(),i=fJ(t).from,a=fJ(t).to;i.each(function(t){_J(i,t,!0,e,n),_J(a,t,!1,e,n)}),r.each(function(e){r.setItemLayout(e,[i.getItemLayout(e),a.getItemLayout(e)])}),this.markerGroupMap.get(e.id).updateLayout()}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,new SF);this.group.add(c.group);var l=yJ(i,e,t),u=l.from,d=l.to,f=l.line;fJ(t).from=u,fJ(t).to=d,t.setData(f);var p=t.get(`symbol`),m=t.get(`symbolSize`),h=t.get(`symbolRotate`),g=t.get(`symbolOffset`);V(p)||(p=[p,p]),V(m)||(m=[m,m]),V(h)||(h=[h,h]),V(g)||(g=[g,g]),l.from.each(function(e){_(u,e,!0),_(d,e,!1)}),f.each(function(e){var t=f.getItemModel(e).getModel(`lineStyle`).getLineStyle();f.setItemLayout(e,[u.getItemLayout(e),d.getItemLayout(e)]),t.stroke??=u.getItemVisual(e,`style`).fill,f.setItemVisual(e,{fromSymbolKeepAspect:u.getItemVisual(e,`symbolKeepAspect`),fromSymbolOffset:u.getItemVisual(e,`symbolOffset`),fromSymbolRotate:u.getItemVisual(e,`symbolRotate`),fromSymbolSize:u.getItemVisual(e,`symbolSize`),fromSymbol:u.getItemVisual(e,`symbol`),toSymbolKeepAspect:d.getItemVisual(e,`symbolKeepAspect`),toSymbolOffset:d.getItemVisual(e,`symbolOffset`),toSymbolRotate:d.getItemVisual(e,`symbolRotate`),toSymbolSize:d.getItemVisual(e,`symbolSize`),toSymbol:d.getItemVisual(e,`symbol`),style:t})}),c.updateData(f),l.line.eachItemGraphicEl(function(e){Q(e).dataModel=t,e.traverse(function(e){Q(e).dataModel=t})});function _(t,n,i){var a=t.getItemModel(n);_J(t,n,i,e,r);var s=a.getModel(`itemStyle`).getItemStyle();s.fill??=Wv(o,`color`),t.setItemVisual(n,{symbolKeepAspect:a.get(`symbolKeepAspect`),symbolOffset:G(a.get(`symbolOffset`,!0),g[+!i]),symbolRotate:G(a.get(`symbolRotate`,!0),h[+!i]),symbolSize:G(a.get(`symbolSize`),m[+!i]),symbol:G(a.get(`symbol`,!0),p[+!i]),style:s})}this.markKeep(c),c.group.silent=t.get(`silent`)||e.get(`silent`)},t.type=`markLine`,t}(oJ);function yJ(e,t,n){var r=e?I(e&&e.dimensions,function(e){return j(j({},t.getData().getDimensionInfo(t.getData().mapDimension(e))||{}),{name:e,ordinalMeta:null})}):[{name:`value`,type:`float`}],i=new lS(r,n),a=new lS(r,n),o=new lS([],n),s=I(n.get(`data`),B(pJ,t,e,n));e&&(s=L(s,B(gJ,e)));var c=rJ(!!e,r);return i.initData(I(s,function(e){return e[0]}),null,c),a.initData(I(s,function(e){return e[1]}),null,c),o.initData(I(s,function(e){return e[2]})),o.hasItemOption=!0,{from:i,to:a,line:o}}function bJ(e){e.registerComponentModel(dJ),e.registerComponentView(vJ),e.registerPreprocessor(function(e){Uq(e.series,`markLine`)&&(e.markLine=e.markLine||{})})}var xJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.createMarkerModelFromSeries=function(e,n,r){return new t(e,n,r)},t.type=`markArea`,t.defaultOption={z:1,tooltip:{trigger:`item`},animation:!1,label:{show:!0,position:`top`},itemStyle:{borderWidth:0},emphasis:{label:{show:!0,position:`top`}}},t}(Kq),SJ=To(),CJ=function(e,t,n,r){var i=r[0],a=r[1];if(!(!i||!a)){var o=Qq(e,i),s=Qq(e,a),c=o.coord,l=s.coord;c[0]=me(c[0],-1/0),c[1]=me(c[1],-1/0),l[0]=me(l[0],1/0),l[1]=me(l[1],1/0);var u=A([{},o,s]);return u.coord=[o.coord,s.coord],u.x0=o.x,u.y0=o.y,u.x1=s.x,u.y1=s.y,u}};function wJ(e){return!isNaN(e)&&!isFinite(e)}function TJ(e,t,n,r){var i=1-e;return wJ(t[i])&&wJ(n[i])}function EJ(e,t){var n=t.coord[0],r=t.coord[1],i={coord:n,x:t.x0,y:t.y0},a={coord:r,x:t.x1,y:t.y1};return DD(e,`cartesian2d`)?n&&r&&(TJ(1,n,r,e)||TJ(0,n,r,e))?!0:nJ(e,i,a):tJ(e,i)||tJ(e,a)}function DJ(e,t,n,r,i){var a=r.coordinateSystem,o=e.getItemModel(t),s,c=Z(o.get(n[0]),i.getWidth()),l=Z(o.get(n[1]),i.getHeight());if(!isNaN(c)&&!isNaN(l))s=[c,l];else{if(r.getMarkerPosition){var u=e.getValues([`x0`,`y0`],t),d=e.getValues([`x1`,`y1`],t),f=a.clampData(u),p=a.clampData(d),m=[];m[0]=n[0]===`x0`?f[0]>p[0]?d[0]:u[0]:f[0]>p[0]?u[0]:d[0],m[1]=n[1]===`y0`?f[1]>p[1]?d[1]:u[1]:f[1]>p[1]?u[1]:d[1],s=r.getMarkerPosition(m,n,!0)}else{var h=e.get(n[0],t),g=e.get(n[1],t),_=[h,g];a.clampData&&a.clampData(_,_),s=a.dataToPoint(_,!0)}if(DD(a,`cartesian2d`)){var v=a.getAxis(`x`),y=a.getAxis(`y`),h=e.get(n[0],t),g=e.get(n[1],t);wJ(h)?s[0]=v.toGlobalCoord(v.getExtent()[n[0]===`x0`?0:1]):wJ(g)&&(s[1]=y.toGlobalCoord(y.getExtent()[n[1]===`y0`?0:1]))}isNaN(c)||(s[0]=c),isNaN(l)||(s[1]=l)}return s}var OJ=[[`x0`,`y0`],[`x1`,`y0`],[`x1`,`y1`],[`x0`,`y1`]],kJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.updateTransform=function(e,t,n){t.eachSeries(function(e){var t=Kq.getMarkerModelFromSeries(e,`markArea`);if(t){var r=t.getData();r.each(function(t){var i=I(OJ,function(i){return DJ(r,t,i,e,n)});r.setItemLayout(t,i),r.getItemGraphicEl(t).setShape(`points`,i)})}},this)},t.prototype.renderSeries=function(e,t,n,r){var i=e.coordinateSystem,a=e.id,o=e.getData(),s=this.markerGroupMap,c=s.get(a)||s.set(a,{group:new X});this.group.add(c.group),this.markKeep(c);var l=AJ(i,e,t);t.setData(l),l.each(function(t){var n=I(OJ,function(n){return DJ(l,t,n,e,r)}),a=i.getAxis(`x`).scale,s=i.getAxis(`y`).scale,c=a.getExtent(),u=s.getExtent(),d=[a.parse(l.get(`x0`,t)),a.parse(l.get(`x1`,t))],f=[s.parse(l.get(`y0`,t)),s.parse(l.get(`y1`,t))];Ma(d),Ma(f);var p=c[0]>d[1]||c[1]f[1]||u[1]=0},t.prototype.getOrient=function(){return this.get(`orient`)===`vertical`?{index:1,name:`vertical`}:{index:0,name:`horizontal`}},t.type=`legend.plain`,t.dependencies=[`series`],t.defaultOption={z:4,show:!0,orient:`horizontal`,left:`center`,top:0,align:`auto`,backgroundColor:`rgba(0,0,0,0)`,borderColor:`#ccc`,borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:`inherit`,symbolKeepAspect:!0,inactiveColor:`#ccc`,inactiveBorderColor:`#ccc`,inactiveBorderWidth:`auto`,itemStyle:{color:`inherit`,opacity:`inherit`,borderColor:`inherit`,borderWidth:`auto`,borderCap:`inherit`,borderJoin:`inherit`,borderDashOffset:`inherit`,borderMiterLimit:`inherit`},lineStyle:{width:`auto`,color:`inherit`,inactiveColor:`#ccc`,inactiveWidth:2,opacity:`inherit`,type:`inherit`,cap:`inherit`,join:`inherit`,dashOffset:`inherit`,miterLimit:`inherit`},textStyle:{color:`#333`},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:`sans-serif`,color:`#666`,borderWidth:1,borderColor:`#666`},emphasis:{selectorLabel:{show:!0,color:`#eee`,backgroundColor:`#666`}},selectorPosition:`auto`,selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},t}(Sm),PJ=B,FJ=F,IJ=X,LJ=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.newlineDisabled=!1,n}return t.prototype.init=function(){this.group.add(this._contentGroup=new IJ),this.group.add(this._selectorGroup=new IJ),this._isFirstRender=!0},t.prototype.getContentGroup=function(){return this._contentGroup},t.prototype.getSelectorGroup=function(){return this._selectorGroup},t.prototype.render=function(e,t,n){var r=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),e.get(`show`,!0)){var i=e.get(`align`),a=e.get(`orient`);(!i||i===`auto`)&&(i=e.get(`left`)===`right`&&a===`vertical`?`right`:`left`);var o=e.get(`selector`,!0),s=e.get(`selectorPosition`,!0);o&&(!s||s===`auto`)&&(s=a===`horizontal`?`end`:`start`),this.renderInner(i,e,t,n,o,a,s);var c=e.getBoxLayoutParams(),l={width:n.getWidth(),height:n.getHeight()},u=e.get(`padding`),d=mm(c,l,u),f=this.layoutInner(e,i,d,r,o,s),p=mm(M({width:f.width,height:f.height},c),l,u);this.group.x=p.x-f.x,this.group.y=p.y-f.y,this.group.markRedraw(),this.group.add(this._backgroundEl=gG(f,e))}},t.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},t.prototype.renderInner=function(e,t,n,r,i,a,o){var s=this.getContentGroup(),c=K(),l=t.get(`selectedMode`),u=[];n.eachRawSeries(function(e){!e.get(`legendHoverLink`)&&u.push(e.id)}),FJ(t.getData(),function(i,a){var o=i.get(`name`);if(!this.newlineDisabled&&(o===``||o===` +`)){var d=new IJ;d.newline=!0,s.add(d);return}var f=n.getSeriesByName(o)[0];if(!c.get(o)){if(f){var p=f.getData(),m=p.getVisual(`legendLineStyle`)||{},h=p.getVisual(`legendIcon`),g=p.getVisual(`style`),_=this._createItem(f,o,a,i,t,e,m,g,h,l,r);_.on(`click`,PJ(BJ,o,null,r,u)).on(`mouseover`,PJ(HJ,f.name,null,r,u)).on(`mouseout`,PJ(UJ,f.name,null,r,u)),n.ssr&&_.eachChild(function(e){var t=Q(e);t.seriesIndex=f.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),c.set(o,!0)}else n.eachRawSeries(function(s){if(!c.get(o)&&s.legendVisualProvider){var d=s.legendVisualProvider;if(!d.containName(o))return;var f=d.indexOfName(o),p=d.getItemVisual(f,`style`),m=d.getItemVisual(f,`legendIcon`),h=ur(p.fill);h&&h[3]===0&&(h[3]=.2,p=j(j({},p),{fill:vr(h,`rgba`)}));var g=this._createItem(s,o,a,i,t,e,{},p,m,l,r);g.on(`click`,PJ(BJ,null,o,r,u)).on(`mouseover`,PJ(HJ,null,o,r,u)).on(`mouseout`,PJ(UJ,null,o,r,u)),n.ssr&&g.eachChild(function(e){var t=Q(e);t.seriesIndex=s.seriesIndex,t.dataIndex=a,t.ssrType=`legend`}),c.set(o,!0)}},this)}},this),i&&this._createSelector(i,t,r,a,o)},t.prototype._createSelector=function(e,t,n,r,i){var a=this.getSelectorGroup();FJ(e,function(e){var r=e.type,i=new Zc({style:{x:0,y:0,align:`center`,verticalAlign:`middle`},onclick:function(){n.dispatchAction({type:r===`all`?`legendAllSelect`:`legendInverseSelect`,legendId:t.id})}});a.add(i),jf(i,{normal:t.getModel(`selectorLabel`),emphasis:t.getModel([`emphasis`,`selectorLabel`])},{defaultText:e.title}),au(i)})},t.prototype._createItem=function(e,t,n,r,i,a,o,s,c,l,u){var d=e.visualDrawType,f=i.get(`itemWidth`),p=i.get(`itemHeight`),m=i.isSelected(t),h=r.get(`symbolRotate`),g=r.get(`symbolKeepAspect`),_=r.get(`icon`);c=_||c||`roundRect`;var v=RJ(c,r,o,s,d,m,u),y=new IJ,b=r.getModel(`textStyle`);if(H(e.getLegendIcon)&&(!_||_===`inherit`))y.add(e.getLegendIcon({itemWidth:f,itemHeight:p,icon:c,iconRotate:h,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}));else{var x=_===`inherit`&&e.getData().getVisual(`symbol`)?h===`inherit`?e.getData().getVisual(`symbolRotate`):h:0;y.add(zJ({itemWidth:f,itemHeight:p,icon:c,iconRotate:x,itemStyle:v.itemStyle,lineStyle:v.lineStyle,symbolKeepAspect:g}))}var S=a===`left`?f+5:-5,C=a,w=i.get(`formatter`),T=t;U(w)&&w?T=w.replace(`{name}`,t??``):H(w)&&(T=w(t));var E=m?b.getTextColor():r.get(`inactiveColor`);y.add(new Zc({style:Nf(b,{text:T,x:S,y:p/2,fill:E,align:C,verticalAlign:`middle`},{inheritColor:E})}));var D=new qc({shape:y.getBoundingRect(),style:{fill:`transparent`}}),O=r.getModel(`tooltip`);return O.get(`show`)&&Tf({el:D,componentModel:i,itemName:t,itemTooltipOption:O.option}),y.add(D),y.eachChild(function(e){e.silent=!0}),D.silent=!l,this.getContentGroup().add(y),au(y),y.__legendDataIndex=n,y},t.prototype.layoutInner=function(e,t,n,r,i,a){var o=this.getContentGroup(),s=this.getSelectorGroup();fm(e.get(`orient`),o,e.get(`itemGap`),n.width,n.height);var c=o.getBoundingRect(),l=[-c.x,-c.y];if(s.markRedraw(),o.markRedraw(),i){fm(`horizontal`,s,e.get(`selectorItemGap`,!0));var u=s.getBoundingRect(),d=[-u.x,-u.y],f=e.get(`selectorButtonGap`,!0),p=e.getOrient().index,m=p===0?`width`:`height`,h=p===0?`height`:`width`,g=p===0?`y`:`x`;a===`end`?d[p]+=c[m]+f:l[p]+=u[m]+f,d[1-p]+=c[h]/2-u[h]/2,s.x=d[0],s.y=d[1],o.x=l[0],o.y=l[1];var _={x:0,y:0};return _[m]=c[m]+f+u[m],_[h]=Math.max(c[h],u[h]),_[g]=Math.min(0,u[g]+d[1-p]),_}return o.x=l[0],o.y=l[1],this.group.getBoundingRect()},t.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},t.type=`legend.plain`,t}(U_);function RJ(e,t,n,r,i,a,o){function s(e,t){e.lineWidth===`auto`&&(e.lineWidth=t.lineWidth>0?2:0),FJ(e,function(n,r){e[r]===`inherit`&&(e[r]=t[r])})}var c=t.getModel(`itemStyle`),l=c.getItemStyle(),u=e.lastIndexOf(`empty`,0)===0?`fill`:`stroke`,d=c.getShallow(`decal`);l.decal=!d||d===`inherit`?r.decal:Jy(d,o),l.fill===`inherit`&&(l.fill=r[i]),l.stroke===`inherit`&&(l.stroke=r[u]),l.opacity===`inherit`&&(l.opacity=(i===`fill`?r:n).opacity),s(l,r);var f=t.getModel(`lineStyle`),p=f.getLineStyle();if(s(p,n),l.fill===`auto`&&(l.fill=r.fill),l.stroke===`auto`&&(l.stroke=r.fill),p.stroke===`auto`&&(p.stroke=r.fill),!a){var m=t.get(`inactiveBorderWidth`),h=l[u];l.lineWidth=m===`auto`?r.lineWidth>0&&h?2:0:l.lineWidth,l.fill=t.get(`inactiveColor`),l.stroke=t.get(`inactiveBorderColor`),p.stroke=f.get(`inactiveColor`),p.lineWidth=f.get(`inactiveWidth`)}return{itemStyle:l,lineStyle:p}}function zJ(e){var t=e.icon||`roundRect`,n=ay(t,0,0,e.itemWidth,e.itemHeight,e.itemStyle.fill,e.symbolKeepAspect);return n.setStyle(e.itemStyle),n.rotation=(e.iconRotate||0)*Math.PI/180,n.setOrigin([e.itemWidth/2,e.itemHeight/2]),t.indexOf(`empty`)>-1&&(n.style.stroke=n.style.fill,n.style.fill=`#fff`,n.style.lineWidth=2),n}function BJ(e,t,n,r){UJ(e,t,n,r),n.dispatchAction({type:`legendToggleSelect`,name:e??t}),HJ(e,t,n,r)}function VJ(e){for(var t=e.getZr().storage.getDisplayList(),n,r=0,i=t.length;rn[i],m=[-d.x,-d.y];t||(m[r]=c[s]);var h=[0,0],g=[-f.x,-f.y],_=G(e.get(`pageButtonGap`,!0),e.get(`itemGap`,!0));p&&(e.get(`pageButtonPosition`,!0)===`end`?g[r]+=n[i]-f[i]:h[r]+=f[i]+_),g[1-r]+=d[a]/2-f[a]/2,c.setPosition(m),l.setPosition(h),u.setPosition(g);var v={x:0,y:0};if(v[i]=p?n[i]:d[i],v[a]=Math.max(d[a],f[a]),v[o]=Math.min(0,f[o]+g[1-r]),l.__rectSize=n[i],p){var y={x:0,y:0};y[i]=Math.max(n[i]-f[i]-_,0),y[a]=v[a],l.setClipPath(new qc({shape:y})),l.__rectSize=y[i]}else u.eachChild(function(e){e.attr({invisible:!0,silent:!0})});var b=this._getPageInfo(e);return b.pageIndex!=null&&Bd(c,{x:b.contentPosition[0],y:b.contentPosition[1]},p?e:null),this._updatePageInfoView(e,b),v},t.prototype._pageGo=function(e,t,n){var r=this._getPageInfo(t)[e];r!=null&&n.dispatchAction({type:`legendScroll`,scrollDataIndex:r,legendId:t.id})},t.prototype._updatePageInfoView=function(e,t){var n=this._controllerGroup;F([`pagePrev`,`pageNext`],function(r){var i=t[r+`DataIndex`]!=null,a=n.childOfName(r);a&&(a.setStyle(`fill`,i?e.get(`pageIconColor`,!0):e.get(`pageIconInactiveColor`,!0)),a.cursor=i?`pointer`:`default`)});var r=n.childOfName(`pageText`),i=e.get(`pageFormatter`),a=t.pageIndex,o=a==null?0:a+1,s=t.pageCount;r&&i&&r.setStyle(`text`,U(i)?i.replace(`{current}`,o==null?``:o+``).replace(`{total}`,s==null?``:s+``):i({current:o,total:s}))},t.prototype._getPageInfo=function(e){var t=e.get(`scrollDataIndex`,!0),n=this.getContentGroup(),r=this._containerGroup.__rectSize,i=e.getOrient().index,a=QJ[i],o=$J[i],s=this._findTargetItemIndex(t),c=n.children(),l=c[s],u=c.length,d=+!!u,f={contentPosition:[n.x,n.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!l)return f;var p=v(l);f.contentPosition[i]=-p.s;for(var m=s+1,h=p,g=p,_=null;m<=u;++m)_=v(c[m]),(!_&&g.e>h.s+r||_&&!y(_,h.s))&&(h=g.i>h.i?g:_,h&&(f.pageNextDataIndex??=h.i,++f.pageCount)),g=_;for(var m=s-1,h=p,g=p,_=null;m>=-1;--m)_=v(c[m]),(!_||!y(g,_.s))&&h.i=t&&e.s<=t+r}},t.prototype._findTargetItemIndex=function(e){if(!this._showController)return 0;var t,n=this.getContentGroup(),r;return n.eachChild(function(n,i){var a=n.__legendDataIndex;r==null&&a!=null&&(r=i),a===e&&(t=i)}),t??r},t.type=`legend.scroll`,t}(LJ);function tY(e){e.registerAction(`legendScroll`,`legendscroll`,function(e,t){var n=e.scrollDataIndex;n!=null&&t.eachComponent({mainType:`legend`,subType:`scroll`,query:e},function(e){e.setScrollDataIndex(n)})})}function nY(e){$(JJ),e.registerComponentModel(YJ),e.registerComponentView(eY),tY(e)}function rY(e){$(JJ),$(nY)}var iY=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.inside`,t.defaultOption=op(XW.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),t}(XW),aY=To();function oY(e,t,n){aY(e).coordSysRecordMap.each(function(e){var r=e.dataZoomInfoMap.get(t.uid);r&&(r.getRange=n)})}function sY(e,t){for(var n=aY(e).coordSysRecordMap,r=n.keys(),i=0;ir[n+t]&&(t=o),i&&=a.get(`preventDefaultMouseMove`,!0)}),{controlType:t,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!i}}}function pY(e){e.registerProcessor(e.PRIORITY.PROCESSOR.FILTER,function(e,t){var n=aY(t),r=n.coordSysRecordMap||=K();r.each(function(e){e.dataZoomInfoMap=null}),e.eachComponent({mainType:`dataZoom`,subType:`inside`},function(e){F(JW(e).infoList,function(n){var i=n.model.uid,a=r.get(i)||r.set(i,lY(t,n.model));(a.dataZoomInfoMap||=K()).set(e.uid,{dzReferCoordSysInfo:n,model:e,getRange:null})})}),r.each(function(e){var t=e.controller,n,i=e.dataZoomInfoMap;if(i){var a=i.keys()[0];a!=null&&(n=i.get(a))}if(!n){cY(r,e);return}var o=fY(i);t.enable(o.controlType,o.opt),t.setPointerChecker(e.containsPoint),rv(e,`dispatchAction`,n.model.get(`throttle`,!0),`fixRate`)})})}var mY=function(e){r(t,e);function t(){var t=e!==null&&e.apply(this,arguments)||this;return t.type=`dataZoom.inside`,t}return t.prototype.render=function(t,n,r){if(e.prototype.render.apply(this,arguments),t.noTarget()){this._clear();return}this.range=t.getPercentRange(),oY(r,t,{pan:z(hY.pan,this),zoom:z(hY.zoom,this),scrollMove:z(hY.scrollMove,this)})},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){sY(this.api,this.dataZoomModel),this.range=null},t.type=`dataZoom.inside`,t}($W),hY={zoom:function(e,t,n,r){var i=this.range,a=i.slice(),o=e.axisModels[0];if(o){var s=_Y[t](null,[r.originX,r.originY],o,n,e),c=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(a[1]-a[0])+a[0],l=Math.max(1/r.scale,0);a[0]=(a[0]-c)*l+c,a[1]=(a[1]-c)*l+c;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(AI(0,a,[0,100],0,u.minSpan,u.maxSpan),this.range=a,i[0]!==a[0]||i[1]!==a[1])return a}},pan:gY(function(e,t,n,r,i,a){var o=_Y[r]([a.oldX,a.oldY],[a.newX,a.newY],t,i,n);return o.signal*(e[1]-e[0])*o.pixel/o.pixelLength}),scrollMove:gY(function(e,t,n,r,i,a){return _Y[r]([0,0],[a.scrollDelta,a.scrollDelta],t,i,n).signal*(e[1]-e[0])*a.scrollDelta})};function gY(e){return function(t,n,r,i){var a=this.range,o=a.slice(),s=t.axisModels[0];if(s&&(AI(e(o,s,t,n,r,i),o,[0,100],`all`),this.range=o,a[0]!==o[0]||a[1]!==o[1]))return o}}var _Y={grid:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem.getRect();return e||=[0,0],a.dim===`x`?(o.pixel=t[0]-e[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=a.inverse?-1:1),o},polar:function(e,t,n,r,i){var a=n.axis,o={},s=i.model.coordinateSystem,c=s.getRadiusAxis().getExtent(),l=s.getAngleAxis().getExtent();return e=e?s.pointToCoord(e):[0,0],t=s.pointToCoord(t),n.mainType===`radiusAxis`?(o.pixel=t[0]-e[0],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=a.inverse?1:-1):(o.pixel=t[1]-e[1],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=a.inverse?-1:1),o},singleAxis:function(e,t,n,r,i){var a=n.axis,o=i.model.coordinateSystem.getRect(),s={};return e||=[0,0],a.orient===`horizontal`?(s.pixel=t[0]-e[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=a.inverse?1:-1):(s.pixel=t[1]-e[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=a.inverse?-1:1),s}};function vY(e){cG(e),e.registerComponentModel(iY),e.registerComponentView(mY),pY(e)}var yY=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.type=`dataZoom.slider`,t.layoutMode=`box`,t.defaultOption=op(XW.defaultOption,{show:!0,right:`ph`,top:`ph`,width:`ph`,height:`ph`,left:null,bottom:null,borderColor:`#d2dbee`,borderRadius:3,backgroundColor:`rgba(47,69,84,0)`,dataBackground:{lineStyle:{color:`#d2dbee`,width:.5},areaStyle:{color:`#d2dbee`,opacity:.2}},selectedDataBackground:{lineStyle:{color:`#8fb0f7`,width:.5},areaStyle:{color:`#8fb0f7`,opacity:.2}},fillerColor:`rgba(135,175,274,0.2)`,handleIcon:`path://M-9.35,34.56V42m0-40V9.5m-2,0h4a2,2,0,0,1,2,2v21a2,2,0,0,1-2,2h-4a2,2,0,0,1-2-2v-21A2,2,0,0,1-11.35,9.5Z`,handleSize:`100%`,handleStyle:{color:`#fff`,borderColor:`#ACB8D1`},moveHandleSize:7,moveHandleIcon:`path://M-320.9-50L-320.9-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-348-41-339-50-320.9-50z M-212.3-50L-212.3-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-239.4-41-230.4-50-212.3-50z M-103.7-50L-103.7-50c18.1,0,27.1,9,27.1,27.1V85.7c0,18.1-9,27.1-27.1,27.1l0,0c-18.1,0-27.1-9-27.1-27.1V-22.9C-130.9-41-121.8-50-103.7-50z`,moveHandleStyle:{color:`#D2DBEE`,opacity:.7},showDetail:!0,showDataShadow:`auto`,realtime:!0,zoomLock:!1,textStyle:{color:`#6E7079`},brushSelect:!0,brushStyle:{color:`rgba(135,175,274,0.15)`},emphasis:{handleLabel:{show:!0},handleStyle:{borderColor:`#8FB0F7`},moveHandleStyle:{color:`#8FB0F7`}}}),t}(XW),bY=qc,xY=7,SY=1,CY=30,wY=7,TY=`horizontal`,EY=`vertical`,DY=5,OY=[`line`,`bar`,`candlestick`,`scatter`],kY={easing:`cubicOut`,duration:100,delay:0},AY=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._displayables={},n}return t.prototype.init=function(e,t){this.api=t,this._onBrush=z(this._onBrush,this),this._onBrushEnd=z(this._onBrushEnd,this)},t.prototype.render=function(t,n,r,i){if(e.prototype.render.apply(this,arguments),rv(this,`_dispatchZoomAction`,t.get(`throttle`),`fixRate`),this._orient=t.getOrient(),t.get(`show`)===!1){this.group.removeAll();return}if(t.noTarget()){this._clear(),this.group.removeAll();return}(!i||i.type!==`dataZoom`||i.from!==this.uid)&&this._buildView(),this._updateView()},t.prototype.dispose=function(){this._clear(),e.prototype.dispose.apply(this,arguments)},t.prototype._clear=function(){iv(this,`_dispatchZoomAction`);var e=this.api.getZr();e.off(`mousemove`,this._onBrush),e.off(`mouseup`,this._onBrushEnd)},t.prototype._buildView=function(){var e=this.group;e.removeAll(),this._brushing=!1,this._displayables.brushRect=null,this._resetLocation(),this._resetInterval();var t=this._displayables.sliderGroup=new X;this._renderBackground(),this._renderHandle(),this._renderDataShadow(),e.add(t),this._positionGroup()},t.prototype._resetLocation=function(){var e=this.dataZoomModel,t=this.api,n=e.get(`brushSelect`)?wY:0,r=this._findCoordRect(),i={width:t.getWidth(),height:t.getHeight()},a=this._orient===TY?{right:i.width-r.x-r.width,top:i.height-CY-xY-n,width:r.width,height:CY}:{right:xY,top:r.y,width:CY,height:r.height},o=ym(e.option);F([`right`,`top`,`width`,`height`],function(e){o[e]===`ph`&&(o[e]=a[e])});var s=mm(o,i);this._location={x:s.x,y:s.y},this._size=[s.width,s.height],this._orient===EY&&this._size.reverse()},t.prototype._positionGroup=function(){var e=this.group,t=this._location,n=this._orient,r=this.dataZoomModel.getFirstTargetAxisModel(),i=r&&r.get(`inverse`),a=this._displayables.sliderGroup,o=(this._dataShadowInfo||{}).otherAxisInverse;a.attr(n===TY&&!i?{scaleY:o?1:-1,scaleX:1}:n===TY&&i?{scaleY:o?1:-1,scaleX:-1}:n===EY&&!i?{scaleY:o?-1:1,scaleX:1,rotation:Math.PI/2}:{scaleY:o?-1:1,scaleX:-1,rotation:Math.PI/2});var s=e.getBoundingRect([a]);e.x=t.x-s.x,e.y=t.y-s.y,e.markRedraw()},t.prototype._getViewExtent=function(){return[0,this._size[0]]},t.prototype._renderBackground=function(){var e=this.dataZoomModel,t=this._size,n=this._displayables.sliderGroup,r=e.get(`brushSelect`);n.add(new bY({silent:!0,shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:e.get(`backgroundColor`)},z2:-40}));var i=new bY({shape:{x:0,y:0,width:t[0],height:t[1]},style:{fill:`transparent`},z2:0,onclick:z(this._onClickPanel,this)}),a=this.api.getZr();r?(i.on(`mousedown`,this._onBrushStart,this),i.cursor=`crosshair`,a.on(`mousemove`,this._onBrush),a.on(`mouseup`,this._onBrushEnd)):(a.off(`mousemove`,this._onBrush),a.off(`mouseup`,this._onBrushEnd)),n.add(i)},t.prototype._renderDataShadow=function(){var e=this._dataShadowInfo=this._prepareDataShadowInfo();if(this._displayables.dataShadowSegs=[],!e)return;var t=this._size,n=this._shadowSize||[],r=e.series,i=r.getRawData(),a=r.getShadowDim&&r.getShadowDim(),o=a&&i.getDimensionInfo(a)?r.getShadowDim():e.otherDim;if(o==null)return;var s=this._shadowPolygonPts,c=this._shadowPolylinePts;if(i!==this._shadowData||o!==this._shadowDim||t[0]!==n[0]||t[1]!==n[1]){var l=i.getDataExtent(o),u=(l[1]-l[0])*.3;l=[l[0]-u,l[1]+u];var d=[0,t[1]],f=[0,t[0]],p=[[t[0],0],[0,0]],m=[],h=f[1]/(i.count()-1),g=0,_=Math.round(i.count()/t[0]),v;i.each([o],function(e,t){if(_>0&&t%_){g+=h;return}var n=e==null||isNaN(e)||e===``,r=n?0:Aa(e,l,d,!0);n&&!v&&t?(p.push([p[p.length-1][0],0]),m.push([m[m.length-1][0],0])):!n&&v&&(p.push([g,0]),m.push([g,0])),p.push([g,r]),m.push([g,r]),g+=h,v=n}),s=this._shadowPolygonPts=p,c=this._shadowPolylinePts=m}this._shadowData=i,this._shadowDim=o,this._shadowSize=[t[0],t[1]];var y=this.dataZoomModel;function b(e){var t=y.getModel(e?`selectedDataBackground`:`dataBackground`),n=new X,r=new md({shape:{points:s},segmentIgnoreThreshold:1,style:t.getModel(`areaStyle`).getAreaStyle(),silent:!0,z2:-20}),i=new gd({shape:{points:c},segmentIgnoreThreshold:1,style:t.getModel(`lineStyle`).getLineStyle(),silent:!0,z2:-19});return n.add(r),n.add(i),n}for(var x=0;x<3;x++){var S=b(x===1);this._displayables.sliderGroup.add(S),this._displayables.dataShadowSegs.push(S)}},t.prototype._prepareDataShadowInfo=function(){var e=this.dataZoomModel,t=e.get(`showDataShadow`);if(t!==!1){var n,r=this.ecModel;return e.eachTargetAxis(function(i,a){F(e.getAxisProxy(i,a).getTargetSeriesModels(),function(e){if(!n&&!(t!==!0&&N(OY,e.get(`type`))<0)){var o=r.getComponent(KW(i),a).axis,s=jY(i),c,l=e.coordinateSystem;s!=null&&l.getOtherAxis&&(c=l.getOtherAxis(o).inverse),s=e.getData().mapDimension(s),n={thisAxis:o,series:e,thisDim:i,otherDim:s,otherAxisInverse:c}}},this)},this),n}},t.prototype._renderHandle=function(){var e=this.group,t=this._displayables,n=t.handles=[null,null],r=t.handleLabels=[null,null],i=this._displayables.sliderGroup,a=this._size,o=this.dataZoomModel,s=this.api,c=o.get(`borderRadius`)||0,l=o.get(`brushSelect`),u=t.filler=new bY({silent:l,style:{fill:o.get(`fillerColor`)},textConfig:{position:`inside`}});i.add(u),i.add(new bY({silent:!0,subPixelOptimize:!0,shape:{x:0,y:0,width:a[0],height:a[1],r:c},style:{stroke:o.get(`dataBackgroundColor`)||o.get(`borderColor`),lineWidth:SY,fill:`rgba(0,0,0,0)`}})),F([0,1],function(t){var a=o.get(`handleIcon`);!ny[a]&&a.indexOf(`path://`)<0&&a.indexOf(`image://`)<0&&(a=`path://`+a);var s=ay(a,-1,0,2,2,null,!0);s.attr({cursor:MY(this._orient),draggable:!0,drift:z(this._onDragMove,this,t),ondragend:z(this._onDragEnd,this),onmouseover:z(this._showDataInfo,this,!0),onmouseout:z(this._showDataInfo,this,!1),z2:5});var c=s.getBoundingRect(),l=o.get(`handleSize`);this._handleHeight=Z(l,this._size[1]),this._handleWidth=c.width/c.height*this._handleHeight,s.setStyle(o.getModel(`handleStyle`).getItemStyle()),s.style.strokeNoScale=!0,s.rectHover=!0,s.ensureState(`emphasis`).style=o.getModel([`emphasis`,`handleStyle`]).getItemStyle(),au(s);var u=o.get(`handleColor`);u!=null&&(s.style.fill=u),i.add(n[t]=s);var d=o.getModel(`textStyle`),f=(o.get(`handleLabel`)||{}).show||!1;e.add(r[t]=new Zc({silent:!0,invisible:!f,style:Nf(d,{x:0,y:0,text:``,verticalAlign:`middle`,align:`center`,fill:d.getTextColor(),font:d.getFont()}),z2:10}))},this);var d=u;if(l){var f=Z(o.get(`moveHandleSize`),a[1]),p=t.moveHandle=new qc({style:o.getModel(`moveHandleStyle`).getItemStyle(),silent:!0,shape:{r:[0,0,2,2],y:a[1]-.5,height:f}}),m=f*.8,h=t.moveHandleIcon=ay(o.get(`moveHandleIcon`),-m/2,-m/2,m,m,`#fff`,!0);h.silent=!0,h.y=a[1]+f/2-.5,p.ensureState(`emphasis`).style=o.getModel([`emphasis`,`moveHandleStyle`]).getItemStyle();var g=Math.min(a[1]/2,Math.max(f,10));d=t.moveZone=new qc({invisible:!0,shape:{y:a[1]-g,height:f+g}}),d.on(`mouseover`,function(){s.enterEmphasis(p)}).on(`mouseout`,function(){s.leaveEmphasis(p)}),i.add(p),i.add(h),i.add(d)}d.attr({draggable:!0,cursor:MY(this._orient),drift:z(this._onDragMove,this,`all`),ondragstart:z(this._showDataInfo,this,!0),ondragend:z(this._onDragEnd,this),onmouseover:z(this._showDataInfo,this,!0),onmouseout:z(this._showDataInfo,this,!1)})},t.prototype._resetInterval=function(){var e=this._range=this.dataZoomModel.getPercentRange(),t=this._getViewExtent();this._handleEnds=[Aa(e[0],[0,100],t,!0),Aa(e[1],[0,100],t,!0)]},t.prototype._updateInterval=function(e,t){var n=this.dataZoomModel,r=this._handleEnds,i=this._getViewExtent(),a=n.findRepresentativeAxisProxy().getMinMaxSpan(),o=[0,100];AI(t,r,i,n.get(`zoomLock`)?`all`:e,a.minSpan==null?null:Aa(a.minSpan,o,i,!0),a.maxSpan==null?null:Aa(a.maxSpan,o,i,!0));var s=this._range,c=this._range=Ma([Aa(r[0],i,o,!0),Aa(r[1],i,o,!0)]);return!s||s[0]!==c[0]||s[1]!==c[1]},t.prototype._updateView=function(e){var t=this._displayables,n=this._handleEnds,r=Ma(n.slice()),i=this._size;F([0,1],function(e){var r=t.handles[e],a=this._handleHeight;r.attr({scaleX:a/2,scaleY:a/2,x:n[e]+(e?-1:1),y:i[1]/2-a/2})},this),t.filler.setShape({x:r[0],y:0,width:r[1]-r[0],height:i[1]});var a={x:r[0],width:r[1]-r[0]};t.moveHandle&&(t.moveHandle.setShape(a),t.moveZone.setShape(a),t.moveZone.getBoundingRect(),t.moveHandleIcon&&t.moveHandleIcon.attr(`x`,a.x+a.width/2));for(var o=t.dataShadowSegs,s=[0,r[0],r[1],i[0]],c=0;ct[0]||n[1]<0||n[1]>t[1])){var r=this._handleEnds,i=(r[0]+r[1])/2,a=this._updateInterval(`all`,n[0]-i);this._updateView(),a&&this._dispatchZoomAction(!1)}},t.prototype._onBrushStart=function(e){var t=e.offsetX,n=e.offsetY;this._brushStart=new J(t,n),this._brushing=!0,this._brushStartTime=+new Date},t.prototype._onBrushEnd=function(e){if(this._brushing){var t=this._displayables.brushRect;if(this._brushing=!1,t){t.attr(`ignore`,!0);var n=t.shape;if(!(+new Date-this._brushStartTime<200&&Math.abs(n.width)<5)){var r=this._getViewExtent(),i=[0,100];this._range=Ma([Aa(n.x,r,i,!0),Aa(n.x+n.width,r,i,!0)]),this._handleEnds=[n.x,n.x+n.width],this._updateView(),this._dispatchZoomAction(!1)}}}},t.prototype._onBrush=function(e){this._brushing&&(Ct(e.event),this._updateBrushRect(e.offsetX,e.offsetY))},t.prototype._updateBrushRect=function(e,t){var n=this._displayables,r=this.dataZoomModel,i=n.brushRect;i||(i=n.brushRect=new bY({silent:!0,style:r.getModel(`brushStyle`).getItemStyle()}),n.sliderGroup.add(i)),i.attr(`ignore`,!1);var a=this._brushStart,o=this._displayables.sliderGroup,s=o.transformCoordToLocal(e,t),c=o.transformCoordToLocal(a.x,a.y),l=this._size;s[0]=Math.max(Math.min(l[0],s[0]),0),i.setShape({x:c[0],y:0,width:s[0]-c[0],height:l[1]})},t.prototype._dispatchZoomAction=function(e){var t=this._range;this.api.dispatchAction({type:`dataZoom`,from:this.uid,dataZoomId:this.dataZoomModel.id,animation:e?kY:null,start:t[0],end:t[1]})},t.prototype._findCoordRect=function(){var e,t=JW(this.dataZoomModel).infoList;if(!e&&t.length){var n=t[0].model.coordinateSystem;e=n.getRect&&n.getRect()}if(!e){var r=this.api.getWidth(),i=this.api.getHeight();e={x:r*.2,y:i*.2,width:r*.6,height:i*.6}}return e},t.type=`dataZoom.slider`,t}($W);function jY(e){return{x:`y`,y:`x`,radius:`angle`,angle:`radius`}[e]}function MY(e){return e===`vertical`?`ns-resize`:`ew-resize`}function NY(e){e.registerComponentModel(yY),e.registerComponentView(AY),cG(e)}function PY(e){$(vY),$(NY)}var FY={get:function(e,t,n){var r=O((IY[e]||{})[t]);return n&&V(r)?r[r.length-1]:r}},IY={color:{active:[`#006edd`,`#e0ffff`],inactive:[`rgba(0,0,0,0)`]},colorHue:{active:[0,360],inactive:[0,0]},colorSaturation:{active:[.3,1],inactive:[0,0]},colorLightness:{active:[.9,.5],inactive:[0,0]},colorAlpha:{active:[.3,1],inactive:[0,0]},opacity:{active:[.3,1],inactive:[0,0]},symbol:{active:[`circle`,`roundRect`,`diamond`],inactive:[`none`]},symbolSize:{active:[10,50],inactive:[0,0]}},LY=VN.mapVisual,RY=VN.eachVisual,zY=V,BY=F,VY=Ma,HY=Aa,UY=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n.stateList=[`inRange`,`outOfRange`],n.replacableOptionKeys=[`inRange`,`outOfRange`,`target`,`controller`,`color`],n.layoutMode={type:`box`,ignoreSize:!0},n.dataBound=[-1/0,1/0],n.targetVisuals={},n.controllerVisuals={},n}return t.prototype.init=function(e,t,n){this.mergeDefaultAndTheme(e,n)},t.prototype.optionUpdated=function(e,t){var n=this.option;!t&&ZK(n,e,this.replacableOptionKeys),this.textStyleModel=this.getModel(`textStyle`),this.resetItemSize(),this.completeVisualOption()},t.prototype.resetVisual=function(e){var t=this.stateList;e=z(e,this),this.controllerVisuals=XK(this.option.controller,t,e),this.targetVisuals=XK(this.option.target,t,e)},t.prototype.getItemSymbol=function(){return null},t.prototype.getTargetSeriesIndices=function(){var e=this.option.seriesIndex,t=[];return e==null||e===`all`?this.ecModel.eachSeries(function(e,n){t.push(n)}):t=no(e),t},t.prototype.eachTargetSeries=function(e,t){F(this.getTargetSeriesIndices(),function(n){var r=this.ecModel.getSeriesByIndex(n);r&&e.call(t,r)},this)},t.prototype.isTargetSeries=function(e){var t=!1;return this.eachTargetSeries(function(n){n===e&&(t=!0)}),t},t.prototype.formatValueText=function(e,t,n){var r=this.option,i=r.precision,a=this.dataBound,o=r.formatter,s;n||=[`<`,`>`],V(e)&&(e=e.slice(),s=!0);var c=t?e:s?[l(e[0]),l(e[1])]:l(e);if(U(o))return o.replace(`{value}`,s?c[0]:c).replace(`{value2}`,s?c[1]:c);if(H(o))return s?o(e[0],e[1]):o(e);if(s)return e[0]===a[0]?n[0]+` `+c[1]:e[1]===a[1]?n[1]+` `+c[0]:c[0]+` - `+c[1];return c;function l(e){return e===a[0]?`min`:e===a[1]?`max`:(+e).toFixed(Math.min(i,20))}},t.prototype.resetExtent=function(){var e=this.option,t=VY([e.min,e.max]);this._dataExtent=t},t.prototype.getDataDimensionIndex=function(e){var t=this.option.dimension;if(t!=null)return e.getDimensionIndex(t);for(var n=e.dimensions,r=n.length-1;r>=0;r--){var i=n[r],a=e.getDimensionInfo(i);if(!a.isCalculationCoord)return a.storeDimIndex}},t.prototype.getExtent=function(){return this._dataExtent.slice()},t.prototype.completeVisualOption=function(){var e=this.ecModel,t=this.option,n={inRange:t.inRange,outOfRange:t.outOfRange},r=t.target||={},i=t.controller||={};k(r,n),k(i,n);var a=this.isCategory();o.call(this,r),o.call(this,i),s.call(this,r,`inRange`,`outOfRange`),c.call(this,i);function o(n){zY(t.color)&&!n.inRange&&(n.inRange={color:t.color.slice().reverse()}),n.inRange=n.inRange||{color:e.get(`gradientColor`)}}function s(e,t,n){var r=e[t],i=e[n];r&&!i&&(i=e[n]={},BY(r,function(e,t){if(VN.isValidType(t)){var n=FY.get(t,`inactive`,a);n!=null&&(i[t]=n,t===`color`&&!i.hasOwnProperty(`opacity`)&&!i.hasOwnProperty(`colorAlpha`)&&(i.opacity=[0,0]))}}))}function c(e){var t=(e.inRange||{}).symbol||(e.outOfRange||{}).symbol,n=(e.inRange||{}).symbolSize||(e.outOfRange||{}).symbolSize,r=this.get(`inactiveColor`),i=this.getItemSymbol()||`roundRect`;BY(this.stateList,function(o){var s=this.itemSize,c=e[o];c||=e[o]={color:a?r:[r]},c.symbol??(c.symbol=t&&O(t)||(a?i:[i])),c.symbolSize??(c.symbolSize=n&&O(n)||(a?s[0]:[s[0],s[0]])),c.symbol=LY(c.symbol,function(e){return e===`none`?i:e});var l=c.symbolSize;if(l!=null){var u=-1/0;RY(l,function(e){e>u&&(u=e)}),c.symbolSize=LY(l,function(e){return HY(e,[0,u],[0,s[0]],!0)})}},this)}},t.prototype.resetItemSize=function(){this.itemSize=[parseFloat(this.get(`itemWidth`)),parseFloat(this.get(`itemHeight`))]},t.prototype.isCategory=function(){return!!this.option.categories},t.prototype.setSelected=function(e){},t.prototype.getSelected=function(){return null},t.prototype.getValueState=function(e){return null},t.prototype.getVisualMeta=function(e){return null},t.type=`visualMap`,t.dependencies=[`series`],t.defaultOption={show:!0,z:4,seriesIndex:`all`,min:0,max:200,left:0,right:null,top:null,bottom:0,itemWidth:null,itemHeight:null,inverse:!1,orient:`vertical`,backgroundColor:`rgba(0,0,0,0)`,borderColor:`#ccc`,contentColor:`#5793f3`,inactiveColor:`#aaa`,borderWidth:0,padding:5,textGap:10,precision:0,textStyle:{color:`#333`}},t}(Sm),WY=[20,140],GY=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent(),this.resetVisual(function(e){e.mappingMethod=`linear`,e.dataExtent=this.getExtent()}),this._resetRange()},t.prototype.resetItemSize=function(){e.prototype.resetItemSize.apply(this,arguments);var t=this.itemSize;(t[0]==null||isNaN(t[0]))&&(t[0]=WY[0]),(t[1]==null||isNaN(t[1]))&&(t[1]=WY[1])},t.prototype._resetRange=function(){var e=this.getExtent(),t=this.option.range;!t||t.auto?(e.auto=1,this.option.range=e):V(t)&&(t[0]>t[1]&&t.reverse(),t[0]=Math.max(t[0],e[0]),t[1]=Math.min(t[1],e[1]))},t.prototype.completeVisualOption=function(){e.prototype.completeVisualOption.apply(this,arguments),F(this.stateList,function(e){var t=this.option.controller[e].symbolSize;t&&t[0]!==t[1]&&(t[0]=t[1]/3)},this)},t.prototype.setSelected=function(e){this.option.range=e.slice(),this._resetRange()},t.prototype.getSelected=function(){var e=this.getExtent(),t=Ma((this.get(`range`)||[]).slice());return t[0]>e[1]&&(t[0]=e[1]),t[1]>e[1]&&(t[1]=e[1]),t[0]=n[1]||e<=t[1])?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[];return this.eachTargetSeries(function(n){var r=[],i=n.getData();i.each(this.getDataDimensionIndex(i),function(t,n){e[0]<=t&&t<=e[1]&&r.push(n)},this),t.push({seriesId:n.id,dataIndex:r})},this),t},t.prototype.getVisualMeta=function(e){var t=KY(this,`outOfRange`,this.getExtent()),n=KY(this,`inRange`,this.option.range.slice()),r=[];function i(t,n){r.push({value:t,color:e(t,n)})}for(var a=0,o=0,s=n.length,c=t.length;oe[1])break;r.push({color:this.getControllerVisual(o,`color`,t),offset:a/n})}return r.push({color:this.getControllerVisual(e[1],`color`,t),offset:1}),r},t.prototype._createBarPoints=function(e,t){var n=this.visualMapModel.itemSize;return[[n[0]-t[0],e[0]],[n[0],e[0]],[n[0],e[1]],[n[0]-t[1],e[1]]]},t.prototype._createBarGroup=function(e){var t=this._orient,n=this.visualMapModel.get(`inverse`);return new X(t===`horizontal`&&!n?{scaleX:e===`bottom`?1:-1,rotation:Math.PI/2}:t===`horizontal`&&n?{scaleX:e===`bottom`?-1:1,rotation:-Math.PI/2}:t===`vertical`&&!n?{scaleX:e===`left`?1:-1,scaleY:-1}:{scaleX:e===`left`?1:-1})},t.prototype._updateHandle=function(e,t){if(this._useHandle){var n=this._shapes,r=this.visualMapModel,i=n.handleThumbs,a=n.handleLabels,o=r.itemSize,s=r.getExtent(),c=this._applyTransform(`left`,n.mainGroup);QY([0,1],function(l){var u=i[l];u.setStyle(`fill`,t.handlesColor[l]),u.y=e[l];var d=ZY(e[l],[0,o[1]],s,!0),f=this.getControllerVisual(d,`symbolSize`);u.scaleX=u.scaleY=f/o[0],u.x=o[0]-f/2;var p=pf(n.handleLabelPoints[l],ff(u,this.group));if(this._orient===`horizontal`){var m=c===`left`||c===`top`?(o[0]-f)/2:(o[0]-f)/-2;p[1]+=m}a[l].setStyle({x:p[0],y:p[1],text:r.formatValueText(this._dataInterval[l]),verticalAlign:`middle`,align:this._orient===`vertical`?this._applyTransform(`left`,n.mainGroup):`center`})},this)}},t.prototype._showIndicator=function(e,t,n,r){var i=this.visualMapModel,a=i.getExtent(),o=i.itemSize,s=[0,o[1]],c=this._shapes,l=c.indicator;if(l){l.attr(`invisible`,!1);var u=this.getControllerVisual(e,`color`,{convertOpacityToAlpha:!0}),d=this.getControllerVisual(e,`symbolSize`),f=ZY(e,a,s,!0),p=o[0]-d/2,m={x:l.x,y:l.y};l.y=f,l.x=p;var h=pf(c.indicatorLabelPoint,ff(l,this.group)),g=c.indicatorLabel;g.attr(`invisible`,!1);var _=this._applyTransform(`left`,c.mainGroup),v=this._orient===`horizontal`;g.setStyle({text:(n||``)+i.formatValueText(t),verticalAlign:v?_:`middle`,align:v?`center`:_});var y={x:p,y:f,style:{fill:u}},b={style:{x:h[0],y:h[1]}};if(i.ecModel.isAnimationEnabled()&&!this._firstShowIndicator){var x={duration:100,easing:`cubicInOut`,additive:!0};l.x=m.x,l.y=m.y,l.animateTo(y,x),g.animateTo(b,x)}else l.attr(y),g.attr(b);this._firstShowIndicator=!1;var S=this._shapes.handleLabels;if(S)for(var C=0;Ci[1]&&(l[1]=1/0),t&&(l[0]===-1/0?this._showIndicator(c,l[1],`< `,o):l[1]===1/0?this._showIndicator(c,l[0],`> `,o):this._showIndicator(c,c,`≈ `,o));var u=this._hoverLinkDataIndices,d=[];(t||oX(n))&&(d=this._hoverLinkDataIndices=n.findTargetDataIndices(l));var f=Co(u,d);this._dispatchHighDown(`downplay`,XY(f[0],n)),this._dispatchHighDown(`highlight`,XY(f[1],n))}},t.prototype._hoverLinkFromSeriesMouseOver=function(e){var t;if(Yv(e.target,function(e){var n=Q(e);if(n.dataIndex!=null)return t=n,!0},!0),t){var n=this.ecModel.getSeriesByIndex(t.seriesIndex),r=this.visualMapModel;if(r.isTargetSeries(n)){var i=n.getData(t.dataType),a=i.getStore().get(r.getDataDimensionIndex(i),t.dataIndex);isNaN(a)||this._showIndicator(a,a)}}},t.prototype._hideIndicator=function(){var e=this._shapes;e.indicator&&e.indicator.attr(`invisible`,!0),e.indicatorLabel&&e.indicatorLabel.attr(`invisible`,!0);var t=this._shapes.handleLabels;if(t)for(var n=0;n=0&&(i.dimension=a,r.push(i))}}),e.getData().setVisual(`visualMeta`,r)}}];function dX(e,t,n,r){for(var i=t.targetVisuals[r],a=VN.prepareVisualTypes(i),o={color:Wv(e.getData(),`color`)},s=0,c=a.length;s0:e.splitNumber>0)||e.calculable)?`continuous`:`piecewise`}),e.registerAction(cX,lX),F(uX,function(t){e.registerVisual(e.PRIORITY.VISUAL.COMPONENT,t)}),e.registerPreprocessor(pX))}function _X(e){e.registerComponentModel(GY),e.registerComponentView(rX),gX(e)}var vX=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n._pieceList=[],n}return t.prototype.optionUpdated=function(t,n){e.prototype.optionUpdated.apply(this,arguments),this.resetExtent();var r=this._mode=this._determineMode();this._pieceList=[],yX[this._mode].call(this,this._pieceList),this._resetSelected(t,n);var i=this.option.categories;this.resetVisual(function(e,t){r===`categories`?(e.mappingMethod=`category`,e.categories=O(i)):(e.dataExtent=this.getExtent(),e.mappingMethod=`piecewise`,e.pieceList=I(this._pieceList,function(e){return e=O(e),t!==`inRange`&&(e.visual=null),e}))})},t.prototype.completeVisualOption=function(){var t=this.option,n={},r=VN.listVisualTypes(),i=this.isCategory();F(t.pieces,function(e){F(r,function(t){e.hasOwnProperty(t)&&(n[t]=1)})}),F(n,function(e,n){var r=!1;F(this.stateList,function(e){r=r||a(t,e,n)||a(t.target,e,n)},this),!r&&F(this.stateList,function(e){(t[e]||(t[e]={}))[n]=FY.get(n,e===`inRange`?`active`:`inactive`,i)})},this);function a(e,t,n){return e&&e[t]&&e[t].hasOwnProperty(n)}e.prototype.completeVisualOption.apply(this,arguments)},t.prototype._resetSelected=function(e,t){var n=this.option,r=this._pieceList,i=(t?n:e).selected||{};if(n.selected=i,F(r,function(e,t){var n=this.getSelectedMapKey(e);i.hasOwnProperty(n)||(i[n]=!0)},this),n.selectedMode===`single`){var a=!1;F(r,function(e,t){var n=this.getSelectedMapKey(e);i[n]&&(a?i[n]=!1:a=!0)},this)}},t.prototype.getItemSymbol=function(){return this.get(`itemSymbol`)},t.prototype.getSelectedMapKey=function(e){return this._mode===`categories`?e.value+``:e.index+``},t.prototype.getPieceList=function(){return this._pieceList},t.prototype._determineMode=function(){var e=this.option;return e.pieces&&e.pieces.length>0?`pieces`:this.option.categories?`categories`:`splitNumber`},t.prototype.setSelected=function(e){this.option.selected=O(e)},t.prototype.getValueState=function(e){var t=VN.findPieceIndex(e,this._pieceList);return t==null?`outOfRange`:this.option.selected[this.getSelectedMapKey(this._pieceList[t])]?`inRange`:`outOfRange`},t.prototype.findTargetDataIndices=function(e){var t=[],n=this._pieceList;return this.eachTargetSeries(function(r){var i=[],a=r.getData();a.each(this.getDataDimensionIndex(a),function(t,r){VN.findPieceIndex(t,n)===e&&i.push(r)},this),t.push({seriesId:r.id,dataIndex:i})},this),t},t.prototype.getRepresentValue=function(e){var t;if(this.isCategory())t=e.value;else if(e.value!=null)t=e.value;else{var n=e.interval||[];t=n[0]===-1/0&&n[1]===1/0?0:(n[0]+n[1])/2}return t},t.prototype.getVisualMeta=function(e){if(this.isCategory())return;var t=[],n=[``,``],r=this;function i(i,a){var o=r.getRepresentValue({interval:i});a||=r.getValueState(o);var s=e(o,a);i[0]===-1/0?n[0]=s:i[1]===1/0?n[1]=s:t.push({value:i[0],color:s},{value:i[1],color:s})}var a=this._pieceList.slice();if(!a.length)a.push({interval:[-1/0,1/0]});else{var o=a[0].interval[0];o!==-1/0&&a.unshift({interval:[-1/0,o]}),o=a[a.length-1].interval[1],o!==1/0&&a.push({interval:[o,1/0]})}var s=-1/0;return F(a,function(e){var t=e.interval;t&&(t[0]>s&&i([s,t[0]],`outOfRange`),i(t.slice()),s=t[1])},this),{stops:t,outerColors:n}},t.type=`visualMap.piecewise`,t.defaultOption=op(UY.defaultOption,{selected:null,minOpen:!1,maxOpen:!1,align:`auto`,itemWidth:20,itemHeight:14,itemSymbol:`roundRect`,pieces:null,categories:null,splitNumber:5,selectedMode:`multiple`,itemGap:10,hoverLink:!0}),t}(UY),yX={splitNumber:function(e){var t=this.option,n=Math.min(t.precision,20),r=this.getExtent(),i=t.splitNumber;i=Math.max(parseInt(i,10),1),t.splitNumber=i;for(var a=(r[1]-r[0])/i;+a.toFixed(n)!==a&&n<5;)n++;t.precision=n,a=+a.toFixed(n),t.minOpen&&e.push({interval:[-1/0,r[0]],close:[0,0]});for(var o=0,s=r[0];o`,`≥`][t[0]]];e.text=e.text||this.formatValueText(e.value==null?e.interval:e.value,!1,n)},this)}};function bX(e,t){var n=e.inverse;(e.orient===`vertical`?!n:n)&&t.reverse()}var xX=function(e){r(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.type=t.type,n}return t.prototype.doRender=function(){var e=this.group;e.removeAll();var t=this.visualMapModel,n=t.get(`textGap`),r=t.textStyleModel,i=r.getFont(),a=r.getTextColor(),o=this._getItemAlign(),s=t.itemSize,c=this._getViewData(),l=c.endsText,u=me(t.get(`showLabel`,!0),!l),d=!t.get(`selectedMode`);l&&this._renderEndsText(e,l[0],s,u,o),F(c.viewPieceList,function(r){var c=r.piece,l=new X;l.onclick=z(this._onItemClick,this,c),this._enableHoverLink(l,r.indexInModelPieceList);var f=t.getRepresentValue(c);if(this._createItemSymbol(l,f,[0,0,s[0],s[1]],d),u){var p=this.visualMapModel.getValueState(f);l.add(new Zc({style:{x:o===`right`?-n:s[0]+n,y:s[1]/2,text:c.text,verticalAlign:`middle`,align:o,font:i,fill:a,opacity:p===`outOfRange`?.5:1},silent:d}))}e.add(l)},this),l&&this._renderEndsText(e,l[1],s,u,o),fm(t.get(`orient`),e,t.get(`itemGap`)),this.renderBackground(e),this.positionGroup(e)},t.prototype._enableHoverLink=function(e,t){var n=this;e.on(`mouseover`,function(){return r(`highlight`)}).on(`mouseout`,function(){return r(`downplay`)});var r=function(e){var r=n.visualMapModel;r.option.hoverLink&&n.api.dispatchAction({type:e,batch:XY(r.findTargetDataIndices(t),r)})}},t.prototype._getItemAlign=function(){var e=this.visualMapModel,t=e.option;if(t.orient===`vertical`)return YY(e,this.api,e.itemSize);var n=t.align;return(!n||n===`auto`)&&(n=`left`),n},t.prototype._renderEndsText=function(e,t,n,r,i){if(t){var a=new X,o=this.visualMapModel.textStyleModel;a.add(new Zc({style:Nf(o,{x:r?i===`right`?n[0]:0:n[0]/2,y:n[1]/2,verticalAlign:`middle`,align:r?i:`center`,text:t})})),e.add(a)}},t.prototype._getViewData=function(){var e=this.visualMapModel,t=I(e.getPieceList(),function(e,t){return{piece:e,indexInModelPieceList:t}}),n=e.get(`text`),r=e.get(`orient`),i=e.get(`inverse`);return(r===`horizontal`?i:!i)?t.reverse():n&&=n.slice().reverse(),{viewPieceList:t,endsText:n}},t.prototype._createItemSymbol=function(e,t,n,r){var i=ay(this.getControllerVisual(t,`symbol`),n[0],n[1],n[2],n[3],this.getControllerVisual(t,`color`));i.silent=r,e.add(i)},t.prototype._onItemClick=function(e){var t=this.visualMapModel,n=t.option,r=n.selectedMode;if(r){var i=O(n.selected),a=t.getSelectedMapKey(e);r===`single`||r===!0?(i[a]=!0,F(i,function(e,t){i[t]=t===a})):i[a]=!i[a],this.api.dispatchAction({type:`selectDataRange`,from:this.uid,visualMapId:this.visualMapModel.id,selected:i})}},t.type=`visualMap.piecewise`,t}(qY);function SX(e){e.registerComponentModel(vX),e.registerComponentView(xX),gX(e)}function CX(e){$(_X),$(SX)}var wX={label:{enabled:!0},decal:{show:!1}},TX=To(),EX={};function DX(e,t){var n=e.getModel(`aria`);if(!n.get(`enabled`))return;var r=O(wX);k(r.label,e.getLocaleModel().get(`aria`),!1),k(n.option,r,!1),i(),a();function i(){if(n.getModel(`decal`).get(`show`)){var t=K();e.eachSeries(function(e){if(!e.isColorBySeries()){var n=t.get(e.type);n||(n={},t.set(e.type,n)),TX(e).scope=n}}),e.eachRawSeries(function(t){if(e.isSeriesFiltered(t))return;if(H(t.enableAriaDecal)){t.enableAriaDecal();return}var n=t.getData();if(t.isColorBySeries()){var r=Xm(t.ecModel,t.name,EX,e.getSeriesCount()),i=n.getVisual(`decal`);n.setVisual(`decal`,l(i,r))}else{var a=t.getRawData(),o={},s=TX(t).scope;n.each(function(e){var t=n.getRawIndex(e);o[t]=e});var c=a.count();a.each(function(e){var r=o[e],i=a.getName(e)||e+``,u=Xm(t.ecModel,i,s,c),d=n.getItemVisual(r,`decal`);n.setItemVisual(r,`decal`,l(d,u))})}function l(e,t){var n=e?j(j({},t),e):t;return n.dirty=!0,n}})}}function a(){var r=t.getZr().dom;if(r){var i=e.getLocaleModel().get(`aria`),a=n.getModel(`label`);if(a.option=M(a.option,i),a.get(`enabled`)){if(r.setAttribute(`role`,`img`),a.get(`description`)){r.setAttribute(`aria-label`,a.get(`description`));return}var l=e.getSeriesCount(),u=a.get([`data`,`maxCount`])||10,d=a.get([`series`,`maxCount`])||10,f=Math.min(l,d),p;if(!(l<1)){var m=s();p=m?o(a.get([`general`,`withTitle`]),{title:m}):a.get([`general`,`withoutTitle`]);var h=[],g=l>1?a.get([`series`,`multiple`,`prefix`]):a.get([`series`,`single`,`prefix`]);p+=o(g,{seriesCount:l}),e.eachSeries(function(e,t){if(t1?a.get([`series`,`multiple`,r]):a.get([`series`,`single`,r]),n=o(n,{seriesId:e.seriesIndex,seriesName:e.get(`name`),seriesType:c(e.subType)});var i=e.getData();if(i.count()>u){var s=a.get([`data`,`partialData`]);n+=o(s,{displayCnt:u})}else n+=a.get([`data`,`allData`]);for(var d=a.get([`data`,`separator`,`middle`]),p=a.get([`data`,`separator`,`end`]),m=a.get([`data`,`excludeDimensionId`]),g=[],_=0;_":`gt`,">=":`gte`,"=":`eq`,"!=":`ne`,"<>":`ne`},jX=function(){function e(e){(this._condVal=U(e)?new RegExp(e):fe(e)?e:null)??Qa(``)}return e.prototype.evaluate=function(e){var t=typeof e;return U(t)?this._condVal.test(e):oe(t)?this._condVal.test(e+``):!1},e}(),MX=function(){function e(){}return e.prototype.evaluate=function(){return this.value},e}(),NX=function(){function e(){}return e.prototype.evaluate=function(){for(var e=this.children,t=0;t2&&r.push(i),i=[e,t]}function u(e,t,n,r){ZX(e,n)&&ZX(t,r)||i.push(e,t,n,r,n,r)}function d(e,t,n,r,a,o){var s=Math.abs(t-e),c=Math.tan(s/4)*4/3,l=tw:D2&&r.push(i),r}function $X(e,t,n,r,i,a,o,s,c,l){if(ZX(e,n)&&ZX(t,r)&&ZX(i,o)&&ZX(a,s)){c.push(o,s);return}var u=2/l,d=u*u,f=o-e,p=s-t,m=Math.sqrt(f*f+p*p);f/=m,p/=m;var h=n-e,g=r-t,_=i-o,v=a-s,y=h*h+g*g,b=_*_+v*v;if(y=0&&w=0){c.push(o,s);return}var T=[],E=[];Fn(e,n,i,o,.5,T),Fn(t,r,a,s,.5,E),$X(T[0],E[0],T[1],E[1],T[2],E[2],T[3],E[3],c,l),$X(T[4],E[4],T[5],E[5],T[6],E[6],T[7],E[7],c,l)}function eZ(e,t){var n=QX(e),r=[];t||=1;for(var i=0;i0)for(var l=0;lMath.abs(l),d=tZ([c,l],+!u,t),f=(u?s:l)/d.length,p=0;pi,o=tZ([r,i],+!a,t),s=a?`width`:`height`,c=a?`height`:`width`,l=a?`x`:`y`,u=a?`y`:`x`,d=e[s]/o.length,f=0;f1?null:new J(p*c+e,p*l+t)}function oZ(e,t,n){var r=new J;J.sub(r,n,t),r.normalize();var i=new J;return J.sub(i,e,t),i.dot(r)}function sZ(e,t){var n=e[e.length-1];n&&n[0]===t[0]&&n[1]===t[1]||e.push(t)}function cZ(e,t,n){for(var r=e.length,i=[],a=0;ao?(l.x=u.x=s+a/2,l.y=c,u.y=c+o):(l.y=u.y=c+o/2,l.x=s,u.x=s+a),cZ(t,l,u)}function uZ(e,t,n,r){if(n===1)r.push(t);else{var i=Math.floor(n/2),a=e(t);uZ(e,a[0],i,r),uZ(e,a[1],n-i,r)}return r}function dZ(e,t){for(var n=[],r=0;r0)for(var x=r/n,S=-r/2;S<=r/2;S+=x){for(var C=Math.sin(S),w=Math.cos(S),T=0,y=0;y0;l/=2){var u=0,d=0;(e&l)>0&&(u=1),(t&l)>0&&(d=1),s+=l*l*(3*u^d),d===0&&(u===1&&(e=l-1-e,t=l-1-t),c=e,e=t,t=c)}return s}function AZ(e){var t=1/0,n=1/0,r=-1/0,i=-1/0;return I(I(e,function(e){var a=e.getBoundingRect(),o=e.getComputedTransform(),s=a.x+a.width/2+(o?o[4]:0),c=a.y+a.height/2+(o?o[5]:0);return t=Math.min(s,t),n=Math.min(c,n),r=Math.max(s,r),i=Math.max(c,i),[s,c]}),function(a,o){return{cp:a,z:kZ(a[0],a[1],t,n,r,i),path:e[o]}}).sort(function(e,t){return e.z-t.z}).map(function(e){return e.path})}function jZ(e){return mZ(e.path,e.count)}function MZ(){return{fromIndividuals:[],toIndividuals:[],count:0}}function NZ(e,t,n){var r=[];function i(e){for(var t=0;t=0;i--)if(!n[i].many.length){var c=n[s].many;if(c.length<=1){if(s)s=0;else return n}var a=c.length,l=Math.ceil(a/2);n[i].many=c.slice(l,a),n[s].many=c.slice(0,l),s++}return n}var LZ={clone:function(e){for(var t=[],n=1-(1-e.path.style.opacity)**(1/e.count),r=0;r0))return;var s=r.getModel(`universalTransition`).get(`delay`),c=Object.assign({setToFinal:!0},o),l,u;FZ(e)&&(l=e,u=t),FZ(t)&&(l=t,u=e);function d(e,t,r,i,o){var l=e.many,u=e.one;if(l.length===1&&!o){var f=t?l[0]:u,p=t?u:l[0];if(SZ(f))d({many:[f],one:p},!0,r,i,!0);else{var m=s?M({delay:s(r,i)},c):c;OZ(f,p,m),a(f,p,f,p,m)}}else for(var h=M({dividePath:LZ[n],individualDelay:s&&function(e,t,n,a){return s(e+r,i)}},c),g=t?NZ(l,u,h):PZ(u,l,h),_=g.fromIndividuals,v=g.toIndividuals,y=_.length,b=0;bt.length,p=l?IZ(u,l):IZ(f?t:e,[f?e:t]),m=0,h=0;hBZ))for(var i=n.getIndices(),a=0;a0&&r.group.traverse(function(e){e instanceof Nc&&!e.animators.length&&e.animateFrom({style:{opacity:0}},i)})})}function tQ(e){return e.getModel(`universalTransition`).get(`seriesKey`)||e.id}function nQ(e){return V(e)?e.sort().join(`,`):e}function rQ(e){if(e.hostModel)return e.hostModel.getModel(`universalTransition`).get(`divideShape`)}function iQ(e,t){var n=K(),r=K(),i=K();return F(e.oldSeries,function(t,n){var a=e.oldDataGroupIds[n],o=e.oldData[n],s=tQ(t),c=nQ(s);r.set(c,{dataGroupId:a,data:o}),V(s)&&F(s,function(e){i.set(e,{key:c,dataGroupId:a,data:o})})}),F(t.updatedSeries,function(e){if(e.isUniversalTransitionEnabled()&&e.isAnimationEnabled()){var t=e.get(`dataGroupId`),a=e.getData(),o=tQ(e),s=nQ(o),c=r.get(s);if(c)n.set(s,{oldSeries:[{dataGroupId:c.dataGroupId,divide:rQ(c.data),data:c.data}],newSeries:[{dataGroupId:t,divide:rQ(a),data:a}]});else if(V(o)){var l=[];F(o,function(e){var t=r.get(e);t.data&&l.push({dataGroupId:t.dataGroupId,divide:rQ(t.data),data:t.data})}),l.length&&n.set(s,{oldSeries:l,newSeries:[{dataGroupId:t,data:a,divide:rQ(a)}]})}else{var u=i.get(o);if(u){var d=n.get(u.key);d||(d={oldSeries:[{dataGroupId:u.dataGroupId,data:u.data,divide:rQ(u.data)}],newSeries:[]},n.set(u.key,d)),d.newSeries.push({dataGroupId:t,data:a,divide:rQ(a)})}}}}),n}function aQ(e,t){for(var n=0;n=0&&i.push({dataGroupId:t.oldDataGroupIds[n],data:t.oldData[n],divide:rQ(t.oldData[n]),groupIdDim:e.dimension})}),F(no(e.to),function(e){var r=aQ(n.updatedSeries,e);if(r>=0){var i=n.updatedSeries[r].getData();a.push({dataGroupId:t.oldDataGroupIds[r],data:i,divide:rQ(i),groupIdDim:e.dimension})}}),i.length>0&&a.length>0&&eQ(i,a,r)}function sQ(e){e.registerUpdateLifecycle(`series:beforeupdate`,function(e,t,n){F(no(n.seriesTransition),function(e){F(no(e.to),function(e){for(var t=n.updatedSeries,r=0;r{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},u=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;lt[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:r(s(e)),d(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e));let p=e("@deepseek-ai/dsh-client-ui-primitives");p=f(p,1);let m=e("react-dom/client"),h=e("react"),g=e("react/jsx-runtime"),_=(0,h.createContext)(void 0),v=p.GenuiActionContext??_;function y(){return(0,h.useContext)(v)}let b={display:`flex`,flexDirection:`column`,gap:`4px`,padding:`8px 12px`,margin:`4px 0`,borderRadius:`8px`,border:`1px solid rgba(127,127,127,0.35)`,background:`rgba(127,127,127,0.08)`,color:`inherit`,fontSize:`12px`,lineHeight:1.5,fontFamily:`inherit`};var x=class extends h.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[dsh-genui] render failed:`,e,t.componentStack??``)}render(){let{error:e}=this.state;return e===null?this.props.children:(0,g.jsxs)(`div`,{style:b,role:`alert`,"data-genui-error":!0,children:[(0,g.jsxs)(`span`,{style:{fontWeight:600},children:[`⚠️ `,this.props.label??`此界面`,`渲染失败(已隔离,不影响其他内容)`]}),(0,g.jsx)(`span`,{style:{opacity:.75,overflowWrap:`anywhere`},children:e.message})]})}};let S=`@omdsh-dev/dsh-genui/GenuiBlock.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(S)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@omdsh-dev/dsh-genui`,e.dataset.pluginCss=S,e.textContent=`.V1MMBW_block{--dsl-g-radius-surface:12px;--dsl-g-radius-control:8px;--dsl-g-radius-pill:999px;--dsl-g-font-display:24px;--dsl-g-font-h1:20px;--dsl-g-font-h2:16px;--dsl-g-font-h3:14px;--dsl-g-font-body:14px;--dsl-g-font-title:13px;--dsl-g-font-meta:12px;--dsl-g-font-data:11px;--dsl-g-gap-lg:16px;--dsl-g-gap-md:12px;--dsl-g-gap-sm:8px;--dsl-g-gap-xs:4px;--dsl-g-border:var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,#ffffff1f));--dsl-g-border-strong:var(--dsw-alias-border-l2,#ffffff1f);--dsl-g-accent:var(--dsw-alias-state-business-primary,#4f8ef7);--dsl-g-accent-soft:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint), transparent);--dsl-g-tint:8%;--dsl-g-tint-strong:14%;--dsl-g-font-mono:var(--ds-font-family-code,ui-monospace, "SF Mono", monospace);color:var(--dsw-alias-label-primary);margin:8px 0}.V1MMBW_banner{font-size:var(--dsl-g-font-title);letter-spacing:.01em;color:var(--dsw-alias-label-primary);margin-bottom:var(--dsl-g-gap-lg);border-bottom:1px solid var(--dsl-g-border);padding-bottom:10px;font-weight:600}.V1MMBW_col{gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_row{align-items:center;gap:var(--dsl-g-gap-md);display:flex}.V1MMBW_row.V1MMBW_wrap{flex-wrap:wrap}.V1MMBW_grid{gap:var(--dsl-g-gap-md);display:grid}.V1MMBW_spacer{flex:1}.V1MMBW_divider{background:var(--dsw-alias-markdown-hr,var(--dsl-g-border));height:1px;margin:var(--dsl-g-gap-xs) 0;border:none}.V1MMBW_card{background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);padding:var(--dsl-g-gap-lg);gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_cardTitle{font-size:var(--dsl-g-font-meta);letter-spacing:.02em;color:var(--dsw-alias-label-secondary);font-weight:600}.V1MMBW_text{color:var(--dsw-alias-label-primary)}.V1MMBW_text.V1MMBW_h1{font-size:var(--dsl-g-font-h1);letter-spacing:-.02em;font-weight:700;line-height:1.3}.V1MMBW_text.V1MMBW_h2{font-size:var(--dsl-g-font-h2);letter-spacing:-.01em;font-weight:600;line-height:1.35}.V1MMBW_text.V1MMBW_h3{font-size:var(--dsl-g-font-h3);font-weight:600;line-height:1.5}.V1MMBW_text.V1MMBW_body{font-size:var(--dsl-g-font-body);color:var(--dsw-alias-label-primary);line-height:1.6}.V1MMBW_text.V1MMBW_muted{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);line-height:1.5}.V1MMBW_text.V1MMBW_caption{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);letter-spacing:.02em;line-height:1.5}.V1MMBW_text.V1MMBW_center{text-align:center}.V1MMBW_button{border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:var(--dsl-g-radius-control);padding:8px var(--dsl-g-gap-lg);font-size:var(--dsl-g-font-title);cursor:pointer;text-align:center;font-family:inherit;font-weight:600;line-height:1.4;transition:border-color .15s,filter .15s,background .15s}.V1MMBW_button:hover:not(:disabled){border-color:var(--dsl-g-accent);filter:brightness(1.06)}.V1MMBW_button.V1MMBW_primary:hover:not(:disabled){filter:brightness(1.08)}.V1MMBW_button:disabled{cursor:not-allowed;opacity:.45;filter:none;box-shadow:none;pointer-events:none}.V1MMBW_button.V1MMBW_primary{background:var(--dsl-g-accent);color:#fff;border:none;box-shadow:inset 0 1px #ffffff24}.V1MMBW_button.V1MMBW_danger{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent);border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent);color:var(--dsw-alias-state-error-primary,#ffb3b3)}.V1MMBW_button.V1MMBW_success{background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 30%, transparent);color:var(--dsw-alias-state-success-secondary,#9fe8c5)}.V1MMBW_button.V1MMBW_ghost{background:0 0}.V1MMBW_button.V1MMBW_full{width:100%}.V1MMBW_button.V1MMBW_small{font-size:var(--dsl-g-font-meta);border-radius:var(--dsl-g-radius-control);padding:4px 12px}.V1MMBW_field{gap:var(--dsl-g-gap-xs);flex-direction:column;display:flex}.V1MMBW_field>span{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_input,.V1MMBW_select{background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);color:var(--dsw-alias-label-primary);font-size:var(--dsl-g-font-title);outline:none;width:100%;padding:8px 12px;font-family:inherit}.V1MMBW_input:focus,.V1MMBW_select:focus{border-color:var(--dsl-g-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent)}.V1MMBW_input::placeholder{color:var(--dsw-alias-label-caption,#5b6378)}.V1MMBW_checkbox{align-items:center;gap:var(--dsl-g-gap-sm);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);cursor:pointer;display:flex}.V1MMBW_checkbox input{accent-color:var(--dsl-g-accent);width:15px;height:15px}.V1MMBW_link{color:var(--dsl-g-accent);font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;border:none;padding:0;font-family:inherit;text-decoration:none}.V1MMBW_link:hover{text-decoration:underline}.V1MMBW_linkText{color:var(--dsl-g-accent);font-size:var(--dsl-g-font-title);font-family:inherit;text-decoration:none}.V1MMBW_badge{align-items:center;gap:var(--dsl-g-gap-xs);font-size:var(--dsl-g-font-meta);letter-spacing:.01em;border-radius:var(--dsl-g-radius-pill);background:color-mix(in srgb, var(--dsw-alias-label-tertiary) var(--dsl-g-tint), transparent);width:fit-content;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsl-g-border);padding:1px 10px;font-weight:500;line-height:1.5;display:inline-flex}.V1MMBW_badge.V1MMBW_success{background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-success-secondary,#7fe3b4);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 30%, transparent)}.V1MMBW_badge.V1MMBW_warn{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#f5b83d) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-warn-secondary,#f7cf7d);border-color:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#f5b83d) 30%, transparent)}.V1MMBW_badge.V1MMBW_danger{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-error-primary,#ff9d9d);border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent)}.V1MMBW_badge.V1MMBW_accent{background:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-business-primary,#9cc3ff);border-color:color-mix(in srgb, var(--dsl-g-accent) 30%, transparent)}.V1MMBW_stat{padding:6px var(--dsl-g-gap-lg);flex-direction:column;gap:2px;display:flex}.V1MMBW_grid>.V1MMBW_stat,.V1MMBW_row>.V1MMBW_stat{border-left:1px solid var(--dsl-g-border)}.V1MMBW_grid>.V1MMBW_stat:first-child,.V1MMBW_row>.V1MMBW_stat:first-child{padding-left:var(--dsl-g-gap-xs);border-left:none}.V1MMBW_statLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);letter-spacing:.02em}.V1MMBW_statValue{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-display);letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.2}.V1MMBW_statDelta{font-size:var(--dsl-g-font-meta);font-weight:500}.V1MMBW_statDelta.V1MMBW_up{color:var(--dsw-alias-state-success-primary,#22c55e)}.V1MMBW_statDelta.V1MMBW_down{color:var(--dsw-alias-state-error-primary,#f25a5a)}.V1MMBW_progress{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_progressRow{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);justify-content:space-between;display:flex}.V1MMBW_progressRow span:last-child{font-family:var(--dsl-g-font-mono)}.V1MMBW_track{border-radius:var(--dsl-g-radius-pill);background:var(--dsw-alias-bg-layer-1);height:6px;box-shadow:inset 0 0 0 1px var(--dsl-g-border);overflow:hidden}.V1MMBW_fill{border-radius:var(--dsl-g-radius-pill);background:var(--dsl-g-accent);height:100%;transition:width .5s}.V1MMBW_list{flex-direction:column;display:flex}.V1MMBW_li{padding:var(--dsl-g-gap-sm) var(--dsl-g-gap-xs);flex-direction:column;gap:2px;display:flex}.V1MMBW_li+.V1MMBW_li{border-top:1px solid var(--dsl-g-border)}.V1MMBW_li:last-child{border-bottom:none}.V1MMBW_liTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.5}.V1MMBW_liDesc{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);line-height:1.5}.V1MMBW_tableWrap{border-radius:var(--dsl-g-radius-control);overscroll-behavior-x:contain;min-width:0;max-width:100%;overflow-x:auto}.V1MMBW_table{border-collapse:collapse;width:100%;font-size:var(--dsl-g-font-title)}.V1MMBW_table th{text-align:left;padding:var(--dsl-g-gap-sm) var(--dsl-g-gap-md);color:var(--dsw-alias-label-tertiary);font-weight:600;font-size:var(--dsl-g-font-meta);border-bottom:1px solid var(--dsl-g-border);white-space:nowrap}.V1MMBW_table td{padding:var(--dsl-g-gap-sm) var(--dsl-g-gap-md);border-bottom:1px solid var(--dsl-g-border);color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;line-height:1.5}.V1MMBW_table tr:last-child td{border-bottom:none}.V1MMBW_thSort{color:inherit;font:inherit;font-weight:inherit;cursor:pointer;text-align:left;background:0 0;border:none;margin:0;padding:0}.V1MMBW_thSort:hover{color:var(--dsw-alias-label-primary)}.V1MMBW_thSortMark{color:var(--dsl-g-accent)}.V1MMBW_thSort:focus-visible{outline:2px solid var(--dsl-g-accent);outline-offset:1px;border-radius:var(--dsl-g-radius-control)}.V1MMBW_chart{gap:var(--dsl-g-gap-xs);flex-direction:column;display:flex}.V1MMBW_chartPlot{align-items:flex-end;gap:var(--dsl-g-gap-sm);height:132px;display:flex;position:relative}.V1MMBW_baseline{background:var(--dsl-g-border-strong);pointer-events:none;height:1px;position:absolute;bottom:0;left:0;right:0}.V1MMBW_gridline{background:var(--dsw-alias-border-l1,#ffffff0f);pointer-events:none;height:1px;position:absolute;left:0;right:0}.V1MMBW_chartLabels{gap:var(--dsl-g-gap-sm);display:flex}.V1MMBW_chartLabels>span{flex:1;min-width:0}.V1MMBW_barCol{justify-content:flex-end;gap:var(--dsl-g-gap-xs);flex-direction:column;flex:1;min-width:0;height:100%;display:flex}.V1MMBW_barValue{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data);font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);text-align:center;line-height:1.2}.V1MMBW_barFill{background:var(--dsl-g-accent);border-radius:4px 4px 2px 2px;min-height:4px;transition:height .6s}.V1MMBW_barLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);text-align:center;white-space:nowrap;text-overflow:ellipsis;line-height:1.5;overflow:hidden}.V1MMBW_tabs{gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_tabBar{gap:var(--dsl-g-gap-xs);border-bottom:1px solid var(--dsl-g-border);display:flex}.V1MMBW_tab{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:6px 12px;font-family:inherit;font-weight:600;line-height:1.5}.V1MMBW_tabActive{color:var(--dsw-alias-label-primary);border-bottom-color:var(--dsl-g-accent)}.V1MMBW_avatar{width:32px;height:32px;font-size:var(--dsl-g-font-title);color:#fff;border:1px solid #ffffff24;border-radius:50%;flex-shrink:0;place-items:center;font-weight:700;display:grid;box-shadow:inset 0 1px #ffffff29}.V1MMBW_callout{border-radius:var(--dsl-g-radius-control);border:1px solid var(--dsl-g-border);font-size:var(--dsl-g-font-title);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));flex-direction:column;gap:2px;padding:10px 14px;line-height:1.6;display:flex}.V1MMBW_calloutInfo{background:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint), transparent)}.V1MMBW_calloutSuccess{background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent)}.V1MMBW_calloutWarning{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#f5b83d) var(--dsl-g-tint), transparent)}.V1MMBW_calloutError{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent)}.V1MMBW_calloutTitle{font-weight:600;font-size:var(--dsl-g-font-meta);letter-spacing:.02em;color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;display:flex}.V1MMBW_calloutTitle:before{content:"";background:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary));border-radius:50%;width:6px;height:6px}.V1MMBW_calloutInfo .V1MMBW_calloutTitle:before{background:var(--dsl-g-accent)}.V1MMBW_calloutSuccess .V1MMBW_calloutTitle:before{background:var(--dsw-alias-state-success-primary,#3ecf8e)}.V1MMBW_calloutWarning .V1MMBW_calloutTitle:before{background:var(--dsw-alias-state-warn-primary,#f5b83d)}.V1MMBW_calloutError .V1MMBW_calloutTitle:before{background:var(--dsw-alias-state-error-primary,#ff6b6b)}.V1MMBW_calloutBody{color:var(--dsw-alias-label-secondary)}.V1MMBW_steps{gap:var(--dsl-g-gap-sm);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.V1MMBW_step{gap:var(--dsl-g-gap-md);align-items:flex-start;display:flex}.V1MMBW_stepMarker{width:24px;height:24px;font-size:var(--dsl-g-font-meta);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsl-g-border);color:var(--dsw-alias-label-tertiary);border-radius:50%;flex-shrink:0;place-items:center;font-weight:700;display:grid}.V1MMBW_stepDone .V1MMBW_stepMarker{background:var(--dsw-alias-state-success-primary,#3ecf8e);color:#fff;border-color:#0000;font-size:13px}.V1MMBW_stepActive .V1MMBW_stepMarker{background:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent);border-color:var(--dsl-g-accent);color:var(--dsl-g-accent)}.V1MMBW_stepContent{flex-direction:column;gap:2px;padding-top:3px;display:flex}.V1MMBW_stepTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.5}.V1MMBW_stepDesc{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);line-height:1.5}.V1MMBW_keyvalue{flex-direction:column;margin:0;display:flex}.V1MMBW_kvRow{gap:var(--dsl-g-gap-md);font-size:var(--dsl-g-font-title);padding:6px 0;display:flex}.V1MMBW_kvRow+.V1MMBW_kvRow{border-top:1px solid var(--dsl-g-border)}.V1MMBW_kvRow:last-child{border-bottom:none}.V1MMBW_kvKey{width:96px;color:var(--dsw-alias-label-tertiary);flex-shrink:0;font-weight:600}.V1MMBW_kvValue{color:var(--dsw-alias-label-primary);word-break:break-word;margin:0;line-height:1.5}.V1MMBW_jsonScalar{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary)}.V1MMBW_lineChart{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_linePath{fill:none;stroke:var(--dsl-g-accent);stroke-width:2px;stroke-linejoin:round;stroke-linecap:round}.V1MMBW_lineDot{fill:var(--dsl-g-accent)}.V1MMBW_lineGrid{stroke:var(--dsw-alias-border-l1,#ffffff12);stroke-width:1px}.V1MMBW_lineGridAxis{stroke:var(--dsl-g-border-strong);stroke-width:1px}.V1MMBW_lineTick{fill:var(--dsw-alias-label-tertiary);font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data)}.V1MMBW_lineLabels{justify-content:space-between;display:flex}.V1MMBW_groupedBars{gap:var(--dsl-g-gap-xs);align-items:flex-end;width:100%;height:100%;display:flex}.V1MMBW_groupedBar{flex-direction:column;flex:1;justify-content:flex-end;align-items:center;gap:2px;min-width:0;height:100%;display:flex}.V1MMBW_groupValue{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data);font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;max-width:100%;line-height:1.2;overflow:hidden}.V1MMBW_groupedFill{background:var(--dsl-g-accent);border-radius:4px 4px 2px 2px;flex:none;width:100%;min-height:3px}.V1MMBW_donut{align-items:center;gap:var(--dsl-g-gap-lg);display:flex}.V1MMBW_donutTrack{stroke:var(--dsw-alias-border-l1,#ffffff14)}.V1MMBW_donutTotal{fill:var(--dsw-alias-label-primary);font-size:var(--dsl-g-font-h2);font-weight:700}.V1MMBW_donutTotalLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.V1MMBW_donutLegend{gap:var(--dsl-g-gap-xs);font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-secondary);flex-direction:column;line-height:1.5;display:flex}.V1MMBW_fieldGroup{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_fieldLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_radio{align-items:center;gap:var(--dsl-g-gap-sm);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);cursor:pointer;line-height:1.5;display:flex}.V1MMBW_radio input{accent-color:var(--dsl-g-accent)}.V1MMBW_submitRow{align-items:center;gap:var(--dsl-g-gap-md);margin-top:2px;display:flex}.V1MMBW_submit{align-self:flex-start}.V1MMBW_submitHint{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_btnSent{margin-left:var(--dsl-g-gap-sm);font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-state-success-primary,#3ecf8e);font-weight:600}.V1MMBW_gradeWrap{gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_gradeScore{align-items:baseline;gap:var(--dsl-g-gap-sm);display:flex}.V1MMBW_gradeScoreValue{font-size:var(--dsl-g-font-display);color:var(--dsw-alias-label-primary);font-weight:700;line-height:1.2}.V1MMBW_gradeScoreLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_gradeList{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_gradeItem{font-size:var(--dsl-g-font-title);padding:var(--dsl-g-gap-sm) 12px;border-radius:var(--dsl-g-radius-control);border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-layer-1);grid-template-columns:auto auto 1fr;align-items:baseline;gap:6px 10px;line-height:1.5;display:grid}.V1MMBW_gradeItemOk{border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 30%, transparent)}.V1MMBW_gradeItemNo{border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent)}.V1MMBW_gradeQ{color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_gradeTag{font-weight:700}.V1MMBW_gradeItemOk .V1MMBW_gradeTag{color:var(--dsw-alias-state-success-primary,#3ecf8e)}.V1MMBW_gradeItemNo .V1MMBW_gradeTag{color:var(--dsw-alias-state-error-primary,#ff6b6b)}.V1MMBW_gradeAns{color:var(--dsw-alias-label-secondary)}.V1MMBW_gradeRight{color:var(--dsw-alias-state-error-primary,#ffb3b3)}.V1MMBW_gradeExp{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);grid-column:1/-1;line-height:1.5}.V1MMBW_switchRow{justify-content:space-between;align-items:center;gap:var(--dsl-g-gap-md);cursor:pointer;display:flex}.V1MMBW_switchRow:focus-within .V1MMBW_switch{box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent)}.V1MMBW_switchLabel{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);line-height:1.5}.V1MMBW_switch{border-radius:var(--dsl-g-radius-pill);border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-base,#17171a);width:38px;height:22px;transition:background .2s;position:relative}.V1MMBW_switchOn{background:var(--dsl-g-accent);border-color:#0000}.V1MMBW_switchKnob{background:#fff;border-radius:50%;width:14px;height:14px;transition:left .2s;position:absolute;top:3px;left:3px;box-shadow:0 1px 2px #0000004d}.V1MMBW_switchOn .V1MMBW_switchKnob{left:19px}.V1MMBW_sliderRow{align-items:center;gap:var(--dsl-g-gap-md);width:100%;display:flex}.V1MMBW_sliderInput{min-width:0;accent-color:var(--dsl-g-accent);flex:1}.V1MMBW_sliderValue{text-align:right;min-width:44px;font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data);color:var(--dsw-alias-label-primary)}.V1MMBW_textarea{background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);width:100%;color:var(--dsw-alias-label-primary);padding:var(--dsl-g-gap-sm) 12px;font-size:var(--dsl-g-font-title);resize:vertical;outline:none;font-family:inherit;line-height:1.5}.V1MMBW_textarea:focus{border-color:var(--dsl-g-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent)}.V1MMBW_accordion{border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);flex-direction:column;display:flex;overflow:hidden}.V1MMBW_accItem{border-bottom:1px solid var(--dsl-g-border)}.V1MMBW_accItem:last-child{border-bottom:none}.V1MMBW_accHead{justify-content:space-between;align-items:center;gap:var(--dsl-g-gap-sm);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);font-size:var(--dsl-g-font-title);cursor:pointer;border:none;padding:10px 14px;font-family:inherit;font-weight:600;line-height:1.5;display:flex}.V1MMBW_accChevron{color:var(--dsw-alias-label-tertiary)}.V1MMBW_accBody{padding:var(--dsl-g-gap-md) 14px;gap:var(--dsl-g-gap-sm);background:var(--dsw-alias-bg-base,#17171a);flex-direction:column;display:flex}.V1MMBW_copyChip{border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);cursor:pointer;width:fit-content;padding:6px 14px;font-family:inherit;font-weight:600;transition:all .15s}.V1MMBW_copyChip:hover{border-color:var(--dsl-g-accent)}.V1MMBW_copyChipDone{border-color:var(--dsw-alias-state-success-primary,#3ecf8e);color:var(--dsw-alias-state-success-primary,#3ecf8e)}.V1MMBW_mermaid{padding:var(--dsl-g-gap-xs) 0;overflow-x:auto}.V1MMBW_mermaid svg{max-width:100%;height:auto}.V1MMBW_mermaidFallback{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_mermaidFallback pre{padding:var(--dsl-g-gap-sm) 10px;background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-meta);margin:0;overflow-x:auto}.V1MMBW_mermaidErr{color:var(--dsw-alias-state-error-primary,#ff6b6b);font-size:var(--dsl-g-font-meta)}.V1MMBW_mermaidHint{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-meta)}.V1MMBW_scene3dWrap{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_scene3dTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:700}.V1MMBW_scene3dCanvas{border-radius:var(--dsl-g-radius-surface);background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);height:240px;overflow:hidden}.V1MMBW_scene3dCanvas canvas{display:block}.V1MMBW_scene3dHint{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-meta)}.V1MMBW_timeline{flex-direction:column;display:flex}.V1MMBW_tlItem{gap:var(--dsl-g-gap-md);display:flex}.V1MMBW_tlRail{flex-direction:column;flex-shrink:0;align-items:center;width:12px;display:flex}.V1MMBW_tlDot{background:var(--dsl-g-accent);width:10px;height:10px;box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent);border-radius:50%;flex-shrink:0;margin-top:4px}.V1MMBW_tlLine{background:var(--dsl-g-border);flex:1;width:2px;margin:2px 0}.V1MMBW_tlBody{padding-bottom:var(--dsl-g-gap-lg);flex:1;min-width:0}.V1MMBW_tlHead{align-items:baseline;gap:var(--dsl-g-gap-md);display:flex}.V1MMBW_tlTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.5}.V1MMBW_tlTime{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-left:auto}.V1MMBW_tlDesc{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);margin-top:2px;line-height:1.5}.V1MMBW_fileTree{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-meta);flex-direction:column;display:flex}.V1MMBW_ftRow{align-items:center;gap:var(--dsl-g-gap-sm);padding:3px var(--dsl-g-gap-xs);border-radius:var(--dsl-g-radius-control);display:flex}.V1MMBW_ftRow:hover{background:var(--dsw-alias-bg-layer-1)}.V1MMBW_ftIcon{text-align:center;width:13px;font-size:10px;font-family:var(--dsl-g-font-mono);color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary));flex-shrink:0;line-height:1}.V1MMBW_ftIconDir{color:var(--dsl-g-accent);font-size:11px}.V1MMBW_ftName{color:var(--dsw-alias-label-secondary)}.V1MMBW_ftDir{color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_ftNameBtn{align-items:center;gap:var(--dsl-g-gap-sm);min-width:0;font-family:inherit;font-size:var(--dsl-g-font-body);cursor:default;text-align:left;background:0 0;border:none;padding:0;display:inline-flex}button.V1MMBW_ftNameBtn[aria-expanded]{cursor:pointer}.V1MMBW_ftNameBtn:focus-visible{outline:2px solid var(--dsl-g-accent);outline-offset:1px;border-radius:var(--dsl-g-radius-control)}.V1MMBW_breadcrumb{align-items:center;gap:var(--dsl-g-gap-xs);font-size:var(--dsl-g-font-title);flex-wrap:wrap;display:flex}.V1MMBW_bcItem{align-items:center;gap:var(--dsl-g-gap-xs);display:inline-flex}.V1MMBW_bcText{color:var(--dsw-alias-label-secondary);cursor:pointer}.V1MMBW_bcText:hover{color:var(--dsl-g-accent)}.V1MMBW_bcCurrent{color:var(--dsw-alias-label-primary);cursor:default;font-weight:600}.V1MMBW_bcSep{color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary))}@keyframes V1MMBW_genuiReveal{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.V1MMBW_reveal{animation:.45s cubic-bezier(.22,1,.36,1) both V1MMBW_genuiReveal}@media (prefers-reduced-motion:reduce){.V1MMBW_reveal{animation:none}}.V1MMBW_quiz{gap:var(--dsl-g-gap-md);padding:var(--dsl-g-gap-lg);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);flex-direction:column;display:flex}.V1MMBW_quizQuestion{font-size:var(--dsl-g-font-body);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.6}.V1MMBW_quizOptions{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_quizOpt{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);cursor:pointer;padding:10px 14px;font-family:inherit;line-height:1.5;transition:border-color .15s,background .15s;display:flex}.V1MMBW_quizOpt:hover:not(:disabled){border-color:var(--dsl-g-accent);background:var(--dsl-g-accent-soft)}.V1MMBW_quizOpt:focus-visible,.V1MMBW_button:focus-visible,.V1MMBW_tab:focus-visible,.V1MMBW_accHead:focus-visible,.V1MMBW_copyChip:focus-visible,.V1MMBW_link:focus-visible,.V1MMBW_quizRetry:focus-visible,.V1MMBW_resetBtn:focus-visible,.V1MMBW_playBtn:focus-visible,.V1MMBW_bcText:focus-visible{outline:2px solid var(--dsl-g-accent);outline-offset:1px}.V1MMBW_quizOpt:disabled{cursor:default;opacity:.85}.V1MMBW_quizOptCorrect{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 40%, transparent);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-success-primary,#3ecf8e);padding:10px 14px;font-family:inherit;font-weight:600;line-height:1.5;display:flex}.V1MMBW_quizOptWrong{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-error-primary,#ff6b6b);padding:10px 14px;font-family:inherit;font-weight:600;line-height:1.5;display:flex}.V1MMBW_quizOptReveal{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);border:1px dashed color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 40%, transparent);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-success-primary,#3ecf8e);padding:10px 14px;font-family:inherit;line-height:1.5;display:flex}.V1MMBW_quizMarker{text-align:center;width:16px;font-weight:700}.V1MMBW_quizResult{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_quizCorrectMsg{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-success-primary,#3ecf8e);font-weight:600}.V1MMBW_quizWrongMsg{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-error-primary,#ff6b6b);font-weight:600}.V1MMBW_quizFeedback{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-secondary);margin-top:3px;font-weight:400;line-height:1.5}.V1MMBW_quizExplanation{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);padding:var(--dsl-g-gap-sm) 10px;border-top:1px solid var(--dsl-g-border);line-height:1.6}.V1MMBW_quizRetry{border:1px solid var(--dsl-g-border);width:fit-content;color:var(--dsw-alias-label-secondary);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;padding:6px 14px;font-family:inherit}.V1MMBW_quizRetry:hover{border-color:var(--dsl-g-accent);color:var(--dsl-g-accent)}.V1MMBW_tool{margin:4px 0}.V1MMBW_toolFallback{align-items:center;gap:var(--dsl-g-gap-md);padding:var(--dsl-g-gap-sm) 12px;border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));font-size:var(--dsl-g-font-title);display:flex}.V1MMBW_toolFallbackTitle{color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_toolFallbackMeta{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.V1MMBW_panel{border:1px solid color-mix(in srgb, var(--dsw-alias-state-business-primary,#4f8ef7) 35%, transparent);background:var(--dsw-alias-bg-layer-1,#ffffff0a);border-radius:14px;margin:10px 14px 2px;overflow:hidden}.V1MMBW_panelHeader{align-items:center;display:flex}.V1MMBW_panelToggle{align-items:center;gap:var(--dsl-g-gap-sm);width:100%;color:inherit;font:inherit;font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;border:0;padding:9px 14px;display:flex}.V1MMBW_panelToggle:hover{background:#ffffff0a}.V1MMBW_panelBadge{padding:0 var(--dsl-g-gap-sm);background:color-mix(in srgb, var(--dsw-alias-state-business-primary,#4f8ef7) var(--dsl-g-tint-strong), transparent);color:var(--dsw-alias-state-business-primary,#7ba8ff);letter-spacing:.04em;border-radius:6px;flex:none;font-size:11px;font-weight:600;line-height:1.6}.V1MMBW_panelTitle{color:var(--dsw-alias-label-primary,#e6e6e6);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.V1MMBW_panelChevron{color:var(--dsw-alias-label-secondary,#ffffff8c);font-size:var(--dsl-g-font-meta);margin-left:auto}.V1MMBW_panelBody{height:360px;padding:0 16px var(--dsl-g-gap-lg);overflow-y:auto}.V1MMBW_panelResizeHandle{cursor:ns-resize;touch-action:none;background:0 0;border-radius:3px;height:6px;transition:background .15s}.V1MMBW_panelResizeHandle:hover,.V1MMBW_panelResizeHandleActive{background:color-mix(in srgb, var(--dsw-alias-state-business-primary,#4f8ef7) 35%, transparent)}`,document.head.appendChild(e)}var C={accBody:`V1MMBW_accBody`,accChevron:`V1MMBW_accChevron`,accHead:`V1MMBW_accHead`,accItem:`V1MMBW_accItem`,accent:`V1MMBW_accent`,accordion:`V1MMBW_accordion`,avatar:`V1MMBW_avatar`,badge:`V1MMBW_badge`,banner:`V1MMBW_banner`,barCol:`V1MMBW_barCol`,barFill:`V1MMBW_barFill`,barLabel:`V1MMBW_barLabel`,barValue:`V1MMBW_barValue`,baseline:`V1MMBW_baseline`,bcCurrent:`V1MMBW_bcCurrent`,bcItem:`V1MMBW_bcItem`,bcSep:`V1MMBW_bcSep`,bcText:`V1MMBW_bcText`,block:`V1MMBW_block`,body:`V1MMBW_body`,breadcrumb:`V1MMBW_breadcrumb`,btnSent:`V1MMBW_btnSent`,button:`V1MMBW_button`,callout:`V1MMBW_callout`,calloutBody:`V1MMBW_calloutBody`,calloutError:`V1MMBW_calloutError`,calloutInfo:`V1MMBW_calloutInfo`,calloutSuccess:`V1MMBW_calloutSuccess`,calloutTitle:`V1MMBW_calloutTitle`,calloutWarning:`V1MMBW_calloutWarning`,caption:`V1MMBW_caption`,card:`V1MMBW_card`,cardTitle:`V1MMBW_cardTitle`,center:`V1MMBW_center`,chart:`V1MMBW_chart`,chartLabels:`V1MMBW_chartLabels`,chartPlot:`V1MMBW_chartPlot`,checkbox:`V1MMBW_checkbox`,col:`V1MMBW_col`,copyChip:`V1MMBW_copyChip`,copyChipDone:`V1MMBW_copyChipDone`,danger:`V1MMBW_danger`,divider:`V1MMBW_divider`,donut:`V1MMBW_donut`,donutLegend:`V1MMBW_donutLegend`,donutTotal:`V1MMBW_donutTotal`,donutTotalLabel:`V1MMBW_donutTotalLabel`,donutTrack:`V1MMBW_donutTrack`,down:`V1MMBW_down`,field:`V1MMBW_field`,fieldGroup:`V1MMBW_fieldGroup`,fieldLabel:`V1MMBW_fieldLabel`,fileTree:`V1MMBW_fileTree`,fill:`V1MMBW_fill`,ftDir:`V1MMBW_ftDir`,ftIcon:`V1MMBW_ftIcon`,ftIconDir:`V1MMBW_ftIconDir`,ftName:`V1MMBW_ftName`,ftNameBtn:`V1MMBW_ftNameBtn`,ftRow:`V1MMBW_ftRow`,full:`V1MMBW_full`,genuiReveal:`V1MMBW_genuiReveal`,ghost:`V1MMBW_ghost`,gradeAns:`V1MMBW_gradeAns`,gradeExp:`V1MMBW_gradeExp`,gradeItem:`V1MMBW_gradeItem`,gradeItemNo:`V1MMBW_gradeItemNo`,gradeItemOk:`V1MMBW_gradeItemOk`,gradeList:`V1MMBW_gradeList`,gradeQ:`V1MMBW_gradeQ`,gradeRight:`V1MMBW_gradeRight`,gradeScore:`V1MMBW_gradeScore`,gradeScoreLabel:`V1MMBW_gradeScoreLabel`,gradeScoreValue:`V1MMBW_gradeScoreValue`,gradeTag:`V1MMBW_gradeTag`,gradeWrap:`V1MMBW_gradeWrap`,grid:`V1MMBW_grid`,gridline:`V1MMBW_gridline`,groupValue:`V1MMBW_groupValue`,groupedBar:`V1MMBW_groupedBar`,groupedBars:`V1MMBW_groupedBars`,groupedFill:`V1MMBW_groupedFill`,h1:`V1MMBW_h1`,h2:`V1MMBW_h2`,h3:`V1MMBW_h3`,input:`V1MMBW_input`,jsonScalar:`V1MMBW_jsonScalar`,keyvalue:`V1MMBW_keyvalue`,kvKey:`V1MMBW_kvKey`,kvRow:`V1MMBW_kvRow`,kvValue:`V1MMBW_kvValue`,li:`V1MMBW_li`,liDesc:`V1MMBW_liDesc`,liTitle:`V1MMBW_liTitle`,lineChart:`V1MMBW_lineChart`,lineDot:`V1MMBW_lineDot`,lineGrid:`V1MMBW_lineGrid`,lineGridAxis:`V1MMBW_lineGridAxis`,lineLabels:`V1MMBW_lineLabels`,linePath:`V1MMBW_linePath`,lineTick:`V1MMBW_lineTick`,link:`V1MMBW_link`,linkText:`V1MMBW_linkText`,list:`V1MMBW_list`,mermaid:`V1MMBW_mermaid`,mermaidErr:`V1MMBW_mermaidErr`,mermaidFallback:`V1MMBW_mermaidFallback`,mermaidHint:`V1MMBW_mermaidHint`,muted:`V1MMBW_muted`,panel:`V1MMBW_panel`,panelBadge:`V1MMBW_panelBadge`,panelBody:`V1MMBW_panelBody`,panelChevron:`V1MMBW_panelChevron`,panelHeader:`V1MMBW_panelHeader`,panelResizeHandle:`V1MMBW_panelResizeHandle`,panelResizeHandleActive:`V1MMBW_panelResizeHandleActive`,panelTitle:`V1MMBW_panelTitle`,panelToggle:`V1MMBW_panelToggle`,playBtn:`V1MMBW_playBtn`,primary:`V1MMBW_primary`,progress:`V1MMBW_progress`,progressRow:`V1MMBW_progressRow`,quiz:`V1MMBW_quiz`,quizCorrectMsg:`V1MMBW_quizCorrectMsg`,quizExplanation:`V1MMBW_quizExplanation`,quizFeedback:`V1MMBW_quizFeedback`,quizMarker:`V1MMBW_quizMarker`,quizOpt:`V1MMBW_quizOpt`,quizOptCorrect:`V1MMBW_quizOptCorrect`,quizOptReveal:`V1MMBW_quizOptReveal`,quizOptWrong:`V1MMBW_quizOptWrong`,quizOptions:`V1MMBW_quizOptions`,quizQuestion:`V1MMBW_quizQuestion`,quizResult:`V1MMBW_quizResult`,quizRetry:`V1MMBW_quizRetry`,quizWrongMsg:`V1MMBW_quizWrongMsg`,radio:`V1MMBW_radio`,resetBtn:`V1MMBW_resetBtn`,reveal:`V1MMBW_reveal`,row:`V1MMBW_row`,scene3dCanvas:`V1MMBW_scene3dCanvas`,scene3dHint:`V1MMBW_scene3dHint`,scene3dTitle:`V1MMBW_scene3dTitle`,scene3dWrap:`V1MMBW_scene3dWrap`,select:`V1MMBW_select`,sliderInput:`V1MMBW_sliderInput`,sliderRow:`V1MMBW_sliderRow`,sliderValue:`V1MMBW_sliderValue`,small:`V1MMBW_small`,spacer:`V1MMBW_spacer`,stat:`V1MMBW_stat`,statDelta:`V1MMBW_statDelta`,statLabel:`V1MMBW_statLabel`,statValue:`V1MMBW_statValue`,step:`V1MMBW_step`,stepActive:`V1MMBW_stepActive`,stepContent:`V1MMBW_stepContent`,stepDesc:`V1MMBW_stepDesc`,stepDone:`V1MMBW_stepDone`,stepMarker:`V1MMBW_stepMarker`,stepTitle:`V1MMBW_stepTitle`,steps:`V1MMBW_steps`,submit:`V1MMBW_submit`,submitHint:`V1MMBW_submitHint`,submitRow:`V1MMBW_submitRow`,success:`V1MMBW_success`,switch:`V1MMBW_switch`,switchKnob:`V1MMBW_switchKnob`,switchLabel:`V1MMBW_switchLabel`,switchOn:`V1MMBW_switchOn`,switchRow:`V1MMBW_switchRow`,tab:`V1MMBW_tab`,tabActive:`V1MMBW_tabActive`,tabBar:`V1MMBW_tabBar`,table:`V1MMBW_table`,tableWrap:`V1MMBW_tableWrap`,tabs:`V1MMBW_tabs`,text:`V1MMBW_text`,textarea:`V1MMBW_textarea`,thSort:`V1MMBW_thSort`,thSortMark:`V1MMBW_thSortMark`,timeline:`V1MMBW_timeline`,tlBody:`V1MMBW_tlBody`,tlDesc:`V1MMBW_tlDesc`,tlDot:`V1MMBW_tlDot`,tlHead:`V1MMBW_tlHead`,tlItem:`V1MMBW_tlItem`,tlLine:`V1MMBW_tlLine`,tlRail:`V1MMBW_tlRail`,tlTime:`V1MMBW_tlTime`,tlTitle:`V1MMBW_tlTitle`,tool:`V1MMBW_tool`,toolFallback:`V1MMBW_toolFallback`,toolFallbackMeta:`V1MMBW_toolFallbackMeta`,toolFallbackTitle:`V1MMBW_toolFallbackTitle`,track:`V1MMBW_track`,up:`V1MMBW_up`,warn:`V1MMBW_warn`,wrap:`V1MMBW_wrap`};let w=`dsh.genui.interaction`;function T(){return{order:[],blocks:{}}}function E(){try{let e=localStorage.getItem(w);if(e===null)return T();let t=JSON.parse(e);return!Array.isArray(t.order)||typeof t.blocks!=`object`||t.blocks===null?T():{order:t.order.filter(e=>typeof e==`string`),blocks:t.blocks}}catch{return T()}}function ee(e){try{localStorage.setItem(w,JSON.stringify(e))}catch{}}function te(e){return e===``?null:E().blocks[e]??null}function ne(e,t){if(e===``)return;let n=E(),r=n.order.filter(t=>t!==e);r.unshift(e);let i={...n.blocks,[e]:t};for(;r.length>200;){let e=r.pop();e!==void 0&&delete i[e]}ee({order:r,blocks:i})}function re(e){let t=5381;for(let n=0;n>>0;return t.toString(36)}function ie(e,t,n){return`f:${e}:${String(t)}:${re(n)}`}function ae(e,t){return`p:${e}:${re(t)}`}function oe(e,t){return`t:${e}:${t}`}let D={maxDepth:8,maxNodes:200,maxString:2e3,maxCode:12e3,maxMermaid:8e3,maxGridCols:12,maxTabs:12,maxAccordionItems:24,maxListItems:50,maxOptions:50,maxTableRows:50,maxTableCols:12,maxChartPoints:60,maxPlotSeries:8,maxPlotParams:6,maxMeshes:5,maxQuizOptions:8,maxSteps:24,maxTimelineItems:24,maxBreadcrumbItems:12,maxKeyValuePairs:24,maxTreeDepth:6};function se(e,t){return typeof e==`string`&&t.includes(e)}function O(e,t){return typeof e==`string`?e.slice(0,t):void 0}let ce=/^(?:#[\da-fA-F]{3,8}|rgba?\([^)]{0,64}\)|hsla?\([^)]{0,64}\)|var\(--dsw-[\w-]+(?:,\s*#[0-9a-fA-F]{3,8})?\))$/;function k(e){if(typeof e!=`string`)return;let t=e.trim();return t.length<=64&&ce.test(t)?t:void 0}function le(e){if(typeof e!=`string`)return;let t=e.trim();if(!(t.length>2048))return/^https?:\/\//i.test(t)||/^mailto:[^@\s]+@[^@\s]+$/i.test(t)?t:void 0}function A(e,t,n){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):void 0}function j(e,t,n){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,Math.trunc(e))):void 0}function M(e,t){return se(e,t)?e:void 0}function N(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function P(e,t){return t===void 0?{}:{[e]:t}}let ue=[`h1`,`h2`,`h3`,`body`,`muted`,`caption`],de=[`primary`,`danger`,`success`,`ghost`],fe=[`success`,`warn`,`danger`,`accent`],pe=[`text`,`email`,`password`],me=[`info`,`success`,`warning`,`error`],he=[`bars`,`line`,`donut`],ge=[`line`,`area`,`scatter`],_e=[`box`,`sphere`,`cone`,`cylinder`,`torus`],ve=[`file`,`dir`];function F(e,t,n){if(!Array.isArray(e))return[];let r=[];for(let i of e){if(t.remaining<=0)break;--t.remaining;let e=ye(i,t,n);e!==null&&r.push(e)}return r}function ye(e,t,n){if(n>D.maxDepth)return null;let r=N(e);if(r===void 0)return null;let i=r.type;if(typeof i!=`string`)return null;switch(i){case`text`:{let e=O(r.content,D.maxString);return e===void 0?null:{type:`text`,content:e,...P(`size`,M(r.size,ue)),...P(`center`,r.center===!0||void 0)}}case`row`:return{type:`row`,items:F(r.items,t,n+1),...P(`wrap`,r.wrap===!0||void 0),...P(`spacer`,r.spacer===!0||void 0)};case`col`:return{type:`col`,items:F(r.items,t,n+1),...P(`gap`,A(r.gap,0,96))};case`grid`:return{type:`grid`,cols:j(r.cols,1,D.maxGridCols)??1,items:F(r.items,t,n+1)};case`card`:return{type:`card`,items:F(r.items,t,n+1),...P(`title`,O(r.title,D.maxString))};case`button`:{let e=O(r.label,D.maxString);return e===void 0?null:{type:`button`,label:e,...P(`tone`,M(r.tone,de)),...P(`full`,r.full===!0||void 0),...P(`small`,r.small===!0||void 0),...P(`icon`,O(r.icon,64)),...P(`action`,O(r.action,200))}}case`input`:return{type:`input`,...P(`label`,O(r.label,D.maxString)),...P(`placeholder`,O(r.placeholder,D.maxString)),...P(`value`,O(r.value,D.maxString)),...P(`inputType`,M(r.inputType,pe)),...P(`action`,O(r.action,200)),...P(`id`,O(r.id,200))};case`select`:{let e=I(r.options,D.maxOptions,D.maxString);return e===void 0?null:{type:`select`,options:e,...P(`label`,O(r.label,D.maxString)),...P(`action`,O(r.action,200)),...P(`selected`,j(r.selected,0,e.length-1)),...P(`id`,O(r.id,200))}}case`checkbox`:{let e=O(r.label,D.maxString);return e===void 0?null:{type:`checkbox`,label:e,...P(`checked`,r.checked===!0||void 0),...P(`action`,O(r.action,200))}}case`link`:{let e=O(r.label,D.maxString);return e===void 0?null:{type:`link`,label:e,...P(`href`,le(r.href))}}case`badge`:{let e=O(r.label,D.maxString);return e===void 0?null:{type:`badge`,label:e,...P(`tone`,M(r.tone,fe)),...P(`icon`,O(r.icon,64))}}case`stat`:{let e=O(r.label,D.maxString),t=O(r.value,128);return e===void 0||t===void 0?null:{type:`stat`,label:e,value:t,...P(`delta`,O(r.delta,64))}}case`progress`:{let e=A(r.value,0,100);return e===void 0?null:{type:`progress`,value:e,...P(`label`,O(r.label,D.maxString)),...P(`valueLabel`,O(r.valueLabel,64))}}case`divider`:return{type:`divider`};case`spacer`:return{type:`spacer`};case`avatar`:{let e=O(r.name,64);return e===void 0?null:{type:`avatar`,name:e,...P(`color`,k(r.color))}}case`list`:{let e=be(r.items,D.maxListItems);return e===void 0?null:{type:`list`,items:e}}case`table`:{let e=I(r.columns,D.maxTableCols,128),t=xe(r.rows,D.maxTableRows,D.maxTableCols);return e===void 0||t===void 0?null:{type:`table`,columns:e,rows:t}}case`chart`:{let e=Se(r.data,D.maxChartPoints),t=Array.isArray(r.series)?Ce(r.series,D.maxPlotSeries,D.maxChartPoints):void 0;return e===void 0&&t===void 0?null:{type:`chart`,data:e??[],...P(`kind`,M(r.kind,he)),...P(`series`,t)}}case`tabs`:{let e=we(r.tabs,t,n);return e===void 0?null:{type:`tabs`,tabs:e}}case`plot`:{let e=Te(r.series,D.maxPlotSeries);return e===void 0?null:{type:`plot`,series:e,...P(`xMin`,A(r.xMin,-1e6,1e6)),...P(`xMax`,A(r.xMax,-1e6,1e6)),...P(`yMin`,A(r.yMin,-1e9,1e9)),...P(`yMax`,A(r.yMax,-1e9,1e9)),...P(`title`,O(r.title,D.maxString))}}case`callout`:{let e=O(r.content,D.maxString);return e===void 0?null:{type:`callout`,content:e,...P(`tone`,M(r.tone,me)),...P(`title`,O(r.title,D.maxString))}}case`steps`:{let e=Ee(r.steps);return e===void 0?null:{type:`steps`,steps:e,...P(`current`,j(r.current,0,e.length))}}case`keyvalue`:{let e=De(r.pairs,D.maxKeyValuePairs);return e===void 0?null:{type:`keyvalue`,pairs:e}}case`diff`:{let e=Oe(r.diffs);return e===void 0?null:{type:`diff`,diffs:e}}case`json`:return`value`in r?{type:`json`,value:r.value}:null;case`code`:{let e=O(r.code,D.maxCode);return e===void 0?null:{type:`code`,code:e,...P(`lang`,O(r.lang,64))}}case`radio`:{let e=I(r.options,D.maxOptions,D.maxString);return e===void 0?null:{type:`radio`,options:e,...P(`label`,O(r.label,D.maxString)),...P(`selected`,j(r.selected,0,e.length-1)),...P(`action`,O(r.action,200)),...P(`group`,O(r.group,200)),...P(`answer`,typeof r.answer==`number`&&Number.isFinite(r.answer)&&r.answer>=0&&r.answer=t)break;typeof i==`string`&&r.push(i.slice(0,n))}return r}function be(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;if(typeof r==`string`){n.push(r.slice(0,D.maxString));continue}let e=N(r),i=e===void 0?void 0:O(e.title,D.maxString);i!==void 0&&n.push({title:i,...P(`desc`,e===void 0?void 0:O(e.desc,D.maxString))})}return n}function xe(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=t)break;if(!Array.isArray(i))continue;let e=[];for(let t of i){if(e.length>=n)break;typeof t==`string`?e.push(t.slice(0,256)):typeof t==`number`&&Number.isFinite(t)&&e.push(t)}e.length>0&&r.push(e)}return r}function Se(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=N(r),i=e===void 0?void 0:O(e.label,128),a=e===void 0?void 0:A(e.value,-0xe8d4a51000,0xe8d4a51000);i!==void 0&&a!==void 0&&n.push({label:i,value:a,...P(`color`,e===void 0?void 0:k(e.color))})}return n}function Ce(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=t)break;let e=N(i),a=e===void 0?void 0:O(e.label,128),o=e===void 0?void 0:Se(e.data,n);a!==void 0&&o!==void 0&&r.push({label:a,data:o,...P(`color`,e===void 0?void 0:k(e.color))})}return r}function we(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=D.maxTabs)break;let e=N(i),a=e===void 0?void 0:O(e.label,128);a!==void 0&&e!==void 0&&r.push({label:a,items:F(e.items,t,n+1)})}return r}function Te(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=N(r),i=e===void 0?void 0:O(e.expr,512);if(i===void 0||e===void 0)continue;let a=[];if(Array.isArray(e.params))for(let t of e.params){if(a.length>=D.maxPlotParams)break;let e=N(t),n=e===void 0?void 0:O(e.name,64),r=e===void 0?void 0:A(e.value,-1e9,1e9);n!==void 0&&r!==void 0&&a.push({name:n,value:r,...P(`min`,e===void 0?void 0:A(e.min,-1e9,1e9)),...P(`max`,e===void 0?void 0:A(e.max,-1e9,1e9)),...P(`step`,e===void 0?void 0:A(e.step,1e-9,1e9)),...P(`animateTo`,e===void 0?void 0:A(e.animateTo,-1e9,1e9)),...P(`durationMs`,e===void 0?void 0:A(e.durationMs,1,12e4)),...P(`loop`,e===void 0?void 0:e.loop===!0||void 0)})}n.push({expr:i,...P(`label`,O(e.label,128)),...P(`color`,k(e.color)),...P(`kind`,M(e.kind,ge)),...P(`params`,a.length>0?a:void 0)})}return n}function Ee(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=D.maxSteps)break;let e=N(n),r=e===void 0?void 0:O(e.title,256);r!==void 0&&t.push({title:r,...P(`desc`,e===void 0?void 0:O(e.desc,D.maxString))})}return t}function De(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=N(r),i=e===void 0?void 0:O(e.key,256),a=e===void 0?void 0:O(e.value,D.maxString);i!==void 0&&a!==void 0&&n.push({key:i,value:a})}return n}function Oe(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=24)break;let e=N(n),r=e===void 0?void 0:O(e.path,1024),i=e===void 0?void 0:O(e.newText,2e4);if(r===void 0||i===void 0)continue;let a=e===void 0?void 0:e.oldText;t.push({path:r,newText:i,oldText:a===null||typeof a!=`string`?null:a.slice(0,2e4)})}return t}function ke(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=D.maxAccordionItems)break;let e=N(i),a=e===void 0?void 0:O(e.title,256);a!==void 0&&e!==void 0&&r.push({title:a,items:F(e.items,t,n+1)})}return r}function Ae(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=D.maxMeshes)break;let e=N(n),r=e===void 0?void 0:M(e.shape,_e);if(r===void 0)continue;let i=e===void 0?void 0:A(e.scale,-1e6,1e6)??L(e.scale),a=e===void 0?void 0:A(e.size,-1e6,1e6)??L(e.size);t.push({shape:r,...P(`color`,e===void 0?void 0:k(e.color)),...P(`position`,e===void 0?void 0:L(e.position)),...P(`rotation`,e===void 0?void 0:L(e.rotation)),...P(`scale`,i),...P(`size`,a)})}return t}function L(e){if(!Array.isArray(e)||e.length!==3)return;let[t,n,r]=e;if(!(typeof t!=`number`||!Number.isFinite(t)||typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)))return[Math.min(1e6,Math.max(-1e6,t)),Math.min(1e6,Math.max(-1e6,n)),Math.min(1e6,Math.max(-1e6,r))]}function je(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=N(r),i=e===void 0?void 0:O(e.title,256);i!==void 0&&n.push({title:i,...P(`desc`,e===void 0?void 0:O(e.desc,D.maxString)),...P(`time`,e===void 0?void 0:O(e.time,128))})}return n}function Me(e,t){return Ne(e,t,D.maxTreeDepth)}function Ne(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=t)break;let e=N(i),a=e===void 0?void 0:O(e.name,256);if(a===void 0)continue;let o=e!==void 0&&n>0&&Array.isArray(e.children)?Ne(e.children,t,n-1):void 0;r.push({name:a,...P(`type`,e===void 0?void 0:M(e.type,ve)),...P(`children`,o)})}return r}function Pe(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=D.maxQuizOptions)break;let e=N(n),r=e===void 0?void 0:O(e.label,512);r!==void 0&&t.push({label:r,...P(`correct`,e===void 0?void 0:e.correct===!0||void 0),...P(`feedback`,e===void 0?void 0:O(e.feedback,D.maxString))})}return t}function R(e){let t=N(e);if(t===void 0||!Array.isArray(t.items))return null;let n={remaining:D.maxNodes};return{...P(`title`,O(t.title,D.maxString)),...P(`gap`,A(t.gap,0,96)),...P(`panel`,t.panel===!0||void 0),...P(`append`,t.append===!0||void 0),items:F(t.items,n,0)}}function z(e,t=1/0){let n=0,r=e=>{if(Array.isArray(e))for(let i of e){if(n>=t)return;n+=1;let e=N(i);if(e!==void 0){if(e.type===`tabs`&&Array.isArray(e.tabs))for(let i of e.tabs){if(n>=t)return;let e=N(i);e!==void 0&&r(e.items)}else if(e.type===`accordion`&&Array.isArray(e.items))for(let i of e.items){if(n>=t)return;let e=N(i);e!==void 0&&r(e.items)}else e.type===`file-tree`&&Array.isArray(e.items)&&r(e.items)}}},i=N(e);return r(i===void 0?[]:i.items),n}let Fe=[`var(--dsw-static-deepseek-400)`,`var(--dsw-static-deepseek-450)`,`var(--dsw-static-blue-450)`,`var(--dsw-static-green-400)`,`var(--dsw-static-amber-400)`,`var(--dsw-static-red-400)`,`var(--dsw-static-deepseek-300)`,`var(--dsw-static-neutral-bluish-400)`];function Ie(e){let t=0;for(let n=0;n>>0;return Fe[t%Fe.length]}function Le({className:e,disabled:t,onClick:n,children:r}){let[i,a]=(0,h.useState)(!1),o=(0,h.useRef)(null);return(0,h.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]),(0,g.jsxs)(`button`,{type:`button`,className:e,disabled:t,onClick:n===void 0?void 0:()=>{n(),o.current!==null&&clearTimeout(o.current),a(!0),o.current=setTimeout(()=>a(!1),1400)},children:[r,i&&(0,g.jsx)(`span`,{className:C.btnSent,children:`✓ 已触发`})]})}let Re=[`var(--dsw-static-deepseek-400)`,`var(--dsw-static-green-400)`,`var(--dsw-static-amber-400)`,`var(--dsw-static-red-400)`,`var(--dsw-static-blue-450)`,`var(--dsw-static-deepseek-450)`,`var(--dsw-static-neutral-bluish-400)`,`var(--dsw-static-deepseek-300)`],B=(e,t,n)=>n??(t>1?Re[e%Re.length]:void 0);function ze({node:e}){let t=e.columns.slice(0,D.maxTableCols),n=e.rows.slice(0,D.maxTableRows),[r,i]=(0,h.useState)(null),a=r===null?n:[...n].sort((e,t)=>{let n=e[r.col],i=t[r.col],a=typeof n==`number`?n:n===``?NaN:Number(n),o=typeof i==`number`?i:i===``?NaN:Number(i);if(Number.isFinite(a)&&Number.isFinite(o)&&a!==o)return(a-o)*r.dir;let s=String(n??``),c=String(i??``);return(sc))*r.dir}),o=e=>{i(t=>t!==null&&t.col===e?t.dir===1?{col:e,dir:-1}:null:{col:e,dir:1})};return(0,g.jsx)(`div`,{className:C.tableWrap,children:(0,g.jsxs)(`table`,{className:C.table,children:[(0,g.jsx)(`thead`,{children:(0,g.jsx)(`tr`,{children:t.map((e,t)=>(0,g.jsx)(`th`,{"aria-sort":r!==null&&r.col===t?r.dir===1?`ascending`:`descending`:`none`,children:(0,g.jsxs)(`button`,{type:`button`,className:C.thSort,onClick:()=>o(t),children:[e,r!==null&&r.col===t&&(0,g.jsx)(`span`,{className:C.thSortMark,"aria-hidden":!0,children:r.dir===1?` ▲`:` ▼`})]})},t))})}),(0,g.jsx)(`tbody`,{children:a.map((e,n)=>(0,g.jsx)(`tr`,{children:e.slice(0,t.length).map((e,t)=>(0,g.jsx)(`td`,{children:String(e)},t))},n))})]})})}function Be({chart:e}){let t=e.kind??`bars`;return t===`donut`?(0,g.jsx)(Ue,{chart:e}):t===`line`?(0,g.jsx)(He,{chart:e}):(0,g.jsx)(Ve,{chart:e})}function Ve({chart:e}){let t=e.series===void 0?void 0:e.series.slice(0,D.maxPlotSeries);if(t!==void 0&&t.length>0){let e=t[0].data.map(e=>e.label),n=Math.max(...t.flatMap(e=>e.data.map(e=>Number(e.value)||0)),1);return(0,g.jsxs)(`div`,{className:C.chart,children:[(0,g.jsxs)(`div`,{className:C.chartPlot,children:[[0,25,50,75].map(e=>(0,g.jsx)(`span`,{className:e===0?C.baseline:C.gridline,style:{bottom:`${e}%`}},e)),e.map((e,r)=>(0,g.jsx)(`div`,{className:C.barCol,children:(0,g.jsx)(`div`,{className:C.groupedBars,children:t.map((e,i)=>{let a=e.data[r],o=a===void 0?0:Number(a.value)||0,s=a===void 0?0:Math.min(Math.round(Math.max(0,o)/n*100),82);return(0,g.jsxs)(`div`,{className:C.groupedBar,title:a===void 0?e.label:`${e.label}: ${String(a.value)}`,children:[(0,g.jsx)(`span`,{className:C.groupValue,children:a===void 0?``:String(a.value)}),(0,g.jsx)(`div`,{className:C.groupedFill,style:{height:`${s}%`,background:B(i,t.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`}})]},i)})})},r))]}),(0,g.jsx)(`div`,{className:C.chartLabels,children:e.map(e=>(0,g.jsx)(`span`,{className:C.barLabel,children:e},e))})]})}let n=e.data.slice(0,D.maxChartPoints),r=Math.max(...n.map(e=>Number(e.value)||0),1);return(0,g.jsxs)(`div`,{className:C.chart,children:[(0,g.jsxs)(`div`,{className:C.chartPlot,children:[[0,25,50,75].map(e=>(0,g.jsx)(`span`,{className:e===0?C.baseline:C.gridline,style:{bottom:`${e}%`}},e)),n.map((e,t)=>{let n=Number(e.value)||0,i=Math.min(Math.round(Math.max(0,n)/r*100),85);return(0,g.jsxs)(`div`,{className:C.barCol,title:`${e.label}: ${String(e.value)}`,children:[(0,g.jsx)(`span`,{className:C.barValue,children:String(e.value)}),(0,g.jsx)(`div`,{className:C.barFill,style:{height:`${i}%`,...e.color===void 0?{}:{background:e.color}}})]},t)})]}),(0,g.jsx)(`div`,{className:C.chartLabels,children:n.map(e=>(0,g.jsx)(`span`,{className:C.barLabel,children:e.label},e.label))})]})}function He({chart:e}){let t=e.data.slice(0,D.maxChartPoints),n=Math.max(...t.map(e=>Number(e.value)||0),1),r=Math.min(...t.map(e=>Number(e.value)||0),0),i=n-r||1,a=Math.max(t.length-1,1),o=(e,t)=>[36+e/a*416,10+(1-(t-r)/i)*134],s=t.map((e,t)=>o(t,Number(e.value)||0)).map((e,t)=>`${t===0?`M`:`L`} ${e[0].toFixed(1)} ${e[1].toFixed(1)}`).join(` `),c=[0,1,2,3].map(e=>r+i*e/3),l=e=>{let t=Math.abs(e);return t>=1e3?`${(e/1e3).toFixed(t%1e3==0?0:1)}k`:Number.isInteger(e)?String(e):e.toFixed(1)};return(0,g.jsxs)(`div`,{className:C.lineChart,children:[(0,g.jsxs)(`svg`,{width:`100%`,viewBox:`0 0 460 150`,children:[c.map((e,t)=>{let n=10+(1-(e-r)/i)*134;return(0,g.jsxs)(`g`,{children:[(0,g.jsx)(`line`,{x1:36,x2:452,y1:n,y2:n,className:t===0?C.lineGridAxis:C.lineGrid}),(0,g.jsx)(`text`,{x:30,y:n+3,textAnchor:`end`,className:C.lineTick,children:l(e)})]},t)}),t.map((e,t)=>{let[n,r]=o(t,Number(e.value)||0);return(0,g.jsx)(`circle`,{cx:n,cy:r,r:3,className:C.lineDot,fill:e.color??void 0,children:(0,g.jsx)(`title`,{children:`${e.label}: ${String(e.value)}`})},t)}),(0,g.jsx)(`path`,{d:s,className:C.linePath})]}),(0,g.jsx)(`div`,{className:C.lineLabels,children:t.map((e,t)=>(0,g.jsx)(`span`,{className:C.barLabel,children:e.label},t))})]})}function Ue({chart:e}){let t=e.data.slice(0,D.maxChartPoints),n=t.map(e=>({...e,v:Math.max(0,Number(e.value)||0)})),r=n.reduce((e,t)=>e+t.v,0)||1,i=2*Math.PI*42,a=0;return(0,g.jsxs)(`div`,{className:C.donut,children:[(0,g.jsxs)(`svg`,{width:`120`,height:`120`,viewBox:`0 0 120 120`,children:[(0,g.jsx)(`circle`,{cx:`60`,cy:`60`,r:42,fill:`none`,strokeWidth:`14`,className:C.donutTrack}),n.map((e,n)=>{let o=e.v/r*i,s=(0,g.jsx)(`circle`,{cx:`60`,cy:`60`,r:42,fill:`none`,strokeWidth:`14`,style:{stroke:B(n,t.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`},strokeDasharray:`${o} ${i-o}`,strokeDashoffset:-a,transform:`rotate(-90 60 60)`,children:(0,g.jsx)(`title`,{children:`${e.label}: ${String(e.value)}`})},n);return a+=o,s}),(0,g.jsx)(`text`,{x:`60`,y:`58`,textAnchor:`middle`,className:C.donutTotal,children:r>=1e3?`${Math.round(r/100)/10}k`:String(r)}),(0,g.jsx)(`text`,{x:`60`,y:`74`,textAnchor:`middle`,className:C.donutTotalLabel,children:`合计`})]}),(0,g.jsx)(`div`,{className:C.donutLegend,children:t.map((e,n)=>(0,g.jsxs)(`span`,{className:C.legendItem,children:[(0,g.jsx)(`span`,{className:C.legendSwatch,style:{background:B(n,t.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`}}),e.label,` · `,String(e.value)]},n))})]})}function We({node:e,onAction:t,answers:n}){let r=e.action,i=e.group,a=i!==void 0,o=e.options.slice(0,D.maxOptions),s=i!==void 0&&n?.answers[i]!==void 0?o.indexOf(n.answers[i]):-1,[c,l]=(0,h.useState)(s>=0?s:e.selected??null),u=(0,h.useId)(),d=a&&n?.locked===!0;return(0,h.useEffect)(()=>{i!==void 0&&(n?.registerMeta(i,{label:e.label??i,options:o,answer:e.answer,explanation:e.explanation}),e.selected!==void 0&&o[e.selected]!==void 0&&n?.answers[i]===void 0&&n?.setAnswer(i,o[e.selected]))},[i,e.label,e.answer,e.explanation,e.options,e.selected]),(0,g.jsxs)(`div`,{className:C.fieldGroup,role:`radiogroup`,"aria-label":e.label,children:[e.label!==void 0&&(0,g.jsx)(`span`,{className:C.fieldLabel,children:e.label}),o.map((e,o)=>(0,g.jsxs)(`label`,{className:C.radio,children:[(0,g.jsx)(`input`,{type:`radio`,name:`genui-radio-${u}`,checked:c===o,disabled:d,onChange:()=>{l(o),a?n?.setAnswer(i,e):r!==void 0&&t!==void 0&&t(r,{type:`radio`,value:e})}}),(0,g.jsx)(`span`,{children:e})]},o))]})}function Ge(e){if(e.answer!==void 0)return typeof e.answer==`number`?e.options[e.answer]:e.answer}function Ke({node:e,onAction:t,answers:n}){let r=n?.answers??{},i=n?.fields??{},a=n?.meta??{},o=e.groups,s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.trim()!==``&&!n?.secretFields.has(e))),c=o===void 0?Math.max(Object.keys(r).length,Object.keys(s).length):o.filter(e=>r[e]!==void 0).length,l=o?.length??c,u=o??Object.keys(r),d=u.some(e=>a[e]?.answer!==void 0),f=n?.locked===!0,p=c>0&&c>=l&&(d||e.action!==void 0&&t!==void 0);if(f){let i=u.filter(e=>r[e]!==void 0&&a[e]?.answer!==void 0),s=i.filter(e=>r[e]===Ge(a[e])).length;return(0,g.jsxs)(`div`,{className:C.gradeWrap,"data-genui-grade":!0,children:[(0,g.jsxs)(`div`,{className:C.gradeScore,children:[(0,g.jsxs)(`span`,{className:C.gradeScoreValue,children:[s,` / `,i.length]}),(0,g.jsxs)(`span`,{className:C.gradeScoreLabel,children:[`得分`,i.length{let t=r[e],n=a[e];if(t===void 0||n===void 0)return null;let i=Ge(n);if(i===void 0)return(0,g.jsxs)(`div`,{className:C.gradeItem,children:[(0,g.jsx)(`span`,{className:C.gradeQ,children:n.label}),(0,g.jsxs)(`span`,{className:C.gradeAns,children:[`你的答案:`,t]})]},e);let o=t===i;return(0,g.jsxs)(`div`,{className:`${C.gradeItem} ${o?C.gradeItemOk:C.gradeItemNo}`,children:[(0,g.jsx)(`span`,{className:C.gradeQ,children:n.label}),(0,g.jsx)(`span`,{className:C.gradeTag,children:o?`✓`:`✗`}),(0,g.jsxs)(`span`,{className:C.gradeAns,children:[`你的答案:`,t,!o&&(0,g.jsxs)(`span`,{className:C.gradeRight,children:[` 正确答案:`,i]})]}),n.explanation!==void 0&&(0,g.jsx)(`span`,{className:C.gradeExp,children:n.explanation})]},e)})}),(0,g.jsx)(`button`,{type:`button`,className:`${C.button} ${C.ghost} ${C.submit}`,onClick:()=>{n?.clear(),e.resetAction!==void 0&&t!==void 0&&t(e.resetAction,{type:`submit-reset`,groups:o??Object.keys(r)})},children:`重新作答`})]})}return(0,g.jsxs)(`div`,{className:C.submitRow,children:[(0,g.jsx)(`button`,{type:`button`,className:`${C.button} ${C.primary} ${C.submit}`,disabled:!p,onClick:p?()=>{d?n?.setLocked(!0):e.action!==void 0&&t!==void 0&&t(e.action,{type:`submit`,answers:r,...Object.keys(s).length>0?{fields:s}:{},total:l,answered:c})}:void 0,children:e.label}),l>0&&(0,g.jsxs)(`span`,{className:C.submitHint,"aria-live":`polite`,children:[`已选 `,c,`/`,l]})]})}function qe({node:e,onAction:t}){let[n,r]=(0,h.useState)(e.checked===!0),i=e.action;return(0,g.jsxs)(`label`,{className:C.switchRow,children:[(0,g.jsx)(`span`,{className:C.switchLabel,children:e.label}),(0,g.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,className:`${C.switch} ${n?C.switchOn:``}`,onClick:()=>{let e=!n;r(e),i!==void 0&&t!==void 0&&t(i,{type:`switch`,checked:e})},children:(0,g.jsx)(`span`,{className:C.switchKnob})})]})}function Je({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,a=i!==void 0&&n?.fields[i]!==void 0?Number(n.fields[i]):NaN,o=Number.isFinite(a)?a:e.value??e.min??0,[s,c]=(0,h.useState)(o),l=(0,h.useRef)(!1);(0,h.useEffect)(()=>{l.current||(l.current=!0,i!==void 0&&n?.setField(i,String(o)))},[]);let u=e=>{r!==void 0&&t!==void 0&&t(r,{type:`slider`,value:e,...i===void 0?{}:{id:i}})};return(0,g.jsxs)(`label`,{className:C.sliderRow,children:[e.label!==void 0&&(0,g.jsx)(`span`,{className:C.fieldLabel,children:e.label}),(0,g.jsx)(`input`,{type:`range`,className:C.sliderInput,min:e.min,max:e.max,step:e.step??1,value:s,"aria-label":e.label,onChange:e=>{let t=Number(e.currentTarget.value);c(t),i!==void 0&&n?.setField(i,String(t)),u(t)}}),(0,g.jsx)(`span`,{className:C.sliderValue,children:Math.round(s*100)/100})]})}function Ye(){let e=(0,h.useRef)(!1),t=(0,h.useRef)(null);return(0,h.useEffect)(()=>()=>{t.current!==null&&clearTimeout(t.current)},[]),{isComposing:()=>e.current,onCompositionStart:()=>{e.current=!0,t.current!==null&&(clearTimeout(t.current),t.current=null)},onCompositionEnd:()=>{t.current!==null&&clearTimeout(t.current),t.current=setTimeout(()=>{e.current=!1},10)}}}function Xe(e){let t=e.nativeEvent;return t.isComposing===!0||t.keyCode===229}function Ze({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,a=e.options.slice(0,D.maxOptions),o=i!==void 0&&n?.fields[i]!==void 0?a.indexOf(n.fields[i]):-1,s=o>=0?a[o]:e.selected!==void 0&&a[e.selected]!==void 0?a[e.selected]:null,[c,l]=(0,h.useState)(s),u=(0,h.useRef)(!1);(0,h.useEffect)(()=>{u.current||(u.current=!0,i!==void 0&&s!==null&&n?.setField(i,s))},[]);let d=e=>{r!==void 0&&t!==void 0&&t(r,{type:`select`,value:e,...i===void 0?{}:{id:i}})};return(0,g.jsxs)(`label`,{className:C.field,children:[e.label!==void 0&&(0,g.jsx)(`span`,{children:e.label}),(0,g.jsxs)(`select`,{className:C.select,value:c??``,onChange:e=>{let t=e.currentTarget.value;l(t),i!==void 0&&n?.setField(i,t),d(t)},children:[c===null&&(0,g.jsx)(`option`,{value:``,hidden:!0,disabled:!0,children:`请选择…`}),a.map((e,t)=>(0,g.jsx)(`option`,{value:e,children:e},t))]})]})}function Qe({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,a=e.inputType===`password`,[o,s]=(0,h.useState)(()=>a?``:e.value??(i===void 0?``:n?.fields[i]??``)),c=(0,h.useRef)(o),l=e=>{r!==void 0&&t!==void 0&&(c.current=o,t(r,{type:`input`,value:o,...i===void 0?{}:{id:i},...e?{submit:!0}:{}}))},u=Ye(),d=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{d.current||(d.current=!0,!a&&i!==void 0&&e.value!==void 0&&e.value.trim()!==``&&n?.setField(i,e.value))},[]),(0,h.useEffect)(()=>{a&&i!==void 0&&n?.registerSecretField(i)},[a,i]),(0,g.jsxs)(`label`,{className:C.field,children:[e.label!==void 0&&(0,g.jsx)(`span`,{children:e.label}),(0,g.jsx)(`input`,{className:C.input,type:e.inputType??`text`,placeholder:e.placeholder,value:o,onChange:e=>{let t=e.currentTarget.value;s(t),i!==void 0&&n?.setField(i,t)},onBlur:()=>{o!==c.current&&l(!1)},onCompositionStart:u.onCompositionStart,onCompositionEnd:u.onCompositionEnd,onKeyDown:e=>{e.key===`Enter`&&(u.isComposing()||Xe(e)||(e.preventDefault(),l(!0)))}})]})}function $e({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,[a,o]=(0,h.useState)(()=>e.value??(i===void 0?``:n?.fields[i]??``)),s=(0,h.useRef)(a),c=e=>{r!==void 0&&t!==void 0&&(s.current=a,t(r,{type:`textarea`,value:a,...i===void 0?{}:{id:i},...e?{submit:!0}:{}}))},l=Ye(),u=(0,h.useRef)(!1);return(0,h.useEffect)(()=>{u.current||(u.current=!0,i!==void 0&&e.value!==void 0&&e.value.trim()!==``&&n?.setField(i,e.value))},[]),(0,g.jsxs)(`label`,{className:C.field,children:[e.label!==void 0&&(0,g.jsx)(`span`,{children:e.label}),(0,g.jsx)(`textarea`,{className:C.textarea,placeholder:e.placeholder,rows:e.rows??4,value:a,onChange:e=>{let t=e.currentTarget.value;o(t),i!==void 0&&n?.setField(i,t)},onBlur:()=>{a!==s.current&&c(!1)},onCompositionStart:l.onCompositionStart,onCompositionEnd:l.onCompositionEnd,onKeyDown:e=>{!(e.metaKey||e.ctrlKey)||e.key!==`Enter`||l.isComposing()||Xe(e)||(e.preventDefault(),c(!0))}})]})}let et={pi:Math.PI,e:Math.E,tau:Math.PI*2},tt={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sqrt:Math.sqrt,cbrt:Math.cbrt,exp:Math.exp,log:Math.log10,ln:Math.log,abs:Math.abs,floor:Math.floor,ceil:Math.ceil,round:Math.round,min:Math.min,max:Math.max,pow:(e,t)=>e**+t};var V=class extends Error{pos;constructor(e,t){super(`SafeMath parse error at ${t}: ${e}`),this.pos=t}},nt=class{src;vars;i=0;constructor(e,t){this.src=e,this.vars=t}parse(){let e=this.parseExpr();if(this.skipWs(),this.ie:e}parseExpr(){let e=this.parseTerm();for(;;){this.skipWs();let t=this.peek();if(t===`+`||t===`-`){this.i++;let n=this.parseTerm(),r=t,i=e;e=r===`+`?e=>this.asNum(i,e)+this.asNum(n,e):e=>this.asNum(i,e)-this.asNum(n,e)}else return e}}parseTerm(){let e=this.parseUnary();for(;;){this.skipWs();let t=this.peek();if(t===`*`||t===`/`||t===`%`){this.i++;let n=this.parseUnary(),r=t,i=e;e=r===`*`?e=>this.asNum(i,e)*this.asNum(n,e):r===`/`?e=>this.asNum(i,e)/this.asNum(n,e):e=>this.asNum(i,e)%this.asNum(n,e)}else return e}}parseUnary(){this.skipWs();let e=this.char();if(e===`-`||e===`+`){this.i++;let t=this.parseUnary();return e===`-`?e=>-this.asNum(t,e):e=>this.asNum(t,e)}return this.parsePower()}parsePower(){let e=this.parseAtom();if(this.skipWs(),this.peek()===`^`){this.i++;let t=this.parsePower(),n=e;return e=>this.asNum(n,e)**+this.asNum(t,e)}return e}parseAtom(){this.skipWs();let e=this.char();if(e===`(`){this.i++;let e=this.parseExpr();if(this.skipWs(),this.peek()!==`)`)throw new V(`expected )`,this.i);return this.i++,e}if(e>=`0`&&e<=`9`||e===`.`)return this.parseNumber();if(this.isIdentStart(e))return this.parseIdent();throw new V(`unexpected character '${e}'`,this.i)}parseNumber(){let e=this.i;for(;this.in(...r.map(t=>this.asNum(t,e)))}if(Object.hasOwn(et,t))return et[t];if(t===`x`)return e=>e;if(Object.hasOwn(this.vars,t)){let e=this.vars[t];return()=>e}if(/^[a-z]$/.test(t))return()=>1;throw new V(`unknown identifier '${t}'`,e)}asNum(e,t){return typeof e==`number`?e:e(t)}skipWs(){for(;this.in??(t>1?ot[e%ot.length]:void 0);function ct(e){let t=1/0,n=-1/0;for(let[,r]of e)rn&&(n=r);if(!Number.isFinite(t)||!Number.isFinite(n))return[-1,1];t===n&&(--t,n+=1);let r=(n-t)*.08;return[t-r,n+r]}function lt(e,t,n=5){let r=t-e;if(!Number.isFinite(r)||r<=0)return[];let i=10**Math.floor(Math.log10(r/n)),a=r/n/i,o=i*(a>=7.5?10:a>=3.5?5:a>=1.5?2:1),s=[];for(let n=Math.ceil(e/o)*o;n<=t+o*1e-9;n+=o)s.push(Math.round(n*1e9)/1e9);return s}function ut(e){return Math.abs(e)>=1e5||Math.abs(e)<.001&&e!==0?e.toExponential(1):String(Math.round(e*100)/100)}function dt({points:e,className:t,color:n}){let r=e.length>40?`${e.slice(0,16)}|${e.slice(-16)}`:e;return(0,g.jsx)(`polyline`,{points:e,className:t,style:n===void 0?void 0:{stroke:n}},r)}let ft=(0,h.memo)(function({series:e,xMin:t=-5,xMax:n=5,yMin:r,yMax:i,title:a}){let[o,s]=(0,h.useState)(()=>{let a={};for(let[t,n]of e.entries())for(let e of n.params??[])e!=null&&(a[`${t}:${e.name}`]=e.value);let[o,s]=ct(e.map((e,r)=>{let i={};for(let t of e.params??[])t!=null&&(i[t.name]=a[`${r}:${t.name}`]??t.value);return it(e.expr,t,n,240,i)}).flatMap(e=>e));return{xMin:t,xMax:n,yMin:r??o,yMax:i??s}}),c=(0,h.useRef)(null),[l,u]=(0,h.useState)(()=>({})),d=(()=>{for(let[t,n]of e.entries())for(let e of n.params??[])if(e!=null&&e.animateTo!==void 0)return{si:t,param:e};return null})(),[f,p]=(0,h.useState)(!1),[m,_]=(0,h.useState)(0),v=(0,h.useRef)(null);(0,h.useEffect)(()=>{if(!f||d===null)return;let e=l[`${d.si}:${d.param.name}`]??d.param.value,t=d.param.animateTo,n=d.param.durationMs??4e3,r=performance.now(),i=a=>{let o=Math.min(1,(a-r)/n),s=1-(1-o)**3,c=e+(t-e)*s;u(e=>({...e,[`${d.si}:${d.param.name}`]:c})),_(o),o<1?v.current=requestAnimationFrame(i):d.param.loop===!0?(u(e=>({...e,[`${d.si}:${d.param.name}`]:d.param.value})),_(0),v.current=requestAnimationFrame(()=>p(e=>e))):p(!1)};return v.current=requestAnimationFrame(i),()=>{v.current!==null&&cancelAnimationFrame(v.current)}},[f,d?.si,d?.param.name,d?.param.animateTo]);let y=o.xMin,b=o.xMax,x=o.yMin,S=o.yMax,C=e=>y+(e-34)/436*(b-y),w=e=>34+(e-y)/(b-y)*436,T=e=>14+(1-(e-x)/(S-x))*182,E=e.map((e,t)=>{let n={};for(let r of e.params??[])r!=null&&(n[r.name]=l[`${t}:${r.name}`]??r.value);return{series:e,points:it(e.expr,y,b,240,n).map(([e,t])=>`${w(e).toFixed(2)},${T(t).toFixed(2)}`).join(` `)}}),ee=lt(y,b),te=lt(x,S),ne=E.some(e=>e.points.length>1),re=Number.isFinite(y)&&Number.isFinite(b)&&b>y&&Number.isFinite(S)&&Number.isFinite(x)&&S>x,ie=(e,t,n)=>{let r=st(t,E.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`,i=e.kind??`line`;if(i===`scatter`){let e=n===``?[]:n.split(` `).map(e=>{let[t,n]=e.split(`,`);return[Number(t),Number(n)]});return(0,g.jsx)(`g`,{children:e.map(([e,t],n)=>(0,g.jsx)(`circle`,{cx:e,cy:t,r:2.6,className:H.scatterDot,style:{fill:r}},n))},t)}if(i===`area`){if(n===``)return(0,g.jsx)(dt,{points:``,className:H.line,color:r},t);let e=n.slice(0,n.indexOf(` `)).split(`,`)[0],i=n.slice(n.lastIndexOf(` `)+1).split(`,`)[0],a=T(x),o=`${e},${a.toFixed(2)} ${n} ${i},${a.toFixed(2)}`;return(0,g.jsx)(`polygon`,{points:o,className:H.area,style:{fill:r}},t)}return(0,g.jsx)(dt,{points:n,className:H.line,color:r},t)},ae=e=>{c.current={startX:e.clientX,startY:e.clientY,xMin:y,xMax:b},e.target.setPointerCapture?.(e.pointerId)},oe=e=>{let t=c.current;if(t===null)return;let n=t.xMax-t.xMin,r=(t.startX-e.clientX)/436*n;s(e=>({xMin:t.xMin+r,xMax:t.xMax+r,yMin:e.yMin,yMax:e.yMax}))},D=()=>{c.current=null},se=e=>{let t=b-y,n=t*(e.deltaY>0?1.15:1/1.15),r=e.currentTarget.getBoundingClientRect(),i=C((e.clientX-r.left)/r.width*480),a=i-(i-y)/t*n;s(e=>({xMin:a,xMax:a+n,yMin:e.yMin,yMax:e.yMax}))},O=e.some(e=>(e.params?.length??0)>0);return(0,g.jsxs)(`div`,{className:H.block,"data-genui-plot":!0,children:[a!==void 0&&(0,g.jsx)(`div`,{className:H.title,children:a}),ne&&re?(0,g.jsxs)(`svg`,{width:`100%`,viewBox:`0 0 480 220`,role:`img`,"aria-label":a??`function plot`,className:H.surface,onPointerDown:ae,onPointerMove:oe,onPointerUp:D,onPointerLeave:D,onWheel:se,children:[te.map(e=>(0,g.jsxs)(`g`,{children:[(0,g.jsx)(`line`,{x1:34,x2:470,y1:T(e),y2:T(e),className:H.gridLine}),(0,g.jsx)(`text`,{x:28,y:T(e)+4,className:H.tick,textAnchor:`end`,children:ut(e)})]},`y${e}`)),ee.map(e=>(0,g.jsxs)(`g`,{children:[(0,g.jsx)(`line`,{x1:w(e),x2:w(e),y1:14,y2:196,className:H.gridLine}),(0,g.jsx)(`text`,{x:w(e),y:210,className:H.tick,textAnchor:`middle`,children:ut(e)})]},`x${e}`)),(0,g.jsx)(`line`,{x1:34,x2:470,y1:196,y2:196,className:H.axis}),(0,g.jsx)(`line`,{x1:34,x2:34,y1:14,y2:196,className:H.axis}),E.map(({series:e,points:t},n)=>ie(e,n,t))]}):(0,g.jsx)(`div`,{className:H.empty,children:e.map((e,t)=>(0,g.jsxs)(`div`,{className:H.emptyRow,children:[e.expr,` — 无法绘制(表达式无效或范围非法)`]},t))}),O&&(0,g.jsxs)(`div`,{className:H.sliders,children:[(0,g.jsxs)(`div`,{className:H.slidersHead,children:[(0,g.jsx)(`span`,{className:H.slidersTitle,children:`参数调节`}),(0,g.jsx)(`button`,{type:`button`,className:H.resetBtn,onClick:()=>{p(!1);let t={};for(let[n,r]of e.entries())for(let e of r.params??[])e!=null&&(t[`${n}:${e.name}`]=e.value);u(t),_(0)},children:`↺ 重置`})]}),e.map((e,t)=>(e.params??[]).map(n=>{if(n==null)return null;let r=`${t}:${n.name}`,i=l[r]??n.value;return(0,g.jsxs)(`label`,{className:H.sliderRow,children:[(0,g.jsxs)(`span`,{className:H.sliderName,children:[e.label??e.expr,` · `,n.name]}),(0,g.jsx)(`input`,{type:`range`,className:H.slider,min:n.min??0,max:n.max??10,step:n.step??.1,value:i,onChange:e=>{let t=Number(e.currentTarget.value);u(e=>({...e,[r]:t}))}}),(0,g.jsx)(`span`,{className:H.sliderValue,children:Math.round(i*100)/100})]},r)}))]}),d!==null&&(0,g.jsxs)(`div`,{className:H.animBar,children:[(0,g.jsx)(`button`,{type:`button`,className:H.playBtn,onClick:()=>{f?p(!1):(u(e=>({...e,[`${d.si}:${d.param.name}`]:d.param.value})),_(0),p(!0))},children:f?`⏸ 暂停`:`▶ 播放动画`}),f&&(0,g.jsx)(`div`,{className:H.animTrack,children:(0,g.jsx)(`div`,{className:H.animFill,style:{width:`${m*100}%`}})})]}),(e.length>1||O)&&(0,g.jsx)(`div`,{className:H.legend,children:e.map((t,n)=>(0,g.jsxs)(`span`,{className:H.legendItem,children:[(0,g.jsx)(`span`,{className:H.legendSwatch,style:{background:st(n,e.length,t.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`}}),t.label??t.expr]},n))})]})});function U(e){let t=window.__DSH_BOOT__?.entries?.find(e=>e.id===mt)?.rev;return`${ht}/${e}${t===void 0?``:`?rev=${t}`}`}function pt(e){let t=`${e}.js`,n=gt.get(t);if(n!==void 0)return n;let r=new Promise((n,r)=>{let i=document.createElement(`script`);i.src=U(t),i.async=!0,i.onload=()=>{let i=(window.__GenuiAssets__??{})[e];if(i===void 0){r(Error(`genui asset '${t}' loaded but registered no '${e}' engine`));return}n(i)},i.onerror=()=>{r(Error(`genui asset '${t}' failed to load (host asset route missing?)`))},document.head.appendChild(i)});return gt.set(t,r),r}var mt,ht,gt,_t=l((()=>{mt=`@omdsh-dev/dsh-genui`,ht=`/plugins/${mt}/assets`,gt=new Map}));function vt(e){if(bt.test(e))throw Error(`mermaid output failed the sanitization check; refusing to render`)}function yt(e){let t=/^([A-Za-z]+)/.exec(e.trim())?.[1]??``;if(t!==`graph`&&t!==`flowchart`)return e;let n=e.replace(/`/g,``).replace(//gi,` `),r=/(--|==|-\.)(?!>)[ \t]*([^-\n]|-(?!--))*?[ \t]*(-->|==>|\.->)/g,i=[],a=n.replace(r,e=>(i.push(e),`\uE000${i.length-1}\uE001`)),o=/\|([^|\n]*[\[\]][^|\n]*)\|/g,s=[];return a.replace(o,(e,t)=>{let n=t.trim();return n.includes(`"`)?e:(s.push(n),`\uE002${s.length-1}\uE003`)}).replace(/([\[\(])([^\[\]\(\)\{\}"'\n]*)([\]\)])/g,(e,t,n,r)=>{let i=n.trim();return i===``?e:/[\u4e00-\u9fff\u3040-\u30ff\uac00-\ud7af]/.test(i)||/\s/.test(i)?`${t}"${i}"${r}`:e}).replace(/\uE000(\d+)\uE001/g,(e,t)=>i[Number(t)]??e).replace(/\uE002(\d+)\uE003/g,(e,t)=>{let n=s[Number(t)];return n===void 0?e:`|"${n}"|`})}var bt,xt=l((()=>{bt=/vt,renderMermaid:()=>Ct,repairMermaidSource:()=>yt});async function Ct(e){return(await pt(`mermaid`)).renderMermaid(e)}var wt=l((()=>{_t(),xt()})),Tt=u({mountScene:()=>Et});async function Et(e,t){return(await pt(`three`)).mountScene(e,t)}var Dt=l((()=>{_t()}));let Ot={info:C.calloutInfo,success:C.calloutSuccess,warning:C.calloutWarning,error:C.calloutError};function kt({node:e}){let t=e.tone??`info`,n=Ot[t]??C.calloutInfo;return(0,g.jsxs)(`div`,{className:`${C.callout} ${n}`,"data-genui-callout":!0,children:[e.title!==void 0&&(0,g.jsx)(`div`,{className:C.calloutTitle,children:e.title}),(0,g.jsx)(`div`,{className:C.calloutBody,children:e.content})]})}function At({steps:e}){let t=e.steps.slice(0,D.maxSteps),n=e.current??t.length;return(0,g.jsx)(`ol`,{className:C.steps,children:t.map((e,t)=>{let r=t(0,g.jsxs)(`div`,{className:C.kvRow,children:[(0,g.jsx)(`dt`,{className:C.kvKey,children:e.key}),(0,g.jsx)(`dd`,{className:C.kvValue,children:e.value})]},t))})}function Mt({plot:e}){let t=e.series.slice(0,D.maxPlotSeries);return(0,g.jsx)(ft,{series:t.map(e=>({expr:e.expr,label:e.label,color:e.color,kind:e.kind,params:e.params})),xMin:e.xMin,xMax:e.xMax,yMin:e.yMin,yMax:e.yMax,title:e.title})}function Nt({node:e}){return(0,g.jsx)(p.DiffBlock,{diffs:e.diffs})}function Pt({node:e}){let t=e.value;return typeof t!=`object`||!t?(0,g.jsx)(`div`,{className:C.jsonScalar,children:String(t)}):(0,g.jsx)(p.JsonTree,{data:t,copyable:!0})}function Ft({node:e}){return(0,g.jsx)(p.CodeBlock,{code:e.code.slice(0,D.maxCode),lang:e.lang})}function It({tabs:e,onAction:t,depth:n=0,answers:r}){let[i,a]=(0,h.useState)(0),o=(0,h.useId)(),s=e.tabs.slice(0,D.maxTabs),c=s[i],l=e=>{let t=(e+s.length)%s.length;a(t),document.getElementById(`${o}-tab-${t}`)?.focus()};return(0,g.jsxs)(`div`,{className:C.tabs,children:[(0,g.jsx)(`div`,{className:C.tabBar,role:`tablist`,"aria-orientation":`horizontal`,onKeyDown:e=>{e.key===`ArrowRight`?(e.preventDefault(),l(i+1)):e.key===`ArrowLeft`?(e.preventDefault(),l(i-1)):e.key===`Home`?(e.preventDefault(),l(0)):e.key===`End`&&(e.preventDefault(),l(s.length-1))},children:s.map((e,t)=>(0,g.jsx)(`button`,{id:`${o}-tab-${t}`,type:`button`,role:`tab`,"aria-selected":t===i,"aria-controls":`${o}-panel-${t}`,tabIndex:t===i?0:-1,className:`${C.tab} ${t===i?C.tabActive:``}`,onClick:()=>a(t),children:e.label},t))}),c!==void 0&&(0,g.jsx)(`div`,{className:C.col,role:`tabpanel`,id:`${o}-panel-${i}`,"aria-labelledby":`${o}-tab-${i}`,children:c.items.map((e,i)=>W(e,i,t,n+1,r))})]})}function Lt({node:e,onAction:t,depth:n=0,answers:r}){let[i,a]=(0,h.useState)(0),o=(0,h.useId)(),s=e.items.slice(0,D.maxAccordionItems);return(0,g.jsx)(`div`,{className:C.accordion,children:s.map((e,s)=>(0,g.jsxs)(`div`,{className:C.accItem,children:[(0,g.jsxs)(`button`,{type:`button`,className:C.accHead,id:`${o}-head-${s}`,"aria-expanded":i===s,"aria-controls":`${o}-body-${s}`,onClick:()=>a(i===s?null:s),children:[(0,g.jsx)(`span`,{className:C.accTitle,children:e.title}),(0,g.jsx)(`span`,{className:C.accChevron,children:i===s?`▾`:`▸`})]}),i===s&&(0,g.jsx)(`div`,{className:C.accBody,id:`${o}-body-${s}`,"aria-labelledby":`${o}-head-${s}`,children:e.items.map((e,i)=>W(e,i,t,n+1,r))})]},s))})}function Rt({node:e}){let[t,n]=(0,h.useState)(!1);return(0,g.jsx)(`button`,{type:`button`,className:`${C.copyChip} ${t?C.copyChipDone:``}`,onClick:()=>{navigator.clipboard?.writeText(e.text).catch(()=>{}),n(!0),setTimeout(()=>n(!1),1500)},children:t?`✓ 已复制`:e.label??`复制`})}function zt({node:e}){let[t,n]=(0,h.useState)(null),[r,i]=(0,h.useState)(!1),a=e.code.slice(0,D.maxMermaid);return(0,h.useEffect)(()=>{let e=!0;return Promise.resolve().then(()=>(wt(),St)).then(async t=>{try{let r=await t.renderMermaid(a);e&&n(r)}catch{e&&i(!0)}}),()=>{e=!1}},[a]),r?(0,g.jsxs)(`div`,{className:C.mermaidFallback,children:[(0,g.jsx)(`pre`,{children:a}),(0,g.jsx)(`div`,{className:C.mermaidErr,children:`图语法有误,已降级显示源码`})]}):t===null?(0,g.jsxs)(`div`,{className:C.mermaidFallback,children:[(0,g.jsx)(`pre`,{children:a}),(0,g.jsx)(`div`,{className:C.mermaidHint,children:`渲染中…`})]}):(0,g.jsx)(`div`,{className:C.mermaid,dangerouslySetInnerHTML:{__html:t},"data-genui-mermaid":!0})}function Bt({node:e}){let[t,n]=(0,h.useState)(`loading`),r=(0,h.useRef)(null),i=e.meshes.length>D.maxMeshes?{...e,meshes:e.meshes.slice(0,D.maxMeshes)}:e;return(0,h.useEffect)(()=>{let e=!0,t;return Promise.resolve().then(()=>(Dt(),Tt)).then(async a=>{if(!(!e||r.current===null))try{t=await a.mountScene(r.current,i),e&&n(`ready`)}catch{e&&n(`error`)}}),()=>{e=!1,t?.()}},[i]),(0,g.jsxs)(`div`,{className:C.scene3dWrap,"data-genui-scene3d":!0,children:[e.title!==void 0&&(0,g.jsx)(`div`,{className:C.scene3dTitle,children:e.title}),(0,g.jsx)(`div`,{ref:r,className:C.scene3dCanvas}),t===`loading`&&(0,g.jsx)(`div`,{className:C.scene3dHint,children:`加载 3D 场景…`}),t===`error`&&(0,g.jsx)(`div`,{className:C.scene3dHint,children:`3D 渲染失败`})]})}function Vt({node:e}){let t=e.items.slice(0,D.maxTimelineItems);return(0,g.jsx)(`div`,{className:C.timeline,children:t.map((e,n)=>(0,g.jsxs)(`div`,{className:C.tlItem,children:[(0,g.jsxs)(`div`,{className:C.tlRail,children:[(0,g.jsx)(`span`,{className:C.tlDot}),n`${e}-${t}`,i=e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},a=(e,n,o)=>{if(n>D.maxTreeDepth)return null;let s=e.type===`dir`||e.children!==void 0&&e.children.length>0,c=r(n,o),l=s&&t.has(c);return(0,g.jsxs)(`div`,{className:C.ftRow,style:{paddingLeft:`${n*16}px`},children:[(0,g.jsxs)(`button`,{type:`button`,className:C.ftNameBtn,"aria-expanded":s?!l:void 0,onClick:s?()=>i(c):void 0,children:[(0,g.jsx)(`span`,{className:`${C.ftIcon} ${s?C.ftIconDir:``}`,"aria-hidden":!0,children:s?l?`▸`:`▾`:`·`}),(0,g.jsx)(`span`,{className:`${C.ftName} ${s?C.ftDir:``}`,children:e.name})]}),s&&!l&&(e.children??[]).map((e,t)=>a(e,n+1,t))]},c)};return(0,g.jsx)(`div`,{className:C.fileTree,children:e.items.slice(0,D.maxListItems).map((e,t)=>a(e,0,t))})}function Ut({node:e,onAction:t}){let[n,r]=(0,h.useState)(null),i=e.options.slice(0,D.maxQuizOptions),a=n!==null,o=n===null?void 0:i[n],s=o?.correct===!0,c=e.action;return(0,g.jsxs)(`div`,{className:C.quiz,"data-genui-quiz":!0,children:[(0,g.jsx)(`div`,{className:C.quizQuestion,children:e.question}),(0,g.jsx)(`div`,{className:C.quizOptions,children:i.map((i,o)=>{let s=n===o,l=a?s?i.correct===!0?C.quizOptCorrect:C.quizOptWrong:i.correct===!0?C.quizOptReveal:C.quizOpt:C.quizOpt;return(0,g.jsxs)(`button`,{type:`button`,className:l,disabled:a,onClick:()=>{r(o),c!==void 0&&t!==void 0&&t(c,{type:`quiz`,question:e.question,answer:i.label,correct:i.correct===!0})},children:[(0,g.jsx)(`span`,{className:C.quizMarker,children:a&&(i.correct===!0?`✓`:s?`✗`:``)}),i.label]},o)})}),a&&(0,g.jsxs)(`div`,{className:C.quizResult,"aria-live":`polite`,children:[(0,g.jsxs)(`div`,{className:s?C.quizCorrectMsg:C.quizWrongMsg,children:[s?`✓ 回答正确!`:`✗ 再想想看`,o?.feedback!==void 0&&(0,g.jsx)(`div`,{className:C.quizFeedback,children:o.feedback})]}),e.explanation!==void 0&&(0,g.jsx)(`div`,{className:C.quizExplanation,children:e.explanation}),(0,g.jsx)(`button`,{type:`button`,className:C.quizRetry,onClick:()=>r(null),children:`重新作答`})]})]})}function Wt({node:e}){let t=e.items.slice(0,D.maxBreadcrumbItems);return(0,g.jsx)(`nav`,{className:C.breadcrumb,"aria-label":`breadcrumb`,children:t.map((e,n)=>(0,g.jsxs)(`span`,{className:C.bcItem,children:[(0,g.jsx)(`span`,{className:`${C.bcText} ${n===t.length-1?C.bcCurrent:``}`,children:e}),nD.maxDepth)return null;switch(e.type){case`text`:{let n=e.size??`body`;return(0,g.jsx)(`div`,{className:`${C.text} ${C[n]}`+(e.center?` ${C.center}`:``),children:e.content},t)}case`row`:return(0,g.jsxs)(`div`,{className:C.row+(e.wrap?` ${C.wrap}`:``),children:[e.items.map((e,t)=>W(e,t,n,r+1,i)),e.spacer&&(0,g.jsx)(`div`,{className:C.spacer})]},t);case`col`:return(0,g.jsx)(`div`,{className:C.col,style:e.gap===void 0?void 0:{gap:`${e.gap}px`},children:e.items.map((e,t)=>W(e,t,n,r+1,i))},t);case`grid`:return(0,g.jsx)(`div`,{className:C.grid,style:{gridTemplateColumns:`repeat(${Math.max(1,e.cols)}, minmax(0, 1fr))`},children:e.items.map((e,t)=>W(e,t,n,r+1,i))},t);case`card`:return(0,g.jsxs)(`div`,{className:C.card,children:[e.title!==void 0&&(0,g.jsx)(`div`,{className:C.cardTitle,children:e.title}),e.items.map((e,t)=>W(e,t,n,r+1,i))]},t);case`button`:{let r=e.tone??``,i=`${C.button} ${C[r]||``}`+(e.full?` ${C.full}`:``)+(e.small?` ${C.small}`:``),a=e.action,o=a!==void 0&&n!==void 0;return(0,g.jsxs)(Le,{className:i,disabled:!o,onClick:o?()=>n(a,{type:`button`,label:e.label}):void 0,children:[e.icon!==void 0&&(0,g.jsxs)(`span`,{"aria-hidden":!0,children:[e.icon,` `]}),e.label]},t)}case`input`:return(0,g.jsx)(Qe,{node:e,onAction:n,answers:i},t);case`select`:return(0,g.jsx)(Ze,{node:e,onAction:n,answers:i},t);case`checkbox`:{let r=e.action;return(0,g.jsxs)(`label`,{className:C.checkbox,children:[(0,g.jsx)(`input`,{type:`checkbox`,defaultChecked:e.checked===!0,onChange:r!==void 0&&n!==void 0?e=>n(r,{type:`checkbox`,checked:e.currentTarget.checked}):void 0}),(0,g.jsx)(`span`,{children:e.label})]},t)}case`link`:{let n=e.href;return n===void 0?(0,g.jsx)(`span`,{className:C.linkText,children:e.label},t):(0,g.jsx)(`a`,{className:C.link,href:n,target:`_blank`,rel:`noopener noreferrer`,children:e.label},t)}case`badge`:{let n=e.tone??``;return(0,g.jsxs)(`span`,{className:`${C.badge} ${C[n]||``}`,children:[e.icon!==void 0&&(0,g.jsxs)(`span`,{"aria-hidden":!0,children:[e.icon,` `]}),e.label]},t)}case`stat`:{let n=e.delta!==void 0&&e.delta.startsWith(`-`);return(0,g.jsxs)(`div`,{className:C.stat,children:[(0,g.jsx)(`span`,{className:C.statLabel,children:e.label}),(0,g.jsx)(`span`,{className:C.statValue,children:e.value}),e.delta!==void 0&&(0,g.jsx)(`span`,{className:`${C.statDelta} ${n?C.down:C.up}`,children:e.delta})]},t)}case`progress`:{let n=Math.max(0,Math.min(100,Number(e.value)||0));return(0,g.jsxs)(`div`,{className:C.progress,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,"aria-label":e.label??e.valueLabel??void 0,children:[(e.label!==void 0||e.valueLabel!==void 0)&&(0,g.jsxs)(`div`,{className:C.progressRow,children:[(0,g.jsx)(`span`,{children:e.label}),e.valueLabel!==void 0&&(0,g.jsx)(`span`,{children:e.valueLabel})]}),(0,g.jsx)(`div`,{className:C.track,children:(0,g.jsx)(`div`,{className:C.fill,style:{width:`${n}%`}})})]},t)}case`divider`:return(0,g.jsx)(`hr`,{className:C.divider},t);case`list`:{let n=e.items.slice(0,D.maxListItems);return(0,g.jsx)(`div`,{className:C.list,children:n.map((e,t)=>(0,g.jsx)(`div`,{className:C.li,children:typeof e==`string`?(0,g.jsx)(`span`,{className:C.liTitle,children:e}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(`span`,{className:C.liTitle,children:e.title}),e.desc!==void 0&&(0,g.jsx)(`span`,{className:C.liDesc,children:e.desc})]})},t))},t)}case`table`:return(0,g.jsx)(ze,{node:e},t);case`chart`:return(0,g.jsx)(Be,{chart:e},t);case`tabs`:return(0,g.jsx)(It,{tabs:e,onAction:n,depth:r+1,answers:i},t);case`avatar`:return(0,g.jsx)(`div`,{className:C.avatar,style:{background:e.color??Ie(e.name)},children:e.name.slice(0,1).toUpperCase()},t);case`spacer`:return(0,g.jsx)(`div`,{className:C.spacer},t);case`plot`:return(0,g.jsx)(Mt,{plot:e},t);case`callout`:return(0,g.jsx)(kt,{node:e},t);case`steps`:return(0,g.jsx)(At,{steps:e},t);case`keyvalue`:return(0,g.jsx)(jt,{node:e},t);case`diff`:return(0,g.jsx)(Nt,{node:e},t);case`json`:return(0,g.jsx)(Pt,{node:e},t);case`code`:return(0,g.jsx)(Ft,{node:e},t);case`radio`:return(0,g.jsx)(We,{node:e,onAction:n,answers:i},`${t}:r${i?.round??0}`);case`submit`:return(0,g.jsx)(Ke,{node:e,onAction:n,answers:i},t);case`switch`:return(0,g.jsx)(qe,{node:e,onAction:n},t);case`slider`:return(0,g.jsx)(Je,{node:e,onAction:n,answers:i},t);case`textarea`:return(0,g.jsx)($e,{node:e,onAction:n,answers:i},t);case`accordion`:return(0,g.jsx)(Lt,{node:e,onAction:n,depth:r+1,answers:i},t);case`copy`:return(0,g.jsx)(Rt,{node:e},t);case`mermaid`:return(0,g.jsx)(zt,{node:e},t);case`scene3d`:return(0,g.jsx)(Bt,{node:e},t);case`timeline`:return(0,g.jsx)(Vt,{node:e},t);case`file-tree`:return(0,g.jsx)(Ht,{node:e},t);case`breadcrumb`:return(0,g.jsx)(Wt,{node:e},t);case`quiz`:return(0,g.jsx)(Ut,{node:e,onAction:n},t);default:{let a=e,o=Gt?.(a.type);return o===void 0?null:(0,g.jsx)(o,{node:a,onAction:n,renderChildren:(e,t)=>e.map((e,a)=>W(e,Number(t)+a,n,r+1,i))},t)}}}function Kt(e){let t=(0,h.useRef)(null);return(0,h.useEffect)(()=>()=>{let e=t.current;if(e!==null){for(let t of e.values())clearTimeout(t);e.clear()}},[]),(0,h.useMemo)(()=>{if(e===void 0)return;let n=new Map;return t.current=n,(t,r)=>{let i=n.get(t);i!==void 0&&clearTimeout(i),n.set(t,setTimeout(()=>{n.delete(t),e(t,r)},300))}},[e])}function qt(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}let Jt=(0,h.memo)(function({spec:e,stateKey:t}){let n=e.gap??16,r=Kt(y()),[i]=(0,h.useState)(()=>t===void 0?null:te(t)),[a,o]=(0,h.useState)(i?.answers??{}),[s,c]=(0,h.useState)(i?.fields??{}),[l,u]=(0,h.useState)({}),[d,f]=(0,h.useState)(i?.locked===!0),[p,m]=(0,h.useState)(0),[_,v]=(0,h.useState)(new Set),b=(0,h.useCallback)((e,t)=>{o(n=>n[e]===t?n:{...n,[e]:t})},[]),x=(0,h.useCallback)((e,t)=>{c(n=>{if(t.trim()===``){if(!(e in n))return n;let t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}})},[]),S=(0,h.useCallback)(e=>{v(t=>t.has(e)?t:new Set(t).add(e))},[]),w=(0,h.useCallback)((e,t)=>{u(n=>{let r=n[e];return r!==void 0&&r.label===t.label&&r.answer===t.answer&&r.explanation===t.explanation?n:{...n,[e]:t}})},[]),T=(0,h.useCallback)(()=>{o({}),f(!1),m(e=>e+1)},[]),E=(0,h.useMemo)(()=>({answers:a,fields:s,secretFields:_,meta:l,locked:d,round:p,setAnswer:b,setField:x,registerSecretField:S,registerMeta:w,clear:T,setLocked:f}),[a,s,_,l,d,p,b,x,S,w,T]);return(0,h.useEffect)(()=>{if(t===void 0)return;let e=setTimeout(()=>{let e=Object.fromEntries(Object.entries(s).filter(([e])=>!_.has(e)));ne(t,{answers:a,locked:d,...Object.keys(e).length>0?{fields:e}:{}})},300);return()=>clearTimeout(e)},[t,a,d,s,_]),(0,g.jsxs)(`div`,{className:C.block,"data-genui":!0,children:[e.title!==void 0&&(0,g.jsx)(`div`,{className:C.banner,children:e.title}),(0,g.jsx)(`div`,{className:C.col,style:{gap:`${n}px`},children:e.items.map((e,t)=>(0,g.jsx)(`div`,{className:C.reveal,style:{animationDelay:`${Math.min(t*90,720)}ms`},children:W(e,t,r,0,E)},t))})]})},(e,t)=>e.stateKey===t.stateKey&&qt(e.spec,t.spec));function Yt(e){if(typeof e!=`object`||!e)return!1;let t=e;return!(!Array.isArray(t.items)||t.title!==void 0&&typeof t.title!=`string`||t.gap!==void 0&&typeof t.gap!=`number`)}function Xt(e){let t=[],n=[],r=e=>{n.length>=32&&n.shift(),n.push(e)},i=!1,a=!1,o=0;for(;ot.end-e.end);let s=[];for(let e of n)(s.length===0||s[s.length-1].end!==e.end)&&s.push(e);return{candidates:s.slice(0,32),scannedChars:o}}function Zt(e){let t=``;for(let n=e.length-1;n>=0;n--)t+=e[n]===`{`?`}`:`]`;return t}function Qt(e){try{let t=JSON.parse(e);return Yt(t)?t:null}catch{return null}}function $t(e){let t=e.trim();if(t===``)return null;let n=Qt(t);if(n!==null)return n;let{candidates:r}=Xt(t);for(let e of r){let n=Qt(t.slice(0,e.end)+e.closingSuffix);if(n!==null)return n}return null}let G={maxNodes:200,maxAppends:200},en=new Map,K=new Set;function tn(){return{ops:new Map,seen:new Map,overflow:null,local:null,localBarrier:-1,replayBarrier:-1,maxSeenSeq:-1,snapshot:null}}let nn=`dsh.genui.panel`;function rn(){try{let e=localStorage.getItem(nn);if(e===null)return{order:[],sessions:{}};let t=JSON.parse(e);return!Array.isArray(t.order)||typeof t.sessions!=`object`||t.sessions===null?{order:[],sessions:{}}:{order:t.order.filter(e=>typeof e==`string`),sessions:t.sessions}}catch{return{order:[],sessions:{}}}}function an(e,t){try{let n=rn(),r=n.order.filter(t=>t!==e);r.unshift(e);let i={...n.sessions,[e]:t};for(;r.length>50;){let e=r.pop();e!==void 0&&delete i[e]}localStorage.setItem(nn,JSON.stringify({order:r,sessions:i}))}catch{}}function on(e){let t=en.get(e);if(t!==void 0)return t;let n=tn();try{let t=rn().sessions[e];t!==void 0&&(n={ops:new Map,seen:new Map,overflow:null,local:t.local??null,localBarrier:t.localBarrier??-1,replayBarrier:t.maxSeenSeq??-1,maxSeenSeq:t.maxSeenSeq??-1,snapshot:t.snapshot??null})}catch{}return en.set(e,n),n}function q(e,t){for(let n=0;n<3;n++){let r=e[n]-t[n];if(r!==0)return r}return 0}function sn(e,t){if(t!==null&&(t.order[0]<=e.localBarrier||t.order[0]<=e.replayBarrier||e.seen.has(t.sourceId)||e.overflow!==null&&e.overflow.sourceId===t.sourceId||t.mode===`append`&&e.overflow!==null&&q(t.order,e.overflow.order)>0))return null;let n=[...e.ops.values()].filter(t=>t.order[0]>e.localBarrier&&t.order[0]>e.replayBarrier);t!==null&&n.push(t),n.sort((e,t)=>q(e.order,t.order));let r=0;for(let e=0;ec&&(c=t.order[0]),t.mode===`replace`){if(z(t.spec,G.maxNodes+1)>G.maxNodes){(a===null||q(t.order,a.order)<0)&&(a=t);continue}a=null,i=t.spec,s.length=0,o=0,s.push(t);continue}let r=_n(i,t.spec);if(o>=G.maxAppends||z(r,G.maxNodes+1)>G.maxNodes){(a===null||q(t.order,a.order)<0)&&(a=t);continue}i=r,o+=1,s.push(t)}return t!==null&&s.length===e.ops.size&&s.every(t=>e.ops.get(t.sourceId)?.mode===t.mode)&&(a===null&&e.overflow===null||a!==null&&e.overflow!==null&&a.sourceId===e.overflow.sourceId)?null:{snapshot:i,kept:s,overflow:a,maxSeenSeq:c}}function cn(e,t,n){e.snapshot=t.snapshot,e.overflow=t.overflow,e.maxSeenSeq=t.maxSeenSeq,e.ops=new Map(t.kept.map(e=>[e.sourceId,e]));for(let n of t.kept)e.seen.set(n.sourceId,n.order);t.overflow!==null&&e.seen.set(t.overflow.sourceId,t.overflow.order),an(n,{snapshot:e.snapshot,local:e.local,localBarrier:e.localBarrier,maxSeenSeq:e.maxSeenSeq})}function ln(e,t){let n=on(e),r=sn(n,t);if(r===null)return n.seen.has(t.sourceId)||n.overflow?.sourceId===t.sourceId?`idempotent`:(n.overflow!==null&&t.mode===`append`&&q(t.order,n.overflow.order)>0||un(e,t,n),`blocked`);let i=r.overflow!==null&&r.overflow.sourceId===t.sourceId?`overflow`:`accepted`,a=n.snapshot!==r.snapshot;if(cn(n,r,e),a)for(let e of K)e();return i}let J=new Set;function un(e,t,n){let r=`${e}\u0000${t.sourceId}`;J.has(r)||(J.add(r),console.warn(`[genui] 面板操作被重放屏障拒绝(source ${t.sourceId},order[0]=${t.order[0]} ≤ replayBarrier ${n.replayBarrier} / localBarrier ${n.localBarrier})。历史消息重放被拒是预期行为;若是刚发送的新消息,说明消息序号推导异常,请报告。`))}function dn(e,t){let n=on(e),r=n.maxSeenSeq;if(n.local!==t||n.localBarrier!==r){n.local=t,n.localBarrier=r,cn(n,sn(n,null),e);for(let e of K)e()}}let Y=new Set;function fn(e,t){let n=`${e}\u0000${t}`;Y.has(n)||(Y.add(n),console.warn(`[genui] 面板已到节点/操作上限(${G.maxNodes} 节点、${G.maxAppends} 条追加),本次 append 被拒绝;请让模型发送 replace 更新面板。`))}function pn(e){let t=en.delete(e),n=X.delete(e),r=`${e}\u0000`;for(let e of Y)e.startsWith(r)&&Y.delete(e);for(let e of J)e.startsWith(r)&&J.delete(e);if(!(!t&&!n)){for(let e of K)e();for(let e of Z)e()}}function mn(e){return on(e).snapshot}function hn(e){return K.add(e),()=>{K.delete(e)}}function gn(e){if(e.items.length!==1)return null;let t=e.items[0];return t?.type!==`tabs`||!Array.isArray(t.tabs)?null:t.tabs}function _n(e,t){if(e===null||e.items.length===0)return t;let n=e.title??t.title,r={...e,...n===void 0?{}:{title:n}},i=gn(e),a=gn(t);if(i!==null&&a!==null){let e=new Map(i.map(e=>[e.label,{label:e.label,items:[...e.items]}]));for(let t of a){let n=e.get(t.label);n===void 0?e.set(t.label,{label:t.label,items:[...t.items]}):n.items.push(...t.items)}return{...r,items:[{type:`tabs`,tabs:[...e.values()]}]}}return{...r,items:[...e.items,...t.items]}}let X=new Map,Z=new Set;function vn(e){X.set(e,(X.get(e)??0)+1);for(let e of Z)e()}function yn(e){return X.get(e)??0}function bn(e){return Z.add(e),()=>{Z.delete(e)}}function xn(e){try{return JSON.parse(e),!0}catch{return!1}}function Sn(e){try{return JSON.parse(e),null}catch(e){let t=e instanceof Error?e.message:String(e),n=t.match(/position (\d+)/i);return`${n===null?``:`(字符 ${n[1]} 附近)`}${t.slice(0,140)}`}}function Cn(e){try{return JSON.parse(e),null}catch{}let t=``,n=!1,r=!1,i=0;for(let a=0;a{var t={exports:{}},n=t.exports;Object.defineProperty(n,Symbol.toStringTag,{value:`Module`});var r=Object.create,i=Object.defineProperty,a=Object.getOwnPropertyDescriptor,o=Object.getOwnPropertyNames,s=Object.getPrototypeOf,c=Object.prototype.hasOwnProperty,l=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},u=(e,t)=>{let n={};for(var r in e)i(n,r,{get:e[r],enumerable:!0});return t||i(n,Symbol.toStringTag,{value:`Module`}),n},d=(e,t,n,r)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var s=o(t),l=0,u=s.length,d;lt[e]).bind(null,d),enumerable:!(r=a(t,d))||r.enumerable});return e},f=(e,t,n)=>(n=e==null?{}:r(s(e)),d(t||!e||!e.__esModule||!c.call(e,`default`)?i(n,`default`,{value:e,enumerable:!0}):n,e));let p=e("@deepseek-ai/dsh-client-ui-primitives");p=f(p,1);let ee=e("react-dom/client"),m=e("react"),h=e("react/jsx-runtime"),g=(0,m.createContext)(void 0),_=p.GenuiActionContext??g;function v(){return(0,m.useContext)(_)}let y={display:`flex`,flexDirection:`column`,gap:`4px`,padding:`8px 12px`,margin:`4px 0`,borderRadius:`8px`,border:`1px solid rgba(127,127,127,0.35)`,background:`rgba(127,127,127,0.08)`,color:`inherit`,fontSize:`12px`,lineHeight:1.5,fontFamily:`inherit`};var b=class extends m.Component{state={error:null};static getDerivedStateFromError(e){return{error:e}}componentDidCatch(e,t){console.error(`[dsh-genui] render failed:`,e,t.componentStack??``)}render(){let{error:e}=this.state;return e===null?this.props.children:(0,h.jsxs)(`div`,{style:y,role:`alert`,"data-genui-error":!0,children:[(0,h.jsxs)(`span`,{style:{fontWeight:600},children:[`⚠️ `,this.props.label??`此界面`,`渲染失败(已隔离,不影响其他内容)`]}),(0,h.jsx)(`span`,{style:{opacity:.75,overflowWrap:`anywhere`},children:e.message})]})}};let x=`@omdsh-dev/dsh-genui/GenuiBlock.module.css`;if(typeof document<`u`&&document.querySelector(`style[data-plugin-css=`+JSON.stringify(x)+`]`)===null){let e=document.createElement(`style`);e.dataset.plugin=`@omdsh-dev/dsh-genui`,e.dataset.pluginCss=x,e.textContent=`.V1MMBW_block{--dsl-g-radius-surface:12px;--dsl-g-radius-control:8px;--dsl-g-radius-pill:999px;--dsl-g-font-display:24px;--dsl-g-font-h1:20px;--dsl-g-font-h2:16px;--dsl-g-font-h3:14px;--dsl-g-font-body:14px;--dsl-g-font-title:13px;--dsl-g-font-meta:12px;--dsl-g-font-data:11px;--dsl-g-gap-lg:16px;--dsl-g-gap-md:12px;--dsl-g-gap-sm:8px;--dsl-g-gap-xs:4px;--dsl-g-border:var(--dsw-alias-border-l1,var(--dsw-alias-border-l2,#ffffff1f));--dsl-g-border-strong:var(--dsw-alias-border-l2,#ffffff1f);--dsl-g-accent:var(--dsw-alias-state-business-primary,#4f8ef7);--dsl-g-accent-soft:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint), transparent);--dsl-g-tint:8%;--dsl-g-tint-strong:14%;--dsl-g-font-mono:var(--ds-font-family-code,ui-monospace, "SF Mono", monospace);color:var(--dsw-alias-label-primary);margin:8px 0}.V1MMBW_banner{font-size:var(--dsl-g-font-title);letter-spacing:.01em;color:var(--dsw-alias-label-primary);margin-bottom:var(--dsl-g-gap-lg);border-bottom:1px solid var(--dsl-g-border);padding-bottom:10px;font-weight:600}.V1MMBW_col{gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_row{align-items:center;gap:var(--dsl-g-gap-md);display:flex}.V1MMBW_row.V1MMBW_wrap{flex-wrap:wrap}.V1MMBW_grid{gap:var(--dsl-g-gap-md);display:grid}.V1MMBW_spacer{flex:1}.V1MMBW_divider{background:var(--dsw-alias-markdown-hr,var(--dsl-g-border));height:1px;margin:var(--dsl-g-gap-xs) 0;border:none}.V1MMBW_card{background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);padding:var(--dsl-g-gap-lg);gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_cardTitle{font-size:var(--dsl-g-font-meta);letter-spacing:.02em;color:var(--dsw-alias-label-secondary);font-weight:600}.V1MMBW_text{color:var(--dsw-alias-label-primary)}.V1MMBW_text.V1MMBW_h1{font-size:var(--dsl-g-font-h1);letter-spacing:-.02em;font-weight:700;line-height:1.3}.V1MMBW_text.V1MMBW_h2{font-size:var(--dsl-g-font-h2);letter-spacing:-.01em;font-weight:600;line-height:1.35}.V1MMBW_text.V1MMBW_h3{font-size:var(--dsl-g-font-h3);font-weight:600;line-height:1.5}.V1MMBW_text.V1MMBW_body{font-size:var(--dsl-g-font-body);color:var(--dsw-alias-label-primary);line-height:1.6}.V1MMBW_text.V1MMBW_muted{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);line-height:1.5}.V1MMBW_text.V1MMBW_caption{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);letter-spacing:.02em;line-height:1.5}.V1MMBW_text.V1MMBW_center{text-align:center}.V1MMBW_button{border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:var(--dsl-g-radius-control);padding:8px var(--dsl-g-gap-lg);font-size:var(--dsl-g-font-title);cursor:pointer;text-align:center;font-family:inherit;font-weight:600;line-height:1.4;transition:border-color .15s,filter .15s,background .15s}.V1MMBW_button:hover:not(:disabled){border-color:var(--dsl-g-accent);filter:brightness(1.06)}.V1MMBW_button.V1MMBW_primary:hover:not(:disabled){filter:brightness(1.08)}.V1MMBW_button:disabled{cursor:not-allowed;opacity:.45;filter:none;box-shadow:none;pointer-events:none}.V1MMBW_button.V1MMBW_primary{background:var(--dsl-g-accent);color:#fff;border:none;box-shadow:inset 0 1px #ffffff24}.V1MMBW_button.V1MMBW_danger{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent);border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent);color:var(--dsw-alias-state-error-primary,#ffb3b3)}.V1MMBW_button.V1MMBW_success{background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 30%, transparent);color:var(--dsw-alias-state-success-secondary,#9fe8c5)}.V1MMBW_button.V1MMBW_ghost{background:0 0}.V1MMBW_button.V1MMBW_full{width:100%}.V1MMBW_button.V1MMBW_small{font-size:var(--dsl-g-font-meta);border-radius:var(--dsl-g-radius-control);padding:4px 12px}.V1MMBW_field{gap:var(--dsl-g-gap-xs);flex-direction:column;display:flex}.V1MMBW_field>span{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_input,.V1MMBW_select{background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);color:var(--dsw-alias-label-primary);font-size:var(--dsl-g-font-title);outline:none;width:100%;padding:8px 12px;font-family:inherit}.V1MMBW_input:focus,.V1MMBW_select:focus{border-color:var(--dsl-g-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent)}.V1MMBW_input::placeholder{color:var(--dsw-alias-label-caption,#5b6378)}.V1MMBW_checkbox{align-items:center;gap:var(--dsl-g-gap-sm);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);cursor:pointer;display:flex}.V1MMBW_checkbox input{accent-color:var(--dsl-g-accent);width:15px;height:15px}.V1MMBW_link{color:var(--dsl-g-accent);font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;border:none;padding:0;font-family:inherit;text-decoration:none}.V1MMBW_link:hover{text-decoration:underline}.V1MMBW_linkText{color:var(--dsl-g-accent);font-size:var(--dsl-g-font-title);font-family:inherit;text-decoration:none}.V1MMBW_badge{align-items:center;gap:var(--dsl-g-gap-xs);font-size:var(--dsl-g-font-meta);letter-spacing:.01em;border-radius:var(--dsl-g-radius-pill);background:color-mix(in srgb, var(--dsw-alias-label-tertiary) var(--dsl-g-tint), transparent);width:fit-content;color:var(--dsw-alias-label-secondary);border:1px solid var(--dsl-g-border);padding:1px 10px;font-weight:500;line-height:1.5;display:inline-flex}.V1MMBW_badge.V1MMBW_success{background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-success-secondary,#7fe3b4);border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 30%, transparent)}.V1MMBW_badge.V1MMBW_warn{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#f5b83d) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-warn-secondary,#f7cf7d);border-color:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#f5b83d) 30%, transparent)}.V1MMBW_badge.V1MMBW_danger{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-error-primary,#ff9d9d);border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent)}.V1MMBW_badge.V1MMBW_accent{background:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint), transparent);color:var(--dsw-alias-state-business-primary,#9cc3ff);border-color:color-mix(in srgb, var(--dsl-g-accent) 30%, transparent)}.V1MMBW_stat{padding:6px var(--dsl-g-gap-lg);flex-direction:column;gap:2px;display:flex}.V1MMBW_grid>.V1MMBW_stat,.V1MMBW_row>.V1MMBW_stat{border-left:1px solid var(--dsl-g-border)}.V1MMBW_grid>.V1MMBW_stat:first-child,.V1MMBW_row>.V1MMBW_stat:first-child{padding-left:var(--dsl-g-gap-xs);border-left:none}.V1MMBW_statLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);letter-spacing:.02em}.V1MMBW_statValue{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-display);letter-spacing:-.02em;font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.2}.V1MMBW_statDelta{font-size:var(--dsl-g-font-meta);font-weight:500}.V1MMBW_statDelta.V1MMBW_up{color:var(--dsw-alias-state-success-primary,#22c55e)}.V1MMBW_statDelta.V1MMBW_down{color:var(--dsw-alias-state-error-primary,#f25a5a)}.V1MMBW_progress{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_progressRow{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);justify-content:space-between;display:flex}.V1MMBW_progressRow span:last-child{font-family:var(--dsl-g-font-mono)}.V1MMBW_track{border-radius:var(--dsl-g-radius-pill);background:var(--dsw-alias-bg-layer-1);height:6px;box-shadow:inset 0 0 0 1px var(--dsl-g-border);overflow:hidden}.V1MMBW_fill{border-radius:var(--dsl-g-radius-pill);background:var(--dsl-g-accent);height:100%;transition:width .5s}.V1MMBW_list{flex-direction:column;display:flex}.V1MMBW_li{padding:var(--dsl-g-gap-sm) var(--dsl-g-gap-xs);flex-direction:column;gap:2px;display:flex}.V1MMBW_li+.V1MMBW_li{border-top:1px solid var(--dsl-g-border)}.V1MMBW_li:last-child{border-bottom:none}.V1MMBW_liTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.5}.V1MMBW_liDesc{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);line-height:1.5}.V1MMBW_tableWrap{border-radius:var(--dsl-g-radius-control);overscroll-behavior-x:contain;min-width:0;max-width:100%;overflow-x:auto}.V1MMBW_table{border-collapse:collapse;width:100%;font-size:var(--dsl-g-font-title)}.V1MMBW_table th{text-align:left;padding:var(--dsl-g-gap-sm) var(--dsl-g-gap-md);color:var(--dsw-alias-label-tertiary);font-weight:600;font-size:var(--dsl-g-font-meta);border-bottom:1px solid var(--dsl-g-border);white-space:nowrap}.V1MMBW_table td{padding:var(--dsl-g-gap-sm) var(--dsl-g-gap-md);border-bottom:1px solid var(--dsl-g-border);color:var(--dsw-alias-label-secondary);white-space:nowrap;font-variant-numeric:tabular-nums;line-height:1.5}.V1MMBW_table tr:last-child td{border-bottom:none}.V1MMBW_thSort{color:inherit;font:inherit;font-weight:inherit;cursor:pointer;text-align:left;background:0 0;border:none;margin:0;padding:0}.V1MMBW_thSort:hover{color:var(--dsw-alias-label-primary)}.V1MMBW_thSortMark{color:var(--dsl-g-accent)}.V1MMBW_thSort:focus-visible{outline:2px solid var(--dsl-g-accent);outline-offset:1px;border-radius:var(--dsl-g-radius-control)}.V1MMBW_chart{gap:var(--dsl-g-gap-xs);flex-direction:column;display:flex}.V1MMBW_chartPlot{align-items:flex-end;gap:var(--dsl-g-gap-sm);height:132px;display:flex;position:relative}.V1MMBW_baseline{background:var(--dsl-g-border-strong);pointer-events:none;height:1px;position:absolute;bottom:0;left:0;right:0}.V1MMBW_gridline{background:var(--dsw-alias-border-l1,#ffffff0f);pointer-events:none;height:1px;position:absolute;left:0;right:0}.V1MMBW_chartLabels{gap:var(--dsl-g-gap-sm);display:flex}.V1MMBW_chartLabels>span{flex:1;min-width:0}.V1MMBW_barCol{justify-content:flex-end;gap:var(--dsl-g-gap-xs);flex-direction:column;flex:1;min-width:0;height:100%;display:flex}.V1MMBW_barValue{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data);font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);text-align:center;line-height:1.2}.V1MMBW_barFill{background:var(--dsl-g-accent);border-radius:4px 4px 2px 2px;min-height:4px;transition:height .6s}.V1MMBW_barLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);text-align:center;white-space:nowrap;text-overflow:ellipsis;line-height:1.5;overflow:hidden}.V1MMBW_tabs{gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_tabBar{gap:var(--dsl-g-gap-xs);border-bottom:1px solid var(--dsl-g-border);display:flex}.V1MMBW_tab{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;border:none;border-bottom:2px solid #0000;margin-bottom:-1px;padding:6px 12px;font-family:inherit;font-weight:600;line-height:1.5}.V1MMBW_tabActive{color:var(--dsw-alias-label-primary);border-bottom-color:var(--dsl-g-accent)}.V1MMBW_avatar{width:32px;height:32px;font-size:var(--dsl-g-font-title);color:#fff;border:1px solid #ffffff24;border-radius:50%;flex-shrink:0;place-items:center;font-weight:700;display:grid;box-shadow:inset 0 1px #ffffff29}.V1MMBW_callout{border-radius:var(--dsl-g-radius-control);border:1px solid var(--dsl-g-border);font-size:var(--dsl-g-font-title);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));flex-direction:column;gap:2px;padding:10px 14px;line-height:1.6;display:flex}.V1MMBW_calloutInfo{background:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint), transparent)}.V1MMBW_calloutSuccess{background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent)}.V1MMBW_calloutWarning{background:color-mix(in srgb, var(--dsw-alias-state-warn-primary,#f5b83d) var(--dsl-g-tint), transparent)}.V1MMBW_calloutError{background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent)}.V1MMBW_calloutTitle{font-weight:600;font-size:var(--dsl-g-font-meta);letter-spacing:.02em;color:var(--dsw-alias-label-secondary);align-items:center;gap:6px;display:flex}.V1MMBW_calloutTitle:before{content:"";background:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary));border-radius:50%;width:6px;height:6px}.V1MMBW_calloutInfo .V1MMBW_calloutTitle:before{background:var(--dsl-g-accent)}.V1MMBW_calloutSuccess .V1MMBW_calloutTitle:before{background:var(--dsw-alias-state-success-primary,#3ecf8e)}.V1MMBW_calloutWarning .V1MMBW_calloutTitle:before{background:var(--dsw-alias-state-warn-primary,#f5b83d)}.V1MMBW_calloutError .V1MMBW_calloutTitle:before{background:var(--dsw-alias-state-error-primary,#ff6b6b)}.V1MMBW_calloutBody{color:var(--dsw-alias-label-secondary)}.V1MMBW_steps{gap:var(--dsl-g-gap-sm);flex-direction:column;margin:0;padding:0;list-style:none;display:flex}.V1MMBW_step{gap:var(--dsl-g-gap-md);align-items:flex-start;display:flex}.V1MMBW_stepMarker{width:24px;height:24px;font-size:var(--dsl-g-font-meta);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsl-g-border);color:var(--dsw-alias-label-tertiary);border-radius:50%;flex-shrink:0;place-items:center;font-weight:700;display:grid}.V1MMBW_stepDone .V1MMBW_stepMarker{background:var(--dsw-alias-state-success-primary,#3ecf8e);color:#fff;border-color:#0000;font-size:13px}.V1MMBW_stepActive .V1MMBW_stepMarker{background:color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent);border-color:var(--dsl-g-accent);color:var(--dsl-g-accent)}.V1MMBW_stepContent{flex-direction:column;gap:2px;padding-top:3px;display:flex}.V1MMBW_stepTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.5}.V1MMBW_stepDesc{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);line-height:1.5}.V1MMBW_keyvalue{flex-direction:column;margin:0;display:flex}.V1MMBW_kvRow{gap:var(--dsl-g-gap-md);font-size:var(--dsl-g-font-title);padding:6px 0;display:flex}.V1MMBW_kvRow+.V1MMBW_kvRow{border-top:1px solid var(--dsl-g-border)}.V1MMBW_kvRow:last-child{border-bottom:none}.V1MMBW_kvKey{width:96px;color:var(--dsw-alias-label-tertiary);flex-shrink:0;font-weight:600}.V1MMBW_kvValue{color:var(--dsw-alias-label-primary);word-break:break-word;margin:0;line-height:1.5}.V1MMBW_jsonScalar{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary)}.V1MMBW_lineChart{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_linePath{fill:none;stroke:var(--dsl-g-accent);stroke-width:2px;stroke-linejoin:round;stroke-linecap:round}.V1MMBW_lineDot{fill:var(--dsl-g-accent)}.V1MMBW_lineGrid{stroke:var(--dsw-alias-border-l1,#ffffff12);stroke-width:1px}.V1MMBW_lineGridAxis{stroke:var(--dsl-g-border-strong);stroke-width:1px}.V1MMBW_lineTick{fill:var(--dsw-alias-label-tertiary);font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data)}.V1MMBW_lineLabels{justify-content:space-between;display:flex}.V1MMBW_groupedBars{gap:var(--dsl-g-gap-xs);align-items:flex-end;width:100%;height:100%;display:flex}.V1MMBW_groupedBar{flex-direction:column;flex:1;justify-content:flex-end;align-items:center;gap:2px;min-width:0;height:100%;display:flex}.V1MMBW_groupValue{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data);font-variant-numeric:tabular-nums;color:var(--dsw-alias-label-secondary);text-overflow:ellipsis;max-width:100%;line-height:1.2;overflow:hidden}.V1MMBW_groupedFill{background:var(--dsl-g-accent);border-radius:4px 4px 2px 2px;flex:none;width:100%;min-height:3px}.V1MMBW_donut{align-items:center;gap:var(--dsl-g-gap-lg);display:flex}.V1MMBW_donutTrack{stroke:var(--dsw-alias-border-l1,#ffffff14)}.V1MMBW_donutTotal{fill:var(--dsw-alias-label-primary);font-size:var(--dsl-g-font-h2);font-weight:700}.V1MMBW_donutTotalLabel{fill:var(--dsw-alias-label-tertiary);font-size:10px}.V1MMBW_donutLegend{gap:var(--dsl-g-gap-xs);font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-secondary);flex-direction:column;line-height:1.5;display:flex}.V1MMBW_fieldGroup{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_fieldLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_radio{align-items:center;gap:var(--dsl-g-gap-sm);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);cursor:pointer;line-height:1.5;display:flex}.V1MMBW_radio input{accent-color:var(--dsl-g-accent)}.V1MMBW_submitRow{align-items:center;gap:var(--dsl-g-gap-md);margin-top:2px;display:flex}.V1MMBW_submit{align-self:flex-start}.V1MMBW_submitHint{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_btnSent{margin-left:var(--dsl-g-gap-sm);font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-state-success-primary,#3ecf8e);font-weight:600}.V1MMBW_gradeWrap{gap:var(--dsl-g-gap-md);flex-direction:column;display:flex}.V1MMBW_gradeScore{align-items:baseline;gap:var(--dsl-g-gap-sm);display:flex}.V1MMBW_gradeScoreValue{font-size:var(--dsl-g-font-display);color:var(--dsw-alias-label-primary);font-weight:700;line-height:1.2}.V1MMBW_gradeScoreLabel{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary)}.V1MMBW_gradeList{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_gradeItem{font-size:var(--dsl-g-font-title);padding:var(--dsl-g-gap-sm) 12px;border-radius:var(--dsl-g-radius-control);border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-layer-1);grid-template-columns:auto auto 1fr;align-items:baseline;gap:6px 10px;line-height:1.5;display:grid}.V1MMBW_gradeItemOk{border-color:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 30%, transparent)}.V1MMBW_gradeItemNo{border-color:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent)}.V1MMBW_gradeQ{color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_gradeTag{font-weight:700}.V1MMBW_gradeItemOk .V1MMBW_gradeTag{color:var(--dsw-alias-state-success-primary,#3ecf8e)}.V1MMBW_gradeItemNo .V1MMBW_gradeTag{color:var(--dsw-alias-state-error-primary,#ff6b6b)}.V1MMBW_gradeAns{color:var(--dsw-alias-label-secondary)}.V1MMBW_gradeRight{color:var(--dsw-alias-state-error-primary,#ffb3b3)}.V1MMBW_gradeExp{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);grid-column:1/-1;line-height:1.5}.V1MMBW_switchRow{justify-content:space-between;align-items:center;gap:var(--dsl-g-gap-md);cursor:pointer;display:flex}.V1MMBW_switchRow:focus-within .V1MMBW_switch{box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent)}.V1MMBW_switchLabel{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);line-height:1.5}.V1MMBW_switch{border-radius:var(--dsl-g-radius-pill);border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-base,#17171a);width:38px;height:22px;transition:background .2s;position:relative}.V1MMBW_switchOn{background:var(--dsl-g-accent);border-color:#0000}.V1MMBW_switchKnob{background:#fff;border-radius:50%;width:14px;height:14px;transition:left .2s;position:absolute;top:3px;left:3px;box-shadow:0 1px 2px #0000004d}.V1MMBW_switchOn .V1MMBW_switchKnob{left:19px}.V1MMBW_sliderRow{align-items:center;gap:var(--dsl-g-gap-md);width:100%;display:flex}.V1MMBW_sliderInput{min-width:0;accent-color:var(--dsl-g-accent);flex:1}.V1MMBW_sliderValue{text-align:right;min-width:44px;font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-data);color:var(--dsw-alias-label-primary)}.V1MMBW_textarea{background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);width:100%;color:var(--dsw-alias-label-primary);padding:var(--dsl-g-gap-sm) 12px;font-size:var(--dsl-g-font-title);resize:vertical;outline:none;font-family:inherit;line-height:1.5}.V1MMBW_textarea:focus{border-color:var(--dsl-g-accent);box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent)}.V1MMBW_accordion{border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);flex-direction:column;display:flex;overflow:hidden}.V1MMBW_accItem{border-bottom:1px solid var(--dsl-g-border)}.V1MMBW_accItem:last-child{border-bottom:none}.V1MMBW_accHead{justify-content:space-between;align-items:center;gap:var(--dsl-g-gap-sm);background:var(--dsw-alias-bg-layer-1);width:100%;color:var(--dsw-alias-label-primary);font-size:var(--dsl-g-font-title);cursor:pointer;border:none;padding:10px 14px;font-family:inherit;font-weight:600;line-height:1.5;display:flex}.V1MMBW_accChevron{color:var(--dsw-alias-label-tertiary)}.V1MMBW_accBody{padding:var(--dsl-g-gap-md) 14px;gap:var(--dsl-g-gap-sm);background:var(--dsw-alias-bg-base,#17171a);flex-direction:column;display:flex}.V1MMBW_copyChip{border:1px solid var(--dsl-g-border);background:var(--dsw-alias-bg-layer-1);color:var(--dsw-alias-label-primary);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);cursor:pointer;width:fit-content;padding:6px 14px;font-family:inherit;font-weight:600;transition:all .15s}.V1MMBW_copyChip:hover{border-color:var(--dsl-g-accent)}.V1MMBW_copyChipDone{border-color:var(--dsw-alias-state-success-primary,#3ecf8e);color:var(--dsw-alias-state-success-primary,#3ecf8e)}.V1MMBW_mermaid{padding:var(--dsl-g-gap-xs) 0;overflow-x:auto}.V1MMBW_mermaid svg{max-width:100%;height:auto}.V1MMBW_mermaidFallback{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_mermaidFallback pre{padding:var(--dsl-g-gap-sm) 10px;background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-meta);margin:0;overflow-x:auto}.V1MMBW_mermaidErr{color:var(--dsw-alias-state-error-primary,#ff6b6b);font-size:var(--dsl-g-font-meta)}.V1MMBW_mermaidHint{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-meta)}.V1MMBW_scene3dWrap{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_echartWrap{gap:var(--dsl-g-gap-sm);padding:var(--dsl-g-gap-md);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);flex-direction:column;display:flex}.V1MMBW_echartTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_echartCanvas{width:100%;min-height:0}.V1MMBW_echartHint{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-meta)}.V1MMBW_echartFallback{gap:var(--dsl-g-gap-sm);padding:var(--dsl-g-gap-md);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);flex-direction:column;display:flex}.V1MMBW_echartErr{color:var(--dsw-alias-state-error-primary,#ff6b6b);font-size:var(--dsl-g-font-meta)}.V1MMBW_scene3dTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:700}.V1MMBW_scene3dCanvas{border-radius:var(--dsl-g-radius-surface);background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);height:240px;overflow:hidden}.V1MMBW_scene3dCanvas canvas{display:block}.V1MMBW_scene3dHint{color:var(--dsw-alias-label-tertiary);font-size:var(--dsl-g-font-meta)}.V1MMBW_timeline{flex-direction:column;display:flex}.V1MMBW_tlItem{gap:var(--dsl-g-gap-md);display:flex}.V1MMBW_tlRail{flex-direction:column;flex-shrink:0;align-items:center;width:12px;display:flex}.V1MMBW_tlDot{background:var(--dsl-g-accent);width:10px;height:10px;box-shadow:0 0 0 3px color-mix(in srgb, var(--dsl-g-accent) var(--dsl-g-tint-strong), transparent);border-radius:50%;flex-shrink:0;margin-top:4px}.V1MMBW_tlLine{background:var(--dsl-g-border);flex:1;width:2px;margin:2px 0}.V1MMBW_tlBody{padding-bottom:var(--dsl-g-gap-lg);flex:1;min-width:0}.V1MMBW_tlHead{align-items:baseline;gap:var(--dsl-g-gap-md);display:flex}.V1MMBW_tlTitle{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.5}.V1MMBW_tlTime{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);white-space:nowrap;margin-left:auto}.V1MMBW_tlDesc{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);margin-top:2px;line-height:1.5}.V1MMBW_fileTree{font-family:var(--dsl-g-font-mono);font-size:var(--dsl-g-font-meta);flex-direction:column;display:flex}.V1MMBW_ftRow{align-items:center;gap:var(--dsl-g-gap-sm);padding:3px var(--dsl-g-gap-xs);border-radius:var(--dsl-g-radius-control);display:flex}.V1MMBW_ftRow:hover{background:var(--dsw-alias-bg-layer-1)}.V1MMBW_ftIcon{text-align:center;width:13px;font-size:10px;font-family:var(--dsl-g-font-mono);color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary));flex-shrink:0;line-height:1}.V1MMBW_ftIconDir{color:var(--dsl-g-accent);font-size:11px}.V1MMBW_ftName{color:var(--dsw-alias-label-secondary)}.V1MMBW_ftDir{color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_ftNameBtn{align-items:center;gap:var(--dsl-g-gap-sm);min-width:0;font-family:inherit;font-size:var(--dsl-g-font-body);cursor:default;text-align:left;background:0 0;border:none;padding:0;display:inline-flex}button.V1MMBW_ftNameBtn[aria-expanded]{cursor:pointer}.V1MMBW_ftNameBtn:focus-visible{outline:2px solid var(--dsl-g-accent);outline-offset:1px;border-radius:var(--dsl-g-radius-control)}.V1MMBW_breadcrumb{align-items:center;gap:var(--dsl-g-gap-xs);font-size:var(--dsl-g-font-title);flex-wrap:wrap;display:flex}.V1MMBW_bcItem{align-items:center;gap:var(--dsl-g-gap-xs);display:inline-flex}.V1MMBW_bcText{color:var(--dsw-alias-label-secondary);cursor:pointer}.V1MMBW_bcText:hover{color:var(--dsl-g-accent)}.V1MMBW_bcCurrent{color:var(--dsw-alias-label-primary);cursor:default;font-weight:600}.V1MMBW_bcSep{color:var(--dsw-alias-label-caption,var(--dsw-alias-label-tertiary))}@keyframes V1MMBW_genuiReveal{0%{opacity:0;transform:translateY(10px)}to{opacity:1;transform:translateY(0)}}.V1MMBW_reveal{animation:.45s cubic-bezier(.22,1,.36,1) both V1MMBW_genuiReveal}@media (prefers-reduced-motion:reduce){.V1MMBW_reveal{animation:none}}.V1MMBW_quiz{gap:var(--dsl-g-gap-md);padding:var(--dsl-g-gap-lg);background:var(--dsw-alias-bg-layer-1);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);flex-direction:column;display:flex}.V1MMBW_quizQuestion{font-size:var(--dsl-g-font-body);color:var(--dsw-alias-label-primary);font-weight:600;line-height:1.6}.V1MMBW_quizOptions{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_quizOpt{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:var(--dsw-alias-bg-base,#17171a);border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-label-secondary);cursor:pointer;padding:10px 14px;font-family:inherit;line-height:1.5;transition:border-color .15s,background .15s;display:flex}.V1MMBW_quizOpt:hover:not(:disabled){border-color:var(--dsl-g-accent);background:var(--dsl-g-accent-soft)}.V1MMBW_quizOpt:focus-visible,.V1MMBW_button:focus-visible,.V1MMBW_tab:focus-visible,.V1MMBW_accHead:focus-visible,.V1MMBW_copyChip:focus-visible,.V1MMBW_link:focus-visible,.V1MMBW_quizRetry:focus-visible,.V1MMBW_resetBtn:focus-visible,.V1MMBW_playBtn:focus-visible,.V1MMBW_bcText:focus-visible{outline:2px solid var(--dsl-g-accent);outline-offset:1px}.V1MMBW_quizOpt:disabled{cursor:default;opacity:.85}.V1MMBW_quizOptCorrect{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 40%, transparent);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-success-primary,#3ecf8e);padding:10px 14px;font-family:inherit;font-weight:600;line-height:1.5;display:flex}.V1MMBW_quizOptWrong{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) var(--dsl-g-tint), transparent);border:1px solid color-mix(in srgb, var(--dsw-alias-state-error-primary,#ff6b6b) 30%, transparent);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-error-primary,#ff6b6b);padding:10px 14px;font-family:inherit;font-weight:600;line-height:1.5;display:flex}.V1MMBW_quizOptReveal{align-items:center;gap:var(--dsl-g-gap-sm);text-align:left;background:color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) var(--dsl-g-tint), transparent);border:1px dashed color-mix(in srgb, var(--dsw-alias-state-success-primary,#3ecf8e) 40%, transparent);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-success-primary,#3ecf8e);padding:10px 14px;font-family:inherit;line-height:1.5;display:flex}.V1MMBW_quizMarker{text-align:center;width:16px;font-weight:700}.V1MMBW_quizResult{gap:var(--dsl-g-gap-sm);flex-direction:column;display:flex}.V1MMBW_quizCorrectMsg{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-success-primary,#3ecf8e);font-weight:600}.V1MMBW_quizWrongMsg{font-size:var(--dsl-g-font-title);color:var(--dsw-alias-state-error-primary,#ff6b6b);font-weight:600}.V1MMBW_quizFeedback{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-secondary);margin-top:3px;font-weight:400;line-height:1.5}.V1MMBW_quizExplanation{font-size:var(--dsl-g-font-meta);color:var(--dsw-alias-label-tertiary);padding:var(--dsl-g-gap-sm) 10px;border-top:1px solid var(--dsl-g-border);line-height:1.6}.V1MMBW_quizRetry{border:1px solid var(--dsl-g-border);width:fit-content;color:var(--dsw-alias-label-secondary);border-radius:var(--dsl-g-radius-control);font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;padding:6px 14px;font-family:inherit}.V1MMBW_quizRetry:hover{border-color:var(--dsl-g-accent);color:var(--dsl-g-accent)}.V1MMBW_tool{margin:4px 0}.V1MMBW_toolFallback{align-items:center;gap:var(--dsl-g-gap-md);padding:var(--dsl-g-gap-sm) 12px;border:1px solid var(--dsl-g-border);border-radius:var(--dsl-g-radius-surface);background:var(--dsw-alias-bg-layer-1,var(--dsw-alias-markdown-code-block));font-size:var(--dsl-g-font-title);display:flex}.V1MMBW_toolFallbackTitle{color:var(--dsw-alias-label-primary);font-weight:600}.V1MMBW_toolFallbackMeta{color:var(--dsw-alias-label-secondary);font-variant-numeric:tabular-nums;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.V1MMBW_panel{border:1px solid color-mix(in srgb, var(--dsw-alias-state-business-primary,#4f8ef7) 35%, transparent);background:var(--dsw-alias-bg-layer-1,#ffffff0a);border-radius:14px;margin:10px 14px 2px;overflow:hidden}.V1MMBW_panelHeader{align-items:center;display:flex}.V1MMBW_panelToggle{align-items:center;gap:var(--dsl-g-gap-sm);width:100%;color:inherit;font:inherit;font-size:var(--dsl-g-font-title);cursor:pointer;background:0 0;border:0;padding:9px 14px;display:flex}.V1MMBW_panelToggle:hover{background:#ffffff0a}.V1MMBW_panelBadge{padding:0 var(--dsl-g-gap-sm);background:color-mix(in srgb, var(--dsw-alias-state-business-primary,#4f8ef7) var(--dsl-g-tint-strong), transparent);color:var(--dsw-alias-state-business-primary,#7ba8ff);letter-spacing:.04em;border-radius:6px;flex:none;font-size:11px;font-weight:600;line-height:1.6}.V1MMBW_panelTitle{color:var(--dsw-alias-label-primary,#e6e6e6);text-overflow:ellipsis;white-space:nowrap;font-weight:600;overflow:hidden}.V1MMBW_panelChevron{color:var(--dsw-alias-label-secondary,#ffffff8c);font-size:var(--dsl-g-font-meta);margin-left:auto}.V1MMBW_panelBody{height:360px;padding:0 16px var(--dsl-g-gap-lg);overflow-y:auto}.V1MMBW_panelResizeHandle{cursor:ns-resize;touch-action:none;background:0 0;border-radius:3px;height:6px;transition:background .15s}.V1MMBW_panelResizeHandle:hover,.V1MMBW_panelResizeHandleActive{background:color-mix(in srgb, var(--dsw-alias-state-business-primary,#4f8ef7) 35%, transparent)}`,document.head.appendChild(e)}var S={accBody:`V1MMBW_accBody`,accChevron:`V1MMBW_accChevron`,accHead:`V1MMBW_accHead`,accItem:`V1MMBW_accItem`,accent:`V1MMBW_accent`,accordion:`V1MMBW_accordion`,avatar:`V1MMBW_avatar`,badge:`V1MMBW_badge`,banner:`V1MMBW_banner`,barCol:`V1MMBW_barCol`,barFill:`V1MMBW_barFill`,barLabel:`V1MMBW_barLabel`,barValue:`V1MMBW_barValue`,baseline:`V1MMBW_baseline`,bcCurrent:`V1MMBW_bcCurrent`,bcItem:`V1MMBW_bcItem`,bcSep:`V1MMBW_bcSep`,bcText:`V1MMBW_bcText`,block:`V1MMBW_block`,body:`V1MMBW_body`,breadcrumb:`V1MMBW_breadcrumb`,btnSent:`V1MMBW_btnSent`,button:`V1MMBW_button`,callout:`V1MMBW_callout`,calloutBody:`V1MMBW_calloutBody`,calloutError:`V1MMBW_calloutError`,calloutInfo:`V1MMBW_calloutInfo`,calloutSuccess:`V1MMBW_calloutSuccess`,calloutTitle:`V1MMBW_calloutTitle`,calloutWarning:`V1MMBW_calloutWarning`,caption:`V1MMBW_caption`,card:`V1MMBW_card`,cardTitle:`V1MMBW_cardTitle`,center:`V1MMBW_center`,chart:`V1MMBW_chart`,chartLabels:`V1MMBW_chartLabels`,chartPlot:`V1MMBW_chartPlot`,checkbox:`V1MMBW_checkbox`,col:`V1MMBW_col`,copyChip:`V1MMBW_copyChip`,copyChipDone:`V1MMBW_copyChipDone`,danger:`V1MMBW_danger`,divider:`V1MMBW_divider`,donut:`V1MMBW_donut`,donutLegend:`V1MMBW_donutLegend`,donutTotal:`V1MMBW_donutTotal`,donutTotalLabel:`V1MMBW_donutTotalLabel`,donutTrack:`V1MMBW_donutTrack`,down:`V1MMBW_down`,echartCanvas:`V1MMBW_echartCanvas`,echartErr:`V1MMBW_echartErr`,echartFallback:`V1MMBW_echartFallback`,echartHint:`V1MMBW_echartHint`,echartTitle:`V1MMBW_echartTitle`,echartWrap:`V1MMBW_echartWrap`,field:`V1MMBW_field`,fieldGroup:`V1MMBW_fieldGroup`,fieldLabel:`V1MMBW_fieldLabel`,fileTree:`V1MMBW_fileTree`,fill:`V1MMBW_fill`,ftDir:`V1MMBW_ftDir`,ftIcon:`V1MMBW_ftIcon`,ftIconDir:`V1MMBW_ftIconDir`,ftName:`V1MMBW_ftName`,ftNameBtn:`V1MMBW_ftNameBtn`,ftRow:`V1MMBW_ftRow`,full:`V1MMBW_full`,genuiReveal:`V1MMBW_genuiReveal`,ghost:`V1MMBW_ghost`,gradeAns:`V1MMBW_gradeAns`,gradeExp:`V1MMBW_gradeExp`,gradeItem:`V1MMBW_gradeItem`,gradeItemNo:`V1MMBW_gradeItemNo`,gradeItemOk:`V1MMBW_gradeItemOk`,gradeList:`V1MMBW_gradeList`,gradeQ:`V1MMBW_gradeQ`,gradeRight:`V1MMBW_gradeRight`,gradeScore:`V1MMBW_gradeScore`,gradeScoreLabel:`V1MMBW_gradeScoreLabel`,gradeScoreValue:`V1MMBW_gradeScoreValue`,gradeTag:`V1MMBW_gradeTag`,gradeWrap:`V1MMBW_gradeWrap`,grid:`V1MMBW_grid`,gridline:`V1MMBW_gridline`,groupValue:`V1MMBW_groupValue`,groupedBar:`V1MMBW_groupedBar`,groupedBars:`V1MMBW_groupedBars`,groupedFill:`V1MMBW_groupedFill`,h1:`V1MMBW_h1`,h2:`V1MMBW_h2`,h3:`V1MMBW_h3`,input:`V1MMBW_input`,jsonScalar:`V1MMBW_jsonScalar`,keyvalue:`V1MMBW_keyvalue`,kvKey:`V1MMBW_kvKey`,kvRow:`V1MMBW_kvRow`,kvValue:`V1MMBW_kvValue`,li:`V1MMBW_li`,liDesc:`V1MMBW_liDesc`,liTitle:`V1MMBW_liTitle`,lineChart:`V1MMBW_lineChart`,lineDot:`V1MMBW_lineDot`,lineGrid:`V1MMBW_lineGrid`,lineGridAxis:`V1MMBW_lineGridAxis`,lineLabels:`V1MMBW_lineLabels`,linePath:`V1MMBW_linePath`,lineTick:`V1MMBW_lineTick`,link:`V1MMBW_link`,linkText:`V1MMBW_linkText`,list:`V1MMBW_list`,mermaid:`V1MMBW_mermaid`,mermaidErr:`V1MMBW_mermaidErr`,mermaidFallback:`V1MMBW_mermaidFallback`,mermaidHint:`V1MMBW_mermaidHint`,muted:`V1MMBW_muted`,panel:`V1MMBW_panel`,panelBadge:`V1MMBW_panelBadge`,panelBody:`V1MMBW_panelBody`,panelChevron:`V1MMBW_panelChevron`,panelHeader:`V1MMBW_panelHeader`,panelResizeHandle:`V1MMBW_panelResizeHandle`,panelResizeHandleActive:`V1MMBW_panelResizeHandleActive`,panelTitle:`V1MMBW_panelTitle`,panelToggle:`V1MMBW_panelToggle`,playBtn:`V1MMBW_playBtn`,primary:`V1MMBW_primary`,progress:`V1MMBW_progress`,progressRow:`V1MMBW_progressRow`,quiz:`V1MMBW_quiz`,quizCorrectMsg:`V1MMBW_quizCorrectMsg`,quizExplanation:`V1MMBW_quizExplanation`,quizFeedback:`V1MMBW_quizFeedback`,quizMarker:`V1MMBW_quizMarker`,quizOpt:`V1MMBW_quizOpt`,quizOptCorrect:`V1MMBW_quizOptCorrect`,quizOptReveal:`V1MMBW_quizOptReveal`,quizOptWrong:`V1MMBW_quizOptWrong`,quizOptions:`V1MMBW_quizOptions`,quizQuestion:`V1MMBW_quizQuestion`,quizResult:`V1MMBW_quizResult`,quizRetry:`V1MMBW_quizRetry`,quizWrongMsg:`V1MMBW_quizWrongMsg`,radio:`V1MMBW_radio`,resetBtn:`V1MMBW_resetBtn`,reveal:`V1MMBW_reveal`,row:`V1MMBW_row`,scene3dCanvas:`V1MMBW_scene3dCanvas`,scene3dHint:`V1MMBW_scene3dHint`,scene3dTitle:`V1MMBW_scene3dTitle`,scene3dWrap:`V1MMBW_scene3dWrap`,select:`V1MMBW_select`,sliderInput:`V1MMBW_sliderInput`,sliderRow:`V1MMBW_sliderRow`,sliderValue:`V1MMBW_sliderValue`,small:`V1MMBW_small`,spacer:`V1MMBW_spacer`,stat:`V1MMBW_stat`,statDelta:`V1MMBW_statDelta`,statLabel:`V1MMBW_statLabel`,statValue:`V1MMBW_statValue`,step:`V1MMBW_step`,stepActive:`V1MMBW_stepActive`,stepContent:`V1MMBW_stepContent`,stepDesc:`V1MMBW_stepDesc`,stepDone:`V1MMBW_stepDone`,stepMarker:`V1MMBW_stepMarker`,stepTitle:`V1MMBW_stepTitle`,steps:`V1MMBW_steps`,submit:`V1MMBW_submit`,submitHint:`V1MMBW_submitHint`,submitRow:`V1MMBW_submitRow`,success:`V1MMBW_success`,switch:`V1MMBW_switch`,switchKnob:`V1MMBW_switchKnob`,switchLabel:`V1MMBW_switchLabel`,switchOn:`V1MMBW_switchOn`,switchRow:`V1MMBW_switchRow`,tab:`V1MMBW_tab`,tabActive:`V1MMBW_tabActive`,tabBar:`V1MMBW_tabBar`,table:`V1MMBW_table`,tableWrap:`V1MMBW_tableWrap`,tabs:`V1MMBW_tabs`,text:`V1MMBW_text`,textarea:`V1MMBW_textarea`,thSort:`V1MMBW_thSort`,thSortMark:`V1MMBW_thSortMark`,timeline:`V1MMBW_timeline`,tlBody:`V1MMBW_tlBody`,tlDesc:`V1MMBW_tlDesc`,tlDot:`V1MMBW_tlDot`,tlHead:`V1MMBW_tlHead`,tlItem:`V1MMBW_tlItem`,tlLine:`V1MMBW_tlLine`,tlRail:`V1MMBW_tlRail`,tlTime:`V1MMBW_tlTime`,tlTitle:`V1MMBW_tlTitle`,tool:`V1MMBW_tool`,toolFallback:`V1MMBW_toolFallback`,toolFallbackMeta:`V1MMBW_toolFallbackMeta`,toolFallbackTitle:`V1MMBW_toolFallbackTitle`,track:`V1MMBW_track`,up:`V1MMBW_up`,warn:`V1MMBW_warn`,wrap:`V1MMBW_wrap`};let C=`dsh.genui.interaction`;function w(){return{order:[],blocks:{}}}function T(){try{let e=localStorage.getItem(C);if(e===null)return w();let t=JSON.parse(e);return!Array.isArray(t.order)||typeof t.blocks!=`object`||t.blocks===null?w():{order:t.order.filter(e=>typeof e==`string`),blocks:t.blocks}}catch{return w()}}function te(e){try{localStorage.setItem(C,JSON.stringify(e))}catch{}}function ne(e){return e===``?null:T().blocks[e]??null}function re(e,t){if(e===``)return;let n=T(),r=n.order.filter(t=>t!==e);r.unshift(e);let i={...n.blocks,[e]:t};for(;r.length>200;){let e=r.pop();e!==void 0&&delete i[e]}te({order:r,blocks:i})}function ie(e){let t=5381;for(let n=0;n>>0;return t.toString(36)}function ae(e,t,n){return`f:${e}:${String(t)}:${ie(n)}`}function oe(e,t){return`p:${e}:${ie(t)}`}function se(e,t){return`t:${e}:${t}`}let E={maxDepth:8,maxNodes:200,maxString:2e3,maxCode:12e3,maxMermaid:8e3,maxGridCols:12,maxTabs:12,maxAccordionItems:24,maxListItems:50,maxOptions:50,maxTableRows:50,maxTableCols:12,maxChartPoints:60,maxPlotSeries:8,maxPlotParams:6,maxMeshes:5,maxQuizOptions:8,maxSteps:24,maxTimelineItems:24,maxBreadcrumbItems:12,maxKeyValuePairs:24,maxTreeDepth:6,maxEChartOptionDepth:10};function ce(e,t){return typeof e==`string`&&t.includes(e)}function D(e,t){return typeof e==`string`?e.slice(0,t):void 0}let le=/^(?:#[\da-fA-F]{3,8}|rgba?\([^)]{0,64}\)|hsla?\([^)]{0,64}\)|var\(--dsw-[\w-]+(?:,\s*#[0-9a-fA-F]{3,8})?\))$/;function O(e){if(typeof e!=`string`)return;let t=e.trim();return t.length<=64&&le.test(t)?t:void 0}function ue(e){if(typeof e!=`string`)return;let t=e.trim();if(!(t.length>2048))return/^https?:\/\//i.test(t)||/^mailto:[^@\s]+@[^@\s]+$/i.test(t)?t:void 0}function k(e,t,n){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,e)):void 0}function A(e,t,n){return typeof e==`number`&&Number.isFinite(e)?Math.min(n,Math.max(t,Math.trunc(e))):void 0}function j(e,t){return ce(e,t)?e:void 0}function M(e){return typeof e==`object`&&e&&!Array.isArray(e)?e:void 0}function N(e,t){return t===void 0?{}:{[e]:t}}let de=[`h1`,`h2`,`h3`,`body`,`muted`,`caption`],fe=[`primary`,`danger`,`success`,`ghost`],pe=[`success`,`warn`,`danger`,`accent`],me=[`text`,`email`,`password`],he=[`info`,`success`,`warning`,`error`],ge=[`bars`,`line`,`donut`],_e=[`line`,`area`,`scatter`],ve=[`box`,`sphere`,`cone`,`cylinder`,`torus`],ye=[`file`,`dir`],be=[`bar`,`line`,`area`,`pie`,`scatter`];function P(e,t,n){if(!Array.isArray(e))return[];let r=[];for(let i of e){if(t.remaining<=0)break;--t.remaining;let e=xe(i,t,n);e!==null&&r.push(e)}return r}function xe(e,t,n){if(n>E.maxDepth)return null;let r=M(e);if(r===void 0)return null;let i=r.type;if(typeof i!=`string`)return null;switch(i){case`text`:{let e=D(r.content,E.maxString);return e===void 0?null:{type:`text`,content:e,...N(`size`,j(r.size,de)),...N(`center`,r.center===!0||void 0)}}case`row`:return{type:`row`,items:P(r.items,t,n+1),...N(`wrap`,r.wrap===!0||void 0),...N(`spacer`,r.spacer===!0||void 0)};case`col`:return{type:`col`,items:P(r.items,t,n+1),...N(`gap`,k(r.gap,0,96))};case`grid`:return{type:`grid`,cols:A(r.cols,1,E.maxGridCols)??1,items:P(r.items,t,n+1)};case`card`:return{type:`card`,items:P(r.items,t,n+1),...N(`title`,D(r.title,E.maxString))};case`button`:{let e=D(r.label,E.maxString);return e===void 0?null:{type:`button`,label:e,...N(`tone`,j(r.tone,fe)),...N(`full`,r.full===!0||void 0),...N(`small`,r.small===!0||void 0),...N(`icon`,D(r.icon,64)),...N(`action`,D(r.action,200))}}case`input`:return{type:`input`,...N(`label`,D(r.label,E.maxString)),...N(`placeholder`,D(r.placeholder,E.maxString)),...N(`value`,D(r.value,E.maxString)),...N(`inputType`,j(r.inputType,me)),...N(`action`,D(r.action,200)),...N(`id`,D(r.id,200))};case`select`:{let e=F(r.options,E.maxOptions,E.maxString);return e===void 0?null:{type:`select`,options:e,...N(`label`,D(r.label,E.maxString)),...N(`action`,D(r.action,200)),...N(`selected`,A(r.selected,0,e.length-1)),...N(`id`,D(r.id,200))}}case`checkbox`:{let e=D(r.label,E.maxString);return e===void 0?null:{type:`checkbox`,label:e,...N(`checked`,r.checked===!0||void 0),...N(`action`,D(r.action,200))}}case`link`:{let e=D(r.label,E.maxString);return e===void 0?null:{type:`link`,label:e,...N(`href`,ue(r.href))}}case`badge`:{let e=D(r.label,E.maxString);return e===void 0?null:{type:`badge`,label:e,...N(`tone`,j(r.tone,pe)),...N(`icon`,D(r.icon,64))}}case`stat`:{let e=D(r.label,E.maxString),t=D(r.value,128);return e===void 0||t===void 0?null:{type:`stat`,label:e,value:t,...N(`delta`,D(r.delta,64))}}case`progress`:{let e=k(r.value,0,100);return e===void 0?null:{type:`progress`,value:e,...N(`label`,D(r.label,E.maxString)),...N(`valueLabel`,D(r.valueLabel,64))}}case`divider`:return{type:`divider`};case`spacer`:return{type:`spacer`};case`avatar`:{let e=D(r.name,64);return e===void 0?null:{type:`avatar`,name:e,...N(`color`,O(r.color))}}case`list`:{let e=Se(r.items,E.maxListItems);return e===void 0?null:{type:`list`,items:e}}case`table`:{let e=F(r.columns,E.maxTableCols,128),t=Ce(r.rows,E.maxTableRows,E.maxTableCols);return e===void 0||t===void 0?null:{type:`table`,columns:e,rows:t}}case`chart`:{let e=we(r.data,E.maxChartPoints),t=Array.isArray(r.series)?Te(r.series,E.maxPlotSeries,E.maxChartPoints):void 0;return e===void 0&&t===void 0?null:{type:`chart`,data:e??[],...N(`kind`,j(r.kind,ge)),...N(`series`,t)}}case`tabs`:{let e=Ee(r.tabs,t,n);return e===void 0?null:{type:`tabs`,tabs:e}}case`plot`:{let e=De(r.series,E.maxPlotSeries);return e===void 0?null:{type:`plot`,series:e,...N(`xMin`,k(r.xMin,-1e6,1e6)),...N(`xMax`,k(r.xMax,-1e6,1e6)),...N(`yMin`,k(r.yMin,-1e9,1e9)),...N(`yMax`,k(r.yMax,-1e9,1e9)),...N(`title`,D(r.title,E.maxString))}}case`callout`:{let e=D(r.content,E.maxString);return e===void 0?null:{type:`callout`,content:e,...N(`tone`,j(r.tone,he)),...N(`title`,D(r.title,E.maxString))}}case`steps`:{let e=Oe(r.steps);return e===void 0?null:{type:`steps`,steps:e,...N(`current`,A(r.current,0,e.length))}}case`keyvalue`:{let e=ke(r.pairs,E.maxKeyValuePairs);return e===void 0?null:{type:`keyvalue`,pairs:e}}case`diff`:{let e=Ae(r.diffs);return e===void 0?null:{type:`diff`,diffs:e}}case`json`:return`value`in r?{type:`json`,value:r.value}:null;case`code`:{let e=D(r.code,E.maxCode);return e===void 0?null:{type:`code`,code:e,...N(`lang`,D(r.lang,64))}}case`radio`:{let e=F(r.options,E.maxOptions,E.maxString);return e===void 0?null:{type:`radio`,options:e,...N(`label`,D(r.label,E.maxString)),...N(`selected`,A(r.selected,0,e.length-1)),...N(`action`,D(r.action,200)),...N(`group`,D(r.group,200)),...N(`answer`,typeof r.answer==`number`&&Number.isFinite(r.answer)&&r.answer>=0&&r.answer=t)break;typeof i==`string`&&r.push(i.slice(0,n))}return r}function Se(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;if(typeof r==`string`){n.push(r.slice(0,E.maxString));continue}let e=M(r),i=e===void 0?void 0:D(e.title,E.maxString);i!==void 0&&n.push({title:i,...N(`desc`,e===void 0?void 0:D(e.desc,E.maxString))})}return n}function Ce(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=t)break;if(!Array.isArray(i))continue;let e=[];for(let t of i){if(e.length>=n)break;typeof t==`string`?e.push(t.slice(0,256)):typeof t==`number`&&Number.isFinite(t)&&e.push(t)}e.length>0&&r.push(e)}return r}function we(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=M(r),i=e===void 0?void 0:D(e.label,128),a=e===void 0?void 0:k(e.value,-0xe8d4a51000,0xe8d4a51000);i!==void 0&&a!==void 0&&n.push({label:i,value:a,...N(`color`,e===void 0?void 0:O(e.color))})}return n}function Te(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=t)break;let e=M(i),a=e===void 0?void 0:D(e.label,128),o=e===void 0?void 0:we(e.data,n);a!==void 0&&o!==void 0&&r.push({label:a,data:o,...N(`color`,e===void 0?void 0:O(e.color))})}return r}function Ee(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=E.maxTabs)break;let e=M(i),a=e===void 0?void 0:D(e.label,128);a!==void 0&&e!==void 0&&r.push({label:a,items:P(e.items,t,n+1)})}return r}function De(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=M(r),i=e===void 0?void 0:D(e.expr,512);if(i===void 0||e===void 0)continue;let a=[];if(Array.isArray(e.params))for(let t of e.params){if(a.length>=E.maxPlotParams)break;let e=M(t),n=e===void 0?void 0:D(e.name,64),r=e===void 0?void 0:k(e.value,-1e9,1e9);n!==void 0&&r!==void 0&&a.push({name:n,value:r,...N(`min`,e===void 0?void 0:k(e.min,-1e9,1e9)),...N(`max`,e===void 0?void 0:k(e.max,-1e9,1e9)),...N(`step`,e===void 0?void 0:k(e.step,1e-9,1e9)),...N(`animateTo`,e===void 0?void 0:k(e.animateTo,-1e9,1e9)),...N(`durationMs`,e===void 0?void 0:k(e.durationMs,1,12e4)),...N(`loop`,e===void 0?void 0:e.loop===!0||void 0)})}n.push({expr:i,...N(`label`,D(e.label,128)),...N(`color`,O(e.color)),...N(`kind`,j(e.kind,_e)),...N(`params`,a.length>0?a:void 0)})}return n}function Oe(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=E.maxSteps)break;let e=M(n),r=e===void 0?void 0:D(e.title,256);r!==void 0&&t.push({title:r,...N(`desc`,e===void 0?void 0:D(e.desc,E.maxString))})}return t}function ke(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=M(r),i=e===void 0?void 0:D(e.key,256),a=e===void 0?void 0:D(e.value,E.maxString);i!==void 0&&a!==void 0&&n.push({key:i,value:a})}return n}function Ae(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=24)break;let e=M(n),r=e===void 0?void 0:D(e.path,1024),i=e===void 0?void 0:D(e.newText,2e4);if(r===void 0||i===void 0)continue;let a=e===void 0?void 0:e.oldText;t.push({path:r,newText:i,oldText:a===null||typeof a!=`string`?null:a.slice(0,2e4)})}return t}function je(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=E.maxAccordionItems)break;let e=M(i),a=e===void 0?void 0:D(e.title,256);a!==void 0&&e!==void 0&&r.push({title:a,items:P(e.items,t,n+1)})}return r}function Me(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=E.maxMeshes)break;let e=M(n),r=e===void 0?void 0:j(e.shape,ve);if(r===void 0)continue;let i=e===void 0?void 0:k(e.scale,-1e6,1e6)??I(e.scale),a=e===void 0?void 0:k(e.size,-1e6,1e6)??I(e.size);t.push({shape:r,...N(`color`,e===void 0?void 0:O(e.color)),...N(`position`,e===void 0?void 0:I(e.position)),...N(`rotation`,e===void 0?void 0:I(e.rotation)),...N(`scale`,i),...N(`size`,a)})}return t}function I(e){if(!Array.isArray(e)||e.length!==3)return;let[t,n,r]=e;if(!(typeof t!=`number`||!Number.isFinite(t)||typeof n!=`number`||!Number.isFinite(n)||typeof r!=`number`||!Number.isFinite(r)))return[Math.min(1e6,Math.max(-1e6,t)),Math.min(1e6,Math.max(-1e6,n)),Math.min(1e6,Math.max(-1e6,r))]}function Ne(e,t){if(!Array.isArray(e))return;let n=[];for(let r of e){if(n.length>=t)break;let e=M(r),i=e===void 0?void 0:D(e.title,256);i!==void 0&&n.push({title:i,...N(`desc`,e===void 0?void 0:D(e.desc,E.maxString)),...N(`time`,e===void 0?void 0:D(e.time,128))})}return n}function Pe(e,t){return Fe(e,t,E.maxTreeDepth)}function Fe(e,t,n){if(!Array.isArray(e))return;let r=[];for(let i of e){if(r.length>=t)break;let e=M(i),a=e===void 0?void 0:D(e.name,256);if(a===void 0)continue;let o=e!==void 0&&n>0&&Array.isArray(e.children)?Fe(e.children,t,n-1):void 0;r.push({name:a,...N(`type`,e===void 0?void 0:j(e.type,ye)),...N(`children`,o)})}return r}function Ie(e){if(!Array.isArray(e))return;let t=[];for(let n of e){if(t.length>=E.maxQuizOptions)break;let e=M(n),r=e===void 0?void 0:D(e.label,512);r!==void 0&&t.push({label:r,...N(`correct`,e===void 0?void 0:e.correct===!0||void 0),...N(`feedback`,e===void 0?void 0:D(e.feedback,E.maxString))})}return t}function Le(e,t){if(t>E.maxEChartOptionDepth)return;if(typeof e==`string`){let t=e.slice(0,E.maxString);return t.toLowerCase().includes(`url(`)?void 0:t}if(typeof e==`number`&&Number.isFinite(e)||typeof e==`boolean`)return e;if(e===null)return null;if(Array.isArray(e)){let n=e.map(e=>Le(e,t+1)).filter(e=>e!==void 0);return n.length>0?n:void 0}let n=M(e);if(n===void 0)return;let r={};for(let[e,i]of Object.entries(n)){let n=Le(i,t+1);n!==void 0&&(r[e]=n)}return Object.keys(r).length>0?r:void 0}function L(e){let t=M(e);if(t===void 0||!Array.isArray(t.items))return null;let n={remaining:E.maxNodes};return{...N(`title`,D(t.title,E.maxString)),...N(`gap`,k(t.gap,0,96)),...N(`panel`,t.panel===!0||void 0),...N(`append`,t.append===!0||void 0),items:P(t.items,n,0)}}function R(e,t=1/0){let n=0,r=e=>{if(Array.isArray(e))for(let i of e){if(n>=t)return;n+=1;let e=M(i);if(e!==void 0){if(e.type===`tabs`&&Array.isArray(e.tabs))for(let i of e.tabs){if(n>=t)return;let e=M(i);e!==void 0&&r(e.items)}else if(e.type===`accordion`&&Array.isArray(e.items))for(let i of e.items){if(n>=t)return;let e=M(i);e!==void 0&&r(e.items)}else e.type===`file-tree`&&Array.isArray(e.items)&&r(e.items)}}},i=M(e);return r(i===void 0?[]:i.items),n}let Re=[`var(--dsw-static-deepseek-400)`,`var(--dsw-static-deepseek-450)`,`var(--dsw-static-blue-450)`,`var(--dsw-static-green-400)`,`var(--dsw-static-amber-400)`,`var(--dsw-static-red-400)`,`var(--dsw-static-deepseek-300)`,`var(--dsw-static-neutral-bluish-400)`];function ze(e){let t=0;for(let n=0;n>>0;return Re[t%Re.length]}function Be({className:e,disabled:t,onClick:n,children:r}){let[i,a]=(0,m.useState)(!1),o=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{o.current!==null&&clearTimeout(o.current)},[]),(0,h.jsxs)(`button`,{type:`button`,className:e,disabled:t,onClick:n===void 0?void 0:()=>{n(),o.current!==null&&clearTimeout(o.current),a(!0),o.current=setTimeout(()=>a(!1),1400)},children:[r,i&&(0,h.jsx)(`span`,{className:S.btnSent,children:`✓ 已触发`})]})}let z=[`var(--dsw-static-deepseek-400)`,`var(--dsw-static-green-400)`,`var(--dsw-static-amber-400)`,`var(--dsw-static-red-400)`,`var(--dsw-static-blue-450)`,`var(--dsw-static-deepseek-450)`,`var(--dsw-static-neutral-bluish-400)`,`var(--dsw-static-deepseek-300)`],B=(e,t,n)=>n??(t>1?z[e%z.length]:void 0);function Ve({node:e}){let t=e.columns.slice(0,E.maxTableCols),n=e.rows.slice(0,E.maxTableRows),[r,i]=(0,m.useState)(null),a=r===null?n:[...n].sort((e,t)=>{let n=e[r.col],i=t[r.col],a=typeof n==`number`?n:n===``?NaN:Number(n),o=typeof i==`number`?i:i===``?NaN:Number(i);if(Number.isFinite(a)&&Number.isFinite(o)&&a!==o)return(a-o)*r.dir;let s=String(n??``),c=String(i??``);return(sc))*r.dir}),o=e=>{i(t=>t!==null&&t.col===e?t.dir===1?{col:e,dir:-1}:null:{col:e,dir:1})};return(0,h.jsx)(`div`,{className:S.tableWrap,children:(0,h.jsxs)(`table`,{className:S.table,children:[(0,h.jsx)(`thead`,{children:(0,h.jsx)(`tr`,{children:t.map((e,t)=>(0,h.jsx)(`th`,{"aria-sort":r!==null&&r.col===t?r.dir===1?`ascending`:`descending`:`none`,children:(0,h.jsxs)(`button`,{type:`button`,className:S.thSort,onClick:()=>o(t),children:[e,r!==null&&r.col===t&&(0,h.jsx)(`span`,{className:S.thSortMark,"aria-hidden":!0,children:r.dir===1?` ▲`:` ▼`})]})},t))})}),(0,h.jsx)(`tbody`,{children:a.map((e,n)=>(0,h.jsx)(`tr`,{children:e.slice(0,t.length).map((e,t)=>(0,h.jsx)(`td`,{children:String(e)},t))},n))})]})})}function He({chart:e}){let t=e.kind??`bars`;return t===`donut`?(0,h.jsx)(Ge,{chart:e}):t===`line`?(0,h.jsx)(We,{chart:e}):(0,h.jsx)(Ue,{chart:e})}function Ue({chart:e}){let t=e.series===void 0?void 0:e.series.slice(0,E.maxPlotSeries);if(t!==void 0&&t.length>0){let e=t[0].data.map(e=>e.label),n=Math.max(...t.flatMap(e=>e.data.map(e=>Number(e.value)||0)),1);return(0,h.jsxs)(`div`,{className:S.chart,children:[(0,h.jsxs)(`div`,{className:S.chartPlot,children:[[0,25,50,75].map(e=>(0,h.jsx)(`span`,{className:e===0?S.baseline:S.gridline,style:{bottom:`${e}%`}},e)),e.map((e,r)=>(0,h.jsx)(`div`,{className:S.barCol,children:(0,h.jsx)(`div`,{className:S.groupedBars,children:t.map((e,i)=>{let a=e.data[r],o=a===void 0?0:Number(a.value)||0,s=a===void 0?0:Math.min(Math.round(Math.max(0,o)/n*100),82);return(0,h.jsxs)(`div`,{className:S.groupedBar,title:a===void 0?e.label:`${e.label}: ${String(a.value)}`,children:[(0,h.jsx)(`span`,{className:S.groupValue,children:a===void 0?``:String(a.value)}),(0,h.jsx)(`div`,{className:S.groupedFill,style:{height:`${s}%`,background:B(i,t.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`}})]},i)})})},r))]}),(0,h.jsx)(`div`,{className:S.chartLabels,children:e.map(e=>(0,h.jsx)(`span`,{className:S.barLabel,children:e},e))})]})}let n=e.data.slice(0,E.maxChartPoints),r=Math.max(...n.map(e=>Number(e.value)||0),1);return(0,h.jsxs)(`div`,{className:S.chart,children:[(0,h.jsxs)(`div`,{className:S.chartPlot,children:[[0,25,50,75].map(e=>(0,h.jsx)(`span`,{className:e===0?S.baseline:S.gridline,style:{bottom:`${e}%`}},e)),n.map((e,t)=>{let n=Number(e.value)||0,i=Math.min(Math.round(Math.max(0,n)/r*100),85);return(0,h.jsxs)(`div`,{className:S.barCol,title:`${e.label}: ${String(e.value)}`,children:[(0,h.jsx)(`span`,{className:S.barValue,children:String(e.value)}),(0,h.jsx)(`div`,{className:S.barFill,style:{height:`${i}%`,...e.color===void 0?{}:{background:e.color}}})]},t)})]}),(0,h.jsx)(`div`,{className:S.chartLabels,children:n.map(e=>(0,h.jsx)(`span`,{className:S.barLabel,children:e.label},e.label))})]})}function We({chart:e}){let t=e.data.slice(0,E.maxChartPoints),n=Math.max(...t.map(e=>Number(e.value)||0),1),r=Math.min(...t.map(e=>Number(e.value)||0),0),i=n-r||1,a=Math.max(t.length-1,1),o=(e,t)=>[36+e/a*416,10+(1-(t-r)/i)*134],s=t.map((e,t)=>o(t,Number(e.value)||0)).map((e,t)=>`${t===0?`M`:`L`} ${e[0].toFixed(1)} ${e[1].toFixed(1)}`).join(` `),c=[0,1,2,3].map(e=>r+i*e/3),l=e=>{let t=Math.abs(e);return t>=1e3?`${(e/1e3).toFixed(t%1e3==0?0:1)}k`:Number.isInteger(e)?String(e):e.toFixed(1)};return(0,h.jsxs)(`div`,{className:S.lineChart,children:[(0,h.jsxs)(`svg`,{width:`100%`,viewBox:`0 0 460 150`,children:[c.map((e,t)=>{let n=10+(1-(e-r)/i)*134;return(0,h.jsxs)(`g`,{children:[(0,h.jsx)(`line`,{x1:36,x2:452,y1:n,y2:n,className:t===0?S.lineGridAxis:S.lineGrid}),(0,h.jsx)(`text`,{x:30,y:n+3,textAnchor:`end`,className:S.lineTick,children:l(e)})]},t)}),t.map((e,t)=>{let[n,r]=o(t,Number(e.value)||0);return(0,h.jsx)(`circle`,{cx:n,cy:r,r:3,className:S.lineDot,fill:e.color??void 0,children:(0,h.jsx)(`title`,{children:`${e.label}: ${String(e.value)}`})},t)}),(0,h.jsx)(`path`,{d:s,className:S.linePath})]}),(0,h.jsx)(`div`,{className:S.lineLabels,children:t.map((e,t)=>(0,h.jsx)(`span`,{className:S.barLabel,children:e.label},t))})]})}function Ge({chart:e}){let t=e.data.slice(0,E.maxChartPoints),n=t.map(e=>({...e,v:Math.max(0,Number(e.value)||0)})),r=n.reduce((e,t)=>e+t.v,0)||1,i=2*Math.PI*42,a=0;return(0,h.jsxs)(`div`,{className:S.donut,children:[(0,h.jsxs)(`svg`,{width:`120`,height:`120`,viewBox:`0 0 120 120`,children:[(0,h.jsx)(`circle`,{cx:`60`,cy:`60`,r:42,fill:`none`,strokeWidth:`14`,className:S.donutTrack}),n.map((e,n)=>{let o=e.v/r*i,s=(0,h.jsx)(`circle`,{cx:`60`,cy:`60`,r:42,fill:`none`,strokeWidth:`14`,style:{stroke:B(n,t.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`},strokeDasharray:`${o} ${i-o}`,strokeDashoffset:-a,transform:`rotate(-90 60 60)`,children:(0,h.jsx)(`title`,{children:`${e.label}: ${String(e.value)}`})},n);return a+=o,s}),(0,h.jsx)(`text`,{x:`60`,y:`58`,textAnchor:`middle`,className:S.donutTotal,children:r>=1e3?`${Math.round(r/100)/10}k`:String(r)}),(0,h.jsx)(`text`,{x:`60`,y:`74`,textAnchor:`middle`,className:S.donutTotalLabel,children:`合计`})]}),(0,h.jsx)(`div`,{className:S.donutLegend,children:t.map((e,n)=>(0,h.jsxs)(`span`,{className:S.legendItem,children:[(0,h.jsx)(`span`,{className:S.legendSwatch,style:{background:B(n,t.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`}}),e.label,` · `,String(e.value)]},n))})]})}function Ke({node:e,onAction:t,answers:n}){let r=e.action,i=e.group,a=i!==void 0,o=e.options.slice(0,E.maxOptions),s=i!==void 0&&n?.answers[i]!==void 0?o.indexOf(n.answers[i]):-1,[c,l]=(0,m.useState)(s>=0?s:e.selected??null),u=(0,m.useId)(),d=a&&n?.locked===!0;return(0,m.useEffect)(()=>{i!==void 0&&(n?.registerMeta(i,{label:e.label??i,options:o,answer:e.answer,explanation:e.explanation}),e.selected!==void 0&&o[e.selected]!==void 0&&n?.answers[i]===void 0&&n?.setAnswer(i,o[e.selected]))},[i,e.label,e.answer,e.explanation,e.options,e.selected]),(0,h.jsxs)(`div`,{className:S.fieldGroup,role:`radiogroup`,"aria-label":e.label,children:[e.label!==void 0&&(0,h.jsx)(`span`,{className:S.fieldLabel,children:e.label}),o.map((e,o)=>(0,h.jsxs)(`label`,{className:S.radio,children:[(0,h.jsx)(`input`,{type:`radio`,name:`genui-radio-${u}`,checked:c===o,disabled:d,onChange:()=>{l(o),a?n?.setAnswer(i,e):r!==void 0&&t!==void 0&&t(r,{type:`radio`,value:e})}}),(0,h.jsx)(`span`,{children:e})]},o))]})}function qe(e){if(e.answer!==void 0)return typeof e.answer==`number`?e.options[e.answer]:e.answer}function Je({node:e,onAction:t,answers:n}){let r=n?.answers??{},i=n?.fields??{},a=n?.meta??{},o=e.groups,s=Object.fromEntries(Object.entries(i).filter(([e,t])=>t.trim()!==``&&!n?.secretFields.has(e))),c=o===void 0?Math.max(Object.keys(r).length,Object.keys(s).length):o.filter(e=>r[e]!==void 0).length,l=o?.length??c,u=o??Object.keys(r),d=u.some(e=>a[e]?.answer!==void 0),f=n?.locked===!0,p=c>0&&c>=l&&(d||e.action!==void 0&&t!==void 0);if(f){let i=u.filter(e=>r[e]!==void 0&&a[e]?.answer!==void 0),s=i.filter(e=>r[e]===qe(a[e])).length;return(0,h.jsxs)(`div`,{className:S.gradeWrap,"data-genui-grade":!0,children:[(0,h.jsxs)(`div`,{className:S.gradeScore,children:[(0,h.jsxs)(`span`,{className:S.gradeScoreValue,children:[s,` / `,i.length]}),(0,h.jsxs)(`span`,{className:S.gradeScoreLabel,children:[`得分`,i.length{let t=r[e],n=a[e];if(t===void 0||n===void 0)return null;let i=qe(n);if(i===void 0)return(0,h.jsxs)(`div`,{className:S.gradeItem,children:[(0,h.jsx)(`span`,{className:S.gradeQ,children:n.label}),(0,h.jsxs)(`span`,{className:S.gradeAns,children:[`你的答案:`,t]})]},e);let o=t===i;return(0,h.jsxs)(`div`,{className:`${S.gradeItem} ${o?S.gradeItemOk:S.gradeItemNo}`,children:[(0,h.jsx)(`span`,{className:S.gradeQ,children:n.label}),(0,h.jsx)(`span`,{className:S.gradeTag,children:o?`✓`:`✗`}),(0,h.jsxs)(`span`,{className:S.gradeAns,children:[`你的答案:`,t,!o&&(0,h.jsxs)(`span`,{className:S.gradeRight,children:[` 正确答案:`,i]})]}),n.explanation!==void 0&&(0,h.jsx)(`span`,{className:S.gradeExp,children:n.explanation})]},e)})}),(0,h.jsx)(`button`,{type:`button`,className:`${S.button} ${S.ghost} ${S.submit}`,onClick:()=>{n?.clear(),e.resetAction!==void 0&&t!==void 0&&t(e.resetAction,{type:`submit-reset`,groups:o??Object.keys(r)})},children:`重新作答`})]})}return(0,h.jsxs)(`div`,{className:S.submitRow,children:[(0,h.jsx)(`button`,{type:`button`,className:`${S.button} ${S.primary} ${S.submit}`,disabled:!p,onClick:p?()=>{d?n?.setLocked(!0):e.action!==void 0&&t!==void 0&&t(e.action,{type:`submit`,answers:r,...Object.keys(s).length>0?{fields:s}:{},total:l,answered:c})}:void 0,children:e.label}),l>0&&(0,h.jsxs)(`span`,{className:S.submitHint,"aria-live":`polite`,children:[`已选 `,c,`/`,l]})]})}function Ye({node:e,onAction:t}){let[n,r]=(0,m.useState)(e.checked===!0),i=e.action;return(0,h.jsxs)(`label`,{className:S.switchRow,children:[(0,h.jsx)(`span`,{className:S.switchLabel,children:e.label}),(0,h.jsx)(`button`,{type:`button`,role:`switch`,"aria-checked":n,className:`${S.switch} ${n?S.switchOn:``}`,onClick:()=>{let e=!n;r(e),i!==void 0&&t!==void 0&&t(i,{type:`switch`,checked:e})},children:(0,h.jsx)(`span`,{className:S.switchKnob})})]})}function Xe({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,a=i!==void 0&&n?.fields[i]!==void 0?Number(n.fields[i]):NaN,o=Number.isFinite(a)?a:e.value??e.min??0,[s,c]=(0,m.useState)(o),l=(0,m.useRef)(!1);(0,m.useEffect)(()=>{l.current||(l.current=!0,i!==void 0&&n?.setField(i,String(o)))},[]);let u=e=>{r!==void 0&&t!==void 0&&t(r,{type:`slider`,value:e,...i===void 0?{}:{id:i}})};return(0,h.jsxs)(`label`,{className:S.sliderRow,children:[e.label!==void 0&&(0,h.jsx)(`span`,{className:S.fieldLabel,children:e.label}),(0,h.jsx)(`input`,{type:`range`,className:S.sliderInput,min:e.min,max:e.max,step:e.step??1,value:s,"aria-label":e.label,onChange:e=>{let t=Number(e.currentTarget.value);c(t),i!==void 0&&n?.setField(i,String(t)),u(t)}}),(0,h.jsx)(`span`,{className:S.sliderValue,children:Math.round(s*100)/100})]})}function Ze(){let e=(0,m.useRef)(!1),t=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{t.current!==null&&clearTimeout(t.current)},[]),{isComposing:()=>e.current,onCompositionStart:()=>{e.current=!0,t.current!==null&&(clearTimeout(t.current),t.current=null)},onCompositionEnd:()=>{t.current!==null&&clearTimeout(t.current),t.current=setTimeout(()=>{e.current=!1},10)}}}function Qe(e){let t=e.nativeEvent;return t.isComposing===!0||t.keyCode===229}function $e({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,a=e.options.slice(0,E.maxOptions),o=i!==void 0&&n?.fields[i]!==void 0?a.indexOf(n.fields[i]):-1,s=o>=0?a[o]:e.selected!==void 0&&a[e.selected]!==void 0?a[e.selected]:null,[c,l]=(0,m.useState)(s),u=(0,m.useRef)(!1);(0,m.useEffect)(()=>{u.current||(u.current=!0,i!==void 0&&s!==null&&n?.setField(i,s))},[]);let d=e=>{r!==void 0&&t!==void 0&&t(r,{type:`select`,value:e,...i===void 0?{}:{id:i}})};return(0,h.jsxs)(`label`,{className:S.field,children:[e.label!==void 0&&(0,h.jsx)(`span`,{children:e.label}),(0,h.jsxs)(`select`,{className:S.select,value:c??``,onChange:e=>{let t=e.currentTarget.value;l(t),i!==void 0&&n?.setField(i,t),d(t)},children:[c===null&&(0,h.jsx)(`option`,{value:``,hidden:!0,disabled:!0,children:`请选择…`}),a.map((e,t)=>(0,h.jsx)(`option`,{value:e,children:e},t))]})]})}function et({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,a=e.inputType===`password`,[o,s]=(0,m.useState)(()=>a?``:e.value??(i===void 0?``:n?.fields[i]??``)),c=(0,m.useRef)(o),l=e=>{r!==void 0&&t!==void 0&&(c.current=o,t(r,{type:`input`,value:o,...i===void 0?{}:{id:i},...e?{submit:!0}:{}}))},u=Ze(),d=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{d.current||(d.current=!0,!a&&i!==void 0&&e.value!==void 0&&e.value.trim()!==``&&n?.setField(i,e.value))},[]),(0,m.useEffect)(()=>{a&&i!==void 0&&n?.registerSecretField(i)},[a,i]),(0,h.jsxs)(`label`,{className:S.field,children:[e.label!==void 0&&(0,h.jsx)(`span`,{children:e.label}),(0,h.jsx)(`input`,{className:S.input,type:e.inputType??`text`,placeholder:e.placeholder,value:o,onChange:e=>{let t=e.currentTarget.value;s(t),i!==void 0&&n?.setField(i,t)},onBlur:()=>{o!==c.current&&l(!1)},onCompositionStart:u.onCompositionStart,onCompositionEnd:u.onCompositionEnd,onKeyDown:e=>{e.key===`Enter`&&(u.isComposing()||Qe(e)||(e.preventDefault(),l(!0)))}})]})}function tt({node:e,onAction:t,answers:n}){let r=e.action,i=e.id,[a,o]=(0,m.useState)(()=>e.value??(i===void 0?``:n?.fields[i]??``)),s=(0,m.useRef)(a),c=e=>{r!==void 0&&t!==void 0&&(s.current=a,t(r,{type:`textarea`,value:a,...i===void 0?{}:{id:i},...e?{submit:!0}:{}}))},l=Ze(),u=(0,m.useRef)(!1);return(0,m.useEffect)(()=>{u.current||(u.current=!0,i!==void 0&&e.value!==void 0&&e.value.trim()!==``&&n?.setField(i,e.value))},[]),(0,h.jsxs)(`label`,{className:S.field,children:[e.label!==void 0&&(0,h.jsx)(`span`,{children:e.label}),(0,h.jsx)(`textarea`,{className:S.textarea,placeholder:e.placeholder,rows:e.rows??4,value:a,onChange:e=>{let t=e.currentTarget.value;o(t),i!==void 0&&n?.setField(i,t)},onBlur:()=>{a!==s.current&&c(!1)},onCompositionStart:l.onCompositionStart,onCompositionEnd:l.onCompositionEnd,onKeyDown:e=>{!(e.metaKey||e.ctrlKey)||e.key!==`Enter`||l.isComposing()||Qe(e)||(e.preventDefault(),c(!0))}})]})}let nt={pi:Math.PI,e:Math.E,tau:Math.PI*2},rt={sin:Math.sin,cos:Math.cos,tan:Math.tan,asin:Math.asin,acos:Math.acos,atan:Math.atan,sqrt:Math.sqrt,cbrt:Math.cbrt,exp:Math.exp,log:Math.log10,ln:Math.log,abs:Math.abs,floor:Math.floor,ceil:Math.ceil,round:Math.round,min:Math.min,max:Math.max,pow:(e,t)=>e**+t};var V=class extends Error{pos;constructor(e,t){super(`SafeMath parse error at ${t}: ${e}`),this.pos=t}},it=class{src;vars;i=0;constructor(e,t){this.src=e,this.vars=t}parse(){let e=this.parseExpr();if(this.skipWs(),this.ie:e}parseExpr(){let e=this.parseTerm();for(;;){this.skipWs();let t=this.peek();if(t===`+`||t===`-`){this.i++;let n=this.parseTerm(),r=t,i=e;e=r===`+`?e=>this.asNum(i,e)+this.asNum(n,e):e=>this.asNum(i,e)-this.asNum(n,e)}else return e}}parseTerm(){let e=this.parseUnary();for(;;){this.skipWs();let t=this.peek();if(t===`*`||t===`/`||t===`%`){this.i++;let n=this.parseUnary(),r=t,i=e;e=r===`*`?e=>this.asNum(i,e)*this.asNum(n,e):r===`/`?e=>this.asNum(i,e)/this.asNum(n,e):e=>this.asNum(i,e)%this.asNum(n,e)}else return e}}parseUnary(){this.skipWs();let e=this.char();if(e===`-`||e===`+`){this.i++;let t=this.parseUnary();return e===`-`?e=>-this.asNum(t,e):e=>this.asNum(t,e)}return this.parsePower()}parsePower(){let e=this.parseAtom();if(this.skipWs(),this.peek()===`^`){this.i++;let t=this.parsePower(),n=e;return e=>this.asNum(n,e)**+this.asNum(t,e)}return e}parseAtom(){this.skipWs();let e=this.char();if(e===`(`){this.i++;let e=this.parseExpr();if(this.skipWs(),this.peek()!==`)`)throw new V(`expected )`,this.i);return this.i++,e}if(e>=`0`&&e<=`9`||e===`.`)return this.parseNumber();if(this.isIdentStart(e))return this.parseIdent();throw new V(`unexpected character '${e}'`,this.i)}parseNumber(){let e=this.i;for(;this.in(...r.map(t=>this.asNum(t,e)))}if(Object.hasOwn(nt,t))return nt[t];if(t===`x`)return e=>e;if(Object.hasOwn(this.vars,t)){let e=this.vars[t];return()=>e}if(/^[a-z]$/.test(t))return()=>1;throw new V(`unknown identifier '${t}'`,e)}asNum(e,t){return typeof e==`number`?e:e(t)}skipWs(){for(;this.in??(t>1?ct[e%ct.length]:void 0);function ut(e){let t=1/0,n=-1/0;for(let[,r]of e)rn&&(n=r);if(!Number.isFinite(t)||!Number.isFinite(n))return[-1,1];t===n&&(--t,n+=1);let r=(n-t)*.08;return[t-r,n+r]}function dt(e,t,n=5){let r=t-e;if(!Number.isFinite(r)||r<=0)return[];let i=10**Math.floor(Math.log10(r/n)),a=r/n/i,o=i*(a>=7.5?10:a>=3.5?5:a>=1.5?2:1),s=[];for(let n=Math.ceil(e/o)*o;n<=t+o*1e-9;n+=o)s.push(Math.round(n*1e9)/1e9);return s}function ft(e){return Math.abs(e)>=1e5||Math.abs(e)<.001&&e!==0?e.toExponential(1):String(Math.round(e*100)/100)}function pt({points:e,className:t,color:n}){let r=e.length>40?`${e.slice(0,16)}|${e.slice(-16)}`:e;return(0,h.jsx)(`polyline`,{points:e,className:t,style:n===void 0?void 0:{stroke:n}},r)}let mt=(0,m.memo)(function({series:e,xMin:t=-5,xMax:n=5,yMin:r,yMax:i,title:a}){let[o,s]=(0,m.useState)(()=>{let a={};for(let[t,n]of e.entries())for(let e of n.params??[])e!=null&&(a[`${t}:${e.name}`]=e.value);let[o,s]=ut(e.map((e,r)=>{let i={};for(let t of e.params??[])t!=null&&(i[t.name]=a[`${r}:${t.name}`]??t.value);return ot(e.expr,t,n,240,i)}).flatMap(e=>e));return{xMin:t,xMax:n,yMin:r??o,yMax:i??s}}),c=(0,m.useRef)(null),[l,u]=(0,m.useState)(()=>({})),d=(()=>{for(let[t,n]of e.entries())for(let e of n.params??[])if(e!=null&&e.animateTo!==void 0)return{si:t,param:e};return null})(),[f,p]=(0,m.useState)(!1),[ee,g]=(0,m.useState)(0),_=(0,m.useRef)(null);(0,m.useEffect)(()=>{if(!f||d===null)return;let e=l[`${d.si}:${d.param.name}`]??d.param.value,t=d.param.animateTo,n=d.param.durationMs??4e3,r=performance.now(),i=a=>{let o=Math.min(1,(a-r)/n),s=1-(1-o)**3,c=e+(t-e)*s;u(e=>({...e,[`${d.si}:${d.param.name}`]:c})),g(o),o<1?_.current=requestAnimationFrame(i):d.param.loop===!0?(u(e=>({...e,[`${d.si}:${d.param.name}`]:d.param.value})),g(0),_.current=requestAnimationFrame(()=>p(e=>e))):p(!1)};return _.current=requestAnimationFrame(i),()=>{_.current!==null&&cancelAnimationFrame(_.current)}},[f,d?.si,d?.param.name,d?.param.animateTo]);let v=o.xMin,y=o.xMax,b=o.yMin,x=o.yMax,S=e=>v+(e-34)/436*(y-v),C=e=>34+(e-v)/(y-v)*436,w=e=>14+(1-(e-b)/(x-b))*182,T=e.map((e,t)=>{let n={};for(let r of e.params??[])r!=null&&(n[r.name]=l[`${t}:${r.name}`]??r.value);return{series:e,points:ot(e.expr,v,y,240,n).map(([e,t])=>`${C(e).toFixed(2)},${w(t).toFixed(2)}`).join(` `)}}),te=dt(v,y),ne=dt(b,x),re=T.some(e=>e.points.length>1),ie=Number.isFinite(v)&&Number.isFinite(y)&&y>v&&Number.isFinite(x)&&Number.isFinite(b)&&x>b,ae=(e,t,n)=>{let r=lt(t,T.length,e.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`,i=e.kind??`line`;if(i===`scatter`){let e=n===``?[]:n.split(` `).map(e=>{let[t,n]=e.split(`,`);return[Number(t),Number(n)]});return(0,h.jsx)(`g`,{children:e.map(([e,t],n)=>(0,h.jsx)(`circle`,{cx:e,cy:t,r:2.6,className:H.scatterDot,style:{fill:r}},n))},t)}if(i===`area`){if(n===``)return(0,h.jsx)(pt,{points:``,className:H.line,color:r},t);let e=n.slice(0,n.indexOf(` `)).split(`,`)[0],i=n.slice(n.lastIndexOf(` `)+1).split(`,`)[0],a=w(b),o=`${e},${a.toFixed(2)} ${n} ${i},${a.toFixed(2)}`;return(0,h.jsx)(`polygon`,{points:o,className:H.area,style:{fill:r}},t)}return(0,h.jsx)(pt,{points:n,className:H.line,color:r},t)},oe=e=>{c.current={startX:e.clientX,startY:e.clientY,xMin:v,xMax:y},e.target.setPointerCapture?.(e.pointerId)},se=e=>{let t=c.current;if(t===null)return;let n=t.xMax-t.xMin,r=(t.startX-e.clientX)/436*n;s(e=>({xMin:t.xMin+r,xMax:t.xMax+r,yMin:e.yMin,yMax:e.yMax}))},E=()=>{c.current=null},ce=e=>{let t=y-v,n=t*(e.deltaY>0?1.15:1/1.15),r=e.currentTarget.getBoundingClientRect(),i=S((e.clientX-r.left)/r.width*480),a=i-(i-v)/t*n;s(e=>({xMin:a,xMax:a+n,yMin:e.yMin,yMax:e.yMax}))},D=e.some(e=>(e.params?.length??0)>0);return(0,h.jsxs)(`div`,{className:H.block,"data-genui-plot":!0,children:[a!==void 0&&(0,h.jsx)(`div`,{className:H.title,children:a}),re&&ie?(0,h.jsxs)(`svg`,{width:`100%`,viewBox:`0 0 480 220`,role:`img`,"aria-label":a??`function plot`,className:H.surface,onPointerDown:oe,onPointerMove:se,onPointerUp:E,onPointerLeave:E,onWheel:ce,children:[ne.map(e=>(0,h.jsxs)(`g`,{children:[(0,h.jsx)(`line`,{x1:34,x2:470,y1:w(e),y2:w(e),className:H.gridLine}),(0,h.jsx)(`text`,{x:28,y:w(e)+4,className:H.tick,textAnchor:`end`,children:ft(e)})]},`y${e}`)),te.map(e=>(0,h.jsxs)(`g`,{children:[(0,h.jsx)(`line`,{x1:C(e),x2:C(e),y1:14,y2:196,className:H.gridLine}),(0,h.jsx)(`text`,{x:C(e),y:210,className:H.tick,textAnchor:`middle`,children:ft(e)})]},`x${e}`)),(0,h.jsx)(`line`,{x1:34,x2:470,y1:196,y2:196,className:H.axis}),(0,h.jsx)(`line`,{x1:34,x2:34,y1:14,y2:196,className:H.axis}),T.map(({series:e,points:t},n)=>ae(e,n,t))]}):(0,h.jsx)(`div`,{className:H.empty,children:e.map((e,t)=>(0,h.jsxs)(`div`,{className:H.emptyRow,children:[e.expr,` — 无法绘制(表达式无效或范围非法)`]},t))}),D&&(0,h.jsxs)(`div`,{className:H.sliders,children:[(0,h.jsxs)(`div`,{className:H.slidersHead,children:[(0,h.jsx)(`span`,{className:H.slidersTitle,children:`参数调节`}),(0,h.jsx)(`button`,{type:`button`,className:H.resetBtn,onClick:()=>{p(!1);let t={};for(let[n,r]of e.entries())for(let e of r.params??[])e!=null&&(t[`${n}:${e.name}`]=e.value);u(t),g(0)},children:`↺ 重置`})]}),e.map((e,t)=>(e.params??[]).map(n=>{if(n==null)return null;let r=`${t}:${n.name}`,i=l[r]??n.value;return(0,h.jsxs)(`label`,{className:H.sliderRow,children:[(0,h.jsxs)(`span`,{className:H.sliderName,children:[e.label??e.expr,` · `,n.name]}),(0,h.jsx)(`input`,{type:`range`,className:H.slider,min:n.min??0,max:n.max??10,step:n.step??.1,value:i,onChange:e=>{let t=Number(e.currentTarget.value);u(e=>({...e,[r]:t}))}}),(0,h.jsx)(`span`,{className:H.sliderValue,children:Math.round(i*100)/100})]},r)}))]}),d!==null&&(0,h.jsxs)(`div`,{className:H.animBar,children:[(0,h.jsx)(`button`,{type:`button`,className:H.playBtn,onClick:()=>{f?p(!1):(u(e=>({...e,[`${d.si}:${d.param.name}`]:d.param.value})),g(0),p(!0))},children:f?`⏸ 暂停`:`▶ 播放动画`}),f&&(0,h.jsx)(`div`,{className:H.animTrack,children:(0,h.jsx)(`div`,{className:H.animFill,style:{width:`${ee*100}%`}})})]}),(e.length>1||D)&&(0,h.jsx)(`div`,{className:H.legend,children:e.map((t,n)=>(0,h.jsxs)(`span`,{className:H.legendItem,children:[(0,h.jsx)(`span`,{className:H.legendSwatch,style:{background:lt(n,e.length,t.color)??`var(--dsw-alias-state-business-primary, #4f8ef7)`}}),t.label??t.expr]},n))})]})});function ht(e){let t=window.__DSH_BOOT__?.entries?.find(e=>e.id===_t)?.rev;return`${vt}/${e}${t===void 0?``:`?rev=${t}`}`}function gt(e){let t=`${e}.js`,n=yt.get(t);if(n!==void 0)return n;let r=new Promise((n,r)=>{let i=document.createElement(`script`);i.src=ht(t),i.async=!0,i.onload=()=>{let i=(window.__GenuiAssets__??{})[e];if(i===void 0){r(Error(`genui asset '${t}' loaded but registered no '${e}' engine`));return}n(i)},i.onerror=()=>{r(Error(`genui asset '${t}' failed to load (host asset route missing?)`))},document.head.appendChild(i)});return yt.set(t,r),r}var _t,vt,yt,U=l((()=>{_t=`@omdsh-dev/dsh-genui`,vt=`/plugins/${_t}/assets`,yt=new Map}));function bt(e){if(St.test(e))throw Error(`mermaid output failed the sanitization check; refusing to render`)}function xt(e){let t=/^([A-Za-z]+)/.exec(e.trim())?.[1]??``;if(t!==`graph`&&t!==`flowchart`)return e;let n=e.replace(/`/g,``).replace(//gi,` `),r=/(--|==|-\.)(?!>)[ \t]*([^-\n]|-(?!--))*?[ \t]*(-->|==>|\.->)/g,i=[],a=n.replace(r,e=>(i.push(e),`\uE000${i.length-1}\uE001`)),o=/\|([^|\n]*[\[\]][^|\n]*)\|/g,s=[];return a.replace(o,(e,t)=>{let n=t.trim();return n.includes(`"`)?e:(s.push(n),`\uE002${s.length-1}\uE003`)}).replace(/([\[\(])([^\[\]\(\)\{\}"'\n]*)([\]\)])/g,(e,t,n,r)=>{let i=n.trim();return i===``?e:/[\u4e00-\u9fff\u3040-\u30ff\uac00-\ud7af]/.test(i)||/\s/.test(i)?`${t}"${i}"${r}`:e}).replace(/\uE000(\d+)\uE001/g,(e,t)=>i[Number(t)]??e).replace(/\uE002(\d+)\uE003/g,(e,t)=>{let n=s[Number(t)];return n===void 0?e:`|"${n}"|`})}var St,Ct=l((()=>{St=/bt,renderMermaid:()=>Tt,repairMermaidSource:()=>xt});async function Tt(e){return(await gt(`mermaid`)).renderMermaid(e)}var Et=l((()=>{U(),Ct()})),Dt=u({mountScene:()=>Ot});async function Ot(e,t){return(await gt(`three`)).mountScene(e,t)}var kt=l((()=>{U()}));let At={info:S.calloutInfo,success:S.calloutSuccess,warning:S.calloutWarning,error:S.calloutError};function jt({node:e}){let t=e.tone??`info`,n=At[t]??S.calloutInfo;return(0,h.jsxs)(`div`,{className:`${S.callout} ${n}`,"data-genui-callout":!0,children:[e.title!==void 0&&(0,h.jsx)(`div`,{className:S.calloutTitle,children:e.title}),(0,h.jsx)(`div`,{className:S.calloutBody,children:e.content})]})}function Mt({steps:e}){let t=e.steps.slice(0,E.maxSteps),n=e.current??t.length;return(0,h.jsx)(`ol`,{className:S.steps,children:t.map((e,t)=>{let r=t(0,h.jsxs)(`div`,{className:S.kvRow,children:[(0,h.jsx)(`dt`,{className:S.kvKey,children:e.key}),(0,h.jsx)(`dd`,{className:S.kvValue,children:e.value})]},t))})}function Pt({plot:e}){let t=e.series.slice(0,E.maxPlotSeries);return(0,h.jsx)(mt,{series:t.map(e=>({expr:e.expr,label:e.label,color:e.color,kind:e.kind,params:e.params})),xMin:e.xMin,xMax:e.xMax,yMin:e.yMin,yMax:e.yMax,title:e.title})}function Ft({node:e}){return(0,h.jsx)(p.DiffBlock,{diffs:e.diffs})}function It({node:e}){let t=e.value;return typeof t!=`object`||!t?(0,h.jsx)(`div`,{className:S.jsonScalar,children:String(t)}):(0,h.jsx)(p.JsonTree,{data:t,copyable:!0})}function Lt({node:e}){return(0,h.jsx)(p.CodeBlock,{code:e.code.slice(0,E.maxCode),lang:e.lang})}function Rt({tabs:e,onAction:t,depth:n=0,answers:r}){let[i,a]=(0,m.useState)(0),o=(0,m.useId)(),s=e.tabs.slice(0,E.maxTabs),c=s[i],l=e=>{let t=(e+s.length)%s.length;a(t),document.getElementById(`${o}-tab-${t}`)?.focus()};return(0,h.jsxs)(`div`,{className:S.tabs,children:[(0,h.jsx)(`div`,{className:S.tabBar,role:`tablist`,"aria-orientation":`horizontal`,onKeyDown:e=>{e.key===`ArrowRight`?(e.preventDefault(),l(i+1)):e.key===`ArrowLeft`?(e.preventDefault(),l(i-1)):e.key===`Home`?(e.preventDefault(),l(0)):e.key===`End`&&(e.preventDefault(),l(s.length-1))},children:s.map((e,t)=>(0,h.jsx)(`button`,{id:`${o}-tab-${t}`,type:`button`,role:`tab`,"aria-selected":t===i,"aria-controls":`${o}-panel-${t}`,tabIndex:t===i?0:-1,className:`${S.tab} ${t===i?S.tabActive:``}`,onClick:()=>a(t),children:e.label},t))}),c!==void 0&&(0,h.jsx)(`div`,{className:S.col,role:`tabpanel`,id:`${o}-panel-${i}`,"aria-labelledby":`${o}-tab-${i}`,children:c.items.map((e,i)=>G(e,i,t,n+1,r))})]})}function zt({node:e,onAction:t,depth:n=0,answers:r}){let[i,a]=(0,m.useState)(0),o=(0,m.useId)(),s=e.items.slice(0,E.maxAccordionItems);return(0,h.jsx)(`div`,{className:S.accordion,children:s.map((e,s)=>(0,h.jsxs)(`div`,{className:S.accItem,children:[(0,h.jsxs)(`button`,{type:`button`,className:S.accHead,id:`${o}-head-${s}`,"aria-expanded":i===s,"aria-controls":`${o}-body-${s}`,onClick:()=>a(i===s?null:s),children:[(0,h.jsx)(`span`,{className:S.accTitle,children:e.title}),(0,h.jsx)(`span`,{className:S.accChevron,children:i===s?`▾`:`▸`})]}),i===s&&(0,h.jsx)(`div`,{className:S.accBody,id:`${o}-body-${s}`,"aria-labelledby":`${o}-head-${s}`,children:e.items.map((e,i)=>G(e,i,t,n+1,r))})]},s))})}function Bt({node:e}){let[t,n]=(0,m.useState)(!1);return(0,h.jsx)(`button`,{type:`button`,className:`${S.copyChip} ${t?S.copyChipDone:``}`,onClick:()=>{navigator.clipboard?.writeText(e.text).catch(()=>{}),n(!0),setTimeout(()=>n(!1),1500)},children:t?`✓ 已复制`:e.label??`复制`})}function Vt({node:e}){let[t,n]=(0,m.useState)(null),[r,i]=(0,m.useState)(!1),a=e.code.slice(0,E.maxMermaid);return(0,m.useEffect)(()=>{let e=!0;return Promise.resolve().then(()=>(Et(),wt)).then(async t=>{try{let r=await t.renderMermaid(a);e&&n(r)}catch{e&&i(!0)}}),()=>{e=!1}},[a]),r?(0,h.jsxs)(`div`,{className:S.mermaidFallback,children:[(0,h.jsx)(`pre`,{children:a}),(0,h.jsx)(`div`,{className:S.mermaidErr,children:`图语法有误,已降级显示源码`})]}):t===null?(0,h.jsxs)(`div`,{className:S.mermaidFallback,children:[(0,h.jsx)(`pre`,{children:a}),(0,h.jsx)(`div`,{className:S.mermaidHint,children:`渲染中…`})]}):(0,h.jsx)(`div`,{className:S.mermaid,dangerouslySetInnerHTML:{__html:t},"data-genui-mermaid":!0})}function Ht({node:e}){let[t,n]=(0,m.useState)(`loading`),r=(0,m.useRef)(null),i=e.meshes.length>E.maxMeshes?{...e,meshes:e.meshes.slice(0,E.maxMeshes)}:e;return(0,m.useEffect)(()=>{let e=!0,t;return Promise.resolve().then(()=>(kt(),Dt)).then(async a=>{if(!(!e||r.current===null))try{t=await a.mountScene(r.current,i),e&&n(`ready`)}catch{e&&n(`error`)}}),()=>{e=!1,t?.()}},[i]),(0,h.jsxs)(`div`,{className:S.scene3dWrap,"data-genui-scene3d":!0,children:[e.title!==void 0&&(0,h.jsx)(`div`,{className:S.scene3dTitle,children:e.title}),(0,h.jsx)(`div`,{ref:r,className:S.scene3dCanvas}),t===`loading`&&(0,h.jsx)(`div`,{className:S.scene3dHint,children:`加载 3D 场景…`}),t===`error`&&(0,h.jsx)(`div`,{className:S.scene3dHint,children:`3D 渲染失败`})]})}function Ut({node:e}){let t=e.items.slice(0,E.maxTimelineItems);return(0,h.jsx)(`div`,{className:S.timeline,children:t.map((e,n)=>(0,h.jsxs)(`div`,{className:S.tlItem,children:[(0,h.jsxs)(`div`,{className:S.tlRail,children:[(0,h.jsx)(`span`,{className:S.tlDot}),n`${e}-${t}`,i=e=>{n(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})},a=(e,n,o)=>{if(n>E.maxTreeDepth)return null;let s=e.type===`dir`||e.children!==void 0&&e.children.length>0,c=r(n,o),l=s&&t.has(c);return(0,h.jsxs)(`div`,{className:S.ftRow,style:{paddingLeft:`${n*16}px`},children:[(0,h.jsxs)(`button`,{type:`button`,className:S.ftNameBtn,"aria-expanded":s?!l:void 0,onClick:s?()=>i(c):void 0,children:[(0,h.jsx)(`span`,{className:`${S.ftIcon} ${s?S.ftIconDir:``}`,"aria-hidden":!0,children:s?l?`▸`:`▾`:`·`}),(0,h.jsx)(`span`,{className:`${S.ftName} ${s?S.ftDir:``}`,children:e.name})]}),s&&!l&&(e.children??[]).map((e,t)=>a(e,n+1,t))]},c)};return(0,h.jsx)(`div`,{className:S.fileTree,children:e.items.slice(0,E.maxListItems).map((e,t)=>a(e,0,t))})}function Gt({node:e,onAction:t}){let[n,r]=(0,m.useState)(null),i=e.options.slice(0,E.maxQuizOptions),a=n!==null,o=n===null?void 0:i[n],s=o?.correct===!0,c=e.action;return(0,h.jsxs)(`div`,{className:S.quiz,"data-genui-quiz":!0,children:[(0,h.jsx)(`div`,{className:S.quizQuestion,children:e.question}),(0,h.jsx)(`div`,{className:S.quizOptions,children:i.map((i,o)=>{let s=n===o,l=a?s?i.correct===!0?S.quizOptCorrect:S.quizOptWrong:i.correct===!0?S.quizOptReveal:S.quizOpt:S.quizOpt;return(0,h.jsxs)(`button`,{type:`button`,className:l,disabled:a,onClick:()=>{r(o),c!==void 0&&t!==void 0&&t(c,{type:`quiz`,question:e.question,answer:i.label,correct:i.correct===!0})},children:[(0,h.jsx)(`span`,{className:S.quizMarker,children:a&&(i.correct===!0?`✓`:s?`✗`:``)}),i.label]},o)})}),a&&(0,h.jsxs)(`div`,{className:S.quizResult,"aria-live":`polite`,children:[(0,h.jsxs)(`div`,{className:s?S.quizCorrectMsg:S.quizWrongMsg,children:[s?`✓ 回答正确!`:`✗ 再想想看`,o?.feedback!==void 0&&(0,h.jsx)(`div`,{className:S.quizFeedback,children:o.feedback})]}),e.explanation!==void 0&&(0,h.jsx)(`div`,{className:S.quizExplanation,children:e.explanation}),(0,h.jsx)(`button`,{type:`button`,className:S.quizRetry,onClick:()=>r(null),children:`重新作答`})]})]})}function Kt({node:e}){let t=e.items.slice(0,E.maxBreadcrumbItems);return(0,h.jsx)(`nav`,{className:S.breadcrumb,"aria-label":`breadcrumb`,children:t.map((e,n)=>(0,h.jsxs)(`span`,{className:S.bcItem,children:[(0,h.jsx)(`span`,{className:`${S.bcText} ${n===t.length-1?S.bcCurrent:``}`,children:e}),nW(e.replace(`var(`,``).replace(`)`,``),t.accent)),r=e.data??[],i=e.series,a={color:n,textStyle:{color:t.labelSecondary,fontFamily:`inherit`},backgroundColor:`transparent`,grid:{left:48,right:16,top:24,bottom:32},tooltip:{trigger:`item`,backgroundColor:t.bgLayer1,borderColor:t.border,textStyle:{color:t.labelPrimary}}};switch(e.preset){case`pie`:return{...a,tooltip:{trigger:`item`,formatter:`{b}: {c} ({d}%)`,backgroundColor:t.bgLayer1,borderColor:t.border,textStyle:{color:t.labelPrimary}},legend:{bottom:0,textStyle:{color:t.labelTertiary}},series:[{type:`pie`,radius:[`40%`,`70%`],avoidLabelOverlap:!0,itemStyle:{borderRadius:6,borderColor:t.bgLayer1,borderWidth:2},label:{color:t.labelSecondary},data:r.map(e=>({name:e.label,value:e.value}))}]};case`scatter`:return{...a,tooltip:{trigger:`item`,backgroundColor:t.bgLayer1,borderColor:t.border,textStyle:{color:t.labelPrimary}},xAxis:{type:`value`,axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary},splitLine:{lineStyle:{color:t.border,opacity:.5}}},yAxis:{type:`value`,axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary},splitLine:{lineStyle:{color:t.border,opacity:.5}}},series:[{type:`scatter`,symbolSize:10,data:r.map(e=>[e.label,e.value])}]};case`area`:return{...a,tooltip:{trigger:`axis`,backgroundColor:t.bgLayer1,borderColor:t.border,textStyle:{color:t.labelPrimary}},xAxis:{type:`category`,data:r.map(e=>e.label),axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary}},yAxis:{type:`value`,axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary},splitLine:{lineStyle:{color:t.border,opacity:.5}}},series:(i??[{label:``,data:r}]).map(e=>({name:e.label,type:`line`,smooth:!0,areaStyle:{opacity:.15},data:e.data.map(e=>e.value)})),legend:i===void 0?void 0:{bottom:0,textStyle:{color:t.labelTertiary}}};case`line`:return{...a,tooltip:{trigger:`axis`,backgroundColor:t.bgLayer1,borderColor:t.border,textStyle:{color:t.labelPrimary}},xAxis:{type:`category`,data:r.map(e=>e.label),axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary}},yAxis:{type:`value`,axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary},splitLine:{lineStyle:{color:t.border,opacity:.5}}},series:(i??[{label:``,data:r}]).map(e=>({name:e.label,type:`line`,smooth:!0,showSymbol:!0,symbolSize:6,data:e.data.map(e=>e.value)})),legend:i===void 0?void 0:{bottom:0,textStyle:{color:t.labelTertiary}}};default:return{...a,tooltip:{trigger:`axis`,axisPointer:{type:`shadow`},backgroundColor:t.bgLayer1,borderColor:t.border,textStyle:{color:t.labelPrimary}},xAxis:{type:`category`,data:r.map(e=>e.label),axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary}},yAxis:{type:`value`,axisLine:{lineStyle:{color:t.border}},axisLabel:{color:t.labelTertiary},splitLine:{lineStyle:{color:t.border,opacity:.5}}},series:(i??[{label:``,data:r}]).map(e=>({name:e.label,type:`bar`,barMaxWidth:40,itemStyle:{borderRadius:[4,4,2,2]},data:e.data.map(e=>e.value)})),legend:i===void 0?void 0:{bottom:0,textStyle:{color:t.labelTertiary}}}}}function Xt({node:e}){let t=(0,m.useRef)(null),[n,r]=(0,m.useState)(`loading`),i=(0,m.useRef)(null);return(0,m.useEffect)(()=>{let n=!0,a=t.current;return a===null?void 0:(qt(a,e.option??Yt(e),{height:e.height??300}).then(e=>{if(!n){e.dispose();return}i.current=e,r(`ready`)}).catch(()=>{n&&r(`error`)}),()=>{n=!1,i.current?.dispose(),i.current=null})},[]),(0,m.useEffect)(()=>{if(n!==`ready`)return;let e=t.current;if(e===null)return;let r=new ResizeObserver(()=>{i.current?.resize()});return r.observe(e),()=>{r.disconnect()}},[n]),(0,m.useEffect)(()=>{if(n!==`ready`||i.current===null)return;let t=e.option??Yt(e);i.current.setOption(t,!0)},[e]),n===`error`?(0,h.jsxs)(`div`,{className:S.echartFallback,"data-genui-echart":!0,children:[(0,h.jsx)(`div`,{className:S.echartErr,children:`ECharts 渲染失败`}),e.title!==void 0&&(0,h.jsx)(`div`,{className:S.echartHint,children:e.title})]}):(0,h.jsxs)(`div`,{className:S.echartWrap,"data-genui-echart":!0,children:[e.title!==void 0&&(0,h.jsx)(`div`,{className:S.echartTitle,children:e.title}),(0,h.jsx)(`div`,{ref:t,className:S.echartCanvas,style:{height:`${e.height??300}px`}}),n===`loading`&&(0,h.jsx)(`div`,{className:S.echartHint,children:`加载图表…`})]})}let Zt=p.getGenuiComponent;function G(e,t,n,r=0,i){if(r>E.maxDepth)return null;switch(e.type){case`text`:{let n=e.size??`body`;return(0,h.jsx)(`div`,{className:`${S.text} ${S[n]}`+(e.center?` ${S.center}`:``),children:e.content},t)}case`row`:return(0,h.jsxs)(`div`,{className:S.row+(e.wrap?` ${S.wrap}`:``),children:[e.items.map((e,t)=>G(e,t,n,r+1,i)),e.spacer&&(0,h.jsx)(`div`,{className:S.spacer})]},t);case`col`:return(0,h.jsx)(`div`,{className:S.col,style:e.gap===void 0?void 0:{gap:`${e.gap}px`},children:e.items.map((e,t)=>G(e,t,n,r+1,i))},t);case`grid`:return(0,h.jsx)(`div`,{className:S.grid,style:{gridTemplateColumns:`repeat(${Math.max(1,e.cols)}, minmax(0, 1fr))`},children:e.items.map((e,t)=>G(e,t,n,r+1,i))},t);case`card`:return(0,h.jsxs)(`div`,{className:S.card,children:[e.title!==void 0&&(0,h.jsx)(`div`,{className:S.cardTitle,children:e.title}),e.items.map((e,t)=>G(e,t,n,r+1,i))]},t);case`button`:{let r=e.tone??``,i=`${S.button} ${S[r]||``}`+(e.full?` ${S.full}`:``)+(e.small?` ${S.small}`:``),a=e.action,o=a!==void 0&&n!==void 0;return(0,h.jsxs)(Be,{className:i,disabled:!o,onClick:o?()=>n(a,{type:`button`,label:e.label}):void 0,children:[e.icon!==void 0&&(0,h.jsxs)(`span`,{"aria-hidden":!0,children:[e.icon,` `]}),e.label]},t)}case`input`:return(0,h.jsx)(et,{node:e,onAction:n,answers:i},t);case`select`:return(0,h.jsx)($e,{node:e,onAction:n,answers:i},t);case`checkbox`:{let r=e.action;return(0,h.jsxs)(`label`,{className:S.checkbox,children:[(0,h.jsx)(`input`,{type:`checkbox`,defaultChecked:e.checked===!0,onChange:r!==void 0&&n!==void 0?e=>n(r,{type:`checkbox`,checked:e.currentTarget.checked}):void 0}),(0,h.jsx)(`span`,{children:e.label})]},t)}case`link`:{let n=e.href;return n===void 0?(0,h.jsx)(`span`,{className:S.linkText,children:e.label},t):(0,h.jsx)(`a`,{className:S.link,href:n,target:`_blank`,rel:`noopener noreferrer`,children:e.label},t)}case`badge`:{let n=e.tone??``;return(0,h.jsxs)(`span`,{className:`${S.badge} ${S[n]||``}`,children:[e.icon!==void 0&&(0,h.jsxs)(`span`,{"aria-hidden":!0,children:[e.icon,` `]}),e.label]},t)}case`stat`:{let n=e.delta!==void 0&&e.delta.startsWith(`-`);return(0,h.jsxs)(`div`,{className:S.stat,children:[(0,h.jsx)(`span`,{className:S.statLabel,children:e.label}),(0,h.jsx)(`span`,{className:S.statValue,children:e.value}),e.delta!==void 0&&(0,h.jsx)(`span`,{className:`${S.statDelta} ${n?S.down:S.up}`,children:e.delta})]},t)}case`progress`:{let n=Math.max(0,Math.min(100,Number(e.value)||0));return(0,h.jsxs)(`div`,{className:S.progress,role:`progressbar`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":n,"aria-label":e.label??e.valueLabel??void 0,children:[(e.label!==void 0||e.valueLabel!==void 0)&&(0,h.jsxs)(`div`,{className:S.progressRow,children:[(0,h.jsx)(`span`,{children:e.label}),e.valueLabel!==void 0&&(0,h.jsx)(`span`,{children:e.valueLabel})]}),(0,h.jsx)(`div`,{className:S.track,children:(0,h.jsx)(`div`,{className:S.fill,style:{width:`${n}%`}})})]},t)}case`divider`:return(0,h.jsx)(`hr`,{className:S.divider},t);case`list`:{let n=e.items.slice(0,E.maxListItems);return(0,h.jsx)(`div`,{className:S.list,children:n.map((e,t)=>(0,h.jsx)(`div`,{className:S.li,children:typeof e==`string`?(0,h.jsx)(`span`,{className:S.liTitle,children:e}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(`span`,{className:S.liTitle,children:e.title}),e.desc!==void 0&&(0,h.jsx)(`span`,{className:S.liDesc,children:e.desc})]})},t))},t)}case`table`:return(0,h.jsx)(Ve,{node:e},t);case`chart`:return(0,h.jsx)(He,{chart:e},t);case`tabs`:return(0,h.jsx)(Rt,{tabs:e,onAction:n,depth:r+1,answers:i},t);case`avatar`:return(0,h.jsx)(`div`,{className:S.avatar,style:{background:e.color??ze(e.name)},children:e.name.slice(0,1).toUpperCase()},t);case`spacer`:return(0,h.jsx)(`div`,{className:S.spacer},t);case`plot`:return(0,h.jsx)(Pt,{plot:e},t);case`callout`:return(0,h.jsx)(jt,{node:e},t);case`steps`:return(0,h.jsx)(Mt,{steps:e},t);case`keyvalue`:return(0,h.jsx)(Nt,{node:e},t);case`diff`:return(0,h.jsx)(Ft,{node:e},t);case`json`:return(0,h.jsx)(It,{node:e},t);case`code`:return(0,h.jsx)(Lt,{node:e},t);case`radio`:return(0,h.jsx)(Ke,{node:e,onAction:n,answers:i},`${t}:r${i?.round??0}`);case`submit`:return(0,h.jsx)(Je,{node:e,onAction:n,answers:i},t);case`switch`:return(0,h.jsx)(Ye,{node:e,onAction:n},t);case`slider`:return(0,h.jsx)(Xe,{node:e,onAction:n,answers:i},t);case`textarea`:return(0,h.jsx)(tt,{node:e,onAction:n,answers:i},t);case`accordion`:return(0,h.jsx)(zt,{node:e,onAction:n,depth:r+1,answers:i},t);case`copy`:return(0,h.jsx)(Bt,{node:e},t);case`mermaid`:return(0,h.jsx)(Vt,{node:e},t);case`scene3d`:return(0,h.jsx)(Ht,{node:e},t);case`timeline`:return(0,h.jsx)(Ut,{node:e},t);case`file-tree`:return(0,h.jsx)(Wt,{node:e},t);case`breadcrumb`:return(0,h.jsx)(Kt,{node:e},t);case`quiz`:return(0,h.jsx)(Gt,{node:e,onAction:n},t);case`echart`:return(0,h.jsx)(Xt,{node:e},t);default:{let a=e,o=Zt?.(a.type);return o===void 0?null:(0,h.jsx)(o,{node:a,onAction:n,renderChildren:(e,t)=>e.map((e,a)=>G(e,Number(t)+a,n,r+1,i))},t)}}}function Qt(e){let t=(0,m.useRef)(null);return(0,m.useEffect)(()=>()=>{let e=t.current;if(e!==null){for(let t of e.values())clearTimeout(t);e.clear()}},[]),(0,m.useMemo)(()=>{if(e===void 0)return;let n=new Map;return t.current=n,(t,r)=>{let i=n.get(t);i!==void 0&&clearTimeout(i),n.set(t,setTimeout(()=>{n.delete(t),e(t,r)},300))}},[e])}function $t(e,t){return e===t||JSON.stringify(e)===JSON.stringify(t)}let en=(0,m.memo)(function({spec:e,stateKey:t}){let n=e.gap??16,r=Qt(v()),[i]=(0,m.useState)(()=>t===void 0?null:ne(t)),[a,o]=(0,m.useState)(i?.answers??{}),[s,c]=(0,m.useState)(i?.fields??{}),[l,u]=(0,m.useState)({}),[d,f]=(0,m.useState)(i?.locked===!0),[p,ee]=(0,m.useState)(0),[g,_]=(0,m.useState)(new Set),y=(0,m.useCallback)((e,t)=>{o(n=>n[e]===t?n:{...n,[e]:t})},[]),b=(0,m.useCallback)((e,t)=>{c(n=>{if(t.trim()===``){if(!(e in n))return n;let t={...n};return delete t[e],t}return n[e]===t?n:{...n,[e]:t}})},[]),x=(0,m.useCallback)(e=>{_(t=>t.has(e)?t:new Set(t).add(e))},[]),C=(0,m.useCallback)((e,t)=>{u(n=>{let r=n[e];return r!==void 0&&r.label===t.label&&r.answer===t.answer&&r.explanation===t.explanation?n:{...n,[e]:t}})},[]),w=(0,m.useCallback)(()=>{o({}),f(!1),ee(e=>e+1)},[]),T=(0,m.useMemo)(()=>({answers:a,fields:s,secretFields:g,meta:l,locked:d,round:p,setAnswer:y,setField:b,registerSecretField:x,registerMeta:C,clear:w,setLocked:f}),[a,s,g,l,d,p,y,b,x,C,w]);return(0,m.useEffect)(()=>{if(t===void 0)return;let e=setTimeout(()=>{let e=Object.fromEntries(Object.entries(s).filter(([e])=>!g.has(e)));re(t,{answers:a,locked:d,...Object.keys(e).length>0?{fields:e}:{}})},300);return()=>clearTimeout(e)},[t,a,d,s,g]),(0,h.jsxs)(`div`,{className:S.block,"data-genui":!0,children:[e.title!==void 0&&(0,h.jsx)(`div`,{className:S.banner,children:e.title}),(0,h.jsx)(`div`,{className:S.col,style:{gap:`${n}px`},children:e.items.map((e,t)=>(0,h.jsx)(`div`,{className:S.reveal,style:{animationDelay:`${Math.min(t*90,720)}ms`},children:G(e,t,r,0,T)},t))})]})},(e,t)=>e.stateKey===t.stateKey&&$t(e.spec,t.spec));function tn(e){if(typeof e!=`object`||!e)return!1;let t=e;return!(!Array.isArray(t.items)||t.title!==void 0&&typeof t.title!=`string`||t.gap!==void 0&&typeof t.gap!=`number`)}function nn(e){let t=[],n=[],r=e=>{n.length>=32&&n.shift(),n.push(e)},i=!1,a=!1,o=0;for(;ot.end-e.end);let s=[];for(let e of n)(s.length===0||s[s.length-1].end!==e.end)&&s.push(e);return{candidates:s.slice(0,32),scannedChars:o}}function rn(e){let t=``;for(let n=e.length-1;n>=0;n--)t+=e[n]===`{`?`}`:`]`;return t}function an(e){try{let t=JSON.parse(e);return tn(t)?t:null}catch{return null}}function on(e){let t=e.trim();if(t===``)return null;let n=an(t);if(n!==null)return n;let{candidates:r}=nn(t);for(let e of r){let n=an(t.slice(0,e.end)+e.closingSuffix);if(n!==null)return n}return null}let K={maxNodes:200,maxAppends:200},sn=new Map,q=new Set;function cn(){return{ops:new Map,seen:new Map,overflow:null,local:null,localBarrier:-1,replayBarrier:-1,maxSeenSeq:-1,snapshot:null}}let ln=`dsh.genui.panel`;function un(){try{let e=localStorage.getItem(ln);if(e===null)return{order:[],sessions:{}};let t=JSON.parse(e);return!Array.isArray(t.order)||typeof t.sessions!=`object`||t.sessions===null?{order:[],sessions:{}}:{order:t.order.filter(e=>typeof e==`string`),sessions:t.sessions}}catch{return{order:[],sessions:{}}}}function dn(e,t){try{let n=un(),r=n.order.filter(t=>t!==e);r.unshift(e);let i={...n.sessions,[e]:t};for(;r.length>50;){let e=r.pop();e!==void 0&&delete i[e]}localStorage.setItem(ln,JSON.stringify({order:r,sessions:i}))}catch{}}function fn(e){let t=sn.get(e);if(t!==void 0)return t;let n=cn();try{let t=un().sessions[e];t!==void 0&&(n={ops:new Map,seen:new Map,overflow:null,local:t.local??null,localBarrier:t.localBarrier??-1,replayBarrier:t.maxSeenSeq??-1,maxSeenSeq:t.maxSeenSeq??-1,snapshot:t.snapshot??null})}catch{}return sn.set(e,n),n}function J(e,t){for(let n=0;n<3;n++){let r=e[n]-t[n];if(r!==0)return r}return 0}function pn(e,t){if(t!==null&&(t.order[0]<=e.localBarrier||t.order[0]<=e.replayBarrier||e.seen.has(t.sourceId)||e.overflow!==null&&e.overflow.sourceId===t.sourceId||t.mode===`append`&&e.overflow!==null&&J(t.order,e.overflow.order)>0))return null;let n=[...e.ops.values()].filter(t=>t.order[0]>e.localBarrier&&t.order[0]>e.replayBarrier);t!==null&&n.push(t),n.sort((e,t)=>J(e.order,t.order));let r=0;for(let e=0;ec&&(c=t.order[0]),t.mode===`replace`){if(R(t.spec,K.maxNodes+1)>K.maxNodes){(a===null||J(t.order,a.order)<0)&&(a=t);continue}a=null,i=t.spec,s.length=0,o=0,s.push(t);continue}let r=Cn(i,t.spec);if(o>=K.maxAppends||R(r,K.maxNodes+1)>K.maxNodes){(a===null||J(t.order,a.order)<0)&&(a=t);continue}i=r,o+=1,s.push(t)}return t!==null&&s.length===e.ops.size&&s.every(t=>e.ops.get(t.sourceId)?.mode===t.mode)&&(a===null&&e.overflow===null||a!==null&&e.overflow!==null&&a.sourceId===e.overflow.sourceId)?null:{snapshot:i,kept:s,overflow:a,maxSeenSeq:c}}function mn(e,t,n){e.snapshot=t.snapshot,e.overflow=t.overflow,e.maxSeenSeq=t.maxSeenSeq,e.ops=new Map(t.kept.map(e=>[e.sourceId,e]));for(let n of t.kept)e.seen.set(n.sourceId,n.order);t.overflow!==null&&e.seen.set(t.overflow.sourceId,t.overflow.order),dn(n,{snapshot:e.snapshot,local:e.local,localBarrier:e.localBarrier,maxSeenSeq:e.maxSeenSeq})}function hn(e,t){let n=fn(e),r=pn(n,t);if(r===null)return n.seen.has(t.sourceId)||n.overflow?.sourceId===t.sourceId?`idempotent`:(n.overflow!==null&&t.mode===`append`&&J(t.order,n.overflow.order)>0||gn(e,t,n),`blocked`);let i=r.overflow!==null&&r.overflow.sourceId===t.sourceId?`overflow`:`accepted`,a=n.snapshot!==r.snapshot;if(mn(n,r,e),a)for(let e of q)e();return i}let Y=new Set;function gn(e,t,n){let r=`${e}\u0000${t.sourceId}`;Y.has(r)||(Y.add(r),console.warn(`[genui] 面板操作被重放屏障拒绝(source ${t.sourceId},order[0]=${t.order[0]} ≤ replayBarrier ${n.replayBarrier} / localBarrier ${n.localBarrier})。历史消息重放被拒是预期行为;若是刚发送的新消息,说明消息序号推导异常,请报告。`))}function _n(e,t){let n=fn(e),r=n.maxSeenSeq;if(n.local!==t||n.localBarrier!==r){n.local=t,n.localBarrier=r,mn(n,pn(n,null),e);for(let e of q)e()}}let X=new Set;function vn(e,t){let n=`${e}\u0000${t}`;X.has(n)||(X.add(n),console.warn(`[genui] 面板已到节点/操作上限(${K.maxNodes} 节点、${K.maxAppends} 条追加),本次 append 被拒绝;请让模型发送 replace 更新面板。`))}function yn(e){let t=sn.delete(e),n=Z.delete(e),r=`${e}\u0000`;for(let e of X)e.startsWith(r)&&X.delete(e);for(let e of Y)e.startsWith(r)&&Y.delete(e);if(!(!t&&!n)){for(let e of q)e();for(let e of Q)e()}}function bn(e){return fn(e).snapshot}function xn(e){return q.add(e),()=>{q.delete(e)}}function Sn(e){if(e.items.length!==1)return null;let t=e.items[0];return t?.type!==`tabs`||!Array.isArray(t.tabs)?null:t.tabs}function Cn(e,t){if(e===null||e.items.length===0)return t;let n=e.title??t.title,r={...e,...n===void 0?{}:{title:n}},i=Sn(e),a=Sn(t);if(i!==null&&a!==null){let e=new Map(i.map(e=>[e.label,{label:e.label,items:[...e.items]}]));for(let t of a){let n=e.get(t.label);n===void 0?e.set(t.label,{label:t.label,items:[...t.items]}):n.items.push(...t.items)}return{...r,items:[{type:`tabs`,tabs:[...e.values()]}]}}return{...r,items:[...e.items,...t.items]}}let Z=new Map,Q=new Set;function wn(e){Z.set(e,(Z.get(e)??0)+1);for(let e of Q)e()}function Tn(e){return Z.get(e)??0}function En(e){return Q.add(e),()=>{Q.delete(e)}}function Dn(e){try{return JSON.parse(e),!0}catch{return!1}}function On(e){try{return JSON.parse(e),null}catch(e){let t=e instanceof Error?e.message:String(e),n=t.match(/position (\d+)/i);return`${n===null?``:`(字符 ${n[1]} 附近)`}${t.slice(0,140)}`}}function kn(e){try{return JSON.parse(e),null}catch{}let t=``,n=!1,r=!1,i=0;for(let a=0;a0;)t+=n.pop(),a++;if(a===0)return null;try{return JSON.parse(t),{text:t,repairs:a}}catch{return null}}let Tn={margin:`0 0 6px`,padding:`6px 10px`,borderRadius:6,background:`rgba(239, 68, 68, 0.14)`,border:`1px solid rgba(239, 68, 68, 0.4)`,color:`#f87171`,fontSize:12,lineHeight:1.55,whiteSpace:`pre-wrap`};function En({raw:e,fenceKey:t}){let n=(0,h.useRef)(null),[r,i]=(0,h.useState)(!1);(0,h.useLayoutEffect)(()=>{let e=n.current;e!==null&&e.closest(`[data-streaming]`)===null&&i(!0)});let a=r&&e.trim()!==``?Sn(e):null;return(0,g.jsxs)(`div`,{ref:n,children:[a!==null&&(0,g.jsxs)(`div`,{style:Tn,role:`alert`,children:[`⚠️ dsh-ui fence JSON 解析失败`,a,` —— 围栏保持为代码块;请让模型检查并修复 JSON 后重发。`]}),(0,g.jsx)(p.CodeBlock,{code:`${e}\n`,lang:`dsh-ui`},t)]})}function Dn({sessionId:e,sourceId:t,order:n,spec:r}){return(0,h.useEffect)(()=>{ln(e,{sourceId:t,order:n,mode:r.append===!0?`append`:`replace`,spec:r})===`overflow`&&fn(e,t)},[e,t,n,r]),null}function On(e,t){let n=$t(e),r=n===null?null:R(n);if(r===null){let n=Cn(e);if(n!==null){let e=$t(n.text);r=e===null?null:R(e)}if(r===null&&t?.source!==void 0){let t=wn(e);if(t!==null){let e=$t(t.text);r=e===null?null:R(e)}}}return r}function kn(e,t,n){let r=t?.sessionId;return(0,g.jsx)(x,{label:`该界面`,children:(0,g.jsx)(Jt,{spec:n,stateKey:r===void 0?void 0:ie(r,t?.source?.id??String(e),JSON.stringify(n))})},t?.source?.id??e)}function An(e,t,n){let r=On(e,n);return r===null?null:r.panel===!0?n!==void 0&&n.sessionId!==void 0&&n.source!==void 0?r.append===!0&&!xn(e)?(0,g.jsx)(h.Fragment,{},t):(0,g.jsx)(Dn,{sessionId:n.sessionId,sourceId:n.source.id,order:n.source.order,spec:r},t):(0,g.jsx)(h.Fragment,{},t):kn(t,n,r)}function jn(e,t,n){let r=On(e,n);return r===null?(0,g.jsx)(En,{fenceKey:t,raw:e},t):r.panel===!0?n!==void 0&&n.sessionId!==void 0&&n.source!==void 0?r.append===!0&&!xn(e)?null:(0,g.jsx)(Dn,{sessionId:n.sessionId,sourceId:n.source.id,order:n.source.order,spec:r},t):null:kn(t,n,r)}let Q=`.md-code-block, .code-block, .code-block-small`,$=`data-genui-rendered`,Mn=`[data-streaming]`;function Nn(e){return e.nodeType===Node.TEXT_NODE}function Pn(e){let t=e.querySelector(`pre`);for(let n of e.querySelectorAll(`*`)){if(n.childElementCount!==0||n.textContent!==`dsh-ui`||t!==null&&t.contains(n))continue;let r=n.closest(Q);if(r===null||r===e)return`dsh-ui`}return null}function Fn(e){let t=e.querySelector(`pre`);for(let n of e.querySelectorAll(`*`))if(n.childElementCount===0&&!(t!==null&&t.contains(n)))return n.textContent??``;return``}function In(e){let t=e.querySelector(`pre`);if(t===null)return``;let n=``;for(let e of t.childNodes)Nn(e),n+=e.textContent??``;return n}function Ln(e){return e.closest(Mn)===null}function Rn(e,t=document){let n=e.parentElement;for(let e=0;n!==null&&n!==t&&e<4;e+=1,n=n.parentElement)if(Pn(n)===`dsh-ui`)return n;return null}function zn(e=document){let t=new Set,n=[];for(let r of e.querySelectorAll(Q))(r.parentElement===null||r.parentElement.closest(Q)===null)&&(t.has(r)||(n.push(r),t.add(r)));for(let r of e.querySelectorAll(`pre`)){if(r.closest(Q)!==null)continue;let i=Rn(r,e);i===null||t.has(i)||(Bn||(Bn=!0,console.warn(`[dsh-genui] 围栏表面类名未被已知选择器命中(宿主 DOM 漂移),已按 label+pre 结构识别 dsh-ui 围栏`)),n.push(i),t.add(i))}return n}let Bn=!1,Vn=`[data-chat-flow-key], [data-chat-flow-kind]`;function Hn(e){return e.closest(`[data-chat-anchor-key]`)??e.closest(Vn)??e}function Un(e,t){let n=e===t?document:e,r=0;for(let e of zn(n))if(e.closest(Mn)===null&&Pn(e)!==null&&(r+=1,e===t))return r;return r+1}function Wn(e){let t=e.getAttribute(`data-chat-anchor-key`)??``,n=/assistant-step(\d+):(\d+)$/.exec(t);if(n!==null){let e=Number(n[1]),t=Number(n[2]);if(Number.isFinite(e)&&Number.isFinite(t))return e*1e3+t}let r=document.querySelectorAll(`[data-chat-anchor-key], ${Vn}`);for(let t=0;t`u`)return()=>{};Bn=!1;let n=new Map,r=()=>{try{return e.sessions.list.getSnapshot().current}catch{return}};function i(e,t,n){n&&e.getAttribute(`data-chat-anchor-key`)===null&&s(t,`no [data-chat-anchor-key] ancestor for a dsh-ui fence (host render path without row anchor — e.g. Safari); using fallback identity dom:unknown:N`);let i=Un(e,t),a=`dom:${e.getAttribute(`data-chat-anchor-key`)??`unknown`}:${i}`,o=r();return{key:a,context:{...o===void 0?{}:{sessionId:o},...n?{source:{id:a,order:[Wn(e),0,i]}}:{}}}}function a(e){let t=n.get(e);t!==void 0&&(n.delete(e),t.root.unmount(),t.container.remove(),e.style.display=``,e.removeAttribute($))}let o=new WeakSet;function s(e,t){o.has(e)||(o.add(e),console.warn(`[dsh-genui] ${t}`))}function c(e){if(e.hasAttribute($))return;let a=Hn(e),o=Ln(e);if(o&&Pn(e)===null)return;let c=In(e);if(c.trim()===``){o&&s(e,`settled dsh-ui fence has an empty body; keeping the code block`);return}let{key:l,context:u}=i(a,e,o),d=An(c,l,u);if(d===null){o&&s(e,`settled dsh-ui fence body does not parse; keeping the code block`);return}let f=document.createElement(`div`);f.className=`genui-dom-fence`,e.style.display=`none`,e.after(f),e.setAttribute($,``);let p=(0,m.createRoot)(f);p.render((0,g.jsx)(v.Provider,{value:(e,n)=>{let i=r();i!==void 0&&t(i,e,n)},children:d})),n.set(e,{root:p,container:f,block:e,lastRaw:c,lastSettled:o})}function l(){for(let e of n.values()){let t=e.block;t.isConnected&&(t.style.display!==`none`&&(t.style.display=`none`),t.hasAttribute($)||t.setAttribute($,``),(e.container.parentElement!==t.parentElement||e.container.previousElementSibling!==t)&&t.after(e.container))}}function u(){for(let[e,o]of n){if(!e.isConnected){a(e);continue}let n=In(e),s=Ln(e);if(s&&!o.lastSettled){let t=Fn(e);if(t!==``&&t!==`dsh-ui`){a(e);continue}}if(o.lastRaw!==n||o.lastSettled!==s){let{key:c,context:l}=i(Hn(e),e,s),u=An(n,c,l);if(u===null){a(e);continue}o.lastRaw=n,o.lastSettled=s,o.root.render((0,g.jsx)(v.Provider,{value:(e,n)=>{let i=r();i!==void 0&&t(i,e,n)},children:u}))}}l();for(let e of zn())c(e)}let d=!1,f=()=>{d||(d=!0,requestAnimationFrame(()=>{d=!1,u()}))},p=new MutationObserver(()=>{l(),f()});p.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-streaming`],characterData:!0});let h=window.setInterval(u,1e3);return u(),()=>{p.disconnect(),window.clearInterval(h);for(let e of Array.from(n.keys()))a(e)}}let Kn={title:`GenUI 面板`,items:[{type:`text`,size:`h3`,content:`GenUI 生成式界面`},{type:`text`,size:`muted`,content:`面板会原地更新:对话里说「更新面板」,或再次执行 /panel 刷新。`},{type:`grid`,cols:4,items:[{type:`stat`,label:`组件`,value:`38`},{type:`stat`,label:`单个`,value:`12`},{type:`stat`,label:`组合`,value:`8`},{type:`stat`,label:`高级`,value:`18`}]},{type:`list`,items:[{title:`单个 ×12`,desc:`text button input select checkbox link badge stat progress divider avatar spacer`},{title:`组合 ×8`,desc:`row col grid card list table chart tabs`},{title:`数据 ×7`,desc:`plot callout steps keyvalue diff json code`},{title:`交互 ×5`,desc:`radio switch textarea accordion copy`},{title:`高级 ×5`,desc:`mermaid scene3d timeline file-tree breadcrumb`},{title:`教学 ×1`,desc:`quiz`}]},{type:`callout`,tone:`info`,title:`更新方式`,content:`对话说「更新面板」→ 模型输出 panel:true 围栏;/panel clear 清空面板。`}]};function qn(e,t){let n=t.trim().toLowerCase();if(n===`clear`||n===`off`||n===`close`){dn(e,null);return}dn(e,Kn),vn(e)}function Jn(e,t){return{token:`/panel`,hint:`开启 GenUI 面板;/panel <指令> 让模型定制;/panel clear 清空`,submit:async(n,r)=>{let i=n.trim();return i===``?qn(e,``):/^(clear|off|close)$/i.test(i)?qn(e,i):(qn(e,``),t(e,i)),{kind:`success`}}}}function Yn(e){return{trigger:`/`,name:`genui`,order:60,candidates:async(e,t)=>[{name:`panel`,description:`开启 GenUI 面板(/panel clear 清空;/panel <指令> 定制内容)`,hint:`/panel`}],onPick(t){return{claim:Jn(t.session.sessionId,e)}},matchEnter:async(t,n,r)=>{if(/^\/panel(?:\s|$)/.test(n.trim()))return{claim:Jn(t.sessionId,e)}}}}function Xn({sessionId:e,sendGenuiAction:t}){let n=(0,h.useSyncExternalStore)(hn,()=>mn(e)),r=(0,h.useSyncExternalStore)(bn,()=>yn(e)),[i,a]=(0,h.useState)(!0),[o,s]=(0,h.useState)(null),[c,l]=(0,h.useState)(!1),u=(0,h.useRef)(null),d=(0,h.useRef)(null);(0,h.useEffect)(()=>{r>0&&a(!1)},[r]),(0,h.useEffect)(()=>()=>{pn(e)},[e]),(0,h.useEffect)(()=>{if(c)return()=>{u.current=null}},[c]);let f=(0,h.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=o??360;u.current={y:e.clientY,height:n},l(!0);try{t.setPointerCapture(e.pointerId)}catch{}let r=e=>{let t=u.current;if(t===null)return;let n=Math.min(600,Math.max(120,t.height+(t.y-e.clientY)));s(n)},i=()=>{u.current=null,l(!1),t.removeEventListener(`pointermove`,r),t.removeEventListener(`pointerup`,i),t.removeEventListener(`pointercancel`,i)};t.addEventListener(`pointermove`,r),t.addEventListener(`pointerup`,i),t.addEventListener(`pointercancel`,i)},[o]);return n===null||n.items.length===0?null:(0,g.jsxs)(`div`,{className:C.panel,"data-genui-panel":!0,children:[!i&&(0,g.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":`调整面板高度`,className:`${C.panelResizeHandle}${c?` ${C.panelResizeHandleActive}`:``}`,onPointerDown:f}),(0,g.jsx)(`div`,{className:C.panelHeader,children:(0,g.jsxs)(`button`,{type:`button`,className:C.panelToggle,"aria-expanded":!i,onClick:()=>a(e=>!e),children:[(0,g.jsx)(`span`,{className:C.panelBadge,children:`面板`}),(0,g.jsx)(`span`,{className:C.panelTitle,children:n.title??`GenUI 面板`}),(0,g.jsx)(`span`,{className:C.panelChevron,"aria-hidden":!0,children:i?`▸`:`▾`})]})}),!i&&(0,g.jsx)(`div`,{ref:d,className:C.panelBody,"data-genui-panel-body":!0,style:o===null?void 0:{height:o},children:(0,g.jsx)(v.Provider,{value:t,children:(0,g.jsx)(x,{label:`面板`,children:(0,g.jsx)(Jt,{spec:n,stateKey:ae(e,JSON.stringify(n))})})})})]})}function Zn({toolName:e,block:t,sessionId:n}){let r=`meta`in t?t.meta:void 0,i=(0,h.useMemo)(()=>r===void 0?null:R(r),[r]);return(0,h.useEffect)(()=>{i!==null&&i.items.length>0&&ln(n,{sourceId:JSON.stringify([`render_ui`,t.callId]),order:[`seq`in t&&typeof t.seq==`number`?t.seq:0,-1,0],mode:`replace`,spec:i})},[n,i,t]),i===null||i.items.length===0?(0,g.jsxs)(`div`,{className:C.toolFallback,"data-genui-tool":!0,children:[(0,g.jsx)(`span`,{className:C.toolFallbackTitle,children:e}),(0,g.jsx)(`span`,{className:C.toolFallbackMeta,children:t.callId})]}):(0,g.jsx)(`div`,{className:C.tool,"data-genui-tool":!0,children:(0,g.jsx)(x,{label:`工具卡片`,children:(0,g.jsx)(Jt,{spec:i,stateKey:oe(n,t.callId)})})})}_t();function Qn(){if(!(typeof document>`u`))for(let e of[`mermaid.js`,`three.js`]){if(document.head.querySelector(`link[rel="prefetch"][href="${U(e)}"]`)!==null)continue;let t=document.createElement(`link`);t.rel=`prefetch`,t.as=`script`,t.href=U(e),document.head.appendChild(t)}}function $n(e,t){let n=e.sessions.scope(t)?.get(`conversation`);return{sessionId:t,sendGenuiAction:(e,r)=>{if(n===void 0)return;let i=Object.keys(r).length===0?``:` 组件数据: ${JSON.stringify(r)}`;n.send(`[genui-action] ${e}。用户刚刚在面板中触发了动作 "${e}",请根据组件数据执行相应操作,只输出一个 panel:true 的 dsh-ui 围栏来更新面板,回复文本至多一行 10 字以内的确认(如"已刷新"),不要解释、不要普通围栏。${i}`).catch(n=>{console.warn(`[genui] 面板动作 "${e}" 发送失败(session ${t}):`,n instanceof Error?n.message:String(n))})}}}function er(e,t,n){let r=e.sessions.scope(t)?.get(`conversation`);r!==void 0&&r.send(`用户执行了 /panel 并请求:${n}。请只输出一个 panel:true 的 dsh-ui 围栏来更新会话面板,内容按请求定制;回复文本至多一行 10 字以内的确认(如"已更新"),不要解释、不要普通围栏。`).catch(e=>{console.warn(`[genui] /panel 指令发送失败(session ${t}):`,e instanceof Error?e.message:String(e))})}function tr(e,t,n,r){let i=e.sessions.scope(t)?.get(`conversation`);if(i===void 0)return;let a=Object.keys(r).length===0?``:` 组件数据: ${JSON.stringify(r)}`;i.send(`[genui-action] ${n}。用户刚刚在界面中触发了动作 "${n}",请根据组件数据执行相应操作,并用 dsh-ui 输出更新后的界面。${a}`).catch(()=>{})}function nr(e){let t=p.registerFenceRenderer,n=typeof t==`function`?[t(`dsh-ui`,jn)]:(console.info(`[genui] fence-registry 扩展点不存在(原版 DSH)——启用 DOM 渲染通道`),[Gn(e,(t,n,r)=>tr(e,t,n,r))]);Qn(),n.push(e.slots.inject(`tool.call.toolview`,()=>e.slots.register({name:`tool.call.toolview`,key:`render_ui`},Zn))),n.push(e.slots.inject(`conversation.input.dock`,()=>e.slots.register({name:`conversation.input.dock`,id:`genui-panel`,order:50,inject:t=>$n(e,t)},Xn)));let r=e.get(`inputTriggers`);return r===void 0?console.warn(`[genui] inputTriggers service unavailable; /panel command disabled`):n.push(e.effect(()=>r.registerSource(Yn((t,n)=>er(e,t,n))),`genui: /panel`)),()=>{for(let e of n)e()}}return n.apply=nr,n.inject=[`slots`,`sessions`,`inputTriggers`],n.prefetchGenuiAssets=Qn,n.renderGenuiFence=jn,t.exports}}); \ No newline at end of file +`||e[t]===`\r`);)t++;let n=t0;)t+=n.pop(),a++;if(a===0)return null;try{return JSON.parse(t),{text:t,repairs:a}}catch{return null}}let jn={margin:`0 0 6px`,padding:`6px 10px`,borderRadius:6,background:`rgba(239, 68, 68, 0.14)`,border:`1px solid rgba(239, 68, 68, 0.4)`,color:`#f87171`,fontSize:12,lineHeight:1.55,whiteSpace:`pre-wrap`};function Mn({raw:e,fenceKey:t}){let n=(0,m.useRef)(null),[r,i]=(0,m.useState)(!1);(0,m.useLayoutEffect)(()=>{let e=n.current;e!==null&&e.closest(`[data-streaming]`)===null&&i(!0)});let a=r&&e.trim()!==``?On(e):null;return(0,h.jsxs)(`div`,{ref:n,children:[a!==null&&(0,h.jsxs)(`div`,{style:jn,role:`alert`,children:[`⚠️ dsh-ui fence JSON 解析失败`,a,` —— 围栏保持为代码块;请让模型检查并修复 JSON 后重发。`]}),(0,h.jsx)(p.CodeBlock,{code:`${e}\n`,lang:`dsh-ui`},t)]})}function Nn({sessionId:e,sourceId:t,order:n,spec:r}){return(0,m.useEffect)(()=>{hn(e,{sourceId:t,order:n,mode:r.append===!0?`append`:`replace`,spec:r})===`overflow`&&vn(e,t)},[e,t,n,r]),null}function Pn(e,t){let n=on(e),r=n===null?null:L(n);if(r===null){let n=kn(e);if(n!==null){let e=on(n.text);r=e===null?null:L(e)}if(r===null&&t?.source!==void 0){let t=An(e);if(t!==null){let e=on(t.text);r=e===null?null:L(e)}}}return r}function Fn(e,t,n){let r=t?.sessionId;return(0,h.jsx)(b,{label:`该界面`,children:(0,h.jsx)(en,{spec:n,stateKey:r===void 0?void 0:ae(r,t?.source?.id??String(e),JSON.stringify(n))})},t?.source?.id??e)}function In(e,t,n){let r=Pn(e,n);return r===null?null:r.panel===!0?n!==void 0&&n.sessionId!==void 0&&n.source!==void 0?r.append===!0&&!Dn(e)?(0,h.jsx)(m.Fragment,{},t):(0,h.jsx)(Nn,{sessionId:n.sessionId,sourceId:n.source.id,order:n.source.order,spec:r},t):(0,h.jsx)(m.Fragment,{},t):Fn(t,n,r)}function Ln(e,t,n){let r=Pn(e,n);return r===null?(0,h.jsx)(Mn,{fenceKey:t,raw:e},t):r.panel===!0?n!==void 0&&n.sessionId!==void 0&&n.source!==void 0?r.append===!0&&!Dn(e)?null:(0,h.jsx)(Nn,{sessionId:n.sessionId,sourceId:n.source.id,order:n.source.order,spec:r},t):null:Fn(t,n,r)}let Rn=`.md-code-block, .code-block, .code-block-small`,$=`data-genui-rendered`,zn=`[data-streaming]`;function Bn(e){return e.nodeType===Node.TEXT_NODE}function Vn(e){let t=e.querySelector(`pre`);for(let n of e.querySelectorAll(`*`))if(n.childElementCount===0&&n.textContent===`dsh-ui`&&!(t!==null&&t.contains(n)))return`dsh-ui`;return null}function Hn(e){let t=e.querySelector(`pre`);for(let n of e.querySelectorAll(`*`))if(n.childElementCount===0&&!(t!==null&&t.contains(n)))return n.textContent??``;return``}function Un(e){let t=e.querySelector(`pre`);if(t===null)return``;let n=``;for(let e of t.childNodes)Bn(e),n+=e.textContent??``;return n}function Wn(e){return e.closest(zn)===null}function Gn(e,t=document){let n=e.parentElement;for(let e=0;n!==null&&n!==t&&e<4;e+=1,n=n.parentElement)if(Vn(n)===`dsh-ui`)return n;return null}function Kn(e=document){let t=new Set,n=[];for(let r of e.querySelectorAll(Rn))(r.parentElement===null||r.parentElement.closest(Rn)===null)&&(t.has(r)||(n.push(r),t.add(r)));for(let r of e.querySelectorAll(`pre`)){let i=Gn(r,e);i===null||t.has(i)||(qn||(qn=!0,console.warn(`[dsh-genui] 围栏表面类名未被已知选择器命中(宿主 DOM 漂移),已按 label+pre 结构识别 dsh-ui 围栏`)),n.push(i),t.add(i))}return n}let qn=!1,Jn=`[data-chat-flow-key], [data-chat-flow-kind]`;function Yn(e){return e.closest(`[data-chat-anchor-key]`)??e.closest(Jn)??e}function Xn(e,t){let n=e===t?document:e,r=0;for(let e of Kn(n))if(e.closest(zn)===null&&Vn(e)!==null&&(r+=1,e===t))return r;return r+1}function Zn(e){let t=e.getAttribute(`data-chat-anchor-key`)??``,n=/assistant-step(\d+):(\d+)$/.exec(t);if(n!==null){let e=Number(n[1]),t=Number(n[2]);if(Number.isFinite(e)&&Number.isFinite(t))return e*1e3+t}let r=document.querySelectorAll(`[data-chat-anchor-key], ${Jn}`);for(let t=0;t`u`)return()=>{};qn=!1;let n=new Map,r=()=>{try{return e.sessions.list.getSnapshot().current}catch{return}};function i(e,t,n){n&&e.getAttribute(`data-chat-anchor-key`)===null&&s(t,`no [data-chat-anchor-key] ancestor for a dsh-ui fence (host render path without row anchor — e.g. Safari); using fallback identity dom:unknown:N`);let i=Xn(e,t),a=`dom:${e.getAttribute(`data-chat-anchor-key`)??`unknown`}:${i}`,o=r();return{key:a,context:{...o===void 0?{}:{sessionId:o},...n?{source:{id:a,order:[Zn(e),0,i]}}:{}}}}function a(e){let t=n.get(e);t!==void 0&&(n.delete(e),t.root.unmount(),t.container.remove(),e.style.display=``,e.removeAttribute($))}let o=new WeakSet;function s(e,t){o.has(e)||(o.add(e),console.warn(`[dsh-genui] ${t}`))}function c(e){if(e.hasAttribute($))return;let a=Yn(e),o=Wn(e);if(o&&Vn(e)===null)return;let c=Un(e);if(c.trim()===``){o&&s(e,`settled dsh-ui fence has an empty body; keeping the code block`);return}let{key:l,context:u}=i(a,e,o),d=In(c,l,u);if(d===null){o&&s(e,`settled dsh-ui fence body does not parse; keeping the code block`);return}let f=document.createElement(`div`);f.className=`genui-dom-fence`,e.style.display=`none`,e.after(f),e.setAttribute($,``);let p=(0,ee.createRoot)(f);p.render((0,h.jsx)(_.Provider,{value:(e,n)=>{let i=r();i!==void 0&&t(i,e,n)},children:d})),n.set(e,{root:p,container:f,block:e,lastRaw:c,lastSettled:o})}function l(){for(let e of n.values()){let t=e.block;t.isConnected&&(t.style.display!==`none`&&(t.style.display=`none`),t.hasAttribute($)||t.setAttribute($,``),(e.container.parentElement!==t.parentElement||e.container.previousElementSibling!==t)&&t.after(e.container))}}function u(){for(let[e,o]of n){if(!e.isConnected){a(e);continue}let n=Un(e),s=Wn(e);if(s&&!o.lastSettled){let t=Hn(e);if(t!==``&&t!==`dsh-ui`){a(e);continue}}if(o.lastRaw!==n||o.lastSettled!==s){let{key:c,context:l}=i(Yn(e),e,s),u=In(n,c,l);if(u===null){a(e);continue}o.lastRaw=n,o.lastSettled=s,o.root.render((0,h.jsx)(_.Provider,{value:(e,n)=>{let i=r();i!==void 0&&t(i,e,n)},children:u}))}}l();for(let e of Kn())c(e)}let d=!1,f=()=>{d||(d=!0,requestAnimationFrame(()=>{d=!1,u()}))},p=new MutationObserver(()=>{l(),f()});p.observe(document.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:[`data-streaming`],characterData:!0});let m=window.setInterval(u,1e3);return u(),()=>{p.disconnect(),window.clearInterval(m);for(let e of Array.from(n.keys()))a(e)}}let $n={title:`GenUI 面板`,items:[{type:`text`,size:`h3`,content:`GenUI 生成式界面`},{type:`text`,size:`muted`,content:`面板会原地更新:对话里说「更新面板」,或再次执行 /panel 刷新。`},{type:`grid`,cols:4,items:[{type:`stat`,label:`组件`,value:`38`},{type:`stat`,label:`单个`,value:`12`},{type:`stat`,label:`组合`,value:`8`},{type:`stat`,label:`高级`,value:`18`}]},{type:`list`,items:[{title:`单个 ×12`,desc:`text button input select checkbox link badge stat progress divider avatar spacer`},{title:`组合 ×8`,desc:`row col grid card list table chart tabs`},{title:`数据 ×7`,desc:`plot callout steps keyvalue diff json code`},{title:`交互 ×5`,desc:`radio switch textarea accordion copy`},{title:`高级 ×5`,desc:`mermaid scene3d timeline file-tree breadcrumb`},{title:`教学 ×1`,desc:`quiz`}]},{type:`callout`,tone:`info`,title:`更新方式`,content:`对话说「更新面板」→ 模型输出 panel:true 围栏;/panel clear 清空面板。`}]};function er(e,t){let n=t.trim().toLowerCase();if(n===`clear`||n===`off`||n===`close`){_n(e,null);return}_n(e,$n),wn(e)}function tr(e,t){return{token:`/panel`,hint:`开启 GenUI 面板;/panel <指令> 让模型定制;/panel clear 清空`,submit:async(n,r)=>{let i=n.trim();return i===``?er(e,``):/^(clear|off|close)$/i.test(i)?er(e,i):(er(e,``),t(e,i)),{kind:`success`}}}}function nr(e){return{trigger:`/`,name:`genui`,order:60,candidates:async(e,t)=>[{name:`panel`,description:`开启 GenUI 面板(/panel clear 清空;/panel <指令> 定制内容)`,hint:`/panel`}],onPick(t){return{claim:tr(t.session.sessionId,e)}},matchEnter:async(t,n,r)=>{if(/^\/panel(?:\s|$)/.test(n.trim()))return{claim:tr(t.sessionId,e)}}}}function rr({sessionId:e,sendGenuiAction:t}){let n=(0,m.useSyncExternalStore)(xn,()=>bn(e)),r=(0,m.useSyncExternalStore)(En,()=>Tn(e)),[i,a]=(0,m.useState)(!0),[o,s]=(0,m.useState)(null),[c,l]=(0,m.useState)(!1),u=(0,m.useRef)(null),d=(0,m.useRef)(null);(0,m.useEffect)(()=>{r>0&&a(!1)},[r]),(0,m.useEffect)(()=>()=>{yn(e)},[e]),(0,m.useEffect)(()=>{if(c)return()=>{u.current=null}},[c]);let f=(0,m.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=o??360;u.current={y:e.clientY,height:n},l(!0);try{t.setPointerCapture(e.pointerId)}catch{}let r=e=>{let t=u.current;if(t===null)return;let n=Math.min(600,Math.max(120,t.height+(t.y-e.clientY)));s(n)},i=()=>{u.current=null,l(!1),t.removeEventListener(`pointermove`,r),t.removeEventListener(`pointerup`,i),t.removeEventListener(`pointercancel`,i)};t.addEventListener(`pointermove`,r),t.addEventListener(`pointerup`,i),t.addEventListener(`pointercancel`,i)},[o]);return n===null||n.items.length===0?null:(0,h.jsxs)(`div`,{className:S.panel,"data-genui-panel":!0,children:[!i&&(0,h.jsx)(`div`,{role:`separator`,"aria-orientation":`horizontal`,"aria-label":`调整面板高度`,className:`${S.panelResizeHandle}${c?` ${S.panelResizeHandleActive}`:``}`,onPointerDown:f}),(0,h.jsx)(`div`,{className:S.panelHeader,children:(0,h.jsxs)(`button`,{type:`button`,className:S.panelToggle,"aria-expanded":!i,onClick:()=>a(e=>!e),children:[(0,h.jsx)(`span`,{className:S.panelBadge,children:`面板`}),(0,h.jsx)(`span`,{className:S.panelTitle,children:n.title??`GenUI 面板`}),(0,h.jsx)(`span`,{className:S.panelChevron,"aria-hidden":!0,children:i?`▸`:`▾`})]})}),!i&&(0,h.jsx)(`div`,{ref:d,className:S.panelBody,"data-genui-panel-body":!0,style:o===null?void 0:{height:o},children:(0,h.jsx)(_.Provider,{value:t,children:(0,h.jsx)(b,{label:`面板`,children:(0,h.jsx)(en,{spec:n,stateKey:oe(e,JSON.stringify(n))})})})})]})}function ir({toolName:e,block:t,sessionId:n}){let r=`meta`in t?t.meta:void 0,i=(0,m.useMemo)(()=>r===void 0?null:L(r),[r]);return(0,m.useEffect)(()=>{i!==null&&i.items.length>0&&hn(n,{sourceId:JSON.stringify([`render_ui`,t.callId]),order:[`seq`in t&&typeof t.seq==`number`?t.seq:0,-1,0],mode:`replace`,spec:i})},[n,i,t]),i===null||i.items.length===0?(0,h.jsxs)(`div`,{className:S.toolFallback,"data-genui-tool":!0,children:[(0,h.jsx)(`span`,{className:S.toolFallbackTitle,children:e}),(0,h.jsx)(`span`,{className:S.toolFallbackMeta,children:t.callId})]}):(0,h.jsx)(`div`,{className:S.tool,"data-genui-tool":!0,children:(0,h.jsx)(b,{label:`工具卡片`,children:(0,h.jsx)(en,{spec:i,stateKey:se(n,t.callId)})})})}U();function ar(){if(!(typeof document>`u`))for(let e of[`mermaid.js`,`three.js`]){if(document.head.querySelector(`link[rel="prefetch"][href="${ht(e)}"]`)!==null)continue;let t=document.createElement(`link`);t.rel=`prefetch`,t.as=`script`,t.href=ht(e),document.head.appendChild(t)}}function or(e,t){let n=e.sessions.scope(t)?.get(`conversation`);return{sessionId:t,sendGenuiAction:(e,r)=>{if(n===void 0)return;let i=Object.keys(r).length===0?``:` 组件数据: ${JSON.stringify(r)}`;n.send(`[genui-action] ${e}。用户刚刚在面板中触发了动作 "${e}",请根据组件数据执行相应操作,只输出一个 panel:true 的 dsh-ui 围栏来更新面板,回复文本至多一行 10 字以内的确认(如"已刷新"),不要解释、不要普通围栏。${i}`).catch(n=>{console.warn(`[genui] 面板动作 "${e}" 发送失败(session ${t}):`,n instanceof Error?n.message:String(n))})}}}function sr(e,t,n){let r=e.sessions.scope(t)?.get(`conversation`);r!==void 0&&r.send(`用户执行了 /panel 并请求:${n}。请只输出一个 panel:true 的 dsh-ui 围栏来更新会话面板,内容按请求定制;回复文本至多一行 10 字以内的确认(如"已更新"),不要解释、不要普通围栏。`).catch(e=>{console.warn(`[genui] /panel 指令发送失败(session ${t}):`,e instanceof Error?e.message:String(e))})}function cr(e,t,n,r){let i=e.sessions.scope(t)?.get(`conversation`);if(i===void 0)return;let a=Object.keys(r).length===0?``:` 组件数据: ${JSON.stringify(r)}`;i.send(`[genui-action] ${n}。用户刚刚在界面中触发了动作 "${n}",请根据组件数据执行相应操作,并用 dsh-ui 输出更新后的界面。${a}`).catch(()=>{})}function lr(e){let t=p.registerFenceRenderer,n=typeof t==`function`?[t(`dsh-ui`,Ln)]:(console.info(`[genui] fence-registry 扩展点不存在(原版 DSH)——启用 DOM 渲染通道`),[Qn(e,(t,n,r)=>cr(e,t,n,r))]);ar(),n.push(e.slots.inject(`tool.call.toolview`,()=>e.slots.register({name:`tool.call.toolview`,key:`render_ui`},ir))),n.push(e.slots.inject(`conversation.input.dock`,()=>e.slots.register({name:`conversation.input.dock`,id:`genui-panel`,order:50,inject:t=>or(e,t)},rr)));let r=e.get(`inputTriggers`);return r===void 0?console.warn(`[genui] inputTriggers service unavailable; /panel command disabled`):n.push(e.effect(()=>r.registerSource(nr((t,n)=>sr(e,t,n))),`genui: /panel`)),()=>{for(let e of n)e()}}return n.apply=lr,n.inject=[`slots`,`sessions`,`inputTriggers`],n.prefetchGenuiAssets=ar,n.renderGenuiFence=Ln,t.exports}}); \ No newline at end of file diff --git a/lib/index.js b/lib/index.js index b33663c..f826b61 100644 --- a/lib/index.js +++ b/lib/index.js @@ -42,7 +42,10 @@ const GENUI_LIMITS = { maxBreadcrumbItems: 12, maxKeyValuePairs: 24, /** Maximum `file-tree` nesting. */ - maxTreeDepth: 6 + maxTreeDepth: 6, + /** Maximum depth of an `echart` option object (prevents pathological nested + * ECharts configs from stalling the guard walk). */ + maxEChartOptionDepth: 10 }; /** Is `v` one of `values`? (enum guard) */ function inEnum(v, values) { @@ -151,6 +154,13 @@ const MESH_SHAPES = [ "torus" ]; const FILE_TYPES = ["file", "dir"]; +const ECHART_PRESETS = [ + "bar", + "line", + "area", + "pie", + "scatter" +]; /** Walk `list` with the shared node budget; drops invalid entries. */ function repairItems(list, ctx, depth) { if (!Array.isArray(list)) return []; @@ -532,6 +542,22 @@ function repairNode(value, ctx, depth) { ...opt("action", str(v.action, 200)) }; } + case "echart": { + const data = v.data !== void 0 ? repairChartData(v.data, GENUI_LIMITS.maxChartPoints) : void 0; + const series = v.series !== void 0 && Array.isArray(v.series) ? repairSeries(v.series, GENUI_LIMITS.maxPlotSeries, GENUI_LIMITS.maxChartPoints) : void 0; + const sanitized = v.option !== void 0 ? sanitizeEChartOption(v.option, 0) : void 0; + const option = sanitized === void 0 || typeof sanitized !== "object" || sanitized === null || Array.isArray(sanitized) ? void 0 : sanitized; + if (option === void 0 && data === void 0 && series === void 0) return null; + return { + type: "echart", + ...opt("title", str(v.title, GENUI_LIMITS.maxString)), + ...opt("height", int(v.height, 100, 800)), + ...opt("preset", enu(v.preset, ECHART_PRESETS)), + ...opt("data", data), + ...opt("series", series), + ...opt("option", option) + }; + } default: return value; } } @@ -812,6 +838,39 @@ function repairQuizOptions(v) { return out; } /** +* Sanitize an ECharts option object: depth-bounded pass-through that strips +* dangerous values (functions, `url()` in styles) but preserves the object +* shape ECharts needs. Scalars are KEPT: ECharts options are full of them, +* including inside `data` arrays (`data: [120, 150, 180]`, +* `xAxis.data: ['1月', '2月']`). Previously a scalar hit the plain-object +* gate below and returned undefined, so every primitive-valued array was +* filtered to empty and dropped — a chart with a full `option` rendered +* with empty series (blank canvas). This is a safety walk, not an ECharts +* semantic validator. +*/ +function sanitizeEChartOption(v, depth) { + if (depth > GENUI_LIMITS.maxEChartOptionDepth) return void 0; + if (typeof v === "string") { + const s = v.slice(0, GENUI_LIMITS.maxString); + return s.toLowerCase().includes("url(") ? void 0 : s; + } + if (typeof v === "number" && Number.isFinite(v)) return v; + if (typeof v === "boolean") return v; + if (v === null) return null; + if (Array.isArray(v)) { + const arr = v.map((item) => sanitizeEChartOption(item, depth + 1)).filter((item) => item !== void 0); + return arr.length > 0 ? arr : void 0; + } + const o = obj(v); + if (o === void 0) return void 0; + const out = {}; + for (const [key, val] of Object.entries(o)) { + const s = sanitizeEChartOption(val, depth + 1); + if (s !== void 0) out[key] = s; + } + return Object.keys(out).length > 0 ? out : void 0; +} +/** * Deterministically repair a raw spec value into a renderable GenuiSpec. * Returns null only when the root is not an object with an `items` array; * every other defect is healed by dropping/clamping/truncating. Idempotent: @@ -1348,6 +1407,7 @@ The spec is a white-listed component tree rendered inline where the fence sits. - list: {"type":"list","items":["..."] or [{"title":"...","desc":"..."}]} - table: {"type":"table","columns":["..."],"rows":[["...","..."]]} — 表头点击本地排序(升/降/还原,数值感知) - chart: {"type":"chart","kind":"bars|line|donut","data":[{"label":"...","value":n,"color":"#hex?"}],"series":[...]?} — bars 默认;line 趋势;donut 占比;series=分组柱;负值柱高为 0 但标注照显;hover 显示精确值 +- echart: {"type":"echart","preset":"bar|line|area|pie|scatter","title":"..."?,"height":n?,"data":[{"label":"...","value:n}]?,"series":[...]?} — ECharts 全功能图表(渐变/tooltip/动画/图例交互),视觉效果远超 chart;preset 模式用和 chart 一样的 data/series 格式自动构建主题化配置;也可传 "option":{...} 写原生 ECharts 配置(支持 radar/gauge/heatmap/dataZoom 等,option 中的函数会被过滤);推荐用 echart 替代 chart - tabs: {"type":"tabs","tabs":[{"label":"...","items":[...]}]} / accordion: {"type":"accordion","items":[{"title":"...","items":[...]}]} - avatar: {"type":"avatar","name":"..."} - plot: {"type":"plot","series":[{"expr":"sin(x)","label":"...","kind":"line|area|scatter"?,"params":[...]?}],"xMin":-5,"xMax":5,"yMin":?,"yMax":?,"title":"..."} — SVG 函数图(可拖拽平移/滚轮缩放;params 渲染实时滑块);kind 缺省 line,area 填到基线,scatter 散点;表达式白名单 sin/cos/tan/asin/acos/atan/sqrt/cbrt/exp/log/ln/abs/floor/ceil/round/min/max/pow,常量 pi/e/tau,变量 x @@ -1364,7 +1424,7 @@ The spec is a white-listed component tree rendered inline where the fence sits. Rules: - Trigger: 结构化表达优于纯文本时就主动用围栏(要点、强调、对比、流程、步骤、状态、数据、演示),纯问答与一句话不套 UI。 - 围栏放在回答中该组件该在的位置,文字前后照常流动;不要把围栏套进别的代码围栏,JSON 字符串内不放 markdown。 -- Component choice (每个主题一个主组件): 结论/提醒→callout · 2–4 指标→grid+stat · 进度→progress · 多阶段→steps · 要点→list · 配置→keyvalue · 对比→table · 趋势→chart(line) · 占比→chart(donut) · 分类对比→chart(bars) · 数学曲线→plot · 事件→timeline · 分页内容→tabs · 长内容→accordion · 树→file-tree · 代码→code · 文件变更→diff · 嵌套JSON→json · 架构/流程→mermaid · 仅几何内容→scene3d · 教学→quiz · 单操作→button(action)。优先 table/chart 而非文字堆砌;同一数据不重复出现在两个组件;每次回复 3–8 个组件,拿不准就少。 +- Component choice (每个主题一个主组件): 结论/提醒→callout · 2–4 指标→grid+stat · 进度→progress · 多阶段→steps · 要点→list · 配置→keyvalue · 对比→table · 趋势→echart(line) 或 chart(line) · 占比→echart(pie) 或 chart(donut) · 分类对比→echart(bar) 或 chart(bars) · 数学曲线→plot · 事件→timeline · 分页内容→tabs · 长内容→accordion · 树→file-tree · 代码→code · 文件变更→diff · 嵌套JSON→json · 架构/流程→mermaid · 仅几何内容→scene3d · 教学→quiz · 单操作→button(action)。优先 echart/table 而非文字堆砌;同一数据不重复出现在两个组件;每次回复 3–8 个组件,拿不准就少。 - 语法: 坏围栏降级为代码块,保持 JSON 严格。≥3 节点或含 table 的围栏发出前调用 validate_dsh_ui 验证,❌ 则修好再发;若 ❌ 回复里附了「已自动修复」的 JSON,照抄即可。 - 主题: 内容适配暗色;UI 主题跟随 app,不要自造。规模: ≤200 节点、嵌套≤8 层(超出被截断);3D 网格 1–5 个;plot 给合理 xMin/xMax。 - v2 actions: button/input/select/checkbox/radio/switch/slider/textarea/quiz 可带 "action":"name",交互以 [genui-action] name + 组件数据回传,届时重渲染更新 UI。可交互组件必须带 action(无 action 按钮禁用);带 action 的按钮点击有「已触发」本地反馈。 diff --git a/lib/types/client/EChartNode.d.ts b/lib/types/client/EChartNode.d.ts new file mode 100644 index 0000000..59d1dbf --- /dev/null +++ b/lib/types/client/EChartNode.d.ts @@ -0,0 +1,4 @@ +import type { GenuiEChart } from './spec.ts'; +export declare function EChartNode({ node }: { + node: GenuiEChart; +}): import("react").JSX.Element; diff --git a/lib/types/client/asset-echarts.d.ts b/lib/types/client/asset-echarts.d.ts new file mode 100644 index 0000000..9142e67 --- /dev/null +++ b/lib/types/client/asset-echarts.d.ts @@ -0,0 +1,15 @@ +/** + * ECharts asset-bundle entry: registers the echarts engine on + * `window.__GenuiAssets__.echarts`. Built as a standalone IIFE into + * `lib/assets/echarts.js` and served by the plugin's node-half route; loaded + * on demand by echarts-lazy when a spec contains an `echart` node. + * @module @omdsh-dev/dsh-genui/client/asset-echarts + */ +import { type EChartsType, type EChartsCoreOption } from 'echarts'; +/** The engine surface registered by the echarts asset bundle. */ +export interface EChartsAssetApi { + /** Create an ECharts instance on `el`, apply `option`, return the instance. */ + createChart: (el: HTMLElement, option: EChartsCoreOption, opts?: { + height?: number; + }) => EChartsType; +} diff --git a/lib/types/client/asset-loader.d.ts b/lib/types/client/asset-loader.d.ts index 311ec26..df768bf 100644 --- a/lib/types/client/asset-loader.d.ts +++ b/lib/types/client/asset-loader.d.ts @@ -28,4 +28,4 @@ export declare function assetUrl(file: string): string; * @param name - 'mermaid' or 'three'. * @returns the registered engine surface. */ -export declare function loadGenuiAsset(name: 'mermaid' | 'three'): Promise; +export declare function loadGenuiAsset(name: 'mermaid' | 'three' | 'echarts'): Promise; diff --git a/lib/types/client/blocks/charts.d.ts b/lib/types/client/blocks/charts.d.ts index 5c65191..7f0a453 100644 --- a/lib/types/client/blocks/charts.d.ts +++ b/lib/types/client/blocks/charts.d.ts @@ -1,4 +1,5 @@ import type { GenuiChart, GenuiTable } from '../spec.ts'; +export declare const CHART_COLORS: string[]; export declare function TableNode({ node }: { node: GenuiTable; }): import("react").JSX.Element; diff --git a/lib/types/client/echarts-lazy.d.ts b/lib/types/client/echarts-lazy.d.ts new file mode 100644 index 0000000..46a81cb --- /dev/null +++ b/lib/types/client/echarts-lazy.d.ts @@ -0,0 +1,17 @@ +/** The ECharts instance surface (the subset the component uses). */ +export interface EChartsInstance { + setOption: (opt: unknown, notMerge?: boolean) => void; + resize: () => void; + dispose: () => void; +} +/** + * Create an ECharts instance on `el` with the given option (engine loaded on + * demand). The caller owns the returned instance and must dispose it. + * @param el - the DOM node to host the chart canvas. + * @param option - the ECharts option object. + * @param opts - optional height override. + * @returns the ECharts instance (setOption/resize/dispose). + */ +export declare function createChart(el: HTMLElement, option: unknown, opts?: { + height?: number; +}): Promise; diff --git a/lib/types/client/guard.d.ts b/lib/types/client/guard.d.ts index e9d38bc..bd22c28 100644 --- a/lib/types/client/guard.d.ts +++ b/lib/types/client/guard.d.ts @@ -60,6 +60,9 @@ export declare const GENUI_LIMITS: { readonly maxKeyValuePairs: 24; /** Maximum `file-tree` nesting. */ readonly maxTreeDepth: 6; + /** Maximum depth of an `echart` option object (prevents pathological nested + * ECharts configs from stalling the guard walk). */ + readonly maxEChartOptionDepth: 10; }; /** Result of `validateGenuiSpec`. */ export interface GenuiValidation { diff --git a/lib/types/client/spec.d.ts b/lib/types/client/spec.d.ts index 58f3d24..7141357 100644 --- a/lib/types/client/spec.d.ts +++ b/lib/types/client/spec.d.ts @@ -9,7 +9,7 @@ * are operable, but events do NOT flow back to the model. */ /** One node in the component tree. */ -export type GenuiNode = GenuiText | GenuiRow | GenuiCol | GenuiGrid | GenuiCard | GenuiButton | GenuiInput | GenuiSelect | GenuiCheckbox | GenuiLink | GenuiBadge | GenuiStat | GenuiProgress | GenuiDivider | GenuiList | GenuiTable | GenuiChart | GenuiTabs | GenuiAvatar | GenuiSpacer | GenuiPlot | GenuiCallout | GenuiSteps | GenuiKeyValue | GenuiDiff | GenuiJson | GenuiCode | GenuiRadio | GenuiSubmit | GenuiSwitch | GenuiSlider | GenuiTextarea | GenuiAccordion | GenuiCopy | GenuiMermaid | GenuiScene3D | GenuiTimeline | GenuiFileTree | GenuiBreadcrumb | GenuiQuiz; +export type GenuiNode = GenuiText | GenuiRow | GenuiCol | GenuiGrid | GenuiCard | GenuiButton | GenuiInput | GenuiSelect | GenuiCheckbox | GenuiLink | GenuiBadge | GenuiStat | GenuiProgress | GenuiDivider | GenuiList | GenuiTable | GenuiChart | GenuiTabs | GenuiAvatar | GenuiSpacer | GenuiPlot | GenuiCallout | GenuiSteps | GenuiKeyValue | GenuiDiff | GenuiJson | GenuiCode | GenuiRadio | GenuiSubmit | GenuiSwitch | GenuiSlider | GenuiTextarea | GenuiAccordion | GenuiCopy | GenuiMermaid | GenuiScene3D | GenuiTimeline | GenuiFileTree | GenuiBreadcrumb | GenuiQuiz | GenuiEChart; export interface GenuiSpec { /** Short title shown as the card banner. */ title?: string; @@ -455,6 +455,44 @@ export interface GenuiQuiz { * or grade it. */ action?: string; } +/** Preset chart kinds the `echart` node can build from `data`/`series` without + * a full ECharts option. Each maps to a themed option template. */ +export type EChartPreset = 'bar' | 'line' | 'area' | 'pie' | 'scatter'; +/** ECharts node: renders a full ECharts chart. Two modes: + * + * 1. **Full option** (`option` set): the model provides a standard ECharts + * `EChartsCoreOption` object directly. This is the escape hatch for + * custom chart types, complex series, or advanced features (dataZoom, + * visualMap, etc.). + * 2. **Preset shorthand** (`preset` + `data`/`series`): the model provides + * the same simple `data`/`series` shape as the `chart` node, and the + * component builds a themed ECharts option automatically. This is the + * easy upgrade path: change `type: 'chart'` to `type: 'echart'` and add + * `preset`. + * + * The echarts engine is lazy-loaded (lib/assets/echarts.js) only when an + * `echart` node appears in a spec. */ +export interface GenuiEChart { + type: 'echart'; + /** Optional title shown above the chart. */ + title?: string; + /** Chart height in pixels (default 300). */ + height?: number; + /** Preset: builds the ECharts option from `data`/`series` when `option` + * is absent. */ + preset?: EChartPreset; + /** Simple data for preset mode (same shape as `chart.data`). */ + data?: GenuiChartDatum[]; + /** Multi-series for preset mode (same shape as `chart.series`). */ + series?: Array<{ + label: string; + color?: string; + data: GenuiChartDatum[]; + }>; + /** Full ECharts option object. When present, `preset`/`data`/`series` are + * ignored. This is a pass-through to `echarts.setOption`. */ + option?: Record; +} /** Parse the raw fence body as a GenuiSpec, or null when it is not one. */ export declare function parseGenuiSpec(raw: string): GenuiSpec | null; /** Basic structural guard: is this object a valid GenuiSpec? */ diff --git a/lib/types/plugin/index.d.ts b/lib/types/plugin/index.d.ts index c8ffe74..c7ad166 100644 --- a/lib/types/plugin/index.d.ts +++ b/lib/types/plugin/index.d.ts @@ -13,7 +13,7 @@ import { Context } from '@deepseek-ai/cordis'; /** Convention: tool guidance uses 100–199; bash's section is 104. */ export declare const GENUI_SECTION_ORDER = 105; /** The fence language description injected into every assembled system prompt. */ -export declare const GENUI_SECTION_TEXT = "You can render interactive UI components INSIDE your reply \u2014 between paragraphs \u2014 by emitting a fenced block with the language tag `dsh-ui` containing a JSON spec:\n\n```dsh-ui\n{\"title\":\"\u53EF\u9009\u6807\u9898\",\"gap\":14,\"items\":[...]}\n```\n\nThe spec is a white-listed component tree rendered inline where the fence sits. Vocabulary (only these `type` values; the `genui` skill, when available, carries the fuller content\u2192component mapping and field details):\n\n- text: {\"type\":\"text\",\"size\":\"h1|h2|h3|body|muted|caption\",\"content\":\"...\",\"center\":true?}\n- row / col: {\"type\":\"row\"|\"col\",\"items\":[...],\"wrap\":true?,\"spacer\":true?,\"gap\":n?} \u2014 \u5E03\u5C40\u5BB9\u5668\n- grid: {\"type\":\"grid\",\"cols\":n,\"items\":[...]} / card: {\"type\":\"card\",\"title\":\"...\",\"items\":[...]}\n- button: {\"type\":\"button\",\"label\":\"...\",\"tone\":\"primary|danger|success|ghost\",\"full\":true?,\"small\":true?,\"icon\":\"emoji?\",\"action\":\"name\"?} \u2014 \u65E0 action \u65F6\u6E32\u67D3\u4E3A\u7981\u7528\u6001\n- input / textarea: {\"type\":\"input\"|\"textarea\",\"label\":\"...\",\"placeholder\":\"...\",\"inputType\":\"text|email\"?,\"rows\":n?,\"value\":\"...\",\"action\":\"name\"?,\"id\":\"field-id\"?} \u2014 input \u6309 Enter \u63D0\u4EA4\uFF08submit:true\uFF09\u3001textarea Ctrl/Cmd+Enter\uFF1Bblur \u4EC5\u503C\u6709\u53D8\u5316\u624D\u53D1\u9001\uFF1B\u5E26 id \u7684\u503C\u8DE8\u5237\u65B0\u6301\u4E45\u5316\u5E76\u88AB sibling submit \u6536\u96C6\u4E3A fields:{id:value}\n- select: {\"type\":\"select\",\"label\":\"...\",\"options\":[...],\"selected\":\u4E0B\u6807?,\"action\":\"name\"?,\"id\":\"field-id\"?} \u2014 id/selected \u8BED\u4E49\u540C input\n- checkbox / switch / slider: {\"type\":\"checkbox\"|\"switch\",\"label\":\"...\",\"checked\":true?,\"action\":\"name\"?} \u00B7 {\"type\":\"slider\",\"label\":\"...\",\"min\":0,\"max\":100,\"step\":1,\"value\":n?,\"action\":\"name\"?,\"id\":\"field-id\"?} \u2014 slider \u662F\u6570\u503C\u8868\u5355\uFF1Aid \u6301\u4E45\u5316\u5E76\u8FDB submit \u7684 fields\n- radio: {\"type\":\"radio\",\"label\":\"...\",\"options\":[...],\"selected\":n?,\"action\":\"name\"?} \u2014 \u52A0 \"group\":\"\u9898\u76EE\u540D\" \u8BB0\u5F55\u9009\u62E9\uFF08\u70B9\u51FB\u4E0D\u5F80\u8FD4\uFF09\uFF1B\u518D\u52A0 \"answer\":\u6B63\u786E\u4E0B\u6807|\u6807\u7B7E \u4E0E \"explanation\":\"\u89E3\u6790\" \u4F9B sibling submit \u672C\u5730\u5224\u5206\n- submit: {\"type\":\"submit\",\"label\":\"\u4EA4\u5377\",\"groups\":[\"q1\"]?,\"action\":\"name\"?,\"resetAction\":\"name\"?} \u2014 LOCAL-FIRST\uFF1A\u9898\u76EE\u5E26 answer \u65F6\u70B9\u51FB\u5C31\u5730\u5224\u5206\uFF08\u5F97\u5206 + \u9010\u9898 \u2713/\u2717 + \u89E3\u6790\uFF09\u5E76\u9501\u5B9A\u81F3\u300C\u91CD\u65B0\u4F5C\u7B54\u300D\uFF0C\u96F6\u5F80\u8FD4\u3001\u65E0\u9700 action\uFF1B\u4EC5\u5F53\u65E0 answer \u65F6\u624D\u53D1\u4E00\u4E2A action {answers:{group:choice},fields:{id:value},total,answered}\uFF1B\u672A\u7B54\u5B8C\u4FDD\u6301\u7981\u7528\n- quiz: {\"type\":\"quiz\",\"question\":\"...\",\"options\":[{\"label\":\"...\",\"correct\":true?,\"feedback\":\"...\"?}],\"explanation\":\"...\",\"id\":\"...\"?,\"action\":\"name\"?} \u2014 \u70B9\u9009\u5C31\u5730\u5224\u5BF9\u9519 + \u91CD\u8BD5\uFF1Bid \u53D8\u5316\u91CD\u7F6E\uFF1B\u5E26 action \u65F6\u53E6\u56DE\u4F20 {type:'quiz',question,answer,correct}\n- link: {\"type\":\"link\",\"label\":\"...\",\"href\":\"https://...\"?} \u2014 \u4EC5 http(s)/mailto\uFF1B\u65E0 href \u6E32\u67D3\u4E3A\u7EAF\u6587\u672C\n- badge: {\"type\":\"badge\",\"label\":\"...\",\"tone\":\"success|warn|danger|accent\",\"icon\":\"emoji?\"}\n- stat: {\"type\":\"stat\",\"label\":\"...\",\"value\":\"...\",\"delta\":\"+12.4%|-3%\"}\n- progress: {\"type\":\"progress\",\"label\":\"...\",\"value\":0-100,\"valueLabel\":\"70%\"}\n- divider: {\"type\":\"divider\"} / spacer: {\"type\":\"spacer\"}\n- list: {\"type\":\"list\",\"items\":[\"...\"] or [{\"title\":\"...\",\"desc\":\"...\"}]}\n- table: {\"type\":\"table\",\"columns\":[\"...\"],\"rows\":[[\"...\",\"...\"]]} \u2014 \u8868\u5934\u70B9\u51FB\u672C\u5730\u6392\u5E8F\uFF08\u5347/\u964D/\u8FD8\u539F\uFF0C\u6570\u503C\u611F\u77E5\uFF09\n- chart: {\"type\":\"chart\",\"kind\":\"bars|line|donut\",\"data\":[{\"label\":\"...\",\"value\":n,\"color\":\"#hex?\"}],\"series\":[...]?} \u2014 bars \u9ED8\u8BA4\uFF1Bline \u8D8B\u52BF\uFF1Bdonut \u5360\u6BD4\uFF1Bseries=\u5206\u7EC4\u67F1\uFF1B\u8D1F\u503C\u67F1\u9AD8\u4E3A 0 \u4F46\u6807\u6CE8\u7167\u663E\uFF1Bhover \u663E\u793A\u7CBE\u786E\u503C\n- tabs: {\"type\":\"tabs\",\"tabs\":[{\"label\":\"...\",\"items\":[...]}]} / accordion: {\"type\":\"accordion\",\"items\":[{\"title\":\"...\",\"items\":[...]}]}\n- avatar: {\"type\":\"avatar\",\"name\":\"...\"}\n- plot: {\"type\":\"plot\",\"series\":[{\"expr\":\"sin(x)\",\"label\":\"...\",\"kind\":\"line|area|scatter\"?,\"params\":[...]?}],\"xMin\":-5,\"xMax\":5,\"yMin\":?,\"yMax\":?,\"title\":\"...\"} \u2014 SVG \u51FD\u6570\u56FE\uFF08\u53EF\u62D6\u62FD\u5E73\u79FB/\u6EDA\u8F6E\u7F29\u653E\uFF1Bparams \u6E32\u67D3\u5B9E\u65F6\u6ED1\u5757\uFF09\uFF1Bkind \u7F3A\u7701 line\uFF0Carea \u586B\u5230\u57FA\u7EBF\uFF0Cscatter \u6563\u70B9\uFF1B\u8868\u8FBE\u5F0F\u767D\u540D\u5355 sin/cos/tan/asin/acos/atan/sqrt/cbrt/exp/log/ln/abs/floor/ceil/round/min/max/pow\uFF0C\u5E38\u91CF pi/e/tau\uFF0C\u53D8\u91CF x\n- callout: {\"type\":\"callout\",\"tone\":\"info|success|warning|error\",\"title\":\"...\",\"content\":\"...\"}\n- steps: {\"type\":\"steps\",\"current\":n,\"steps\":[{\"title\":\"...\",\"desc\":\"...\"}]}\n- keyvalue: {\"type\":\"keyvalue\",\"pairs\":[{\"key\":\"...\",\"value\":\"...\"}]} / json: {\"type\":\"json\",\"value\":...} / code: {\"type\":\"code\",\"lang\":\"ts\",\"code\":\"...\"} / diff: {\"type\":\"diff\",\"diffs\":[{\"path\":\"...\",\"oldText\":\"...\"|null,\"newText\":\"...\"}]}\n- copy: {\"type\":\"copy\",\"label\":\"\u590D\u5236\",\"text\":\"...\"}\n- mermaid: {\"type\":\"mermaid\",\"code\":\"graph TD\\nA-->B\"} \u2014 flowchart/sequence/class/gantt/pie/er/state/journey\n- scene3d: {\"type\":\"scene3d\",\"title\":\"...\",\"meshes\":[{\"shape\":\"box|sphere|cone|cylinder|torus\",\"color\":\"#hex?\",\"size\":n|[w,h,d]?,\"position\":[x,y,z]?,\"rotation\":[rx,ry,rz]?,\"scale\":n?|[x,y,z]?}],\"ambient\":0-2?,\"background\":\"#hex?\"} \u2014 \u62D6\u62FD\u65CB\u8F6C\u6EDA\u8F6E\u7F29\u653E\n- timeline: {\"type\":\"timeline\",\"items\":[{\"title\":\"...\",\"desc\":\"...\",\"time\":\"...\"}]}\n- file-tree: {\"type\":\"file-tree\",\"items\":[{\"name\":\"...\",\"type\":\"file|dir\",\"children\":[...]?}]} \u2014 \u76EE\u5F55\u884C\u53EF\u70B9\u51FB\u6298\u53E0\n- breadcrumb: {\"type\":\"breadcrumb\",\"items\":[\"\u9996\u9875\",\"\u8BBE\u7F6E\",\"\u8D26\u6237\"]}\n\nRules:\n- Trigger: \u7ED3\u6784\u5316\u8868\u8FBE\u4F18\u4E8E\u7EAF\u6587\u672C\u65F6\u5C31\u4E3B\u52A8\u7528\u56F4\u680F\uFF08\u8981\u70B9\u3001\u5F3A\u8C03\u3001\u5BF9\u6BD4\u3001\u6D41\u7A0B\u3001\u6B65\u9AA4\u3001\u72B6\u6001\u3001\u6570\u636E\u3001\u6F14\u793A\uFF09\uFF0C\u7EAF\u95EE\u7B54\u4E0E\u4E00\u53E5\u8BDD\u4E0D\u5957 UI\u3002\n- \u56F4\u680F\u653E\u5728\u56DE\u7B54\u4E2D\u8BE5\u7EC4\u4EF6\u8BE5\u5728\u7684\u4F4D\u7F6E\uFF0C\u6587\u5B57\u524D\u540E\u7167\u5E38\u6D41\u52A8\uFF1B\u4E0D\u8981\u628A\u56F4\u680F\u5957\u8FDB\u522B\u7684\u4EE3\u7801\u56F4\u680F\uFF0CJSON \u5B57\u7B26\u4E32\u5185\u4E0D\u653E markdown\u3002\n- Component choice (\u6BCF\u4E2A\u4E3B\u9898\u4E00\u4E2A\u4E3B\u7EC4\u4EF6): \u7ED3\u8BBA/\u63D0\u9192\u2192callout \u00B7 2\u20134 \u6307\u6807\u2192grid+stat \u00B7 \u8FDB\u5EA6\u2192progress \u00B7 \u591A\u9636\u6BB5\u2192steps \u00B7 \u8981\u70B9\u2192list \u00B7 \u914D\u7F6E\u2192keyvalue \u00B7 \u5BF9\u6BD4\u2192table \u00B7 \u8D8B\u52BF\u2192chart(line) \u00B7 \u5360\u6BD4\u2192chart(donut) \u00B7 \u5206\u7C7B\u5BF9\u6BD4\u2192chart(bars) \u00B7 \u6570\u5B66\u66F2\u7EBF\u2192plot \u00B7 \u4E8B\u4EF6\u2192timeline \u00B7 \u5206\u9875\u5185\u5BB9\u2192tabs \u00B7 \u957F\u5185\u5BB9\u2192accordion \u00B7 \u6811\u2192file-tree \u00B7 \u4EE3\u7801\u2192code \u00B7 \u6587\u4EF6\u53D8\u66F4\u2192diff \u00B7 \u5D4C\u5957JSON\u2192json \u00B7 \u67B6\u6784/\u6D41\u7A0B\u2192mermaid \u00B7 \u4EC5\u51E0\u4F55\u5185\u5BB9\u2192scene3d \u00B7 \u6559\u5B66\u2192quiz \u00B7 \u5355\u64CD\u4F5C\u2192button(action)\u3002\u4F18\u5148 table/chart \u800C\u975E\u6587\u5B57\u5806\u780C\uFF1B\u540C\u4E00\u6570\u636E\u4E0D\u91CD\u590D\u51FA\u73B0\u5728\u4E24\u4E2A\u7EC4\u4EF6\uFF1B\u6BCF\u6B21\u56DE\u590D 3\u20138 \u4E2A\u7EC4\u4EF6\uFF0C\u62FF\u4E0D\u51C6\u5C31\u5C11\u3002\n- \u8BED\u6CD5: \u574F\u56F4\u680F\u964D\u7EA7\u4E3A\u4EE3\u7801\u5757\uFF0C\u4FDD\u6301 JSON \u4E25\u683C\u3002\u22653 \u8282\u70B9\u6216\u542B table \u7684\u56F4\u680F\u53D1\u51FA\u524D\u8C03\u7528 validate_dsh_ui \u9A8C\u8BC1\uFF0C\u274C \u5219\u4FEE\u597D\u518D\u53D1\uFF1B\u82E5 \u274C \u56DE\u590D\u91CC\u9644\u4E86\u300C\u5DF2\u81EA\u52A8\u4FEE\u590D\u300D\u7684 JSON\uFF0C\u7167\u6284\u5373\u53EF\u3002\n- \u4E3B\u9898: \u5185\u5BB9\u9002\u914D\u6697\u8272\uFF1BUI \u4E3B\u9898\u8DDF\u968F app\uFF0C\u4E0D\u8981\u81EA\u9020\u3002\u89C4\u6A21: \u2264200 \u8282\u70B9\u3001\u5D4C\u5957\u22648 \u5C42\uFF08\u8D85\u51FA\u88AB\u622A\u65AD\uFF09\uFF1B3D \u7F51\u683C 1\u20135 \u4E2A\uFF1Bplot \u7ED9\u5408\u7406 xMin/xMax\u3002\n- v2 actions: button/input/select/checkbox/radio/switch/slider/textarea/quiz \u53EF\u5E26 \"action\":\"name\"\uFF0C\u4EA4\u4E92\u4EE5 [genui-action] name + \u7EC4\u4EF6\u6570\u636E\u56DE\u4F20\uFF0C\u5C4A\u65F6\u91CD\u6E32\u67D3\u66F4\u65B0 UI\u3002\u53EF\u4EA4\u4E92\u7EC4\u4EF6\u5FC5\u987B\u5E26 action\uFF08\u65E0 action \u6309\u94AE\u7981\u7528\uFF09\uFF1B\u5E26 action \u7684\u6309\u94AE\u70B9\u51FB\u6709\u300C\u5DF2\u89E6\u53D1\u300D\u672C\u5730\u53CD\u9988\u3002\n- LOCAL-FIRST: UI \u81EA\u5DF1\u80FD\u505A\u7684\u72B6\u6001\u53D8\u5316\uFF08\u5224\u5377\u3001\u5224\u9898\u3001\u91CD\u7F6E\u3001\u5C55\u5F00\u3001\u9009\u4E2D\uFF09\u5168\u90E8\u5C31\u5730\u5B8C\u6210\uFF0C\u96F6\u6A21\u578B\u5F80\u8FD4\uFF1Baction \u53EA\u7528\u4E8E\u5FC5\u987B\u6A21\u578B\u53C2\u4E0E\u7684\u4E8B\uFF08\u751F\u6210\u65B0\u5185\u5BB9\u3001\u6267\u884C\u5DE5\u5177\u3001\u4E0B\u4E00\u6B65\u5EFA\u8BAE\uFF09\u3002\n- Durable state: \u4EA4\u4E92\u72B6\u6001\u6309\u300C\u4F1A\u8BDD+\u5185\u5BB9\u6307\u7EB9\u300D\u6301\u4E45\u5316\u2014\u2014\u5237\u65B0/\u91CD\u653E\u540C\u4E00\u5185\u5BB9\u6062\u590D\u539F\u72B6\uFF1B\u6362\u5185\u5BB9\uFF08\u6362\u9898\u3001\u6539 spec\uFF09\u81EA\u52A8\u6E05\u7A7A\u3002\u91CD\u6E32\u67D3\u76F8\u540C\u5185\u5BB9\u4FDD\u7559\u72B6\u6001\uFF0C\u6E32\u67D3\u65B0\u5185\u5BB9\u91CD\u7F6E\u72B6\u6001\u3002\n- Exam pattern: \u6BCF\u9898\u4E00\u4E2A radio\uFF08group \u9898\u76EE\u540D + answer + explanation\uFF09+ \u4E00\u4E2A submit\uFF08groups \u5168\u5217\uFF09\uFF1B\u7528\u6237\u7B54\u5B8C\u70B9\u4EA4\u5377\uFF0C\u672C\u5730\u5373\u65F6\u5224\u5206\u3002\u4EC5\u5F53\u7528\u6237\u8981\u65B0\u5377\u6216\u8FFD\u95EE\u5EFA\u8BAE\u65F6\u624D\u91CD\u6E32\u67D3\u3002\n- Secrets ban: GenUI \u4E0D\u5F97\u7D22\u53D6\u5BC6\u7801\u3001API Key\u3001\u8BBF\u95EE\u4EE4\u724C\u3001\u6062\u590D\u7801\u7B49\u79D8\u5BC6\uFF1B\u9700\u8981\u65F6\u62D2\u7EDD\u5E76\u89E3\u91CA\u3002\n- Tool channel: render_ui \u5DE5\u5177\u628A\u540C\u4E00 spec \u6E32\u67D3\u4E3A\u5DE5\u5177\u884C\u5361\u7247\uFF08\u4EA4\u4ED8\u7269\u578B\u754C\u9762\u7528\uFF09\uFF1B\u56F4\u680F\u7528\u4E8E\u56DE\u7B54\u5185\u8054 UI\u3002\n- Panel: \"panel\":true \u56F4\u680F\u53EA\u6E32\u67D3\u8FDB\u4F1A\u8BDD\u9762\u677F dock \u5E76\u539F\u5730\u66F4\u65B0\uFF1B\"append\":true \u8FFD\u52A0\u5408\u5E76\uFF08\u540C\u6807\u7B7E tabs \u8FFD\u52A0/\u65B0\u6807\u7B7E\u52A0\u5165/\u5C3E\u90E8\u8FFD\u52A0\uFF09\uFF1B\u9762\u677F\u4E0A\u9650 200 \u8282\u70B9/200 \u6B21\u8FFD\u52A0\uFF0C\u6EE1\u4E86\u53D1 replace \u91CD\u5EFA\u3002\u9762\u677F\u7EC4\u4EF6\u6765\u7684 [genui-action] \u53EA\u56DE\u4E00\u4E2A panel:true \u56F4\u680F + \u81F3\u591A\u4E00\u884C 10 \u5B57\u4EE5\u5185\u786E\u8BA4\uFF0C\u4E0D\u89E3\u91CA\u3001\u4E0D\u7528\u666E\u901A\u56F4\u680F\u3002"; +export declare const GENUI_SECTION_TEXT = "You can render interactive UI components INSIDE your reply \u2014 between paragraphs \u2014 by emitting a fenced block with the language tag `dsh-ui` containing a JSON spec:\n\n```dsh-ui\n{\"title\":\"\u53EF\u9009\u6807\u9898\",\"gap\":14,\"items\":[...]}\n```\n\nThe spec is a white-listed component tree rendered inline where the fence sits. Vocabulary (only these `type` values; the `genui` skill, when available, carries the fuller content\u2192component mapping and field details):\n\n- text: {\"type\":\"text\",\"size\":\"h1|h2|h3|body|muted|caption\",\"content\":\"...\",\"center\":true?}\n- row / col: {\"type\":\"row\"|\"col\",\"items\":[...],\"wrap\":true?,\"spacer\":true?,\"gap\":n?} \u2014 \u5E03\u5C40\u5BB9\u5668\n- grid: {\"type\":\"grid\",\"cols\":n,\"items\":[...]} / card: {\"type\":\"card\",\"title\":\"...\",\"items\":[...]}\n- button: {\"type\":\"button\",\"label\":\"...\",\"tone\":\"primary|danger|success|ghost\",\"full\":true?,\"small\":true?,\"icon\":\"emoji?\",\"action\":\"name\"?} \u2014 \u65E0 action \u65F6\u6E32\u67D3\u4E3A\u7981\u7528\u6001\n- input / textarea: {\"type\":\"input\"|\"textarea\",\"label\":\"...\",\"placeholder\":\"...\",\"inputType\":\"text|email\"?,\"rows\":n?,\"value\":\"...\",\"action\":\"name\"?,\"id\":\"field-id\"?} \u2014 input \u6309 Enter \u63D0\u4EA4\uFF08submit:true\uFF09\u3001textarea Ctrl/Cmd+Enter\uFF1Bblur \u4EC5\u503C\u6709\u53D8\u5316\u624D\u53D1\u9001\uFF1B\u5E26 id \u7684\u503C\u8DE8\u5237\u65B0\u6301\u4E45\u5316\u5E76\u88AB sibling submit \u6536\u96C6\u4E3A fields:{id:value}\n- select: {\"type\":\"select\",\"label\":\"...\",\"options\":[...],\"selected\":\u4E0B\u6807?,\"action\":\"name\"?,\"id\":\"field-id\"?} \u2014 id/selected \u8BED\u4E49\u540C input\n- checkbox / switch / slider: {\"type\":\"checkbox\"|\"switch\",\"label\":\"...\",\"checked\":true?,\"action\":\"name\"?} \u00B7 {\"type\":\"slider\",\"label\":\"...\",\"min\":0,\"max\":100,\"step\":1,\"value\":n?,\"action\":\"name\"?,\"id\":\"field-id\"?} \u2014 slider \u662F\u6570\u503C\u8868\u5355\uFF1Aid \u6301\u4E45\u5316\u5E76\u8FDB submit \u7684 fields\n- radio: {\"type\":\"radio\",\"label\":\"...\",\"options\":[...],\"selected\":n?,\"action\":\"name\"?} \u2014 \u52A0 \"group\":\"\u9898\u76EE\u540D\" \u8BB0\u5F55\u9009\u62E9\uFF08\u70B9\u51FB\u4E0D\u5F80\u8FD4\uFF09\uFF1B\u518D\u52A0 \"answer\":\u6B63\u786E\u4E0B\u6807|\u6807\u7B7E \u4E0E \"explanation\":\"\u89E3\u6790\" \u4F9B sibling submit \u672C\u5730\u5224\u5206\n- submit: {\"type\":\"submit\",\"label\":\"\u4EA4\u5377\",\"groups\":[\"q1\"]?,\"action\":\"name\"?,\"resetAction\":\"name\"?} \u2014 LOCAL-FIRST\uFF1A\u9898\u76EE\u5E26 answer \u65F6\u70B9\u51FB\u5C31\u5730\u5224\u5206\uFF08\u5F97\u5206 + \u9010\u9898 \u2713/\u2717 + \u89E3\u6790\uFF09\u5E76\u9501\u5B9A\u81F3\u300C\u91CD\u65B0\u4F5C\u7B54\u300D\uFF0C\u96F6\u5F80\u8FD4\u3001\u65E0\u9700 action\uFF1B\u4EC5\u5F53\u65E0 answer \u65F6\u624D\u53D1\u4E00\u4E2A action {answers:{group:choice},fields:{id:value},total,answered}\uFF1B\u672A\u7B54\u5B8C\u4FDD\u6301\u7981\u7528\n- quiz: {\"type\":\"quiz\",\"question\":\"...\",\"options\":[{\"label\":\"...\",\"correct\":true?,\"feedback\":\"...\"?}],\"explanation\":\"...\",\"id\":\"...\"?,\"action\":\"name\"?} \u2014 \u70B9\u9009\u5C31\u5730\u5224\u5BF9\u9519 + \u91CD\u8BD5\uFF1Bid \u53D8\u5316\u91CD\u7F6E\uFF1B\u5E26 action \u65F6\u53E6\u56DE\u4F20 {type:'quiz',question,answer,correct}\n- link: {\"type\":\"link\",\"label\":\"...\",\"href\":\"https://...\"?} \u2014 \u4EC5 http(s)/mailto\uFF1B\u65E0 href \u6E32\u67D3\u4E3A\u7EAF\u6587\u672C\n- badge: {\"type\":\"badge\",\"label\":\"...\",\"tone\":\"success|warn|danger|accent\",\"icon\":\"emoji?\"}\n- stat: {\"type\":\"stat\",\"label\":\"...\",\"value\":\"...\",\"delta\":\"+12.4%|-3%\"}\n- progress: {\"type\":\"progress\",\"label\":\"...\",\"value\":0-100,\"valueLabel\":\"70%\"}\n- divider: {\"type\":\"divider\"} / spacer: {\"type\":\"spacer\"}\n- list: {\"type\":\"list\",\"items\":[\"...\"] or [{\"title\":\"...\",\"desc\":\"...\"}]}\n- table: {\"type\":\"table\",\"columns\":[\"...\"],\"rows\":[[\"...\",\"...\"]]} \u2014 \u8868\u5934\u70B9\u51FB\u672C\u5730\u6392\u5E8F\uFF08\u5347/\u964D/\u8FD8\u539F\uFF0C\u6570\u503C\u611F\u77E5\uFF09\n- chart: {\"type\":\"chart\",\"kind\":\"bars|line|donut\",\"data\":[{\"label\":\"...\",\"value\":n,\"color\":\"#hex?\"}],\"series\":[...]?} \u2014 bars \u9ED8\u8BA4\uFF1Bline \u8D8B\u52BF\uFF1Bdonut \u5360\u6BD4\uFF1Bseries=\u5206\u7EC4\u67F1\uFF1B\u8D1F\u503C\u67F1\u9AD8\u4E3A 0 \u4F46\u6807\u6CE8\u7167\u663E\uFF1Bhover \u663E\u793A\u7CBE\u786E\u503C\n- echart: {\"type\":\"echart\",\"preset\":\"bar|line|area|pie|scatter\",\"title\":\"...\"?,\"height\":n?,\"data\":[{\"label\":\"...\",\"value:n}]?,\"series\":[...]?} \u2014 ECharts \u5168\u529F\u80FD\u56FE\u8868\uFF08\u6E10\u53D8/tooltip/\u52A8\u753B/\u56FE\u4F8B\u4EA4\u4E92\uFF09\uFF0C\u89C6\u89C9\u6548\u679C\u8FDC\u8D85 chart\uFF1Bpreset \u6A21\u5F0F\u7528\u548C chart \u4E00\u6837\u7684 data/series \u683C\u5F0F\u81EA\u52A8\u6784\u5EFA\u4E3B\u9898\u5316\u914D\u7F6E\uFF1B\u4E5F\u53EF\u4F20 \"option\":{...} \u5199\u539F\u751F ECharts \u914D\u7F6E\uFF08\u652F\u6301 radar/gauge/heatmap/dataZoom \u7B49\uFF0Coption \u4E2D\u7684\u51FD\u6570\u4F1A\u88AB\u8FC7\u6EE4\uFF09\uFF1B\u63A8\u8350\u7528 echart \u66FF\u4EE3 chart\n- tabs: {\"type\":\"tabs\",\"tabs\":[{\"label\":\"...\",\"items\":[...]}]} / accordion: {\"type\":\"accordion\",\"items\":[{\"title\":\"...\",\"items\":[...]}]}\n- avatar: {\"type\":\"avatar\",\"name\":\"...\"}\n- plot: {\"type\":\"plot\",\"series\":[{\"expr\":\"sin(x)\",\"label\":\"...\",\"kind\":\"line|area|scatter\"?,\"params\":[...]?}],\"xMin\":-5,\"xMax\":5,\"yMin\":?,\"yMax\":?,\"title\":\"...\"} \u2014 SVG \u51FD\u6570\u56FE\uFF08\u53EF\u62D6\u62FD\u5E73\u79FB/\u6EDA\u8F6E\u7F29\u653E\uFF1Bparams \u6E32\u67D3\u5B9E\u65F6\u6ED1\u5757\uFF09\uFF1Bkind \u7F3A\u7701 line\uFF0Carea \u586B\u5230\u57FA\u7EBF\uFF0Cscatter \u6563\u70B9\uFF1B\u8868\u8FBE\u5F0F\u767D\u540D\u5355 sin/cos/tan/asin/acos/atan/sqrt/cbrt/exp/log/ln/abs/floor/ceil/round/min/max/pow\uFF0C\u5E38\u91CF pi/e/tau\uFF0C\u53D8\u91CF x\n- callout: {\"type\":\"callout\",\"tone\":\"info|success|warning|error\",\"title\":\"...\",\"content\":\"...\"}\n- steps: {\"type\":\"steps\",\"current\":n,\"steps\":[{\"title\":\"...\",\"desc\":\"...\"}]}\n- keyvalue: {\"type\":\"keyvalue\",\"pairs\":[{\"key\":\"...\",\"value\":\"...\"}]} / json: {\"type\":\"json\",\"value\":...} / code: {\"type\":\"code\",\"lang\":\"ts\",\"code\":\"...\"} / diff: {\"type\":\"diff\",\"diffs\":[{\"path\":\"...\",\"oldText\":\"...\"|null,\"newText\":\"...\"}]}\n- copy: {\"type\":\"copy\",\"label\":\"\u590D\u5236\",\"text\":\"...\"}\n- mermaid: {\"type\":\"mermaid\",\"code\":\"graph TD\\nA-->B\"} \u2014 flowchart/sequence/class/gantt/pie/er/state/journey\n- scene3d: {\"type\":\"scene3d\",\"title\":\"...\",\"meshes\":[{\"shape\":\"box|sphere|cone|cylinder|torus\",\"color\":\"#hex?\",\"size\":n|[w,h,d]?,\"position\":[x,y,z]?,\"rotation\":[rx,ry,rz]?,\"scale\":n?|[x,y,z]?}],\"ambient\":0-2?,\"background\":\"#hex?\"} \u2014 \u62D6\u62FD\u65CB\u8F6C\u6EDA\u8F6E\u7F29\u653E\n- timeline: {\"type\":\"timeline\",\"items\":[{\"title\":\"...\",\"desc\":\"...\",\"time\":\"...\"}]}\n- file-tree: {\"type\":\"file-tree\",\"items\":[{\"name\":\"...\",\"type\":\"file|dir\",\"children\":[...]?}]} \u2014 \u76EE\u5F55\u884C\u53EF\u70B9\u51FB\u6298\u53E0\n- breadcrumb: {\"type\":\"breadcrumb\",\"items\":[\"\u9996\u9875\",\"\u8BBE\u7F6E\",\"\u8D26\u6237\"]}\n\nRules:\n- Trigger: \u7ED3\u6784\u5316\u8868\u8FBE\u4F18\u4E8E\u7EAF\u6587\u672C\u65F6\u5C31\u4E3B\u52A8\u7528\u56F4\u680F\uFF08\u8981\u70B9\u3001\u5F3A\u8C03\u3001\u5BF9\u6BD4\u3001\u6D41\u7A0B\u3001\u6B65\u9AA4\u3001\u72B6\u6001\u3001\u6570\u636E\u3001\u6F14\u793A\uFF09\uFF0C\u7EAF\u95EE\u7B54\u4E0E\u4E00\u53E5\u8BDD\u4E0D\u5957 UI\u3002\n- \u56F4\u680F\u653E\u5728\u56DE\u7B54\u4E2D\u8BE5\u7EC4\u4EF6\u8BE5\u5728\u7684\u4F4D\u7F6E\uFF0C\u6587\u5B57\u524D\u540E\u7167\u5E38\u6D41\u52A8\uFF1B\u4E0D\u8981\u628A\u56F4\u680F\u5957\u8FDB\u522B\u7684\u4EE3\u7801\u56F4\u680F\uFF0CJSON \u5B57\u7B26\u4E32\u5185\u4E0D\u653E markdown\u3002\n- Component choice (\u6BCF\u4E2A\u4E3B\u9898\u4E00\u4E2A\u4E3B\u7EC4\u4EF6): \u7ED3\u8BBA/\u63D0\u9192\u2192callout \u00B7 2\u20134 \u6307\u6807\u2192grid+stat \u00B7 \u8FDB\u5EA6\u2192progress \u00B7 \u591A\u9636\u6BB5\u2192steps \u00B7 \u8981\u70B9\u2192list \u00B7 \u914D\u7F6E\u2192keyvalue \u00B7 \u5BF9\u6BD4\u2192table \u00B7 \u8D8B\u52BF\u2192echart(line) \u6216 chart(line) \u00B7 \u5360\u6BD4\u2192echart(pie) \u6216 chart(donut) \u00B7 \u5206\u7C7B\u5BF9\u6BD4\u2192echart(bar) \u6216 chart(bars) \u00B7 \u6570\u5B66\u66F2\u7EBF\u2192plot \u00B7 \u4E8B\u4EF6\u2192timeline \u00B7 \u5206\u9875\u5185\u5BB9\u2192tabs \u00B7 \u957F\u5185\u5BB9\u2192accordion \u00B7 \u6811\u2192file-tree \u00B7 \u4EE3\u7801\u2192code \u00B7 \u6587\u4EF6\u53D8\u66F4\u2192diff \u00B7 \u5D4C\u5957JSON\u2192json \u00B7 \u67B6\u6784/\u6D41\u7A0B\u2192mermaid \u00B7 \u4EC5\u51E0\u4F55\u5185\u5BB9\u2192scene3d \u00B7 \u6559\u5B66\u2192quiz \u00B7 \u5355\u64CD\u4F5C\u2192button(action)\u3002\u4F18\u5148 echart/table \u800C\u975E\u6587\u5B57\u5806\u780C\uFF1B\u540C\u4E00\u6570\u636E\u4E0D\u91CD\u590D\u51FA\u73B0\u5728\u4E24\u4E2A\u7EC4\u4EF6\uFF1B\u6BCF\u6B21\u56DE\u590D 3\u20138 \u4E2A\u7EC4\u4EF6\uFF0C\u62FF\u4E0D\u51C6\u5C31\u5C11\u3002\n- \u8BED\u6CD5: \u574F\u56F4\u680F\u964D\u7EA7\u4E3A\u4EE3\u7801\u5757\uFF0C\u4FDD\u6301 JSON \u4E25\u683C\u3002\u22653 \u8282\u70B9\u6216\u542B table \u7684\u56F4\u680F\u53D1\u51FA\u524D\u8C03\u7528 validate_dsh_ui \u9A8C\u8BC1\uFF0C\u274C \u5219\u4FEE\u597D\u518D\u53D1\uFF1B\u82E5 \u274C \u56DE\u590D\u91CC\u9644\u4E86\u300C\u5DF2\u81EA\u52A8\u4FEE\u590D\u300D\u7684 JSON\uFF0C\u7167\u6284\u5373\u53EF\u3002\n- \u4E3B\u9898: \u5185\u5BB9\u9002\u914D\u6697\u8272\uFF1BUI \u4E3B\u9898\u8DDF\u968F app\uFF0C\u4E0D\u8981\u81EA\u9020\u3002\u89C4\u6A21: \u2264200 \u8282\u70B9\u3001\u5D4C\u5957\u22648 \u5C42\uFF08\u8D85\u51FA\u88AB\u622A\u65AD\uFF09\uFF1B3D \u7F51\u683C 1\u20135 \u4E2A\uFF1Bplot \u7ED9\u5408\u7406 xMin/xMax\u3002\n- v2 actions: button/input/select/checkbox/radio/switch/slider/textarea/quiz \u53EF\u5E26 \"action\":\"name\"\uFF0C\u4EA4\u4E92\u4EE5 [genui-action] name + \u7EC4\u4EF6\u6570\u636E\u56DE\u4F20\uFF0C\u5C4A\u65F6\u91CD\u6E32\u67D3\u66F4\u65B0 UI\u3002\u53EF\u4EA4\u4E92\u7EC4\u4EF6\u5FC5\u987B\u5E26 action\uFF08\u65E0 action \u6309\u94AE\u7981\u7528\uFF09\uFF1B\u5E26 action \u7684\u6309\u94AE\u70B9\u51FB\u6709\u300C\u5DF2\u89E6\u53D1\u300D\u672C\u5730\u53CD\u9988\u3002\n- LOCAL-FIRST: UI \u81EA\u5DF1\u80FD\u505A\u7684\u72B6\u6001\u53D8\u5316\uFF08\u5224\u5377\u3001\u5224\u9898\u3001\u91CD\u7F6E\u3001\u5C55\u5F00\u3001\u9009\u4E2D\uFF09\u5168\u90E8\u5C31\u5730\u5B8C\u6210\uFF0C\u96F6\u6A21\u578B\u5F80\u8FD4\uFF1Baction \u53EA\u7528\u4E8E\u5FC5\u987B\u6A21\u578B\u53C2\u4E0E\u7684\u4E8B\uFF08\u751F\u6210\u65B0\u5185\u5BB9\u3001\u6267\u884C\u5DE5\u5177\u3001\u4E0B\u4E00\u6B65\u5EFA\u8BAE\uFF09\u3002\n- Durable state: \u4EA4\u4E92\u72B6\u6001\u6309\u300C\u4F1A\u8BDD+\u5185\u5BB9\u6307\u7EB9\u300D\u6301\u4E45\u5316\u2014\u2014\u5237\u65B0/\u91CD\u653E\u540C\u4E00\u5185\u5BB9\u6062\u590D\u539F\u72B6\uFF1B\u6362\u5185\u5BB9\uFF08\u6362\u9898\u3001\u6539 spec\uFF09\u81EA\u52A8\u6E05\u7A7A\u3002\u91CD\u6E32\u67D3\u76F8\u540C\u5185\u5BB9\u4FDD\u7559\u72B6\u6001\uFF0C\u6E32\u67D3\u65B0\u5185\u5BB9\u91CD\u7F6E\u72B6\u6001\u3002\n- Exam pattern: \u6BCF\u9898\u4E00\u4E2A radio\uFF08group \u9898\u76EE\u540D + answer + explanation\uFF09+ \u4E00\u4E2A submit\uFF08groups \u5168\u5217\uFF09\uFF1B\u7528\u6237\u7B54\u5B8C\u70B9\u4EA4\u5377\uFF0C\u672C\u5730\u5373\u65F6\u5224\u5206\u3002\u4EC5\u5F53\u7528\u6237\u8981\u65B0\u5377\u6216\u8FFD\u95EE\u5EFA\u8BAE\u65F6\u624D\u91CD\u6E32\u67D3\u3002\n- Secrets ban: GenUI \u4E0D\u5F97\u7D22\u53D6\u5BC6\u7801\u3001API Key\u3001\u8BBF\u95EE\u4EE4\u724C\u3001\u6062\u590D\u7801\u7B49\u79D8\u5BC6\uFF1B\u9700\u8981\u65F6\u62D2\u7EDD\u5E76\u89E3\u91CA\u3002\n- Tool channel: render_ui \u5DE5\u5177\u628A\u540C\u4E00 spec \u6E32\u67D3\u4E3A\u5DE5\u5177\u884C\u5361\u7247\uFF08\u4EA4\u4ED8\u7269\u578B\u754C\u9762\u7528\uFF09\uFF1B\u56F4\u680F\u7528\u4E8E\u56DE\u7B54\u5185\u8054 UI\u3002\n- Panel: \"panel\":true \u56F4\u680F\u53EA\u6E32\u67D3\u8FDB\u4F1A\u8BDD\u9762\u677F dock \u5E76\u539F\u5730\u66F4\u65B0\uFF1B\"append\":true \u8FFD\u52A0\u5408\u5E76\uFF08\u540C\u6807\u7B7E tabs \u8FFD\u52A0/\u65B0\u6807\u7B7E\u52A0\u5165/\u5C3E\u90E8\u8FFD\u52A0\uFF09\uFF1B\u9762\u677F\u4E0A\u9650 200 \u8282\u70B9/200 \u6B21\u8FFD\u52A0\uFF0C\u6EE1\u4E86\u53D1 replace \u91CD\u5EFA\u3002\u9762\u677F\u7EC4\u4EF6\u6765\u7684 [genui-action] \u53EA\u56DE\u4E00\u4E2A panel:true \u56F4\u680F + \u81F3\u591A\u4E00\u884C 10 \u5B57\u4EE5\u5185\u786E\u8BA4\uFF0C\u4E0D\u89E3\u91CA\u3001\u4E0D\u7528\u666E\u901A\u56F4\u680F\u3002"; /** * Register the GenUI output-language section and the render_ui tool. * @param ctx - cordis context. diff --git a/package.json b/package.json index 51acdb2..f60147e 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "lib/client.js", "lib/assets/mermaid.js", "lib/assets/three.js", + "lib/assets/echarts.js", "lib/types/plugin/index.d.ts", "lib/types/plugin/invariant.d.ts", "lib/types/client/index.d.ts", @@ -88,6 +89,7 @@ "typescript": "^5.6.0", "vite": "^6.0.0", "vitest": "^3.0.0", + "echarts": "^5.6.0", "mermaid": "11.16.0", "three": "^0.180.0", "react-dom": "^18.3.1" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index f6777a1..b697cf7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -57,6 +57,9 @@ importers: '@types/three': specifier: ^0.185.4 version: 0.185.4 + echarts: + specifier: ^5.6.0 + version: 5.6.0 jsdom: specifier: ^25.0.0 version: 25.0.1 @@ -2007,6 +2010,9 @@ packages: resolution: {integrity: sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==} engines: {node: '>= 0.4'} + echarts@5.6.0: + resolution: {integrity: sha512-oTbVTsXfKuEhxftHqL5xprgLoc0k7uScAwtryCgWF6hPYFLRwOUHiFmHGCBKP5NPFNkDVopOieyUqYGH8Fa3kA==} + empathic@2.0.1: resolution: {integrity: sha512-YGRs8knHhKHVShLkFET/rWAU8kmHbOV5LwN938RHI0pljAJ1Gf6SzXsSmRaEzcXTtOOmVqJ5+WtQPL5uigY50Q==} engines: {node: '>=14'} @@ -2709,6 +2715,9 @@ packages: unrun: optional: true + tslib@2.3.0: + resolution: {integrity: sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==} + tsx@4.23.12: resolution: {integrity: sha512-FDf4L4sYzKtzWYhU/Xm0AQFdTjdIxNo9ElTf2mxXM6k8YMHXzYUe4yODVaXP4V9uMFbVg8c0qyBccK2OOxb45Q==} engines: {node: '>=18.0.0'} @@ -2892,6 +2901,9 @@ packages: zod@4.4.3: resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==} + zrender@5.6.1: + resolution: {integrity: sha512-OFXkDJKcrlx5su2XbzJvj/34Q3m6PvyCZkVPHGYpcCJ52ek4U/ymZyfuV1nKE23AyBJ51E/6Yr0mhZ7xGTO4ag==} + zustand@4.4.7: resolution: {integrity: sha512-QFJWJMdlETcI69paJwhSMJz7PPWjVP8Sjhclxmxmxv/RYI7ZOvR5BHX+ktH0we9gTWQMxcne8q1OY8xxz604gw==} engines: {node: '>=12.7.0'} @@ -4628,6 +4640,11 @@ snapshots: es-errors: 1.3.0 gopd: 1.2.0 + echarts@5.6.0: + dependencies: + tslib: 2.3.0 + zrender: 5.6.1 + empathic@2.0.1: {} entities@6.0.1: {} @@ -5577,6 +5594,8 @@ snapshots: - oxc-resolver - vue-tsc + tslib@2.3.0: {} + tsx@4.23.12: dependencies: esbuild: 0.28.2 @@ -5785,6 +5804,10 @@ snapshots: zod@4.4.3: {} + zrender@5.6.1: + dependencies: + tslib: 2.3.0 + zustand@4.4.7(@types/react@18.3.31)(immer@10.2.0)(react@18.3.1): dependencies: use-sync-external-store: 1.2.0(react@18.3.1) diff --git a/src/client/EChartNode.tsx b/src/client/EChartNode.tsx new file mode 100644 index 0000000..c6a3192 --- /dev/null +++ b/src/client/EChartNode.tsx @@ -0,0 +1,210 @@ +/** + * ECharts node: renders a full ECharts chart from a declarative option + * object. The echarts engine is lazy-loaded (lib/assets/echarts.js) only when + * an `echart` node appears — the main client bundle never carries the engine. + * + * The `option` field accepts a standard ECharts `EChartsCoreOption`. For + * simple use cases the `preset` + `data` shorthand builds the option + * automatically: `preset: 'bar' | 'line' | 'pie' | 'scatter' | 'area'` maps + * to a themed option template that reads the same `data`/`series` shape as + * the `chart` node, so a model can upgrade a `chart` to ECharts by changing + * `type` to `echart` and adding `preset`. + * @module @omdsh-dev/dsh-genui/client/EChartNode + */ +import { useEffect, useRef, useState } from 'react' +import css from './GenuiBlock.module.css' +import { createChart as lazyCreateChart, type EChartsInstance } from './echarts-lazy.ts' +import { CHART_COLORS } from './blocks/charts.tsx' +import type { GenuiEChart } from './spec.ts' + +/** Read a CSS custom property from the document root (host theme token). */ +function readToken(name: string, fallback: string): string { + const v = getComputedStyle(document.documentElement).getPropertyValue(name).trim() + return v || fallback +} + +/** Resolve the host accent and label colors for ECharts theming. */ +function themeColors(): { + accent: string + labelPrimary: string + labelSecondary: string + labelTertiary: string + border: string + bgLayer1: string +} { + return { + accent: readToken('--dsw-alias-state-business-primary', '#4f8ef7'), + labelPrimary: readToken('--dsw-alias-label-primary', '#e6e6e6'), + labelSecondary: readToken('--dsw-alias-label-secondary', '#a0a0a0'), + labelTertiary: readToken('--dsw-alias-label-tertiary', '#6b6b6b'), + border: readToken('--dsw-alias-border-l1', 'rgba(255,255,255,0.12)'), + bgLayer1: readToken('--dsw-alias-bg-layer-1', '#1a1a1e'), + } +} + +/** Build a full ECharts option from a preset + the simple data/series shape. */ +function presetOption(node: GenuiEChart): Record { + const t = themeColors() + const colors = CHART_COLORS.map(c => readToken(c.replace('var(', '').replace(')', ''), t.accent)) + const data = node.data ?? [] + const series = node.series + + const base = { + color: colors, + textStyle: { color: t.labelSecondary, fontFamily: 'inherit' }, + backgroundColor: 'transparent', + grid: { left: 48, right: 16, top: 24, bottom: 32 }, + tooltip: { trigger: 'item', backgroundColor: t.bgLayer1, borderColor: t.border, textStyle: { color: t.labelPrimary } }, + } + + switch (node.preset) { + case 'pie': { + return { + ...base, + tooltip: { trigger: 'item', formatter: '{b}: {c} ({d}%)', backgroundColor: t.bgLayer1, borderColor: t.border, textStyle: { color: t.labelPrimary } }, + legend: { bottom: 0, textStyle: { color: t.labelTertiary } }, + series: [{ + type: 'pie', + radius: ['40%', '70%'], + avoidLabelOverlap: true, + itemStyle: { borderRadius: 6, borderColor: t.bgLayer1, borderWidth: 2 }, + label: { color: t.labelSecondary }, + data: data.map(d => ({ name: d.label, value: d.value })), + }], + } + } + case 'scatter': { + return { + ...base, + tooltip: { trigger: 'item', backgroundColor: t.bgLayer1, borderColor: t.border, textStyle: { color: t.labelPrimary } }, + xAxis: { type: 'value', axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary }, splitLine: { lineStyle: { color: t.border, opacity: 0.5 } } }, + yAxis: { type: 'value', axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary }, splitLine: { lineStyle: { color: t.border, opacity: 0.5 } } }, + series: [{ + type: 'scatter', + symbolSize: 10, + data: data.map(d => [d.label, d.value]), + }], + } + } + case 'area': { + return { + ...base, + tooltip: { trigger: 'axis', backgroundColor: t.bgLayer1, borderColor: t.border, textStyle: { color: t.labelPrimary } }, + xAxis: { type: 'category', data: data.map(d => d.label), axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary } }, + yAxis: { type: 'value', axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary }, splitLine: { lineStyle: { color: t.border, opacity: 0.5 } } }, + series: (series ?? [{ label: '', data }]).map(s => ({ + name: s.label, + type: 'line', + smooth: true, + areaStyle: { opacity: 0.15 }, + data: s.data.map(d => d.value), + })), + legend: series !== undefined ? { bottom: 0, textStyle: { color: t.labelTertiary } } : undefined, + } + } + case 'line': { + return { + ...base, + tooltip: { trigger: 'axis', backgroundColor: t.bgLayer1, borderColor: t.border, textStyle: { color: t.labelPrimary } }, + xAxis: { type: 'category', data: data.map(d => d.label), axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary } }, + yAxis: { type: 'value', axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary }, splitLine: { lineStyle: { color: t.border, opacity: 0.5 } } }, + series: (series ?? [{ label: '', data }]).map(s => ({ + name: s.label, + type: 'line', + smooth: true, + showSymbol: true, + symbolSize: 6, + data: s.data.map(d => d.value), + })), + legend: series !== undefined ? { bottom: 0, textStyle: { color: t.labelTertiary } } : undefined, + } + } + default: { + // 'bar' or unspecified + return { + ...base, + tooltip: { trigger: 'axis', axisPointer: { type: 'shadow' }, backgroundColor: t.bgLayer1, borderColor: t.border, textStyle: { color: t.labelPrimary } }, + xAxis: { type: 'category', data: data.map(d => d.label), axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary } }, + yAxis: { type: 'value', axisLine: { lineStyle: { color: t.border } }, axisLabel: { color: t.labelTertiary }, splitLine: { lineStyle: { color: t.border, opacity: 0.5 } } }, + series: (series ?? [{ label: '', data }]).map(s => ({ + name: s.label, + type: 'bar', + barMaxWidth: 40, + itemStyle: { borderRadius: [4, 4, 2, 2] }, + data: s.data.map(d => d.value), + })), + legend: series !== undefined ? { bottom: 0, textStyle: { color: t.labelTertiary } } : undefined, + } + } + } +} + +export function EChartNode({ node }: { node: GenuiEChart }) { + const ref = useRef(null) + const [status, setStatus] = useState<'loading' | 'ready' | 'error'>('loading') + const instanceRef = useRef(null) + + useEffect(() => { + let alive = true + const el = ref.current + if (el === null) return + + // Full `option` wins over preset shorthand. + const option = node.option ?? presetOption(node) + + void lazyCreateChart(el, option, { height: node.height ?? 300 }).then((inst) => { + if (!alive) { + inst.dispose() + return + } + instanceRef.current = inst + setStatus('ready') + }).catch(() => { + if (alive) setStatus('error') + }) + + return () => { + alive = false + instanceRef.current?.dispose() + instanceRef.current = null + } + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []) + + // Resize observer: keep the chart responsive. + useEffect(() => { + if (status !== 'ready') return + const el = ref.current + if (el === null) return + const ro = new ResizeObserver(() => { + instanceRef.current?.resize() + }) + ro.observe(el) + return () => { ro.disconnect() } + }, [status]) + + // Update option when the node changes (model re-render). + useEffect(() => { + if (status !== 'ready' || instanceRef.current === null) return + const option = node.option ?? presetOption(node) + instanceRef.current.setOption(option, true) + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [node]) + + if (status === 'error') { + return ( +
+
ECharts 渲染失败
+ {node.title !== undefined &&
{node.title}
} +
+ ) + } + + return ( +
+ {node.title !== undefined &&
{node.title}
} +
+ {status === 'loading' &&
加载图表…
} +
+ ) +} diff --git a/src/client/GenuiBlock.module.css b/src/client/GenuiBlock.module.css index 0072bb2..8743dea 100644 --- a/src/client/GenuiBlock.module.css +++ b/src/client/GenuiBlock.module.css @@ -742,6 +742,44 @@ /* ---------- scene3d ---------- */ .scene3dWrap { display: flex; flex-direction: column; gap: var(--dsl-g-gap-sm); } + +/* ---------- echart ---------- */ + +.echartWrap { + display: flex; + flex-direction: column; + gap: var(--dsl-g-gap-sm); + padding: var(--dsl-g-gap-md); + background: var(--dsw-alias-bg-layer-1, var(--dsw-alias-markdown-code-block)); + border: 1px solid var(--dsl-g-border); + border-radius: var(--dsl-g-radius-surface); +} +.echartTitle { + font-size: var(--dsl-g-font-title); + font-weight: 600; + color: var(--dsw-alias-label-primary); +} +.echartCanvas { + width: 100%; + min-height: 0; +} +.echartHint { + color: var(--dsw-alias-label-tertiary); + font-size: var(--dsl-g-font-meta); +} +.echartFallback { + display: flex; + flex-direction: column; + gap: var(--dsl-g-gap-sm); + padding: var(--dsl-g-gap-md); + background: var(--dsw-alias-bg-layer-1, var(--dsw-alias-markdown-code-block)); + border: 1px solid var(--dsl-g-border); + border-radius: var(--dsl-g-radius-surface); +} +.echartErr { + color: var(--dsw-alias-state-error-primary, #ff6b6b); + font-size: var(--dsl-g-font-meta); +} .scene3dTitle { font-size: var(--dsl-g-font-title); font-weight: 700; color: var(--dsw-alias-label-primary); } .scene3dCanvas { height: 240px; diff --git a/src/client/asset-echarts.ts b/src/client/asset-echarts.ts new file mode 100644 index 0000000..f49d9df --- /dev/null +++ b/src/client/asset-echarts.ts @@ -0,0 +1,25 @@ +/** + * ECharts asset-bundle entry: registers the echarts engine on + * `window.__GenuiAssets__.echarts`. Built as a standalone IIFE into + * `lib/assets/echarts.js` and served by the plugin's node-half route; loaded + * on demand by echarts-lazy when a spec contains an `echart` node. + * @module @omdsh-dev/dsh-genui/client/asset-echarts + */ +import { init as echartsInit, type EChartsType, type EChartsCoreOption } from 'echarts' + +/** The engine surface registered by the echarts asset bundle. */ +export interface EChartsAssetApi { + /** Create an ECharts instance on `el`, apply `option`, return the instance. */ + createChart: (el: HTMLElement, option: EChartsCoreOption, opts?: { height?: number }) => EChartsType +} + +function createChart(el: HTMLElement, option: EChartsCoreOption, opts?: { height?: number }): EChartsType { + const initOpts = opts !== undefined && opts.height !== undefined ? { height: opts.height } : undefined + const instance = echartsInit(el, undefined, initOpts) + instance.setOption(option) + return instance +} + +const win = globalThis as unknown as { __GenuiAssets__?: Record } +const assets = win.__GenuiAssets__ ?? (win.__GenuiAssets__ = {}) +assets.echarts = { createChart } diff --git a/src/client/asset-loader.ts b/src/client/asset-loader.ts index 0c1cd00..4060874 100644 --- a/src/client/asset-loader.ts +++ b/src/client/asset-loader.ts @@ -52,7 +52,7 @@ const pending = new Map>>() * @param name - 'mermaid' or 'three'. * @returns the registered engine surface. */ -export function loadGenuiAsset(name: 'mermaid' | 'three'): Promise { +export function loadGenuiAsset(name: 'mermaid' | 'three' | 'echarts'): Promise { const file = `${name}.js` const existing = pending.get(file) if (existing !== undefined) return existing as Promise diff --git a/src/client/blocks/charts.tsx b/src/client/blocks/charts.tsx index 6cec72d..f3eec65 100644 --- a/src/client/blocks/charts.tsx +++ b/src/client/blocks/charts.tsx @@ -8,7 +8,7 @@ import css from '../GenuiBlock.module.css' import { GENUI_LIMITS } from '../guard.ts' import type { GenuiChart, GenuiTable } from '../spec.ts' -const CHART_COLORS = [ +export const CHART_COLORS = [ 'var(--dsw-static-deepseek-400)', 'var(--dsw-static-green-400)', 'var(--dsw-static-amber-400)', diff --git a/src/client/blocks/render-node.tsx b/src/client/blocks/render-node.tsx index a9c0104..9b738ec 100644 --- a/src/client/blocks/render-node.tsx +++ b/src/client/blocks/render-node.tsx @@ -19,6 +19,7 @@ import { AccordionNode, BreadcrumbNode, CalloutNode, CodeNode, CopyNode, DiffNode, FileTreeNode, JsonNode, KeyValueNode, MermaidNode, PlotNode, QuizNode, Scene3DNode, StepsNode, TabsNode, TimelineNode, } from './advanced.tsx' +import { EChartNode } from '../EChartNode.tsx' /** Custom node data shape (declared locally: pristine hosts export no type). */ interface GenuiCustomNode { @@ -223,6 +224,7 @@ export function renderNode( case 'file-tree': return case 'breadcrumb': return case 'quiz': return + case 'echart': return default: { // Plugin-registered custom types: a plugin ships a renderer through // registerGenuiComponent; unregistered unknowns render nothing. The diff --git a/src/client/echarts-lazy.ts b/src/client/echarts-lazy.ts new file mode 100644 index 0000000..6aad02e --- /dev/null +++ b/src/client/echarts-lazy.ts @@ -0,0 +1,35 @@ +/** + * Runtime loader for the ECharts engine. The heavy echarts bundle ships as a + * separate asset (`lib/assets/echarts.js`, served by the plugin's own HTTP + * route) and is fetched ONLY when a spec contains an `echart` node — the + * main client bundle stays small and most conversations never download + * echarts at all. On a host that does not serve the asset the load rejects + * and the EChartNode shows its fallback. + * @module @omdsh-dev/dsh-genui/client/echarts-lazy + */ +import { loadGenuiAsset } from './asset-loader.ts' + +/** The ECharts instance surface (the subset the component uses). */ +export interface EChartsInstance { + setOption: (opt: unknown, notMerge?: boolean) => void + resize: () => void + dispose: () => void +} + +/** The engine surface registered by the echarts asset bundle. */ +interface EChartsAssetApi { + createChart: (el: HTMLElement, option: unknown, opts?: { height?: number }) => EChartsInstance +} + +/** + * Create an ECharts instance on `el` with the given option (engine loaded on + * demand). The caller owns the returned instance and must dispose it. + * @param el - the DOM node to host the chart canvas. + * @param option - the ECharts option object. + * @param opts - optional height override. + * @returns the ECharts instance (setOption/resize/dispose). + */ +export async function createChart(el: HTMLElement, option: unknown, opts?: { height?: number }): Promise { + const api = await loadGenuiAsset('echarts') + return api.createChart(el, option, opts) +} diff --git a/src/client/guard.ts b/src/client/guard.ts index 67e9800..6a0d427 100644 --- a/src/client/guard.ts +++ b/src/client/guard.ts @@ -61,6 +61,9 @@ export const GENUI_LIMITS = { maxKeyValuePairs: 24, /** Maximum `file-tree` nesting. */ maxTreeDepth: 6, + /** Maximum depth of an `echart` option object (prevents pathological nested + * ECharts configs from stalling the guard walk). */ + maxEChartOptionDepth: 10, } as const /** Result of `validateGenuiSpec`. */ @@ -149,6 +152,7 @@ const CHART_KINDS = ['bars', 'line', 'donut'] as const const PLOT_KINDS = ['line', 'area', 'scatter'] as const const MESH_SHAPES = ['box', 'sphere', 'cone', 'cylinder', 'torus'] as const const FILE_TYPES = ['file', 'dir'] as const +const ECHART_PRESETS = ['bar', 'line', 'area', 'pie', 'scatter'] as const /* ---------------- repair ---------------- */ @@ -442,6 +446,34 @@ function repairNode(value: unknown, ctx: RepairCtx, depth: number): GenuiNode | ...opt('action', str(v.action, 200)), } } + case 'echart': { + // Preset shorthand data/series reuse the chart repair helpers. + const data = v.data !== undefined ? repairChartData(v.data, GENUI_LIMITS.maxChartPoints) : undefined + const series = v.series !== undefined && Array.isArray(v.series) + ? repairSeries(v.series, GENUI_LIMITS.maxPlotSeries, GENUI_LIMITS.maxChartPoints) + : undefined + // Full option: depth-bounded pass-through (the model writes the ECharts + // option object; the guard walks it to cap nesting but does not + // validate ECharts semantics — that is echarts' own job). + const sanitized = v.option !== undefined ? sanitizeEChartOption(v.option, 0) : undefined + // A chart option root is always a plain object; a scalar root is + // invalid, so degrade to preset/data/series handling (option dropped). + const option: Record | undefined = + sanitized === undefined || typeof sanitized !== 'object' || sanitized === null || Array.isArray(sanitized) + ? undefined + : sanitized as Record + // At least one of preset+data or option must be present. + if (option === undefined && data === undefined && series === undefined) return null + return { + type: 'echart', + ...opt('title', str(v.title, GENUI_LIMITS.maxString)), + ...opt('height', int(v.height, 100, 800)), + ...opt('preset', enu(v.preset, ECHART_PRESETS)), + ...opt('data', data), + ...opt('series', series), + ...opt('option', option), + } + } default: // Plugin-registered custom node types are opaque to the guard: pass // through unchanged (the renderer's default branch resolves them). @@ -706,6 +738,42 @@ function repairQuizOptions(v: unknown): Array<{ label: string; correct?: boolean return out } +/** + * Sanitize an ECharts option object: depth-bounded pass-through that strips + * dangerous values (functions, `url()` in styles) but preserves the object + * shape ECharts needs. Scalars are KEPT: ECharts options are full of them, + * including inside `data` arrays (`data: [120, 150, 180]`, + * `xAxis.data: ['1月', '2月']`). Previously a scalar hit the plain-object + * gate below and returned undefined, so every primitive-valued array was + * filtered to empty and dropped — a chart with a full `option` rendered + * with empty series (blank canvas). This is a safety walk, not an ECharts + * semantic validator. + */ +function sanitizeEChartOption(v: unknown, depth: number): unknown { + if (depth > GENUI_LIMITS.maxEChartOptionDepth) return undefined + // Scalars pass through: numbers/strings/booleans/null are legal ECharts + // values both as object fields and as array elements. + if (typeof v === 'string') { + const s = v.slice(0, GENUI_LIMITS.maxString) + return s.toLowerCase().includes('url(') ? undefined : s + } + if (typeof v === 'number' && Number.isFinite(v)) return v + if (typeof v === 'boolean') return v + if (v === null) return null + if (Array.isArray(v)) { + const arr = v.map(item => sanitizeEChartOption(item, depth + 1)).filter(item => item !== undefined) + return arr.length > 0 ? arr : undefined + } + const o = obj(v) + if (o === undefined) return undefined + const out: Record = {} + for (const [key, val] of Object.entries(o)) { + const s = sanitizeEChartOption(val, depth + 1) + if (s !== undefined) out[key] = s + } + return Object.keys(out).length > 0 ? out : undefined +} + /** * Deterministically repair a raw spec value into a renderable GenuiSpec. * Returns null only when the root is not an object with an `items` array; @@ -948,6 +1016,12 @@ function validateNode(value: unknown, depth: number, at: string, errors: string[ if (typeof v.question !== 'string') errors.push(`${at}: type 'quiz' requires question (string)`) if (!Array.isArray(v.options)) errors.push(`${at}: type 'quiz' requires options (array)`) break + case 'echart': + if (v.option === undefined && v.data === undefined && v.series === undefined) { + errors.push(`${at}: type 'echart' requires option, data, or series`) + } + isNum('height') + break default: // Unknown type: plugin-registered custom nodes are valid when a // renderer exists; the guard cannot know, so report as a warning. diff --git a/src/client/spec.ts b/src/client/spec.ts index 9033146..e38be14 100644 --- a/src/client/spec.ts +++ b/src/client/spec.ts @@ -51,6 +51,7 @@ export type GenuiNode = | GenuiFileTree | GenuiBreadcrumb | GenuiQuiz + | GenuiEChart export interface GenuiSpec { /** Short title shown as the card banner. */ @@ -551,6 +552,44 @@ export interface GenuiQuiz { action?: string } +/* ---------------- v1.6: ECharts ---------------- */ + +/** Preset chart kinds the `echart` node can build from `data`/`series` without + * a full ECharts option. Each maps to a themed option template. */ +export type EChartPreset = 'bar' | 'line' | 'area' | 'pie' | 'scatter' + +/** ECharts node: renders a full ECharts chart. Two modes: + * + * 1. **Full option** (`option` set): the model provides a standard ECharts + * `EChartsCoreOption` object directly. This is the escape hatch for + * custom chart types, complex series, or advanced features (dataZoom, + * visualMap, etc.). + * 2. **Preset shorthand** (`preset` + `data`/`series`): the model provides + * the same simple `data`/`series` shape as the `chart` node, and the + * component builds a themed ECharts option automatically. This is the + * easy upgrade path: change `type: 'chart'` to `type: 'echart'` and add + * `preset`. + * + * The echarts engine is lazy-loaded (lib/assets/echarts.js) only when an + * `echart` node appears in a spec. */ +export interface GenuiEChart { + type: 'echart' + /** Optional title shown above the chart. */ + title?: string + /** Chart height in pixels (default 300). */ + height?: number + /** Preset: builds the ECharts option from `data`/`series` when `option` + * is absent. */ + preset?: EChartPreset + /** Simple data for preset mode (same shape as `chart.data`). */ + data?: GenuiChartDatum[] + /** Multi-series for preset mode (same shape as `chart.series`). */ + series?: Array<{ label: string; color?: string; data: GenuiChartDatum[] }> + /** Full ECharts option object. When present, `preset`/`data`/`series` are + * ignored. This is a pass-through to `echarts.setOption`. */ + option?: Record +} + /** Parse the raw fence body as a GenuiSpec, or null when it is not one. */ export function parseGenuiSpec(raw: string): GenuiSpec | null { const trimmed = raw.trim() diff --git a/src/plugin/index.ts b/src/plugin/index.ts index 8795851..224349f 100644 --- a/src/plugin/index.ts +++ b/src/plugin/index.ts @@ -111,6 +111,7 @@ The spec is a white-listed component tree rendered inline where the fence sits. - list: {"type":"list","items":["..."] or [{"title":"...","desc":"..."}]} - table: {"type":"table","columns":["..."],"rows":[["...","..."]]} — 表头点击本地排序(升/降/还原,数值感知) - chart: {"type":"chart","kind":"bars|line|donut","data":[{"label":"...","value":n,"color":"#hex?"}],"series":[...]?} — bars 默认;line 趋势;donut 占比;series=分组柱;负值柱高为 0 但标注照显;hover 显示精确值 +- echart: {"type":"echart","preset":"bar|line|area|pie|scatter","title":"..."?,"height":n?,"data":[{"label":"...","value:n}]?,"series":[...]?} — ECharts 全功能图表(渐变/tooltip/动画/图例交互),视觉效果远超 chart;preset 模式用和 chart 一样的 data/series 格式自动构建主题化配置;也可传 "option":{...} 写原生 ECharts 配置(支持 radar/gauge/heatmap/dataZoom 等,option 中的函数会被过滤);推荐用 echart 替代 chart - tabs: {"type":"tabs","tabs":[{"label":"...","items":[...]}]} / accordion: {"type":"accordion","items":[{"title":"...","items":[...]}]} - avatar: {"type":"avatar","name":"..."} - plot: {"type":"plot","series":[{"expr":"sin(x)","label":"...","kind":"line|area|scatter"?,"params":[...]?}],"xMin":-5,"xMax":5,"yMin":?,"yMax":?,"title":"..."} — SVG 函数图(可拖拽平移/滚轮缩放;params 渲染实时滑块);kind 缺省 line,area 填到基线,scatter 散点;表达式白名单 sin/cos/tan/asin/acos/atan/sqrt/cbrt/exp/log/ln/abs/floor/ceil/round/min/max/pow,常量 pi/e/tau,变量 x @@ -127,7 +128,7 @@ The spec is a white-listed component tree rendered inline where the fence sits. Rules: - Trigger: 结构化表达优于纯文本时就主动用围栏(要点、强调、对比、流程、步骤、状态、数据、演示),纯问答与一句话不套 UI。 - 围栏放在回答中该组件该在的位置,文字前后照常流动;不要把围栏套进别的代码围栏,JSON 字符串内不放 markdown。 -- Component choice (每个主题一个主组件): 结论/提醒→callout · 2–4 指标→grid+stat · 进度→progress · 多阶段→steps · 要点→list · 配置→keyvalue · 对比→table · 趋势→chart(line) · 占比→chart(donut) · 分类对比→chart(bars) · 数学曲线→plot · 事件→timeline · 分页内容→tabs · 长内容→accordion · 树→file-tree · 代码→code · 文件变更→diff · 嵌套JSON→json · 架构/流程→mermaid · 仅几何内容→scene3d · 教学→quiz · 单操作→button(action)。优先 table/chart 而非文字堆砌;同一数据不重复出现在两个组件;每次回复 3–8 个组件,拿不准就少。 +- Component choice (每个主题一个主组件): 结论/提醒→callout · 2–4 指标→grid+stat · 进度→progress · 多阶段→steps · 要点→list · 配置→keyvalue · 对比→table · 趋势→echart(line) 或 chart(line) · 占比→echart(pie) 或 chart(donut) · 分类对比→echart(bar) 或 chart(bars) · 数学曲线→plot · 事件→timeline · 分页内容→tabs · 长内容→accordion · 树→file-tree · 代码→code · 文件变更→diff · 嵌套JSON→json · 架构/流程→mermaid · 仅几何内容→scene3d · 教学→quiz · 单操作→button(action)。优先 echart/table 而非文字堆砌;同一数据不重复出现在两个组件;每次回复 3–8 个组件,拿不准就少。 - 语法: 坏围栏降级为代码块,保持 JSON 严格。≥3 节点或含 table 的围栏发出前调用 validate_dsh_ui 验证,❌ 则修好再发;若 ❌ 回复里附了「已自动修复」的 JSON,照抄即可。 - 主题: 内容适配暗色;UI 主题跟随 app,不要自造。规模: ≤200 节点、嵌套≤8 层(超出被截断);3D 网格 1–5 个;plot 给合理 xMin/xMax。 - v2 actions: button/input/select/checkbox/radio/switch/slider/textarea/quiz 可带 "action":"name",交互以 [genui-action] name + 组件数据回传,届时重渲染更新 UI。可交互组件必须带 action(无 action 按钮禁用);带 action 的按钮点击有「已触发」本地反馈。 diff --git a/tsdown.config.ts b/tsdown.config.ts index 822dc71..f6701ae 100644 --- a/tsdown.config.ts +++ b/tsdown.config.ts @@ -189,4 +189,5 @@ export default [ clientConfig, assetConfig('mermaid', 'src/client/asset-mermaid.ts'), assetConfig('three', 'src/client/asset-three.ts'), + assetConfig('echarts', 'src/client/asset-echarts.ts'), ]