iobroker.eos-admin 7.9.83 → 7.9.85

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/admin/img/eos/nexowatt-eos-brand-wide.png +0 -0
  2. package/adminWww/assets/AdapterUpdateDialog-BMg84Hpf-v84.js +2 -0
  3. package/adminWww/assets/AdapterUpdateDialog-BMg84Hpf.js +1 -1
  4. package/adminWww/assets/{Adapters-B5_jQ7DE-v82.js → Adapters-B5_jQ7DE-v84.js} +1 -1
  5. package/adminWww/assets/Adapters-B5_jQ7DE.js +1 -9
  6. package/adminWww/assets/Config-hHK2UzGP-v84.js +1 -0
  7. package/adminWww/assets/Config-hHK2UzGP.js +1 -1
  8. package/adminWww/assets/{CustomTab-B0wqoazH-v82.js → CustomTab-B0wqoazH-v84.js} +1 -1
  9. package/adminWww/assets/CustomTab-B0wqoazH.js +1 -1
  10. package/adminWww/assets/{DeviceManager-BFmQeYQ1-v82.js → DeviceManager-BFmQeYQ1-v84.js} +1 -1
  11. package/adminWww/assets/DeviceManager-BFmQeYQ1.js +1 -1
  12. package/adminWww/assets/{EasyMode-B1d9Vdc4-v82.js → EasyMode-B1d9Vdc4-v84.js} +1 -1
  13. package/adminWww/assets/EasyMode-B1d9Vdc4.js +1 -1
  14. package/adminWww/assets/{Enums-DbWYxKOo-v82.js → Enums-DbWYxKOo-v84.js} +1 -1
  15. package/adminWww/assets/Enums-DbWYxKOo.js +1 -91
  16. package/adminWww/assets/Fields-CX3rKuWb-v84.js +1 -0
  17. package/adminWww/assets/Fields-CX3rKuWb.js +1 -1
  18. package/adminWww/assets/{Files-Cd2HOzIE-v82.js → Files-Cd2HOzIE-v84.js} +1 -1
  19. package/adminWww/assets/Files-Cd2HOzIE.js +1 -1
  20. package/adminWww/assets/{Hosts-Bg8QzW5i-v82.js → Hosts-Bg8QzW5i-v84.js} +1 -1
  21. package/adminWww/assets/Hosts-Bg8QzW5i.js +1 -121
  22. package/adminWww/assets/{Instances-YdaGnS5a-v82.js → Instances-YdaGnS5a-v84.js} +1 -1
  23. package/adminWww/assets/Instances-YdaGnS5a.js +1 -2
  24. package/adminWww/assets/{Intro-DkwRiz1n-v82.js → Intro-DkwRiz1n-v84.js} +1 -1
  25. package/adminWww/assets/Intro-DkwRiz1n.js +1 -2
  26. package/adminWww/assets/{Logs-CsVPSLJH-v82.js → Logs-CsVPSLJH-v84.js} +1 -1
  27. package/adminWww/assets/Logs-CsVPSLJH.js +1 -1
  28. package/adminWww/assets/{Objects-DPan0bzw-v82.js → Objects-DPan0bzw-v84.js} +1 -1
  29. package/adminWww/assets/Objects-DPan0bzw.js +1 -1
  30. package/adminWww/assets/{Users-BgnBRgwU-v82.js → Users-BgnBRgwU-v84.js} +1 -1
  31. package/adminWww/assets/Users-BgnBRgwU.js +1 -1
  32. package/adminWww/assets/{bootstrap-COulQZax-v82.js → bootstrap-COulQZax-v84.js} +4 -4
  33. package/adminWww/assets/bootstrap-COulQZax.js +1 -1
  34. package/adminWww/assets/hostInit-OBG53iVO.js +1 -1
  35. package/adminWww/assets/{hostInit-v82.js → hostInit-v84.js} +2 -2
  36. package/adminWww/assets/{index-CQZugZ1z-v82.js → index-CQZugZ1z-v84.js} +2 -2
  37. package/adminWww/assets/index-CQZugZ1z.js +1 -1
  38. package/adminWww/assets/index-D2ymscJA.js +1 -1
  39. package/adminWww/assets/sentry-B7YeoTAx-v84.js +1 -0
  40. package/adminWww/css/nexowatt-native-shell.css +25 -21
  41. package/adminWww/img/eos/nexowatt-eos-brand-wide.png +0 -0
  42. package/adminWww/index.html +9 -9
  43. package/adminWww/js/eos-assistant.js +2 -2
  44. package/adminWww/js/eos-manual-write-policy.js +1 -1
  45. package/adminWww/js/eos-native-security.js +1 -1
  46. package/adminWww/js/eos-policy-client.js +1 -1
  47. package/adminWww/js/eos-role-ui.js +1 -1
  48. package/adminWww/js/nexowatt-native-shell.js +4 -4
  49. package/adminWww/mf-manifest.json +1 -1
  50. package/adminWww/{remoteEntry-v82.js → remoteEntry-v84.js} +2 -2
  51. package/adminWww/remoteEntry.js +1 -1
  52. package/io-package.json +5 -5
  53. package/package.json +8 -3
  54. package/tools/nexowatt-validate-package.cjs +11 -0
  55. /package/adminWww/assets/{index-D2ymscJA-v82.js → index-D2ymscJA-v84.js} +0 -0
@@ -1,4 +1,4 @@
1
- import{j as L}from"./DefaultPropsProvider-BiXBMQYQ.js";import{i as Te,a as uS}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{i as E,a as Ie}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as ee}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{l as vie}from"./index-8HslT92O.js";import{i as _p}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-CpA7pnS5.js";import{b as Bg,i as co,d as dS,f as _ie,M as F7,E as f$}from"./bootstrap-COulQZax-v82.js";import{i as _s}from"./ext-language_tools-ylAoucDh.js";import{c as bie,d as wie,e as yie,f as B7}from"./index-BmNcalFW.js";import{a as Cie}from"./_commonjsHelpers-CE1G-McA.js";import{h as xT}from"./zh-cn-nUtvS7Wc.js";import{C as Sie}from"./CustomModal-CqDLqryN.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-g2X2zhAf.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BywLg1Xe.js";import"./ace-DEUjyTIn.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-CNUAG3AH.js";import"./iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-CwjnV48g.js";import"./iobroker_admin__loadShare__react_mf_2_dom__loadShare__-CVeAXnkk.js";import"./preload-helper-BDBacUwf.js";import"./sdk-C-e-e2gd.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B0aQ9eG_.js";import"./useTheme-Bl-M1DYp.js";import"./createTheme-DFX8CY6F.js";import"./blue-CagzI6CQ.js";import"./index-DcK0RDrH.js";import"./ThemeProvider-BOFFjWAF.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./setYear-3ufv5yRD.js";import"./en-US-DBFJNIH6.js";import"./iconBase-2IlPecPg.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const ds={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden"},headingIcon:{marginRight:5,width:32,height:32},titleEnabled:{float:"right",fontSize:16,color:"#7ff57f",textTransform:"uppercase",fontWeight:"bold",paddingLeft:20},scrollDiv:{width:"100%",height:"100%",overflow:"auto"},enabledControl:{width:130,display:"inline-block",verticalAlign:"top"},customControls:{width:"calc(100% - 130px)",maxWidth:800,display:"inline-block",verticalAlign:"top",paddingTop:16},accordionOdd:{},accordionEven:{backgroundColor:"rgba(128, 128, 128, 0.1)"},accordionHeaderOdd:{backgroundColor:"rgba(128, 128, 128, 0.2)"},accordionHeaderEven:{backgroundColor:"rgba(128, 128, 128, 0.3)"},accordionHeaderEnabledOdd:{backgroundColor:"rgba(128, 255, 128, 0.2)"},accordionHeaderEnabledEven:{backgroundColor:"rgba(128, 255, 128, 0.2)"},enabledVisible:{display:"inline-block"},enabledInvisible:{display:"none"}},xie=".";class fS extends Te.Component{changedIds;scrollDivRef;jsonConfigs;refTemplate;customObj;commonConfig={};statesFilterFunctions={};cb;cachedNewValues;constructor(e){super(e);let t;try{t=JSON.parse((window._localStorage||window.localStorage).getItem("App.customsExpanded")||"[]")}catch{t=[]}this.changedIds=[],this.state={loaded:!1,expanded:t,newValues:{},confirmed:!1,showConfirmation:!1,maxOids:0,systemConfig:this.props.systemConfig},this.scrollDivRef=Te.createRef(),this.jsonConfigs={},this.refTemplate={},this.props.customsInstances.map(i=>this.refTemplate[i]=Te.createRef()),this.customObj=this.props.objectIDs.length>1?{common:{custom:{}},native:{}}:Bg.deepClone(this.props.objects[this.props.objectIDs[0]]||null),this.customObj&&this.loadAllCustoms().then(()=>{this.commonConfig=this.getCommonConfig(),this.setState({loaded:!0,newValues:{}})})}async componentDidMount(){this.state.systemConfig||this.setState({systemConfig:await this.props.socket.getCompactSystemConfig()}),this.props.registerSaveFunc&&this.props.registerSaveFunc(this.onSave)}componentWillUnmount(){this.props.registerSaveFunc&&this.props.registerSaveFunc()}async loadAllCustoms(){const e=[];for(const t of this.props.customsInstances){if(t==="_")continue;const i=t.replace(/\.\d+$/,"").replace("system.adapter.","");this.jsonConfigs[i]===void 0&&(this.jsonConfigs[i]=null,e.push(this.getCustomTemplate(i)))}await Promise.all(e),this.props.customsInstances.forEach(t=>{var n,r;const i=t.replace(/\.\d+$/,"").replace("system.adapter.","");this.jsonConfigs[i]&&(this.jsonConfigs[i].instanceObjs||={},this.jsonConfigs[i].instanceObjs[t]={_id:t,common:JSON.parse(JSON.stringify((n=this.props.objects[`system.adapter.${t}`])==null?void 0:n.common)),native:JSON.parse(JSON.stringify((r=this.props.objects[`system.adapter.${t}`])==null?void 0:r.native)),type:"instance",instanceObjects:[],objects:[]})})}getStatesFilterFunction(e){var r,o;if(this.statesFilterFunctions[e])return this.statesFilterFunctions[e];const t=e.split(".")[0],i=(o=(r=this.jsonConfigs[t])==null?void 0:r.json)==null?void 0:o.statesFilter;let n;if(i===void 0)n=()=>!0;else if(i===!0){const a=`${e}.`;n=l=>l.startsWith(a)}else try{const a=new RegExp(i);n=l=>a.test(l)}catch{console.error(`Invalid statesFilter regex: ${i}`),n=()=>!0}return this.statesFilterFunctions[e]=n,n}getFilteredObjectIDs(e){const t=this.getStatesFilterFunction(e);return this.props.objectIDs.filter(t)}async getCustomTemplate(e){var i;const t=this.props.objects[`system.adapter.${e}`]?Bg.deepClone(this.props.objects[`system.adapter.${e}`]):null;if(!t){console.error(`Cannot find adapter "${e}"`);return}if(Bg.fixAdminUI(t),((i=t.common)==null?void 0:i.adminUI.custom)==="json")try{const n=await this.props.socket.fileExists(`${e}.admin`,"jsonCustom.json5");let r,o;n?o=await this.props.socket.readFile(`${e}.admin`,"jsonCustom.json5"):o=await this.props.socket.readFile(`${e}.admin`,"jsonCustom.json"),o.file!==void 0?r=o.file:r=o;let a;try{a=vie.parse(r),this.jsonConfigs[e]=this.jsonConfigs[e]||{},this.jsonConfigs[e].json=a}catch(l){console.error(`Cannot parse jsonConfig of ${e}: ${l}`),window.alert(`Cannot parse jsonConfig of ${e}: ${l}`)}await _p.JsonConfigComponent.loadI18n(this.props.socket,a.i18n,e);return}catch(n){console.error(`Cannot load jsonConfig of ${e}: ${n}`),window.alert(`Cannot load jsonConfig of ${e}: ${n}`)}console.error(`Adapter ${e} is not yet supported by this version of admin`),window.alert(`Adapter ${e} is not yet supported by this version of admin`)}_executeCustom(e,t,i,n,r,o,a){if(a.includes(o))return;a.push(o);let l=[],h;if(e&&typeof e=="object"?(l=e.alsoDependsOn||[],typeof l=="string"&&(l=[l]),h=e.func):h=e,l.forEach(c=>{if(!r[c])console.error(`[JsonConfigComponent] attribute "${c}" does not exist!`);else if(!r[c].defaultFunc)console.error(`[JsonConfigComponent] attribute "${c}" is not required to be includes in "alsoDependsOn" while has static value!`);else{const u=this._executeCustom(r[c].defaultFunc,t,i,n,r,c,a);u!==void 0&&(t[c]=u)}}),!h)t[o]=r[o].default===void 0?null:r[o].default;else try{const c=new Function("data","originalData","_system","instanceObj","customObj","_socket",h.includes("return")?h:`return ${h}`);t[o]=c(t||this.props.data,this.props.originalData,this.props.systemConfig,n,i,this.props.socket)}catch(c){console.error(`Cannot execute ${e}: ${c}`),t[o]=!r[o]||r[o].default===void 0?null:r[o].default}return t[o]}static flattenItems(e,t={}){return e&&Object.keys(e).forEach(i=>{e[i].items?fS.flattenItems(e[i].items,t):t[i]=e[i]}),t}getDefaultValues(e,t){const i={enabled:!1},n=e.split(".")[0];if(this.jsonConfigs[n]&&!this.jsonConfigs[n].disabled){const r=fS.flattenItems(this.jsonConfigs[n].json.items);if(r){const o=[],a=Object.keys(r).filter(l=>r[l]);a.forEach(l=>{!r[l].defaultFunc&&r[l].default!==void 0&&(i[l]=r[l].default)}),a.forEach(l=>{r[l].defaultFunc&&this._executeCustom(r[l].defaultFunc,i,t,this.jsonConfigs[n].instanceObjs[e],r,l,o)})}}return i}getCommonConfig(){const e=this.props.objects,t={};return this.props.customsInstances.forEach(i=>{const n=i.split(".")[0];if(this.jsonConfigs[n]&&this.jsonConfigs[n].disabled)return;const r=this.getFilteredObjectIDs(i);t[i]={},r.forEach(o=>{var h;const a=e[o],l=(h=a==null?void 0:a.common)!=null&&h.custom&&a.common.custom[i]||null;if(l)Object.keys(l).forEach(c=>{c.startsWith("_")||(t[i][c]===void 0?t[i][c]=l[c]:t[i][c]!==l[c]&&(Array.isArray(t[i][c])||(t[i][c]=[t[i][c]]),t[i][c].includes(l[c])||t[i][c].push(l[c])))});else{const c=this.getDefaultValues(i,a);c.enabled=!1,Object.keys(c).forEach(u=>{u.startsWith("_")||(t[i][u]===void 0?t[i][u]=c[u]:t[i][u]!==c[u]&&(Array.isArray(t[i][u])||(t[i][u]=[t[i][u]]),t[i][u].includes(c[u])||t[i][u].push(c[u])))})}}),Object.keys(t[i]).forEach(o=>{Array.isArray(t[i][o])&&t[i][o].sort()})}),t}isChanged(e){return e=e||this.state.newValues,Object.keys(e).find(t=>e[t]===null||e[t]&&Object.keys(e[t]).find(i=>!i.startsWith("_")))}combineNewAndOld(e,t=!1){const i={...this.commonConfig[e]||{},...this.state.newValues[e]||{}};return t&&Object.keys(i).forEach(n=>{n.startsWith("_")&&delete i[n]}),this.state.newValues[e]===null&&(i.enabled=!1),i}renderOneCustom(e,t,i,n){var g,p;const r=e.split(".")[0];if(this.getFilteredObjectIDs(e).length===0)return null;const o=`${xie}/adapter/${r}/${this.props.objects[`system.adapter.${r}`].common.icon}`,a=this.state.newValues[e]!==void 0&&(!this.state.newValues[e]||this.state.newValues[e].enabled!==void 0)?!!(this.state.newValues[e]&&this.state.newValues[e].enabled):this.state.newValues[e]===null?!1:this.commonConfig[e].enabled,l=Array.isArray(a)&&(!this.state.newValues[e]||this.state.newValues[e].enabled===void 0),h=(p=(g=this.jsonConfigs[r])==null?void 0:g.json)==null?void 0:p.disabled,c=this.combineNewAndOld(e),u=this.jsonConfigs[r].json.hidden;if(h&&u===!0||typeof u=="string"&&this._executeCustom(u,c,i,t,this.jsonConfigs[r].json.items,"enabled",[]))return null;let d=null;const f=this.jsonConfigs[r].json.help;return h&&f&&(typeof f=="object"?d=f[this.props.lang]||f.en:d=this.props.t(f)),L.jsxs(E.Accordion,{id:`Accordion_${e}`,style:n%2?ds.accordionOdd:ds.accordionEven,expanded:this.state.expanded.includes(e),ref:this.refTemplate[e],onChange:()=>{const m=[...this.state.expanded],v=m.indexOf(e);v===-1?m.push(e):m.splice(v,1),(window._localStorage||window.localStorage).setItem("App.customsExpanded",JSON.stringify(m)),v===-1&&(window._localStorage||window.localStorage).setItem("App.customsLastExpanded",e),this.setState({expanded:m})},children:[L.jsxs(E.AccordionSummary,{expandIcon:L.jsx(Ie.ExpandMore,{}),"data-id":e,style:n%2?a?ds.accordionHeaderEnabledOdd:ds.accordionHeaderOdd:a?ds.accordionHeaderEnabledEven:ds.accordionHeaderEven,children:[L.jsx("img",{src:o,style:ds.headingIcon,alt:""}),L.jsx(E.Typography,{style:ds.heading,children:this.props.t("Settings %s",e)}),L.jsx("div",{className:"titleEnabled",style:{...ds.titleEnabled,...a?ds.enabledVisible:ds.enabledInvisible},children:this.props.t("Enabled")})]}),L.jsxs(E.AccordionDetails,{children:[L.jsx("div",{style:ds.enabledControl,children:L.jsx(E.FormControlLabel,{style:ds.formControl,control:L.jsx(E.Checkbox,{indeterminate:l,checked:!!a,disabled:!!h,onChange:m=>{this.cachedNewValues=this.cachedNewValues||this.state.newValues;const v=Bg.deepClone(this.cachedNewValues);v[e]=v[e]||{},l||m.target.checked?v[e].enabled=!0:a&&this.commonConfig[e].enabled?v[e]=null:delete v[e],this.cachedNewValues=v,this.setState({newValues:v,hasChanges:this.isChanged(v)},()=>{this.cachedNewValues=void 0,this.props.onChange&&this.props.onChange(!!this.state.hasChanges)})}}),label:this.props.t("Enabled")})}),L.jsxs("div",{style:ds.customControls,children:[!h&&(a||l)&&this.state.systemConfig?L.jsx(_p.JsonConfigComponent,{instanceObj:t,customObj:i,custom:!0,adapterName:r,instance:parseInt((e==null?void 0:e.split(".").pop())??"0",10)||0,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,multiEdit:this.props.objectIDs.length>1,schema:this.jsonConfigs[r].json,data:c,isFloatComma:this.props.systemConfig.common.isFloatComma,dateFormat:this.props.systemConfig.common.dateFormat,onError:m=>this.setState({error:m},()=>{var v,_;return(_=(v=this.props).onError)==null?void 0:_.call(v,m)}),onValueChange:(m,v)=>{var b;this.cachedNewValues=this.cachedNewValues||this.state.newValues,console.log(`${m} => ${v}`);const _=Bg.deepClone(this.cachedNewValues);_[e]=_[e]||{},JSON.stringify(_p.ConfigGeneric.getValue((b=this.commonConfig)==null?void 0:b[e],m))===JSON.stringify(v)?(_p.ConfigGeneric.setValue(_[e],m,null),Object.keys(_[e]).length||delete _[e]):_p.ConfigGeneric.setValue(_[e],m,v),this.cachedNewValues=_,this.setState({newValues:_,hasChanges:this.isChanged(_)},()=>{this.cachedNewValues=void 0,this.props.onChange&&this.props.onChange(!!this.state.hasChanges)})}}):null,d]})]})]},e)}renderErrorMessage(){return!!this.state.error&&L.jsx(ee.DialogError,{title:this.props.t("Error"),text:this.state.error?"Error":"",onClose:()=>this.setState({error:!1})})}getObject(e,t,i){return e[i]?Promise.resolve(e[i]):this.props.socket.getObject(i).then(n=>(t[i]=Bg.deepClone(n),e[i]=n,n))}saveOneState(e,t,i,n){if(i=i||{},n=n||{},e!=null&&e.length){const r=this.state.maxOids||e.length;this.state.maxOids===null&&this.setState({maxOids:e.length},()=>this.props.onProgress(!0)),this.setState({progress:Math.round((r-e.length)/r*50)});const o=e.shift();this.getObject(i,n,o).then(a=>{var h,c,u;if(!a){window.alert(`Invalid object ${o}`);return}(h=a.common)!=null&&h.custom&&Object.keys(a.common.custom).forEach(d=>{(!a.common.custom[d]||!a.common.custom[d].enabled)&&(a.common.custom[d]=null)});const l=Object.keys(this.state.newValues);for(let d=0;d<l.length;d++){const f=l[d];if(!this.getStatesFilterFunction(f)(o))continue;const g=this.combineNewAndOld(f,!0);if(g.enabled===!1)(u=(c=a.common)==null?void 0:c.custom)!=null&&u[f]&&(a.common.custom[f]=null);else if(g.enabled){if(a.common=a.common||{},Array.isArray(g.enabled)&&(!a.common.custom||!a.common.custom[f]||!a.common.custom[f].enabled)){a.common.custom&&a.common.custom[f]&&(a.common.custom[f]=null);continue}if(a.common.custom=a.common.custom||{},!a.common.custom[f]||!a.common.custom[f].enabled){const m=this.getDefaultValues(f,a);a.common.custom[f]=JSON.parse(JSON.stringify(m||{})),Object.keys(a.common.custom[f]).forEach(v=>{v.startsWith("_")&&delete a.common.custom[f][v]})}const p=this.props.objectIDs.length>1;a.common.custom[f].enabled=!0,Object.keys(g).forEach(m=>{if(!m.startsWith("_")){if(Array.isArray(g[m])&&p)return;a.common.custom[f][m]=g[m]}})}}setTimeout(()=>this.saveOneState(e,t,i,n),0)})}else{const r=Object.keys(i);if(!r.length)this.setState({maxOids:0},()=>this.props.onProgress(!1)),t&&t();else{this.setState({progress:Math.round((this.state.maxOids-r.length)/this.state.maxOids*50)+50});const o=r.shift();if(JSON.stringify(i[o].common)!==JSON.stringify(n[o].common)){this.changedIds.includes(o)||this.changedIds.push(o),this.props.socket.setObject(o,i[o]).then(async()=>{delete i[o],delete n[o],this.props.objects[o]=await this.props.socket.getObject(o),setTimeout(()=>this.saveOneState(e,t,i,n),0)});return}delete i[o],delete n[o],setTimeout(()=>this.saveOneState(e,t,i,n),0)}}}renderConfirmationDialog(){return this.state.showConfirmation?L.jsx(ee.DialogConfirm,{text:this.props.t("The changes will be applied to %s states. Are you sure?",this.props.objectIDs.length.toString()),ok:this.props.t("Yes"),onClose:e=>{e?this.setState({showConfirmation:!1,confirmed:!0},()=>{const t=this.cb;this.cb=void 0,this.onSave(t)}):(this.cb=void 0,this.setState({showConfirmation:!1}))}}):null}onSave=e=>{this.props.objectIDs.length>10&&!this.state.confirmed?(this.cb=e,this.setState({showConfirmation:!0})):this.saveOneState([...this.props.objectIDs],()=>{this.cachedNewValues={},this.commonConfig=this.getCommonConfig(),this.setState({confirmed:!1,hasChanges:void 0,newValues:{}},()=>{this.props.reportChangedIds(this.changedIds),this.props.onChange(!1,!0),e&&setTimeout(()=>e(),100)})})};render(){if(this.customObj===null)return L.jsx("div",{style:{color:"#F55",fontSize:32},children:this.props.t("Object does not exist!")});if(!this.state.loaded)return L.jsx(E.LinearProgress,{});let e=0;return L.jsxs(E.Paper,{style:ds.paper,children:[this.state.maxOids>1&&L.jsx(E.LinearProgress,{color:"secondary",variant:"determinate",value:this.state.progress}),L.jsx("div",{style:ds.scrollDiv,ref:this.scrollDivRef,children:this.state.maxOids===0&&Object.values(this.jsonConfigs).map(t=>t?Object.keys(t.instanceObjs).map(i=>this.renderOneCustom(i,t.instanceObjs[i],this.customObj,e++)):null)}),this.renderErrorMessage(),this.renderConfirmationDialog()]})}}const gS={en:co.enUS,fr:co.fr,ru:co.ru,de:co.de,es:co.es,br:co.ptBR,nl:co.nl,it:co.it,pt:co.pt,pl:co.pl,uk:co.uk,"zh-cn":co.zhCN},gt={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden"},tableDiv:s=>({height:`calc(100% - ${parseInt(s.mixins.toolbar.minHeight,10)+8}px)`,overflow:"hidden",width:"100%"}),container:{height:"100%"},table:s=>({minWidth:960,width:"100%","& td:nth-of-type(5)":{overflow:"hidden",whiteSpace:"nowrap"},"& tr:nth-child(even)":{backgroundColor:s.palette.mode==="dark"?"#383838":"#b2b2b2"}}),row:{userSelect:"none",position:"relative","&:hover":{opacity:.7},"& td":{position:"relative"}},updatedRow:{animation:"updated 1s"},rowInterpolated:{opacity:.5},selectHistoryControl:{width:130},selectRelativeTime:{marginLeft:10,width:200},notAliveInstance:{opacity:.5},customRange:s=>({color:s.palette.primary.main}),rowSelected:s=>({backgroundColor:s.palette.secondary.main,color:s.palette.secondary.contrastText,"& td":{color:s.palette.secondary.contrastText,backgroundColor:s.palette.secondary.main}}),rowFocused:s=>({position:"absolute",pointerEvents:"none",top:0,bottom:0,left:0,right:0,m:"3px",border:`1px dotted ${s.palette.action.active}`}),grow:{flexGrow:1},msInput:{width:50,pt:"10px",ml:"5px","& label":{mt:"15px"}},cellAckTrue:s=>({color:s.palette.mode==="dark"?"#66ff7f":"#04a821"}),cellAckFalse:{color:"#FF6666"},toolbarDate:{width:124,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTime:{width:84,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTimeGrid:{position:"relative",marginLeft:8,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px dotted #AAAAAA",borderRadius:8,display:"flex"},toolbarTimeLabel:{position:"absolute",padding:8,fontSize:"0.8rem",left:2,top:-9},noLoadingProgress:{width:"100%",height:4},colValue:{},colAck:{},colFrom:{},colLastChange:{},colTs:{}};class pS extends Te.Component{adminInstance;supportedFeaturesPromises;unit;timeTimer;readSupportedFeaturesTimeout;rangeValues;rangeRef;subscribes;localStorage;constructor(e){super(e),this.localStorage=window._localStorage||window.localStorage;let t=this.localStorage.getItem("App.relativeRange")||"absolute";const i=parseInt(this.localStorage.getItem("App.absoluteStart"),10)||0,n=parseInt(this.localStorage.getItem("App.absoluteEnd"),10)||0,r=this.localStorage.getItem("App.historySelected")||"",o=parseInt(this.localStorage.getItem("App.historyLastSelected"),10)||null,a=this.localStorage.getItem("App.historyLastSelectedColumn")||null;(!i||!n)&&(!t||t==="absolute")&&(t="30"),i&&n&&(t="absolute");let l;try{l=JSON.parse(r)}catch{l=[]}this.state={start:i,end:n,values:null,relativeRange:t,selected:l,lastSelected:o,lastSelectedColumn:a,historyInstance:"",updateOpened:!1,insertOpened:!1,historyInstances:null,lcVisible:!0,ackVisible:!0,fromVisible:!0,supportedFeatures:[],ampm:!1,edit:{}},this.adminInstance=parseInt(window.location.search.slice(1),10)||0,this.supportedFeaturesPromises={},this.unit=this.props.obj.common&&this.props.obj.common.unit?` ${this.props.obj.common.unit}`:"",this.timeTimer=void 0,this.subscribes=[],this.prepareData().then(()=>this.readHistoryRange()).then(()=>{t!=="absolute"?this.setRelativeInterval(this.state.relativeRange,!0):this.readHistory()})}readSupportedFeatures(e){return e=e||this.state.historyInstance,e?this.supportedFeaturesPromises[e]instanceof Promise?this.supportedFeaturesPromises[e]:(this.supportedFeaturesPromises[e]=new Promise(t=>{this.readSupportedFeaturesTimeout&&clearTimeout(this.readSupportedFeaturesTimeout),this.readSupportedFeaturesTimeout=setTimeout(()=>{this.readSupportedFeaturesTimeout=void 0,t([])},2e3),this.props.socket.sendTo(e,"features",null).then(i=>{this.readSupportedFeaturesTimeout?(clearTimeout(this.readSupportedFeaturesTimeout),this.readSupportedFeaturesTimeout=void 0,t(i?i.supportedFeatures||[]:[])):this.setState({supportedFeatures:i?i.supportedFeatures||[]:[]})})}),this.supportedFeaturesPromises[e]):Promise.resolve([])}async componentDidMount(){await this.props.socket.subscribeState(this.props.obj._id,this.onChange)}componentWillUnmount(){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0);for(let e=0;e<this.subscribes.length;e++)this.props.socket.unsubscribeState(this.subscribes[e],this.onChange);this.subscribes=[],this.props.socket.unsubscribeState(this.props.obj._id,this.onChange)}onChange=(e,t)=>{if(e===this.props.obj._id&&t&&this.state.values&&(!this.state.values.length||this.state.values[this.state.values.length-1].ts<t.ts)){const i=[...this.state.values,t];this.setState({values:i})}else if(e.startsWith("system.adapter.")&&e.endsWith(".alive")){const i=e.substring(15,e.length-6),n=this.state.historyInstances,r=n.findIndex(o=>o.id===i);if(r!==-1&&n[r].alive!==!!(t!=null&&t.val)){const o=JSON.parse(JSON.stringify(n));o[r].alive=!!(t!=null&&t.val),this.setState({historyInstances:o},()=>{o[r].alive&&this.state.historyInstance===i&&this.readHistoryRange().then(()=>this.readHistory())})}}};async prepareData(){var o;const e=await this.getHistoryInstances(),t=await this.props.socket.getCompactSystemConfig(),i=(o=t==null?void 0:t.common)==null?void 0:o.defaultHistory;let n=this.localStorage.getItem("App.historyInstance")||"";if((!n||!e.find(a=>a.id===n&&a.alive))&&(n=i),!n||!e.find(a=>a.id===n&&a.alive)){const a=e.find(l=>l.alive);a&&(n=a.id)}!n&&e.length&&(n=i);const r=await this.readSupportedFeatures(n);await new Promise(a=>{this.setState({ampm:(t.common.dateFormat||"").includes("/"),historyInstances:e,historyInstance:n,supportedFeatures:r},()=>a())})}getHistoryInstances(){const e=[],t=[];return this.props.customsInstances.forEach(i=>{const n=this.props.objects[`system.adapter.${i}`];if(n&&n.common&&n.common.getHistory){const r={id:i,alive:!1};e.push(r),t.push(`system.adapter.${i}.alive`)}}),t.length?this.props.socket.getForeignStates(t).then(async i=>{Object.keys(i).forEach(n=>{var o;const r=e.find(a=>n.endsWith(`${a.id}.alive`));r&&(r.alive=!!((o=i[n])!=null&&o.val))}),this.subscribes=t;for(let n=0;n<t.length;n++)await this.props.socket.subscribeState(t[n],this.onChange);return e}):Promise.resolve(e)}readHistory(e,t){var i;return e=e||this.state.start,t=t||this.state.end,!this.state.historyInstance||!((i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive))?null:(this.setState({loading:!0}),this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:e,end:t,from:!0,ack:!0,q:!0,addId:!1,aggregate:"none",returnNewestEntries:!0}).then(n=>{const r=[],o=this.rangeValues;let a=!1,l=!1,h=!1;if(o&&o.length&&(!n||!n.length||o[0].ts<n[0].ts)&&(r.push(o[0]),r.push({ts:o[0].ts+1,e:!0}),console.log(`add ${new Date(o[0].ts).toISOString()}: ${o[0].val}`),!l&&o[0].ack!==void 0&&(l=!0),!h&&o[0].from&&(h=!0)),n!=null&&n.length)for(let c=0;c<n.length;c++)n[c]&&(!r.length||r[r.length-1].ts<n[c].ts)?(r.push(n[c]),n[c].from&&(n[c].from.startsWith("system.adapter.")?n[c].from=n[c].from.substring(15):n[c].from.startsWith("system.host.")&&(n[c].from=n[c].from.substring(7))),!a&&n[c].lc&&(a=!0),!l&&n[c].ack!==void 0&&(l=!0),!h&&n[c].from&&(h=!0),console.log(`add value ${new Date(n[c].ts).toISOString()}: ${n[c].val}`)):r[r.length-1].ts===n[c].ts&&r[r.length-1].val!==n[c].ts&&console.error("Strange data!");else r.push({noDataForPeriod:!0});r.length||r.push({noData:!0}),this.setState({loading:!1,values:r,lcVisible:a,fromVisible:h,ackVisible:l})}))}readHistoryRange(){var i;const e=new Date,t=new Date(2e3,0,1);return!this.state.historyInstance||!((i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive))?Promise.resolve():(this.setState({loading:!0}),this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:t.getTime(),end:e.getTime(),limit:1,from:!1,ack:!1,q:!1,addId:!1,aggregate:"none"}).then(n=>{n.length?((n[0].val===null||n[0].ts===t.getTime())&&n.shift(),n.forEach(r=>r.i=!0),this.rangeValues=n,this.setState({loading:!1})):(this.rangeValues=[],this.setState({loading:!1}))}))}onToggleSelect(e,t,i){let n=[...this.state.selected];const r=n.indexOf(t);if(e.shiftKey&&this.state.lastSelected){let o=-1,a=-1;n=[];for(let l=0;l<this.state.values.length&&!(this.state.values[l].ts===t&&(o=l,a!==o&&n.push(this.state.values[l].ts),o!==-1&&a!==-1)||this.state.values[l].ts===this.state.lastSelected&&(a=l,a!==o&&n.push(this.state.values[l].ts),o!==-1&&a!==-1));l++)(o!==-1||a!==-1)&&n.push(this.state.values[l].ts)}else e.ctrlKey?(r!==-1?n.splice(r,1):n.push(t),n.sort()):n=[t];this.localStorage.setItem("App.historyLastSelected",t.toString()),this.localStorage.setItem("App.historyLastSelectedColumn",i),this.localStorage.setItem("App.historySelected",JSON.stringify(n)),this.setState({selected:n,lastSelected:t,lastSelectedColumn:i})}getTableRows(){const e=[];for(let t=this.state.values.length-1;t>=0;t--){const i=this.state.values[t],n=i.ts;if(i.e)e.push(L.jsxs(E.TableRow,{sx:{...gt.row,...gt.updatedRow,...gt.rowInterpolated},hover:!0,children:[L.jsx(E.TableCell,{}),L.jsx(E.TableCell,{children:"..."}),this.state.ackVisible?L.jsx(E.TableCell,{}):null,this.state.fromVisible?L.jsx(E.TableCell,{}):null,this.state.lcVisible?L.jsx(E.TableCell,{}):null]},n));else if(i.noData||i.noDataForPeriod)e.push(L.jsxs(E.TableRow,{sx:{...gt.row,...gt.updatedRow,...gt.rowNoData},hover:!0,children:[L.jsx(E.TableCell,{}),L.jsx(E.TableCell,{children:i.noData?this.props.t("No data in history"):this.props.t("No data in history for selected period")}),this.state.ackVisible?L.jsx(E.TableCell,{}):null,this.state.fromVisible?L.jsx(E.TableCell,{}):null,this.state.lcVisible?L.jsx(E.TableCell,{}):null]},i.noData?"nodata":""));else{const r=i.i,o=this.state.lastSelected===n;let a=i.val;this.props.isFloatComma&&this.props.obj.common.type==="number"&&a&&(a=a.toString().replace(".",",")),a===null&&(a="null"),a===void 0&&(a="_");const l=this.state.selected.includes(n);e.push(L.jsxs(E.TableRow,{sx:{...gt.row,...gt.updatedRow,...r?gt.rowInterpolated:void 0,...l?gt.rowSelected:void 0},children:[L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"ts"),children:[`${pS.formatTimestamp(i.ts)}`,o&&this.state.lastSelectedColumn==="ts"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}),L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"val"),children:[a+this.unit,o&&this.state.lastSelectedColumn==="val"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}),this.state.ackVisible?L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"ack"),sx:i.ack?gt.cellAckTrue:gt.cellAckFalse,children:[i.ack?"true":"false",o&&this.state.lastSelectedColumn==="ack"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}):null,this.state.fromVisible?L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"from"),children:[i.from||"",o&&this.state.lastSelectedColumn==="from"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}):null,this.state.lcVisible?L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"lc"),children:[i.lc?`${new Date(i.lc).toLocaleDateString()} ${new Date(i.lc).toLocaleTimeString()}.${(i.ts%1e3).toString().padStart(3,"0")}`:"",o&&this.state.lastSelectedColumn==="lc"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}):null]},n.toString()+(i.val||"").toString()))}}return e}shiftTime(){const e=new Date,t=6e4-e.getSeconds()-(1e3-e.getMilliseconds());e.getMilliseconds()&&e.setMilliseconds(1e3),e.getSeconds()&&e.setSeconds(60);const i=e.getTime();let n;const r=this.state.relativeRange;if(r==="day")e.setHours(0),e.setMinutes(0),e.setSeconds(0),n=e.getTime();else if(r==="week"){e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0);const o=e.getDay()||7;o!==1&&e.setHours(-24*(o-1)),n=e.getTime()}else if(r==="2weeks"){e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(e.getDate()-7);const o=e.getDay()||7;o!==1&&e.setHours(-24*(o-1)),n=e.getTime()}else r==="month"?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(1),n=e.getTime()):r==="year"?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(1),e.setMonth(0),n=e.getTime()):r==="12months"?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setFullYear(e.getFullYear()-1),n=e.getTime()):n=i-parseInt(r,10)*6e4;this.setState({start:n,end:i},()=>this.readHistory()),this.timeTimer=setTimeout(()=>{this.timeTimer=void 0,this.shiftTime()},t||6e4)}setRelativeInterval(e,t){if(t||(this.localStorage.setItem("App.relativeRange",e.toString()),this.setState({relativeRange:e})),e==="absolute"){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0);return}this.localStorage.removeItem("App.absoluteStart"),this.localStorage.removeItem("App.absolute");const i=new Date;if(!this.timeTimer){const o=6e4-i.getSeconds()-(1e3-i.getMilliseconds());this.timeTimer=setTimeout(()=>{this.timeTimer=void 0,this.shiftTime()},o||6e4)}i.getMilliseconds()&&i.setMilliseconds(1e3),i.getSeconds()&&i.setSeconds(60);const n=i.getTime();let r;if(e==="day")i.setHours(0),i.setMinutes(0),i.setSeconds(0),r=i.getTime();else if(e==="week"){i.setHours(0),i.setMinutes(0),i.setSeconds(0);const o=i.getDay()||7;o!==1&&i.setHours(-24*(o-1)),r=i.getTime()}else if(e==="2weeks"){i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(i.getDate()-7);const o=i.getDay()||7;o!==1&&i.setHours(-24*(o-1)),r=i.getTime()}else e==="month"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(1),r=i.getTime()):e==="year"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(1),i.setMonth(0),r=i.getTime()):e==="12months"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setFullYear(i.getFullYear()-1),r=i.getTime()):(e=Number(e),r=n-e*6e4);this.setState({start:r,end:n},()=>this.readHistory())}renderTable(){var e;if(!this.state.historyInstance)return L.jsx("div",{style:{marginTop:20,fontSize:24},children:this.props.t("History instance not selected")});if(!((e=this.state.historyInstances)!=null&&e.find(t=>t.id===this.state.historyInstance&&t.alive)))return L.jsx("div",{style:{marginTop:20,fontSize:24},children:this.props.t("History instance not alive")});if(this.state.values){const t=[200,"auto"],i=[190,100];return this.state.ackVisible&&(t.push(50),i.push(50)),this.state.fromVisible&&(t.push(150),i.push(150)),this.state.lcVisible&&(t.push(200),i.push(190)),L.jsx(E.TableContainer,{style:gt.container,children:L.jsxs(ee.TableResize,{stickyHeader:!0,sx:gt.table,initialWidths:t,minWidths:i,dblTitle:this.props.t("ra_Double click to reset table layout"),children:[L.jsx(E.TableHead,{children:L.jsxs(E.TableRow,{children:[L.jsx(E.TableCell,{style:gt.colTs,children:this.props.t("Timestamp")}),L.jsx(E.TableCell,{style:gt.colValue,children:this.props.t("Value")}),this.state.ackVisible?L.jsx(E.TableCell,{style:gt.colAck,children:this.props.t("Ack")}):null,this.state.fromVisible?L.jsx(E.TableCell,{style:gt.colFrom,children:this.props.t("From")}):null,this.state.lcVisible?L.jsx(E.TableCell,{style:gt.colLastChange,children:this.props.t("lc")}):null]})}),L.jsx(E.TableBody,{children:this.getTableRows()})]})})}return L.jsx(E.LinearProgress,{})}renderDialogConfirm(){return L.jsxs(E.Dialog,{open:!!this.state.areYouSure,onClose:()=>this.setState({areYouSure:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[L.jsx(E.DialogTitle,{id:"alert-dialog-title"}),L.jsxs(E.DialogContent,{children:[L.jsx(E.DialogContentText,{id:"alert-dialog-description",children:this.props.t("Are you sure?")}),L.jsx(E.FormControlLabel,{control:L.jsx(E.Checkbox,{value:this.state.suppressMessage,onChange:()=>this.setState({suppressMessage:!0})}),label:this.props.t("Suppress for 5 minutes")})]}),L.jsxs(E.DialogActions,{children:[L.jsx(E.Button,{variant:"contained",onClick:()=>this.setState({areYouSure:!1,suppressMessage:this.state.suppressMessage&&Date.now()},()=>this.onDelete()),color:"primary",autoFocus:!0,startIcon:L.jsx(Ie.Delete,{}),children:this.props.t("Delete")}),L.jsx(E.Button,{variant:"contained",onClick:()=>this.setState({areYouSure:!1}),color:"secondary",startIcon:L.jsx(Ie.Close,{}),children:this.props.t("Cancel")})]})]})}onDelete(){const e=this.state.selected.map(t=>({state:{ts:t},id:this.props.obj._id}));this.props.socket.sendTo(this.state.historyInstance,"delete",e).then(()=>this.readHistory())}onUpdate(){let e=this.state.edit.val;this.props.obj.common&&(this.props.obj.common.type==="number"?typeof e!="number"&&(e=parseFloat(e.toString().replace(",","."))):this.props.obj.common.type==="boolean"&&(e=e==="true"||e==="TRUE"||e===!0||e==="1"||e===1));const t={val:e,ack:this.state.edit.ack,ts:this.state.selected[0],from:`system.adapter.eos-admin.${this.adminInstance}`,q:this.state.edit.q};for(const[i,n]of Object.entries(t))n===void 0&&delete t[i];!this.state.lcVisible&&t.lc&&delete t.lc,this.props.socket.sendTo(this.state.historyInstance,"update",[{id:this.props.obj._id,state:t}]).then(()=>this.readHistory())}onInsert(){let e=this.state.edit.val;this.props.obj.common&&(this.props.obj.common.type==="number"?e=parseFloat(e.toString().replace(",",".")):this.props.obj.common.type==="boolean"&&(e=e==="true"||e==="TRUE"||e===!0||e==="1"||e===1));const t=this.state.edit.date;t.setHours(this.state.edit.time.getHours()),t.setMinutes(this.state.edit.time.getMinutes()),t.setSeconds(this.state.edit.time.getSeconds()),t.setMilliseconds(parseInt(this.state.edit.ms,10));const i={ts:t.getTime(),val:e,ack:this.state.edit.ack,from:`system.adapter.eos-admin.${this.adminInstance}`,q:this.state.edit.q||0};!this.state.lcVisible&&i.lc&&delete i.lc;for(const[n,r]of Object.entries(i))r===void 0&&delete i[n];this.props.socket.sendTo(this.state.historyInstance,"insert",[{id:this.props.obj._id,state:i}]).then(()=>this.readHistory())}updateEdit(e,t){const i=JSON.parse(JSON.stringify(this.state.edit));i.time=new Date(i.time),i.date=new Date(i.date),i[e]=t,this.setState({edit:i})}renderEditDialog(){return L.jsxs(E.Dialog,{open:this.state.updateOpened||this.state.insertOpened,onClose:()=>this.setState({updateOpened:!1,insertOpened:!1}),"aria-labelledby":"edit-dialog-title","aria-describedby":"edit-dialog-description",children:[L.jsx(E.DialogTitle,{id:"edit-dialog-title",children:this.state.updateOpened?this.props.t("Update entry"):this.props.t("Insert entry")}),L.jsx(E.DialogContent,{children:L.jsxs("form",{noValidate:!0,autoComplete:"off",children:[typeof this.state.edit.val=="boolean"?L.jsx(E.FormControlLabel,{control:L.jsx(E.Checkbox,{checked:this.state.edit.val,onChange:e=>this.updateEdit("val",e.target.checked)}),label:this.props.t("Value")}):L.jsx(E.TextField,{variant:"standard",label:this.props.t("Value"),value:this.state.edit.val,onChange:e=>this.updateEdit("val",e.target.value)}),L.jsx("br",{}),L.jsx(E.FormControlLabel,{control:L.jsx(E.Checkbox,{checked:this.state.edit.ack,onChange:e=>this.updateEdit("ack",e.target.checked)}),label:this.props.t("Acknowledged")}),this.state.insertOpened?L.jsx(_s.LocalizationProvider,{dateAdapter:dS,adapterLocale:gS[this.props.lang],children:L.jsxs("div",{style:gt.toolbarTimeGrid,children:[L.jsx("div",{style:gt.toolbarTimeLabel,children:this.props.t("Time")}),L.jsx(_s.DatePicker,{sx:gt.toolbarDate,value:this.state.edit.date,onChange:e=>this.updateEdit("date",e)}),L.jsx(_s.TimePicker,{sx:gt.toolbarTime,ampm:this.state.ampm,views:["hours","minutes","seconds"],value:this.state.edit.time,onChange:e=>this.updateEdit("time",e)}),L.jsx(E.TextField,{variant:"standard",sx:gt.msInput,helperText:this.props.t("ms"),type:"number",slotProps:{htmlInput:{max:999,min:0}},value:this.state.edit.ms,onChange:e=>this.updateEdit("ms",e.target.value)})]})}):null]})}),L.jsxs(E.DialogActions,{children:[L.jsx(E.Button,{variant:"contained",disabled:this.state.edit.val==="",onClick:()=>{const e=this.state.updateOpened;this.setState({updateOpened:!1,insertOpened:!1},()=>e?this.onUpdate():this.onInsert())},color:"primary",autoFocus:!0,children:this.state.updateOpened?this.props.t("Update"):this.props.t("Add")}),L.jsx(E.Button,{variant:"contained",onClick:()=>this.setState({updateOpened:!1,insertOpened:!1}),color:"grey",children:this.props.t("Cancel")})]})]})}setStartDate(e){const t=e.getTime();this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0),this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",t.toString()),this.localStorage.setItem("App.absoluteEnd",this.state.end.toString()),this.setState({start:t,relativeRange:"absolute"},()=>this.readHistory())}setEndDate(e){const t=e.getTime();this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",this.state.start.toString()),this.localStorage.setItem("App.absoluteEnd",t.toString()),this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0),this.setState({end:t,relativeRange:"absolute"},()=>this.readHistory())}renderToolbar(){var e,t;return L.jsxs(E.Toolbar,{children:[L.jsxs(E.FormControl,{variant:"standard",style:gt.selectHistoryControl,children:[L.jsx(E.InputLabel,{children:this.props.t("History instance")}),L.jsx(E.Select,{variant:"standard",value:this.state.historyInstance||"",onChange:i=>{const n=i.target.value;this.localStorage.setItem("App.historyInstance",n),this.readSupportedFeatures(n).then(r=>this.setState({historyInstance:n,supportedFeatures:r},()=>this.readHistory()))},children:(e=this.state.historyInstances)==null?void 0:e.map(i=>L.jsx(E.MenuItem,{value:i.id,style:i.alive?void 0:gt.notAliveInstance,children:i.id},i.id))})]}),L.jsxs(E.FormControl,{variant:"standard",style:gt.selectRelativeTime,children:[L.jsx(E.InputLabel,{children:this.props.t("Relative")}),L.jsxs(E.Select,{variant:"standard",ref:this.rangeRef,value:this.state.relativeRange,onChange:i=>this.setRelativeInterval(i.target.value),children:[L.jsx(E.MenuItem,{value:"absolute",sx:gt.customRange,children:this.props.t("custom range")},"custom"),L.jsx(E.MenuItem,{value:10,children:this.props.t("last 10 minutes")},"1"),L.jsx(E.MenuItem,{value:30,children:this.props.t("last 30 minutes")},"2"),L.jsx(E.MenuItem,{value:60,children:this.props.t("last hour")},"3"),L.jsx(E.MenuItem,{value:"day",children:this.props.t("this day")},"4"),L.jsx(E.MenuItem,{value:1440,children:this.props.t("last 24 hours")},"5"),L.jsx(E.MenuItem,{value:"week",children:this.props.t("this week")},"6"),L.jsx(E.MenuItem,{value:1440*7,children:this.props.t("last week")},"7"),L.jsx(E.MenuItem,{value:"2weeks",children:this.props.t("this 2 weeks")},"8"),L.jsx(E.MenuItem,{value:1440*14,children:this.props.t("last 2 weeks")},"9"),L.jsx(E.MenuItem,{value:"month",children:this.props.t("this month")},"10"),L.jsx(E.MenuItem,{value:720*60,children:this.props.t("last 30 days")},"11"),L.jsx(E.MenuItem,{value:"year",children:this.props.t("this year")},"12"),L.jsx(E.MenuItem,{value:"12months",children:this.props.t("last 12 months")},"13")]})]}),L.jsxs(_s.LocalizationProvider,{dateAdapter:dS,adapterLocale:gS[this.props.lang],children:[L.jsxs("div",{style:gt.toolbarTimeGrid,children:[L.jsx("div",{style:{...gt.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("Start time")}),L.jsx(_s.DatePicker,{sx:gt.toolbarDate,disabled:this.state.relativeRange!=="absolute",value:new Date(this.state.start),onChange:i=>this.setStartDate(i)}),L.jsx(_s.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:gt.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.start),onChange:i=>this.setStartDate(i)})]}),L.jsxs("div",{style:gt.toolbarTimeGrid,children:[L.jsx("div",{style:{...gt.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("End time")}),L.jsx(_s.DatePicker,{disabled:this.state.relativeRange!=="absolute",sx:gt.toolbarDate,value:new Date(this.state.end),onChange:i=>this.setEndDate(i)}),L.jsx(_s.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:gt.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.end),onChange:i=>this.setEndDate(i)})]})]}),L.jsx(E.Box,{component:"div",sx:gt.grow}),(t=this.state.values)!=null&&t.length?L.jsx(E.IconButton,{size:"large",onClick:()=>this.exportData(),title:this.props.t("Save data as csv"),children:L.jsx(bie,{})}):null,this.state.supportedFeatures.includes("insert")&&this.props.expertMode?L.jsx(E.IconButton,{size:"large",onClick:()=>{const i=new Date,n={ack:this.state.values[this.state.values.length-1].ack,val:this.state.values[this.state.values.length-1].val,date:new Date(i),ms:0,time:new Date(i),q:0};this.setState({edit:n,insertOpened:!0})},children:L.jsx(wie,{})}):null,this.state.supportedFeatures.includes("update")&&this.props.expertMode?L.jsx(E.IconButton,{size:"large",disabled:this.state.selected.length!==1,onClick:()=>{const i=JSON.parse(JSON.stringify(this.state.values.find(r=>r.ts===this.state.lastSelected))),n=new Date(i.ts);i.date=new Date(n),i.time=new Date(n),this.setState({edit:i,updateOpened:!0})},children:L.jsx(Ie.Edit,{})}):null,this.state.supportedFeatures.includes("delete")&&this.props.expertMode?L.jsx(E.IconButton,{size:"large",disabled:!this.state.selected.length,onClick:()=>{typeof this.state.suppressMessage=="number"&&Date.now()-this.state.suppressMessage<3e5?this.onDelete():this.setState({areYouSure:!0})},children:L.jsx(Ie.Delete,{})}):null]})}exportData(){let e=window.document.getElementById("export-file");e||(e=document.createElement("a"),e.setAttribute("id","export-file"),e.style.display="none",document.body.appendChild(e));const t=["timestamp;value;acknowledged;from;"];this.state.values.forEach(i=>!i.i&&!i.e&&t.push([pS.formatTimestamp(i.ts),i.val===null||i.val===void 0?"null":i.val.toString(),i.ack?"true":"false",i.from||""].join(";"))),e.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(t.join(`
1
+ import{j as L}from"./DefaultPropsProvider-BiXBMQYQ.js";import{i as Te,a as uS}from"./iobroker_admin__loadShare__react__loadShare__-LM7uyL45.js";import{i as E,a as Ie}from"./iobroker_admin__loadShare___mf_0_mui_mf_1_icons_mf_2_material__loadShare__-CJO5yP3h.js";import{i as ee}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_adapter_mf_2_react_mf_2_v5__loadShare__-LFZoiUTt.js";import{l as vie}from"./index-8HslT92O.js";import{i as _p}from"./iobroker_admin__loadShare___mf_0_iobroker_mf_1_json_mf_2_config__loadShare__-CpA7pnS5.js";import{b as Bg,i as co,d as dS,f as _ie,M as F7,E as f$}from"./bootstrap-COulQZax-v84.js";import{i as _s}from"./ext-language_tools-ylAoucDh.js";import{c as bie,d as wie,e as yie,f as B7}from"./index-BmNcalFW.js";import{a as Cie}from"./_commonjsHelpers-CE1G-McA.js";import{h as xT}from"./zh-cn-nUtvS7Wc.js";import{C as Sie}from"./CustomModal-CqDLqryN.js";import"./iobroker_admin__mf_v__runtimeInit__mf_v__-g2X2zhAf.js";import"./emotion-serialize.esm-Q4o_CgeF.js";import"./iobroker_admin__loadShare___mf_0_emotion_mf_1_react__loadShare__-BywLg1Xe.js";import"./ace-DEUjyTIn.js";import"./iobroker_admin__loadShare__leaflet__loadShare__-CNUAG3AH.js";import"./iobroker_admin__loadShare__react_mf_2_dropzone__loadShare__-CwjnV48g.js";import"./iobroker_admin__loadShare__react_mf_2_dom__loadShare__-CVeAXnkk.js";import"./preload-helper-BDBacUwf.js";import"./sdk-C-e-e2gd.js";import"./extends-CF3RwP-h.js";import"./assertThisInitialized-B0aQ9eG_.js";import"./useTheme-Bl-M1DYp.js";import"./createTheme-DFX8CY6F.js";import"./blue-CagzI6CQ.js";import"./index-DcK0RDrH.js";import"./ThemeProvider-BOFFjWAF.js";import"./emotion-cache.browser.esm-BgJfNZJN.js";import"./setYear-3ufv5yRD.js";import"./en-US-DBFJNIH6.js";import"./iconBase-2IlPecPg.js";import"./_commonjs-dynamic-modules-TDtrdbi3.js";const ds={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden"},headingIcon:{marginRight:5,width:32,height:32},titleEnabled:{float:"right",fontSize:16,color:"#7ff57f",textTransform:"uppercase",fontWeight:"bold",paddingLeft:20},scrollDiv:{width:"100%",height:"100%",overflow:"auto"},enabledControl:{width:130,display:"inline-block",verticalAlign:"top"},customControls:{width:"calc(100% - 130px)",maxWidth:800,display:"inline-block",verticalAlign:"top",paddingTop:16},accordionOdd:{},accordionEven:{backgroundColor:"rgba(128, 128, 128, 0.1)"},accordionHeaderOdd:{backgroundColor:"rgba(128, 128, 128, 0.2)"},accordionHeaderEven:{backgroundColor:"rgba(128, 128, 128, 0.3)"},accordionHeaderEnabledOdd:{backgroundColor:"rgba(128, 255, 128, 0.2)"},accordionHeaderEnabledEven:{backgroundColor:"rgba(128, 255, 128, 0.2)"},enabledVisible:{display:"inline-block"},enabledInvisible:{display:"none"}},xie=".";class fS extends Te.Component{changedIds;scrollDivRef;jsonConfigs;refTemplate;customObj;commonConfig={};statesFilterFunctions={};cb;cachedNewValues;constructor(e){super(e);let t;try{t=JSON.parse((window._localStorage||window.localStorage).getItem("App.customsExpanded")||"[]")}catch{t=[]}this.changedIds=[],this.state={loaded:!1,expanded:t,newValues:{},confirmed:!1,showConfirmation:!1,maxOids:0,systemConfig:this.props.systemConfig},this.scrollDivRef=Te.createRef(),this.jsonConfigs={},this.refTemplate={},this.props.customsInstances.map(i=>this.refTemplate[i]=Te.createRef()),this.customObj=this.props.objectIDs.length>1?{common:{custom:{}},native:{}}:Bg.deepClone(this.props.objects[this.props.objectIDs[0]]||null),this.customObj&&this.loadAllCustoms().then(()=>{this.commonConfig=this.getCommonConfig(),this.setState({loaded:!0,newValues:{}})})}async componentDidMount(){this.state.systemConfig||this.setState({systemConfig:await this.props.socket.getCompactSystemConfig()}),this.props.registerSaveFunc&&this.props.registerSaveFunc(this.onSave)}componentWillUnmount(){this.props.registerSaveFunc&&this.props.registerSaveFunc()}async loadAllCustoms(){const e=[];for(const t of this.props.customsInstances){if(t==="_")continue;const i=t.replace(/\.\d+$/,"").replace("system.adapter.","");this.jsonConfigs[i]===void 0&&(this.jsonConfigs[i]=null,e.push(this.getCustomTemplate(i)))}await Promise.all(e),this.props.customsInstances.forEach(t=>{var n,r;const i=t.replace(/\.\d+$/,"").replace("system.adapter.","");this.jsonConfigs[i]&&(this.jsonConfigs[i].instanceObjs||={},this.jsonConfigs[i].instanceObjs[t]={_id:t,common:JSON.parse(JSON.stringify((n=this.props.objects[`system.adapter.${t}`])==null?void 0:n.common)),native:JSON.parse(JSON.stringify((r=this.props.objects[`system.adapter.${t}`])==null?void 0:r.native)),type:"instance",instanceObjects:[],objects:[]})})}getStatesFilterFunction(e){var r,o;if(this.statesFilterFunctions[e])return this.statesFilterFunctions[e];const t=e.split(".")[0],i=(o=(r=this.jsonConfigs[t])==null?void 0:r.json)==null?void 0:o.statesFilter;let n;if(i===void 0)n=()=>!0;else if(i===!0){const a=`${e}.`;n=l=>l.startsWith(a)}else try{const a=new RegExp(i);n=l=>a.test(l)}catch{console.error(`Invalid statesFilter regex: ${i}`),n=()=>!0}return this.statesFilterFunctions[e]=n,n}getFilteredObjectIDs(e){const t=this.getStatesFilterFunction(e);return this.props.objectIDs.filter(t)}async getCustomTemplate(e){var i;const t=this.props.objects[`system.adapter.${e}`]?Bg.deepClone(this.props.objects[`system.adapter.${e}`]):null;if(!t){console.error(`Cannot find adapter "${e}"`);return}if(Bg.fixAdminUI(t),((i=t.common)==null?void 0:i.adminUI.custom)==="json")try{const n=await this.props.socket.fileExists(`${e}.admin`,"jsonCustom.json5");let r,o;n?o=await this.props.socket.readFile(`${e}.admin`,"jsonCustom.json5"):o=await this.props.socket.readFile(`${e}.admin`,"jsonCustom.json"),o.file!==void 0?r=o.file:r=o;let a;try{a=vie.parse(r),this.jsonConfigs[e]=this.jsonConfigs[e]||{},this.jsonConfigs[e].json=a}catch(l){console.error(`Cannot parse jsonConfig of ${e}: ${l}`),window.alert(`Cannot parse jsonConfig of ${e}: ${l}`)}await _p.JsonConfigComponent.loadI18n(this.props.socket,a.i18n,e);return}catch(n){console.error(`Cannot load jsonConfig of ${e}: ${n}`),window.alert(`Cannot load jsonConfig of ${e}: ${n}`)}console.error(`Adapter ${e} is not yet supported by this version of admin`),window.alert(`Adapter ${e} is not yet supported by this version of admin`)}_executeCustom(e,t,i,n,r,o,a){if(a.includes(o))return;a.push(o);let l=[],h;if(e&&typeof e=="object"?(l=e.alsoDependsOn||[],typeof l=="string"&&(l=[l]),h=e.func):h=e,l.forEach(c=>{if(!r[c])console.error(`[JsonConfigComponent] attribute "${c}" does not exist!`);else if(!r[c].defaultFunc)console.error(`[JsonConfigComponent] attribute "${c}" is not required to be includes in "alsoDependsOn" while has static value!`);else{const u=this._executeCustom(r[c].defaultFunc,t,i,n,r,c,a);u!==void 0&&(t[c]=u)}}),!h)t[o]=r[o].default===void 0?null:r[o].default;else try{const c=new Function("data","originalData","_system","instanceObj","customObj","_socket",h.includes("return")?h:`return ${h}`);t[o]=c(t||this.props.data,this.props.originalData,this.props.systemConfig,n,i,this.props.socket)}catch(c){console.error(`Cannot execute ${e}: ${c}`),t[o]=!r[o]||r[o].default===void 0?null:r[o].default}return t[o]}static flattenItems(e,t={}){return e&&Object.keys(e).forEach(i=>{e[i].items?fS.flattenItems(e[i].items,t):t[i]=e[i]}),t}getDefaultValues(e,t){const i={enabled:!1},n=e.split(".")[0];if(this.jsonConfigs[n]&&!this.jsonConfigs[n].disabled){const r=fS.flattenItems(this.jsonConfigs[n].json.items);if(r){const o=[],a=Object.keys(r).filter(l=>r[l]);a.forEach(l=>{!r[l].defaultFunc&&r[l].default!==void 0&&(i[l]=r[l].default)}),a.forEach(l=>{r[l].defaultFunc&&this._executeCustom(r[l].defaultFunc,i,t,this.jsonConfigs[n].instanceObjs[e],r,l,o)})}}return i}getCommonConfig(){const e=this.props.objects,t={};return this.props.customsInstances.forEach(i=>{const n=i.split(".")[0];if(this.jsonConfigs[n]&&this.jsonConfigs[n].disabled)return;const r=this.getFilteredObjectIDs(i);t[i]={},r.forEach(o=>{var h;const a=e[o],l=(h=a==null?void 0:a.common)!=null&&h.custom&&a.common.custom[i]||null;if(l)Object.keys(l).forEach(c=>{c.startsWith("_")||(t[i][c]===void 0?t[i][c]=l[c]:t[i][c]!==l[c]&&(Array.isArray(t[i][c])||(t[i][c]=[t[i][c]]),t[i][c].includes(l[c])||t[i][c].push(l[c])))});else{const c=this.getDefaultValues(i,a);c.enabled=!1,Object.keys(c).forEach(u=>{u.startsWith("_")||(t[i][u]===void 0?t[i][u]=c[u]:t[i][u]!==c[u]&&(Array.isArray(t[i][u])||(t[i][u]=[t[i][u]]),t[i][u].includes(c[u])||t[i][u].push(c[u])))})}}),Object.keys(t[i]).forEach(o=>{Array.isArray(t[i][o])&&t[i][o].sort()})}),t}isChanged(e){return e=e||this.state.newValues,Object.keys(e).find(t=>e[t]===null||e[t]&&Object.keys(e[t]).find(i=>!i.startsWith("_")))}combineNewAndOld(e,t=!1){const i={...this.commonConfig[e]||{},...this.state.newValues[e]||{}};return t&&Object.keys(i).forEach(n=>{n.startsWith("_")&&delete i[n]}),this.state.newValues[e]===null&&(i.enabled=!1),i}renderOneCustom(e,t,i,n){var g,p;const r=e.split(".")[0];if(this.getFilteredObjectIDs(e).length===0)return null;const o=`${xie}/adapter/${r}/${this.props.objects[`system.adapter.${r}`].common.icon}`,a=this.state.newValues[e]!==void 0&&(!this.state.newValues[e]||this.state.newValues[e].enabled!==void 0)?!!(this.state.newValues[e]&&this.state.newValues[e].enabled):this.state.newValues[e]===null?!1:this.commonConfig[e].enabled,l=Array.isArray(a)&&(!this.state.newValues[e]||this.state.newValues[e].enabled===void 0),h=(p=(g=this.jsonConfigs[r])==null?void 0:g.json)==null?void 0:p.disabled,c=this.combineNewAndOld(e),u=this.jsonConfigs[r].json.hidden;if(h&&u===!0||typeof u=="string"&&this._executeCustom(u,c,i,t,this.jsonConfigs[r].json.items,"enabled",[]))return null;let d=null;const f=this.jsonConfigs[r].json.help;return h&&f&&(typeof f=="object"?d=f[this.props.lang]||f.en:d=this.props.t(f)),L.jsxs(E.Accordion,{id:`Accordion_${e}`,style:n%2?ds.accordionOdd:ds.accordionEven,expanded:this.state.expanded.includes(e),ref:this.refTemplate[e],onChange:()=>{const m=[...this.state.expanded],v=m.indexOf(e);v===-1?m.push(e):m.splice(v,1),(window._localStorage||window.localStorage).setItem("App.customsExpanded",JSON.stringify(m)),v===-1&&(window._localStorage||window.localStorage).setItem("App.customsLastExpanded",e),this.setState({expanded:m})},children:[L.jsxs(E.AccordionSummary,{expandIcon:L.jsx(Ie.ExpandMore,{}),"data-id":e,style:n%2?a?ds.accordionHeaderEnabledOdd:ds.accordionHeaderOdd:a?ds.accordionHeaderEnabledEven:ds.accordionHeaderEven,children:[L.jsx("img",{src:o,style:ds.headingIcon,alt:""}),L.jsx(E.Typography,{style:ds.heading,children:this.props.t("Settings %s",e)}),L.jsx("div",{className:"titleEnabled",style:{...ds.titleEnabled,...a?ds.enabledVisible:ds.enabledInvisible},children:this.props.t("Enabled")})]}),L.jsxs(E.AccordionDetails,{children:[L.jsx("div",{style:ds.enabledControl,children:L.jsx(E.FormControlLabel,{style:ds.formControl,control:L.jsx(E.Checkbox,{indeterminate:l,checked:!!a,disabled:!!h,onChange:m=>{this.cachedNewValues=this.cachedNewValues||this.state.newValues;const v=Bg.deepClone(this.cachedNewValues);v[e]=v[e]||{},l||m.target.checked?v[e].enabled=!0:a&&this.commonConfig[e].enabled?v[e]=null:delete v[e],this.cachedNewValues=v,this.setState({newValues:v,hasChanges:this.isChanged(v)},()=>{this.cachedNewValues=void 0,this.props.onChange&&this.props.onChange(!!this.state.hasChanges)})}}),label:this.props.t("Enabled")})}),L.jsxs("div",{style:ds.customControls,children:[!h&&(a||l)&&this.state.systemConfig?L.jsx(_p.JsonConfigComponent,{instanceObj:t,customObj:i,custom:!0,adapterName:r,instance:parseInt((e==null?void 0:e.split(".").pop())??"0",10)||0,socket:this.props.socket,themeName:this.props.themeName,themeType:this.props.themeType,theme:this.props.theme,multiEdit:this.props.objectIDs.length>1,schema:this.jsonConfigs[r].json,data:c,isFloatComma:this.props.systemConfig.common.isFloatComma,dateFormat:this.props.systemConfig.common.dateFormat,onError:m=>this.setState({error:m},()=>{var v,_;return(_=(v=this.props).onError)==null?void 0:_.call(v,m)}),onValueChange:(m,v)=>{var b;this.cachedNewValues=this.cachedNewValues||this.state.newValues,console.log(`${m} => ${v}`);const _=Bg.deepClone(this.cachedNewValues);_[e]=_[e]||{},JSON.stringify(_p.ConfigGeneric.getValue((b=this.commonConfig)==null?void 0:b[e],m))===JSON.stringify(v)?(_p.ConfigGeneric.setValue(_[e],m,null),Object.keys(_[e]).length||delete _[e]):_p.ConfigGeneric.setValue(_[e],m,v),this.cachedNewValues=_,this.setState({newValues:_,hasChanges:this.isChanged(_)},()=>{this.cachedNewValues=void 0,this.props.onChange&&this.props.onChange(!!this.state.hasChanges)})}}):null,d]})]})]},e)}renderErrorMessage(){return!!this.state.error&&L.jsx(ee.DialogError,{title:this.props.t("Error"),text:this.state.error?"Error":"",onClose:()=>this.setState({error:!1})})}getObject(e,t,i){return e[i]?Promise.resolve(e[i]):this.props.socket.getObject(i).then(n=>(t[i]=Bg.deepClone(n),e[i]=n,n))}saveOneState(e,t,i,n){if(i=i||{},n=n||{},e!=null&&e.length){const r=this.state.maxOids||e.length;this.state.maxOids===null&&this.setState({maxOids:e.length},()=>this.props.onProgress(!0)),this.setState({progress:Math.round((r-e.length)/r*50)});const o=e.shift();this.getObject(i,n,o).then(a=>{var h,c,u;if(!a){window.alert(`Invalid object ${o}`);return}(h=a.common)!=null&&h.custom&&Object.keys(a.common.custom).forEach(d=>{(!a.common.custom[d]||!a.common.custom[d].enabled)&&(a.common.custom[d]=null)});const l=Object.keys(this.state.newValues);for(let d=0;d<l.length;d++){const f=l[d];if(!this.getStatesFilterFunction(f)(o))continue;const g=this.combineNewAndOld(f,!0);if(g.enabled===!1)(u=(c=a.common)==null?void 0:c.custom)!=null&&u[f]&&(a.common.custom[f]=null);else if(g.enabled){if(a.common=a.common||{},Array.isArray(g.enabled)&&(!a.common.custom||!a.common.custom[f]||!a.common.custom[f].enabled)){a.common.custom&&a.common.custom[f]&&(a.common.custom[f]=null);continue}if(a.common.custom=a.common.custom||{},!a.common.custom[f]||!a.common.custom[f].enabled){const m=this.getDefaultValues(f,a);a.common.custom[f]=JSON.parse(JSON.stringify(m||{})),Object.keys(a.common.custom[f]).forEach(v=>{v.startsWith("_")&&delete a.common.custom[f][v]})}const p=this.props.objectIDs.length>1;a.common.custom[f].enabled=!0,Object.keys(g).forEach(m=>{if(!m.startsWith("_")){if(Array.isArray(g[m])&&p)return;a.common.custom[f][m]=g[m]}})}}setTimeout(()=>this.saveOneState(e,t,i,n),0)})}else{const r=Object.keys(i);if(!r.length)this.setState({maxOids:0},()=>this.props.onProgress(!1)),t&&t();else{this.setState({progress:Math.round((this.state.maxOids-r.length)/this.state.maxOids*50)+50});const o=r.shift();if(JSON.stringify(i[o].common)!==JSON.stringify(n[o].common)){this.changedIds.includes(o)||this.changedIds.push(o),this.props.socket.setObject(o,i[o]).then(async()=>{delete i[o],delete n[o],this.props.objects[o]=await this.props.socket.getObject(o),setTimeout(()=>this.saveOneState(e,t,i,n),0)});return}delete i[o],delete n[o],setTimeout(()=>this.saveOneState(e,t,i,n),0)}}}renderConfirmationDialog(){return this.state.showConfirmation?L.jsx(ee.DialogConfirm,{text:this.props.t("The changes will be applied to %s states. Are you sure?",this.props.objectIDs.length.toString()),ok:this.props.t("Yes"),onClose:e=>{e?this.setState({showConfirmation:!1,confirmed:!0},()=>{const t=this.cb;this.cb=void 0,this.onSave(t)}):(this.cb=void 0,this.setState({showConfirmation:!1}))}}):null}onSave=e=>{this.props.objectIDs.length>10&&!this.state.confirmed?(this.cb=e,this.setState({showConfirmation:!0})):this.saveOneState([...this.props.objectIDs],()=>{this.cachedNewValues={},this.commonConfig=this.getCommonConfig(),this.setState({confirmed:!1,hasChanges:void 0,newValues:{}},()=>{this.props.reportChangedIds(this.changedIds),this.props.onChange(!1,!0),e&&setTimeout(()=>e(),100)})})};render(){if(this.customObj===null)return L.jsx("div",{style:{color:"#F55",fontSize:32},children:this.props.t("Object does not exist!")});if(!this.state.loaded)return L.jsx(E.LinearProgress,{});let e=0;return L.jsxs(E.Paper,{style:ds.paper,children:[this.state.maxOids>1&&L.jsx(E.LinearProgress,{color:"secondary",variant:"determinate",value:this.state.progress}),L.jsx("div",{style:ds.scrollDiv,ref:this.scrollDivRef,children:this.state.maxOids===0&&Object.values(this.jsonConfigs).map(t=>t?Object.keys(t.instanceObjs).map(i=>this.renderOneCustom(i,t.instanceObjs[i],this.customObj,e++)):null)}),this.renderErrorMessage(),this.renderConfirmationDialog()]})}}const gS={en:co.enUS,fr:co.fr,ru:co.ru,de:co.de,es:co.es,br:co.ptBR,nl:co.nl,it:co.it,pt:co.pt,pl:co.pl,uk:co.uk,"zh-cn":co.zhCN},gt={paper:{height:"100%",maxHeight:"100%",maxWidth:"100%",overflow:"hidden"},tableDiv:s=>({height:`calc(100% - ${parseInt(s.mixins.toolbar.minHeight,10)+8}px)`,overflow:"hidden",width:"100%"}),container:{height:"100%"},table:s=>({minWidth:960,width:"100%","& td:nth-of-type(5)":{overflow:"hidden",whiteSpace:"nowrap"},"& tr:nth-child(even)":{backgroundColor:s.palette.mode==="dark"?"#383838":"#b2b2b2"}}),row:{userSelect:"none",position:"relative","&:hover":{opacity:.7},"& td":{position:"relative"}},updatedRow:{animation:"updated 1s"},rowInterpolated:{opacity:.5},selectHistoryControl:{width:130},selectRelativeTime:{marginLeft:10,width:200},notAliveInstance:{opacity:.5},customRange:s=>({color:s.palette.primary.main}),rowSelected:s=>({backgroundColor:s.palette.secondary.main,color:s.palette.secondary.contrastText,"& td":{color:s.palette.secondary.contrastText,backgroundColor:s.palette.secondary.main}}),rowFocused:s=>({position:"absolute",pointerEvents:"none",top:0,bottom:0,left:0,right:0,m:"3px",border:`1px dotted ${s.palette.action.active}`}),grow:{flexGrow:1},msInput:{width:50,pt:"10px",ml:"5px","& label":{mt:"15px"}},cellAckTrue:s=>({color:s.palette.mode==="dark"?"#66ff7f":"#04a821"}),cellAckFalse:{color:"#FF6666"},toolbarDate:{width:124,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTime:{width:84,mt:"9px","& fieldset":{display:"none"},"& input":{padding:"8px 0 0 0"},"& .MuiInputAdornment-root":{ml:0,mt:"7px"}},toolbarTimeGrid:{position:"relative",marginLeft:8,paddingLeft:8,paddingRight:8,paddingTop:4,paddingBottom:4,border:"1px dotted #AAAAAA",borderRadius:8,display:"flex"},toolbarTimeLabel:{position:"absolute",padding:8,fontSize:"0.8rem",left:2,top:-9},noLoadingProgress:{width:"100%",height:4},colValue:{},colAck:{},colFrom:{},colLastChange:{},colTs:{}};class pS extends Te.Component{adminInstance;supportedFeaturesPromises;unit;timeTimer;readSupportedFeaturesTimeout;rangeValues;rangeRef;subscribes;localStorage;constructor(e){super(e),this.localStorage=window._localStorage||window.localStorage;let t=this.localStorage.getItem("App.relativeRange")||"absolute";const i=parseInt(this.localStorage.getItem("App.absoluteStart"),10)||0,n=parseInt(this.localStorage.getItem("App.absoluteEnd"),10)||0,r=this.localStorage.getItem("App.historySelected")||"",o=parseInt(this.localStorage.getItem("App.historyLastSelected"),10)||null,a=this.localStorage.getItem("App.historyLastSelectedColumn")||null;(!i||!n)&&(!t||t==="absolute")&&(t="30"),i&&n&&(t="absolute");let l;try{l=JSON.parse(r)}catch{l=[]}this.state={start:i,end:n,values:null,relativeRange:t,selected:l,lastSelected:o,lastSelectedColumn:a,historyInstance:"",updateOpened:!1,insertOpened:!1,historyInstances:null,lcVisible:!0,ackVisible:!0,fromVisible:!0,supportedFeatures:[],ampm:!1,edit:{}},this.adminInstance=parseInt(window.location.search.slice(1),10)||0,this.supportedFeaturesPromises={},this.unit=this.props.obj.common&&this.props.obj.common.unit?` ${this.props.obj.common.unit}`:"",this.timeTimer=void 0,this.subscribes=[],this.prepareData().then(()=>this.readHistoryRange()).then(()=>{t!=="absolute"?this.setRelativeInterval(this.state.relativeRange,!0):this.readHistory()})}readSupportedFeatures(e){return e=e||this.state.historyInstance,e?this.supportedFeaturesPromises[e]instanceof Promise?this.supportedFeaturesPromises[e]:(this.supportedFeaturesPromises[e]=new Promise(t=>{this.readSupportedFeaturesTimeout&&clearTimeout(this.readSupportedFeaturesTimeout),this.readSupportedFeaturesTimeout=setTimeout(()=>{this.readSupportedFeaturesTimeout=void 0,t([])},2e3),this.props.socket.sendTo(e,"features",null).then(i=>{this.readSupportedFeaturesTimeout?(clearTimeout(this.readSupportedFeaturesTimeout),this.readSupportedFeaturesTimeout=void 0,t(i?i.supportedFeatures||[]:[])):this.setState({supportedFeatures:i?i.supportedFeatures||[]:[]})})}),this.supportedFeaturesPromises[e]):Promise.resolve([])}async componentDidMount(){await this.props.socket.subscribeState(this.props.obj._id,this.onChange)}componentWillUnmount(){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0);for(let e=0;e<this.subscribes.length;e++)this.props.socket.unsubscribeState(this.subscribes[e],this.onChange);this.subscribes=[],this.props.socket.unsubscribeState(this.props.obj._id,this.onChange)}onChange=(e,t)=>{if(e===this.props.obj._id&&t&&this.state.values&&(!this.state.values.length||this.state.values[this.state.values.length-1].ts<t.ts)){const i=[...this.state.values,t];this.setState({values:i})}else if(e.startsWith("system.adapter.")&&e.endsWith(".alive")){const i=e.substring(15,e.length-6),n=this.state.historyInstances,r=n.findIndex(o=>o.id===i);if(r!==-1&&n[r].alive!==!!(t!=null&&t.val)){const o=JSON.parse(JSON.stringify(n));o[r].alive=!!(t!=null&&t.val),this.setState({historyInstances:o},()=>{o[r].alive&&this.state.historyInstance===i&&this.readHistoryRange().then(()=>this.readHistory())})}}};async prepareData(){var o;const e=await this.getHistoryInstances(),t=await this.props.socket.getCompactSystemConfig(),i=(o=t==null?void 0:t.common)==null?void 0:o.defaultHistory;let n=this.localStorage.getItem("App.historyInstance")||"";if((!n||!e.find(a=>a.id===n&&a.alive))&&(n=i),!n||!e.find(a=>a.id===n&&a.alive)){const a=e.find(l=>l.alive);a&&(n=a.id)}!n&&e.length&&(n=i);const r=await this.readSupportedFeatures(n);await new Promise(a=>{this.setState({ampm:(t.common.dateFormat||"").includes("/"),historyInstances:e,historyInstance:n,supportedFeatures:r},()=>a())})}getHistoryInstances(){const e=[],t=[];return this.props.customsInstances.forEach(i=>{const n=this.props.objects[`system.adapter.${i}`];if(n&&n.common&&n.common.getHistory){const r={id:i,alive:!1};e.push(r),t.push(`system.adapter.${i}.alive`)}}),t.length?this.props.socket.getForeignStates(t).then(async i=>{Object.keys(i).forEach(n=>{var o;const r=e.find(a=>n.endsWith(`${a.id}.alive`));r&&(r.alive=!!((o=i[n])!=null&&o.val))}),this.subscribes=t;for(let n=0;n<t.length;n++)await this.props.socket.subscribeState(t[n],this.onChange);return e}):Promise.resolve(e)}readHistory(e,t){var i;return e=e||this.state.start,t=t||this.state.end,!this.state.historyInstance||!((i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive))?null:(this.setState({loading:!0}),this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:e,end:t,from:!0,ack:!0,q:!0,addId:!1,aggregate:"none",returnNewestEntries:!0}).then(n=>{const r=[],o=this.rangeValues;let a=!1,l=!1,h=!1;if(o&&o.length&&(!n||!n.length||o[0].ts<n[0].ts)&&(r.push(o[0]),r.push({ts:o[0].ts+1,e:!0}),console.log(`add ${new Date(o[0].ts).toISOString()}: ${o[0].val}`),!l&&o[0].ack!==void 0&&(l=!0),!h&&o[0].from&&(h=!0)),n!=null&&n.length)for(let c=0;c<n.length;c++)n[c]&&(!r.length||r[r.length-1].ts<n[c].ts)?(r.push(n[c]),n[c].from&&(n[c].from.startsWith("system.adapter.")?n[c].from=n[c].from.substring(15):n[c].from.startsWith("system.host.")&&(n[c].from=n[c].from.substring(7))),!a&&n[c].lc&&(a=!0),!l&&n[c].ack!==void 0&&(l=!0),!h&&n[c].from&&(h=!0),console.log(`add value ${new Date(n[c].ts).toISOString()}: ${n[c].val}`)):r[r.length-1].ts===n[c].ts&&r[r.length-1].val!==n[c].ts&&console.error("Strange data!");else r.push({noDataForPeriod:!0});r.length||r.push({noData:!0}),this.setState({loading:!1,values:r,lcVisible:a,fromVisible:h,ackVisible:l})}))}readHistoryRange(){var i;const e=new Date,t=new Date(2e3,0,1);return!this.state.historyInstance||!((i=this.state.historyInstances)!=null&&i.find(n=>n.id===this.state.historyInstance&&n.alive))?Promise.resolve():(this.setState({loading:!0}),this.props.socket.getHistory(this.props.obj._id,{instance:this.state.historyInstance,start:t.getTime(),end:e.getTime(),limit:1,from:!1,ack:!1,q:!1,addId:!1,aggregate:"none"}).then(n=>{n.length?((n[0].val===null||n[0].ts===t.getTime())&&n.shift(),n.forEach(r=>r.i=!0),this.rangeValues=n,this.setState({loading:!1})):(this.rangeValues=[],this.setState({loading:!1}))}))}onToggleSelect(e,t,i){let n=[...this.state.selected];const r=n.indexOf(t);if(e.shiftKey&&this.state.lastSelected){let o=-1,a=-1;n=[];for(let l=0;l<this.state.values.length&&!(this.state.values[l].ts===t&&(o=l,a!==o&&n.push(this.state.values[l].ts),o!==-1&&a!==-1)||this.state.values[l].ts===this.state.lastSelected&&(a=l,a!==o&&n.push(this.state.values[l].ts),o!==-1&&a!==-1));l++)(o!==-1||a!==-1)&&n.push(this.state.values[l].ts)}else e.ctrlKey?(r!==-1?n.splice(r,1):n.push(t),n.sort()):n=[t];this.localStorage.setItem("App.historyLastSelected",t.toString()),this.localStorage.setItem("App.historyLastSelectedColumn",i),this.localStorage.setItem("App.historySelected",JSON.stringify(n)),this.setState({selected:n,lastSelected:t,lastSelectedColumn:i})}getTableRows(){const e=[];for(let t=this.state.values.length-1;t>=0;t--){const i=this.state.values[t],n=i.ts;if(i.e)e.push(L.jsxs(E.TableRow,{sx:{...gt.row,...gt.updatedRow,...gt.rowInterpolated},hover:!0,children:[L.jsx(E.TableCell,{}),L.jsx(E.TableCell,{children:"..."}),this.state.ackVisible?L.jsx(E.TableCell,{}):null,this.state.fromVisible?L.jsx(E.TableCell,{}):null,this.state.lcVisible?L.jsx(E.TableCell,{}):null]},n));else if(i.noData||i.noDataForPeriod)e.push(L.jsxs(E.TableRow,{sx:{...gt.row,...gt.updatedRow,...gt.rowNoData},hover:!0,children:[L.jsx(E.TableCell,{}),L.jsx(E.TableCell,{children:i.noData?this.props.t("No data in history"):this.props.t("No data in history for selected period")}),this.state.ackVisible?L.jsx(E.TableCell,{}):null,this.state.fromVisible?L.jsx(E.TableCell,{}):null,this.state.lcVisible?L.jsx(E.TableCell,{}):null]},i.noData?"nodata":""));else{const r=i.i,o=this.state.lastSelected===n;let a=i.val;this.props.isFloatComma&&this.props.obj.common.type==="number"&&a&&(a=a.toString().replace(".",",")),a===null&&(a="null"),a===void 0&&(a="_");const l=this.state.selected.includes(n);e.push(L.jsxs(E.TableRow,{sx:{...gt.row,...gt.updatedRow,...r?gt.rowInterpolated:void 0,...l?gt.rowSelected:void 0},children:[L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"ts"),children:[`${pS.formatTimestamp(i.ts)}`,o&&this.state.lastSelectedColumn==="ts"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}),L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"val"),children:[a+this.unit,o&&this.state.lastSelectedColumn==="val"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}),this.state.ackVisible?L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"ack"),sx:i.ack?gt.cellAckTrue:gt.cellAckFalse,children:[i.ack?"true":"false",o&&this.state.lastSelectedColumn==="ack"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}):null,this.state.fromVisible?L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"from"),children:[i.from||"",o&&this.state.lastSelectedColumn==="from"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}):null,this.state.lcVisible?L.jsxs(E.TableCell,{onClick:h=>!r&&this.onToggleSelect(h,n,"lc"),children:[i.lc?`${new Date(i.lc).toLocaleDateString()} ${new Date(i.lc).toLocaleTimeString()}.${(i.ts%1e3).toString().padStart(3,"0")}`:"",o&&this.state.lastSelectedColumn==="lc"?L.jsx(E.Box,{component:"div",sx:gt.rowFocused}):""]}):null]},n.toString()+(i.val||"").toString()))}}return e}shiftTime(){const e=new Date,t=6e4-e.getSeconds()-(1e3-e.getMilliseconds());e.getMilliseconds()&&e.setMilliseconds(1e3),e.getSeconds()&&e.setSeconds(60);const i=e.getTime();let n;const r=this.state.relativeRange;if(r==="day")e.setHours(0),e.setMinutes(0),e.setSeconds(0),n=e.getTime();else if(r==="week"){e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setMilliseconds(0);const o=e.getDay()||7;o!==1&&e.setHours(-24*(o-1)),n=e.getTime()}else if(r==="2weeks"){e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(e.getDate()-7);const o=e.getDay()||7;o!==1&&e.setHours(-24*(o-1)),n=e.getTime()}else r==="month"?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(1),n=e.getTime()):r==="year"?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setDate(1),e.setMonth(0),n=e.getTime()):r==="12months"?(e.setHours(0),e.setMinutes(0),e.setSeconds(0),e.setFullYear(e.getFullYear()-1),n=e.getTime()):n=i-parseInt(r,10)*6e4;this.setState({start:n,end:i},()=>this.readHistory()),this.timeTimer=setTimeout(()=>{this.timeTimer=void 0,this.shiftTime()},t||6e4)}setRelativeInterval(e,t){if(t||(this.localStorage.setItem("App.relativeRange",e.toString()),this.setState({relativeRange:e})),e==="absolute"){this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0);return}this.localStorage.removeItem("App.absoluteStart"),this.localStorage.removeItem("App.absolute");const i=new Date;if(!this.timeTimer){const o=6e4-i.getSeconds()-(1e3-i.getMilliseconds());this.timeTimer=setTimeout(()=>{this.timeTimer=void 0,this.shiftTime()},o||6e4)}i.getMilliseconds()&&i.setMilliseconds(1e3),i.getSeconds()&&i.setSeconds(60);const n=i.getTime();let r;if(e==="day")i.setHours(0),i.setMinutes(0),i.setSeconds(0),r=i.getTime();else if(e==="week"){i.setHours(0),i.setMinutes(0),i.setSeconds(0);const o=i.getDay()||7;o!==1&&i.setHours(-24*(o-1)),r=i.getTime()}else if(e==="2weeks"){i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(i.getDate()-7);const o=i.getDay()||7;o!==1&&i.setHours(-24*(o-1)),r=i.getTime()}else e==="month"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(1),r=i.getTime()):e==="year"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setDate(1),i.setMonth(0),r=i.getTime()):e==="12months"?(i.setHours(0),i.setMinutes(0),i.setSeconds(0),i.setFullYear(i.getFullYear()-1),r=i.getTime()):(e=Number(e),r=n-e*6e4);this.setState({start:r,end:n},()=>this.readHistory())}renderTable(){var e;if(!this.state.historyInstance)return L.jsx("div",{style:{marginTop:20,fontSize:24},children:this.props.t("History instance not selected")});if(!((e=this.state.historyInstances)!=null&&e.find(t=>t.id===this.state.historyInstance&&t.alive)))return L.jsx("div",{style:{marginTop:20,fontSize:24},children:this.props.t("History instance not alive")});if(this.state.values){const t=[200,"auto"],i=[190,100];return this.state.ackVisible&&(t.push(50),i.push(50)),this.state.fromVisible&&(t.push(150),i.push(150)),this.state.lcVisible&&(t.push(200),i.push(190)),L.jsx(E.TableContainer,{style:gt.container,children:L.jsxs(ee.TableResize,{stickyHeader:!0,sx:gt.table,initialWidths:t,minWidths:i,dblTitle:this.props.t("ra_Double click to reset table layout"),children:[L.jsx(E.TableHead,{children:L.jsxs(E.TableRow,{children:[L.jsx(E.TableCell,{style:gt.colTs,children:this.props.t("Timestamp")}),L.jsx(E.TableCell,{style:gt.colValue,children:this.props.t("Value")}),this.state.ackVisible?L.jsx(E.TableCell,{style:gt.colAck,children:this.props.t("Ack")}):null,this.state.fromVisible?L.jsx(E.TableCell,{style:gt.colFrom,children:this.props.t("From")}):null,this.state.lcVisible?L.jsx(E.TableCell,{style:gt.colLastChange,children:this.props.t("lc")}):null]})}),L.jsx(E.TableBody,{children:this.getTableRows()})]})})}return L.jsx(E.LinearProgress,{})}renderDialogConfirm(){return L.jsxs(E.Dialog,{open:!!this.state.areYouSure,onClose:()=>this.setState({areYouSure:!1}),"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[L.jsx(E.DialogTitle,{id:"alert-dialog-title"}),L.jsxs(E.DialogContent,{children:[L.jsx(E.DialogContentText,{id:"alert-dialog-description",children:this.props.t("Are you sure?")}),L.jsx(E.FormControlLabel,{control:L.jsx(E.Checkbox,{value:this.state.suppressMessage,onChange:()=>this.setState({suppressMessage:!0})}),label:this.props.t("Suppress for 5 minutes")})]}),L.jsxs(E.DialogActions,{children:[L.jsx(E.Button,{variant:"contained",onClick:()=>this.setState({areYouSure:!1,suppressMessage:this.state.suppressMessage&&Date.now()},()=>this.onDelete()),color:"primary",autoFocus:!0,startIcon:L.jsx(Ie.Delete,{}),children:this.props.t("Delete")}),L.jsx(E.Button,{variant:"contained",onClick:()=>this.setState({areYouSure:!1}),color:"secondary",startIcon:L.jsx(Ie.Close,{}),children:this.props.t("Cancel")})]})]})}onDelete(){const e=this.state.selected.map(t=>({state:{ts:t},id:this.props.obj._id}));this.props.socket.sendTo(this.state.historyInstance,"delete",e).then(()=>this.readHistory())}onUpdate(){let e=this.state.edit.val;this.props.obj.common&&(this.props.obj.common.type==="number"?typeof e!="number"&&(e=parseFloat(e.toString().replace(",","."))):this.props.obj.common.type==="boolean"&&(e=e==="true"||e==="TRUE"||e===!0||e==="1"||e===1));const t={val:e,ack:this.state.edit.ack,ts:this.state.selected[0],from:`system.adapter.eos-admin.${this.adminInstance}`,q:this.state.edit.q};for(const[i,n]of Object.entries(t))n===void 0&&delete t[i];!this.state.lcVisible&&t.lc&&delete t.lc,this.props.socket.sendTo(this.state.historyInstance,"update",[{id:this.props.obj._id,state:t}]).then(()=>this.readHistory())}onInsert(){let e=this.state.edit.val;this.props.obj.common&&(this.props.obj.common.type==="number"?e=parseFloat(e.toString().replace(",",".")):this.props.obj.common.type==="boolean"&&(e=e==="true"||e==="TRUE"||e===!0||e==="1"||e===1));const t=this.state.edit.date;t.setHours(this.state.edit.time.getHours()),t.setMinutes(this.state.edit.time.getMinutes()),t.setSeconds(this.state.edit.time.getSeconds()),t.setMilliseconds(parseInt(this.state.edit.ms,10));const i={ts:t.getTime(),val:e,ack:this.state.edit.ack,from:`system.adapter.eos-admin.${this.adminInstance}`,q:this.state.edit.q||0};!this.state.lcVisible&&i.lc&&delete i.lc;for(const[n,r]of Object.entries(i))r===void 0&&delete i[n];this.props.socket.sendTo(this.state.historyInstance,"insert",[{id:this.props.obj._id,state:i}]).then(()=>this.readHistory())}updateEdit(e,t){const i=JSON.parse(JSON.stringify(this.state.edit));i.time=new Date(i.time),i.date=new Date(i.date),i[e]=t,this.setState({edit:i})}renderEditDialog(){return L.jsxs(E.Dialog,{open:this.state.updateOpened||this.state.insertOpened,onClose:()=>this.setState({updateOpened:!1,insertOpened:!1}),"aria-labelledby":"edit-dialog-title","aria-describedby":"edit-dialog-description",children:[L.jsx(E.DialogTitle,{id:"edit-dialog-title",children:this.state.updateOpened?this.props.t("Update entry"):this.props.t("Insert entry")}),L.jsx(E.DialogContent,{children:L.jsxs("form",{noValidate:!0,autoComplete:"off",children:[typeof this.state.edit.val=="boolean"?L.jsx(E.FormControlLabel,{control:L.jsx(E.Checkbox,{checked:this.state.edit.val,onChange:e=>this.updateEdit("val",e.target.checked)}),label:this.props.t("Value")}):L.jsx(E.TextField,{variant:"standard",label:this.props.t("Value"),value:this.state.edit.val,onChange:e=>this.updateEdit("val",e.target.value)}),L.jsx("br",{}),L.jsx(E.FormControlLabel,{control:L.jsx(E.Checkbox,{checked:this.state.edit.ack,onChange:e=>this.updateEdit("ack",e.target.checked)}),label:this.props.t("Acknowledged")}),this.state.insertOpened?L.jsx(_s.LocalizationProvider,{dateAdapter:dS,adapterLocale:gS[this.props.lang],children:L.jsxs("div",{style:gt.toolbarTimeGrid,children:[L.jsx("div",{style:gt.toolbarTimeLabel,children:this.props.t("Time")}),L.jsx(_s.DatePicker,{sx:gt.toolbarDate,value:this.state.edit.date,onChange:e=>this.updateEdit("date",e)}),L.jsx(_s.TimePicker,{sx:gt.toolbarTime,ampm:this.state.ampm,views:["hours","minutes","seconds"],value:this.state.edit.time,onChange:e=>this.updateEdit("time",e)}),L.jsx(E.TextField,{variant:"standard",sx:gt.msInput,helperText:this.props.t("ms"),type:"number",slotProps:{htmlInput:{max:999,min:0}},value:this.state.edit.ms,onChange:e=>this.updateEdit("ms",e.target.value)})]})}):null]})}),L.jsxs(E.DialogActions,{children:[L.jsx(E.Button,{variant:"contained",disabled:this.state.edit.val==="",onClick:()=>{const e=this.state.updateOpened;this.setState({updateOpened:!1,insertOpened:!1},()=>e?this.onUpdate():this.onInsert())},color:"primary",autoFocus:!0,children:this.state.updateOpened?this.props.t("Update"):this.props.t("Add")}),L.jsx(E.Button,{variant:"contained",onClick:()=>this.setState({updateOpened:!1,insertOpened:!1}),color:"grey",children:this.props.t("Cancel")})]})]})}setStartDate(e){const t=e.getTime();this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0),this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",t.toString()),this.localStorage.setItem("App.absoluteEnd",this.state.end.toString()),this.setState({start:t,relativeRange:"absolute"},()=>this.readHistory())}setEndDate(e){const t=e.getTime();this.localStorage.setItem("App.relativeRange","absolute"),this.localStorage.setItem("App.absoluteStart",this.state.start.toString()),this.localStorage.setItem("App.absoluteEnd",t.toString()),this.timeTimer&&(clearTimeout(this.timeTimer),this.timeTimer=void 0),this.setState({end:t,relativeRange:"absolute"},()=>this.readHistory())}renderToolbar(){var e,t;return L.jsxs(E.Toolbar,{children:[L.jsxs(E.FormControl,{variant:"standard",style:gt.selectHistoryControl,children:[L.jsx(E.InputLabel,{children:this.props.t("History instance")}),L.jsx(E.Select,{variant:"standard",value:this.state.historyInstance||"",onChange:i=>{const n=i.target.value;this.localStorage.setItem("App.historyInstance",n),this.readSupportedFeatures(n).then(r=>this.setState({historyInstance:n,supportedFeatures:r},()=>this.readHistory()))},children:(e=this.state.historyInstances)==null?void 0:e.map(i=>L.jsx(E.MenuItem,{value:i.id,style:i.alive?void 0:gt.notAliveInstance,children:i.id},i.id))})]}),L.jsxs(E.FormControl,{variant:"standard",style:gt.selectRelativeTime,children:[L.jsx(E.InputLabel,{children:this.props.t("Relative")}),L.jsxs(E.Select,{variant:"standard",ref:this.rangeRef,value:this.state.relativeRange,onChange:i=>this.setRelativeInterval(i.target.value),children:[L.jsx(E.MenuItem,{value:"absolute",sx:gt.customRange,children:this.props.t("custom range")},"custom"),L.jsx(E.MenuItem,{value:10,children:this.props.t("last 10 minutes")},"1"),L.jsx(E.MenuItem,{value:30,children:this.props.t("last 30 minutes")},"2"),L.jsx(E.MenuItem,{value:60,children:this.props.t("last hour")},"3"),L.jsx(E.MenuItem,{value:"day",children:this.props.t("this day")},"4"),L.jsx(E.MenuItem,{value:1440,children:this.props.t("last 24 hours")},"5"),L.jsx(E.MenuItem,{value:"week",children:this.props.t("this week")},"6"),L.jsx(E.MenuItem,{value:1440*7,children:this.props.t("last week")},"7"),L.jsx(E.MenuItem,{value:"2weeks",children:this.props.t("this 2 weeks")},"8"),L.jsx(E.MenuItem,{value:1440*14,children:this.props.t("last 2 weeks")},"9"),L.jsx(E.MenuItem,{value:"month",children:this.props.t("this month")},"10"),L.jsx(E.MenuItem,{value:720*60,children:this.props.t("last 30 days")},"11"),L.jsx(E.MenuItem,{value:"year",children:this.props.t("this year")},"12"),L.jsx(E.MenuItem,{value:"12months",children:this.props.t("last 12 months")},"13")]})]}),L.jsxs(_s.LocalizationProvider,{dateAdapter:dS,adapterLocale:gS[this.props.lang],children:[L.jsxs("div",{style:gt.toolbarTimeGrid,children:[L.jsx("div",{style:{...gt.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("Start time")}),L.jsx(_s.DatePicker,{sx:gt.toolbarDate,disabled:this.state.relativeRange!=="absolute",value:new Date(this.state.start),onChange:i=>this.setStartDate(i)}),L.jsx(_s.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:gt.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.start),onChange:i=>this.setStartDate(i)})]}),L.jsxs("div",{style:gt.toolbarTimeGrid,children:[L.jsx("div",{style:{...gt.toolbarTimeLabel,opacity:this.state.relativeRange!=="absolute"?.5:void 0},children:this.props.t("End time")}),L.jsx(_s.DatePicker,{disabled:this.state.relativeRange!=="absolute",sx:gt.toolbarDate,value:new Date(this.state.end),onChange:i=>this.setEndDate(i)}),L.jsx(_s.TimePicker,{disabled:this.state.relativeRange!=="absolute",sx:gt.toolbarTime,ampm:this.state.ampm,value:new Date(this.state.end),onChange:i=>this.setEndDate(i)})]})]}),L.jsx(E.Box,{component:"div",sx:gt.grow}),(t=this.state.values)!=null&&t.length?L.jsx(E.IconButton,{size:"large",onClick:()=>this.exportData(),title:this.props.t("Save data as csv"),children:L.jsx(bie,{})}):null,this.state.supportedFeatures.includes("insert")&&this.props.expertMode?L.jsx(E.IconButton,{size:"large",onClick:()=>{const i=new Date,n={ack:this.state.values[this.state.values.length-1].ack,val:this.state.values[this.state.values.length-1].val,date:new Date(i),ms:0,time:new Date(i),q:0};this.setState({edit:n,insertOpened:!0})},children:L.jsx(wie,{})}):null,this.state.supportedFeatures.includes("update")&&this.props.expertMode?L.jsx(E.IconButton,{size:"large",disabled:this.state.selected.length!==1,onClick:()=>{const i=JSON.parse(JSON.stringify(this.state.values.find(r=>r.ts===this.state.lastSelected))),n=new Date(i.ts);i.date=new Date(n),i.time=new Date(n),this.setState({edit:i,updateOpened:!0})},children:L.jsx(Ie.Edit,{})}):null,this.state.supportedFeatures.includes("delete")&&this.props.expertMode?L.jsx(E.IconButton,{size:"large",disabled:!this.state.selected.length,onClick:()=>{typeof this.state.suppressMessage=="number"&&Date.now()-this.state.suppressMessage<3e5?this.onDelete():this.setState({areYouSure:!0})},children:L.jsx(Ie.Delete,{})}):null]})}exportData(){let e=window.document.getElementById("export-file");e||(e=document.createElement("a"),e.setAttribute("id","export-file"),e.style.display="none",document.body.appendChild(e));const t=["timestamp;value;acknowledged;from;"];this.state.values.forEach(i=>!i.i&&!i.e&&t.push([pS.formatTimestamp(i.ts),i.val===null||i.val===void 0?"null":i.val.toString(),i.ack?"true":"false",i.from||""].join(";"))),e.setAttribute("href",`data:text/plain;charset=utf-8,${encodeURIComponent(t.join(`
2
2
  `))}`),e.setAttribute("download",`${ee.Utils.getObjectName({[this.props.obj._id]:this.props.obj},this.props.obj._id,this.props.lang)}.csv`),e.click(),document.body.removeChild(e)}render(){return this.state.historyInstances?L.jsxs(E.Paper,{style:gt.paper,children:[this.state.loading?L.jsx(E.LinearProgress,{}):L.jsx("div",{style:gt.noLoadingProgress}),this.renderToolbar(),L.jsx(E.Box,{component:"div",sx:gt.tableDiv,children:this.renderTable()}),this.renderDialogConfirm(),this.renderEditDialog()]}):L.jsx(E.LinearProgress,{})}static formatTimestamp(e){return`${new Date(e).toLocaleDateString()} ${new Date(e).toLocaleTimeString()}.${(e%1e3).toString().padStart(3,"0")}`}}var g$={};var kE=function(s,e){return kE=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,i){t.__proto__=i}||function(t,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])},kE(s,e)};function ye(s,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");kE(s,e);function t(){this.constructor=s}s.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var DE=function(){return DE=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e},DE.apply(this,arguments)};function Lie(s,e){var t={};for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&e.indexOf(i)<0&&(t[i]=s[i]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(s);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(s,i[n])&&(t[i[n]]=s[i[n]]);return t}function kie(s,e,t,i){var n=arguments.length,r=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,t):i,o;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(s,e,t,i);else for(var a=s.length-1;a>=0;a--)(o=s[a])&&(r=(n<3?o(r):n>3?o(e,t,r):o(e,t))||r);return n>3&&r&&Object.defineProperty(e,t,r),r}function Die(s,e){return function(t,i){e(t,i,s)}}function Tie(s,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(s,e)}function Iie(s,e,t,i){function n(r){return r instanceof t?r:new t(function(o){o(r)})}return new(t||(t=Promise))(function(r,o){function a(c){try{h(i.next(c))}catch(u){o(u)}}function l(c){try{h(i.throw(c))}catch(u){o(u)}}function h(c){c.done?r(c.value):n(c.value).then(a,l)}h((i=i.apply(s,e||[])).next())})}function Eie(s,e){var t={label:0,sent:function(){if(r[0]&1)throw r[1];return r[1]},trys:[],ops:[]},i,n,r,o;return o={next:a(0),throw:a(1),return:a(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function a(h){return function(c){return l([h,c])}}function l(h){if(i)throw new TypeError("Generator is already executing.");for(;t;)try{if(i=1,n&&(r=h[0]&2?n.return:h[0]?n.throw||((r=n.return)&&r.call(n),0):n.next)&&!(r=r.call(n,h[1])).done)return r;switch(n=0,r&&(h=[h[0]&2,r.value]),h[0]){case 0:case 1:r=h;break;case 4:return t.label++,{value:h[1],done:!1};case 5:t.label++,n=h[1],h=[0];continue;case 7:h=t.ops.pop(),t.trys.pop();continue;default:if(r=t.trys,!(r=r.length>0&&r[r.length-1])&&(h[0]===6||h[0]===2)){t=0;continue}if(h[0]===3&&(!r||h[1]>r[0]&&h[1]<r[3])){t.label=h[1];break}if(h[0]===6&&t.label<r[1]){t.label=r[1],r=h;break}if(r&&t.label<r[2]){t.label=r[2],t.ops.push(h);break}r[2]&&t.ops.pop(),t.trys.pop();continue}h=e.call(s,t)}catch(c){h=[6,c],n=0}finally{i=r=0}if(h[0]&5)throw h[1];return{value:h[0]?h[1]:void 0,done:!0}}}var ZO=Object.create?(function(s,e,t,i){i===void 0&&(i=t),Object.defineProperty(s,i,{enumerable:!0,get:function(){return e[t]}})}):(function(s,e,t,i){i===void 0&&(i=t),s[i]=e[t]});function Nie(s,e){for(var t in s)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&ZO(e,s,t)}function TE(s){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&s[e],i=0;if(t)return t.call(s);if(s&&typeof s.length=="number")return{next:function(){return s&&i>=s.length&&(s=void 0),{value:s&&s[i++],done:!s}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function p$(s,e){var t=typeof Symbol=="function"&&s[Symbol.iterator];if(!t)return s;var i=t.call(s),n,r=[],o;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)r.push(n.value)}catch(a){o={error:a}}finally{try{n&&!n.done&&(t=i.return)&&t.call(i)}finally{if(o)throw o.error}}return r}function Mie(){for(var s=[],e=0;e<arguments.length;e++)s=s.concat(p$(arguments[e]));return s}function Aie(){for(var s=0,e=0,t=arguments.length;e<t;e++)s+=arguments[e].length;for(var i=Array(s),n=0,e=0;e<t;e++)for(var r=arguments[e],o=0,a=r.length;o<a;o++,n++)i[n]=r[o];return i}function Rie(s,e,t){if(t||arguments.length===2)for(var i=0,n=e.length,r;i<n;i++)(r||!(i in e))&&(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return s.concat(r||e)}function pb(s){return this instanceof pb?(this.v=s,this):new pb(s)}function Pie(s,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=t.apply(s,e||[]),n,r=[];return n={},o("next"),o("throw"),o("return"),n[Symbol.asyncIterator]=function(){return this},n;function o(d){i[d]&&(n[d]=function(f){return new Promise(function(g,p){r.push([d,f,g,p])>1||a(d,f)})})}function a(d,f){try{l(i[d](f))}catch(g){u(r[0][3],g)}}function l(d){d.value instanceof pb?Promise.resolve(d.value.v).then(h,c):u(r[0][2],d)}function h(d){a("next",d)}function c(d){a("throw",d)}function u(d,f){d(f),r.shift(),r.length&&a(r[0][0],r[0][1])}}function Oie(s){var e,t;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,r){e[n]=s[n]?function(o){return(t=!t)?{value:pb(s[n](o)),done:n==="return"}:r?r(o):o}:r}}function Fie(s){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=s[Symbol.asyncIterator],t;return e?e.call(s):(s=typeof TE=="function"?TE(s):s[Symbol.iterator](),t={},i("next"),i("throw"),i("return"),t[Symbol.asyncIterator]=function(){return this},t);function i(r){t[r]=s[r]&&function(o){return new Promise(function(a,l){o=s[r](o),n(a,l,o.done,o.value)})}}function n(r,o,a,l){Promise.resolve(l).then(function(h){r({value:h,done:a})},o)}}function Bie(s,e){return Object.defineProperty?Object.defineProperty(s,"raw",{value:e}):s.raw=e,s}var Vie=Object.create?(function(s,e){Object.defineProperty(s,"default",{enumerable:!0,value:e})}):function(s,e){s.default=e};function Wie(s){if(s&&s.__esModule)return s;var e={};if(s!=null)for(var t in s)t!=="default"&&Object.prototype.hasOwnProperty.call(s,t)&&ZO(e,s,t);return Vie(e,s),e}function Hie(s){return s&&s.__esModule?s:{default:s}}function zie(s,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?s!==e||!i:!e.has(s))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(s):i?i.value:e.get(s)}function jie(s,e,t,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?s!==e||!n:!e.has(s))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(s,t):n?n.value=t:e.set(s,t),t}const Uie=Object.freeze(Object.defineProperty({__proto__:null,get __assign(){return DE},__asyncDelegator:Oie,__asyncGenerator:Pie,__asyncValues:Fie,__await:pb,__awaiter:Iie,__classPrivateFieldGet:zie,__classPrivateFieldSet:jie,__createBinding:ZO,__decorate:kie,__exportStar:Nie,__extends:ye,__generator:Eie,__importDefault:Hie,__importStar:Wie,__makeTemplateObject:Bie,__metadata:Tie,__param:Die,__read:p$,__rest:Lie,__spread:Mie,__spreadArray:Rie,__spreadArrays:Aie,__values:TE},Symbol.toStringTag,{value:"Module"})),m$=Cie(Uie);var Vl={},Wl={},LT={},V7;function $ie(){return V7||(V7=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var e=1,t=function(){return"".concat(e++)};s.default=t})(LT)),LT}var Fv={},Bv={},kT={},W7;function v$(){return W7||(W7=1,(function(s){Object.defineProperty(s,"__esModule",{value:!0}),s.default=void 0;var e=function(i){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:60,r=null;return function(){for(var o=this,a=arguments.length,l=new Array(a),h=0;h<a;h++)l[h]=arguments[h];clearTimeout(r),r=setTimeout(function(){i.apply(o,l)},n)}};s.default=e})(kT)),kT}var Hl={},H7;function QO(){if(H7)return Hl;H7=1,Object.defineProperty(Hl,"__esModule",{value:!0}),Hl.SizeSensorId=Hl.SensorTabIndex=Hl.SensorClassName=void 0;var s="size-sensor-id";Hl.SizeSensorId=s;var e="size-sensor-object";Hl.SensorClassName=e;var t="-1";return Hl.SensorTabIndex=t,Hl}var z7;function Gie(){if(z7)return Bv;z7=1,Object.defineProperty(Bv,"__esModule",{value:!0}),Bv.createSensor=void 0;var s=t(v$()),e=QO();function t(n){return n&&n.__esModule?n:{default:n}}var i=function(r,o){var a=void 0,l=[],h=function(){getComputedStyle(r).position==="static"&&(r.style.position="relative");var p=document.createElement("object");return p.onload=function(){p.contentDocument.defaultView.addEventListener("resize",c),c()},p.style.display="block",p.style.position="absolute",p.style.top="0",p.style.left="0",p.style.height="100%",p.style.width="100%",p.style.overflow="hidden",p.style.pointerEvents="none",p.style.zIndex="-1",p.style.opacity="0",p.setAttribute("class",e.SensorClassName),p.setAttribute("tabindex",e.SensorTabIndex),p.type="text/html",r.appendChild(p),p.data="about:blank",p},c=(0,s.default)(function(){l.forEach(function(g){g(r)})}),u=function(p){a||(a=h()),l.indexOf(p)===-1&&l.push(p)},d=function(){a&&a.parentNode&&(a.contentDocument&&a.contentDocument.defaultView.removeEventListener("resize",c),a.parentNode.removeChild(a),r.removeAttribute(e.SizeSensorId),a=void 0,l=[],o&&o())},f=function(p){var m=l.indexOf(p);m!==-1&&l.splice(m,1),l.length===0&&a&&d()};return{element:r,bind:u,destroy:d,unbind:f}};return Bv.createSensor=i,Bv}var Vv={},j7;function qie(){if(j7)return Vv;j7=1,Object.defineProperty(Vv,"__esModule",{value:!0}),Vv.createSensor=void 0;var s=QO(),e=t(v$());function t(n){return n&&n.__esModule?n:{default:n}}var i=function(r,o){var a=void 0,l=[],h=(0,e.default)(function(){l.forEach(function(g){g(r)})}),c=function(){var p=new ResizeObserver(h);return p.observe(r),h(),p},u=function(p){a||(a=c()),l.indexOf(p)===-1&&l.push(p)},d=function(){a.disconnect(),l=[],a=void 0,r.removeAttribute(s.SizeSensorId),o&&o()},f=function(p){var m=l.indexOf(p);m!==-1&&l.splice(m,1),l.length===0&&a&&d()};return{element:r,bind:u,destroy:d,unbind:f}};return Vv.createSensor=i,Vv}var U7;function Kie(){if(U7)return Fv;U7=1,Object.defineProperty(Fv,"__esModule",{value:!0}),Fv.createSensor=void 0;var s=Gie(),e=qie(),t=typeof ResizeObserver<"u"?e.createSensor:s.createSensor;return Fv.createSensor=t,Fv}var $7;function Yie(){if($7)return Wl;$7=1,Object.defineProperty(Wl,"__esModule",{value:!0}),Wl.removeSensor=Wl.getSensor=Wl.Sensors=void 0;var s=i($ie()),e=Kie(),t=QO();function i(l){return l&&l.__esModule?l:{default:l}}var n={};Wl.Sensors=n;function r(l){l&&n[l]&&delete n[l]}var o=function(h){var c=h.getAttribute(t.SizeSensorId);if(c&&n[c])return n[c];var u=(0,s.default)();h.setAttribute(t.SizeSensorId,u);var d=(0,e.createSensor)(h,function(){return r(u)});return n[u]=d,d};Wl.getSensor=o;var a=function(h){var c=h.element.getAttribute(t.SizeSensorId);h.destroy(),r(c)};return Wl.removeSensor=a,Wl}var G7;function Xie(){if(G7)return Vl;G7=1,Object.defineProperty(Vl,"__esModule",{value:!0}),Vl.ver=Vl.clear=Vl.bind=void 0;var s=Yie(),e=function(r,o){var a=(0,s.getSensor)(r);return a.bind(o),function(){a.unbind(o)}};Vl.bind=e;var t=function(r){var o=(0,s.getSensor)(r);(0,s.removeSensor)(o)};Vl.clear=t;var i="1.0.2";return Vl.ver=i,Vl}var Wv={},q7;function Zie(){if(q7)return Wv;q7=1,Object.defineProperty(Wv,"__esModule",{value:!0}),Wv.pick=void 0;function s(e,t){var i={};return t.forEach(function(n){i[n]=e[n]}),i}return Wv.pick=s,Wv}var Hv={},K7;function Qie(){if(K7)return Hv;K7=1,Object.defineProperty(Hv,"__esModule",{value:!0}),Hv.isFunction=void 0;function s(e){return typeof e=="function"}return Hv.isFunction=s,Hv}var zv={},Y7;function Jie(){if(Y7)return zv;Y7=1,Object.defineProperty(zv,"__esModule",{value:!0}),zv.isString=void 0;function s(e){return typeof e=="string"}return zv.isString=s,zv}var jv={},X7;function ene(){if(X7)return jv;X7=1,Object.defineProperty(jv,"__esModule",{value:!0}),jv.isEqual=void 0;var s=m$,e=s.__importDefault(_ie);return jv.isEqual=e.default,jv}Object.defineProperty(g$,"__esModule",{value:!0});var Va=m$,Z7=Va.__importStar(Te),Q7=Xie(),J7=Zie(),DT=Qie(),tne=Jie(),Vg=ene(),ine=(function(s){Va.__extends(e,s);function e(t){var i=s.call(this,t)||this;return i.echarts=t.echarts,i.ele=null,i.isInitialResize=!0,i.eventHandlerRefs={},i}return e.prototype.componentDidMount=function(){this.renderNewEcharts()},e.prototype.componentDidUpdate=function(t){var i=this.props.shouldSetOption;if(!((0,DT.isFunction)(i)&&!i(t,this.props))){if(!(0,Vg.isEqual)(t.theme,this.props.theme)||!(0,Vg.isEqual)(t.opts,this.props.opts)){this.dispose(),this.renderNewEcharts();return}var n=this.getEchartsInstance();(0,Vg.isEqual)(t.onEvents,this.props.onEvents)||(this.unbindEvents(n),this.bindEvents(n,this.props.onEvents));var r=["option","notMerge","replaceMerge","lazyUpdate","showLoading","loadingOption"];(0,Vg.isEqual)((0,J7.pick)(this.props,r),(0,J7.pick)(t,r))||this.updateEChartsOption(),(!(0,Vg.isEqual)(t.style,this.props.style)||!(0,Vg.isEqual)(t.className,this.props.className))&&this.resize()}},e.prototype.componentWillUnmount=function(){this.dispose()},e.prototype.initEchartsInstance=function(){return Va.__awaiter(this,void 0,void 0,function(){var t=this;return Va.__generator(this,function(i){return[2,new Promise(function(n){t.echarts.init(t.ele,t.props.theme,t.props.opts);var r=t.getEchartsInstance();r.on("finished",function(){var o=t.ele.clientWidth,a=t.ele.clientHeight;t.echarts.dispose(t.ele);var l=Va.__assign({width:o,height:a},t.props.opts);n(t.echarts.init(t.ele,t.props.theme,l))})})]})})},e.prototype.getEchartsInstance=function(){return this.echarts.getInstanceByDom(this.ele)},e.prototype.dispose=function(){if(this.ele){try{(0,Q7.clear)(this.ele)}catch(t){console.warn(t)}this.echarts.dispose(this.ele)}},e.prototype.renderNewEcharts=function(){return Va.__awaiter(this,void 0,void 0,function(){var t,i,n,r,o,a,l=this;return Va.__generator(this,function(h){switch(h.label){case 0:return t=this.props,i=t.onEvents,n=t.onChartReady,r=t.autoResize,o=r===void 0?!0:r,[4,this.initEchartsInstance()];case 1:return h.sent(),a=this.updateEChartsOption(),this.bindEvents(a,i||{}),(0,DT.isFunction)(n)&&n(a),this.ele&&o&&(0,Q7.bind)(this.ele,function(){l.resize()}),[2]}})})},e.prototype.bindEvents=function(t,i){var n=this,r=function(a,l){if((0,tne.isString)(a)&&(0,DT.isFunction)(l)){var h=function(c){l(c,t)};t.on(a,h),n.eventHandlerRefs[a]=h}};for(var o in i)Object.prototype.hasOwnProperty.call(i,o)&&r(o,i[o])},e.prototype.unbindEvents=function(t){for(var i=0,n=Object.entries(this.eventHandlerRefs);i<n.length;i++){var r=n[i],o=r[0],a=r[1];t.off(o,a)}this.eventHandlerRefs={}},e.prototype.updateEChartsOption=function(){var t=this.props,i=t.option,n=t.notMerge,r=n===void 0?!1:n,o=t.replaceMerge,a=o===void 0?null:o,l=t.lazyUpdate,h=l===void 0?!1:l,c=t.showLoading,u=t.loadingOption,d=u===void 0?null:u,f=this.getEchartsInstance();return f.setOption(i,{notMerge:r,replaceMerge:a,lazyUpdate:h}),c?f.showLoading(d):f.hideLoading(),f},e.prototype.resize=function(){var t=this.getEchartsInstance();if(!this.isInitialResize)try{t.resize({width:"auto",height:"auto"})}catch(i){console.warn(i)}this.isInitialResize=!1},e.prototype.render=function(){var t=this,i=this.props,n=i.style,r=i.className,o=r===void 0?"":r;i.echarts,i.option,i.theme,i.notMerge,i.replaceMerge,i.lazyUpdate,i.showLoading,i.loadingOption,i.opts,i.onChartReady,i.onEvents,i.shouldSetOption,i.autoResize;var a=Va.__rest(i,["style","className","echarts","option","theme","notMerge","replaceMerge","lazyUpdate","showLoading","loadingOption","opts","onChartReady","onEvents","shouldSetOption","autoResize"]),l=Va.__assign({height:300},n);return Z7.default.createElement("div",Va.__assign({ref:function(h){t.ele=h},style:l,className:"echarts-for-react ".concat(o)},a))},e})(Z7.PureComponent),nne=g$.default=ine,sne=(function(){function s(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return s})(),rne=(function(){function s(){this.browser=new sne,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 s})(),at=new rne;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(at.wxa=!0,at.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?at.worker=!0:!at.hasGlobalWindow||"Deno"in window?(at.node=!0,at.svgSupported=!0):one(navigator.userAgent,at);function one(s,e){var t=e.browser,i=s.match(/Firefox\/([\d.]+)/),n=s.match(/MSIE\s([\d.]+)/)||s.match(/Trident\/.+?rv:(([\d.]+))/),r=s.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(s);i&&(t.firefox=!0,t.version=i[1]),n&&(t.ie=!0,t.version=n[1]),r&&(t.edge=!0,t.version=r[1],t.newEdge=+r[1].split(".")[0]>18),o&&(t.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!t.ie&&!t.edge,e.pointerEventsSupported="onpointerdown"in window&&(t.edge||t.ie&&+t.version>=11),e.domSupported=typeof document<"u";var a=document.documentElement.style;e.transform3dSupported=(t.ie&&"transition"in a||t.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in a)&&!("OTransition"in a),e.transformSupported=e.transform3dSupported||t.ie&&+t.version>=9}var JO=12,_$="sans-serif",ou=JO+"px "+_$,ane=20,lne=100,hne="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function cne(s){var e={};if(typeof JSON>"u")return e;for(var t=0;t<s.length;t++){var i=String.fromCharCode(t+32),n=(s.charCodeAt(t)-ane)/lne;e[i]=n}return e}var une=cne(hne),au={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var s,e;return function(t,i){if(!s){var n=au.createCanvas();s=n&&n.getContext("2d")}if(s)return e!==i&&(e=s.font=i||ou),s.measureText(t);t=t||"",i=i||ou;var r=/((?:\d+)?\.?\d*)px/.exec(i),o=r&&+r[1]||JO,a=0;if(i.indexOf("mono")>=0)a=o*t.length;else for(var l=0;l<t.length;l++){var h=une[t[l]];a+=h==null?o:h*o}return{width:a}}})(),loadImage:function(s,e,t){var i=new Image;return i.onload=e,i.onerror=t,i.src=s,i}};function b$(s){for(var e in au)s[e]&&(au[e]=s[e])}var w$=vl(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(s,e){return s["[object "+e+"]"]=!0,s},{}),y$=vl(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(s,e){return s["[object "+e+"Array]"]=!0,s},{}),mv=Object.prototype.toString,Ik=Array.prototype,dne=Ik.forEach,fne=Ik.filter,e5=Ik.slice,gne=Ik.map,e9=function(){}.constructor,Uw=e9?e9.prototype:null,t5="__proto__",pne=2311;function i5(){return pne++}function n5(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];typeof console<"u"&&console.error.apply(console,s)}function mt(s){if(s==null||typeof s!="object")return s;var e=s,t=mv.call(s);if(t==="[object Array]"){if(!lm(s)){e=[];for(var i=0,n=s.length;i<n;i++)e[i]=mt(s[i])}}else if(y$[t]){if(!lm(s)){var r=s.constructor;if(r.from)e=r.from(s);else{e=new r(s.length);for(var i=0,n=s.length;i<n;i++)e[i]=s[i]}}}else if(!w$[t]&&!lm(s)&&!Wf(s)){e={};for(var o in s)s.hasOwnProperty(o)&&o!==t5&&(e[o]=mt(s[o]))}return e}function Dt(s,e,t){if(!Ue(e)||!Ue(s))return t?mt(e):s;for(var i in e)if(e.hasOwnProperty(i)&&i!==t5){var n=s[i],r=e[i];Ue(r)&&Ue(n)&&!Me(r)&&!Me(n)&&!Wf(r)&&!Wf(n)&&!IE(r)&&!IE(n)&&!lm(r)&&!lm(n)?Dt(n,r,t):(t||!(i in s))&&(s[i]=mt(e[i]))}return s}function mne(s,e){for(var t=s[0],i=1,n=s.length;i<n;i++)t=Dt(t,s[i],e);return t}function we(s,e){if(Object.assign)Object.assign(s,e);else for(var t in e)e.hasOwnProperty(t)&&t!==t5&&(s[t]=e[t]);return s}function At(s,e,t){for(var i=Gt(e),n=0,r=i.length;n<r;n++){var o=i[n];(t?e[o]!=null:s[o]==null)&&(s[o]=e[o])}return s}var vne=au.createCanvas;function $t(s,e){if(s){if(s.indexOf)return s.indexOf(e);for(var t=0,i=s.length;t<i;t++)if(s[t]===e)return t}return-1}function s5(s,e){var t=s.prototype;function i(){}i.prototype=e.prototype,s.prototype=new i;for(var n in t)t.hasOwnProperty(n)&&(s.prototype[n]=t[n]);s.prototype.constructor=s,s.superClass=e}function oo(s,e,t){if(s="prototype"in s?s.prototype:s,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var i=Object.getOwnPropertyNames(e),n=0;n<i.length;n++){var r=i[n];r!=="constructor"&&(t?e[r]!=null:s[r]==null)&&(s[r]=e[r])}else At(s,e,t)}function Ks(s){return!s||typeof s=="string"?!1:typeof s.length=="number"}function V(s,e,t){if(s&&e)if(s.forEach&&s.forEach===dne)s.forEach(e,t);else if(s.length===+s.length)for(var i=0,n=s.length;i<n;i++)e.call(t,s[i],i,s);else for(var r in s)s.hasOwnProperty(r)&&e.call(t,s[r],r,s)}function Ne(s,e,t){if(!s)return[];if(!e)return Nk(s);if(s.map&&s.map===gne)return s.map(e,t);for(var i=[],n=0,r=s.length;n<r;n++)i.push(e.call(t,s[n],n,s));return i}function vl(s,e,t,i){if(s&&e){for(var n=0,r=s.length;n<r;n++)t=e.call(i,t,s[n],n,s);return t}}function Xi(s,e,t){if(!s)return[];if(!e)return Nk(s);if(s.filter&&s.filter===fne)return s.filter(e,t);for(var i=[],n=0,r=s.length;n<r;n++)e.call(t,s[n],n,s)&&i.push(s[n]);return i}function _ne(s,e,t){if(s&&e){for(var i=0,n=s.length;i<n;i++)if(e.call(t,s[i],i,s))return s[i]}}function Gt(s){if(!s)return[];if(Object.keys)return Object.keys(s);var e=[];for(var t in s)s.hasOwnProperty(t)&&e.push(t);return e}function bne(s,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return function(){return s.apply(e,t.concat(e5.call(arguments)))}}var Ot=Uw&&ut(Uw.bind)?Uw.call.bind(Uw.bind):bne;function Si(s){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return function(){return s.apply(this,e.concat(e5.call(arguments)))}}function Me(s){return Array.isArray?Array.isArray(s):mv.call(s)==="[object Array]"}function ut(s){return typeof s=="function"}function Be(s){return typeof s=="string"}function mS(s){return mv.call(s)==="[object String]"}function ki(s){return typeof s=="number"}function Ue(s){var e=typeof s;return e==="function"||!!s&&e==="object"}function IE(s){return!!w$[mv.call(s)]}function Ys(s){return!!y$[mv.call(s)]}function Wf(s){return typeof s=="object"&&typeof s.nodeType=="number"&&typeof s.ownerDocument=="object"}function Ek(s){return s.colorStops!=null}function wne(s){return s.image!=null}function yne(s){return mv.call(s)==="[object RegExp]"}function mb(s){return s!==s}function Vm(){for(var s=[],e=0;e<arguments.length;e++)s[e]=arguments[e];for(var t=0,i=s.length;t<i;t++)if(s[t]!=null)return s[t]}function ct(s,e){return s??e}function e1(s,e,t){return s??e??t}function Nk(s){for(var e=[],t=1;t<arguments.length;t++)e[t-1]=arguments[t];return e5.apply(s,e)}function r5(s){if(typeof s=="number")return[s,s,s,s];var e=s.length;return e===2?[s[0],s[1],s[0],s[1]]:e===3?[s[0],s[1],s[2],s[1]]:s}function ro(s,e){if(!s)throw new Error(e)}function la(s){return s==null?null:typeof s.trim=="function"?s.trim():s.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var C$="__ec_primitive__";function vS(s){s[C$]=!0}function lm(s){return s[C$]}var Cne=(function(){function s(){this.data={}}return s.prototype.delete=function(e){var t=this.has(e);return t&&delete this.data[e],t},s.prototype.has=function(e){return this.data.hasOwnProperty(e)},s.prototype.get=function(e){return this.data[e]},s.prototype.set=function(e,t){return this.data[e]=t,this},s.prototype.keys=function(){return Gt(this.data)},s.prototype.forEach=function(e){var t=this.data;for(var i in t)t.hasOwnProperty(i)&&e(t[i],i)},s})(),S$=typeof Map=="function";function Sne(){return S$?new Map:new Cne}var x$=(function(){function s(e){var t=Me(e);this.data=Sne();var i=this;e instanceof s?e.each(n):e&&V(e,n);function n(r,o){t?i.set(r,o):i.set(o,r)}}return s.prototype.hasKey=function(e){return this.data.has(e)},s.prototype.get=function(e){return this.data.get(e)},s.prototype.set=function(e,t){return this.data.set(e,t),t},s.prototype.each=function(e,t){this.data.forEach(function(i,n){e.call(t,i,n)})},s.prototype.keys=function(){var e=this.data.keys();return S$?Array.from(e):e},s.prototype.removeKey=function(e){this.data.delete(e)},s})();function _t(s){return new x$(s)}function L$(s,e){for(var t=new s.constructor(s.length+e.length),i=0;i<s.length;i++)t[i]=s[i];for(var n=s.length,i=0;i<e.length;i++)t[i+n]=e[i];return t}function G0(s,e){var t;if(Object.create)t=Object.create(s);else{var i=function(){};i.prototype=s,t=new i}return e&&we(t,e),t}function xne(s){var e=s.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function Hf(s,e){return s.hasOwnProperty(e)}function ts(){}var t1=180/Math.PI;const Lne=Object.freeze(Object.defineProperty({__proto__:null,HashMap:x$,RADIAN_TO_DEGREE:t1,assert:ro,bind:Ot,clone:mt,concatArray:L$,createCanvas:vne,createHashMap:_t,createObject:G0,curry:Si,defaults:At,disableUserSelect:xne,each:V,eqNaN:mb,extend:we,filter:Xi,find:_ne,guid:i5,hasOwn:Hf,indexOf:$t,inherits:s5,isArray:Me,isArrayLike:Ks,isBuiltInObject:IE,isDom:Wf,isFunction:ut,isGradientObject:Ek,isImagePatternObject:wne,isNumber:ki,isObject:Ue,isPrimitive:lm,isRegExp:yne,isString:Be,isStringSafe:mS,isTypedArray:Ys,keys:Gt,logError:n5,map:Ne,merge:Dt,mergeAll:mne,mixin:oo,noop:ts,normalizeCssArray:r5,reduce:vl,retrieve:Vm,retrieve2:ct,retrieve3:e1,setAsPrimitive:vS,slice:Nk,trim:la},Symbol.toStringTag,{value:"Module"}));function fg(s,e){return s==null&&(s=0),e==null&&(e=0),[s,e]}function kne(s,e){return s[0]=e[0],s[1]=e[1],s}function k$(s){return[s[0],s[1]]}function Dne(s,e,t){return s[0]=e,s[1]=t,s}function EE(s,e,t){return s[0]=e[0]+t[0],s[1]=e[1]+t[1],s}function Tne(s,e,t,i){return s[0]=e[0]+t[0]*i,s[1]=e[1]+t[1]*i,s}function D$(s,e,t){return s[0]=e[0]-t[0],s[1]=e[1]-t[1],s}function o5(s){return Math.sqrt(a5(s))}var Ine=o5;function a5(s){return s[0]*s[0]+s[1]*s[1]}var Ene=a5;function Nne(s,e,t){return s[0]=e[0]*t[0],s[1]=e[1]*t[1],s}function Mne(s,e,t){return s[0]=e[0]/t[0],s[1]=e[1]/t[1],s}function Ane(s,e){return s[0]*e[0]+s[1]*e[1]}function CC(s,e,t){return s[0]=e[0]*t,s[1]=e[1]*t,s}function T$(s,e){var t=o5(e);return t===0?(s[0]=0,s[1]=0):(s[0]=e[0]/t,s[1]=e[1]/t),s}function _S(s,e){return Math.sqrt((s[0]-e[0])*(s[0]-e[0])+(s[1]-e[1])*(s[1]-e[1]))}var I$=_S;function E$(s,e){return(s[0]-e[0])*(s[0]-e[0])+(s[1]-e[1])*(s[1]-e[1])}var cf=E$;function Rne(s,e){return s[0]=-e[0],s[1]=-e[1],s}function Pne(s,e,t,i){return s[0]=e[0]+i*(t[0]-e[0]),s[1]=e[1]+i*(t[1]-e[1]),s}function Us(s,e,t){var i=e[0],n=e[1];return s[0]=t[0]*i+t[2]*n+t[4],s[1]=t[1]*i+t[3]*n+t[5],s}function Mc(s,e,t){return s[0]=Math.min(e[0],t[0]),s[1]=Math.min(e[1],t[1]),s}function Ac(s,e,t){return s[0]=Math.max(e[0],t[0]),s[1]=Math.max(e[1],t[1]),s}const One=Object.freeze(Object.defineProperty({__proto__:null,add:EE,applyTransform:Us,clone:k$,copy:kne,create:fg,dist:I$,distSquare:cf,distance:_S,distanceSquare:E$,div:Mne,dot:Ane,len:o5,lenSquare:a5,length:Ine,lengthSquare:Ene,lerp:Pne,max:Ac,min:Mc,mul:Nne,negate:Rne,normalize:T$,scale:CC,scaleAndAdd:Tne,set:Dne,sub:D$},Symbol.toStringTag,{value:"Module"}));var Wg=(function(){function s(e,t){this.target=e,this.topTarget=t&&t.topTarget}return s})(),Fne=(function(){function s(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return s.prototype._dragStart=function(e){for(var t=e.target;t&&!t.draggable;)t=t.parent||t.__hostTarget;t&&(this._draggingTarget=t,t.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Wg(t,e),"dragstart",e.event))},s.prototype._drag=function(e){var t=this._draggingTarget;if(t){var i=e.offsetX,n=e.offsetY,r=i-this._x,o=n-this._y;this._x=i,this._y=n,t.drift(r,o,e),this.handler.dispatchToElement(new Wg(t,e),"drag",e.event);var a=this.handler.findHover(i,n,t).target,l=this._dropTarget;this._dropTarget=a,t!==a&&(l&&a!==l&&this.handler.dispatchToElement(new Wg(l,e),"dragleave",e.event),a&&a!==l&&this.handler.dispatchToElement(new Wg(a,e),"dragenter",e.event))}},s.prototype._dragEnd=function(e){var t=this._draggingTarget;t&&(t.dragging=!1),this.handler.dispatchToElement(new Wg(t,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Wg(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},s})(),Il=(function(){function s(e){e&&(this._$eventProcessor=e)}return s.prototype.on=function(e,t,i,n){this._$handlers||(this._$handlers={});var r=this._$handlers;if(typeof t=="function"&&(n=i,i=t,t=null),!i||!e)return this;var o=this._$eventProcessor;t!=null&&o&&o.normalizeQuery&&(t=o.normalizeQuery(t)),r[e]||(r[e]=[]);for(var a=0;a<r[e].length;a++)if(r[e][a].h===i)return this;var l={h:i,query:t,ctx:n||this,callAtLast:i.zrEventfulCallAtLast},h=r[e].length-1,c=r[e][h];return c&&c.callAtLast?r[e].splice(h,0,l):r[e].push(l),this},s.prototype.isSilent=function(e){var t=this._$handlers;return!t||!t[e]||!t[e].length},s.prototype.off=function(e,t){var i=this._$handlers;if(!i)return this;if(!e)return this._$handlers={},this;if(t){if(i[e]){for(var n=[],r=0,o=i[e].length;r<o;r++)i[e][r].h!==t&&n.push(i[e][r]);i[e]=n}i[e]&&i[e].length===0&&delete i[e]}else delete i[e];return this},s.prototype.trigger=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var o=t.length,a=n.length,l=0;l<a;l++){var h=n[l];if(!(r&&r.filter&&h.query!=null&&!r.filter(e,h.query)))switch(o){case 0:h.h.call(h.ctx);break;case 1:h.h.call(h.ctx,t[0]);break;case 2:h.h.call(h.ctx,t[0],t[1]);break;default:h.h.apply(h.ctx,t);break}}return r&&r.afterTrigger&&r.afterTrigger(e),this},s.prototype.triggerWithContext=function(e){for(var t=[],i=1;i<arguments.length;i++)t[i-1]=arguments[i];if(!this._$handlers)return this;var n=this._$handlers[e],r=this._$eventProcessor;if(n)for(var o=t.length,a=t[o-1],l=n.length,h=0;h<l;h++){var c=n[h];if(!(r&&r.filter&&c.query!=null&&!r.filter(e,c.query)))switch(o){case 0:c.h.call(a);break;case 1:c.h.call(a,t[0]);break;case 2:c.h.call(a,t[0],t[1]);break;default:c.h.apply(a,t.slice(1,o-1));break}}return r&&r.afterTrigger&&r.afterTrigger(e),this},s})(),Bne=Math.log(2);function NE(s,e,t,i,n,r){var o=i+"-"+n,a=s.length;if(r.hasOwnProperty(o))return r[o];if(e===1){var l=Math.round(Math.log((1<<a)-1&~n)/Bne);return s[t][l]}for(var h=i|1<<t,c=t+1;i&1<<c;)c++;for(var u=0,d=0,f=0;d<a;d++){var g=1<<d;g&n||(u+=(f%2?-1:1)*s[t][d]*NE(s,e-1,c,h,n|g,r),f++)}return r[o]=u,u}function t9(s,e){var t=[[s[0],s[1],1,0,0,0,-e[0]*s[0],-e[0]*s[1]],[0,0,0,s[0],s[1],1,-e[1]*s[0],-e[1]*s[1]],[s[2],s[3],1,0,0,0,-e[2]*s[2],-e[2]*s[3]],[0,0,0,s[2],s[3],1,-e[3]*s[2],-e[3]*s[3]],[s[4],s[5],1,0,0,0,-e[4]*s[4],-e[4]*s[5]],[0,0,0,s[4],s[5],1,-e[5]*s[4],-e[5]*s[5]],[s[6],s[7],1,0,0,0,-e[6]*s[6],-e[6]*s[7]],[0,0,0,s[6],s[7],1,-e[7]*s[6],-e[7]*s[7]]],i={},n=NE(t,8,0,0,0,i);if(n!==0){for(var r=[],o=0;o<8;o++)for(var a=0;a<8;a++)r[a]==null&&(r[a]=0),r[a]+=((o+a)%2?-1:1)*NE(t,7,o===0?1:0,1<<o,1<<a,i)/n*e[o];return function(l,h,c){var u=h*r[6]+c*r[7]+1;l[0]=(h*r[0]+c*r[1]+r[2])/u,l[1]=(h*r[3]+c*r[4]+r[5])/u}}}var i9="___zrEVENTSAVED",TT=[];function Vne(s,e,t,i,n){return ME(TT,e,i,n,!0)&&ME(s,t,TT[0],TT[1])}function ME(s,e,t,i,n){if(e.getBoundingClientRect&&at.domSupported&&!N$(e)){var r=e[i9]||(e[i9]={}),o=Wne(e,r),a=Hne(o,r,n);if(a)return a(s,t,i),!0}return!1}function Wne(s,e){var t=e.markers;if(t)return t;t=e.markers=[];for(var i=["left","right"],n=["top","bottom"],r=0;r<4;r++){var o=document.createElement("div"),a=o.style,l=r%2,h=(r>>1)%2;a.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",i[l]+":0",n[h]+":0",i[1-l]+":auto",n[1-h]+":auto",""].join("!important;"),s.appendChild(o),t.push(o)}return t}function Hne(s,e,t){for(var i=t?"invTrans":"trans",n=e[i],r=e.srcCoords,o=[],a=[],l=!0,h=0;h<4;h++){var c=s[h].getBoundingClientRect(),u=2*h,d=c.left,f=c.top;o.push(d,f),l=l&&r&&d===r[u]&&f===r[u+1],a.push(s[h].offsetLeft,s[h].offsetTop)}return l&&n?n:(e.srcCoords=o,e[i]=t?t9(a,o):t9(o,a))}function N$(s){return s.nodeName.toUpperCase()==="CANVAS"}var zne=/([&<>"'])/g,jne={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function Cs(s){return s==null?"":(s+"").replace(zne,function(e,t){return jne[t]})}var Une=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,IT=[],$ne=at.browser.firefox&&+at.browser.version.split(".")[0]<39;function AE(s,e,t,i){return t=t||{},i?n9(s,e,t):$ne&&e.layerX!=null&&e.layerX!==e.offsetX?(t.zrX=e.layerX,t.zrY=e.layerY):e.offsetX!=null?(t.zrX=e.offsetX,t.zrY=e.offsetY):n9(s,e,t),t}function n9(s,e,t){if(at.domSupported&&s.getBoundingClientRect){var i=e.clientX,n=e.clientY;if(N$(s)){var r=s.getBoundingClientRect();t.zrX=i-r.left,t.zrY=n-r.top;return}else if(ME(IT,s,i,n)){t.zrX=IT[0],t.zrY=IT[1];return}}t.zrX=t.zrY=0}function l5(s){return s||window.event}function _o(s,e,t){if(e=l5(e),e.zrX!=null)return e;var i=e.type,n=i&&i.indexOf("touch")>=0;if(n){var o=i!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&AE(s,o,e,t)}else{AE(s,e,e,t);var r=Gne(e);e.zrDelta=r?r/120:-(e.detail||0)/3}var a=e.button;return e.which==null&&a!==void 0&&Une.test(e.type)&&(e.which=a&1?1:a&2?3:a&4?2:0),e}function Gne(s){var e=s.wheelDelta;if(e)return e;var t=s.deltaX,i=s.deltaY;if(t==null||i==null)return e;var n=Math.abs(i!==0?i:t),r=i>0?-1:i<0?1:t>0?-1:1;return 3*n*r}function RE(s,e,t,i){s.addEventListener(e,t,i)}function qne(s,e,t,i){s.removeEventListener(e,t,i)}var M$=function(s){s.preventDefault(),s.stopPropagation(),s.cancelBubble=!0},Kne=(function(){function s(){this._track=[]}return s.prototype.recognize=function(e,t,i){return this._doTrack(e,t,i),this._recognize(e)},s.prototype.clear=function(){return this._track.length=0,this},s.prototype._doTrack=function(e,t,i){var n=e.touches;if(n){for(var r={points:[],touches:[],target:t,event:e},o=0,a=n.length;o<a;o++){var l=n[o],h=AE(i,l,{});r.points.push([h.zrX,h.zrY]),r.touches.push(l)}this._track.push(r)}},s.prototype._recognize=function(e){for(var t in ET)if(ET.hasOwnProperty(t)){var i=ET[t](this._track,e);if(i)return i}},s})();function s9(s){var e=s[1][0]-s[0][0],t=s[1][1]-s[0][1];return Math.sqrt(e*e+t*t)}function Yne(s){return[(s[0][0]+s[1][0])/2,(s[0][1]+s[1][1])/2]}var ET={pinch:function(s,e){var t=s.length;if(t){var i=(s[t-1]||{}).points,n=(s[t-2]||{}).points||i;if(n&&n.length>1&&i&&i.length>1){var r=s9(i)/s9(n);!isFinite(r)&&(r=1),e.pinchScale=r;var o=Yne(i);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:s[0].target,event:e}}}}};function Ph(){return[1,0,0,1,0,0]}function q0(s){return s[0]=1,s[1]=0,s[2]=0,s[3]=1,s[4]=0,s[5]=0,s}function h5(s,e){return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[4]=e[4],s[5]=e[5],s}function Kc(s,e,t){var i=e[0]*t[0]+e[2]*t[1],n=e[1]*t[0]+e[3]*t[1],r=e[0]*t[2]+e[2]*t[3],o=e[1]*t[2]+e[3]*t[3],a=e[0]*t[4]+e[2]*t[5]+e[4],l=e[1]*t[4]+e[3]*t[5]+e[5];return s[0]=i,s[1]=n,s[2]=r,s[3]=o,s[4]=a,s[5]=l,s}function Wm(s,e,t){return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s[4]=e[4]+t[0],s[5]=e[5]+t[1],s}function K0(s,e,t,i){i===void 0&&(i=[0,0]);var n=e[0],r=e[2],o=e[4],a=e[1],l=e[3],h=e[5],c=Math.sin(t),u=Math.cos(t);return s[0]=n*u+a*c,s[1]=-n*c+a*u,s[2]=r*u+l*c,s[3]=-r*c+u*l,s[4]=u*(o-i[0])+c*(h-i[1])+i[0],s[5]=u*(h-i[1])-c*(o-i[0])+i[1],s}function A$(s,e,t){var i=t[0],n=t[1];return s[0]=e[0]*i,s[1]=e[1]*n,s[2]=e[2]*i,s[3]=e[3]*n,s[4]=e[4]*i,s[5]=e[5]*n,s}function Y0(s,e){var t=e[0],i=e[2],n=e[4],r=e[1],o=e[3],a=e[5],l=t*o-r*i;return l?(l=1/l,s[0]=o*l,s[1]=-r*l,s[2]=-i*l,s[3]=t*l,s[4]=(i*a-o*n)*l,s[5]=(r*n-t*a)*l,s):null}function Xne(s){var e=Ph();return h5(e,s),e}const Zne=Object.freeze(Object.defineProperty({__proto__:null,clone:Xne,copy:h5,create:Ph,identity:q0,invert:Y0,mul:Kc,rotate:K0,scale:A$,translate:Wm},Symbol.toStringTag,{value:"Module"}));var fi=(function(){function s(e,t){this.x=e||0,this.y=t||0}return s.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},s.prototype.clone=function(){return new s(this.x,this.y)},s.prototype.set=function(e,t){return this.x=e,this.y=t,this},s.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},s.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},s.prototype.scale=function(e){this.x*=e,this.y*=e},s.prototype.scaleAndAdd=function(e,t){this.x+=e.x*t,this.y+=e.y*t},s.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},s.prototype.dot=function(e){return this.x*e.x+this.y*e.y},s.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},s.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},s.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},s.prototype.distance=function(e){var t=this.x-e.x,i=this.y-e.y;return Math.sqrt(t*t+i*i)},s.prototype.distanceSquare=function(e){var t=this.x-e.x,i=this.y-e.y;return t*t+i*i},s.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},s.prototype.transform=function(e){if(e){var t=this.x,i=this.y;return this.x=e[0]*t+e[2]*i+e[4],this.y=e[1]*t+e[3]*i+e[5],this}},s.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},s.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},s.set=function(e,t,i){e.x=t,e.y=i},s.copy=function(e,t){e.x=t.x,e.y=t.y},s.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},s.lenSquare=function(e){return e.x*e.x+e.y*e.y},s.dot=function(e,t){return e.x*t.x+e.y*t.y},s.add=function(e,t,i){e.x=t.x+i.x,e.y=t.y+i.y},s.sub=function(e,t,i){e.x=t.x-i.x,e.y=t.y-i.y},s.scale=function(e,t,i){e.x=t.x*i,e.y=t.y*i},s.scaleAndAdd=function(e,t,i,n){e.x=t.x+i.x*n,e.y=t.y+i.y*n},s.lerp=function(e,t,i,n){var r=1-n;e.x=r*t.x+n*i.x,e.y=r*t.y+n*i.y},s})(),$w=Math.min,Gw=Math.max,Nu=new fi,Mu=new fi,Au=new fi,Ru=new fi,Uv=new fi,$v=new fi,Jt=(function(){function s(e,t,i,n){i<0&&(e=e+i,i=-i),n<0&&(t=t+n,n=-n),this.x=e,this.y=t,this.width=i,this.height=n}return s.prototype.union=function(e){var t=$w(e.x,this.x),i=$w(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Gw(e.x+e.width,this.x+this.width)-t:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Gw(e.y+e.height,this.y+this.height)-i:this.height=e.height,this.x=t,this.y=i},s.prototype.applyTransform=function(e){s.applyTransform(this,this,e)},s.prototype.calculateTransform=function(e){var t=this,i=e.width/t.width,n=e.height/t.height,r=Ph();return Wm(r,r,[-t.x,-t.y]),A$(r,r,[i,n]),Wm(r,r,[e.x,e.y]),r},s.prototype.intersect=function(e,t){if(!e)return!1;e instanceof s||(e=s.create(e));var i=this,n=i.x,r=i.x+i.width,o=i.y,a=i.y+i.height,l=e.x,h=e.x+e.width,c=e.y,u=e.y+e.height,d=!(r<l||h<n||a<c||u<o);if(t){var f=1/0,g=0,p=Math.abs(r-l),m=Math.abs(h-n),v=Math.abs(a-c),_=Math.abs(u-o),b=Math.min(p,m),y=Math.min(v,_);r<l||h<n?b>g&&(g=b,p<m?fi.set($v,-p,0):fi.set($v,m,0)):b<f&&(f=b,p<m?fi.set(Uv,p,0):fi.set(Uv,-m,0)),a<c||u<o?y>g&&(g=y,v<_?fi.set($v,0,-v):fi.set($v,0,_)):b<f&&(f=b,v<_?fi.set(Uv,0,v):fi.set(Uv,0,-_))}return t&&fi.copy(t,d?Uv:$v),d},s.prototype.contain=function(e,t){var i=this;return e>=i.x&&e<=i.x+i.width&&t>=i.y&&t<=i.y+i.height},s.prototype.clone=function(){return new s(this.x,this.y,this.width,this.height)},s.prototype.copy=function(e){s.copy(this,e)},s.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},s.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},s.prototype.isZero=function(){return this.width===0||this.height===0},s.create=function(e){return new s(e.x,e.y,e.width,e.height)},s.copy=function(e,t){e.x=t.x,e.y=t.y,e.width=t.width,e.height=t.height},s.applyTransform=function(e,t,i){if(!i){e!==t&&s.copy(e,t);return}if(i[1]<1e-5&&i[1]>-1e-5&&i[2]<1e-5&&i[2]>-1e-5){var n=i[0],r=i[3],o=i[4],a=i[5];e.x=t.x*n+o,e.y=t.y*r+a,e.width=t.width*n,e.height=t.height*r,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Nu.x=Au.x=t.x,Nu.y=Ru.y=t.y,Mu.x=Ru.x=t.x+t.width,Mu.y=Au.y=t.y+t.height,Nu.transform(i),Ru.transform(i),Mu.transform(i),Au.transform(i),e.x=$w(Nu.x,Mu.x,Au.x,Ru.x),e.y=$w(Nu.y,Mu.y,Au.y,Ru.y);var l=Gw(Nu.x,Mu.x,Au.x,Ru.x),h=Gw(Nu.y,Mu.y,Au.y,Ru.y);e.width=l-e.x,e.height=h-e.y},s})(),R$="silent";function Qne(s,e,t){return{type:s,event:t,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:t.zrX,offsetY:t.zrY,gestureEvent:t.gestureEvent,pinchX:t.pinchX,pinchY:t.pinchY,pinchScale:t.pinchScale,wheelDelta:t.zrDelta,zrByTouch:t.zrByTouch,which:t.which,stop:Jne}}function Jne(){M$(this.event)}var ese=(function(s){ye(e,s);function e(){var t=s!==null&&s.apply(this,arguments)||this;return t.handler=null,t}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e})(Il),Gv=(function(){function s(e,t){this.x=e,this.y=t}return s})(),tse=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],NT=new Jt(0,0,0,0),P$=(function(s){ye(e,s);function e(t,i,n,r,o){var a=s.call(this)||this;return a._hovered=new Gv(0,0),a.storage=t,a.painter=i,a.painterRoot=r,a._pointerSize=o,n=n||new ese,a.proxy=null,a.setHandlerProxy(n),a._draggingMgr=new Fne(a),a}return e.prototype.setHandlerProxy=function(t){this.proxy&&this.proxy.dispose(),t&&(V(tse,function(i){t.on&&t.on(i,this[i],this)},this),t.handler=this),this.proxy=t},e.prototype.mousemove=function(t){var i=t.zrX,n=t.zrY,r=O$(this,i,n),o=this._hovered,a=o.target;a&&!a.__zr&&(o=this.findHover(o.x,o.y),a=o.target);var l=this._hovered=r?new Gv(i,n):this.findHover(i,n),h=l.target,c=this.proxy;c.setCursor&&c.setCursor(h?h.cursor:"default"),a&&h!==a&&this.dispatchToElement(o,"mouseout",t),this.dispatchToElement(l,"mousemove",t),h&&h!==a&&this.dispatchToElement(l,"mouseover",t)},e.prototype.mouseout=function(t){var i=t.zrEventControl;i!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",t),i!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:t})},e.prototype.resize=function(){this._hovered=new Gv(0,0)},e.prototype.dispatch=function(t,i){var n=this[t];n&&n.call(this,i)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(t){var i=this.proxy;i.setCursor&&i.setCursor(t)},e.prototype.dispatchToElement=function(t,i,n){t=t||{};var r=t.target;if(!(r&&r.silent)){for(var o="on"+i,a=Qne(i,t,n);r&&(r[o]&&(a.cancelBubble=!!r[o].call(r,a)),r.trigger(i,a),r=r.__hostTarget?r.__hostTarget:r.parent,!a.cancelBubble););a.cancelBubble||(this.trigger(i,a),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,a),l.trigger&&l.trigger(i,a)}))}},e.prototype.findHover=function(t,i,n){var r=this.storage.getDisplayList(),o=new Gv(t,i);if(r9(r,o,t,i,n),this._pointerSize&&!o.target){for(var a=[],l=this._pointerSize,h=l/2,c=new Jt(t-h,i-h,l,l),u=r.length-1;u>=0;u--){var d=r[u];d!==n&&!d.ignore&&!d.ignoreCoarsePointer&&(!d.parent||!d.parent.ignoreCoarsePointer)&&(NT.copy(d.getBoundingRect()),d.transform&&NT.applyTransform(d.transform),NT.intersect(c)&&a.push(d))}if(a.length)for(var f=4,g=Math.PI/12,p=Math.PI*2,m=0;m<h;m+=f)for(var v=0;v<p;v+=g){var _=t+m*Math.cos(v),b=i+m*Math.sin(v);if(r9(a,o,_,b,n),o.target)return o}}return o},e.prototype.processGesture=function(t,i){this._gestureMgr||(this._gestureMgr=new Kne);var n=this._gestureMgr;i==="start"&&n.clear();var r=n.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if(i==="end"&&n.clear(),r){var o=r.type;t.gestureEvent=o;var a=new Gv;a.target=r.target,this.dispatchToElement(a,o,r.event)}},e})(Il);V(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(s){P$.prototype[s]=function(e){var t=e.zrX,i=e.zrY,n=O$(this,t,i),r,o;if((s!=="mouseup"||!n)&&(r=this.findHover(t,i),o=r.target),s==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(s==="mouseup")this._upEl=o;else if(s==="click"){if(this._downEl!==this._upEl||!this._downPoint||I$(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(r,s,e)}});function ise(s,e,t){if(s[s.rectHover?"rectContain":"contain"](e,t)){for(var i=s,n=void 0,r=!1;i;){if(i.ignoreClip&&(r=!0),!r){var o=i.getClipPath();if(o&&!o.contain(e,t))return!1}i.silent&&(n=!0);var a=i.__hostTarget;i=a||i.parent}return n?R$:!0}return!1}function r9(s,e,t,i,n){for(var r=s.length-1;r>=0;r--){var o=s[r],a=void 0;if(o!==n&&!o.ignore&&(a=ise(o,t,i))&&(!e.topTarget&&(e.topTarget=o),a!==R$)){e.target=o;break}}}function O$(s,e,t){var i=s.painter;return e<0||e>i.getWidth()||t<0||t>i.getHeight()}var F$=32,qv=7;function nse(s){for(var e=0;s>=F$;)e|=s&1,s>>=1;return s+e}function o9(s,e,t,i){var n=e+1;if(n===t)return 1;if(i(s[n++],s[e])<0){for(;n<t&&i(s[n],s[n-1])<0;)n++;sse(s,e,n)}else for(;n<t&&i(s[n],s[n-1])>=0;)n++;return n-e}function sse(s,e,t){for(t--;e<t;){var i=s[e];s[e++]=s[t],s[t--]=i}}function a9(s,e,t,i,n){for(i===e&&i++;i<t;i++){for(var r=s[i],o=e,a=i,l;o<a;)l=o+a>>>1,n(r,s[l])<0?a=l:o=l+1;var h=i-o;switch(h){case 3:s[o+3]=s[o+2];case 2:s[o+2]=s[o+1];case 1:s[o+1]=s[o];break;default:for(;h>0;)s[o+h]=s[o+h-1],h--}s[o]=r}}function MT(s,e,t,i,n,r){var o=0,a=0,l=1;if(r(s,e[t+n])>0){for(a=i-n;l<a&&r(s,e[t+n+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=a);l>a&&(l=a),o+=n,l+=n}else{for(a=n+1;l<a&&r(s,e[t+n-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=a);l>a&&(l=a);var h=o;o=n-l,l=n-h}for(o++;o<l;){var c=o+(l-o>>>1);r(s,e[t+c])>0?o=c+1:l=c}return l}function AT(s,e,t,i,n,r){var o=0,a=0,l=1;if(r(s,e[t+n])<0){for(a=n+1;l<a&&r(s,e[t+n-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=a);l>a&&(l=a);var h=o;o=n-l,l=n-h}else{for(a=i-n;l<a&&r(s,e[t+n+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=a);l>a&&(l=a),o+=n,l+=n}for(o++;o<l;){var c=o+(l-o>>>1);r(s,e[t+c])<0?l=c:o=c+1}return l}function rse(s,e){var t=qv,i,n,r=0,o=[];i=[],n=[];function a(f,g){i[r]=f,n[r]=g,r+=1}function l(){for(;r>1;){var f=r-2;if(f>=1&&n[f-1]<=n[f]+n[f+1]||f>=2&&n[f-2]<=n[f]+n[f-1])n[f-1]<n[f+1]&&f--;else if(n[f]>n[f+1])break;c(f)}}function h(){for(;r>1;){var f=r-2;f>0&&n[f-1]<n[f+1]&&f--,c(f)}}function c(f){var g=i[f],p=n[f],m=i[f+1],v=n[f+1];n[f]=p+v,f===r-3&&(i[f+1]=i[f+2],n[f+1]=n[f+2]),r--;var _=AT(s[m],s,g,p,0,e);g+=_,p-=_,p!==0&&(v=MT(s[g+p-1],s,m,v,v-1,e),v!==0&&(p<=v?u(g,p,m,v):d(g,p,m,v)))}function u(f,g,p,m){var v=0;for(v=0;v<g;v++)o[v]=s[f+v];var _=0,b=p,y=f;if(s[y++]=s[b++],--m===0){for(v=0;v<g;v++)s[y+v]=o[_+v];return}if(g===1){for(v=0;v<m;v++)s[y+v]=s[b+v];s[y+m]=o[_];return}for(var C=t,x,S,k;;){x=0,S=0,k=!1;do if(e(s[b],o[_])<0){if(s[y++]=s[b++],S++,x=0,--m===0){k=!0;break}}else if(s[y++]=o[_++],x++,S=0,--g===1){k=!0;break}while((x|S)<C);if(k)break;do{if(x=AT(s[b],o,_,g,0,e),x!==0){for(v=0;v<x;v++)s[y+v]=o[_+v];if(y+=x,_+=x,g-=x,g<=1){k=!0;break}}if(s[y++]=s[b++],--m===0){k=!0;break}if(S=MT(o[_],s,b,m,0,e),S!==0){for(v=0;v<S;v++)s[y+v]=s[b+v];if(y+=S,b+=S,m-=S,m===0){k=!0;break}}if(s[y++]=o[_++],--g===1){k=!0;break}C--}while(x>=qv||S>=qv);if(k)break;C<0&&(C=0),C+=2}if(t=C,t<1&&(t=1),g===1){for(v=0;v<m;v++)s[y+v]=s[b+v];s[y+m]=o[_]}else{if(g===0)throw new Error;for(v=0;v<g;v++)s[y+v]=o[_+v]}}function d(f,g,p,m){var v=0;for(v=0;v<m;v++)o[v]=s[p+v];var _=f+g-1,b=m-1,y=p+m-1,C=0,x=0;if(s[y--]=s[_--],--g===0){for(C=y-(m-1),v=0;v<m;v++)s[C+v]=o[v];return}if(m===1){for(y-=g,_-=g,x=y+1,C=_+1,v=g-1;v>=0;v--)s[x+v]=s[C+v];s[y]=o[b];return}for(var S=t;;){var k=0,T=0,I=!1;do if(e(o[b],s[_])<0){if(s[y--]=s[_--],k++,T=0,--g===0){I=!0;break}}else if(s[y--]=o[b--],T++,k=0,--m===1){I=!0;break}while((k|T)<S);if(I)break;do{if(k=g-AT(o[b],s,f,g,g-1,e),k!==0){for(y-=k,_-=k,g-=k,x=y+1,C=_+1,v=k-1;v>=0;v--)s[x+v]=s[C+v];if(g===0){I=!0;break}}if(s[y--]=o[b--],--m===1){I=!0;break}if(T=m-MT(s[_],o,0,m,m-1,e),T!==0){for(y-=T,b-=T,m-=T,x=y+1,C=b+1,v=0;v<T;v++)s[x+v]=o[C+v];if(m<=1){I=!0;break}}if(s[y--]=s[_--],--g===0){I=!0;break}S--}while(k>=qv||T>=qv);if(I)break;S<0&&(S=0),S+=2}if(t=S,t<1&&(t=1),m===1){for(y-=g,_-=g,x=y+1,C=_+1,v=g-1;v>=0;v--)s[x+v]=s[C+v];s[y]=o[b]}else{if(m===0)throw new Error;for(C=y-(m-1),v=0;v<m;v++)s[C+v]=o[v]}}return{mergeRuns:l,forceMergeRuns:h,pushRun:a}}function SC(s,e,t,i){t||(t=0),i||(i=s.length);var n=i-t;if(!(n<2)){var r=0;if(n<F$){r=o9(s,t,i,e),a9(s,t,i,t+r,e);return}var o=rse(s,e),a=nse(n);do{if(r=o9(s,t,i,e),r<a){var l=n;l>a&&(l=a),a9(s,t,t+l,t+r,e),r=l}o.pushRun(t,r),o.mergeRuns(),n-=r,t+=r}while(n!==0);o.forceMergeRuns()}}var il=1,P_=2,bp=4,l9=!1;function RT(){l9||(l9=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function h9(s,e){return s.zlevel===e.zlevel?s.z===e.z?s.z2-e.z2:s.z-e.z:s.zlevel-e.zlevel}var ose=(function(){function s(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=h9}return s.prototype.traverse=function(e,t){for(var i=0;i<this._roots.length;i++)this._roots[i].traverse(e,t)},s.prototype.getDisplayList=function(e,t){t=t||!1;var i=this._displayList;return(e||!i.length)&&this.updateDisplayList(t),i},s.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var t=this._roots,i=this._displayList,n=0,r=t.length;n<r;n++)this._updateAndAddDisplayable(t[n],null,e);i.length=this._displayListLen,SC(i,h9)},s.prototype._updateAndAddDisplayable=function(e,t,i){if(!(e.ignore&&!i)){e.beforeUpdate(),e.update(),e.afterUpdate();var n=e.getClipPath();if(e.ignoreClip)t=null;else if(n){t?t=t.slice():t=[];for(var r=n,o=e;r;)r.parent=o,r.updateTransform(),t.push(r),o=r,r=r.getClipPath()}if(e.childrenRef){for(var a=e.childrenRef(),l=0;l<a.length;l++){var h=a[l];e.__dirty&&(h.__dirty|=il),this._updateAndAddDisplayable(h,t,i)}e.__dirty=0}else{var c=e;t&&t.length?c.__clipPaths=t:c.__clipPaths&&c.__clipPaths.length>0&&(c.__clipPaths=[]),isNaN(c.z)&&(RT(),c.z=0),isNaN(c.z2)&&(RT(),c.z2=0),isNaN(c.zlevel)&&(RT(),c.zlevel=0),this._displayList[this._displayListLen++]=c}var u=e.getDecalElement&&e.getDecalElement();u&&this._updateAndAddDisplayable(u,t,i);var d=e.getTextGuideLine();d&&this._updateAndAddDisplayable(d,t,i);var f=e.getTextContent();f&&this._updateAndAddDisplayable(f,t,i)}},s.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},s.prototype.delRoot=function(e){if(e instanceof Array){for(var t=0,i=e.length;t<i;t++)this.delRoot(e[t]);return}var n=$t(this._roots,e);n>=0&&this._roots.splice(n,1)},s.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},s.prototype.getRoots=function(){return this._roots},s.prototype.dispose=function(){this._displayList=null,this._roots=null},s})(),PE;PE=at.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(s){return setTimeout(s,16)};var i1={linear:function(s){return s},quadraticIn:function(s){return s*s},quadraticOut:function(s){return s*(2-s)},quadraticInOut:function(s){return(s*=2)<1?.5*s*s:-.5*(--s*(s-2)-1)},cubicIn:function(s){return s*s*s},cubicOut:function(s){return--s*s*s+1},cubicInOut:function(s){return(s*=2)<1?.5*s*s*s:.5*((s-=2)*s*s+2)},quarticIn:function(s){return s*s*s*s},quarticOut:function(s){return 1- --s*s*s*s},quarticInOut:function(s){return(s*=2)<1?.5*s*s*s*s:-.5*((s-=2)*s*s*s-2)},quinticIn:function(s){return s*s*s*s*s},quinticOut:function(s){return--s*s*s*s*s+1},quinticInOut:function(s){return(s*=2)<1?.5*s*s*s*s*s:.5*((s-=2)*s*s*s*s+2)},sinusoidalIn:function(s){return 1-Math.cos(s*Math.PI/2)},sinusoidalOut:function(s){return Math.sin(s*Math.PI/2)},sinusoidalInOut:function(s){return .5*(1-Math.cos(Math.PI*s))},exponentialIn:function(s){return s===0?0:Math.pow(1024,s-1)},exponentialOut:function(s){return s===1?1:1-Math.pow(2,-10*s)},exponentialInOut:function(s){return s===0?0:s===1?1:(s*=2)<1?.5*Math.pow(1024,s-1):.5*(-Math.pow(2,-10*(s-1))+2)},circularIn:function(s){return 1-Math.sqrt(1-s*s)},circularOut:function(s){return Math.sqrt(1- --s*s)},circularInOut:function(s){return(s*=2)<1?-.5*(Math.sqrt(1-s*s)-1):.5*(Math.sqrt(1-(s-=2)*s)+1)},elasticIn:function(s){var e,t=.1,i=.4;return s===0?0:s===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),-(t*Math.pow(2,10*(s-=1))*Math.sin((s-e)*(2*Math.PI)/i)))},elasticOut:function(s){var e,t=.1,i=.4;return s===0?0:s===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),t*Math.pow(2,-10*s)*Math.sin((s-e)*(2*Math.PI)/i)+1)},elasticInOut:function(s){var e,t=.1,i=.4;return s===0?0:s===1?1:(!t||t<1?(t=1,e=i/4):e=i*Math.asin(1/t)/(2*Math.PI),(s*=2)<1?-.5*(t*Math.pow(2,10*(s-=1))*Math.sin((s-e)*(2*Math.PI)/i)):t*Math.pow(2,-10*(s-=1))*Math.sin((s-e)*(2*Math.PI)/i)*.5+1)},backIn:function(s){var e=1.70158;return s*s*((e+1)*s-e)},backOut:function(s){var e=1.70158;return--s*s*((e+1)*s+e)+1},backInOut:function(s){var e=2.5949095;return(s*=2)<1?.5*(s*s*((e+1)*s-e)):.5*((s-=2)*s*((e+1)*s+e)+2)},bounceIn:function(s){return 1-i1.bounceOut(1-s)},bounceOut:function(s){return s<1/2.75?7.5625*s*s:s<2/2.75?7.5625*(s-=1.5/2.75)*s+.75:s<2.5/2.75?7.5625*(s-=2.25/2.75)*s+.9375:7.5625*(s-=2.625/2.75)*s+.984375},bounceInOut:function(s){return s<.5?i1.bounceIn(s*2)*.5:i1.bounceOut(s*2-1)*.5+.5}},qw=Math.pow,Yc=Math.sqrt,bS=1e-8,B$=1e-4,c9=Yc(3),Kw=1/3,nl=fg(),Co=fg(),hm=fg();function Rc(s){return s>-bS&&s<bS}function V$(s){return s>bS||s<-bS}function Yn(s,e,t,i,n){var r=1-n;return r*r*(r*s+3*n*e)+n*n*(n*i+3*r*t)}function u9(s,e,t,i,n){var r=1-n;return 3*(((e-s)*r+2*(t-e)*n)*r+(i-t)*n*n)}function wS(s,e,t,i,n,r){var o=i+3*(e-t)-s,a=3*(t-e*2+s),l=3*(e-s),h=s-n,c=a*a-3*o*l,u=a*l-9*o*h,d=l*l-3*a*h,f=0;if(Rc(c)&&Rc(u))if(Rc(a))r[0]=0;else{var g=-l/a;g>=0&&g<=1&&(r[f++]=g)}else{var p=u*u-4*c*d;if(Rc(p)){var m=u/c,g=-a/o+m,v=-m/2;g>=0&&g<=1&&(r[f++]=g),v>=0&&v<=1&&(r[f++]=v)}else if(p>0){var _=Yc(p),b=c*a+1.5*o*(-u+_),y=c*a+1.5*o*(-u-_);b<0?b=-qw(-b,Kw):b=qw(b,Kw),y<0?y=-qw(-y,Kw):y=qw(y,Kw);var g=(-a-(b+y))/(3*o);g>=0&&g<=1&&(r[f++]=g)}else{var C=(2*c*a-3*o*u)/(2*Yc(c*c*c)),x=Math.acos(C)/3,S=Yc(c),k=Math.cos(x),g=(-a-2*S*k)/(3*o),v=(-a+S*(k+c9*Math.sin(x)))/(3*o),T=(-a+S*(k-c9*Math.sin(x)))/(3*o);g>=0&&g<=1&&(r[f++]=g),v>=0&&v<=1&&(r[f++]=v),T>=0&&T<=1&&(r[f++]=T)}}return f}function W$(s,e,t,i,n){var r=6*t-12*e+6*s,o=9*e+3*i-3*s-9*t,a=3*e-3*s,l=0;if(Rc(o)){if(V$(r)){var h=-a/r;h>=0&&h<=1&&(n[l++]=h)}}else{var c=r*r-4*o*a;if(Rc(c))n[0]=-r/(2*o);else if(c>0){var u=Yc(c),h=(-r+u)/(2*o),d=(-r-u)/(2*o);h>=0&&h<=1&&(n[l++]=h),d>=0&&d<=1&&(n[l++]=d)}}return l}function yS(s,e,t,i,n,r){var o=(e-s)*n+s,a=(t-e)*n+e,l=(i-t)*n+t,h=(a-o)*n+o,c=(l-a)*n+a,u=(c-h)*n+h;r[0]=s,r[1]=o,r[2]=h,r[3]=u,r[4]=u,r[5]=c,r[6]=l,r[7]=i}function ase(s,e,t,i,n,r,o,a,l,h,c){var u,d=.005,f=1/0,g,p,m,v;nl[0]=l,nl[1]=h;for(var _=0;_<1;_+=.05)Co[0]=Yn(s,t,n,o,_),Co[1]=Yn(e,i,r,a,_),m=cf(nl,Co),m<f&&(u=_,f=m);f=1/0;for(var b=0;b<32&&!(d<B$);b++)g=u-d,p=u+d,Co[0]=Yn(s,t,n,o,g),Co[1]=Yn(e,i,r,a,g),m=cf(Co,nl),g>=0&&m<f?(u=g,f=m):(hm[0]=Yn(s,t,n,o,p),hm[1]=Yn(e,i,r,a,p),v=cf(hm,nl),p<=1&&v<f?(u=p,f=v):d*=.5);return Yc(f)}function lse(s,e,t,i,n,r,o,a,l){for(var h=s,c=e,u=0,d=1/l,f=1;f<=l;f++){var g=f*d,p=Yn(s,t,n,o,g),m=Yn(e,i,r,a,g),v=p-h,_=m-c;u+=Math.sqrt(v*v+_*_),h=p,c=m}return u}function _r(s,e,t,i){var n=1-i;return n*(n*s+2*i*e)+i*i*t}function d9(s,e,t,i){return 2*((1-i)*(e-s)+i*(t-e))}function hse(s,e,t,i,n){var r=s-2*e+t,o=2*(e-s),a=s-i,l=0;if(Rc(r)){if(V$(o)){var h=-a/o;h>=0&&h<=1&&(n[l++]=h)}}else{var c=o*o-4*r*a;if(Rc(c)){var h=-o/(2*r);h>=0&&h<=1&&(n[l++]=h)}else if(c>0){var u=Yc(c),h=(-o+u)/(2*r),d=(-o-u)/(2*r);h>=0&&h<=1&&(n[l++]=h),d>=0&&d<=1&&(n[l++]=d)}}return l}function H$(s,e,t){var i=s+t-2*e;return i===0?.5:(s-e)/i}function CS(s,e,t,i,n){var r=(e-s)*i+s,o=(t-e)*i+e,a=(o-r)*i+r;n[0]=s,n[1]=r,n[2]=a,n[3]=a,n[4]=o,n[5]=t}function cse(s,e,t,i,n,r,o,a,l){var h,c=.005,u=1/0;nl[0]=o,nl[1]=a;for(var d=0;d<1;d+=.05){Co[0]=_r(s,t,n,d),Co[1]=_r(e,i,r,d);var f=cf(nl,Co);f<u&&(h=d,u=f)}u=1/0;for(var g=0;g<32&&!(c<B$);g++){var p=h-c,m=h+c;Co[0]=_r(s,t,n,p),Co[1]=_r(e,i,r,p);var f=cf(Co,nl);if(p>=0&&f<u)h=p,u=f;else{hm[0]=_r(s,t,n,m),hm[1]=_r(e,i,r,m);var v=cf(hm,nl);m<=1&&v<u?(h=m,u=v):c*=.5}}return Yc(u)}function use(s,e,t,i,n,r,o){for(var a=s,l=e,h=0,c=1/o,u=1;u<=o;u++){var d=u*c,f=_r(s,t,n,d),g=_r(e,i,r,d),p=f-a,m=g-l;h+=Math.sqrt(p*p+m*m),a=f,l=g}return h}var dse=/cubic-bezier\(([0-9,\.e ]+)\)/;function c5(s){var e=s&&dse.exec(s);if(e){var t=e[1].split(","),i=+la(t[0]),n=+la(t[1]),r=+la(t[2]),o=+la(t[3]);if(isNaN(i+n+r+o))return;var a=[];return function(l){return l<=0?0:l>=1?1:wS(0,i,r,1,l,a)&&Yn(0,n,o,1,a[0])}}}var fse=(function(){function s(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||ts,this.ondestroy=e.ondestroy||ts,this.onrestart=e.onrestart||ts,e.easing&&this.setEasing(e.easing)}return s.prototype.step=function(e,t){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=t;return}var i=this._life,n=e-this._startTime-this._pausedTime,r=n/i;r<0&&(r=0),r=Math.min(r,1);var o=this.easingFunc,a=o?o(r):r;if(this.onframe(a),r===1)if(this.loop){var l=n%i;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},s.prototype.pause=function(){this._paused=!0},s.prototype.resume=function(){this._paused=!1},s.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ut(e)?e:i1[e]||c5(e)},s})(),z$=(function(){function s(e){this.value=e}return s})(),gse=(function(){function s(){this._len=0}return s.prototype.insert=function(e){var t=new z$(e);return this.insertEntry(t),t},s.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++},s.prototype.remove=function(e){var t=e.prev,i=e.next;t?t.next=i:this.head=i,i?i.prev=t:this.tail=t,e.next=e.prev=null,this._len--},s.prototype.len=function(){return this._len},s.prototype.clear=function(){this.head=this.tail=null,this._len=0},s})(),X0=(function(){function s(e){this._list=new gse,this._maxSize=10,this._map={},this._maxSize=e}return s.prototype.put=function(e,t){var i=this._list,n=this._map,r=null;if(n[e]==null){var o=i.len(),a=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=i.head;i.remove(l),delete n[l.key],r=l.value,this._lastRemovedEntry=l}a?a.value=t:a=new z$(t),a.key=e,i.insertEntry(a),n[e]=a}return r},s.prototype.get=function(e){var t=this._map[e],i=this._list;if(t!=null)return t!==i.tail&&(i.remove(t),i.insertEntry(t)),t.value},s.prototype.clear=function(){this._list.clear(),this._map={}},s.prototype.len=function(){return this._list.len()},s})(),f9={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 ca(s){return s=Math.round(s),s<0?0:s>255?255:s}function pse(s){return s=Math.round(s),s<0?0:s>360?360:s}function vb(s){return s<0?0:s>1?1:s}function PT(s){var e=s;return e.length&&e.charAt(e.length-1)==="%"?ca(parseFloat(e)/100*255):ca(parseInt(e,10))}function uf(s){var e=s;return e.length&&e.charAt(e.length-1)==="%"?vb(parseFloat(e)/100):vb(parseFloat(e))}function OT(s,e,t){return t<0?t+=1:t>1&&(t-=1),t*6<1?s+(e-s)*t*6:t*2<1?e:t*3<2?s+(e-s)*(2/3-t)*6:s}function Pc(s,e,t){return s+(e-s)*t}function go(s,e,t,i,n){return s[0]=e,s[1]=t,s[2]=i,s[3]=n,s}function OE(s,e){return s[0]=e[0],s[1]=e[1],s[2]=e[2],s[3]=e[3],s}var j$=new X0(20),Yw=null;function Hg(s,e){Yw&&OE(Yw,e),Yw=j$.put(s,Yw||e.slice())}function Jr(s,e){if(s){e=e||[];var t=j$.get(s);if(t)return OE(e,t);s=s+"";var i=s.replace(/ /g,"").toLowerCase();if(i in f9)return OE(e,f9[i]),Hg(s,e),e;var n=i.length;if(i.charAt(0)==="#"){if(n===4||n===5){var r=parseInt(i.slice(1,4),16);if(!(r>=0&&r<=4095)){go(e,0,0,0,1);return}return go(e,(r&3840)>>4|(r&3840)>>8,r&240|(r&240)>>4,r&15|(r&15)<<4,n===5?parseInt(i.slice(4),16)/15:1),Hg(s,e),e}else if(n===7||n===9){var r=parseInt(i.slice(1,7),16);if(!(r>=0&&r<=16777215)){go(e,0,0,0,1);return}return go(e,(r&16711680)>>16,(r&65280)>>8,r&255,n===9?parseInt(i.slice(7),16)/255:1),Hg(s,e),e}return}var o=i.indexOf("("),a=i.indexOf(")");if(o!==-1&&a+1===n){var l=i.substr(0,o),h=i.substr(o+1,a-(o+1)).split(","),c=1;switch(l){case"rgba":if(h.length!==4)return h.length===3?go(e,+h[0],+h[1],+h[2],1):go(e,0,0,0,1);c=uf(h.pop());case"rgb":if(h.length>=3)return go(e,PT(h[0]),PT(h[1]),PT(h[2]),h.length===3?c:uf(h[3])),Hg(s,e),e;go(e,0,0,0,1);return;case"hsla":if(h.length!==4){go(e,0,0,0,1);return}return h[3]=uf(h[3]),FE(h,e),Hg(s,e),e;case"hsl":if(h.length!==3){go(e,0,0,0,1);return}return FE(h,e),Hg(s,e),e;default:return}}go(e,0,0,0,1)}}function FE(s,e){var t=(parseFloat(s[0])%360+360)%360/360,i=uf(s[1]),n=uf(s[2]),r=n<=.5?n*(i+1):n+i-n*i,o=n*2-r;return e=e||[],go(e,ca(OT(o,r,t+1/3)*255),ca(OT(o,r,t)*255),ca(OT(o,r,t-1/3)*255),1),s.length===4&&(e[3]=s[3]),e}function mse(s){if(s){var e=s[0]/255,t=s[1]/255,i=s[2]/255,n=Math.min(e,t,i),r=Math.max(e,t,i),o=r-n,a=(r+n)/2,l,h;if(o===0)l=0,h=0;else{a<.5?h=o/(r+n):h=o/(2-r-n);var c=((r-e)/6+o/2)/o,u=((r-t)/6+o/2)/o,d=((r-i)/6+o/2)/o;e===r?l=d-u:t===r?l=1/3+c-d:i===r&&(l=2/3+u-c),l<0&&(l+=1),l>1&&(l-=1)}var f=[l*360,h,a];return s[3]!=null&&f.push(s[3]),f}}function BE(s,e){var t=Jr(s);if(t){for(var i=0;i<3;i++)e<0?t[i]=t[i]*(1-e)|0:t[i]=(255-t[i])*e+t[i]|0,t[i]>255?t[i]=255:t[i]<0&&(t[i]=0);return gg(t,t.length===4?"rgba":"rgb")}}function vse(s){var e=Jr(s);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function U$(s,e,t){if(!(!(e&&e.length)||!(s>=0&&s<=1))){t=t||[];var i=s*(e.length-1),n=Math.floor(i),r=Math.ceil(i),o=e[n],a=e[r],l=i-n;return t[0]=ca(Pc(o[0],a[0],l)),t[1]=ca(Pc(o[1],a[1],l)),t[2]=ca(Pc(o[2],a[2],l)),t[3]=vb(Pc(o[3],a[3],l)),t}}var _se=U$;function u5(s,e,t){if(!(!(e&&e.length)||!(s>=0&&s<=1))){var i=s*(e.length-1),n=Math.floor(i),r=Math.ceil(i),o=Jr(e[n]),a=Jr(e[r]),l=i-n,h=gg([ca(Pc(o[0],a[0],l)),ca(Pc(o[1],a[1],l)),ca(Pc(o[2],a[2],l)),vb(Pc(o[3],a[3],l))],"rgba");return t?{color:h,leftIndex:n,rightIndex:r,value:i}:h}}var bse=u5;function wse(s,e,t,i){var n=Jr(s);if(s)return n=mse(n),e!=null&&(n[0]=pse(e)),t!=null&&(n[1]=uf(t)),i!=null&&(n[2]=uf(i)),gg(FE(n),"rgba")}function yse(s,e){var t=Jr(s);if(t&&e!=null)return t[3]=vb(e),gg(t,"rgba")}function gg(s,e){if(!(!s||!s.length)){var t=s[0]+","+s[1]+","+s[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(t+=","+s[3]),e+"("+t+")"}}function _b(s,e){var t=Jr(s);return t?(.299*t[0]+.587*t[1]+.114*t[2])*t[3]/255+(1-t[3])*e:0}function Cse(){return gg([Math.round(Math.random()*255),Math.round(Math.random()*255),Math.round(Math.random()*255)],"rgb")}var g9=new X0(100);function SS(s){if(Be(s)){var e=g9.get(s);return e||(e=BE(s,-.1),g9.put(s,e)),e}else if(Ek(s)){var t=we({},s);return t.colorStops=Ne(s.colorStops,function(i){return{offset:i.offset,color:BE(i.color,-.1)}}),t}return s}const Sse=Object.freeze(Object.defineProperty({__proto__:null,fastLerp:U$,fastMapToColor:_se,lerp:u5,lift:BE,liftColor:SS,lum:_b,mapToColor:bse,modifyAlpha:yse,modifyHSL:wse,parse:Jr,random:Cse,stringify:gg,toHex:vse},Symbol.toStringTag,{value:"Module"}));var xS=Math.round;function bb(s){var e;if(!s||s==="transparent")s="none";else if(typeof s=="string"&&s.indexOf("rgba")>-1){var t=Jr(s);t&&(s="rgb("+t[0]+","+t[1]+","+t[2]+")",e=t[3])}return{color:s,opacity:e??1}}var p9=1e-4;function Oc(s){return s<p9&&s>-p9}function Xw(s){return xS(s*1e3)/1e3}function VE(s){return xS(s*1e4)/1e4}function xse(s){return"matrix("+Xw(s[0])+","+Xw(s[1])+","+Xw(s[2])+","+Xw(s[3])+","+VE(s[4])+","+VE(s[5])+")"}var Lse={left:"start",right:"end",center:"middle",middle:"middle"};function kse(s,e,t){return t==="top"?s+=e/2:t==="bottom"&&(s-=e/2),s}function Dse(s){return s&&(s.shadowBlur||s.shadowOffsetX||s.shadowOffsetY)}function Tse(s){var e=s.style,t=s.getGlobalScale();return[e.shadowColor,(e.shadowBlur||0).toFixed(2),(e.shadowOffsetX||0).toFixed(2),(e.shadowOffsetY||0).toFixed(2),t[0],t[1]].join(",")}function $$(s){return s&&!!s.image}function Ise(s){return s&&!!s.svgElement}function d5(s){return $$(s)||Ise(s)}function G$(s){return s.type==="linear"}function q$(s){return s.type==="radial"}function K$(s){return s&&(s.type==="linear"||s.type==="radial")}function Mk(s){return"url(#"+s+")"}function Y$(s){var e=s.getGlobalScale(),t=Math.max(e[0],e[1]);return Math.max(Math.ceil(Math.log(t)/Math.log(10)),1)}function X$(s){var e=s.x||0,t=s.y||0,i=(s.rotation||0)*t1,n=ct(s.scaleX,1),r=ct(s.scaleY,1),o=s.skewX||0,a=s.skewY||0,l=[];return(e||t)&&l.push("translate("+e+"px,"+t+"px)"),i&&l.push("rotate("+i+")"),(n!==1||r!==1)&&l.push("scale("+n+","+r+")"),(o||a)&&l.push("skew("+xS(o*t1)+"deg, "+xS(a*t1)+"deg)"),l.join(" ")}var Ese=(function(){return at.hasGlobalWindow&&ut(window.btoa)?function(s){return window.btoa(unescape(encodeURIComponent(s)))}:typeof Buffer<"u"?function(s){return Buffer.from(s).toString("base64")}:function(s){return null}})(),WE=Array.prototype.slice;function th(s,e,t){return(e-s)*t+s}function FT(s,e,t,i){for(var n=e.length,r=0;r<n;r++)s[r]=th(e[r],t[r],i);return s}function Nse(s,e,t,i){for(var n=e.length,r=n&&e[0].length,o=0;o<n;o++){s[o]||(s[o]=[]);for(var a=0;a<r;a++)s[o][a]=th(e[o][a],t[o][a],i)}return s}function Zw(s,e,t,i){for(var n=e.length,r=0;r<n;r++)s[r]=e[r]+t[r]*i;return s}function m9(s,e,t,i){for(var n=e.length,r=n&&e[0].length,o=0;o<n;o++){s[o]||(s[o]=[]);for(var a=0;a<r;a++)s[o][a]=e[o][a]+t[o][a]*i}return s}function Mse(s,e){for(var t=s.length,i=e.length,n=t>i?e:s,r=Math.min(t,i),o=n[r-1]||{color:[0,0,0,0],offset:0},a=r;a<Math.max(t,i);a++)n.push({offset:o.offset,color:o.color.slice()})}function Ase(s,e,t){var i=s,n=e;if(!(!i.push||!n.push)){var r=i.length,o=n.length;if(r!==o){var a=r>o;if(a)i.length=o;else for(var l=r;l<o;l++)i.push(t===1?n[l]:WE.call(n[l]))}for(var h=i[0]&&i[0].length,l=0;l<i.length;l++)if(t===1)isNaN(i[l])&&(i[l]=n[l]);else for(var c=0;c<h;c++)isNaN(i[l][c])&&(i[l][c]=n[l][c])}}function xC(s){if(Ks(s)){var e=s.length;if(Ks(s[0])){for(var t=[],i=0;i<e;i++)t.push(WE.call(s[i]));return t}return WE.call(s)}return s}function LC(s){return s[0]=Math.floor(s[0])||0,s[1]=Math.floor(s[1])||0,s[2]=Math.floor(s[2])||0,s[3]=s[3]==null?1:s[3],"rgba("+s.join(",")+")"}function Rse(s){return Ks(s&&s[0])?2:1}var Qw=0,kC=1,Z$=2,O_=3,HE=4,zE=5,v9=6;function _9(s){return s===HE||s===zE}function Jw(s){return s===kC||s===Z$}var Kv=[0,0,0,0],Pse=(function(){function s(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return s.prototype.isFinished=function(){return this._finished},s.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},s.prototype.needsAnimate=function(){return this.keyframes.length>=1},s.prototype.getAdditiveTrack=function(){return this._additiveTrack},s.prototype.addKeyframe=function(e,t,i){this._needsSort=!0;var n=this.keyframes,r=n.length,o=!1,a=v9,l=t;if(Ks(t)){var h=Rse(t);a=h,(h===1&&!ki(t[0])||h===2&&!ki(t[0][0]))&&(o=!0)}else if(ki(t)&&!mb(t))a=Qw;else if(Be(t))if(!isNaN(+t))a=Qw;else{var c=Jr(t);c&&(l=c,a=O_)}else if(Ek(t)){var u=we({},l);u.colorStops=Ne(t.colorStops,function(f){return{offset:f.offset,color:Jr(f.color)}}),G$(t)?a=HE:q$(t)&&(a=zE),l=u}r===0?this.valType=a:(a!==this.valType||a===v9)&&(o=!0),this.discrete=this.discrete||o;var d={time:e,value:l,rawValue:t,percent:0};return i&&(d.easing=i,d.easingFunc=ut(i)?i:i1[i]||c5(i)),n.push(d),d},s.prototype.prepare=function(e,t){var i=this.keyframes;this._needsSort&&i.sort(function(p,m){return p.time-m.time});for(var n=this.valType,r=i.length,o=i[r-1],a=this.discrete,l=Jw(n),h=_9(n),c=0;c<r;c++){var u=i[c],d=u.value,f=o.value;u.percent=u.time/e,a||(l&&c!==r-1?Ase(d,f,n):h&&Mse(d.colorStops,f.colorStops))}if(!a&&n!==zE&&t&&this.needsAnimate()&&t.needsAnimate()&&n===t.valType&&!t._finished){this._additiveTrack=t;for(var g=i[0].value,c=0;c<r;c++)n===Qw?i[c].additiveValue=i[c].value-g:n===O_?i[c].additiveValue=Zw([],i[c].value,g,-1):Jw(n)&&(i[c].additiveValue=n===kC?Zw([],i[c].value,g,-1):m9([],i[c].value,g,-1))}},s.prototype.step=function(e,t){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var i=this._additiveTrack!=null,n=i?"additiveValue":"value",r=this.valType,o=this.keyframes,a=o.length,l=this.propName,h=r===O_,c,u=this._lastFr,d=Math.min,f,g;if(a===1)f=g=o[0];else{if(t<0)c=0;else if(t<this._lastFrP){var p=d(u+1,a-1);for(c=p;c>=0&&!(o[c].percent<=t);c--);c=d(c,a-2)}else{for(c=u;c<a&&!(o[c].percent>t);c++);c=d(c-1,a-2)}g=o[c+1],f=o[c]}if(f&&g){this._lastFr=c,this._lastFrP=t;var m=g.percent-f.percent,v=m===0?1:d((t-f.percent)/m,1);g.easingFunc&&(v=g.easingFunc(v));var _=i?this._additiveValue:h?Kv:e[l];if((Jw(r)||h)&&!_&&(_=this._additiveValue=[]),this.discrete)e[l]=v<1?f.rawValue:g.rawValue;else if(Jw(r))r===kC?FT(_,f[n],g[n],v):Nse(_,f[n],g[n],v);else if(_9(r)){var b=f[n],y=g[n],C=r===HE;e[l]={type:C?"linear":"radial",x:th(b.x,y.x,v),y:th(b.y,y.y,v),colorStops:Ne(b.colorStops,function(S,k){var T=y.colorStops[k];return{offset:th(S.offset,T.offset,v),color:LC(FT([],S.color,T.color,v))}}),global:y.global},C?(e[l].x2=th(b.x2,y.x2,v),e[l].y2=th(b.y2,y.y2,v)):e[l].r=th(b.r,y.r,v)}else if(h)FT(_,f[n],g[n],v),i||(e[l]=LC(_));else{var x=th(f[n],g[n],v);i?this._additiveValue=x:e[l]=x}i&&this._addToTarget(e)}}},s.prototype._addToTarget=function(e){var t=this.valType,i=this.propName,n=this._additiveValue;t===Qw?e[i]=e[i]+n:t===O_?(Jr(e[i],Kv),Zw(Kv,Kv,n,1),e[i]=LC(Kv)):t===kC?Zw(e[i],e[i],n,1):t===Z$&&m9(e[i],e[i],n,1)},s})(),f5=(function(){function s(e,t,i,n){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=t,t&&n){n5("Can' use additive animation on looped animation.");return}this._additiveAnimators=n,this._allowDiscrete=i}return s.prototype.getMaxTime=function(){return this._maxTime},s.prototype.getDelay=function(){return this._delay},s.prototype.getLoop=function(){return this._loop},s.prototype.getTarget=function(){return this._target},s.prototype.changeTarget=function(e){this._target=e},s.prototype.when=function(e,t,i){return this.whenWithKeys(e,t,Gt(t),i)},s.prototype.whenWithKeys=function(e,t,i,n){for(var r=this._tracks,o=0;o<i.length;o++){var a=i[o],l=r[a];if(!l){l=r[a]=new Pse(a);var h=void 0,c=this._getAdditiveTrack(a);if(c){var u=c.keyframes,d=u[u.length-1];h=d&&d.value,c.valType===O_&&h&&(h=LC(h))}else h=this._target[a];if(h==null)continue;e>0&&l.addKeyframe(0,xC(h),n),this._trackKeys.push(a)}l.addKeyframe(e,xC(t[a]),n)}return this._maxTime=Math.max(this._maxTime,e),this},s.prototype.pause=function(){this._clip.pause(),this._paused=!0},s.prototype.resume=function(){this._clip.resume(),this._paused=!1},s.prototype.isPaused=function(){return!!this._paused},s.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},s.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var t=e.length,i=0;i<t;i++)e[i].call(this)},s.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,t=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,t)for(var i=0;i<t.length;i++)t[i].call(this)},s.prototype._setTracksFinished=function(){for(var e=this._tracks,t=this._trackKeys,i=0;i<t.length;i++)e[t[i]].setFinished()},s.prototype._getAdditiveTrack=function(e){var t,i=this._additiveAnimators;if(i)for(var n=0;n<i.length;n++){var r=i[n].getTrack(e);r&&(t=r)}return t},s.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var t=this,i=[],n=this._maxTime||0,r=0;r<this._trackKeys.length;r++){var o=this._trackKeys[r],a=this._tracks[o],l=this._getAdditiveTrack(o),h=a.keyframes,c=h.length;if(a.prepare(n,l),a.needsAnimate())if(!this._allowDiscrete&&a.discrete){var u=h[c-1];u&&(t._target[a.propName]=u.rawValue),a.setFinished()}else i.push(a)}if(i.length||this._force){var d=new fse({life:n,loop:this._loop,delay:this._delay||0,onframe:function(f){t._started=2;var g=t._additiveAnimators;if(g){for(var p=!1,m=0;m<g.length;m++)if(g[m]._clip){p=!0;break}p||(t._additiveAnimators=null)}for(var m=0;m<i.length;m++)i[m].step(t._target,f);var v=t._onframeCbs;if(v)for(var m=0;m<v.length;m++)v[m](t._target,f)},ondestroy:function(){t._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.setEasing(e)}else this._doneCallback();return this}},s.prototype.stop=function(e){if(this._clip){var t=this._clip;e&&t.onframe(1),this._abortedCallback()}},s.prototype.delay=function(e){return this._delay=e,this},s.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},s.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},s.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},s.prototype.getClip=function(){return this._clip},s.prototype.getTrack=function(e){return this._tracks[e]},s.prototype.getTracks=function(){var e=this;return Ne(this._trackKeys,function(t){return e._tracks[t]})},s.prototype.stopTracks=function(e,t){if(!e.length||!this._clip)return!0;for(var i=this._tracks,n=this._trackKeys,r=0;r<e.length;r++){var o=i[e[r]];o&&!o.isFinished()&&(t?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var a=!0,r=0;r<n.length;r++)if(!i[n[r]].isFinished()){a=!1;break}return a&&this._abortedCallback(),a},s.prototype.saveTo=function(e,t,i){if(e){t=t||this._trackKeys;for(var n=0;n<t.length;n++){var r=t[n],o=this._tracks[r];if(!(!o||o.isFinished())){var a=o.keyframes,l=a[i?0:a.length-1];l&&(e[r]=xC(l.rawValue))}}}},s.prototype.__changeFinalValue=function(e,t){t=t||Gt(e);for(var i=0;i<t.length;i++){var n=t[i],r=this._tracks[n];if(r){var o=r.keyframes;if(o.length>1){var a=o.pop();r.addKeyframe(a.time,e[n]),r.prepare(this._maxTime,r.getAdditiveTrack())}}}},s})();function kp(){return new Date().getTime()}var Ose=(function(s){ye(e,s);function e(t){var i=s.call(this)||this;return i._running=!1,i._time=0,i._pausedTime=0,i._pauseStart=0,i._paused=!1,t=t||{},i.stage=t.stage||{},i}return e.prototype.addClip=function(t){t.animation&&this.removeClip(t),this._head?(this._tail.next=t,t.prev=this._tail,t.next=null,this._tail=t):this._head=this._tail=t,t.animation=this},e.prototype.addAnimator=function(t){t.animation=this;var i=t.getClip();i&&this.addClip(i)},e.prototype.removeClip=function(t){if(t.animation){var i=t.prev,n=t.next;i?i.next=n:this._head=n,n?n.prev=i:this._tail=i,t.next=t.prev=t.animation=null}},e.prototype.removeAnimator=function(t){var i=t.getClip();i&&this.removeClip(i),t.animation=null},e.prototype.update=function(t){for(var i=kp()-this._pausedTime,n=i-this._time,r=this._head;r;){var o=r.next,a=r.step(i,n);a&&(r.ondestroy(),this.removeClip(r)),r=o}this._time=i,t||(this.trigger("frame",n),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var t=this;this._running=!0;function i(){t._running&&(PE(i),!t._paused&&t.update())}PE(i)},e.prototype.start=function(){this._running||(this._time=kp(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=kp(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=kp()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var t=this._head;t;){var i=t.next;t.prev=t.next=t.animation=null,t=i}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(t,i){i=i||{},this.start();var n=new f5(t,i.loop);return this.addAnimator(n),n},e})(Il),Fse=300,BT=at.domSupported,VT=(function(){var s=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],t={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},i=Ne(s,function(n){var r=n.replace("mouse","pointer");return t.hasOwnProperty(r)?r:n});return{mouse:s,touch:e,pointer:i}})(),b9={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},w9=!1;function jE(s){var e=s.pointerType;return e==="pen"||e==="touch"}function Bse(s){s.touching=!0,s.touchTimer!=null&&(clearTimeout(s.touchTimer),s.touchTimer=null),s.touchTimer=setTimeout(function(){s.touching=!1,s.touchTimer=null},700)}function WT(s){s&&(s.zrByTouch=!0)}function Vse(s,e){return _o(s.dom,new Wse(s,e),!0)}function Q$(s,e){for(var t=e,i=!1;t&&t.nodeType!==9&&!(i=t.domBelongToZr||t!==e&&t===s.painterRoot);)t=t.parentNode;return i}var Wse=(function(){function s(e,t){this.stopPropagation=ts,this.stopImmediatePropagation=ts,this.preventDefault=ts,this.type=t.type,this.target=this.currentTarget=e.dom,this.pointerType=t.pointerType,this.clientX=t.clientX,this.clientY=t.clientY}return s})(),Ko={mousedown:function(s){s=_o(this.dom,s),this.__mayPointerCapture=[s.zrX,s.zrY],this.trigger("mousedown",s)},mousemove:function(s){s=_o(this.dom,s);var e=this.__mayPointerCapture;e&&(s.zrX!==e[0]||s.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",s)},mouseup:function(s){s=_o(this.dom,s),this.__togglePointerCapture(!1),this.trigger("mouseup",s)},mouseout:function(s){s=_o(this.dom,s);var e=s.toElement||s.relatedTarget;Q$(this,e)||(this.__pointerCapturing&&(s.zrEventControl="no_globalout"),this.trigger("mouseout",s))},wheel:function(s){w9=!0,s=_o(this.dom,s),this.trigger("mousewheel",s)},mousewheel:function(s){w9||(s=_o(this.dom,s),this.trigger("mousewheel",s))},touchstart:function(s){s=_o(this.dom,s),WT(s),this.__lastTouchMoment=new Date,this.handler.processGesture(s,"start"),Ko.mousemove.call(this,s),Ko.mousedown.call(this,s)},touchmove:function(s){s=_o(this.dom,s),WT(s),this.handler.processGesture(s,"change"),Ko.mousemove.call(this,s)},touchend:function(s){s=_o(this.dom,s),WT(s),this.handler.processGesture(s,"end"),Ko.mouseup.call(this,s),+new Date-+this.__lastTouchMoment<Fse&&Ko.click.call(this,s)},pointerdown:function(s){Ko.mousedown.call(this,s)},pointermove:function(s){jE(s)||Ko.mousemove.call(this,s)},pointerup:function(s){Ko.mouseup.call(this,s)},pointerout:function(s){jE(s)||Ko.mouseout.call(this,s)}};V(["click","dblclick","contextmenu"],function(s){Ko[s]=function(e){e=_o(this.dom,e),this.trigger(s,e)}});var UE={pointermove:function(s){jE(s)||UE.mousemove.call(this,s)},pointerup:function(s){UE.mouseup.call(this,s)},mousemove:function(s){this.trigger("mousemove",s)},mouseup:function(s){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",s),e&&(s.zrEventControl="only_globalout",this.trigger("mouseout",s))}};function Hse(s,e){var t=e.domHandlers;at.pointerEventsSupported?V(VT.pointer,function(i){DC(e,i,function(n){t[i].call(s,n)})}):(at.touchEventsSupported&&V(VT.touch,function(i){DC(e,i,function(n){t[i].call(s,n),Bse(e)})}),V(VT.mouse,function(i){DC(e,i,function(n){n=l5(n),e.touching||t[i].call(s,n)})}))}function zse(s,e){at.pointerEventsSupported?V(b9.pointer,t):at.touchEventsSupported||V(b9.mouse,t);function t(i){function n(r){r=l5(r),Q$(s,r.target)||(r=Vse(s,r),e.domHandlers[i].call(s,r))}DC(e,i,n,{capture:!0})}}function DC(s,e,t,i){s.mounted[e]=t,s.listenerOpts[e]=i,RE(s.domTarget,e,t,i)}function HT(s){var e=s.mounted;for(var t in e)e.hasOwnProperty(t)&&qne(s.domTarget,t,e[t],s.listenerOpts[t]);s.mounted={}}var y9=(function(){function s(e,t){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=t}return s})(),jse=(function(s){ye(e,s);function e(t,i){var n=s.call(this)||this;return n.__pointerCapturing=!1,n.dom=t,n.painterRoot=i,n._localHandlerScope=new y9(t,Ko),BT&&(n._globalHandlerScope=new y9(document,UE)),Hse(n,n._localHandlerScope),n}return e.prototype.dispose=function(){HT(this._localHandlerScope),BT&&HT(this._globalHandlerScope)},e.prototype.setCursor=function(t){this.dom.style&&(this.dom.style.cursor=t||"default")},e.prototype.__togglePointerCapture=function(t){if(this.__mayPointerCapture=null,BT&&+this.__pointerCapturing^+t){this.__pointerCapturing=t;var i=this._globalHandlerScope;t?zse(this,i):HT(i)}},e})(Il),J$=1;at.hasGlobalWindow&&(J$=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var C9=J$,$E=.4,GE="#333",qE="#ccc",Use="#eee",S9=q0,x9=5e-5;function Pu(s){return s>x9||s<-x9}var Ou=[],zg=[],zT=Ph(),jT=Math.abs,g5=(function(){function s(){}return s.prototype.getLocalTransform=function(e){return s.getLocalTransform(this,e)},s.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},s.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},s.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},s.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},s.prototype.needLocalTransform=function(){return Pu(this.rotation)||Pu(this.x)||Pu(this.y)||Pu(this.scaleX-1)||Pu(this.scaleY-1)||Pu(this.skewX)||Pu(this.skewY)},s.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,t=this.needLocalTransform(),i=this.transform;if(!(t||e)){i&&(S9(i),this.invTransform=null);return}i=i||Ph(),t?this.getLocalTransform(i):S9(i),e&&(t?Kc(i,e,i):h5(i,e)),this.transform=i,this._resolveGlobalScaleRatio(i)},s.prototype._resolveGlobalScaleRatio=function(e){var t=this.globalScaleRatio;if(t!=null&&t!==1){this.getGlobalScale(Ou);var i=Ou[0]<0?-1:1,n=Ou[1]<0?-1:1,r=((Ou[0]-i)*t+i)/Ou[0]||0,o=((Ou[1]-n)*t+n)/Ou[1]||0;e[0]*=r,e[1]*=r,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||Ph(),Y0(this.invTransform,e)},s.prototype.getComputedTransform=function(){for(var e=this,t=[];e;)t.push(e),e=e.parent;for(;e=t.pop();)e.updateTransform();return this.transform},s.prototype.setLocalTransform=function(e){if(e){var t=e[0]*e[0]+e[1]*e[1],i=e[2]*e[2]+e[3]*e[3],n=Math.atan2(e[1],e[0]),r=Math.PI/2+n-Math.atan2(e[3],e[2]);i=Math.sqrt(i)*Math.cos(r),t=Math.sqrt(t),this.skewX=r,this.skewY=0,this.rotation=-n,this.x=+e[4],this.y=+e[5],this.scaleX=t,this.scaleY=i,this.originX=0,this.originY=0}},s.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,t=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||Ph(),Kc(zg,e.invTransform,t),t=zg);var i=this.originX,n=this.originY;(i||n)&&(zT[4]=i,zT[5]=n,Kc(zg,t,zT),zg[4]-=i,zg[5]-=n,t=zg),this.setLocalTransform(t)}},s.prototype.getGlobalScale=function(e){var t=this.transform;return e=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)},s.prototype.transformCoordToLocal=function(e,t){var i=[e,t],n=this.invTransform;return n&&Us(i,i,n),i},s.prototype.transformCoordToGlobal=function(e,t){var i=[e,t],n=this.transform;return n&&Us(i,i,n),i},s.prototype.getLineScale=function(){var e=this.transform;return e&&jT(e[0]-1)>1e-10&&jT(e[3]-1)>1e-10?Math.sqrt(jT(e[0]*e[3]-e[2]*e[1])):1},s.prototype.copyTransform=function(e){eG(this,e)},s.getLocalTransform=function(e,t){t=t||[];var i=e.originX||0,n=e.originY||0,r=e.scaleX,o=e.scaleY,a=e.anchorX,l=e.anchorY,h=e.rotation||0,c=e.x,u=e.y,d=e.skewX?Math.tan(e.skewX):0,f=e.skewY?Math.tan(-e.skewY):0;if(i||n||a||l){var g=i+a,p=n+l;t[4]=-g*r-d*p*o,t[5]=-p*o-f*g*r}else t[4]=t[5]=0;return t[0]=r,t[3]=o,t[1]=f*r,t[2]=d*o,h&&K0(t,t,h),t[4]+=i+c,t[5]+=n+u,t},s.initDefaultProps=(function(){var e=s.prototype;e.scaleX=e.scaleY=e.globalScaleRatio=1,e.x=e.y=e.originX=e.originY=e.skewX=e.skewY=e.rotation=e.anchorX=e.anchorY=0})(),s})(),wb=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function eG(s,e){for(var t=0;t<wb.length;t++){var i=wb[t];s[i]=e[i]}}var L9={};function eo(s,e){e=e||ou;var t=L9[e];t||(t=L9[e]=new X0(500));var i=t.get(s);return i==null&&(i=au.measureText(s,e).width,t.put(s,i)),i}function k9(s,e,t,i){var n=eo(s,e),r=Rk(e),o=F_(0,n,t),a=wp(0,r,i),l=new Jt(o,a,n,r);return l}function Ak(s,e,t,i){var n=((s||"")+"").split(`
3
3
  `),r=n.length;if(r===1)return k9(n[0],e,t,i);for(var o=new Jt(0,0,0,0),a=0;a<n.length;a++){var l=k9(n[a],e,t,i);a===0?o.copy(l):o.union(l)}return o}function F_(s,e,t){return t==="right"?s-=e:t==="center"&&(s-=e/2),s}function wp(s,e,t){return t==="middle"?s-=e/2:t==="bottom"&&(s-=e),s}function Rk(s){return eo("国",s)}function lu(s,e){return typeof s=="string"?s.lastIndexOf("%")>=0?parseFloat(s)/100*e:parseFloat(s):s}function tG(s,e,t){var i=e.position||"inside",n=e.distance!=null?e.distance:5,r=t.height,o=t.width,a=r/2,l=t.x,h=t.y,c="left",u="top";if(i instanceof Array)l+=lu(i[0],t.width),h+=lu(i[1],t.height),c=null,u=null;else switch(i){case"left":l-=n,h+=a,c="right",u="middle";break;case"right":l+=n+o,h+=a,u="middle";break;case"top":l+=o/2,h-=n,c="center",u="bottom";break;case"bottom":l+=o/2,h+=r+n,c="center";break;case"inside":l+=o/2,h+=a,c="center",u="middle";break;case"insideLeft":l+=n,h+=a,u="middle";break;case"insideRight":l+=o-n,h+=a,c="right",u="middle";break;case"insideTop":l+=o/2,h+=n,c="center";break;case"insideBottom":l+=o/2,h+=r-n,c="center",u="bottom";break;case"insideTopLeft":l+=n,h+=n;break;case"insideTopRight":l+=o-n,h+=n,c="right";break;case"insideBottomLeft":l+=n,h+=r-n,u="bottom";break;case"insideBottomRight":l+=o-n,h+=r-n,c="right",u="bottom";break}return s=s||{},s.x=l,s.y=h,s.align=c,s.verticalAlign=u,s}var UT="__zr_normal__",$T=wb.concat(["ignore"]),$se=vl(wb,function(s,e){return s[e]=!0,s},{ignore:!1}),jg={},Gse=new Jt(0,0,0,0),Pk=(function(){function s(e){this.id=i5(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return s.prototype._init=function(e){this.attr(e)},s.prototype.drift=function(e,t,i){switch(this.draggable){case"horizontal":t=0;break;case"vertical":e=0;break}var n=this.transform;n||(n=this.transform=[1,0,0,1,0,0]),n[4]+=e,n[5]+=t,this.decomposeTransform(),this.markRedraw()},s.prototype.beforeUpdate=function(){},s.prototype.afterUpdate=function(){},s.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},s.prototype.updateInnerText=function(e){var t=this._textContent;if(t&&(!t.ignore||e)){this.textConfig||(this.textConfig={});var i=this.textConfig,n=i.local,r=t.innerTransformable,o=void 0,a=void 0,l=!1;r.parent=n?this:null;var h=!1;if(r.copyTransform(t),i.position!=null){var c=Gse;i.layoutRect?c.copy(i.layoutRect):c.copy(this.getBoundingRect()),n||c.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(jg,i,c):tG(jg,i,c),r.x=jg.x,r.y=jg.y,o=jg.align,a=jg.verticalAlign;var u=i.origin;if(u&&i.rotation!=null){var d=void 0,f=void 0;u==="center"?(d=c.width*.5,f=c.height*.5):(d=lu(u[0],c.width),f=lu(u[1],c.height)),h=!0,r.originX=-r.x+d+(n?0:c.x),r.originY=-r.y+f+(n?0:c.y)}}i.rotation!=null&&(r.rotation=i.rotation);var g=i.offset;g&&(r.x+=g[0],r.y+=g[1],h||(r.originX=-g[0],r.originY=-g[1]));var p=i.inside==null?typeof i.position=="string"&&i.position.indexOf("inside")>=0:i.inside,m=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,_=void 0,b=void 0;p&&this.canBeInsideText()?(v=i.insideFill,_=i.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(_==null||_==="auto")&&(_=this.getInsideTextStroke(v),b=!0)):(v=i.outsideFill,_=i.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(_==null||_==="auto")&&(_=this.getOutsideStroke(v),b=!0)),v=v||"#000",(v!==m.fill||_!==m.stroke||b!==m.autoStroke||o!==m.align||a!==m.verticalAlign)&&(l=!0,m.fill=v,m.stroke=_,m.autoStroke=b,m.align=o,m.verticalAlign=a,t.setDefaultTextStyle(m)),t.__dirty|=il,l&&t.dirtyStyle(!0)}},s.prototype.canBeInsideText=function(){return!0},s.prototype.getInsideTextFill=function(){return"#fff"},s.prototype.getInsideTextStroke=function(e){return"#000"},s.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?qE:GE},s.prototype.getOutsideStroke=function(e){var t=this.__zr&&this.__zr.getBackgroundColor(),i=typeof t=="string"&&Jr(t);i||(i=[255,255,255,1]);for(var n=i[3],r=this.__zr.isDarkMode(),o=0;o<3;o++)i[o]=i[o]*n+(r?0:255)*(1-n);return i[3]=1,gg(i,"rgba")},s.prototype.traverse=function(e,t){},s.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||{},we(this.extra,t)):this[e]=t},s.prototype.hide=function(){this.ignore=!0,this.markRedraw()},s.prototype.show=function(){this.ignore=!1,this.markRedraw()},s.prototype.attr=function(e,t){if(typeof e=="string")this.attrKV(e,t);else if(Ue(e))for(var i=e,n=Gt(i),r=0;r<n.length;r++){var o=n[r];this.attrKV(o,e[o])}return this.markRedraw(),this},s.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var t=this._normalState,i=0;i<this.animators.length;i++){var n=this.animators[i],r=n.__fromStateTransition;if(!(n.getLoop()||r&&r!==UT)){var o=n.targetName,a=o?t[o]:t;n.saveTo(a)}}},s.prototype._innerSaveToNormal=function(e){var t=this._normalState;t||(t=this._normalState={}),e.textConfig&&!t.textConfig&&(t.textConfig=this.textConfig),this._savePrimaryToNormal(e,t,$T)},s.prototype._savePrimaryToNormal=function(e,t,i){for(var n=0;n<i.length;n++){var r=i[n];e[r]!=null&&!(r in t)&&(t[r]=this[r])}},s.prototype.hasState=function(){return this.currentStates.length>0},s.prototype.getState=function(e){return this.states[e]},s.prototype.ensureState=function(e){var t=this.states;return t[e]||(t[e]={}),t[e]},s.prototype.clearStates=function(e){this.useState(UT,!1,e)},s.prototype.useState=function(e,t,i,n){var r=e===UT,o=this.hasState();if(!(!o&&r)){var a=this.currentStates,l=this.stateTransition;if(!($t(a,e)>=0&&(t||a.length===1))){var h;if(this.stateProxy&&!r&&(h=this.stateProxy(e)),h||(h=this.states&&this.states[e]),!h&&!r){n5("State "+e+" not exists.");return}r||this.saveCurrentToNormalState(h);var c=!!(h&&h.hoverLayer||n);c&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,h,this._normalState,t,!i&&!this.__inHover&&l&&l.duration>0,l);var u=this._textContent,d=this._textGuide;return u&&u.useState(e,t,i,c),d&&d.useState(e,t,i,c),r?(this.currentStates=[],this._normalState={}):t?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!c&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~il),h}}},s.prototype.useStates=function(e,t,i){if(!e.length)this.clearStates();else{var n=[],r=this.currentStates,o=e.length,a=o===r.length;if(a){for(var l=0;l<o;l++)if(e[l]!==r[l]){a=!1;break}}if(a)return;for(var l=0;l<o;l++){var h=e[l],c=void 0;this.stateProxy&&(c=this.stateProxy(h,e)),c||(c=this.states[h]),c&&n.push(c)}var u=n[o-1],d=!!(u&&u.hoverLayer||i);d&&this._toggleHoverLayerFlag(!0);var f=this._mergeStates(n),g=this.stateTransition;this.saveCurrentToNormalState(f),this._applyStateObj(e.join(","),f,this._normalState,!1,!t&&!this.__inHover&&g&&g.duration>0,g);var p=this._textContent,m=this._textGuide;p&&p.useStates(e,t,d),m&&m.useStates(e,t,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~il)}},s.prototype.isSilent=function(){for(var e=this.silent,t=this.parent;!e&&t;){if(t.silent){e=!0;break}t=t.parent}return e},s.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var t=this.animators[e];t.targetName&&t.changeTarget(this[t.targetName])}},s.prototype.removeState=function(e){var t=$t(this.currentStates,e);if(t>=0){var i=this.currentStates.slice();i.splice(t,1),this.useStates(i)}},s.prototype.replaceState=function(e,t,i){var n=this.currentStates.slice(),r=$t(n,e),o=$t(n,t)>=0;r>=0?o?n.splice(r,1):n[r]=t:i&&!o&&n.push(t),this.useStates(n)},s.prototype.toggleState=function(e,t){t?this.useState(e,!0):this.removeState(e)},s.prototype._mergeStates=function(e){for(var t={},i,n=0;n<e.length;n++){var r=e[n];we(t,r),r.textConfig&&(i=i||{},we(i,r.textConfig))}return i&&(t.textConfig=i),t},s.prototype._applyStateObj=function(e,t,i,n,r,o){var a=!(t&&n);t&&t.textConfig?(this.textConfig=we({},n?this.textConfig:i.textConfig),we(this.textConfig,t.textConfig)):a&&i.textConfig&&(this.textConfig=i.textConfig);for(var l={},h=!1,c=0;c<$T.length;c++){var u=$T[c],d=r&&$se[u];t&&t[u]!=null?d?(h=!0,l[u]=t[u]):this[u]=t[u]:a&&i[u]!=null&&(d?(h=!0,l[u]=i[u]):this[u]=i[u])}if(!r)for(var c=0;c<this.animators.length;c++){var f=this.animators[c],g=f.targetName;f.getLoop()||f.__changeFinalValue(g?(t||i)[g]:t||i)}h&&this._transitionState(e,l,o)},s.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var t=this.__zr;t&&e.addSelfToZr(t),e.__zr=t,e.__hostTarget=this}},s.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},s.prototype.getClipPath=function(){return this._clipPath},s.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},s.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},s.prototype.getTextContent=function(){return this._textContent},s.prototype.setTextContent=function(e){var t=this._textContent;t!==e&&(t&&t!==e&&this.removeTextContent(),e.innerTransformable=new g5,this._attachComponent(e),this._textContent=e,this.markRedraw())},s.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),we(this.textConfig,e),this.markRedraw()},s.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},s.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},s.prototype.getTextGuideLine=function(){return this._textGuide},s.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},s.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},s.prototype.markRedraw=function(){this.__dirty|=il;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},s.prototype.dirty=function(){this.markRedraw()},s.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var t=this._textContent,i=this._textGuide;t&&(t.__inHover=e),i&&(i.__inHover=e)},s.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.addAnimator(t[i]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},s.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var t=this.animators;if(t)for(var i=0;i<t.length;i++)e.animation.removeAnimator(t[i]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},s.prototype.animate=function(e,t,i){var n=e?this[e]:this,r=new f5(n,t,i);return e&&(r.targetName=e),this.addAnimator(r,e),r},s.prototype.addAnimator=function(e,t){var i=this.__zr,n=this;e.during(function(){n.updateDuringAnimation(t)}).done(function(){var r=n.animators,o=$t(r,e);o>=0&&r.splice(o,1)}),this.animators.push(e),i&&i.animation.addAnimator(e),i&&i.wakeUp()},s.prototype.updateDuringAnimation=function(e){this.markRedraw()},s.prototype.stopAnimation=function(e,t){for(var i=this.animators,n=i.length,r=[],o=0;o<n;o++){var a=i[o];!e||e===a.scope?a.stop(t):r.push(a)}return this.animators=r,this},s.prototype.animateTo=function(e,t,i){GT(this,e,t,i)},s.prototype.animateFrom=function(e,t,i){GT(this,e,t,i,!0)},s.prototype._transitionState=function(e,t,i,n){for(var r=GT(this,t,i,n),o=0;o<r.length;o++)r[o].__fromStateTransition=e},s.prototype.getBoundingRect=function(){return null},s.prototype.getPaintRect=function(){return null},s.initDefaultProps=(function(){var e=s.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=il;function t(i,n,r,o){Object.defineProperty(e,i,{get:function(){if(!this[n]){var l=this[n]=[];a(this,l)}return this[n]},set:function(l){this[r]=l[0],this[o]=l[1],this[n]=l,a(this,l)}});function a(l,h){Object.defineProperty(h,0,{get:function(){return l[r]},set:function(c){l[r]=c}}),Object.defineProperty(h,1,{get:function(){return l[o]},set:function(c){l[o]=c}})}}Object.defineProperty&&(t("position","_legacyPos","x","y"),t("scale","_legacyScale","scaleX","scaleY"),t("origin","_legacyOrigin","originX","originY"))})(),s})();oo(Pk,Il);oo(Pk,g5);function GT(s,e,t,i,n){t=t||{};var r=[];iG(s,"",s,e,t,i,r,n);var o=r.length,a=!1,l=t.done,h=t.aborted,c=function(){a=!0,o--,o<=0&&(a?l&&l():h&&h())},u=function(){o--,o<=0&&(a?l&&l():h&&h())};o||l&&l(),r.length>0&&t.during&&r[0].during(function(g,p){t.during(p)});for(var d=0;d<r.length;d++){var f=r[d];c&&f.done(c),u&&f.aborted(u),t.force&&f.duration(t.duration),f.start(t.easing)}return r}function qT(s,e,t){for(var i=0;i<t;i++)s[i]=e[i]}function qse(s){return Ks(s[0])}function Kse(s,e,t){if(Ks(e[t]))if(Ks(s[t])||(s[t]=[]),Ys(e[t])){var i=e[t].length;s[t].length!==i&&(s[t]=new e[t].constructor(i),qT(s[t],e[t],i))}else{var n=e[t],r=s[t],o=n.length;if(qse(n))for(var a=n[0].length,l=0;l<o;l++)r[l]?qT(r[l],n[l],a):r[l]=Array.prototype.slice.call(n[l]);else qT(r,n,o);r.length=n.length}else s[t]=e[t]}function Yse(s,e){return s===e||Ks(s)&&Ks(e)&&Xse(s,e)}function Xse(s,e){var t=s.length;if(t!==e.length)return!1;for(var i=0;i<t;i++)if(s[i]!==e[i])return!1;return!0}function iG(s,e,t,i,n,r,o,a){for(var l=Gt(i),h=n.duration,c=n.delay,u=n.additive,d=n.setToFinal,f=!Ue(r),g=s.animators,p=[],m=0;m<l.length;m++){var v=l[m],_=i[v];if(_!=null&&t[v]!=null&&(f||r[v]))if(Ue(_)&&!Ks(_)&&!Ek(_)){if(e){a||(t[v]=_,s.updateDuringAnimation(e));continue}iG(s,v,t[v],_,n,r&&r[v],o,a)}else p.push(v);else a||(t[v]=_,s.updateDuringAnimation(e),p.push(v))}var b=p.length;if(!u&&b)for(var y=0;y<g.length;y++){var C=g[y];if(C.targetName===e){var x=C.stopTracks(p);if(x){var S=$t(g,C);g.splice(S,1)}}}if(n.force||(p=Xi(p,function(N){return!Yse(i[N],t[N])}),b=p.length),b>0||n.force&&!o.length){var k=void 0,T=void 0,I=void 0;if(a){T={},d&&(k={});for(var y=0;y<b;y++){var v=p[y];T[v]=t[v],d?k[v]=i[v]:t[v]=i[v]}}else if(d){I={};for(var y=0;y<b;y++){var v=p[y];I[v]=xC(t[v]),Kse(t,i,v)}}var C=new f5(t,!1,!1,u?Xi(g,function(A){return A.targetName===e}):null);C.targetName=e,n.scope&&(C.scope=n.scope),d&&k&&C.whenWithKeys(0,k,p),I&&C.whenWithKeys(0,I,p),C.whenWithKeys(h??500,a?T:i,p).delay(c||0),s.addAnimator(C,e),o.push(C)}}var kn=(function(s){ye(e,s);function e(t){var i=s.call(this)||this;return i.isGroup=!0,i._children=[],i.attr(t),i}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(t){return this._children[t]},e.prototype.childOfName=function(t){for(var i=this._children,n=0;n<i.length;n++)if(i[n].name===t)return i[n]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(t){return t&&t!==this&&t.parent!==this&&(this._children.push(t),this._doAdd(t)),this},e.prototype.addBefore=function(t,i){if(t&&t!==this&&t.parent!==this&&i&&i.parent===this){var n=this._children,r=n.indexOf(i);r>=0&&(n.splice(r,0,t),this._doAdd(t))}return this},e.prototype.replace=function(t,i){var n=$t(this._children,t);return n>=0&&this.replaceAt(i,n),this},e.prototype.replaceAt=function(t,i){var n=this._children,r=n[i];if(t&&t!==this&&t.parent!==this&&t!==r){n[i]=t,r.parent=null;var o=this.__zr;o&&r.removeSelfFromZr(o),this._doAdd(t)}return this},e.prototype._doAdd=function(t){t.parent&&t.parent.remove(t),t.parent=this;var i=this.__zr;i&&i!==t.__zr&&t.addSelfToZr(i),i&&i.refresh()},e.prototype.remove=function(t){var i=this.__zr,n=this._children,r=$t(n,t);return r<0?this:(n.splice(r,1),t.parent=null,i&&t.removeSelfFromZr(i),i&&i.refresh(),this)},e.prototype.removeAll=function(){for(var t=this._children,i=this.__zr,n=0;n<t.length;n++){var r=t[n];i&&r.removeSelfFromZr(i),r.parent=null}return t.length=0,this},e.prototype.eachChild=function(t,i){for(var n=this._children,r=0;r<n.length;r++){var o=n[r];t.call(i,o,r)}return this},e.prototype.traverse=function(t,i){for(var n=0;n<this._children.length;n++){var r=this._children[n],o=t.call(i,r);r.isGroup&&!o&&r.traverse(t,i)}return this},e.prototype.addSelfToZr=function(t){s.prototype.addSelfToZr.call(this,t);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.addSelfToZr(t)}},e.prototype.removeSelfFromZr=function(t){s.prototype.removeSelfFromZr.call(this,t);for(var i=0;i<this._children.length;i++){var n=this._children[i];n.removeSelfFromZr(t)}},e.prototype.getBoundingRect=function(t){for(var i=new Jt(0,0,0,0),n=t||this._children,r=[],o=null,a=0;a<n.length;a++){var l=n[a];if(!(l.ignore||l.invisible)){var h=l.getBoundingRect(),c=l.getLocalTransform(r);c?(Jt.applyTransform(i,h,c),o=o||i.clone(),o.union(i)):(o=o||h.clone(),o.union(h))}}return o||i},e})(Pk);kn.prototype.type="group";var TC={},Gd={};function Zse(s){delete Gd[s]}function Qse(s){if(!s)return!1;if(typeof s=="string")return _b(s,1)<$E;if(s.colorStops){for(var e=s.colorStops,t=0,i=e.length,n=0;n<i;n++)t+=_b(e[n].color,1);return t/=i,t<$E}return!1}var Jse=(function(){function s(e,t,i){var n=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,i=i||{},this.dom=t,this.id=e;var r=new ose,o=i.renderer||"canvas";TC[o]||(o=Gt(TC)[0]),i.useDirtyRect=i.useDirtyRect==null?!1:i.useDirtyRect;var a=new TC[o](t,r,i,e),l=i.ssr||a.ssrOnly;this.storage=r,this.painter=a;var h=!at.node&&!at.worker&&!l?new jse(a.getViewportRoot(),a.root):null,c=i.useCoarsePointer,u=c==null||c==="auto"?at.touchEventsSupported:!!c,d=44,f;u&&(f=ct(i.pointerSize,d)),this.handler=new P$(r,a,h,a.root,f),this.animation=new Ose({stage:{update:l?null:function(){return n._flush(!0)}}}),l||this.animation.start()}return s.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},s.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},s.prototype.configLayer=function(e,t){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,t),this.refresh())},s.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=Qse(e))},s.prototype.getBackgroundColor=function(){return this._backgroundColor},s.prototype.setDarkMode=function(e){this._darkMode=e},s.prototype.isDarkMode=function(){return this._darkMode},s.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},s.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},s.prototype.flush=function(){this._disposed||this._flush(!1)},s.prototype._flush=function(e){var t,i=kp();this._needsRefresh&&(t=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately());var n=kp();t?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:n-i})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},s.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},s.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},s.prototype.refreshHover=function(){this._needsRefreshHover=!0},s.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},s.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},s.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},s.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},s.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},s.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},s.prototype.findHover=function(e,t){if(!this._disposed)return this.handler.findHover(e,t)},s.prototype.on=function(e,t,i){return this._disposed||this.handler.on(e,t,i),this},s.prototype.off=function(e,t){this._disposed||this.handler.off(e,t)},s.prototype.trigger=function(e,t){this._disposed||this.handler.trigger(e,t)},s.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),t=0;t<e.length;t++)e[t]instanceof kn&&e[t].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},s.prototype.dispose=function(){this._disposed||(this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,this._disposed=!0,Zse(this.id))},s})();function KE(s,e){var t=new Jse(i5(),s,e);return Gd[t.id]=t,t}function ere(s){s.dispose()}function tre(){for(var s in Gd)Gd.hasOwnProperty(s)&&Gd[s].dispose();Gd={}}function ire(s){return Gd[s]}function nG(s,e){TC[s]=e}var YE;function sG(s){if(typeof YE=="function")return YE(s)}function rG(s){YE=s}var nre="5.6.1";const sre=Object.freeze(Object.defineProperty({__proto__:null,dispose:ere,disposeAll:tre,getElementSSRData:sG,getInstance:ire,init:KE,registerPainter:nG,registerSSRDataGetter:rG,version:nre},Symbol.toStringTag,{value:"Module"}));var D9=1e-4,oG=20;function rre(s){return s.replace(/^\s+|\s+$/g,"")}function Lc(s,e,t,i){var n=e[0],r=e[1],o=t[0],a=t[1],l=r-n,h=a-o;if(l===0)return h===0?o:(o+a)/2;if(i)if(l>0){if(s<=n)return o;if(s>=r)return a}else{if(s>=n)return o;if(s<=r)return a}else{if(s===n)return o;if(s===r)return a}return(s-n)/l*h+o}function Bs(s,e){switch(s){case"center":case"middle":s="50%";break;case"left":case"top":s="0%";break;case"right":case"bottom":s="100%";break}return Be(s)?rre(s).match(/%$/)?parseFloat(s)/100*e:parseFloat(s):s==null?NaN:+s}function Qi(s,e,t){return e==null&&(e=10),e=Math.min(Math.max(0,e),oG),s=(+s).toFixed(e),t?s:+s}function p5(s){return s.sort(function(e,t){return e-t}),s}function al(s){if(s=+s,isNaN(s))return 0;if(s>1e-14){for(var e=1,t=0;t<15;t++,e*=10)if(Math.round(s*e)/e===s)return t}return aG(s)}function aG(s){var e=s.toString().toLowerCase(),t=e.indexOf("e"),i=t>0?+e.slice(t+1):0,n=t>0?t:e.length,r=e.indexOf("."),o=r<0?0:n-1-r;return Math.max(0,o-i)}function m5(s,e){var t=Math.log,i=Math.LN10,n=Math.floor(t(s[1]-s[0])/i),r=Math.round(t(Math.abs(e[1]-e[0]))/i),o=Math.min(Math.max(-n+r,0),20);return isFinite(o)?o:20}function ore(s,e,t){if(!s[e])return 0;var i=are(s,t);return i[e]||0}function are(s,e){var t=vl(s,function(f,g){return f+(isNaN(g)?0:g)},0);if(t===0)return[];for(var i=Math.pow(10,e),n=Ne(s,function(f){return(isNaN(f)?0:f)/t*i*100}),r=i*100,o=Ne(n,function(f){return Math.floor(f)}),a=vl(o,function(f,g){return f+g},0),l=Ne(n,function(f,g){return f-o[g]});a<r;){for(var h=Number.NEGATIVE_INFINITY,c=null,u=0,d=l.length;u<d;++u)l[u]>h&&(h=l[u],c=u);++o[c],l[c]=0,++a}return Ne(o,function(f){return f/i})}function lre(s,e){var t=Math.max(al(s),al(e)),i=s+e;return t>oG?i:Qi(i,t)}var hre=9007199254740991;function v5(s){var e=Math.PI*2;return(s%e+e)%e}function yb(s){return s>-D9&&s<D9}var cre=/^(?:(\d{4})(?:[-\/](\d{1,2})(?:[-\/](\d{1,2})(?:[T ](\d{1,2})(?::(\d{1,2})(?::(\d{1,2})(?:[.,](\d+))?)?)?(Z|[\+\-]\d\d:?\d\d)?)?)?)?)?$/;function Mo(s){if(s instanceof Date)return s;if(Be(s)){var e=cre.exec(s);if(!e)return new Date(NaN);if(e[8]){var t=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(t-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,t,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0))}else return new Date(+e[1],+(e[2]||1)-1,+e[3]||1,+e[4]||0,+(e[5]||0),+e[6]||0,e[7]?+e[7].substring(0,3):0)}else if(s==null)return new Date(NaN);return new Date(Math.round(s))}function lG(s){return Math.pow(10,Ok(s))}function Ok(s){if(s===0)return 0;var e=Math.floor(Math.log(s)/Math.LN10);return s/Math.pow(10,e)>=10&&e++,e}function _5(s,e){var t=Ok(s),i=Math.pow(10,t),n=s/i,r;return e?n<1.5?r=1:n<2.5?r=2:n<4?r=3:n<7?r=5:r=10:n<1?r=1:n<2?r=2:n<3?r=3:n<5?r=5:r=10,s=r*i,t>=-20?+s.toFixed(t<0?-t:0):s}function ure(s,e){var t=(s.length-1)*e+1,i=Math.floor(t),n=+s[i-1],r=t-i;return r?n+r*(s[i]-n):n}function dre(s){s.sort(function(l,h){return a(l,h,0)?-1:1});for(var e=-1/0,t=1,i=0;i<s.length;){for(var n=s[i].interval,r=s[i].close,o=0;o<2;o++)n[o]<=e&&(n[o]=e,r[o]=o?1:1-t),e=n[o],t=r[o];n[0]===n[1]&&r[0]*r[1]!==1?s.splice(i,1):i++}return s;function a(l,h,c){return l.interval[c]<h.interval[c]||l.interval[c]===h.interval[c]&&(l.close[c]-h.close[c]===(c?-1:1)||!c&&a(l,h,1))}}function Cb(s){var e=parseFloat(s);return e==s&&(e!==0||!Be(s)||s.indexOf("x")<=0)?e:NaN}function hG(s){return!isNaN(Cb(s))}function cG(){return Math.round(Math.random()*9)}function uG(s,e){return e===0?s:uG(e,s%e)}function T9(s,e){return s==null?e:e==null?s:s*e/uG(s,e)}function br(s){throw new Error(s)}function I9(s,e,t){return(e-s)*t+s}var dG="series\0",fG="\0_ec_\0";function $s(s){return s instanceof Array?s:s==null?[]:[s]}function E9(s,e,t){if(s){s[e]=s[e]||{},s.emphasis=s.emphasis||{},s.emphasis[e]=s.emphasis[e]||{};for(var i=0,n=t.length;i<n;i++){var r=t[i];!s.emphasis[e].hasOwnProperty(r)&&s[e].hasOwnProperty(r)&&(s.emphasis[e][r]=s[e][r])}}}var N9=["fontStyle","fontWeight","fontSize","fontFamily","rich","tag","color","textBorderColor","textBorderWidth","width","height","lineHeight","align","verticalAlign","baseline","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY","backgroundColor","borderColor","borderWidth","borderRadius","padding"];function vv(s){return Ue(s)&&!Me(s)&&!(s instanceof Date)?s.value:s}function fre(s){return Ue(s)&&!(s instanceof Array)}function gre(s,e,t){var i=t==="normalMerge",n=t==="replaceMerge",r=t==="replaceAll";s=s||[],e=(e||[]).slice();var o=_t();V(e,function(l,h){if(!Ue(l)){e[h]=null;return}});var a=pre(s,o,t);return(i||n)&&mre(a,s,o,e),i&&vre(a,e),i||n?_re(a,e,n):r&&bre(a,e),wre(a),a}function pre(s,e,t){var i=[];if(t==="replaceAll")return i;for(var n=0;n<s.length;n++){var r=s[n];r&&r.id!=null&&e.set(r.id,n),i.push({existing:t==="replaceMerge"||Sb(r)?null:r,newOption:null,keyInfo:null,brandNew:null})}return i}function mre(s,e,t,i){V(i,function(n,r){if(!(!n||n.id==null)){var o=n1(n.id),a=t.get(o);if(a!=null){var l=s[a];ro(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=n,l.existing=e[a],i[r]=null}}})}function vre(s,e){V(e,function(t,i){if(!(!t||t.name==null))for(var n=0;n<s.length;n++){var r=s[n].existing;if(!s[n].newOption&&r&&(r.id==null||t.id==null)&&!Sb(t)&&!Sb(r)&&gG("name",r,t)){s[n].newOption=t,e[i]=null;return}}})}function _re(s,e,t){V(e,function(i){if(i){for(var n,r=0;(n=s[r])&&(n.newOption||Sb(n.existing)||n.existing&&i.id!=null&&!gG("id",i,n.existing));)r++;n?(n.newOption=i,n.brandNew=t):s.push({newOption:i,brandNew:t,existing:null,keyInfo:null}),r++}})}function bre(s,e){V(e,function(t){s.push({newOption:t,brandNew:!0,existing:null,keyInfo:null})})}function wre(s){var e=_t();V(s,function(t){var i=t.existing;i&&e.set(i.id,t)}),V(s,function(t){var i=t.newOption;ro(!i||i.id==null||!e.get(i.id)||e.get(i.id)===t,"id duplicates: "+(i&&i.id)),i&&i.id!=null&&e.set(i.id,t),!t.keyInfo&&(t.keyInfo={})}),V(s,function(t,i){var n=t.existing,r=t.newOption,o=t.keyInfo;if(Ue(r)){if(o.name=r.name!=null?n1(r.name):n?n.name:dG+i,n)o.id=n1(n.id);else if(r.id!=null)o.id=n1(r.id);else{var a=0;do o.id="\0"+o.name+"\0"+a++;while(e.get(o.id))}e.set(o.id,t)}})}function gG(s,e,t){var i=ua(e[s],null),n=ua(t[s],null);return i!=null&&n!=null&&i===n}function n1(s){return ua(s,"")}function ua(s,e){return s==null?e:Be(s)?s:ki(s)||mS(s)?s+"":e}function pG(s){var e=s.name;return!!(e&&e.indexOf(dG))}function Sb(s){return s&&s.id!=null&&n1(s.id).indexOf(fG)===0}function yre(s){return fG+s}function Cre(s,e,t){V(s,function(i){var n=i.newOption;Ue(n)&&(i.keyInfo.mainType=e,i.keyInfo.subType=Sre(e,n,i.existing,t))})}function Sre(s,e,t,i){var n=e.type?e.type:t?t.subType:i.determineSubType(s,e);return n}function zf(s,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return Me(e.dataIndex)?Ne(e.dataIndex,function(t){return s.indexOfRawIndex(t)}):s.indexOfRawIndex(e.dataIndex);if(e.name!=null)return Me(e.name)?Ne(e.name,function(t){return s.indexOfName(t)}):s.indexOfName(e.name)}function tn(){var s="__ec_inner_"+xre++;return function(e){return e[s]||(e[s]={})}}var xre=cG();function s1(s,e,t){var i=b5(e,t),n=i.mainTypeSpecified,r=i.queryOptionMap,o=i.others,a=o,l=t?t.defaultMainType:null;return!n&&l&&r.set(l,{}),r.each(function(h,c){var u=Z0(s,c,h,{useDefault:l===c,enableAll:t&&t.enableAll!=null?t.enableAll:!0,enableNone:t&&t.enableNone!=null?t.enableNone:!0});a[c+"Models"]=u.models,a[c+"Model"]=u.models[0]}),a}function b5(s,e){var t;if(Be(s)){var i={};i[s+"Index"]=0,t=i}else t=s;var n=_t(),r={},o=!1;return V(t,function(a,l){if(l==="dataIndex"||l==="dataIndexInside"){r[l]=a;return}var h=l.match(/^(\w+)(Index|Id|Name)$/)||[],c=h[1],u=(h[2]||"").toLowerCase();if(!(!c||!u||e&&e.includeMainTypes&&$t(e.includeMainTypes,c)<0)){o=o||!!c;var d=n.get(c)||n.set(c,{});d[u]=a}}),{mainTypeSpecified:o,queryOptionMap:n,others:r}}var zs={useDefault:!0,enableAll:!1,enableNone:!1},Lre={useDefault:!1,enableAll:!0,enableNone:!0};function Z0(s,e,t,i){i=i||zs;var n=t.index,r=t.id,o=t.name,a={models:null,specified:n!=null||r!=null||o!=null};if(!a.specified){var l=void 0;return a.models=i.useDefault&&(l=s.getComponent(e))?[l]:[],a}return n==="none"||n===!1?(ro(i.enableNone,'`"none"` or `false` is not a valid value on index option.'),a.models=[],a):(n==="all"&&(ro(i.enableAll,'`"all"` is not a valid value on index option.'),n=r=o=null),a.models=s.queryComponents({mainType:e,index:n,id:r,name:o}),a)}function mG(s,e,t){s.setAttribute?s.setAttribute(e,t):s[e]=t}function kre(s,e){return s.getAttribute?s.getAttribute(e):s[e]}function Dre(s){return s==="auto"?at.domSupported?"html":"richText":s||"html"}function Tre(s,e,t,i,n){var r=e==null||e==="auto";if(i==null)return i;if(ki(i)){var o=I9(t||0,i,n);return Qi(o,r?Math.max(al(t||0),al(i)):e)}else{if(Be(i))return n<1?t:i;for(var a=[],l=t,h=i,c=Math.max(l?l.length:0,h.length),u=0;u<c;++u){var d=s.getDimensionInfo(u);if(d&&d.type==="ordinal")a[u]=(n<1&&l?l:h)[u];else{var f=l&&l[u]?l[u]:0,g=h[u],o=I9(f,g,n);a[u]=Qi(o,r?Math.max(al(f),al(g)):e)}}return a}}var Ire=".",Fu="___EC__COMPONENT__CONTAINER___",vG="___EC__EXTENDED_CLASS___";function ll(s){var e={main:"",sub:""};if(s){var t=s.split(Ire);e.main=t[0]||"",e.sub=t[1]||""}return e}function Ere(s){ro(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(s),'componentType "'+s+'" illegal')}function Nre(s){return!!(s&&s[vG])}function w5(s,e){s.$constructor=s,s.extend=function(t){var i=this,n;return Mre(i)?n=(function(r){ye(o,r);function o(){return r.apply(this,arguments)||this}return o})(i):(n=function(){(t.$constructor||i).apply(this,arguments)},s5(n,this)),we(n.prototype,t),n[vG]=!0,n.extend=this.extend,n.superCall=Pre,n.superApply=Ore,n.superClass=i,n}}function Mre(s){return ut(s)&&/^class\s/.test(Function.prototype.toString.call(s))}function _G(s,e){s.extend=e.extend}var Are=Math.round(Math.random()*10);function Rre(s){var e=["__\0is_clz",Are++].join("_");s.prototype[e]=!0,s.isInstance=function(t){return!!(t&&t[e])}}function Pre(s,e){for(var t=[],i=2;i<arguments.length;i++)t[i-2]=arguments[i];return this.superClass.prototype[e].apply(s,t)}function Ore(s,e,t){return this.superClass.prototype[e].apply(s,t)}function Fk(s){var e={};s.registerClass=function(i){var n=i.type||i.prototype.type;if(n){Ere(n),i.prototype.type=n;var r=ll(n);if(!r.sub)e[r.main]=i;else if(r.sub!==Fu){var o=t(r);o[r.sub]=i}}return i},s.getClass=function(i,n,r){var o=e[i];if(o&&o[Fu]&&(o=n?o[n]:null),r&&!o)throw new Error(n?"Component "+i+"."+(n||"")+" is used but not imported.":i+".type should be specified.");return o},s.getClassesByMainType=function(i){var n=ll(i),r=[],o=e[n.main];return o&&o[Fu]?V(o,function(a,l){l!==Fu&&r.push(a)}):r.push(o),r},s.hasClass=function(i){var n=ll(i);return!!e[n.main]},s.getAllClassMainTypes=function(){var i=[];return V(e,function(n,r){i.push(r)}),i},s.hasSubTypes=function(i){var n=ll(i),r=e[n.main];return r&&r[Fu]};function t(i){var n=e[i.main];return(!n||!n[Fu])&&(n=e[i.main]={},n[Fu]=!0),n}}function xb(s,e){for(var t=0;t<s.length;t++)s[t][1]||(s[t][1]=s[t][0]);return e=e||!1,function(i,n,r){for(var o={},a=0;a<s.length;a++){var l=s[a][1];if(!(n&&$t(n,l)>=0||r&&$t(r,l)<0)){var h=i.getShallow(l,e);h!=null&&(o[s[a][0]]=h)}}return o}}var Fre=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Bre=xb(Fre),Vre=(function(){function s(){}return s.prototype.getAreaStyle=function(e,t){return Bre(this,e,t)},s})(),XE=new X0(50);function Wre(s){if(typeof s=="string"){var e=XE.get(s);return e&&e.image}else return s}function y5(s,e,t,i,n){if(s)if(typeof s=="string"){if(e&&e.__zrImageSrc===s||!t)return e;var r=XE.get(s),o={hostEl:t,cb:i,cbPayload:n};return r?(e=r.image,!Bk(e)&&r.pending.push(o)):(e=au.loadImage(s,M9,M9),e.__zrImageSrc=s,XE.put(s,e.__cachedImgObj={image:e,pending:[o]})),e}else return s;else return e}function M9(){var s=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<s.pending.length;e++){var t=s.pending[e],i=t.cb;i&&i(this,t.cbPayload),t.hostEl.dirty()}s.pending.length=0}function Bk(s){return s&&s.width&&s.height}var KT=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Hre(s,e,t,i,n){var r={};return bG(r,s,e,t,i,n),r.text}function bG(s,e,t,i,n,r){if(!t){s.text="",s.isTruncated=!1;return}var o=(e+"").split(`
4
4
  `);r=wG(t,i,n,r);for(var a=!1,l={},h=0,c=o.length;h<c;h++)yG(l,o[h],r),o[h]=l.textLine,a=a||l.isTruncated;s.text=o.join(`
@@ -1 +1 @@
1
- export { default } from "./Objects-DPan0bzw-v73.js";
1
+ export { default } from "./Objects-DPan0bzw-v84.js";