@accurix/centrinfo-widget 1.1.0 → 4.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/centrinfo-widget.js +303 -61
- package/dist/cdn/manifest.json +6 -6
- package/dist/{config-CHvO9tW1.mjs → config-CkU4urQY.mjs} +7 -7
- package/dist/{config-BfVMFkZ4.cjs → config-DsNMbdKp.cjs} +7 -7
- package/dist/index.cjs +284 -42
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +284 -42
- package/dist/runtime.cjs +1 -1
- package/dist/runtime.d.cts +36 -7
- package/dist/runtime.d.mts +36 -7
- package/dist/runtime.mjs +1 -1
- package/dist/{types-BwixZ4yh.d.mts → types-1ZJJY7Da.d.mts} +280 -8
- package/dist/{types-CiW6Ilds.d.cts → types-B0r4SXaT.d.cts} +280 -8
- package/package.json +4 -4
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
var Centrinfo=(function(yr){"use strict";var IE=Object.defineProperty;var PE=(yr,Vt,De)=>Vt in yr?IE(yr,Vt,{enumerable:!0,configurable:!0,writable:!0,value:De}):yr[Vt]=De;var Ht=(yr,Vt,De)=>PE(yr,typeof Vt!="symbol"?Vt+"":Vt,De);var Vt,De,gp,tn,mp,yp,_p,Bc,Jo,_i,bp,zc,Fc,Hc,xp,es={},ts=[],M1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,rs=Array.isArray;function Br(t,e){for(var r in e)t[r]=e[r];return t}function Vc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function A1(t,e,r){var n,a,i,o={};for(i in e)i=="key"?n=e[i]:i=="ref"?a=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?Vt.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return ns(t,o,n,a,null)}function ns(t,e,r,n,a){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++gp,__i:-1,__u:0};return a==null&&De.vnode!=null&&De.vnode(i),i}function Ce(t){return t.children}function as(t,e){this.props=t,this.context=e}function ya(t,e){if(e==null)return t.__?ya(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?ya(t):null}function D1(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],a=[],i=Br({},e);i.__v=e.__v+1,De.vnode&&De.vnode(i),Wc(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??ya(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,Mp(n,i,a),e.__e=e.__=null,i.__e!=r&&wp(i)}}function wp(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),wp(t)}function Gc(t){(!t.__d&&(t.__d=!0)&&tn.push(t)&&!is.__r++||mp!=De.debounceRendering)&&((mp=De.debounceRendering)||yp)(is)}function is(){try{for(var t,e=1;tn.length;)tn.length>e&&tn.sort(_p),t=tn.shift(),e=tn.length,D1(t)}finally{tn.length=is.__r=0}}function Sp(t,e,r,n,a,i,o,s,l,c,u){var f,h,d,p,m,v,g,y=n&&n.__k||ts,b=e.length;for(l=I1(r,e,y,l,b),f=0;f<b;f++)(d=r.__k[f])!=null&&(h=d.__i!=-1&&y[d.__i]||es,d.__i=f,v=Wc(t,d,h,a,i,o,s,l,c,u),p=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&Uc(h.ref,null,d),u.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),(g=!!(4&d.__u))||h.__k===d.__k?(l=kp(d,l,t,g),g&&h.__e&&(h.__e=null)):typeof d.type=="function"&&v!==void 0?l=v:p&&(l=p.nextSibling),d.__u&=-7);return r.__e=m,l}function I1(t,e,r,n,a){var i,o,s,l,c,u=r.length,f=u,h=0;for(t.__k=new Array(a),i=0;i<a;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[i]=ns(null,o,null,null,null):rs(o)?o=t.__k[i]=ns(Ce,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[i]=ns(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[i]=o,l=i+h,o.__=t,o.__b=t.__b+1,s=null,(c=o.__i=P1(o,r,l,f))!=-1&&(f--,(s=r[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(a>u?h--:a<u&&h++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,o.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<u;i++)(s=r[i])!=null&&(2&s.__u)==0&&(s.__e==n&&(n=ya(s)),Dp(s,s));return n}function kp(t,e,r,n){var a,i;if(typeof t.type=="function"){for(a=t.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=t,e=kp(a[i],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=ya(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function P1(t,e,r,n){var a,i,o,s=t.key,l=t.type,c=e[r],u=c!=null&&(2&c.__u)==0;if(c===null&&s==null||u&&s==c.key&&l==c.type)return r;if(n>(u?1:0)){for(a=r-1,i=r+1;a>=0||i<e.length;)if((c=e[o=a>=0?a--:i++])!=null&&(2&c.__u)==0&&s==c.key&&l==c.type)return o}return-1}function Tp(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||M1.test(e)?r:r+"px"}function os(t,e,r,n,a){var i,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Tp(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Tp(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(bp,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r[_i]=n[_i]:(r[_i]=zc,t.addEventListener(e,i?Hc:Fc,i)):t.removeEventListener(e,i?Hc:Fc,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Cp(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[Jo]==null)e[Jo]=zc++;else if(e[Jo]<r[_i])return;return r(De.event?De.event(e):e)}}}function Wc(t,e,r,n,a,i,o,s,l,c){var u,f,h,d,p,m,v,g,y,b,x,S,w,k,T,M=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=e.__e=r.__e]),(u=De.__b)&&u(e);e:if(typeof M=="function")try{if(g=e.props,y=M.prototype&&M.prototype.render,b=(u=M.contextType)&&n[u.__c],x=u?b?b.props.value:u.__:n,r.__c?v=(f=e.__c=r.__c).__=f.__E:(y?e.__c=f=new M(g,x):(e.__c=f=new as(g,x),f.constructor=M,f.render=R1),b&&b.sub(f),f.state||(f.state={}),f.__n=n,h=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&M.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Br({},f.__s)),Br(f.__s,M.getDerivedStateFromProps(g,f.__s))),d=f.props,p=f.state,f.__v=e,h)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&g!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(g,x),e.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(g,f.__s,x)===!1){e.__v!=r.__v&&(f.props=g,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(A){A&&(A.__=e)}),ts.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(g,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=x,f.props=g,f.__P=t,f.__e=!1,S=De.__r,w=0,y)f.state=f.__s,f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),ts.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++w<25);f.state=f.__s,f.getChildContext!=null&&(n=Br(Br({},n),f.getChildContext())),y&&!h&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),k=u!=null&&u.type===Ce&&u.key==null?Ap(u.props.children):u,s=Sp(t,rs(k)?k:[k],e,r,n,a,i,o,s,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),v&&(f.__E=f.__=null)}catch(A){if(e.__v=null,l||i!=null)if(A.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else{for(T=i.length;T--;)Vc(i[T]);$c(e)}else e.__e=r.__e,e.__k=r.__k,A.then||$c(e);De.__e(A,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=L1(r.__e,e,r,n,a,i,o,l,c);return(u=De.diffed)&&u(e),128&e.__u?void 0:s}function $c(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some($c))}function Mp(t,e,r){for(var n=0;n<r.length;n++)Uc(r[n],r[++n],r[++n]);De.__c&&De.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){De.__e(i,a.__v)}})}function Ap(t){return typeof t!="object"||t==null||t.__b>0?t:rs(t)?t.map(Ap):t.constructor!==void 0?null:Br({},t)}function L1(t,e,r,n,a,i,o,s,l){var c,u,f,h,d,p,m,v=r.props||es,g=e.props,y=e.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((d=i[c])&&"setAttribute"in d==!!y&&(y?d.localName==y:d.nodeType==3)){t=d,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(g);t=document.createElementNS(a,y,g.is&&g),s&&(De.__m&&De.__m(e,i),s=!1),i=null}if(y==null)v===g||s&&t.data==g||(t.data=g);else{if(i=y=="textarea"&&g.defaultValue!=null?null:i&&Vt.call(t.childNodes),!s&&i!=null)for(v={},c=0;c<t.attributes.length;c++)v[(d=t.attributes[c]).name]=d.value;for(c in v)d=v[c],c=="dangerouslySetInnerHTML"?f=d:c=="children"||c in g||c=="value"&&"defaultValue"in g||c=="checked"&&"defaultChecked"in g||os(t,c,null,d,a);for(c in g)d=g[c],c=="children"?h=d:c=="dangerouslySetInnerHTML"?u=d:c=="value"?p=d:c=="checked"?m=d:s&&typeof d!="function"||v[c]===d||os(t,c,d,v[c],a);if(u)s||f&&(u.__html==f.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(f&&(t.innerHTML=""),Sp(e.type=="template"?t.content:t,rs(h)?h:[h],e,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:r.__k&&ya(r,0),s,l),i!=null)for(c=i.length;c--;)Vc(i[c]);s&&y!="textarea"||(c="value",y=="progress"&&p==null?t.removeAttribute("value"):p!=null&&(p!==t[c]||y=="progress"&&!p||y=="option"&&p!=v[c])&&os(t,c,p,v[c],a),c="checked",m!=null&&m!=t[c]&&os(t,c,m,v[c],a))}return t}function Uc(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(a){De.__e(a,r)}}function Dp(t,e,r){var n,a;if(De.unmount&&De.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||Uc(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){De.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(a=0;a<n.length;a++)n[a]&&Dp(n[a],e,r||typeof t.type!="function");r||Vc(t.__e),t.__c=t.__=t.__e=void 0}function R1(t,e,r){return this.constructor(t,r)}function Ip(t,e,r){var n,a,i,o;e==document&&(e=document.documentElement),De.__&&De.__(t,e),a=(n=!1)?null:e.__k,i=[],o=[],Wc(e,t=e.__k=A1(Ce,null,[t]),a||es,es,e.namespaceURI,a?null:e.firstChild?Vt.call(e.childNodes):null,i,a?a.__e:e.firstChild,n,o),Mp(i,t,o)}function E1(t){function e(r){var n,a;return this.getChildContext||(n=new Set,(a={})[e.__c]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&n.forEach(function(o){o.__e=!0,Gc(o)})},this.sub=function(i){n.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){n&&n.delete(i),o&&o.call(i)}}),r.children}return e.__c="__cC"+xp++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}Vt=ts.slice,De={__e:function(t,e,r,n){for(var a,i,o;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,n||{}),o=a.__d),o)return a.__E=a}catch(s){t=s}throw t}},gp=0,as.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Br({},this.state),typeof t=="function"&&(t=t(Br({},r),this.props)),t&&Br(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Gc(this))},as.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Gc(this))},as.prototype.render=Ce,tn=[],yp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,_p=function(t,e){return t.__v.__b-e.__v.__b},is.__r=0,Bc=Math.random().toString(8),Jo="__d"+Bc,_i="__a"+Bc,bp=/(PointerCapture)$|Capture$/i,zc=0,Fc=Cp(!1),Hc=Cp(!0),xp=0;var O1=0;function _(t,e,r,n,a,i){e||(e={});var o,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?o=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--O1,__i:-1,__u:0,__source:a,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return De.vnode&&De.vnode(c),c}class Pp extends Error{constructor(r,n){super(n);Ht(this,"status");this.status=r,this.name="ApiError"}}const Yc=()=>({agentName:"Accurix",greeting:"Hi! 👋 How can I help you today?",widgetModule:"chat",assistantMediaKind:"image",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"text",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:[]}),N1="Sara is an AI assistant; answers may be imperfect.",B1="Accurix is an AI assistant; answers may be imperfect.",Lp=t=>{typeof console>"u"||console.warn(`[centrinfo-widget] Could not load saved widget configuration from the API (${t}). Showing default widget chrome. Check data-token, data-api-base, CORS, and backend availability.`)},qc=(t,e={})=>{const n=t.disclaimerText?.trim()?.toLowerCase(),a=e.agentName?.trim()||t.agentName?.trim()||"Accurix",i=e.agentAvatarUrl?.trim()||t.agentAvatarUrl?.trim();return{...t,agentName:a,agentAvatarUrl:i||void 0,disclaimerText:n===N1.toLowerCase()||n?.includes("sara is an ai assistant")?B1:t.disclaimerText}};class Rp{constructor(e,r,n,a,i={},o,s,l="floating"){Ht(this,"baseUrl");Ht(this,"token");Ht(this,"gifApiKey");Ht(this,"analyticsContextToken");Ht(this,"bootstrapOverrides");Ht(this,"identityToken");Ht(this,"identityTokenProvider");Ht(this,"chatSurface");this.baseUrl=e,this.token=r,this.gifApiKey=n,this.analyticsContextToken=a,this.bootstrapOverrides=i,this.identityToken=o,this.identityTokenProvider=s,this.chatSurface=l}async currentIdentityToken(){if(this.identityTokenProvider){const e=await this.identityTokenProvider();this.identityToken=e?.trim()||void 0}return this.identityToken}headers(e=!0){const r={Authorization:`Bearer ${this.token}`};return e&&(r["Content-Type"]="application/json"),r}async json(e){let r;try{r=await e.json()}catch{r=void 0}if(!e.ok){const n=F1(r)??`request failed (${e.status})`;throw new Pp(e.status,n)}return r?.data??r}async bootstrap(){try{const e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return Lp(`bootstrap request failed with ${e.status}`),qc(Yc(),this.bootstrapOverrides);const r=await this.json(e);return qc({...Yc(),...r},this.bootstrapOverrides)}catch(e){return Lp(e instanceof Error?e.message:"bootstrap request failed"),qc(Yc(),this.bootstrapOverrides)}}async history(){const e=await this.currentIdentityToken();if(!e)return{conversations:[]};const r=await fetch(`${this.baseUrl}/public-chat/history`,{method:"POST",headers:this.headers(),body:JSON.stringify({identityToken:e,surface:this.chatSurface})}),n=await this.json(r);return{activeSessionId:n.activeSessionId,conversations:Array.isArray(n.conversations)?n.conversations:[]}}async stream(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat/stream`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal});return!i.ok||!i.body?this.send(e,r,n):H1(i.body,n)}async liveEvents(e,r){const n=`sessionId=${encodeURIComponent(e)}&after=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/live-events?${n}`,{headers:this.headers(!1)}),i=await this.json(a);return{mode:i.mode??"ai",assignedAgentName:i.assignedAgentName,agentTyping:!!i.agentTyping,agentTypingName:i.agentTypingName,conversationEnded:!!i.conversationEnded,events:i.events??[]}}async typing(e,r){try{const n=await fetch(`${this.baseUrl}/public-chat/typing`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e,isTyping:r})});if(!n.ok)try{await n.text()}catch{}}catch{}}async send(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal}),o=await this.json(i);return n.onChunk(o.answer??""),{answer:o.answer??"",sources:o.sources??[],suggestedReplies:o.suggestedReplies??[],availableActions:o.availableActions??[],handoffOffered:o.handoffOffered??!1,requestedContactFields:Ep(o.requestedContactFields),conversationEnded:o.conversationEnded??!1,liveMode:o.liveMode,assignedAgentName:o.assignedAgentName,audioBase64:o.audioBase64,mimeType:o.mimeType,visualization:o.visualization}}async action(e,r){const n=await fetch(`${this.baseUrl}/public-chat/${e}`,{method:"POST",headers:this.headers(),body:JSON.stringify(r)}),a=await this.json(n);return{ok:!0,note:a?.note,booking:a?.booking}}async speak(e){const r=await fetch(`${this.baseUrl}/public-chat/speak`,{method:"POST",headers:this.headers(),body:JSON.stringify({text:e})}),n=await this.json(r);return{providerReady:!!n.providerReady,message:n.message,audioBase64:n.audioBase64,mimeType:n.mimeType}}async identify(e,r){if(!(!e||!r))try{const n=await fetch(`${this.baseUrl}/public-chat/identify`,{method:"POST",headers:this.headers(),body:JSON.stringify(z1(e,r))});if(!n.ok)try{await n.text()}catch{}}catch{}}async transcribe(e,r,n,a){const i=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:r,languageHint:n,durationSeconds:a})});return(await this.json(i)).text??""}async endConversation(e){try{const r=await fetch(`${this.baseUrl}/public-chat/end`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!r.ok)try{await r.text()}catch{}}catch{}}async sendFeedback(e){try{const r=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:"POST",headers:this.headers(),body:JSON.stringify(e)});if(!r.ok)try{await r.text()}catch{}}catch{}}async extract(e,r,n){const a=await fetch(`${this.baseUrl}/public-chat/extract`,{method:"POST",headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:r,filename:n})});return(await this.json(a)).text??""}async demoSlots(e,r){try{const n=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/demo-slots?${n}`,{headers:this.headers(!1)});if(!a.ok)return{taken:[],busy:[]};const i=await this.json(a);return{taken:i?.taken??[],busy:i?.busy??[]}}catch{return{taken:[],busy:[]}}}async searchGifs(e){if(!this.gifApiKey)return[];const n=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||"trending")}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{const a=await fetch(n);return a.ok?((await a.json()).results??[]).map(o=>({id:o.id,url:o.media_formats?.gif?.url??o.media_formats?.tinygif?.url??"",preview:o.media_formats?.tinygif?.url??o.media_formats?.gif?.url??"",alt:o.content_description||"GIF"})).filter(o=>o.url):[]}catch{return[]}}}const z1=(t,e)=>{const r={...e.customAttributes??{},...e.metadata??{}};e.createdAt!==void 0&&(r.createdAt=e.createdAt),e.avatarUrl&&(r.avatarUrl=e.avatarUrl),e.company&&(r.company=e.company);const n={sessionId:t},a=e.externalId??e.userId;return a&&(n.externalId=a),e.email&&(n.email=e.email),e.firstName&&(n.firstName=e.firstName),e.lastName&&(n.lastName=e.lastName),e.name&&(n.name=e.name),e.phone&&(n.phone=e.phone),Object.keys(r).length>0&&(n.metadata=r),n},F1=t=>{const e=t?.message;if(Array.isArray(e))return e.join(", ");if(typeof e=="string")return e},H1=async(t,e)=>{const r=t.getReader(),n=new TextDecoder,a={answer:"",sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1};let i="";for(;;){const{done:o,value:s}=await r.read();if(o)break;i+=n.decode(s,{stream:!0});let l;for(;(l=i.indexOf(`
|
|
1
|
+
var Centrinfo=(function(Tr){"use strict";var aO=Object.defineProperty;var iO=(Tr,Zt,Ee)=>Zt in Tr?aO(Tr,Zt,{enumerable:!0,configurable:!0,writable:!0,value:Ee}):Tr[Zt]=Ee;var Vt=(Tr,Zt,Ee)=>iO(Tr,typeof Zt!="symbol"?Zt+"":Zt,Ee);var Zt,Ee,Mp,hn,Ap,Dp,Ip,Zc,us,Ni,Lp,Kc,jc,Qc,Pp,fs={},hs=[],W1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,ds=Array.isArray;function Wr(t,e){for(var r in e)t[r]=e[r];return t}function Jc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function U1(t,e,r){var n,a,i,o={};for(i in e)i=="key"?n=e[i]:i=="ref"?a=e[i]:o[i]=e[i];if(arguments.length>2&&(o.children=arguments.length>3?Zt.call(arguments,2):r),typeof t=="function"&&t.defaultProps!=null)for(i in t.defaultProps)o[i]===void 0&&(o[i]=t.defaultProps[i]);return ps(t,o,n,a,null)}function ps(t,e,r,n,a){var i={type:t,props:e,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:a??++Mp,__i:-1,__u:0};return a==null&&Ee.vnode!=null&&Ee.vnode(i),i}function Ae(t){return t.children}function vs(t,e){this.props=t,this.context=e}function Oa(t,e){if(e==null)return t.__?Oa(t.__,t.__i+1):null;for(var r;e<t.__k.length;e++)if((r=t.__k[e])!=null&&r.__e!=null)return r.__e;return typeof t.type=="function"?Oa(t):null}function Y1(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],a=[],i=Wr({},e);i.__v=e.__v+1,Ee.vnode&&Ee.vnode(i),tu(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??Oa(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,zp(n,i,a),e.__e=e.__=null,i.__e!=r&&Rp(i)}}function Rp(t){if((t=t.__)!=null&&t.__c!=null)return t.__e=t.__c.base=null,t.__k.some(function(e){if(e!=null&&e.__e!=null)return t.__e=t.__c.base=e.__e}),Rp(t)}function eu(t){(!t.__d&&(t.__d=!0)&&hn.push(t)&&!gs.__r++||Ap!=Ee.debounceRendering)&&((Ap=Ee.debounceRendering)||Dp)(gs)}function gs(){try{for(var t,e=1;hn.length;)hn.length>e&&hn.sort(Ip),t=hn.shift(),e=hn.length,Y1(t)}finally{hn.length=gs.__r=0}}function Ep(t,e,r,n,a,i,o,s,l,c,u){var f,h,d,p,m,g,v,y=n&&n.__k||hs,b=e.length;for(l=q1(r,e,y,l,b),f=0;f<b;f++)(d=r.__k[f])!=null&&(h=d.__i!=-1&&y[d.__i]||fs,d.__i=f,g=tu(t,d,h,a,i,o,s,l,c,u),p=d.__e,d.ref&&h.ref!=d.ref&&(h.ref&&nu(h.ref,null,d),u.push(d.ref,d.__c||p,d)),m==null&&p!=null&&(m=p),(v=!!(4&d.__u))||h.__k===d.__k?(l=Op(d,l,t,v),v&&h.__e&&(h.__e=null)):typeof d.type=="function"&&g!==void 0?l=g:p&&(l=p.nextSibling),d.__u&=-7);return r.__e=m,l}function q1(t,e,r,n,a){var i,o,s,l,c,u=r.length,f=u,h=0;for(t.__k=new Array(a),i=0;i<a;i++)(o=e[i])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=t.__k[i]=ps(null,o,null,null,null):ds(o)?o=t.__k[i]=ps(Ae,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[i]=ps(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[i]=o,l=i+h,o.__=t,o.__b=t.__b+1,s=null,(c=o.__i=X1(o,r,l,f))!=-1&&(f--,(s=r[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(a>u?h--:a<u&&h++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?h--:c==l+1?h++:(c>l?h--:h++,o.__u|=4))):t.__k[i]=null;if(f)for(i=0;i<u;i++)(s=r[i])!=null&&(2&s.__u)==0&&(s.__e==n&&(n=Oa(s)),Hp(s,s));return n}function Op(t,e,r,n){var a,i;if(typeof t.type=="function"){for(a=t.__k,i=0;a&&i<a.length;i++)a[i]&&(a[i].__=t,e=Op(a[i],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=Oa(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function X1(t,e,r,n){var a,i,o,s=t.key,l=t.type,c=e[r],u=c!=null&&(2&c.__u)==0;if(c===null&&s==null||u&&s==c.key&&l==c.type)return r;if(n>(u?1:0)){for(a=r-1,i=r+1;a>=0||i<e.length;)if((c=e[o=a>=0?a--:i++])!=null&&(2&c.__u)==0&&s==c.key&&l==c.type)return o}return-1}function Np(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||W1.test(e)?r:r+"px"}function ms(t,e,r,n,a){var i,o;e:if(e=="style")if(typeof r=="string")t.style.cssText=r;else{if(typeof n=="string"&&(t.style.cssText=n=""),n)for(e in n)r&&e in r||Np(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||Np(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(Lp,"$1")),o=e.toLowerCase(),e=o in t||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+i]=r,r?n?r[Ni]=n[Ni]:(r[Ni]=Kc,t.addEventListener(e,i?Qc:jc,i)):t.removeEventListener(e,i?Qc:jc,i);else{if(a=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in t)try{t[e]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&r==1?"":r))}}function Bp(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[us]==null)e[us]=Kc++;else if(e[us]<r[Ni])return;return r(Ee.event?Ee.event(e):e)}}}function tu(t,e,r,n,a,i,o,s,l,c){var u,f,h,d,p,m,g,v,y,b,x,S,w,k,T,C=e.type;if(e.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),i=[s=e.__e=r.__e]),(u=Ee.__b)&&u(e);e:if(typeof C=="function")try{if(v=e.props,y=C.prototype&&C.prototype.render,b=(u=C.contextType)&&n[u.__c],x=u?b?b.props.value:u.__:n,r.__c?g=(f=e.__c=r.__c).__=f.__E:(y?e.__c=f=new C(v,x):(e.__c=f=new vs(v,x),f.constructor=C,f.render=K1),b&&b.sub(f),f.state||(f.state={}),f.__n=n,h=f.__d=!0,f.__h=[],f._sb=[]),y&&f.__s==null&&(f.__s=f.state),y&&C.getDerivedStateFromProps!=null&&(f.__s==f.state&&(f.__s=Wr({},f.__s)),Wr(f.__s,C.getDerivedStateFromProps(v,f.__s))),d=f.props,p=f.state,f.__v=e,h)y&&C.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&C.getDerivedStateFromProps==null&&v!==d&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(v,x),e.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(v,f.__s,x)===!1){e.__v!=r.__v&&(f.props=v,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(A){A&&(A.__=e)}),hs.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(v,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(d,p,m)})}if(f.context=x,f.props=v,f.__P=t,f.__e=!1,S=Ee.__r,w=0,y)f.state=f.__s,f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),hs.push.apply(f.__h,f._sb),f._sb=[];else do f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),f.state=f.__s;while(f.__d&&++w<25);f.state=f.__s,f.getChildContext!=null&&(n=Wr(Wr({},n),f.getChildContext())),y&&!h&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(d,p)),k=u!=null&&u.type===Ae&&u.key==null?Fp(u.props.children):u,s=Ep(t,ds(k)?k:[k],e,r,n,a,i,o,s,l,c),f.base=e.__e,e.__u&=-161,f.__h.length&&o.push(f),g&&(f.__E=f.__=null)}catch(A){if(e.__v=null,l||i!=null)if(A.then){for(e.__u|=l?160:128;s&&s.nodeType==8&&s.nextSibling;)s=s.nextSibling;i[i.indexOf(s)]=null,e.__e=s}else{for(T=i.length;T--;)Jc(i[T]);ru(e)}else e.__e=r.__e,e.__k=r.__k,A.then||ru(e);Ee.__e(A,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=Z1(r.__e,e,r,n,a,i,o,l,c);return(u=Ee.diffed)&&u(e),128&e.__u?void 0:s}function ru(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ru))}function zp(t,e,r){for(var n=0;n<r.length;n++)nu(r[n],r[++n],r[++n]);Ee.__c&&Ee.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){Ee.__e(i,a.__v)}})}function Fp(t){return typeof t!="object"||t==null||t.__b>0?t:ds(t)?t.map(Fp):t.constructor!==void 0?null:Wr({},t)}function Z1(t,e,r,n,a,i,o,s,l){var c,u,f,h,d,p,m,g=r.props||fs,v=e.props,y=e.type;if(y=="svg"?a="http://www.w3.org/2000/svg":y=="math"?a="http://www.w3.org/1998/Math/MathML":a||(a="http://www.w3.org/1999/xhtml"),i!=null){for(c=0;c<i.length;c++)if((d=i[c])&&"setAttribute"in d==!!y&&(y?d.localName==y:d.nodeType==3)){t=d,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(v);t=document.createElementNS(a,y,v.is&&v),s&&(Ee.__m&&Ee.__m(e,i),s=!1),i=null}if(y==null)g===v||s&&t.data==v||(t.data=v);else{if(i=y=="textarea"&&v.defaultValue!=null?null:i&&Zt.call(t.childNodes),!s&&i!=null)for(g={},c=0;c<t.attributes.length;c++)g[(d=t.attributes[c]).name]=d.value;for(c in g)d=g[c],c=="dangerouslySetInnerHTML"?f=d:c=="children"||c in v||c=="value"&&"defaultValue"in v||c=="checked"&&"defaultChecked"in v||ms(t,c,null,d,a);for(c in v)d=v[c],c=="children"?h=d:c=="dangerouslySetInnerHTML"?u=d:c=="value"?p=d:c=="checked"?m=d:s&&typeof d!="function"||g[c]===d||ms(t,c,d,g[c],a);if(u)s||f&&(u.__html==f.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(f&&(t.innerHTML=""),Ep(e.type=="template"?t.content:t,ds(h)?h:[h],e,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:r.__k&&Oa(r,0),s,l),i!=null)for(c=i.length;c--;)Jc(i[c]);s&&y!="textarea"||(c="value",y=="progress"&&p==null?t.removeAttribute("value"):p!=null&&(p!==t[c]||y=="progress"&&!p||y=="option"&&p!=g[c])&&ms(t,c,p,g[c],a),c="checked",m!=null&&m!=t[c]&&ms(t,c,m,g[c],a))}return t}function nu(t,e,r){try{if(typeof t=="function"){var n=typeof t.__u=="function";n&&t.__u(),n&&e==null||(t.__u=t(e))}else t.current=e}catch(a){Ee.__e(a,r)}}function Hp(t,e,r){var n,a;if(Ee.unmount&&Ee.unmount(t),(n=t.ref)&&(n.current&&n.current!=t.__e||nu(n,null,e)),(n=t.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(i){Ee.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(a=0;a<n.length;a++)n[a]&&Hp(n[a],e,r||typeof t.type!="function");r||Jc(t.__e),t.__c=t.__=t.__e=void 0}function K1(t,e,r){return this.constructor(t,r)}function Vp(t,e,r){var n,a,i,o;e==document&&(e=document.documentElement),Ee.__&&Ee.__(t,e),a=(n=!1)?null:e.__k,i=[],o=[],tu(e,t=e.__k=U1(Ae,null,[t]),a||fs,fs,e.namespaceURI,a?null:e.firstChild?Zt.call(e.childNodes):null,i,a?a.__e:e.firstChild,n,o),zp(i,t,o)}function j1(t){function e(r){var n,a;return this.getChildContext||(n=new Set,(a={})[e.__c]=this,this.getChildContext=function(){return a},this.componentWillUnmount=function(){n=null},this.shouldComponentUpdate=function(i){this.props.value!=i.value&&n.forEach(function(o){o.__e=!0,eu(o)})},this.sub=function(i){n.add(i);var o=i.componentWillUnmount;i.componentWillUnmount=function(){n&&n.delete(i),o&&o.call(i)}}),r.children}return e.__c="__cC"+Pp++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}Zt=hs.slice,Ee={__e:function(t,e,r,n){for(var a,i,o;e=e.__;)if((a=e.__c)&&!a.__)try{if((i=a.constructor)&&i.getDerivedStateFromError!=null&&(a.setState(i.getDerivedStateFromError(t)),o=a.__d),a.componentDidCatch!=null&&(a.componentDidCatch(t,n||{}),o=a.__d),o)return a.__E=a}catch(s){t=s}throw t}},Mp=0,vs.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Wr({},this.state),typeof t=="function"&&(t=t(Wr({},r),this.props)),t&&Wr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),eu(this))},vs.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),eu(this))},vs.prototype.render=Ae,hn=[],Dp=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ip=function(t,e){return t.__v.__b-e.__v.__b},gs.__r=0,Zc=Math.random().toString(8),us="__d"+Zc,Ni="__a"+Zc,Lp=/(PointerCapture)$|Capture$/i,Kc=0,jc=Bp(!1),Qc=Bp(!0),Pp=0;var Q1=0;function _(t,e,r,n,a,i){e||(e={});var o,s,l=e;if("ref"in l)for(s in l={},e)s=="ref"?o=e[s]:l[s]=e[s];var c={type:t,props:l,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Q1,__i:-1,__u:0,__source:a,__self:i};if(typeof t=="function"&&(o=t.defaultProps))for(s in o)l[s]===void 0&&(l[s]=o[s]);return Ee.vnode&&Ee.vnode(c),c}class Gp extends Error{constructor(r,n){super(n);Vt(this,"status");this.status=r,this.name="ApiError"}}const au=()=>({agentName:"Accurix",greeting:"Hi! 👋 How can I help you today?",widgetModule:"chat",assistantMediaKind:"image",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"text",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:[]}),J1="Sara is an AI assistant; answers may be imperfect.",ew="Accurix is an AI assistant; answers may be imperfect.",$p=t=>{typeof console>"u"||console.warn(`[centrinfo-widget] Could not load saved widget configuration from the API (${t}). Showing default widget chrome. Check data-token, data-api-base, CORS, and backend availability.`)},iu=(t,e={})=>{const n=t.disclaimerText?.trim()?.toLowerCase(),a=e.agentName?.trim()||t.agentName?.trim()||"Accurix",i=e.agentAvatarUrl?.trim()||t.agentAvatarUrl?.trim();return{...t,agentName:a,agentAvatarUrl:i||void 0,disclaimerText:n===J1.toLowerCase()||n?.includes("sara is an ai assistant")?ew:t.disclaimerText}};class Wp{constructor(e,r,n,a,i={},o,s,l="floating"){Vt(this,"baseUrl");Vt(this,"token");Vt(this,"gifApiKey");Vt(this,"analyticsContextToken");Vt(this,"bootstrapOverrides");Vt(this,"identityToken");Vt(this,"identityTokenProvider");Vt(this,"chatSurface");this.baseUrl=e,this.token=r,this.gifApiKey=n,this.analyticsContextToken=a,this.bootstrapOverrides=i,this.identityToken=o,this.identityTokenProvider=s,this.chatSurface=l}async currentIdentityToken(){if(this.identityTokenProvider){const e=await this.identityTokenProvider();this.identityToken=e?.trim()||void 0}return this.identityToken}headers(e=!0){const r={Authorization:`Bearer ${this.token}`};return e&&(r["Content-Type"]="application/json"),r}async json(e){let r;try{r=await e.json()}catch{r=void 0}if(!e.ok){const n=rw(r)??`request failed (${e.status})`;throw new Gp(e.status,n)}return r?.data??r}async bootstrap(){try{const e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return $p(`bootstrap request failed with ${e.status}`),iu(au(),this.bootstrapOverrides);const r=await this.json(e);return iu({...au(),...r},this.bootstrapOverrides)}catch(e){return $p(e instanceof Error?e.message:"bootstrap request failed"),iu(au(),this.bootstrapOverrides)}}async history(){const e=await this.currentIdentityToken();if(!e)return{conversations:[]};const r=await fetch(`${this.baseUrl}/public-chat/history`,{method:"POST",headers:this.headers(),body:JSON.stringify({identityToken:e,surface:this.chatSurface})}),n=await this.json(r);return{activeSessionId:n.activeSessionId,conversations:Array.isArray(n.conversations)?n.conversations:[]}}async stream(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat/stream`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal});return!i.ok||!i.body?this.send(e,r,n):nw(i.body,n)}async liveEvents(e,r){const n=`sessionId=${encodeURIComponent(e)}&after=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/live-events?${n}`,{headers:this.headers(!1)}),i=await this.json(a);return{mode:i.mode??"ai",assignedAgentName:i.assignedAgentName,agentTyping:!!i.agentTyping,agentTypingName:i.agentTypingName,conversationEnded:!!i.conversationEnded,events:i.events??[]}}async typing(e,r){try{const n=await fetch(`${this.baseUrl}/public-chat/typing`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e,isTyping:r})});if(!n.ok)try{await n.text()}catch{}}catch{}}async send(e,r,n){const a=await this.currentIdentityToken(),i=await fetch(`${this.baseUrl}/public-chat`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:r,voicePlaybackRequested:!!n.voicePlaybackRequested,analyticsContextToken:this.analyticsContextToken,identityToken:a,surface:this.chatSurface}),signal:n.signal}),o=await this.json(i);return n.onChunk(o.answer??""),{answer:o.answer??"",sources:o.sources??[],suggestedReplies:o.suggestedReplies??[],availableActions:o.availableActions??[],actions:o.actions??[],selectedAction:o.selectedAction,handoffOffered:o.handoffOffered??!1,requestedContactFields:Up(o.requestedContactFields),conversationEnded:o.conversationEnded??!1,liveMode:o.liveMode,assignedAgentName:o.assignedAgentName,audioBase64:o.audioBase64,mimeType:o.mimeType,visualization:o.visualization,artifacts:o.artifacts}}async action(e,r,n){const a=n?.trim()||(e==="contact-support"?"inquiry":e),i=await fetch(`${this.baseUrl}/public-chat/${a}`,{method:"POST",headers:this.headers(),body:JSON.stringify(r)}),o=await this.json(i);return{ok:!0,note:o?.note,booking:o?.booking}}async speak(e){const r=await fetch(`${this.baseUrl}/public-chat/speak`,{method:"POST",headers:this.headers(),body:JSON.stringify({text:e})}),n=await this.json(r);return{providerReady:!!n.providerReady,message:n.message,audioBase64:n.audioBase64,mimeType:n.mimeType}}async identify(e,r){if(!(!e||!r))try{const n=await fetch(`${this.baseUrl}/public-chat/identify`,{method:"POST",headers:this.headers(),body:JSON.stringify(tw(e,r))});if(!n.ok)try{await n.text()}catch{}}catch{}}async transcribe(e,r,n,a){const i=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:r,languageHint:n,durationSeconds:a})});return(await this.json(i)).text??""}async transcribeAudio(e,r,n,a){const i=new FormData;i.append("audio",e,"voice-recording"),i.append("mimeType",r||e.type||"audio/webm"),n&&i.append("languageHint",n),a!==void 0&&Number.isFinite(a)&&i.append("durationSeconds",String(a));const o=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(!1),body:i});return(await this.json(o)).text??""}async endConversation(e){try{const r=await fetch(`${this.baseUrl}/public-chat/end`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!r.ok)try{await r.text()}catch{}}catch{}}async sendFeedback(e){try{const r=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:"POST",headers:this.headers(),body:JSON.stringify(e)});if(!r.ok)try{await r.text()}catch{}}catch{}}async extract(e,r,n){const a=await fetch(`${this.baseUrl}/public-chat/extract`,{method:"POST",headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:r,filename:n})});return(await this.json(a)).text??""}async demoSlots(e,r){const n=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(r)}`,a=await fetch(`${this.baseUrl}/public-chat/demo-slots?${n}`,{headers:this.headers(!1)});if(!a.ok){const o=new Error("Calendar availability is temporarily unavailable.");throw o.status=a.status,o}const i=await this.json(a);return{status:i?.status,reason:i?.reason,timezone:i?.timezone,slotDurationMinutes:i?.slotDurationMinutes,available:i?.available,taken:i?.taken??[],busy:i?.busy??[]}}async searchGifs(e){if(!this.gifApiKey)return[];const n=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||"trending")}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{const a=await fetch(n);return a.ok?((await a.json()).results??[]).map(o=>({id:o.id,url:o.media_formats?.gif?.url??o.media_formats?.tinygif?.url??"",preview:o.media_formats?.tinygif?.url??o.media_formats?.gif?.url??"",alt:o.content_description||"GIF"})).filter(o=>o.url):[]}catch{return[]}}}const tw=(t,e)=>{const r={...e.customAttributes??{},...e.metadata??{}};e.createdAt!==void 0&&(r.createdAt=e.createdAt),e.avatarUrl&&(r.avatarUrl=e.avatarUrl),e.company&&(r.company=e.company);const n={sessionId:t},a=e.externalId??e.userId;return a&&(n.externalId=a),e.email&&(n.email=e.email),e.firstName&&(n.firstName=e.firstName),e.lastName&&(n.lastName=e.lastName),e.name&&(n.name=e.name),e.phone&&(n.phone=e.phone),Object.keys(r).length>0&&(n.metadata=r),n},rw=t=>{const e=t?.message;if(Array.isArray(e))return e.join(", ");if(typeof e=="string")return e},nw=async(t,e)=>{const r=t.getReader(),n=new TextDecoder,a={answer:"",sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1};let i="";for(;;){const{done:o,value:s}=await r.read();if(o)break;i+=n.decode(s,{stream:!0});let l;for(;(l=i.indexOf(`
|
|
2
2
|
|
|
3
|
-
`))!==-1;){const c=i.slice(0,l);i=i.slice(l+2);const u=
|
|
3
|
+
`))!==-1;){const c=i.slice(0,l);i=i.slice(l+2);const u=aw(c);if(u){if(u.event==="error")throw new Gp(502,u.data?.message??"stream error");if(u.event==="chunk"&&typeof u.data?.text=="string")a.answer+=u.data.text,e.onChunk(u.data.text);else if(u.event==="final"&&u.data)a.sources=u.data.sources??[],a.suggestedReplies=u.data.suggestedReplies??[],a.availableActions=u.data.availableActions??[],a.actions=u.data.actions??[],a.selectedAction=u.data.selectedAction,a.handoffOffered=!!u.data.handoffOffered,a.requestedContactFields=Up(u.data.requestedContactFields),a.conversationEnded=!!u.data.conversationEnded,a.liveMode=u.data.liveMode,a.assignedAgentName=u.data.assignedAgentName,a.visualization=u.data.visualization,a.artifacts=u.data.artifacts,a.audioBase64=u.data.audioBase64,a.mimeType=u.data.mimeType;else if(u.event==="done")return a}}}return a},aw=t=>{let e="message";const r=[];for(const n of t.split(`
|
|
4
4
|
`))n.startsWith("event:")?e=n.slice(6).trim():n.startsWith("data:")&&r.push(n.slice(5).trim());if(r.length===0)return{event:e};try{return{event:e,data:JSON.parse(r.join(`
|
|
5
|
-
`))}}catch{return{event:e}}},Ep=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):[],Rt=t=>new Promise(e=>setTimeout(e,t)),Op={agentName:"Accurix",agentAvatarUrl:"",widgetModule:"assistant",assistantMediaUrl:"https://images.unsplash.com/photo-1494790108377-be9c29b29330",assistantMediaKind:"image",assistantPrivacyUrl:"https://accurix.tech/privacy",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"avatar",avatarProvider:"demo",avatarId:"accurix-demo",greeting:"Hi! I'm Accurix, the AI assistant for Accurix. Ask me anything about products, pricing, or documentation — or book a demo.",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:["public_book_demo","public_capture_contact","public_submit_inquiry"],agentDescription:"I help with Accurix products, pricing, and documentation.",welcomeSubtitle:"Ask me anything — most answers are instant.",disclaimerText:"Accurix is an AI assistant; answers may be imperfect.",starterQuestions:["What can Accurix help with?","How do I get started?","What's your pricing?"],featuredLinks:[{label:"Accurix founders",url:"https://accurix.tech/about"},{label:"Pricing",url:"https://accurix.tech/pricing"}]},G1=[{match:/demo chart|monthly orders|orders by status/i,result:{answer:"Orders moved in different directions by status in the latest month. The chart below shows one line for submitted, approved, and fulfilled orders.",sources:[],suggestedReplies:["Show a demo KPI","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"chart",type:"line",title:"Monthly orders by status",columns:["month","status","order_count"],rows:[{month:"2025-01-01",status:"Submitted",order_count:12},{month:"2025-01-01",status:"Approved",order_count:16},{month:"2025-01-01",status:"Fulfilled",order_count:14},{month:"2025-02-01",status:"Submitted",order_count:14},{month:"2025-02-01",status:"Approved",order_count:15},{month:"2025-02-01",status:"Fulfilled",order_count:15},{month:"2025-03-01",status:"Submitted",order_count:13},{month:"2025-03-01",status:"Approved",order_count:17},{month:"2025-03-01",status:"Fulfilled",order_count:16},{month:"2025-04-01",status:"Submitted",order_count:15},{month:"2025-04-01",status:"Approved",order_count:16},{month:"2025-04-01",status:"Fulfilled",order_count:17},{month:"2025-05-01",status:"Submitted",order_count:16},{month:"2025-05-01",status:"Approved",order_count:18},{month:"2025-05-01",status:"Fulfilled",order_count:17},{month:"2025-06-01",status:"Submitted",order_count:17},{month:"2025-06-01",status:"Approved",order_count:17},{month:"2025-06-01",status:"Fulfilled",order_count:18},{month:"2025-07-01",status:"Submitted",order_count:18},{month:"2025-07-01",status:"Approved",order_count:19},{month:"2025-07-01",status:"Fulfilled",order_count:18},{month:"2025-08-01",status:"Submitted",order_count:19},{month:"2025-08-01",status:"Approved",order_count:18},{month:"2025-08-01",status:"Fulfilled",order_count:19}],rowCount:24,timezone:"UTC",columnMetadata:[{key:"month",label:"Order month",dataType:"date",semanticRole:"date"},{key:"status",label:"Status",dataType:"text",semanticRole:"dimension"},{key:"order_count",label:"Distinct order count",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],chartRecommendation:{type:"line",mode:"time_series",categoryField:"month",valueFields:["order_count"],seriesField:"status"},expandable:!0,tableAvailable:!1,explanation:{headline:"The latest results moved in different directions by status.",summary:"Submitted and fulfilled orders increased, while approved orders decreased.",evidence:["Submitted orders increased from 18 in July to 19 in August.","Approved orders decreased from 19 in July to 18 in August.","Fulfilled orders increased from 18 in July to 19 in August."],businessMeaning:"Overall order activity is steady, but the small approval decline is worth watching if it continues.",followUps:["Which status changed the most?","How does this compare with the prior quarter?"],source:"governed_result"}}}},{match:/demo kpi|active accounts/i,result:{answer:"There are 5,632 active accounts in the current demo result.",sources:[],suggestedReplies:["Show a demo chart","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"kpi",type:"kpi",title:"Active accounts",columns:["active_accounts"],value:"active_accounts",rows:[{active_accounts:5632}],rowCount:1,columnMetadata:[{key:"active_accounts",label:"Active accounts",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],explanation:{headline:"Active accounts are 5,632.",summary:"This is the latest value in the demo result.",evidence:["The displayed active-account count is 5,632."],source:"governed_result"}}}},{match:/demo table|account health/i,result:{answer:"Nine accounts are included in this governed result. The table shows a compact preview and can be expanded to inspect every permitted row.",sources:[],suggestedReplies:["Show a demo chart","Test the hidden table response"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",title:"Account health",columns:["account_name","region","health_score","renewal_month"],rows:[{account_name:"Northstar Industries",region:"West",health_score:94,renewal_month:"August"},{account_name:"Apex Group",region:"East",health_score:91,renewal_month:"September"},{account_name:"Summit Retail",region:"North",health_score:88,renewal_month:"August"},{account_name:"Harbor Logistics",region:"South",health_score:86,renewal_month:"October"},{account_name:"Brightline Media",region:"West",health_score:84,renewal_month:"November"},{account_name:"Redwood Labs",region:"East",health_score:82,renewal_month:"September"},{account_name:"Atlas Foods",region:"North",health_score:79,renewal_month:"December"},{account_name:"Cedar Health",region:"South",health_score:77,renewal_month:"October"},{account_name:"Bluewave Energy",region:"West",health_score:74,renewal_month:"December"}],rowCount:9,columnMetadata:[{key:"account_name",label:"Account",dataType:"text",semanticRole:"dimension"},{key:"region",label:"Region",dataType:"text",semanticRole:"geography"},{key:"health_score",label:"Health score",dataType:"number",semanticRole:"measure"},{key:"renewal_month",label:"Renewal month",dataType:"text",semanticRole:"date"}],expandable:!0,tableAvailable:!0,downloadAvailable:!0,explanation:{headline:"Nine accounts are available for review.",summary:"Health scores range from 74 to 94 across four regions.",evidence:["Northstar Industries has the highest health score at 94."],source:"governed_result"}}}},{match:/hidden table|table response/i,result:{answer:"Three accounts need attention. The public widget explains the result without exposing its underlying rows.",sources:[],suggestedReplies:["Show a demo chart","Show a demo KPI"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",columns:["account_name","risk_score"],rows:[{account_name:"Private account A",risk_score:91},{account_name:"Private account B",risk_score:87},{account_name:"Private account C",risk_score:82}],rowCount:3,tableAvailable:!1,explanation:{headline:"Three accounts need attention.",summary:"The written result is available without displaying a public data table.",evidence:["Three accounts matched the approved attention rule."],source:"governed_result"}}}},{match:/^\s*(hi+|hey+|hello|yo|sup|howdy|hola|thanks|thank you|thx|good (morning|afternoon|evening))\b/i,result:{answer:"Hello! 👋 How can I help you today?",sources:[],suggestedReplies:["How do I track a shipment?","How does customs work?"],handoffOffered:!1}},{match:/track|shipment|where|status/i,result:{answer:"Centrinfo can answer from your indexed knowledge base, public website, connected files, and approved organization tools. It keeps answers grounded in your configured sources and can hand a conversation to your team when the AI is not enough.",sources:[{title:"Centrinfo public widget",url:"https://accurix.tech/centrinfo"}],suggestedReplies:["How does the widget work?","Can a human take over?"],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:"Accurix connects your organization knowledge, channels, integrations, and public widget in one place. You can configure which sources the AI can use, which tools visitors can trigger, and when your team should take over live chat.",sources:[{title:"Accurix documentation",url:"https://accurix.tech/docs"}],suggestedReplies:["Which tools can I connect?","How do permissions work?"],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:"Accurix uses a usage-based pricing model. Organizations keep an active subscription and spend credits as the AI answers, searches, and uses tools. Credit top-ups can extend usage when the subscription grant runs low.",sources:[{title:"Pricing",url:"https://accurix.tech/pricing"}],suggestedReplies:["How do credits work?","Can I top up credits?"],handoffOffered:!1}}],W1={answer:"That's a great question — I don't have a confident answer from Accurix's published docs yet. Want me to pass it to the team so a human can follow up? You can also book a quick demo.",sources:[],suggestedReplies:["What can you help with?"],handoffOffered:!0},$1=t=>G1.find(e=>e.match.test(t))?.result??W1;class U1{async history(){return{conversations:[]}}async bootstrap(){return await Rt(180),Op}async stream(e,r,n){await Rt(550);const a=$1(e),i=a.answer.split(/(\s+)/);for(const o of i){if(n.signal?.aborted)break;n.onChunk(o),await Rt(18+Math.min(40,o.length*6))}return{...a,availableActions:Op.availableActions}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async typing(){await Rt(20)}async action(e,r){return await Rt(450),{ok:!0,note:{"book-demo":"Demo requested — we'll email you a few times that work. 📅",contact:"Got it — saved your details. ✅",inquiry:"Thanks! We'll get back to you shortly. ✉️","request-callback":"We'll call you back soon. 📞","subscribe-newsletter":"You're subscribed. 🎉"}[e]}}async speak(){return await Rt(120),{providerReady:!1,message:"Demo voice provider is not connected."}}async transcribe(e,r,n,a){return await Rt(700),"How do I track a shipment?"}async extract(e,r,n){return await Rt(600),`[Attached file${n?`: ${n}`:""}] Invoice #4821 — 3 pallets, Rotterdam → Lagos, ETA 12 days.`}async identify(e,r){await Rt(50)}async endConversation(e){await Rt(50)}async sendFeedback(){await Rt(50)}async demoSlots(e,r){return await Rt(150),{taken:[[11,0],[15,0]].map(([a,i])=>{const o=new Date;return o.setHours(a,i,0,0),o.toISOString()}),busy:[]}}async searchGifs(e){await Rt(280);const r=e.trim().toLowerCase(),n=r?Xc.filter(i=>i.alt.includes(r)||i.tags.some(o=>o.includes(r)||r.includes(o))):Xc;return(n.length>0?n:Xc).map(i=>({id:i.id,url:Np(i.emoji,i.anim),preview:Np(i.emoji,i.anim),alt:i.alt}))}}const ss="<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>",ls="<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>",Np=(t,e)=>{const r=`<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128'><rect width='128' height='128' rx='14' fill='#eef1f4'/><text x='64' y='88' font-size='64' text-anchor='middle'>${t}${e}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`},Xc=[{id:"g1",emoji:"👍",alt:"thumbs up",tags:["thumbs","yes","ok","great","good"],anim:ss},{id:"g2",emoji:"🎉",alt:"celebrate",tags:["party","yay","congrats","celebrate"],anim:ls},{id:"g3",emoji:"👋",alt:"wave hello",tags:["hi","hello","hey","wave","bye"],anim:ls},{id:"g4",emoji:"❤️",alt:"heart",tags:["love","thanks","heart"],anim:ss},{id:"g5",emoji:"🤔",alt:"thinking",tags:["hmm","think","thinking"],anim:ls},{id:"g6",emoji:"😂",alt:"laughing",tags:["lol","funny","haha","laugh"],anim:ss},{id:"g7",emoji:"🔥",alt:"fire",tags:["fire","hot","lit","awesome"],anim:ss},{id:"g8",emoji:"🚀",alt:"rocket",tags:["rocket","launch","fast","go"],anim:ls}],Zc=t=>new Promise(e=>setTimeout(e,t));class Y1{constructor(e,r){Ht(this,"real");Ht(this,"strings");this.real=e,this.strings=r}bootstrap(){return this.real.bootstrap()}async history(){return{conversations:[]}}async stream(e,r,n){await Zc(300);for(const a of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(a),await Zc(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async typing(){}async action(){return await Zc(250),{ok:!0,note:this.strings.previewActionNote}}async speak(){return{providerReady:!1,message:"Preview voice provider is not connected."}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(e,r,n,a){return""}async extract(){return""}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}}var _a,$e,Kc,Bp,bi=0,zp=[],et=De,Fp=et.__b,Hp=et.__r,Vp=et.diffed,Gp=et.__c,Wp=et.unmount,$p=et.__;function cs(t,e){et.__h&&et.__h($e,t,bi||e),bi=0;var r=$e.__H||($e.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function W(t){return bi=1,q1(qp,t)}function q1(t,e,r){var n=cs(_a++,2);if(n.t=t,!n.__c&&(n.__=[qp(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=$e,!$e.__f)){var a=function(s,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return h.__c});if(u.every(function(h){return!h.__N}))return!i||i.call(this,s,l,c);var f=n.__c.props!==s;return u.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(f=!0)}}),i&&i.call(this,s,l,c)||f};$e.__f=!0;var i=$e.shouldComponentUpdate,o=$e.componentWillUpdate;$e.componentWillUpdate=function(s,l,c){if(this.__e){var u=i;i=void 0,a(s,l,c),i=u}o&&o.call(this,s,l,c)},$e.shouldComponentUpdate=a}return n.__N||n.__}function he(t,e){var r=cs(_a++,3);!et.__s&&Yp(r.__H,e)&&(r.__=t,r.u=e,$e.__H.__h.push(r))}function q(t){return bi=5,_r(function(){return{current:t}},[])}function _r(t,e){var r=cs(_a++,7);return Yp(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function re(t,e){return bi=8,_r(function(){return t},e)}function X1(t){var e=$e.context[t.__c],r=cs(_a++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub($e)),e.props.value):t.__}function Z1(){for(var t;t=zp.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(us),e.__h.some(jc),e.__h=[]}catch(r){e.__h=[],et.__e(r,t.__v)}}}et.__b=function(t){$e=null,Fp&&Fp(t)},et.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),$p&&$p(t,e)},et.__r=function(t){Hp&&Hp(t),_a=0;var e=($e=t.__c).__H;e&&(Kc===$e?(e.__h=[],$e.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(us),e.__h.some(jc),e.__h=[],_a=0)),Kc=$e},et.diffed=function(t){Vp&&Vp(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(zp.push(e)!==1&&Bp===et.requestAnimationFrame||((Bp=et.requestAnimationFrame)||K1)(Z1)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Kc=$e=null},et.__c=function(t,e){e.some(function(r){try{r.__h.some(us),r.__h=r.__h.filter(function(n){return!n.__||jc(n)})}catch(n){e.some(function(a){a.__h&&(a.__h=[])}),e=[],et.__e(n,r.__v)}}),Gp&&Gp(t,e)},et.unmount=function(t){Wp&&Wp(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{us(n)}catch(a){e=a}}),r.__H=void 0,e&&et.__e(e,r.__v))};var Up=typeof requestAnimationFrame=="function";function K1(t){var e,r=function(){clearTimeout(n),Up&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);Up&&(e=requestAnimationFrame(r))}function us(t){var e=$e,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),$e=e}function jc(t){var e=$e;t.__c=t.__(),$e=e}function Yp(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function qp(t,e){return typeof e=="function"?e(t):e}var Qc=function(t,e){return Qc=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},Qc(t,e)};function U(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");Qc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Jc=12,j1="sans-serif",An=Jc+"px "+j1,Q1=20,J1=100,ew="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function tw(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var n=String.fromCharCode(r+32),a=(t.charCodeAt(r)-Q1)/J1;e[n]=a}return e}var rw=tw(ew),ba={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var t,e;return function(r,n){if(!t){var a=ba.createCanvas();t=a&&a.getContext("2d")}if(t)return e!==n&&(e=t.font=n||An),t.measureText(r);r=r||"",n=n||An;var i=/((?:\d+)?\.?\d*)px/.exec(n),o=i&&+i[1]||Jc,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var c=rw[r[l]];s+=c==null?o:c*o}return{width:s}}})(),loadImage:function(t,e,r){var n=new Image;return n.onload=e,n.onerror=r,n.src=t,n}},Xp=xa(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),Zp=xa(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),xi=Object.prototype.toString,fs=Array.prototype,nw=fs.forEach,aw=fs.filter,eu=fs.slice,iw=fs.map,Kp=function(){}.constructor,hs=Kp?Kp.prototype:null,tu="__proto__",ow=2311;function jp(){return ow++}function ru(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function we(t){if(t==null||typeof t!="object")return t;var e=t,r=xi.call(t);if(r==="[object Array]"){if(!ki(t)){e=[];for(var n=0,a=t.length;n<a;n++)e[n]=we(t[n])}}else if(Zp[r]){if(!ki(t)){var i=t.constructor;if(i.from)e=i.from(t);else{e=new i(t.length);for(var n=0,a=t.length;n<a;n++)e[n]=t[n]}}}else if(!Xp[r]&&!ki(t)&&!wi(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==tu&&(e[o]=we(t[o]))}return e}function Me(t,e,r){if(!ce(e)||!ce(t))return r?we(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==tu){var a=t[n],i=e[n];ce(i)&&ce(a)&&!ne(i)&&!ne(a)&&!wi(i)&&!wi(a)&&!Qp(i)&&!Qp(a)&&!ki(i)&&!ki(a)?Me(a,i,r):(r||!(n in t))&&(t[n]=we(e[n]))}return t}function G(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==tu&&(t[r]=e[r]);return t}function Ie(t,e,r){for(var n=Ge(e),a=0,i=n.length;a<i;a++){var o=n[a];t[o]==null&&(t[o]=e[o])}return t}function Pe(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r}return-1}function sw(t,e){var r=t.prototype;function n(){}n.prototype=e.prototype,t.prototype=new n;for(var a in r)r.hasOwnProperty(a)&&(t.prototype[a]=r[a]);t.prototype.constructor=t,t.superClass=e}function br(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),a=0;a<n.length;a++){var i=n[a];i!=="constructor"&&t[i]==null&&(t[i]=e[i])}else Ie(t,e)}function xt(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function D(t,e,r){if(t&&e)if(t.forEach&&t.forEach===nw)t.forEach(e,r);else if(t.length===+t.length)for(var n=0,a=t.length;n<a;n++)e.call(r,t[n],n,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(r,t[i],i,t)}function fe(t,e,r){if(!t)return[];if(!e)return au(t);if(t.map&&t.map===iw)return t.map(e,r);for(var n=[],a=0,i=t.length;a<i;a++)n.push(e.call(r,t[a],a,t));return n}function xa(t,e,r,n){if(t&&e){for(var a=0,i=t.length;a<i;a++)r=e.call(n,r,t[a],a,t);return r}}function ot(t,e,r){if(!t)return[];if(!e)return au(t);if(t.filter&&t.filter===aw)return t.filter(e,r);for(var n=[],a=0,i=t.length;a<i;a++)e.call(r,t[a],a,t)&&n.push(t[a]);return n}function Ge(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function lw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return t.apply(e,r.concat(eu.call(arguments)))}}var Ae=hs&&ye(hs.bind)?hs.call.bind(hs.bind):lw;function Ke(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(eu.call(arguments)))}}function ne(t){return Array.isArray?Array.isArray(t):xi.call(t)==="[object Array]"}function ye(t){return typeof t=="function"}function oe(t){return typeof t=="string"}function nu(t){return xi.call(t)==="[object String]"}function He(t){return typeof t=="number"}function ce(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function Qp(t){return!!Xp[xi.call(t)]}function wt(t){return!!Zp[xi.call(t)]}function wi(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function ds(t){return t.colorStops!=null}function cw(t){return t.image!=null}function ps(t){return t!==t}function Si(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t.length;r<n;r++)if(t[r]!=null)return t[r]}function ke(t,e){return t??e}function vs(t,e,r){return t??e??r}function au(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return eu.apply(t,e)}function Jp(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function zr(t,e){if(!t)throw new Error(e)}function xr(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var ev="__ec_primitive__";function iu(t){t[ev]=!0}function ki(t){return t[ev]}var uw=(function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return Ge(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&e(r[n],n)},t})(),tv=typeof Map=="function";function fw(){return tv?new Map:new uw}var hw=(function(){function t(e){var r=ne(e);this.data=fw();var n=this;e instanceof t?e.each(a):e&&D(e,a);function a(i,o){r?n.set(i,o):n.set(o,i)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(n,a){e.call(r,n,a)})},t.prototype.keys=function(){var e=this.data.keys();return tv?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t})();function de(t){return new hw(t)}function dw(t,e){for(var r=new t.constructor(t.length+e.length),n=0;n<t.length;n++)r[n]=t[n];for(var a=t.length,n=0;n<e.length;n++)r[n+a]=e[n];return r}function gs(t,e){var r;if(Object.create)r=Object.create(t);else{var n=function(){};n.prototype=t,r=new n}return e&&G(r,e),r}function rv(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function Dn(t,e){return t.hasOwnProperty(e)}function mt(){}var pw=180/Math.PI,vw=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),gw=(function(){function t(){this.browser=new vw,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 t})(),ve=new gw;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(ve.wxa=!0,ve.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?ve.worker=!0:!ve.hasGlobalWindow||"Deno"in window?(ve.node=!0,ve.svgSupported=!0):mw(navigator.userAgent,ve);function mw(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),a=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),i=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),a&&(r.ie=!0,r.version=a[1]),i&&(r.edge=!0,r.version=i[1],r.newEdge=+i[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var yw=".",In="___EC__COMPONENT__CONTAINER___",nv="___EC__EXTENDED_CLASS___";function wr(t){var e={main:"",sub:""};if(t){var r=t.split(yw);e.main=r[0]||"",e.sub=r[1]||""}return e}function _w(t){zr(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function bw(t){return!!(t&&t[nv])}function ou(t,e){t.$constructor=t,t.extend=function(r){var n=this,a;return xw(n)?a=(function(i){U(o,i);function o(){return i.apply(this,arguments)||this}return o})(n):(a=function(){(r.$constructor||n).apply(this,arguments)},sw(a,this)),G(a.prototype,r),a[nv]=!0,a.extend=this.extend,a.superCall=kw,a.superApply=Tw,a.superClass=n,a}}function xw(t){return ye(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function av(t,e){t.extend=e.extend}var ww=Math.round(Math.random()*10);function Sw(t){var e=["__\0is_clz",ww++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function kw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.superClass.prototype[e].apply(t,r)}function Tw(t,e,r){return this.superClass.prototype[e].apply(t,r)}function ms(t){var e={};t.registerClass=function(n){var a=n.type||n.prototype.type;if(a){_w(a),n.prototype.type=a;var i=wr(a);if(!i.sub)e[i.main]=n;else if(i.sub!==In){var o=r(i);o[i.sub]=n}}return n},t.getClass=function(n,a,i){var o=e[n];if(o&&o[In]&&(o=a?o[a]:null),i&&!o)throw new Error(a?"Component "+n+"."+(a||"")+" is used but not imported.":n+".type should be specified.");return o},t.getClassesByMainType=function(n){var a=wr(n),i=[],o=e[a.main];return o&&o[In]?D(o,function(s,l){l!==In&&i.push(s)}):i.push(o),i},t.hasClass=function(n){var a=wr(n);return!!e[a.main]},t.getAllClassMainTypes=function(){var n=[];return D(e,function(a,i){n.push(i)}),n},t.hasSubTypes=function(n){var a=wr(n),i=e[a.main];return i&&i[In]};function r(n){var a=e[n.main];return(!a||!a[In])&&(a=e[n.main]={},a[In]=!0),a}}function Ti(t,e){for(var r=0;r<t.length;r++)t[r][1]||(t[r][1]=t[r][0]);return e=e||!1,function(n,a,i){for(var o={},s=0;s<t.length;s++){var l=t[s][1];if(!(a&&Pe(a,l)>=0||i&&Pe(i,l)<0)){var c=n.getShallow(l,e);c!=null&&(o[t[s][0]]=c)}}return o}}var Cw=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Mw=Ti(Cw),Aw=(function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return Mw(this,e,r)},t})(),iv=(function(){function t(e){this.value=e}return t})(),Dw=(function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new iv(e);return this.insertEntry(r),r},t.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++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t})(),Ci=(function(){function t(e){this._list=new Dw,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,a=this._map,i=null;if(a[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete a[l.key],i=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new iv(r),s.key=e,n.insertEntry(s),a[e]=s}return i},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t})(),su=new Ci(50);function Iw(t){if(typeof t=="string"){var e=su.get(t);return e&&e.image}else return t}function ov(t,e,r,n,a){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var i=su.get(t),o={hostEl:r,cb:n,cbPayload:a};return i?(e=i.image,!ys(e)&&i.pending.push(o)):(e=ba.loadImage(t,sv,sv),e.__zrImageSrc=t,su.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function sv(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function ys(t){return t&&t.width&&t.height}function wa(){return[1,0,0,1,0,0]}function lu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Pw(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Sa(t,e,r){var n=e[0]*r[0]+e[2]*r[1],a=e[1]*r[0]+e[3]*r[1],i=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t}function cu(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function uu(t,e,r,n){n===void 0&&(n=[0,0]);var a=e[0],i=e[2],o=e[4],s=e[1],l=e[3],c=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=a*f+s*u,t[1]=-a*u+s*f,t[2]=i*f+l*u,t[3]=-i*u+f*l,t[4]=f*(o-n[0])+u*(c-n[1])+n[0],t[5]=f*(c-n[1])-u*(o-n[0])+n[1],t}function Lw(t,e,r){var n=r[0],a=r[1];return t[0]=e[0]*n,t[1]=e[1]*a,t[2]=e[2]*n,t[3]=e[3]*a,t[4]=e[4]*n,t[5]=e[5]*a,t}function fu(t,e){var r=e[0],n=e[2],a=e[4],i=e[1],o=e[3],s=e[5],l=r*o-i*n;return l?(l=1/l,t[0]=o*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*a)*l,t[5]=(i*a-r*s)*l,t):null}var Be=(function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,a){e.x=r.x+n.x*a,e.y=r.y+n.y*a},t.lerp=function(e,r,n,a){var i=1-a;e.x=i*r.x+a*n.x,e.y=i*r.y+a*n.y},t})(),_s=Math.min,bs=Math.max,Pn=new Be,Ln=new Be,Rn=new Be,En=new Be,Mi=new Be,Ai=new Be,Le=(function(){function t(e,r,n,a){n<0&&(e=e+n,n=-n),a<0&&(r=r+a,a=-a),this.x=e,this.y=r,this.width=n,this.height=a}return t.prototype.union=function(e){var r=_s(e.x,this.x),n=_s(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=bs(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=bs(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,n=e.width/r.width,a=e.height/r.height,i=wa();return cu(i,i,[-r.x,-r.y]),Lw(i,i,[n,a]),cu(i,i,[e.x,e.y]),i},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var n=this,a=n.x,i=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,c=e.x+e.width,u=e.y,f=e.y+e.height,h=!(i<l||c<a||s<u||f<o);if(r){var d=1/0,p=0,m=Math.abs(i-l),v=Math.abs(c-a),g=Math.abs(s-u),y=Math.abs(f-o),b=Math.min(m,v),x=Math.min(g,y);i<l||c<a?b>p&&(p=b,m<v?Be.set(Ai,-m,0):Be.set(Ai,v,0)):b<d&&(d=b,m<v?Be.set(Mi,m,0):Be.set(Mi,-v,0)),s<u||f<o?x>p&&(p=x,g<y?Be.set(Ai,0,-g):Be.set(Ai,0,y)):b<d&&(d=b,g<y?Be.set(Mi,0,g):Be.set(Mi,0,-y))}return r&&Be.copy(r,h?Mi:Ai),h},t.prototype.contain=function(e,r){var n=this;return e>=n.x&&e<=n.x+n.width&&r>=n.y&&r<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,n){if(!n){e!==r&&t.copy(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var a=n[0],i=n[3],o=n[4],s=n[5];e.x=r.x*a+o,e.y=r.y*i+s,e.width=r.width*a,e.height=r.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}Pn.x=Rn.x=r.x,Pn.y=En.y=r.y,Ln.x=En.x=r.x+r.width,Ln.y=Rn.y=r.y+r.height,Pn.transform(n),En.transform(n),Ln.transform(n),Rn.transform(n),e.x=_s(Pn.x,Ln.x,Rn.x,En.x),e.y=_s(Pn.y,Ln.y,Rn.y,En.y);var l=bs(Pn.x,Ln.x,Rn.x,En.x),c=bs(Pn.y,Ln.y,Rn.y,En.y);e.width=l-e.x,e.height=c-e.y},t})(),lv={};function Et(t,e){e=e||An;var r=lv[e];r||(r=lv[e]=new Ci(500));var n=r.get(t);return n==null&&(n=ba.measureText(t,e).width,r.put(t,n)),n}function cv(t,e,r,n){var a=Et(t,e),i=du(e),o=Di(0,a,r),s=ka(0,i,n),l=new Le(o,s,a,i);return l}function hu(t,e,r,n){var a=((t||"")+"").split(`
|
|
6
|
-
`),i=a.length;if(i===1)return
|
|
7
|
-
`);i=
|
|
8
|
-
`),t.isTruncated=s}function
|
|
9
|
-
`):[];var d=h.length*s,p=
|
|
10
|
-
`),c=!0),n.accumWidth=p}else{var m=
|
|
11
|
-
`);for(var
|
|
12
|
-
`){l&&(s+=l,u+=c),i.push(s),o.push(u),s="",l="",c=0,u=0;continue}var d=Et(h,e),p=n?!1:!Vw(h);if(i.length?u+d>r:a+u+d>r){u?(s||l)&&(p?(s||(s=l,l="",c=0,u=c),i.push(s),o.push(u-c),l+=h,c+=d,s="",u=c):(l&&(s+=l,l="",c=0),i.push(s),o.push(u),s=h,u=d)):p?(i.push(l),o.push(c),l=h,c=d):(i.push(h),o.push(d));continue}u+=d,p?(l+=h,c+=d):(l&&(s+=l,l="",c=0),s+=h)}return!i.length&&!s&&(s=t,l="",c=0),l&&(s+=l),s&&(i.push(s),o.push(u)),i.length===1&&(u+=a),{accumWidth:u,lines:i,linesWidths:o}}function Ta(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function Gw(t){return[t[0],t[1]]}function pv(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function Ww(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function $w(t){return Math.sqrt(Uw(t))}function Uw(t){return t[0]*t[0]+t[1]*t[1]}function gu(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function Yw(t,e){var r=$w(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function mu(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var qw=mu;function Xw(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Ca=Xw;function Gt(t,e,r){var n=e[0],a=e[1];return t[0]=r[0]*n+r[2]*a+r[4],t[1]=r[1]*n+r[3]*a+r[5],t}function Ma(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Aa(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var vv=lu,gv=5e-5;function On(t){return t>gv||t<-gv}var Nn=[],Da=[],yu=wa(),_u=Math.abs,bu=(function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return On(this.rotation)||On(this.x)||On(this.y)||On(this.scaleX-1)||On(this.scaleY-1)||On(this.skewX)||On(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(vv(n),this.invTransform=null);return}n=n||wa(),r?this.getLocalTransform(n):vv(n),e&&(r?Sa(n,e,n):Pw(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Nn);var n=Nn[0]<0?-1:1,a=Nn[1]<0?-1:1,i=((Nn[0]-n)*r+n)/Nn[0]||0,o=((Nn[1]-a)*r+a)/Nn[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||wa(),fu(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],a=Math.atan2(e[1],e[0]),i=Math.PI/2+a-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),r=Math.sqrt(r),this.skewX=i,this.skewY=0,this.rotation=-a,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||wa(),Sa(Da,e.invTransform,r),r=Da);var n=this.originX,a=this.originY;(n||a)&&(yu[4]=n,yu[5]=a,Sa(Da,r,yu),Da[4]-=n,Da[5]-=a,r=Da),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],a=this.invTransform;return a&&Gt(n,n,a),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],a=this.transform;return a&&Gt(n,n,a),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&_u(e[0]-1)>1e-10&&_u(e[3]-1)>1e-10?Math.sqrt(_u(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){Zw(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,a=e.originY||0,i=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,c=e.rotation||0,u=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||a||s||l){var p=n+s,m=a+l;r[4]=-p*i-h*m*o,r[5]=-m*o-d*p*i}else r[4]=r[5]=0;return r[0]=i,r[3]=o,r[1]=d*i,r[2]=h*o,c&&uu(r,r,c),r[4]+=n+u,r[5]+=a+f,r},t.initDefaultProps=(function(){var e=t.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})(),t})(),Ii=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Zw(t,e){for(var r=0;r<Ii.length;r++){var n=Ii[r];t[n]=e[n]}}var Pi={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Pi.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?Pi.bounceIn(t*2)*.5:Pi.bounceOut(t*2-1)*.5+.5}},ws=Math.pow,nn=Math.sqrt,Ss=1e-8,mv=1e-4,yv=nn(3),ks=1/3,Sr=Ta(),Wt=Ta(),Ia=Ta();function an(t){return t>-Ss&&t<Ss}function _v(t){return t>Ss||t<-Ss}function lt(t,e,r,n,a){var i=1-a;return i*i*(i*t+3*a*e)+a*a*(a*n+3*i*r)}function bv(t,e,r,n,a){var i=1-a;return 3*(((e-t)*i+2*(r-e)*a)*i+(n-r)*a*a)}function Ts(t,e,r,n,a,i){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),c=t-a,u=s*s-3*o*l,f=s*l-9*o*c,h=l*l-3*s*c,d=0;if(an(u)&&an(f))if(an(s))i[0]=0;else{var p=-l/s;p>=0&&p<=1&&(i[d++]=p)}else{var m=f*f-4*u*h;if(an(m)){var v=f/u,p=-s/o+v,g=-v/2;p>=0&&p<=1&&(i[d++]=p),g>=0&&g<=1&&(i[d++]=g)}else if(m>0){var y=nn(m),b=u*s+1.5*o*(-f+y),x=u*s+1.5*o*(-f-y);b<0?b=-ws(-b,ks):b=ws(b,ks),x<0?x=-ws(-x,ks):x=ws(x,ks);var p=(-s-(b+x))/(3*o);p>=0&&p<=1&&(i[d++]=p)}else{var S=(2*u*s-3*o*f)/(2*nn(u*u*u)),w=Math.acos(S)/3,k=nn(u),T=Math.cos(w),p=(-s-2*k*T)/(3*o),g=(-s+k*(T+yv*Math.sin(w)))/(3*o),M=(-s+k*(T-yv*Math.sin(w)))/(3*o);p>=0&&p<=1&&(i[d++]=p),g>=0&&g<=1&&(i[d++]=g),M>=0&&M<=1&&(i[d++]=M)}}return d}function xv(t,e,r,n,a){var i=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(an(o)){if(_v(i)){var c=-s/i;c>=0&&c<=1&&(a[l++]=c)}}else{var u=i*i-4*o*s;if(an(u))a[0]=-i/(2*o);else if(u>0){var f=nn(u),c=(-i+f)/(2*o),h=(-i-f)/(2*o);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Cs(t,e,r,n,a,i){var o=(e-t)*a+t,s=(r-e)*a+e,l=(n-r)*a+r,c=(s-o)*a+o,u=(l-s)*a+s,f=(u-c)*a+c;i[0]=t,i[1]=o,i[2]=c,i[3]=f,i[4]=f,i[5]=u,i[6]=l,i[7]=n}function Kw(t,e,r,n,a,i,o,s,l,c,u){var f,h=.005,d=1/0,p,m,v,g;Sr[0]=l,Sr[1]=c;for(var y=0;y<1;y+=.05)Wt[0]=lt(t,r,a,o,y),Wt[1]=lt(e,n,i,s,y),v=Ca(Sr,Wt),v<d&&(f=y,d=v);d=1/0;for(var b=0;b<32&&!(h<mv);b++)p=f-h,m=f+h,Wt[0]=lt(t,r,a,o,p),Wt[1]=lt(e,n,i,s,p),v=Ca(Wt,Sr),p>=0&&v<d?(f=p,d=v):(Ia[0]=lt(t,r,a,o,m),Ia[1]=lt(e,n,i,s,m),g=Ca(Ia,Sr),m<=1&&g<d?(f=m,d=g):h*=.5);return nn(d)}function jw(t,e,r,n,a,i,o,s,l){for(var c=t,u=e,f=0,h=1/l,d=1;d<=l;d++){var p=d*h,m=lt(t,r,a,o,p),v=lt(e,n,i,s,p),g=m-c,y=v-u;f+=Math.sqrt(g*g+y*y),c=m,u=v}return f}function St(t,e,r,n){var a=1-n;return a*(a*t+2*n*e)+n*n*r}function wv(t,e,r,n){return 2*((1-n)*(e-t)+n*(r-e))}function Qw(t,e,r,n,a){var i=t-2*e+r,o=2*(e-t),s=t-n,l=0;if(an(i)){if(_v(o)){var c=-s/o;c>=0&&c<=1&&(a[l++]=c)}}else{var u=o*o-4*i*s;if(an(u)){var c=-o/(2*i);c>=0&&c<=1&&(a[l++]=c)}else if(u>0){var f=nn(u),c=(-o+f)/(2*i),h=(-o-f)/(2*i);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Sv(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function Ms(t,e,r,n,a){var i=(e-t)*n+t,o=(r-e)*n+e,s=(o-i)*n+i;a[0]=t,a[1]=i,a[2]=s,a[3]=s,a[4]=o,a[5]=r}function Jw(t,e,r,n,a,i,o,s,l){var c,u=.005,f=1/0;Sr[0]=o,Sr[1]=s;for(var h=0;h<1;h+=.05){Wt[0]=St(t,r,a,h),Wt[1]=St(e,n,i,h);var d=Ca(Sr,Wt);d<f&&(c=h,f=d)}f=1/0;for(var p=0;p<32&&!(u<mv);p++){var m=c-u,v=c+u;Wt[0]=St(t,r,a,m),Wt[1]=St(e,n,i,m);var d=Ca(Wt,Sr);if(m>=0&&d<f)c=m,f=d;else{Ia[0]=St(t,r,a,v),Ia[1]=St(e,n,i,v);var g=Ca(Ia,Sr);v<=1&&g<f?(c=v,f=g):u*=.5}}return nn(f)}function eS(t,e,r,n,a,i,o){for(var s=t,l=e,c=0,u=1/o,f=1;f<=o;f++){var h=f*u,d=St(t,r,a,h),p=St(e,n,i,h),m=d-s,v=p-l;c+=Math.sqrt(m*m+v*v),s=d,l=p}return c}var tS=/cubic-bezier\(([0-9,\.e ]+)\)/;function kv(t){var e=t&&tS.exec(t);if(e){var r=e[1].split(","),n=+xr(r[0]),a=+xr(r[1]),i=+xr(r[2]),o=+xr(r[3]);if(isNaN(n+a+i+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Ts(0,n,i,1,l,s)&<(0,a,o,1,s[0])}}}var rS=(function(){function t(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||mt,this.ondestroy=e.ondestroy||mt,this.onrestart=e.onrestart||mt,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,a=e-this._startTime-this._pausedTime,i=a/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,s=o?o(i):i;if(this.onframe(s),i===1)if(this.loop){var l=a%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ye(e)?e:Pi[e]||kv(e)},t})(),Tv={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 on(t){return t=Math.round(t),t<0?0:t>255?255:t}function xu(t){return t<0?0:t>1?1:t}function wu(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?on(parseFloat(e)/100*255):on(parseInt(e,10))}function Li(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?xu(parseFloat(e)/100):xu(parseFloat(e))}function Su(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(.6666666666666666-r)*6:t}function As(t,e,r){return t+(e-t)*r}function $t(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}function ku(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Cv=new Ci(20),Ds=null;function Pa(t,e){Ds&&ku(Ds,e),Ds=Cv.put(t,Ds||e.slice())}function Fr(t,e){if(t){e=e||[];var r=Cv.get(t);if(r)return ku(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in Tv)return ku(e,Tv[n]),Pa(t,e),e;var a=n.length;if(n.charAt(0)==="#"){if(a===4||a===5){var i=parseInt(n.slice(1,4),16);if(!(i>=0&&i<=4095)){$t(e,0,0,0,1);return}return $t(e,(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,a===5?parseInt(n.slice(4),16)/15:1),Pa(t,e),e}else if(a===7||a===9){var i=parseInt(n.slice(1,7),16);if(!(i>=0&&i<=16777215)){$t(e,0,0,0,1);return}return $t(e,(i&16711680)>>16,(i&65280)>>8,i&255,a===9?parseInt(n.slice(7),16)/255:1),Pa(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===a){var l=n.substr(0,o),c=n.substr(o+1,s-(o+1)).split(","),u=1;switch(l){case"rgba":if(c.length!==4)return c.length===3?$t(e,+c[0],+c[1],+c[2],1):$t(e,0,0,0,1);u=Li(c.pop());case"rgb":if(c.length>=3)return $t(e,wu(c[0]),wu(c[1]),wu(c[2]),c.length===3?u:Li(c[3])),Pa(t,e),e;$t(e,0,0,0,1);return;case"hsla":if(c.length!==4){$t(e,0,0,0,1);return}return c[3]=Li(c[3]),Mv(c,e),Pa(t,e),e;case"hsl":if(c.length!==3){$t(e,0,0,0,1);return}return Mv(c,e),Pa(t,e),e;default:return}}$t(e,0,0,0,1)}}function Mv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=Li(t[1]),a=Li(t[2]),i=a<=.5?a*(n+1):a+n-a*n,o=a*2-i;return e=e||[],$t(e,on(Su(o,i,r+.3333333333333333)*255),on(Su(o,i,r)*255),on(Su(o,i,r-.3333333333333333)*255),1),t.length===4&&(e[3]=t[3]),e}function Av(t,e){var r=Fr(t);if(r){for(var n=0;n<3;n++)r[n]=r[n]*(1-e)|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Is(r,r.length===4?"rgba":"rgb")}}function nS(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),a=Math.floor(n),i=Math.ceil(n),o=Fr(e[a]),s=Fr(e[i]),l=n-a,c=Is([on(As(o[0],s[0],l)),on(As(o[1],s[1],l)),on(As(o[2],s[2],l)),xu(As(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:a,rightIndex:i,value:n}:c}}function Is(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function Ps(t,e){var r=Fr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Dv=new Ci(100);function Iv(t){if(oe(t)){var e=Dv.get(t);return e||(e=Av(t,-.1),Dv.put(t,e)),e}else if(ds(t)){var r=G({},t);return r.colorStops=fe(t.colorStops,function(n){return{offset:n.offset,color:Av(n.color,-.1)}}),r}return t}function aS(t){return t.type==="linear"}function iS(t){return t.type==="radial"}(function(){return ve.hasGlobalWindow&&ye(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:typeof Buffer<"u"?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}})();var Tu=Array.prototype.slice;function Hr(t,e,r){return(e-t)*r+t}function Cu(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=Hr(e[i],r[i],n);return t}function oS(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=Hr(e[o][s],r[o][s],n)}return t}function Ls(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=e[i]+r[i]*n;return t}function Pv(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=e[o][s]+r[o][s]*n}return t}function sS(t,e){for(var r=t.length,n=e.length,a=r>n?e:t,i=Math.min(r,n),o=a[i-1]||{color:[0,0,0,0],offset:0},s=i;s<Math.max(r,n);s++)a.push({offset:o.offset,color:o.color.slice()})}function lS(t,e,r){var n=t,a=e;if(!(!n.push||!a.push)){var i=n.length,o=a.length;if(i!==o){var s=i>o;if(s)n.length=o;else for(var l=i;l<o;l++)n.push(r===1?a[l]:Tu.call(a[l]))}for(var c=n[0]&&n[0].length,l=0;l<n.length;l++)if(r===1)isNaN(n[l])&&(n[l]=a[l]);else for(var u=0;u<c;u++)isNaN(n[l][u])&&(n[l][u]=a[l][u])}}function Rs(t){if(xt(t)){var e=t.length;if(xt(t[0])){for(var r=[],n=0;n<e;n++)r.push(Tu.call(t[n]));return r}return Tu.call(t)}return t}function Es(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=t[3]==null?1:t[3],"rgba("+t.join(",")+")"}function cS(t){return xt(t&&t[0])?2:1}var Os=0,Ns=1,Lv=2,Ri=3,Mu=4,Au=5,Rv=6;function Ev(t){return t===Mu||t===Au}function Bs(t){return t===Ns||t===Lv}var Ei=[0,0,0,0],uS=(function(){function t(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,n){this._needsSort=!0;var a=this.keyframes,i=a.length,o=!1,s=Rv,l=r;if(xt(r)){var c=cS(r);s=c,(c===1&&!He(r[0])||c===2&&!He(r[0][0]))&&(o=!0)}else if(He(r)&&!ps(r))s=Os;else if(oe(r))if(!isNaN(+r))s=Os;else{var u=Fr(r);u&&(l=u,s=Ri)}else if(ds(r)){var f=G({},l);f.colorStops=fe(r.colorStops,function(d){return{offset:d.offset,color:Fr(d.color)}}),aS(r)?s=Mu:iS(r)&&(s=Au),l=f}i===0?this.valType=s:(s!==this.valType||s===Rv)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=ye(n)?n:Pi[n]||kv(n)),a.push(h),h},t.prototype.prepare=function(e,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,v){return m.time-v.time});for(var a=this.valType,i=n.length,o=n[i-1],s=this.discrete,l=Bs(a),c=Ev(a),u=0;u<i;u++){var f=n[u],h=f.value,d=o.value;f.percent=f.time/e,s||(l&&u!==i-1?lS(h,d,a):c&&sS(h.colorStops,d.colorStops))}if(!s&&a!==Au&&r&&this.needsAnimate()&&r.needsAnimate()&&a===r.valType&&!r._finished){this._additiveTrack=r;for(var p=n[0].value,u=0;u<i;u++)a===Os?n[u].additiveValue=n[u].value-p:a===Ri?n[u].additiveValue=Ls([],n[u].value,p,-1):Bs(a)&&(n[u].additiveValue=a===Ns?Ls([],n[u].value,p,-1):Pv([],n[u].value,p,-1))}},t.prototype.step=function(e,r){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,a=n?"additiveValue":"value",i=this.valType,o=this.keyframes,s=o.length,l=this.propName,c=i===Ri,u,f=this._lastFr,h=Math.min,d,p;if(s===1)d=p=o[0];else{if(r<0)u=0;else if(r<this._lastFrP){var m=h(f+1,s-1);for(u=m;u>=0&&!(o[u].percent<=r);u--);u=h(u,s-2)}else{for(u=f;u<s&&!(o[u].percent>r);u++);u=h(u-1,s-2)}p=o[u+1],d=o[u]}if(d&&p){this._lastFr=u,this._lastFrP=r;var v=p.percent-d.percent,g=v===0?1:h((r-d.percent)/v,1);p.easingFunc&&(g=p.easingFunc(g));var y=n?this._additiveValue:c?Ei:e[l];if((Bs(i)||c)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=g<1?d.rawValue:p.rawValue;else if(Bs(i))i===Ns?Cu(y,d[a],p[a],g):oS(y,d[a],p[a],g);else if(Ev(i)){var b=d[a],x=p[a],S=i===Mu;e[l]={type:S?"linear":"radial",x:Hr(b.x,x.x,g),y:Hr(b.y,x.y,g),colorStops:fe(b.colorStops,function(k,T){var M=x.colorStops[T];return{offset:Hr(k.offset,M.offset,g),color:Es(Cu([],k.color,M.color,g))}}),global:x.global},S?(e[l].x2=Hr(b.x2,x.x2,g),e[l].y2=Hr(b.y2,x.y2,g)):e[l].r=Hr(b.r,x.r,g)}else if(c)Cu(y,d[a],p[a],g),n||(e[l]=Es(y));else{var w=Hr(d[a],p[a],g);n?this._additiveValue=w:e[l]=w}n&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,n=this.propName,a=this._additiveValue;r===Os?e[n]=e[n]+a:r===Ri?(Fr(e[n],Ei),Ls(Ei,Ei,a,1),e[n]=Es(Ei)):r===Ns?Ls(e[n],e[n],a,1):r===Lv&&Pv(e[n],e[n],a,1)},t})(),Du=(function(){function t(e,r,n,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&a){ru("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=n}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,n){return this.whenWithKeys(e,r,Ge(r),n)},t.prototype.whenWithKeys=function(e,r,n,a){for(var i=this._tracks,o=0;o<n.length;o++){var s=n[o],l=i[s];if(!l){l=i[s]=new uS(s);var c=void 0,u=this._getAdditiveTrack(s);if(u){var f=u.keyframes,h=f[f.length-1];c=h&&h.value,u.valType===Ri&&c&&(c=Es(c))}else c=this._target[s];if(c==null)continue;e>0&&l.addKeyframe(0,Rs(c),a),this._trackKeys.push(s)}l.addKeyframe(e,Rs(r[s]),a)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,n=0;n<r;n++)e[n].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,r=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,r)for(var n=0;n<r.length;n++)r[n].call(this)},t.prototype._setTracksFinished=function(){for(var e=this._tracks,r=this._trackKeys,n=0;n<r.length;n++)e[r[n]].setFinished()},t.prototype._getAdditiveTrack=function(e){var r,n=this._additiveAnimators;if(n)for(var a=0;a<n.length;a++){var i=n[a].getTrack(e);i&&(r=i)}return r},t.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var r=this,n=[],a=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],s=this._tracks[o],l=this._getAdditiveTrack(o),c=s.keyframes,u=c.length;if(s.prepare(a,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var f=c[u-1];f&&(r._target[s.propName]=f.rawValue),s.setFinished()}else n.push(s)}if(n.length||this._force){var h=new rS({life:a,loop:this._loop,delay:this._delay||0,onframe:function(d){r._started=2;var p=r._additiveAnimators;if(p){for(var m=!1,v=0;v<p.length;v++)if(p[v]._clip){m=!0;break}m||(r._additiveAnimators=null)}for(var v=0;v<n.length;v++)n[v].step(r._target,d);var g=r._onframeCbs;if(g)for(var v=0;v<g.length;v++)g[v](r._target,d)},ondestroy:function(){r._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},t.prototype.stop=function(e){if(this._clip){var r=this._clip;e&&r.onframe(1),this._abortedCallback()}},t.prototype.delay=function(e){return this._delay=e,this},t.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},t.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},t.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(e){return this._tracks[e]},t.prototype.getTracks=function(){var e=this;return fe(this._trackKeys,function(r){return e._tracks[r]})},t.prototype.stopTracks=function(e,r){if(!e.length||!this._clip)return!0;for(var n=this._tracks,a=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(r?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,i=0;i<a.length;i++)if(!n[a[i]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(e,r,n){if(e){r=r||this._trackKeys;for(var a=0;a<r.length;a++){var i=r[a],o=this._tracks[i];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[n?0:s.length-1];l&&(e[i]=Rs(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||Ge(e);for(var n=0;n<r.length;n++){var a=r[n],i=this._tracks[a];if(i){var o=i.keyframes;if(o.length>1){var s=o.pop();i.addKeyframe(s.time,e[a]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},t})(),rr=(function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,n,a){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof r=="function"&&(a=n,n=r,r=null),!n||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),i[e]||(i[e]=[]);for(var s=0;s<i[e].length;s++)if(i[e][s].h===n)return this;var l={h:n,query:r,ctx:a||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,u=i[e][c];return u&&u.callAtLast?i[e].splice(c,0,l):i[e].push(l),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(r){if(n[e]){for(var a=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==r&&a.push(n[e][i]);n[e]=a}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},t.prototype.trigger=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=a.length,l=0;l<s;l++){var c=a[l];if(!(i&&i.filter&&c.query!=null&&!i.filter(e,c.query)))switch(o){case 0:c.h.call(c.ctx);break;case 1:c.h.call(c.ctx,r[0]);break;case 2:c.h.call(c.ctx,r[0],r[1]);break;default:c.h.apply(c.ctx,r);break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=r[o-1],l=a.length,c=0;c<l;c++){var u=a[c];if(!(i&&i.filter&&u.query!=null&&!i.filter(e,u.query)))switch(o){case 0:u.h.call(s);break;case 1:u.h.call(s,r[0]);break;case 2:u.h.call(s,r[0],r[1]);break;default:u.h.apply(s,r.slice(1,o-1));break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t})(),Ov=1;ve.hasGlobalWindow&&(Ov=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var zs=Ov,Iu=.4,Pu="#333",Lu="#ccc",fS="#eee",Ot=1,Oi=2,La=4,Ru="__zr_normal__",Eu=Ii.concat(["ignore"]),hS=xa(Ii,function(t,e){return t[e]=!0,t},{ignore:!1}),Ra={},dS=new Le(0,0,0,0),Fs=(function(){function t(e){this.id=jp(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=e,a[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,a=n.local,i=r.innerTransformable,o=void 0,s=void 0,l=!1;i.parent=a?this:null;var c=!1;if(i.copyTransform(r),n.position!=null){var u=dS;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Ra,n,u):xs(Ra,n,u),i.x=Ra.x,i.y=Ra.y,o=Ra.align,s=Ra.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var h=void 0,d=void 0;f==="center"?(h=u.width*.5,d=u.height*.5):(h=rn(f[0],u.width),d=rn(f[1],u.height)),c=!0,i.originX=-i.x+h+(a?0:u.x),i.originY=-i.y+d+(a?0:u.y)}}n.rotation!=null&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],c||(i.originX=-p[0],i.originY=-p[1]));var m=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,v=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),g=void 0,y=void 0,b=void 0;m&&this.canBeInsideText()?(g=n.insideFill,y=n.insideStroke,(g==null||g==="auto")&&(g=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(g),b=!0)):(g=n.outsideFill,y=n.outsideStroke,(g==null||g==="auto")&&(g=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(g),b=!0)),g=g||"#000",(g!==v.fill||y!==v.stroke||b!==v.autoStroke||o!==v.align||s!==v.verticalAlign)&&(l=!0,v.fill=g,v.stroke=y,v.autoStroke=b,v.align=o,v.verticalAlign=s,r.setDefaultTextStyle(v)),r.__dirty|=Ot,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Lu:Pu},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Fr(r);n||(n=[255,255,255,1]);for(var a=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*a+(i?0:255)*(1-a);return n[3]=1,Is(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},G(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(ce(e))for(var n=e,a=Ge(n),i=0;i<a.length;i++){var o=a[i];this.attrKV(o,e[o])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var r=this._normalState,n=0;n<this.animators.length;n++){var a=this.animators[n],i=a.__fromStateTransition;if(!(a.getLoop()||i&&i!==Ru)){var o=a.targetName,s=o?r[o]:r;a.saveTo(s)}}},t.prototype._innerSaveToNormal=function(e){var r=this._normalState;r||(r=this._normalState={}),e.textConfig&&!r.textConfig&&(r.textConfig=this.textConfig),this._savePrimaryToNormal(e,r,Eu)},t.prototype._savePrimaryToNormal=function(e,r,n){for(var a=0;a<n.length;a++){var i=n[a];e[i]!=null&&!(i in r)&&(r[i]=this[i])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(Ru,!1,e)},t.prototype.useState=function(e,r,n,a){var i=e===Ru,o=this.hasState();if(!(!o&&i)){var s=this.currentStates,l=this.stateTransition;if(!(Pe(s,e)>=0&&(r||s.length===1))){var c;if(this.stateProxy&&!i&&(c=this.stateProxy(e)),c||(c=this.states&&this.states[e]),!c&&!i){ru("State "+e+" not exists.");return}i||this.saveCurrentToNormalState(c);var u=!!(c&&c.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,c,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,r,n,u),h&&h.useState(e,r,n,u),i?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Ot),c}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var a=[],i=this.currentStates,o=e.length,s=o===i.length;if(s){for(var l=0;l<o;l++)if(e[l]!==i[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var c=e[l],u=void 0;this.stateProxy&&(u=this.stateProxy(c,e)),u||(u=this.states[c]),u&&a.push(u)}var f=a[o-1],h=!!(f&&f.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(a),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!r&&!this.__inHover&&p&&p.duration>0,p);var m=this._textContent,v=this._textGuide;m&&m.useStates(e,r,h),v&&v.useStates(e,r,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Ot)}},t.prototype.isSilent=function(){for(var e=this.silent,r=this.parent;!e&&r;){if(r.silent){e=!0;break}r=r.parent}return e},t.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var r=this.animators[e];r.targetName&&r.changeTarget(this[r.targetName])}},t.prototype.removeState=function(e){var r=Pe(this.currentStates,e);if(r>=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var a=this.currentStates.slice(),i=Pe(a,e),o=Pe(a,r)>=0;i>=0?o?a.splice(i,1):a[i]=r:n&&!o&&a.push(r),this.useStates(a)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,a=0;a<e.length;a++){var i=e[a];G(r,i),i.textConfig&&(n=n||{},G(n,i.textConfig))}return n&&(r.textConfig=n),r},t.prototype._applyStateObj=function(e,r,n,a,i,o){var s=!(r&&a);r&&r.textConfig?(this.textConfig=G({},a?this.textConfig:n.textConfig),G(this.textConfig,r.textConfig)):s&&n.textConfig&&(this.textConfig=n.textConfig);for(var l={},c=!1,u=0;u<Eu.length;u++){var f=Eu[u],h=i&&hS[f];r&&r[f]!=null?h?(c=!0,l[f]=r[f]):this[f]=r[f]:s&&n[f]!=null&&(h?(c=!0,l[f]=n[f]):this[f]=n[f])}if(!i)for(var u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(r||n)[p]:r||n)}c&&this._transitionState(e,l,o)},t.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var r=this.__zr;r&&e.addSelfToZr(r),e.__zr=r,e.__hostTarget=this}},t.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},t.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(e){var r=this._textContent;r!==e&&(r&&r!==e&&this.removeTextContent(),e.innerTransformable=new bu,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),G(this.textConfig,e),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=Ot;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var r=this._textContent,n=this._textGuide;r&&(r.__inHover=e),n&&(n.__inHover=e)},t.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.addAnimator(r[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.removeAnimator(r[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},t.prototype.animate=function(e,r,n){var a=e?this[e]:this,i=new Du(a,r,n);return e&&(i.targetName=e),this.addAnimator(i,e),i},t.prototype.addAnimator=function(e,r){var n=this.__zr,a=this;e.during(function(){a.updateDuringAnimation(r)}).done(function(){var i=a.animators,o=Pe(i,e);o>=0&&i.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,a=n.length,i=[],o=0;o<a;o++){var s=n[o];!e||e===s.scope?s.stop(r):i.push(s)}return this.animators=i,this},t.prototype.animateTo=function(e,r,n){Ou(this,e,r,n)},t.prototype.animateFrom=function(e,r,n){Ou(this,e,r,n,!0)},t.prototype._transitionState=function(e,r,n,a){for(var i=Ou(this,r,n,a),o=0;o<i.length;o++)i[o].__fromStateTransition=e},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=(function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=Ot;function r(n,a,i,o){Object.defineProperty(e,n,{get:function(){if(!this[a]){var l=this[a]=[];s(this,l)}return this[a]},set:function(l){this[i]=l[0],this[o]=l[1],this[a]=l,s(this,l)}});function s(l,c){Object.defineProperty(c,0,{get:function(){return l[i]},set:function(u){l[i]=u}}),Object.defineProperty(c,1,{get:function(){return l[o]},set:function(u){l[o]=u}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))})(),t})();br(Fs,rr),br(Fs,bu);function Ou(t,e,r,n,a){r=r||{};var i=[];Nv(t,"",t,e,r,n,i,a);var o=i.length,s=!1,l=r.done,c=r.aborted,u=function(){s=!0,o--,o<=0&&(s?l&&l():c&&c())},f=function(){o--,o<=0&&(s?l&&l():c&&c())};o||l&&l(),i.length>0&&r.during&&i[0].during(function(p,m){r.during(m)});for(var h=0;h<i.length;h++){var d=i[h];u&&d.done(u),f&&d.aborted(f),r.force&&d.duration(r.duration),d.start(r.easing)}return i}function Nu(t,e,r){for(var n=0;n<r;n++)t[n]=e[n]}function pS(t){return xt(t[0])}function vS(t,e,r){if(xt(e[r]))if(xt(t[r])||(t[r]=[]),wt(e[r])){var n=e[r].length;t[r].length!==n&&(t[r]=new e[r].constructor(n),Nu(t[r],e[r],n))}else{var a=e[r],i=t[r],o=a.length;if(pS(a))for(var s=a[0].length,l=0;l<o;l++)i[l]?Nu(i[l],a[l],s):i[l]=Array.prototype.slice.call(a[l]);else Nu(i,a,o);i.length=a.length}else t[r]=e[r]}function gS(t,e){return t===e||xt(t)&&xt(e)&&mS(t,e)}function mS(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function Nv(t,e,r,n,a,i,o,s){for(var l=Ge(n),c=a.duration,u=a.delay,f=a.additive,h=a.setToFinal,d=!ce(i),p=t.animators,m=[],v=0;v<l.length;v++){var g=l[v],y=n[g];if(y!=null&&r[g]!=null&&(d||i[g]))if(ce(y)&&!xt(y)&&!ds(y)){if(e){s||(r[g]=y,t.updateDuringAnimation(e));continue}Nv(t,g,r[g],y,a,i&&i[g],o,s)}else m.push(g);else s||(r[g]=y,t.updateDuringAnimation(e),m.push(g))}var b=m.length;if(!f&&b)for(var x=0;x<p.length;x++){var S=p[x];if(S.targetName===e){var w=S.stopTracks(m);if(w){var k=Pe(p,S);p.splice(k,1)}}}if(a.force||(m=ot(m,function(C){return!gS(n[C],r[C])}),b=m.length),b>0||a.force&&!o.length){var T=void 0,M=void 0,A=void 0;if(s){M={},h&&(T={});for(var x=0;x<b;x++){var g=m[x];M[g]=r[g],h?T[g]=n[g]:r[g]=n[g]}}else if(h){A={};for(var x=0;x<b;x++){var g=m[x];A[g]=Rs(r[g]),vS(r,n,g)}}var S=new Du(r,!1,!1,f?ot(p,function(I){return I.targetName===e}):null);S.targetName=e,a.scope&&(S.scope=a.scope),h&&T&&S.whenWithKeys(0,T,m),A&&S.whenWithKeys(0,A,m),S.whenWithKeys(c??500,s?M:n,m).delay(u||0),t.addAnimator(S,e),o.push(S)}}var Bu="__zr_style_"+Math.round(Math.random()*10),Bn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Hs={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Bn[Bu]=!0;var Bv=["z","z2","invisible"],yS=["invisible"],Ni=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=Ge(r),a=0;a<n.length;a++){var i=n[a];i==="style"?this.useStyle(r[i]):t.prototype.attrKV.call(this,i,r[i])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(r,n,a,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&_S(this,r,n)||o&&!o[0]&&!o[3])return!1;if(a&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(i&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(r,n){return this.rectContain(r,n)},e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.rectContain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();return i.contain(a[0],a[1])},e.prototype.getPaintRect=function(){var r=this._paintRect;if(!this._paintRect||this.__dirty){var n=this.transform,a=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,s=i.shadowOffsetX||0,l=i.shadowOffsetY||0;r=this._paintRect||(this._paintRect=new Le(0,0,0,0)),n?Le.applyTransform(r,a,n):r.copy(a),(o||s||l)&&(r.width+=o*2+Math.abs(s),r.height+=o*2+Math.abs(l),r.x=Math.min(r.x,r.x+s-o),r.y=Math.min(r.y,r.y+l-o));var c=this.dirtyRectTolerance;r.isZero()||(r.x=Math.floor(r.x-c),r.y=Math.floor(r.y-c),r.width=Math.ceil(r.width+1+c*2),r.height=Math.ceil(r.height+1+c*2))}return r},e.prototype.setPrevPaintRect=function(r){r?(this._prevPaintRect=this._prevPaintRect||new Le(0,0,0,0),this._prevPaintRect.copy(r)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(r){return this.animate("style",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(r,n){r!=="style"?t.prototype.attrKV.call(this,r,n):this.style?this.setStyle(n):this.useStyle(n)},e.prototype.setStyle=function(r,n){return typeof r=="string"?this.style[r]=n:G(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=Oi,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&Oi)},e.prototype.styleUpdated=function(){this.__dirty&=~Oi},e.prototype.createStyle=function(r){return gs(Bn,r)},e.prototype.useStyle=function(r){r[Bu]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Bu]},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(r,n,Bv)},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.style?o?i?c=n.style:(c=this._mergeStyle(this.createStyle(),a.style),this._mergeStyle(c,n.style)):(c=this._mergeStyle(this.createStyle(),i?this.style:a.style),this._mergeStyle(c,n.style)):l&&(c=a.style),c)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var f=Ge(u),h=0;h<f.length;h++){var d=f[h];d in c&&(c[d]=c[d],this.style[d]=u[d])}for(var p=Ge(c),h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(r,{style:c},s,this.getAnimationStyleProps())}else this.useStyle(c);for(var m=this.__inHover?yS:Bv,h=0;h<m.length;h++){var d=m[h];n&&n[d]!=null?this[d]=n[d]:l&&a[d]!=null&&(this[d]=a[d])}},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.style&&(a=a||{},this._mergeStyle(a,o.style))}return a&&(n.style=a),n},e.prototype._mergeStyle=function(r,n){return G(r,n),r},e.prototype.getAnimationStyleProps=function(){return Hs},e.initDefaultProps=(function(){var r=e.prototype;r.type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=!1,r._rect=null,r.dirtyRectTolerance=0,r.__dirty=Ot|Oi})(),e})(Fs),zu=new Le(0,0,0,0),Fu=new Le(0,0,0,0);function _S(t,e,r){return zu.copy(t.getBoundingRect()),t.transform&&zu.applyTransform(t.transform),Fu.width=e,Fu.height=r,!zu.intersect(Fu)}var Ut=Math.min,Yt=Math.max,Hu=Math.sin,Vu=Math.cos,zn=Math.PI*2,Vs=Ta(),Gs=Ta(),Ws=Ta();function zv(t,e,r,n,a,i){a[0]=Ut(t,r),a[1]=Ut(e,n),i[0]=Yt(t,r),i[1]=Yt(e,n)}var Fv=[],Hv=[];function bS(t,e,r,n,a,i,o,s,l,c){var u=xv,f=lt,h=u(t,r,a,o,Fv);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var d=0;d<h;d++){var p=f(t,r,a,o,Fv[d]);l[0]=Ut(p,l[0]),c[0]=Yt(p,c[0])}h=u(e,n,i,s,Hv);for(var d=0;d<h;d++){var m=f(e,n,i,s,Hv[d]);l[1]=Ut(m,l[1]),c[1]=Yt(m,c[1])}l[0]=Ut(t,l[0]),c[0]=Yt(t,c[0]),l[0]=Ut(o,l[0]),c[0]=Yt(o,c[0]),l[1]=Ut(e,l[1]),c[1]=Yt(e,c[1]),l[1]=Ut(s,l[1]),c[1]=Yt(s,c[1])}function xS(t,e,r,n,a,i,o,s){var l=Sv,c=St,u=Yt(Ut(l(t,r,a),1),0),f=Yt(Ut(l(e,n,i),1),0),h=c(t,r,a,u),d=c(e,n,i,f);o[0]=Ut(t,a,h),o[1]=Ut(e,i,d),s[0]=Yt(t,a,h),s[1]=Yt(e,i,d)}function wS(t,e,r,n,a,i,o,s,l){var c=Ma,u=Aa,f=Math.abs(a-i);if(f%zn<1e-4&&f>1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(Vs[0]=Vu(a)*r+t,Vs[1]=Hu(a)*n+e,Gs[0]=Vu(i)*r+t,Gs[1]=Hu(i)*n+e,c(s,Vs,Gs),u(l,Vs,Gs),a=a%zn,a<0&&(a=a+zn),i=i%zn,i<0&&(i=i+zn),a>i&&!o?i+=zn:a<i&&o&&(a+=zn),o){var h=i;i=a,a=h}for(var d=0;d<i;d+=Math.PI/2)d>a&&(Ws[0]=Vu(d)*r+t,Ws[1]=Hu(d)*n+e,c(s,Ws,s),u(l,Ws,l))}var Re={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Fn=[],Hn=[],kr=[],sn=[],Tr=[],Cr=[],Gu=Math.min,Wu=Math.max,Vn=Math.cos,Gn=Math.sin,Vr=Math.abs,$u=Math.PI,ln=$u*2,Uu=typeof Float32Array<"u",Bi=[];function Yu(t){var e=Math.round(t/$u*1e8)/1e8;return e%2*$u}function SS(t,e){var r=Yu(t[0]);r<0&&(r+=ln);var n=r-t[0],a=t[1];a+=n,!e&&a-r>=ln?a=r+ln:e&&r-a>=ln?a=r-ln:!e&&r>a?a=r+(ln-Yu(r-a)):e&&r<a&&(a=r-(ln-Yu(a-r))),t[0]=r,t[1]=a}var Wn=(function(){function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,r,n){n=n||0,n>0&&(this._ux=Vr(n/zs/e)||0,this._uy=Vr(n/zs/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(Re.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=Vr(e-this._xi),a=Vr(r-this._yi),i=n>this._ux||a>this._uy;if(this.addData(Re.L,e,r),this._ctx&&i&&this._ctx.lineTo(e,r),i)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+a*a;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,a,i,o){return this._drawPendingPt(),this.addData(Re.C,e,r,n,a,i,o),this._ctx&&this._ctx.bezierCurveTo(e,r,n,a,i,o),this._xi=i,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,a){return this._drawPendingPt(),this.addData(Re.Q,e,r,n,a),this._ctx&&this._ctx.quadraticCurveTo(e,r,n,a),this._xi=n,this._yi=a,this},t.prototype.arc=function(e,r,n,a,i,o){this._drawPendingPt(),Bi[0]=a,Bi[1]=i,SS(Bi,o),a=Bi[0],i=Bi[1];var s=i-a;return this.addData(Re.A,e,r,n,n,a,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,a,i,o),this._xi=Vn(i)*n+e,this._yi=Gn(i)*n+r,this},t.prototype.arcTo=function(e,r,n,a,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,a,i),this},t.prototype.rect=function(e,r,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,a),this.addData(Re.R,e,r,n,a),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Re.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&e.closePath(),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var r=e.length;!(this.data&&this.data.length===r)&&Uu&&(this.data=new Float32Array(r));for(var n=0;n<r;n++)this.data[n]=e[n];this._len=r},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var r=e.length,n=0,a=this._len,i=0;i<r;i++)n+=e[i].len();Uu&&this.data instanceof Float32Array&&(this.data=new Float32Array(a+n));for(var i=0;i<r;i++)for(var o=e[i].data,s=0;s<o.length;s++)this.data[a++]=o[s];this._len=a},t.prototype.addData=function(e,r,n,a,i,o,s,l,c){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var f=0;f<arguments.length;f++)u[this._len++]=arguments[f]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r<this._len;r++)e[r]=this.data[r];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,Uu&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){kr[0]=kr[1]=Tr[0]=Tr[1]=Number.MAX_VALUE,sn[0]=sn[1]=Cr[0]=Cr[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,a=0,i=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(r=e[o],n=e[o+1],a=r,i=n),s){case Re.M:r=a=e[o++],n=i=e[o++],Tr[0]=a,Tr[1]=i,Cr[0]=a,Cr[1]=i;break;case Re.L:zv(r,n,e[o],e[o+1],Tr,Cr),r=e[o++],n=e[o++];break;case Re.C:bS(r,n,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Tr,Cr),r=e[o++],n=e[o++];break;case Re.Q:xS(r,n,e[o++],e[o++],e[o],e[o+1],Tr,Cr),r=e[o++],n=e[o++];break;case Re.A:var c=e[o++],u=e[o++],f=e[o++],h=e[o++],d=e[o++],p=e[o++]+d;o+=1;var m=!e[o++];l&&(a=Vn(d)*f+c,i=Gn(d)*h+u),wS(c,u,f,h,d,p,m,Tr,Cr),r=Vn(p)*f+c,n=Gn(p)*h+u;break;case Re.R:a=r=e[o++],i=n=e[o++];var v=e[o++],g=e[o++];zv(a,i,a+v,i+g,Tr,Cr);break;case Re.Z:r=a,n=i;break}Ma(kr,kr,Tr),Aa(sn,sn,Cr)}return o===0&&(kr[0]=kr[1]=sn[0]=sn[1]=0),new Le(kr[0],kr[1],sn[0]-kr[0],sn[1]-kr[1])},t.prototype._calculateLength=function(){var e=this.data,r=this._len,n=this._ux,a=this._uy,i=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var c=this._pathSegLen,u=0,f=0,h=0;h<r;){var d=e[h++],p=h===1;p&&(i=e[h],o=e[h+1],s=i,l=o);var m=-1;switch(d){case Re.M:i=s=e[h++],o=l=e[h++];break;case Re.L:{var v=e[h++],g=e[h++],y=v-i,b=g-o;(Vr(y)>n||Vr(b)>a||h===r-1)&&(m=Math.sqrt(y*y+b*b),i=v,o=g);break}case Re.C:{var x=e[h++],S=e[h++],v=e[h++],g=e[h++],w=e[h++],k=e[h++];m=jw(i,o,x,S,v,g,w,k,10),i=w,o=k;break}case Re.Q:{var x=e[h++],S=e[h++],v=e[h++],g=e[h++];m=eS(i,o,x,S,v,g,10),i=v,o=g;break}case Re.A:var T=e[h++],M=e[h++],A=e[h++],C=e[h++],I=e[h++],P=e[h++],R=P+I;h+=1,p&&(s=Vn(I)*A+T,l=Gn(I)*C+M),m=Wu(A,C)*Gu(ln,Math.abs(P)),i=Vn(R)*A+T,o=Gn(R)*C+M;break;case Re.R:{s=i=e[h++],l=o=e[h++];var E=e[h++],O=e[h++];m=E*2+O*2;break}case Re.Z:{var y=s-i,b=l-o;m=Math.sqrt(y*y+b*b),i=s,o=l;break}}m>=0&&(c[f++]=m,u+=m)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,r){var n=this.data,a=this._ux,i=this._uy,o=this._len,s,l,c,u,f,h,d=r<1,p,m,v=0,g=0,y,b=0,x,S;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,y=r*m,!y)))e:for(var w=0;w<o;){var k=n[w++],T=w===1;switch(T&&(c=n[w],u=n[w+1],s=c,l=u),k!==Re.L&&b>0&&(e.lineTo(x,S),b=0),k){case Re.M:s=c=n[w++],l=u=n[w++],e.moveTo(c,u);break;case Re.L:{f=n[w++],h=n[w++];var M=Vr(f-c),A=Vr(h-u);if(M>a||A>i){if(d){var C=p[g++];if(v+C>y){var I=(y-v)/C;e.lineTo(c*(1-I)+f*I,u*(1-I)+h*I);break e}v+=C}e.lineTo(f,h),c=f,u=h,b=0}else{var P=M*M+A*A;P>b&&(x=f,S=h,b=P)}break}case Re.C:{var R=n[w++],E=n[w++],O=n[w++],K=n[w++],L=n[w++],B=n[w++];if(d){var C=p[g++];if(v+C>y){var I=(y-v)/C;Cs(c,R,O,L,I,Fn),Cs(u,E,K,B,I,Hn),e.bezierCurveTo(Fn[1],Hn[1],Fn[2],Hn[2],Fn[3],Hn[3]);break e}v+=C}e.bezierCurveTo(R,E,O,K,L,B),c=L,u=B;break}case Re.Q:{var R=n[w++],E=n[w++],O=n[w++],K=n[w++];if(d){var C=p[g++];if(v+C>y){var I=(y-v)/C;Ms(c,R,O,I,Fn),Ms(u,E,K,I,Hn),e.quadraticCurveTo(Fn[1],Hn[1],Fn[2],Hn[2]);break e}v+=C}e.quadraticCurveTo(R,E,O,K),c=O,u=K;break}case Re.A:var V=n[w++],$=n[w++],X=n[w++],ue=n[w++],_e=n[w++],Te=n[w++],Ue=n[w++],We=!n[w++],Ye=X>ue?X:ue,J=Vr(X-ue)>.001,le=_e+Te,j=!1;if(d){var C=p[g++];v+C>y&&(le=_e+Te*(y-v)/C,j=!0),v+=C}if(J&&e.ellipse?e.ellipse(V,$,X,ue,Ue,_e,le,We):e.arc(V,$,Ye,_e,le,We),j)break e;T&&(s=Vn(_e)*X+V,l=Gn(_e)*ue+$),c=Vn(le)*X+V,u=Gn(le)*ue+$;break;case Re.R:s=c=n[w],l=u=n[w+1],f=n[w++],h=n[w++];var Q=n[w++],F=n[w++];if(d){var C=p[g++];if(v+C>y){var ie=y-v;e.moveTo(f,h),e.lineTo(f+Gu(ie,Q),h),ie-=Q,ie>0&&e.lineTo(f+Q,h+Gu(ie,F)),ie-=F,ie>0&&e.lineTo(f+Wu(Q-ie,0),h+F),ie-=Q,ie>0&&e.lineTo(f,h+Wu(F-ie,0));break e}v+=C}e.rect(f,h,Q,F);break;case Re.Z:if(d){var C=p[g++];if(v+C>y){var I=(y-v)/C;e.lineTo(c*(1-I)+s*I,u*(1-I)+l*I);break e}v+=C}e.closePath(),c=s,u=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=Re,t.initDefaultProps=(function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0})(),t})();function Ea(t,e,r,n,a,i,o){if(a===0)return!1;var s=a,l=0,c=t;if(o>e+s&&o>n+s||o<e-s&&o<n-s||i>t+s&&i>r+s||i<t-s&&i<r-s)return!1;if(t!==r)l=(e-n)/(t-r),c=(t*n-r*e)/(t-r);else return Math.abs(i-t)<=s/2;var u=l*i-o+c,f=u*u/(l*l+1);return f<=s/2*s/2}function kS(t,e,r,n,a,i,o,s,l,c,u){if(l===0)return!1;var f=l;if(u>e+f&&u>n+f&&u>i+f&&u>s+f||u<e-f&&u<n-f&&u<i-f&&u<s-f||c>t+f&&c>r+f&&c>a+f&&c>o+f||c<t-f&&c<r-f&&c<a-f&&c<o-f)return!1;var h=Kw(t,e,r,n,a,i,o,s,c,u);return h<=f/2}function TS(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;if(l>e+c&&l>n+c&&l>i+c||l<e-c&&l<n-c&&l<i-c||s>t+c&&s>r+c&&s>a+c||s<t-c&&s<r-c&&s<a-c)return!1;var u=Jw(t,e,r,n,a,i,s,l);return u<=c/2}var Vv=Math.PI*2;function $s(t){return t%=Vv,t<0&&(t+=Vv),t}var zi=Math.PI*2;function CS(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-c>r||u+c<r)return!1;if(Math.abs(n-a)%zi<1e-4)return!0;if(i){var f=n;n=$s(a),a=$s(f)}else n=$s(n),a=$s(a);n>a&&(a+=zi);var h=Math.atan2(l,s);return h<0&&(h+=zi),h>=n&&h<=a||h+zi>=n&&h+zi<=a}function $n(t,e,r,n,a,i){if(i>e&&i>n||i<e&&i<n||n===e)return 0;var o=(i-e)/(n-e),s=n<e?1:-1;(o===1||o===0)&&(s=n<e?.5:-.5);var l=o*(r-t)+t;return l===a?1/0:l>a?s:0}var cn=Wn.CMD,Un=Math.PI*2,MS=1e-4;function AS(t,e){return Math.abs(t-e)<MS}var yt=[-1,-1,-1],qt=[-1,-1];function DS(){var t=qt[0];qt[0]=qt[1],qt[1]=t}function IS(t,e,r,n,a,i,o,s,l,c){if(c>e&&c>n&&c>i&&c>s||c<e&&c<n&&c<i&&c<s)return 0;var u=Ts(e,n,i,s,c,yt);if(u===0)return 0;for(var f=0,h=-1,d=void 0,p=void 0,m=0;m<u;m++){var v=yt[m],g=v===0||v===1?.5:1,y=lt(t,r,a,o,v);y<l||(h<0&&(h=xv(e,n,i,s,qt),qt[1]<qt[0]&&h>1&&DS(),d=lt(e,n,i,s,qt[0]),h>1&&(p=lt(e,n,i,s,qt[1]))),h===2?v<qt[0]?f+=d<e?g:-g:v<qt[1]?f+=p<d?g:-g:f+=s<p?g:-g:v<qt[0]?f+=d<e?g:-g:f+=s<d?g:-g)}return f}function PS(t,e,r,n,a,i,o,s){if(s>e&&s>n&&s>i||s<e&&s<n&&s<i)return 0;var l=Qw(e,n,i,s,yt);if(l===0)return 0;var c=Sv(e,n,i);if(c>=0&&c<=1){for(var u=0,f=St(e,n,i,c),h=0;h<l;h++){var d=yt[h]===0||yt[h]===1?.5:1,p=St(t,r,a,yt[h]);p<o||(yt[h]<c?u+=f<e?d:-d:u+=i<f?d:-d)}return u}else{var d=yt[0]===0||yt[0]===1?.5:1,p=St(t,r,a,yt[0]);return p<o?0:i<e?d:-d}}function LS(t,e,r,n,a,i,o,s){if(s-=e,s>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);yt[0]=-l,yt[1]=l;var c=Math.abs(n-a);if(c<1e-4)return 0;if(c>=Un-1e-4){n=0,a=Un;var u=i?1:-1;return o>=yt[0]+t&&o<=yt[1]+t?u:0}if(n>a){var f=n;n=a,a=f}n<0&&(n+=Un,a+=Un);for(var h=0,d=0;d<2;d++){var p=yt[d];if(p+t>o){var m=Math.atan2(s,p),u=i?1:-1;m<0&&(m=Un+m),(m>=n&&m<=a||m+Un>=n&&m+Un<=a)&&(m>Math.PI/2&&m<Math.PI*1.5&&(u=-u),h+=u)}}return h}function Gv(t,e,r,n,a){for(var i=t.data,o=t.len(),s=0,l=0,c=0,u=0,f=0,h,d,p=0;p<o;){var m=i[p++],v=p===1;switch(m===cn.M&&p>1&&(r||(s+=$n(l,c,u,f,n,a))),v&&(l=i[p],c=i[p+1],u=l,f=c),m){case cn.M:u=i[p++],f=i[p++],l=u,c=f;break;case cn.L:if(r){if(Ea(l,c,i[p],i[p+1],e,n,a))return!0}else s+=$n(l,c,i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case cn.C:if(r){if(kS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=IS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case cn.Q:if(r){if(TS(l,c,i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=PS(l,c,i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case cn.A:var g=i[p++],y=i[p++],b=i[p++],x=i[p++],S=i[p++],w=i[p++];p+=1;var k=!!(1-i[p++]);h=Math.cos(S)*b+g,d=Math.sin(S)*x+y,v?(u=h,f=d):s+=$n(l,c,h,d,n,a);var T=(n-g)*x/b+g;if(r){if(CS(g,y,x,S,S+w,k,e,T,a))return!0}else s+=LS(g,y,x,S,S+w,k,T,a);l=Math.cos(S+w)*b+g,c=Math.sin(S+w)*x+y;break;case cn.R:u=l=i[p++],f=c=i[p++];var M=i[p++],A=i[p++];if(h=u+M,d=f+A,r){if(Ea(u,f,h,f,e,n,a)||Ea(h,f,h,d,e,n,a)||Ea(h,d,u,d,e,n,a)||Ea(u,d,u,f,e,n,a))return!0}else s+=$n(h,f,h,d,n,a),s+=$n(u,d,u,f,n,a);break;case cn.Z:if(r){if(Ea(l,c,u,f,e,n,a))return!0}else s+=$n(l,c,u,f,n,a);l=u,c=f;break}}return!r&&!AS(c,f)&&(s+=$n(l,c,u,f,n,a)||0),s!==0}function RS(t,e,r){return Gv(t,0,!1,e,r)}function ES(t,e,r,n){return Gv(t,e,!0,r,n)}var Wv=Ie({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Bn),OS={style:Ie({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Hs.style)},qu=Ii.concat(["invisible","culling","z","z2","zlevel","parent"]),Oe=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var a=this._decalEl=this._decalEl||new e;a.buildPath===e.prototype.buildPath&&(a.buildPath=function(l){r.buildPath(l,r.shape)}),a.silent=!0;var i=a.style;for(var o in n)i[o]!==n[o]&&(i[o]=n[o]);i.fill=n.fill?n.decal:null,i.decal=null,i.shadowColor=null,n.strokeFirst&&(i.stroke=null);for(var s=0;s<qu.length;++s)a[qu[s]]=this[qu[s]];a.__dirty|=Ot}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var n=Ge(r);this.shape=this.getDefaultShape();var a=this.getDefaultStyle();a&&this.useStyle(a);for(var i=0;i<n.length;i++){var o=n[i],s=r[o];o==="style"?this.style?G(this.style,s):this.useStyle(s):o==="shape"?G(this.shape,s):t.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var r=this.style.fill;if(r!=="none"){if(oe(r)){var n=Ps(r,0);return n>.5?Pu:n>.2?fS:Lu}else if(r)return Lu}return Pu},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(oe(n)){var a=this.__zr,i=!!(a&&a.isDarkMode()),o=Ps(r,0)<Iu;if(i===o)return n}},e.prototype.buildPath=function(r,n,a){},e.prototype.pathUpdated=function(){this.__dirty&=~La},e.prototype.getUpdatedPathProxy=function(r){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,r),this.path},e.prototype.createPathProxy=function(){this.path=new Wn(!1)},e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return!(n==null||n==="none"||!(r.lineWidth>0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,a=!r;if(a){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||this.__dirty&La)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||a){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,c=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;c=Math.max(c,u??4)}l>1e-10&&(s.width+=c/l,s.height+=c/l,s.x-=c/l/2,s.y-=c/l/2)}return s}return r},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect(),o=this.style;if(r=a[0],n=a[1],i.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,c=o.strokeNoScale?this.getLineScale():1;if(c>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),ES(s,l/c,r,n)))return!0}if(this.hasFill())return RS(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=La,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var a=this.shape;return a||(a=this.shape={}),typeof r=="string"?a[r]=n:G(a,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&La)},e.prototype.createStyle=function(r){return gs(Wv,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=G({},this.shape))},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.shape?o?i?c=n.shape:(c=G({},a.shape),G(c,n.shape)):(c=G({},i?this.shape:a.shape),G(c,n.shape)):l&&(c=a.shape),c)if(o){this.shape=G({},this.shape);for(var u={},f=Ge(c),h=0;h<f.length;h++){var d=f[h];typeof c[d]=="object"?this.shape[d]=c[d]:u[d]=c[d]}this._transitionState(r,{shape:u},s)}else this.shape=c,this.dirtyShape()},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.shape&&(a=a||{},this._mergeStyle(a,o.shape))}return a&&(n.shape=a),n},e.prototype.getAnimationStyleProps=function(){return OS},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var n=(function(i){U(o,i);function o(s){var l=i.call(this,s)||this;return r.init&&r.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return we(r.style)},o.prototype.getDefaultShape=function(){return we(r.shape)},o})(e);for(var a in r)typeof r[a]=="function"&&(n.prototype[a]=r[a]);return n},e.initDefaultProps=(function(){var r=e.prototype;r.type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,r.__dirty=Ot|Oi|La})(),e})(Ni),NS=Ie({strokeFirst:!0,font:An,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Wv),Us=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return n!=null&&n!=="none"&&r.lineWidth>0},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(r){return gs(NS,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var n=r.text;n!=null?n+="":n="";var a=hu(n,r.font,r.textAlign,r.textBaseline);if(a.x+=r.x||0,a.y+=r.y||0,this.hasStroke()){var i=r.lineWidth;a.x-=i/2,a.y-=i/2,a.width+=i,a.height+=i}this._rect=a}return this._rect},e.initDefaultProps=(function(){var r=e.prototype;r.dirtyRectTolerance=10})(),e})(Ni);Us.prototype.type="tspan";var BS=Ie({x:0,y:0},Bn),zS={style:Ie({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Hs.style)};function FS(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var un=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return gs(BS,r)},e.prototype._getSize=function(r){var n=this.style,a=n[r];if(a!=null)return a;var i=FS(n.image)?n.image:this.__image;if(!i)return 0;var o=r==="width"?"height":"width",s=n[o];return s==null?i[r]:i[r]/i[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return zS},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Le(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e})(Ni);un.prototype.type="image";function HS(t,e){var r=e.x,n=e.y,a=e.width,i=e.height,o=e.r,s,l,c,u;a<0&&(r=r+a,a=-a),i<0&&(n=n+i,i=-i),typeof o=="number"?s=l=c=u=o:o instanceof Array?o.length===1?s=l=c=u=o[0]:o.length===2?(s=c=o[0],l=u=o[1]):o.length===3?(s=o[0],l=u=o[1],c=o[2]):(s=o[0],l=o[1],c=o[2],u=o[3]):s=l=c=u=0;var f;s+l>a&&(f=s+l,s*=a/f,l*=a/f),c+u>a&&(f=c+u,c*=a/f,u*=a/f),l+c>i&&(f=l+c,l*=i/f,c*=i/f),s+u>i&&(f=s+u,s*=i/f,u*=i/f),t.moveTo(r+s,n),t.lineTo(r+a-l,n),l!==0&&t.arc(r+a-l,n+l,l,-Math.PI/2,0),t.lineTo(r+a,n+i-c),c!==0&&t.arc(r+a-c,n+i-c,c,0,Math.PI/2),t.lineTo(r+u,n+i),u!==0&&t.arc(r+u,n+i-u,u,Math.PI/2,Math.PI),t.lineTo(r,n+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var Oa=Math.round;function $v(t,e,r){if(e){var n=e.x1,a=e.x2,i=e.y1,o=e.y2;t.x1=n,t.x2=a,t.y1=i,t.y2=o;var s=r&&r.lineWidth;return s&&(Oa(n*2)===Oa(a*2)&&(t.x1=t.x2=Yn(n,s,!0)),Oa(i*2)===Oa(o*2)&&(t.y1=t.y2=Yn(i,s,!0))),t}}function Uv(t,e,r){if(e){var n=e.x,a=e.y,i=e.width,o=e.height;t.x=n,t.y=a,t.width=i,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=Yn(n,s,!0),t.y=Yn(a,s,!0),t.width=Math.max(Yn(n+i,s,!1)-t.x,i===0?0:1),t.height=Math.max(Yn(a+o,s,!1)-t.y,o===0?0:1)),t}}function Yn(t,e,r){if(!e)return t;var n=Oa(t*2);return(n+Oa(e))%2===0?n/2:(n+(r?1:-1))/2}var VS=(function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t})(),GS={},at=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new VS},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=Uv(GS,n,this.style);a=l.x,i=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else a=n.x,i=n.y,o=n.width,s=n.height;n.r?HS(r,n):r.rect(a,i,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e})(Oe);at.prototype.type="rect";var Yv={fill:"#000"},qv=2,WS={style:Ie({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Hs.style)},kt=(function(t){U(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=Yv,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r<this._children.length;r++){var n=this._children[r];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},e.prototype.updateTransform=function(){var r=this.innerTransformable;r?(r.updateTransform(),r.transform&&(this.transform=r.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(r){var n=this.innerTransformable;return n?n.getLocalTransform(r):t.prototype.getLocalTransform.call(this,r)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,XS(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=r},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var r=new Le(0,0,0,0),n=this._children,a=[],i=null,o=0;o<n.length;o++){var s=n[o],l=s.getBoundingRect(),c=s.getLocalTransform(a);c?(r.copy(l),r.applyTransform(c),i=i||r.clone(),i.union(r)):(i=i||l.clone(),i.union(l))}this._rect=i||r}return this._rect},e.prototype.setDefaultTextStyle=function(r){this._defaultStyle=r||Yv},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,n){if(!n)return r;var a=n.rich,i=r.rich||a&&{};return G(r,n),a&&i?(this._mergeRich(i,a),r.rich=i):i&&(r.rich=i),r},e.prototype._mergeRich=function(r,n){for(var a=Ge(n),i=0;i<a.length;i++){var o=a[i];r[o]=r[o]||{},G(r[o],n[o])}},e.prototype.getAnimationStyleProps=function(){return WS},e.prototype._getOrCreateChild=function(r){var n=this._children[this._childCursor];return(!n||!(n instanceof r))&&(n=new r),this._children[this._childCursor++]=n,n.__zr=this.__zr,n.parent=this,n},e.prototype._updatePlainTexts=function(){var r=this.style,n=r.font||An,a=r.padding,i=eg(r),o=Ow(i,r),s=Xu(r),l=!!r.backgroundColor,c=o.outerHeight,u=o.outerWidth,f=o.contentWidth,h=o.lines,d=o.lineHeight,p=this._defaultStyle;this.isTruncated=!!o.isTruncated;var m=r.x||0,v=r.y||0,g=r.align||p.align||"left",y=r.verticalAlign||p.verticalAlign||"top",b=m,x=ka(v,o.contentHeight,y);if(s||a){var S=Di(m,u,g),w=ka(v,c,y);s&&this._renderBackground(r,r,S,w,u,c)}x+=d/2,a&&(b=Jv(m,g,a),y==="top"?x+=a[0]:y==="bottom"&&(x-=a[2]));for(var k=0,T=!1,M=Qv("fill"in r?r.fill:(T=!0,p.fill)),A=jv("stroke"in r?r.stroke:!l&&(!p.autoStroke||T)?(k=qv,p.stroke):null),C=r.textShadowBlur>0,I=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),P=o.calculatedLineHeight,R=0;R<h.length;R++){var E=this._getOrCreateChild(Us),O=E.createStyle();E.useStyle(O),O.text=h[R],O.x=b,O.y=x,O.textAlign=g,O.textBaseline="middle",O.opacity=r.opacity,O.strokeFirst=!0,C&&(O.shadowBlur=r.textShadowBlur||0,O.shadowColor=r.textShadowColor||"transparent",O.shadowOffsetX=r.textShadowOffsetX||0,O.shadowOffsetY=r.textShadowOffsetY||0),O.stroke=A,O.fill=M,A&&(O.lineWidth=r.lineWidth||k,O.lineDash=r.lineDash,O.lineDashOffset=r.lineDashOffset||0),O.font=n,Zv(O,r),x+=d,I&&E.setBoundingRect(new Le(Di(O.x,f,O.textAlign),ka(O.y,P,O.textBaseline),f,P))}},e.prototype._updateRichTexts=function(){var r=this.style,n=eg(r),a=zw(n,r),i=a.width,o=a.outerWidth,s=a.outerHeight,l=r.padding,c=r.x||0,u=r.y||0,f=this._defaultStyle,h=r.align||f.align,d=r.verticalAlign||f.verticalAlign;this.isTruncated=!!a.isTruncated;var p=Di(c,o,h),m=ka(u,s,d),v=p,g=m;l&&(v+=l[3],g+=l[0]);var y=v+i;Xu(r)&&this._renderBackground(r,r,p,m,o,s);for(var b=!!r.backgroundColor,x=0;x<a.lines.length;x++){for(var S=a.lines[x],w=S.tokens,k=w.length,T=S.lineHeight,M=S.width,A=0,C=v,I=y,P=k-1,R=void 0;A<k&&(R=w[A],!R.align||R.align==="left");)this._placeToken(R,r,T,g,C,"left",b),M-=R.width,C+=R.width,A++;for(;P>=0&&(R=w[P],R.align==="right");)this._placeToken(R,r,T,g,I,"right",b),M-=R.width,I-=R.width,P--;for(C+=(i-(C-v)-(y-I)-M)/2;A<=P;)R=w[A],this._placeToken(R,r,T,g,C+R.width/2,"center",b),C+=R.width,A++;g+=T}},e.prototype._placeToken=function(r,n,a,i,o,s,l){var c=n.rich[r.styleName]||{};c.text=r.text;var u=r.verticalAlign,f=i+a/2;u==="top"?f=i+r.height/2:u==="bottom"&&(f=i+a-r.height/2);var h=!r.isLineHolder&&Xu(c);h&&this._renderBackground(c,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!c.backgroundColor,p=r.textPadding;p&&(o=Jv(o,s,p),f-=r.height/2-p[0]-r.innerHeight/2);var m=this._getOrCreateChild(Us),v=m.createStyle();m.useStyle(v);var g=this._defaultStyle,y=!1,b=0,x=Qv("fill"in c?c.fill:"fill"in n?n.fill:(y=!0,g.fill)),S=jv("stroke"in c?c.stroke:"stroke"in n?n.stroke:!d&&!l&&(!g.autoStroke||y)?(b=qv,g.stroke):null),w=c.textShadowBlur>0||n.textShadowBlur>0;v.text=r.text,v.x=o,v.y=f,w&&(v.shadowBlur=c.textShadowBlur||n.textShadowBlur||0,v.shadowColor=c.textShadowColor||n.textShadowColor||"transparent",v.shadowOffsetX=c.textShadowOffsetX||n.textShadowOffsetX||0,v.shadowOffsetY=c.textShadowOffsetY||n.textShadowOffsetY||0),v.textAlign=s,v.textBaseline="middle",v.font=r.font||An,v.opacity=vs(c.opacity,n.opacity,1),Zv(v,c),S&&(v.lineWidth=vs(c.lineWidth,n.lineWidth,b),v.lineDash=ke(c.lineDash,n.lineDash),v.lineDashOffset=n.lineDashOffset||0,v.stroke=S),x&&(v.fill=x);var k=r.contentWidth,T=r.contentHeight;m.setBoundingRect(new Le(Di(v.x,k,v.textAlign),ka(v.y,T,v.textBaseline),k,T))},e.prototype._renderBackground=function(r,n,a,i,o,s){var l=r.backgroundColor,c=r.borderWidth,u=r.borderColor,f=l&&l.image,h=l&&!f,d=r.borderRadius,p=this,m,v;if(h||r.lineHeight||c&&u){m=this._getOrCreateChild(at),m.useStyle(m.createStyle()),m.style.fill=null;var g=m.shape;g.x=a,g.y=i,g.width=o,g.height=s,g.r=d,m.dirtyShape()}if(h){var y=m.style;y.fill=l||null,y.fillOpacity=ke(r.fillOpacity,1)}else if(f){v=this._getOrCreateChild(un),v.onload=function(){p.dirtyStyle()};var b=v.style;b.image=l.image,b.x=a,b.y=i,b.width=o,b.height=s}if(c&&u){var y=m.style;y.lineWidth=c,y.stroke=u,y.strokeOpacity=ke(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(m||v).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=vs(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return qS(r)&&(n=[r.fontStyle,r.fontWeight,YS(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&xr(n)||r.textFont||r.font},e})(Ni),$S={left:!0,right:1,center:1},US={top:1,bottom:1,middle:1},Xv=["fontStyle","fontWeight","fontSize","fontFamily"];function YS(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Jc+"px":t+"px"}function Zv(t,e){for(var r=0;r<Xv.length;r++){var n=Xv[r],a=e[n];a!=null&&(t[n]=a)}}function qS(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function XS(t){return Kv(t),D(t.rich,Kv),t}function Kv(t){if(t){t.font=kt.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||$S[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||US[r]?r:"top";var n=t.padding;n&&(t.padding=Jp(t.padding))}}function jv(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function Qv(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function Jv(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function eg(t){var e=t.text;return e!=null&&(e+=""),e}function Xu(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var tg=1e-4,rg=20;function ZS(t){return t.replace(/^\s+|\s+$/g,"")}function qn(t,e,r,n){var a=e[0],i=e[1],o=r[0],s=r[1],l=i-a,c=s-o;if(l===0)return c===0?o:(o+s)/2;if(n)if(l>0){if(t<=a)return o;if(t>=i)return s}else{if(t>=a)return o;if(t<=i)return s}else{if(t===a)return o;if(t===i)return s}return(t-a)/l*c+o}function _t(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return oe(t)?ZS(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function tt(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),rg),t=(+t).toFixed(e),r?t:+t}function KS(t){return t.sort(function(e,r){return e-r}),t}function Gr(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return jS(t)}function jS(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,a=r>0?r:e.length,i=e.indexOf("."),o=i<0?0:a-1-i;return Math.max(0,o-n)}function ng(t,e){var r=Math.log,n=Math.LN10,a=Math.floor(r(t[1]-t[0])/n),i=Math.round(r(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-a+i,0),20);return isFinite(o)?o:20}function QS(t,e){var r=Math.max(Gr(t),Gr(e)),n=t+e;return r>rg?n:tt(n,r)}function ag(t){var e=Math.PI*2;return(t%e+e)%e}function Ys(t){return t>-tg&&t<tg}var JS=/^(?:(\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 Wr(t){if(t instanceof Date)return t;if(oe(t)){var e=JS.exec(t);if(!e)return new Date(NaN);if(e[8]){var r=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(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(t==null)return new Date(NaN);return new Date(Math.round(t))}function ek(t){return Math.pow(10,Zu(t))}function Zu(t){if(t===0)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function ig(t,e){var r=Zu(t),n=Math.pow(10,r),a=t/n,i;return a<1.5?i=1:a<2.5?i=2:a<4?i=3:a<7?i=5:i=10,t=i*n,r>=-20?+t.toFixed(r<0?-r:0):t}function qs(t){var e=parseFloat(t);return e==t&&(e!==0||!oe(t)||t.indexOf("x")<=0)?e:NaN}function tk(t){return!isNaN(qs(t))}function og(){return Math.round(Math.random()*9)}function sg(t,e){return e===0?t:sg(e,t%e)}function lg(t,e){return t==null?e:e==null?t:t*e/sg(t,e)}function Tt(t){throw new Error(t)}function cg(t,e,r){return(e-t)*r+t}var ug="series\0",rk="\0_ec_\0";function ht(t){return t instanceof Array?t:t==null?[]:[t]}function fg(t,e,r){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,a=r.length;n<a;n++){var i=r[n];!t.emphasis[e].hasOwnProperty(i)&&t[e].hasOwnProperty(i)&&(t.emphasis[e][i]=t[e][i])}}}var hg=["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 Fi(t){return ce(t)&&!ne(t)&&!(t instanceof Date)?t.value:t}function nk(t){return ce(t)&&!(t instanceof Array)}function ak(t,e,r){var n=r==="normalMerge",a=r==="replaceMerge",i=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=de();D(e,function(l,c){if(!ce(l)){e[c]=null;return}});var s=ik(t,o,r);return(n||a)&&ok(s,t,o,e),n&&sk(s,e),n||a?lk(s,e,a):i&&ck(s,e),uk(s),s}function ik(t,e,r){var n=[];if(r==="replaceAll")return n;for(var a=0;a<t.length;a++){var i=t[a];i&&i.id!=null&&e.set(i.id,a),n.push({existing:r==="replaceMerge"||Vi(i)?null:i,newOption:null,keyInfo:null,brandNew:null})}return n}function ok(t,e,r,n){D(n,function(a,i){if(!(!a||a.id==null)){var o=Hi(a.id),s=r.get(o);if(s!=null){var l=t[s];zr(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=a,l.existing=e[s],n[i]=null}}})}function sk(t,e){D(e,function(r,n){if(!(!r||r.name==null))for(var a=0;a<t.length;a++){var i=t[a].existing;if(!t[a].newOption&&i&&(i.id==null||r.id==null)&&!Vi(r)&&!Vi(i)&&dg("name",i,r)){t[a].newOption=r,e[n]=null;return}}})}function lk(t,e,r){D(e,function(n){if(n){for(var a,i=0;(a=t[i])&&(a.newOption||Vi(a.existing)||a.existing&&n.id!=null&&!dg("id",n,a.existing));)i++;a?(a.newOption=n,a.brandNew=r):t.push({newOption:n,brandNew:r,existing:null,keyInfo:null}),i++}})}function ck(t,e){D(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function uk(t){var e=de();D(t,function(r){var n=r.existing;n&&e.set(n.id,r)}),D(t,function(r){var n=r.newOption;zr(!n||n.id==null||!e.get(n.id)||e.get(n.id)===r,"id duplicates: "+(n&&n.id)),n&&n.id!=null&&e.set(n.id,r),!r.keyInfo&&(r.keyInfo={})}),D(t,function(r,n){var a=r.existing,i=r.newOption,o=r.keyInfo;if(ce(i)){if(o.name=i.name!=null?Hi(i.name):a?a.name:ug+n,a)o.id=Hi(a.id);else if(i.id!=null)o.id=Hi(i.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,r)}})}function dg(t,e,r){var n=Mr(e[t],null),a=Mr(r[t],null);return n!=null&&a!=null&&n===a}function Hi(t){return Mr(t,"")}function Mr(t,e){return t==null?e:oe(t)?t:He(t)||nu(t)?t+"":e}function Ku(t){var e=t.name;return!!(e&&e.indexOf(ug))}function Vi(t){return t&&t.id!=null&&Hi(t.id).indexOf(rk)===0}function fk(t,e,r){D(t,function(n){var a=n.newOption;ce(a)&&(n.keyInfo.mainType=e,n.keyInfo.subType=hk(e,a,n.existing,r))})}function hk(t,e,r,n){var a=e.type?e.type:r?r.subType:n.determineSubType(t,e);return a}function Xn(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return ne(e.dataIndex)?fe(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return ne(e.name)?fe(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function je(){var t="__ec_inner_"+dk++;return function(e){return e[t]||(e[t]={})}}var dk=og();function ju(t,e,r){var n=Qu(e,r),a=n.mainTypeSpecified,i=n.queryOptionMap,o=n.others,s=o,l=r?r.defaultMainType:null;return!a&&l&&i.set(l,{}),i.each(function(c,u){var f=Gi(t,u,c,{useDefault:l===u,enableAll:r&&r.enableAll!=null?r.enableAll:!0,enableNone:r&&r.enableNone!=null?r.enableNone:!0});s[u+"Models"]=f.models,s[u+"Model"]=f.models[0]}),s}function Qu(t,e){var r;if(oe(t)){var n={};n[t+"Index"]=0,r=n}else r=t;var a=de(),i={},o=!1;return D(r,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){i[l]=s;return}var c=l.match(/^(\w+)(Index|Id|Name)$/)||[],u=c[1],f=(c[2]||"").toLowerCase();if(!(!u||!f||e&&e.includeMainTypes&&Pe(e.includeMainTypes,u)<0)){o=o||!!u;var h=a.get(u)||a.set(u,{});h[f]=s}}),{mainTypeSpecified:o,queryOptionMap:a,others:i}}var Ct={useDefault:!0,enableAll:!1,enableNone:!1},pk={useDefault:!1,enableAll:!0,enableNone:!0};function Gi(t,e,r,n){n=n||Ct;var a=r.index,i=r.id,o=r.name,s={models:null,specified:a!=null||i!=null||o!=null};if(!s.specified){var l=void 0;return s.models=n.useDefault&&(l=t.getComponent(e))?[l]:[],s}return a==="none"||a===!1?(zr(n.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(a==="all"&&(zr(n.enableAll,'`"all"` is not a valid value on index option.'),a=i=o=null),s.models=t.queryComponents({mainType:e,index:a,id:i,name:o}),s)}function pg(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function vk(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function gk(t){return t==="auto"?ve.domSupported?"html":"richText":t||"html"}function mk(t,e,r,n,a){var i=e==null||e==="auto";if(n==null)return n;if(He(n)){var o=cg(r||0,n,a);return tt(o,i?Math.max(Gr(r||0),Gr(n)):e)}else{if(oe(n))return a<1?r:n;for(var s=[],l=r,c=n,u=Math.max(l?l.length:0,c.length),f=0;f<u;++f){var h=t.getDimensionInfo(f);if(h&&h.type==="ordinal")s[f]=(a<1&&l?l:c)[f];else{var d=l&&l[f]?l[f]:0,p=c[f],o=cg(d,p,a);s[f]=tt(o,i?Math.max(Gr(d),Gr(p)):e)}}return s}}var Ee=je(),yk=function(t,e,r,n){if(n){var a=Ee(n);a.dataIndex=r,a.dataType=e,a.seriesIndex=t,a.ssrType="chart",n.type==="group"&&n.traverse(function(i){var o=Ee(i);o.seriesIndex=t,o.dataIndex=r,o.dataType=e,o.ssrType="chart"})}},vg=1,gg={},mg=je(),Ju=je(),ef=0,Xs=1,Zs=2,Ar=["emphasis","blur","select"],yg=["normal","emphasis","blur","select"],_k=10,bk=9,Zn="highlight",Ks="downplay",Wi="select",js="unselect",$i="toggleSelect";function Na(t){return t!=null&&t!=="none"}function Qs(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function _g(t){Qs(t,"emphasis",Zs)}function bg(t){t.hoverState===Zs&&Qs(t,"normal",ef)}function tf(t){Qs(t,"blur",Xs)}function xg(t){t.hoverState===Xs&&Qs(t,"normal",ef)}function xk(t){t.selected=!0}function wk(t){t.selected=!1}function wg(t,e,r){e(t,r)}function $r(t,e,r){wg(t,e,r),t.isGroup&&t.traverse(function(n){wg(n,e,r)})}function Sg(t,e){switch(e){case"emphasis":t.hoverState=Zs;break;case"normal":t.hoverState=ef;break;case"blur":t.hoverState=Xs;break;case"select":t.selected=!0}}function Sk(t,e,r,n){for(var a=t.style,i={},o=0;o<e.length;o++){var s=e[o],l=a[s];i[s]=l??(n&&n[s])}for(var o=0;o<t.animators.length;o++){var c=t.animators[o];c.__fromStateTransition&&c.__fromStateTransition.indexOf(r)<0&&c.targetName==="style"&&c.saveTo(i,e)}return i}function kk(t,e,r,n){var a=r&&Pe(r,"select")>=0,i=!1;if(t instanceof Oe){var o=mg(t),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(Na(s)||Na(l)){n=n||{};var c=n.style||{};c.fill==="inherit"?(i=!0,n=G({},n),c=G({},c),c.fill=s):!Na(c.fill)&&Na(s)?(i=!0,n=G({},n),c=G({},c),c.fill=Iv(s)):!Na(c.stroke)&&Na(l)&&(i||(n=G({},n),c=G({},c)),c.stroke=Iv(l)),n.style=c}}if(n&&n.z2==null){i||(n=G({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(u??_k)}return n}function Tk(t,e,r){if(r&&r.z2==null){r=G({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??bk)}return r}function Ck(t,e,r){var n=Pe(t.currentStates,e)>=0,a=t.style.opacity,i=n?null:Sk(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=G({},r),o=G({opacity:n?a:i.opacity*.1},o),r.style=o),r}function rf(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return kk(this,t,e,r);if(t==="blur")return Ck(this,t,r);if(t==="select")return Tk(this,t,r)}return r}function Mk(t){t.stateProxy=rf;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=rf),r&&(r.stateProxy=rf)}function kg(t,e){!Dg(t,e)&&!t.__highByOuter&&$r(t,_g)}function Tg(t,e){!Dg(t,e)&&!t.__highByOuter&&$r(t,bg)}function Js(t,e){t.__highByOuter|=1<<(e||0),$r(t,_g)}function el(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&$r(t,bg)}function Ak(t){$r(t,tf)}function Cg(t){$r(t,xg)}function Mg(t){$r(t,xk)}function Ag(t){$r(t,wk)}function Dg(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Ig(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(a,i){var o=Ju(i),s=a==="series",l=s?t.getViewOfSeriesModel(i):t.getViewOfComponentModel(i);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(c){xg(c)}),s&&r.push(i)),o.isBlured=!1}),D(n,function(a){a&&a.toggleBlurSeries&&a.toggleBlurSeries(r,!1,e)})}function nf(t,e,r,n){var a=n.getModel();r=r||"coordinateSystem";function i(c,u){for(var f=0;f<u.length;f++){var h=c.getItemGraphicEl(u[f]);h&&Cg(h)}}if(t!=null&&!(!e||e==="none")){var o=a.getSeriesByIndex(t),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];a.eachSeries(function(c){var u=o===c,f=c.coordinateSystem;f&&f.master&&(f=f.master);var h=f&&s?f===s:u;if(!(r==="series"&&!u||r==="coordinateSystem"&&!h||e==="series"&&u)){var d=n.getViewOfSeriesModel(c);if(d.group.traverse(function(v){v.__highByOuter&&u&&e==="self"||tf(v)}),xt(e))i(c.getData(),e);else if(ce(e))for(var p=Ge(e),m=0;m<p.length;m++)i(c.getData(p[m]),e[p[m]]);l.push(c),Ju(c).isBlured=!0}}),a.eachComponent(function(c,u){if(c!=="series"){var f=n.getViewOfComponentModel(u);f&&f.toggleBlurSeries&&f.toggleBlurSeries(l,!0,a)}})}}function af(t,e,r){if(!(t==null||e==null)){var n=r.getModel().getComponent(t,e);if(n){Ju(n).isBlured=!0;var a=r.getViewOfComponentModel(n);!a||!a.focusBlurEnabled||a.group.traverse(function(i){tf(i)})}}}function Dk(t,e,r){var n=t.seriesIndex,a=t.getData(e.dataType);if(a){var i=Xn(a,e);i=(ne(i)?i[0]:i)||0;var o=a.getItemGraphicEl(i);if(!o)for(var s=a.count(),l=0;!o&&l<s;)o=a.getItemGraphicEl(l++);if(o){var c=Ee(o);nf(n,c.focus,c.blurScope,r)}else{var u=t.get(["emphasis","focus"]),f=t.get(["emphasis","blurScope"]);u!=null&&nf(n,u,f,r)}}}function of(t,e,r,n){var a={focusSelf:!1,dispatchers:null};if(t==null||t==="series"||e==null||r==null)return a;var i=n.getModel().getComponent(t,e);if(!i)return a;var o=n.getViewOfComponentModel(i);if(!o||!o.findHighDownDispatchers)return a;for(var s=o.findHighDownDispatchers(r),l,c=0;c<s.length;c++)if(Ee(s[c]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function Ik(t,e,r){var n=Ee(t),a=of(n.componentMainType,n.componentIndex,n.componentHighDownName,r),i=a.dispatchers,o=a.focusSelf;i?(o&&af(n.componentMainType,n.componentIndex,r),D(i,function(s){return kg(s,e)})):(nf(n.seriesIndex,n.focus,n.blurScope,r),n.focus==="self"&&af(n.componentMainType,n.componentIndex,r),kg(t,e))}function Pk(t,e,r){Ig(r);var n=Ee(t),a=of(n.componentMainType,n.componentIndex,n.componentHighDownName,r).dispatchers;a?D(a,function(i){return Tg(i,e)}):Tg(t,e)}function Lk(t,e,r){if(uf(e)){var n=e.dataType,a=t.getData(n),i=Xn(a,e);ne(i)||(i=[i]),t[e.type===$i?"toggleSelect":e.type===Wi?"select":"unselect"](i,n)}}function Pg(t){var e=t.getAllData();D(e,function(r){var n=r.data,a=r.type;n.eachItemGraphicEl(function(i,o){t.isSelected(o,a)?Mg(i):Ag(i)})})}function Rk(t){var e=[];return t.eachSeries(function(r){var n=r.getAllData();D(n,function(a){a.data;var i=a.type,o=r.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:r.seriesIndex};i!=null&&(s.dataType=i),e.push(s)}})}),e}function sf(t,e,r){Rg(t,!0),$r(t,Mk),Ok(t,e,r)}function Ek(t){Rg(t,!1)}function tl(t,e,r,n){n?Ek(t):sf(t,e,r)}function Ok(t,e,r){var n=Ee(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var Lg=["emphasis","blur","select"],Nk={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function lf(t,e,r,n){r=r||"itemStyle";for(var a=0;a<Lg.length;a++){var i=Lg[a],o=e.getModel([i,r]),s=t.ensureState(i);s.style=o[Nk[r]]()}}function Rg(t,e){var r=e===!1,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||n.__highDownDispatcher)&&(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!r)}function cf(t){return!!(t&&t.__highDownDispatcher)}function Bk(t){var e=gg[t];return e==null&&vg<=32&&(e=gg[t]=vg++),e}function uf(t){var e=t.type;return e===Wi||e===js||e===$i}function Eg(t){var e=t.type;return e===Zn||e===Ks}function zk(t){var e=mg(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var Ba=Wn.CMD,Fk=[[],[],[]],Og=Math.sqrt,Hk=Math.atan2;function Vk(t,e){if(e){var r=t.data,n=t.len(),a,i,o,s,l,c,u=Ba.M,f=Ba.C,h=Ba.L,d=Ba.R,p=Ba.A,m=Ba.Q;for(o=0,s=0;o<n;){switch(a=r[o++],s=o,i=0,a){case u:i=1;break;case h:i=1;break;case f:i=3;break;case m:i=2;break;case p:var v=e[4],g=e[5],y=Og(e[0]*e[0]+e[1]*e[1]),b=Og(e[2]*e[2]+e[3]*e[3]),x=Hk(-e[1]/b,e[0]/y);r[o]*=y,r[o++]+=v,r[o]*=b,r[o++]+=g,r[o++]*=y,r[o++]*=b,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case d:c[0]=r[o++],c[1]=r[o++],Gt(c,c,e),r[s++]=c[0],r[s++]=c[1],c[0]+=r[o++],c[1]+=r[o++],Gt(c,c,e),r[s++]=c[0],r[s++]=c[1]}for(l=0;l<i;l++){var S=Fk[l];S[0]=r[o++],S[1]=r[o++],Gt(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var ff=Math.sqrt,rl=Math.sin,nl=Math.cos,Ui=Math.PI;function Ng(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function hf(t,e){return(t[0]*e[0]+t[1]*e[1])/(Ng(t)*Ng(e))}function Bg(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(hf(t,e))}function zg(t,e,r,n,a,i,o,s,l,c,u){var f=l*(Ui/180),h=nl(f)*(t-r)/2+rl(f)*(e-n)/2,d=-1*rl(f)*(t-r)/2+nl(f)*(e-n)/2,p=h*h/(o*o)+d*d/(s*s);p>1&&(o*=ff(p),s*=ff(p));var m=(a===i?-1:1)*ff((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,v=m*o*d/s,g=m*-s*h/o,y=(t+r)/2+nl(f)*v-rl(f)*g,b=(e+n)/2+rl(f)*v+nl(f)*g,x=Bg([1,0],[(h-v)/o,(d-g)/s]),S=[(h-v)/o,(d-g)/s],w=[(-1*h-v)/o,(-1*d-g)/s],k=Bg(S,w);if(hf(S,w)<=-1&&(k=Ui),hf(S,w)>=1&&(k=0),k<0){var T=Math.round(k/Ui*1e6)/1e6;k=Ui*2+T%2*Ui}u.addData(c,y,b,o,s,x,k,f,i)}var Gk=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,Wk=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function $k(t){var e=new Wn;if(!t)return e;var r=0,n=0,a=r,i=n,o,s=Wn.CMD,l=t.match(Gk);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],f=u.charAt(0),h=void 0,d=u.match(Wk)||[],p=d.length,m=0;m<p;m++)d[m]=parseFloat(d[m]);for(var v=0;v<p;){var g=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=r,M=n,A=void 0,C=void 0;switch(f){case"l":r+=d[v++],n+=d[v++],h=s.L,e.addData(h,r,n);break;case"L":r=d[v++],n=d[v++],h=s.L,e.addData(h,r,n);break;case"m":r+=d[v++],n+=d[v++],h=s.M,e.addData(h,r,n),a=r,i=n,f="l";break;case"M":r=d[v++],n=d[v++],h=s.M,e.addData(h,r,n),a=r,i=n,f="L";break;case"h":r+=d[v++],h=s.L,e.addData(h,r,n);break;case"H":r=d[v++],h=s.L,e.addData(h,r,n);break;case"v":n+=d[v++],h=s.L,e.addData(h,r,n);break;case"V":n=d[v++],h=s.L,e.addData(h,r,n);break;case"C":h=s.C,e.addData(h,d[v++],d[v++],d[v++],d[v++],d[v++],d[v++]),r=d[v-2],n=d[v-1];break;case"c":h=s.C,e.addData(h,d[v++]+r,d[v++]+n,d[v++]+r,d[v++]+n,d[v++]+r,d[v++]+n),r+=d[v-2],n+=d[v-1];break;case"S":g=r,y=n,A=e.len(),C=e.data,o===s.C&&(g+=r-C[A-4],y+=n-C[A-3]),h=s.C,T=d[v++],M=d[v++],r=d[v++],n=d[v++],e.addData(h,g,y,T,M,r,n);break;case"s":g=r,y=n,A=e.len(),C=e.data,o===s.C&&(g+=r-C[A-4],y+=n-C[A-3]),h=s.C,T=r+d[v++],M=n+d[v++],r+=d[v++],n+=d[v++],e.addData(h,g,y,T,M,r,n);break;case"Q":T=d[v++],M=d[v++],r=d[v++],n=d[v++],h=s.Q,e.addData(h,T,M,r,n);break;case"q":T=d[v++]+r,M=d[v++]+n,r+=d[v++],n+=d[v++],h=s.Q,e.addData(h,T,M,r,n);break;case"T":g=r,y=n,A=e.len(),C=e.data,o===s.Q&&(g+=r-C[A-4],y+=n-C[A-3]),r=d[v++],n=d[v++],h=s.Q,e.addData(h,g,y,r,n);break;case"t":g=r,y=n,A=e.len(),C=e.data,o===s.Q&&(g+=r-C[A-4],y+=n-C[A-3]),r+=d[v++],n+=d[v++],h=s.Q,e.addData(h,g,y,r,n);break;case"A":b=d[v++],x=d[v++],S=d[v++],w=d[v++],k=d[v++],T=r,M=n,r=d[v++],n=d[v++],h=s.A,zg(T,M,r,n,w,k,b,x,S,h,e);break;case"a":b=d[v++],x=d[v++],S=d[v++],w=d[v++],k=d[v++],T=r,M=n,r+=d[v++],n+=d[v++],h=s.A,zg(T,M,r,n,w,k,b,x,S,h,e);break}}(f==="z"||f==="Z")&&(h=s.Z,e.addData(h),r=a,n=i),o=h}return e.toStatic(),e}var Fg=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e})(Oe);function Hg(t){return t.setData!=null}function Vg(t,e){var r=$k(t),n=G({},e);return n.buildPath=function(a){if(Hg(a)){a.setData(r.data);var i=a.getContext();i&&a.rebuildPath(i,1)}else{var i=a;r.rebuildPath(i,1)}},n.applyTransform=function(a){Vk(r,a),this.dirtyShape()},n}function Uk(t,e){return new Fg(Vg(t,e))}function Yk(t,e){var r=Vg(t,e),n=(function(a){U(i,a);function i(o){var s=a.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return i})(Fg);return n}function qk(t,e){for(var r=[],n=t.length,a=0;a<n;a++){var i=t[a];r.push(i.getUpdatedPathProxy(!0))}var o=new Oe(e);return o.createPathProxy(),o.buildPath=function(s){if(Hg(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var ct=(function(t){U(e,t);function e(r){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var n=this._children,a=0;a<n.length;a++)if(n[a].name===r)return n[a]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(r){return r&&r!==this&&r.parent!==this&&(this._children.push(r),this._doAdd(r)),this},e.prototype.addBefore=function(r,n){if(r&&r!==this&&r.parent!==this&&n&&n.parent===this){var a=this._children,i=a.indexOf(n);i>=0&&(a.splice(i,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var a=Pe(this._children,r);return a>=0&&this.replaceAt(n,a),this},e.prototype.replaceAt=function(r,n){var a=this._children,i=a[n];if(r&&r!==this&&r.parent!==this&&r!==i){a[n]=r,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,a=this._children,i=Pe(a,r);return i<0?this:(a.splice(i,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,a=0;a<r.length;a++){var i=r[a];n&&i.removeSelfFromZr(n),i.parent=null}return r.length=0,this},e.prototype.eachChild=function(r,n){for(var a=this._children,i=0;i<a.length;i++){var o=a[i];r.call(n,o,i)}return this},e.prototype.traverse=function(r,n){for(var a=0;a<this._children.length;a++){var i=this._children[a],o=r.call(n,i);i.isGroup&&!o&&i.traverse(r,n)}return this},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.addSelfToZr(r)}},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.removeSelfFromZr(r)}},e.prototype.getBoundingRect=function(r){for(var n=new Le(0,0,0,0),a=r||this._children,i=[],o=null,s=0;s<a.length;s++){var l=a[s];if(!(l.ignore||l.invisible)){var c=l.getBoundingRect(),u=l.getLocalTransform(i);u?(Le.applyTransform(n,c,u),o=o||n.clone(),o.union(n)):(o=o||c.clone(),o.union(c))}}return o||n},e})(Fs);ct.prototype.type="group";var Xk=(function(){function t(){this.cx=0,this.cy=0,this.r=0}return t})(),al=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Xk},e.prototype.buildPath=function(r,n){r.moveTo(n.cx+n.r,n.cy),r.arc(n.cx,n.cy,n.r,0,Math.PI*2)},e})(Oe);al.prototype.type="circle";var Zk=(function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t})(),df=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Zk},e.prototype.buildPath=function(r,n){var a=.5522848,i=n.cx,o=n.cy,s=n.rx,l=n.ry,c=s*a,u=l*a;r.moveTo(i-s,o),r.bezierCurveTo(i-s,o-u,i-c,o-l,i,o-l),r.bezierCurveTo(i+c,o-l,i+s,o-u,i+s,o),r.bezierCurveTo(i+s,o+u,i+c,o+l,i,o+l),r.bezierCurveTo(i-c,o+l,i-s,o+u,i-s,o),r.closePath()},e})(Oe);df.prototype.type="ellipse";var Gg=Math.PI,pf=Gg*2,Kn=Math.sin,za=Math.cos,Kk=Math.acos,dt=Math.atan2,Wg=Math.abs,Yi=Math.sqrt,qi=Math.max,Dr=Math.min,nr=1e-4;function jk(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=f*l-u*c;if(!(h*h<nr))return h=(u*(e-i)-f*(t-a))/h,[t+h*l,e+h*c]}function il(t,e,r,n,a,i,o){var s=t-r,l=e-n,c=(o?i:-i)/Yi(s*s+l*l),u=c*l,f=-c*s,h=t+u,d=e+f,p=r+u,m=n+f,v=(h+p)/2,g=(d+m)/2,y=p-h,b=m-d,x=y*y+b*b,S=a-i,w=h*m-p*d,k=(b<0?-1:1)*Yi(qi(0,S*S*x-w*w)),T=(w*b-y*k)/x,M=(-w*y-b*k)/x,A=(w*b+y*k)/x,C=(-w*y+b*k)/x,I=T-v,P=M-g,R=A-v,E=C-g;return I*I+P*P>R*R+E*E&&(T=A,M=C),{cx:T,cy:M,x0:-u,y0:-f,x1:T*(a/S-1),y1:M*(a/S-1)}}function Qk(t){var e;if(ne(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function Jk(t,e){var r,n=qi(e.r,0),a=qi(e.r0||0,0),i=n>0,o=a>0;if(!(!i&&!o)){if(i||(n=a,a=0),a>n){var s=n;n=a,a=s}var l=e.startAngle,c=e.endAngle;if(!(isNaN(l)||isNaN(c))){var u=e.cx,f=e.cy,h=!!e.clockwise,d=Wg(c-l),p=d>pf&&d%pf;if(p>nr&&(d=p),!(n>nr))t.moveTo(u,f);else if(d>pf-nr)t.moveTo(u+n*za(l),f+n*Kn(l)),t.arc(u,f,n,l,c,!h),a>nr&&(t.moveTo(u+a*za(c),f+a*Kn(c)),t.arc(u,f,a,c,l,h));else{var m=void 0,v=void 0,g=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=void 0,M=void 0,A=void 0,C=void 0,I=void 0,P=void 0,R=void 0,E=n*za(l),O=n*Kn(l),K=a*za(c),L=a*Kn(c),B=d>nr;if(B){var V=e.cornerRadius;V&&(r=Qk(V),m=r[0],v=r[1],g=r[2],y=r[3]);var $=Wg(n-a)/2;if(b=Dr($,g),x=Dr($,y),S=Dr($,m),w=Dr($,v),M=k=qi(b,x),A=T=qi(S,w),(k>nr||T>nr)&&(C=n*za(c),I=n*Kn(c),P=a*za(l),R=a*Kn(l),d<Gg)){var X=jk(E,O,P,R,C,I,K,L);if(X){var ue=E-X[0],_e=O-X[1],Te=C-X[0],Ue=I-X[1],We=1/Kn(Kk((ue*Te+_e*Ue)/(Yi(ue*ue+_e*_e)*Yi(Te*Te+Ue*Ue)))/2),Ye=Yi(X[0]*X[0]+X[1]*X[1]);M=Dr(k,(n-Ye)/(We+1)),A=Dr(T,(a-Ye)/(We-1))}}}if(!B)t.moveTo(u+E,f+O);else if(M>nr){var J=Dr(g,M),le=Dr(y,M),j=il(P,R,E,O,n,J,h),Q=il(C,I,K,L,n,le,h);t.moveTo(u+j.cx+j.x0,f+j.cy+j.y0),M<k&&J===le?t.arc(u+j.cx,f+j.cy,M,dt(j.y0,j.x0),dt(Q.y0,Q.x0),!h):(J>0&&t.arc(u+j.cx,f+j.cy,J,dt(j.y0,j.x0),dt(j.y1,j.x1),!h),t.arc(u,f,n,dt(j.cy+j.y1,j.cx+j.x1),dt(Q.cy+Q.y1,Q.cx+Q.x1),!h),le>0&&t.arc(u+Q.cx,f+Q.cy,le,dt(Q.y1,Q.x1),dt(Q.y0,Q.x0),!h))}else t.moveTo(u+E,f+O),t.arc(u,f,n,l,c,!h);if(!(a>nr)||!B)t.lineTo(u+K,f+L);else if(A>nr){var J=Dr(m,A),le=Dr(v,A),j=il(K,L,C,I,a,-le,h),Q=il(E,O,P,R,a,-J,h);t.lineTo(u+j.cx+j.x0,f+j.cy+j.y0),A<T&&J===le?t.arc(u+j.cx,f+j.cy,A,dt(j.y0,j.x0),dt(Q.y0,Q.x0),!h):(le>0&&t.arc(u+j.cx,f+j.cy,le,dt(j.y0,j.x0),dt(j.y1,j.x1),!h),t.arc(u,f,a,dt(j.cy+j.y1,j.cx+j.x1),dt(Q.cy+Q.y1,Q.cx+Q.x1),h),J>0&&t.arc(u+Q.cx,f+Q.cy,J,dt(Q.y1,Q.x1),dt(Q.y0,Q.x0),!h))}else t.lineTo(u+K,f+L),t.arc(u,f,a,c,l,h)}t.closePath()}}}var eT=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t})(),Fa=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new eT},e.prototype.buildPath=function(r,n){Jk(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e})(Oe);Fa.prototype.type="sector";var tT=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t})(),vf=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new tT},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.PI*2;r.moveTo(a+n.r,i),r.arc(a,i,n.r,0,o,!1),r.moveTo(a+n.r0,i),r.arc(a,i,n.r0,0,o,!0)},e})(Oe);vf.prototype.type="ring";function rT(t,e,r,n){var a=[],i=[],o=[],s=[],l,c,u,f;if(n){u=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=t.length;h<d;h++)Ma(u,u,t[h]),Aa(f,f,t[h]);Ma(u,u,n[0]),Aa(f,f,n[1])}for(var h=0,d=t.length;h<d;h++){var p=t[h];if(r)l=t[h?h-1:d-1],c=t[(h+1)%d];else if(h===0||h===d-1){a.push(Gw(t[h]));continue}else l=t[h-1],c=t[h+1];Ww(i,c,l),gu(i,i,e);var m=mu(p,l),v=mu(p,c),g=m+v;g!==0&&(m/=g,v/=g),gu(o,i,-m),gu(s,i,v);var y=pv([],p,o),b=pv([],p,s);n&&(Aa(y,y,u),Ma(y,y,f),Aa(b,b,u),Ma(b,b,f)),a.push(y),a.push(b)}return r&&a.push(a.shift()),a}function $g(t,e,r){var n=e.smooth,a=e.points;if(a&&a.length>=2){if(n){var i=rT(a,n,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var o=a.length,s=0;s<(r?o:o-1);s++){var l=i[s*2],c=i[s*2+1],u=a[(s+1)%o];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{t.moveTo(a[0][0],a[0][1]);for(var s=1,f=a.length;s<f;s++)t.lineTo(a[s][0],a[s][1])}r&&t.closePath()}}var nT=(function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t})(),gf=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new nT},e.prototype.buildPath=function(r,n){$g(r,n,!0)},e})(Oe);gf.prototype.type="polygon";var aT=(function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t})(),mf=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new aT},e.prototype.buildPath=function(r,n){$g(r,n,!1)},e})(Oe);mf.prototype.type="polyline";var iT={},oT=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t})(),fn=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new oT},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=$v(iT,n,this.style);a=l.x1,i=l.y1,o=l.x2,s=l.y2}else a=n.x1,i=n.y1,o=n.x2,s=n.y2;var c=n.percent;c!==0&&(r.moveTo(a,i),c<1&&(o=a*(1-c)+o*c,s=i*(1-c)+s*c),r.lineTo(o,s))},e.prototype.pointAt=function(r){var n=this.shape;return[n.x1*(1-r)+n.x2*r,n.y1*(1-r)+n.y2*r]},e})(Oe);fn.prototype.type="line";var Mt=[],sT=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return t})();function Ug(t,e,r){var n=t.cpx2,a=t.cpy2;return n!=null||a!=null?[(r?bv:lt)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?bv:lt)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?wv:St)(t.x1,t.cpx1,t.x2,e),(r?wv:St)(t.y1,t.cpy1,t.y2,e)]}var yf=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new sT},e.prototype.buildPath=function(r,n){var a=n.x1,i=n.y1,o=n.x2,s=n.y2,l=n.cpx1,c=n.cpy1,u=n.cpx2,f=n.cpy2,h=n.percent;h!==0&&(r.moveTo(a,i),u==null||f==null?(h<1&&(Ms(a,l,o,h,Mt),l=Mt[1],o=Mt[2],Ms(i,c,s,h,Mt),c=Mt[1],s=Mt[2]),r.quadraticCurveTo(l,c,o,s)):(h<1&&(Cs(a,l,u,o,h,Mt),l=Mt[1],u=Mt[2],o=Mt[3],Cs(i,c,f,s,h,Mt),c=Mt[1],f=Mt[2],s=Mt[3]),r.bezierCurveTo(l,c,u,f,o,s)))},e.prototype.pointAt=function(r){return Ug(this.shape,r,!1)},e.prototype.tangentAt=function(r){var n=Ug(this.shape,r,!0);return Yw(n,n)},e})(Oe);yf.prototype.type="bezier-curve";var lT=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),ol=(function(t){U(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new lT},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r,0),s=n.startAngle,l=n.endAngle,c=n.clockwise,u=Math.cos(s),f=Math.sin(s);r.moveTo(u*o+a,f*o+i),r.arc(a,i,o,s,l,!c)},e})(Oe);ol.prototype.type="arc";var cT=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="compound",r}return e.prototype._updatePathDirty=function(){for(var r=this.shape.paths,n=this.shapeChanged(),a=0;a<r.length;a++)n=n||r[a].shapeChanged();n&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var r=this.shape.paths||[],n=this.getGlobalScale(),a=0;a<r.length;a++)r[a].path||r[a].createPathProxy(),r[a].path.setScale(n[0],n[1],r[a].segmentIgnoreThreshold)},e.prototype.buildPath=function(r,n){for(var a=n.paths||[],i=0;i<a.length;i++)a[i].buildPath(r,a[i].shape,!0)},e.prototype.afterBrush=function(){for(var r=this.shape.paths||[],n=0;n<r.length;n++)r[n].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),Oe.prototype.getBoundingRect.call(this)},e})(Oe),Yg=(function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t})(),qg=(function(t){U(e,t);function e(r,n,a,i,o,s){var l=t.call(this,o)||this;return l.x=r??0,l.y=n??0,l.x2=a??1,l.y2=i??0,l.type="linear",l.global=s||!1,l}return e})(Yg),uT=(function(t){U(e,t);function e(r,n,a,i,o){var s=t.call(this,i)||this;return s.x=r??.5,s.y=n??.5,s.r=a??.5,s.type="radial",s.global=o||!1,s}return e})(Yg),jn=[0,0],Qn=[0,0],sl=new Be,ll=new Be,cl=(function(){function t(e,r){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Be;for(var n=0;n<2;n++)this._axes[n]=new Be;e&&this.fromBoundingRect(e,r)}return t.prototype.fromBoundingRect=function(e,r){var n=this._corners,a=this._axes,i=e.x,o=e.y,s=i+e.width,l=o+e.height;if(n[0].set(i,o),n[1].set(s,o),n[2].set(s,l),n[3].set(i,l),r)for(var c=0;c<4;c++)n[c].transform(r);Be.sub(a[0],n[1],n[0]),Be.sub(a[1],n[3],n[0]),a[0].normalize(),a[1].normalize();for(var c=0;c<2;c++)this._origin[c]=a[c].dot(n[0])},t.prototype.intersect=function(e,r){var n=!0,a=!r;return sl.set(1/0,1/0),ll.set(0,0),!this._intersectCheckOneSide(this,e,sl,ll,a,1)&&(n=!1,a)||!this._intersectCheckOneSide(e,this,sl,ll,a,-1)&&(n=!1,a)||a||Be.copy(r,n?sl:ll),n},t.prototype._intersectCheckOneSide=function(e,r,n,a,i,o){for(var s=!0,l=0;l<2;l++){var c=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,jn),this._getProjMinMaxOnAxis(l,r._corners,Qn),jn[1]<Qn[0]||jn[0]>Qn[1]){if(s=!1,i)return s;var u=Math.abs(Qn[0]-jn[1]),f=Math.abs(jn[0]-Qn[1]);Math.min(u,f)>a.len()&&(u<f?Be.scale(a,c,-u*o):Be.scale(a,c,f*o))}else if(n){var u=Math.abs(Qn[0]-jn[1]),f=Math.abs(jn[0]-Qn[1]);Math.min(u,f)<n.len()&&(u<f?Be.scale(n,c,u*o):Be.scale(n,c,-f*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var a=this._axes[e],i=this._origin,o=r[0].dot(a)+i[e],s=o,l=o,c=1;c<r.length;c++){var u=r[c].dot(a)+i[e];s=Math.min(u,s),l=Math.max(u,l)}n[0]=s,n[1]=l},t})(),fT=[],hT=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.notClear=!0,r.incremental=!0,r._displayables=[],r._temporaryDisplayables=[],r._cursor=0,r}return e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(r,n){n?this._temporaryDisplayables.push(r):this._displayables.push(r),this.markRedraw()},e.prototype.addDisplayables=function(r,n){n=n||!1;for(var a=0;a<r.length;a++)this.addDisplayable(r[a],n)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(r){for(var n=this._cursor;n<this._displayables.length;n++)r&&r(this._displayables[n]);for(var n=0;n<this._temporaryDisplayables.length;n++)r&&r(this._temporaryDisplayables[n])},e.prototype.update=function(){this.updateTransform();for(var r=this._cursor;r<this._displayables.length;r++){var n=this._displayables[r];n.parent=this,n.update(),n.parent=null}for(var r=0;r<this._temporaryDisplayables.length;r++){var n=this._temporaryDisplayables[r];n.parent=this,n.update(),n.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var r=new Le(1/0,1/0,-1/0,-1/0),n=0;n<this._displayables.length;n++){var a=this._displayables[n],i=a.getBoundingRect().clone();a.needLocalTransform()&&i.applyTransform(a.getLocalTransform(fT)),r.union(i)}this._rect=r}return this._rect},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();if(i.contain(a[0],a[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(r,n))return!0}return!1},e})(Ni),dT=je();function pT(t,e,r,n,a){var i;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();i=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=t==="update";if(s){var c=void 0,u=void 0,f=void 0;n?(c=ke(n.duration,200),u=ke(n.easing,"cubicOut"),f=0):(c=e.getShallow(l?"animationDurationUpdate":"animationDuration"),u=e.getShallow(l?"animationEasingUpdate":"animationEasing"),f=e.getShallow(l?"animationDelayUpdate":"animationDelay")),i&&(i.duration!=null&&(c=i.duration),i.easing!=null&&(u=i.easing),i.delay!=null&&(f=i.delay)),ye(f)&&(f=f(r,a)),ye(c)&&(c=c(r));var h={duration:c||0,delay:f,easing:u};return h}else return null}function _f(t,e,r,n,a,i,o){var s=!1,l;ye(a)?(o=i,i=a,a=null):ce(a)&&(i=a.cb,o=a.during,s=a.isFrom,l=a.removeOpt,a=a.dataIndex);var c=t==="leave";c||e.stopAnimation("leave");var u=pT(t,n,a,c?l||{}:null,n&&n.getAnimationDelayParams?n.getAnimationDelayParams(e,a):null);if(u&&u.duration>0){var f=u.duration,h=u.delay,d=u.easing,p={duration:f,delay:h||0,easing:d,done:i,force:!!i||!!o,setToFinal:!c,scope:t,during:o};s?e.animateFrom(r,p):e.animateTo(r,p)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),i&&i()}function Nt(t,e,r,n,a,i){_f("update",t,e,r,n,a,i)}function Ur(t,e,r,n,a,i){_f("enter",t,e,r,n,a,i)}function Xi(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){var r=t.animators[e];if(r.scope==="leave")return!0}return!1}function ul(t,e,r,n,a,i){Xi(t)||_f("leave",t,e,r,n,a,i)}function Xg(t,e,r,n){t.removeTextContent(),t.removeTextGuideLine(),ul(t,{style:{opacity:0}},e,r,n)}function bf(t,e,r){function n(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(a){a.isGroup||Xg(a,e,r,n)}):Xg(t,e,r,n)}function Zg(t){dT(t).oldStyle=t.style}var fl=Math.max,hl=Math.min,xf={};function vT(t){return Oe.extend(t)}var gT=Yk;function mT(t,e){return gT(t,e)}function ar(t,e){xf[t]=e}function yT(t){if(xf.hasOwnProperty(t))return xf[t]}function wf(t,e,r,n){var a=Uk(t,e);return r&&(n==="center"&&(r=jg(r,a.getBoundingRect())),Qg(a,r)),a}function Kg(t,e,r){var n=new un({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(a){if(r==="center"){var i={width:a.width,height:a.height};n.setStyle(jg(e,i))}}});return n}function jg(t,e){var r=e.width/e.height,n=t.height*r,a;n<=t.width?a=t.height:(n=t.width,a=n/r);var i=t.x+t.width/2,o=t.y+t.height/2;return{x:i-n/2,y:o-a/2,width:n,height:a}}var _T=qk;function Qg(t,e){if(t.applyTransform){var r=t.getBoundingRect(),n=r.calculateTransform(e);t.applyTransform(n)}}function Zi(t,e){return $v(t,t,{lineWidth:e}),t}function bT(t){return Uv(t.shape,t.shape,t.style),t}var xT=Yn;function wT(t,e){for(var r=lu([]);t&&t!==e;)Sa(r,t.getLocalTransform(),r),t=t.parent;return r}function Sf(t,e,r){return e&&!xt(e)&&(e=bu.getLocalTransform(e)),r&&(e=fu([],e)),Gt([],t,e)}function ST(t,e,r){var n=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),a=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),i=[t==="left"?-n:t==="right"?n:0,t==="top"?-a:t==="bottom"?a:0];return i=Sf(i,e,r),Math.abs(i[0])>Math.abs(i[1])?i[0]>0?"right":"left":i[1]>0?"bottom":"top"}function Jg(t){return!t.isGroup}function kT(t){return t.shape!=null}function em(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){Jg(l)&&l.anid&&(s[l.anid]=l)}),s}function a(o){var s={x:o.x,y:o.y,rotation:o.rotation};return kT(o)&&(s.shape=G({},o.shape)),s}var i=n(t);e.traverse(function(o){if(Jg(o)&&o.anid){var s=i[o.anid];if(s){var l=a(o);o.attr(a(s)),Nt(o,l,r,Ee(o).dataIndex)}}})}function TT(t,e){return fe(t,function(r){var n=r[0];n=fl(n,e.x),n=hl(n,e.x+e.width);var a=r[1];return a=fl(a,e.y),a=hl(a,e.y+e.height),[n,a]})}function CT(t,e){var r=fl(t.x,e.x),n=hl(t.x+t.width,e.x+e.width),a=fl(t.y,e.y),i=hl(t.y+t.height,e.y+e.height);if(n>=r&&i>=a)return{x:r,y:a,width:n-r,height:i-a}}function kf(t,e,r){var n=G({rectHover:!0},e),a=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(a.image=t.slice(8),Ie(a,r),new un(n)):wf(t.replace("path://",""),n,r,"center")}function MT(t,e,r,n,a){for(var i=0,o=a[a.length-1];i<a.length;i++){var s=a[i];if(tm(t,e,r,n,s[0],s[1],o[0],o[1]))return!0;o=s}}function tm(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=Tf(u,f,l,c);if(AT(h))return!1;var d=t-a,p=e-i,m=Tf(d,p,l,c)/h;if(m<0||m>1)return!1;var v=Tf(d,p,u,f)/h;return!(v<0||v>1)}function Tf(t,e,r,n){return t*n-r*e}function AT(t){return t<=1e-6&&t>=-1e-6}function dl(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,a=oe(e)?{formatter:e}:e,i=r.mainType,o=r.componentIndex,s={componentType:i,name:n,$vars:["name"]};s[i+"Index"]=o;var l=t.formatterParamsExtra;l&&D(Ge(l),function(u){Dn(s,u)||(s[u]=l[u],s.$vars.push(u))});var c=Ee(t.el);c.componentMainType=i,c.componentIndex=o,c.tooltipConfig={name:n,option:Ie({content:n,encodeHTMLContent:!0,formatterParams:s},a)}}function rm(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function pl(t,e){if(t)if(ne(t))for(var r=0;r<t.length;r++)rm(t[r],e);else rm(t,e)}ar("circle",al),ar("ellipse",df),ar("sector",Fa),ar("ring",vf),ar("polygon",gf),ar("polyline",mf),ar("rect",at),ar("line",fn),ar("bezierCurve",yf),ar("arc",ol);const DT=Object.freeze(Object.defineProperty({__proto__:null,Arc:ol,BezierCurve:yf,BoundingRect:Le,Circle:al,CompoundPath:cT,Ellipse:df,Group:ct,Image:un,IncrementalDisplayable:hT,Line:fn,LinearGradient:qg,OrientedBoundingRect:cl,Path:Oe,Point:Be,Polygon:gf,Polyline:mf,RadialGradient:uT,Rect:at,Ring:vf,Sector:Fa,Text:kt,applyTransform:Sf,clipPointsByRect:TT,clipRectByRect:CT,createIcon:kf,extendPath:mT,extendShape:vT,getShapeClass:yT,getTransform:wT,groupTransition:em,initProps:Ur,isElementRemoved:Xi,lineLineIntersect:tm,linePolygonIntersect:MT,makeImage:Kg,makePath:wf,mergePath:_T,registerShape:ar,removeElement:ul,removeElementWithFadeOut:bf,resizePath:Qg,setTooltipConfig:dl,subPixelOptimize:xT,subPixelOptimizeLine:Zi,subPixelOptimizeRect:bT,transformDirection:ST,traverseElements:pl,updateProps:Nt},Symbol.toStringTag,{value:"Module"}));var vl={};function IT(t,e){for(var r=0;r<Ar.length;r++){var n=Ar[r],a=e[n],i=t.ensureState(n);i.style=i.style||{},i.style.text=a}var o=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(o,!0)}function nm(t,e,r){var n=t.labelFetcher,a=t.labelDataIndex,i=t.labelDimIndex,o=e.normal,s;n&&(s=n.getFormattedLabel(a,"normal",null,i,o&&o.get("formatter"),r!=null?{interpolatedValue:r}:null)),s==null&&(s=ye(t.defaultText)?t.defaultText(a,t,r):t.defaultText);for(var l={normal:s},c=0;c<Ar.length;c++){var u=Ar[c],f=e[u];l[u]=ke(n?n.getFormattedLabel(a,u,null,i,f&&f.get("formatter")):null,s)}return l}function gl(t,e,r,n){r=r||vl;for(var a=t instanceof kt,i=!1,o=0;o<yg.length;o++){var s=e[yg[o]];if(s&&s.getShallow("show")){i=!0;break}}var l=a?t:t.getTextContent();if(i){a||(l||(l=new kt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var c=nm(r,e),u=e.normal,f=!!u.getShallow("show"),h=Ha(u,n&&n.normal,r,!1,!a);h.text=c.normal,a||t.setTextConfig(am(u,r,!1));for(var o=0;o<Ar.length;o++){var d=Ar[o],s=e[d];if(s){var p=l.ensureState(d),m=!!ke(s.getShallow("show"),f);if(m!==f&&(p.ignore=!m),p.style=Ha(s,n&&n[d],r,!0,!a),p.style.text=c[d],!a){var v=t.ensureState(d);v.textConfig=am(s,r,!0)}}}l.silent=!!u.getShallow("silent"),l.style.x!=null&&(h.x=l.style.x),l.style.y!=null&&(h.y=l.style.y),l.ignore=!f,l.useStyle(h),l.dirty(),r.enableTextSetter&&(yl(l).setLabelText=function(g){var y=nm(r,e,g);IT(l,y)})}else l&&(l.ignore=!0);t.dirty()}function ml(t,e){e=e||"label";for(var r={normal:t.getModel(e)},n=0;n<Ar.length;n++){var a=Ar[n];r[a]=t.getModel([a,e])}return r}function Ha(t,e,r,n,a){var i={};return PT(i,t,r,n,a),e&&G(i,e),i}function am(t,e,r){e=e||{};var n={},a,i=t.getShallow("rotate"),o=ke(t.getShallow("distance"),r?null:5),s=t.getShallow("offset");return a=t.getShallow("position")||(r?null:"inside"),a==="outside"&&(a=e.defaultOutsidePosition||"top"),a!=null&&(n.position=a),s!=null&&(n.offset=s),i!=null&&(i*=Math.PI/180,n.rotation=i),o!=null&&(n.distance=o),n.outsideFill=t.get("color")==="inherit"?e.inheritColor||null:"auto",n}function PT(t,e,r,n,a){r=r||vl;var i=e.ecModel,o=i&&i.option.textStyle,s=LT(e),l;if(s){l={};for(var c in s)if(s.hasOwnProperty(c)){var u=e.getModel(["rich",c]);lm(l[c]={},u,o,r,n,a,!1,!0)}}l&&(t.rich=l);var f=e.get("overflow");f&&(t.overflow=f);var h=e.get("minMargin");h!=null&&(t.margin=h),lm(t,e,o,r,n,a,!0,!1)}function LT(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||vl).rich;if(r){e=e||{};for(var n=Ge(r),a=0;a<n.length;a++){var i=n[a];e[i]=1}}t=t.parentModel}return e}var im=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],om=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],sm=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function lm(t,e,r,n,a,i,o,s){r=!a&&r||vl;var l=n&&n.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),f=ke(e.getShallow("opacity"),r.opacity);(c==="inherit"||c==="auto")&&(l?c=l:c=null),(u==="inherit"||u==="auto")&&(l?u=l:u=null),i||(c=c||r.color,u=u||r.textBorderColor),c!=null&&(t.fill=c),u!=null&&(t.stroke=u);var h=ke(e.getShallow("textBorderWidth"),r.textBorderWidth);h!=null&&(t.lineWidth=h);var d=ke(e.getShallow("textBorderType"),r.textBorderType);d!=null&&(t.lineDash=d);var p=ke(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);p!=null&&(t.lineDashOffset=p),!a&&f==null&&!s&&(f=n&&n.defaultOpacity),f!=null&&(t.opacity=f),!a&&!i&&t.fill==null&&n.inheritColor&&(t.fill=n.inheritColor);for(var m=0;m<im.length;m++){var v=im[m],g=ke(e.getShallow(v),r[v]);g!=null&&(t[v]=g)}for(var m=0;m<om.length;m++){var v=om[m],g=e.getShallow(v);g!=null&&(t[v]=g)}if(t.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(t.verticalAlign=y)}if(!o||!n.disableBox){for(var m=0;m<sm.length;m++){var v=sm[m],g=e.getShallow(v);g!=null&&(t[v]=g)}var b=e.getShallow("borderType");b!=null&&(t.borderDash=b),(t.backgroundColor==="auto"||t.backgroundColor==="inherit")&&l&&(t.backgroundColor=l),(t.borderColor==="auto"||t.borderColor==="inherit")&&l&&(t.borderColor=l)}}function RT(t,e){var r=e&&e.getModel("textStyle");return xr([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))}var yl=je();function ET(t,e,r,n){if(t){var a=yl(t);a.prevValue=a.value,a.value=r;var i=e.normal;a.valueAnimation=i.get("valueAnimation"),a.valueAnimation&&(a.precision=i.get("precision"),a.defaultInterpolatedText=n,a.statesModels=e)}}var OT=["textStyle","color"],Cf=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Mf=new kt,NT=(function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(OT):null)},t.prototype.getFont=function(){return RT({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(e){for(var r={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<Cf.length;n++)r[Cf[n]]=this.getShallow(Cf[n]);return Mf.useStyle(r),Mf.update(),Mf.getBoundingRect()},t})(),cm=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],BT=Ti(cm),zT=(function(){function t(){}return t.prototype.getLineStyle=function(e){return BT(this,e)},t})(),um=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],FT=Ti(um),HT=(function(){function t(){}return t.prototype.getItemStyle=function(e,r){return FT(this,e,r)},t})(),Xe=(function(){function t(e,r,n){this.parentModel=r,this.ecModel=n,this.option=e}return t.prototype.init=function(e,r,n){},t.prototype.mergeOption=function(e,r){Me(this.option,e,!0)},t.prototype.get=function(e,r){return e==null?this.option:this._doGet(this.parsePath(e),!r&&this.parentModel)},t.prototype.getShallow=function(e,r){var n=this.option,a=n==null?n:n[e];if(a==null&&!r){var i=this.parentModel;i&&(a=i.getShallow(e))}return a},t.prototype.getModel=function(e,r){var n=e!=null,a=n?this.parsePath(e):null,i=n?this._doGet(a):this.option;return r=r||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(a)),new t(i,r,this.ecModel)},t.prototype.isEmpty=function(){return this.option==null},t.prototype.restoreData=function(){},t.prototype.clone=function(){var e=this.constructor;return new e(we(this.option))},t.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},t.prototype.resolveParentPath=function(e){return e},t.prototype.isAnimationEnabled=function(){if(!ve.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(e,r){var n=this.option;if(!e)return n;for(var a=0;a<e.length&&!(e[a]&&(n=n&&typeof n=="object"?n[e[a]]:null,n==null));a++);return n==null&&r&&(n=r._doGet(this.resolveParentPath(e),r.parentModel)),n},t})();ou(Xe),Sw(Xe),br(Xe,zT),br(Xe,HT),br(Xe,Aw),br(Xe,NT);function Ki(t){return t==null?0:t.length||1}function fm(t){return t}var VT=(function(){function t(e,r,n,a,i,o){this._old=e,this._new=r,this._oldKeyGetter=n||fm,this._newKeyGetter=a||fm,this.context=i,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},a=new Array(e.length),i=new Array(r.length);this._initIndexMap(e,null,a,"_oldKeyGetter"),this._initIndexMap(r,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=a[o],l=n[s],c=Ki(l);if(c>1){var u=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(u,o)}else c===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},a={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(r,a,o,"_newKeyGetter");for(var s=0;s<i.length;s++){var l=i[s],c=n[l],u=a[l],f=Ki(c),h=Ki(u);if(f>1&&h===1)this._updateManyToOne&&this._updateManyToOne(u,c),a[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(u,c),a[l]=null;else if(f===1&&h===1)this._update&&this._update(u,c),a[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,c),a[l]=null;else if(f>1)for(var d=0;d<f;d++)this._remove&&this._remove(c[d]);else this._remove&&this._remove(c)}this._performRestAdd(o,a)},t.prototype._performRestAdd=function(e,r){for(var n=0;n<e.length;n++){var a=e[n],i=r[a],o=Ki(i);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(i[s]);else o===1&&this._add&&this._add(i);r[a]=null}},t.prototype._initIndexMap=function(e,r,n,a){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[a](e[o],o);if(i||(n[o]=s),!!r){var l=r[s],c=Ki(l);c===0?(r[s]=o,i&&n.push(s)):c===1?r[s]=[l,o]:l.push(o)}}},t})(),hm=de(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Xt="original",At="arrayRows",Ir="objectRows",Yr="keyedColumns",hn="typedArray",dm="unknown",qr="column",Va="row",Bt={Must:1,Might:2,Not:3},pm=je();function GT(t){pm(t).datasetMap=de()}function WT(t,e,r){var n={},a=vm(e);if(!a||!t)return n;var i=[],o=[],s=e.ecModel,l=pm(s).datasetMap,c=a.uid+"_"+r.seriesLayoutBy,u,f;t=t.slice(),D(t,function(m,v){var g=ce(m)?m:t[v]={name:m};g.type==="ordinal"&&u==null&&(u=v,f=p(g)),n[g.name]=[]});var h=l.get(c)||l.set(c,{categoryWayDim:f,valueWayDim:0});D(t,function(m,v){var g=m.name,y=p(m);if(u==null){var b=h.valueWayDim;d(n[g],b,y),d(o,b,y),h.valueWayDim+=y}else if(u===v)d(n[g],0,y),d(i,0,y);else{var b=h.categoryWayDim;d(n[g],b,y),d(o,b,y),h.categoryWayDim+=y}});function d(m,v,g){for(var y=0;y<g;y++)m.push(v+y)}function p(m){var v=m.dimsDef;return v?v.length:1}return i.length&&(n.itemName=i),o.length&&(n.seriesName=o),n}function vm(t){var e=t.get("data",!0);if(!e)return Gi(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},Ct).models[0]}function $T(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:Gi(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},Ct).models}function gm(t,e){return UT(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function UT(t,e,r,n,a,i){var o,s=5;if(wt(t))return Bt.Not;var l,c;if(n){var u=n[i];ce(u)?(l=u.name,c=u.type):oe(u)&&(l=u)}if(c!=null)return c==="ordinal"?Bt.Must:Bt.Not;if(e===At){var f=t;if(r===Va){for(var h=f[i],d=0;d<(h||[]).length&&d<s;d++)if((o=x(h[a+d]))!=null)return o}else for(var d=0;d<f.length&&d<s;d++){var p=f[a+d];if(p&&(o=x(p[i]))!=null)return o}}else if(e===Ir){var m=t;if(!l)return Bt.Not;for(var d=0;d<m.length&&d<s;d++){var v=m[d];if(v&&(o=x(v[l]))!=null)return o}}else if(e===Yr){var g=t;if(!l)return Bt.Not;var h=g[l];if(!h||wt(h))return Bt.Not;for(var d=0;d<h.length&&d<s;d++)if((o=x(h[d]))!=null)return o}else if(e===Xt)for(var y=t,d=0;d<y.length&&d<s;d++){var v=y[d],b=Fi(v);if(!ne(b))return Bt.Not;if((o=x(b[i]))!=null)return o}function x(S){var w=oe(S);if(S!=null&&Number.isFinite(Number(S))&&S!=="")return w?Bt.Might:Bt.Not;if(w&&S!=="-")return Bt.Must}return Bt.Not}var _l=(function(){function t(e){this.data=e.data||(e.sourceFormat===Yr?{}:[]),this.sourceFormat=e.sourceFormat||dm,this.seriesLayoutBy=e.seriesLayoutBy||qr,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;n<r.length;n++){var a=r[n];a.type==null&&gm(this,n)===Bt.Must&&(a.type="ordinal")}}return t})();function Af(t){return t instanceof _l}function Df(t,e,r){r=r||ym(t);var n=e.seriesLayoutBy,a=qT(t,r,n,e.sourceHeader,e.dimensions),i=new _l({data:t,sourceFormat:r,seriesLayoutBy:n,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,metaRawOption:we(e)});return i}function mm(t){return new _l({data:t,sourceFormat:wt(t)?hn:Xt})}function YT(t){return new _l({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:we(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function ym(t){var e=dm;if(wt(t))e=hn;else if(ne(t)){t.length===0&&(e=At);for(var r=0,n=t.length;r<n;r++){var a=t[r];if(a!=null){if(ne(a)||wt(a)){e=At;break}else if(ce(a)){e=Ir;break}}}}else if(ce(t)){for(var i in t)if(Dn(t,i)&&xt(t[i])){e=Yr;break}}return e}function qT(t,e,r,n,a){var i,o;if(!t)return{dimensionsDefine:_m(a),startIndex:o,dimensionsDetectedCount:i};if(e===At){var s=t;n==="auto"||n==null?bm(function(c){c!=null&&c!=="-"&&(oe(c)?o==null&&(o=1):o=0)},r,s,10):o=He(n)?n:n?1:0,!a&&o===1&&(a=[],bm(function(c,u){a[u]=c!=null?c+"":""},r,s,1/0)),i=a?a.length:r===Va?s.length:s[0]?s[0].length:null}else if(e===Ir)a||(a=XT(t));else if(e===Yr)a||(a=[],D(t,function(c,u){a.push(u)}));else if(e===Xt){var l=Fi(t[0]);i=ne(l)&&l.length||1}return{startIndex:o,dimensionsDefine:_m(a),dimensionsDetectedCount:i}}function XT(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return Ge(r)}function _m(t){if(t){var e=de();return fe(t,function(r,n){r=ce(r)?r:{name:r};var a={name:r.name,displayName:r.displayName,type:r.type};if(a.name==null)return a;a.name+="",a.displayName==null&&(a.displayName=a.name);var i=e.get(a.name);return i?a.name+="-"+i.count++:e.set(a.name,{count:1}),a})}}function bm(t,e,r,n){if(e===Va)for(var a=0;a<r.length&&a<n;a++)t(r[a]?r[a][0]:null,a);else for(var i=r[0]||[],a=0;a<i.length&&a<n;a++)t(i[a],a)}function xm(t){var e=t.sourceFormat;return e===Ir||e===Yr}var Jn,ea,ta,wm,Sm,km=(function(){function t(e,r){var n=Af(e)?e:mm(e);this._source=n;var a=this._data=n.data;n.sourceFormat===hn&&(this._offset=0,this._dimSize=r,this._data=a),Sm(this,a,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,r){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=(function(){var e=t.prototype;e.pure=!1,e.persistent=!0})(),t.internalField=(function(){var e;Sm=function(o,s,l){var c=l.sourceFormat,u=l.seriesLayoutBy,f=l.startIndex,h=l.dimensionsDefine,d=wm[Pf(c,u)];if(G(o,d),c===hn)o.getItem=r,o.count=a,o.fillStorage=n;else{var p=Cm(c,u);o.getItem=Ae(p,null,s,f,h);var m=Am(c,u);o.count=Ae(m,null,s,f,h)}};var r=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,c=this._dimSize,u=c*o,f=0;f<c;f++)s[f]=l[u+f];return s},n=function(o,s,l,c){for(var u=this._data,f=this._dimSize,h=0;h<f;h++){for(var d=c[h],p=d[0]==null?1/0:d[0],m=d[1]==null?-1/0:d[1],v=s-o,g=l[h],y=0;y<v;y++){var b=u[y*f+h];g[o+y]=b,b<p&&(p=b),b>m&&(m=b)}d[0]=p,d[1]=m}},a=function(){return this._data?this._data.length/this._dimSize:0};wm=(e={},e[At+"_"+qr]={pure:!0,appendData:i},e[At+"_"+Va]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Ir]={pure:!0,appendData:i},e[Yr]={pure:!0,appendData:function(o){var s=this._data;D(o,function(l,c){for(var u=s[c]||(s[c]=[]),f=0;f<(l||[]).length;f++)u.push(l[f])})}},e[Xt]={appendData:i},e[hn]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}})(),t})(),Tm=function(t,e,r,n){return t[n]},ZT=(Jn={},Jn[At+"_"+qr]=function(t,e,r,n){return t[n+e]},Jn[At+"_"+Va]=function(t,e,r,n,a){n+=e;for(var i=a||[],o=t,s=0;s<o.length;s++){var l=o[s];i[s]=l?l[n]:null}return i},Jn[Ir]=Tm,Jn[Yr]=function(t,e,r,n,a){for(var i=a||[],o=0;o<r.length;o++){var s=r[o].name,l=t[s];i[o]=l?l[n]:null}return i},Jn[Xt]=Tm,Jn);function Cm(t,e){var r=ZT[Pf(t,e)];return r}var Mm=function(t,e,r){return t.length},KT=(ea={},ea[At+"_"+qr]=function(t,e,r){return Math.max(0,t.length-e)},ea[At+"_"+Va]=function(t,e,r){var n=t[0];return n?Math.max(0,n.length-e):0},ea[Ir]=Mm,ea[Yr]=function(t,e,r){var n=r[0].name,a=t[n];return a?a.length:0},ea[Xt]=Mm,ea);function Am(t,e){var r=KT[Pf(t,e)];return r}var If=function(t,e,r){return t[e]},jT=(ta={},ta[At]=If,ta[Ir]=function(t,e,r){return t[r]},ta[Yr]=If,ta[Xt]=function(t,e,r){var n=Fi(t);return n instanceof Array?n[e]:n},ta[hn]=If,ta);function Dm(t){var e=jT[t];return e}function Pf(t,e){return t===At?t+"_"+e:t}function Ga(t,e,r){if(t){var n=t.getRawDataItem(e);if(n!=null){var a=t.getStore(),i=a.getSource().sourceFormat;if(r!=null){var o=t.getDimensionIndex(r),s=a.getDimensionProperty(o);return Dm(i)(n,o,s)}else{var l=n;return i===Xt&&(l=Fi(n)),l}}}}var QT=(function(){function t(e,r){this._encode=e,this._schema=r}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t})();function JT(t,e){var r={},n=r.encode={},a=de(),i=[],o=[],s={};D(t.dimensions,function(h){var d=t.getDimensionInfo(h),p=d.coordDim;if(p){var m=d.coordDimIndex;Lf(n,p)[m]=h,d.isExtraCoord||(a.set(p,1),t2(d.type)&&(i[0]=h),Lf(s,p)[m]=t.getDimensionIndex(d.name)),d.defaultTooltip&&o.push(h)}hm.each(function(v,g){var y=Lf(n,g),b=d.otherDims[g];b!=null&&b!==!1&&(y[b]=d.name)})});var l=[],c={};a.each(function(h,d){var p=n[d];c[d]=p[0],l=l.concat(p)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=fe(l,function(h){return t.getDimensionInfo(h).storeDimIndex}),r.encodeFirstDimNotExtra=c;var u=n.label;u&&u.length&&(i=u.slice());var f=n.tooltip;return f&&f.length?o=f.slice():o.length||(o=i.slice()),n.defaultedLabel=i,n.defaultedTooltip=o,r.userOutput=new QT(s,e),r}function Lf(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function e2(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function t2(t){return!(t==="ordinal"||t==="time")}var bl=(function(){function t(e){this.otherDims={},e!=null&&G(this,e)}return t})();function xl(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!He(t)&&t!=null&&t!=="-"&&(t=+Wr(t)),t==null||t===""?NaN:Number(t))}de({number:function(t){return parseFloat(t)},time:function(t){return+Wr(t)},trim:function(t){return oe(t)?xr(t):t}});var r2=(function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=He(e)?e:qs(e),a=He(r)?r:qs(r),i=isNaN(n),o=isNaN(a);if(i&&(n=this._incomparable),o&&(a=this._incomparable),i&&o){var s=oe(e),l=oe(r);s&&(n=l?e:0),l&&(a=s?r:0)}return n<a?this._resultLT:n>a?-this._resultLT:0},t})(),wl="undefined",n2=typeof Uint32Array===wl?Array:Uint32Array,a2=typeof Uint16Array===wl?Array:Uint16Array,Im=typeof Int32Array===wl?Array:Int32Array,Pm=typeof Float64Array===wl?Array:Float64Array,Lm={float:Pm,int:Im,ordinal:Array,number:Array,time:Pm},Rf;function Wa(t){return t>65535?n2:a2}function $a(){return[1/0,-1/0]}function i2(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Rm(t,e,r,n,a){var i=Lm[r||"float"];if(a){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new i(n),c=0;c<s;c++)l[c]=o[c];t[e]=l}}else t[e]=new i(n)}var Ef=(function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=de()}return t.prototype.initData=function(e,r,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var a=e.getSource(),i=this.defaultDimValueGetter=Rf[a.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],xm(a),this._dimensions=fe(r,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(e,r){var n=this._calcDimNameToIdx,a=this._dimensions,i=n.get(e);if(i!=null){if(a[i].type===r)return i}else i=a.length;return a[i]={type:r},n.set(e,i),this._chunks[i]=new Lm[r||"float"](this._rawCount),this._rawExtent[i]=$a(),i},t.prototype.collectOrdinalMeta=function(e,r){var n=this._chunks[e],a=this._dimensions[e],i=this._rawExtent,o=a.ordinalOffset||0,s=n.length;o===0&&(i[e]=$a());for(var l=i[e],c=o;c<s;c++){var u=n[c]=r.parseAndCollect(n[c]);isNaN(u)||(l[0]=Math.min(u,l[0]),l[1]=Math.max(u,l[1]))}a.ordinalMeta=r,a.ordinalOffset=s,a.type="ordinal"},t.prototype.getOrdinalMeta=function(e){var r=this._dimensions[e],n=r.ordinalMeta;return n},t.prototype.getDimensionProperty=function(e){var r=this._dimensions[e];return r&&r.property},t.prototype.appendData=function(e){var r=this._provider,n=this.count();r.appendData(e);var a=r.count();return r.persistent||(a+=n),n<a&&this._initDataFromProvider(n,a,!0),[n,a]},t.prototype.appendValues=function(e,r){for(var n=this._chunks,a=this._dimensions,i=a.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,r||0),c=0;c<i;c++){var u=a[c];Rm(n,c,u.type,l,!0)}for(var f=[],h=s;h<l;h++)for(var d=h-s,p=0;p<i;p++){var u=a[p],m=Rf.arrayRows.call(this,e[d]||f,u.property,d,p);n[p][h]=m;var v=o[p];m<v[0]&&(v[0]=m),m>v[1]&&(v[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var a=this._provider,i=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,c=fe(o,function(y){return y.property}),u=0;u<s;u++){var f=o[u];l[u]||(l[u]=$a()),Rm(i,u,f.type,r,n)}if(a.fillStorage)a.fillStorage(e,r,i,l);else for(var h=[],d=e;d<r;d++){h=a.getItem(d,h);for(var p=0;p<s;p++){var m=i[p],v=this._dimValueGetter(h,c[p],d,p);m[d]=v;var g=l[p];v<g[0]&&(g[0]=v),v>g[1]&&(g[1]=v)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(r)]:NaN},t.prototype.getValues=function(e,r){var n=[],a=[];if(r==null){r=e,e=[];for(var i=0;i<this._dimensions.length;i++)a.push(i)}else a=e;for(var i=0,o=a.length;i<o;i++)n.push(this.get(a[i],r));return n},t.prototype.getByRawIndex=function(e,r){if(!(r>=0&&r<this._rawCount))return NaN;var n=this._chunks[e];return n?n[r]:NaN},t.prototype.getSum=function(e){var r=this._chunks[e],n=0;if(r)for(var a=0,i=this.count();a<i;a++){var o=this.get(e,a);isNaN(o)||(n+=o)}return n},t.prototype.getMedian=function(e){var r=[];this.each([e],function(i){isNaN(i)||r.push(i)});var n=r.sort(function(i,o){return i-o}),a=this.count();return a===0?0:a%2===1?n[(a-1)/2]:(n[a/2]+n[a/2-1])/2},t.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&n<this._count&&n===e)return e;for(var a=0,i=this._count-1;a<=i;){var o=(a+i)/2|0;if(r[o]<e)a=o+1;else if(r[o]>e)i=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,n){var a=this._chunks,i=a[e],o=[];if(!i)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,c=0,u=0,f=this.count();u<f;u++){var h=this.getRawIndex(u),d=r-i[h],p=Math.abs(d);p<=n&&((p<s||p===s&&d>=0&&l<0)&&(s=p,l=d,c=0),d===l&&(o[c++]=u))}return o.length=c,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,a=this._count;if(n===Array){e=new n(a);for(var i=0;i<a;i++)e[i]=r[i]}else e=new n(r.buffer,0,a)}else{var n=Wa(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},t.prototype.filter=function(e,r){if(!this._count)return this;for(var n=this.clone(),a=n.count(),i=Wa(n._rawCount),o=new i(a),s=[],l=e.length,c=0,u=e[0],f=n._chunks,h=0;h<a;h++){var d=void 0,p=n.getRawIndex(h);if(l===0)d=r(h);else if(l===1){var m=f[u][p];d=r(m,h)}else{for(var v=0;v<l;v++)s[v]=f[e[v]][p];s[v]=h,d=r.apply(null,s)}d&&(o[c++]=p)}return c<a&&(n._indices=o),n._count=c,n._extent=[],n._updateGetRawIdx(),n},t.prototype.selectRange=function(e){var r=this.clone(),n=r._count;if(!n)return this;var a=Ge(e),i=a.length;if(!i)return this;var o=r.count(),s=Wa(r._rawCount),l=new s(o),c=0,u=a[0],f=e[u][0],h=e[u][1],d=r._chunks,p=!1;if(!r._indices){var m=0;if(i===1){for(var v=d[a[0]],g=0;g<n;g++){var y=v[g];(y>=f&&y<=h||isNaN(y))&&(l[c++]=m),m++}p=!0}else if(i===2){for(var v=d[a[0]],b=d[a[1]],x=e[a[1]][0],S=e[a[1]][1],g=0;g<n;g++){var y=v[g],w=b[g];(y>=f&&y<=h||isNaN(y))&&(w>=x&&w<=S||isNaN(w))&&(l[c++]=m),m++}p=!0}}if(!p)if(i===1)for(var g=0;g<o;g++){var k=r.getRawIndex(g),y=d[a[0]][k];(y>=f&&y<=h||isNaN(y))&&(l[c++]=k)}else for(var g=0;g<o;g++){for(var T=!0,k=r.getRawIndex(g),M=0;M<i;M++){var A=a[M],y=d[A][k];(y<e[A][0]||y>e[A][1])&&(T=!1)}T&&(l[c++]=r.getRawIndex(g))}return c<o&&(r._indices=l),r._count=c,r._extent=[],r._updateGetRawIdx(),r},t.prototype.map=function(e,r){var n=this.clone(e);return this._updateDims(n,e,r),n},t.prototype.modify=function(e,r){this._updateDims(this,e,r)},t.prototype._updateDims=function(e,r,n){for(var a=e._chunks,i=[],o=r.length,s=e.count(),l=[],c=e._rawExtent,u=0;u<r.length;u++)c[r[u]]=$a();for(var f=0;f<s;f++){for(var h=e.getRawIndex(f),d=0;d<o;d++)l[d]=a[r[d]][h];l[o]=f;var p=n&&n.apply(null,l);if(p!=null){typeof p!="object"&&(i[0]=p,p=i);for(var u=0;u<p.length;u++){var m=r[u],v=p[u],g=c[m],y=a[m];y&&(y[h]=v),v<g[0]&&(g[0]=v),v>g[1]&&(g[1]=v)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),a=n._chunks,i=a[e],o=this.count(),s=0,l=Math.floor(1/r),c=this.getRawIndex(0),u,f,h,d=new(Wa(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=c;for(var p=1;p<o-1;p+=l){for(var m=Math.min(p+l,o-1),v=Math.min(p+l*2,o),g=(v+m)/2,y=0,b=m;b<v;b++){var x=this.getRawIndex(b),S=i[x];isNaN(S)||(y+=S)}y/=v-m;var w=p,k=Math.min(p+l,o),T=p-1,M=i[c];u=-1,h=w;for(var A=-1,C=0,b=w;b<k;b++){var x=this.getRawIndex(b),S=i[x];if(isNaN(S)){C++,A<0&&(A=x);continue}f=Math.abs((T-g)*(S-M)-(T-b)*(y-M)),f>u&&(u=f,h=x)}C>0&&C<k-w&&(d[s++]=Math.min(A,h),h=Math.max(A,h)),d[s++]=h,c=h}return d[s++]=this.getRawIndex(o-1),n._count=s,n._indices=d,n.getRawIndex=this._getRawIdx,n},t.prototype.minmaxDownSample=function(e,r){for(var n=this.clone([e],!0),a=n._chunks,i=Math.floor(1/r),o=a[e],s=this.count(),l=new(Wa(this._rawCount))(Math.ceil(s/i)*2),c=0,u=0;u<s;u+=i){var f=u,h=o[this.getRawIndex(f)],d=u,p=o[this.getRawIndex(d)],m=i;u+i>s&&(m=s-u);for(var v=0;v<m;v++){var g=this.getRawIndex(u+v),y=o[g];y<h&&(h=y,f=u+v),y>p&&(p=y,d=u+v)}var b=this.getRawIndex(f),x=this.getRawIndex(d);f<d?(l[c++]=b,l[c++]=x):(l[c++]=x,l[c++]=b)}return n._count=c,n._indices=l,n._updateGetRawIdx(),n},t.prototype.downSample=function(e,r,n,a){for(var i=this.clone([e],!0),o=i._chunks,s=[],l=Math.floor(1/r),c=o[e],u=this.count(),f=i._rawExtent[e]=$a(),h=new(Wa(this._rawCount))(Math.ceil(u/l)),d=0,p=0;p<u;p+=l){l>u-p&&(l=u-p,s.length=l);for(var m=0;m<l;m++){var v=this.getRawIndex(p+m);s[m]=c[v]}var g=n(s),y=this.getRawIndex(Math.min(p+a(s,g)||0,u-1));c[y]=g,g<f[0]&&(f[0]=g),g>f[1]&&(f[1]=g),h[d++]=y}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,a=this._chunks,i=0,o=this.count();i<o;i++){var s=this.getRawIndex(i);switch(n){case 0:r(i);break;case 1:r(a[e[0]][s],i);break;case 2:r(a[e[0]][s],a[e[1]][s],i);break;default:for(var l=0,c=[];l<n;l++)c[l]=a[e[l]][s];c[l]=i,r.apply(null,c)}}},t.prototype.getDataExtent=function(e){var r=this._chunks[e],n=$a();if(!r)return n;var a=this.count(),i=!this._indices,o;if(i)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=n;for(var s=o[0],l=o[1],c=0;c<a;c++){var u=this.getRawIndex(c),f=r[u];f<s&&(s=f),f>l&&(l=f)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],a=this._chunks,i=0;i<a.length;i++)n.push(a[i][r]);return n},t.prototype.clone=function(e,r){var n=new t,a=this._chunks,i=e&&xa(e,function(s,l){return s[l]=!0,s},{});if(i)for(var o=0;o<a.length;o++)n._chunks[o]=i[o]?i2(a[o]):a[o];else n._chunks=a;return this._copyCommonProps(n),r||(n._indices=this._cloneIndices()),n._updateGetRawIdx(),n},t.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=we(this._extent),e._rawExtent=we(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,r=void 0;if(e===Array){var n=this._indices.length;r=new e(n);for(var a=0;a<n;a++)r[a]=this._indices[a]}else r=new e(this._indices);return r}return null},t.prototype._getRawIdxIdentity=function(e){return e},t.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=(function(){function e(r,n,a,i){return xl(r[i],this._dimensions[i])}Rf={arrayRows:e,objectRows:function(r,n,a,i){return xl(r[n],this._dimensions[i])},keyedColumns:e,original:function(r,n,a,i){var o=r&&(r.value==null?r:r.value);return xl(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(r,n,a,i){return r[i]}}})(),t})(),o2=je(),s2={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},Em=(function(){function t(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=Bm(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return ke(this._dimNameMap.get(e),-1)},t.prototype.getSourceDimension=function(e){var r=this.source.dimensionsDefine;if(r)return r[e]},t.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,r=xm(this.source),n=!zm(e),a="",i=[],o=0,s=0;o<e;o++){var l=void 0,c=void 0,u=void 0,f=this.dimensions[s];if(f&&f.storeDimIndex===o)l=r?f.name:null,c=f.type,u=f.ordinalMeta,s++;else{var h=this.getSourceDimension(o);h&&(l=r?h.name:null,c=h.type)}i.push({property:l,type:c,ordinalMeta:u}),r&&l!=null&&(!f||!f.isCalculationCoord)&&(a+=n?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),a+="$",a+=s2[c]||"f",u&&(a+=u.uid),a+="$"}var d=this.source,p=[d.seriesLayoutBy,d.startIndex,a].join("$$");return{dimensions:i,hash:p}},t.prototype.makeOutputDimensionNames=function(){for(var e=[],r=0,n=0;r<this._fullDimCount;r++){var a=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===r)i.isCalculationCoord||(a=i.name),n++;else{var o=this.getSourceDimension(r);o&&(a=o.name)}e.push(a)}return e},t.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t})();function Om(t){return t instanceof Em}function Nm(t){for(var e=de(),r=0;r<(t||[]).length;r++){var n=t[r],a=ce(n)?n.name:n;a!=null&&e.get(a)==null&&e.set(a,r)}return e}function Bm(t){var e=o2(t);return e.dimNameMap||(e.dimNameMap=Nm(t.dimensionsDefine))}function zm(t){return t>30}var ji=ce,dn=fe,l2=typeof Int32Array>"u"?Array:Int32Array,c2="e\0\0",Fm=-1,u2=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],f2=["_approximateExtent"],Hm,Sl,Qi,Ji,Of,eo,Nf,h2=(function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,a=!1;Om(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(a=!0,n=e),n=n||["x","y"];for(var i={},o=[],s={},l=!1,c={},u=0;u<n.length;u++){var f=n[u],h=oe(f)?new bl({name:f}):f instanceof bl?f:new bl(f),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,c[d]!=null&&(l=!0),h.createInvertedIndices&&(s[d]=[]),p.itemName===0&&(this._nameDimIdx=u),p.itemId===0&&(this._idDimIdx=u),a&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var m=this._dimIdxToName=de();D(o,function(v){m.set(i[v].storeDimIndex,v)})}}return t.prototype.getDimension=function(e){var r=this._recognizeDimIndex(e);if(r==null)return e;if(r=e,!this._dimOmitted)return this.dimensions[r];var n=this._dimIdxToName.get(r);if(n!=null)return n;var a=this._schema.getSourceDimension(r);if(a)return a.name},t.prototype.getDimensionIndex=function(e){var r=this._recognizeDimIndex(e);if(r!=null)return r;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},t.prototype._recognizeDimIndex=function(e){if(He(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},t.prototype._getStoreDimIndex=function(e){var r=this.getDimensionIndex(e);return r},t.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},t.prototype._initGetDimensionInfo=function(e){var r=this._dimInfos;this._getDimInfo=e?function(n){return r.hasOwnProperty(n)?r[n]:void 0}:function(n){return r[n]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(e,r){var n=this._dimSummary;if(r==null)return n.encodeFirstDimNotExtra[e];var a=n.encode[e];return a?a[r]:null},t.prototype.mapDimensionsAll=function(e){var r=this._dimSummary,n=r.encode[e];return(n||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(e,r,n){var a=this,i;if(e instanceof Ef&&(i=e),!i){var o=this.dimensions,s=Af(e)||xt(e)?new km(e,o.length):e;i=new Ef;var l=dn(o,function(c){return{type:a._dimInfos[c].type,property:c}});i.initData(s,l,n)}this._store=i,this._nameList=(r||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=JT(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(e){var r=this._store.appendData(e);this._doInit(r[0],r[1])},t.prototype.appendValues=function(e,r){var n=this._store.appendValues(e,r&&r.length),a=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),r)for(var s=a;s<i;s++){var l=s-a;this._nameList[s]=r[l],o&&Nf(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var e=this._store,r=this.dimensions,n=0;n<r.length;n++){var a=this._dimInfos[r[n]];a.ordinalMeta&&e.collectOrdinalMeta(a.storeDimIndex,a.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==hn&&!e.fillStorage},t.prototype._doInit=function(e,r){if(!(e>=r)){var n=this._store,a=n.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList,s=a.getSource().sourceFormat,l=s===Xt;if(l&&!a.pure)for(var c=[],u=e;u<r;u++){var f=a.getItem(u,c);if(!this.hasItemOption&&nk(f)&&(this.hasItemOption=!0),f){var h=f.name;i[u]==null&&h!=null&&(i[u]=Mr(h,null));var d=f.id;o[u]==null&&d!=null&&(o[u]=Mr(d,null))}}if(this._shouldMakeIdFromName())for(var u=e;u<r;u++)Nf(this,u);Hm(this)}},t.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.setApproximateExtent=function(e,r){r=this.getDimension(r),this._approximateExtent[r]=e.slice()},t.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},t.prototype.setCalculationInfo=function(e,r){ji(e)?G(this._calculationInfo,e):this._calculationInfo[e]=r},t.prototype.getName=function(e){var r=this.getRawIndex(e),n=this._nameList[r];return n==null&&this._nameDimIdx!=null&&(n=Qi(this,this._nameDimIdx,r)),n==null&&(n=""),n},t.prototype._getCategory=function(e,r){var n=this._store.get(e,r),a=this._store.getOrdinalMeta(e);return a?a.categories[n]:n},t.prototype.getId=function(e){return Sl(this,this.getRawIndex(e))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.get(a.storeDimIndex,r)},t.prototype.getByRawIndex=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.getByRawIndex(a.storeDimIndex,r)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},t.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},t.prototype.getValues=function(e,r){var n=this,a=this._store;return ne(e)?a.getValues(dn(e,function(i){return n._getStoreDimIndex(i)}),r):a.getValues(e)},t.prototype.hasValue=function(e){for(var r=this._dimSummary.dataDimIndicesOnCoord,n=0,a=r.length;n<a;n++)if(isNaN(this._store.get(r[n],e)))return!1;return!0},t.prototype.indexOfName=function(e){for(var r=0,n=this._store.count();r<n;r++)if(this.getName(r)===e)return r;return-1},t.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},t.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},t.prototype.rawIndexOf=function(e,r){var n=e&&this._invertedIndicesMap[e],a=n&&n[r];return a==null||isNaN(a)?Fm:a},t.prototype.indicesOfNearest=function(e,r,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,n)},t.prototype.each=function(e,r,n){ye(e)&&(n=r,r=e,e=[]);var a=n||this,i=dn(Ji(e),this._getStoreDimIndex,this);this._store.each(i,a?Ae(r,a):r)},t.prototype.filterSelf=function(e,r,n){ye(e)&&(n=r,r=e,e=[]);var a=n||this,i=dn(Ji(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,a?Ae(r,a):r),this},t.prototype.selectRange=function(e){var r=this,n={},a=Ge(e);return D(a,function(i){var o=r._getStoreDimIndex(i);n[o]=e[i]}),this._store=this._store.selectRange(n),this},t.prototype.mapArray=function(e,r,n){ye(e)&&(n=r,r=e,e=[]),n=n||this;var a=[];return this.each(e,function(){a.push(r&&r.apply(this,arguments))},n),a},t.prototype.map=function(e,r,n,a){var i=n||a||this,o=dn(Ji(e),this._getStoreDimIndex,this),s=eo(this);return s._store=this._store.map(o,i?Ae(r,i):r),s},t.prototype.modify=function(e,r,n,a){var i=n||a||this,o=dn(Ji(e),this._getStoreDimIndex,this);this._store.modify(o,i?Ae(r,i):r)},t.prototype.downSample=function(e,r,n,a){var i=eo(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),r,n,a),i},t.prototype.minmaxDownSample=function(e,r){var n=eo(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),r),n},t.prototype.lttbDownSample=function(e,r){var n=eo(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),r),n},t.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},t.prototype.getItemModel=function(e){var r=this.hostModel,n=this.getRawDataItem(e);return new Xe(n,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new VT(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(n){return Sl(e,n)},function(n){return Sl(r,n)})},t.prototype.getVisual=function(e){var r=this._visual;return r&&r[e]},t.prototype.setVisual=function(e,r){this._visual=this._visual||{},ji(e)?G(this._visual,e):this._visual[e]=r},t.prototype.getItemVisual=function(e,r){var n=this._itemVisuals[e],a=n&&n[r];return a??this.getVisual(r)},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,a=n[e];a||(a=n[e]={});var i=a[r];return i==null&&(i=this.getVisual(r),ne(i)?i=i.slice():ji(i)&&(i=G({},i)),a[r]=i),i},t.prototype.setItemVisual=function(e,r,n){var a=this._itemVisuals[e]||{};this._itemVisuals[e]=a,ji(r)?G(a,r):a[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){ji(e)?G(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?G(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;yk(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){D(this._graphicEls,function(n,a){n&&e&&e.call(r,n,a)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:dn(this.dimensions,this._getDimInfo,this),this.hostModel)),Of(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ye(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var a=n.apply(this,arguments);return r.apply(this,[a].concat(au(arguments)))})},t.internalField=(function(){Hm=function(e){var r=e._invertedIndicesMap;D(r,function(n,a){var i=e._dimInfos[a],o=i.ordinalMeta,s=e._store;if(o){n=r[a]=new l2(o.categories.length);for(var l=0;l<n.length;l++)n[l]=Fm;for(var l=0;l<s.count();l++)n[s.get(i.storeDimIndex,l)]=l}})},Qi=function(e,r,n){return Mr(e._getCategory(r,n),null)},Sl=function(e,r){var n=e._idList[r];return n==null&&e._idDimIdx!=null&&(n=Qi(e,e._idDimIdx,r)),n==null&&(n=c2+r),n},Ji=function(e){return ne(e)||(e=e!=null?[e]:[]),e},eo=function(e){var r=new t(e._schema?e._schema:dn(e.dimensions,e._getDimInfo,e),e.hostModel);return Of(r,e),r},Of=function(e,r){D(u2.concat(r.__wrappedMethods||[]),function(n){r.hasOwnProperty(n)&&(e[n]=r[n])}),e.__wrappedMethods=r.__wrappedMethods,D(f2,function(n){e[n]=we(r[n])}),e._calculationInfo=G({},r._calculationInfo)},Nf=function(e,r){var n=e._nameList,a=e._idList,i=e._nameDimIdx,o=e._idDimIdx,s=n[r],l=a[r];if(s==null&&i!=null&&(n[r]=s=Qi(e,i,r)),l==null&&o!=null&&(a[r]=l=Qi(e,o,r)),l==null&&s!=null){var c=e._nameRepeatCount,u=c[s]=(c[s]||0)+1;l=s,u>1&&(l+="__ec__"+u),a[r]=l}}})(),t})();function d2(t,e){Af(t)||(t=mm(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],a=de(),i=[],o=v2(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&zm(o),l=n===t.dimensionsDefine,c=l?Bm(t):Nm(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,o));for(var f=de(u),h=new Im(o),d=0;d<h.length;d++)h[d]=-1;function p(M){var A=h[M];if(A<0){var C=n[M],I=ce(C)?C:{name:C},P=new bl,R=I.name;R!=null&&c.get(R)!=null&&(P.name=P.displayName=R),I.type!=null&&(P.type=I.type),I.displayName!=null&&(P.displayName=I.displayName);var E=i.length;return h[M]=E,P.storeDimIndex=M,i.push(P),P}return i[A]}if(!s)for(var d=0;d<o;d++)p(d);f.each(function(M,A){var C=ht(M).slice();if(C.length===1&&!oe(C[0])&&C[0]<0){f.set(A,!1);return}var I=f.set(A,[]);D(C,function(P,R){var E=oe(P)?c.get(P):P;E!=null&&E<o&&(I[R]=E,v(p(E),A,R))})});var m=0;D(r,function(M){var A,C,I,P;if(oe(M))A=M,P={};else{P=M,A=P.name;var R=P.ordinalMeta;P.ordinalMeta=null,P=G({},P),P.ordinalMeta=R,C=P.dimsDef,I=P.otherDims,P.name=P.coordDim=P.coordDimIndex=P.dimsDef=P.otherDims=null}var E=f.get(A);if(E!==!1){if(E=ht(E),!E.length)for(var O=0;O<(C&&C.length||1);O++){for(;m<o&&p(m).coordDim!=null;)m++;m<o&&E.push(m++)}D(E,function(K,L){var B=p(K);if(l&&P.type!=null&&(B.type=P.type),v(Ie(B,P),A,L),B.name==null&&C){var V=C[L];!ce(V)&&(V={name:V}),B.name=B.displayName=V.name,B.defaultTooltip=V.defaultTooltip}I&&Ie(B.otherDims,I)})}});function v(M,A,C){hm.get(A)!=null?M.otherDims[A]=C:(M.coordDim=A,M.coordDimIndex=C,a.set(A,!0))}var g=e.generateCoord,y=e.generateCoordCount,b=y!=null;y=g?y||1:0;var x=g||"value";function S(M){M.name==null&&(M.name=M.coordDim)}if(s)D(i,function(M){S(M)}),i.sort(function(M,A){return M.storeDimIndex-A.storeDimIndex});else for(var w=0;w<o;w++){var k=p(w),T=k.coordDim;T==null&&(k.coordDim=g2(x,a,b),k.coordDimIndex=0,(!g||y<=0)&&(k.isExtraCoord=!0),y--),S(k),k.type==null&&(gm(t,w)===Bt.Must||k.isExtraCoord&&(k.otherDims.itemName!=null||k.otherDims.seriesName!=null))&&(k.type="ordinal")}return p2(i),new Em({source:t,dimensions:i,fullDimensionCount:o,dimensionOmitted:s})}function p2(t){for(var e=de(),r=0;r<t.length;r++){var n=t[r],a=n.name,i=e.get(a)||0;i>0&&(n.name=a+(i-1)),i++,e.set(a,i)}}function v2(t,e,r,n){var a=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return D(e,function(i){var o;ce(i)&&(o=i.dimsDef)&&(a=Math.max(a,o.length))}),a}function g2(t,e,r){if(r||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var Bf={},zf=(function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var n=[];D(Bf,function(a,i){var o=a.create(e,r);n=n.concat(o||[])}),this._coordinateSystems=n},t.prototype.update=function(e,r){D(this._coordinateSystems,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){Bf[e]=r},t.get=function(e){return Bf[e]},t})(),m2=(function(){function t(e){this.coordSysDims=[],this.axisMap=de(),this.categoryAxisMap=de(),this.coordSysName=e}return t})();function y2(t){var e=t.get("coordinateSystem"),r=new m2(e),n=_2[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var _2={cartesian2d:function(t,e,r,n){var a=t.getReferringComponents("xAxis",Ct).models[0],i=t.getReferringComponents("yAxis",Ct).models[0];e.coordSysDims=["x","y"],r.set("x",a),r.set("y",i),Ua(a)&&(n.set("x",a),e.firstCategoryDimIndex=0),Ua(i)&&(n.set("y",i),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var a=t.getReferringComponents("singleAxis",Ct).models[0];e.coordSysDims=["single"],r.set("single",a),Ua(a)&&(n.set("single",a),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var a=t.getReferringComponents("polar",Ct).models[0],i=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",i),r.set("angle",o),Ua(i)&&(n.set("radius",i),e.firstCategoryDimIndex=0),Ua(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var a=t.ecModel,i=a.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=i.dimensions.slice();D(i.parallelAxisIndex,function(s,l){var c=a.getComponent("parallelAxis",s),u=o[l];r.set(u,c),Ua(c)&&(n.set(u,c),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function Ua(t){return t.get("type")==="category"}function b2(t,e,r){r=r||{};var n=r.byIndex,a=r.stackedCoordDimension,i,o,s;x2(e)?i=e:(o=e.schema,i=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),c,u,f,h;if(D(i,function(y,b){oe(y)&&(i[b]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!c&&y.ordinalMeta&&(c=y),!u&&y.type!=="ordinal"&&y.type!=="time"&&(!a||a===y.coordDim)&&(u=y))}),u&&!n&&!c&&(n=!0),u){f="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,c&&(c.createInvertedIndices=!0);var d=u.coordDim,p=u.type,m=0;D(i,function(y){y.coordDim===d&&m++});var v={name:f,coordDim:d,coordDimIndex:m,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},g={name:h,coordDim:h,coordDimIndex:m+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(s&&(v.storeDimIndex=s.ensureCalculationDimension(h,p),g.storeDimIndex=s.ensureCalculationDimension(f,p)),o.appendCalculationDimension(v),o.appendCalculationDimension(g)):(i.push(v),i.push(g))}return{stackedDimension:u&&u.name,stackedByDimension:c&&c.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function x2(t){return!Om(t.schema)}function Ya(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function w2(t,e){return Ya(t,e)?t.getCalculationInfo("stackResultDimension"):e}function S2(t,e){var r=t.get("coordinateSystem"),n=zf.get(r),a;return e&&e.coordSysDims&&(a=fe(e.coordSysDims,function(i){var o={name:i},s=e.axisMap.get(i);if(s){var l=s.get("type");o.type=e2(l)}return o})),a||(a=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),a}function k2(t,e,r){var n,a;return r&&D(t,function(i,o){var s=i.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),i.ordinalMeta=l.getOrdinalMeta(),e&&(i.createInvertedIndices=!0)),i.otherDims.itemName!=null&&(a=!0)}),!a&&n!=null&&(t[n].otherDims.itemName=0),n}function Ff(t,e,r){r=r||{};var n=e.getSourceManager(),a,i=!1;a=n.getSource(),i=a.sourceFormat===Xt;var o=y2(e),s=S2(e,o),l=r.useEncodeDefaulter,c=ye(l)?l:l?Ke(WT,s,e):null,u={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!i},f=d2(a,u),h=k2(f.dimensions,r.createInvertedIndices,o),d=i?null:n.getSharedDataStore(f),p=b2(e,{schema:f,store:d}),m=new h2(f,e);m.setCalculationInfo(p);var v=h!=null&&T2(a)?function(g,y,b,x){return x===h?b:this.defaultDimValueGetter(g,y,b,x)}:null;return m.hasItemOption=!1,m.initData(i?a:d,null,v),m}function T2(t){if(t.sourceFormat===Xt){var e=C2(t.data||[]);return!ne(Fi(e))}}function C2(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var M2=Math.round(Math.random()*10);function kl(t){return[t||"",M2++].join("_")}function A2(t){var e={};t.registerSubTypeDefaulter=function(r,n){var a=wr(r);e[a.main]=n},t.determineSubType=function(r,n){var a=n.type;if(!a){var i=wr(r).main;t.hasSubTypes(r)&&e[i]&&(a=e[i](n))}return a}}function D2(t,e){t.topologicalTravel=function(i,o,s,l){if(!i.length)return;var c=r(o),u=c.graph,f=c.noEntryList,h={};for(D(i,function(y){h[y]=!0});f.length;){var d=f.pop(),p=u[d],m=!!h[d];m&&(s.call(l,d,p.originalDeps.slice()),delete h[d]),D(p.successor,m?g:v)}D(h,function(){var y="";throw new Error(y)});function v(y){u[y].entryCount--,u[y].entryCount===0&&f.push(y)}function g(y){h[y]=!0,v(y)}};function r(i){var o={},s=[];return D(i,function(l){var c=n(o,l),u=c.originalDeps=e(l),f=a(u,i);c.entryCount=f.length,c.entryCount===0&&s.push(l),D(f,function(h){Pe(c.predecessor,h)<0&&c.predecessor.push(h);var d=n(o,h);Pe(d.successor,h)<0&&d.successor.push(l)})}),{graph:o,noEntryList:s}}function n(i,o){return i[o]||(i[o]={predecessor:[],successor:[]}),i[o]}function a(i,o){var s=[];return D(i,function(l){Pe(o,l)>=0&&s.push(l)}),s}}function Hf(t,e){return Me(Me({},t,!0),e,!0)}var I2=Math.log(2);function Vf(t,e,r,n,a,i){var o=n+"-"+a,s=t.length;if(i.hasOwnProperty(o))return i[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~a)/I2);return t[r][l]}for(var c=n|1<<r,u=r+1;n&1<<u;)u++;for(var f=0,h=0,d=0;h<s;h++){var p=1<<h;p&a||(f+=(d%2?-1:1)*t[r][h]*Vf(t,e-1,u,c,a|p,i),d++)}return i[o]=f,f}function Vm(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},a=Vf(r,8,0,0,0,n);if(a!==0){for(var i=[],o=0;o<8;o++)for(var s=0;s<8;s++)i[s]==null&&(i[s]=0),i[s]+=((o+s)%2?-1:1)*Vf(r,7,o===0?1:0,1<<o,1<<s,n)/a*e[o];return function(l,c,u){var f=c*i[6]+u*i[7]+1;l[0]=(c*i[0]+u*i[1]+i[2])/f,l[1]=(c*i[3]+u*i[4]+i[5])/f}}}var Gm="___zrEVENTSAVED",Gf=[];function P2(t,e,r,n,a){return Wf(Gf,e,n,a,!0)&&Wf(t,r,Gf[0],Gf[1])}function Wf(t,e,r,n,a){if(e.getBoundingClientRect&&ve.domSupported&&!Wm(e)){var i=e[Gm]||(e[Gm]={}),o=L2(e,i),s=R2(o,i,a);if(s)return s(t,r,n),!0}return!1}function L2(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var n=["left","right"],a=["top","bottom"],i=0;i<4;i++){var o=document.createElement("div"),s=o.style,l=i%2,c=(i>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",a[c]+":0",n[1-l]+":auto",a[1-c]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function R2(t,e,r){for(var n=r?"invTrans":"trans",a=e[n],i=e.srcCoords,o=[],s=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),f=2*c,h=u.left,d=u.top;o.push(h,d),l=l&&i&&h===i[f]&&d===i[f+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&a?a:(e.srcCoords=o,e[n]=r?Vm(s,o):Vm(o,s))}function Wm(t){return t.nodeName.toUpperCase()==="CANVAS"}var E2=/([&<>"'])/g,O2={"&":"&","<":"<",">":">",'"':""","'":"'"};function Dt(t){return t==null?"":(t+"").replace(E2,function(e,r){return O2[r]})}const N2={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},B2={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var Tl="ZH",$f="EN",qa=$f,Cl={},Uf={},$m=ve.domSupported?(function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||qa).toUpperCase();return t.indexOf(Tl)>-1?Tl:qa})():qa;function Um(t,e){t=t.toUpperCase(),Uf[t]=new Xe(e),Cl[t]=e}function z2(t){if(oe(t)){var e=Cl[t.toUpperCase()]||{};return t===Tl||t===$f?we(e):Me(we(e),we(Cl[qa]),!1)}else return Me(we(t),we(Cl[qa]),!1)}function F2(t){return Uf[t]}function H2(){return Uf[qa]}Um($f,N2),Um(Tl,B2);var Yf=1e3,qf=Yf*60,to=qf*60,Zt=to*24,Ym=Zt*365,ro={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Ml="{yyyy}-{MM}-{dd}",qm={year:"{yyyy}",month:"{yyyy}-{MM}",day:Ml,hour:Ml+" "+ro.hour,minute:Ml+" "+ro.minute,second:Ml+" "+ro.second,millisecond:ro.none},Xf=["year","month","day","hour","minute","second","millisecond"],Xm=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function pn(t,e){return t+="","0000".substr(0,e-t.length)+t}function Xa(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function V2(t){return t===Xa(t)}function G2(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function Al(t,e,r,n){var a=Wr(t),i=a[Zf(r)](),o=a[Za(r)]()+1,s=Math.floor((o-1)/3)+1,l=a[Dl(r)](),c=a["get"+(r?"UTC":"")+"Day"](),u=a[no(r)](),f=(u-1)%12+1,h=a[Il(r)](),d=a[Pl(r)](),p=a[Ll(r)](),m=u>=12?"pm":"am",v=m.toUpperCase(),g=n instanceof Xe?n:F2(n||$m)||H2(),y=g.getModel("time"),b=y.get("month"),x=y.get("monthAbbr"),S=y.get("dayOfWeek"),w=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,m+"").replace(/{A}/g,v+"").replace(/{yyyy}/g,i+"").replace(/{yy}/g,pn(i%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,pn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,pn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[c]).replace(/{ee}/g,w[c]).replace(/{e}/g,c+"").replace(/{HH}/g,pn(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,pn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,pn(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,pn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,pn(p,3)).replace(/{S}/g,p+"")}function W2(t,e,r,n,a){var i=null;if(oe(r))i=r;else if(ye(r))i=r(t.value,e,{level:t.level});else{var o=G({},ro);if(t.level>0)for(var s=0;s<Xf.length;++s)o[Xf[s]]="{primary|"+o[Xf[s]]+"}";var l=r?r.inherit===!1?r:Ie(r,o):o,c=Zm(t.value,a);if(l[c])i=l[c];else if(l.inherit){for(var u=Xm.indexOf(c),s=u-1;s>=0;--s)if(l[c]){i=l[c];break}i=i||o.none}if(ne(i)){var f=t.level==null?0:t.level>=0?t.level:i.length+t.level;f=Math.min(f,i.length-1),i=i[f]}}return Al(new Date(t.value),i,a,n)}function Zm(t,e){var r=Wr(t),n=r[Za(e)]()+1,a=r[Dl(e)](),i=r[no(e)](),o=r[Il(e)](),s=r[Pl(e)](),l=r[Ll(e)](),c=l===0,u=c&&s===0,f=u&&o===0,h=f&&i===0,d=h&&a===1,p=d&&n===1;return p?"year":d?"month":h?"day":f?"hour":u?"minute":c?"second":"millisecond"}function Km(t,e,r){var n=He(t)?Wr(t):t;switch(e=e||Zm(t,r),e){case"year":return n[Zf(r)]();case"half-year":return n[Za(r)]()>=6?1:0;case"quarter":return Math.floor((n[Za(r)]()+1)/4);case"month":return n[Za(r)]();case"day":return n[Dl(r)]();case"half-day":return n[no(r)]()/24;case"hour":return n[no(r)]();case"minute":return n[Il(r)]();case"second":return n[Pl(r)]();case"millisecond":return n[Ll(r)]()}}function Zf(t){return t?"getUTCFullYear":"getFullYear"}function Za(t){return t?"getUTCMonth":"getMonth"}function Dl(t){return t?"getUTCDate":"getDate"}function no(t){return t?"getUTCHours":"getHours"}function Il(t){return t?"getUTCMinutes":"getMinutes"}function Pl(t){return t?"getUTCSeconds":"getSeconds"}function Ll(t){return t?"getUTCMilliseconds":"getMilliseconds"}function $2(t){return t?"setUTCFullYear":"setFullYear"}function jm(t){return t?"setUTCMonth":"setMonth"}function Qm(t){return t?"setUTCDate":"setDate"}function Jm(t){return t?"setUTCHours":"setHours"}function ey(t){return t?"setUTCMinutes":"setMinutes"}function ty(t){return t?"setUTCSeconds":"setSeconds"}function ry(t){return t?"setUTCMilliseconds":"setMilliseconds"}function ny(t){if(!tk(t))return oe(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function ay(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var Rl=Jp;function Kf(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function a(u){return u&&xr(u)?u:"-"}function i(u){return!!(u!=null&&!isNaN(u)&&isFinite(u))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?Wr(t):t;if(isNaN(+l)){if(s)return"-"}else return Al(l,n,r)}if(e==="ordinal")return nu(t)?a(t):He(t)&&i(t)?t+"":"-";var c=qs(t);return i(c)?ny(c):nu(t)?a(t):typeof t=="boolean"?t+"":"-"}var iy=["a","b","c","d","e","f","g"],jf=function(t,e){return"{"+t+(e??"")+"}"};function oy(t,e,r){ne(e)||(e=[e]);var n=e.length;if(!n)return"";for(var a=e[0].$vars||[],i=0;i<a.length;i++){var o=iy[i];t=t.replace(jf(o),jf(o,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var c=e[s][a[l]];t=t.replace(jf(iy[l],s),r?Dt(c):c)}return t}function U2(t,e){var r=oe(t)?{color:t,extraCssText:e}:t||{},n=r.color,a=r.type;e=r.extraCssText;var i=r.renderMode||"html";if(!n)return"";if(i==="html")return a==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Dt(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Dt(n)+";"+(e||"")+'"></span>';var o=r.markerId||"markerX";return{renderMode:i,content:"{"+o+"|} ",style:a==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function ra(t,e){return e=e||"transparent",oe(t)?t:ce(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var El=D,Y2=["left","right","top","bottom","width","height"],Ol=[["width","left","right"],["height","top","bottom"]];function Qf(t,e,r,n,a){var i=0,o=0;n==null&&(n=1/0),a==null&&(a=1/0);var s=0;e.eachChild(function(l,c){var u=l.getBoundingRect(),f=e.childAt(c+1),h=f&&f.getBoundingRect(),d,p;if(t==="horizontal"){var m=u.width+(h?-h.x+u.x:0);d=i+m,d>n||l.newline?(i=0,d=m,o+=s+r,s=u.height):s=Math.max(s,u.height)}else{var v=u.height+(h?-h.y+u.y:0);p=o+v,p>a||l.newline?(i+=s+r,o=0,p=v,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=i,l.y=o,l.markRedraw(),t==="horizontal"?i=d+r:o=p+r)})}var ao=Qf;Ke(Qf,"vertical"),Ke(Qf,"horizontal");function Nl(t,e,r){r=Rl(r||0);var n=e.width,a=e.height,i=_t(t.left,n),o=_t(t.top,a),s=_t(t.right,n),l=_t(t.bottom,a),c=_t(t.width,n),u=_t(t.height,a),f=r[2]+r[0],h=r[1]+r[3],d=t.aspect;switch(isNaN(c)&&(c=n-s-h-i),isNaN(u)&&(u=a-l-f-o),d!=null&&(isNaN(c)&&isNaN(u)&&(d>n/a?c=n*.8:u=a*.8),isNaN(c)&&(c=d*u),isNaN(u)&&(u=c/d)),isNaN(i)&&(i=n-s-c-h),isNaN(o)&&(o=a-l-u-f),t.left||t.right){case"center":i=n/2-c/2-r[3];break;case"right":i=n-c-h;break}switch(t.top||t.bottom){case"middle":case"center":o=a/2-u/2-r[0];break;case"bottom":o=a-u-f;break}i=i||0,o=o||0,isNaN(c)&&(c=n-h-i-(s||0)),isNaN(u)&&(u=a-f-o-(l||0));var p=new Le(i+r[3],o+r[0],c,u);return p.margin=r,p}function io(t){var e=t.layoutMode||t.constructor.layoutMode;return ce(e)?e:e?{type:e}:null}function Ka(t,e,r){var n=r&&r.ignoreSize;!ne(n)&&(n=[n,n]);var a=o(Ol[0],0),i=o(Ol[1],1);c(Ol[0],t,a),c(Ol[1],t,i);function o(u,f){var h={},d=0,p={},m=0,v=2;if(El(u,function(b){p[b]=t[b]}),El(u,function(b){s(e,b)&&(h[b]=p[b]=e[b]),l(h,b)&&d++,l(p,b)&&m++}),n[f])return l(e,u[1])?p[u[2]]=null:l(e,u[2])&&(p[u[1]]=null),p;if(m===v||!d)return p;if(d>=v)return h;for(var g=0;g<u.length;g++){var y=u[g];if(!s(h,y)&&s(t,y)){h[y]=t[y];break}}return h}function s(u,f){return u.hasOwnProperty(f)}function l(u,f){return u[f]!=null&&u[f]!=="auto"}function c(u,f,h){El(u,function(d){f[d]=h[d]})}}function Bl(t){return q2({},t)}function q2(t,e){return e&&t&&El(Y2,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var X2=je(),Ne=(function(t){U(e,t);function e(r,n,a){var i=t.call(this,r,n,a)||this;return i.uid=kl("ec_cpt_model"),i}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=io(this),i=a?Bl(r):{},o=n.getTheme();Me(r,o.get(this.mainType)),Me(r,this.getDefaultOption()),a&&Ka(r,i,a)},e.prototype.mergeOption=function(r,n){Me(this.option,r,!0);var a=io(this);a&&Ka(this.option,r,a)},e.prototype.optionUpdated=function(r,n){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!bw(r))return r.defaultOption;var n=X2(this);if(!n.defaultOption){for(var a=[],i=r;i;){var o=i.prototype.defaultOption;o&&a.push(o),i=i.superClass}for(var s={},l=a.length-1;l>=0;l--)s=Me(s,a[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var a=r+"Index",i=r+"Id";return Gi(this.ecModel,r,{index:this.get(a,!0),id:this.get(i,!0)},n)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=(function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),e})(Xe);av(Ne,Xe),ms(Ne),A2(Ne),D2(Ne,Z2);function Z2(t){var e=[];return D(Ne.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=fe(e,function(r){return wr(r).main}),t!=="dataset"&&Pe(e,"dataset")<=0&&e.unshift("dataset"),e}var sy=je(),K2=je(),Jf=(function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,n){var a=ht(this.get("color",!0)),i=this.get("colorLayer",!0);return cy(this,sy,a,i,e,r,n)},t.prototype.clearColorPalette=function(){Q2(this,sy)},t})();function ly(t,e,r,n){var a=ht(t.get(["aria","decal","decals"]));return cy(t,K2,a,null,e,r,n)}function j2(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n].length>e)return t[n];return t[r-1]}function cy(t,e,r,n,a,i,o){i=i||t;var s=e(i),l=s.paletteIdx||0,c=s.paletteNameMap=s.paletteNameMap||{};if(c.hasOwnProperty(a))return c[a];var u=o==null||!n?r:j2(n,o);if(u=u||r,!(!u||!u.length)){var f=u[l];return a&&(c[a]=f),s.paletteIdx=(l+1)%u.length,f}}function Q2(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var J2=/\{@(.+?)\}/g,eC=(function(){function t(){}return t.prototype.getDataParams=function(e,r){var n=this.getData(r),a=this.getRawValue(e,r),i=n.getRawIndex(e),o=n.getName(e),s=n.getRawDataItem(e),l=n.getItemVisual(e,"style"),c=l&&l[n.getItemVisual(e,"drawType")||"fill"],u=l&&l.stroke,f=this.mainType,h=f==="series",d=n.userOutput&&n.userOutput.get();return{componentType:f,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:s,dataType:r,value:a,color:c,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(e,r,n,a,i,o){r=r||"normal";var s=this.getData(n),l=this.getDataParams(e,n);if(o&&(l.value=o.interpolatedValue),a!=null&&ne(l.value)&&(l.value=l.value[a]),!i){var c=s.getItemModel(e);i=c.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ye(i))return l.status=r,l.dimensionIndex=a,i(l);if(oe(i)){var u=oy(i,l);return u.replace(J2,function(f,h){var d=h.length,p=h;p.charAt(0)==="["&&p.charAt(d-1)==="]"&&(p=+p.slice(1,d-1));var m=Ga(s,e,p);if(o&&ne(o.interpolatedValue)){var v=s.getDimensionIndex(p);v>=0&&(m=o.interpolatedValue[v])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return Ga(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t})();function uy(t){var e,r;return ce(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function oo(t){return new tC(t)}var tC=(function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var a=this.context;a.data=a.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var o=u(this._modBy),s=this._modDataCount||0,l=u(e&&e.modBy),c=e&&e.modDataCount||0;(o!==l||s!==c)&&(i="reset");function u(y){return!(y>=1)&&(y=1),y}var f;(this._dirty||i==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=c;var h=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d<p)){var m=this._progress;if(ne(m))for(var v=0;v<m.length;v++)this._doProgress(m[v],d,p,l,c);else this._doProgress(m,d,p,l,c)}this._dueIndex=p;var g=this._settedOutputEnd!=null?this._settedOutputEnd:p;this._outputDueEnd=g}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(e,r,n,a,i){fy.reset(r,n,a,i),this._callingProgress=e,this._callingProgress({start:r,end:n,count:n-r,next:fy.next},this.context)},t.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var r,n;!e&&this._reset&&(r=this._reset(this.context),r&&r.progress&&(n=r.forceFirstProgress,r=r.progress),ne(r)&&!r.length&&(r=null)),this._progress=r,this._modBy=this._modDataCount=null;var a=this._downstream;return a&&a.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},t})(),fy=(function(){var t,e,r,n,a,i={reset:function(l,c,u,f){e=l,t=c,r=u,n=f,a=Math.ceil(n/r),i.next=r>1&&n>0?s:o}};return i;function o(){return e<t?e++:null}function s(){var l=e%a*r+Math.ceil(e/a),c=e>=t?null:l<n?l:e;return e++,c}})(),rC=(function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return xl(e,r)},t})();function nC(t,e){var r=new rC,n=t.data,a=r.sourceFormat=t.sourceFormat,i=t.startIndex,o="";t.seriesLayoutBy!==qr&&Tt(o);var s=[],l={},c=t.dimensionsDefine;if(c)D(c,function(m,v){var g=m.name,y={index:v,name:g,displayName:m.displayName};if(s.push(y),g!=null){var b="";Dn(l,g)&&Tt(b),l[g]=y}});else for(var u=0;u<t.dimensionsDetectedCount;u++)s.push({index:u});var f=Cm(a,qr);e.__isBuiltIn&&(r.getRawDataItem=function(m){return f(n,i,s,m)},r.getRawData=Ae(aC,null,t)),r.cloneRawData=Ae(iC,null,t);var h=Am(a,qr);r.count=Ae(h,null,n,i,s);var d=Dm(a);r.retrieveValue=function(m,v){var g=f(n,i,s,m);return p(g,v)};var p=r.retrieveValueFromItem=function(m,v){if(m!=null){var g=s[v];if(g)return d(m,v,g.name)}};return r.getDimensionInfo=Ae(oC,null,s,l),r.cloneAllDimensionInfo=Ae(sC,null,s),r}function aC(t){var e=t.sourceFormat;if(!eh(e)){var r="";Tt(r)}return t.data}function iC(t){var e=t.sourceFormat,r=t.data;if(!eh(e)){var n="";Tt(n)}if(e===At){for(var a=[],i=0,o=r.length;i<o;i++)a.push(r[i].slice());return a}else if(e===Ir){for(var a=[],i=0,o=r.length;i<o;i++)a.push(G({},r[i]));return a}}function oC(t,e,r){if(r!=null){if(He(r)||!isNaN(r)&&!Dn(e,r))return t[r];if(Dn(e,r))return e[r]}}function sC(t){return we(t)}var hy=de();function lC(t){t=we(t);var e=t.type,r="";e||Tt(r);var n=e.split(":");n.length!==2&&Tt(r);var a=!1;n[0]==="echarts"&&(e=n[1],a=!0),t.__isBuiltIn=a,hy.set(e,t)}function cC(t,e,r){var n=ht(t),a=n.length,i="";a||Tt(i);for(var o=0,s=a;o<s;o++){var l=n[o];e=uC(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function uC(t,e,r,n){var a="";e.length||Tt(a),ce(t)||Tt(a);var i=t.type,o=hy.get(i);o||Tt(a);var s=fe(e,function(c){return nC(c,o)}),l=ht(o.transform({upstream:s[0],upstreamList:s,config:we(t.config)}));return fe(l,function(c,u){var f="";ce(c)||Tt(f),c.data||Tt(f);var h=ym(c.data);eh(h)||Tt(f);var d,p=e[0];if(p&&u===0&&!c.dimensions){var m=p.startIndex;m&&(c.data=p.data.slice(0,m).concat(c.data)),d={seriesLayoutBy:qr,sourceHeader:m,dimensions:p.metaRawOption.dimensions}}else d={seriesLayoutBy:qr,sourceHeader:0,dimensions:c.dimensions};return Df(c.data,d,null)})}function eh(t){return t===At||t===Ir}var fC=(function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,a,i;if(zl(e)){var o=e,s=void 0,l=void 0,c=void 0;if(n){var u=r[0];u.prepareSource(),c=u.getSource(),s=c.data,l=c.sourceFormat,i=[u._getVersionSign()]}else s=o.get("data",!0),l=wt(s)?hn:Xt,i=[];var f=this._getSourceMetaRawOption()||{},h=c&&c.metaRawOption||{},d=ke(f.seriesLayoutBy,h.seriesLayoutBy)||null,p=ke(f.sourceHeader,h.sourceHeader),m=ke(f.dimensions,h.dimensions),v=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||m;a=v?[Df(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:m},l)]:[]}else{var g=e;if(n){var y=this._applyTransform(r);a=y.sourceList,i=y.upstreamSignList}else{var b=g.get("source",!0);a=[Df(b,this._getSourceMetaRawOption(),null)],i=[]}}this._setLocalSource(a,i)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),a=r.get("fromTransformResult",!0);if(a!=null){var i="";e.length!==1&&dy(i)}var o,s=[],l=[];return D(e,function(c){c.prepareSource();var u=c.getSource(a||0),f="";a!=null&&!u&&dy(f),s.push(u),l.push(c._getVersionSign())}),n?o=cC(n,s,{datasetIndex:r.componentIndex}):a!=null&&(o=[YT(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r<e.length;r++){var n=e[r];if(n._isDirty()||this._upstreamSignList[r]!==n._getVersionSign())return!0}},t.prototype.getSource=function(e){e=e||0;var r=this._sourceList[e];if(!r){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return r},t.prototype.getSharedDataStore=function(e){var r=e.makeStoreSchema();return this._innerGetDataStore(r.dimensions,e.source,r.hash)},t.prototype._innerGetDataStore=function(e,r,n){var a=0,i=this._storeList,o=i[a];o||(o=i[a]={});var s=o[n];if(!s){var l=this._getUpstreamSourceManagers()[0];zl(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,n):(s=new Ef,s.initData(new km(r,e.length),e)),o[n]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(zl(e)){var r=vm(e);return r?[r.getSourceManager()]:[]}else return fe($T(e),function(n){return n.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,n,a;if(zl(e))r=e.get("seriesLayoutBy",!0),n=e.get("sourceHeader",!0),a=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=e;r=i.get("seriesLayoutBy",!0),n=i.get("sourceHeader",!0),a=i.get("dimensions",!0)}return{seriesLayoutBy:r,sourceHeader:n,dimensions:a}},t})();function zl(t){return t.mainType==="series"}function dy(t){throw new Error(t)}var hC="line-height:1";function py(t){var e=t.lineHeight;return e==null?hC:"line-height:"+Dt(e+"")+"px"}function vy(t,e){var r=t.color||"#6e7079",n=t.fontSize||12,a=t.fontWeight||"400",i=t.color||"#464646",o=t.fontSize||14,s=t.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Dt(n+"")+"px;color:"+Dt(r)+";font-weight:"+Dt(a+""),valueStyle:"font-size:"+Dt(o+"")+"px;color:"+Dt(i)+";font-weight:"+Dt(s+"")}:{nameStyle:{fontSize:n,fill:r,fontWeight:a},valueStyle:{fontSize:o,fill:i,fontWeight:s}}}var dC=[0,10,20,30],pC=["",`
|
|
5
|
+
`))}}catch{return{event:e}}},Up=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):[],Gt=t=>new Promise(e=>setTimeout(e,t)),Yp={agentName:"Accurix",agentAvatarUrl:"",widgetModule:"assistant",assistantMediaUrl:"https://images.unsplash.com/photo-1494790108377-be9c29b29330",assistantMediaKind:"image",assistantPrivacyUrl:"https://accurix.tech/privacy",soundEnabled:!0,voiceOutputEnabled:!1,talkbackMode:"avatar",avatarProvider:"demo",avatarId:"accurix-demo",greeting:"Hi! I'm Accurix, the AI assistant for Accurix. Ask me anything about products, pricing, or documentation — or book a demo.",allowVoiceInput:!1,memoryEnabled:!0,memoryRetentionDays:30,memoryMessageCap:50,availableActions:["public_book_demo","public_capture_contact","public_submit_inquiry"],agentDescription:"I help with Accurix products, pricing, and documentation.",welcomeSubtitle:"Ask me anything — most answers are instant.",disclaimerText:"Accurix is an AI assistant; answers may be imperfect.",starterQuestions:["What can Accurix help with?","How do I get started?","What's your pricing?"],featuredLinks:[{label:"Accurix founders",url:"https://accurix.tech/about"},{label:"Pricing",url:"https://accurix.tech/pricing"}]},iw=[{match:/demo chart|monthly orders|orders by status/i,result:{answer:"Orders moved in different directions by status in the latest month. The chart below shows one line for submitted, approved, and fulfilled orders.",sources:[],suggestedReplies:["Show a demo KPI","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"chart",type:"line",title:"Monthly orders by status",columns:["month","status","order_count"],rows:[{month:"2025-01-01",status:"Submitted",order_count:12},{month:"2025-01-01",status:"Approved",order_count:16},{month:"2025-01-01",status:"Fulfilled",order_count:14},{month:"2025-02-01",status:"Submitted",order_count:14},{month:"2025-02-01",status:"Approved",order_count:15},{month:"2025-02-01",status:"Fulfilled",order_count:15},{month:"2025-03-01",status:"Submitted",order_count:13},{month:"2025-03-01",status:"Approved",order_count:17},{month:"2025-03-01",status:"Fulfilled",order_count:16},{month:"2025-04-01",status:"Submitted",order_count:15},{month:"2025-04-01",status:"Approved",order_count:16},{month:"2025-04-01",status:"Fulfilled",order_count:17},{month:"2025-05-01",status:"Submitted",order_count:16},{month:"2025-05-01",status:"Approved",order_count:18},{month:"2025-05-01",status:"Fulfilled",order_count:17},{month:"2025-06-01",status:"Submitted",order_count:17},{month:"2025-06-01",status:"Approved",order_count:17},{month:"2025-06-01",status:"Fulfilled",order_count:18},{month:"2025-07-01",status:"Submitted",order_count:18},{month:"2025-07-01",status:"Approved",order_count:19},{month:"2025-07-01",status:"Fulfilled",order_count:18},{month:"2025-08-01",status:"Submitted",order_count:19},{month:"2025-08-01",status:"Approved",order_count:18},{month:"2025-08-01",status:"Fulfilled",order_count:19}],rowCount:24,timezone:"UTC",columnMetadata:[{key:"month",label:"Order month",dataType:"date",semanticRole:"date"},{key:"status",label:"Status",dataType:"text",semanticRole:"dimension"},{key:"order_count",label:"Distinct order count",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],chartRecommendation:{type:"line",mode:"time_series",categoryField:"month",valueFields:["order_count"],seriesField:"status"},expandable:!0,tableAvailable:!1,explanation:{headline:"The latest results moved in different directions by status.",summary:"Submitted and fulfilled orders increased, while approved orders decreased.",evidence:["Submitted orders increased from 18 in July to 19 in August.","Approved orders decreased from 19 in July to 18 in August.","Fulfilled orders increased from 18 in July to 19 in August."],businessMeaning:"Overall order activity is steady, but the small approval decline is worth watching if it continues.",followUps:["Which status changed the most?","How does this compare with the prior quarter?"],source:"governed_result"}}}},{match:/demo kpi|active accounts/i,result:{answer:"There are 5,632 active accounts in the current demo result.",sources:[],suggestedReplies:["Show a demo chart","Show a demo table"],handoffOffered:!1,visualization:{version:1,presentation:"kpi",type:"kpi",title:"Active accounts",columns:["active_accounts"],value:"active_accounts",rows:[{active_accounts:5632}],rowCount:1,columnMetadata:[{key:"active_accounts",label:"Active accounts",dataType:"number",semanticRole:"measure",aggregation:"count_distinct"}],explanation:{headline:"Active accounts are 5,632.",summary:"This is the latest value in the demo result.",evidence:["The displayed active-account count is 5,632."],source:"governed_result"}}}},{match:/demo table|account health/i,result:{answer:"Nine accounts are included in this governed result. The table shows a compact preview and can be expanded to inspect every permitted row.",sources:[],suggestedReplies:["Show a demo chart","Test the hidden table response"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",title:"Account health",columns:["account_name","region","health_score","renewal_month"],rows:[{account_name:"Northstar Industries",region:"West",health_score:94,renewal_month:"August"},{account_name:"Apex Group",region:"East",health_score:91,renewal_month:"September"},{account_name:"Summit Retail",region:"North",health_score:88,renewal_month:"August"},{account_name:"Harbor Logistics",region:"South",health_score:86,renewal_month:"October"},{account_name:"Brightline Media",region:"West",health_score:84,renewal_month:"November"},{account_name:"Redwood Labs",region:"East",health_score:82,renewal_month:"September"},{account_name:"Atlas Foods",region:"North",health_score:79,renewal_month:"December"},{account_name:"Cedar Health",region:"South",health_score:77,renewal_month:"October"},{account_name:"Bluewave Energy",region:"West",health_score:74,renewal_month:"December"}],rowCount:9,columnMetadata:[{key:"account_name",label:"Account",dataType:"text",semanticRole:"dimension"},{key:"region",label:"Region",dataType:"text",semanticRole:"geography"},{key:"health_score",label:"Health score",dataType:"number",semanticRole:"measure"},{key:"renewal_month",label:"Renewal month",dataType:"text",semanticRole:"date"}],expandable:!0,tableAvailable:!0,downloadAvailable:!0,explanation:{headline:"Nine accounts are available for review.",summary:"Health scores range from 74 to 94 across four regions.",evidence:["Northstar Industries has the highest health score at 94."],source:"governed_result"}}}},{match:/hidden table|table response/i,result:{answer:"Three accounts need attention. The public widget explains the result without exposing its underlying rows.",sources:[],suggestedReplies:["Show a demo chart","Show a demo KPI"],handoffOffered:!1,visualization:{version:1,presentation:"table",type:"table",columns:["account_name","risk_score"],rows:[{account_name:"Private account A",risk_score:91},{account_name:"Private account B",risk_score:87},{account_name:"Private account C",risk_score:82}],rowCount:3,tableAvailable:!1,explanation:{headline:"Three accounts need attention.",summary:"The written result is available without displaying a public data table.",evidence:["Three accounts matched the approved attention rule."],source:"governed_result"}}}},{match:/^\s*(hi+|hey+|hello|yo|sup|howdy|hola|thanks|thank you|thx|good (morning|afternoon|evening))\b/i,result:{answer:"Hello! 👋 How can I help you today?",sources:[],suggestedReplies:["How do I track a shipment?","How does customs work?"],handoffOffered:!1}},{match:/track|shipment|where|status/i,result:{answer:"Centrinfo can answer from your indexed knowledge base, public website, connected files, and approved organization tools. It keeps answers grounded in your configured sources and can hand a conversation to your team when the AI is not enough.",sources:[{title:"Centrinfo public widget",url:"https://accurix.tech/centrinfo"}],suggestedReplies:["How does the widget work?","Can a human take over?"],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:"Accurix connects your organization knowledge, channels, integrations, and public widget in one place. You can configure which sources the AI can use, which tools visitors can trigger, and when your team should take over live chat.",sources:[{title:"Accurix documentation",url:"https://accurix.tech/docs"}],suggestedReplies:["Which tools can I connect?","How do permissions work?"],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:"Accurix uses a usage-based pricing model. Organizations keep an active subscription and spend credits as the AI answers, searches, and uses tools. Credit top-ups can extend usage when the subscription grant runs low.",sources:[{title:"Pricing",url:"https://accurix.tech/pricing"}],suggestedReplies:["How do credits work?","Can I top up credits?"],handoffOffered:!1}}],ow={answer:"That's a great question — I don't have a confident answer from Accurix's published docs yet. Want me to pass it to the team so a human can follow up? You can also book a quick demo.",sources:[],suggestedReplies:["What can you help with?"],handoffOffered:!0},sw=t=>iw.find(e=>e.match.test(t))?.result??ow;class lw{async history(){return{conversations:[]}}async bootstrap(){return await Gt(180),Yp}async stream(e,r,n){await Gt(550);const a=sw(e),i=a.answer.split(/(\s+)/);for(const o of i){if(n.signal?.aborted)break;n.onChunk(o),await Gt(18+Math.min(40,o.length*6))}return{...a,availableActions:Yp.availableActions}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async typing(){await Gt(20)}async action(e,r){return await Gt(450),{ok:!0,note:{"book-demo":"Demo requested — we'll email you a few times that work. 📅",contact:"Got it — saved your details. ✅","contact-support":"Support has been notified and can join this conversation. ✅",inquiry:"Thanks! We'll get back to you shortly. ✉️","request-callback":"We'll call you back soon. 📞","subscribe-newsletter":"You're subscribed. 🎉"}[e]}}async speak(){return await Gt(120),{providerReady:!1,message:"Demo voice provider is not connected."}}async transcribe(e,r,n,a){return await Gt(700),"How do I track a shipment?"}async extract(e,r,n){return await Gt(600),`[Attached file${n?`: ${n}`:""}] Invoice #4821 — 3 pallets, Rotterdam → Lagos, ETA 12 days.`}async identify(e,r){await Gt(50)}async endConversation(e){await Gt(50)}async sendFeedback(){await Gt(50)}async demoSlots(e,r){return await Gt(150),{taken:[[11,0],[15,0]].map(([a,i])=>{const o=new Date;return o.setHours(a,i,0,0),o.toISOString()}),busy:[]}}async searchGifs(e){await Gt(280);const r=e.trim().toLowerCase(),n=r?ou.filter(i=>i.alt.includes(r)||i.tags.some(o=>o.includes(r)||r.includes(o))):ou;return(n.length>0?n:ou).map(i=>({id:i.id,url:qp(i.emoji,i.anim),preview:qp(i.emoji,i.anim),alt:i.alt}))}}const ys="<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>",_s="<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>",qp=(t,e)=>{const r=`<svg xmlns='http://www.w3.org/2000/svg' width='128' height='128'><rect width='128' height='128' rx='14' fill='#eef1f4'/><text x='64' y='88' font-size='64' text-anchor='middle'>${t}${e}</text></svg>`;return`data:image/svg+xml,${encodeURIComponent(r)}`},ou=[{id:"g1",emoji:"👍",alt:"thumbs up",tags:["thumbs","yes","ok","great","good"],anim:ys},{id:"g2",emoji:"🎉",alt:"celebrate",tags:["party","yay","congrats","celebrate"],anim:_s},{id:"g3",emoji:"👋",alt:"wave hello",tags:["hi","hello","hey","wave","bye"],anim:_s},{id:"g4",emoji:"❤️",alt:"heart",tags:["love","thanks","heart"],anim:ys},{id:"g5",emoji:"🤔",alt:"thinking",tags:["hmm","think","thinking"],anim:_s},{id:"g6",emoji:"😂",alt:"laughing",tags:["lol","funny","haha","laugh"],anim:ys},{id:"g7",emoji:"🔥",alt:"fire",tags:["fire","hot","lit","awesome"],anim:ys},{id:"g8",emoji:"🚀",alt:"rocket",tags:["rocket","launch","fast","go"],anim:_s}],su=t=>new Promise(e=>setTimeout(e,t));class cw{constructor(e,r){Vt(this,"real");Vt(this,"strings");this.real=e,this.strings=r}bootstrap(){return this.real.bootstrap()}async history(){return{conversations:[]}}async stream(e,r,n){await su(300);for(const a of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(a),await su(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async liveEvents(){return{mode:"ai",conversationEnded:!1,events:[]}}async typing(){}async action(){return await su(250),{ok:!0,note:this.strings.previewActionNote}}async speak(){return{providerReady:!1,message:"Preview voice provider is not connected."}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(e,r,n,a){return""}async extract(){return""}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}}var Fn,je,lu,Xp,Bi=0,Zp=[],nt=Ee,Kp=nt.__b,jp=nt.__r,Qp=nt.diffed,Jp=nt.__c,ev=nt.unmount,tv=nt.__;function zi(t,e){nt.__h&&nt.__h(je,t,Bi||e),Bi=0;var r=je.__H||(je.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function V(t){return Bi=1,uw(av,t)}function uw(t,e,r){var n=zi(Fn++,2);if(n.t=t,!n.__c&&(n.__=[av(void 0,e),function(s){var l=n.__N?n.__N[0]:n.__[0],c=n.t(l,s);l!==c&&(n.__N=[c,n.__[1]],n.__c.setState({}))}],n.__c=je,!je.__f)){var a=function(s,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(h){return h.__c});if(u.every(function(h){return!h.__N}))return!i||i.call(this,s,l,c);var f=n.__c.props!==s;return u.some(function(h){if(h.__N){var d=h.__[0];h.__=h.__N,h.__N=void 0,d!==h.__[0]&&(f=!0)}}),i&&i.call(this,s,l,c)||f};je.__f=!0;var i=je.shouldComponentUpdate,o=je.componentWillUpdate;je.componentWillUpdate=function(s,l,c){if(this.__e){var u=i;i=void 0,a(s,l,c),i=u}o&&o.call(this,s,l,c)},je.shouldComponentUpdate=a}return n.__N||n.__}function ie(t,e){var r=zi(Fn++,3);!nt.__s&&uu(r.__H,e)&&(r.__=t,r.u=e,je.__H.__h.push(r))}function rv(t,e){var r=zi(Fn++,4);!nt.__s&&uu(r.__H,e)&&(r.__=t,r.u=e,je.__h.push(r))}function W(t){return Bi=5,Kt(function(){return{current:t}},[])}function Kt(t,e){var r=zi(Fn++,7);return uu(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function Q(t,e){return Bi=8,Kt(function(){return t},e)}function fw(t){var e=je.context[t.__c],r=zi(Fn++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(je)),e.props.value):t.__}function hw(){for(var t;t=Zp.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(bs),e.__h.some(cu),e.__h=[]}catch(r){e.__h=[],nt.__e(r,t.__v)}}}nt.__b=function(t){je=null,Kp&&Kp(t)},nt.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),tv&&tv(t,e)},nt.__r=function(t){jp&&jp(t),Fn=0;var e=(je=t.__c).__H;e&&(lu===je?(e.__h=[],je.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(bs),e.__h.some(cu),e.__h=[],Fn=0)),lu=je},nt.diffed=function(t){Qp&&Qp(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Zp.push(e)!==1&&Xp===nt.requestAnimationFrame||((Xp=nt.requestAnimationFrame)||dw)(hw)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),lu=je=null},nt.__c=function(t,e){e.some(function(r){try{r.__h.some(bs),r.__h=r.__h.filter(function(n){return!n.__||cu(n)})}catch(n){e.some(function(a){a.__h&&(a.__h=[])}),e=[],nt.__e(n,r.__v)}}),Jp&&Jp(t,e)},nt.unmount=function(t){ev&&ev(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{bs(n)}catch(a){e=a}}),r.__H=void 0,e&&nt.__e(e,r.__v))};var nv=typeof requestAnimationFrame=="function";function dw(t){var e,r=function(){clearTimeout(n),nv&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);nv&&(e=requestAnimationFrame(r))}function bs(t){var e=je,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),je=e}function cu(t){var e=je;t.__c=t.__(),je=e}function uu(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function av(t,e){return typeof e=="function"?e(t):e}var fu=function(t,e){return fu=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(r[a]=n[a])},fu(t,e)};function Z(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");fu(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var hu=12,pw="sans-serif",Hn=hu+"px "+pw,vw=20,gw=100,mw="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function yw(t){var e={};if(typeof JSON>"u")return e;for(var r=0;r<t.length;r++){var n=String.fromCharCode(r+32),a=(t.charCodeAt(r)-vw)/gw;e[n]=a}return e}var _w=yw(mw),Na={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var t,e;return function(r,n){if(!t){var a=Na.createCanvas();t=a&&a.getContext("2d")}if(t)return e!==n&&(e=t.font=n||Hn),t.measureText(r);r=r||"",n=n||Hn;var i=/((?:\d+)?\.?\d*)px/.exec(n),o=i&&+i[1]||hu,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var c=_w[r[l]];s+=c==null?o:c*o}return{width:s}}})(),loadImage:function(t,e,r){var n=new Image;return n.onload=e,n.onerror=r,n.src=t,n}},iv=Ba(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),ov=Ba(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),Fi=Object.prototype.toString,xs=Array.prototype,bw=xs.forEach,xw=xs.filter,du=xs.slice,ww=xs.map,sv=function(){}.constructor,ws=sv?sv.prototype:null,pu="__proto__",Sw=2311;function lv(){return Sw++}function vu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function Te(t){if(t==null||typeof t!="object")return t;var e=t,r=Fi.call(t);if(r==="[object Array]"){if(!Gi(t)){e=[];for(var n=0,a=t.length;n<a;n++)e[n]=Te(t[n])}}else if(ov[r]){if(!Gi(t)){var i=t.constructor;if(i.from)e=i.from(t);else{e=new i(t.length);for(var n=0,a=t.length;n<a;n++)e[n]=t[n]}}}else if(!iv[r]&&!Gi(t)&&!Hi(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==pu&&(e[o]=Te(t[o]))}return e}function De(t,e,r){if(!ce(e)||!ce(t))return r?Te(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==pu){var a=t[n],i=e[n];ce(i)&&ce(a)&&!ee(i)&&!ee(a)&&!Hi(i)&&!Hi(a)&&!cv(i)&&!cv(a)&&!Gi(i)&&!Gi(a)?De(a,i,r):(r||!(n in t))&&(t[n]=Te(e[n]))}return t}function U(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==pu&&(t[r]=e[r]);return t}function Ne(t,e,r){for(var n=Qe(e),a=0,i=n.length;a<i;a++){var o=n[a];t[o]==null&&(t[o]=e[o])}return t}function ze(t,e){if(t){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r}return-1}function kw(t,e){var r=t.prototype;function n(){}n.prototype=e.prototype,t.prototype=new n;for(var a in r)r.hasOwnProperty(a)&&(t.prototype[a]=r[a]);t.prototype.constructor=t,t.superClass=e}function Cr(t,e,r){if(t="prototype"in t?t.prototype:t,e="prototype"in e?e.prototype:e,Object.getOwnPropertyNames)for(var n=Object.getOwnPropertyNames(e),a=0;a<n.length;a++){var i=n[a];i!=="constructor"&&t[i]==null&&(t[i]=e[i])}else Ne(t,e)}function Dt(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function D(t,e,r){if(t&&e)if(t.forEach&&t.forEach===bw)t.forEach(e,r);else if(t.length===+t.length)for(var n=0,a=t.length;n<a;n++)e.call(r,t[n],n,t);else for(var i in t)t.hasOwnProperty(i)&&e.call(r,t[i],i,t)}function ue(t,e,r){if(!t)return[];if(!e)return mu(t);if(t.map&&t.map===ww)return t.map(e,r);for(var n=[],a=0,i=t.length;a<i;a++)n.push(e.call(r,t[a],a,t));return n}function Ba(t,e,r,n){if(t&&e){for(var a=0,i=t.length;a<i;a++)r=e.call(n,r,t[a],a,t);return r}}function dt(t,e,r){if(!t)return[];if(!e)return mu(t);if(t.filter&&t.filter===xw)return t.filter(e,r);for(var n=[],a=0,i=t.length;a<i;a++)e.call(r,t[a],a,t)&&n.push(t[a]);return n}function Qe(t){if(!t)return[];if(Object.keys)return Object.keys(t);var e=[];for(var r in t)t.hasOwnProperty(r)&&e.push(r);return e}function Tw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return t.apply(e,r.concat(du.call(arguments)))}}var Le=ws&&ye(ws.bind)?ws.call.bind(ws.bind):Tw;function at(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(du.call(arguments)))}}function ee(t){return Array.isArray?Array.isArray(t):Fi.call(t)==="[object Array]"}function ye(t){return typeof t=="function"}function ne(t){return typeof t=="string"}function gu(t){return Fi.call(t)==="[object String]"}function Ke(t){return typeof t=="number"}function ce(t){var e=typeof t;return e==="function"||!!t&&e==="object"}function cv(t){return!!iv[Fi.call(t)]}function It(t){return!!ov[Fi.call(t)]}function Hi(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function Ss(t){return t.colorStops!=null}function Cw(t){return t.image!=null}function ks(t){return t!==t}function Vi(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];for(var r=0,n=t.length;r<n;r++)if(t[r]!=null)return t[r]}function Ce(t,e){return t??e}function Ts(t,e,r){return t??e??r}function mu(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return du.apply(t,e)}function uv(t){if(typeof t=="number")return[t,t,t,t];var e=t.length;return e===2?[t[0],t[1],t[0],t[1]]:e===3?[t[0],t[1],t[2],t[1]]:t}function Ur(t,e){if(!t)throw new Error(e)}function Mr(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var fv="__ec_primitive__";function yu(t){t[fv]=!0}function Gi(t){return t[fv]}var Mw=(function(){function t(){this.data={}}return t.prototype.delete=function(e){var r=this.has(e);return r&&delete this.data[e],r},t.prototype.has=function(e){return this.data.hasOwnProperty(e)},t.prototype.get=function(e){return this.data[e]},t.prototype.set=function(e,r){return this.data[e]=r,this},t.prototype.keys=function(){return Qe(this.data)},t.prototype.forEach=function(e){var r=this.data;for(var n in r)r.hasOwnProperty(n)&&e(r[n],n)},t})(),hv=typeof Map=="function";function Aw(){return hv?new Map:new Mw}var Dw=(function(){function t(e){var r=ee(e);this.data=Aw();var n=this;e instanceof t?e.each(a):e&&D(e,a);function a(i,o){r?n.set(i,o):n.set(o,i)}}return t.prototype.hasKey=function(e){return this.data.has(e)},t.prototype.get=function(e){return this.data.get(e)},t.prototype.set=function(e,r){return this.data.set(e,r),r},t.prototype.each=function(e,r){this.data.forEach(function(n,a){e.call(r,n,a)})},t.prototype.keys=function(){var e=this.data.keys();return hv?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t})();function de(t){return new Dw(t)}function Iw(t,e){for(var r=new t.constructor(t.length+e.length),n=0;n<t.length;n++)r[n]=t[n];for(var a=t.length,n=0;n<e.length;n++)r[n+a]=e[n];return r}function Cs(t,e){var r;if(Object.create)r=Object.create(t);else{var n=function(){};n.prototype=t,r=new n}return e&&U(r,e),r}function dv(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function Vn(t,e){return t.hasOwnProperty(e)}function Ct(){}var Lw=180/Math.PI,Pw=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),Rw=(function(){function t(){this.browser=new Pw,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 t})(),ge=new Rw;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(ge.wxa=!0,ge.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?ge.worker=!0:!ge.hasGlobalWindow||"Deno"in window?(ge.node=!0,ge.svgSupported=!0):Ew(navigator.userAgent,ge);function Ew(t,e){var r=e.browser,n=t.match(/Firefox\/([\d.]+)/),a=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),i=t.match(/Edge?\/([\d.]+)/),o=/micromessenger/i.test(t);n&&(r.firefox=!0,r.version=n[1]),a&&(r.ie=!0,r.version=a[1]),i&&(r.edge=!0,r.version=i[1],r.newEdge=+i[1].split(".")[0]>18),o&&(r.weChat=!0),e.svgSupported=typeof SVGRect<"u",e.touchEventsSupported="ontouchstart"in window&&!r.ie&&!r.edge,e.pointerEventsSupported="onpointerdown"in window&&(r.edge||r.ie&&+r.version>=11),e.domSupported=typeof document<"u";var s=document.documentElement.style;e.transform3dSupported=(r.ie&&"transition"in s||r.edge||"WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix||"MozPerspective"in s)&&!("OTransition"in s),e.transformSupported=e.transform3dSupported||r.ie&&+r.version>=9}var Ow=".",Gn="___EC__COMPONENT__CONTAINER___",pv="___EC__EXTENDED_CLASS___";function Ar(t){var e={main:"",sub:""};if(t){var r=t.split(Ow);e.main=r[0]||"",e.sub=r[1]||""}return e}function Nw(t){Ur(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function Bw(t){return!!(t&&t[pv])}function _u(t,e){t.$constructor=t,t.extend=function(r){var n=this,a;return zw(n)?a=(function(i){Z(o,i);function o(){return i.apply(this,arguments)||this}return o})(n):(a=function(){(r.$constructor||n).apply(this,arguments)},kw(a,this)),U(a.prototype,r),a[pv]=!0,a.extend=this.extend,a.superCall=Vw,a.superApply=Gw,a.superClass=n,a}}function zw(t){return ye(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function vv(t,e){t.extend=e.extend}var Fw=Math.round(Math.random()*10);function Hw(t){var e=["__\0is_clz",Fw++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function Vw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return this.superClass.prototype[e].apply(t,r)}function Gw(t,e,r){return this.superClass.prototype[e].apply(t,r)}function Ms(t){var e={};t.registerClass=function(n){var a=n.type||n.prototype.type;if(a){Nw(a),n.prototype.type=a;var i=Ar(a);if(!i.sub)e[i.main]=n;else if(i.sub!==Gn){var o=r(i);o[i.sub]=n}}return n},t.getClass=function(n,a,i){var o=e[n];if(o&&o[Gn]&&(o=a?o[a]:null),i&&!o)throw new Error(a?"Component "+n+"."+(a||"")+" is used but not imported.":n+".type should be specified.");return o},t.getClassesByMainType=function(n){var a=Ar(n),i=[],o=e[a.main];return o&&o[Gn]?D(o,function(s,l){l!==Gn&&i.push(s)}):i.push(o),i},t.hasClass=function(n){var a=Ar(n);return!!e[a.main]},t.getAllClassMainTypes=function(){var n=[];return D(e,function(a,i){n.push(i)}),n},t.hasSubTypes=function(n){var a=Ar(n),i=e[a.main];return i&&i[Gn]};function r(n){var a=e[n.main];return(!a||!a[Gn])&&(a=e[n.main]={},a[Gn]=!0),a}}function $i(t,e){for(var r=0;r<t.length;r++)t[r][1]||(t[r][1]=t[r][0]);return e=e||!1,function(n,a,i){for(var o={},s=0;s<t.length;s++){var l=t[s][1];if(!(a&&ze(a,l)>=0||i&&ze(i,l)<0)){var c=n.getShallow(l,e);c!=null&&(o[t[s][0]]=c)}}return o}}var $w=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],Ww=$i($w),Uw=(function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return Ww(this,e,r)},t})(),gv=(function(){function t(e){this.value=e}return t})(),Yw=(function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new gv(e);return this.insertEntry(r),r},t.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++},t.prototype.remove=function(e){var r=e.prev,n=e.next;r?r.next=n:this.head=n,n?n.prev=r:this.tail=r,e.next=e.prev=null,this._len--},t.prototype.len=function(){return this._len},t.prototype.clear=function(){this.head=this.tail=null,this._len=0},t})(),Wi=(function(){function t(e){this._list=new Yw,this._maxSize=10,this._map={},this._maxSize=e}return t.prototype.put=function(e,r){var n=this._list,a=this._map,i=null;if(a[e]==null){var o=n.len(),s=this._lastRemovedEntry;if(o>=this._maxSize&&o>0){var l=n.head;n.remove(l),delete a[l.key],i=l.value,this._lastRemovedEntry=l}s?s.value=r:s=new gv(r),s.key=e,n.insertEntry(s),a[e]=s}return i},t.prototype.get=function(e){var r=this._map[e],n=this._list;if(r!=null)return r!==n.tail&&(n.remove(r),n.insertEntry(r)),r.value},t.prototype.clear=function(){this._list.clear(),this._map={}},t.prototype.len=function(){return this._list.len()},t})(),bu=new Wi(50);function qw(t){if(typeof t=="string"){var e=bu.get(t);return e&&e.image}else return t}function mv(t,e,r,n,a){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var i=bu.get(t),o={hostEl:r,cb:n,cbPayload:a};return i?(e=i.image,!As(e)&&i.pending.push(o)):(e=Na.loadImage(t,yv,yv),e.__zrImageSrc=t,bu.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function yv(){var t=this.__cachedImgObj;this.onload=this.onerror=this.__cachedImgObj=null;for(var e=0;e<t.pending.length;e++){var r=t.pending[e],n=r.cb;n&&n(this,r.cbPayload),r.hostEl.dirty()}t.pending.length=0}function As(t){return t&&t.width&&t.height}function za(){return[1,0,0,1,0,0]}function xu(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Xw(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t}function Fa(t,e,r){var n=e[0]*r[0]+e[2]*r[1],a=e[1]*r[0]+e[3]*r[1],i=e[0]*r[2]+e[2]*r[3],o=e[1]*r[2]+e[3]*r[3],s=e[0]*r[4]+e[2]*r[5]+e[4],l=e[1]*r[4]+e[3]*r[5]+e[5];return t[0]=n,t[1]=a,t[2]=i,t[3]=o,t[4]=s,t[5]=l,t}function wu(t,e,r){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4]+r[0],t[5]=e[5]+r[1],t}function Su(t,e,r,n){n===void 0&&(n=[0,0]);var a=e[0],i=e[2],o=e[4],s=e[1],l=e[3],c=e[5],u=Math.sin(r),f=Math.cos(r);return t[0]=a*f+s*u,t[1]=-a*u+s*f,t[2]=i*f+l*u,t[3]=-i*u+f*l,t[4]=f*(o-n[0])+u*(c-n[1])+n[0],t[5]=f*(c-n[1])-u*(o-n[0])+n[1],t}function Zw(t,e,r){var n=r[0],a=r[1];return t[0]=e[0]*n,t[1]=e[1]*a,t[2]=e[2]*n,t[3]=e[3]*a,t[4]=e[4]*n,t[5]=e[5]*a,t}function ku(t,e){var r=e[0],n=e[2],a=e[4],i=e[1],o=e[3],s=e[5],l=r*o-i*n;return l?(l=1/l,t[0]=o*l,t[1]=-i*l,t[2]=-n*l,t[3]=r*l,t[4]=(n*s-o*a)*l,t[5]=(i*a-r*s)*l,t):null}var Ye=(function(){function t(e,r){this.x=e||0,this.y=r||0}return t.prototype.copy=function(e){return this.x=e.x,this.y=e.y,this},t.prototype.clone=function(){return new t(this.x,this.y)},t.prototype.set=function(e,r){return this.x=e,this.y=r,this},t.prototype.equal=function(e){return e.x===this.x&&e.y===this.y},t.prototype.add=function(e){return this.x+=e.x,this.y+=e.y,this},t.prototype.scale=function(e){this.x*=e,this.y*=e},t.prototype.scaleAndAdd=function(e,r){this.x+=e.x*r,this.y+=e.y*r},t.prototype.sub=function(e){return this.x-=e.x,this.y-=e.y,this},t.prototype.dot=function(e){return this.x*e.x+this.y*e.y},t.prototype.len=function(){return Math.sqrt(this.x*this.x+this.y*this.y)},t.prototype.lenSquare=function(){return this.x*this.x+this.y*this.y},t.prototype.normalize=function(){var e=this.len();return this.x/=e,this.y/=e,this},t.prototype.distance=function(e){var r=this.x-e.x,n=this.y-e.y;return Math.sqrt(r*r+n*n)},t.prototype.distanceSquare=function(e){var r=this.x-e.x,n=this.y-e.y;return r*r+n*n},t.prototype.negate=function(){return this.x=-this.x,this.y=-this.y,this},t.prototype.transform=function(e){if(e){var r=this.x,n=this.y;return this.x=e[0]*r+e[2]*n+e[4],this.y=e[1]*r+e[3]*n+e[5],this}},t.prototype.toArray=function(e){return e[0]=this.x,e[1]=this.y,e},t.prototype.fromArray=function(e){this.x=e[0],this.y=e[1]},t.set=function(e,r,n){e.x=r,e.y=n},t.copy=function(e,r){e.x=r.x,e.y=r.y},t.len=function(e){return Math.sqrt(e.x*e.x+e.y*e.y)},t.lenSquare=function(e){return e.x*e.x+e.y*e.y},t.dot=function(e,r){return e.x*r.x+e.y*r.y},t.add=function(e,r,n){e.x=r.x+n.x,e.y=r.y+n.y},t.sub=function(e,r,n){e.x=r.x-n.x,e.y=r.y-n.y},t.scale=function(e,r,n){e.x=r.x*n,e.y=r.y*n},t.scaleAndAdd=function(e,r,n,a){e.x=r.x+n.x*a,e.y=r.y+n.y*a},t.lerp=function(e,r,n,a){var i=1-a;e.x=i*r.x+a*n.x,e.y=i*r.y+a*n.y},t})(),Ds=Math.min,Is=Math.max,$n=new Ye,Wn=new Ye,Un=new Ye,Yn=new Ye,Ui=new Ye,Yi=new Ye,Fe=(function(){function t(e,r,n,a){n<0&&(e=e+n,n=-n),a<0&&(r=r+a,a=-a),this.x=e,this.y=r,this.width=n,this.height=a}return t.prototype.union=function(e){var r=Ds(e.x,this.x),n=Ds(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=Is(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=Is(e.y+e.height,this.y+this.height)-n:this.height=e.height,this.x=r,this.y=n},t.prototype.applyTransform=function(e){t.applyTransform(this,this,e)},t.prototype.calculateTransform=function(e){var r=this,n=e.width/r.width,a=e.height/r.height,i=za();return wu(i,i,[-r.x,-r.y]),Zw(i,i,[n,a]),wu(i,i,[e.x,e.y]),i},t.prototype.intersect=function(e,r){if(!e)return!1;e instanceof t||(e=t.create(e));var n=this,a=n.x,i=n.x+n.width,o=n.y,s=n.y+n.height,l=e.x,c=e.x+e.width,u=e.y,f=e.y+e.height,h=!(i<l||c<a||s<u||f<o);if(r){var d=1/0,p=0,m=Math.abs(i-l),g=Math.abs(c-a),v=Math.abs(s-u),y=Math.abs(f-o),b=Math.min(m,g),x=Math.min(v,y);i<l||c<a?b>p&&(p=b,m<g?Ye.set(Yi,-m,0):Ye.set(Yi,g,0)):b<d&&(d=b,m<g?Ye.set(Ui,m,0):Ye.set(Ui,-g,0)),s<u||f<o?x>p&&(p=x,v<y?Ye.set(Yi,0,-v):Ye.set(Yi,0,y)):b<d&&(d=b,v<y?Ye.set(Ui,0,v):Ye.set(Ui,0,-y))}return r&&Ye.copy(r,h?Ui:Yi),h},t.prototype.contain=function(e,r){var n=this;return e>=n.x&&e<=n.x+n.width&&r>=n.y&&r<=n.y+n.height},t.prototype.clone=function(){return new t(this.x,this.y,this.width,this.height)},t.prototype.copy=function(e){t.copy(this,e)},t.prototype.plain=function(){return{x:this.x,y:this.y,width:this.width,height:this.height}},t.prototype.isFinite=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)},t.prototype.isZero=function(){return this.width===0||this.height===0},t.create=function(e){return new t(e.x,e.y,e.width,e.height)},t.copy=function(e,r){e.x=r.x,e.y=r.y,e.width=r.width,e.height=r.height},t.applyTransform=function(e,r,n){if(!n){e!==r&&t.copy(e,r);return}if(n[1]<1e-5&&n[1]>-1e-5&&n[2]<1e-5&&n[2]>-1e-5){var a=n[0],i=n[3],o=n[4],s=n[5];e.x=r.x*a+o,e.y=r.y*i+s,e.width=r.width*a,e.height=r.height*i,e.width<0&&(e.x+=e.width,e.width=-e.width),e.height<0&&(e.y+=e.height,e.height=-e.height);return}$n.x=Un.x=r.x,$n.y=Yn.y=r.y,Wn.x=Yn.x=r.x+r.width,Wn.y=Un.y=r.y+r.height,$n.transform(n),Yn.transform(n),Wn.transform(n),Un.transform(n),e.x=Ds($n.x,Wn.x,Un.x,Yn.x),e.y=Ds($n.y,Wn.y,Un.y,Yn.y);var l=Is($n.x,Wn.x,Un.x,Yn.x),c=Is($n.y,Wn.y,Un.y,Yn.y);e.width=l-e.x,e.height=c-e.y},t})(),_v={};function $t(t,e){e=e||Hn;var r=_v[e];r||(r=_v[e]=new Wi(500));var n=r.get(t);return n==null&&(n=Na.measureText(t,e).width,r.put(t,n)),n}function bv(t,e,r,n){var a=$t(t,e),i=Cu(e),o=qi(0,a,r),s=Ha(0,i,n),l=new Fe(o,s,a,i);return l}function Tu(t,e,r,n){var a=((t||"")+"").split(`
|
|
6
|
+
`),i=a.length;if(i===1)return bv(a[0],e,r,n);for(var o=new Fe(0,0,0,0),s=0;s<a.length;s++){var l=bv(a[s],e,r,n);s===0?o.copy(l):o.union(l)}return o}function qi(t,e,r){return r==="right"?t-=e:r==="center"&&(t-=e/2),t}function Ha(t,e,r){return r==="middle"?t-=e/2:r==="bottom"&&(t-=e),t}function Cu(t){return $t("国",t)}function dn(t,e){return typeof t=="string"?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function Ls(t,e,r){var n=e.position||"inside",a=e.distance!=null?e.distance:5,i=r.height,o=r.width,s=i/2,l=r.x,c=r.y,u="left",f="top";if(n instanceof Array)l+=dn(n[0],r.width),c+=dn(n[1],r.height),u=null,f=null;else switch(n){case"left":l-=a,c+=s,u="right",f="middle";break;case"right":l+=a+o,c+=s,f="middle";break;case"top":l+=o/2,c-=a,u="center",f="bottom";break;case"bottom":l+=o/2,c+=i+a,u="center";break;case"inside":l+=o/2,c+=s,u="center",f="middle";break;case"insideLeft":l+=a,c+=s,f="middle";break;case"insideRight":l+=o-a,c+=s,u="right",f="middle";break;case"insideTop":l+=o/2,c+=a,u="center";break;case"insideBottom":l+=o/2,c+=i-a,u="center",f="bottom";break;case"insideTopLeft":l+=a,c+=a;break;case"insideTopRight":l+=o-a,c+=a,u="right";break;case"insideBottomLeft":l+=a,c+=i-a,f="bottom";break;case"insideBottomRight":l+=o-a,c+=i-a,u="right",f="bottom";break}return t=t||{},t.x=l,t.y=c,t.align=u,t.verticalAlign=f,t}var Mu=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Kw(t,e,r,n,a,i){if(!r){t.text="",t.isTruncated=!1;return}var o=(e+"").split(`
|
|
7
|
+
`);i=xv(r,n,a,i);for(var s=!1,l={},c=0,u=o.length;c<u;c++)wv(l,o[c],i),o[c]=l.textLine,s=s||l.isTruncated;t.text=o.join(`
|
|
8
|
+
`),t.isTruncated=s}function xv(t,e,r,n){n=n||{};var a=U({},n);a.font=e,r=Ce(r,"..."),a.maxIterations=Ce(n.maxIterations,2);var i=a.minChar=Ce(n.minChar,0);a.cnCharWidth=$t("国",e);var o=a.ascCharWidth=$t("a",e);a.placeholder=Ce(n.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<i&&s>=o;l++)s-=o;var c=$t(r,e);return c>s&&(r="",c=0),s=t-c,a.ellipsis=r,a.ellipsisWidth=c,a.contentWidth=s,a.containerWidth=t,a}function wv(t,e,r){var n=r.containerWidth,a=r.font,i=r.contentWidth;if(!n){t.textLine="",t.isTruncated=!1;return}var o=$t(e,a);if(o<=n){t.textLine=e,t.isTruncated=!1;return}for(var s=0;;s++){if(o<=i||s>=r.maxIterations){e+=r.ellipsis;break}var l=s===0?jw(e,i,r.ascCharWidth,r.cnCharWidth):o>0?Math.floor(e.length*i/o):0;e=e.substr(0,l),o=$t(e,a)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function jw(t,e,r,n){for(var a=0,i=0,o=t.length;i<o&&a<e;i++){var s=t.charCodeAt(i);a+=0<=s&&s<=127?r:n}return i}function Qw(t,e){t!=null&&(t+="");var r=e.overflow,n=e.padding,a=e.font,i=r==="truncate",o=Cu(a),s=Ce(e.lineHeight,o),l=!!e.backgroundColor,c=e.lineOverflow==="truncate",u=!1,f=e.width,h;f!=null&&(r==="break"||r==="breakAll")?h=t?kv(t,e.font,f,r==="breakAll",0).lines:[]:h=t?t.split(`
|
|
9
|
+
`):[];var d=h.length*s,p=Ce(e.height,d);if(d>p&&c){var m=Math.floor(p/s);u=u||h.length>m,h=h.slice(0,m)}if(t&&i&&f!=null)for(var g=xv(f,a,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),v={},y=0;y<h.length;y++)wv(v,h[y],g),h[y]=v.textLine,u=u||v.isTruncated;for(var b=p,x=0,y=0;y<h.length;y++)x=Math.max($t(h[y],a),x);f==null&&(f=x);var S=x;return n&&(b+=n[0]+n[2],S+=n[1]+n[3],f+=n[1]+n[3]),l&&(S=f),{lines:h,height:p,outerWidth:S,outerHeight:b,lineHeight:s,calculatedLineHeight:o,contentWidth:x,contentHeight:d,width:f,isTruncated:u}}var Jw=(function(){function t(){}return t})(),Sv=(function(){function t(e){this.tokens=[],e&&(this.tokens=e)}return t})(),eS=(function(){function t(){this.width=0,this.height=0,this.contentWidth=0,this.contentHeight=0,this.outerWidth=0,this.outerHeight=0,this.lines=[],this.isTruncated=!1}return t})();function tS(t,e){var r=new eS;if(t!=null&&(t+=""),!t)return r;for(var n=e.width,a=e.height,i=e.overflow,o=(i==="break"||i==="breakAll")&&n!=null?{width:n,accumWidth:0,breakAll:i==="breakAll"}:null,s=Mu.lastIndex=0,l;(l=Mu.exec(t))!=null;){var c=l.index;c>s&&Au(r,t.substring(s,c),e,o),Au(r,l[2],e,o,l[1]),s=Mu.lastIndex}s<t.length&&Au(r,t.substring(s,t.length),e,o);var u=[],f=0,h=0,d=e.padding,p=i==="truncate",m=e.lineOverflow==="truncate",g={};function v(F,X,te){F.width=X,F.lineHeight=te,f+=te,h=Math.max(h,X)}e:for(var y=0;y<r.lines.length;y++){for(var b=r.lines[y],x=0,S=0,w=0;w<b.tokens.length;w++){var k=b.tokens[w],T=k.styleName&&e.rich[k.styleName]||{},C=k.textPadding=T.padding,A=C?C[1]+C[3]:0,M=k.font=T.font||e.font;k.contentHeight=Cu(M);var I=Ce(T.height,k.contentHeight);if(k.innerHeight=I,C&&(I+=C[0]+C[2]),k.height=I,k.lineHeight=Ts(T.lineHeight,e.lineHeight,I),k.align=T&&T.align||e.align,k.verticalAlign=T&&T.verticalAlign||"middle",m&&a!=null&&f+k.lineHeight>a){var L=r.lines.length;w>0?(b.tokens=b.tokens.slice(0,w),v(b,S,x),r.lines=r.lines.slice(0,y+1)):r.lines=r.lines.slice(0,y),r.isTruncated=r.isTruncated||r.lines.length<L;break e}var P=T.width,N=P==null||P==="auto";if(typeof P=="string"&&P.charAt(P.length-1)==="%")k.percentWidth=P,u.push(k),k.contentWidth=$t(k.text,M);else{if(N){var O=T.backgroundColor,q=O&&O.image;q&&(q=qw(q),As(q)&&(k.width=Math.max(k.width,q.width*I/q.height)))}var R=p&&n!=null?n-S:null;R!=null&&R<k.width?!N||R<A?(k.text="",k.width=k.contentWidth=0):(Kw(g,k.text,R-A,M,e.ellipsis,{minChar:e.truncateMinChar}),k.text=g.text,r.isTruncated=r.isTruncated||g.isTruncated,k.width=k.contentWidth=$t(k.text,M)):k.contentWidth=$t(k.text,M)}k.width+=A,S+=k.width,T&&(x=Math.max(x,k.lineHeight))}v(b,S,x)}r.outerWidth=r.width=Ce(n,h),r.outerHeight=r.height=Ce(a,f),r.contentHeight=f,r.contentWidth=h,d&&(r.outerWidth+=d[1]+d[3],r.outerHeight+=d[0]+d[2]);for(var y=0;y<u.length;y++){var k=u[y],z=k.percentWidth;k.width=parseInt(z,10)/100*r.width}return r}function Au(t,e,r,n,a){var i=e==="",o=a&&r.rich[a]||{},s=t.lines,l=o.font||r.font,c=!1,u,f;if(n){var h=o.padding,d=h?h[1]+h[3]:0;if(o.width!=null&&o.width!=="auto"){var p=dn(o.width,n.width)+d;s.length>0&&p+n.accumWidth>n.width&&(u=e.split(`
|
|
10
|
+
`),c=!0),n.accumWidth=p}else{var m=kv(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+d,f=m.linesWidths,u=m.lines}}else u=e.split(`
|
|
11
|
+
`);for(var g=0;g<u.length;g++){var v=u[g],y=new Jw;if(y.styleName=a,y.text=v,y.isLineHolder=!v&&!i,typeof o.width=="number"?y.width=o.width:y.width=f?f[g]:$t(v,l),!g&&!c){var b=(s[s.length-1]||(s[0]=new Sv)).tokens,x=b.length;x===1&&b[0].isLineHolder?b[0]=y:(v||!x||i)&&b.push(y)}else s.push(new Sv([y]))}}function rS(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var nS=Ba(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function aS(t){return rS(t)?!!nS[t]:!0}function kv(t,e,r,n,a){for(var i=[],o=[],s="",l="",c=0,u=0,f=0;f<t.length;f++){var h=t.charAt(f);if(h===`
|
|
12
|
+
`){l&&(s+=l,u+=c),i.push(s),o.push(u),s="",l="",c=0,u=0;continue}var d=$t(h,e),p=n?!1:!aS(h);if(i.length?u+d>r:a+u+d>r){u?(s||l)&&(p?(s||(s=l,l="",c=0,u=c),i.push(s),o.push(u-c),l+=h,c+=d,s="",u=c):(l&&(s+=l,l="",c=0),i.push(s),o.push(u),s=h,u=d)):p?(i.push(l),o.push(c),l=h,c=d):(i.push(h),o.push(d));continue}u+=d,p?(l+=h,c+=d):(l&&(s+=l,l="",c=0),s+=h)}return!i.length&&!s&&(s=t,l="",c=0),l&&(s+=l),s&&(i.push(s),o.push(u)),i.length===1&&(u+=a),{accumWidth:u,lines:i,linesWidths:o}}function Va(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function iS(t){return[t[0],t[1]]}function Tv(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function oS(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function sS(t){return Math.sqrt(lS(t))}function lS(t){return t[0]*t[0]+t[1]*t[1]}function Du(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function cS(t,e){var r=sS(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function Iu(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var uS=Iu;function fS(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Ga=fS;function jt(t,e,r){var n=e[0],a=e[1];return t[0]=r[0]*n+r[2]*a+r[4],t[1]=r[1]*n+r[3]*a+r[5],t}function $a(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Wa(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var Cv=xu,Mv=5e-5;function qn(t){return t>Mv||t<-Mv}var Xn=[],Ua=[],Lu=za(),Pu=Math.abs,Ru=(function(){function t(){}return t.prototype.getLocalTransform=function(e){return t.getLocalTransform(this,e)},t.prototype.setPosition=function(e){this.x=e[0],this.y=e[1]},t.prototype.setScale=function(e){this.scaleX=e[0],this.scaleY=e[1]},t.prototype.setSkew=function(e){this.skewX=e[0],this.skewY=e[1]},t.prototype.setOrigin=function(e){this.originX=e[0],this.originY=e[1]},t.prototype.needLocalTransform=function(){return qn(this.rotation)||qn(this.x)||qn(this.y)||qn(this.scaleX-1)||qn(this.scaleY-1)||qn(this.skewX)||qn(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(Cv(n),this.invTransform=null);return}n=n||za(),r?this.getLocalTransform(n):Cv(n),e&&(r?Fa(n,e,n):Xw(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Xn);var n=Xn[0]<0?-1:1,a=Xn[1]<0?-1:1,i=((Xn[0]-n)*r+n)/Xn[0]||0,o=((Xn[1]-a)*r+a)/Xn[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||za(),ku(this.invTransform,e)},t.prototype.getComputedTransform=function(){for(var e=this,r=[];e;)r.push(e),e=e.parent;for(;e=r.pop();)e.updateTransform();return this.transform},t.prototype.setLocalTransform=function(e){if(e){var r=e[0]*e[0]+e[1]*e[1],n=e[2]*e[2]+e[3]*e[3],a=Math.atan2(e[1],e[0]),i=Math.PI/2+a-Math.atan2(e[3],e[2]);n=Math.sqrt(n)*Math.cos(i),r=Math.sqrt(r),this.skewX=i,this.skewY=0,this.rotation=-a,this.x=+e[4],this.y=+e[5],this.scaleX=r,this.scaleY=n,this.originX=0,this.originY=0}},t.prototype.decomposeTransform=function(){if(this.transform){var e=this.parent,r=this.transform;e&&e.transform&&(e.invTransform=e.invTransform||za(),Fa(Ua,e.invTransform,r),r=Ua);var n=this.originX,a=this.originY;(n||a)&&(Lu[4]=n,Lu[5]=a,Fa(Ua,r,Lu),Ua[4]-=n,Ua[5]-=a,r=Ua),this.setLocalTransform(r)}},t.prototype.getGlobalScale=function(e){var r=this.transform;return e=e||[],r?(e[0]=Math.sqrt(r[0]*r[0]+r[1]*r[1]),e[1]=Math.sqrt(r[2]*r[2]+r[3]*r[3]),r[0]<0&&(e[0]=-e[0]),r[3]<0&&(e[1]=-e[1]),e):(e[0]=1,e[1]=1,e)},t.prototype.transformCoordToLocal=function(e,r){var n=[e,r],a=this.invTransform;return a&&jt(n,n,a),n},t.prototype.transformCoordToGlobal=function(e,r){var n=[e,r],a=this.transform;return a&&jt(n,n,a),n},t.prototype.getLineScale=function(){var e=this.transform;return e&&Pu(e[0]-1)>1e-10&&Pu(e[3]-1)>1e-10?Math.sqrt(Pu(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){hS(this,e)},t.getLocalTransform=function(e,r){r=r||[];var n=e.originX||0,a=e.originY||0,i=e.scaleX,o=e.scaleY,s=e.anchorX,l=e.anchorY,c=e.rotation||0,u=e.x,f=e.y,h=e.skewX?Math.tan(e.skewX):0,d=e.skewY?Math.tan(-e.skewY):0;if(n||a||s||l){var p=n+s,m=a+l;r[4]=-p*i-h*m*o,r[5]=-m*o-d*p*i}else r[4]=r[5]=0;return r[0]=i,r[3]=o,r[1]=d*i,r[2]=h*o,c&&Su(r,r,c),r[4]+=n+u,r[5]+=a+f,r},t.initDefaultProps=(function(){var e=t.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})(),t})(),Xi=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function hS(t,e){for(var r=0;r<Xi.length;r++){var n=Xi[r];t[n]=e[n]}}var Zi={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return .5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return t===0?0:Math.pow(1024,t-1)},exponentialOut:function(t){return t===1?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return t===0?0:t===1?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(-Math.pow(2,-10*(t-1))+2)},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),-(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)))},elasticOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),r*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/n)+1)},elasticInOut:function(t){var e,r=.1,n=.4;return t===0?0:t===1?1:(!r||r<1?(r=1,e=n/4):e=n*Math.asin(1/r)/(2*Math.PI),(t*=2)<1?-.5*(r*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)):r*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/n)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?.5*(t*t*((e+1)*t-e)):.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-Zi.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?Zi.bounceIn(t*2)*.5:Zi.bounceOut(t*2-1)*.5+.5}},Ps=Math.pow,pn=Math.sqrt,Rs=1e-8,Av=1e-4,Dv=pn(3),Es=1/3,Dr=Va(),Qt=Va(),Ya=Va();function vn(t){return t>-Rs&&t<Rs}function Iv(t){return t>Rs||t<-Rs}function gt(t,e,r,n,a){var i=1-a;return i*i*(i*t+3*a*e)+a*a*(a*n+3*i*r)}function Lv(t,e,r,n,a){var i=1-a;return 3*(((e-t)*i+2*(r-e)*a)*i+(n-r)*a*a)}function Os(t,e,r,n,a,i){var o=n+3*(e-r)-t,s=3*(r-e*2+t),l=3*(e-t),c=t-a,u=s*s-3*o*l,f=s*l-9*o*c,h=l*l-3*s*c,d=0;if(vn(u)&&vn(f))if(vn(s))i[0]=0;else{var p=-l/s;p>=0&&p<=1&&(i[d++]=p)}else{var m=f*f-4*u*h;if(vn(m)){var g=f/u,p=-s/o+g,v=-g/2;p>=0&&p<=1&&(i[d++]=p),v>=0&&v<=1&&(i[d++]=v)}else if(m>0){var y=pn(m),b=u*s+1.5*o*(-f+y),x=u*s+1.5*o*(-f-y);b<0?b=-Ps(-b,Es):b=Ps(b,Es),x<0?x=-Ps(-x,Es):x=Ps(x,Es);var p=(-s-(b+x))/(3*o);p>=0&&p<=1&&(i[d++]=p)}else{var S=(2*u*s-3*o*f)/(2*pn(u*u*u)),w=Math.acos(S)/3,k=pn(u),T=Math.cos(w),p=(-s-2*k*T)/(3*o),v=(-s+k*(T+Dv*Math.sin(w)))/(3*o),C=(-s+k*(T-Dv*Math.sin(w)))/(3*o);p>=0&&p<=1&&(i[d++]=p),v>=0&&v<=1&&(i[d++]=v),C>=0&&C<=1&&(i[d++]=C)}}return d}function Pv(t,e,r,n,a){var i=6*r-12*e+6*t,o=9*e+3*n-3*t-9*r,s=3*e-3*t,l=0;if(vn(o)){if(Iv(i)){var c=-s/i;c>=0&&c<=1&&(a[l++]=c)}}else{var u=i*i-4*o*s;if(vn(u))a[0]=-i/(2*o);else if(u>0){var f=pn(u),c=(-i+f)/(2*o),h=(-i-f)/(2*o);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Ns(t,e,r,n,a,i){var o=(e-t)*a+t,s=(r-e)*a+e,l=(n-r)*a+r,c=(s-o)*a+o,u=(l-s)*a+s,f=(u-c)*a+c;i[0]=t,i[1]=o,i[2]=c,i[3]=f,i[4]=f,i[5]=u,i[6]=l,i[7]=n}function dS(t,e,r,n,a,i,o,s,l,c,u){var f,h=.005,d=1/0,p,m,g,v;Dr[0]=l,Dr[1]=c;for(var y=0;y<1;y+=.05)Qt[0]=gt(t,r,a,o,y),Qt[1]=gt(e,n,i,s,y),g=Ga(Dr,Qt),g<d&&(f=y,d=g);d=1/0;for(var b=0;b<32&&!(h<Av);b++)p=f-h,m=f+h,Qt[0]=gt(t,r,a,o,p),Qt[1]=gt(e,n,i,s,p),g=Ga(Qt,Dr),p>=0&&g<d?(f=p,d=g):(Ya[0]=gt(t,r,a,o,m),Ya[1]=gt(e,n,i,s,m),v=Ga(Ya,Dr),m<=1&&v<d?(f=m,d=v):h*=.5);return pn(d)}function pS(t,e,r,n,a,i,o,s,l){for(var c=t,u=e,f=0,h=1/l,d=1;d<=l;d++){var p=d*h,m=gt(t,r,a,o,p),g=gt(e,n,i,s,p),v=m-c,y=g-u;f+=Math.sqrt(v*v+y*y),c=m,u=g}return f}function Lt(t,e,r,n){var a=1-n;return a*(a*t+2*n*e)+n*n*r}function Rv(t,e,r,n){return 2*((1-n)*(e-t)+n*(r-e))}function vS(t,e,r,n,a){var i=t-2*e+r,o=2*(e-t),s=t-n,l=0;if(vn(i)){if(Iv(o)){var c=-s/o;c>=0&&c<=1&&(a[l++]=c)}}else{var u=o*o-4*i*s;if(vn(u)){var c=-o/(2*i);c>=0&&c<=1&&(a[l++]=c)}else if(u>0){var f=pn(u),c=(-o+f)/(2*i),h=(-o-f)/(2*i);c>=0&&c<=1&&(a[l++]=c),h>=0&&h<=1&&(a[l++]=h)}}return l}function Ev(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function Bs(t,e,r,n,a){var i=(e-t)*n+t,o=(r-e)*n+e,s=(o-i)*n+i;a[0]=t,a[1]=i,a[2]=s,a[3]=s,a[4]=o,a[5]=r}function gS(t,e,r,n,a,i,o,s,l){var c,u=.005,f=1/0;Dr[0]=o,Dr[1]=s;for(var h=0;h<1;h+=.05){Qt[0]=Lt(t,r,a,h),Qt[1]=Lt(e,n,i,h);var d=Ga(Dr,Qt);d<f&&(c=h,f=d)}f=1/0;for(var p=0;p<32&&!(u<Av);p++){var m=c-u,g=c+u;Qt[0]=Lt(t,r,a,m),Qt[1]=Lt(e,n,i,m);var d=Ga(Qt,Dr);if(m>=0&&d<f)c=m,f=d;else{Ya[0]=Lt(t,r,a,g),Ya[1]=Lt(e,n,i,g);var v=Ga(Ya,Dr);g<=1&&v<f?(c=g,f=v):u*=.5}}return pn(f)}function mS(t,e,r,n,a,i,o){for(var s=t,l=e,c=0,u=1/o,f=1;f<=o;f++){var h=f*u,d=Lt(t,r,a,h),p=Lt(e,n,i,h),m=d-s,g=p-l;c+=Math.sqrt(m*m+g*g),s=d,l=p}return c}var yS=/cubic-bezier\(([0-9,\.e ]+)\)/;function Ov(t){var e=t&&yS.exec(t);if(e){var r=e[1].split(","),n=+Mr(r[0]),a=+Mr(r[1]),i=+Mr(r[2]),o=+Mr(r[3]);if(isNaN(n+a+i+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:Os(0,n,i,1,l,s)&>(0,a,o,1,s[0])}}}var _S=(function(){function t(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||Ct,this.ondestroy=e.ondestroy||Ct,this.onrestart=e.onrestart||Ct,e.easing&&this.setEasing(e.easing)}return t.prototype.step=function(e,r){if(this._inited||(this._startTime=e+this._delay,this._inited=!0),this._paused){this._pausedTime+=r;return}var n=this._life,a=e-this._startTime-this._pausedTime,i=a/n;i<0&&(i=0),i=Math.min(i,1);var o=this.easingFunc,s=o?o(i):i;if(this.onframe(s),i===1)if(this.loop){var l=a%n;this._startTime=e-l,this._pausedTime=0,this.onrestart()}else return!0;return!1},t.prototype.pause=function(){this._paused=!0},t.prototype.resume=function(){this._paused=!1},t.prototype.setEasing=function(e){this.easing=e,this.easingFunc=ye(e)?e:Zi[e]||Ov(e)},t})(),Nv={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 gn(t){return t=Math.round(t),t<0?0:t>255?255:t}function Eu(t){return t<0?0:t>1?1:t}function Ou(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?gn(parseFloat(e)/100*255):gn(parseInt(e,10))}function Ki(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?Eu(parseFloat(e)/100):Eu(parseFloat(e))}function Nu(t,e,r){return r<0?r+=1:r>1&&(r-=1),r*6<1?t+(e-t)*r*6:r*2<1?e:r*3<2?t+(e-t)*(.6666666666666666-r)*6:t}function zs(t,e,r){return t+(e-t)*r}function Jt(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}function Bu(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Bv=new Wi(20),Fs=null;function qa(t,e){Fs&&Bu(Fs,e),Fs=Bv.put(t,Fs||e.slice())}function Yr(t,e){if(t){e=e||[];var r=Bv.get(t);if(r)return Bu(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in Nv)return Bu(e,Nv[n]),qa(t,e),e;var a=n.length;if(n.charAt(0)==="#"){if(a===4||a===5){var i=parseInt(n.slice(1,4),16);if(!(i>=0&&i<=4095)){Jt(e,0,0,0,1);return}return Jt(e,(i&3840)>>4|(i&3840)>>8,i&240|(i&240)>>4,i&15|(i&15)<<4,a===5?parseInt(n.slice(4),16)/15:1),qa(t,e),e}else if(a===7||a===9){var i=parseInt(n.slice(1,7),16);if(!(i>=0&&i<=16777215)){Jt(e,0,0,0,1);return}return Jt(e,(i&16711680)>>16,(i&65280)>>8,i&255,a===9?parseInt(n.slice(7),16)/255:1),qa(t,e),e}return}var o=n.indexOf("("),s=n.indexOf(")");if(o!==-1&&s+1===a){var l=n.substr(0,o),c=n.substr(o+1,s-(o+1)).split(","),u=1;switch(l){case"rgba":if(c.length!==4)return c.length===3?Jt(e,+c[0],+c[1],+c[2],1):Jt(e,0,0,0,1);u=Ki(c.pop());case"rgb":if(c.length>=3)return Jt(e,Ou(c[0]),Ou(c[1]),Ou(c[2]),c.length===3?u:Ki(c[3])),qa(t,e),e;Jt(e,0,0,0,1);return;case"hsla":if(c.length!==4){Jt(e,0,0,0,1);return}return c[3]=Ki(c[3]),zv(c,e),qa(t,e),e;case"hsl":if(c.length!==3){Jt(e,0,0,0,1);return}return zv(c,e),qa(t,e),e;default:return}}Jt(e,0,0,0,1)}}function zv(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=Ki(t[1]),a=Ki(t[2]),i=a<=.5?a*(n+1):a+n-a*n,o=a*2-i;return e=e||[],Jt(e,gn(Nu(o,i,r+.3333333333333333)*255),gn(Nu(o,i,r)*255),gn(Nu(o,i,r-.3333333333333333)*255),1),t.length===4&&(e[3]=t[3]),e}function Fv(t,e){var r=Yr(t);if(r){for(var n=0;n<3;n++)r[n]=r[n]*(1-e)|0,r[n]>255?r[n]=255:r[n]<0&&(r[n]=0);return Hs(r,r.length===4?"rgba":"rgb")}}function bS(t,e,r){if(!(!(e&&e.length)||!(t>=0&&t<=1))){var n=t*(e.length-1),a=Math.floor(n),i=Math.ceil(n),o=Yr(e[a]),s=Yr(e[i]),l=n-a,c=Hs([gn(zs(o[0],s[0],l)),gn(zs(o[1],s[1],l)),gn(zs(o[2],s[2],l)),Eu(zs(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:a,rightIndex:i,value:n}:c}}function Hs(t,e){if(!(!t||!t.length)){var r=t[0]+","+t[1]+","+t[2];return(e==="rgba"||e==="hsva"||e==="hsla")&&(r+=","+t[3]),e+"("+r+")"}}function Vs(t,e){var r=Yr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Hv=new Wi(100);function Vv(t){if(ne(t)){var e=Hv.get(t);return e||(e=Fv(t,-.1),Hv.put(t,e)),e}else if(Ss(t)){var r=U({},t);return r.colorStops=ue(t.colorStops,function(n){return{offset:n.offset,color:Fv(n.color,-.1)}}),r}return t}function xS(t){return t.type==="linear"}function wS(t){return t.type==="radial"}(function(){return ge.hasGlobalWindow&&ye(window.btoa)?function(t){return window.btoa(unescape(encodeURIComponent(t)))}:typeof Buffer<"u"?function(t){return Buffer.from(t).toString("base64")}:function(t){return null}})();var zu=Array.prototype.slice;function qr(t,e,r){return(e-t)*r+t}function Fu(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=qr(e[i],r[i],n);return t}function SS(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=qr(e[o][s],r[o][s],n)}return t}function Gs(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=e[i]+r[i]*n;return t}function Gv(t,e,r,n){for(var a=e.length,i=a&&e[0].length,o=0;o<a;o++){t[o]||(t[o]=[]);for(var s=0;s<i;s++)t[o][s]=e[o][s]+r[o][s]*n}return t}function kS(t,e){for(var r=t.length,n=e.length,a=r>n?e:t,i=Math.min(r,n),o=a[i-1]||{color:[0,0,0,0],offset:0},s=i;s<Math.max(r,n);s++)a.push({offset:o.offset,color:o.color.slice()})}function TS(t,e,r){var n=t,a=e;if(!(!n.push||!a.push)){var i=n.length,o=a.length;if(i!==o){var s=i>o;if(s)n.length=o;else for(var l=i;l<o;l++)n.push(r===1?a[l]:zu.call(a[l]))}for(var c=n[0]&&n[0].length,l=0;l<n.length;l++)if(r===1)isNaN(n[l])&&(n[l]=a[l]);else for(var u=0;u<c;u++)isNaN(n[l][u])&&(n[l][u]=a[l][u])}}function $s(t){if(Dt(t)){var e=t.length;if(Dt(t[0])){for(var r=[],n=0;n<e;n++)r.push(zu.call(t[n]));return r}return zu.call(t)}return t}function Ws(t){return t[0]=Math.floor(t[0])||0,t[1]=Math.floor(t[1])||0,t[2]=Math.floor(t[2])||0,t[3]=t[3]==null?1:t[3],"rgba("+t.join(",")+")"}function CS(t){return Dt(t&&t[0])?2:1}var Us=0,Ys=1,$v=2,ji=3,Hu=4,Vu=5,Wv=6;function Uv(t){return t===Hu||t===Vu}function qs(t){return t===Ys||t===$v}var Qi=[0,0,0,0],MS=(function(){function t(e){this.keyframes=[],this.discrete=!1,this._invalid=!1,this._needsSort=!1,this._lastFr=0,this._lastFrP=0,this.propName=e}return t.prototype.isFinished=function(){return this._finished},t.prototype.setFinished=function(){this._finished=!0,this._additiveTrack&&this._additiveTrack.setFinished()},t.prototype.needsAnimate=function(){return this.keyframes.length>=1},t.prototype.getAdditiveTrack=function(){return this._additiveTrack},t.prototype.addKeyframe=function(e,r,n){this._needsSort=!0;var a=this.keyframes,i=a.length,o=!1,s=Wv,l=r;if(Dt(r)){var c=CS(r);s=c,(c===1&&!Ke(r[0])||c===2&&!Ke(r[0][0]))&&(o=!0)}else if(Ke(r)&&!ks(r))s=Us;else if(ne(r))if(!isNaN(+r))s=Us;else{var u=Yr(r);u&&(l=u,s=ji)}else if(Ss(r)){var f=U({},l);f.colorStops=ue(r.colorStops,function(d){return{offset:d.offset,color:Yr(d.color)}}),xS(r)?s=Hu:wS(r)&&(s=Vu),l=f}i===0?this.valType=s:(s!==this.valType||s===Wv)&&(o=!0),this.discrete=this.discrete||o;var h={time:e,value:l,rawValue:r,percent:0};return n&&(h.easing=n,h.easingFunc=ye(n)?n:Zi[n]||Ov(n)),a.push(h),h},t.prototype.prepare=function(e,r){var n=this.keyframes;this._needsSort&&n.sort(function(m,g){return m.time-g.time});for(var a=this.valType,i=n.length,o=n[i-1],s=this.discrete,l=qs(a),c=Uv(a),u=0;u<i;u++){var f=n[u],h=f.value,d=o.value;f.percent=f.time/e,s||(l&&u!==i-1?TS(h,d,a):c&&kS(h.colorStops,d.colorStops))}if(!s&&a!==Vu&&r&&this.needsAnimate()&&r.needsAnimate()&&a===r.valType&&!r._finished){this._additiveTrack=r;for(var p=n[0].value,u=0;u<i;u++)a===Us?n[u].additiveValue=n[u].value-p:a===ji?n[u].additiveValue=Gs([],n[u].value,p,-1):qs(a)&&(n[u].additiveValue=a===Ys?Gs([],n[u].value,p,-1):Gv([],n[u].value,p,-1))}},t.prototype.step=function(e,r){if(!this._finished){this._additiveTrack&&this._additiveTrack._finished&&(this._additiveTrack=null);var n=this._additiveTrack!=null,a=n?"additiveValue":"value",i=this.valType,o=this.keyframes,s=o.length,l=this.propName,c=i===ji,u,f=this._lastFr,h=Math.min,d,p;if(s===1)d=p=o[0];else{if(r<0)u=0;else if(r<this._lastFrP){var m=h(f+1,s-1);for(u=m;u>=0&&!(o[u].percent<=r);u--);u=h(u,s-2)}else{for(u=f;u<s&&!(o[u].percent>r);u++);u=h(u-1,s-2)}p=o[u+1],d=o[u]}if(d&&p){this._lastFr=u,this._lastFrP=r;var g=p.percent-d.percent,v=g===0?1:h((r-d.percent)/g,1);p.easingFunc&&(v=p.easingFunc(v));var y=n?this._additiveValue:c?Qi:e[l];if((qs(i)||c)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=v<1?d.rawValue:p.rawValue;else if(qs(i))i===Ys?Fu(y,d[a],p[a],v):SS(y,d[a],p[a],v);else if(Uv(i)){var b=d[a],x=p[a],S=i===Hu;e[l]={type:S?"linear":"radial",x:qr(b.x,x.x,v),y:qr(b.y,x.y,v),colorStops:ue(b.colorStops,function(k,T){var C=x.colorStops[T];return{offset:qr(k.offset,C.offset,v),color:Ws(Fu([],k.color,C.color,v))}}),global:x.global},S?(e[l].x2=qr(b.x2,x.x2,v),e[l].y2=qr(b.y2,x.y2,v)):e[l].r=qr(b.r,x.r,v)}else if(c)Fu(y,d[a],p[a],v),n||(e[l]=Ws(y));else{var w=qr(d[a],p[a],v);n?this._additiveValue=w:e[l]=w}n&&this._addToTarget(e)}}},t.prototype._addToTarget=function(e){var r=this.valType,n=this.propName,a=this._additiveValue;r===Us?e[n]=e[n]+a:r===ji?(Yr(e[n],Qi),Gs(Qi,Qi,a,1),e[n]=Ws(Qi)):r===Ys?Gs(e[n],e[n],a,1):r===$v&&Gv(e[n],e[n],a,1)},t})(),Gu=(function(){function t(e,r,n,a){if(this._tracks={},this._trackKeys=[],this._maxTime=0,this._started=0,this._clip=null,this._target=e,this._loop=r,r&&a){vu("Can' use additive animation on looped animation.");return}this._additiveAnimators=a,this._allowDiscrete=n}return t.prototype.getMaxTime=function(){return this._maxTime},t.prototype.getDelay=function(){return this._delay},t.prototype.getLoop=function(){return this._loop},t.prototype.getTarget=function(){return this._target},t.prototype.changeTarget=function(e){this._target=e},t.prototype.when=function(e,r,n){return this.whenWithKeys(e,r,Qe(r),n)},t.prototype.whenWithKeys=function(e,r,n,a){for(var i=this._tracks,o=0;o<n.length;o++){var s=n[o],l=i[s];if(!l){l=i[s]=new MS(s);var c=void 0,u=this._getAdditiveTrack(s);if(u){var f=u.keyframes,h=f[f.length-1];c=h&&h.value,u.valType===ji&&c&&(c=Ws(c))}else c=this._target[s];if(c==null)continue;e>0&&l.addKeyframe(0,$s(c),a),this._trackKeys.push(s)}l.addKeyframe(e,$s(r[s]),a)}return this._maxTime=Math.max(this._maxTime,e),this},t.prototype.pause=function(){this._clip.pause(),this._paused=!0},t.prototype.resume=function(){this._clip.resume(),this._paused=!1},t.prototype.isPaused=function(){return!!this._paused},t.prototype.duration=function(e){return this._maxTime=e,this._force=!0,this},t.prototype._doneCallback=function(){this._setTracksFinished(),this._clip=null;var e=this._doneCbs;if(e)for(var r=e.length,n=0;n<r;n++)e[n].call(this)},t.prototype._abortedCallback=function(){this._setTracksFinished();var e=this.animation,r=this._abortedCbs;if(e&&e.removeClip(this._clip),this._clip=null,r)for(var n=0;n<r.length;n++)r[n].call(this)},t.prototype._setTracksFinished=function(){for(var e=this._tracks,r=this._trackKeys,n=0;n<r.length;n++)e[r[n]].setFinished()},t.prototype._getAdditiveTrack=function(e){var r,n=this._additiveAnimators;if(n)for(var a=0;a<n.length;a++){var i=n[a].getTrack(e);i&&(r=i)}return r},t.prototype.start=function(e){if(!(this._started>0)){this._started=1;for(var r=this,n=[],a=this._maxTime||0,i=0;i<this._trackKeys.length;i++){var o=this._trackKeys[i],s=this._tracks[o],l=this._getAdditiveTrack(o),c=s.keyframes,u=c.length;if(s.prepare(a,l),s.needsAnimate())if(!this._allowDiscrete&&s.discrete){var f=c[u-1];f&&(r._target[s.propName]=f.rawValue),s.setFinished()}else n.push(s)}if(n.length||this._force){var h=new _S({life:a,loop:this._loop,delay:this._delay||0,onframe:function(d){r._started=2;var p=r._additiveAnimators;if(p){for(var m=!1,g=0;g<p.length;g++)if(p[g]._clip){m=!0;break}m||(r._additiveAnimators=null)}for(var g=0;g<n.length;g++)n[g].step(r._target,d);var v=r._onframeCbs;if(v)for(var g=0;g<v.length;g++)v[g](r._target,d)},ondestroy:function(){r._doneCallback()}});this._clip=h,this.animation&&this.animation.addClip(h),e&&h.setEasing(e)}else this._doneCallback();return this}},t.prototype.stop=function(e){if(this._clip){var r=this._clip;e&&r.onframe(1),this._abortedCallback()}},t.prototype.delay=function(e){return this._delay=e,this},t.prototype.during=function(e){return e&&(this._onframeCbs||(this._onframeCbs=[]),this._onframeCbs.push(e)),this},t.prototype.done=function(e){return e&&(this._doneCbs||(this._doneCbs=[]),this._doneCbs.push(e)),this},t.prototype.aborted=function(e){return e&&(this._abortedCbs||(this._abortedCbs=[]),this._abortedCbs.push(e)),this},t.prototype.getClip=function(){return this._clip},t.prototype.getTrack=function(e){return this._tracks[e]},t.prototype.getTracks=function(){var e=this;return ue(this._trackKeys,function(r){return e._tracks[r]})},t.prototype.stopTracks=function(e,r){if(!e.length||!this._clip)return!0;for(var n=this._tracks,a=this._trackKeys,i=0;i<e.length;i++){var o=n[e[i]];o&&!o.isFinished()&&(r?o.step(this._target,1):this._started===1&&o.step(this._target,0),o.setFinished())}for(var s=!0,i=0;i<a.length;i++)if(!n[a[i]].isFinished()){s=!1;break}return s&&this._abortedCallback(),s},t.prototype.saveTo=function(e,r,n){if(e){r=r||this._trackKeys;for(var a=0;a<r.length;a++){var i=r[a],o=this._tracks[i];if(!(!o||o.isFinished())){var s=o.keyframes,l=s[n?0:s.length-1];l&&(e[i]=$s(l.rawValue))}}}},t.prototype.__changeFinalValue=function(e,r){r=r||Qe(e);for(var n=0;n<r.length;n++){var a=r[n],i=this._tracks[a];if(i){var o=i.keyframes;if(o.length>1){var s=o.pop();i.addKeyframe(s.time,e[a]),i.prepare(this._maxTime,i.getAdditiveTrack())}}}},t})(),ur=(function(){function t(e){e&&(this._$eventProcessor=e)}return t.prototype.on=function(e,r,n,a){this._$handlers||(this._$handlers={});var i=this._$handlers;if(typeof r=="function"&&(a=n,n=r,r=null),!n||!e)return this;var o=this._$eventProcessor;r!=null&&o&&o.normalizeQuery&&(r=o.normalizeQuery(r)),i[e]||(i[e]=[]);for(var s=0;s<i[e].length;s++)if(i[e][s].h===n)return this;var l={h:n,query:r,ctx:a||this,callAtLast:n.zrEventfulCallAtLast},c=i[e].length-1,u=i[e][c];return u&&u.callAtLast?i[e].splice(c,0,l):i[e].push(l),this},t.prototype.isSilent=function(e){var r=this._$handlers;return!r||!r[e]||!r[e].length},t.prototype.off=function(e,r){var n=this._$handlers;if(!n)return this;if(!e)return this._$handlers={},this;if(r){if(n[e]){for(var a=[],i=0,o=n[e].length;i<o;i++)n[e][i].h!==r&&a.push(n[e][i]);n[e]=a}n[e]&&n[e].length===0&&delete n[e]}else delete n[e];return this},t.prototype.trigger=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=a.length,l=0;l<s;l++){var c=a[l];if(!(i&&i.filter&&c.query!=null&&!i.filter(e,c.query)))switch(o){case 0:c.h.call(c.ctx);break;case 1:c.h.call(c.ctx,r[0]);break;case 2:c.h.call(c.ctx,r[0],r[1]);break;default:c.h.apply(c.ctx,r);break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t.prototype.triggerWithContext=function(e){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];if(!this._$handlers)return this;var a=this._$handlers[e],i=this._$eventProcessor;if(a)for(var o=r.length,s=r[o-1],l=a.length,c=0;c<l;c++){var u=a[c];if(!(i&&i.filter&&u.query!=null&&!i.filter(e,u.query)))switch(o){case 0:u.h.call(s);break;case 1:u.h.call(s,r[0]);break;case 2:u.h.call(s,r[0],r[1]);break;default:u.h.apply(s,r.slice(1,o-1));break}}return i&&i.afterTrigger&&i.afterTrigger(e),this},t})(),Yv=1;ge.hasGlobalWindow&&(Yv=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Xs=Yv,$u=.4,Wu="#333",Uu="#ccc",AS="#eee",Wt=1,Ji=2,Xa=4,Yu="__zr_normal__",qu=Xi.concat(["ignore"]),DS=Ba(Xi,function(t,e){return t[e]=!0,t},{ignore:!1}),Za={},IS=new Fe(0,0,0,0),Zs=(function(){function t(e){this.id=lv(),this.animators=[],this.currentStates=[],this.states={},this._init(e)}return t.prototype._init=function(e){this.attr(e)},t.prototype.drift=function(e,r,n){switch(this.draggable){case"horizontal":r=0;break;case"vertical":e=0;break}var a=this.transform;a||(a=this.transform=[1,0,0,1,0,0]),a[4]+=e,a[5]+=r,this.decomposeTransform(),this.markRedraw()},t.prototype.beforeUpdate=function(){},t.prototype.afterUpdate=function(){},t.prototype.update=function(){this.updateTransform(),this.__dirty&&this.updateInnerText()},t.prototype.updateInnerText=function(e){var r=this._textContent;if(r&&(!r.ignore||e)){this.textConfig||(this.textConfig={});var n=this.textConfig,a=n.local,i=r.innerTransformable,o=void 0,s=void 0,l=!1;i.parent=a?this:null;var c=!1;if(i.copyTransform(r),n.position!=null){var u=IS;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Za,n,u):Ls(Za,n,u),i.x=Za.x,i.y=Za.y,o=Za.align,s=Za.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var h=void 0,d=void 0;f==="center"?(h=u.width*.5,d=u.height*.5):(h=dn(f[0],u.width),d=dn(f[1],u.height)),c=!0,i.originX=-i.x+h+(a?0:u.x),i.originY=-i.y+d+(a?0:u.y)}}n.rotation!=null&&(i.rotation=n.rotation);var p=n.offset;p&&(i.x+=p[0],i.y+=p[1],c||(i.originX=-p[0],i.originY=-p[1]));var m=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),v=void 0,y=void 0,b=void 0;m&&this.canBeInsideText()?(v=n.insideFill,y=n.insideStroke,(v==null||v==="auto")&&(v=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(v),b=!0)):(v=n.outsideFill,y=n.outsideStroke,(v==null||v==="auto")&&(v=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(v),b=!0)),v=v||"#000",(v!==g.fill||y!==g.stroke||b!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=v,g.stroke=y,g.autoStroke=b,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),r.__dirty|=Wt,l&&r.dirtyStyle(!0)}},t.prototype.canBeInsideText=function(){return!0},t.prototype.getInsideTextFill=function(){return"#fff"},t.prototype.getInsideTextStroke=function(e){return"#000"},t.prototype.getOutsideFill=function(){return this.__zr&&this.__zr.isDarkMode()?Uu:Wu},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&Yr(r);n||(n=[255,255,255,1]);for(var a=n[3],i=this.__zr.isDarkMode(),o=0;o<3;o++)n[o]=n[o]*a+(i?0:255)*(1-a);return n[3]=1,Hs(n,"rgba")},t.prototype.traverse=function(e,r){},t.prototype.attrKV=function(e,r){e==="textConfig"?this.setTextConfig(r):e==="textContent"?this.setTextContent(r):e==="clipPath"?this.setClipPath(r):e==="extra"?(this.extra=this.extra||{},U(this.extra,r)):this[e]=r},t.prototype.hide=function(){this.ignore=!0,this.markRedraw()},t.prototype.show=function(){this.ignore=!1,this.markRedraw()},t.prototype.attr=function(e,r){if(typeof e=="string")this.attrKV(e,r);else if(ce(e))for(var n=e,a=Qe(n),i=0;i<a.length;i++){var o=a[i];this.attrKV(o,e[o])}return this.markRedraw(),this},t.prototype.saveCurrentToNormalState=function(e){this._innerSaveToNormal(e);for(var r=this._normalState,n=0;n<this.animators.length;n++){var a=this.animators[n],i=a.__fromStateTransition;if(!(a.getLoop()||i&&i!==Yu)){var o=a.targetName,s=o?r[o]:r;a.saveTo(s)}}},t.prototype._innerSaveToNormal=function(e){var r=this._normalState;r||(r=this._normalState={}),e.textConfig&&!r.textConfig&&(r.textConfig=this.textConfig),this._savePrimaryToNormal(e,r,qu)},t.prototype._savePrimaryToNormal=function(e,r,n){for(var a=0;a<n.length;a++){var i=n[a];e[i]!=null&&!(i in r)&&(r[i]=this[i])}},t.prototype.hasState=function(){return this.currentStates.length>0},t.prototype.getState=function(e){return this.states[e]},t.prototype.ensureState=function(e){var r=this.states;return r[e]||(r[e]={}),r[e]},t.prototype.clearStates=function(e){this.useState(Yu,!1,e)},t.prototype.useState=function(e,r,n,a){var i=e===Yu,o=this.hasState();if(!(!o&&i)){var s=this.currentStates,l=this.stateTransition;if(!(ze(s,e)>=0&&(r||s.length===1))){var c;if(this.stateProxy&&!i&&(c=this.stateProxy(e)),c||(c=this.states&&this.states[e]),!c&&!i){vu("State "+e+" not exists.");return}i||this.saveCurrentToNormalState(c);var u=!!(c&&c.hoverLayer||a);u&&this._toggleHoverLayerFlag(!0),this._applyStateObj(e,c,this._normalState,r,!n&&!this.__inHover&&l&&l.duration>0,l);var f=this._textContent,h=this._textGuide;return f&&f.useState(e,r,n,u),h&&h.useState(e,r,n,u),i?(this.currentStates=[],this._normalState={}):r?this.currentStates.push(e):this.currentStates=[e],this._updateAnimationTargets(),this.markRedraw(),!u&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Wt),c}}},t.prototype.useStates=function(e,r,n){if(!e.length)this.clearStates();else{var a=[],i=this.currentStates,o=e.length,s=o===i.length;if(s){for(var l=0;l<o;l++)if(e[l]!==i[l]){s=!1;break}}if(s)return;for(var l=0;l<o;l++){var c=e[l],u=void 0;this.stateProxy&&(u=this.stateProxy(c,e)),u||(u=this.states[c]),u&&a.push(u)}var f=a[o-1],h=!!(f&&f.hoverLayer||n);h&&this._toggleHoverLayerFlag(!0);var d=this._mergeStates(a),p=this.stateTransition;this.saveCurrentToNormalState(d),this._applyStateObj(e.join(","),d,this._normalState,!1,!r&&!this.__inHover&&p&&p.duration>0,p);var m=this._textContent,g=this._textGuide;m&&m.useStates(e,r,h),g&&g.useStates(e,r,h),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!h&&this.__inHover&&(this._toggleHoverLayerFlag(!1),this.__dirty&=~Wt)}},t.prototype.isSilent=function(){for(var e=this.silent,r=this.parent;!e&&r;){if(r.silent){e=!0;break}r=r.parent}return e},t.prototype._updateAnimationTargets=function(){for(var e=0;e<this.animators.length;e++){var r=this.animators[e];r.targetName&&r.changeTarget(this[r.targetName])}},t.prototype.removeState=function(e){var r=ze(this.currentStates,e);if(r>=0){var n=this.currentStates.slice();n.splice(r,1),this.useStates(n)}},t.prototype.replaceState=function(e,r,n){var a=this.currentStates.slice(),i=ze(a,e),o=ze(a,r)>=0;i>=0?o?a.splice(i,1):a[i]=r:n&&!o&&a.push(r),this.useStates(a)},t.prototype.toggleState=function(e,r){r?this.useState(e,!0):this.removeState(e)},t.prototype._mergeStates=function(e){for(var r={},n,a=0;a<e.length;a++){var i=e[a];U(r,i),i.textConfig&&(n=n||{},U(n,i.textConfig))}return n&&(r.textConfig=n),r},t.prototype._applyStateObj=function(e,r,n,a,i,o){var s=!(r&&a);r&&r.textConfig?(this.textConfig=U({},a?this.textConfig:n.textConfig),U(this.textConfig,r.textConfig)):s&&n.textConfig&&(this.textConfig=n.textConfig);for(var l={},c=!1,u=0;u<qu.length;u++){var f=qu[u],h=i&&DS[f];r&&r[f]!=null?h?(c=!0,l[f]=r[f]):this[f]=r[f]:s&&n[f]!=null&&(h?(c=!0,l[f]=n[f]):this[f]=n[f])}if(!i)for(var u=0;u<this.animators.length;u++){var d=this.animators[u],p=d.targetName;d.getLoop()||d.__changeFinalValue(p?(r||n)[p]:r||n)}c&&this._transitionState(e,l,o)},t.prototype._attachComponent=function(e){if(!(e.__zr&&!e.__hostTarget)&&e!==this){var r=this.__zr;r&&e.addSelfToZr(r),e.__zr=r,e.__hostTarget=this}},t.prototype._detachComponent=function(e){e.__zr&&e.removeSelfFromZr(e.__zr),e.__zr=null,e.__hostTarget=null},t.prototype.getClipPath=function(){return this._clipPath},t.prototype.setClipPath=function(e){this._clipPath&&this._clipPath!==e&&this.removeClipPath(),this._attachComponent(e),this._clipPath=e,this.markRedraw()},t.prototype.removeClipPath=function(){var e=this._clipPath;e&&(this._detachComponent(e),this._clipPath=null,this.markRedraw())},t.prototype.getTextContent=function(){return this._textContent},t.prototype.setTextContent=function(e){var r=this._textContent;r!==e&&(r&&r!==e&&this.removeTextContent(),e.innerTransformable=new Ru,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),U(this.textConfig,e),this.markRedraw()},t.prototype.removeTextConfig=function(){this.textConfig=null,this.markRedraw()},t.prototype.removeTextContent=function(){var e=this._textContent;e&&(e.innerTransformable=null,this._detachComponent(e),this._textContent=null,this._innerTextDefaultStyle=null,this.markRedraw())},t.prototype.getTextGuideLine=function(){return this._textGuide},t.prototype.setTextGuideLine=function(e){this._textGuide&&this._textGuide!==e&&this.removeTextGuideLine(),this._attachComponent(e),this._textGuide=e,this.markRedraw()},t.prototype.removeTextGuideLine=function(){var e=this._textGuide;e&&(this._detachComponent(e),this._textGuide=null,this.markRedraw())},t.prototype.markRedraw=function(){this.__dirty|=Wt;var e=this.__zr;e&&(this.__inHover?e.refreshHover():e.refresh()),this.__hostTarget&&this.__hostTarget.markRedraw()},t.prototype.dirty=function(){this.markRedraw()},t.prototype._toggleHoverLayerFlag=function(e){this.__inHover=e;var r=this._textContent,n=this._textGuide;r&&(r.__inHover=e),n&&(n.__inHover=e)},t.prototype.addSelfToZr=function(e){if(this.__zr!==e){this.__zr=e;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.addAnimator(r[n]);this._clipPath&&this._clipPath.addSelfToZr(e),this._textContent&&this._textContent.addSelfToZr(e),this._textGuide&&this._textGuide.addSelfToZr(e)}},t.prototype.removeSelfFromZr=function(e){if(this.__zr){this.__zr=null;var r=this.animators;if(r)for(var n=0;n<r.length;n++)e.animation.removeAnimator(r[n]);this._clipPath&&this._clipPath.removeSelfFromZr(e),this._textContent&&this._textContent.removeSelfFromZr(e),this._textGuide&&this._textGuide.removeSelfFromZr(e)}},t.prototype.animate=function(e,r,n){var a=e?this[e]:this,i=new Gu(a,r,n);return e&&(i.targetName=e),this.addAnimator(i,e),i},t.prototype.addAnimator=function(e,r){var n=this.__zr,a=this;e.during(function(){a.updateDuringAnimation(r)}).done(function(){var i=a.animators,o=ze(i,e);o>=0&&i.splice(o,1)}),this.animators.push(e),n&&n.animation.addAnimator(e),n&&n.wakeUp()},t.prototype.updateDuringAnimation=function(e){this.markRedraw()},t.prototype.stopAnimation=function(e,r){for(var n=this.animators,a=n.length,i=[],o=0;o<a;o++){var s=n[o];!e||e===s.scope?s.stop(r):i.push(s)}return this.animators=i,this},t.prototype.animateTo=function(e,r,n){Xu(this,e,r,n)},t.prototype.animateFrom=function(e,r,n){Xu(this,e,r,n,!0)},t.prototype._transitionState=function(e,r,n,a){for(var i=Xu(this,r,n,a),o=0;o<i.length;o++)i[o].__fromStateTransition=e},t.prototype.getBoundingRect=function(){return null},t.prototype.getPaintRect=function(){return null},t.initDefaultProps=(function(){var e=t.prototype;e.type="element",e.name="",e.ignore=e.silent=e.isGroup=e.draggable=e.dragging=e.ignoreClip=e.__inHover=!1,e.__dirty=Wt;function r(n,a,i,o){Object.defineProperty(e,n,{get:function(){if(!this[a]){var l=this[a]=[];s(this,l)}return this[a]},set:function(l){this[i]=l[0],this[o]=l[1],this[a]=l,s(this,l)}});function s(l,c){Object.defineProperty(c,0,{get:function(){return l[i]},set:function(u){l[i]=u}}),Object.defineProperty(c,1,{get:function(){return l[o]},set:function(u){l[o]=u}})}}Object.defineProperty&&(r("position","_legacyPos","x","y"),r("scale","_legacyScale","scaleX","scaleY"),r("origin","_legacyOrigin","originX","originY"))})(),t})();Cr(Zs,ur),Cr(Zs,Ru);function Xu(t,e,r,n,a){r=r||{};var i=[];qv(t,"",t,e,r,n,i,a);var o=i.length,s=!1,l=r.done,c=r.aborted,u=function(){s=!0,o--,o<=0&&(s?l&&l():c&&c())},f=function(){o--,o<=0&&(s?l&&l():c&&c())};o||l&&l(),i.length>0&&r.during&&i[0].during(function(p,m){r.during(m)});for(var h=0;h<i.length;h++){var d=i[h];u&&d.done(u),f&&d.aborted(f),r.force&&d.duration(r.duration),d.start(r.easing)}return i}function Zu(t,e,r){for(var n=0;n<r;n++)t[n]=e[n]}function LS(t){return Dt(t[0])}function PS(t,e,r){if(Dt(e[r]))if(Dt(t[r])||(t[r]=[]),It(e[r])){var n=e[r].length;t[r].length!==n&&(t[r]=new e[r].constructor(n),Zu(t[r],e[r],n))}else{var a=e[r],i=t[r],o=a.length;if(LS(a))for(var s=a[0].length,l=0;l<o;l++)i[l]?Zu(i[l],a[l],s):i[l]=Array.prototype.slice.call(a[l]);else Zu(i,a,o);i.length=a.length}else t[r]=e[r]}function RS(t,e){return t===e||Dt(t)&&Dt(e)&&ES(t,e)}function ES(t,e){var r=t.length;if(r!==e.length)return!1;for(var n=0;n<r;n++)if(t[n]!==e[n])return!1;return!0}function qv(t,e,r,n,a,i,o,s){for(var l=Qe(n),c=a.duration,u=a.delay,f=a.additive,h=a.setToFinal,d=!ce(i),p=t.animators,m=[],g=0;g<l.length;g++){var v=l[g],y=n[v];if(y!=null&&r[v]!=null&&(d||i[v]))if(ce(y)&&!Dt(y)&&!Ss(y)){if(e){s||(r[v]=y,t.updateDuringAnimation(e));continue}qv(t,v,r[v],y,a,i&&i[v],o,s)}else m.push(v);else s||(r[v]=y,t.updateDuringAnimation(e),m.push(v))}var b=m.length;if(!f&&b)for(var x=0;x<p.length;x++){var S=p[x];if(S.targetName===e){var w=S.stopTracks(m);if(w){var k=ze(p,S);p.splice(k,1)}}}if(a.force||(m=dt(m,function(M){return!RS(n[M],r[M])}),b=m.length),b>0||a.force&&!o.length){var T=void 0,C=void 0,A=void 0;if(s){C={},h&&(T={});for(var x=0;x<b;x++){var v=m[x];C[v]=r[v],h?T[v]=n[v]:r[v]=n[v]}}else if(h){A={};for(var x=0;x<b;x++){var v=m[x];A[v]=$s(r[v]),PS(r,n,v)}}var S=new Gu(r,!1,!1,f?dt(p,function(I){return I.targetName===e}):null);S.targetName=e,a.scope&&(S.scope=a.scope),h&&T&&S.whenWithKeys(0,T,m),A&&S.whenWithKeys(0,A,m),S.whenWithKeys(c??500,s?C:n,m).delay(u||0),t.addAnimator(S,e),o.push(S)}}var Ku="__zr_style_"+Math.round(Math.random()*10),Zn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Ks={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};Zn[Ku]=!0;var Xv=["z","z2","invisible"],OS=["invisible"],eo=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype._init=function(r){for(var n=Qe(r),a=0;a<n.length;a++){var i=n[a];i==="style"?this.useStyle(r[i]):t.prototype.attrKV.call(this,i,r[i])}this.style||this.useStyle({})},e.prototype.beforeBrush=function(){},e.prototype.afterBrush=function(){},e.prototype.innerBeforeBrush=function(){},e.prototype.innerAfterBrush=function(){},e.prototype.shouldBePainted=function(r,n,a,i){var o=this.transform;if(this.ignore||this.invisible||this.style.opacity===0||this.culling&&NS(this,r,n)||o&&!o[0]&&!o[3])return!1;if(a&&this.__clipPaths){for(var s=0;s<this.__clipPaths.length;++s)if(this.__clipPaths[s].isZeroArea())return!1}if(i&&this.parent)for(var l=this.parent;l;){if(l.ignore)return!1;l=l.parent}return!0},e.prototype.contain=function(r,n){return this.rectContain(r,n)},e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.rectContain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();return i.contain(a[0],a[1])},e.prototype.getPaintRect=function(){var r=this._paintRect;if(!this._paintRect||this.__dirty){var n=this.transform,a=this.getBoundingRect(),i=this.style,o=i.shadowBlur||0,s=i.shadowOffsetX||0,l=i.shadowOffsetY||0;r=this._paintRect||(this._paintRect=new Fe(0,0,0,0)),n?Fe.applyTransform(r,a,n):r.copy(a),(o||s||l)&&(r.width+=o*2+Math.abs(s),r.height+=o*2+Math.abs(l),r.x=Math.min(r.x,r.x+s-o),r.y=Math.min(r.y,r.y+l-o));var c=this.dirtyRectTolerance;r.isZero()||(r.x=Math.floor(r.x-c),r.y=Math.floor(r.y-c),r.width=Math.ceil(r.width+1+c*2),r.height=Math.ceil(r.height+1+c*2))}return r},e.prototype.setPrevPaintRect=function(r){r?(this._prevPaintRect=this._prevPaintRect||new Fe(0,0,0,0),this._prevPaintRect.copy(r)):this._prevPaintRect=null},e.prototype.getPrevPaintRect=function(){return this._prevPaintRect},e.prototype.animateStyle=function(r){return this.animate("style",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():this.markRedraw()},e.prototype.attrKV=function(r,n){r!=="style"?t.prototype.attrKV.call(this,r,n):this.style?this.setStyle(n):this.useStyle(n)},e.prototype.setStyle=function(r,n){return typeof r=="string"?this.style[r]=n:U(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=Ji,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&Ji)},e.prototype.styleUpdated=function(){this.__dirty&=~Ji},e.prototype.createStyle=function(r){return Cs(Zn,r)},e.prototype.useStyle=function(r){r[Ku]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Ku]},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.style&&!n.style&&(n.style=this._mergeStyle(this.createStyle(),this.style)),this._savePrimaryToNormal(r,n,Xv)},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.style?o?i?c=n.style:(c=this._mergeStyle(this.createStyle(),a.style),this._mergeStyle(c,n.style)):(c=this._mergeStyle(this.createStyle(),i?this.style:a.style),this._mergeStyle(c,n.style)):l&&(c=a.style),c)if(o){var u=this.style;if(this.style=this.createStyle(l?{}:u),l)for(var f=Qe(u),h=0;h<f.length;h++){var d=f[h];d in c&&(c[d]=c[d],this.style[d]=u[d])}for(var p=Qe(c),h=0;h<p.length;h++){var d=p[h];this.style[d]=this.style[d]}this._transitionState(r,{style:c},s,this.getAnimationStyleProps())}else this.useStyle(c);for(var m=this.__inHover?OS:Xv,h=0;h<m.length;h++){var d=m[h];n&&n[d]!=null?this[d]=n[d]:l&&a[d]!=null&&(this[d]=a[d])}},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.style&&(a=a||{},this._mergeStyle(a,o.style))}return a&&(n.style=a),n},e.prototype._mergeStyle=function(r,n){return U(r,n),r},e.prototype.getAnimationStyleProps=function(){return Ks},e.initDefaultProps=(function(){var r=e.prototype;r.type="displayable",r.invisible=!1,r.z=0,r.z2=0,r.zlevel=0,r.culling=!1,r.cursor="pointer",r.rectHover=!1,r.incremental=!1,r._rect=null,r.dirtyRectTolerance=0,r.__dirty=Wt|Ji})(),e})(Zs),ju=new Fe(0,0,0,0),Qu=new Fe(0,0,0,0);function NS(t,e,r){return ju.copy(t.getBoundingRect()),t.transform&&ju.applyTransform(t.transform),Qu.width=e,Qu.height=r,!ju.intersect(Qu)}var er=Math.min,tr=Math.max,Ju=Math.sin,ef=Math.cos,Kn=Math.PI*2,js=Va(),Qs=Va(),Js=Va();function Zv(t,e,r,n,a,i){a[0]=er(t,r),a[1]=er(e,n),i[0]=tr(t,r),i[1]=tr(e,n)}var Kv=[],jv=[];function BS(t,e,r,n,a,i,o,s,l,c){var u=Pv,f=gt,h=u(t,r,a,o,Kv);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var d=0;d<h;d++){var p=f(t,r,a,o,Kv[d]);l[0]=er(p,l[0]),c[0]=tr(p,c[0])}h=u(e,n,i,s,jv);for(var d=0;d<h;d++){var m=f(e,n,i,s,jv[d]);l[1]=er(m,l[1]),c[1]=tr(m,c[1])}l[0]=er(t,l[0]),c[0]=tr(t,c[0]),l[0]=er(o,l[0]),c[0]=tr(o,c[0]),l[1]=er(e,l[1]),c[1]=tr(e,c[1]),l[1]=er(s,l[1]),c[1]=tr(s,c[1])}function zS(t,e,r,n,a,i,o,s){var l=Ev,c=Lt,u=tr(er(l(t,r,a),1),0),f=tr(er(l(e,n,i),1),0),h=c(t,r,a,u),d=c(e,n,i,f);o[0]=er(t,a,h),o[1]=er(e,i,d),s[0]=tr(t,a,h),s[1]=tr(e,i,d)}function FS(t,e,r,n,a,i,o,s,l){var c=$a,u=Wa,f=Math.abs(a-i);if(f%Kn<1e-4&&f>1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(js[0]=ef(a)*r+t,js[1]=Ju(a)*n+e,Qs[0]=ef(i)*r+t,Qs[1]=Ju(i)*n+e,c(s,js,Qs),u(l,js,Qs),a=a%Kn,a<0&&(a=a+Kn),i=i%Kn,i<0&&(i=i+Kn),a>i&&!o?i+=Kn:a<i&&o&&(a+=Kn),o){var h=i;i=a,a=h}for(var d=0;d<i;d+=Math.PI/2)d>a&&(Js[0]=ef(d)*r+t,Js[1]=Ju(d)*n+e,c(s,Js,s),u(l,Js,l))}var He={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},jn=[],Qn=[],Ir=[],mn=[],Lr=[],Pr=[],tf=Math.min,rf=Math.max,Jn=Math.cos,ea=Math.sin,Xr=Math.abs,nf=Math.PI,yn=nf*2,af=typeof Float32Array<"u",to=[];function of(t){var e=Math.round(t/nf*1e8)/1e8;return e%2*nf}function HS(t,e){var r=of(t[0]);r<0&&(r+=yn);var n=r-t[0],a=t[1];a+=n,!e&&a-r>=yn?a=r+yn:e&&r-a>=yn?a=r-yn:!e&&r>a?a=r+(yn-of(r-a)):e&&r<a&&(a=r-(yn-of(a-r))),t[0]=r,t[1]=a}var ta=(function(){function t(e){this.dpr=1,this._xi=0,this._yi=0,this._x0=0,this._y0=0,this._len=0,e&&(this._saveData=!1),this._saveData&&(this.data=[])}return t.prototype.increaseVersion=function(){this._version++},t.prototype.getVersion=function(){return this._version},t.prototype.setScale=function(e,r,n){n=n||0,n>0&&(this._ux=Xr(n/Xs/e)||0,this._uy=Xr(n/Xs/r)||0)},t.prototype.setDPR=function(e){this.dpr=e},t.prototype.setContext=function(e){this._ctx=e},t.prototype.getContext=function(){return this._ctx},t.prototype.beginPath=function(){return this._ctx&&this._ctx.beginPath(),this.reset(),this},t.prototype.reset=function(){this._saveData&&(this._len=0),this._pathSegLen&&(this._pathSegLen=null,this._pathLen=0),this._version++},t.prototype.moveTo=function(e,r){return this._drawPendingPt(),this.addData(He.M,e,r),this._ctx&&this._ctx.moveTo(e,r),this._x0=e,this._y0=r,this._xi=e,this._yi=r,this},t.prototype.lineTo=function(e,r){var n=Xr(e-this._xi),a=Xr(r-this._yi),i=n>this._ux||a>this._uy;if(this.addData(He.L,e,r),this._ctx&&i&&this._ctx.lineTo(e,r),i)this._xi=e,this._yi=r,this._pendingPtDist=0;else{var o=n*n+a*a;o>this._pendingPtDist&&(this._pendingPtX=e,this._pendingPtY=r,this._pendingPtDist=o)}return this},t.prototype.bezierCurveTo=function(e,r,n,a,i,o){return this._drawPendingPt(),this.addData(He.C,e,r,n,a,i,o),this._ctx&&this._ctx.bezierCurveTo(e,r,n,a,i,o),this._xi=i,this._yi=o,this},t.prototype.quadraticCurveTo=function(e,r,n,a){return this._drawPendingPt(),this.addData(He.Q,e,r,n,a),this._ctx&&this._ctx.quadraticCurveTo(e,r,n,a),this._xi=n,this._yi=a,this},t.prototype.arc=function(e,r,n,a,i,o){this._drawPendingPt(),to[0]=a,to[1]=i,HS(to,o),a=to[0],i=to[1];var s=i-a;return this.addData(He.A,e,r,n,n,a,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,a,i,o),this._xi=Jn(i)*n+e,this._yi=ea(i)*n+r,this},t.prototype.arcTo=function(e,r,n,a,i){return this._drawPendingPt(),this._ctx&&this._ctx.arcTo(e,r,n,a,i),this},t.prototype.rect=function(e,r,n,a){return this._drawPendingPt(),this._ctx&&this._ctx.rect(e,r,n,a),this.addData(He.R,e,r,n,a),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(He.Z);var e=this._ctx,r=this._x0,n=this._y0;return e&&e.closePath(),this._xi=r,this._yi=n,this},t.prototype.fill=function(e){e&&e.fill(),this.toStatic()},t.prototype.stroke=function(e){e&&e.stroke(),this.toStatic()},t.prototype.len=function(){return this._len},t.prototype.setData=function(e){var r=e.length;!(this.data&&this.data.length===r)&&af&&(this.data=new Float32Array(r));for(var n=0;n<r;n++)this.data[n]=e[n];this._len=r},t.prototype.appendPath=function(e){e instanceof Array||(e=[e]);for(var r=e.length,n=0,a=this._len,i=0;i<r;i++)n+=e[i].len();af&&this.data instanceof Float32Array&&(this.data=new Float32Array(a+n));for(var i=0;i<r;i++)for(var o=e[i].data,s=0;s<o.length;s++)this.data[a++]=o[s];this._len=a},t.prototype.addData=function(e,r,n,a,i,o,s,l,c){if(this._saveData){var u=this.data;this._len+arguments.length>u.length&&(this._expandData(),u=this.data);for(var f=0;f<arguments.length;f++)u[this._len++]=arguments[f]}},t.prototype._drawPendingPt=function(){this._pendingPtDist>0&&(this._ctx&&this._ctx.lineTo(this._pendingPtX,this._pendingPtY),this._pendingPtDist=0)},t.prototype._expandData=function(){if(!(this.data instanceof Array)){for(var e=[],r=0;r<this._len;r++)e[r]=this.data[r];this.data=e}},t.prototype.toStatic=function(){if(this._saveData){this._drawPendingPt();var e=this.data;e instanceof Array&&(e.length=this._len,af&&this._len>11&&(this.data=new Float32Array(e)))}},t.prototype.getBoundingRect=function(){Ir[0]=Ir[1]=Lr[0]=Lr[1]=Number.MAX_VALUE,mn[0]=mn[1]=Pr[0]=Pr[1]=-Number.MAX_VALUE;var e=this.data,r=0,n=0,a=0,i=0,o;for(o=0;o<this._len;){var s=e[o++],l=o===1;switch(l&&(r=e[o],n=e[o+1],a=r,i=n),s){case He.M:r=a=e[o++],n=i=e[o++],Lr[0]=a,Lr[1]=i,Pr[0]=a,Pr[1]=i;break;case He.L:Zv(r,n,e[o],e[o+1],Lr,Pr),r=e[o++],n=e[o++];break;case He.C:BS(r,n,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Lr,Pr),r=e[o++],n=e[o++];break;case He.Q:zS(r,n,e[o++],e[o++],e[o],e[o+1],Lr,Pr),r=e[o++],n=e[o++];break;case He.A:var c=e[o++],u=e[o++],f=e[o++],h=e[o++],d=e[o++],p=e[o++]+d;o+=1;var m=!e[o++];l&&(a=Jn(d)*f+c,i=ea(d)*h+u),FS(c,u,f,h,d,p,m,Lr,Pr),r=Jn(p)*f+c,n=ea(p)*h+u;break;case He.R:a=r=e[o++],i=n=e[o++];var g=e[o++],v=e[o++];Zv(a,i,a+g,i+v,Lr,Pr);break;case He.Z:r=a,n=i;break}$a(Ir,Ir,Lr),Wa(mn,mn,Pr)}return o===0&&(Ir[0]=Ir[1]=mn[0]=mn[1]=0),new Fe(Ir[0],Ir[1],mn[0]-Ir[0],mn[1]-Ir[1])},t.prototype._calculateLength=function(){var e=this.data,r=this._len,n=this._ux,a=this._uy,i=0,o=0,s=0,l=0;this._pathSegLen||(this._pathSegLen=[]);for(var c=this._pathSegLen,u=0,f=0,h=0;h<r;){var d=e[h++],p=h===1;p&&(i=e[h],o=e[h+1],s=i,l=o);var m=-1;switch(d){case He.M:i=s=e[h++],o=l=e[h++];break;case He.L:{var g=e[h++],v=e[h++],y=g-i,b=v-o;(Xr(y)>n||Xr(b)>a||h===r-1)&&(m=Math.sqrt(y*y+b*b),i=g,o=v);break}case He.C:{var x=e[h++],S=e[h++],g=e[h++],v=e[h++],w=e[h++],k=e[h++];m=pS(i,o,x,S,g,v,w,k,10),i=w,o=k;break}case He.Q:{var x=e[h++],S=e[h++],g=e[h++],v=e[h++];m=mS(i,o,x,S,g,v,10),i=g,o=v;break}case He.A:var T=e[h++],C=e[h++],A=e[h++],M=e[h++],I=e[h++],L=e[h++],P=L+I;h+=1,p&&(s=Jn(I)*A+T,l=ea(I)*M+C),m=rf(A,M)*tf(yn,Math.abs(L)),i=Jn(P)*A+T,o=ea(P)*M+C;break;case He.R:{s=i=e[h++],l=o=e[h++];var N=e[h++],O=e[h++];m=N*2+O*2;break}case He.Z:{var y=s-i,b=l-o;m=Math.sqrt(y*y+b*b),i=s,o=l;break}}m>=0&&(c[f++]=m,u+=m)}return this._pathLen=u,u},t.prototype.rebuildPath=function(e,r){var n=this.data,a=this._ux,i=this._uy,o=this._len,s,l,c,u,f,h,d=r<1,p,m,g=0,v=0,y,b=0,x,S;if(!(d&&(this._pathSegLen||this._calculateLength(),p=this._pathSegLen,m=this._pathLen,y=r*m,!y)))e:for(var w=0;w<o;){var k=n[w++],T=w===1;switch(T&&(c=n[w],u=n[w+1],s=c,l=u),k!==He.L&&b>0&&(e.lineTo(x,S),b=0),k){case He.M:s=c=n[w++],l=u=n[w++],e.moveTo(c,u);break;case He.L:{f=n[w++],h=n[w++];var C=Xr(f-c),A=Xr(h-u);if(C>a||A>i){if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;e.lineTo(c*(1-I)+f*I,u*(1-I)+h*I);break e}g+=M}e.lineTo(f,h),c=f,u=h,b=0}else{var L=C*C+A*A;L>b&&(x=f,S=h,b=L)}break}case He.C:{var P=n[w++],N=n[w++],O=n[w++],q=n[w++],R=n[w++],z=n[w++];if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;Ns(c,P,O,R,I,jn),Ns(u,N,q,z,I,Qn),e.bezierCurveTo(jn[1],Qn[1],jn[2],Qn[2],jn[3],Qn[3]);break e}g+=M}e.bezierCurveTo(P,N,O,q,R,z),c=R,u=z;break}case He.Q:{var P=n[w++],N=n[w++],O=n[w++],q=n[w++];if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;Bs(c,P,O,I,jn),Bs(u,N,q,I,Qn),e.quadraticCurveTo(jn[1],Qn[1],jn[2],Qn[2]);break e}g+=M}e.quadraticCurveTo(P,N,O,q),c=O,u=q;break}case He.A:var F=n[w++],X=n[w++],te=n[w++],fe=n[w++],me=n[w++],we=n[w++],Ze=n[w++],Ie=!n[w++],tt=te>fe?te:fe,Ge=Xr(te-fe)>.001,Me=me+we,re=!1;if(d){var M=p[v++];g+M>y&&(Me=me+we*(y-g)/M,re=!0),g+=M}if(Ge&&e.ellipse?e.ellipse(F,X,te,fe,Ze,me,Me,Ie):e.arc(F,X,tt,me,Me,Ie),re)break e;T&&(s=Jn(me)*te+F,l=ea(me)*fe+X),c=Jn(Me)*te+F,u=ea(Me)*fe+X;break;case He.R:s=c=n[w],l=u=n[w+1],f=n[w++],h=n[w++];var he=n[w++],Be=n[w++];if(d){var M=p[v++];if(g+M>y){var pe=y-g;e.moveTo(f,h),e.lineTo(f+tf(pe,he),h),pe-=he,pe>0&&e.lineTo(f+he,h+tf(pe,Be)),pe-=Be,pe>0&&e.lineTo(f+rf(he-pe,0),h+Be),pe-=he,pe>0&&e.lineTo(f,h+rf(Be-pe,0));break e}g+=M}e.rect(f,h,he,Be);break;case He.Z:if(d){var M=p[v++];if(g+M>y){var I=(y-g)/M;e.lineTo(c*(1-I)+s*I,u*(1-I)+l*I);break e}g+=M}e.closePath(),c=s,u=l}}},t.prototype.clone=function(){var e=new t,r=this.data;return e.data=r.slice?r.slice():Array.prototype.slice.call(r),e._len=this._len,e},t.CMD=He,t.initDefaultProps=(function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0})(),t})();function Ka(t,e,r,n,a,i,o){if(a===0)return!1;var s=a,l=0,c=t;if(o>e+s&&o>n+s||o<e-s&&o<n-s||i>t+s&&i>r+s||i<t-s&&i<r-s)return!1;if(t!==r)l=(e-n)/(t-r),c=(t*n-r*e)/(t-r);else return Math.abs(i-t)<=s/2;var u=l*i-o+c,f=u*u/(l*l+1);return f<=s/2*s/2}function VS(t,e,r,n,a,i,o,s,l,c,u){if(l===0)return!1;var f=l;if(u>e+f&&u>n+f&&u>i+f&&u>s+f||u<e-f&&u<n-f&&u<i-f&&u<s-f||c>t+f&&c>r+f&&c>a+f&&c>o+f||c<t-f&&c<r-f&&c<a-f&&c<o-f)return!1;var h=dS(t,e,r,n,a,i,o,s,c,u);return h<=f/2}function GS(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;if(l>e+c&&l>n+c&&l>i+c||l<e-c&&l<n-c&&l<i-c||s>t+c&&s>r+c&&s>a+c||s<t-c&&s<r-c&&s<a-c)return!1;var u=gS(t,e,r,n,a,i,s,l);return u<=c/2}var Qv=Math.PI*2;function el(t){return t%=Qv,t<0&&(t+=Qv),t}var ro=Math.PI*2;function $S(t,e,r,n,a,i,o,s,l){if(o===0)return!1;var c=o;s-=t,l-=e;var u=Math.sqrt(s*s+l*l);if(u-c>r||u+c<r)return!1;if(Math.abs(n-a)%ro<1e-4)return!0;if(i){var f=n;n=el(a),a=el(f)}else n=el(n),a=el(a);n>a&&(a+=ro);var h=Math.atan2(l,s);return h<0&&(h+=ro),h>=n&&h<=a||h+ro>=n&&h+ro<=a}function ra(t,e,r,n,a,i){if(i>e&&i>n||i<e&&i<n||n===e)return 0;var o=(i-e)/(n-e),s=n<e?1:-1;(o===1||o===0)&&(s=n<e?.5:-.5);var l=o*(r-t)+t;return l===a?1/0:l>a?s:0}var _n=ta.CMD,na=Math.PI*2,WS=1e-4;function US(t,e){return Math.abs(t-e)<WS}var Mt=[-1,-1,-1],rr=[-1,-1];function YS(){var t=rr[0];rr[0]=rr[1],rr[1]=t}function qS(t,e,r,n,a,i,o,s,l,c){if(c>e&&c>n&&c>i&&c>s||c<e&&c<n&&c<i&&c<s)return 0;var u=Os(e,n,i,s,c,Mt);if(u===0)return 0;for(var f=0,h=-1,d=void 0,p=void 0,m=0;m<u;m++){var g=Mt[m],v=g===0||g===1?.5:1,y=gt(t,r,a,o,g);y<l||(h<0&&(h=Pv(e,n,i,s,rr),rr[1]<rr[0]&&h>1&&YS(),d=gt(e,n,i,s,rr[0]),h>1&&(p=gt(e,n,i,s,rr[1]))),h===2?g<rr[0]?f+=d<e?v:-v:g<rr[1]?f+=p<d?v:-v:f+=s<p?v:-v:g<rr[0]?f+=d<e?v:-v:f+=s<d?v:-v)}return f}function XS(t,e,r,n,a,i,o,s){if(s>e&&s>n&&s>i||s<e&&s<n&&s<i)return 0;var l=vS(e,n,i,s,Mt);if(l===0)return 0;var c=Ev(e,n,i);if(c>=0&&c<=1){for(var u=0,f=Lt(e,n,i,c),h=0;h<l;h++){var d=Mt[h]===0||Mt[h]===1?.5:1,p=Lt(t,r,a,Mt[h]);p<o||(Mt[h]<c?u+=f<e?d:-d:u+=i<f?d:-d)}return u}else{var d=Mt[0]===0||Mt[0]===1?.5:1,p=Lt(t,r,a,Mt[0]);return p<o?0:i<e?d:-d}}function ZS(t,e,r,n,a,i,o,s){if(s-=e,s>r||s<-r)return 0;var l=Math.sqrt(r*r-s*s);Mt[0]=-l,Mt[1]=l;var c=Math.abs(n-a);if(c<1e-4)return 0;if(c>=na-1e-4){n=0,a=na;var u=i?1:-1;return o>=Mt[0]+t&&o<=Mt[1]+t?u:0}if(n>a){var f=n;n=a,a=f}n<0&&(n+=na,a+=na);for(var h=0,d=0;d<2;d++){var p=Mt[d];if(p+t>o){var m=Math.atan2(s,p),u=i?1:-1;m<0&&(m=na+m),(m>=n&&m<=a||m+na>=n&&m+na<=a)&&(m>Math.PI/2&&m<Math.PI*1.5&&(u=-u),h+=u)}}return h}function Jv(t,e,r,n,a){for(var i=t.data,o=t.len(),s=0,l=0,c=0,u=0,f=0,h,d,p=0;p<o;){var m=i[p++],g=p===1;switch(m===_n.M&&p>1&&(r||(s+=ra(l,c,u,f,n,a))),g&&(l=i[p],c=i[p+1],u=l,f=c),m){case _n.M:u=i[p++],f=i[p++],l=u,c=f;break;case _n.L:if(r){if(Ka(l,c,i[p],i[p+1],e,n,a))return!0}else s+=ra(l,c,i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case _n.C:if(r){if(VS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=qS(l,c,i[p++],i[p++],i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case _n.Q:if(r){if(GS(l,c,i[p++],i[p++],i[p],i[p+1],e,n,a))return!0}else s+=XS(l,c,i[p++],i[p++],i[p],i[p+1],n,a)||0;l=i[p++],c=i[p++];break;case _n.A:var v=i[p++],y=i[p++],b=i[p++],x=i[p++],S=i[p++],w=i[p++];p+=1;var k=!!(1-i[p++]);h=Math.cos(S)*b+v,d=Math.sin(S)*x+y,g?(u=h,f=d):s+=ra(l,c,h,d,n,a);var T=(n-v)*x/b+v;if(r){if($S(v,y,x,S,S+w,k,e,T,a))return!0}else s+=ZS(v,y,x,S,S+w,k,T,a);l=Math.cos(S+w)*b+v,c=Math.sin(S+w)*x+y;break;case _n.R:u=l=i[p++],f=c=i[p++];var C=i[p++],A=i[p++];if(h=u+C,d=f+A,r){if(Ka(u,f,h,f,e,n,a)||Ka(h,f,h,d,e,n,a)||Ka(h,d,u,d,e,n,a)||Ka(u,d,u,f,e,n,a))return!0}else s+=ra(h,f,h,d,n,a),s+=ra(u,d,u,f,n,a);break;case _n.Z:if(r){if(Ka(l,c,u,f,e,n,a))return!0}else s+=ra(l,c,u,f,n,a);l=u,c=f;break}}return!r&&!US(c,f)&&(s+=ra(l,c,u,f,n,a)||0),s!==0}function KS(t,e,r){return Jv(t,0,!1,e,r)}function jS(t,e,r,n){return Jv(t,e,!0,r,n)}var eg=Ne({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},Zn),QS={style:Ne({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Ks.style)},sf=Xi.concat(["invisible","culling","z","z2","zlevel","parent"]),$e=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.update=function(){var r=this;t.prototype.update.call(this);var n=this.style;if(n.decal){var a=this._decalEl=this._decalEl||new e;a.buildPath===e.prototype.buildPath&&(a.buildPath=function(l){r.buildPath(l,r.shape)}),a.silent=!0;var i=a.style;for(var o in n)i[o]!==n[o]&&(i[o]=n[o]);i.fill=n.fill?n.decal:null,i.decal=null,i.shadowColor=null,n.strokeFirst&&(i.stroke=null);for(var s=0;s<sf.length;++s)a[sf[s]]=this[sf[s]];a.__dirty|=Wt}else this._decalEl&&(this._decalEl=null)},e.prototype.getDecalElement=function(){return this._decalEl},e.prototype._init=function(r){var n=Qe(r);this.shape=this.getDefaultShape();var a=this.getDefaultStyle();a&&this.useStyle(a);for(var i=0;i<n.length;i++){var o=n[i],s=r[o];o==="style"?this.style?U(this.style,s):this.useStyle(s):o==="shape"?U(this.shape,s):t.prototype.attrKV.call(this,o,s)}this.style||this.useStyle({})},e.prototype.getDefaultStyle=function(){return null},e.prototype.getDefaultShape=function(){return{}},e.prototype.canBeInsideText=function(){return this.hasFill()},e.prototype.getInsideTextFill=function(){var r=this.style.fill;if(r!=="none"){if(ne(r)){var n=Vs(r,0);return n>.5?Wu:n>.2?AS:Uu}else if(r)return Uu}return Wu},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ne(n)){var a=this.__zr,i=!!(a&&a.isDarkMode()),o=Vs(r,0)<$u;if(i===o)return n}},e.prototype.buildPath=function(r,n,a){},e.prototype.pathUpdated=function(){this.__dirty&=~Xa},e.prototype.getUpdatedPathProxy=function(r){return!this.path&&this.createPathProxy(),this.path.beginPath(),this.buildPath(this.path,this.shape,r),this.path},e.prototype.createPathProxy=function(){this.path=new ta(!1)},e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return!(n==null||n==="none"||!(r.lineWidth>0))},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.getBoundingRect=function(){var r=this._rect,n=this.style,a=!r;if(a){var i=!1;this.path||(i=!0,this.createPathProxy());var o=this.path;(i||this.__dirty&Xa)&&(o.beginPath(),this.buildPath(o,this.shape,!1),this.pathUpdated()),r=o.getBoundingRect()}if(this._rect=r,this.hasStroke()&&this.path&&this.path.len()>0){var s=this._rectStroke||(this._rectStroke=r.clone());if(this.__dirty||a){s.copy(r);var l=n.strokeNoScale?this.getLineScale():1,c=n.lineWidth;if(!this.hasFill()){var u=this.strokeContainThreshold;c=Math.max(c,u??4)}l>1e-10&&(s.width+=c/l,s.height+=c/l,s.x-=c/l/2,s.y-=c/l/2)}return s}return r},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect(),o=this.style;if(r=a[0],n=a[1],i.contain(r,n)){var s=this.path;if(this.hasStroke()){var l=o.lineWidth,c=o.strokeNoScale?this.getLineScale():1;if(c>1e-10&&(this.hasFill()||(l=Math.max(l,this.strokeContainThreshold)),jS(s,l/c,r,n)))return!0}if(this.hasFill())return KS(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Xa,this._rect&&(this._rect=null),this._decalEl&&this._decalEl.dirtyShape(),this.markRedraw()},e.prototype.dirty=function(){this.dirtyStyle(),this.dirtyShape()},e.prototype.animateShape=function(r){return this.animate("shape",r)},e.prototype.updateDuringAnimation=function(r){r==="style"?this.dirtyStyle():r==="shape"?this.dirtyShape():this.markRedraw()},e.prototype.attrKV=function(r,n){r==="shape"?this.setShape(n):t.prototype.attrKV.call(this,r,n)},e.prototype.setShape=function(r,n){var a=this.shape;return a||(a=this.shape={}),typeof r=="string"?a[r]=n:U(a,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Xa)},e.prototype.createStyle=function(r){return Cs(eg,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=U({},this.shape))},e.prototype._applyStateObj=function(r,n,a,i,o,s){t.prototype._applyStateObj.call(this,r,n,a,i,o,s);var l=!(n&&i),c;if(n&&n.shape?o?i?c=n.shape:(c=U({},a.shape),U(c,n.shape)):(c=U({},i?this.shape:a.shape),U(c,n.shape)):l&&(c=a.shape),c)if(o){this.shape=U({},this.shape);for(var u={},f=Qe(c),h=0;h<f.length;h++){var d=f[h];typeof c[d]=="object"?this.shape[d]=c[d]:u[d]=c[d]}this._transitionState(r,{shape:u},s)}else this.shape=c,this.dirtyShape()},e.prototype._mergeStates=function(r){for(var n=t.prototype._mergeStates.call(this,r),a,i=0;i<r.length;i++){var o=r[i];o.shape&&(a=a||{},this._mergeStyle(a,o.shape))}return a&&(n.shape=a),n},e.prototype.getAnimationStyleProps=function(){return QS},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var n=(function(i){Z(o,i);function o(s){var l=i.call(this,s)||this;return r.init&&r.init.call(l,s),l}return o.prototype.getDefaultStyle=function(){return Te(r.style)},o.prototype.getDefaultShape=function(){return Te(r.shape)},o})(e);for(var a in r)typeof r[a]=="function"&&(n.prototype[a]=r[a]);return n},e.initDefaultProps=(function(){var r=e.prototype;r.type="path",r.strokeContainThreshold=5,r.segmentIgnoreThreshold=0,r.subPixelOptimize=!1,r.autoBatch=!1,r.__dirty=Wt|Ji|Xa})(),e})(eo),JS=Ne({strokeFirst:!0,font:Hn,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},eg),tl=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.hasStroke=function(){var r=this.style,n=r.stroke;return n!=null&&n!=="none"&&r.lineWidth>0},e.prototype.hasFill=function(){var r=this.style,n=r.fill;return n!=null&&n!=="none"},e.prototype.createStyle=function(r){return Cs(JS,r)},e.prototype.setBoundingRect=function(r){this._rect=r},e.prototype.getBoundingRect=function(){var r=this.style;if(!this._rect){var n=r.text;n!=null?n+="":n="";var a=Tu(n,r.font,r.textAlign,r.textBaseline);if(a.x+=r.x||0,a.y+=r.y||0,this.hasStroke()){var i=r.lineWidth;a.x-=i/2,a.y-=i/2,a.width+=i,a.height+=i}this._rect=a}return this._rect},e.initDefaultProps=(function(){var r=e.prototype;r.dirtyRectTolerance=10})(),e})(eo);tl.prototype.type="tspan";var ek=Ne({x:0,y:0},Zn),tk={style:Ne({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Ks.style)};function rk(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var bn=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return Cs(ek,r)},e.prototype._getSize=function(r){var n=this.style,a=n[r];if(a!=null)return a;var i=rk(n.image)?n.image:this.__image;if(!i)return 0;var o=r==="width"?"height":"width",s=n[o];return s==null?i[r]:i[r]/i[o]*s},e.prototype.getWidth=function(){return this._getSize("width")},e.prototype.getHeight=function(){return this._getSize("height")},e.prototype.getAnimationStyleProps=function(){return tk},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Fe(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e})(eo);bn.prototype.type="image";function nk(t,e){var r=e.x,n=e.y,a=e.width,i=e.height,o=e.r,s,l,c,u;a<0&&(r=r+a,a=-a),i<0&&(n=n+i,i=-i),typeof o=="number"?s=l=c=u=o:o instanceof Array?o.length===1?s=l=c=u=o[0]:o.length===2?(s=c=o[0],l=u=o[1]):o.length===3?(s=o[0],l=u=o[1],c=o[2]):(s=o[0],l=o[1],c=o[2],u=o[3]):s=l=c=u=0;var f;s+l>a&&(f=s+l,s*=a/f,l*=a/f),c+u>a&&(f=c+u,c*=a/f,u*=a/f),l+c>i&&(f=l+c,l*=i/f,c*=i/f),s+u>i&&(f=s+u,s*=i/f,u*=i/f),t.moveTo(r+s,n),t.lineTo(r+a-l,n),l!==0&&t.arc(r+a-l,n+l,l,-Math.PI/2,0),t.lineTo(r+a,n+i-c),c!==0&&t.arc(r+a-c,n+i-c,c,0,Math.PI/2),t.lineTo(r+u,n+i),u!==0&&t.arc(r+u,n+i-u,u,Math.PI/2,Math.PI),t.lineTo(r,n+s),s!==0&&t.arc(r+s,n+s,s,Math.PI,Math.PI*1.5)}var ja=Math.round;function tg(t,e,r){if(e){var n=e.x1,a=e.x2,i=e.y1,o=e.y2;t.x1=n,t.x2=a,t.y1=i,t.y2=o;var s=r&&r.lineWidth;return s&&(ja(n*2)===ja(a*2)&&(t.x1=t.x2=aa(n,s,!0)),ja(i*2)===ja(o*2)&&(t.y1=t.y2=aa(i,s,!0))),t}}function rg(t,e,r){if(e){var n=e.x,a=e.y,i=e.width,o=e.height;t.x=n,t.y=a,t.width=i,t.height=o;var s=r&&r.lineWidth;return s&&(t.x=aa(n,s,!0),t.y=aa(a,s,!0),t.width=Math.max(aa(n+i,s,!1)-t.x,i===0?0:1),t.height=Math.max(aa(a+o,s,!1)-t.y,o===0?0:1)),t}}function aa(t,e,r){if(!e)return t;var n=ja(t*2);return(n+ja(e))%2===0?n/2:(n+(r?1:-1))/2}var ak=(function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t})(),ik={},ft=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new ak},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=rg(ik,n,this.style);a=l.x,i=l.y,o=l.width,s=l.height,l.r=n.r,n=l}else a=n.x,i=n.y,o=n.width,s=n.height;n.r?nk(r,n):r.rect(a,i,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e})($e);ft.prototype.type="rect";var ng={fill:"#000"},ag=2,ok={style:Ne({fill:!0,stroke:!0,fillOpacity:!0,strokeOpacity:!0,lineWidth:!0,fontSize:!0,lineHeight:!0,width:!0,height:!0,textShadowColor:!0,textShadowBlur:!0,textShadowOffsetX:!0,textShadowOffsetY:!0,backgroundColor:!0,padding:!0,borderColor:!0,borderWidth:!0,borderRadius:!0},Ks.style)},Pt=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=ng,n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.update=function(){t.prototype.update.call(this),this.styleChanged()&&this._updateSubTexts();for(var r=0;r<this._children.length;r++){var n=this._children[r];n.zlevel=this.zlevel,n.z=this.z,n.z2=this.z2,n.culling=this.culling,n.cursor=this.cursor,n.invisible=this.invisible}},e.prototype.updateTransform=function(){var r=this.innerTransformable;r?(r.updateTransform(),r.transform&&(this.transform=r.transform)):t.prototype.updateTransform.call(this)},e.prototype.getLocalTransform=function(r){var n=this.innerTransformable;return n?n.getLocalTransform(r):t.prototype.getLocalTransform.call(this,r)},e.prototype.getComputedTransform=function(){return this.__hostTarget&&(this.__hostTarget.getComputedTransform(),this.__hostTarget.updateInnerText(!0)),t.prototype.getComputedTransform.call(this)},e.prototype._updateSubTexts=function(){this._childCursor=0,fk(this.style),this.style.rich?this._updateRichTexts():this._updatePlainTexts(),this._children.length=this._childCursor,this.styleUpdated()},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=r},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++)this._children[n].__zr=null},e.prototype.getBoundingRect=function(){if(this.styleChanged()&&this._updateSubTexts(),!this._rect){for(var r=new Fe(0,0,0,0),n=this._children,a=[],i=null,o=0;o<n.length;o++){var s=n[o],l=s.getBoundingRect(),c=s.getLocalTransform(a);c?(r.copy(l),r.applyTransform(c),i=i||r.clone(),i.union(r)):(i=i||l.clone(),i.union(l))}this._rect=i||r}return this._rect},e.prototype.setDefaultTextStyle=function(r){this._defaultStyle=r||ng},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,n){if(!n)return r;var a=n.rich,i=r.rich||a&&{};return U(r,n),a&&i?(this._mergeRich(i,a),r.rich=i):i&&(r.rich=i),r},e.prototype._mergeRich=function(r,n){for(var a=Qe(n),i=0;i<a.length;i++){var o=a[i];r[o]=r[o]||{},U(r[o],n[o])}},e.prototype.getAnimationStyleProps=function(){return ok},e.prototype._getOrCreateChild=function(r){var n=this._children[this._childCursor];return(!n||!(n instanceof r))&&(n=new r),this._children[this._childCursor++]=n,n.__zr=this.__zr,n.parent=this,n},e.prototype._updatePlainTexts=function(){var r=this.style,n=r.font||Hn,a=r.padding,i=fg(r),o=Qw(i,r),s=lf(r),l=!!r.backgroundColor,c=o.outerHeight,u=o.outerWidth,f=o.contentWidth,h=o.lines,d=o.lineHeight,p=this._defaultStyle;this.isTruncated=!!o.isTruncated;var m=r.x||0,g=r.y||0,v=r.align||p.align||"left",y=r.verticalAlign||p.verticalAlign||"top",b=m,x=Ha(g,o.contentHeight,y);if(s||a){var S=qi(m,u,v),w=Ha(g,c,y);s&&this._renderBackground(r,r,S,w,u,c)}x+=d/2,a&&(b=ug(m,v,a),y==="top"?x+=a[0]:y==="bottom"&&(x-=a[2]));for(var k=0,T=!1,C=cg("fill"in r?r.fill:(T=!0,p.fill)),A=lg("stroke"in r?r.stroke:!l&&(!p.autoStroke||T)?(k=ag,p.stroke):null),M=r.textShadowBlur>0,I=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),L=o.calculatedLineHeight,P=0;P<h.length;P++){var N=this._getOrCreateChild(tl),O=N.createStyle();N.useStyle(O),O.text=h[P],O.x=b,O.y=x,O.textAlign=v,O.textBaseline="middle",O.opacity=r.opacity,O.strokeFirst=!0,M&&(O.shadowBlur=r.textShadowBlur||0,O.shadowColor=r.textShadowColor||"transparent",O.shadowOffsetX=r.textShadowOffsetX||0,O.shadowOffsetY=r.textShadowOffsetY||0),O.stroke=A,O.fill=C,A&&(O.lineWidth=r.lineWidth||k,O.lineDash=r.lineDash,O.lineDashOffset=r.lineDashOffset||0),O.font=n,og(O,r),x+=d,I&&N.setBoundingRect(new Fe(qi(O.x,f,O.textAlign),Ha(O.y,L,O.textBaseline),f,L))}},e.prototype._updateRichTexts=function(){var r=this.style,n=fg(r),a=tS(n,r),i=a.width,o=a.outerWidth,s=a.outerHeight,l=r.padding,c=r.x||0,u=r.y||0,f=this._defaultStyle,h=r.align||f.align,d=r.verticalAlign||f.verticalAlign;this.isTruncated=!!a.isTruncated;var p=qi(c,o,h),m=Ha(u,s,d),g=p,v=m;l&&(g+=l[3],v+=l[0]);var y=g+i;lf(r)&&this._renderBackground(r,r,p,m,o,s);for(var b=!!r.backgroundColor,x=0;x<a.lines.length;x++){for(var S=a.lines[x],w=S.tokens,k=w.length,T=S.lineHeight,C=S.width,A=0,M=g,I=y,L=k-1,P=void 0;A<k&&(P=w[A],!P.align||P.align==="left");)this._placeToken(P,r,T,v,M,"left",b),C-=P.width,M+=P.width,A++;for(;L>=0&&(P=w[L],P.align==="right");)this._placeToken(P,r,T,v,I,"right",b),C-=P.width,I-=P.width,L--;for(M+=(i-(M-g)-(y-I)-C)/2;A<=L;)P=w[A],this._placeToken(P,r,T,v,M+P.width/2,"center",b),M+=P.width,A++;v+=T}},e.prototype._placeToken=function(r,n,a,i,o,s,l){var c=n.rich[r.styleName]||{};c.text=r.text;var u=r.verticalAlign,f=i+a/2;u==="top"?f=i+r.height/2:u==="bottom"&&(f=i+a-r.height/2);var h=!r.isLineHolder&&lf(c);h&&this._renderBackground(c,n,s==="right"?o-r.width:s==="center"?o-r.width/2:o,f-r.height/2,r.width,r.height);var d=!!c.backgroundColor,p=r.textPadding;p&&(o=ug(o,s,p),f-=r.height/2-p[0]-r.innerHeight/2);var m=this._getOrCreateChild(tl),g=m.createStyle();m.useStyle(g);var v=this._defaultStyle,y=!1,b=0,x=cg("fill"in c?c.fill:"fill"in n?n.fill:(y=!0,v.fill)),S=lg("stroke"in c?c.stroke:"stroke"in n?n.stroke:!d&&!l&&(!v.autoStroke||y)?(b=ag,v.stroke):null),w=c.textShadowBlur>0||n.textShadowBlur>0;g.text=r.text,g.x=o,g.y=f,w&&(g.shadowBlur=c.textShadowBlur||n.textShadowBlur||0,g.shadowColor=c.textShadowColor||n.textShadowColor||"transparent",g.shadowOffsetX=c.textShadowOffsetX||n.textShadowOffsetX||0,g.shadowOffsetY=c.textShadowOffsetY||n.textShadowOffsetY||0),g.textAlign=s,g.textBaseline="middle",g.font=r.font||Hn,g.opacity=Ts(c.opacity,n.opacity,1),og(g,c),S&&(g.lineWidth=Ts(c.lineWidth,n.lineWidth,b),g.lineDash=Ce(c.lineDash,n.lineDash),g.lineDashOffset=n.lineDashOffset||0,g.stroke=S),x&&(g.fill=x);var k=r.contentWidth,T=r.contentHeight;m.setBoundingRect(new Fe(qi(g.x,k,g.textAlign),Ha(g.y,T,g.textBaseline),k,T))},e.prototype._renderBackground=function(r,n,a,i,o,s){var l=r.backgroundColor,c=r.borderWidth,u=r.borderColor,f=l&&l.image,h=l&&!f,d=r.borderRadius,p=this,m,g;if(h||r.lineHeight||c&&u){m=this._getOrCreateChild(ft),m.useStyle(m.createStyle()),m.style.fill=null;var v=m.shape;v.x=a,v.y=i,v.width=o,v.height=s,v.r=d,m.dirtyShape()}if(h){var y=m.style;y.fill=l||null,y.fillOpacity=Ce(r.fillOpacity,1)}else if(f){g=this._getOrCreateChild(bn),g.onload=function(){p.dirtyStyle()};var b=g.style;b.image=l.image,b.x=a,b.y=i,b.width=o,b.height=s}if(c&&u){var y=m.style;y.lineWidth=c,y.stroke=u,y.strokeOpacity=Ce(r.strokeOpacity,1),y.lineDash=r.borderDash,y.lineDashOffset=r.borderDashOffset||0,m.strokeContainThreshold=0,m.hasFill()&&m.hasStroke()&&(y.strokeFirst=!0,y.lineWidth*=2)}var x=(m||g).style;x.shadowBlur=r.shadowBlur||0,x.shadowColor=r.shadowColor||"transparent",x.shadowOffsetX=r.shadowOffsetX||0,x.shadowOffsetY=r.shadowOffsetY||0,x.opacity=Ts(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return uk(r)&&(n=[r.fontStyle,r.fontWeight,ck(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&Mr(n)||r.textFont||r.font},e})(eo),sk={left:!0,right:1,center:1},lk={top:1,bottom:1,middle:1},ig=["fontStyle","fontWeight","fontSize","fontFamily"];function ck(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?hu+"px":t+"px"}function og(t,e){for(var r=0;r<ig.length;r++){var n=ig[r],a=e[n];a!=null&&(t[n]=a)}}function uk(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function fk(t){return sg(t),D(t.rich,sg),t}function sg(t){if(t){t.font=Pt.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||sk[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||lk[r]?r:"top";var n=t.padding;n&&(t.padding=uv(t.padding))}}function lg(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function cg(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function ug(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function fg(t){var e=t.text;return e!=null&&(e+=""),e}function lf(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var hg=1e-4,dg=20;function hk(t){return t.replace(/^\s+|\s+$/g,"")}function ia(t,e,r,n){var a=e[0],i=e[1],o=r[0],s=r[1],l=i-a,c=s-o;if(l===0)return c===0?o:(o+s)/2;if(n)if(l>0){if(t<=a)return o;if(t>=i)return s}else{if(t>=a)return o;if(t<=i)return s}else{if(t===a)return o;if(t===i)return s}return(t-a)/l*c+o}function At(t,e){switch(t){case"center":case"middle":t="50%";break;case"left":case"top":t="0%";break;case"right":case"bottom":t="100%";break}return ne(t)?hk(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function lt(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),dg),t=(+t).toFixed(e),r?t:+t}function dk(t){return t.sort(function(e,r){return e-r}),t}function Zr(t){if(t=+t,isNaN(t))return 0;if(t>1e-14){for(var e=1,r=0;r<15;r++,e*=10)if(Math.round(t*e)/e===t)return r}return pk(t)}function pk(t){var e=t.toString().toLowerCase(),r=e.indexOf("e"),n=r>0?+e.slice(r+1):0,a=r>0?r:e.length,i=e.indexOf("."),o=i<0?0:a-1-i;return Math.max(0,o-n)}function pg(t,e){var r=Math.log,n=Math.LN10,a=Math.floor(r(t[1]-t[0])/n),i=Math.round(r(Math.abs(e[1]-e[0]))/n),o=Math.min(Math.max(-a+i,0),20);return isFinite(o)?o:20}function vk(t,e){var r=Math.max(Zr(t),Zr(e)),n=t+e;return r>dg?n:lt(n,r)}function vg(t){var e=Math.PI*2;return(t%e+e)%e}function rl(t){return t>-hg&&t<hg}var gk=/^(?:(\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 Kr(t){if(t instanceof Date)return t;if(ne(t)){var e=gk.exec(t);if(!e)return new Date(NaN);if(e[8]){var r=+e[4]||0;return e[8].toUpperCase()!=="Z"&&(r-=+e[8].slice(0,3)),new Date(Date.UTC(+e[1],+(e[2]||1)-1,+e[3]||1,r,+(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(t==null)return new Date(NaN);return new Date(Math.round(t))}function mk(t){return Math.pow(10,cf(t))}function cf(t){if(t===0)return 0;var e=Math.floor(Math.log(t)/Math.LN10);return t/Math.pow(10,e)>=10&&e++,e}function gg(t,e){var r=cf(t),n=Math.pow(10,r),a=t/n,i;return a<1.5?i=1:a<2.5?i=2:a<4?i=3:a<7?i=5:i=10,t=i*n,r>=-20?+t.toFixed(r<0?-r:0):t}function nl(t){var e=parseFloat(t);return e==t&&(e!==0||!ne(t)||t.indexOf("x")<=0)?e:NaN}function yk(t){return!isNaN(nl(t))}function mg(){return Math.round(Math.random()*9)}function yg(t,e){return e===0?t:yg(e,t%e)}function _g(t,e){return t==null?e:e==null?t:t*e/yg(t,e)}function Rt(t){throw new Error(t)}function bg(t,e,r){return(e-t)*r+t}var xg="series\0",_k="\0_ec_\0";function _t(t){return t instanceof Array?t:t==null?[]:[t]}function wg(t,e,r){if(t){t[e]=t[e]||{},t.emphasis=t.emphasis||{},t.emphasis[e]=t.emphasis[e]||{};for(var n=0,a=r.length;n<a;n++){var i=r[n];!t.emphasis[e].hasOwnProperty(i)&&t[e].hasOwnProperty(i)&&(t.emphasis[e][i]=t[e][i])}}}var Sg=["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 no(t){return ce(t)&&!ee(t)&&!(t instanceof Date)?t.value:t}function bk(t){return ce(t)&&!(t instanceof Array)}function xk(t,e,r){var n=r==="normalMerge",a=r==="replaceMerge",i=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=de();D(e,function(l,c){if(!ce(l)){e[c]=null;return}});var s=wk(t,o,r);return(n||a)&&Sk(s,t,o,e),n&&kk(s,e),n||a?Tk(s,e,a):i&&Ck(s,e),Mk(s),s}function wk(t,e,r){var n=[];if(r==="replaceAll")return n;for(var a=0;a<t.length;a++){var i=t[a];i&&i.id!=null&&e.set(i.id,a),n.push({existing:r==="replaceMerge"||io(i)?null:i,newOption:null,keyInfo:null,brandNew:null})}return n}function Sk(t,e,r,n){D(n,function(a,i){if(!(!a||a.id==null)){var o=ao(a.id),s=r.get(o);if(s!=null){var l=t[s];Ur(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=a,l.existing=e[s],n[i]=null}}})}function kk(t,e){D(e,function(r,n){if(!(!r||r.name==null))for(var a=0;a<t.length;a++){var i=t[a].existing;if(!t[a].newOption&&i&&(i.id==null||r.id==null)&&!io(r)&&!io(i)&&kg("name",i,r)){t[a].newOption=r,e[n]=null;return}}})}function Tk(t,e,r){D(e,function(n){if(n){for(var a,i=0;(a=t[i])&&(a.newOption||io(a.existing)||a.existing&&n.id!=null&&!kg("id",n,a.existing));)i++;a?(a.newOption=n,a.brandNew=r):t.push({newOption:n,brandNew:r,existing:null,keyInfo:null}),i++}})}function Ck(t,e){D(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function Mk(t){var e=de();D(t,function(r){var n=r.existing;n&&e.set(n.id,r)}),D(t,function(r){var n=r.newOption;Ur(!n||n.id==null||!e.get(n.id)||e.get(n.id)===r,"id duplicates: "+(n&&n.id)),n&&n.id!=null&&e.set(n.id,r),!r.keyInfo&&(r.keyInfo={})}),D(t,function(r,n){var a=r.existing,i=r.newOption,o=r.keyInfo;if(ce(i)){if(o.name=i.name!=null?ao(i.name):a?a.name:xg+n,a)o.id=ao(a.id);else if(i.id!=null)o.id=ao(i.id);else{var s=0;do o.id="\0"+o.name+"\0"+s++;while(e.get(o.id))}e.set(o.id,r)}})}function kg(t,e,r){var n=Rr(e[t],null),a=Rr(r[t],null);return n!=null&&a!=null&&n===a}function ao(t){return Rr(t,"")}function Rr(t,e){return t==null?e:ne(t)?t:Ke(t)||gu(t)?t+"":e}function uf(t){var e=t.name;return!!(e&&e.indexOf(xg))}function io(t){return t&&t.id!=null&&ao(t.id).indexOf(_k)===0}function Ak(t,e,r){D(t,function(n){var a=n.newOption;ce(a)&&(n.keyInfo.mainType=e,n.keyInfo.subType=Dk(e,a,n.existing,r))})}function Dk(t,e,r,n){var a=e.type?e.type:r?r.subType:n.determineSubType(t,e);return a}function oa(t,e){if(e.dataIndexInside!=null)return e.dataIndexInside;if(e.dataIndex!=null)return ee(e.dataIndex)?ue(e.dataIndex,function(r){return t.indexOfRawIndex(r)}):t.indexOfRawIndex(e.dataIndex);if(e.name!=null)return ee(e.name)?ue(e.name,function(r){return t.indexOfName(r)}):t.indexOfName(e.name)}function it(){var t="__ec_inner_"+Ik++;return function(e){return e[t]||(e[t]={})}}var Ik=mg();function ff(t,e,r){var n=hf(e,r),a=n.mainTypeSpecified,i=n.queryOptionMap,o=n.others,s=o,l=r?r.defaultMainType:null;return!a&&l&&i.set(l,{}),i.each(function(c,u){var f=oo(t,u,c,{useDefault:l===u,enableAll:r&&r.enableAll!=null?r.enableAll:!0,enableNone:r&&r.enableNone!=null?r.enableNone:!0});s[u+"Models"]=f.models,s[u+"Model"]=f.models[0]}),s}function hf(t,e){var r;if(ne(t)){var n={};n[t+"Index"]=0,r=n}else r=t;var a=de(),i={},o=!1;return D(r,function(s,l){if(l==="dataIndex"||l==="dataIndexInside"){i[l]=s;return}var c=l.match(/^(\w+)(Index|Id|Name)$/)||[],u=c[1],f=(c[2]||"").toLowerCase();if(!(!u||!f||e&&e.includeMainTypes&&ze(e.includeMainTypes,u)<0)){o=o||!!u;var h=a.get(u)||a.set(u,{});h[f]=s}}),{mainTypeSpecified:o,queryOptionMap:a,others:i}}var Et={useDefault:!0,enableAll:!1,enableNone:!1},Lk={useDefault:!1,enableAll:!0,enableNone:!0};function oo(t,e,r,n){n=n||Et;var a=r.index,i=r.id,o=r.name,s={models:null,specified:a!=null||i!=null||o!=null};if(!s.specified){var l=void 0;return s.models=n.useDefault&&(l=t.getComponent(e))?[l]:[],s}return a==="none"||a===!1?(Ur(n.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(a==="all"&&(Ur(n.enableAll,'`"all"` is not a valid value on index option.'),a=i=o=null),s.models=t.queryComponents({mainType:e,index:a,id:i,name:o}),s)}function Tg(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function Pk(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function Rk(t){return t==="auto"?ge.domSupported?"html":"richText":t||"html"}function Ek(t,e,r,n,a){var i=e==null||e==="auto";if(n==null)return n;if(Ke(n)){var o=bg(r||0,n,a);return lt(o,i?Math.max(Zr(r||0),Zr(n)):e)}else{if(ne(n))return a<1?r:n;for(var s=[],l=r,c=n,u=Math.max(l?l.length:0,c.length),f=0;f<u;++f){var h=t.getDimensionInfo(f);if(h&&h.type==="ordinal")s[f]=(a<1&&l?l:c)[f];else{var d=l&&l[f]?l[f]:0,p=c[f],o=bg(d,p,a);s[f]=lt(o,i?Math.max(Zr(d),Zr(p)):e)}}return s}}var Ve=it(),Ok=function(t,e,r,n){if(n){var a=Ve(n);a.dataIndex=r,a.dataType=e,a.seriesIndex=t,a.ssrType="chart",n.type==="group"&&n.traverse(function(i){var o=Ve(i);o.seriesIndex=t,o.dataIndex=r,o.dataType=e,o.ssrType="chart"})}},Cg=1,Mg={},Ag=it(),df=it(),pf=0,al=1,il=2,Er=["emphasis","blur","select"],Dg=["normal","emphasis","blur","select"],Nk=10,Bk=9,sa="highlight",ol="downplay",so="select",sl="unselect",lo="toggleSelect";function Qa(t){return t!=null&&t!=="none"}function ll(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function Ig(t){ll(t,"emphasis",il)}function Lg(t){t.hoverState===il&&ll(t,"normal",pf)}function vf(t){ll(t,"blur",al)}function Pg(t){t.hoverState===al&&ll(t,"normal",pf)}function zk(t){t.selected=!0}function Fk(t){t.selected=!1}function Rg(t,e,r){e(t,r)}function jr(t,e,r){Rg(t,e,r),t.isGroup&&t.traverse(function(n){Rg(n,e,r)})}function Eg(t,e){switch(e){case"emphasis":t.hoverState=il;break;case"normal":t.hoverState=pf;break;case"blur":t.hoverState=al;break;case"select":t.selected=!0}}function Hk(t,e,r,n){for(var a=t.style,i={},o=0;o<e.length;o++){var s=e[o],l=a[s];i[s]=l??(n&&n[s])}for(var o=0;o<t.animators.length;o++){var c=t.animators[o];c.__fromStateTransition&&c.__fromStateTransition.indexOf(r)<0&&c.targetName==="style"&&c.saveTo(i,e)}return i}function Vk(t,e,r,n){var a=r&&ze(r,"select")>=0,i=!1;if(t instanceof $e){var o=Ag(t),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(Qa(s)||Qa(l)){n=n||{};var c=n.style||{};c.fill==="inherit"?(i=!0,n=U({},n),c=U({},c),c.fill=s):!Qa(c.fill)&&Qa(s)?(i=!0,n=U({},n),c=U({},c),c.fill=Vv(s)):!Qa(c.stroke)&&Qa(l)&&(i||(n=U({},n),c=U({},c)),c.stroke=Vv(l)),n.style=c}}if(n&&n.z2==null){i||(n=U({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(u??Nk)}return n}function Gk(t,e,r){if(r&&r.z2==null){r=U({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??Bk)}return r}function $k(t,e,r){var n=ze(t.currentStates,e)>=0,a=t.style.opacity,i=n?null:Hk(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=U({},r),o=U({opacity:n?a:i.opacity*.1},o),r.style=o),r}function gf(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return Vk(this,t,e,r);if(t==="blur")return $k(this,t,r);if(t==="select")return Gk(this,t,r)}return r}function Wk(t){t.stateProxy=gf;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=gf),r&&(r.stateProxy=gf)}function Og(t,e){!Hg(t,e)&&!t.__highByOuter&&jr(t,Ig)}function Ng(t,e){!Hg(t,e)&&!t.__highByOuter&&jr(t,Lg)}function cl(t,e){t.__highByOuter|=1<<(e||0),jr(t,Ig)}function ul(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&jr(t,Lg)}function Uk(t){jr(t,vf)}function Bg(t){jr(t,Pg)}function zg(t){jr(t,zk)}function Fg(t){jr(t,Fk)}function Hg(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Vg(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(a,i){var o=df(i),s=a==="series",l=s?t.getViewOfSeriesModel(i):t.getViewOfComponentModel(i);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(c){Pg(c)}),s&&r.push(i)),o.isBlured=!1}),D(n,function(a){a&&a.toggleBlurSeries&&a.toggleBlurSeries(r,!1,e)})}function mf(t,e,r,n){var a=n.getModel();r=r||"coordinateSystem";function i(c,u){for(var f=0;f<u.length;f++){var h=c.getItemGraphicEl(u[f]);h&&Bg(h)}}if(t!=null&&!(!e||e==="none")){var o=a.getSeriesByIndex(t),s=o.coordinateSystem;s&&s.master&&(s=s.master);var l=[];a.eachSeries(function(c){var u=o===c,f=c.coordinateSystem;f&&f.master&&(f=f.master);var h=f&&s?f===s:u;if(!(r==="series"&&!u||r==="coordinateSystem"&&!h||e==="series"&&u)){var d=n.getViewOfSeriesModel(c);if(d.group.traverse(function(g){g.__highByOuter&&u&&e==="self"||vf(g)}),Dt(e))i(c.getData(),e);else if(ce(e))for(var p=Qe(e),m=0;m<p.length;m++)i(c.getData(p[m]),e[p[m]]);l.push(c),df(c).isBlured=!0}}),a.eachComponent(function(c,u){if(c!=="series"){var f=n.getViewOfComponentModel(u);f&&f.toggleBlurSeries&&f.toggleBlurSeries(l,!0,a)}})}}function yf(t,e,r){if(!(t==null||e==null)){var n=r.getModel().getComponent(t,e);if(n){df(n).isBlured=!0;var a=r.getViewOfComponentModel(n);!a||!a.focusBlurEnabled||a.group.traverse(function(i){vf(i)})}}}function Yk(t,e,r){var n=t.seriesIndex,a=t.getData(e.dataType);if(a){var i=oa(a,e);i=(ee(i)?i[0]:i)||0;var o=a.getItemGraphicEl(i);if(!o)for(var s=a.count(),l=0;!o&&l<s;)o=a.getItemGraphicEl(l++);if(o){var c=Ve(o);mf(n,c.focus,c.blurScope,r)}else{var u=t.get(["emphasis","focus"]),f=t.get(["emphasis","blurScope"]);u!=null&&mf(n,u,f,r)}}}function _f(t,e,r,n){var a={focusSelf:!1,dispatchers:null};if(t==null||t==="series"||e==null||r==null)return a;var i=n.getModel().getComponent(t,e);if(!i)return a;var o=n.getViewOfComponentModel(i);if(!o||!o.findHighDownDispatchers)return a;for(var s=o.findHighDownDispatchers(r),l,c=0;c<s.length;c++)if(Ve(s[c]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function qk(t,e,r){var n=Ve(t),a=_f(n.componentMainType,n.componentIndex,n.componentHighDownName,r),i=a.dispatchers,o=a.focusSelf;i?(o&&yf(n.componentMainType,n.componentIndex,r),D(i,function(s){return Og(s,e)})):(mf(n.seriesIndex,n.focus,n.blurScope,r),n.focus==="self"&&yf(n.componentMainType,n.componentIndex,r),Og(t,e))}function Xk(t,e,r){Vg(r);var n=Ve(t),a=_f(n.componentMainType,n.componentIndex,n.componentHighDownName,r).dispatchers;a?D(a,function(i){return Ng(i,e)}):Ng(t,e)}function Zk(t,e,r){if(Sf(e)){var n=e.dataType,a=t.getData(n),i=oa(a,e);ee(i)||(i=[i]),t[e.type===lo?"toggleSelect":e.type===so?"select":"unselect"](i,n)}}function Gg(t){var e=t.getAllData();D(e,function(r){var n=r.data,a=r.type;n.eachItemGraphicEl(function(i,o){t.isSelected(o,a)?zg(i):Fg(i)})})}function Kk(t){var e=[];return t.eachSeries(function(r){var n=r.getAllData();D(n,function(a){a.data;var i=a.type,o=r.getSelectedDataIndices();if(o.length>0){var s={dataIndex:o,seriesIndex:r.seriesIndex};i!=null&&(s.dataType=i),e.push(s)}})}),e}function bf(t,e,r){Wg(t,!0),jr(t,Wk),Qk(t,e,r)}function jk(t){Wg(t,!1)}function fl(t,e,r,n){n?jk(t):bf(t,e,r)}function Qk(t,e,r){var n=Ve(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var $g=["emphasis","blur","select"],Jk={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function xf(t,e,r,n){r=r||"itemStyle";for(var a=0;a<$g.length;a++){var i=$g[a],o=e.getModel([i,r]),s=t.ensureState(i);s.style=o[Jk[r]]()}}function Wg(t,e){var r=e===!1,n=t;t.highDownSilentOnTouch&&(n.__highDownSilentOnTouch=t.highDownSilentOnTouch),(!r||n.__highDownDispatcher)&&(n.__highByOuter=n.__highByOuter||0,n.__highDownDispatcher=!r)}function wf(t){return!!(t&&t.__highDownDispatcher)}function eT(t){var e=Mg[t];return e==null&&Cg<=32&&(e=Mg[t]=Cg++),e}function Sf(t){var e=t.type;return e===so||e===sl||e===lo}function Ug(t){var e=t.type;return e===sa||e===ol}function tT(t){var e=Ag(t);e.normalFill=t.style.fill,e.normalStroke=t.style.stroke;var r=t.states.select||{};e.selectFill=r.style&&r.style.fill||null,e.selectStroke=r.style&&r.style.stroke||null}var Ja=ta.CMD,rT=[[],[],[]],Yg=Math.sqrt,nT=Math.atan2;function aT(t,e){if(e){var r=t.data,n=t.len(),a,i,o,s,l,c,u=Ja.M,f=Ja.C,h=Ja.L,d=Ja.R,p=Ja.A,m=Ja.Q;for(o=0,s=0;o<n;){switch(a=r[o++],s=o,i=0,a){case u:i=1;break;case h:i=1;break;case f:i=3;break;case m:i=2;break;case p:var g=e[4],v=e[5],y=Yg(e[0]*e[0]+e[1]*e[1]),b=Yg(e[2]*e[2]+e[3]*e[3]),x=nT(-e[1]/b,e[0]/y);r[o]*=y,r[o++]+=g,r[o]*=b,r[o++]+=v,r[o++]*=y,r[o++]*=b,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case d:c[0]=r[o++],c[1]=r[o++],jt(c,c,e),r[s++]=c[0],r[s++]=c[1],c[0]+=r[o++],c[1]+=r[o++],jt(c,c,e),r[s++]=c[0],r[s++]=c[1]}for(l=0;l<i;l++){var S=rT[l];S[0]=r[o++],S[1]=r[o++],jt(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var kf=Math.sqrt,hl=Math.sin,dl=Math.cos,co=Math.PI;function qg(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function Tf(t,e){return(t[0]*e[0]+t[1]*e[1])/(qg(t)*qg(e))}function Xg(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(Tf(t,e))}function Zg(t,e,r,n,a,i,o,s,l,c,u){var f=l*(co/180),h=dl(f)*(t-r)/2+hl(f)*(e-n)/2,d=-1*hl(f)*(t-r)/2+dl(f)*(e-n)/2,p=h*h/(o*o)+d*d/(s*s);p>1&&(o*=kf(p),s*=kf(p));var m=(a===i?-1:1)*kf((o*o*(s*s)-o*o*(d*d)-s*s*(h*h))/(o*o*(d*d)+s*s*(h*h)))||0,g=m*o*d/s,v=m*-s*h/o,y=(t+r)/2+dl(f)*g-hl(f)*v,b=(e+n)/2+hl(f)*g+dl(f)*v,x=Xg([1,0],[(h-g)/o,(d-v)/s]),S=[(h-g)/o,(d-v)/s],w=[(-1*h-g)/o,(-1*d-v)/s],k=Xg(S,w);if(Tf(S,w)<=-1&&(k=co),Tf(S,w)>=1&&(k=0),k<0){var T=Math.round(k/co*1e6)/1e6;k=co*2+T%2*co}u.addData(c,y,b,o,s,x,k,f,i)}var iT=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,oT=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function sT(t){var e=new ta;if(!t)return e;var r=0,n=0,a=r,i=n,o,s=ta.CMD,l=t.match(iT);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],f=u.charAt(0),h=void 0,d=u.match(oT)||[],p=d.length,m=0;m<p;m++)d[m]=parseFloat(d[m]);for(var g=0;g<p;){var v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=r,C=n,A=void 0,M=void 0;switch(f){case"l":r+=d[g++],n+=d[g++],h=s.L,e.addData(h,r,n);break;case"L":r=d[g++],n=d[g++],h=s.L,e.addData(h,r,n);break;case"m":r+=d[g++],n+=d[g++],h=s.M,e.addData(h,r,n),a=r,i=n,f="l";break;case"M":r=d[g++],n=d[g++],h=s.M,e.addData(h,r,n),a=r,i=n,f="L";break;case"h":r+=d[g++],h=s.L,e.addData(h,r,n);break;case"H":r=d[g++],h=s.L,e.addData(h,r,n);break;case"v":n+=d[g++],h=s.L,e.addData(h,r,n);break;case"V":n=d[g++],h=s.L,e.addData(h,r,n);break;case"C":h=s.C,e.addData(h,d[g++],d[g++],d[g++],d[g++],d[g++],d[g++]),r=d[g-2],n=d[g-1];break;case"c":h=s.C,e.addData(h,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n,d[g++]+r,d[g++]+n),r+=d[g-2],n+=d[g-1];break;case"S":v=r,y=n,A=e.len(),M=e.data,o===s.C&&(v+=r-M[A-4],y+=n-M[A-3]),h=s.C,T=d[g++],C=d[g++],r=d[g++],n=d[g++],e.addData(h,v,y,T,C,r,n);break;case"s":v=r,y=n,A=e.len(),M=e.data,o===s.C&&(v+=r-M[A-4],y+=n-M[A-3]),h=s.C,T=r+d[g++],C=n+d[g++],r+=d[g++],n+=d[g++],e.addData(h,v,y,T,C,r,n);break;case"Q":T=d[g++],C=d[g++],r=d[g++],n=d[g++],h=s.Q,e.addData(h,T,C,r,n);break;case"q":T=d[g++]+r,C=d[g++]+n,r+=d[g++],n+=d[g++],h=s.Q,e.addData(h,T,C,r,n);break;case"T":v=r,y=n,A=e.len(),M=e.data,o===s.Q&&(v+=r-M[A-4],y+=n-M[A-3]),r=d[g++],n=d[g++],h=s.Q,e.addData(h,v,y,r,n);break;case"t":v=r,y=n,A=e.len(),M=e.data,o===s.Q&&(v+=r-M[A-4],y+=n-M[A-3]),r+=d[g++],n+=d[g++],h=s.Q,e.addData(h,v,y,r,n);break;case"A":b=d[g++],x=d[g++],S=d[g++],w=d[g++],k=d[g++],T=r,C=n,r=d[g++],n=d[g++],h=s.A,Zg(T,C,r,n,w,k,b,x,S,h,e);break;case"a":b=d[g++],x=d[g++],S=d[g++],w=d[g++],k=d[g++],T=r,C=n,r+=d[g++],n+=d[g++],h=s.A,Zg(T,C,r,n,w,k,b,x,S,h,e);break}}(f==="z"||f==="Z")&&(h=s.Z,e.addData(h),r=a,n=i),o=h}return e.toStatic(),e}var Kg=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e})($e);function jg(t){return t.setData!=null}function Qg(t,e){var r=sT(t),n=U({},e);return n.buildPath=function(a){if(jg(a)){a.setData(r.data);var i=a.getContext();i&&a.rebuildPath(i,1)}else{var i=a;r.rebuildPath(i,1)}},n.applyTransform=function(a){aT(r,a),this.dirtyShape()},n}function lT(t,e){return new Kg(Qg(t,e))}function cT(t,e){var r=Qg(t,e),n=(function(a){Z(i,a);function i(o){var s=a.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return i})(Kg);return n}function uT(t,e){for(var r=[],n=t.length,a=0;a<n;a++){var i=t[a];r.push(i.getUpdatedPathProxy(!0))}var o=new $e(e);return o.createPathProxy(),o.buildPath=function(s){if(jg(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var mt=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;return n.isGroup=!0,n._children=[],n.attr(r),n}return e.prototype.childrenRef=function(){return this._children},e.prototype.children=function(){return this._children.slice()},e.prototype.childAt=function(r){return this._children[r]},e.prototype.childOfName=function(r){for(var n=this._children,a=0;a<n.length;a++)if(n[a].name===r)return n[a]},e.prototype.childCount=function(){return this._children.length},e.prototype.add=function(r){return r&&r!==this&&r.parent!==this&&(this._children.push(r),this._doAdd(r)),this},e.prototype.addBefore=function(r,n){if(r&&r!==this&&r.parent!==this&&n&&n.parent===this){var a=this._children,i=a.indexOf(n);i>=0&&(a.splice(i,0,r),this._doAdd(r))}return this},e.prototype.replace=function(r,n){var a=ze(this._children,r);return a>=0&&this.replaceAt(n,a),this},e.prototype.replaceAt=function(r,n){var a=this._children,i=a[n];if(r&&r!==this&&r.parent!==this&&r!==i){a[n]=r,i.parent=null;var o=this.__zr;o&&i.removeSelfFromZr(o),this._doAdd(r)}return this},e.prototype._doAdd=function(r){r.parent&&r.parent.remove(r),r.parent=this;var n=this.__zr;n&&n!==r.__zr&&r.addSelfToZr(n),n&&n.refresh()},e.prototype.remove=function(r){var n=this.__zr,a=this._children,i=ze(a,r);return i<0?this:(a.splice(i,1),r.parent=null,n&&r.removeSelfFromZr(n),n&&n.refresh(),this)},e.prototype.removeAll=function(){for(var r=this._children,n=this.__zr,a=0;a<r.length;a++){var i=r[a];n&&i.removeSelfFromZr(n),i.parent=null}return r.length=0,this},e.prototype.eachChild=function(r,n){for(var a=this._children,i=0;i<a.length;i++){var o=a[i];r.call(n,o,i)}return this},e.prototype.traverse=function(r,n){for(var a=0;a<this._children.length;a++){var i=this._children[a],o=r.call(n,i);i.isGroup&&!o&&i.traverse(r,n)}return this},e.prototype.addSelfToZr=function(r){t.prototype.addSelfToZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.addSelfToZr(r)}},e.prototype.removeSelfFromZr=function(r){t.prototype.removeSelfFromZr.call(this,r);for(var n=0;n<this._children.length;n++){var a=this._children[n];a.removeSelfFromZr(r)}},e.prototype.getBoundingRect=function(r){for(var n=new Fe(0,0,0,0),a=r||this._children,i=[],o=null,s=0;s<a.length;s++){var l=a[s];if(!(l.ignore||l.invisible)){var c=l.getBoundingRect(),u=l.getLocalTransform(i);u?(Fe.applyTransform(n,c,u),o=o||n.clone(),o.union(n)):(o=o||c.clone(),o.union(c))}}return o||n},e})(Zs);mt.prototype.type="group";var fT=(function(){function t(){this.cx=0,this.cy=0,this.r=0}return t})(),pl=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new fT},e.prototype.buildPath=function(r,n){r.moveTo(n.cx+n.r,n.cy),r.arc(n.cx,n.cy,n.r,0,Math.PI*2)},e})($e);pl.prototype.type="circle";var hT=(function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t})(),Cf=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new hT},e.prototype.buildPath=function(r,n){var a=.5522848,i=n.cx,o=n.cy,s=n.rx,l=n.ry,c=s*a,u=l*a;r.moveTo(i-s,o),r.bezierCurveTo(i-s,o-u,i-c,o-l,i,o-l),r.bezierCurveTo(i+c,o-l,i+s,o-u,i+s,o),r.bezierCurveTo(i+s,o+u,i+c,o+l,i,o+l),r.bezierCurveTo(i-c,o+l,i-s,o+u,i-s,o),r.closePath()},e})($e);Cf.prototype.type="ellipse";var Jg=Math.PI,Mf=Jg*2,la=Math.sin,ei=Math.cos,dT=Math.acos,bt=Math.atan2,em=Math.abs,uo=Math.sqrt,fo=Math.max,Or=Math.min,fr=1e-4;function pT(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=f*l-u*c;if(!(h*h<fr))return h=(u*(e-i)-f*(t-a))/h,[t+h*l,e+h*c]}function vl(t,e,r,n,a,i,o){var s=t-r,l=e-n,c=(o?i:-i)/uo(s*s+l*l),u=c*l,f=-c*s,h=t+u,d=e+f,p=r+u,m=n+f,g=(h+p)/2,v=(d+m)/2,y=p-h,b=m-d,x=y*y+b*b,S=a-i,w=h*m-p*d,k=(b<0?-1:1)*uo(fo(0,S*S*x-w*w)),T=(w*b-y*k)/x,C=(-w*y-b*k)/x,A=(w*b+y*k)/x,M=(-w*y+b*k)/x,I=T-g,L=C-v,P=A-g,N=M-v;return I*I+L*L>P*P+N*N&&(T=A,C=M),{cx:T,cy:C,x0:-u,y0:-f,x1:T*(a/S-1),y1:C*(a/S-1)}}function vT(t){var e;if(ee(t)){var r=t.length;if(!r)return t;r===1?e=[t[0],t[0],0,0]:r===2?e=[t[0],t[0],t[1],t[1]]:r===3?e=t.concat(t[2]):e=t}else e=[t,t,t,t];return e}function gT(t,e){var r,n=fo(e.r,0),a=fo(e.r0||0,0),i=n>0,o=a>0;if(!(!i&&!o)){if(i||(n=a,a=0),a>n){var s=n;n=a,a=s}var l=e.startAngle,c=e.endAngle;if(!(isNaN(l)||isNaN(c))){var u=e.cx,f=e.cy,h=!!e.clockwise,d=em(c-l),p=d>Mf&&d%Mf;if(p>fr&&(d=p),!(n>fr))t.moveTo(u,f);else if(d>Mf-fr)t.moveTo(u+n*ei(l),f+n*la(l)),t.arc(u,f,n,l,c,!h),a>fr&&(t.moveTo(u+a*ei(c),f+a*la(c)),t.arc(u,f,a,c,l,h));else{var m=void 0,g=void 0,v=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=void 0,C=void 0,A=void 0,M=void 0,I=void 0,L=void 0,P=void 0,N=n*ei(l),O=n*la(l),q=a*ei(c),R=a*la(c),z=d>fr;if(z){var F=e.cornerRadius;F&&(r=vT(F),m=r[0],g=r[1],v=r[2],y=r[3]);var X=em(n-a)/2;if(b=Or(X,v),x=Or(X,y),S=Or(X,m),w=Or(X,g),C=k=fo(b,x),A=T=fo(S,w),(k>fr||T>fr)&&(M=n*ei(c),I=n*la(c),L=a*ei(l),P=a*la(l),d<Jg)){var te=pT(N,O,L,P,M,I,q,R);if(te){var fe=N-te[0],me=O-te[1],we=M-te[0],Ze=I-te[1],Ie=1/la(dT((fe*we+me*Ze)/(uo(fe*fe+me*me)*uo(we*we+Ze*Ze)))/2),tt=uo(te[0]*te[0]+te[1]*te[1]);C=Or(k,(n-tt)/(Ie+1)),A=Or(T,(a-tt)/(Ie-1))}}}if(!z)t.moveTo(u+N,f+O);else if(C>fr){var Ge=Or(v,C),Me=Or(y,C),re=vl(L,P,N,O,n,Ge,h),he=vl(M,I,q,R,n,Me,h);t.moveTo(u+re.cx+re.x0,f+re.cy+re.y0),C<k&&Ge===Me?t.arc(u+re.cx,f+re.cy,C,bt(re.y0,re.x0),bt(he.y0,he.x0),!h):(Ge>0&&t.arc(u+re.cx,f+re.cy,Ge,bt(re.y0,re.x0),bt(re.y1,re.x1),!h),t.arc(u,f,n,bt(re.cy+re.y1,re.cx+re.x1),bt(he.cy+he.y1,he.cx+he.x1),!h),Me>0&&t.arc(u+he.cx,f+he.cy,Me,bt(he.y1,he.x1),bt(he.y0,he.x0),!h))}else t.moveTo(u+N,f+O),t.arc(u,f,n,l,c,!h);if(!(a>fr)||!z)t.lineTo(u+q,f+R);else if(A>fr){var Ge=Or(m,A),Me=Or(g,A),re=vl(q,R,M,I,a,-Me,h),he=vl(N,O,L,P,a,-Ge,h);t.lineTo(u+re.cx+re.x0,f+re.cy+re.y0),A<T&&Ge===Me?t.arc(u+re.cx,f+re.cy,A,bt(re.y0,re.x0),bt(he.y0,he.x0),!h):(Me>0&&t.arc(u+re.cx,f+re.cy,Me,bt(re.y0,re.x0),bt(re.y1,re.x1),!h),t.arc(u,f,a,bt(re.cy+re.y1,re.cx+re.x1),bt(he.cy+he.y1,he.cx+he.x1),h),Ge>0&&t.arc(u+he.cx,f+he.cy,Ge,bt(he.y1,he.x1),bt(he.y0,he.x0),!h))}else t.lineTo(u+q,f+R),t.arc(u,f,a,c,l,h)}t.closePath()}}}var mT=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0,this.cornerRadius=0}return t})(),ti=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new mT},e.prototype.buildPath=function(r,n){gT(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e})($e);ti.prototype.type="sector";var yT=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t})(),Af=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new yT},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.PI*2;r.moveTo(a+n.r,i),r.arc(a,i,n.r,0,o,!1),r.moveTo(a+n.r0,i),r.arc(a,i,n.r0,0,o,!0)},e})($e);Af.prototype.type="ring";function _T(t,e,r,n){var a=[],i=[],o=[],s=[],l,c,u,f;if(n){u=[1/0,1/0],f=[-1/0,-1/0];for(var h=0,d=t.length;h<d;h++)$a(u,u,t[h]),Wa(f,f,t[h]);$a(u,u,n[0]),Wa(f,f,n[1])}for(var h=0,d=t.length;h<d;h++){var p=t[h];if(r)l=t[h?h-1:d-1],c=t[(h+1)%d];else if(h===0||h===d-1){a.push(iS(t[h]));continue}else l=t[h-1],c=t[h+1];oS(i,c,l),Du(i,i,e);var m=Iu(p,l),g=Iu(p,c),v=m+g;v!==0&&(m/=v,g/=v),Du(o,i,-m),Du(s,i,g);var y=Tv([],p,o),b=Tv([],p,s);n&&(Wa(y,y,u),$a(y,y,f),Wa(b,b,u),$a(b,b,f)),a.push(y),a.push(b)}return r&&a.push(a.shift()),a}function tm(t,e,r){var n=e.smooth,a=e.points;if(a&&a.length>=2){if(n){var i=_T(a,n,r,e.smoothConstraint);t.moveTo(a[0][0],a[0][1]);for(var o=a.length,s=0;s<(r?o:o-1);s++){var l=i[s*2],c=i[s*2+1],u=a[(s+1)%o];t.bezierCurveTo(l[0],l[1],c[0],c[1],u[0],u[1])}}else{t.moveTo(a[0][0],a[0][1]);for(var s=1,f=a.length;s<f;s++)t.lineTo(a[s][0],a[s][1])}r&&t.closePath()}}var bT=(function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t})(),Df=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new bT},e.prototype.buildPath=function(r,n){tm(r,n,!0)},e})($e);Df.prototype.type="polygon";var xT=(function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t})(),If=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new xT},e.prototype.buildPath=function(r,n){tm(r,n,!1)},e})($e);If.prototype.type="polyline";var wT={},ST=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t})(),xn=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new ST},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=tg(wT,n,this.style);a=l.x1,i=l.y1,o=l.x2,s=l.y2}else a=n.x1,i=n.y1,o=n.x2,s=n.y2;var c=n.percent;c!==0&&(r.moveTo(a,i),c<1&&(o=a*(1-c)+o*c,s=i*(1-c)+s*c),r.lineTo(o,s))},e.prototype.pointAt=function(r){var n=this.shape;return[n.x1*(1-r)+n.x2*r,n.y1*(1-r)+n.y2*r]},e})($e);xn.prototype.type="line";var Ot=[],kT=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.cpx1=0,this.cpy1=0,this.percent=1}return t})();function rm(t,e,r){var n=t.cpx2,a=t.cpy2;return n!=null||a!=null?[(r?Lv:gt)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?Lv:gt)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?Rv:Lt)(t.x1,t.cpx1,t.x2,e),(r?Rv:Lt)(t.y1,t.cpy1,t.y2,e)]}var Lf=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new kT},e.prototype.buildPath=function(r,n){var a=n.x1,i=n.y1,o=n.x2,s=n.y2,l=n.cpx1,c=n.cpy1,u=n.cpx2,f=n.cpy2,h=n.percent;h!==0&&(r.moveTo(a,i),u==null||f==null?(h<1&&(Bs(a,l,o,h,Ot),l=Ot[1],o=Ot[2],Bs(i,c,s,h,Ot),c=Ot[1],s=Ot[2]),r.quadraticCurveTo(l,c,o,s)):(h<1&&(Ns(a,l,u,o,h,Ot),l=Ot[1],u=Ot[2],o=Ot[3],Ns(i,c,f,s,h,Ot),c=Ot[1],f=Ot[2],s=Ot[3]),r.bezierCurveTo(l,c,u,f,o,s)))},e.prototype.pointAt=function(r){return rm(this.shape,r,!1)},e.prototype.tangentAt=function(r){var n=rm(this.shape,r,!0);return cS(n,n)},e})($e);Lf.prototype.type="bezier-curve";var TT=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),gl=(function(t){Z(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new TT},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r,0),s=n.startAngle,l=n.endAngle,c=n.clockwise,u=Math.cos(s),f=Math.sin(s);r.moveTo(u*o+a,f*o+i),r.arc(a,i,o,s,l,!c)},e})($e);gl.prototype.type="arc";var CT=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="compound",r}return e.prototype._updatePathDirty=function(){for(var r=this.shape.paths,n=this.shapeChanged(),a=0;a<r.length;a++)n=n||r[a].shapeChanged();n&&this.dirtyShape()},e.prototype.beforeBrush=function(){this._updatePathDirty();for(var r=this.shape.paths||[],n=this.getGlobalScale(),a=0;a<r.length;a++)r[a].path||r[a].createPathProxy(),r[a].path.setScale(n[0],n[1],r[a].segmentIgnoreThreshold)},e.prototype.buildPath=function(r,n){for(var a=n.paths||[],i=0;i<a.length;i++)a[i].buildPath(r,a[i].shape,!0)},e.prototype.afterBrush=function(){for(var r=this.shape.paths||[],n=0;n<r.length;n++)r[n].pathUpdated()},e.prototype.getBoundingRect=function(){return this._updatePathDirty.call(this),$e.prototype.getBoundingRect.call(this)},e})($e),nm=(function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t})(),am=(function(t){Z(e,t);function e(r,n,a,i,o,s){var l=t.call(this,o)||this;return l.x=r??0,l.y=n??0,l.x2=a??1,l.y2=i??0,l.type="linear",l.global=s||!1,l}return e})(nm),MT=(function(t){Z(e,t);function e(r,n,a,i,o){var s=t.call(this,i)||this;return s.x=r??.5,s.y=n??.5,s.r=a??.5,s.type="radial",s.global=o||!1,s}return e})(nm),ca=[0,0],ua=[0,0],ml=new Ye,yl=new Ye,_l=(function(){function t(e,r){this._corners=[],this._axes=[],this._origin=[0,0];for(var n=0;n<4;n++)this._corners[n]=new Ye;for(var n=0;n<2;n++)this._axes[n]=new Ye;e&&this.fromBoundingRect(e,r)}return t.prototype.fromBoundingRect=function(e,r){var n=this._corners,a=this._axes,i=e.x,o=e.y,s=i+e.width,l=o+e.height;if(n[0].set(i,o),n[1].set(s,o),n[2].set(s,l),n[3].set(i,l),r)for(var c=0;c<4;c++)n[c].transform(r);Ye.sub(a[0],n[1],n[0]),Ye.sub(a[1],n[3],n[0]),a[0].normalize(),a[1].normalize();for(var c=0;c<2;c++)this._origin[c]=a[c].dot(n[0])},t.prototype.intersect=function(e,r){var n=!0,a=!r;return ml.set(1/0,1/0),yl.set(0,0),!this._intersectCheckOneSide(this,e,ml,yl,a,1)&&(n=!1,a)||!this._intersectCheckOneSide(e,this,ml,yl,a,-1)&&(n=!1,a)||a||Ye.copy(r,n?ml:yl),n},t.prototype._intersectCheckOneSide=function(e,r,n,a,i,o){for(var s=!0,l=0;l<2;l++){var c=this._axes[l];if(this._getProjMinMaxOnAxis(l,e._corners,ca),this._getProjMinMaxOnAxis(l,r._corners,ua),ca[1]<ua[0]||ca[0]>ua[1]){if(s=!1,i)return s;var u=Math.abs(ua[0]-ca[1]),f=Math.abs(ca[0]-ua[1]);Math.min(u,f)>a.len()&&(u<f?Ye.scale(a,c,-u*o):Ye.scale(a,c,f*o))}else if(n){var u=Math.abs(ua[0]-ca[1]),f=Math.abs(ca[0]-ua[1]);Math.min(u,f)<n.len()&&(u<f?Ye.scale(n,c,u*o):Ye.scale(n,c,-f*o))}}return s},t.prototype._getProjMinMaxOnAxis=function(e,r,n){for(var a=this._axes[e],i=this._origin,o=r[0].dot(a)+i[e],s=o,l=o,c=1;c<r.length;c++){var u=r[c].dot(a)+i[e];s=Math.min(u,s),l=Math.max(u,l)}n[0]=s,n[1]=l},t})(),AT=[],DT=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.notClear=!0,r.incremental=!0,r._displayables=[],r._temporaryDisplayables=[],r._cursor=0,r}return e.prototype.traverse=function(r,n){r.call(n,this)},e.prototype.useStyle=function(){this.style={}},e.prototype.getCursor=function(){return this._cursor},e.prototype.innerAfterBrush=function(){this._cursor=this._displayables.length},e.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.markRedraw(),this.notClear=!1},e.prototype.clearTemporalDisplayables=function(){this._temporaryDisplayables=[]},e.prototype.addDisplayable=function(r,n){n?this._temporaryDisplayables.push(r):this._displayables.push(r),this.markRedraw()},e.prototype.addDisplayables=function(r,n){n=n||!1;for(var a=0;a<r.length;a++)this.addDisplayable(r[a],n)},e.prototype.getDisplayables=function(){return this._displayables},e.prototype.getTemporalDisplayables=function(){return this._temporaryDisplayables},e.prototype.eachPendingDisplayable=function(r){for(var n=this._cursor;n<this._displayables.length;n++)r&&r(this._displayables[n]);for(var n=0;n<this._temporaryDisplayables.length;n++)r&&r(this._temporaryDisplayables[n])},e.prototype.update=function(){this.updateTransform();for(var r=this._cursor;r<this._displayables.length;r++){var n=this._displayables[r];n.parent=this,n.update(),n.parent=null}for(var r=0;r<this._temporaryDisplayables.length;r++){var n=this._temporaryDisplayables[r];n.parent=this,n.update(),n.parent=null}},e.prototype.getBoundingRect=function(){if(!this._rect){for(var r=new Fe(1/0,1/0,-1/0,-1/0),n=0;n<this._displayables.length;n++){var a=this._displayables[n],i=a.getBoundingRect().clone();a.needLocalTransform()&&i.applyTransform(a.getLocalTransform(AT)),r.union(i)}this._rect=r}return this._rect},e.prototype.contain=function(r,n){var a=this.transformCoordToLocal(r,n),i=this.getBoundingRect();if(i.contain(a[0],a[1]))for(var o=0;o<this._displayables.length;o++){var s=this._displayables[o];if(s.contain(r,n))return!0}return!1},e})(eo),IT=it();function LT(t,e,r,n,a){var i;if(e&&e.ecModel){var o=e.ecModel.getUpdatePayload();i=o&&o.animation}var s=e&&e.isAnimationEnabled(),l=t==="update";if(s){var c=void 0,u=void 0,f=void 0;n?(c=Ce(n.duration,200),u=Ce(n.easing,"cubicOut"),f=0):(c=e.getShallow(l?"animationDurationUpdate":"animationDuration"),u=e.getShallow(l?"animationEasingUpdate":"animationEasing"),f=e.getShallow(l?"animationDelayUpdate":"animationDelay")),i&&(i.duration!=null&&(c=i.duration),i.easing!=null&&(u=i.easing),i.delay!=null&&(f=i.delay)),ye(f)&&(f=f(r,a)),ye(c)&&(c=c(r));var h={duration:c||0,delay:f,easing:u};return h}else return null}function Pf(t,e,r,n,a,i,o){var s=!1,l;ye(a)?(o=i,i=a,a=null):ce(a)&&(i=a.cb,o=a.during,s=a.isFrom,l=a.removeOpt,a=a.dataIndex);var c=t==="leave";c||e.stopAnimation("leave");var u=LT(t,n,a,c?l||{}:null,n&&n.getAnimationDelayParams?n.getAnimationDelayParams(e,a):null);if(u&&u.duration>0){var f=u.duration,h=u.delay,d=u.easing,p={duration:f,delay:h||0,easing:d,done:i,force:!!i||!!o,setToFinal:!c,scope:t,during:o};s?e.animateFrom(r,p):e.animateTo(r,p)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),i&&i()}function Ut(t,e,r,n,a,i){Pf("update",t,e,r,n,a,i)}function Qr(t,e,r,n,a,i){Pf("enter",t,e,r,n,a,i)}function ho(t){if(!t.__zr)return!0;for(var e=0;e<t.animators.length;e++){var r=t.animators[e];if(r.scope==="leave")return!0}return!1}function bl(t,e,r,n,a,i){ho(t)||Pf("leave",t,e,r,n,a,i)}function im(t,e,r,n){t.removeTextContent(),t.removeTextGuideLine(),bl(t,{style:{opacity:0}},e,r,n)}function Rf(t,e,r){function n(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(a){a.isGroup||im(a,e,r,n)}):im(t,e,r,n)}function om(t){IT(t).oldStyle=t.style}var xl=Math.max,wl=Math.min,Ef={};function PT(t){return $e.extend(t)}var RT=cT;function ET(t,e){return RT(t,e)}function hr(t,e){Ef[t]=e}function OT(t){if(Ef.hasOwnProperty(t))return Ef[t]}function Of(t,e,r,n){var a=lT(t,e);return r&&(n==="center"&&(r=lm(r,a.getBoundingRect())),cm(a,r)),a}function sm(t,e,r){var n=new bn({style:{image:t,x:e.x,y:e.y,width:e.width,height:e.height},onload:function(a){if(r==="center"){var i={width:a.width,height:a.height};n.setStyle(lm(e,i))}}});return n}function lm(t,e){var r=e.width/e.height,n=t.height*r,a;n<=t.width?a=t.height:(n=t.width,a=n/r);var i=t.x+t.width/2,o=t.y+t.height/2;return{x:i-n/2,y:o-a/2,width:n,height:a}}var NT=uT;function cm(t,e){if(t.applyTransform){var r=t.getBoundingRect(),n=r.calculateTransform(e);t.applyTransform(n)}}function po(t,e){return tg(t,t,{lineWidth:e}),t}function BT(t){return rg(t.shape,t.shape,t.style),t}var zT=aa;function FT(t,e){for(var r=xu([]);t&&t!==e;)Fa(r,t.getLocalTransform(),r),t=t.parent;return r}function Nf(t,e,r){return e&&!Dt(e)&&(e=Ru.getLocalTransform(e)),r&&(e=ku([],e)),jt([],t,e)}function HT(t,e,r){var n=e[4]===0||e[5]===0||e[0]===0?1:Math.abs(2*e[4]/e[0]),a=e[4]===0||e[5]===0||e[2]===0?1:Math.abs(2*e[4]/e[2]),i=[t==="left"?-n:t==="right"?n:0,t==="top"?-a:t==="bottom"?a:0];return i=Nf(i,e,r),Math.abs(i[0])>Math.abs(i[1])?i[0]>0?"right":"left":i[1]>0?"bottom":"top"}function um(t){return!t.isGroup}function VT(t){return t.shape!=null}function fm(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){um(l)&&l.anid&&(s[l.anid]=l)}),s}function a(o){var s={x:o.x,y:o.y,rotation:o.rotation};return VT(o)&&(s.shape=U({},o.shape)),s}var i=n(t);e.traverse(function(o){if(um(o)&&o.anid){var s=i[o.anid];if(s){var l=a(o);o.attr(a(s)),Ut(o,l,r,Ve(o).dataIndex)}}})}function GT(t,e){return ue(t,function(r){var n=r[0];n=xl(n,e.x),n=wl(n,e.x+e.width);var a=r[1];return a=xl(a,e.y),a=wl(a,e.y+e.height),[n,a]})}function $T(t,e){var r=xl(t.x,e.x),n=wl(t.x+t.width,e.x+e.width),a=xl(t.y,e.y),i=wl(t.y+t.height,e.y+e.height);if(n>=r&&i>=a)return{x:r,y:a,width:n-r,height:i-a}}function Bf(t,e,r){var n=U({rectHover:!0},e),a=n.style={strokeNoScale:!0};if(r=r||{x:-1,y:-1,width:2,height:2},t)return t.indexOf("image://")===0?(a.image=t.slice(8),Ne(a,r),new bn(n)):Of(t.replace("path://",""),n,r,"center")}function WT(t,e,r,n,a){for(var i=0,o=a[a.length-1];i<a.length;i++){var s=a[i];if(hm(t,e,r,n,s[0],s[1],o[0],o[1]))return!0;o=s}}function hm(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,h=zf(u,f,l,c);if(UT(h))return!1;var d=t-a,p=e-i,m=zf(d,p,l,c)/h;if(m<0||m>1)return!1;var g=zf(d,p,u,f)/h;return!(g<0||g>1)}function zf(t,e,r,n){return t*n-r*e}function UT(t){return t<=1e-6&&t>=-1e-6}function Sl(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,a=ne(e)?{formatter:e}:e,i=r.mainType,o=r.componentIndex,s={componentType:i,name:n,$vars:["name"]};s[i+"Index"]=o;var l=t.formatterParamsExtra;l&&D(Qe(l),function(u){Vn(s,u)||(s[u]=l[u],s.$vars.push(u))});var c=Ve(t.el);c.componentMainType=i,c.componentIndex=o,c.tooltipConfig={name:n,option:Ne({content:n,encodeHTMLContent:!0,formatterParams:s},a)}}function dm(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function kl(t,e){if(t)if(ee(t))for(var r=0;r<t.length;r++)dm(t[r],e);else dm(t,e)}hr("circle",pl),hr("ellipse",Cf),hr("sector",ti),hr("ring",Af),hr("polygon",Df),hr("polyline",If),hr("rect",ft),hr("line",xn),hr("bezierCurve",Lf),hr("arc",gl);const YT=Object.freeze(Object.defineProperty({__proto__:null,Arc:gl,BezierCurve:Lf,BoundingRect:Fe,Circle:pl,CompoundPath:CT,Ellipse:Cf,Group:mt,Image:bn,IncrementalDisplayable:DT,Line:xn,LinearGradient:am,OrientedBoundingRect:_l,Path:$e,Point:Ye,Polygon:Df,Polyline:If,RadialGradient:MT,Rect:ft,Ring:Af,Sector:ti,Text:Pt,applyTransform:Nf,clipPointsByRect:GT,clipRectByRect:$T,createIcon:Bf,extendPath:ET,extendShape:PT,getShapeClass:OT,getTransform:FT,groupTransition:fm,initProps:Qr,isElementRemoved:ho,lineLineIntersect:hm,linePolygonIntersect:WT,makeImage:sm,makePath:Of,mergePath:NT,registerShape:hr,removeElement:bl,removeElementWithFadeOut:Rf,resizePath:cm,setTooltipConfig:Sl,subPixelOptimize:zT,subPixelOptimizeLine:po,subPixelOptimizeRect:BT,transformDirection:HT,traverseElements:kl,updateProps:Ut},Symbol.toStringTag,{value:"Module"}));var Tl={};function qT(t,e){for(var r=0;r<Er.length;r++){var n=Er[r],a=e[n],i=t.ensureState(n);i.style=i.style||{},i.style.text=a}var o=t.currentStates.slice();t.clearStates(!0),t.setStyle({text:e.normal}),t.useStates(o,!0)}function pm(t,e,r){var n=t.labelFetcher,a=t.labelDataIndex,i=t.labelDimIndex,o=e.normal,s;n&&(s=n.getFormattedLabel(a,"normal",null,i,o&&o.get("formatter"),r!=null?{interpolatedValue:r}:null)),s==null&&(s=ye(t.defaultText)?t.defaultText(a,t,r):t.defaultText);for(var l={normal:s},c=0;c<Er.length;c++){var u=Er[c],f=e[u];l[u]=Ce(n?n.getFormattedLabel(a,u,null,i,f&&f.get("formatter")):null,s)}return l}function Cl(t,e,r,n){r=r||Tl;for(var a=t instanceof Pt,i=!1,o=0;o<Dg.length;o++){var s=e[Dg[o]];if(s&&s.getShallow("show")){i=!0;break}}var l=a?t:t.getTextContent();if(i){a||(l||(l=new Pt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var c=pm(r,e),u=e.normal,f=!!u.getShallow("show"),h=ri(u,n&&n.normal,r,!1,!a);h.text=c.normal,a||t.setTextConfig(vm(u,r,!1));for(var o=0;o<Er.length;o++){var d=Er[o],s=e[d];if(s){var p=l.ensureState(d),m=!!Ce(s.getShallow("show"),f);if(m!==f&&(p.ignore=!m),p.style=ri(s,n&&n[d],r,!0,!a),p.style.text=c[d],!a){var g=t.ensureState(d);g.textConfig=vm(s,r,!0)}}}l.silent=!!u.getShallow("silent"),l.style.x!=null&&(h.x=l.style.x),l.style.y!=null&&(h.y=l.style.y),l.ignore=!f,l.useStyle(h),l.dirty(),r.enableTextSetter&&(Al(l).setLabelText=function(v){var y=pm(r,e,v);qT(l,y)})}else l&&(l.ignore=!0);t.dirty()}function Ml(t,e){e=e||"label";for(var r={normal:t.getModel(e)},n=0;n<Er.length;n++){var a=Er[n];r[a]=t.getModel([a,e])}return r}function ri(t,e,r,n,a){var i={};return XT(i,t,r,n,a),e&&U(i,e),i}function vm(t,e,r){e=e||{};var n={},a,i=t.getShallow("rotate"),o=Ce(t.getShallow("distance"),r?null:5),s=t.getShallow("offset");return a=t.getShallow("position")||(r?null:"inside"),a==="outside"&&(a=e.defaultOutsidePosition||"top"),a!=null&&(n.position=a),s!=null&&(n.offset=s),i!=null&&(i*=Math.PI/180,n.rotation=i),o!=null&&(n.distance=o),n.outsideFill=t.get("color")==="inherit"?e.inheritColor||null:"auto",n}function XT(t,e,r,n,a){r=r||Tl;var i=e.ecModel,o=i&&i.option.textStyle,s=ZT(e),l;if(s){l={};for(var c in s)if(s.hasOwnProperty(c)){var u=e.getModel(["rich",c]);_m(l[c]={},u,o,r,n,a,!1,!0)}}l&&(t.rich=l);var f=e.get("overflow");f&&(t.overflow=f);var h=e.get("minMargin");h!=null&&(t.margin=h),_m(t,e,o,r,n,a,!0,!1)}function ZT(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||Tl).rich;if(r){e=e||{};for(var n=Qe(r),a=0;a<n.length;a++){var i=n[a];e[i]=1}}t=t.parentModel}return e}var gm=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],mm=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],ym=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function _m(t,e,r,n,a,i,o,s){r=!a&&r||Tl;var l=n&&n.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),f=Ce(e.getShallow("opacity"),r.opacity);(c==="inherit"||c==="auto")&&(l?c=l:c=null),(u==="inherit"||u==="auto")&&(l?u=l:u=null),i||(c=c||r.color,u=u||r.textBorderColor),c!=null&&(t.fill=c),u!=null&&(t.stroke=u);var h=Ce(e.getShallow("textBorderWidth"),r.textBorderWidth);h!=null&&(t.lineWidth=h);var d=Ce(e.getShallow("textBorderType"),r.textBorderType);d!=null&&(t.lineDash=d);var p=Ce(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);p!=null&&(t.lineDashOffset=p),!a&&f==null&&!s&&(f=n&&n.defaultOpacity),f!=null&&(t.opacity=f),!a&&!i&&t.fill==null&&n.inheritColor&&(t.fill=n.inheritColor);for(var m=0;m<gm.length;m++){var g=gm[m],v=Ce(e.getShallow(g),r[g]);v!=null&&(t[g]=v)}for(var m=0;m<mm.length;m++){var g=mm[m],v=e.getShallow(g);v!=null&&(t[g]=v)}if(t.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(t.verticalAlign=y)}if(!o||!n.disableBox){for(var m=0;m<ym.length;m++){var g=ym[m],v=e.getShallow(g);v!=null&&(t[g]=v)}var b=e.getShallow("borderType");b!=null&&(t.borderDash=b),(t.backgroundColor==="auto"||t.backgroundColor==="inherit")&&l&&(t.backgroundColor=l),(t.borderColor==="auto"||t.borderColor==="inherit")&&l&&(t.borderColor=l)}}function KT(t,e){var r=e&&e.getModel("textStyle");return Mr([t.fontStyle||r&&r.getShallow("fontStyle")||"",t.fontWeight||r&&r.getShallow("fontWeight")||"",(t.fontSize||r&&r.getShallow("fontSize")||12)+"px",t.fontFamily||r&&r.getShallow("fontFamily")||"sans-serif"].join(" "))}var Al=it();function jT(t,e,r,n){if(t){var a=Al(t);a.prevValue=a.value,a.value=r;var i=e.normal;a.valueAnimation=i.get("valueAnimation"),a.valueAnimation&&(a.precision=i.get("precision"),a.defaultInterpolatedText=n,a.statesModels=e)}}var QT=["textStyle","color"],Ff=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Hf=new Pt,JT=(function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(QT):null)},t.prototype.getFont=function(){return KT({fontStyle:this.getShallow("fontStyle"),fontWeight:this.getShallow("fontWeight"),fontSize:this.getShallow("fontSize"),fontFamily:this.getShallow("fontFamily")},this.ecModel)},t.prototype.getTextRect=function(e){for(var r={text:e,verticalAlign:this.getShallow("verticalAlign")||this.getShallow("baseline")},n=0;n<Ff.length;n++)r[Ff[n]]=this.getShallow(Ff[n]);return Hf.useStyle(r),Hf.update(),Hf.getBoundingRect()},t})(),bm=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],e2=$i(bm),t2=(function(){function t(){}return t.prototype.getLineStyle=function(e){return e2(this,e)},t})(),xm=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],r2=$i(xm),n2=(function(){function t(){}return t.prototype.getItemStyle=function(e,r){return r2(this,e,r)},t})(),et=(function(){function t(e,r,n){this.parentModel=r,this.ecModel=n,this.option=e}return t.prototype.init=function(e,r,n){},t.prototype.mergeOption=function(e,r){De(this.option,e,!0)},t.prototype.get=function(e,r){return e==null?this.option:this._doGet(this.parsePath(e),!r&&this.parentModel)},t.prototype.getShallow=function(e,r){var n=this.option,a=n==null?n:n[e];if(a==null&&!r){var i=this.parentModel;i&&(a=i.getShallow(e))}return a},t.prototype.getModel=function(e,r){var n=e!=null,a=n?this.parsePath(e):null,i=n?this._doGet(a):this.option;return r=r||this.parentModel&&this.parentModel.getModel(this.resolveParentPath(a)),new t(i,r,this.ecModel)},t.prototype.isEmpty=function(){return this.option==null},t.prototype.restoreData=function(){},t.prototype.clone=function(){var e=this.constructor;return new e(Te(this.option))},t.prototype.parsePath=function(e){return typeof e=="string"?e.split("."):e},t.prototype.resolveParentPath=function(e){return e},t.prototype.isAnimationEnabled=function(){if(!ge.node&&this.option){if(this.option.animation!=null)return!!this.option.animation;if(this.parentModel)return this.parentModel.isAnimationEnabled()}},t.prototype._doGet=function(e,r){var n=this.option;if(!e)return n;for(var a=0;a<e.length&&!(e[a]&&(n=n&&typeof n=="object"?n[e[a]]:null,n==null));a++);return n==null&&r&&(n=r._doGet(this.resolveParentPath(e),r.parentModel)),n},t})();_u(et),Hw(et),Cr(et,t2),Cr(et,n2),Cr(et,Uw),Cr(et,JT);function vo(t){return t==null?0:t.length||1}function wm(t){return t}var a2=(function(){function t(e,r,n,a,i,o){this._old=e,this._new=r,this._oldKeyGetter=n||wm,this._newKeyGetter=a||wm,this.context=i,this._diffModeMultiple=o==="multiple"}return t.prototype.add=function(e){return this._add=e,this},t.prototype.update=function(e){return this._update=e,this},t.prototype.updateManyToOne=function(e){return this._updateManyToOne=e,this},t.prototype.updateOneToMany=function(e){return this._updateOneToMany=e,this},t.prototype.updateManyToMany=function(e){return this._updateManyToMany=e,this},t.prototype.remove=function(e){return this._remove=e,this},t.prototype.execute=function(){this[this._diffModeMultiple?"_executeMultiple":"_executeOneToOne"]()},t.prototype._executeOneToOne=function(){var e=this._old,r=this._new,n={},a=new Array(e.length),i=new Array(r.length);this._initIndexMap(e,null,a,"_oldKeyGetter"),this._initIndexMap(r,n,i,"_newKeyGetter");for(var o=0;o<e.length;o++){var s=a[o],l=n[s],c=vo(l);if(c>1){var u=l.shift();l.length===1&&(n[s]=l[0]),this._update&&this._update(u,o)}else c===1?(n[s]=null,this._update&&this._update(l,o)):this._remove&&this._remove(o)}this._performRestAdd(i,n)},t.prototype._executeMultiple=function(){var e=this._old,r=this._new,n={},a={},i=[],o=[];this._initIndexMap(e,n,i,"_oldKeyGetter"),this._initIndexMap(r,a,o,"_newKeyGetter");for(var s=0;s<i.length;s++){var l=i[s],c=n[l],u=a[l],f=vo(c),h=vo(u);if(f>1&&h===1)this._updateManyToOne&&this._updateManyToOne(u,c),a[l]=null;else if(f===1&&h>1)this._updateOneToMany&&this._updateOneToMany(u,c),a[l]=null;else if(f===1&&h===1)this._update&&this._update(u,c),a[l]=null;else if(f>1&&h>1)this._updateManyToMany&&this._updateManyToMany(u,c),a[l]=null;else if(f>1)for(var d=0;d<f;d++)this._remove&&this._remove(c[d]);else this._remove&&this._remove(c)}this._performRestAdd(o,a)},t.prototype._performRestAdd=function(e,r){for(var n=0;n<e.length;n++){var a=e[n],i=r[a],o=vo(i);if(o>1)for(var s=0;s<o;s++)this._add&&this._add(i[s]);else o===1&&this._add&&this._add(i);r[a]=null}},t.prototype._initIndexMap=function(e,r,n,a){for(var i=this._diffModeMultiple,o=0;o<e.length;o++){var s="_ec_"+this[a](e[o],o);if(i||(n[o]=s),!!r){var l=r[s],c=vo(l);c===0?(r[s]=o,i&&n.push(s)):c===1?r[s]=[l,o]:l.push(o)}}},t})(),Sm=de(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),nr="original",Nt="arrayRows",Nr="objectRows",Jr="keyedColumns",wn="typedArray",km="unknown",en="column",ni="row",Yt={Must:1,Might:2,Not:3},Tm=it();function i2(t){Tm(t).datasetMap=de()}function o2(t,e,r){var n={},a=Cm(e);if(!a||!t)return n;var i=[],o=[],s=e.ecModel,l=Tm(s).datasetMap,c=a.uid+"_"+r.seriesLayoutBy,u,f;t=t.slice(),D(t,function(m,g){var v=ce(m)?m:t[g]={name:m};v.type==="ordinal"&&u==null&&(u=g,f=p(v)),n[v.name]=[]});var h=l.get(c)||l.set(c,{categoryWayDim:f,valueWayDim:0});D(t,function(m,g){var v=m.name,y=p(m);if(u==null){var b=h.valueWayDim;d(n[v],b,y),d(o,b,y),h.valueWayDim+=y}else if(u===g)d(n[v],0,y),d(i,0,y);else{var b=h.categoryWayDim;d(n[v],b,y),d(o,b,y),h.categoryWayDim+=y}});function d(m,g,v){for(var y=0;y<v;y++)m.push(g+y)}function p(m){var g=m.dimsDef;return g?g.length:1}return i.length&&(n.itemName=i),o.length&&(n.seriesName=o),n}function Cm(t){var e=t.get("data",!0);if(!e)return oo(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},Et).models[0]}function s2(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:oo(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},Et).models}function Mm(t,e){return l2(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function l2(t,e,r,n,a,i){var o,s=5;if(It(t))return Yt.Not;var l,c;if(n){var u=n[i];ce(u)?(l=u.name,c=u.type):ne(u)&&(l=u)}if(c!=null)return c==="ordinal"?Yt.Must:Yt.Not;if(e===Nt){var f=t;if(r===ni){for(var h=f[i],d=0;d<(h||[]).length&&d<s;d++)if((o=x(h[a+d]))!=null)return o}else for(var d=0;d<f.length&&d<s;d++){var p=f[a+d];if(p&&(o=x(p[i]))!=null)return o}}else if(e===Nr){var m=t;if(!l)return Yt.Not;for(var d=0;d<m.length&&d<s;d++){var g=m[d];if(g&&(o=x(g[l]))!=null)return o}}else if(e===Jr){var v=t;if(!l)return Yt.Not;var h=v[l];if(!h||It(h))return Yt.Not;for(var d=0;d<h.length&&d<s;d++)if((o=x(h[d]))!=null)return o}else if(e===nr)for(var y=t,d=0;d<y.length&&d<s;d++){var g=y[d],b=no(g);if(!ee(b))return Yt.Not;if((o=x(b[i]))!=null)return o}function x(S){var w=ne(S);if(S!=null&&Number.isFinite(Number(S))&&S!=="")return w?Yt.Might:Yt.Not;if(w&&S!=="-")return Yt.Must}return Yt.Not}var Dl=(function(){function t(e){this.data=e.data||(e.sourceFormat===Jr?{}:[]),this.sourceFormat=e.sourceFormat||km,this.seriesLayoutBy=e.seriesLayoutBy||en,this.startIndex=e.startIndex||0,this.dimensionsDetectedCount=e.dimensionsDetectedCount,this.metaRawOption=e.metaRawOption;var r=this.dimensionsDefine=e.dimensionsDefine;if(r)for(var n=0;n<r.length;n++){var a=r[n];a.type==null&&Mm(this,n)===Yt.Must&&(a.type="ordinal")}}return t})();function Vf(t){return t instanceof Dl}function Gf(t,e,r){r=r||Dm(t);var n=e.seriesLayoutBy,a=u2(t,r,n,e.sourceHeader,e.dimensions),i=new Dl({data:t,sourceFormat:r,seriesLayoutBy:n,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,metaRawOption:Te(e)});return i}function Am(t){return new Dl({data:t,sourceFormat:It(t)?wn:nr})}function c2(t){return new Dl({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:Te(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function Dm(t){var e=km;if(It(t))e=wn;else if(ee(t)){t.length===0&&(e=Nt);for(var r=0,n=t.length;r<n;r++){var a=t[r];if(a!=null){if(ee(a)||It(a)){e=Nt;break}else if(ce(a)){e=Nr;break}}}}else if(ce(t)){for(var i in t)if(Vn(t,i)&&Dt(t[i])){e=Jr;break}}return e}function u2(t,e,r,n,a){var i,o;if(!t)return{dimensionsDefine:Im(a),startIndex:o,dimensionsDetectedCount:i};if(e===Nt){var s=t;n==="auto"||n==null?Lm(function(c){c!=null&&c!=="-"&&(ne(c)?o==null&&(o=1):o=0)},r,s,10):o=Ke(n)?n:n?1:0,!a&&o===1&&(a=[],Lm(function(c,u){a[u]=c!=null?c+"":""},r,s,1/0)),i=a?a.length:r===ni?s.length:s[0]?s[0].length:null}else if(e===Nr)a||(a=f2(t));else if(e===Jr)a||(a=[],D(t,function(c,u){a.push(u)}));else if(e===nr){var l=no(t[0]);i=ee(l)&&l.length||1}return{startIndex:o,dimensionsDefine:Im(a),dimensionsDetectedCount:i}}function f2(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return Qe(r)}function Im(t){if(t){var e=de();return ue(t,function(r,n){r=ce(r)?r:{name:r};var a={name:r.name,displayName:r.displayName,type:r.type};if(a.name==null)return a;a.name+="",a.displayName==null&&(a.displayName=a.name);var i=e.get(a.name);return i?a.name+="-"+i.count++:e.set(a.name,{count:1}),a})}}function Lm(t,e,r,n){if(e===ni)for(var a=0;a<r.length&&a<n;a++)t(r[a]?r[a][0]:null,a);else for(var i=r[0]||[],a=0;a<i.length&&a<n;a++)t(i[a],a)}function Pm(t){var e=t.sourceFormat;return e===Nr||e===Jr}var fa,ha,da,Rm,Em,Om=(function(){function t(e,r){var n=Vf(e)?e:Am(e);this._source=n;var a=this._data=n.data;n.sourceFormat===wn&&(this._offset=0,this._dimSize=r,this._data=a),Em(this,a,n)}return t.prototype.getSource=function(){return this._source},t.prototype.count=function(){return 0},t.prototype.getItem=function(e,r){},t.prototype.appendData=function(e){},t.prototype.clean=function(){},t.protoInitialize=(function(){var e=t.prototype;e.pure=!1,e.persistent=!0})(),t.internalField=(function(){var e;Em=function(o,s,l){var c=l.sourceFormat,u=l.seriesLayoutBy,f=l.startIndex,h=l.dimensionsDefine,d=Rm[Wf(c,u)];if(U(o,d),c===wn)o.getItem=r,o.count=a,o.fillStorage=n;else{var p=Bm(c,u);o.getItem=Le(p,null,s,f,h);var m=Fm(c,u);o.count=Le(m,null,s,f,h)}};var r=function(o,s){o=o-this._offset,s=s||[];for(var l=this._data,c=this._dimSize,u=c*o,f=0;f<c;f++)s[f]=l[u+f];return s},n=function(o,s,l,c){for(var u=this._data,f=this._dimSize,h=0;h<f;h++){for(var d=c[h],p=d[0]==null?1/0:d[0],m=d[1]==null?-1/0:d[1],g=s-o,v=l[h],y=0;y<g;y++){var b=u[y*f+h];v[o+y]=b,b<p&&(p=b),b>m&&(m=b)}d[0]=p,d[1]=m}},a=function(){return this._data?this._data.length/this._dimSize:0};Rm=(e={},e[Nt+"_"+en]={pure:!0,appendData:i},e[Nt+"_"+ni]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Nr]={pure:!0,appendData:i},e[Jr]={pure:!0,appendData:function(o){var s=this._data;D(o,function(l,c){for(var u=s[c]||(s[c]=[]),f=0;f<(l||[]).length;f++)u.push(l[f])})}},e[nr]={appendData:i},e[wn]={persistent:!1,pure:!0,appendData:function(o){this._data=o},clean:function(){this._offset+=this.count(),this._data=null}},e);function i(o){for(var s=0;s<o.length;s++)this._data.push(o[s])}})(),t})(),Nm=function(t,e,r,n){return t[n]},h2=(fa={},fa[Nt+"_"+en]=function(t,e,r,n){return t[n+e]},fa[Nt+"_"+ni]=function(t,e,r,n,a){n+=e;for(var i=a||[],o=t,s=0;s<o.length;s++){var l=o[s];i[s]=l?l[n]:null}return i},fa[Nr]=Nm,fa[Jr]=function(t,e,r,n,a){for(var i=a||[],o=0;o<r.length;o++){var s=r[o].name,l=t[s];i[o]=l?l[n]:null}return i},fa[nr]=Nm,fa);function Bm(t,e){var r=h2[Wf(t,e)];return r}var zm=function(t,e,r){return t.length},d2=(ha={},ha[Nt+"_"+en]=function(t,e,r){return Math.max(0,t.length-e)},ha[Nt+"_"+ni]=function(t,e,r){var n=t[0];return n?Math.max(0,n.length-e):0},ha[Nr]=zm,ha[Jr]=function(t,e,r){var n=r[0].name,a=t[n];return a?a.length:0},ha[nr]=zm,ha);function Fm(t,e){var r=d2[Wf(t,e)];return r}var $f=function(t,e,r){return t[e]},p2=(da={},da[Nt]=$f,da[Nr]=function(t,e,r){return t[r]},da[Jr]=$f,da[nr]=function(t,e,r){var n=no(t);return n instanceof Array?n[e]:n},da[wn]=$f,da);function Hm(t){var e=p2[t];return e}function Wf(t,e){return t===Nt?t+"_"+e:t}function ai(t,e,r){if(t){var n=t.getRawDataItem(e);if(n!=null){var a=t.getStore(),i=a.getSource().sourceFormat;if(r!=null){var o=t.getDimensionIndex(r),s=a.getDimensionProperty(o);return Hm(i)(n,o,s)}else{var l=n;return i===nr&&(l=no(n)),l}}}}var v2=(function(){function t(e,r){this._encode=e,this._schema=r}return t.prototype.get=function(){return{fullDimensions:this._getFullDimensionNames(),encode:this._encode}},t.prototype._getFullDimensionNames=function(){return this._cachedDimNames||(this._cachedDimNames=this._schema?this._schema.makeOutputDimensionNames():[]),this._cachedDimNames},t})();function g2(t,e){var r={},n=r.encode={},a=de(),i=[],o=[],s={};D(t.dimensions,function(h){var d=t.getDimensionInfo(h),p=d.coordDim;if(p){var m=d.coordDimIndex;Uf(n,p)[m]=h,d.isExtraCoord||(a.set(p,1),y2(d.type)&&(i[0]=h),Uf(s,p)[m]=t.getDimensionIndex(d.name)),d.defaultTooltip&&o.push(h)}Sm.each(function(g,v){var y=Uf(n,v),b=d.otherDims[v];b!=null&&b!==!1&&(y[b]=d.name)})});var l=[],c={};a.each(function(h,d){var p=n[d];c[d]=p[0],l=l.concat(p)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=ue(l,function(h){return t.getDimensionInfo(h).storeDimIndex}),r.encodeFirstDimNotExtra=c;var u=n.label;u&&u.length&&(i=u.slice());var f=n.tooltip;return f&&f.length?o=f.slice():o.length||(o=i.slice()),n.defaultedLabel=i,n.defaultedTooltip=o,r.userOutput=new v2(s,e),r}function Uf(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function m2(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function y2(t){return!(t==="ordinal"||t==="time")}var Il=(function(){function t(e){this.otherDims={},e!=null&&U(this,e)}return t})();function Ll(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!Ke(t)&&t!=null&&t!=="-"&&(t=+Kr(t)),t==null||t===""?NaN:Number(t))}de({number:function(t){return parseFloat(t)},time:function(t){return+Kr(t)},trim:function(t){return ne(t)?Mr(t):t}});var _2=(function(){function t(e,r){var n=e==="desc";this._resultLT=n?1:-1,r==null&&(r=n?"min":"max"),this._incomparable=r==="min"?-1/0:1/0}return t.prototype.evaluate=function(e,r){var n=Ke(e)?e:nl(e),a=Ke(r)?r:nl(r),i=isNaN(n),o=isNaN(a);if(i&&(n=this._incomparable),o&&(a=this._incomparable),i&&o){var s=ne(e),l=ne(r);s&&(n=l?e:0),l&&(a=s?r:0)}return n<a?this._resultLT:n>a?-this._resultLT:0},t})(),Pl="undefined",b2=typeof Uint32Array===Pl?Array:Uint32Array,x2=typeof Uint16Array===Pl?Array:Uint16Array,Vm=typeof Int32Array===Pl?Array:Int32Array,Gm=typeof Float64Array===Pl?Array:Float64Array,$m={float:Gm,int:Vm,ordinal:Array,number:Array,time:Gm},Yf;function ii(t){return t>65535?b2:x2}function oi(){return[1/0,-1/0]}function w2(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Wm(t,e,r,n,a){var i=$m[r||"float"];if(a){var o=t[e],s=o&&o.length;if(s!==n){for(var l=new i(n),c=0;c<s;c++)l[c]=o[c];t[e]=l}}else t[e]=new i(n)}var qf=(function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=de()}return t.prototype.initData=function(e,r,n){this._provider=e,this._chunks=[],this._indices=null,this.getRawIndex=this._getRawIdxIdentity;var a=e.getSource(),i=this.defaultDimValueGetter=Yf[a.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],Pm(a),this._dimensions=ue(r,function(o){return{type:o.type,property:o.property}}),this._initDataFromProvider(0,e.count())},t.prototype.getProvider=function(){return this._provider},t.prototype.getSource=function(){return this._provider.getSource()},t.prototype.ensureCalculationDimension=function(e,r){var n=this._calcDimNameToIdx,a=this._dimensions,i=n.get(e);if(i!=null){if(a[i].type===r)return i}else i=a.length;return a[i]={type:r},n.set(e,i),this._chunks[i]=new $m[r||"float"](this._rawCount),this._rawExtent[i]=oi(),i},t.prototype.collectOrdinalMeta=function(e,r){var n=this._chunks[e],a=this._dimensions[e],i=this._rawExtent,o=a.ordinalOffset||0,s=n.length;o===0&&(i[e]=oi());for(var l=i[e],c=o;c<s;c++){var u=n[c]=r.parseAndCollect(n[c]);isNaN(u)||(l[0]=Math.min(u,l[0]),l[1]=Math.max(u,l[1]))}a.ordinalMeta=r,a.ordinalOffset=s,a.type="ordinal"},t.prototype.getOrdinalMeta=function(e){var r=this._dimensions[e],n=r.ordinalMeta;return n},t.prototype.getDimensionProperty=function(e){var r=this._dimensions[e];return r&&r.property},t.prototype.appendData=function(e){var r=this._provider,n=this.count();r.appendData(e);var a=r.count();return r.persistent||(a+=n),n<a&&this._initDataFromProvider(n,a,!0),[n,a]},t.prototype.appendValues=function(e,r){for(var n=this._chunks,a=this._dimensions,i=a.length,o=this._rawExtent,s=this.count(),l=s+Math.max(e.length,r||0),c=0;c<i;c++){var u=a[c];Wm(n,c,u.type,l,!0)}for(var f=[],h=s;h<l;h++)for(var d=h-s,p=0;p<i;p++){var u=a[p],m=Yf.arrayRows.call(this,e[d]||f,u.property,d,p);n[p][h]=m;var g=o[p];m<g[0]&&(g[0]=m),m>g[1]&&(g[1]=m)}return this._rawCount=this._count=l,{start:s,end:l}},t.prototype._initDataFromProvider=function(e,r,n){for(var a=this._provider,i=this._chunks,o=this._dimensions,s=o.length,l=this._rawExtent,c=ue(o,function(y){return y.property}),u=0;u<s;u++){var f=o[u];l[u]||(l[u]=oi()),Wm(i,u,f.type,r,n)}if(a.fillStorage)a.fillStorage(e,r,i,l);else for(var h=[],d=e;d<r;d++){h=a.getItem(d,h);for(var p=0;p<s;p++){var m=i[p],g=this._dimValueGetter(h,c[p],d,p);m[d]=g;var v=l[p];g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}}!a.persistent&&a.clean&&a.clean(),this._rawCount=this._count=r,this._extent=[]},t.prototype.count=function(){return this._count},t.prototype.get=function(e,r){if(!(r>=0&&r<this._count))return NaN;var n=this._chunks[e];return n?n[this.getRawIndex(r)]:NaN},t.prototype.getValues=function(e,r){var n=[],a=[];if(r==null){r=e,e=[];for(var i=0;i<this._dimensions.length;i++)a.push(i)}else a=e;for(var i=0,o=a.length;i<o;i++)n.push(this.get(a[i],r));return n},t.prototype.getByRawIndex=function(e,r){if(!(r>=0&&r<this._rawCount))return NaN;var n=this._chunks[e];return n?n[r]:NaN},t.prototype.getSum=function(e){var r=this._chunks[e],n=0;if(r)for(var a=0,i=this.count();a<i;a++){var o=this.get(e,a);isNaN(o)||(n+=o)}return n},t.prototype.getMedian=function(e){var r=[];this.each([e],function(i){isNaN(i)||r.push(i)});var n=r.sort(function(i,o){return i-o}),a=this.count();return a===0?0:a%2===1?n[(a-1)/2]:(n[a/2]+n[a/2-1])/2},t.prototype.indexOfRawIndex=function(e){if(e>=this._rawCount||e<0)return-1;if(!this._indices)return e;var r=this._indices,n=r[e];if(n!=null&&n<this._count&&n===e)return e;for(var a=0,i=this._count-1;a<=i;){var o=(a+i)/2|0;if(r[o]<e)a=o+1;else if(r[o]>e)i=o-1;else return o}return-1},t.prototype.indicesOfNearest=function(e,r,n){var a=this._chunks,i=a[e],o=[];if(!i)return o;n==null&&(n=1/0);for(var s=1/0,l=-1,c=0,u=0,f=this.count();u<f;u++){var h=this.getRawIndex(u),d=r-i[h],p=Math.abs(d);p<=n&&((p<s||p===s&&d>=0&&l<0)&&(s=p,l=d,c=0),d===l&&(o[c++]=u))}return o.length=c,o},t.prototype.getIndices=function(){var e,r=this._indices;if(r){var n=r.constructor,a=this._count;if(n===Array){e=new n(a);for(var i=0;i<a;i++)e[i]=r[i]}else e=new n(r.buffer,0,a)}else{var n=ii(this._rawCount);e=new n(this.count());for(var i=0;i<e.length;i++)e[i]=i}return e},t.prototype.filter=function(e,r){if(!this._count)return this;for(var n=this.clone(),a=n.count(),i=ii(n._rawCount),o=new i(a),s=[],l=e.length,c=0,u=e[0],f=n._chunks,h=0;h<a;h++){var d=void 0,p=n.getRawIndex(h);if(l===0)d=r(h);else if(l===1){var m=f[u][p];d=r(m,h)}else{for(var g=0;g<l;g++)s[g]=f[e[g]][p];s[g]=h,d=r.apply(null,s)}d&&(o[c++]=p)}return c<a&&(n._indices=o),n._count=c,n._extent=[],n._updateGetRawIdx(),n},t.prototype.selectRange=function(e){var r=this.clone(),n=r._count;if(!n)return this;var a=Qe(e),i=a.length;if(!i)return this;var o=r.count(),s=ii(r._rawCount),l=new s(o),c=0,u=a[0],f=e[u][0],h=e[u][1],d=r._chunks,p=!1;if(!r._indices){var m=0;if(i===1){for(var g=d[a[0]],v=0;v<n;v++){var y=g[v];(y>=f&&y<=h||isNaN(y))&&(l[c++]=m),m++}p=!0}else if(i===2){for(var g=d[a[0]],b=d[a[1]],x=e[a[1]][0],S=e[a[1]][1],v=0;v<n;v++){var y=g[v],w=b[v];(y>=f&&y<=h||isNaN(y))&&(w>=x&&w<=S||isNaN(w))&&(l[c++]=m),m++}p=!0}}if(!p)if(i===1)for(var v=0;v<o;v++){var k=r.getRawIndex(v),y=d[a[0]][k];(y>=f&&y<=h||isNaN(y))&&(l[c++]=k)}else for(var v=0;v<o;v++){for(var T=!0,k=r.getRawIndex(v),C=0;C<i;C++){var A=a[C],y=d[A][k];(y<e[A][0]||y>e[A][1])&&(T=!1)}T&&(l[c++]=r.getRawIndex(v))}return c<o&&(r._indices=l),r._count=c,r._extent=[],r._updateGetRawIdx(),r},t.prototype.map=function(e,r){var n=this.clone(e);return this._updateDims(n,e,r),n},t.prototype.modify=function(e,r){this._updateDims(this,e,r)},t.prototype._updateDims=function(e,r,n){for(var a=e._chunks,i=[],o=r.length,s=e.count(),l=[],c=e._rawExtent,u=0;u<r.length;u++)c[r[u]]=oi();for(var f=0;f<s;f++){for(var h=e.getRawIndex(f),d=0;d<o;d++)l[d]=a[r[d]][h];l[o]=f;var p=n&&n.apply(null,l);if(p!=null){typeof p!="object"&&(i[0]=p,p=i);for(var u=0;u<p.length;u++){var m=r[u],g=p[u],v=c[m],y=a[m];y&&(y[h]=g),g<v[0]&&(v[0]=g),g>v[1]&&(v[1]=g)}}}},t.prototype.lttbDownSample=function(e,r){var n=this.clone([e],!0),a=n._chunks,i=a[e],o=this.count(),s=0,l=Math.floor(1/r),c=this.getRawIndex(0),u,f,h,d=new(ii(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));d[s++]=c;for(var p=1;p<o-1;p+=l){for(var m=Math.min(p+l,o-1),g=Math.min(p+l*2,o),v=(g+m)/2,y=0,b=m;b<g;b++){var x=this.getRawIndex(b),S=i[x];isNaN(S)||(y+=S)}y/=g-m;var w=p,k=Math.min(p+l,o),T=p-1,C=i[c];u=-1,h=w;for(var A=-1,M=0,b=w;b<k;b++){var x=this.getRawIndex(b),S=i[x];if(isNaN(S)){M++,A<0&&(A=x);continue}f=Math.abs((T-v)*(S-C)-(T-b)*(y-C)),f>u&&(u=f,h=x)}M>0&&M<k-w&&(d[s++]=Math.min(A,h),h=Math.max(A,h)),d[s++]=h,c=h}return d[s++]=this.getRawIndex(o-1),n._count=s,n._indices=d,n.getRawIndex=this._getRawIdx,n},t.prototype.minmaxDownSample=function(e,r){for(var n=this.clone([e],!0),a=n._chunks,i=Math.floor(1/r),o=a[e],s=this.count(),l=new(ii(this._rawCount))(Math.ceil(s/i)*2),c=0,u=0;u<s;u+=i){var f=u,h=o[this.getRawIndex(f)],d=u,p=o[this.getRawIndex(d)],m=i;u+i>s&&(m=s-u);for(var g=0;g<m;g++){var v=this.getRawIndex(u+g),y=o[v];y<h&&(h=y,f=u+g),y>p&&(p=y,d=u+g)}var b=this.getRawIndex(f),x=this.getRawIndex(d);f<d?(l[c++]=b,l[c++]=x):(l[c++]=x,l[c++]=b)}return n._count=c,n._indices=l,n._updateGetRawIdx(),n},t.prototype.downSample=function(e,r,n,a){for(var i=this.clone([e],!0),o=i._chunks,s=[],l=Math.floor(1/r),c=o[e],u=this.count(),f=i._rawExtent[e]=oi(),h=new(ii(this._rawCount))(Math.ceil(u/l)),d=0,p=0;p<u;p+=l){l>u-p&&(l=u-p,s.length=l);for(var m=0;m<l;m++){var g=this.getRawIndex(p+m);s[m]=c[g]}var v=n(s),y=this.getRawIndex(Math.min(p+a(s,v)||0,u-1));c[y]=v,v<f[0]&&(f[0]=v),v>f[1]&&(f[1]=v),h[d++]=y}return i._count=d,i._indices=h,i._updateGetRawIdx(),i},t.prototype.each=function(e,r){if(this._count)for(var n=e.length,a=this._chunks,i=0,o=this.count();i<o;i++){var s=this.getRawIndex(i);switch(n){case 0:r(i);break;case 1:r(a[e[0]][s],i);break;case 2:r(a[e[0]][s],a[e[1]][s],i);break;default:for(var l=0,c=[];l<n;l++)c[l]=a[e[l]][s];c[l]=i,r.apply(null,c)}}},t.prototype.getDataExtent=function(e){var r=this._chunks[e],n=oi();if(!r)return n;var a=this.count(),i=!this._indices,o;if(i)return this._rawExtent[e].slice();if(o=this._extent[e],o)return o.slice();o=n;for(var s=o[0],l=o[1],c=0;c<a;c++){var u=this.getRawIndex(c),f=r[u];f<s&&(s=f),f>l&&(l=f)}return o=[s,l],this._extent[e]=o,o},t.prototype.getRawDataItem=function(e){var r=this.getRawIndex(e);if(this._provider.persistent)return this._provider.getItem(r);for(var n=[],a=this._chunks,i=0;i<a.length;i++)n.push(a[i][r]);return n},t.prototype.clone=function(e,r){var n=new t,a=this._chunks,i=e&&Ba(e,function(s,l){return s[l]=!0,s},{});if(i)for(var o=0;o<a.length;o++)n._chunks[o]=i[o]?w2(a[o]):a[o];else n._chunks=a;return this._copyCommonProps(n),r||(n._indices=this._cloneIndices()),n._updateGetRawIdx(),n},t.prototype._copyCommonProps=function(e){e._count=this._count,e._rawCount=this._rawCount,e._provider=this._provider,e._dimensions=this._dimensions,e._extent=Te(this._extent),e._rawExtent=Te(this._rawExtent)},t.prototype._cloneIndices=function(){if(this._indices){var e=this._indices.constructor,r=void 0;if(e===Array){var n=this._indices.length;r=new e(n);for(var a=0;a<n;a++)r[a]=this._indices[a]}else r=new e(this._indices);return r}return null},t.prototype._getRawIdxIdentity=function(e){return e},t.prototype._getRawIdx=function(e){return e<this._count&&e>=0?this._indices[e]:-1},t.prototype._updateGetRawIdx=function(){this.getRawIndex=this._indices?this._getRawIdx:this._getRawIdxIdentity},t.internalField=(function(){function e(r,n,a,i){return Ll(r[i],this._dimensions[i])}Yf={arrayRows:e,objectRows:function(r,n,a,i){return Ll(r[n],this._dimensions[i])},keyedColumns:e,original:function(r,n,a,i){var o=r&&(r.value==null?r:r.value);return Ll(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(r,n,a,i){return r[i]}}})(),t})(),S2=it(),k2={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},Um=(function(){function t(e){this.dimensions=e.dimensions,this._dimOmitted=e.dimensionOmitted,this.source=e.source,this._fullDimCount=e.fullDimensionCount,this._updateDimOmitted(e.dimensionOmitted)}return t.prototype.isDimensionOmitted=function(){return this._dimOmitted},t.prototype._updateDimOmitted=function(e){this._dimOmitted=e,e&&(this._dimNameMap||(this._dimNameMap=Xm(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return Ce(this._dimNameMap.get(e),-1)},t.prototype.getSourceDimension=function(e){var r=this.source.dimensionsDefine;if(r)return r[e]},t.prototype.makeStoreSchema=function(){for(var e=this._fullDimCount,r=Pm(this.source),n=!Zm(e),a="",i=[],o=0,s=0;o<e;o++){var l=void 0,c=void 0,u=void 0,f=this.dimensions[s];if(f&&f.storeDimIndex===o)l=r?f.name:null,c=f.type,u=f.ordinalMeta,s++;else{var h=this.getSourceDimension(o);h&&(l=r?h.name:null,c=h.type)}i.push({property:l,type:c,ordinalMeta:u}),r&&l!=null&&(!f||!f.isCalculationCoord)&&(a+=n?l.replace(/\`/g,"`1").replace(/\$/g,"`2"):l),a+="$",a+=k2[c]||"f",u&&(a+=u.uid),a+="$"}var d=this.source,p=[d.seriesLayoutBy,d.startIndex,a].join("$$");return{dimensions:i,hash:p}},t.prototype.makeOutputDimensionNames=function(){for(var e=[],r=0,n=0;r<this._fullDimCount;r++){var a=void 0,i=this.dimensions[n];if(i&&i.storeDimIndex===r)i.isCalculationCoord||(a=i.name),n++;else{var o=this.getSourceDimension(r);o&&(a=o.name)}e.push(a)}return e},t.prototype.appendCalculationDimension=function(e){this.dimensions.push(e),e.isCalculationCoord=!0,this._fullDimCount++,this._updateDimOmitted(!0)},t})();function Ym(t){return t instanceof Um}function qm(t){for(var e=de(),r=0;r<(t||[]).length;r++){var n=t[r],a=ce(n)?n.name:n;a!=null&&e.get(a)==null&&e.set(a,r)}return e}function Xm(t){var e=S2(t);return e.dimNameMap||(e.dimNameMap=qm(t.dimensionsDefine))}function Zm(t){return t>30}var go=ce,Sn=ue,T2=typeof Int32Array>"u"?Array:Int32Array,C2="e\0\0",Km=-1,M2=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],A2=["_approximateExtent"],jm,Rl,mo,yo,Xf,_o,Zf,D2=(function(){function t(e,r){this.type="list",this._dimOmitted=!1,this._nameList=[],this._idList=[],this._visual={},this._layout={},this._itemVisuals=[],this._itemLayouts=[],this._graphicEls=[],this._approximateExtent={},this._calculationInfo={},this.hasItemOption=!1,this.TRANSFERABLE_METHODS=["cloneShallow","downSample","minmaxDownSample","lttbDownSample","map"],this.CHANGABLE_METHODS=["filterSelf","selectRange"],this.DOWNSAMPLE_METHODS=["downSample","minmaxDownSample","lttbDownSample"];var n,a=!1;Ym(e)?(n=e.dimensions,this._dimOmitted=e.isDimensionOmitted(),this._schema=e):(a=!0,n=e),n=n||["x","y"];for(var i={},o=[],s={},l=!1,c={},u=0;u<n.length;u++){var f=n[u],h=ne(f)?new Il({name:f}):f instanceof Il?f:new Il(f),d=h.name;h.type=h.type||"float",h.coordDim||(h.coordDim=d,h.coordDimIndex=0);var p=h.otherDims=h.otherDims||{};o.push(d),i[d]=h,c[d]!=null&&(l=!0),h.createInvertedIndices&&(s[d]=[]),p.itemName===0&&(this._nameDimIdx=u),p.itemId===0&&(this._idDimIdx=u),a&&(h.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var m=this._dimIdxToName=de();D(o,function(g){m.set(i[g].storeDimIndex,g)})}}return t.prototype.getDimension=function(e){var r=this._recognizeDimIndex(e);if(r==null)return e;if(r=e,!this._dimOmitted)return this.dimensions[r];var n=this._dimIdxToName.get(r);if(n!=null)return n;var a=this._schema.getSourceDimension(r);if(a)return a.name},t.prototype.getDimensionIndex=function(e){var r=this._recognizeDimIndex(e);if(r!=null)return r;if(e==null)return-1;var n=this._getDimInfo(e);return n?n.storeDimIndex:this._dimOmitted?this._schema.getSourceDimensionIndex(e):-1},t.prototype._recognizeDimIndex=function(e){if(Ke(e)||e!=null&&!isNaN(e)&&!this._getDimInfo(e)&&(!this._dimOmitted||this._schema.getSourceDimensionIndex(e)<0))return+e},t.prototype._getStoreDimIndex=function(e){var r=this.getDimensionIndex(e);return r},t.prototype.getDimensionInfo=function(e){return this._getDimInfo(this.getDimension(e))},t.prototype._initGetDimensionInfo=function(e){var r=this._dimInfos;this._getDimInfo=e?function(n){return r.hasOwnProperty(n)?r[n]:void 0}:function(n){return r[n]}},t.prototype.getDimensionsOnCoord=function(){return this._dimSummary.dataDimsOnCoord.slice()},t.prototype.mapDimension=function(e,r){var n=this._dimSummary;if(r==null)return n.encodeFirstDimNotExtra[e];var a=n.encode[e];return a?a[r]:null},t.prototype.mapDimensionsAll=function(e){var r=this._dimSummary,n=r.encode[e];return(n||[]).slice()},t.prototype.getStore=function(){return this._store},t.prototype.initData=function(e,r,n){var a=this,i;if(e instanceof qf&&(i=e),!i){var o=this.dimensions,s=Vf(e)||Dt(e)?new Om(e,o.length):e;i=new qf;var l=Sn(o,function(c){return{type:a._dimInfos[c].type,property:c}});i.initData(s,l,n)}this._store=i,this._nameList=(r||[]).slice(),this._idList=[],this._nameRepeatCount={},this._doInit(0,i.count()),this._dimSummary=g2(this,this._schema),this.userOutput=this._dimSummary.userOutput},t.prototype.appendData=function(e){var r=this._store.appendData(e);this._doInit(r[0],r[1])},t.prototype.appendValues=function(e,r){var n=this._store.appendValues(e,r&&r.length),a=n.start,i=n.end,o=this._shouldMakeIdFromName();if(this._updateOrdinalMeta(),r)for(var s=a;s<i;s++){var l=s-a;this._nameList[s]=r[l],o&&Zf(this,s)}},t.prototype._updateOrdinalMeta=function(){for(var e=this._store,r=this.dimensions,n=0;n<r.length;n++){var a=this._dimInfos[r[n]];a.ordinalMeta&&e.collectOrdinalMeta(a.storeDimIndex,a.ordinalMeta)}},t.prototype._shouldMakeIdFromName=function(){var e=this._store.getProvider();return this._idDimIdx==null&&e.getSource().sourceFormat!==wn&&!e.fillStorage},t.prototype._doInit=function(e,r){if(!(e>=r)){var n=this._store,a=n.getProvider();this._updateOrdinalMeta();var i=this._nameList,o=this._idList,s=a.getSource().sourceFormat,l=s===nr;if(l&&!a.pure)for(var c=[],u=e;u<r;u++){var f=a.getItem(u,c);if(!this.hasItemOption&&bk(f)&&(this.hasItemOption=!0),f){var h=f.name;i[u]==null&&h!=null&&(i[u]=Rr(h,null));var d=f.id;o[u]==null&&d!=null&&(o[u]=Rr(d,null))}}if(this._shouldMakeIdFromName())for(var u=e;u<r;u++)Zf(this,u);jm(this)}},t.prototype.getApproximateExtent=function(e){return this._approximateExtent[e]||this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.setApproximateExtent=function(e,r){r=this.getDimension(r),this._approximateExtent[r]=e.slice()},t.prototype.getCalculationInfo=function(e){return this._calculationInfo[e]},t.prototype.setCalculationInfo=function(e,r){go(e)?U(this._calculationInfo,e):this._calculationInfo[e]=r},t.prototype.getName=function(e){var r=this.getRawIndex(e),n=this._nameList[r];return n==null&&this._nameDimIdx!=null&&(n=mo(this,this._nameDimIdx,r)),n==null&&(n=""),n},t.prototype._getCategory=function(e,r){var n=this._store.get(e,r),a=this._store.getOrdinalMeta(e);return a?a.categories[n]:n},t.prototype.getId=function(e){return Rl(this,this.getRawIndex(e))},t.prototype.count=function(){return this._store.count()},t.prototype.get=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.get(a.storeDimIndex,r)},t.prototype.getByRawIndex=function(e,r){var n=this._store,a=this._dimInfos[e];if(a)return n.getByRawIndex(a.storeDimIndex,r)},t.prototype.getIndices=function(){return this._store.getIndices()},t.prototype.getDataExtent=function(e){return this._store.getDataExtent(this._getStoreDimIndex(e))},t.prototype.getSum=function(e){return this._store.getSum(this._getStoreDimIndex(e))},t.prototype.getMedian=function(e){return this._store.getMedian(this._getStoreDimIndex(e))},t.prototype.getValues=function(e,r){var n=this,a=this._store;return ee(e)?a.getValues(Sn(e,function(i){return n._getStoreDimIndex(i)}),r):a.getValues(e)},t.prototype.hasValue=function(e){for(var r=this._dimSummary.dataDimIndicesOnCoord,n=0,a=r.length;n<a;n++)if(isNaN(this._store.get(r[n],e)))return!1;return!0},t.prototype.indexOfName=function(e){for(var r=0,n=this._store.count();r<n;r++)if(this.getName(r)===e)return r;return-1},t.prototype.getRawIndex=function(e){return this._store.getRawIndex(e)},t.prototype.indexOfRawIndex=function(e){return this._store.indexOfRawIndex(e)},t.prototype.rawIndexOf=function(e,r){var n=e&&this._invertedIndicesMap[e],a=n&&n[r];return a==null||isNaN(a)?Km:a},t.prototype.indicesOfNearest=function(e,r,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,n)},t.prototype.each=function(e,r,n){ye(e)&&(n=r,r=e,e=[]);var a=n||this,i=Sn(yo(e),this._getStoreDimIndex,this);this._store.each(i,a?Le(r,a):r)},t.prototype.filterSelf=function(e,r,n){ye(e)&&(n=r,r=e,e=[]);var a=n||this,i=Sn(yo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,a?Le(r,a):r),this},t.prototype.selectRange=function(e){var r=this,n={},a=Qe(e);return D(a,function(i){var o=r._getStoreDimIndex(i);n[o]=e[i]}),this._store=this._store.selectRange(n),this},t.prototype.mapArray=function(e,r,n){ye(e)&&(n=r,r=e,e=[]),n=n||this;var a=[];return this.each(e,function(){a.push(r&&r.apply(this,arguments))},n),a},t.prototype.map=function(e,r,n,a){var i=n||a||this,o=Sn(yo(e),this._getStoreDimIndex,this),s=_o(this);return s._store=this._store.map(o,i?Le(r,i):r),s},t.prototype.modify=function(e,r,n,a){var i=n||a||this,o=Sn(yo(e),this._getStoreDimIndex,this);this._store.modify(o,i?Le(r,i):r)},t.prototype.downSample=function(e,r,n,a){var i=_o(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),r,n,a),i},t.prototype.minmaxDownSample=function(e,r){var n=_o(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),r),n},t.prototype.lttbDownSample=function(e,r){var n=_o(this);return n._store=this._store.lttbDownSample(this._getStoreDimIndex(e),r),n},t.prototype.getRawDataItem=function(e){return this._store.getRawDataItem(e)},t.prototype.getItemModel=function(e){var r=this.hostModel,n=this.getRawDataItem(e);return new et(n,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new a2(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(n){return Rl(e,n)},function(n){return Rl(r,n)})},t.prototype.getVisual=function(e){var r=this._visual;return r&&r[e]},t.prototype.setVisual=function(e,r){this._visual=this._visual||{},go(e)?U(this._visual,e):this._visual[e]=r},t.prototype.getItemVisual=function(e,r){var n=this._itemVisuals[e],a=n&&n[r];return a??this.getVisual(r)},t.prototype.hasItemVisual=function(){return this._itemVisuals.length>0},t.prototype.ensureUniqueItemVisual=function(e,r){var n=this._itemVisuals,a=n[e];a||(a=n[e]={});var i=a[r];return i==null&&(i=this.getVisual(r),ee(i)?i=i.slice():go(i)&&(i=U({},i)),a[r]=i),i},t.prototype.setItemVisual=function(e,r,n){var a=this._itemVisuals[e]||{};this._itemVisuals[e]=a,go(r)?U(a,r):a[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){go(e)?U(this._layout,e):this._layout[e]=r},t.prototype.getLayout=function(e){return this._layout[e]},t.prototype.getItemLayout=function(e){return this._itemLayouts[e]},t.prototype.setItemLayout=function(e,r,n){this._itemLayouts[e]=n?U(this._itemLayouts[e]||{},r):r},t.prototype.clearItemLayouts=function(){this._itemLayouts.length=0},t.prototype.setItemGraphicEl=function(e,r){var n=this.hostModel&&this.hostModel.seriesIndex;Ok(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){D(this._graphicEls,function(n,a){n&&e&&e.call(r,n,a)})},t.prototype.cloneShallow=function(e){return e||(e=new t(this._schema?this._schema:Sn(this.dimensions,this._getDimInfo,this),this.hostModel)),Xf(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ye(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var a=n.apply(this,arguments);return r.apply(this,[a].concat(mu(arguments)))})},t.internalField=(function(){jm=function(e){var r=e._invertedIndicesMap;D(r,function(n,a){var i=e._dimInfos[a],o=i.ordinalMeta,s=e._store;if(o){n=r[a]=new T2(o.categories.length);for(var l=0;l<n.length;l++)n[l]=Km;for(var l=0;l<s.count();l++)n[s.get(i.storeDimIndex,l)]=l}})},mo=function(e,r,n){return Rr(e._getCategory(r,n),null)},Rl=function(e,r){var n=e._idList[r];return n==null&&e._idDimIdx!=null&&(n=mo(e,e._idDimIdx,r)),n==null&&(n=C2+r),n},yo=function(e){return ee(e)||(e=e!=null?[e]:[]),e},_o=function(e){var r=new t(e._schema?e._schema:Sn(e.dimensions,e._getDimInfo,e),e.hostModel);return Xf(r,e),r},Xf=function(e,r){D(M2.concat(r.__wrappedMethods||[]),function(n){r.hasOwnProperty(n)&&(e[n]=r[n])}),e.__wrappedMethods=r.__wrappedMethods,D(A2,function(n){e[n]=Te(r[n])}),e._calculationInfo=U({},r._calculationInfo)},Zf=function(e,r){var n=e._nameList,a=e._idList,i=e._nameDimIdx,o=e._idDimIdx,s=n[r],l=a[r];if(s==null&&i!=null&&(n[r]=s=mo(e,i,r)),l==null&&o!=null&&(a[r]=l=mo(e,o,r)),l==null&&s!=null){var c=e._nameRepeatCount,u=c[s]=(c[s]||0)+1;l=s,u>1&&(l+="__ec__"+u),a[r]=l}}})(),t})();function I2(t,e){Vf(t)||(t=Am(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],a=de(),i=[],o=P2(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Zm(o),l=n===t.dimensionsDefine,c=l?Xm(t):qm(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,o));for(var f=de(u),h=new Vm(o),d=0;d<h.length;d++)h[d]=-1;function p(C){var A=h[C];if(A<0){var M=n[C],I=ce(M)?M:{name:M},L=new Il,P=I.name;P!=null&&c.get(P)!=null&&(L.name=L.displayName=P),I.type!=null&&(L.type=I.type),I.displayName!=null&&(L.displayName=I.displayName);var N=i.length;return h[C]=N,L.storeDimIndex=C,i.push(L),L}return i[A]}if(!s)for(var d=0;d<o;d++)p(d);f.each(function(C,A){var M=_t(C).slice();if(M.length===1&&!ne(M[0])&&M[0]<0){f.set(A,!1);return}var I=f.set(A,[]);D(M,function(L,P){var N=ne(L)?c.get(L):L;N!=null&&N<o&&(I[P]=N,g(p(N),A,P))})});var m=0;D(r,function(C){var A,M,I,L;if(ne(C))A=C,L={};else{L=C,A=L.name;var P=L.ordinalMeta;L.ordinalMeta=null,L=U({},L),L.ordinalMeta=P,M=L.dimsDef,I=L.otherDims,L.name=L.coordDim=L.coordDimIndex=L.dimsDef=L.otherDims=null}var N=f.get(A);if(N!==!1){if(N=_t(N),!N.length)for(var O=0;O<(M&&M.length||1);O++){for(;m<o&&p(m).coordDim!=null;)m++;m<o&&N.push(m++)}D(N,function(q,R){var z=p(q);if(l&&L.type!=null&&(z.type=L.type),g(Ne(z,L),A,R),z.name==null&&M){var F=M[R];!ce(F)&&(F={name:F}),z.name=z.displayName=F.name,z.defaultTooltip=F.defaultTooltip}I&&Ne(z.otherDims,I)})}});function g(C,A,M){Sm.get(A)!=null?C.otherDims[A]=M:(C.coordDim=A,C.coordDimIndex=M,a.set(A,!0))}var v=e.generateCoord,y=e.generateCoordCount,b=y!=null;y=v?y||1:0;var x=v||"value";function S(C){C.name==null&&(C.name=C.coordDim)}if(s)D(i,function(C){S(C)}),i.sort(function(C,A){return C.storeDimIndex-A.storeDimIndex});else for(var w=0;w<o;w++){var k=p(w),T=k.coordDim;T==null&&(k.coordDim=R2(x,a,b),k.coordDimIndex=0,(!v||y<=0)&&(k.isExtraCoord=!0),y--),S(k),k.type==null&&(Mm(t,w)===Yt.Must||k.isExtraCoord&&(k.otherDims.itemName!=null||k.otherDims.seriesName!=null))&&(k.type="ordinal")}return L2(i),new Um({source:t,dimensions:i,fullDimensionCount:o,dimensionOmitted:s})}function L2(t){for(var e=de(),r=0;r<t.length;r++){var n=t[r],a=n.name,i=e.get(a)||0;i>0&&(n.name=a+(i-1)),i++,e.set(a,i)}}function P2(t,e,r,n){var a=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return D(e,function(i){var o;ce(i)&&(o=i.dimsDef)&&(a=Math.max(a,o.length))}),a}function R2(t,e,r){if(r||e.hasKey(t)){for(var n=0;e.hasKey(t+n);)n++;t+=n}return e.set(t,!0),t}var Kf={},jf=(function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var n=[];D(Kf,function(a,i){var o=a.create(e,r);n=n.concat(o||[])}),this._coordinateSystems=n},t.prototype.update=function(e,r){D(this._coordinateSystems,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){Kf[e]=r},t.get=function(e){return Kf[e]},t})(),E2=(function(){function t(e){this.coordSysDims=[],this.axisMap=de(),this.categoryAxisMap=de(),this.coordSysName=e}return t})();function O2(t){var e=t.get("coordinateSystem"),r=new E2(e),n=N2[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var N2={cartesian2d:function(t,e,r,n){var a=t.getReferringComponents("xAxis",Et).models[0],i=t.getReferringComponents("yAxis",Et).models[0];e.coordSysDims=["x","y"],r.set("x",a),r.set("y",i),si(a)&&(n.set("x",a),e.firstCategoryDimIndex=0),si(i)&&(n.set("y",i),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var a=t.getReferringComponents("singleAxis",Et).models[0];e.coordSysDims=["single"],r.set("single",a),si(a)&&(n.set("single",a),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var a=t.getReferringComponents("polar",Et).models[0],i=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",i),r.set("angle",o),si(i)&&(n.set("radius",i),e.firstCategoryDimIndex=0),si(o)&&(n.set("angle",o),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},geo:function(t,e,r,n){e.coordSysDims=["lng","lat"]},parallel:function(t,e,r,n){var a=t.ecModel,i=a.getComponent("parallel",t.get("parallelIndex")),o=e.coordSysDims=i.dimensions.slice();D(i.parallelAxisIndex,function(s,l){var c=a.getComponent("parallelAxis",s),u=o[l];r.set(u,c),si(c)&&(n.set(u,c),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function si(t){return t.get("type")==="category"}function B2(t,e,r){r=r||{};var n=r.byIndex,a=r.stackedCoordDimension,i,o,s;z2(e)?i=e:(o=e.schema,i=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),c,u,f,h;if(D(i,function(y,b){ne(y)&&(i[b]=y={name:y}),l&&!y.isExtraCoord&&(!n&&!c&&y.ordinalMeta&&(c=y),!u&&y.type!=="ordinal"&&y.type!=="time"&&(!a||a===y.coordDim)&&(u=y))}),u&&!n&&!c&&(n=!0),u){f="__\0ecstackresult_"+t.id,h="__\0ecstackedover_"+t.id,c&&(c.createInvertedIndices=!0);var d=u.coordDim,p=u.type,m=0;D(i,function(y){y.coordDim===d&&m++});var g={name:f,coordDim:d,coordDimIndex:m,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},v={name:h,coordDim:h,coordDimIndex:m+1,type:p,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(h,p),v.storeDimIndex=s.ensureCalculationDimension(f,p)),o.appendCalculationDimension(g),o.appendCalculationDimension(v)):(i.push(g),i.push(v))}return{stackedDimension:u&&u.name,stackedByDimension:c&&c.name,isStackedByIndex:n,stackedOverDimension:h,stackResultDimension:f}}function z2(t){return!Ym(t.schema)}function li(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function F2(t,e){return li(t,e)?t.getCalculationInfo("stackResultDimension"):e}function H2(t,e){var r=t.get("coordinateSystem"),n=jf.get(r),a;return e&&e.coordSysDims&&(a=ue(e.coordSysDims,function(i){var o={name:i},s=e.axisMap.get(i);if(s){var l=s.get("type");o.type=m2(l)}return o})),a||(a=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),a}function V2(t,e,r){var n,a;return r&&D(t,function(i,o){var s=i.coordDim,l=r.categoryAxisMap.get(s);l&&(n==null&&(n=o),i.ordinalMeta=l.getOrdinalMeta(),e&&(i.createInvertedIndices=!0)),i.otherDims.itemName!=null&&(a=!0)}),!a&&n!=null&&(t[n].otherDims.itemName=0),n}function Qf(t,e,r){r=r||{};var n=e.getSourceManager(),a,i=!1;a=n.getSource(),i=a.sourceFormat===nr;var o=O2(e),s=H2(e,o),l=r.useEncodeDefaulter,c=ye(l)?l:l?at(o2,s,e):null,u={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!i},f=I2(a,u),h=V2(f.dimensions,r.createInvertedIndices,o),d=i?null:n.getSharedDataStore(f),p=B2(e,{schema:f,store:d}),m=new D2(f,e);m.setCalculationInfo(p);var g=h!=null&&G2(a)?function(v,y,b,x){return x===h?b:this.defaultDimValueGetter(v,y,b,x)}:null;return m.hasItemOption=!1,m.initData(i?a:d,null,g),m}function G2(t){if(t.sourceFormat===nr){var e=$2(t.data||[]);return!ee(no(e))}}function $2(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var W2=Math.round(Math.random()*10);function El(t){return[t||"",W2++].join("_")}function U2(t){var e={};t.registerSubTypeDefaulter=function(r,n){var a=Ar(r);e[a.main]=n},t.determineSubType=function(r,n){var a=n.type;if(!a){var i=Ar(r).main;t.hasSubTypes(r)&&e[i]&&(a=e[i](n))}return a}}function Y2(t,e){t.topologicalTravel=function(i,o,s,l){if(!i.length)return;var c=r(o),u=c.graph,f=c.noEntryList,h={};for(D(i,function(y){h[y]=!0});f.length;){var d=f.pop(),p=u[d],m=!!h[d];m&&(s.call(l,d,p.originalDeps.slice()),delete h[d]),D(p.successor,m?v:g)}D(h,function(){var y="";throw new Error(y)});function g(y){u[y].entryCount--,u[y].entryCount===0&&f.push(y)}function v(y){h[y]=!0,g(y)}};function r(i){var o={},s=[];return D(i,function(l){var c=n(o,l),u=c.originalDeps=e(l),f=a(u,i);c.entryCount=f.length,c.entryCount===0&&s.push(l),D(f,function(h){ze(c.predecessor,h)<0&&c.predecessor.push(h);var d=n(o,h);ze(d.successor,h)<0&&d.successor.push(l)})}),{graph:o,noEntryList:s}}function n(i,o){return i[o]||(i[o]={predecessor:[],successor:[]}),i[o]}function a(i,o){var s=[];return D(i,function(l){ze(o,l)>=0&&s.push(l)}),s}}function Jf(t,e){return De(De({},t,!0),e,!0)}var q2=Math.log(2);function eh(t,e,r,n,a,i){var o=n+"-"+a,s=t.length;if(i.hasOwnProperty(o))return i[o];if(e===1){var l=Math.round(Math.log((1<<s)-1&~a)/q2);return t[r][l]}for(var c=n|1<<r,u=r+1;n&1<<u;)u++;for(var f=0,h=0,d=0;h<s;h++){var p=1<<h;p&a||(f+=(d%2?-1:1)*t[r][h]*eh(t,e-1,u,c,a|p,i),d++)}return i[o]=f,f}function Qm(t,e){var r=[[t[0],t[1],1,0,0,0,-e[0]*t[0],-e[0]*t[1]],[0,0,0,t[0],t[1],1,-e[1]*t[0],-e[1]*t[1]],[t[2],t[3],1,0,0,0,-e[2]*t[2],-e[2]*t[3]],[0,0,0,t[2],t[3],1,-e[3]*t[2],-e[3]*t[3]],[t[4],t[5],1,0,0,0,-e[4]*t[4],-e[4]*t[5]],[0,0,0,t[4],t[5],1,-e[5]*t[4],-e[5]*t[5]],[t[6],t[7],1,0,0,0,-e[6]*t[6],-e[6]*t[7]],[0,0,0,t[6],t[7],1,-e[7]*t[6],-e[7]*t[7]]],n={},a=eh(r,8,0,0,0,n);if(a!==0){for(var i=[],o=0;o<8;o++)for(var s=0;s<8;s++)i[s]==null&&(i[s]=0),i[s]+=((o+s)%2?-1:1)*eh(r,7,o===0?1:0,1<<o,1<<s,n)/a*e[o];return function(l,c,u){var f=c*i[6]+u*i[7]+1;l[0]=(c*i[0]+u*i[1]+i[2])/f,l[1]=(c*i[3]+u*i[4]+i[5])/f}}}var Jm="___zrEVENTSAVED",th=[];function X2(t,e,r,n,a){return rh(th,e,n,a,!0)&&rh(t,r,th[0],th[1])}function rh(t,e,r,n,a){if(e.getBoundingClientRect&&ge.domSupported&&!ey(e)){var i=e[Jm]||(e[Jm]={}),o=Z2(e,i),s=K2(o,i,a);if(s)return s(t,r,n),!0}return!1}function Z2(t,e){var r=e.markers;if(r)return r;r=e.markers=[];for(var n=["left","right"],a=["top","bottom"],i=0;i<4;i++){var o=document.createElement("div"),s=o.style,l=i%2,c=(i>>1)%2;s.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",n[l]+":0",a[c]+":0",n[1-l]+":auto",a[1-c]+":auto",""].join("!important;"),t.appendChild(o),r.push(o)}return r}function K2(t,e,r){for(var n=r?"invTrans":"trans",a=e[n],i=e.srcCoords,o=[],s=[],l=!0,c=0;c<4;c++){var u=t[c].getBoundingClientRect(),f=2*c,h=u.left,d=u.top;o.push(h,d),l=l&&i&&h===i[f]&&d===i[f+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&a?a:(e.srcCoords=o,e[n]=r?Qm(s,o):Qm(o,s))}function ey(t){return t.nodeName.toUpperCase()==="CANVAS"}var j2=/([&<>"'])/g,Q2={"&":"&","<":"<",">":">",'"':""","'":"'"};function Bt(t){return t==null?"":(t+"").replace(j2,function(e,r){return Q2[r]})}const J2={time:{month:["January","February","March","April","May","June","July","August","September","October","November","December"],monthAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],dayOfWeek:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],dayOfWeekAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]},legend:{selector:{all:"All",inverse:"Inv"}},toolbox:{brush:{title:{rect:"Box Select",polygon:"Lasso Select",lineX:"Horizontally Select",lineY:"Vertically Select",keep:"Keep Selections",clear:"Clear Selections"}},dataView:{title:"Data View",lang:["Data View","Close","Refresh"]},dataZoom:{title:{zoom:"Zoom",back:"Zoom Reset"}},magicType:{title:{line:"Switch to Line Chart",bar:"Switch to Bar Chart",stack:"Stack",tiled:"Tile"}},restore:{title:"Restore"},saveAsImage:{title:"Save as Image",lang:["Right Click to Save Image"]}},series:{typeNames:{pie:"Pie chart",bar:"Bar chart",line:"Line chart",scatter:"Scatter plot",effectScatter:"Ripple scatter plot",radar:"Radar chart",tree:"Tree",treemap:"Treemap",boxplot:"Boxplot",candlestick:"Candlestick",k:"K line chart",heatmap:"Heat map",map:"Map",parallel:"Parallel coordinate map",lines:"Line graph",graph:"Relationship graph",sankey:"Sankey diagram",funnel:"Funnel chart",gauge:"Gauge",pictorialBar:"Pictorial bar",themeRiver:"Theme River Map",sunburst:"Sunburst",custom:"Custom chart",chart:"Chart"}},aria:{general:{withTitle:'This is a chart about "{title}"',withoutTitle:"This is a chart"},series:{single:{prefix:"",withName:" with type {seriesType} named {seriesName}.",withoutName:" with type {seriesType}."},multiple:{prefix:". It consists of {seriesCount} series count.",withName:" The {seriesId} series is a {seriesType} representing {seriesName}.",withoutName:" The {seriesId} series is a {seriesType}.",separator:{middle:"",end:""}}},data:{allData:"The data is as follows: ",partialData:"The first {displayCnt} items are: ",withName:"the data for {name} is {value}",withoutName:"{value}",separator:{middle:", ",end:". "}}}},eC={time:{month:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],monthAbbr:["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],dayOfWeek:["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],dayOfWeekAbbr:["日","一","二","三","四","五","六"]},legend:{selector:{all:"全选",inverse:"反选"}},toolbox:{brush:{title:{rect:"矩形选择",polygon:"圈选",lineX:"横向选择",lineY:"纵向选择",keep:"保持选择",clear:"清除选择"}},dataView:{title:"数据视图",lang:["数据视图","关闭","刷新"]},dataZoom:{title:{zoom:"区域缩放",back:"区域缩放还原"}},magicType:{title:{line:"切换为折线图",bar:"切换为柱状图",stack:"切换为堆叠",tiled:"切换为平铺"}},restore:{title:"还原"},saveAsImage:{title:"保存为图片",lang:["右键另存为图片"]}},series:{typeNames:{pie:"饼图",bar:"柱状图",line:"折线图",scatter:"散点图",effectScatter:"涟漪散点图",radar:"雷达图",tree:"树图",treemap:"矩形树图",boxplot:"箱型图",candlestick:"K线图",k:"K线图",heatmap:"热力图",map:"地图",parallel:"平行坐标图",lines:"线图",graph:"关系图",sankey:"桑基图",funnel:"漏斗图",gauge:"仪表盘图",pictorialBar:"象形柱图",themeRiver:"主题河流图",sunburst:"旭日图",custom:"自定义图表",chart:"图表"}},aria:{general:{withTitle:"这是一个关于“{title}”的图表。",withoutTitle:"这是一个图表,"},series:{single:{prefix:"",withName:"图表类型是{seriesType},表示{seriesName}。",withoutName:"图表类型是{seriesType}。"},multiple:{prefix:"它由{seriesCount}个图表系列组成。",withName:"第{seriesId}个系列是一个表示{seriesName}的{seriesType},",withoutName:"第{seriesId}个系列是一个{seriesType},",separator:{middle:";",end:"。"}}},data:{allData:"其数据是——",partialData:"其中,前{displayCnt}项是——",withName:"{name}的数据是{value}",withoutName:"{value}",separator:{middle:",",end:""}}}};var Ol="ZH",nh="EN",ci=nh,Nl={},ah={},ty=ge.domSupported?(function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||ci).toUpperCase();return t.indexOf(Ol)>-1?Ol:ci})():ci;function ry(t,e){t=t.toUpperCase(),ah[t]=new et(e),Nl[t]=e}function tC(t){if(ne(t)){var e=Nl[t.toUpperCase()]||{};return t===Ol||t===nh?Te(e):De(Te(e),Te(Nl[ci]),!1)}else return De(Te(t),Te(Nl[ci]),!1)}function rC(t){return ah[t]}function nC(){return ah[ci]}ry(nh,J2),ry(Ol,eC);var ih=1e3,oh=ih*60,bo=oh*60,ar=bo*24,ny=ar*365,xo={year:"{yyyy}",month:"{MMM}",day:"{d}",hour:"{HH}:{mm}",minute:"{HH}:{mm}",second:"{HH}:{mm}:{ss}",millisecond:"{HH}:{mm}:{ss} {SSS}",none:"{yyyy}-{MM}-{dd} {HH}:{mm}:{ss} {SSS}"},Bl="{yyyy}-{MM}-{dd}",ay={year:"{yyyy}",month:"{yyyy}-{MM}",day:Bl,hour:Bl+" "+xo.hour,minute:Bl+" "+xo.minute,second:Bl+" "+xo.second,millisecond:xo.none},sh=["year","month","day","hour","minute","second","millisecond"],iy=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function kn(t,e){return t+="","0000".substr(0,e-t.length)+t}function ui(t){switch(t){case"half-year":case"quarter":return"month";case"week":case"half-week":return"day";case"half-day":case"quarter-day":return"hour";default:return t}}function aC(t){return t===ui(t)}function iC(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function zl(t,e,r,n){var a=Kr(t),i=a[lh(r)](),o=a[fi(r)]()+1,s=Math.floor((o-1)/3)+1,l=a[Fl(r)](),c=a["get"+(r?"UTC":"")+"Day"](),u=a[wo(r)](),f=(u-1)%12+1,h=a[Hl(r)](),d=a[Vl(r)](),p=a[Gl(r)](),m=u>=12?"pm":"am",g=m.toUpperCase(),v=n instanceof et?n:rC(n||ty)||nC(),y=v.getModel("time"),b=y.get("month"),x=y.get("monthAbbr"),S=y.get("dayOfWeek"),w=y.get("dayOfWeekAbbr");return(e||"").replace(/{a}/g,m+"").replace(/{A}/g,g+"").replace(/{yyyy}/g,i+"").replace(/{yy}/g,kn(i%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,kn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,kn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[c]).replace(/{ee}/g,w[c]).replace(/{e}/g,c+"").replace(/{HH}/g,kn(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,kn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,kn(h,2)).replace(/{m}/g,h+"").replace(/{ss}/g,kn(d,2)).replace(/{s}/g,d+"").replace(/{SSS}/g,kn(p,3)).replace(/{S}/g,p+"")}function oC(t,e,r,n,a){var i=null;if(ne(r))i=r;else if(ye(r))i=r(t.value,e,{level:t.level});else{var o=U({},xo);if(t.level>0)for(var s=0;s<sh.length;++s)o[sh[s]]="{primary|"+o[sh[s]]+"}";var l=r?r.inherit===!1?r:Ne(r,o):o,c=oy(t.value,a);if(l[c])i=l[c];else if(l.inherit){for(var u=iy.indexOf(c),s=u-1;s>=0;--s)if(l[c]){i=l[c];break}i=i||o.none}if(ee(i)){var f=t.level==null?0:t.level>=0?t.level:i.length+t.level;f=Math.min(f,i.length-1),i=i[f]}}return zl(new Date(t.value),i,a,n)}function oy(t,e){var r=Kr(t),n=r[fi(e)]()+1,a=r[Fl(e)](),i=r[wo(e)](),o=r[Hl(e)](),s=r[Vl(e)](),l=r[Gl(e)](),c=l===0,u=c&&s===0,f=u&&o===0,h=f&&i===0,d=h&&a===1,p=d&&n===1;return p?"year":d?"month":h?"day":f?"hour":u?"minute":c?"second":"millisecond"}function sy(t,e,r){var n=Ke(t)?Kr(t):t;switch(e=e||oy(t,r),e){case"year":return n[lh(r)]();case"half-year":return n[fi(r)]()>=6?1:0;case"quarter":return Math.floor((n[fi(r)]()+1)/4);case"month":return n[fi(r)]();case"day":return n[Fl(r)]();case"half-day":return n[wo(r)]()/24;case"hour":return n[wo(r)]();case"minute":return n[Hl(r)]();case"second":return n[Vl(r)]();case"millisecond":return n[Gl(r)]()}}function lh(t){return t?"getUTCFullYear":"getFullYear"}function fi(t){return t?"getUTCMonth":"getMonth"}function Fl(t){return t?"getUTCDate":"getDate"}function wo(t){return t?"getUTCHours":"getHours"}function Hl(t){return t?"getUTCMinutes":"getMinutes"}function Vl(t){return t?"getUTCSeconds":"getSeconds"}function Gl(t){return t?"getUTCMilliseconds":"getMilliseconds"}function sC(t){return t?"setUTCFullYear":"setFullYear"}function ly(t){return t?"setUTCMonth":"setMonth"}function cy(t){return t?"setUTCDate":"setDate"}function uy(t){return t?"setUTCHours":"setHours"}function fy(t){return t?"setUTCMinutes":"setMinutes"}function hy(t){return t?"setUTCSeconds":"setSeconds"}function dy(t){return t?"setUTCMilliseconds":"setMilliseconds"}function py(t){if(!yk(t))return ne(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function vy(t,e){return t=(t||"").toLowerCase().replace(/-(.)/g,function(r,n){return n.toUpperCase()}),e&&t&&(t=t.charAt(0).toUpperCase()+t.slice(1)),t}var $l=uv;function ch(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function a(u){return u&&Mr(u)?u:"-"}function i(u){return!!(u!=null&&!isNaN(u)&&isFinite(u))}var o=e==="time",s=t instanceof Date;if(o||s){var l=o?Kr(t):t;if(isNaN(+l)){if(s)return"-"}else return zl(l,n,r)}if(e==="ordinal")return gu(t)?a(t):Ke(t)&&i(t)?t+"":"-";var c=nl(t);return i(c)?py(c):gu(t)?a(t):typeof t=="boolean"?t+"":"-"}var gy=["a","b","c","d","e","f","g"],uh=function(t,e){return"{"+t+(e??"")+"}"};function my(t,e,r){ee(e)||(e=[e]);var n=e.length;if(!n)return"";for(var a=e[0].$vars||[],i=0;i<a.length;i++){var o=gy[i];t=t.replace(uh(o),uh(o,0))}for(var s=0;s<n;s++)for(var l=0;l<a.length;l++){var c=e[s][a[l]];t=t.replace(uh(gy[l],s),r?Bt(c):c)}return t}function lC(t,e){var r=ne(t)?{color:t,extraCssText:e}:t||{},n=r.color,a=r.type;e=r.extraCssText;var i=r.renderMode||"html";if(!n)return"";if(i==="html")return a==="subItem"?'<span style="display:inline-block;vertical-align:middle;margin-right:8px;margin-left:3px;border-radius:4px;width:4px;height:4px;background-color:'+Bt(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Bt(n)+";"+(e||"")+'"></span>';var o=r.markerId||"markerX";return{renderMode:i,content:"{"+o+"|} ",style:a==="subItem"?{width:4,height:4,borderRadius:2,backgroundColor:n}:{width:10,height:10,borderRadius:5,backgroundColor:n}}}function pa(t,e){return e=e||"transparent",ne(t)?t:ce(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var Wl=D,cC=["left","right","top","bottom","width","height"],Ul=[["width","left","right"],["height","top","bottom"]];function fh(t,e,r,n,a){var i=0,o=0;n==null&&(n=1/0),a==null&&(a=1/0);var s=0;e.eachChild(function(l,c){var u=l.getBoundingRect(),f=e.childAt(c+1),h=f&&f.getBoundingRect(),d,p;if(t==="horizontal"){var m=u.width+(h?-h.x+u.x:0);d=i+m,d>n||l.newline?(i=0,d=m,o+=s+r,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(h?-h.y+u.y:0);p=o+g,p>a||l.newline?(i+=s+r,o=0,p=g,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=i,l.y=o,l.markRedraw(),t==="horizontal"?i=d+r:o=p+r)})}var So=fh;at(fh,"vertical"),at(fh,"horizontal");function Yl(t,e,r){r=$l(r||0);var n=e.width,a=e.height,i=At(t.left,n),o=At(t.top,a),s=At(t.right,n),l=At(t.bottom,a),c=At(t.width,n),u=At(t.height,a),f=r[2]+r[0],h=r[1]+r[3],d=t.aspect;switch(isNaN(c)&&(c=n-s-h-i),isNaN(u)&&(u=a-l-f-o),d!=null&&(isNaN(c)&&isNaN(u)&&(d>n/a?c=n*.8:u=a*.8),isNaN(c)&&(c=d*u),isNaN(u)&&(u=c/d)),isNaN(i)&&(i=n-s-c-h),isNaN(o)&&(o=a-l-u-f),t.left||t.right){case"center":i=n/2-c/2-r[3];break;case"right":i=n-c-h;break}switch(t.top||t.bottom){case"middle":case"center":o=a/2-u/2-r[0];break;case"bottom":o=a-u-f;break}i=i||0,o=o||0,isNaN(c)&&(c=n-h-i-(s||0)),isNaN(u)&&(u=a-f-o-(l||0));var p=new Fe(i+r[3],o+r[0],c,u);return p.margin=r,p}function ko(t){var e=t.layoutMode||t.constructor.layoutMode;return ce(e)?e:e?{type:e}:null}function hi(t,e,r){var n=r&&r.ignoreSize;!ee(n)&&(n=[n,n]);var a=o(Ul[0],0),i=o(Ul[1],1);c(Ul[0],t,a),c(Ul[1],t,i);function o(u,f){var h={},d=0,p={},m=0,g=2;if(Wl(u,function(b){p[b]=t[b]}),Wl(u,function(b){s(e,b)&&(h[b]=p[b]=e[b]),l(h,b)&&d++,l(p,b)&&m++}),n[f])return l(e,u[1])?p[u[2]]=null:l(e,u[2])&&(p[u[1]]=null),p;if(m===g||!d)return p;if(d>=g)return h;for(var v=0;v<u.length;v++){var y=u[v];if(!s(h,y)&&s(t,y)){h[y]=t[y];break}}return h}function s(u,f){return u.hasOwnProperty(f)}function l(u,f){return u[f]!=null&&u[f]!=="auto"}function c(u,f,h){Wl(u,function(d){f[d]=h[d]})}}function ql(t){return uC({},t)}function uC(t,e){return e&&t&&Wl(cC,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var fC=it(),We=(function(t){Z(e,t);function e(r,n,a){var i=t.call(this,r,n,a)||this;return i.uid=El("ec_cpt_model"),i}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=ko(this),i=a?ql(r):{},o=n.getTheme();De(r,o.get(this.mainType)),De(r,this.getDefaultOption()),a&&hi(r,i,a)},e.prototype.mergeOption=function(r,n){De(this.option,r,!0);var a=ko(this);a&&hi(this.option,r,a)},e.prototype.optionUpdated=function(r,n){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!Bw(r))return r.defaultOption;var n=fC(this);if(!n.defaultOption){for(var a=[],i=r;i;){var o=i.prototype.defaultOption;o&&a.push(o),i=i.superClass}for(var s={},l=a.length-1;l>=0;l--)s=De(s,a[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var a=r+"Index",i=r+"Id";return oo(this.ecModel,r,{index:this.get(a,!0),id:this.get(i,!0)},n)},e.prototype.getBoxLayoutParams=function(){var r=this;return{left:r.get("left"),top:r.get("top"),right:r.get("right"),bottom:r.get("bottom"),width:r.get("width"),height:r.get("height")}},e.prototype.getZLevelKey=function(){return""},e.prototype.setZLevel=function(r){this.option.zlevel=r},e.protoInitialize=(function(){var r=e.prototype;r.type="component",r.id="",r.name="",r.mainType="",r.subType="",r.componentIndex=0})(),e})(et);vv(We,et),Ms(We),U2(We),Y2(We,hC);function hC(t){var e=[];return D(We.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=ue(e,function(r){return Ar(r).main}),t!=="dataset"&&ze(e,"dataset")<=0&&e.unshift("dataset"),e}var yy=it(),dC=it(),hh=(function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,n){var a=_t(this.get("color",!0)),i=this.get("colorLayer",!0);return by(this,yy,a,i,e,r,n)},t.prototype.clearColorPalette=function(){vC(this,yy)},t})();function _y(t,e,r,n){var a=_t(t.get(["aria","decal","decals"]));return by(t,dC,a,null,e,r,n)}function pC(t,e){for(var r=t.length,n=0;n<r;n++)if(t[n].length>e)return t[n];return t[r-1]}function by(t,e,r,n,a,i,o){i=i||t;var s=e(i),l=s.paletteIdx||0,c=s.paletteNameMap=s.paletteNameMap||{};if(c.hasOwnProperty(a))return c[a];var u=o==null||!n?r:pC(n,o);if(u=u||r,!(!u||!u.length)){var f=u[l];return a&&(c[a]=f),s.paletteIdx=(l+1)%u.length,f}}function vC(t,e){e(t).paletteIdx=0,e(t).paletteNameMap={}}var gC=/\{@(.+?)\}/g,mC=(function(){function t(){}return t.prototype.getDataParams=function(e,r){var n=this.getData(r),a=this.getRawValue(e,r),i=n.getRawIndex(e),o=n.getName(e),s=n.getRawDataItem(e),l=n.getItemVisual(e,"style"),c=l&&l[n.getItemVisual(e,"drawType")||"fill"],u=l&&l.stroke,f=this.mainType,h=f==="series",d=n.userOutput&&n.userOutput.get();return{componentType:f,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:h?this.subType:null,seriesIndex:this.seriesIndex,seriesId:h?this.id:null,seriesName:h?this.name:null,name:o,dataIndex:i,data:s,dataType:r,value:a,color:c,borderColor:u,dimensionNames:d?d.fullDimensions:null,encode:d?d.encode:null,$vars:["seriesName","name","value"]}},t.prototype.getFormattedLabel=function(e,r,n,a,i,o){r=r||"normal";var s=this.getData(n),l=this.getDataParams(e,n);if(o&&(l.value=o.interpolatedValue),a!=null&&ee(l.value)&&(l.value=l.value[a]),!i){var c=s.getItemModel(e);i=c.get(r==="normal"?["label","formatter"]:[r,"label","formatter"])}if(ye(i))return l.status=r,l.dimensionIndex=a,i(l);if(ne(i)){var u=my(i,l);return u.replace(gC,function(f,h){var d=h.length,p=h;p.charAt(0)==="["&&p.charAt(d-1)==="]"&&(p=+p.slice(1,d-1));var m=ai(s,e,p);if(o&&ee(o.interpolatedValue)){var g=s.getDimensionIndex(p);g>=0&&(m=o.interpolatedValue[g])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return ai(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t})();function xy(t){var e,r;return ce(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function To(t){return new yC(t)}var yC=(function(){function t(e){e=e||{},this._reset=e.reset,this._plan=e.plan,this._count=e.count,this._onDirty=e.onDirty,this._dirty=!0}return t.prototype.perform=function(e){var r=this._upstream,n=e&&e.skip;if(this._dirty&&r){var a=this.context;a.data=a.outputData=r.context.outputData}this.__pipeline&&(this.__pipeline.currentTask=this);var i;this._plan&&!n&&(i=this._plan(this.context));var o=u(this._modBy),s=this._modDataCount||0,l=u(e&&e.modBy),c=e&&e.modDataCount||0;(o!==l||s!==c)&&(i="reset");function u(y){return!(y>=1)&&(y=1),y}var f;(this._dirty||i==="reset")&&(this._dirty=!1,f=this._doReset(n)),this._modBy=l,this._modDataCount=c;var h=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var d=this._dueIndex,p=Math.min(h!=null?this._dueIndex+h:1/0,this._dueEnd);if(!n&&(f||d<p)){var m=this._progress;if(ee(m))for(var g=0;g<m.length;g++)this._doProgress(m[g],d,p,l,c);else this._doProgress(m,d,p,l,c)}this._dueIndex=p;var v=this._settedOutputEnd!=null?this._settedOutputEnd:p;this._outputDueEnd=v}else this._dueIndex=this._outputDueEnd=this._settedOutputEnd!=null?this._settedOutputEnd:this._dueEnd;return this.unfinished()},t.prototype.dirty=function(){this._dirty=!0,this._onDirty&&this._onDirty(this.context)},t.prototype._doProgress=function(e,r,n,a,i){wy.reset(r,n,a,i),this._callingProgress=e,this._callingProgress({start:r,end:n,count:n-r,next:wy.next},this.context)},t.prototype._doReset=function(e){this._dueIndex=this._outputDueEnd=this._dueEnd=0,this._settedOutputEnd=null;var r,n;!e&&this._reset&&(r=this._reset(this.context),r&&r.progress&&(n=r.forceFirstProgress,r=r.progress),ee(r)&&!r.length&&(r=null)),this._progress=r,this._modBy=this._modDataCount=null;var a=this._downstream;return a&&a.dirty(),n},t.prototype.unfinished=function(){return this._progress&&this._dueIndex<this._dueEnd},t.prototype.pipe=function(e){(this._downstream!==e||this._dirty)&&(this._downstream=e,e._upstream=this,e.dirty())},t.prototype.dispose=function(){this._disposed||(this._upstream&&(this._upstream._downstream=null),this._downstream&&(this._downstream._upstream=null),this._dirty=!1,this._disposed=!0)},t.prototype.getUpstream=function(){return this._upstream},t.prototype.getDownstream=function(){return this._downstream},t.prototype.setOutputEnd=function(e){this._outputDueEnd=this._settedOutputEnd=e},t})(),wy=(function(){var t,e,r,n,a,i={reset:function(l,c,u,f){e=l,t=c,r=u,n=f,a=Math.ceil(n/r),i.next=r>1&&n>0?s:o}};return i;function o(){return e<t?e++:null}function s(){var l=e%a*r+Math.ceil(e/a),c=e>=t?null:l<n?l:e;return e++,c}})(),_C=(function(){function t(){}return t.prototype.getRawData=function(){throw new Error("not supported")},t.prototype.getRawDataItem=function(e){throw new Error("not supported")},t.prototype.cloneRawData=function(){},t.prototype.getDimensionInfo=function(e){},t.prototype.cloneAllDimensionInfo=function(){},t.prototype.count=function(){},t.prototype.retrieveValue=function(e,r){},t.prototype.retrieveValueFromItem=function(e,r){},t.prototype.convertValue=function(e,r){return Ll(e,r)},t})();function bC(t,e){var r=new _C,n=t.data,a=r.sourceFormat=t.sourceFormat,i=t.startIndex,o="";t.seriesLayoutBy!==en&&Rt(o);var s=[],l={},c=t.dimensionsDefine;if(c)D(c,function(m,g){var v=m.name,y={index:g,name:v,displayName:m.displayName};if(s.push(y),v!=null){var b="";Vn(l,v)&&Rt(b),l[v]=y}});else for(var u=0;u<t.dimensionsDetectedCount;u++)s.push({index:u});var f=Bm(a,en);e.__isBuiltIn&&(r.getRawDataItem=function(m){return f(n,i,s,m)},r.getRawData=Le(xC,null,t)),r.cloneRawData=Le(wC,null,t);var h=Fm(a,en);r.count=Le(h,null,n,i,s);var d=Hm(a);r.retrieveValue=function(m,g){var v=f(n,i,s,m);return p(v,g)};var p=r.retrieveValueFromItem=function(m,g){if(m!=null){var v=s[g];if(v)return d(m,g,v.name)}};return r.getDimensionInfo=Le(SC,null,s,l),r.cloneAllDimensionInfo=Le(kC,null,s),r}function xC(t){var e=t.sourceFormat;if(!dh(e)){var r="";Rt(r)}return t.data}function wC(t){var e=t.sourceFormat,r=t.data;if(!dh(e)){var n="";Rt(n)}if(e===Nt){for(var a=[],i=0,o=r.length;i<o;i++)a.push(r[i].slice());return a}else if(e===Nr){for(var a=[],i=0,o=r.length;i<o;i++)a.push(U({},r[i]));return a}}function SC(t,e,r){if(r!=null){if(Ke(r)||!isNaN(r)&&!Vn(e,r))return t[r];if(Vn(e,r))return e[r]}}function kC(t){return Te(t)}var Sy=de();function TC(t){t=Te(t);var e=t.type,r="";e||Rt(r);var n=e.split(":");n.length!==2&&Rt(r);var a=!1;n[0]==="echarts"&&(e=n[1],a=!0),t.__isBuiltIn=a,Sy.set(e,t)}function CC(t,e,r){var n=_t(t),a=n.length,i="";a||Rt(i);for(var o=0,s=a;o<s;o++){var l=n[o];e=MC(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function MC(t,e,r,n){var a="";e.length||Rt(a),ce(t)||Rt(a);var i=t.type,o=Sy.get(i);o||Rt(a);var s=ue(e,function(c){return bC(c,o)}),l=_t(o.transform({upstream:s[0],upstreamList:s,config:Te(t.config)}));return ue(l,function(c,u){var f="";ce(c)||Rt(f),c.data||Rt(f);var h=Dm(c.data);dh(h)||Rt(f);var d,p=e[0];if(p&&u===0&&!c.dimensions){var m=p.startIndex;m&&(c.data=p.data.slice(0,m).concat(c.data)),d={seriesLayoutBy:en,sourceHeader:m,dimensions:p.metaRawOption.dimensions}}else d={seriesLayoutBy:en,sourceHeader:0,dimensions:c.dimensions};return Gf(c.data,d,null)})}function dh(t){return t===Nt||t===Nr}var AC=(function(){function t(e){this._sourceList=[],this._storeList=[],this._upstreamSignList=[],this._versionSignBase=0,this._dirty=!0,this._sourceHost=e}return t.prototype.dirty=function(){this._setLocalSource([],[]),this._storeList=[],this._dirty=!0},t.prototype._setLocalSource=function(e,r){this._sourceList=e,this._upstreamSignList=r,this._versionSignBase++,this._versionSignBase>9e10&&(this._versionSignBase=0)},t.prototype._getVersionSign=function(){return this._sourceHost.uid+"_"+this._versionSignBase},t.prototype.prepareSource=function(){this._isDirty()&&(this._createSource(),this._dirty=!1)},t.prototype._createSource=function(){this._setLocalSource([],[]);var e=this._sourceHost,r=this._getUpstreamSourceManagers(),n=!!r.length,a,i;if(Xl(e)){var o=e,s=void 0,l=void 0,c=void 0;if(n){var u=r[0];u.prepareSource(),c=u.getSource(),s=c.data,l=c.sourceFormat,i=[u._getVersionSign()]}else s=o.get("data",!0),l=It(s)?wn:nr,i=[];var f=this._getSourceMetaRawOption()||{},h=c&&c.metaRawOption||{},d=Ce(f.seriesLayoutBy,h.seriesLayoutBy)||null,p=Ce(f.sourceHeader,h.sourceHeader),m=Ce(f.dimensions,h.dimensions),g=d!==h.seriesLayoutBy||!!p!=!!h.sourceHeader||m;a=g?[Gf(s,{seriesLayoutBy:d,sourceHeader:p,dimensions:m},l)]:[]}else{var v=e;if(n){var y=this._applyTransform(r);a=y.sourceList,i=y.upstreamSignList}else{var b=v.get("source",!0);a=[Gf(b,this._getSourceMetaRawOption(),null)],i=[]}}this._setLocalSource(a,i)},t.prototype._applyTransform=function(e){var r=this._sourceHost,n=r.get("transform",!0),a=r.get("fromTransformResult",!0);if(a!=null){var i="";e.length!==1&&ky(i)}var o,s=[],l=[];return D(e,function(c){c.prepareSource();var u=c.getSource(a||0),f="";a!=null&&!u&&ky(f),s.push(u),l.push(c._getVersionSign())}),n?o=CC(n,s,{datasetIndex:r.componentIndex}):a!=null&&(o=[c2(s[0])]),{sourceList:o,upstreamSignList:l}},t.prototype._isDirty=function(){if(this._dirty)return!0;for(var e=this._getUpstreamSourceManagers(),r=0;r<e.length;r++){var n=e[r];if(n._isDirty()||this._upstreamSignList[r]!==n._getVersionSign())return!0}},t.prototype.getSource=function(e){e=e||0;var r=this._sourceList[e];if(!r){var n=this._getUpstreamSourceManagers();return n[0]&&n[0].getSource(e)}return r},t.prototype.getSharedDataStore=function(e){var r=e.makeStoreSchema();return this._innerGetDataStore(r.dimensions,e.source,r.hash)},t.prototype._innerGetDataStore=function(e,r,n){var a=0,i=this._storeList,o=i[a];o||(o=i[a]={});var s=o[n];if(!s){var l=this._getUpstreamSourceManagers()[0];Xl(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,n):(s=new qf,s.initData(new Om(r,e.length),e)),o[n]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(Xl(e)){var r=Cm(e);return r?[r.getSourceManager()]:[]}else return ue(s2(e),function(n){return n.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,n,a;if(Xl(e))r=e.get("seriesLayoutBy",!0),n=e.get("sourceHeader",!0),a=e.get("dimensions",!0);else if(!this._getUpstreamSourceManagers().length){var i=e;r=i.get("seriesLayoutBy",!0),n=i.get("sourceHeader",!0),a=i.get("dimensions",!0)}return{seriesLayoutBy:r,sourceHeader:n,dimensions:a}},t})();function Xl(t){return t.mainType==="series"}function ky(t){throw new Error(t)}var DC="line-height:1";function Ty(t){var e=t.lineHeight;return e==null?DC:"line-height:"+Bt(e+"")+"px"}function Cy(t,e){var r=t.color||"#6e7079",n=t.fontSize||12,a=t.fontWeight||"400",i=t.color||"#464646",o=t.fontSize||14,s=t.fontWeight||"900";return e==="html"?{nameStyle:"font-size:"+Bt(n+"")+"px;color:"+Bt(r)+";font-weight:"+Bt(a+""),valueStyle:"font-size:"+Bt(o+"")+"px;color:"+Bt(i)+";font-weight:"+Bt(s+"")}:{nameStyle:{fontSize:n,fill:r,fontWeight:a},valueStyle:{fontSize:o,fill:i,fontWeight:s}}}var IC=[0,10,20,30],LC=["",`
|
|
13
13
|
`,`
|
|
14
14
|
|
|
15
15
|
`,`
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
`];function so(t,e){return e.type=t,e}function th(t){return t.type==="section"}function gy(t){return th(t)?vC:gC}function my(t){if(th(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return D(t.blocks,function(a){var i=my(a);i>=e&&(e=i+ +(n&&(!i||th(a)&&!a.noHeader)))}),e}return 0}function vC(t,e,r,n){var a=e.noHeader,i=mC(my(e)),o=[],s=e.blocks||[];zr(!s||ne(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Dn(c,l)){var u=new r2(c[l],null);s.sort(function(m,v){return u.evaluate(m.sortParam,v.sortParam)})}else l==="seriesDesc"&&s.reverse()}D(s,function(m,v){var g=e.valueFormatter,y=gy(m)(g?G(G({},t),{valueFormatter:g}):t,m,v>0?i.html:0,n);y!=null&&o.push(y)});var f=t.renderMode==="richText"?o.join(i.richText):rh(n,o.join(""),a?r:i.html);if(a)return f;var h=Kf(e.header,"ordinal",t.useUTC),d=vy(n,t.renderMode).nameStyle,p=py(n);return t.renderMode==="richText"?_y(t,h,d)+i.richText+f:rh(n,'<div style="'+d+";"+p+';">'+Dt(h)+"</div>"+f,r)}function gC(t,e,r,n){var a=t.renderMode,i=e.noName,o=e.noValue,s=!e.markerType,l=e.name,c=t.useUTC,u=e.valueFormatter||t.valueFormatter||function(x){return x=ne(x)?x:[x],fe(x,function(S,w){return Kf(S,ne(d)?d[w]:d,c)})};if(!(i&&o)){var f=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),h=i?"":Kf(l,"ordinal",c),d=e.valueType,p=o?[]:u(e.value,e.dataIndex),m=!s||!i,v=!s&&i,g=vy(n,a),y=g.nameStyle,b=g.valueStyle;return a==="richText"?(s?"":f)+(i?"":_y(t,h,y))+(o?"":bC(t,p,m,v,b)):rh(n,(s?"":f)+(i?"":yC(h,!s,y))+(o?"":_C(p,m,v,b)),r)}}function yy(t,e,r,n,a,i){if(t){var o=gy(t),s={useUTC:a,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,i)}}function mC(t){return{html:dC[t],richText:pC[t]}}function rh(t,e,r){var n='<div style="clear:both"></div>',a="margin: "+r+"px 0 0",i=py(t);return'<div style="'+a+";"+i+';">'+e+n+"</div>"}function yC(t,e,r){var n=e?"margin-left:2px":"";return'<span style="'+r+";"+n+'">'+Dt(t)+"</span>"}function _C(t,e,r,n){var a=r?"10px":"20px",i=e?"float:right;margin-left:"+a:"";return t=ne(t)?t:[t],'<span style="'+i+";"+n+'">'+fe(t,function(o){return Dt(o)}).join(" ")+"</span>"}function _y(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function bC(t,e,r,n,a){var i=[a],o=n?10:20;return r&&i.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ne(e)?e.join(" "):e,i)}function xC(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return ra(n)}function by(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var nh=(function(){function t(){this.richTextStyles={},this._nextStyleNameId=og()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var a=n==="richText"?this._generateStyleName():null,i=U2({color:r,type:e,renderMode:n,markerId:a});return oe(i)?i:(this.richTextStyles[a]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ne(r)?D(r,function(i){return G(n,i)}):G(n,r);var a=this._generateStyleName();return this.richTextStyles[a]=n,"{"+a+"|"+e+"}"},t})();function wC(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,a=e.getData(),i=a.mapDimensionsAll("defaultedTooltip"),o=i.length,s=e.getRawValue(r),l=ne(s),c=xC(e,r),u,f,h,d;if(o>1||l&&!o){var p=SC(s,e,r,i,c);u=p.inlineValues,f=p.inlineValueTypes,h=p.blocks,d=p.inlineValues[0]}else if(o){var m=a.getDimensionInfo(i[0]);d=u=Ga(a,r,i[0]),f=m.type}else d=u=l?s[0]:s;var v=Ku(e),g=v&&e.name||"",y=a.getName(r),b=n?g:y;return so("section",{header:g,noHeader:n||!v,sortParam:d,blocks:[so("nameValue",{markerType:"item",markerColor:c,name:b,noName:!xr(b),value:u,valueType:f,dataIndex:r})].concat(h||[])})}function SC(t,e,r,n,a){var i=e.getData(),o=xa(t,function(f,h,d){var p=i.getDimensionInfo(d);return f=f||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],c=[];n.length?D(n,function(f){u(Ga(i,r,f),f)}):D(t,u);function u(f,h){var d=i.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?c.push(so("nameValue",{markerType:"subItem",markerColor:a,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:c}}var vn=je();function Fl(t,e){return t.getName(e)||t.getId(e)}var kC="__universalTransitionEnabled",Pr=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,a){this.seriesIndex=this.componentIndex,this.dataTask=oo({count:CC,reset:MC}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,a);var i=vn(this).sourceManager=new fC(this);i.prepareSource();var o=this.getInitialData(r,a);wy(o,this),this.dataTask.context.data=o,vn(this).dataBeforeProcessed=o,xy(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=io(this),i=a?Bl(r):{},o=this.subType;Ne.hasClass(o)&&(o+="Series"),Me(r,n.getTheme().get(this.subType)),Me(r,this.getDefaultOption()),fg(r,"label",["show"]),this.fillDataTextStyle(r.data),a&&Ka(r,i,a)},e.prototype.mergeOption=function(r,n){r=Me(this.option,r,!0),this.fillDataTextStyle(r.data);var a=io(this);a&&Ka(this.option,r,a);var i=vn(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(r,n);wy(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,vn(this).dataBeforeProcessed=o,xy(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!wt(r))for(var n=["show"],a=0;a<r.length;a++)r[a]&&r[a].label&&fg(r[a],"label",n)},e.prototype.getInitialData=function(r,n){},e.prototype.appendData=function(r){var n=this.getRawData();n.appendData(r.data)},e.prototype.getData=function(r){var n=ah(this);if(n){var a=n.context.data;return r==null||!a.getLinkedData?a:a.getLinkedData(r)}else return vn(this).data},e.prototype.getAllData=function(){var r=this.getData();return r&&r.getLinkedDataAll?r.getLinkedDataAll():[{data:r}]},e.prototype.setData=function(r){var n=ah(this);if(n){var a=n.context;a.outputData=r,n!==this.dataTask&&(a.data=r)}vn(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return de(r)},e.prototype.getSourceManager=function(){return vn(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return vn(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var r=this.get("colorBy");return r||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var r=this.coordinateSystem;return r&&r.getBaseAxis&&r.getBaseAxis()},e.prototype.formatTooltip=function(r,n,a){return wC({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(ve.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,a){var i=this.ecModel,o=Jf.prototype.getColorFromPalette.call(this,r,n,a);return o||(o=i.getColorFromPalette(r,n,a)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var a=this.option.selectedMap;if(a){var i=this.option.selectedMode,o=this.getData(n);if(i==="series"||a==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<r.length;s++){var l=r[s],c=Fl(o,l);a[c]=!1,this._selectedDataIndicesMap[c]=-1}}},e.prototype.toggleSelect=function(r,n){for(var a=[],i=0;i<r.length;i++)a[0]=r[i],this.isSelected(r[i],n)?this.unselect(a,n):this.select(a,n)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var r=this._selectedDataIndicesMap,n=Ge(r),a=[],i=0;i<n.length;i++){var o=r[n[i]];o>=0&&a.push(o)}return a},e.prototype.isSelected=function(r,n){var a=this.option.selectedMap;if(!a)return!1;var i=this.getData(n);return(a==="all"||a[Fl(i,r)])&&!i.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[kC])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var a,i,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ce(o.selectedMap)||(o.selectedMap={});for(var c=o.selectedMap,u=0;u<l;u++){var f=n[u],h=Fl(r,f);c[h]=!0,this._selectedDataIndicesMap[h]=r.getRawIndex(f)}}else if(s==="single"||s===!0){var d=n[l-1],h=Fl(r,d);o.selectedMap=(a={},a[h]=!0,a),this._selectedDataIndicesMap=(i={},i[h]=r.getRawIndex(d),i)}}},e.prototype._initSelectedMapFromData=function(r){if(!this.option.selectedMap){var n=[];r.hasItemOption&&r.each(function(a){var i=r.getRawDataItem(a);i&&i.selected&&n.push(a)}),n.length>0&&this._innerSelect(r,n)}},e.registerClass=function(r){return Ne.registerClass(r)},e.protoInitialize=(function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),e})(Ne);br(Pr,eC),br(Pr,Jf),av(Pr,Ne);function xy(t){var e=t.name;Ku(t)||(t.name=TC(t)||e)}function TC(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return D(r,function(a){var i=e.getDimensionInfo(a);i.displayName&&n.push(i.displayName)}),n.join(" ")}function CC(t){return t.model.getRawData().count()}function MC(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),AC}function AC(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function wy(t,e){D(dw(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,Ke(DC,e))})}function DC(t,e){var r=ah(t);return r&&r.setOutputEnd((e||this).count()),e}function ah(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(t.uid))}return n}}var IC=Oe.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n+i),t.lineTo(r-a,n+i),t.closePath()}}),PC=Oe.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n),t.lineTo(r,n+i),t.lineTo(r-a,n),t.closePath()}}),LC=Oe.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.x,n=e.y,a=e.width/5*3,i=Math.max(a,e.height),o=a/2,s=o*o/(i-o),l=n-i+o+s,c=Math.asin(s/o),u=Math.cos(c)*o,f=Math.sin(c),h=Math.cos(c),d=o*.6,p=o*.7;t.moveTo(r-u,l+s),t.arc(r,l,o,Math.PI-c,Math.PI*2+c),t.bezierCurveTo(r+u-f*d,l+s+h*d,r,n-p,r,n),t.bezierCurveTo(r,n-p,r-u+f*d,l+s+h*d,r-u,l+s),t.closePath()}}),RC=Oe.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.height,n=e.width,a=e.x,i=e.y,o=n/3*2;t.moveTo(a,i),t.lineTo(a+o,i+r),t.lineTo(a,i+r/4*3),t.lineTo(a-o,i+r),t.lineTo(a,i),t.closePath()}}),EC={line:fn,rect:at,roundRect:at,square:at,circle:al,diamond:PC,pin:LC,arrow:RC,triangle:IC},OC={line:function(t,e,r,n,a){a.x1=t,a.y1=e+n/2,a.x2=t+r,a.y2=e+n/2},rect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n},roundRect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n,a.r=Math.min(r,n)/4},square:function(t,e,r,n,a){var i=Math.min(r,n);a.x=t,a.y=e,a.width=i,a.height=i},circle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.r=Math.min(r,n)/2},diamond:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n},pin:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},arrow:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},triangle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n}},ih={};D(EC,function(t,e){ih[e]=new t});var NC=Oe.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var n=xs(t,e,r),a=this.shape;return a&&a.symbolType==="pin"&&e.position==="inside"&&(n.y=r.y+r.height*.4),n},buildPath:function(t,e,r){var n=e.symbolType;if(n!=="none"){var a=ih[n];a||(n="rect",a=ih[n]),OC[n](e.x,e.y,e.width,e.height,a.shape),a.buildPath(t,a.shape,r)}}});function BC(t,e){if(this.type!=="image"){var r=this.style;this.__isEmptyBrush?(r.stroke=t,r.fill=e||"#fff",r.lineWidth=2):this.shape.symbolType==="line"?r.stroke=t:r.fill=t,this.markRedraw()}}function ja(t,e,r,n,a,i,o){var s=t.indexOf("empty")===0;s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return t.indexOf("image://")===0?l=Kg(t.slice(8),new Le(e,r,n,a),o?"center":"cover"):t.indexOf("path://")===0?l=wf(t.slice(7),{},new Le(e,r,n,a),o?"center":"cover"):l=new NC({shape:{symbolType:t,x:e,y:r,width:n,height:a}}),l.__isEmptyBrush=s,l.setColor=BC,i&&l.setColor(i),l}function zC(t){return ne(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Sy(t,e){if(t!=null)return ne(t)||(t=[t,t]),[_t(t[0],e[0])||0,_t(ke(t[1],t[0]),e[1])||0]}var FC=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r){return Ff(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var n=new ct,a=ja("line",0,r.itemHeight/2,r.itemWidth,0,r.lineStyle.stroke,!1);n.add(a),a.setStyle(r.lineStyle);var i=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=i==="none"?"circle":i,l=r.itemHeight*.8,c=ja(s,(r.itemWidth-l)/2,(r.itemHeight-l)/2,l,l,r.itemStyle.fill);n.add(c),c.setStyle(r.itemStyle);var u=r.iconRotate==="inherit"?o:r.iconRotate||0;return c.rotation=u*Math.PI/180,c.setOrigin([r.itemWidth/2,r.itemHeight/2]),s.indexOf("empty")>-1&&(c.style.stroke=c.style.fill,c.style.fill="#fff",c.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e})(Pr);function oh(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var a=Ga(t,e,r[0]);return a!=null?a+"":null}else if(n){for(var i=[],o=0;o<r.length;o++)i.push(Ga(t,e,r[o]));return i.join(" ")}}function ky(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!ne(e))return e+"";for(var n=[],a=0;a<r.length;a++){var i=t.getDimensionIndex(r[a]);i>=0&&n.push(e[i])}return n.join(" ")}var sh=(function(t){U(e,t);function e(r,n,a,i){var o=t.call(this)||this;return o.updateData(r,n,a,i),o}return e.prototype._createSymbol=function(r,n,a,i,o){this.removeAll();var s=ja(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),s.drift=HC,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){Js(this.childAt(0))},e.prototype.downplay=function(){el(this.childAt(0))},e.prototype.setZ=function(r,n){var a=this.childAt(0);a.zlevel=r,a.z=n},e.prototype.setDraggable=function(r,n){var a=this.childAt(0);a.draggable=r,a.cursor=!n&&r?"move":a.cursor},e.prototype.updateData=function(r,n,a,i){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),c=o!==this._symbolType,u=i&&i.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,f)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};u?h.attr(d):Nt(h,d,s,n),Zg(h)}if(this._updateCommon(r,n,l,a,i),c){var h=this.childAt(0);if(!u){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,Ur(h,d,s,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,a,i,o){var s=this.childAt(0),l=r.hostModel,c,u,f,h,d,p,m,v,g;if(i&&(c=i.emphasisItemStyle,u=i.blurItemStyle,f=i.selectItemStyle,h=i.focus,d=i.blurScope,m=i.labelStatesModels,v=i.hoverScale,g=i.cursorStyle,p=i.emphasisDisabled),!i||r.hasItemOption){var y=i&&i.itemModel?i.itemModel:r.getItemModel(n),b=y.getModel("emphasis");c=b.getModel("itemStyle").getItemStyle(),f=y.getModel(["select","itemStyle"]).getItemStyle(),u=y.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),p=b.get("disabled"),m=ml(y),v=b.getShallow("scale"),g=y.getShallow("cursor")}var x=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=Sy(r.getItemVisual(n,"symbolOffset"),a);S&&(s.x=S[0],s.y=S[1]),g&&s.attr("cursor",g);var w=r.getItemVisual(n,"style"),k=w.fill;if(s instanceof un){var T=s.style;s.useStyle(G({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(G({},w)):s.useStyle(w),s.style.decal=null,s.setColor(k,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var M=r.getItemVisual(n,"liftZ"),A=this._z2;M!=null?A==null&&(this._z2=s.z2,s.z2+=M):A!=null&&(s.z2=A,this._z2=null);var C=o&&o.useNameLabel;gl(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:k,defaultOpacity:w.opacity});function I(E){return C?r.getName(E):oh(r,E)}this._sizeX=a[0]/2,this._sizeY=a[1]/2;var P=s.ensureState("emphasis");P.style=c,s.ensureState("select").style=f,s.ensureState("blur").style=u;var R=v==null||v===!0?Math.max(1.1,3/this._sizeY):isFinite(v)&&v>0?+v:1;P.scaleX=this._sizeX*R,P.scaleY=this._sizeY*R,this.setSymbolScale(1),tl(this,h,d,p)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,a){var i=this.childAt(0),o=Ee(this).dataIndex,s=a&&a.animation;if(this.silent=i.silent=!0,a&&a.fadeLabel){var l=i.getTextContent();l&&ul(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){i.removeTextContent()}})}else i.removeTextContent();ul(i,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return zC(r.getItemVisual(n,"symbolSize"))},e})(ct);function HC(t,e){this.parent.drift(t,e)}function lh(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Ty(t){return t!=null&&!ce(t)&&(t={isIgnore:t}),t||{}}function Cy(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:ml(e),cursorStyle:e.get("cursor")}}var VC=(function(){function t(e){this.group=new ct,this._SymbolCtor=e||sh}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Ty(r);var n=this.group,a=e.hostModel,i=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=Cy(e),c={disableAnimation:s},u=r.getSymbolPoint||function(f){return e.getItemLayout(f)};i||n.removeAll(),e.diff(i).add(function(f){var h=u(f);if(lh(e,h,f,r)){var d=new o(e,f,l,c);d.setPosition(h),e.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=i.getItemGraphicEl(h),p=u(f);if(!lh(e,p,f,r)){n.remove(d);return}var m=e.getItemVisual(f,"symbol")||"circle",v=d&&d.getSymbolType&&d.getSymbolType();if(!d||v&&v!==m)n.remove(d),d=new o(e,f,l,c),d.setPosition(p);else{d.updateData(e,f,l,c);var g={x:p[0],y:p[1]};s?d.attr(g):Nt(d,g,a)}n.add(d),e.setItemGraphicEl(f,d)}).remove(function(f){var h=i.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},a)}).execute(),this._getSymbolPoint=u,this._data=e},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(n,a){var i=e._getSymbolPoint(a);n.setPosition(i),n.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=Cy(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[],n=Ty(n);function a(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var o=r.getItemLayout(i);if(lh(r,o,i,n)){var s=new this._SymbolCtor(r,i,this._seriesScope);s.traverse(a),s.setPosition(o),this.group.add(s),r.setItemGraphicEl(i,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(e){pl(this._progressiveEls||this.group,e)},t.prototype.remove=function(e){var r=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(a){a.fadeOut(function(){r.remove(a)},n.hostModel)}):r.removeAll()},t})();function My(t,e,r){var n=t.getBaseAxis(),a=t.getOtherAxis(n),i=GC(a,r),o=n.dim,s=a.dim,l=e.mapDimension(s),c=e.mapDimension(o),u=s==="x"||s==="radius"?1:0,f=fe(t.dimensions,function(p){return e.mapDimension(p)}),h=!1,d=e.getCalculationInfo("stackResultDimension");return Ya(e,f[0])&&(h=!0,f[0]=d),Ya(e,f[1])&&(h=!0,f[1]=d),{dataDimsForPoint:f,valueStart:i,valueAxisDim:s,baseAxisDim:o,stacked:!!h,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function GC(t,e){var r=0,n=t.scale.getExtent();return e==="start"?r=n[0]:e==="end"?r=n[1]:He(e)&&!isNaN(e)?r=e:n[0]>0?r=n[0]:n[1]<0&&(r=n[1]),r}function Ay(t,e,r,n){var a=NaN;t.stacked&&(a=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=t.valueStart);var i=t.baseDataOffset,o=[];return o[i]=r.get(t.baseDim,n),o[1-i]=a,e.dataToPoint(o)}var Dy=typeof Float32Array<"u",WC=Dy?Float32Array:Array;function Xr(t){return ne(t)?Dy?new Float32Array(t):t:new WC(t)}function $C(t,e){var r=[];return e.diff(t).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,a){r.push({cmd:"=",idx:a,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function UC(t,e,r,n,a,i,o,s){for(var l=$C(t,e),c=[],u=[],f=[],h=[],d=[],p=[],m=[],v=My(a,e,o),g=t.getLayout("points")||[],y=e.getLayout("points")||[],b=0;b<l.length;b++){var x=l[b],S=!0,w=void 0,k=void 0;switch(x.cmd){case"=":w=x.idx*2,k=x.idx1*2;var T=g[w],M=g[w+1],A=y[k],C=y[k+1];(isNaN(T)||isNaN(M))&&(T=A,M=C),c.push(T,M),u.push(A,C),f.push(r[w],r[w+1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(x.idx1));break;case"+":var I=x.idx,P=v.dataDimsForPoint,R=a.dataToPoint([e.get(P[0],I),e.get(P[1],I)]);k=I*2,c.push(R[0],R[1]),u.push(y[k],y[k+1]);var E=Ay(v,a,e,I);f.push(E[0],E[1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(I));break;case"-":S=!1}S&&(d.push(x),p.push(p.length))}p.sort(function(Te,Ue){return m[Te]-m[Ue]});for(var O=c.length,K=Xr(O),L=Xr(O),B=Xr(O),V=Xr(O),$=[],b=0;b<p.length;b++){var X=p[b],ue=b*2,_e=X*2;K[ue]=c[_e],K[ue+1]=c[_e+1],L[ue]=u[_e],L[ue+1]=u[_e+1],B[ue]=f[_e],B[ue+1]=f[_e+1],V[ue]=h[_e],V[ue+1]=h[_e+1],$[b]=d[X]}return{current:K,next:L,stackedOnCurrent:B,stackedOnNext:V,status:$}}var gn=Math.min,mn=Math.max;function na(t,e){return isNaN(t)||isNaN(e)}function ch(t,e,r,n,a,i,o,s,l){for(var c,u,f,h,d,p,m=r,v=0;v<n;v++){var g=e[m*2],y=e[m*2+1];if(m>=a||m<0)break;if(na(g,y)){if(l){m+=i;continue}break}if(m===r)t[i>0?"moveTo":"lineTo"](g,y),f=g,h=y;else{var b=g-c,x=y-u;if(b*b+x*x<.5){m+=i;continue}if(o>0){for(var S=m+i,w=e[S*2],k=e[S*2+1];w===g&&k===y&&v<n;)v++,S+=i,m+=i,w=e[S*2],k=e[S*2+1],g=e[m*2],y=e[m*2+1],b=g-c,x=y-u;var T=v+1;if(l)for(;na(w,k)&&T<n;)T++,S+=i,w=e[S*2],k=e[S*2+1];var M=.5,A=0,C=0,I=void 0,P=void 0;if(T>=n||na(w,k))d=g,p=y;else{A=w-c,C=k-u;var R=g-c,E=w-g,O=y-u,K=k-y,L=void 0,B=void 0;if(s==="x"){L=Math.abs(R),B=Math.abs(E);var V=A>0?1:-1;d=g-V*L*o,p=y,I=g+V*B*o,P=y}else if(s==="y"){L=Math.abs(O),B=Math.abs(K);var $=C>0?1:-1;d=g,p=y-$*L*o,I=g,P=y+$*B*o}else L=Math.sqrt(R*R+O*O),B=Math.sqrt(E*E+K*K),M=B/(B+L),d=g-A*o*(1-M),p=y-C*o*(1-M),I=g+A*o*M,P=y+C*o*M,I=gn(I,mn(w,g)),P=gn(P,mn(k,y)),I=mn(I,gn(w,g)),P=mn(P,gn(k,y)),A=I-g,C=P-y,d=g-A*L/B,p=y-C*L/B,d=gn(d,mn(c,g)),p=gn(p,mn(u,y)),d=mn(d,gn(c,g)),p=mn(p,gn(u,y)),A=g-d,C=y-p,I=g+A*B/L,P=y+C*B/L}t.bezierCurveTo(f,h,d,p,g,y),f=I,h=P}else t.lineTo(g,y)}c=g,u=y,m+=i}return v}var Iy=(function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t})(),YC=(function(t){U(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Iy},e.prototype.buildPath=function(r,n){var a=n.points,i=0,o=a.length/2;if(n.connectNulls){for(;o>0&&na(a[o*2-2],a[o*2-1]);o--);for(;i<o&&na(a[i*2],a[i*2+1]);i++);}for(;i<o;)i+=ch(r,a,i,o,o,1,n.smooth,n.smoothMonotone,n.connectNulls)+1},e.prototype.getPointOn=function(r,n){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var a=this.path,i=a.data,o=Wn.CMD,s,l,c=n==="x",u=[],f=0;f<i.length;){var h=i[f++],d=void 0,p=void 0,m=void 0,v=void 0,g=void 0,y=void 0,b=void 0;switch(h){case o.M:s=i[f++],l=i[f++];break;case o.L:if(d=i[f++],p=i[f++],b=c?(r-s)/(d-s):(r-l)/(p-l),b<=1&&b>=0){var x=c?(p-l)*b+l:(d-s)*b+s;return c?[r,x]:[x,r]}s=d,l=p;break;case o.C:d=i[f++],p=i[f++],m=i[f++],v=i[f++],g=i[f++],y=i[f++];var S=c?Ts(s,d,m,g,r,u):Ts(l,p,v,y,r,u);if(S>0)for(var w=0;w<S;w++){var k=u[w];if(k<=1&&k>=0){var x=c?lt(l,p,v,y,k):lt(s,d,m,g,k);return c?[r,x]:[x,r]}}s=g,l=y;break}}},e})(Oe),qC=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Iy),XC=(function(t){U(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new qC},e.prototype.buildPath=function(r,n){var a=n.points,i=n.stackedOnPoints,o=0,s=a.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&na(a[s*2-2],a[s*2-1]);s--);for(;o<s&&na(a[o*2],a[o*2+1]);o++);}for(;o<s;){var c=ch(r,a,o,s,s,1,n.smooth,l,n.connectNulls);ch(r,i,o+c-1,c,s,-1,n.stackedOnSmooth,l,n.connectNulls),o+=c+1,r.closePath()}},e})(Oe);function uh(){var t=je();return function(e){var r=t(e),n=e.pipelineContext,a=!!r.large,i=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(a!==o||i!==s)&&"reset"}}var Py=je(),ZC=uh(),ir=(function(){function t(){this.group=new ct,this.uid=kl("viewChart"),this.renderTask=oo({plan:KC,reset:jC}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.highlight=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Ry(i,a,"emphasis")},t.prototype.downplay=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Ry(i,a,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateLayout=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateVisual=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.eachRendered=function(e){pl(this.group,e)},t.markUpdateMethod=function(e,r){Py(e).updateMethod=r},t.protoInitialize=(function(){var e=t.prototype;e.type="chart"})(),t})();function Ly(t,e,r){t&&cf(t)&&(e==="emphasis"?Js:el)(t,r)}function Ry(t,e,r){var n=Xn(t,e),a=e&&e.highlightKey!=null?Bk(e.highlightKey):null;n!=null?D(ht(n),function(i){Ly(t.getItemGraphicEl(i),r,a)}):t.eachItemGraphicEl(function(i){Ly(i,r,a)})}ou(ir),ms(ir);function KC(t){return ZC(t.model)}function jC(t){var e=t.model,r=t.ecModel,n=t.api,a=t.payload,i=e.pipelineContext.progressiveRender,o=t.view,s=a&&Py(a).updateMethod,l=i?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,a),QC[l]}var QC={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function Ey(t,e,r,n,a){var i=t.getArea(),o=i.x,s=i.y,l=i.width,c=i.height,u=r.get(["lineStyle","width"])||0;o-=u/2,s-=u/2,l+=u,c+=u,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var f=new at({shape:{x:o,y:s,width:l,height:c}});if(e){var h=t.getBaseAxis(),d=h.isHorizontal(),p=h.inverse;d?(p&&(f.shape.x+=l),f.shape.width=0):(p||(f.shape.y+=c),f.shape.height=0);var m=ye(a)?function(v){a(v,f)}:null;Ur(f,{shape:{width:l,height:c,x:o,y:s}},r,null,n,m)}return f}function Oy(t,e,r){var n=t.getArea(),a=tt(n.r0,1),i=tt(n.r,1),o=new Fa({shape:{cx:tt(t.cx,1),cy:tt(t.cy,1),r0:a,r:i,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});if(e){var s=t.getBaseAxis().dim==="angle";s?o.shape.endAngle=n.startAngle:o.shape.r=a,Ur(o,{shape:{endAngle:n.endAngle,r:i}},r)}return o}function JC(t,e,r,n,a){if(t){if(t.type==="polar")return Oy(t,e,r);if(t.type==="cartesian2d")return Ey(t,e,r,n,a)}else return null;return null}function fh(t,e){return t.type===e}function Ny(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function By(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,i=0;i<t.length;){var o=t[i++],s=t[i++];isNaN(o)||(e=Math.min(o,e),n=Math.max(o,n)),isNaN(s)||(r=Math.min(s,r),a=Math.max(s,a))}return[[e,r],[n,a]]}function zy(t,e){var r=By(t),n=r[0],a=r[1],i=By(e),o=i[0],s=i[1];return Math.max(Math.abs(n[0]-o[0]),Math.abs(n[1]-o[1]),Math.abs(a[0]-s[0]),Math.abs(a[1]-s[1]))}function Fy(t){return He(t)?t:t?.5:0}function eM(t,e,r){if(!r.valueDim)return[];for(var n=e.count(),a=Xr(n*2),i=0;i<n;i++){var o=Ay(r,t,e,i);a[i*2]=o[0],a[i*2+1]=o[1]}return a}function yn(t,e,r,n,a){var i=r.getBaseAxis(),o=i.dim==="x"||i.dim==="radius"?0:1,s=[],l=0,c=[],u=[],f=[],h=[];if(a){for(l=0;l<t.length;l+=2){var d=e||t;!isNaN(d[l])&&!isNaN(d[l+1])&&h.push(t[l],t[l+1])}t=h}for(l=0;l<t.length-2;l+=2)switch(f[0]=t[l+2],f[1]=t[l+3],u[0]=t[l],u[1]=t[l+1],s.push(u[0],u[1]),n){case"end":c[o]=f[o],c[1-o]=u[1-o],s.push(c[0],c[1]);break;case"middle":var p=(u[o]+f[o])/2,m=[];c[o]=m[o]=p,c[1-o]=u[1-o],m[1-o]=f[1-o],s.push(c[0],c[1]),s.push(m[0],m[1]);break;default:c[o]=u[o],c[1-o]=f[1-o],s.push(c[0],c[1])}return s.push(t[l++],t[l++]),s}function tM(t,e){var r=[],n=t.length,a,i;function o(u,f,h){var d=u.coord,p=(h-d)/(f.coord-d),m=nS(p,[u.color,f.color]);return{coord:h,color:m}}for(var s=0;s<n;s++){var l=t[s],c=l.coord;if(c<0)a=l;else if(c>e){i?r.push(o(i,l,e)):a&&r.push(o(a,l,0),o(a,l,e));break}else a&&(r.push(o(a,l,0)),a=null),r.push(l),i=l}return r}function rM(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var a,i,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(a=s&&s.coordDim,a==="x"||a==="y"){i=n[o];break}}if(i){var l=e.getAxis(a),c=fe(i.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),u=c.length,f=i.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),f.reverse());var h=tM(c,a==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&u)return c[0].coord<0?f[1]?f[1]:c[u-1].color:f[0]?f[0]:c[0].color;var p=10,m=h[0].coord-p,v=h[d-1].coord+p,g=v-m;if(g<.001)return"transparent";D(h,function(b){b.offset=(b.coord-m)/g}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var y=new qg(0,0,0,0,h,!0);return y[a]=m,y[a+"2"]=v,y}}}function nM(t,e,r){var n=t.get("showAllSymbol"),a=n==="auto";if(!(n&&!a)){var i=r.getAxesByScale("ordinal")[0];if(i&&!(a&&aM(i,e))){var o=e.mapDimension(i.dim),s={};return D(i.getViewLabels(),function(l){var c=i.scale.getRawOrdinalNumber(l.tickValue);s[c]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function aM(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var a=e.count(),i=Math.max(1,Math.round(a/5)),o=0;o<a;o+=i)if(sh.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>n)return!1;return!0}function iM(t,e){return isNaN(t)||isNaN(e)}function oM(t){for(var e=t.length/2;e>0&&iM(t[e*2-2],t[e*2-1]);e--);return e-1}function Hy(t,e){return[t[e*2],t[e*2+1]]}function sM(t,e,r){for(var n=t.length/2,a=r==="x"?0:1,i,o,s=0,l=-1,c=0;c<n;c++)if(o=t[c*2+a],!(isNaN(o)||isNaN(t[c*2+1-a]))){if(c===0){i=o;continue}if(i<=e&&o>=e||i>=e&&o<=e){l=c;break}s=c,i=o}return{range:[s,l],t:(e-i)/(o-i)}}function Vy(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Ar.length;e++)if(t.get([Ar[e],"endLabel","show"]))return!0;return!1}function hh(t,e,r,n){if(fh(e,"cartesian2d")){var a=n.getModel("endLabel"),i=a.get("valueAnimation"),o=n.getData(),s={lastFrameIndex:0},l=Vy(n)?function(d,p){t._endLabelOnDuring(d,p,o,s,i,a,e)}:null,c=e.getBaseAxis().isHorizontal(),u=Ey(e,r,n,function(){var d=t._endLabel;d&&r&&s.originalX!=null&&d.attr({x:s.originalX,y:s.originalY})},l);if(!n.get("clip",!0)){var f=u.shape,h=Math.max(f.width,f.height);c?(f.y-=h,f.height+=h*2):(f.x-=h,f.width+=h*2)}return l&&l(1,u),u}else return Oy(e,r,n)}function lM(t,e){var r=e.getBaseAxis(),n=r.isHorizontal(),a=r.inverse,i=n?a?"right":"left":"center",o=n?"middle":a?"top":"bottom";return{normal:{align:t.get("align")||i,verticalAlign:t.get("verticalAlign")||o}}}var cM=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new ct,n=new VC;this.group.add(n.group),this._symbolDraw=n,this._lineGroup=r,this._changePolyState=Ae(this._changePolyState,this)},e.prototype.render=function(r,n,a){var i=r.coordinateSystem,o=this.group,s=r.getData(),l=r.getModel("lineStyle"),c=r.getModel("areaStyle"),u=s.getLayout("points")||[],f=i.type==="polar",h=this._coordSys,d=this._symbolDraw,p=this._polyline,m=this._polygon,v=this._lineGroup,g=!n.ssr&&r.get("animation"),y=!c.isEmpty(),b=c.get("origin"),x=My(i,s,b),S=y&&eM(i,s,x),w=r.get("showSymbol"),k=r.get("connectNulls"),T=w&&!f&&nM(r,s,i),M=this._data;M&&M.eachItemGraphicEl(function(Te,Ue){Te.__temp&&(o.remove(Te),M.setItemGraphicEl(Ue,null))}),w||d.remove(),o.add(v);var A=f?!1:r.get("step"),C;i&&i.getArea&&r.get("clip",!0)&&(C=i.getArea(),C.width!=null?(C.x-=.1,C.y-=.1,C.width+=.2,C.height+=.2):C.r0&&(C.r0-=.5,C.r+=.5)),this._clipShapeForSymbol=C;var I=rM(s,i,a)||s.getVisual("style")[s.getVisual("drawType")];if(!(p&&h.type===i.type&&A===this._step))w&&d.updateData(s,{isIgnore:T,clipShape:C,disableAnimation:!0,getSymbolPoint:function(Te){return[u[Te*2],u[Te*2+1]]}}),g&&this._initSymbolLabelAnimation(s,i,C),A&&(S&&(S=yn(S,u,i,A,k)),u=yn(u,null,i,A,k)),p=this._newPolyline(u),y?m=this._newPolygon(u,S):m&&(v.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,ra(I)),v.setClipPath(hh(this,i,!0,r));else{y&&!m?m=this._newPolygon(u,S):m&&!y&&(v.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,ra(I));var P=v.getClipPath();if(P){var R=hh(this,i,!1,r);Ur(P,{shape:R.shape},r)}else v.setClipPath(hh(this,i,!0,r));w&&d.updateData(s,{isIgnore:T,clipShape:C,disableAnimation:!0,getSymbolPoint:function(Te){return[u[Te*2],u[Te*2+1]]}}),(!Ny(this._stackedOnPoints,S)||!Ny(this._points,u))&&(g?this._doUpdateAnimation(s,S,i,a,A,b,k):(A&&(S&&(S=yn(S,u,i,A,k)),u=yn(u,null,i,A,k)),p.setShape({points:u}),m&&m.setShape({points:u,stackedOnPoints:S})))}var E=r.getModel("emphasis"),O=E.get("focus"),K=E.get("blurScope"),L=E.get("disabled");if(p.useStyle(Ie(l.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),lf(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var B=p.getState("emphasis").style;B.lineWidth=+p.style.lineWidth+1}Ee(p).seriesIndex=r.seriesIndex,tl(p,O,K,L);var V=Fy(r.get("smooth")),$=r.get("smoothMonotone");if(p.setShape({smooth:V,smoothMonotone:$,connectNulls:k}),m){var X=s.getCalculationInfo("stackedOnSeries"),ue=0;m.useStyle(Ie(c.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),X&&(ue=Fy(X.get("smooth"))),m.setShape({smooth:V,stackedOnSmooth:ue,smoothMonotone:$,connectNulls:k}),lf(m,r,"areaStyle"),Ee(m).seriesIndex=r.seriesIndex,tl(m,O,K,L)}var _e=this._changePolyState;s.eachItemGraphicEl(function(Te){Te&&(Te.onHoverStateChange=_e)}),this._polyline.onHoverStateChange=_e,this._data=s,this._coordSys=i,this._stackedOnPoints=S,this._points=u,this._step=A,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,p),m&&this.packEventData(r,m))},e.prototype.packEventData=function(r,n){Ee(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,n,a,i){var o=r.getData(),s=Xn(o,i);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),c=o.getItemGraphicEl(s);if(!c){var u=l[s*2],f=l[s*2+1];if(isNaN(u)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(u,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;c=new sh(o,s),c.x=u,c.y=f,c.setZ(h,d);var p=c.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=d,p.z2=this._polyline.z2+1),c.__temp=!0,o.setItemGraphicEl(s,c),c.stopSymbolAnimation(!0),this.group.add(c)}c.highlight()}else ir.prototype.highlight.call(this,r,n,a,i)},e.prototype.downplay=function(r,n,a,i){var o=r.getData(),s=Xn(o,i);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else ir.prototype.downplay.call(this,r,n,a,i)},e.prototype._changePolyState=function(r){var n=this._polygon;Sg(this._polyline,r),n&&Sg(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new YC({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var a=this._polygon;return a&&this._lineGroup.remove(a),a=new XC({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(a),this._polygon=a,a},e.prototype._initSymbolLabelAnimation=function(r,n,a){var i,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(i=s.isHorizontal(),o=!1):n.type==="polar"&&(i=s.dim==="angle",o=!0);var c=r.hostModel,u=c.get("animationDuration");ye(u)&&(u=u(null));var f=c.get("animationDelay")||0,h=ye(f)?f(null):f;r.eachItemGraphicEl(function(d,p){var m=d;if(m){var v=[d.x,d.y],g=void 0,y=void 0,b=void 0;if(a)if(o){var x=a,S=n.pointToCoord(v);i?(g=x.startAngle,y=x.endAngle,b=-S[1]/180*Math.PI):(g=x.r0,y=x.r,b=S[0])}else{var w=a;i?(g=w.x,y=w.x+w.width,b=d.x):(g=w.y+w.height,y=w.y,b=d.y)}var k=y===g?0:(b-g)/(y-g);l&&(k=1-k);var T=ye(f)?f(p):u*k+h,M=m.getSymbolPath(),A=M.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),A&&A.animateFrom({style:{opacity:0}},{duration:300,delay:T}),M.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,a){var i=r.getModel("endLabel");if(Vy(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||(c=this._endLabel=new kt({z2:200}),c.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var u=oM(l);u>=0&&(gl(s,ml(r,"endLabel"),{inheritColor:a,labelFetcher:r,labelDataIndex:u,defaultText:function(f,h,d){return d!=null?ky(o,d):oh(o,f)},enableTextSetter:!0},lM(i,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,a,i,o,s,l){var c=this._endLabel,u=this._polyline;if(c){r<1&&i.originalX==null&&(i.originalX=c.x,i.originalY=c.y);var f=a.getLayout("points"),h=a.hostModel,d=h.get("connectNulls"),p=s.get("precision"),m=s.get("distance")||0,v=l.getBaseAxis(),g=v.isHorizontal(),y=v.inverse,b=n.shape,x=y?g?b.x:b.y+b.height:g?b.x+b.width:b.y,S=(g?m:0)*(y?-1:1),w=(g?0:-m)*(y?-1:1),k=g?"x":"y",T=sM(f,x,k),M=T.range,A=M[1]-M[0],C=void 0;if(A>=1){if(A>1&&!d){var I=Hy(f,M[0]);c.attr({x:I[0]+S,y:I[1]+w}),o&&(C=h.getRawValue(M[0]))}else{var I=u.getPointOn(x,k);I&&c.attr({x:I[0]+S,y:I[1]+w});var P=h.getRawValue(M[0]),R=h.getRawValue(M[1]);o&&(C=mk(a,p,P,R,T.t))}i.lastFrameIndex=M[0]}else{var E=r===1||i.lastFrameIndex>0?M[0]:0,I=Hy(f,E);o&&(C=h.getRawValue(E)),c.attr({x:I[0]+S,y:I[1]+w})}if(o){var O=yl(c);typeof O.setLabelText=="function"&&O.setLabelText(C)}}},e.prototype._doUpdateAnimation=function(r,n,a,i,o,s,l){var c=this._polyline,u=this._polygon,f=r.hostModel,h=UC(this._data,r,this._stackedOnPoints,n,this._coordSys,a,this._valueOrigin),d=h.current,p=h.stackedOnCurrent,m=h.next,v=h.stackedOnNext;if(o&&(p=yn(h.stackedOnCurrent,h.current,a,o,l),d=yn(h.current,null,a,o,l),v=yn(h.stackedOnNext,h.next,a,o,l),m=yn(h.next,null,a,o,l)),zy(d,m)>3e3||u&&zy(p,v)>3e3){c.stopAnimation(),c.setShape({points:m}),u&&(u.stopAnimation(),u.setShape({points:m,stackedOnPoints:v}));return}c.shape.__points=h.current,c.shape.points=d;var g={shape:{points:m}};h.current!==d&&(g.shape.__points=h.next),c.stopAnimation(),Nt(c,g,f),u&&(u.setShape({points:d,stackedOnPoints:p}),u.stopAnimation(),Nt(u,{shape:{stackedOnPoints:v}},f),c.shape.points!==u.shape.points&&(u.shape.points=c.shape.points));for(var y=[],b=h.status,x=0;x<b.length;x++){var S=b[x].cmd;if(S==="="){var w=r.getItemGraphicEl(b[x].idx1);w&&y.push({el:w,ptIdx:x})}}c.animators&&c.animators.length&&c.animators[0].during(function(){u&&u.dirtyShape();for(var k=c.shape.__points,T=0;T<y.length;T++){var M=y[T].el,A=y[T].ptIdx*2;M.x=k[A],M.y=k[A+1],M.markRedraw()}})},e.prototype.remove=function(r){var n=this.group,a=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),a&&a.eachItemGraphicEl(function(i,o){i.__temp&&(n.remove(i),a.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e})(ir);function uM(t,e){return{seriesType:t,plan:uh(),reset:function(r){var n=r.getData(),a=r.coordinateSystem;if(r.pipelineContext,!!a){var i=fe(a.dimensions,function(f){return n.mapDimension(f)}).slice(0,2),o=i.length,s=n.getCalculationInfo("stackResultDimension");Ya(n,i[0])&&(i[0]=s),Ya(n,i[1])&&(i[1]=s);var l=n.getStore(),c=n.getDimensionIndex(i[0]),u=n.getDimensionIndex(i[1]);return o&&{progress:function(f,h){for(var d=f.end-f.start,p=Xr(d*o),m=[],v=[],g=f.start,y=0;g<f.end;g++){var b=void 0;if(o===1){var x=l.get(c,g);b=a.dataToPoint(x,null,v)}else m[0]=l.get(c,g),m[1]=l.get(u,g),b=a.dataToPoint(m,null,v);p[y++]=b[0],p[y++]=b[1]}h.setLayout("points",p)}}}}}}var fM={average:function(t){for(var e=0,r=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],r++);return r===0?NaN:e/r},sum:function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r]||0;return e},max:function(t){for(var e=-1/0,r=0;r<t.length;r++)t[r]>e&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r<t.length;r++)t[r]<e&&(e=t[r]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},hM=function(t){return Math.round(t.length/2)};function Gy(t){return{seriesType:t,reset:function(e,r,n){var a=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,s=a.count();if(s>10&&o.type==="cartesian2d"&&i){var l=o.getBaseAxis(),c=o.getOtherAxis(l),u=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){i==="lttb"?e.setData(a.lttbDownSample(a.mapDimension(c.dim),1/d)):i==="minmax"&&e.setData(a.minmaxDownSample(a.mapDimension(c.dim),1/d));var p=void 0;oe(i)?p=fM[i]:ye(i)&&(p=i),p&&e.setData(a.downSample(a.mapDimension(c.dim),1/d,p,hM))}}}}}function dM(t){t.registerChartView(cM),t.registerSeriesModel(FC),t.registerLayout(uM("line")),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Gy("line"))}var pM="__ec_stack_";function Wy(t){return t.get("stack")||pM+t.seriesIndex}function dh(t){return t.dim+t.index}function $y(t,e){var r=[];return e.eachSeriesByType(t,function(n){Yy(n)&&r.push(n)}),r}function vM(t){var e={};D(t,function(l){var c=l.coordinateSystem,u=c.getBaseAxis();if(!(u.type!=="time"&&u.type!=="value"))for(var f=l.getData(),h=u.dim+"_"+u.index,d=f.getDimensionIndex(f.mapDimension(u.dim)),p=f.getStore(),m=0,v=p.count();m<v;++m){var g=p.get(d,m);e[h]?e[h].push(g):e[h]=[g]}});var r={};for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];if(a){a.sort(function(l,c){return l-c});for(var i=null,o=1;o<a.length;++o){var s=a[o]-a[o-1];s>0&&(i=i===null?s:Math.min(i,s))}r[n]=i}}return r}function Uy(t){var e=vM(t),r=[];return D(t,function(n){var a=n.coordinateSystem,i=a.getBaseAxis(),o=i.getExtent(),s;if(i.type==="category")s=i.getBandWidth();else if(i.type==="value"||i.type==="time"){var l=i.dim+"_"+i.index,c=e[l],u=Math.abs(o[1]-o[0]),f=i.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=c?u/h*c:u}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=_t(n.get("barWidth"),s),m=_t(n.get("barMaxWidth"),s),v=_t(n.get("barMinWidth")||(qy(n)?.5:1),s),g=n.get("barGap"),y=n.get("barCategoryGap");r.push({bandWidth:s,barWidth:p,barMaxWidth:m,barMinWidth:v,barGap:g,barCategoryGap:y,axisKey:dh(i),stackId:Wy(n)})}),gM(r)}function gM(t){var e={};D(t,function(n,a){var i=n.axisKey,o=n.bandWidth,s=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[i]=s;var c=n.stackId;l[c]||s.autoWidthCount++,l[c]=l[c]||{width:0,maxWidth:0};var u=n.barWidth;u&&!l[c].width&&(l[c].width=u,u=Math.min(s.remainedWidth,u),s.remainedWidth-=u);var f=n.barMaxWidth;f&&(l[c].maxWidth=f);var h=n.barMinWidth;h&&(l[c].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var r={};return D(e,function(n,a){r[a]={};var i=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Ge(i).length;s=Math.max(35-l*4,15)+"%"}var c=_t(s,o),u=_t(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-c)/(h+(h-1)*u);d=Math.max(d,0),D(i,function(g){var y=g.maxWidth,b=g.minWidth;if(g.width){var x=g.width;y&&(x=Math.min(x,y)),b&&(x=Math.max(x,b)),g.width=x,f-=x+u*x,h--}else{var x=d;y&&y<x&&(x=Math.min(y,f)),b&&b>x&&(x=b),x!==d&&(g.width=x,f-=x+u*x,h--)}}),d=(f-c)/(h+(h-1)*u),d=Math.max(d,0);var p=0,m;D(i,function(g,y){g.width||(g.width=d),m=g,p+=g.width*(1+u)}),m&&(p-=m.width*u);var v=-p/2;D(i,function(g,y){r[a][y]=r[a][y]||{bandWidth:o,offset:v,width:g.width},v+=g.width*(1+u)})}),r}function mM(t,e,r){if(t&&e){var n=t[dh(e)];return n}}function yM(t,e){var r=$y(t,e),n=Uy(r);D(r,function(a){var i=a.getData(),o=a.coordinateSystem,s=o.getBaseAxis(),l=Wy(a),c=n[dh(s)][l],u=c.offset,f=c.width;i.setLayout({bandWidth:c.bandWidth,offset:u,size:f})})}function _M(t){return{seriesType:t,plan:uh(),reset:function(e){if(Yy(e)){var r=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),i=n.getOtherAxis(a),o=r.getDimensionIndex(r.mapDimension(i.dim)),s=r.getDimensionIndex(r.mapDimension(a.dim)),l=e.get("showBackground",!0),c=r.mapDimension(i.dim),u=r.getCalculationInfo("stackResultDimension"),f=Ya(r,c)&&!!r.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=bM(a,i),p=qy(e),m=e.get("barMinHeight")||0,v=u&&r.getDimensionIndex(u),g=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(b,x){for(var S=b.count,w=p&&Xr(S*3),k=p&&l&&Xr(S*3),T=p&&Xr(S),M=n.master.getRect(),A=h?M.width:M.height,C,I=x.getStore(),P=0;(C=b.next())!=null;){var R=I.get(f?v:o,C),E=I.get(s,C),O=d,K=void 0;f&&(K=+R-I.get(o,C));var L=void 0,B=void 0,V=void 0,$=void 0;if(h){var X=n.dataToPoint([R,E]);if(f){var ue=n.dataToPoint([K,E]);O=ue[0]}L=O,B=X[1]+y,V=X[0]-O,$=g,Math.abs(V)<m&&(V=(V<0?-1:1)*m)}else{var X=n.dataToPoint([E,R]);if(f){var ue=n.dataToPoint([E,K]);O=ue[1]}L=X[0]+y,B=O,V=g,$=X[1]-O,Math.abs($)<m&&($=($<=0?-1:1)*m)}p?(w[P]=L,w[P+1]=B,w[P+2]=h?V:$,k&&(k[P]=h?M.x:L,k[P+1]=h?B:M.y,k[P+2]=A),T[C]=C):x.setItemLayout(C,{x:L,y:B,width:V,height:$}),P+=3}p&&x.setLayout({largePoints:w,largeDataIndices:T,largeBackgroundPoints:k,valueAxisHorizontal:h})}}}}}}function Yy(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function qy(t){return t.pipelineContext&&t.pipelineContext.large}function bM(t,e){var r=e.model.get("startValue");return r||(r=0),e.toGlobalCoord(e.dataToCoord(e.type==="log"?r>0?r:1:r))}var ph=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return Ff(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(r,n,a){var i=this.coordinateSystem;if(i&&i.clampData){var o=i.clampData(r),s=i.dataToPoint(o);if(a)D(i.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var p=h.getTicksCoords(),m=h.getTickModel().get("alignWithLabel"),v=o[d],g=n[d]==="x1"||n[d]==="y1";if(g&&!m&&(v+=1),p.length<2)return;if(p.length===2){s[d]=h.toGlobalCoord(h.getExtent()[g?1:0]);return}for(var y=void 0,b=void 0,x=1,S=0;S<p.length;S++){var w=p[S].coord,k=S===p.length-1?p[S-1].tickValue+x:p[S].tickValue;if(k===v){b=w;break}else if(k<v)y=w;else if(y!=null&&k>v){b=(w+y)/2;break}S===1&&(x=k-p[0].tickValue)}b==null&&(y?y&&(b=p[p.length-1].coord):b=p[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),c=l.getLayout("offset"),u=l.getLayout("size"),f=i.getBaseAxis().isHorizontal()?0:1;s[f]+=c+u/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e})(Pr);Pr.registerClass(ph);var xM=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return Ff(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},e.prototype.brushSelector=function(r,n,a){return a.rect(n.getItemLayout(r))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Hf(ph.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e})(ph),Hl="\0__throttleOriginMethod",Xy="\0__throttleRate",Zy="\0__throttleType";function vh(t,e,r){var n,a=0,i=0,o=null,s,l,c,u;e=e||0;function f(){i=new Date().getTime(),o=null,t.apply(l,c||[])}var h=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];n=new Date().getTime(),l=this,c=d;var m=u||e,v=u||r;u=null,s=n-(v?a:i)-m,clearTimeout(o),v?o=setTimeout(f,m):s>=0?f():o=setTimeout(f,-s),a=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){u=d},h}function gh(t,e,r,n){var a=t[e];if(a){var i=a[Hl]||a,o=a[Zy],s=a[Xy];if(s!==r||o!==n){if(r==null||!n)return t[e]=i;a=t[e]=vh(i,r,n==="debounce"),a[Hl]=i,a[Zy]=n,a[Xy]=r}return a}}function mh(t,e){var r=t[e];r&&r[Hl]&&(r.clear&&r.clear(),t[e]=r[Hl])}var wM=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),Ky=(function(t){U(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new wM},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,c=o+l,u=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,p=h?f-u<d:u-f<d;p||(u=f-(h?d:-d));var m=Math.cos(u),v=Math.sin(u),g=Math.cos(f),y=Math.sin(f);p?(r.moveTo(m*o+a,v*o+i),r.arc(m*c+a,v*c+i,l,-Math.PI+u,u,!h)):r.moveTo(m*s+a,v*s+i),r.arc(a,i,s,u,f,!h),r.arc(g*c+a,y*c+i,l,f-Math.PI*2,f-Math.PI,!h),o!==0&&r.arc(a,i,o,f,u,h)},e})(Oe);function SM(t,e){e=e||{};var r=e.isRoundCap;return function(n,a,i){var o=a.position;if(!o||o instanceof Array)return xs(n,a,i);var s=t(o),l=a.distance!=null?a.distance:5,c=this.shape,u=c.cx,f=c.cy,h=c.r,d=c.r0,p=(h+d)/2,m=c.startAngle,v=c.endAngle,g=(m+v)/2,y=r?Math.abs(h-d)/2:0,b=Math.cos,x=Math.sin,S=u+h*b(m),w=f+h*x(m),k="left",T="top";switch(s){case"startArc":S=u+(d-l)*b(g),w=f+(d-l)*x(g),k="center",T="top";break;case"insideStartArc":S=u+(d+l)*b(g),w=f+(d+l)*x(g),k="center",T="bottom";break;case"startAngle":S=u+p*b(m)+Vl(m,l+y,!1),w=f+p*x(m)+Gl(m,l+y,!1),k="right",T="middle";break;case"insideStartAngle":S=u+p*b(m)+Vl(m,-l+y,!1),w=f+p*x(m)+Gl(m,-l+y,!1),k="left",T="middle";break;case"middle":S=u+p*b(g),w=f+p*x(g),k="center",T="middle";break;case"endArc":S=u+(h+l)*b(g),w=f+(h+l)*x(g),k="center",T="bottom";break;case"insideEndArc":S=u+(h-l)*b(g),w=f+(h-l)*x(g),k="center",T="top";break;case"endAngle":S=u+p*b(v)+Vl(v,l+y,!0),w=f+p*x(v)+Gl(v,l+y,!0),k="left",T="middle";break;case"insideEndAngle":S=u+p*b(v)+Vl(v,-l+y,!0),w=f+p*x(v)+Gl(v,-l+y,!0),k="right",T="middle";break;default:return xs(n,a,i)}return n=n||{},n.x=S,n.y=w,n.align=k,n.verticalAlign=T,n}}function kM(t,e,r,n){if(He(n)){t.setTextConfig({rotation:n});return}else if(ne(e)){t.setTextConfig({rotation:0});return}var a=t.shape,i=a.clockwise?a.startAngle:a.endAngle,o=a.clockwise?a.endAngle:a.startAngle,s=(i+o)/2,l,c=r(e);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=i;break;case"endAngle":case"insideEndAngle":l=o;break;default:t.setTextConfig({rotation:0});return}var u=Math.PI*1.5-l;c==="middle"&&u>Math.PI/2&&u<Math.PI*1.5&&(u-=Math.PI),t.setTextConfig({rotation:u})}function Vl(t,e,r){return e*Math.sin(t)*(r?-1:1)}function Gl(t,e,r){return e*Math.cos(t)*(r?1:-1)}function TM(t,e,r){var n=t.get("borderRadius");if(n==null)return{cornerRadius:0};ne(n)||(n=[n,n,n,n]);var a=Math.abs(e.r||0-e.r0||0);return{cornerRadius:fe(n,function(i){return rn(i,a)})}}var yh=Math.max,_h=Math.min;function CM(t,e){var r=t.getArea&&t.getArea();if(fh(t,"cartesian2d")){var n=t.getBaseAxis();if(n.type!=="category"||!n.onBand){var a=e.getLayout("bandWidth");n.isHorizontal()?(r.x-=a,r.width+=a*2):(r.y-=a,r.height+=a*2)}}return r}var MM=(function(t){U(e,t);function e(){var r=t.call(this)||this;return r.type=e.type,r._isFirstFrame=!0,r}return e.prototype.render=function(r,n,a,i){this._model=r,this._removeOnRenderedListener(a),this._updateDrawMode(r);var o=r.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(r,n,a):this._renderNormal(r,n,a,i))},e.prototype.incrementalPrepareRender=function(r){this._clear(),this._updateDrawMode(r),this._updateLargeClip(r)},e.prototype.incrementalRender=function(r,n){this._progressiveEls=[],this._incrementalRenderLarge(r,n)},e.prototype.eachRendered=function(r){pl(this._progressiveEls||this.group,r)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r,n,a,i){var o=this.group,s=r.getData(),l=this._data,c=r.coordinateSystem,u=c.getBaseAxis(),f;c.type==="cartesian2d"?f=u.isHorizontal():c.type==="polar"&&(f=u.dim==="angle");var h=r.isAnimationEnabled()?r:null,d=AM(r,c);d&&this._enableRealtimeSort(d,s,a);var p=r.get("clip",!0)||d,m=CM(c,s);o.removeClipPath();var v=r.get("roundCap",!0),g=r.get("showBackground",!0),y=r.getModel("backgroundStyle"),b=y.get("borderRadius")||0,x=[],S=this._backgroundEls,w=i&&i.isInitSort,k=i&&i.type==="changeAxisOrder";function T(C){var I=Wl[c.type](s,C),P=OM(c,f,I);return P.useStyle(y.getItemStyle()),c.type==="cartesian2d"?P.setShape("r",b):P.setShape("cornerRadius",b),x[C]=P,P}s.diff(l).add(function(C){var I=s.getItemModel(C),P=Wl[c.type](s,C,I);if(g&&T(C),!(!s.hasValue(C)||!t_[c.type](P))){var R=!1;p&&(R=jy[c.type](m,P));var E=Qy[c.type](r,s,C,P,f,h,u.model,!1,v);d&&(E.forceLabelAnimation=!0),n_(E,s,C,I,P,r,f,c.type==="polar"),w?E.attr({shape:P}):d?Jy(d,h,E,P,C,f,!1,!1):Ur(E,{shape:P},r,C),s.setItemGraphicEl(C,E),o.add(E),E.ignore=R}}).update(function(C,I){var P=s.getItemModel(C),R=Wl[c.type](s,C,P);if(g){var E=void 0;S.length===0?E=T(I):(E=S[I],E.useStyle(y.getItemStyle()),c.type==="cartesian2d"?E.setShape("r",b):E.setShape("cornerRadius",b),x[C]=E);var O=Wl[c.type](s,C),K=s_(f,O,c);Nt(E,{shape:K},h,C)}var L=l.getItemGraphicEl(I);if(!s.hasValue(C)||!t_[c.type](R)){o.remove(L);return}var B=!1;if(p&&(B=jy[c.type](m,R),B&&o.remove(L)),L?Zg(L):L=Qy[c.type](r,s,C,R,f,h,u.model,!!L,v),d&&(L.forceLabelAnimation=!0),k){var V=L.getTextContent();if(V){var $=yl(V);$.prevValue!=null&&($.prevValue=$.value)}}else n_(L,s,C,P,R,r,f,c.type==="polar");w?L.attr({shape:R}):d?Jy(d,h,L,R,C,f,!0,k):Nt(L,{shape:R},r,C,null),s.setItemGraphicEl(C,L),L.ignore=B,o.add(L)}).remove(function(C){var I=l.getItemGraphicEl(C);I&&bf(I,r,C)}).execute();var M=this._backgroundGroup||(this._backgroundGroup=new ct);M.removeAll();for(var A=0;A<x.length;++A)M.add(x[A]);o.add(M),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(r,n,a){this._clear(),i_(r,this.group),this._updateLargeClip(r)},e.prototype._incrementalRenderLarge=function(r,n){this._removeBackground(),i_(n,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(r){var n=r.get("clip",!0)&&JC(r.coordinateSystem,!1,r),a=this.group;n?a.setClipPath(n):a.removeClipPath()},e.prototype._enableRealtimeSort=function(r,n,a){var i=this;if(n.count()){var o=r.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(n,r,a),this._isFirstFrame=!1;else{var s=function(l){var c=n.getItemGraphicEl(l),u=c&&c.shape;return u&&Math.abs(o.isHorizontal()?u.height:u.width)||0};this._onRendered=function(){i._updateSortWithinSameData(n,s,o,a)},a.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(r,n,a){var i=[];return r.each(r.mapDimension(n.dim),function(o,s){var l=a(s);l=l??NaN,i.push({dataIndex:s,mappedValue:l,ordinalNumber:o})}),i.sort(function(o,s){return s.mappedValue-o.mappedValue}),{ordinalNumbers:fe(i,function(o){return o.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(r,n,a){for(var i=a.scale,o=r.mapDimension(a.dim),s=Number.MAX_VALUE,l=0,c=i.getOrdinalMeta().categories.length;l<c;++l){var u=r.rawIndexOf(o,i.getRawOrdinalNumber(l)),f=u<0?Number.MIN_VALUE:n(r.indexOfRawIndex(u));if(f>s)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var a=n.scale,i=a.getExtent(),o=Math.max(0,i[0]),s=Math.min(i[1],a.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==a.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,a,i){if(this._isOrderChangedWithinSameData(r,n,a)){var o=this._dataSort(r,a,n);this._isOrderDifferentInView(o,a)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",axisId:a.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,a){var i=n.baseAxis,o=this._dataSort(r,i,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,a=this._data;r&&r.isAnimationEnabled()&&a&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],a.eachItemGraphicEl(function(i){bf(i,r,Ee(i).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e})(ir),jy={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var a=t.x+t.width,i=t.y+t.height,o=yh(e.x,t.x),s=_h(e.x+e.width,a),l=yh(e.y,t.y),c=_h(e.y+e.height,i),u=s<o,f=c<l;return e.x=u&&o>a?s:o,e.y=f&&l>i?c:l,e.width=u?0:s-o,e.height=f?0:c-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),u||f},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var a=_h(e.r,t.r),i=yh(e.r0,t.r0);e.r=a,e.r0=i;var o=a-i<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},Qy={cartesian2d:function(t,e,r,n,a,i,o,s,l){var c=new at({shape:G({},n),z2:1});if(c.__dataIndex=r,c.name="item",i){var u=c.shape,f=a?"height":"width";u[f]=0}return c},polar:function(t,e,r,n,a,i,o,s,l){var c=!a&&l?Ky:Fa,u=new c({shape:n,z2:1});u.name="item";var f=r_(a);if(u.calculateTextPosition=SM(f,{isRoundCap:c===Ky}),i){var h=u.shape,d=a?"r":"endAngle",p={};h[d]=a?n.r0:n.startAngle,p[d]=n[d],(s?Nt:Ur)(u,{shape:p},i)}return u}};function AM(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function Jy(t,e,r,n,a,i,o,s){var l,c;i?(c={x:n.x,width:n.width},l={y:n.y,height:n.height}):(c={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?Nt:Ur)(r,{shape:l},e,a,null);var u=e?t.baseAxis.model:null;(o?Nt:Ur)(r,{shape:c},u,a)}function e_(t,e){for(var r=0;r<e.length;r++)if(!isFinite(t[e[r]]))return!0;return!1}var DM=["x","y","width","height"],IM=["cx","cy","r","startAngle","endAngle"],t_={cartesian2d:function(t){return!e_(t,DM)},polar:function(t){return!e_(t,IM)}},Wl={cartesian2d:function(t,e,r){var n=t.getItemLayout(e),a=r?LM(r,n):0,i=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+i*a/2,y:n.y+o*a/2,width:n.width-i*a,height:n.height-o*a}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function PM(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function r_(t){return(function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}})(t)}function n_(t,e,r,n,a,i,o,s){var l=e.getItemVisual(r,"style");if(s){if(!i.get("roundCap")){var u=t.shape,f=TM(n.getModel("itemStyle"),u);G(u,f),t.setShape(u)}}else{var c=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var h=n.getShallow("cursor");h&&t.attr("cursor",h);var d=s?o?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":o?a.height>=0?"bottom":"top":a.width>=0?"right":"left",p=ml(n);gl(t,p,{labelFetcher:i,labelDataIndex:r,defaultText:oh(i.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=t.getTextContent();if(s&&m){var v=n.get(["label","position"]);t.textConfig.inside=v==="middle"?!0:null,kM(t,v==="outside"?d:v,r_(o),n.get(["label","rotate"]))}ET(m,p,i.getRawValue(r),function(y){return ky(e,y)});var g=n.getModel(["emphasis"]);tl(t,g.get("focus"),g.get("blurScope"),g.get("disabled")),lf(t,n),PM(a)&&(t.style.fill="none",t.style.stroke="none",D(t.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function LM(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,a=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),i=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,a,i)}var RM=(function(){function t(){}return t})(),a_=(function(t){U(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new RM},e.prototype.buildPath=function(r,n){for(var a=n.points,i=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],c=this.barWidth,u=0;u<a.length;u+=3)l[i]=c,l[o]=a[u+2],s[i]=a[u+i],s[o]=a[u+o],r.rect(s[0],s[1],l[0],l[1])},e})(Oe);function i_(t,e,r,n){var a=t.getData(),i=a.getLayout("valueAxisHorizontal")?1:0,o=a.getLayout("largeDataIndices"),s=a.getLayout("size"),l=t.getModel("backgroundStyle"),c=a.getLayout("largeBackgroundPoints");if(c){var u=new a_({shape:{points:c},incremental:!!n,silent:!0,z2:0});u.baseDimIdx=i,u.largeDataIndices=o,u.barWidth=s,u.useStyle(l.getItemStyle()),e.add(u),r&&r.push(u)}var f=new a_({shape:{points:a.getLayout("largePoints")},incremental:!!n,ignoreCoarsePointer:!0,z2:1});f.baseDimIdx=i,f.largeDataIndices=o,f.barWidth=s,e.add(f),f.useStyle(a.getVisual("style")),f.style.stroke=null,Ee(f).seriesIndex=t.seriesIndex,t.get("silent")||(f.on("mousedown",o_),f.on("mousemove",o_)),r&&r.push(f)}var o_=vh(function(t){var e=this,r=EM(e,t.offsetX,t.offsetY);Ee(e).dataIndex=r>=0?r:null},30,!1);function EM(t,e,r){for(var n=t.baseDimIdx,a=1-n,i=t.shape.points,o=t.largeDataIndices,s=[],l=[],c=t.barWidth,u=0,f=i.length/3;u<f;u++){var h=u*3;if(l[n]=c,l[a]=i[h+2],s[n]=i[h+n],s[a]=i[h+a],l[a]<0&&(s[a]+=l[a],l[a]=-l[a]),e>=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[u]}return-1}function s_(t,e,r){if(fh(r,"cartesian2d")){var n=e,a=r.getArea();return{x:t?n.x:a.x,y:t?a.y:n.y,width:t?n.width:a.width,height:t?a.height:n.height}}else{var a=r.getArea(),i=e;return{cx:a.cx,cy:a.cy,r0:t?a.r0:i.r0,r:t?a.r:i.r,startAngle:t?i.startAngle:0,endAngle:t?i.endAngle:Math.PI*2}}}function OM(t,e,r){var n=t.type==="polar"?Fa:at;return new n({shape:s_(e,r,t),silent:!0,z2:0})}function NM(t){t.registerChartView(MM),t.registerSeriesModel(xM),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,Ke(yM,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,_M("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Gy("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(a){e.sortInfo&&a.axis.setCategorySortInfo(e.sortInfo)})})}function Qa(t,e,r,n,a){var i=t+e;r.isSilent(i)||n.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,c=a.selected,u=0;u<c.length;u++)if(c[u].seriesIndex===s){var f=o.getData(),h=Xn(f,a.fromActionPayload);r.trigger(i,{type:i,seriesId:o.id,name:ne(h)?f.getName(h[0]):f.getName(h),selected:oe(l)?l:G({},l)})}})}function BM(t,e,r){t.on("selectchanged",function(n){var a=r.getModel();n.isFromClick?(Qa("map","selectchanged",e,a,n),Qa("pie","selectchanged",e,a,n)):n.fromAction==="select"?(Qa("map","selected",e,a,n),Qa("pie","selected",e,a,n)):n.fromAction==="unselect"&&(Qa("map","unselected",e,a,n),Qa("pie","unselected",e,a,n))})}function zM(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(!n.defaultAttr.ignore){var a=n.label,i=a.getComputedTransform(),o=a.getBoundingRect(),s=!i||i[1]<1e-5&&i[2]<1e-5,l=a.style.margin||0,c=o.clone();c.applyTransform(i),c.x-=l/2,c.y-=l/2,c.width+=l,c.height+=l;var u=s?new cl(o,i):null;e.push({label:a,labelLine:n.labelLine,rect:c,localRect:o,obb:u,priority:n.priority,defaultAttr:n.defaultAttr,layoutOption:n.computedLayoutOption,axisAligned:s,transform:i})}}return e}function FM(t){var e=[];t.sort(function(m,v){return v.priority-m.priority});var r=new Le(0,0,0,0);function n(m){if(!m.ignore){var v=m.ensureState("emphasis");v.ignore==null&&(v.ignore=!1)}m.ignore=!0}for(var a=0;a<t.length;a++){var i=t[a],o=i.axisAligned,s=i.localRect,l=i.transform,c=i.label,u=i.labelLine;r.copy(i.rect),r.width-=.1,r.height-=.1,r.x+=.05,r.y+=.05;for(var f=i.obb,h=!1,d=0;d<e.length;d++){var p=e[d];if(r.intersect(p.rect)){if(o&&p.axisAligned){h=!0;break}if(p.obb||(p.obb=new cl(p.localRect,p.transform)),f||(f=new cl(s,l)),f.intersect(p.obb)){h=!0;break}}}h?(n(c),u&&n(u)):(c.attr("ignore",i.defaultAttr.ignore),u&&u.attr("ignore",i.defaultAttr.labelGuideIgnore),e.push(i))}}var Ja=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),HM=(function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new Ja(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var n=e.offsetX,a=e.offsetY,i=n-this._x,o=a-this._y;this._x=n,this._y=a,r.drift(i,o,e),this.handler.dispatchToElement(new Ja(r,e),"drag",e.event);var s=this.handler.findHover(n,a,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new Ja(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new Ja(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new Ja(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new Ja(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),VM=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,bh=[],GM=ve.browser.firefox&&+ve.browser.version.split(".")[0]<39;function xh(t,e,r,n){return r=r||{},n?l_(t,e,r):GM&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):l_(t,e,r),r}function l_(t,e,r){if(ve.domSupported&&t.getBoundingClientRect){var n=e.clientX,a=e.clientY;if(Wm(t)){var i=t.getBoundingClientRect();r.zrX=n-i.left,r.zrY=a-i.top;return}else if(Wf(bh,t,n,a)){r.zrX=bh[0],r.zrY=bh[1];return}}r.zrX=r.zrY=0}function wh(t){return t||window.event}function Kt(t,e,r){if(e=wh(e),e.zrX!=null)return e;var n=e.type,a=n&&n.indexOf("touch")>=0;if(a){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&xh(t,o,e,r)}else{xh(t,e,e,r);var i=WM(e);e.zrDelta=i?i/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&VM.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function WM(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var a=Math.abs(n!==0?n:r),i=n>0?-1:n<0?1:r>0?-1:1;return 3*a*i}function $M(t,e,r,n){t.addEventListener(e,r,n)}function UM(t,e,r,n){t.removeEventListener(e,r,n)}var $l=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function c_(t){return t.which===2||t.which===3}var YM=(function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var a=e.touches;if(a){for(var i={points:[],touches:[],target:r,event:e},o=0,s=a.length;o<s;o++){var l=a[o],c=xh(n,l,{});i.points.push([c.zrX,c.zrY]),i.touches.push(l)}this._track.push(i)}},t.prototype._recognize=function(e){for(var r in Sh)if(Sh.hasOwnProperty(r)){var n=Sh[r](this._track,e);if(n)return n}},t})();function u_(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function qM(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var Sh={pinch:function(t,e){var r=t.length;if(r){var n=(t[r-1]||{}).points,a=(t[r-2]||{}).points||n;if(a&&a.length>1&&n&&n.length>1){var i=u_(n)/u_(a);!isFinite(i)&&(i=1),e.pinchScale=i;var o=qM(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},f_="silent";function XM(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:ZM}}function ZM(){$l(this.event)}var KM=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e})(rr),lo=(function(){function t(e,r){this.x=e,this.y=r}return t})(),jM=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],kh=new Le(0,0,0,0),h_=(function(t){U(e,t);function e(r,n,a,i,o){var s=t.call(this)||this;return s._hovered=new lo(0,0),s.storage=r,s.painter=n,s.painterRoot=i,s._pointerSize=o,a=a||new KM,s.proxy=null,s.setHandlerProxy(a),s._draggingMgr=new HM(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(D(jM,function(n){r.on&&r.on(n,this[n],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var n=r.zrX,a=r.zrY,i=p_(this,n,a),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=i?new lo(n,a):this.findHover(n,a),c=l.target,u=this.proxy;u.setCursor&&u.setCursor(c?c.cursor:"default"),s&&c!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),c&&c!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var n=r.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new lo(0,0)},e.prototype.dispatch=function(r,n){var a=this[r];a&&a.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var n=this.proxy;n.setCursor&&n.setCursor(r)},e.prototype.dispatchToElement=function(r,n,a){r=r||{};var i=r.target;if(!(i&&i.silent)){for(var o="on"+n,s=XM(n,r,a);i&&(i[o]&&(s.cancelBubble=!!i[o].call(i,s)),i.trigger(n,s),i=i.__hostTarget?i.__hostTarget:i.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(r,n,a){var i=this.storage.getDisplayList(),o=new lo(r,n);if(d_(i,o,r,n,a),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,c=l/2,u=new Le(r-c,n-c,l,l),f=i.length-1;f>=0;f--){var h=i[f];h!==a&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(kh.copy(h.getBoundingRect()),h.transform&&kh.applyTransform(h.transform),kh.intersect(u)&&s.push(h))}if(s.length)for(var d=4,p=Math.PI/12,m=Math.PI*2,v=0;v<c;v+=d)for(var g=0;g<m;g+=p){var y=r+v*Math.cos(g),b=n+v*Math.sin(g);if(d_(s,o,y,b,a),o.target)return o}}return o},e.prototype.processGesture=function(r,n){this._gestureMgr||(this._gestureMgr=new YM);var a=this._gestureMgr;n==="start"&&a.clear();var i=a.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(n==="end"&&a.clear(),i){var o=i.type;r.gestureEvent=o;var s=new lo;s.target=i.target,this.dispatchToElement(s,o,i.event)}},e})(rr);D(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){h_.prototype[t]=function(e){var r=e.zrX,n=e.zrY,a=p_(this,r,n),i,o;if((t!=="mouseup"||!a)&&(i=this.findHover(r,n),o=i.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||qw(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}});function QM(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,a=void 0,i=!1;n;){if(n.ignoreClip&&(i=!0),!i){var o=n.getClipPath();if(o&&!o.contain(e,r))return!1}n.silent&&(a=!0);var s=n.__hostTarget;n=s||n.parent}return a?f_:!0}return!1}function d_(t,e,r,n,a){for(var i=t.length-1;i>=0;i--){var o=t[i],s=void 0;if(o!==a&&!o.ignore&&(s=QM(o,r,n))&&(!e.topTarget&&(e.topTarget=o),s!==f_)){e.target=o;break}}}function p_(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var v_=32,co=7;function JM(t){for(var e=0;t>=v_;)e|=t&1,t>>=1;return t+e}function g_(t,e,r,n){var a=e+1;if(a===r)return 1;if(n(t[a++],t[e])<0){for(;a<r&&n(t[a],t[a-1])<0;)a++;eA(t,e,a)}else for(;a<r&&n(t[a],t[a-1])>=0;)a++;return a-e}function eA(t,e,r){for(r--;e<r;){var n=t[e];t[e++]=t[r],t[r--]=n}}function m_(t,e,r,n,a){for(n===e&&n++;n<r;n++){for(var i=t[n],o=e,s=n,l;o<s;)l=o+s>>>1,a(i,t[l])<0?s=l:o=l+1;var c=n-o;switch(c){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;c>0;)t[o+c]=t[o+c-1],c--}t[o]=i}}function Th(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])>0){for(s=n-a;l<s&&i(t,e[r+a+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;l<s&&i(t,e[r+a-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])>0?o=u+1:l=u}return l}function Ch(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])<0){for(s=a+1;l<s&&i(t,e[r+a-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}else{for(s=n-a;l<s&&i(t,e[r+a+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])<0?l=u:o=u+1}return l}function tA(t,e){var r=co,n,a,i=0,o=[];n=[],a=[];function s(d,p){n[i]=d,a[i]=p,i+=1}function l(){for(;i>1;){var d=i-2;if(d>=1&&a[d-1]<=a[d]+a[d+1]||d>=2&&a[d-2]<=a[d]+a[d-1])a[d-1]<a[d+1]&&d--;else if(a[d]>a[d+1])break;u(d)}}function c(){for(;i>1;){var d=i-2;d>0&&a[d-1]<a[d+1]&&d--,u(d)}}function u(d){var p=n[d],m=a[d],v=n[d+1],g=a[d+1];a[d]=m+g,d===i-3&&(n[d+1]=n[d+2],a[d+1]=a[d+2]),i--;var y=Ch(t[v],t,p,m,0,e);p+=y,m-=y,m!==0&&(g=Th(t[p+m-1],t,v,g,g-1,e),g!==0&&(m<=g?f(p,m,v,g):h(p,m,v,g)))}function f(d,p,m,v){var g=0;for(g=0;g<p;g++)o[g]=t[d+g];var y=0,b=m,x=d;if(t[x++]=t[b++],--v===0){for(g=0;g<p;g++)t[x+g]=o[y+g];return}if(p===1){for(g=0;g<v;g++)t[x+g]=t[b+g];t[x+v]=o[y];return}for(var S=r,w,k,T;;){w=0,k=0,T=!1;do if(e(t[b],o[y])<0){if(t[x++]=t[b++],k++,w=0,--v===0){T=!0;break}}else if(t[x++]=o[y++],w++,k=0,--p===1){T=!0;break}while((w|k)<S);if(T)break;do{if(w=Ch(t[b],o,y,p,0,e),w!==0){for(g=0;g<w;g++)t[x+g]=o[y+g];if(x+=w,y+=w,p-=w,p<=1){T=!0;break}}if(t[x++]=t[b++],--v===0){T=!0;break}if(k=Th(o[y],t,b,v,0,e),k!==0){for(g=0;g<k;g++)t[x+g]=t[b+g];if(x+=k,b+=k,v-=k,v===0){T=!0;break}}if(t[x++]=o[y++],--p===1){T=!0;break}S--}while(w>=co||k>=co);if(T)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),p===1){for(g=0;g<v;g++)t[x+g]=t[b+g];t[x+v]=o[y]}else{if(p===0)throw new Error;for(g=0;g<p;g++)t[x+g]=o[y+g]}}function h(d,p,m,v){var g=0;for(g=0;g<v;g++)o[g]=t[m+g];var y=d+p-1,b=v-1,x=m+v-1,S=0,w=0;if(t[x--]=t[y--],--p===0){for(S=x-(v-1),g=0;g<v;g++)t[S+g]=o[g];return}if(v===1){for(x-=p,y-=p,w=x+1,S=y+1,g=p-1;g>=0;g--)t[w+g]=t[S+g];t[x]=o[b];return}for(var k=r;;){var T=0,M=0,A=!1;do if(e(o[b],t[y])<0){if(t[x--]=t[y--],T++,M=0,--p===0){A=!0;break}}else if(t[x--]=o[b--],M++,T=0,--v===1){A=!0;break}while((T|M)<k);if(A)break;do{if(T=p-Ch(o[b],t,d,p,p-1,e),T!==0){for(x-=T,y-=T,p-=T,w=x+1,S=y+1,g=T-1;g>=0;g--)t[w+g]=t[S+g];if(p===0){A=!0;break}}if(t[x--]=o[b--],--v===1){A=!0;break}if(M=v-Th(t[y],o,0,v,v-1,e),M!==0){for(x-=M,b-=M,v-=M,w=x+1,S=b+1,g=0;g<M;g++)t[w+g]=o[S+g];if(v<=1){A=!0;break}}if(t[x--]=t[y--],--p===0){A=!0;break}k--}while(T>=co||M>=co);if(A)break;k<0&&(k=0),k+=2}if(r=k,r<1&&(r=1),v===1){for(x-=p,y-=p,w=x+1,S=y+1,g=p-1;g>=0;g--)t[w+g]=t[S+g];t[x]=o[b]}else{if(v===0)throw new Error;for(S=x-(v-1),g=0;g<v;g++)t[S+g]=o[g]}}return{mergeRuns:l,forceMergeRuns:c,pushRun:s}}function Ul(t,e,r,n){r||(r=0),n||(n=t.length);var a=n-r;if(!(a<2)){var i=0;if(a<v_){i=g_(t,r,n,e),m_(t,r,n,r+i,e);return}var o=tA(t,e),s=JM(a);do{if(i=g_(t,r,n,e),i<s){var l=a;l>s&&(l=s),m_(t,r,r+l,r+i,e),i=l}o.pushRun(r,i),o.mergeRuns(),a-=i,r+=i}while(a!==0);o.forceMergeRuns()}}var y_=!1;function Mh(){y_||(y_=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function __(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var rA=(function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=__}return t.prototype.traverse=function(e,r){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,r)},t.prototype.getDisplayList=function(e,r){r=r||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(r),n},t.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var r=this._roots,n=this._displayList,a=0,i=r.length;a<i;a++)this._updateAndAddDisplayable(r[a],null,e);n.length=this._displayListLen,Ul(n,__)},t.prototype._updateAndAddDisplayable=function(e,r,n){if(!(e.ignore&&!n)){e.beforeUpdate(),e.update(),e.afterUpdate();var a=e.getClipPath();if(e.ignoreClip)r=null;else if(a){r?r=r.slice():r=[];for(var i=a,o=e;i;)i.parent=o,i.updateTransform(),r.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var c=s[l];e.__dirty&&(c.__dirty|=Ot),this._updateAndAddDisplayable(c,r,n)}e.__dirty=0}else{var u=e;r&&r.length?u.__clipPaths=r:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(Mh(),u.z=0),isNaN(u.z2)&&(Mh(),u.z2=0),isNaN(u.zlevel)&&(Mh(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,r,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,r,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,r,n)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,n=e.length;r<n;r++)this.delRoot(e[r]);return}var a=Pe(this._roots,e);a>=0&&this._roots.splice(a,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t})(),Yl;Yl=ve.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};function ei(){return new Date().getTime()}var nA=(function(t){U(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,a=r.next;n?n.next=a:this._head=a,a?a.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=ei()-this._pausedTime,a=n-this._time,i=this._head;i;){var o=i.next,s=i.step(n,a);s&&(i.ondestroy(),this.removeClip(i)),i=o}this._time=n,r||(this.trigger("frame",a),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(Yl(n),!r._paused&&r.update())}Yl(n)},e.prototype.start=function(){this._running||(this._time=ei(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=ei(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=ei()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,n){n=n||{},this.start();var a=new Du(r,n.loop);return this.addAnimator(a),a},e})(rr),aA=300,Ah=ve.domSupported,Dh=(function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=fe(t,function(a){var i=a.replace("mouse","pointer");return r.hasOwnProperty(i)?i:a});return{mouse:t,touch:e,pointer:n}})(),b_={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},x_=!1;function Ih(t){var e=t.pointerType;return e==="pen"||e==="touch"}function iA(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Ph(t){t&&(t.zrByTouch=!0)}function oA(t,e){return Kt(t.dom,new sA(t,e),!0)}function w_(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var sA=(function(){function t(e,r){this.stopPropagation=mt,this.stopImmediatePropagation=mt,this.preventDefault=mt,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t})(),or={mousedown:function(t){t=Kt(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=Kt(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=Kt(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=Kt(this.dom,t);var e=t.toElement||t.relatedTarget;w_(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){x_=!0,t=Kt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){x_||(t=Kt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=Kt(this.dom,t),Ph(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),or.mousemove.call(this,t),or.mousedown.call(this,t)},touchmove:function(t){t=Kt(this.dom,t),Ph(t),this.handler.processGesture(t,"change"),or.mousemove.call(this,t)},touchend:function(t){t=Kt(this.dom,t),Ph(t),this.handler.processGesture(t,"end"),or.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<aA&&or.click.call(this,t)},pointerdown:function(t){or.mousedown.call(this,t)},pointermove:function(t){Ih(t)||or.mousemove.call(this,t)},pointerup:function(t){or.mouseup.call(this,t)},pointerout:function(t){Ih(t)||or.mouseout.call(this,t)}};D(["click","dblclick","contextmenu"],function(t){or[t]=function(e){e=Kt(this.dom,e),this.trigger(t,e)}});var Lh={pointermove:function(t){Ih(t)||Lh.mousemove.call(this,t)},pointerup:function(t){Lh.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function lA(t,e){var r=e.domHandlers;ve.pointerEventsSupported?D(Dh.pointer,function(n){ql(e,n,function(a){r[n].call(t,a)})}):(ve.touchEventsSupported&&D(Dh.touch,function(n){ql(e,n,function(a){r[n].call(t,a),iA(e)})}),D(Dh.mouse,function(n){ql(e,n,function(a){a=wh(a),e.touching||r[n].call(t,a)})}))}function cA(t,e){ve.pointerEventsSupported?D(b_.pointer,r):ve.touchEventsSupported||D(b_.mouse,r);function r(n){function a(i){i=wh(i),w_(t,i.target)||(i=oA(t,i),e.domHandlers[n].call(t,i))}ql(e,n,a,{capture:!0})}}function ql(t,e,r,n){t.mounted[e]=r,t.listenerOpts[e]=n,$M(t.domTarget,e,r,n)}function Rh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&UM(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var S_=(function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t})(),uA=(function(t){U(e,t);function e(r,n){var a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=r,a.painterRoot=n,a._localHandlerScope=new S_(r,or),Ah&&(a._globalHandlerScope=new S_(document,Lh)),lA(a,a._localHandlerScope),a}return e.prototype.dispose=function(){Rh(this._localHandlerScope),Ah&&Rh(this._globalHandlerScope)},e.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},e.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,Ah&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var n=this._globalHandlerScope;r?cA(this,n):Rh(n)}},e})(rr);var Xl={},k_={};function fA(t){delete k_[t]}function hA(t){if(!t)return!1;if(typeof t=="string")return Ps(t,1)<Iu;if(t.colorStops){for(var e=t.colorStops,r=0,n=e.length,a=0;a<n;a++)r+=Ps(e[a].color,1);return r/=n,r<Iu}return!1}var dA=(function(){function t(e,r,n){var a=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=r,this.id=e;var i=new rA,o=n.renderer||"canvas";Xl[o]||(o=Ge(Xl)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var s=new Xl[o](r,i,n,e),l=n.ssr||s.ssrOnly;this.storage=i,this.painter=s;var c=!ve.node&&!ve.worker&&!l?new uA(s.getViewportRoot(),s.root):null,u=n.useCoarsePointer,f=u==null||u==="auto"?ve.touchEventsSupported:!!u,h=44,d;f&&(d=ke(n.pointerSize,h)),this.handler=new h_(i,s,c,s.root,d),this.animation=new nA({stage:{update:l?null:function(){return a._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh())},t.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=hA(e))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(e){this._darkMode=e},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!1)},t.prototype._flush=function(e){var r,n=ei();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var a=ei();r?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:a-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this._disposed||this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof ct&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.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,fA(this.id))},t})();function T_(t,e){var r=new dA(jp(),t,e);return k_[r.id]=r,r}function pA(t,e){Xl[t]=e}var C_="";typeof navigator<"u"&&(C_=navigator.platform||"");var ti="rgba(0, 0, 0, 0.2)";const vA={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:ti,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:ti,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:ti,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:ti,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:ti,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:ti,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:C_.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var gA=de();function mA(t,e,r){var n=gA.get(e);if(!n)return r;var a=n(t);return a?r.concat(a):r}var Zl,uo,M_,A_="\0_ec_inner",yA=1,Eh=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,a,i,o,s){i=i||{},this.option=null,this._theme=new Xe(i),this._locale=new Xe(o),this._optionManager=s},e.prototype.setOption=function(r,n,a){var i=P_(n);this._optionManager.setOption(r,a,i),this._resetOption(null,i)},e.prototype.resetOption=function(r,n){return this._resetOption(r,P_(n))},e.prototype._resetOption=function(r,n){var a=!1,i=this._optionManager;if(!r||r==="recreate"){var o=i.mountOption(r==="recreate");!this.option||r==="recreate"?M_(this,o):(this.restoreData(),this._mergeOption(o,n)),a=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=i.getTimelineOption(this);s&&(a=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=i.getMediaOption(this);l.length&&D(l,function(c){a=!0,this._mergeOption(c,n)},this)}return a},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var a=this.option,i=this._componentsMap,o=this._componentsCount,s=[],l=de(),c=n&&n.replaceMergeMainTypeMap;GT(this),D(r,function(f,h){f!=null&&(Ne.hasClass(h)?h&&(s.push(h),l.set(h,!0)):a[h]=a[h]==null?we(f):Me(a[h],f,!0))}),c&&c.each(function(f,h){Ne.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),Ne.topologicalTravel(s,Ne.getAllClassMainTypes(),u,this);function u(f){var h=mA(this,f,ht(r[f])),d=i.get(f),p=d?c&&c.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=ak(d,h,p);fk(m,f,Ne),a[f]=null,i.set(f,null),o.set(f,0);var v=[],g=[],y=0,b;D(m,function(x,S){var w=x.existing,k=x.newOption;if(!k)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var T=f==="series",M=Ne.getClass(f,x.keyInfo.subType,!T);if(!M)return;if(f==="tooltip"){if(b)return;b=!0}if(w&&w.constructor===M)w.name=x.keyInfo.name,w.mergeOption(k,this),w.optionUpdated(k,!1);else{var A=G({componentIndex:S},x.keyInfo);w=new M(k,this,this,A),G(w,A),x.brandNew&&(w.__requireNewView=!0),w.init(k,this,this),w.optionUpdated(null,!0)}}w?(v.push(w.option),g.push(w),y++):(v.push(void 0),g.push(void 0))},this),a[f]=v,i.set(f,g),o.set(f,y),f==="series"&&Zl(this)}this._seriesIndices||Zl(this)},e.prototype.getOption=function(){var r=we(this.option);return D(r,function(n,a){if(Ne.hasClass(a)){for(var i=ht(n),o=i.length,s=!1,l=o-1;l>=0;l--)i[l]&&!Vi(i[l])?s=!0:(i[l]=null,!s&&o--);i.length=o,r[a]=i}}),delete r[A_],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var a=this._componentsMap.get(r);if(a){var i=a[n||0];if(i)return i;if(n==null){for(var o=0;o<a.length;o++)if(a[o])return a[o]}}},e.prototype.queryComponents=function(r){var n=r.mainType;if(!n)return[];var a=r.index,i=r.id,o=r.name,s=this._componentsMap.get(n);if(!s||!s.length)return[];var l;return a!=null?(l=[],D(ht(a),function(c){s[c]&&l.push(s[c])})):i!=null?l=D_("id",i,s):o!=null?l=D_("name",o,s):l=ot(s,function(c){return!!c}),I_(l,r)},e.prototype.findComponents=function(r){var n=r.query,a=r.mainType,i=s(n),o=i?this.queryComponents(i):ot(this._componentsMap.get(a),function(c){return!!c});return l(I_(o,r));function s(c){var u=a+"Index",f=a+"Id",h=a+"Name";return c&&(c[u]!=null||c[f]!=null||c[h]!=null)?{mainType:a,index:c[u],id:c[f],name:c[h]}:null}function l(c){return r.filter?ot(c,r.filter):c}},e.prototype.eachComponent=function(r,n,a){var i=this._componentsMap;if(ye(r)){var o=n,s=r;i.each(function(f,h){for(var d=0;f&&d<f.length;d++){var p=f[d];p&&s.call(o,h,p,p.componentIndex)}})}else for(var l=oe(r)?i.get(r):ce(r)?this.findComponents(r):null,c=0;l&&c<l.length;c++){var u=l[c];u&&n.call(a,u,u.componentIndex)}},e.prototype.getSeriesByName=function(r){var n=Mr(r,null);return ot(this._componentsMap.get("series"),function(a){return!!a&&n!=null&&a.name===n})},e.prototype.getSeriesByIndex=function(r){return this._componentsMap.get("series")[r]},e.prototype.getSeriesByType=function(r){return ot(this._componentsMap.get("series"),function(n){return!!n&&n.subType===r})},e.prototype.getSeries=function(){return ot(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,n){uo(this),D(this._seriesIndices,function(a){var i=this._componentsMap.get("series")[a];r.call(n,i,a)},this)},e.prototype.eachRawSeries=function(r,n){D(this._componentsMap.get("series"),function(a){a&&r.call(n,a,a.componentIndex)})},e.prototype.eachSeriesByType=function(r,n,a){uo(this),D(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];o.subType===r&&n.call(a,o,i)},this)},e.prototype.eachRawSeriesByType=function(r,n,a){return D(this.getSeriesByType(r),n,a)},e.prototype.isSeriesFiltered=function(r){return uo(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,n){uo(this);var a=[];D(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];r.call(n,o,i)&&a.push(i)},this),this._seriesIndices=a,this._seriesIndicesMap=de(a)},e.prototype.restoreData=function(r){Zl(this);var n=this._componentsMap,a=[];n.each(function(i,o){Ne.hasClass(o)&&a.push(o)}),Ne.topologicalTravel(a,Ne.getAllClassMainTypes(),function(i){D(n.get(i),function(o){o&&(i!=="series"||!_A(o,r))&&o.restoreData()})})},e.internalField=(function(){Zl=function(r){var n=r._seriesIndices=[];D(r._componentsMap.get("series"),function(a){a&&n.push(a.componentIndex)}),r._seriesIndicesMap=de(n)},uo=function(r){},M_=function(r,n){r.option={},r.option[A_]=yA,r._componentsMap=de({series:[]}),r._componentsCount=de();var a=n.aria;ce(a)&&a.enabled==null&&(a.enabled=!0),bA(n,r._theme.option),Me(n,vA,!1),r._mergeOption(n,null)}})(),e})(Xe);function _A(t,e){if(e){var r=e.seriesIndex,n=e.seriesId,a=e.seriesName;return r!=null&&t.componentIndex!==r||n!=null&&t.id!==n||a!=null&&t.name!==a}}function bA(t,e){var r=t.color&&!t.colorLayer;D(e,function(n,a){a==="colorLayer"&&r||Ne.hasClass(a)||(typeof n=="object"?t[a]=t[a]?Me(t[a],n,!1):we(n):t[a]==null&&(t[a]=n))})}function D_(t,e,r){if(ne(e)){var n=de();return D(e,function(i){if(i!=null){var o=Mr(i,null);o!=null&&n.set(i,!0)}}),ot(r,function(i){return i&&n.get(i[t])})}else{var a=Mr(e,null);return ot(r,function(i){return i&&a!=null&&i[t]===a})}}function I_(t,e){return e.hasOwnProperty("subType")?ot(t,function(r){return r&&r.subType===e.subType}):t}function P_(t){var e=de();return t&&D(ht(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}br(Eh,Jf);var xA=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],L_=(function(){function t(e){D(xA,function(r){this[r]=Ae(e[r],e)},this)}return t})(),wA=/^(min|max)?(.+)$/,SA=(function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,n){e&&(D(ht(e.series),function(o){o&&o.data&&wt(o.data)&&iu(o.data)}),D(ht(e.dataset),function(o){o&&o.source&&wt(o.source)&&iu(o.source)})),e=we(e);var a=this._optionBackup,i=kA(e,r,!a);this._newBaseOption=i.baseOption,a?(i.timelineOptions.length&&(a.timelineOptions=i.timelineOptions),i.mediaList.length&&(a.mediaList=i.mediaList),i.mediaDefault&&(a.mediaDefault=i.mediaDefault)):this._optionBackup=i},t.prototype.mountOption=function(e){var r=this._optionBackup;return this._timelineOptions=r.timelineOptions,this._mediaList=r.mediaList,this._mediaDefault=r.mediaDefault,this._currentMediaIndices=[],we(e?r.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(e){var r,n=this._timelineOptions;if(n.length){var a=e.getComponent("timeline");a&&(r=we(n[a.getCurrentIndex()]))}return r},t.prototype.getMediaOption=function(e){var r=this._api.getWidth(),n=this._api.getHeight(),a=this._mediaList,i=this._mediaDefault,o=[],s=[];if(!a.length&&!i)return s;for(var l=0,c=a.length;l<c;l++)TA(a[l].query,r,n)&&o.push(l);return!o.length&&i&&(o=[-1]),o.length&&!MA(o,this._currentMediaIndices)&&(s=fe(o,function(u){return we(u===-1?i.option:a[u].option)})),this._currentMediaIndices=o,s},t})();function kA(t,e,r){var n=[],a,i,o=t.baseOption,s=t.timeline,l=t.options,c=t.media,u=!!t.media,f=!!(l||s||o&&o.timeline);o?(i=o,i.timeline||(i.timeline=s)):((f||u)&&(t.options=t.media=null),i=t),u&&ne(c)&&D(c,function(d){d&&d.option&&(d.query?n.push(d):a||(a=d))}),h(i),D(l,function(d){return h(d)}),D(n,function(d){return h(d.option)});function h(d){D(e,function(p){p(d,r)})}return{baseOption:i,timelineOptions:l||[],mediaDefault:a,mediaList:n}}function TA(t,e,r){var n={width:e,height:r,aspectratio:e/r},a=!0;return D(t,function(i,o){var s=o.match(wA);if(!(!s||!s[1]||!s[2])){var l=s[1],c=s[2].toLowerCase();CA(n[c],i,l)||(a=!1)}}),a}function CA(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function MA(t,e){return t.join(",")===e.join(",")}var sr=D,fo=ce,R_=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Oh(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=R_.length;r<n;r++){var a=R_[r],i=e.normal,o=e.emphasis;i&&i[a]&&(t[a]=t[a]||{},t[a].normal?Me(t[a].normal,i[a]):t[a].normal=i[a],i[a]=null),o&&o[a]&&(t[a]=t[a]||{},t[a].emphasis?Me(t[a].emphasis,o[a]):t[a].emphasis=o[a],o[a]=null)}}function pt(t,e,r){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,a=t[e].emphasis;n&&(r?(t[e].normal=t[e].emphasis=null,Ie(t[e],n)):t[e]=n),a&&(t.emphasis=t.emphasis||{},t.emphasis[e]=a,a.focus&&(t.emphasis.focus=a.focus),a.blurScope&&(t.emphasis.blurScope=a.blurScope))}}function ho(t){pt(t,"itemStyle"),pt(t,"lineStyle"),pt(t,"areaStyle"),pt(t,"label"),pt(t,"labelLine"),pt(t,"upperLabel"),pt(t,"edgeLabel")}function Qe(t,e){var r=fo(t)&&t[e],n=fo(r)&&r.textStyle;if(n)for(var a=0,i=hg.length;a<i;a++){var o=hg[a];n.hasOwnProperty(o)&&(r[o]=n[o])}}function jt(t){t&&(ho(t),Qe(t,"label"),t.emphasis&&Qe(t.emphasis,"label"))}function AA(t){if(fo(t)){Oh(t),ho(t),Qe(t,"label"),Qe(t,"upperLabel"),Qe(t,"edgeLabel"),t.emphasis&&(Qe(t.emphasis,"label"),Qe(t.emphasis,"upperLabel"),Qe(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Oh(e),jt(e));var r=t.markLine;r&&(Oh(r),jt(r));var n=t.markArea;n&&jt(n);var a=t.data;if(t.type==="graph"){a=a||t.nodes;var i=t.links||t.edges;if(i&&!wt(i))for(var o=0;o<i.length;o++)jt(i[o]);D(t.categories,function(c){ho(c)})}if(a&&!wt(a))for(var o=0;o<a.length;o++)jt(a[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)jt(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)ne(l[o])?(jt(l[o][0]),jt(l[o][1])):jt(l[o]);t.type==="gauge"?(Qe(t,"axisLabel"),Qe(t,"title"),Qe(t,"detail")):t.type==="treemap"?(pt(t.breadcrumb,"itemStyle"),D(t.levels,function(c){ho(c)})):t.type==="tree"&&ho(t.leaves)}}function Zr(t){return ne(t)?t:t?[t]:[]}function E_(t){return(ne(t)?t[0]:t)||{}}function DA(t,e){sr(Zr(t.series),function(n){fo(n)&&AA(n)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),sr(r,function(n){sr(Zr(t[n]),function(a){a&&(Qe(a,"axisLabel"),Qe(a.axisPointer,"label"))})}),sr(Zr(t.parallel),function(n){var a=n&&n.parallelAxisDefault;Qe(a,"axisLabel"),Qe(a&&a.axisPointer,"label")}),sr(Zr(t.calendar),function(n){pt(n,"itemStyle"),Qe(n,"dayLabel"),Qe(n,"monthLabel"),Qe(n,"yearLabel")}),sr(Zr(t.radar),function(n){Qe(n,"name"),n.name&&n.axisName==null&&(n.axisName=n.name,delete n.name),n.nameGap!=null&&n.axisNameGap==null&&(n.axisNameGap=n.nameGap,delete n.nameGap)}),sr(Zr(t.geo),function(n){fo(n)&&(jt(n),sr(Zr(n.regions),function(a){jt(a)}))}),sr(Zr(t.timeline),function(n){jt(n),pt(n,"label"),pt(n,"itemStyle"),pt(n,"controlStyle",!0);var a=n.data;ne(a)&&D(a,function(i){ce(i)&&(pt(i,"label"),pt(i,"itemStyle"))})}),sr(Zr(t.toolbox),function(n){pt(n,"iconStyle"),sr(n.feature,function(a){pt(a,"iconStyle")})}),Qe(E_(t.axisPointer),"label"),Qe(E_(t.tooltip).axisPointer,"label")}function IA(t,e){for(var r=e.split(","),n=t,a=0;a<r.length&&(n=n&&n[r[a]],n!=null);a++);return n}function PA(t,e,r,n){for(var a=e.split(","),i=t,o,s=0;s<a.length-1;s++)o=a[s],i[o]==null&&(i[o]={}),i=i[o];i[a[s]]==null&&(i[a[s]]=r)}function O_(t){t&&D(LA,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var LA=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],RA=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Nh=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function po(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<Nh.length;r++){var n=Nh[r][1],a=Nh[r][0];e[n]!=null&&(e[a]=e[n])}}function N_(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function B_(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function EA(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function z_(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&z_(t[r].children,e)}function F_(t,e){DA(t,e),t.series=ht(t.series),D(t.series,function(r){if(ce(r)){var n=r.type;if(n==="line")r.clipOverflow!=null&&(r.clip=r.clipOverflow);else if(n==="pie"||n==="gauge"){r.clockWise!=null&&(r.clockwise=r.clockWise),N_(r.label);var a=r.data;if(a&&!wt(a))for(var i=0;i<a.length;i++)N_(a[i]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(n==="gauge"){var o=IA(r,"pointer.color");o!=null&&PA(r,"itemStyle.color",o)}else if(n==="bar"){po(r),po(r.backgroundStyle),po(r.emphasis);var a=r.data;if(a&&!wt(a))for(var i=0;i<a.length;i++)typeof a[i]=="object"&&(po(a[i]),po(a[i]&&a[i].emphasis))}else if(n==="sunburst"){var s=r.highlightPolicy;s&&(r.emphasis=r.emphasis||{},r.emphasis.focus||(r.emphasis.focus=s)),B_(r),z_(r.data,B_)}else n==="graph"||n==="sankey"?EA(r):n==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&Ie(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),O_(r)}}),t.dataRange&&(t.visualMap=t.dataRange),D(RA,function(r){var n=t[r];n&&(ne(n)||(n=[n]),D(n,function(a){O_(a)}))})}function OA(t){var e=de();t.eachSeries(function(r){var n=r.get("stack");if(n){var a=e.get(n)||e.set(n,[]),i=r.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:r};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;a.length&&i.setCalculationInfo("stackedOnSeries",a[a.length-1].seriesModel),a.push(o)}}),e.each(NA)}function NA(t){D(t,function(e,r){var n=[],a=[NaN,NaN],i=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(i,function(c,u,f){var h=o.get(e.stackedDimension,f);if(isNaN(h))return a;var d,p;s?p=o.getRawIndex(f):d=o.get(e.stackedByDimension,f);for(var m=NaN,v=r-1;v>=0;v--){var g=t[v];if(s||(p=g.data.rawIndexOf(g.stackedByDimension,d)),p>=0){var y=g.data.getByRawIndex(g.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&h>=0&&y>0||l==="samesign"&&h<=0&&y<0){h=QS(h,y),m=y;break}}}return n[0]=h,n[1]=m,n})})}var lr=(function(){function t(){this.group=new ct,this.uid=kl("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){},t.prototype.updateLayout=function(e,r,n,a){},t.prototype.updateVisual=function(e,r,n,a){},t.prototype.toggleBlurSeries=function(e,r,n){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t})();ou(lr),ms(lr);var H_=je(),V_={itemStyle:Ti(um,!0),lineStyle:Ti(cm,!0)},BA={lineStyle:"stroke",itemStyle:"fill"};function G_(t,e){var r=t.visualStyleMapper||V_[e];return r||(console.warn("Unknown style type '"+e+"'."),V_.itemStyle)}function W_(t,e){var r=t.visualDrawType||BA[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var zA={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=t.getModel(n),i=G_(t,n),o=i(a),s=a.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=W_(t,n),c=o[l],u=ye(c)?c:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||u||f){var h=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ye(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||ye(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&u)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var m=t.getDataParams(p),v=G({},o);v[l]=u(m),d.setItemVisual(p,"style",v)}}}},vo=new Xe,FA={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=G_(t,n),i=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){vo.option=l[n];var c=a(vo),u=o.ensureUniqueItemVisual(s,"style");G(u,c),vo.option.decal&&(o.setItemVisual(s,"decal",vo.option.decal),vo.option.decal.dirty=!0),i in c&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},HA={performRawSeries:!0,overallReset:function(t){var e=de();t.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var a=r.type+"-"+n,i=e.get(a);i||(i={},e.set(a,i)),H_(r).scope=i}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var n=r.getRawData(),a={},i=r.getData(),o=H_(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=W_(r,s);i.each(function(c){var u=i.getRawIndex(c);a[u]=c}),n.each(function(c){var u=a[c],f=i.getItemVisual(u,"colorFromPalette");if(f){var h=i.ensureUniqueItemVisual(u,"style"),d=n.getName(c)||c+"",p=n.count();h[l]=r.getColorFromPalette(d,o,p)}})}})}},Kl=Math.PI;function VA(t,e){e=e||{},Ie(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new ct,n=new at({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var a=new kt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),i=new at({style:{fill:"none"},textContent:a,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(i);var o;return e.showSpinner&&(o=new ol({shape:{startAngle:-Kl/2,endAngle:-Kl/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:Kl*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Kl*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=a.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,c=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:c,cy:u}),i.setShape({x:c-l,y:u-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var $_=(function(){function t(e,r,n,a){this._stageTaskMap=de(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),a=this._visualHandlers=a.slice(),this._allHandlers=n.concat(a)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var a=n.overallTask;a&&a.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),a=n.context,i=!r&&n.progressiveEnabled&&(!a||a.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=i?n.step:null,s=a&&a.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),a=e.getData(),i=a.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&i>=n.threshold,s=e.get("large")&&i>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?i:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,n=r._pipelineMap=de();e.eachSeries(function(a){var i=a.getProgressive(),o=a.uid;n.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:i&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),r._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;D(this._allHandlers,function(a){var i=e.get(a.uid)||e.set(a.uid,{}),o="";zr(!(a.reset&&a.overallReset),o),a.reset&&this._createSeriesStageTask(a,i,r,n),a.overallReset&&this._createOverallStageTask(a,i,r,n)},this)},t.prototype.prepareView=function(e,r,n,a){var i=e.renderTask,o=i.context;o.model=r,o.ecModel=n,o.api=a,i.__block=!e.incrementalPrepareRender,this._pipe(r,i)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,a){a=a||{};var i=!1,o=this;D(e,function(l,c){if(!(a.visualType&&a.visualType!==l.visualType)){var u=o._stageTaskMap.get(l.uid),f=u.seriesTaskMap,h=u.overallTask;if(h){var d,p=h.agentStubMap;p.each(function(v){s(a,v)&&(v.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var m=o.getPerformArgs(h,a.block);p.each(function(v){v.perform(m)}),h.perform(m)&&(i=!0)}else f&&f.each(function(v,g){s(a,v)&&v.dirty();var y=o.getPerformArgs(v,a.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(v.context.model),o.updatePayload(v,n),v.perform(y)&&(i=!0)})}});function s(l,c){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(c.__pipeline.id))}this.unfinished=i||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,a){var i=this,o=r.seriesTaskMap,s=r.seriesTaskMap=de(),l=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(u):l?n.eachRawSeriesByType(l,u):c&&c(n,a).each(u);function u(f){var h=f.uid,d=s.set(h,o&&o.get(h)||oo({plan:YA,reset:qA,count:ZA}));d.context={model:f,ecModel:n,api:a,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(f,d)}},t.prototype._createOverallStageTask=function(e,r,n,a){var i=this,o=r.overallTask=r.overallTask||oo({reset:GA});o.context={ecModel:n,api:a,overallReset:e.overallReset,scheduler:i};var s=o.agentStubMap,l=o.agentStubMap=de(),c=e.seriesType,u=e.getTargetSeries,f=!0,h=!1,d="";zr(!e.createOnAllSeries,d),c?n.eachRawSeriesByType(c,p):u?u(n,a).each(p):(f=!1,D(n.getSeries(),p));function p(m){var v=m.uid,g=l.set(v,s&&s.get(v)||(h=!0,oo({reset:WA,onDirty:UA})));g.context={model:m,overallProgress:f},g.agent=o,g.__block=f,i._pipe(m,g)}h&&o.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,a=this._pipelineMap.get(n);!a.head&&(a.head=r),a.tail&&a.tail.pipe(r),a.tail=r,r.__idxInPipeline=a.count++,r.__pipeline=a},t.wrapStageHandler=function(e,r){return ye(e)&&(e={overallReset:e,seriesType:KA(e)}),e.uid=kl("stageHandler"),r&&(e.visualType=r),e},t})();function GA(t){t.overallReset(t.ecModel,t.api,t.payload)}function WA(t){return t.overallProgress&&$A}function $A(){this.agent.dirty(),this.getDownstream().dirty()}function UA(){this.agent&&this.agent.dirty()}function YA(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function qA(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ht(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?fe(e,function(r,n){return U_(n)}):XA}var XA=U_(0);function U_(t){return function(e,r){var n=r.data,a=r.resetDefines[t];if(a&&a.dataEach)for(var i=e.start;i<e.end;i++)a.dataEach(n,i);else a&&a.progress&&a.progress(e,n)}}function ZA(t){return t.data.count()}function KA(t){jl=null;try{t(go,Y_)}catch{}return jl}var go={},Y_={},jl;q_(go,Eh),q_(Y_,L_),go.eachSeriesByType=go.eachRawSeriesByType=function(t){jl=t},go.eachComponent=function(t){t.mainType==="series"&&t.subType&&(jl=t.subType)};function q_(t,e){for(var r in e.prototype)t[r]=mt}var X_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const jA={color:X_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],X_]};var vt="#B9B8CE",Z_="#100C2A",Ql=function(){return{axisLine:{lineStyle:{color:vt}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},K_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],j_={darkMode:!0,color:K_,backgroundColor:Z_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:vt},pageTextStyle:{color:vt}},textStyle:{color:vt},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:vt}},dataZoom:{borderColor:"#71708A",textStyle:{color:vt},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:vt}},timeline:{lineStyle:{color:vt},label:{color:vt},controlStyle:{color:vt,borderColor:vt}},calendar:{itemStyle:{color:Z_},dayLabel:{color:vt},monthLabel:{color:vt},yearLabel:{color:vt}},timeAxis:Ql(),logAxis:Ql(),valueAxis:Ql(),categoryAxis:Ql(),line:{symbol:"circle"},graph:{color:K_},gauge:{title:{color:vt},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:vt},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};j_.categoryAxis.splitLine.show=!1;var QA=(function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},n={},a={};if(oe(e)){var i=wr(e);r.mainType=i.main||null,r.subType=i.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};D(e,function(l,c){for(var u=!1,f=0;f<o.length;f++){var h=o[f],d=c.lastIndexOf(h);if(d>0&&d===c.length-h.length){var p=c.slice(0,d);p!=="data"&&(r.mainType=p,r[h.toLowerCase()]=l,u=!0)}}s.hasOwnProperty(c)&&(n[c]=l,u=!0),u||(a[c]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:a}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,i=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,c=r.dataQuery;return u(l,o,"mainType")&&u(l,o,"subType")&&u(l,o,"index","componentIndex")&&u(l,o,"name")&&u(l,o,"id")&&u(c,i,"name")&&u(c,i,"dataIndex")&&u(c,i,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,a,i));function u(f,h,d,p){return f[d]==null||h[p||d]===f[d]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t})(),Bh=["symbol","symbolSize","symbolRotate","symbolOffset"],Q_=Bh.concat(["symbolKeepAspect"]),JA={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var n={},a={},i=!1,o=0;o<Bh.length;o++){var s=Bh[o],l=t.get(s);ye(l)?(i=!0,a[s]=l):n[s]=l}if(n.symbol=n.symbol||t.defaultSymbol,r.setVisual(G({legendIcon:t.legendIcon||n.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},n)),e.isSeriesFiltered(t))return;var c=Ge(a);function u(f,h){for(var d=t.getRawValue(h),p=t.getDataParams(h),m=0;m<c.length;m++){var v=c[m];f.setItemVisual(h,v,a[v](d,p))}}return{dataEach:i?u:null}}},eD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function n(a,i){for(var o=a.getItemModel(i),s=0;s<Q_.length;s++){var l=Q_[s],c=o.getShallow(l,!0);c!=null&&a.setItemVisual(i,l,c)}}return{dataEach:r.hasItemOption?n:null}}};function tD(t,e,r){switch(r){case"color":var n=t.getItemVisual(e,"style");return n[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function rD(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function mo(t,e,r){for(var n;t&&!(e(t)&&(n=t,r));)t=t.__hostTarget||t.parent;return n}var nD=Math.round(Math.random()*9),aD=typeof Object.defineProperty=="function",iD=(function(){function t(){this._id="__ec_inner_"+nD++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var n=this._guard(e);return aD?Object.defineProperty(n,this._id,{value:r,enumerable:!1,configurable:!0}):n[this._id]=r,this},t.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},t.prototype.has=function(e){return!!this._guard(e)[this._id]},t.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},t})();function aa(t){return isFinite(t)}function oD(t,e,r){var n=e.x==null?0:e.x,a=e.x2==null?1:e.x2,i=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(n=n*r.width+r.x,a=a*r.width+r.x,i=i*r.height+r.y,o=o*r.height+r.y),n=aa(n)?n:0,a=aa(a)?a:1,i=aa(i)?i:0,o=aa(o)?o:0;var s=t.createLinearGradient(n,i,a,o);return s}function sD(t,e,r){var n=r.width,a=r.height,i=Math.min(n,a),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*n+r.x,s=s*a+r.y,l=l*i),o=aa(o)?o:.5,s=aa(s)?s:.5,l=l>=0&&aa(l)?l:.5;var c=t.createRadialGradient(o,s,0,o,s,l);return c}function zh(t,e,r){for(var n=e.type==="radial"?sD(t,e,r):oD(t,e,r),a=e.colorStops,i=0;i<a.length;i++)n.addColorStop(a[i].offset,a[i].color);return n}function lD(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!0;return!1}function Jl(t){return parseInt(t,10)}function ec(t,e,r){var n=["width","height"][e],a=["clientWidth","clientHeight"][e],i=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(r[n]!=null&&r[n]!=="auto")return parseFloat(r[n]);var s=document.defaultView.getComputedStyle(t);return(t[a]||Jl(s[n])||Jl(t.style[n]))-(Jl(s[i])||0)-(Jl(s[o])||0)|0}function cD(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:He(t)?[t]:ne(t)?t:null}function J_(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&cD(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(r){var a=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&a!==1&&(r=fe(r,function(i){return i/a}),n/=a)}return[r,n]}var uD=new Wn(!0);function tc(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function e0(t){return typeof t=="string"&&t!=="none"}function rc(t){var e=t.fill;return e!=null&&e!=="none"}function t0(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function r0(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function Fh(t,e,r){var n=ov(e.image,e.__image,r);if(ys(n)){var a=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var i=new DOMMatrix;i.translateSelf(e.x||0,e.y||0),i.rotateSelf(0,0,(e.rotation||0)*pw),i.scaleSelf(e.scaleX||1,e.scaleY||1),a.setTransform(i)}return a}}function fD(t,e,r,n){var a,i=tc(r),o=rc(r),s=r.strokePercent,l=s<1,c=!e.path;(!e.silent||l)&&c&&e.createPathProxy();var u=e.path||uD,f=e.__dirty;if(!n){var h=r.fill,d=r.stroke,p=o&&!!h.colorStops,m=i&&!!d.colorStops,v=o&&!!h.image,g=i&&!!d.image,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0;(p||m)&&(w=e.getBoundingRect()),p&&(y=f?zh(t,h,w):e.__canvasFillGradient,e.__canvasFillGradient=y),m&&(b=f?zh(t,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=b),v&&(x=f||!e.__canvasFillPattern?Fh(t,h,e):e.__canvasFillPattern,e.__canvasFillPattern=x),g&&(S=f||!e.__canvasStrokePattern?Fh(t,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?t.fillStyle=y:v&&(x?t.fillStyle=x:o=!1),m?t.strokeStyle=b:g&&(S?t.strokeStyle=S:i=!1)}var k=e.getGlobalScale();u.setScale(k[0],k[1],e.segmentIgnoreThreshold);var T,M;t.setLineDash&&r.lineDash&&(a=J_(e),T=a[0],M=a[1]);var A=!0;(c||f&La)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),A=!1),u.reset(),e.buildPath(u,e.shape,n),u.toStatic(),e.pathUpdated()),A&&u.rebuildPath(t,l?s:1),T&&(t.setLineDash(T),t.lineDashOffset=M),n||(r.strokeFirst?(i&&r0(t,r),o&&t0(t,r)):(o&&t0(t,r),i&&r0(t,r))),T&&t.setLineDash([])}function hD(t,e,r){var n=e.__image=ov(r.image,e.__image,e,e.onload);if(!(!n||!ys(n))){var a=r.x||0,i=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var c=r.sx||0,u=r.sy||0;t.drawImage(n,c,u,r.sWidth,r.sHeight,a,i,o,s)}else if(r.sx&&r.sy){var c=r.sx,u=r.sy,f=o-c,h=s-u;t.drawImage(n,c,u,f,h,a,i,o,s)}else t.drawImage(n,a,i,o,s)}}function dD(t,e,r){var n,a=r.text;if(a!=null&&(a+=""),a){t.font=r.font||An,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var i=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=J_(e),i=n[0],o=n[1]),i&&(t.setLineDash(i),t.lineDashOffset=o),r.strokeFirst?(tc(r)&&t.strokeText(a,r.x,r.y),rc(r)&&t.fillText(a,r.x,r.y)):(rc(r)&&t.fillText(a,r.x,r.y),tc(r)&&t.strokeText(a,r.x,r.y)),i&&t.setLineDash([])}}var n0=["shadowBlur","shadowOffsetX","shadowOffsetY"],a0=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function i0(t,e,r,n,a){var i=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){It(t,a),i=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?Bn.opacity:o}(n||e.blend!==r.blend)&&(i||(It(t,a),i=!0),t.globalCompositeOperation=e.blend||Bn.blend);for(var s=0;s<n0.length;s++){var l=n0[s];(n||e[l]!==r[l])&&(i||(It(t,a),i=!0),t[l]=t.dpr*(e[l]||0))}return(n||e.shadowColor!==r.shadowColor)&&(i||(It(t,a),i=!0),t.shadowColor=e.shadowColor||Bn.shadowColor),i}function o0(t,e,r,n,a){var i=yo(e,a.inHover),o=n?null:r&&yo(r,a.inHover)||{};if(i===o)return!1;var s=i0(t,i,o,n,a);if((n||i.fill!==o.fill)&&(s||(It(t,a),s=!0),e0(i.fill)&&(t.fillStyle=i.fill)),(n||i.stroke!==o.stroke)&&(s||(It(t,a),s=!0),e0(i.stroke)&&(t.strokeStyle=i.stroke)),(n||i.opacity!==o.opacity)&&(s||(It(t,a),s=!0),t.globalAlpha=i.opacity==null?1:i.opacity),e.hasStroke()){var l=i.lineWidth,c=l/(i.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==c&&(s||(It(t,a),s=!0),t.lineWidth=c)}for(var u=0;u<a0.length;u++){var f=a0[u],h=f[0];(n||i[h]!==o[h])&&(s||(It(t,a),s=!0),t[h]=i[h]||f[1])}return s}function pD(t,e,r,n,a){return i0(t,yo(e,a.inHover),r&&yo(r,a.inHover),n,a)}function s0(t,e){var r=e.transform,n=t.dpr||1;r?t.setTransform(n*r[0],n*r[1],n*r[2],n*r[3],n*r[4],n*r[5]):t.setTransform(n,0,0,n,0,0)}function vD(t,e,r){for(var n=!1,a=0;a<t.length;a++){var i=t[a];n=n||i.isZeroArea(),s0(e,i),e.beginPath(),i.buildPath(e,i.shape),e.clip()}r.allClipped=n}function gD(t,e){return t&&e?t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||t[4]!==e[4]||t[5]!==e[5]:!(!t&&!e)}var l0=1,c0=2,u0=3,f0=4;function mD(t){var e=rc(t),r=tc(t);return!(t.lineDash||!(+e^+r)||e&&typeof t.fill!="string"||r&&typeof t.stroke!="string"||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}function It(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function yo(t,e){return e&&t.__hoverStyle||t.style}function h0(t,e){ia(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function ia(t,e,r,n){var a=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~Ot,e.__isRendered=!1;return}var i=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||lD(i,o))&&(o&&o.length&&(It(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),i&&i.length&&(It(t,r),t.save(),vD(i,t,r),s=!0),r.prevElClipPaths=i),r.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var c=r.prevEl;c||(l=s=!0);var u=e instanceof Oe&&e.autoBatch&&mD(e.style);s||gD(a,c.transform)?(It(t,r),s0(t,e)):u||It(t,r);var f=yo(e,r.inHover);e instanceof Oe?(r.lastDrawType!==l0&&(l=!0,r.lastDrawType=l0),o0(t,e,c,l,r),(!u||!r.batchFill&&!r.batchStroke)&&t.beginPath(),fD(t,e,f,u),u&&(r.batchFill=f.fill||"",r.batchStroke=f.stroke||"")):e instanceof Us?(r.lastDrawType!==u0&&(l=!0,r.lastDrawType=u0),o0(t,e,c,l,r),dD(t,e,f)):e instanceof un?(r.lastDrawType!==c0&&(l=!0,r.lastDrawType=c0),pD(t,e,c,l,r),hD(t,e,f)):e.getTemporalDisplayables&&(r.lastDrawType!==f0&&(l=!0,r.lastDrawType=f0),yD(t,e,r)),u&&n&&It(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function yD(t,e,r){var n=e.getDisplayables(),a=e.getTemporalDisplayables();t.save();var i={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover},o,s;for(o=e.getCursor(),s=n.length;o<s;o++){var l=n[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ia(t,l,i,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}for(var c=0,u=a.length;c<u;c++){var l=a[c];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ia(t,l,i,c===u-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var Hh=new iD,d0=new Ci(100),p0=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Vh(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),n=e.getZr(),a=n.painter.type==="svg";t.dirty&&Hh.delete(t);var i=Hh.get(t);if(i)return i;var o=Ie(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=a?1:1/r,Hh.set(t,s),t.dirty=!1,s;function l(c){for(var u=[r],f=!0,h=0;h<p0.length;++h){var d=o[p0[h]];if(d!=null&&!ne(d)&&!oe(d)&&!He(d)&&typeof d!="boolean"){f=!1;break}u.push(d)}var p;if(f){p=u.join(",")+(a?"-svg":"");var m=d0.get(p);m&&(a?c.svgElement=m:c.image=m)}var v=g0(o.dashArrayX),g=_D(o.dashArrayY),y=v0(o.symbol),b=bD(v),x=m0(g),S=!a&&ba.createCanvas(),w=a&&{tag:"g",attrs:{},key:"dcl",children:[]},k=M(),T;S&&(S.width=k.width*r,S.height=k.height*r,T=S.getContext("2d")),A(),f&&d0.put(p,S||w),c.image=S,c.svgElement=w,c.svgWidth=k.width,c.svgHeight=k.height;function M(){for(var C=1,I=0,P=b.length;I<P;++I)C=lg(C,b[I]);for(var R=1,I=0,P=y.length;I<P;++I)R=lg(R,y[I].length);C*=R;var E=x*b.length*y.length;return{width:Math.max(1,Math.min(C,o.maxTileWidth)),height:Math.max(1,Math.min(E,o.maxTileHeight))}}function A(){T&&(T.clearRect(0,0,S.width,S.height),o.backgroundColor&&(T.fillStyle=o.backgroundColor,T.fillRect(0,0,S.width,S.height)));for(var C=0,I=0;I<g.length;++I)C+=g[I];if(C<=0)return;for(var P=-x,R=0,E=0,O=0;P<k.height;){if(R%2===0){for(var K=E/2%y.length,L=0,B=0,V=0;L<k.width*2;){for(var $=0,I=0;I<v[O].length;++I)$+=v[O][I];if($<=0)break;if(B%2===0){var X=(1-o.symbolSize)*.5,ue=L+v[O][B]*X,_e=P+g[R]*X,Te=v[O][B]*o.symbolSize,Ue=g[R]*o.symbolSize,We=V/2%y[K].length;Ye(ue,_e,Te,Ue,y[K][We])}L+=v[O][B],++V,++B,B===v[O].length&&(B=0)}++O,O===v.length&&(O=0)}P+=g[R],++E,++R,R===g.length&&(R=0)}function Ye(J,le,j,Q,F){var ie=a?1:r,ge=ja(F,J*ie,le*ie,j*ie,Q*ie,o.color,o.symbolKeepAspect);if(a){var Se=n.painter.renderOneToVNode(ge);Se&&w.children.push(Se)}else h0(T,ge)}}}}function v0(t){if(!t||t.length===0)return[["rect"]];if(oe(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!oe(t[r])){e=!1;break}if(e)return v0([t]);for(var n=[],r=0;r<t.length;++r)oe(t[r])?n.push([t[r]]):n.push(t[r]);return n}function g0(t){if(!t||t.length===0)return[[0,0]];if(He(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,n=0;n<t.length;++n)if(!He(t[n])){r=!1;break}if(r)return g0([t]);for(var a=[],n=0;n<t.length;++n)if(He(t[n])){var e=Math.ceil(t[n]);a.push([e,e])}else{var e=fe(t[n],function(s){return Math.ceil(s)});e.length%2===1?a.push(e.concat(e)):a.push(e)}return a}function _D(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if(He(t)){var e=Math.ceil(t);return[e,e]}var r=fe(t,function(n){return Math.ceil(n)});return t.length%2?r.concat(r):r}function bD(t){return fe(t,function(e){return m0(e)})}function m0(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function xD(t,e){t.eachRawSeries(function(r){if(!t.isSeriesFiltered(r)){var n=r.getData();n.hasItemVisual()&&n.each(function(o){var s=n.getItemVisual(o,"decal");if(s){var l=n.ensureUniqueItemVisual(o,"style");l.decal=Vh(s,e)}});var a=n.getVisual("decal");if(a){var i=n.getVisual("style");i.decal=Vh(a,e)}}})}var cr=new rr,y0={};function wD(t,e){y0[t]=e}function SD(t){return y0[t]}var kD=1,TD=800,CD=900,MD=1e3,AD=2e3,DD=5e3,_0=1e3,ID=1100,Gh=2e3,b0=3e3,PD=4e3,nc=4500,LD=4600,RD=5e3,ED=6e3,x0=7e3,OD={PROCESSOR:{FILTER:MD,SERIES_FILTER:TD,STATISTIC:DD},VISUAL:{LAYOUT:_0,PROGRESSIVE_LAYOUT:ID,GLOBAL:Gh,CHART:b0,POST_CHART_LAYOUT:LD,COMPONENT:PD,BRUSH:RD,CHART_ITEM:nc,ARIA:ED,DECAL:x0}},gt="__flagInMainProcess",Pt="__pendingUpdate",Wh="__needsUpdateStatus",w0=/^[a-zA-Z0-9_]+$/,$h="__connectUpdateStatus",S0=0,ND=1,BD=2;function k0(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return C0(this,t,e)}}function T0(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return C0(this,t,e)}}function C0(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),rr.prototype[e].apply(t,r)}var M0=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(rr),A0=M0.prototype;A0.on=T0("on"),A0.off=T0("off");var ri,Uh,ac,_n,Yh,qh,Xh,_o,bo,D0,I0,Zh,P0,ic,L0,R0,Qt,E0,O0=(function(t){U(e,t);function e(r,n,a){var i=t.call(this,new QA)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],a=a||{},oe(n)&&(n=N0[n]),i._dom=r;var o="canvas",s="auto",l=!1;a.ssr;var c=i._zr=T_(r,{renderer:a.renderer||o,devicePixelRatio:a.devicePixelRatio,width:a.width,height:a.height,ssr:a.ssr,useDirtyRect:ke(a.useDirtyRect,l),useCoarsePointer:ke(a.useCoarsePointer,s),pointerSize:a.pointerSize});i._ssr=a.ssr,i._throttledZrFlush=vh(Ae(c.flush,c),17),n=we(n),n&&F_(n,!0),i._theme=n,i._locale=z2(a.locale||$m),i._coordSysMgr=new zf;var u=i._api=L0(i);function f(h,d){return h.__prio-d.__prio}return Ul(sc,f),Ul(jh,f),i._scheduler=new $_(i,u,jh,sc),i._messageCenter=new M0,i._initEvents(),i.resize=Ae(i.resize,i),c.animation.on("frame",i._onframe,i),D0(c,i),I0(c,i),iu(i),i}return e.prototype._onframe=function(){if(!this._disposed){E0(this);var r=this._scheduler;if(this[Pt]){var n=this[Pt].silent;this[gt]=!0;try{ri(this),_n.update.call(this,null,this[Pt].updateParams)}catch(l){throw this[gt]=!1,this[Pt]=null,l}this._zr.flush(),this[gt]=!1,this[Pt]=null,_o.call(this,n),bo.call(this,n)}else if(r.unfinished){var a=kD,i=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(i),r.performDataProcessorTasks(i),qh(this,i),r.performVisualTasks(i),ic(this,this._model,o,"remain",{}),a-=+new Date-s}while(a>0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,n,a){if(!this[gt]){if(this._disposed){this.id;return}var i,o,s;if(ce(n)&&(a=n.lazyUpdate,i=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[gt]=!0,!this._model||n){var l=new SA(this._api),c=this._theme,u=this._model=new Eh;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,c,this._locale,l)}this._model.setOption(r,{replaceMerge:o},Qh);var f={seriesTransition:s,optionChanged:!0};if(a)this[Pt]={silent:i,updateParams:f},this[gt]=!1,this.getZr().wakeUp();else{try{ri(this),_n.update.call(this,null,f)}catch(h){throw this[Pt]=null,this[gt]=!1,h}this._ssr||this._zr.flush(),this[Pt]=null,this[gt]=!1,_o.call(this,i),bo.call(this,i)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ve.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){if(ve.svgSupported){var r=this._zr,n=r.storage.getDisplayList();return D(n,function(a){a.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,a=this._model,i=[],o=this;D(n,function(l){a.eachComponent({mainType:l},function(c){var u=o._componentsMap[c.__viewId];u.group.ignore||(i.push(u),u.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return D(i,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",a=this.group,i=Math.min,o=Math.max,s=1/0;if(B0[a]){var l=s,c=s,u=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();D(wo,function(b,x){if(b.group===a){var S=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(we(r)),w=b.getDom().getBoundingClientRect();l=i(w.left,l),c=i(w.top,c),u=o(w.right,u),f=o(w.bottom,f),h.push({dom:S,left:w.left,top:w.top})}}),l*=d,c*=d,u*=d,f*=d;var p=u-l,m=f-c,v=ba.createCanvas(),g=T_(v,{renderer:n?"svg":"canvas"});if(g.resize({width:p,height:m}),n){var y="";return D(h,function(b){var x=b.left-l,S=b.top-c;y+='<g transform="translate('+x+","+S+')">'+b.dom+"</g>"}),g.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&g.painter.setBackgroundColor(r.connectedBackgroundColor),g.refreshImmediately(),g.painter.toDataURL()}else return r.connectedBackgroundColor&&g.add(new at({shape:{x:0,y:0,width:p,height:m},style:{fill:r.connectedBackgroundColor}})),D(h,function(b){var x=new un({style:{x:b.left*d-l,y:b.top*d-c,image:b.dom}});g.add(x)}),g.refreshImmediately(),v.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n){return Yh(this,"convertToPixel",r,n)},e.prototype.convertFromPixel=function(r,n){return Yh(this,"convertFromPixel",r,n)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var a=this._model,i,o=ju(a,r);return D(o,function(s,l){l.indexOf("Models")>=0&&D(s,function(c){var u=c.coordinateSystem;if(u&&u.containPoint)i=i||!!u.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[c.__viewId];f&&f.containPoint&&(i=i||f.containPoint(n,c))}},this)},this),!!i},e.prototype.getVisual=function(r,n){var a=this._model,i=ju(a,r,{defaultMainType:"series"}),o=i.seriesModel,s=o.getData(),l=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?s.indexOfRawIndex(i.dataIndex):null;return l!=null?tD(s,l,n):rD(s,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;D(zD,function(n){var a=function(i){var o=r.getModel(),s=i.target,l,c=n==="globalout";if(c?l={}:s&&mo(s,function(p){var m=Ee(p);if(m&&m.dataIndex!=null){var v=m.dataModel||o.getSeriesByIndex(m.seriesIndex);return l=v&&v.getDataParams(m.dataIndex,m.dataType,s)||{},!0}else if(m.eventData)return l=G({},m.eventData),!0},!0),l){var u=l.componentType,f=l.componentIndex;(u==="markLine"||u==="markPoint"||u==="markArea")&&(u="series",f=l.seriesIndex);var h=u&&f!=null&&o.getComponent(u,f),d=h&&r[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=i,l.type=n,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:d},r.trigger(n,l)}};a.zrEventfulCallAtLast=!0,r._zr.on(n,a,r)}),D(xo,function(n,a){r._messageCenter.on(a,function(i){this.trigger(a,i)},r)}),D(["selectchanged"],function(n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),BM(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&pg(this.getDom(),ed,"");var n=this,a=n._api,i=n._model;D(n._componentsViews,function(o){o.dispose(i,a)}),D(n._chartsViews,function(o){o.dispose(i,a)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete wo[n.id]},e.prototype.resize=function(r){if(!this[gt]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var a=n.resetOption("media"),i=r&&r.silent;this[Pt]&&(i==null&&(i=this[Pt].silent),a=!0,this[Pt]=null),this[gt]=!0;try{a&&ri(this),_n.update.call(this,{type:"resize",animation:G({duration:0},r&&r.animation)})}catch(o){throw this[gt]=!1,o}this[gt]=!1,_o.call(this,i),bo.call(this,i)}}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ce(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!Jh[r]){var a=Jh[r](this._api,n),i=this._zr;this._loadingFX=a,i.add(a)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=G({},r);return n.type=xo[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ce(n)||(n={silent:!!n}),!!oc[r.type]&&this._model){if(this[gt]){this._pendingActions.push(r);return}var a=n.silent;Xh.call(this,r,a);var i=n.flush;i?this._zr.flush():i!==!1&&ve.browser.weChat&&this._throttledZrFlush(),_o.call(this,a),bo.call(this,a)}},e.prototype.updateLabelLayout=function(){cr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,a=this.getModel(),i=a.getSeriesByIndex(n);i.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=(function(){ri=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),Uh(f,!0),Uh(f,!1),h.plan()},Uh=function(f,h){for(var d=f._model,p=f._scheduler,m=h?f._componentsViews:f._chartsViews,v=h?f._componentsMap:f._chartsMap,g=f._zr,y=f._api,b=0;b<m.length;b++)m[b].__alive=!1;h?d.eachComponent(function(w,k){w!=="series"&&x(k)}):d.eachSeries(x);function x(w){var k=w.__requireNewView;w.__requireNewView=!1;var T="_ec_"+w.id+"_"+w.type,M=!k&&v[T];if(!M){var A=wr(w.type),C=h?lr.getClass(A.main,A.sub):ir.getClass(A.sub);M=new C,M.init(d,y),v[T]=M,m.push(M),g.add(M.group)}w.__viewId=M.__id=T,M.__alive=!0,M.__model=w,M.group.__ecComponentInfo={mainType:w.mainType,index:w.componentIndex},!h&&p.prepareView(M,w,d,y)}for(var b=0;b<m.length;){var S=m[b];S.__alive?b++:(!h&&S.renderTask.dispose(),g.remove(S.group),S.dispose(d,y),m.splice(b,1),v[S.__id]===S&&delete v[S.__id],S.__id=S.group.__ecComponentInfo=null)}},ac=function(f,h,d,p,m){var v=f._model;if(v.setUpdatePayload(d),!p){D([].concat(f._componentsViews).concat(f._chartsViews),S);return}var g={};g[p+"Id"]=d[p+"Id"],g[p+"Index"]=d[p+"Index"],g[p+"Name"]=d[p+"Name"];var y={mainType:p,query:g};m&&(y.subType=m);var b=d.excludeSeriesId,x;b!=null&&(x=de(),D(ht(b),function(w){var k=Mr(w,null);k!=null&&x.set(k,!0)})),v&&v.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;if(!k)if(Eg(d))if(w instanceof Pr)d.type===Zn&&!d.notBlur&&!w.get(["emphasis","disabled"])&&Dk(w,d,f._api);else{var T=of(w.mainType,w.componentIndex,d.name,f._api),M=T.focusSelf,A=T.dispatchers;d.type===Zn&&M&&!d.notBlur&&af(w.mainType,w.componentIndex,f._api),A&&D(A,function(C){d.type===Zn?Js(C):el(C)})}else uf(d)&&w instanceof Pr&&(Lk(w,d,f._api),Pg(w),Qt(f))},f),v&&v.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;k||S(f[p==="series"?"_chartsMap":"_componentsMap"][w.__viewId])},f);function S(w){w&&w.__alive&&w[h]&&w[h](w.__model,v,f._api,d)}},_n={prepareAndUpdate:function(f){ri(this),_n.update.call(this,f,{optionChanged:f.newOption!=null})},update:function(f,h){var d=this._model,p=this._api,m=this._zr,v=this._coordSysMgr,g=this._scheduler;if(d){d.setUpdatePayload(f),g.restoreData(d,f),g.performSeriesTasks(d),v.create(d,p),g.performDataProcessorTasks(d,f),qh(this,d),v.update(d,p),r(d),g.performVisualTasks(d,f),Zh(this,d,p,f,h);var y=d.get("backgroundColor")||"transparent",b=d.get("darkMode");m.setBackgroundColor(y),b!=null&&b!=="auto"&&m.setDarkMode(b),cr.trigger("afterupdate",d,p)}},updateTransform:function(f){var h=this,d=this._model,p=this._api;if(d){d.setUpdatePayload(f);var m=[];d.eachComponent(function(g,y){if(g!=="series"){var b=h.getViewOfComponentModel(y);if(b&&b.__alive)if(b.updateTransform){var x=b.updateTransform(y,d,p,f);x&&x.update&&m.push(b)}else m.push(b)}});var v=de();d.eachSeries(function(g){var y=h._chartsMap[g.__viewId];if(y.updateTransform){var b=y.updateTransform(g,d,p,f);b&&b.update&&v.set(g.uid,1)}else v.set(g.uid,1)}),r(d),this._scheduler.performVisualTasks(d,f,{setDirty:!0,dirtyMap:v}),ic(this,d,p,f,{},v),cr.trigger("afterupdate",d,p)}},updateView:function(f){var h=this._model;h&&(h.setUpdatePayload(f),ir.markUpdateMethod(f,"updateView"),r(h),this._scheduler.performVisualTasks(h,f,{setDirty:!0}),Zh(this,h,this._api,f,{}),cr.trigger("afterupdate",h,this._api))},updateVisual:function(f){var h=this,d=this._model;d&&(d.setUpdatePayload(f),d.eachSeries(function(p){p.getData().clearAllVisual()}),ir.markUpdateMethod(f,"updateVisual"),r(d),this._scheduler.performVisualTasks(d,f,{visualType:"visual",setDirty:!0}),d.eachComponent(function(p,m){if(p!=="series"){var v=h.getViewOfComponentModel(m);v&&v.__alive&&v.updateVisual(m,d,h._api,f)}}),d.eachSeries(function(p){var m=h._chartsMap[p.__viewId];m.updateVisual(p,d,h._api,f)}),cr.trigger("afterupdate",d,this._api))},updateLayout:function(f){_n.update.call(this,f)}},Yh=function(f,h,d,p){if(f._disposed){f.id;return}for(var m=f._model,v=f._coordSysMgr.getCoordinateSystems(),g,y=ju(m,d),b=0;b<v.length;b++){var x=v[b];if(x[h]&&(g=x[h](m,y,p))!=null)return g}},qh=function(f,h){var d=f._chartsMap,p=f._scheduler;h.eachSeries(function(m){p.updateStreamModes(m,d[m.__viewId])})},Xh=function(f,h){var d=this,p=this.getModel(),m=f.type,v=f.escapeConnect,g=oc[m],y=g.actionInfo,b=(y.update||"update").split(":"),x=b.pop(),S=b[0]!=null&&wr(b[0]);this[gt]=!0;var w=[f],k=!1;f.batch&&(k=!0,w=fe(f.batch,function(R){return R=Ie(G({},R),f),R.batch=null,R}));var T=[],M,A=uf(f),C=Eg(f);if(C&&Ig(this._api),D(w,function(R){if(M=g.action(R,d._model,d._api),M=M||G({},R),M.type=y.event||M.type,T.push(M),C){var E=Qu(f),O=E.queryOptionMap,K=E.mainTypeSpecified,L=K?O.keys()[0]:"series";ac(d,x,R,L),Qt(d)}else A?(ac(d,x,R,"series"),Qt(d)):S&&ac(d,x,R,S.main,S.sub)}),x!=="none"&&!C&&!A&&!S)try{this[Pt]?(ri(this),_n.update.call(this,f),this[Pt]=null):_n[x].call(this,f)}catch(R){throw this[gt]=!1,R}if(k?M={type:y.event||m,escapeConnect:v,batch:T}:M=T[0],this[gt]=!1,!h){var I=this._messageCenter;if(I.trigger(M.type,M),A){var P={type:"selectchanged",escapeConnect:v,selected:Rk(p),isFromClick:f.isFromClick||!1,fromAction:f.type,fromActionPayload:f};I.trigger(P.type,P)}}},_o=function(f){for(var h=this._pendingActions;h.length;){var d=h.shift();Xh.call(this,d,f)}},bo=function(f){!f&&this.trigger("updated")},D0=function(f,h){f.on("rendered",function(d){h.trigger("rendered",d),f.animation.isFinished()&&!h[Pt]&&!h._scheduler.unfinished&&!h._pendingActions.length&&h.trigger("finished")})},I0=function(f,h){f.on("mouseover",function(d){var p=d.target,m=mo(p,cf);m&&(Ik(m,d,h._api),Qt(h))}).on("mouseout",function(d){var p=d.target,m=mo(p,cf);m&&(Pk(m,d,h._api),Qt(h))}).on("click",function(d){var p=d.target,m=mo(p,function(y){return Ee(y).dataIndex!=null},!0);if(m){var v=m.selected?"unselect":"select",g=Ee(m);h._api.dispatchAction({type:v,dataType:g.dataType,dataIndexInside:g.dataIndex,seriesIndex:g.seriesIndex,isFromClick:!0})}})};function r(f){f.clearColorPalette(),f.eachSeries(function(h){h.clearColorPalette()})}function n(f){var h=[],d=[],p=!1;if(f.eachComponent(function(y,b){var x=b.get("zlevel")||0,S=b.get("z")||0,w=b.getZLevelKey();p=p||!!w,(y==="series"?d:h).push({zlevel:x,z:S,idx:b.componentIndex,type:y,key:w})}),p){var m=h.concat(d),v,g;Ul(m,function(y,b){return y.zlevel===b.zlevel?y.z-b.z:y.zlevel-b.zlevel}),D(m,function(y){var b=f.getComponent(y.type,y.idx),x=y.zlevel,S=y.key;v!=null&&(x=Math.max(v,x)),S?(x===v&&S!==g&&x++,g=S):g&&(x===v&&x++,g=""),v=x,b.setZLevel(x)})}}Zh=function(f,h,d,p,m){n(h),P0(f,h,d,p,m),D(f._chartsViews,function(v){v.__alive=!1}),ic(f,h,d,p,m),D(f._chartsViews,function(v){v.__alive||v.remove(h,d)})},P0=function(f,h,d,p,m,v){D(v||f._componentsViews,function(g){var y=g.__model;c(y,g),g.render(y,h,d,p),s(y,g),u(y,g)})},ic=function(f,h,d,p,m,v){var g=f._scheduler;m=G(m||{},{updatedSeries:h.getSeries()}),cr.trigger("series:beforeupdate",h,d,m);var y=!1;h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];x.__alive=!0;var S=x.renderTask;g.updatePayload(S,p),c(b,x),v&&v.get(b.uid)&&S.dirty(),S.perform(g.getPerformArgs(S))&&(y=!0),x.group.silent=!!b.get("silent"),o(b,x),Pg(b)}),g.unfinished=y||g.unfinished,cr.trigger("series:layoutlabels",h,d,m),cr.trigger("series:transition",h,d,m),h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];s(b,x),u(b,x)}),i(f,h),cr.trigger("series:afterupdate",h,d,m)},Qt=function(f){f[Wh]=!0,f.getZr().wakeUp()},E0=function(f){f[Wh]&&(f.getZr().storage.traverse(function(h){Xi(h)||a(h)}),f[Wh]=!1)};function a(f){for(var h=[],d=f.currentStates,p=0;p<d.length;p++){var m=d[p];m==="emphasis"||m==="blur"||m==="select"||h.push(m)}f.selected&&f.states.select&&h.push("select"),f.hoverState===Zs&&f.states.emphasis?h.push("emphasis"):f.hoverState===Xs&&f.states.blur&&h.push("blur"),f.useStates(h)}function i(f,h){var d=f._zr,p=d.storage,m=0;p.traverse(function(v){v.isGroup||m++}),m>h.get("hoverLayerThreshold")&&!ve.node&&!ve.worker&&h.eachSeries(function(v){if(!v.preventUsingHoverLayer){var g=f._chartsMap[v.__viewId];g.__alive&&g.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(f,h){if(!f.preventAutoZ){var d=f.get("z")||0,p=f.get("zlevel")||0;h.eachRendered(function(m){return l(m,d,p,-1/0),!0})}}function l(f,h,d,p){var m=f.getTextContent(),v=f.getTextGuideLine(),g=f.isGroup;if(g)for(var y=f.childrenRef(),b=0;b<y.length;b++)p=Math.max(l(y[b],h,d,p),p);else f.z=h,f.zlevel=d,p=Math.max(f.z2,p);if(m&&(m.z=h,m.zlevel=d,isFinite(p)&&(m.z2=p+2)),v){var x=f.textGuideLineConfig;v.z=h,v.zlevel=d,isFinite(p)&&(v.z2=p+(x&&x.showAbove?1:-1))}return p}function c(f,h){h.eachRendered(function(d){if(!Xi(d)){var p=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function u(f,h){var d=f.getModel("stateAnimation"),p=f.isAnimationEnabled(),m=d.get("duration"),v=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(g){if(g.states&&g.states.emphasis){if(Xi(g))return;if(g instanceof Oe&&zk(g),g.__dirty){var y=g.prevStates;y&&g.useStates(y)}if(p){g.stateTransition=v;var b=g.getTextContent(),x=g.getTextGuideLine();b&&(b.stateTransition=v),x&&(x.stateTransition=v)}g.__dirty&&a(g)}})}L0=function(f){return new((function(h){U(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var m=p.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);p=p.parent}},d.prototype.enterEmphasis=function(p,m){Js(p,m),Qt(f)},d.prototype.leaveEmphasis=function(p,m){el(p,m),Qt(f)},d.prototype.enterBlur=function(p){Ak(p),Qt(f)},d.prototype.leaveBlur=function(p){Cg(p),Qt(f)},d.prototype.enterSelect=function(p){Mg(p),Qt(f)},d.prototype.leaveSelect=function(p){Ag(p),Qt(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(p){return f.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return f.getViewOfSeriesModel(p)},d})(L_))(f)},R0=function(f){function h(d,p){for(var m=0;m<d.length;m++){var v=d[m];v[$h]=p}}D(xo,function(d,p){f._messageCenter.on(p,function(m){if(B0[f.group]&&f[$h]!==S0){if(m&&m.escapeConnect)return;var v=f.makeActionFromEvent(m),g=[];D(wo,function(y){y!==f&&y.group===f.group&&g.push(y)}),h(g,S0),D(g,function(y){y[$h]!==ND&&y.dispatchAction(v)}),h(g,BD)}})})}})(),e})(rr),Kh=O0.prototype;Kh.on=k0("on"),Kh.off=k0("off"),Kh.one=function(t,e,r){var n=this;function a(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e&&e.apply&&e.apply(this,i),n.off(t,a)}this.on.call(this,t,a,r)};var zD=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function LE(t){}var oc={},xo={},jh=[],Qh=[],sc=[],N0={},Jh={},wo={},B0={},FD=+new Date-0,ed="_echarts_instance_";function HD(t,e,r){var n=!(r&&r.ssr);if(n){var a=VD(t);if(a)return a}var i=new O0(t,e,r);return i.id="ec_"+FD++,wo[i.id]=i,n&&pg(t,ed,i.id),R0(i),cr.trigger("afterinit",i),i}function VD(t){return wo[vk(t,ed)]}function z0(t,e){N0[t]=e}function F0(t){Pe(Qh,t)<0&&Qh.push(t)}function H0(t,e){rd(jh,t,e,AD)}function GD(t){td("afterinit",t)}function WD(t){td("afterupdate",t)}function td(t,e){cr.on(t,e)}function oa(t,e,r){ye(e)&&(r=e,e="");var n=ce(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,!xo[e]&&(zr(w0.test(n)&&w0.test(e)),oc[n]||(oc[n]={action:r,actionInfo:t}),xo[e]=n)}function $D(t,e){zf.register(t,e)}function UD(t,e){rd(sc,t,e,_0,"layout")}function sa(t,e){rd(sc,t,e,b0,"visual")}var V0=[];function rd(t,e,r,n,a){if((ye(e)||ce(e))&&(r=e,e=n),!(Pe(V0,r)>=0)){V0.push(r);var i=$_.wrapStageHandler(r,a);i.__prio=e,i.__raw=r,t.push(i)}}function G0(t,e){Jh[t]=e}function YD(t,e,r){var n=SD("registerMap");n&&n(t,e,r)}var qD=lC;sa(Gh,zA),sa(nc,FA),sa(nc,HA),sa(Gh,JA),sa(nc,eD),sa(x0,xD),F0(F_),H0(CD,OA),G0("default",VA),oa({type:Zn,event:Zn,update:Zn},mt),oa({type:Ks,event:Ks,update:Ks},mt),oa({type:Wi,event:Wi,update:Wi},mt),oa({type:js,event:js,update:js},mt),oa({type:$i,event:$i,update:$i},mt),z0("light",jA),z0("dark",j_);var W0=[],XD={registerPreprocessor:F0,registerProcessor:H0,registerPostInit:GD,registerPostUpdate:WD,registerUpdateLifecycle:td,registerAction:oa,registerCoordinateSystem:$D,registerLayout:UD,registerVisual:sa,registerTransform:qD,registerLoading:G0,registerMap:YD,registerImpl:wD,PRIORITY:OD,ComponentModel:Ne,ComponentView:lr,SeriesModel:Pr,ChartView:ir,registerComponentModel:function(t){Ne.registerClass(t)},registerComponentView:function(t){lr.registerClass(t)},registerSeriesModel:function(t){Pr.registerClass(t)},registerChartView:function(t){ir.registerClass(t)},registerSubTypeDefaulter:function(t,e){Ne.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){pA(t,e)}};function bn(t){if(ne(t)){D(t,function(e){bn(e)});return}Pe(W0,t)>=0||(W0.push(t),ye(t)&&(t={install:t}),t.install(XD))}var ZD=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e})(Ne),KD=(function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t})(),nd=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Ct).models[0]},e.type="cartesian2dAxis",e})(Ne);br(nd,KD);var $0={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},jD=Me({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},$0),ad=Me({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},$0),QD=Me({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},ad),JD=Ie({logBase:10},ad);const eI={category:jD,value:ad,time:QD,log:JD};var tI=0,id=(function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++tI}return t.createByAxisModel=function(e){var r=e.option,n=r.data,a=n&&fe(n,rI);return new t({categories:a,needCollect:!a,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,n=this._needCollect;if(!oe(e)&&!n)return e;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var a=this._getOrCreateMap();return r=a.get(e),r==null&&(n?(r=this.categories.length,this.categories[r]=e,a.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=de(this.categories))},t})();function rI(t){return ce(t)&&t.value!=null?t.value:t+""}var nI={value:1,category:1,time:1,log:1};function U0(t,e,r,n){D(nI,function(a,i){var o=Me(Me({},eI[i],!0),n,!0),s=(function(l){U(c,l);function c(){var u=l!==null&&l.apply(this,arguments)||this;return u.type=e+"Axis."+i,u}return c.prototype.mergeDefaultAndTheme=function(u,f){var h=io(this),d=h?Bl(u):{},p=f.getTheme();Me(u,p.get(i+"Axis")),Me(u,this.getDefaultOption()),u.type=Y0(u),h&&Ka(u,d,h)},c.prototype.optionUpdated=function(){var u=this.option;u.type==="category"&&(this.__ordinalMeta=id.createByAxisModel(this))},c.prototype.getCategories=function(u){var f=this.option;if(f.type==="category")return u?f.data:this.__ordinalMeta.categories},c.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},c.type=e+"Axis."+i,c.defaultOption=o,c})(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",Y0)}function Y0(t){return t.type||(t.data?"category":"value")}var Lr=(function(){function t(e){this._setting=e||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(e){return this._setting[e]},t.prototype.unionExtent=function(e){var r=this._extent;e[0]<r[0]&&(r[0]=e[0]),e[1]>r[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(r)||(n[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t})();ms(Lr);function od(t){return t.type==="interval"||t.type==="log"}function aI(t,e,r,n){var a={},i=t[1]-t[0],o=a.interval=ig(i/e);r!=null&&o<r&&(o=a.interval=r),n!=null&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=q0(o),l=a.niceTickExtent=[tt(Math.ceil(t[0]/o)*o,s),tt(Math.floor(t[1]/o)*o,s)];return iI(l,t),a}function sd(t){var e=Math.pow(10,Zu(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,tt(r*e)}function q0(t){return Gr(t)+2}function X0(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function iI(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),X0(t,0,e),X0(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function lc(t,e){return t>=e[0]&&t<=e[1]}function cc(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function uc(t,e){return t*(e[1]-e[0])+e[0]}var ld=(function(t){U(e,t);function e(r){var n=t.call(this,r)||this;n.type="ordinal";var a=n.getSetting("ordinalMeta");return a||(a=new id({})),ne(a)&&(a=new id({categories:fe(a,function(i){return ce(i)?i.value:i})})),n._ordinalMeta=a,n._extent=n.getSetting("extent")||[0,a.categories.length-1],n}return e.prototype.parse=function(r){return r==null?NaN:oe(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),lc(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),cc(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(uc(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],n=this._extent,a=n[0];a<=n[1];)r.push({value:a}),a++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,a=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o<l;++o){var c=n[o];a[o]=c,i[c]=o}for(var u=0;o<s;++o){for(;i[u]!=null;)u++;a.push(u),i[u]=o}},e.prototype._getTickNumber=function(r){var n=this._ticksByOrdinalNumber;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getRawOrdinalNumber=function(r){var n=this._ordinalNumbersByTick;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getLabel=function(r){if(!this.isBlank()){var n=this.getRawOrdinalNumber(r.value),a=this._ordinalMeta.categories[n];return a==null?"":a+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.isInExtentRange=function(r){return r=this._getTickNumber(r),this._extent[0]<=r&&this._extent[1]>=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e})(Lr);Lr.registerClass(ld);var la=tt,ni=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return lc(r,this._extent)},e.prototype.normalize=function(r){return cc(r,this._extent)},e.prototype.scale=function(r){return uc(r,this._extent)},e.prototype.setExtent=function(r,n){var a=this._extent;isNaN(r)||(a[0]=parseFloat(r)),isNaN(n)||(a[1]=parseFloat(n))},e.prototype.unionExtent=function(r){var n=this._extent;r[0]<n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=q0(r)},e.prototype.getTicks=function(r){var n=this._interval,a=this._extent,i=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;a[0]<i[0]&&(r?s.push({value:la(i[0]-n,o)}):s.push({value:a[0]}));for(var c=i[0];c<=i[1]&&(s.push({value:c}),c=la(c+n,o),c!==s[s.length-1].value);)if(s.length>l)return[];var u=s.length?s[s.length-1].value:i[1];return a[1]>u&&(r?s.push({value:la(u+n,o)}):s.push({value:a[1]})),s},e.prototype.getMinorTicks=function(r){for(var n=this.getTicks(!0),a=[],i=this.getExtent(),o=1;o<n.length;o++){for(var s=n[o],l=n[o-1],c=0,u=[],f=s.value-l.value,h=f/r;c<r-1;){var d=la(l.value+(c+1)*h);d>i[0]&&d<i[1]&&u.push(d),c++}a.push(u)}return a},e.prototype.getLabel=function(r,n){if(r==null)return"";var a=n&&n.precision;a==null?a=Gr(r.value)||0:a==="auto"&&(a=this._intervalPrecision);var i=la(r.value,a,!0);return ny(i)},e.prototype.calcNiceTicks=function(r,n,a){r=r||5;var i=this._extent,o=i[1]-i[0];if(isFinite(o)){o<0&&(o=-o,i.reverse());var s=aI(i,r,n,a);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1])if(n[0]!==0){var a=Math.abs(n[0]);r.fixMax||(n[1]+=a/2),n[0]-=a/2}else n[1]=1;var i=n[1]-n[0];isFinite(i)||(n[0]=0,n[1]=1),this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval);var o=this._interval;r.fixMin||(n[0]=la(Math.floor(n[0]/o)*o)),r.fixMax||(n[1]=la(Math.ceil(n[1]/o)*o))},e.prototype.setNiceExtent=function(r,n){this._niceExtent=[r,n]},e.type="interval",e})(Lr);Lr.registerClass(ni);var oI=function(t,e,r,n){for(;r<n;){var a=r+n>>>1;t[a][1]<e?r=a+1:n=a}return r},Z0=(function(t){U(e,t);function e(r){var n=t.call(this,r)||this;return n.type="time",n}return e.prototype.getLabel=function(r){var n=this.getSetting("useUTC");return Al(r.value,qm[G2(Xa(this._minLevelUnit))]||qm.second,n,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,n,a){var i=this.getSetting("useUTC"),o=this.getSetting("locale");return W2(r,n,a,o,i)},e.prototype.getTicks=function(){var r=this._interval,n=this._extent,a=[];if(!r)return a;a.push({value:n[0],level:0});var i=this.getSetting("useUTC"),o=dI(this._minLevelUnit,this._approxInterval,i,n);return a=a.concat(o),a.push({value:n[1],level:0}),a},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1]&&(n[0]-=Zt,n[1]+=Zt),n[1]===-1/0&&n[0]===1/0){var a=new Date;n[1]=+new Date(a.getFullYear(),a.getMonth(),a.getDate()),n[0]=n[1]-Zt}this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval)},e.prototype.calcNiceTicks=function(r,n,a){r=r||10;var i=this._extent,o=i[1]-i[0];this._approxInterval=o/r,n!=null&&this._approxInterval<n&&(this._approxInterval=n),a!=null&&this._approxInterval>a&&(this._approxInterval=a);var s=fc.length,l=Math.min(oI(fc,this._approxInterval,0,s),s-1);this._interval=fc[l][1],this._minLevelUnit=fc[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return He(r)?r:+Wr(r)},e.prototype.contain=function(r){return lc(this.parse(r),this._extent)},e.prototype.normalize=function(r){return cc(this.parse(r),this._extent)},e.prototype.scale=function(r){return uc(r,this._extent)},e.type="time",e})(ni),fc=[["second",Yf],["minute",qf],["hour",to],["quarter-day",to*6],["half-day",to*12],["day",Zt*1.2],["half-week",Zt*3.5],["week",Zt*7],["month",Zt*31],["quarter",Zt*95],["half-year",Ym/2],["year",Ym]];function sI(t,e,r,n){var a=Wr(e),i=Wr(r),o=function(p){return Km(a,p,n)===Km(i,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},c=function(){return l()&&o("day")},u=function(){return c()&&o("hour")},f=function(){return u()&&o("minute")},h=function(){return f()&&o("second")},d=function(){return h()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return f();case"second":return h();case"millisecond":return d()}}function lI(t,e){return t/=Zt,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function cI(t){var e=30*Zt;return t/=e,t>6?6:t>3?3:t>2?2:1}function uI(t){return t/=to,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function K0(t,e){return t/=e?qf:Yf,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function fI(t){return ig(t)}function hI(t,e,r){var n=new Date(t);switch(Xa(e)){case"year":case"month":n[jm(r)](0);case"day":n[Qm(r)](1);case"hour":n[Jm(r)](0);case"minute":n[ey(r)](0);case"second":n[ty(r)](0),n[ry(r)](0)}return n.getTime()}function dI(t,e,r,n){var a=1e4,i=Xm,o=0;function s(A,C,I,P,R,E,O){for(var K=new Date(C),L=C,B=K[P]();L<I&&L<=n[1];)O.push({value:L}),B+=A,K[R](B),L=K.getTime();O.push({value:L,notAdd:!0})}function l(A,C,I){var P=[],R=!C.length;if(!sI(Xa(A),n[0],n[1],r)){R&&(C=[{value:hI(new Date(n[0]),A,r)},{value:n[1]}]);for(var E=0;E<C.length-1;E++){var O=C[E].value,K=C[E+1].value;if(O!==K){var L=void 0,B=void 0,V=void 0,$=!1;switch(A){case"year":L=Math.max(1,Math.round(e/Zt/365)),B=Zf(r),V=$2(r);break;case"half-year":case"quarter":case"month":L=cI(e),B=Za(r),V=jm(r);break;case"week":case"half-week":case"day":L=lI(e),B=Dl(r),V=Qm(r),$=!0;break;case"half-day":case"quarter-day":case"hour":L=uI(e),B=no(r),V=Jm(r);break;case"minute":L=K0(e,!0),B=Il(r),V=ey(r);break;case"second":L=K0(e,!1),B=Pl(r),V=ty(r);break;case"millisecond":L=fI(e),B=Ll(r),V=ry(r);break}s(L,O,K,B,V,$,P),A==="year"&&I.length>1&&E===0&&I.unshift({value:I[0].value-L})}}for(var E=0;E<P.length;E++)I.push(P[E]);return P}}for(var c=[],u=[],f=0,h=0,d=0;d<i.length&&o++<a;++d){var p=Xa(i[d]);if(V2(i[d])){l(i[d],c[c.length-1]||[],u);var m=i[d+1]?Xa(i[d+1]):null;if(p!==m){if(u.length){h=f,u.sort(function(A,C){return A.value-C.value});for(var v=[],g=0;g<u.length;++g){var y=u[g].value;(g===0||u[g-1].value!==y)&&(v.push(u[g]),y>=n[0]&&y<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&h>b/1.5||(c.push(v),f>b||t===i[d]))break}u=[]}}}for(var x=ot(fe(c,function(A){return ot(A,function(C){return C.value>=n[0]&&C.value<=n[1]&&!C.notAdd})}),function(A){return A.length>0}),S=[],w=x.length-1,d=0;d<x.length;++d)for(var k=x[d],T=0;T<k.length;++T)S.push({value:k[T].value,level:w-d});S.sort(function(A,C){return A.value-C.value});for(var M=[],d=0;d<S.length;++d)(d===0||S[d].value!==S[d-1].value)&&M.push(S[d]);return M}Lr.registerClass(Z0);var j0=Lr.prototype,So=ni.prototype,pI=tt,vI=Math.floor,gI=Math.ceil,hc=Math.pow,ur=Math.log,cd=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new ni,r._interval=0,r}return e.prototype.getTicks=function(r){var n=this._originalScale,a=this._extent,i=n.getExtent(),o=So.getTicks.call(this,r);return fe(o,function(s){var l=s.value,c=tt(hc(this.base,l));return c=l===a[0]&&this._fixMin?dc(c,i[0]):c,c=l===a[1]&&this._fixMax?dc(c,i[1]):c,{value:c}},this)},e.prototype.setExtent=function(r,n){var a=ur(this.base);r=ur(Math.max(0,r))/a,n=ur(Math.max(0,n))/a,So.setExtent.call(this,r,n)},e.prototype.getExtent=function(){var r=this.base,n=j0.getExtent.call(this);n[0]=hc(r,n[0]),n[1]=hc(r,n[1]);var a=this._originalScale,i=a.getExtent();return this._fixMin&&(n[0]=dc(n[0],i[0])),this._fixMax&&(n[1]=dc(n[1],i[1])),n},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var n=this.base;r[0]=ur(r[0])/ur(n),r[1]=ur(r[1])/ur(n),j0.unionExtent.call(this,r)},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.calcNiceTicks=function(r){r=r||10;var n=this._extent,a=n[1]-n[0];if(!(a===1/0||a<=0)){var i=ek(a),o=r/a*i;for(o<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var s=[tt(gI(n[0]/i)*i),tt(vI(n[1]/i)*i)];this._interval=i,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){So.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=ur(r)/ur(this.base),lc(r,this._extent)},e.prototype.normalize=function(r){return r=ur(r)/ur(this.base),cc(r,this._extent)},e.prototype.scale=function(r){return r=uc(r,this._extent),hc(this.base,r)},e.type="log",e})(Lr),Q0=cd.prototype;Q0.getMinorTicks=So.getMinorTicks,Q0.getLabel=So.getLabel;function dc(t,e){return pI(t,Gr(e))}Lr.registerClass(cd);var mI=(function(){function t(e,r,n){this._prepareParams(e,r,n)}return t.prototype._prepareParams=function(e,r,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var a=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&r.getNeedCrossZero&&r.getNeedCrossZero();var i=r.get("min",!0);i==null&&(i=r.get("startValue",!0));var o=this._modelMinRaw=i;ye(o)?this._modelMinNum=pc(e,o({min:n[0],max:n[1]})):o!=="dataMin"&&(this._modelMinNum=pc(e,o));var s=this._modelMaxRaw=r.get("max",!0);if(ye(s)?this._modelMaxNum=pc(e,s({min:n[0],max:n[1]})):s!=="dataMax"&&(this._modelMaxNum=pc(e,s)),a)this._axisDataLen=r.getCategories().length;else{var l=r.get("boundaryGap"),c=ne(l)?l:[l||0,l||0];typeof c[0]=="boolean"||typeof c[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[rn(c[0],1),rn(c[1],1)]}},t.prototype.calculate=function(){var e=this._isOrdinal,r=this._dataMin,n=this._dataMax,a=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-r||Math.abs(r),s=this._modelMinRaw==="dataMin"?r:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?n:this._modelMaxNum,c=s!=null,u=l!=null;s==null&&(s=e?a?0:NaN:r-i[0]*o),l==null&&(l=e?a?a-1:NaN:n+i[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var f=ps(s)||ps(l)||e&&!a;this._needCrossZero&&(s>0&&l>0&&!c&&(s=0),s<0&&l<0&&!u&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,c=!0),d!=null&&(l=d,u=!0),{min:s,max:l,minFixed:c,maxFixed:u,isBlank:f}},t.prototype.modifyDataMinMax=function(e,r){this[_I[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var n=yI[e];this[n]=r},t.prototype.freeze=function(){this.frozen=!0},t})(),yI={min:"_determinedMin",max:"_determinedMax"},_I={min:"_dataMin",max:"_dataMax"};function J0(t,e,r){var n=t.rawExtentInfo;return n||(n=new mI(t,e,r),t.rawExtentInfo=n,n)}function pc(t,e){return e==null?null:ps(e)?NaN:t.parse(e)}function eb(t,e){var r=t.type,n=J0(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var a=n.min,i=n.max,o=e.ecModel;if(o&&r==="time"){var s=$y("bar",o),l=!1;if(D(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var c=Uy(s),u=bI(a,i,e,c);a=u.min,i=u.max}}return{extent:[a,i],fixMin:n.minFixed,fixMax:n.maxFixed}}function bI(t,e,r,n){var a=r.axis.getExtent(),i=Math.abs(a[1]-a[0]),o=mM(n,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;D(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;D(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,f=1-(s+l)/i,h=u/f-u;return e+=h*(l/c),t-=h*(s/c),{min:t,max:e}}function tb(t,e){var r=e,n=eb(t,r),a=n.extent,i=r.get("splitNumber");t instanceof cd&&(t.base=r.get("logBase"));var o=t.type,s=r.get("interval"),l=o==="interval"||o==="time";t.setExtent(a[0],a[1]),t.calcNiceExtent({splitNumber:i,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&t.setInterval&&t.setInterval(s)}function xI(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new ld({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new Z0({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(Lr.getClass(e)||ni)}}function wI(t){var e=t.scale.getExtent(),r=e[0],n=e[1];return!(r>0&&n>0||r<0&&n<0)}function ai(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?(function(n){return function(a,i){return t.scale.getFormattedLabel(a,i,n)}})(e):oe(e)?(function(n){return function(a){var i=t.scale.getLabel(a),o=n.replace("{value}",i??"");return o}})(e):ye(e)?(function(n){return function(a,i){return r!=null&&(i=a.value-r),n(ud(t,a),i,a.level!=null?{level:a.level}:null)}})(e):function(n){return t.scale.getLabel(n)}}function ud(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function SI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var n,a,i=r.getExtent();r instanceof ld?a=r.count():(n=r.getTicks(),a=n.length);var o=t.getLabelModel(),s=ai(t),l,c=1;a>40&&(c=Math.ceil(a/40));for(var u=0;u<a;u+=c){var f=n?n[u]:{value:i[0]+u},h=s(f,u),d=o.getTextRect(h),p=kI(d,o.get("rotate")||0);l?l.union(p):l=p}return l}}function kI(t,e){var r=e*Math.PI/180,n=t.width,a=t.height,i=n*Math.abs(Math.cos(r))+Math.abs(a*Math.sin(r)),o=n*Math.abs(Math.sin(r))+Math.abs(a*Math.cos(r)),s=new Le(t.x,t.y,i,o);return s}function fd(t){var e=t.get("interval");return e??"auto"}function rb(t){return t.type==="category"&&fd(t.getLabelModel())===0}function nb(t,e){var r={};return D(t.mapDimensionsAll(e),function(n){r[w2(t,n)]=!0}),Ge(r)}function TI(t,e,r){e&&D(nb(e,r),function(n){var a=e.getApproximateExtent(n);a[0]<t[0]&&(t[0]=a[0]),a[1]>t[1]&&(t[1]=a[1])})}var CI=(function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return fe(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),ot(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t})(),hd=["x","y"];function ab(t){return t.type==="interval"||t.type==="time"}var MI=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=hd,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!ab(r)||!ab(n))){var a=r.getExtent(),i=n.getExtent(),o=this.dataToPoint([a[0],i[0]]),s=this.dataToPoint([a[1],i[1]]),l=a[1]-a[0],c=i[1]-i[0];if(!(!l||!c)){var u=(s[0]-o[0])/l,f=(s[1]-o[1])/c,h=o[0]-a[0]*u,d=o[1]-i[0]*f,p=this._transform=[u,0,0,f,h,d];this._invTransform=fu([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),a=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&a.contain(a.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,n){var a=this.dataToPoint(r),i=this.dataToPoint(n),o=this.getArea(),s=new Le(a[0],a[1],i[0]-a[0],i[1]-a[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,n,a){a=a||[];var i=r[0],o=r[1];if(this._transform&&i!=null&&isFinite(i)&&o!=null&&isFinite(o))return Gt(a,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return a[0]=s.toGlobalCoord(s.dataToCoord(i,n)),a[1]=l.toGlobalCoord(l.dataToCoord(o,n)),a},e.prototype.clampData=function(r,n){var a=this.getAxis("x").scale,i=this.getAxis("y").scale,o=a.getExtent(),s=i.getExtent(),l=a.parse(r[0]),c=i.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),c),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n){var a=[];if(this._invTransform)return Gt(a,r,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return a[0]=i.coordToData(i.toLocalCoord(r[0]),n),a[1]=o.coordToData(o.toLocalCoord(r[1]),n),a},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),a=this.getAxis("y").getGlobalExtent(),i=Math.min(n[0],n[1])-r,o=Math.min(a[0],a[1])-r,s=Math.max(n[0],n[1])-i+r,l=Math.max(a[0],a[1])-o+r;return new Le(i,o,s,l)},e})(CI),ko=je();function ib(t,e){var r=fe(e,function(n){return t.scale.parse(n)});return t.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function AI(t){var e=t.getLabelModel().get("customValues");if(e){var r=ai(t),n=t.scale.getExtent(),a=ib(t,e),i=ot(a,function(o){return o>=n[0]&&o<=n[1]});return{labels:fe(i,function(o){var s={value:o};return{formattedLabel:r(s),rawLabel:t.scale.getLabel(s),tickValue:o}})}}return t.type==="category"?II(t):LI(t)}function DI(t,e){var r=t.getTickModel().get("customValues");if(r){var n=t.scale.getExtent(),a=ib(t,r);return{ticks:ot(a,function(i){return i>=n[0]&&i<=n[1]})}}return t.type==="category"?PI(t,e):{ticks:fe(t.scale.getTicks(),function(i){return i.value})}}function II(t){var e=t.getLabelModel(),r=ob(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function ob(t,e){var r=sb(t,"labels"),n=fd(e),a=lb(r,n);if(a)return a;var i,o;return ye(n)?i=fb(t,n):(o=n==="auto"?RI(t):n,i=ub(t,o)),cb(r,n,{labels:i,labelCategoryInterval:o})}function PI(t,e){var r=sb(t,"ticks"),n=fd(e),a=lb(r,n);if(a)return a;var i,o;if((!e.get("show")||t.scale.isBlank())&&(i=[]),ye(n))i=fb(t,n,!0);else if(n==="auto"){var s=ob(t,t.getLabelModel());o=s.labelCategoryInterval,i=fe(s.labels,function(l){return l.tickValue})}else o=n,i=ub(t,o,!0);return cb(r,n,{ticks:i,tickCategoryInterval:o})}function LI(t){var e=t.scale.getTicks(),r=ai(t);return{labels:fe(e,function(n,a){return{level:n.level,formattedLabel:r(n,a),rawLabel:t.scale.getLabel(n),tickValue:n.value}})}}function sb(t,e){return ko(t)[e]||(ko(t)[e]=[])}function lb(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function cb(t,e,r){return t.push({key:e,value:r}),r}function RI(t){var e=ko(t).autoInterval;return e??(ko(t).autoInterval=t.calculateCategoryInterval())}function EI(t){var e=OI(t),r=ai(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,a=t.scale,i=a.getExtent(),o=a.count();if(i[1]-i[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=i[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(n)),f=Math.abs(c*Math.sin(n)),h=0,d=0;l<=i[1];l+=s){var p=0,m=0,v=hu(r({value:l}),e.font,"center","top");p=v.width*1.3,m=v.height*1.3,h=Math.max(h,p,7),d=Math.max(d,m,7)}var g=h/u,y=d/f;isNaN(g)&&(g=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(g,y))),x=ko(t.model),S=t.getExtent(),w=x.lastAutoInterval,k=x.lastTickCount;return w!=null&&k!=null&&Math.abs(w-b)<=1&&Math.abs(k-o)<=1&&w>b&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?b=w:(x.lastTickCount=o,x.lastAutoInterval=b,x.axisExtent0=S[0],x.axisExtent1=S[1]),b}function OI(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function ub(t,e,r){var n=ai(t),a=t.scale,i=a.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=i[0],u=a.count();c!==0&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var f=rb(t),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&c!==i[0]&&m(i[0]);for(var p=c;p<=i[1];p+=l)m(p);d&&p-l!==i[1]&&m(i[1]);function m(v){var g={value:v};s.push(r?v:{formattedLabel:n(g),rawLabel:a.getLabel(g),tickValue:v})}return s}function fb(t,e,r){var n=t.scale,a=ai(t),i=[];return D(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&i.push(r?l:{formattedLabel:a(o),rawLabel:s,tickValue:l})}),i}var hb=[0,1],NI=(function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return e>=n&&e<=a},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return ng(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this._extent,a=this.scale;return e=a.normalize(e),this.onBand&&a.type==="ordinal"&&(n=n.slice(),db(n,a.count())),qn(e,hb,n,r)},t.prototype.coordToData=function(e,r){var n=this._extent,a=this.scale;this.onBand&&a.type==="ordinal"&&(n=n.slice(),db(n,a.count()));var i=qn(e,n,hb,r);return this.scale.scale(i)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=DI(this,r),a=n.ticks,i=fe(a,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return BI(this,i,o,e.clamp),i},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),a=fe(n,function(i){return fe(i,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return a},t.prototype.getViewLabels=function(){return AI(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var a=Math.abs(e[1]-e[0]);return Math.abs(a)/n},t.prototype.calculateCategoryInterval=function(){return EI(this)},t})();function db(t,e){var r=t[1]-t[0],n=e,a=r/n/2;t[0]+=a,t[1]-=a}function BI(t,e,r,n){var a=e.length;if(!t.onBand||r||!a)return;var i=t.getExtent(),o,s;if(a===1)e[0].coord=i[0],o=e[1]={coord:i[1],tickValue:e[0].tickValue};else{var l=e[a-1].tickValue-e[0].tickValue,c=(e[a-1].coord-e[0].coord)/l;D(e,function(d){d.coord-=c/2});var u=t.scale.getExtent();s=1+u[1]-e[a-1].tickValue,o={coord:e[a-1].coord+c*s,tickValue:u[1]+1},e.push(o)}var f=i[0]>i[1];h(e[0].coord,i[0])&&(n?e[0].coord=i[0]:e.shift()),n&&h(i[0],e[0].coord)&&e.unshift({coord:i[0]}),h(i[1],o.coord)&&(n?o.coord=i[1]:e.pop()),n&&h(o.coord,i[1])&&e.push({coord:i[1]});function h(d,p){return d=tt(d),p=tt(p),f?d>p:d<p}}var zI=(function(t){U(e,t);function e(r,n,a,i,o){var s=t.call(this,r,n,a)||this;return s.index=0,s.type=i||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e})(NI);function dd(t,e,r){r=r||{};var n=t.coordinateSystem,a=e.axis,i={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,c=a.dim,u=n.getRect(),f=[u.x,u.x+u.width,u.y,u.y+u.height],h={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=c==="x"?[f[2]-d,f[3]+d]:[f[0]-d,f[1]+d];if(o){var m=o.toGlobalCoord(o.dataToCoord(0));p[h.onZero]=Math.max(Math.min(m,p[1]),p[0])}i.position=[c==="y"?p[h[l]]:f[0],c==="x"?p[h[l]]:f[3]],i.rotation=Math.PI/2*(c==="x"?0:1);var v={top:-1,bottom:1,left:-1,right:1};i.labelDirection=i.tickDirection=i.nameDirection=v[s],i.labelOffset=o?p[h[s]]-p[h.onZero]:0,e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),Si(r.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var g=e.get(["axisLabel","rotate"]);return i.labelRotate=l==="top"?-g:g,i.z2=1,i}function pb(t){return t.get("coordinateSystem")==="cartesian2d"}function vb(t){var e={xAxisModel:null,yAxisModel:null};return D(e,function(r,n){var a=n.replace(/Model$/,""),i=t.getReferringComponents(a,Ct).models[0];e[n]=i}),e}var pd=Math.log;function FI(t,e,r){var n=ni.prototype,a=n.getTicks.call(r),i=n.getTicks.call(r,!0),o=a.length-1,s=n.getInterval.call(r),l=eb(t,e),c=l.extent,u=l.fixMin,f=l.fixMax;if(t.type==="log"){var h=pd(t.base);c=[pd(c[0])/h,pd(c[1])/h]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:f});var d=n.getExtent.call(t);u&&(c[0]=d[0]),f&&(c[1]=d[1]);var p=n.getInterval.call(t),m=c[0],v=c[1];if(u&&f)p=(v-m)/o;else if(u)for(v=c[0]+p*o;v<c[1]&&isFinite(v)&&isFinite(c[1]);)p=sd(p),v=c[0]+p*o;else if(f)for(m=c[1]-p*o;m>c[0]&&isFinite(m)&&isFinite(c[0]);)p=sd(p),m=c[1]-p*o;else{var g=t.getTicks().length-1;g>o&&(p=sd(p));var y=p*o;v=Math.ceil(c[1]/p)*p,m=tt(v-y),m<0&&c[0]>=0?(m=0,v=tt(y)):v>0&&c[1]<=0&&(v=0,m=-tt(y))}var b=(a[0].value-i[0].value)/s,x=(a[o].value-i[o].value)/s;n.setExtent.call(t,m+p*b,v+p*x),n.setInterval.call(t,p),(b||x)&&n.setNiceExtent.call(t,m+p,v-p)}var HI=(function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=hd,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;this._updateScale(e,this.model);function a(o){var s,l=Ge(o),c=l.length;if(c){for(var u=[],f=c-1;f>=0;f--){var h=+l[f],d=o[h],p=d.model,m=d.scale;od(m)&&p.get("alignTicks")&&p.get("interval")==null?u.push(d):(tb(m,p),od(m)&&(s=d))}u.length&&(s||(s=u.pop(),tb(s.scale,s.model)),D(u,function(v){FI(v.scale,v.model,s.scale)}))}}a(n.x),a(n.y);var i={};D(n.x,function(o){gb(n,"y",o,i)}),D(n.y,function(o){gb(n,"x",o,i)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var a=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=Nl(a,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),i&&(D(s,function(c){if(!c.model.get(["axisLabel","inside"])){var u=SI(c);if(u){var f=c.isHorizontal()?"height":"width",h=c.model.get(["axisLabel","margin"]);o[f]-=u[f]+h,c.position==="top"?o.y+=u.height+h:c.position==="left"&&(o.x+=u.width+h)}}}),l()),D(this._coordsList,function(c){c.calcAffineTransform()});function l(){D(s,function(c){var u=c.isHorizontal(),f=u?[0,o.width]:[0,o.height],h=c.inverse?1:0;c.setExtent(f[h],f[1-h]),VI(c,u?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}ce(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var a=0,i=this._coordsList;a<i.length;a++)if(i[a].getAxis("x").index===e||i[a].getAxis("y").index===r)return i[a]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.dataToPoint(n):a.axis?a.axis.toGlobalCoord(a.axis.dataToCoord(n)):null},t.prototype.convertFromPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.pointToData(n):a.axis?a.axis.coordToData(a.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(e){var r=e.seriesModel,n=e.xAxisModel||r&&r.getReferringComponents("xAxis",Ct).models[0],a=e.yAxisModel||r&&r.getReferringComponents("yAxis",Ct).models[0],i=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,Pe(o,s)<0&&(s=null);else if(n&&a)s=this.getCartesian(n.componentIndex,a.componentIndex);else if(n)l=this.getAxis("x",n.componentIndex);else if(a)l=this.getAxis("y",a.componentIndex);else if(i){var c=i.coordinateSystem;c===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},t.prototype.containPoint=function(e){var r=this._coordsList[0];if(r)return r.containPoint(e)},t.prototype._initCartesian=function(e,r,n){var a=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(r.eachComponent("xAxis",c("x"),this),r.eachComponent("yAxis",c("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,D(s.x,function(u,f){D(s.y,function(h,d){var p="x"+f+"y"+d,m=new MI(p);m.master=a,m.model=e,a._coordsMap[p]=m,a._coordsList.push(m),m.addAxis(u),m.addAxis(h)})});function c(u){return function(f,h){if(vd(f,e)){var d=f.get("position");u==="x"?d!=="top"&&d!=="bottom"&&(d=o.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=o.left?"right":"left"),o[d]=!0;var p=new zI(u,xI(f),[0,0],f.get("type"),d),m=p.type==="category";p.onBand=m&&f.get("boundaryGap"),p.inverse=f.get("inverse"),f.axis=p,p.model=f,p.grid=i,p.index=h,i._axesList.push(p),s[u][h]=p,l[u]++}}}},t.prototype._updateScale=function(e,r){D(this._axesList,function(a){if(a.scale.setExtent(1/0,-1/0),a.type==="category"){var i=a.model.get("categorySortInfo");a.scale.setSortInfo(i)}}),e.eachSeries(function(a){if(pb(a)){var i=vb(a),o=i.xAxisModel,s=i.yAxisModel;if(!vd(o,r)||!vd(s,r))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),c=a.getData(),u=l.getAxis("x"),f=l.getAxis("y");n(c,u),n(c,f)}},this);function n(a,i){D(nb(a,i.dim),function(o){i.scale.unionExtentFromData(a,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],n=[];return D(this.getCartesians(),function(a){var i=e!=null&&e!=="auto"?a.getAxis(e):a.getBaseAxis(),o=a.getOtherAxis(i);Pe(r,i)<0&&r.push(i),Pe(n,o)<0&&n.push(o)}),{baseAxes:r,otherAxes:n}},t.create=function(e,r){var n=[];return e.eachComponent("grid",function(a,i){var o=new t(a,e,r);o.name="grid_"+i,o.resize(a,r,!0),a.coordinateSystem=o,n.push(o)}),e.eachSeries(function(a){if(pb(a)){var i=vb(a),o=i.xAxisModel,s=i.yAxisModel,l=o.getCoordSysModel(),c=l.coordinateSystem;a.coordinateSystem=c.getCartesian(o.componentIndex,s.componentIndex)}}),n},t.dimensions=hd,t})();function vd(t,e){return t.getCoordSysModel()===e}function gb(t,e,r,n){r.getAxesOnZeroOf=function(){return i?[i]:[]};var a=t[e],i,o=r.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)mb(a[l])&&(i=a[l]);else for(var c in a)if(a.hasOwnProperty(c)&&mb(a[c])&&!n[u(a[c])]){i=a[c];break}i&&(n[u(i)]=!0);function u(f){return f.dim+"_"+f.index}}function mb(t){return t&&t.type!=="category"&&t.type!=="time"&&wI(t)}function VI(t,e){var r=t.getExtent(),n=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(a){return a+e}:function(a){return n-a+e},t.toLocalCoord=t.dim==="x"?function(a){return a-e}:function(a){return n-a+e}}var xn=Math.PI,wn=(function(){function t(e,r){this.group=new ct,this.opt=r,this.axisModel=e,Ie(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new ct({x:r.position[0],y:r.position[1],rotation:r.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(e){return!!yb[e]},t.prototype.add=function(e){yb[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,n){var a=ag(r-e),i,o;return Ys(a)?(o=n>0?"top":"bottom",i="center"):Ys(a-xn)?(o=n>0?"bottom":"top",i="center"):(o="middle",a>0&&a<xn?i=n>0?"right":"left":i=n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t})(),yb={axisLine:function(t,e,r,n){var a=e.get(["axisLine","show"]);if(a==="auto"&&t.handleAutoShown&&(a=t.handleAutoShown("axisLine")),!!a){var i=e.axis.getExtent(),o=n.transform,s=[i[0],0],l=[i[1],0],c=s[0]>l[0];o&&(Gt(s,s,o),Gt(l,l,o));var u=G({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new fn({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});Zi(f.shape,f.style.lineWidth),f.anid="line",r.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var d=e.get(["axisLine","symbolSize"]);oe(h)&&(h=[h,h]),(oe(d)||He(d))&&(d=[d,d]);var p=Sy(e.get(["axisLine","symbolOffset"])||0,d),m=d[0],v=d[1];D([{rotate:t.rotation+Math.PI/2,offset:p[0],r:0},{rotate:t.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(g,y){if(h[y]!=="none"&&h[y]!=null){var b=ja(h[y],-m/2,-v/2,m,v,u.stroke,!0),x=g.r+g.offset,S=c?l:s;b.attr({rotation:g.rotate,x:S[0]+x*Math.cos(t.rotation),y:S[1]-x*Math.sin(t.rotation),silent:!0,z2:11}),r.add(b)}})}}},axisTickLabel:function(t,e,r,n){var a=$I(r,n,e,t),i=YI(r,n,e,t);if(WI(e,i,a),UI(r,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=zM(fe(i,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));FM(o)}},axisName:function(t,e,r,n){var a=Si(t.axisName,e.get("name"));if(a){var i=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,c=e.axis.getExtent(),u=c[0]>c[1]?-1:1,f=[i==="start"?c[0]-u*l:i==="end"?c[1]+u*l:(c[0]+c[1])/2,bb(i)?t.labelOffset+o*l:0],h,d=e.get("nameRotate");d!=null&&(d=d*xn/180);var p;bb(i)?h=wn.innerTextLayout(t.rotation,d??t.rotation,o):(h=GI(t.rotation,i,d||0,c),p=t.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(h.rotation)),!isFinite(p)&&(p=null)));var m=s.getFont(),v=e.get("nameTruncate",!0)||{},g=v.ellipsis,y=Si(t.nameTruncateMaxWidth,v.maxWidth,p),b=new kt({x:f[0],y:f[1],rotation:h.rotation,silent:wn.isLabelSilent(e),style:Ha(s,{text:a,font:m,overflow:"truncate",width:y,ellipsis:g,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(dl({el:b,componentModel:e,itemName:a}),b.__fullText=a,b.anid="name",e.get("triggerEvent")){var x=wn.makeAxisEventDataBase(e);x.targetType="axisName",x.name=a,Ee(b).eventData=x}n.add(b),b.updateTransform(),r.add(b),b.decomposeTransform()}}};function GI(t,e,r,n){var a=ag(r-t),i,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return Ys(a-xn/2)?(o=l?"bottom":"top",i="center"):Ys(a-xn*1.5)?(o=l?"top":"bottom",i="center"):(o="middle",a<xn*1.5&&a>xn/2?i=l?"left":"right":i=l?"right":"left"),{rotation:a,textAlign:i,textVerticalAlign:o}}function WI(t,e,r){if(!rb(t.axis)){var n=t.get(["axisLabel","showMinLabel"]),a=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var i=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],c=r[0],u=r[1],f=r[r.length-1],h=r[r.length-2];n===!1?(Jt(i),Jt(c)):_b(i,o)&&(n?(Jt(o),Jt(u)):(Jt(i),Jt(c))),a===!1?(Jt(s),Jt(f)):_b(l,s)&&(a?(Jt(l),Jt(h)):(Jt(s),Jt(f)))}}function Jt(t){t&&(t.ignore=!0)}function _b(t,e){var r=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!r||!n)){var a=lu([]);return uu(a,a,-t.rotation),r.applyTransform(Sa([],a,t.getLocalTransform())),n.applyTransform(Sa([],a,e.getLocalTransform())),r.intersect(n)}}function bb(t){return t==="middle"||t==="center"}function xb(t,e,r,n,a){for(var i=[],o=[],s=[],l=0;l<t.length;l++){var c=t[l].coord;o[0]=c,o[1]=0,s[0]=c,s[1]=r,e&&(Gt(o,o,e),Gt(s,s,e));var u=new fn({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,autoBatch:!0,silent:!0});Zi(u.shape,u.style.lineWidth),u.anid=a+"_"+t[l].tickValue,i.push(u)}return i}function $I(t,e,r,n){var a=r.axis,i=r.getModel("axisTick"),o=i.get("show");if(o==="auto"&&n.handleAutoShown&&(o=n.handleAutoShown("axisTick")),!(!o||a.scale.isBlank())){for(var s=i.getModel("lineStyle"),l=n.tickDirection*i.get("length"),c=a.getTicksCoords(),u=xb(c,e.transform,l,Ie(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),f=0;f<u.length;f++)t.add(u[f]);return u}}function UI(t,e,r,n){var a=r.axis,i=r.getModel("minorTick");if(!(!i.get("show")||a.scale.isBlank())){var o=a.getMinorTicksCoords();if(o.length)for(var s=i.getModel("lineStyle"),l=n*i.get("length"),c=Ie(s.getLineStyle(),Ie(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),u=0;u<o.length;u++)for(var f=xb(o[u],e.transform,l,c,"minorticks_"+u),h=0;h<f.length;h++)t.add(f[h])}}function YI(t,e,r,n){var a=r.axis,i=Si(n.axisLabelShow,r.get(["axisLabel","show"]));if(!(!i||a.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=a.getViewLabels(),c=(Si(n.labelRotate,o.get("rotate"))||0)*xn/180,u=wn.innerTextLayout(n.rotation,c,n.labelDirection),f=r.getCategories&&r.getCategories(!0),h=[],d=wn.isLabelSilent(r),p=r.get("triggerEvent");return D(l,function(m,v){var g=a.scale.type==="ordinal"?a.scale.getRawOrdinalNumber(m.tickValue):m.tickValue,y=m.formattedLabel,b=m.rawLabel,x=o;if(f&&f[g]){var S=f[g];ce(S)&&S.textStyle&&(x=new Xe(S.textStyle,o,r.ecModel))}var w=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),k=a.dataToCoord(g),T=x.getShallow("align",!0)||u.textAlign,M=ke(x.getShallow("alignMinLabel",!0),T),A=ke(x.getShallow("alignMaxLabel",!0),T),C=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||u.textVerticalAlign,I=ke(x.getShallow("verticalAlignMinLabel",!0),C),P=ke(x.getShallow("verticalAlignMaxLabel",!0),C),R=new kt({x:k,y:n.labelOffset+n.labelDirection*s,rotation:u.rotation,silent:d,z2:10+(m.level||0),style:Ha(x,{text:y,align:v===0?M:v===l.length-1?A:T,verticalAlign:v===0?I:v===l.length-1?P:C,fill:ye(w)?w(a.type==="category"?b:a.type==="value"?g+"":g,v):w})});if(R.anid="label_"+g,dl({el:R,componentModel:r,itemName:y,formatterParamsExtra:{isTruncated:function(){return R.isTruncated},value:b,tickIndex:v}}),p){var E=wn.makeAxisEventDataBase(r);E.targetType="axisLabel",E.value=b,E.tickIndex=v,a.type==="category"&&(E.dataIndex=g),Ee(R).eventData=E}e.add(R),R.updateTransform(),h.push(R),t.add(R),R.decomposeTransform()}),h}}function qI(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return XI(r,t,e),r.seriesInvolved&&KI(r,t),r}function XI(t,e,r){var n=e.getComponent("tooltip"),a=e.getComponent("axisPointer"),i=a.get("link",!0)||[],o=[];D(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=To(s.model),c=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var u=s.model,f=u.getModel("tooltip",n);if(D(s.getAxes(),Ke(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",p=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&D(p.baseAxes,Ke(m,d?"cross":!0,h)),d&&D(p.otherAxes,Ke(m,"cross",!1))}function m(v,g,y){var b=y.model.getModel("axisPointer",a),x=b.get("show");if(!(!x||x==="auto"&&!v&&!yd(b))){g==null&&(g=b.get("triggerTooltip")),b=v?ZI(y,f,a,e,v,g):b;var S=b.get("snap"),w=b.get("triggerEmphasis"),k=To(y.model),T=g||S||y.type==="category",M=t.axesInfo[k]={key:k,axis:y,coordSys:s,axisPointerModel:b,triggerTooltip:g,triggerEmphasis:w,involveSeries:T,snap:S,useHandle:yd(b),seriesModels:[],linkGroup:null};c[k]=M,t.seriesInvolved=t.seriesInvolved||T;var A=jI(i,y);if(A!=null){var C=o[A]||(o[A]={axesInfo:{}});C.axesInfo[k]=M,C.mapper=i[A].mapper,M.linkGroup=C}}}})}function ZI(t,e,r,n,a,i){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};D(s,function(h){l[h]=we(o.get(h))}),l.snap=t.type!=="category"&&!!i,o.get("type")==="cross"&&(l.type="line");var c=l.label||(l.label={});if(c.show==null&&(c.show=!1),a==="cross"){var u=o.get(["label","show"]);if(c.show=u??!0,!i){var f=l.lineStyle=o.get("crossStyle");f&&Ie(c,f.textStyle)}}return t.model.getModel("axisPointer",new Xe(l,r,n))}function KI(t,e){e.eachSeries(function(r){var n=r.coordinateSystem,a=r.get(["tooltip","trigger"],!0),i=r.get(["tooltip","show"],!0);!n||a==="none"||a===!1||a==="item"||i===!1||r.get(["axisPointer","show"],!0)===!1||D(t.coordSysAxesInfo[To(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function jI(t,e){for(var r=e.model,n=e.dim,a=0;a<t.length;a++){var i=t[a]||{};if(gd(i[n+"AxisId"],r.id)||gd(i[n+"AxisIndex"],r.componentIndex)||gd(i[n+"AxisName"],r.name))return a}}function gd(t,e){return t==="all"||ne(t)&&Pe(t,e)>=0||t===e}function QI(t){var e=md(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,a=r.option,i=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=yd(r);i==null&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),a.value=o,s&&(a.status=e.axis.scale.isBlank()?"hide":"show")}}function md(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[To(t)]}function JI(t){var e=md(t);return e&&e.axisPointerModel}function yd(t){return!!t.get(["handle","show"])}function To(t){return t.type+"||"+t.id}var wb={},Sb=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.axisPointerClass&&QI(r),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(r,a,!0)},e.prototype.updateAxisPointer=function(r,n,a,i){this._doUpdateAxisPointerClass(r,a,!1)},e.prototype.remove=function(r,n){var a=this._axisPointer;a&&a.remove(n)},e.prototype.dispose=function(r,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(r,n,a){var i=e.getAxisPointerClass(this.axisPointerClass);if(i){var o=JI(r);o?(this._axisPointer||(this._axisPointer=new i)).render(r,o,n,a):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(r){this._axisPointer&&this._axisPointer.dispose(r),this._axisPointer=null},e.registerAxisPointerClass=function(r,n){wb[r]=n},e.getAxisPointerClass=function(r){return r&&wb[r]},e.type="axis",e})(lr),_d=je();function eP(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitArea"),o=i.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),c=a.getTicksCoords({tickModel:i,clamp:!0});if(c.length){var u=s.length,f=_d(t).splitAreaColors,h=de(),d=0;if(f)for(var p=0;p<c.length;p++){var m=f.get(c[p].tickValue);if(m!=null){d=(m+(u-1)*p)%u;break}}var v=a.toGlobalCoord(c[0].coord),g=o.getAreaStyle();s=ne(s)?s:[s];for(var p=1;p<c.length;p++){var y=a.toGlobalCoord(c[p].coord),b=void 0,x=void 0,S=void 0,w=void 0;a.isHorizontal()?(b=v,x=l.y,S=y-b,w=l.height,v=b+S):(b=l.x,x=v,S=l.width,w=y-x,v=x+w);var k=c[p-1].tickValue;k!=null&&h.set(k,d),e.add(new at({anid:k!=null?"area_"+k:null,shape:{x:b,y:x,width:S,height:w},style:Ie({fill:s[d]},g),autoBatch:!0,silent:!0})),d=(d+1)%u}_d(t).splitAreaColors=h}}}function tP(t){_d(t).splitAreaColors=null}var rP=["axisLine","axisTickLabel","axisName"],nP=["splitArea","splitLine","minorSplitLine"],kb=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="CartesianAxisPointer",r}return e.prototype.render=function(r,n,a,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new ct,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=dd(s,r),c=new wn(r,G({handleAutoShown:function(f){for(var h=s.coordinateSystem.getCartesians(),d=0;d<h.length;d++)if(od(h[d].getOtherAxis(r.axis).scale))return!0;return!1}},l));D(rP,c.add,c),this._axisGroup.add(c.getGroup()),D(nP,function(f){r.get([f,"show"])&&aP[f](this,this._axisGroup,r,s)},this);var u=i&&i.type==="changeAxisOrder"&&i.isInitSort;u||em(o,this._axisGroup,r),t.prototype.render.call(this,r,n,a,i)}},e.prototype.remove=function(){tP(this)},e.type="cartesianAxis",e})(Sb),aP={splitLine:function(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitLine"),o=i.getModel("lineStyle"),s=o.get("color"),l=i.get("showMinLine")!==!1,c=i.get("showMaxLine")!==!1;s=ne(s)?s:[s];for(var u=n.coordinateSystem.getRect(),f=a.isHorizontal(),h=0,d=a.getTicksCoords({tickModel:i}),p=[],m=[],v=o.getLineStyle(),g=0;g<d.length;g++){var y=a.toGlobalCoord(d[g].coord);if(!(g===0&&!l||g===d.length-1&&!c)){var b=d[g].tickValue;f?(p[0]=y,p[1]=u.y,m[0]=y,m[1]=u.y+u.height):(p[0]=u.x,p[1]=y,m[0]=u.x+u.width,m[1]=y);var x=h++%s.length,S=new fn({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:m[0],y2:m[1]},style:Ie({stroke:s[x]},v),silent:!0});Zi(S.shape,v.lineWidth),e.add(S)}}}},minorSplitLine:function(t,e,r,n){var a=r.axis,i=r.getModel("minorSplitLine"),o=i.getModel("lineStyle"),s=n.coordinateSystem.getRect(),l=a.isHorizontal(),c=a.getMinorTicksCoords();if(c.length)for(var u=[],f=[],h=o.getLineStyle(),d=0;d<c.length;d++)for(var p=0;p<c[d].length;p++){var m=a.toGlobalCoord(c[d][p].coord);l?(u[0]=m,u[1]=s.y,f[0]=m,f[1]=s.y+s.height):(u[0]=s.x,u[1]=m,f[0]=s.x+s.width,f[1]=m);var v=new fn({anid:"minor_line_"+c[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:f[0],y2:f[1]},style:h,silent:!0});Zi(v.shape,h.lineWidth),e.add(v)}},splitArea:function(t,e,r,n){eP(t,e,r,n)}},Tb=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e})(kb),iP=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Tb.type,r}return e.type="yAxis",e})(kb),oP=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="grid",r}return e.prototype.render=function(r,n){this.group.removeAll(),r.get("show")&&this.group.add(new at({shape:r.coordinateSystem.getRect(),style:Ie({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e})(lr),Cb={offset:0};function sP(t){t.registerComponentView(oP),t.registerComponentModel(ZD),t.registerCoordinateSystem("cartesian2d",HI),U0(t,"x",nd,Cb),U0(t,"y",nd,Cb),t.registerComponentView(Tb),t.registerComponentView(iP),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var Mb="\0_ec_interaction_mutex";function Ab(t,e){return!!lP(t)[e]}function lP(t){return t[Mb]||(t[Mb]={})}oa({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},mt);var cP=(function(t){U(e,t);function e(r){var n=t.call(this)||this;n._zr=r;var a=Ae(n._mousedownHandler,n),i=Ae(n._mousemoveHandler,n),o=Ae(n._mouseupHandler,n),s=Ae(n._mousewheelHandler,n),l=Ae(n._pinchHandler,n);return n.enable=function(c,u){this.disable(),this._opt=Ie(we(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),c==null&&(c=!0),(c===!0||c==="move"||c==="pan")&&(r.on("mousedown",a),r.on("mousemove",i),r.on("mouseup",o)),(c===!0||c==="scale"||c==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},n.disable=function(){r.off("mousedown",a),r.off("mousemove",i),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},n}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!c_(r)){for(var n=r.target;n;){if(n.draggable)return;n=n.__hostTarget||n.parent}var a=r.offsetX,i=r.offsetY;this.pointerChecker&&this.pointerChecker(r,a,i)&&(this._x=a,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!vc("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||Ab(this._zr,"globalPan"))){var n=r.offsetX,a=r.offsetY,i=this._x,o=this._y,s=n-i,l=a-o;this._x=n,this._y=a,this._opt.preventDefaultMouseMove&&$l(r.event),Db(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:i,oldY:o,newX:n,newY:a,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){c_(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var n=vc("zoomOnMouseWheel",r,this._opt),a=vc("moveOnMouseWheel",r,this._opt),i=r.wheelDelta,o=Math.abs(i),s=r.offsetX,l=r.offsetY;if(!(i===0||!n&&!a)){if(n){var c=o>3?1.4:o>1?1.2:1.1,u=i>0?c:1/c;bd(this,"zoom","zoomOnMouseWheel",r,{scale:u,originX:s,originY:l,isAvailableBehavior:null})}if(a){var f=Math.abs(i),h=(i>0?1:-1)*(f>3?.4:f>1?.15:.05);bd(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!Ab(this._zr,"globalPan")){var n=r.pinchScale>1?1.1:1/1.1;bd(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e})(rr);function bd(t,e,r,n,a){t.pointerChecker&&t.pointerChecker(n,a.originX,a.originY)&&($l(n.event),Db(t,e,r,n,a))}function Db(t,e,r,n,a){a.isAvailableBehavior=Ae(vc,null,r,n),t.trigger(e,a)}function vc(t,e,r){var n=r[t];return!t||n&&(!oe(n)||e.event[n+"Key"])}function xd(t,e,r,n,a,i){t=t||0;var o=r[1]-r[0];if(a!=null&&(a=ii(a,[0,o])),i!=null&&(i=Math.max(i,a??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=ii(s,[0,o]),a=i=ii(s,[a,i]),n=0}e[0]=ii(e[0],r),e[1]=ii(e[1],r);var l=wd(e,n);e[n]+=t;var c=a||0,u=r.slice();l.sign<0?u[0]+=c:u[1]-=c,e[n]=ii(e[n],u);var f;return f=wd(e,n),a!=null&&(f.sign!==l.sign||f.span<a)&&(e[1-n]=e[n]+l.sign*a),f=wd(e,n),i!=null&&f.span>i&&(e[1-n]=e[n]+f.sign*i),e}function wd(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function ii(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var ca=je(),Ib=we,Sd=Ae,uP=(function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,a){var i=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!a&&this._lastValue===i&&this._lastStatus===o)){this._lastValue=i,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var c={};this.makeElOption(c,i,e,r,n);var u=c.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var f=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new ct,this.createPointerEl(s,c,e,r),this.createLabelEl(s,c,e,r),n.getZr().add(s);else{var h=Ke(Pb,r,f);this.updatePointerEl(s,c,h),this.updateLabelEl(s,c,h,r)}Eb(s,r,!0),this._renderHandle(i)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),a=e.axis,i=a.type==="category",o=r.get("snap");if(!o&&!i)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(i&&a.getBandWidth()>s)return!0;if(o){var l=md(e).seriesDataCount,c=a.getExtent();return Math.abs(c[0]-c[1])/l>s}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,a,i){},t.prototype.createPointerEl=function(e,r,n,a){var i=r.pointer;if(i){var o=ca(e).pointerEl=new DT[i.type](Ib(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,a){if(r.label){var i=ca(e).labelEl=new kt(Ib(r.label));e.add(i),Rb(i,a)}},t.prototype.updatePointerEl=function(e,r,n){var a=ca(e).pointerEl;a&&r.pointer&&(a.setStyle(r.pointer.style),n(a,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,a){var i=ca(e).labelEl;i&&(i.setStyle(r.label.style),n(i,{x:r.label.x,y:r.label.y}),Rb(i,a))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),a=this._handle,i=r.getModel("handle"),o=r.get("status");if(!i.get("show")||!o||o==="hide"){a&&n.remove(a),this._handle=null;return}var s;this._handle||(s=!0,a=this._handle=kf(i.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(c){$l(c.event)},onmousedown:Sd(this._onHandleDragMove,this,0,0),drift:Sd(this._onHandleDragMove,this),ondragend:Sd(this._onHandleDragEnd,this)}),n.add(a)),Eb(a,r,!1),a.setStyle(i.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=i.get("size");ne(l)||(l=[l,l]),a.scaleX=l[0]/2,a.scaleY=l[1]/2,gh(this,"_doDispatchAxisPointer",i.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Pb(this._axisPointerModel,!r&&this._moveAnimation,this._handle,kd(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var a=this.updateHandleTransform(kd(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=a,n.stopAnimation(),n.attr(kd(a)),ca(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,a=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),a&&r.remove(a),this._group=null,this._handle=null,this._payloadInfo=null),mh(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t})();function Pb(t,e,r,n){Lb(ca(r).lastProp,n)||(ca(r).lastProp=n,e?Nt(r,n,t):(r.stopAnimation(),r.attr(n)))}function Lb(t,e){if(ce(t)&&ce(e)){var r=!0;return D(e,function(n,a){r=r&&Lb(t[a],n)}),!!r}else return t===e}function Rb(t,e){t[e.get(["label","show"])?"show":"hide"]()}function kd(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function Eb(t,e,r){var n=e.get("z"),a=e.get("zlevel");t&&t.traverse(function(i){i.type!=="group"&&(n!=null&&(i.z=n),a!=null&&(i.zlevel=a),i.silent=r)})}function fP(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function hP(t,e,r,n,a){var i=r.get("value"),o=Ob(i,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Rl(s.get("padding")||0),c=s.getFont(),u=hu(o,c),f=a.position,h=u.width+l[1]+l[3],d=u.height+l[0]+l[2],p=a.align;p==="right"&&(f[0]-=h),p==="center"&&(f[0]-=h/2);var m=a.verticalAlign;m==="bottom"&&(f[1]-=d),m==="middle"&&(f[1]-=d/2),dP(f,h,d,n);var v=s.get("backgroundColor");(!v||v==="auto")&&(v=e.get(["axisLine","lineStyle","color"])),t.label={x:f[0],y:f[1],style:Ha(s,{text:o,font:c,fill:s.getTextColor(),padding:l,backgroundColor:v}),z2:10}}function dP(t,e,r,n){var a=n.getWidth(),i=n.getHeight();t[0]=Math.min(t[0]+e,a)-e,t[1]=Math.min(t[1]+r,i)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Ob(t,e,r,n,a){t=e.scale.parse(t);var i=e.scale.getLabel({value:t},{precision:a.precision}),o=a.formatter;if(o){var s={value:ud(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};D(n,function(l){var c=r.getSeriesByIndex(l.seriesIndex),u=l.dataIndexInside,f=c&&c.getDataParams(u);f&&s.seriesData.push(f)}),oe(o)?i=o.replace("{value}",i):ye(o)&&(i=o(s))}return i}function Nb(t,e,r){var n=wa();return uu(n,n,r.rotation),cu(n,n,r.position),Sf([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function pP(t,e,r,n,a,i){var o=wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=a.get(["label","margin"]),hP(e,n,a,i,{position:Nb(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function vP(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function gP(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var mP=(function(t){U(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,a,i,o){var s=a.axis,l=s.grid,c=i.get("type"),u=Bb(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(c&&c!=="none"){var h=fP(i),d=yP[c](s,f,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var p=dd(l.model,a);pP(n,r,p,a,i,o)},e.prototype.getHandleTransform=function(r,n,a){var i=dd(n.axis.grid.model,n,{labelInside:!1});i.labelMargin=a.get(["handle","margin"]);var o=Nb(n.axis,r,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,a,i){var o=a.axis,s=o.grid,l=o.getGlobalExtent(!0),c=Bb(s,o).getOtherAxis(o).getGlobalExtent(),u=o.dim==="x"?0:1,f=[r.x,r.y];f[u]+=n[u],f[u]=Math.min(l[1],f[u]),f[u]=Math.max(l[0],f[u]);var h=(c[1]+c[0])/2,d=[h,h];d[u]=f[u];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:p[u]}},e})(uP);function Bb(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var yP={line:function(t,e,r){var n=vP([e,r[0]],[e,r[1]],zb(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r){var n=Math.max(1,t.getBandWidth()),a=r[1]-r[0];return{type:"Rect",shape:gP([e-n/2,r[0]],[n,a],zb(t))}}};function zb(t){return t.dim==="x"?0:1}var _P=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e})(Ne),Kr=je(),bP=D;function Fb(t,e,r){if(!ve.node){var n=e.getZr();Kr(n).records||(Kr(n).records={}),xP(n,e);var a=Kr(n).records[t]||(Kr(n).records[t]={});a.handler=r}}function xP(t,e){if(Kr(t).initialized)return;Kr(t).initialized=!0,r("click",Ke(Hb,"click")),r("mousemove",Ke(Hb,"mousemove")),r("globalout",SP);function r(n,a){t.on(n,function(i){var o=kP(e);bP(Kr(t).records,function(s){s&&a(s,i,o.dispatchAction)}),wP(o.pendings,e)})}}function wP(t,e){var r=t.showTip.length,n=t.hideTip.length,a;r?a=t.showTip[r-1]:n&&(a=t.hideTip[n-1]),a&&(a.dispatchAction=null,e.dispatchAction(a))}function SP(t,e,r){t.handler("leave",null,r)}function Hb(t,e,r,n){e.handler(t,r,n)}function kP(t){var e={showTip:[],hideTip:[]},r=function(n){var a=e[n.type];a?a.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function Td(t,e){if(!ve.node){var r=e.getZr(),n=(Kr(r).records||{})[t];n&&(Kr(r).records[t]=null)}}var TP=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a){var i=n.getComponent("tooltip"),o=r.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";Fb("axisPointer",a,function(s,l,c){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&c({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){Td("axisPointer",n)},e.prototype.dispose=function(r,n){Td("axisPointer",n)},e.type="axisPointer",e})(lr);function Vb(t,e){var r=[],n=t.seriesIndex,a;if(n==null||!(a=e.getSeriesByIndex(n)))return{point:[]};var i=a.getData(),o=Xn(i,t);if(o==null||o<0||ne(o))return{point:[]};var s=i.getItemGraphicEl(o),l=a.coordinateSystem;if(a.getTooltipPosition)r=a.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c),f=u.dim,h=c.dim,d=f==="x"||f==="radius"?1:0,p=i.mapDimension(h),m=[];m[d]=i.get(p,o),m[1-d]=i.get(i.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(i.getValues(fe(l.dimensions,function(g){return i.mapDimension(g)}),o))||[];else if(s){var v=s.getBoundingRect().clone();v.applyTransform(s.transform),r=[v.x+v.width/2,v.y+v.height/2]}return{point:r,el:s}}var Gb=je();function CP(t,e,r){var n=t.currTrigger,a=[t.x,t.y],i=t,o=t.dispatchAction||Ae(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){gc(a)&&(a=Vb({seriesIndex:i.seriesIndex,dataIndex:i.dataIndex},e).point);var l=gc(a),c=i.axesInfo,u=s.axesInfo,f=n==="leave"||gc(a),h={},d={},p={list:[],map:{}},m={showPointer:Ke(AP,d),showTooltip:Ke(DP,p)};D(s.coordSysMap,function(g,y){var b=l||g.containPoint(a);D(s.coordSysAxesInfo[y],function(x,S){var w=x.axis,k=RP(c,x);if(!f&&b&&(!c||k)){var T=k&&k.value;T==null&&!l&&(T=w.pointToData(a)),T!=null&&Wb(x,T,m,!1,h)}})});var v={};return D(u,function(g,y){var b=g.linkGroup;b&&!d[y]&&D(b.axesInfo,function(x,S){var w=d[S];if(x!==g&&w){var k=w.value;b.mapper&&(k=g.axis.scale.parse(b.mapper(k,$b(x),$b(g)))),v[g.key]=k}})}),D(v,function(g,y){Wb(u[y],g,m,!0,h)}),IP(d,u,h),PP(p,a,t,o),LP(u,o,r),h}}function Wb(t,e,r,n,a){var i=t.axis;if(!(i.scale.isBlank()||!i.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=MP(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&a.seriesIndex==null&&G(a,s[0]),!n&&t.snap&&i.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function MP(t,e){var r=e.axis,n=r.dim,a=t,i=[],o=Number.MAX_VALUE,s=-1;return D(e.seriesModels,function(l,c){var u=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(u,t,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.getData().indicesOfNearest(u[0],t,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(u[0],h[0])}if(!(f==null||!isFinite(f))){var p=t-f,m=Math.abs(p);m<=o&&((m<o||p>=0&&s<0)&&(o=m,s=p,a=f,i.length=0),D(h,function(v){i.push({seriesIndex:l.seriesIndex,dataIndexInside:v,dataIndex:l.getData().getRawIndex(v)})}))}}),{payloadBatch:i,snapToValue:a}}function AP(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function DP(t,e,r,n){var a=r.payloadBatch,i=e.axis,o=i.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!a.length)){var l=e.coordSys.model,c=To(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:i.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:a.slice()})}}function IP(t,e,r){var n=r.axesInfo=[];D(e,function(a,i){var o=a.axisPointerModel.option,s=t[i];s?(!a.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!a.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:a.axis.dim,axisIndex:a.axis.model.componentIndex,value:o.value})})}function PP(t,e,r,n){if(gc(e)||!t.list.length){n({type:"hideTip"});return}var a=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:t.list})}function LP(t,e,r){var n=r.getZr(),a="axisPointerLastHighlights",i=Gb(n)[a]||{},o=Gb(n)[a]={};D(t,function(c,u){var f=c.axisPointerModel.option;f.status==="show"&&c.triggerEmphasis&&D(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];D(i,function(c,u){!o[u]&&l.push(c)}),D(o,function(c,u){!i[u]&&s.push(c)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function RP(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function $b(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function gc(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function Ub(t){Sb.registerAxisPointerClass("CartesianAxisPointer",mP),t.registerComponentModel(_P),t.registerComponentView(TP),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!ne(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=qI(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},CP)}function EP(t){bn(sP),bn(Ub)}var Yb=["x","y","radius","angle","single"],OP=["cartesian2d","polar","singleAxis"];function NP(t){var e=t.get("coordinateSystem");return Pe(OP,e)>=0}function ua(t){return t+"Axis"}function BP(t,e){var r=de(),n=[],a=de();t.eachComponent({mainType:"dataZoom",query:e},function(u){a.get(u.uid)||s(u)});var i;do i=!1,t.eachComponent("dataZoom",o);while(i);function o(u){!a.get(u.uid)&&l(u)&&(s(u),i=!0)}function s(u){a.set(u.uid,!0),n.push(u),c(u)}function l(u){var f=!1;return u.eachTargetAxis(function(h,d){var p=r.get(h);p&&p[d]&&(f=!0)}),f}function c(u){u.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function zP(t){var e=t.ecModel,r={infoList:[],infoMap:de()};return t.eachTargetAxis(function(n,a){var i=e.getComponent(ua(n),a);if(i){var o=i.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(i)}}}),r}var Cd=(function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t})(),qb=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,a){var i=Xb(r);this.settledOption=i,this.mergeDefaultAndTheme(r,a),this._doInit(i)},e.prototype.mergeOption=function(r){var n=Xb(r);Me(this.option,r,!0),Me(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var a=this.settledOption;D([["start","startValue"],["end","endValue"]],function(i,o){this._rangePropMode[o]==="value"&&(n[i[0]]=a[i[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=de(),a=this._fillSpecifiedTargetAxis(n);a?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(i){i.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return D(Yb,function(a){var i=this.getReferringComponents(ua(a),pk);if(i.specified){n=!0;var o=new Cd;D(i.models,function(s){o.add(s.componentIndex)}),r.set(a,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var a=this.ecModel,i=!0;if(i){var o=n==="vertical"?"y":"x",s=a.findComponents({mainType:o+"Axis"});l(s,o)}if(i){var s=a.findComponents({mainType:"singleAxis",filter:function(u){return u.get("orient",!0)===n}});l(s,"single")}function l(c,u){var f=c[0];if(f){var h=new Cd;if(h.add(f.componentIndex),r.set(u,h),i=!1,u==="x"||u==="y"){var d=f.getReferringComponents("grid",Ct).models[0];d&&D(c,function(p){f.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",Ct).models[0]&&h.add(p.componentIndex)})}}}i&&D(Yb,function(c){if(i){var u=a.findComponents({mainType:ua(c),filter:function(h){return h.get("type",!0)==="category"}});if(u[0]){var f=new Cd;f.add(u[0].componentIndex),r.set(c,f),i=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,a=this.get("rangeMode");D([["start","startValue"],["end","endValue"]],function(i,o){var s=r[i[0]]!=null,l=r[i[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":a?n[o]=a[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,a){r==null&&(r=this.ecModel.getComponent(ua(n),a))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(a,i){D(a.indexList,function(o){r.call(n,i,o)})})},e.prototype.getAxisProxy=function(r,n){var a=this.getAxisModel(r,n);if(a)return a.__dzAxisProxy},e.prototype.getAxisModel=function(r,n){var a=this._targetAxisInfoMap.get(r);if(a&&a.indexMap[n])return this.ecModel.getComponent(ua(r),n)},e.prototype.setRawRange=function(r){var n=this.option,a=this.settledOption;D([["start","startValue"],["end","endValue"]],function(i){(r[i[0]]!=null||r[i[1]]!=null)&&(n[i[0]]=a[i[0]]=r[i[0]],n[i[1]]=a[i[1]]=r[i[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;D(["start","startValue","end","endValue"],function(a){n[a]=r[a]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var a=this.findRepresentativeAxisProxy();if(a)return a.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,a=this._targetAxisInfoMap.keys(),i=0;i<a.length;i++)for(var o=a[i],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var c=this.getAxisProxy(o,s.indexList[l]);if(c.hostedBy(this))return c;n||(n=c)}return n},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e})(Ne);function Xb(t){var e={};return D(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var FP=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.dataZoomModel=r,this.ecModel=n,this.api=a},e.type="dataZoom",e})(lr),oi=D,Zb=KS,HP=(function(){function t(e,r,n,a){this._dimName=e,this._axisIndex=r,this.ecModel=a,this._dataZoomModel=n}return t.prototype.hostedBy=function(e){return this._dataZoomModel===e},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(r){if(NP(r)){var n=ua(this._dimName),a=r.getReferringComponents(n,Ct).models[0];a&&this._axisIndex===a.componentIndex&&e.push(r)}},this),e},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return we(this._minMaxSpan)},t.prototype.calculateDataWindow=function(e){var r=this._dataExtent,n=this.getAxisModel(),a=n.axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],c;oi(["start","end"],function(h,d){var p=e[h],m=e[h+"Value"];i[d]==="percent"?(p==null&&(p=o[d]),m=a.parse(qn(p,o,r))):(c=!0,m=m==null?r[d]:a.parse(m),p=qn(m,r,o)),l[d]=m==null||isNaN(m)?r[d]:m,s[d]=p==null||isNaN(p)?o[d]:p}),Zb(l),Zb(s);var u=this._minMaxSpan;c?f(l,s,r,o,!1):f(s,l,o,r,!0);function f(h,d,p,m,v){var g=v?"Span":"ValueSpan";xd(0,h,p,"all",u["min"+g],u["max"+g]);for(var y=0;y<2;y++)d[y]=qn(h[y],p,m,!0),v&&(d[y]=a.parse(d[y]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=VP(this,this._dimName,r),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(e,r){if(e!==this._dataZoomModel)return;var n=this._dimName,a=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;if(i==="none")return;oi(a,function(l){var c=l.getData(),u=c.mapDimensionsAll(n);if(u.length){if(i==="weakFilter"){var f=c.getStore(),h=fe(u,function(d){return c.getDimensionIndex(d)},c);c.filterSelf(function(d){for(var p,m,v,g=0;g<u.length;g++){var y=f.get(h[g],d),b=!isNaN(y),x=y<o[0],S=y>o[1];if(b&&!x&&!S)return!0;b&&(v=!0),x&&(p=!0),S&&(m=!0)}return v&&p&&m})}else oi(u,function(d){if(i==="empty")l.setData(c=c.map(d,function(m){return s(m)?m:NaN}));else{var p={};p[d]=o,c.selectRange(p)}});oi(u,function(d){c.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;oi(["min","max"],function(a){var i=r.get(a+"Span"),o=r.get(a+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?i=qn(n[0]+o,n,[0,100],!0):i!=null&&(o=qn(i,[0,100],n,!0)-n[0]),e[a+"Span"]=i,e[a+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var a=ng(n,[0,500]);a=Math.min(a,20);var i=e.axis.scale.rawExtentInfo;r[0]!==0&&i.setDeterminedMinMax("min",+n[0].toFixed(a)),r[1]!==100&&i.setDeterminedMinMax("max",+n[1].toFixed(a)),i.freeze()}},t})();function VP(t,e,r){var n=[1/0,-1/0];oi(r,function(o){TI(n,o.getData(),e)});var a=t.getAxisModel(),i=J0(a.axis.scale,a,n).calculate();return[i.min,i.max]}var GP={getTargetSeries:function(t){function e(a){t.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(o,s){var l=t.getComponent(ua(o),s);a(o,s,l,i)})})}e(function(a,i,o,s){o.__dzAxisProxy=null});var r=[];e(function(a,i,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new HP(a,i,s,t),r.push(o.__dzAxisProxy))});var n=de();return D(r,function(a){D(a.getTargetSeriesModels(),function(i){n.set(i.uid,i)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).reset(r)}),r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var a=n.getDataPercentWindow(),i=n.getDataValueWindow();r.setCalculatedRange({start:a[0],end:a[1],startValue:i[0],endValue:i[1]})}})}};function WP(t){t.registerAction("dataZoom",function(e,r){var n=BP(r,e);D(n,function(a){a.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Kb=!1;function $P(t){Kb||(Kb=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,GP),WP(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function UP(t,e){var r=Rl(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new at({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),t}var YP=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e})(Ne);function jb(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function Qb(t){if(ve.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r<n;r++)if(t[r]in e)return t[r]}}var Jb=Qb(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),qP=Qb(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function ex(t,e){if(!t)return e;e=ay(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function XP(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?r[e]:null}var ZP=ex(qP,"transition"),Md=ex(Jb,"transform"),KP="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(ve.transform3dSupported?"will-change:transform;":"");function jP(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function QP(t,e,r){if(!oe(r)||r==="inside")return"";var n=t.get("backgroundColor"),a=t.get("borderWidth");e=ra(e);var i=jP(r),o=Math.max(Math.round(a)*1.5,6),s="",l=Md+":",c;Pe(["left","right"],i)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(c=i==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(c=i==="top"?225:45)+"deg)");var u=c*Math.PI/180,f=o+a,h=f*Math.abs(Math.cos(u))+f*Math.abs(Math.sin(u)),d=Math.round(((h-Math.SQRT2*a)/2+Math.SQRT2*a-(h-f)/2)*100)/100;s+=";"+i+":-"+d+"px";var p=e+" solid "+a+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'<div style="'+m.join("")+'"></div>'}function JP(t,e){var r="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+r,a="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+r,a+=ve.transformSupported?","+Md+n:",left"+n+",top"+n),ZP+":"+a}function tx(t,e,r){var n=t.toFixed(0)+"px",a=e.toFixed(0)+"px";if(!ve.transformSupported)return r?"top:"+a+";left:"+n+";":[["top",a],["left",n]];var i=ve.transform3dSupported,o="translate"+(i?"3d":"")+"("+n+","+a+(i?",0":"")+")";return r?"top:0;left:0;"+Md+":"+o+";":[["top",0],["left",0],[Jb,o]]}function eL(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var a=ke(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+a+"px");var i=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return i&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+i),D(["decoration","align"],function(c){var u=t.get(c);u&&e.push("text-"+c+":"+u)}),e.join(";")}function tL(t,e,r){var n=[],a=t.get("transitionDuration"),i=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),f=by(t,"html"),h=l+"px "+c+"px "+o+"px "+s;return n.push("box-shadow:"+h),e&&a&&n.push(JP(a,r)),i&&n.push("background-color:"+i),D(["width","color","radius"],function(d){var p="border-"+d,m=ay(p),v=t.get(m);v!=null&&n.push(p+":"+v+(d==="color"?"":"px"))}),n.push(eL(u)),f!=null&&n.push("padding:"+Rl(f).join("px ")+"px"),n.join(";")+";"}function rx(t,e,r,n,a){var i=e&&e.painter;if(r){var o=i&&i.getViewportRoot();o&&P2(t,o,r,n,a)}else{t[0]=n,t[1]=a;var s=i&&i.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var rL=(function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,ve.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=e.getZr(),i=r.appendTo,o=i&&(oe(i)?document.querySelector(i):wi(i)?i:ye(i)&&i(e.getDom()));rx(this._styleCoord,a,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var c=a.handler,u=a.painter.getViewportRoot();Kt(u,l,!0),c.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=XP(r,"position"),a=r.style;a.position!=="absolute"&&n!=="absolute"&&(a.position="relative")}var i=e.get("alwaysShowContent");i&&this._moveIfResized(),this._alwaysShowContent=i,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,a=n.style,i=this._styleCoord;n.innerHTML?a.cssText=KP+tL(e,!this._firstShow,this._longHide)+tx(i[0],i[1],!0)+("border-color:"+ra(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):a.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,a,i){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(oe(i)&&n.get("trigger")==="item"&&!jb(n)&&(s=QP(n,a,i)),oe(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ne(e)||(e=[e]);for(var l=0;l<e.length;l++)wi(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var c=document.createElement("div");c.innerHTML=s,o.appendChild(c)}}},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},t.prototype.moveTo=function(e,r){if(this.el){var n=this._styleCoord;if(rx(n,this._zr,this._container,e,r),n[0]!=null&&n[1]!=null){var a=this.el.style,i=tx(n[0],n[1]);D(i,function(o){a[o[0]]=o[1]})}}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){var e=this,r=this.el.style;r.visibility="hidden",r.opacity="0",ve.transform3dSupported&&(r.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Ae(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},t})(),nL=(function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),ax(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return t.prototype.update=function(e){var r=e.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(e,r,n,a,i){var o=this;ce(e)&&Tt(""),this.el&&this._zr.remove(this.el);var s=n.getModel("textStyle");this.el=new kt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:a,textShadowColor:s.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:by(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),D(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(c){o.el.style[c]=n.get(c)}),D(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(c){o.el.style[c]=s.get(c)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el,r=this.el.getBoundingRect(),n=nx(e.style);return[r.width+n.left+n.right,r.height+n.top+n.bottom]},t.prototype.moveTo=function(e,r){var n=this.el;if(n){var a=this._styleCoord;ax(a,this._zr,e,r),e=a[0],r=a[1];var i=n.style,o=Sn(i.borderWidth||0),s=nx(i);n.x=e+o+s.left,n.y=r+o+s.top,n.markRedraw()}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Ae(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t})();function Sn(t){return Math.max(0,t)}function nx(t){var e=Sn(t.shadowBlur||0),r=Sn(t.shadowOffsetX||0),n=Sn(t.shadowOffsetY||0);return{left:Sn(e-r),right:Sn(e+r),top:Sn(e-n),bottom:Sn(e+n)}}function ax(t,e,r,n){t[0]=r,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var aL=new at({shape:{x:-1,y:-1,width:2,height:2}}),iL=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){if(!(ve.node||!n.getDom())){var a=r.getComponent("tooltip"),i=this._renderMode=gk(a.get("renderMode"));this._tooltipContent=i==="richText"?new nL(n):new rL(n,{appendTo:a.get("appendToBody",!0)?"body":a.get("appendTo",!0)})}},e.prototype.render=function(r,n,a){if(!(ve.node||!a.getDom())){this.group.removeAll(),this._tooltipModel=r,this._ecModel=n,this._api=a;var i=this._tooltipContent;i.update(r),i.setEnterable(r.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&r.get("transitionDuration")?gh(this,"_updatePosition",50,"fixRate"):mh(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,n=r.get("triggerOn");Fb("itemTooltip",this._api,Ae(function(a,i,o){n!=="none"&&(n.indexOf(a)>=0?this._tryShow(i,o):a==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,a=this._api,i=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&i!=="none"&&i!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!a.isDisposed()&&o.manuallyShowTip(r,n,a,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,a,i){if(!(i.from===this.uid||ve.node||!a.getDom())){var o=ix(i,a);this._ticket="";var s=i.dataByCoordSys,l=cL(i,n,a);if(l){var c=l.el.getBoundingRect().clone();c.applyTransform(l.el.transform),this._tryShow({offsetX:c.x+c.width/2,offsetY:c.y+c.height/2,target:l.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&i.x!=null&&i.y!=null){var u=aL;u.x=i.x,u.y=i.y,u.update(),Ee(u).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:u},o)}else if(s)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:s,tooltipOption:i.tooltipOption},o);else if(i.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,a,i))return;var f=Vb(i,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:i.position,positionDefault:"bottom"},o)}else i.x!=null&&i.y!=null&&(a.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:a.getZr().findHover(i.x,i.y).target},o))}},e.prototype.manuallyHideTip=function(r,n,a,i){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(ix(i,a))},e.prototype._manuallyAxisShowTip=function(r,n,a,i){var o=i.seriesIndex,s=i.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var c=n.getSeriesByIndex(o);if(c){var u=c.getData(),f=Co([u.getItemModel(s),c,(c.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return a.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:i.position}),!0}}},e.prototype._tryShow=function(r,n){var a=r.target,i=this._tooltipModel;if(i){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(a){var s=Ee(a);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,c;mo(a,function(u){if(Ee(u).dataIndex!=null)return l=u,!0;if(Ee(u).tooltipConfig!=null)return c=u,!0},!0),l?this._showSeriesItemTooltip(r,l,n):c?this._showComponentItemTooltip(r,c,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var a=r.get("showDelay");n=Ae(n,this),clearTimeout(this._showTimout),a>0?this._showTimout=setTimeout(n,a):n()},e.prototype._showAxisTooltip=function(r,n){var a=this._ecModel,i=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Co([n.tooltipOption],i),l=this._renderMode,c=[],u=so("section",{blocks:[],noHeader:!0}),f=[],h=new nh;D(r,function(y){D(y.dataByAxis,function(b){var x=a.getComponent(b.axisDim+"Axis",b.axisIndex),S=b.value;if(!(!x||S==null)){var w=Ob(S,x.axis,a,b.seriesDataIndices,b.valueLabelOpt),k=so("section",{header:w,noHeader:!xr(w),sortBlocks:!0,blocks:[]});u.blocks.push(k),D(b.seriesDataIndices,function(T){var M=a.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,C=M.getDataParams(A);if(!(C.dataIndex<0)){C.axisDim=b.axisDim,C.axisIndex=b.axisIndex,C.axisType=b.axisType,C.axisId=b.axisId,C.axisValue=ud(x.axis,{value:S}),C.axisValueLabel=w,C.marker=h.makeTooltipMarker("item",ra(C.color),l);var I=uy(M.formatTooltip(A,!0,null)),P=I.frag;if(P){var R=Co([M],i).get("valueFormatter");k.blocks.push(R?G({valueFormatter:R},P):P)}I.text&&f.push(I.text),c.push(C)}})}})}),u.blocks.reverse(),f.reverse();var d=n.position,p=s.get("order"),m=yy(u,h,l,p,a.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var v=l==="richText"?`
|
|
18
|
+
`];function Co(t,e){return e.type=t,e}function ph(t){return t.type==="section"}function My(t){return ph(t)?PC:RC}function Ay(t){if(ph(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return D(t.blocks,function(a){var i=Ay(a);i>=e&&(e=i+ +(n&&(!i||ph(a)&&!a.noHeader)))}),e}return 0}function PC(t,e,r,n){var a=e.noHeader,i=EC(Ay(e)),o=[],s=e.blocks||[];Ur(!s||ee(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(Vn(c,l)){var u=new _2(c[l],null);s.sort(function(m,g){return u.evaluate(m.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}D(s,function(m,g){var v=e.valueFormatter,y=My(m)(v?U(U({},t),{valueFormatter:v}):t,m,g>0?i.html:0,n);y!=null&&o.push(y)});var f=t.renderMode==="richText"?o.join(i.richText):vh(n,o.join(""),a?r:i.html);if(a)return f;var h=ch(e.header,"ordinal",t.useUTC),d=Cy(n,t.renderMode).nameStyle,p=Ty(n);return t.renderMode==="richText"?Iy(t,h,d)+i.richText+f:vh(n,'<div style="'+d+";"+p+';">'+Bt(h)+"</div>"+f,r)}function RC(t,e,r,n){var a=t.renderMode,i=e.noName,o=e.noValue,s=!e.markerType,l=e.name,c=t.useUTC,u=e.valueFormatter||t.valueFormatter||function(x){return x=ee(x)?x:[x],ue(x,function(S,w){return ch(S,ee(d)?d[w]:d,c)})};if(!(i&&o)){var f=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),h=i?"":ch(l,"ordinal",c),d=e.valueType,p=o?[]:u(e.value,e.dataIndex),m=!s||!i,g=!s&&i,v=Cy(n,a),y=v.nameStyle,b=v.valueStyle;return a==="richText"?(s?"":f)+(i?"":Iy(t,h,y))+(o?"":BC(t,p,m,g,b)):vh(n,(s?"":f)+(i?"":OC(h,!s,y))+(o?"":NC(p,m,g,b)),r)}}function Dy(t,e,r,n,a,i){if(t){var o=My(t),s={useUTC:a,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,i)}}function EC(t){return{html:IC[t],richText:LC[t]}}function vh(t,e,r){var n='<div style="clear:both"></div>',a="margin: "+r+"px 0 0",i=Ty(t);return'<div style="'+a+";"+i+';">'+e+n+"</div>"}function OC(t,e,r){var n=e?"margin-left:2px":"";return'<span style="'+r+";"+n+'">'+Bt(t)+"</span>"}function NC(t,e,r,n){var a=r?"10px":"20px",i=e?"float:right;margin-left:"+a:"";return t=ee(t)?t:[t],'<span style="'+i+";"+n+'">'+ue(t,function(o){return Bt(o)}).join(" ")+"</span>"}function Iy(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function BC(t,e,r,n,a){var i=[a],o=n?10:20;return r&&i.push({padding:[0,0,0,o],align:"right"}),t.markupStyleCreator.wrapRichTextStyle(ee(e)?e.join(" "):e,i)}function zC(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return pa(n)}function Ly(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var gh=(function(){function t(){this.richTextStyles={},this._nextStyleNameId=mg()}return t.prototype._generateStyleName=function(){return"__EC_aUTo_"+this._nextStyleNameId++},t.prototype.makeTooltipMarker=function(e,r,n){var a=n==="richText"?this._generateStyleName():null,i=lC({color:r,type:e,renderMode:n,markerId:a});return ne(i)?i:(this.richTextStyles[a]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ee(r)?D(r,function(i){return U(n,i)}):U(n,r);var a=this._generateStyleName();return this.richTextStyles[a]=n,"{"+a+"|"+e+"}"},t})();function FC(t){var e=t.series,r=t.dataIndex,n=t.multipleSeries,a=e.getData(),i=a.mapDimensionsAll("defaultedTooltip"),o=i.length,s=e.getRawValue(r),l=ee(s),c=zC(e,r),u,f,h,d;if(o>1||l&&!o){var p=HC(s,e,r,i,c);u=p.inlineValues,f=p.inlineValueTypes,h=p.blocks,d=p.inlineValues[0]}else if(o){var m=a.getDimensionInfo(i[0]);d=u=ai(a,r,i[0]),f=m.type}else d=u=l?s[0]:s;var g=uf(e),v=g&&e.name||"",y=a.getName(r),b=n?v:y;return Co("section",{header:v,noHeader:n||!g,sortParam:d,blocks:[Co("nameValue",{markerType:"item",markerColor:c,name:b,noName:!Mr(b),value:u,valueType:f,dataIndex:r})].concat(h||[])})}function HC(t,e,r,n,a){var i=e.getData(),o=Ba(t,function(f,h,d){var p=i.getDimensionInfo(d);return f=f||p&&p.tooltip!==!1&&p.displayName!=null},!1),s=[],l=[],c=[];n.length?D(n,function(f){u(ai(i,r,f),f)}):D(t,u);function u(f,h){var d=i.getDimensionInfo(h);!d||d.otherDims.tooltip===!1||(o?c.push(Co("nameValue",{markerType:"subItem",markerColor:a,name:d.displayName,value:f,valueType:d.type})):(s.push(f),l.push(d.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:c}}var Tn=it();function Zl(t,e){return t.getName(e)||t.getId(e)}var VC="__universalTransitionEnabled",Br=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r._selectedDataIndicesMap={},r}return e.prototype.init=function(r,n,a){this.seriesIndex=this.componentIndex,this.dataTask=To({count:$C,reset:WC}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,a);var i=Tn(this).sourceManager=new AC(this);i.prepareSource();var o=this.getInitialData(r,a);Ry(o,this),this.dataTask.context.data=o,Tn(this).dataBeforeProcessed=o,Py(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=ko(this),i=a?ql(r):{},o=this.subType;We.hasClass(o)&&(o+="Series"),De(r,n.getTheme().get(this.subType)),De(r,this.getDefaultOption()),wg(r,"label",["show"]),this.fillDataTextStyle(r.data),a&&hi(r,i,a)},e.prototype.mergeOption=function(r,n){r=De(this.option,r,!0),this.fillDataTextStyle(r.data);var a=ko(this);a&&hi(this.option,r,a);var i=Tn(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(r,n);Ry(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,Tn(this).dataBeforeProcessed=o,Py(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!It(r))for(var n=["show"],a=0;a<r.length;a++)r[a]&&r[a].label&&wg(r[a],"label",n)},e.prototype.getInitialData=function(r,n){},e.prototype.appendData=function(r){var n=this.getRawData();n.appendData(r.data)},e.prototype.getData=function(r){var n=mh(this);if(n){var a=n.context.data;return r==null||!a.getLinkedData?a:a.getLinkedData(r)}else return Tn(this).data},e.prototype.getAllData=function(){var r=this.getData();return r&&r.getLinkedDataAll?r.getLinkedDataAll():[{data:r}]},e.prototype.setData=function(r){var n=mh(this);if(n){var a=n.context;a.outputData=r,n!==this.dataTask&&(a.data=r)}Tn(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return de(r)},e.prototype.getSourceManager=function(){return Tn(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return Tn(this).dataBeforeProcessed},e.prototype.getColorBy=function(){var r=this.get("colorBy");return r||"series"},e.prototype.isColorBySeries=function(){return this.getColorBy()==="series"},e.prototype.getBaseAxis=function(){var r=this.coordinateSystem;return r&&r.getBaseAxis&&r.getBaseAxis()},e.prototype.formatTooltip=function(r,n,a){return FC({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(ge.node&&!(r&&r.ssr))return!1;var n=this.getShallow("animation");return n&&this.getData().count()>this.getShallow("animationThreshold")&&(n=!1),!!n},e.prototype.restoreData=function(){this.dataTask.dirty()},e.prototype.getColorFromPalette=function(r,n,a){var i=this.ecModel,o=hh.prototype.getColorFromPalette.call(this,r,n,a);return o||(o=i.getColorFromPalette(r,n,a)),o},e.prototype.coordDimToDataDim=function(r){return this.getRawData().mapDimensionsAll(r)},e.prototype.getProgressive=function(){return this.get("progressive")},e.prototype.getProgressiveThreshold=function(){return this.get("progressiveThreshold")},e.prototype.select=function(r,n){this._innerSelect(this.getData(n),r)},e.prototype.unselect=function(r,n){var a=this.option.selectedMap;if(a){var i=this.option.selectedMode,o=this.getData(n);if(i==="series"||a==="all"){this.option.selectedMap={},this._selectedDataIndicesMap={};return}for(var s=0;s<r.length;s++){var l=r[s],c=Zl(o,l);a[c]=!1,this._selectedDataIndicesMap[c]=-1}}},e.prototype.toggleSelect=function(r,n){for(var a=[],i=0;i<r.length;i++)a[0]=r[i],this.isSelected(r[i],n)?this.unselect(a,n):this.select(a,n)},e.prototype.getSelectedDataIndices=function(){if(this.option.selectedMap==="all")return[].slice.call(this.getData().getIndices());for(var r=this._selectedDataIndicesMap,n=Qe(r),a=[],i=0;i<n.length;i++){var o=r[n[i]];o>=0&&a.push(o)}return a},e.prototype.isSelected=function(r,n){var a=this.option.selectedMap;if(!a)return!1;var i=this.getData(n);return(a==="all"||a[Zl(i,r)])&&!i.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[VC])return!0;var r=this.option.universalTransition;return r?r===!0?!0:r&&r.enabled:!1},e.prototype._innerSelect=function(r,n){var a,i,o=this.option,s=o.selectedMode,l=n.length;if(!(!s||!l)){if(s==="series")o.selectedMap="all";else if(s==="multiple"){ce(o.selectedMap)||(o.selectedMap={});for(var c=o.selectedMap,u=0;u<l;u++){var f=n[u],h=Zl(r,f);c[h]=!0,this._selectedDataIndicesMap[h]=r.getRawIndex(f)}}else if(s==="single"||s===!0){var d=n[l-1],h=Zl(r,d);o.selectedMap=(a={},a[h]=!0,a),this._selectedDataIndicesMap=(i={},i[h]=r.getRawIndex(d),i)}}},e.prototype._initSelectedMapFromData=function(r){if(!this.option.selectedMap){var n=[];r.hasItemOption&&r.each(function(a){var i=r.getRawDataItem(a);i&&i.selected&&n.push(a)}),n.length>0&&this._innerSelect(r,n)}},e.registerClass=function(r){return We.registerClass(r)},e.protoInitialize=(function(){var r=e.prototype;r.type="series.__base__",r.seriesIndex=0,r.ignoreStyleOnData=!1,r.hasSymbolVisual=!1,r.defaultSymbol="circle",r.visualStyleAccessPath="itemStyle",r.visualDrawType="fill"})(),e})(We);Cr(Br,mC),Cr(Br,hh),vv(Br,We);function Py(t){var e=t.name;uf(t)||(t.name=GC(t)||e)}function GC(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return D(r,function(a){var i=e.getDimensionInfo(a);i.displayName&&n.push(i.displayName)}),n.join(" ")}function $C(t){return t.model.getRawData().count()}function WC(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),UC}function UC(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function Ry(t,e){D(Iw(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,at(YC,e))})}function YC(t,e){var r=mh(t);return r&&r.setOutputEnd((e||this).count()),e}function mh(t){var e=(t.ecModel||{}).scheduler,r=e&&e.getPipeline(t.uid);if(r){var n=r.currentTask;if(n){var a=n.agentStubMap;a&&(n=a.get(t.uid))}return n}}var qC=$e.extend({type:"triangle",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n+i),t.lineTo(r-a,n+i),t.closePath()}}),XC=$e.extend({type:"diamond",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var r=e.cx,n=e.cy,a=e.width/2,i=e.height/2;t.moveTo(r,n-i),t.lineTo(r+a,n),t.lineTo(r,n+i),t.lineTo(r-a,n),t.closePath()}}),ZC=$e.extend({type:"pin",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.x,n=e.y,a=e.width/5*3,i=Math.max(a,e.height),o=a/2,s=o*o/(i-o),l=n-i+o+s,c=Math.asin(s/o),u=Math.cos(c)*o,f=Math.sin(c),h=Math.cos(c),d=o*.6,p=o*.7;t.moveTo(r-u,l+s),t.arc(r,l,o,Math.PI-c,Math.PI*2+c),t.bezierCurveTo(r+u-f*d,l+s+h*d,r,n-p,r,n),t.bezierCurveTo(r,n-p,r-u+f*d,l+s+h*d,r-u,l+s),t.closePath()}}),KC=$e.extend({type:"arrow",shape:{x:0,y:0,width:0,height:0},buildPath:function(t,e){var r=e.height,n=e.width,a=e.x,i=e.y,o=n/3*2;t.moveTo(a,i),t.lineTo(a+o,i+r),t.lineTo(a,i+r/4*3),t.lineTo(a-o,i+r),t.lineTo(a,i),t.closePath()}}),jC={line:xn,rect:ft,roundRect:ft,square:ft,circle:pl,diamond:XC,pin:ZC,arrow:KC,triangle:qC},QC={line:function(t,e,r,n,a){a.x1=t,a.y1=e+n/2,a.x2=t+r,a.y2=e+n/2},rect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n},roundRect:function(t,e,r,n,a){a.x=t,a.y=e,a.width=r,a.height=n,a.r=Math.min(r,n)/4},square:function(t,e,r,n,a){var i=Math.min(r,n);a.x=t,a.y=e,a.width=i,a.height=i},circle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.r=Math.min(r,n)/2},diamond:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n},pin:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},arrow:function(t,e,r,n,a){a.x=t+r/2,a.y=e+n/2,a.width=r,a.height=n},triangle:function(t,e,r,n,a){a.cx=t+r/2,a.cy=e+n/2,a.width=r,a.height=n}},yh={};D(jC,function(t,e){yh[e]=new t});var JC=$e.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var n=Ls(t,e,r),a=this.shape;return a&&a.symbolType==="pin"&&e.position==="inside"&&(n.y=r.y+r.height*.4),n},buildPath:function(t,e,r){var n=e.symbolType;if(n!=="none"){var a=yh[n];a||(n="rect",a=yh[n]),QC[n](e.x,e.y,e.width,e.height,a.shape),a.buildPath(t,a.shape,r)}}});function eM(t,e){if(this.type!=="image"){var r=this.style;this.__isEmptyBrush?(r.stroke=t,r.fill=e||"#fff",r.lineWidth=2):this.shape.symbolType==="line"?r.stroke=t:r.fill=t,this.markRedraw()}}function di(t,e,r,n,a,i,o){var s=t.indexOf("empty")===0;s&&(t=t.substr(5,1).toLowerCase()+t.substr(6));var l;return t.indexOf("image://")===0?l=sm(t.slice(8),new Fe(e,r,n,a),o?"center":"cover"):t.indexOf("path://")===0?l=Of(t.slice(7),{},new Fe(e,r,n,a),o?"center":"cover"):l=new JC({shape:{symbolType:t,x:e,y:r,width:n,height:a}}),l.__isEmptyBrush=s,l.setColor=eM,i&&l.setColor(i),l}function tM(t){return ee(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function Ey(t,e){if(t!=null)return ee(t)||(t=[t,t]),[At(t[0],e[0])||0,At(Ce(t[1],t[0]),e[1])||0]}var rM=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.hasSymbolVisual=!0,r}return e.prototype.getInitialData=function(r){return Qf(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var n=new mt,a=di("line",0,r.itemHeight/2,r.itemWidth,0,r.lineStyle.stroke,!1);n.add(a),a.setStyle(r.lineStyle);var i=this.getData().getVisual("symbol"),o=this.getData().getVisual("symbolRotate"),s=i==="none"?"circle":i,l=r.itemHeight*.8,c=di(s,(r.itemWidth-l)/2,(r.itemHeight-l)/2,l,l,r.itemStyle.fill);n.add(c),c.setStyle(r.itemStyle);var u=r.iconRotate==="inherit"?o:r.iconRotate||0;return c.rotation=u*Math.PI/180,c.setOrigin([r.itemWidth/2,r.itemHeight/2]),s.indexOf("empty")>-1&&(c.style.stroke=c.style.fill,c.style.fill="#fff",c.style.lineWidth=2),n},e.type="series.line",e.dependencies=["grid","polar"],e.defaultOption={z:3,coordinateSystem:"cartesian2d",legendHoverLink:!0,clip:!0,label:{position:"top"},endLabel:{show:!1,valueAnimation:!0,distance:8},lineStyle:{width:2,type:"solid"},emphasis:{scale:!0},step:!1,smooth:!1,smoothMonotone:null,symbol:"emptyCircle",symbolSize:4,symbolRotate:null,showSymbol:!0,showAllSymbol:"auto",connectNulls:!1,sampling:"none",animationEasing:"linear",progressive:0,hoverLayerThreshold:1/0,universalTransition:{divideShape:"clone"},triggerLineEvent:!1},e})(Br);function _h(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var a=ai(t,e,r[0]);return a!=null?a+"":null}else if(n){for(var i=[],o=0;o<r.length;o++)i.push(ai(t,e,r[o]));return i.join(" ")}}function Oy(t,e){var r=t.mapDimensionsAll("defaultedLabel");if(!ee(e))return e+"";for(var n=[],a=0;a<r.length;a++){var i=t.getDimensionIndex(r[a]);i>=0&&n.push(e[i])}return n.join(" ")}var bh=(function(t){Z(e,t);function e(r,n,a,i){var o=t.call(this)||this;return o.updateData(r,n,a,i),o}return e.prototype._createSymbol=function(r,n,a,i,o){this.removeAll();var s=di(r,-1,-1,2,2,null,o);s.attr({z2:100,culling:!0,scaleX:i[0]/2,scaleY:i[1]/2}),s.drift=nM,this._symbolType=r,this.add(s)},e.prototype.stopSymbolAnimation=function(r){this.childAt(0).stopAnimation(null,r)},e.prototype.getSymbolType=function(){return this._symbolType},e.prototype.getSymbolPath=function(){return this.childAt(0)},e.prototype.highlight=function(){cl(this.childAt(0))},e.prototype.downplay=function(){ul(this.childAt(0))},e.prototype.setZ=function(r,n){var a=this.childAt(0);a.zlevel=r,a.z=n},e.prototype.setDraggable=function(r,n){var a=this.childAt(0);a.draggable=r,a.cursor=!n&&r?"move":a.cursor},e.prototype.updateData=function(r,n,a,i){this.silent=!1;var o=r.getItemVisual(n,"symbol")||"circle",s=r.hostModel,l=e.getSymbolSize(r,n),c=o!==this._symbolType,u=i&&i.disableAnimation;if(c){var f=r.getItemVisual(n,"symbolKeepAspect");this._createSymbol(o,r,n,l,f)}else{var h=this.childAt(0);h.silent=!1;var d={scaleX:l[0]/2,scaleY:l[1]/2};u?h.attr(d):Ut(h,d,s,n),om(h)}if(this._updateCommon(r,n,l,a,i),c){var h=this.childAt(0);if(!u){var d={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:h.style.opacity}};h.scaleX=h.scaleY=0,h.style.opacity=0,Qr(h,d,s,n)}}u&&this.childAt(0).stopAnimation("leave")},e.prototype._updateCommon=function(r,n,a,i,o){var s=this.childAt(0),l=r.hostModel,c,u,f,h,d,p,m,g,v;if(i&&(c=i.emphasisItemStyle,u=i.blurItemStyle,f=i.selectItemStyle,h=i.focus,d=i.blurScope,m=i.labelStatesModels,g=i.hoverScale,v=i.cursorStyle,p=i.emphasisDisabled),!i||r.hasItemOption){var y=i&&i.itemModel?i.itemModel:r.getItemModel(n),b=y.getModel("emphasis");c=b.getModel("itemStyle").getItemStyle(),f=y.getModel(["select","itemStyle"]).getItemStyle(),u=y.getModel(["blur","itemStyle"]).getItemStyle(),h=b.get("focus"),d=b.get("blurScope"),p=b.get("disabled"),m=Ml(y),g=b.getShallow("scale"),v=y.getShallow("cursor")}var x=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=Ey(r.getItemVisual(n,"symbolOffset"),a);S&&(s.x=S[0],s.y=S[1]),v&&s.attr("cursor",v);var w=r.getItemVisual(n,"style"),k=w.fill;if(s instanceof bn){var T=s.style;s.useStyle(U({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(U({},w)):s.useStyle(w),s.style.decal=null,s.setColor(k,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var C=r.getItemVisual(n,"liftZ"),A=this._z2;C!=null?A==null&&(this._z2=s.z2,s.z2+=C):A!=null&&(s.z2=A,this._z2=null);var M=o&&o.useNameLabel;Cl(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:k,defaultOpacity:w.opacity});function I(N){return M?r.getName(N):_h(r,N)}this._sizeX=a[0]/2,this._sizeY=a[1]/2;var L=s.ensureState("emphasis");L.style=c,s.ensureState("select").style=f,s.ensureState("blur").style=u;var P=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;L.scaleX=this._sizeX*P,L.scaleY=this._sizeY*P,this.setSymbolScale(1),fl(this,h,d,p)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,a){var i=this.childAt(0),o=Ve(this).dataIndex,s=a&&a.animation;if(this.silent=i.silent=!0,a&&a.fadeLabel){var l=i.getTextContent();l&&bl(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){i.removeTextContent()}})}else i.removeTextContent();bl(i,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return tM(r.getItemVisual(n,"symbolSize"))},e})(mt);function nM(t,e){this.parent.drift(t,e)}function xh(t,e,r,n){return e&&!isNaN(e[0])&&!isNaN(e[1])&&!(n.isIgnore&&n.isIgnore(r))&&!(n.clipShape&&!n.clipShape.contain(e[0],e[1]))&&t.getItemVisual(r,"symbol")!=="none"}function Ny(t){return t!=null&&!ce(t)&&(t={isIgnore:t}),t||{}}function By(t){var e=t.hostModel,r=e.getModel("emphasis");return{emphasisItemStyle:r.getModel("itemStyle").getItemStyle(),blurItemStyle:e.getModel(["blur","itemStyle"]).getItemStyle(),selectItemStyle:e.getModel(["select","itemStyle"]).getItemStyle(),focus:r.get("focus"),blurScope:r.get("blurScope"),emphasisDisabled:r.get("disabled"),hoverScale:r.get("scale"),labelStatesModels:Ml(e),cursorStyle:e.get("cursor")}}var aM=(function(){function t(e){this.group=new mt,this._SymbolCtor=e||bh}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=Ny(r);var n=this.group,a=e.hostModel,i=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=By(e),c={disableAnimation:s},u=r.getSymbolPoint||function(f){return e.getItemLayout(f)};i||n.removeAll(),e.diff(i).add(function(f){var h=u(f);if(xh(e,h,f,r)){var d=new o(e,f,l,c);d.setPosition(h),e.setItemGraphicEl(f,d),n.add(d)}}).update(function(f,h){var d=i.getItemGraphicEl(h),p=u(f);if(!xh(e,p,f,r)){n.remove(d);return}var m=e.getItemVisual(f,"symbol")||"circle",g=d&&d.getSymbolType&&d.getSymbolType();if(!d||g&&g!==m)n.remove(d),d=new o(e,f,l,c),d.setPosition(p);else{d.updateData(e,f,l,c);var v={x:p[0],y:p[1]};s?d.attr(v):Ut(d,v,a)}n.add(d),e.setItemGraphicEl(f,d)}).remove(function(f){var h=i.getItemGraphicEl(f);h&&h.fadeOut(function(){n.remove(h)},a)}).execute(),this._getSymbolPoint=u,this._data=e},t.prototype.updateLayout=function(){var e=this,r=this._data;r&&r.eachItemGraphicEl(function(n,a){var i=e._getSymbolPoint(a);n.setPosition(i),n.markRedraw()})},t.prototype.incrementalPrepareUpdate=function(e){this._seriesScope=By(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[],n=Ny(n);function a(l){l.isGroup||(l.incremental=!0,l.ensureState("emphasis").hoverLayer=!0)}for(var i=e.start;i<e.end;i++){var o=r.getItemLayout(i);if(xh(r,o,i,n)){var s=new this._SymbolCtor(r,i,this._seriesScope);s.traverse(a),s.setPosition(o),this.group.add(s),r.setItemGraphicEl(i,s),this._progressiveEls.push(s)}}},t.prototype.eachRendered=function(e){kl(this._progressiveEls||this.group,e)},t.prototype.remove=function(e){var r=this.group,n=this._data;n&&e?n.eachItemGraphicEl(function(a){a.fadeOut(function(){r.remove(a)},n.hostModel)}):r.removeAll()},t})();function zy(t,e,r){var n=t.getBaseAxis(),a=t.getOtherAxis(n),i=iM(a,r),o=n.dim,s=a.dim,l=e.mapDimension(s),c=e.mapDimension(o),u=s==="x"||s==="radius"?1:0,f=ue(t.dimensions,function(p){return e.mapDimension(p)}),h=!1,d=e.getCalculationInfo("stackResultDimension");return li(e,f[0])&&(h=!0,f[0]=d),li(e,f[1])&&(h=!0,f[1]=d),{dataDimsForPoint:f,valueStart:i,valueAxisDim:s,baseAxisDim:o,stacked:!!h,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function iM(t,e){var r=0,n=t.scale.getExtent();return e==="start"?r=n[0]:e==="end"?r=n[1]:Ke(e)&&!isNaN(e)?r=e:n[0]>0?r=n[0]:n[1]<0&&(r=n[1]),r}function Fy(t,e,r,n){var a=NaN;t.stacked&&(a=r.get(r.getCalculationInfo("stackedOverDimension"),n)),isNaN(a)&&(a=t.valueStart);var i=t.baseDataOffset,o=[];return o[i]=r.get(t.baseDim,n),o[1-i]=a,e.dataToPoint(o)}var Hy=typeof Float32Array<"u",oM=Hy?Float32Array:Array;function tn(t){return ee(t)?Hy?new Float32Array(t):t:new oM(t)}function sM(t,e){var r=[];return e.diff(t).add(function(n){r.push({cmd:"+",idx:n})}).update(function(n,a){r.push({cmd:"=",idx:a,idx1:n})}).remove(function(n){r.push({cmd:"-",idx:n})}).execute(),r}function lM(t,e,r,n,a,i,o,s){for(var l=sM(t,e),c=[],u=[],f=[],h=[],d=[],p=[],m=[],g=zy(a,e,o),v=t.getLayout("points")||[],y=e.getLayout("points")||[],b=0;b<l.length;b++){var x=l[b],S=!0,w=void 0,k=void 0;switch(x.cmd){case"=":w=x.idx*2,k=x.idx1*2;var T=v[w],C=v[w+1],A=y[k],M=y[k+1];(isNaN(T)||isNaN(C))&&(T=A,C=M),c.push(T,C),u.push(A,M),f.push(r[w],r[w+1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(x.idx1));break;case"+":var I=x.idx,L=g.dataDimsForPoint,P=a.dataToPoint([e.get(L[0],I),e.get(L[1],I)]);k=I*2,c.push(P[0],P[1]),u.push(y[k],y[k+1]);var N=Fy(g,a,e,I);f.push(N[0],N[1]),h.push(n[k],n[k+1]),m.push(e.getRawIndex(I));break;case"-":S=!1}S&&(d.push(x),p.push(p.length))}p.sort(function(we,Ze){return m[we]-m[Ze]});for(var O=c.length,q=tn(O),R=tn(O),z=tn(O),F=tn(O),X=[],b=0;b<p.length;b++){var te=p[b],fe=b*2,me=te*2;q[fe]=c[me],q[fe+1]=c[me+1],R[fe]=u[me],R[fe+1]=u[me+1],z[fe]=f[me],z[fe+1]=f[me+1],F[fe]=h[me],F[fe+1]=h[me+1],X[b]=d[te]}return{current:q,next:R,stackedOnCurrent:z,stackedOnNext:F,status:X}}var Cn=Math.min,Mn=Math.max;function va(t,e){return isNaN(t)||isNaN(e)}function wh(t,e,r,n,a,i,o,s,l){for(var c,u,f,h,d,p,m=r,g=0;g<n;g++){var v=e[m*2],y=e[m*2+1];if(m>=a||m<0)break;if(va(v,y)){if(l){m+=i;continue}break}if(m===r)t[i>0?"moveTo":"lineTo"](v,y),f=v,h=y;else{var b=v-c,x=y-u;if(b*b+x*x<.5){m+=i;continue}if(o>0){for(var S=m+i,w=e[S*2],k=e[S*2+1];w===v&&k===y&&g<n;)g++,S+=i,m+=i,w=e[S*2],k=e[S*2+1],v=e[m*2],y=e[m*2+1],b=v-c,x=y-u;var T=g+1;if(l)for(;va(w,k)&&T<n;)T++,S+=i,w=e[S*2],k=e[S*2+1];var C=.5,A=0,M=0,I=void 0,L=void 0;if(T>=n||va(w,k))d=v,p=y;else{A=w-c,M=k-u;var P=v-c,N=w-v,O=y-u,q=k-y,R=void 0,z=void 0;if(s==="x"){R=Math.abs(P),z=Math.abs(N);var F=A>0?1:-1;d=v-F*R*o,p=y,I=v+F*z*o,L=y}else if(s==="y"){R=Math.abs(O),z=Math.abs(q);var X=M>0?1:-1;d=v,p=y-X*R*o,I=v,L=y+X*z*o}else R=Math.sqrt(P*P+O*O),z=Math.sqrt(N*N+q*q),C=z/(z+R),d=v-A*o*(1-C),p=y-M*o*(1-C),I=v+A*o*C,L=y+M*o*C,I=Cn(I,Mn(w,v)),L=Cn(L,Mn(k,y)),I=Mn(I,Cn(w,v)),L=Mn(L,Cn(k,y)),A=I-v,M=L-y,d=v-A*R/z,p=y-M*R/z,d=Cn(d,Mn(c,v)),p=Cn(p,Mn(u,y)),d=Mn(d,Cn(c,v)),p=Mn(p,Cn(u,y)),A=v-d,M=y-p,I=v+A*z/R,L=y+M*z/R}t.bezierCurveTo(f,h,d,p,v,y),f=I,h=L}else t.lineTo(v,y)}c=v,u=y,m+=i}return g}var Vy=(function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t})(),cM=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polyline",n}return e.prototype.getDefaultStyle=function(){return{stroke:"#000",fill:null}},e.prototype.getDefaultShape=function(){return new Vy},e.prototype.buildPath=function(r,n){var a=n.points,i=0,o=a.length/2;if(n.connectNulls){for(;o>0&&va(a[o*2-2],a[o*2-1]);o--);for(;i<o&&va(a[i*2],a[i*2+1]);i++);}for(;i<o;)i+=wh(r,a,i,o,o,1,n.smooth,n.smoothMonotone,n.connectNulls)+1},e.prototype.getPointOn=function(r,n){this.path||(this.createPathProxy(),this.buildPath(this.path,this.shape));for(var a=this.path,i=a.data,o=ta.CMD,s,l,c=n==="x",u=[],f=0;f<i.length;){var h=i[f++],d=void 0,p=void 0,m=void 0,g=void 0,v=void 0,y=void 0,b=void 0;switch(h){case o.M:s=i[f++],l=i[f++];break;case o.L:if(d=i[f++],p=i[f++],b=c?(r-s)/(d-s):(r-l)/(p-l),b<=1&&b>=0){var x=c?(p-l)*b+l:(d-s)*b+s;return c?[r,x]:[x,r]}s=d,l=p;break;case o.C:d=i[f++],p=i[f++],m=i[f++],g=i[f++],v=i[f++],y=i[f++];var S=c?Os(s,d,m,v,r,u):Os(l,p,g,y,r,u);if(S>0)for(var w=0;w<S;w++){var k=u[w];if(k<=1&&k>=0){var x=c?gt(l,p,g,y,k):gt(s,d,m,v,k);return c?[r,x]:[x,r]}}s=v,l=y;break}}},e})($e),uM=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Vy),fM=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="ec-polygon",n}return e.prototype.getDefaultShape=function(){return new uM},e.prototype.buildPath=function(r,n){var a=n.points,i=n.stackedOnPoints,o=0,s=a.length/2,l=n.smoothMonotone;if(n.connectNulls){for(;s>0&&va(a[s*2-2],a[s*2-1]);s--);for(;o<s&&va(a[o*2],a[o*2+1]);o++);}for(;o<s;){var c=wh(r,a,o,s,s,1,n.smooth,l,n.connectNulls);wh(r,i,o+c-1,c,s,-1,n.stackedOnSmooth,l,n.connectNulls),o+=c+1,r.closePath()}},e})($e);function Sh(){var t=it();return function(e){var r=t(e),n=e.pipelineContext,a=!!r.large,i=!!r.progressiveRender,o=r.large=!!(n&&n.large),s=r.progressiveRender=!!(n&&n.progressiveRender);return(a!==o||i!==s)&&"reset"}}var Gy=it(),hM=Sh(),dr=(function(){function t(){this.group=new mt,this.uid=El("viewChart"),this.renderTask=To({plan:dM,reset:pM}),this.renderTask.context={view:this}}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.highlight=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Wy(i,a,"emphasis")},t.prototype.downplay=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Wy(i,a,"normal")},t.prototype.remove=function(e,r){this.group.removeAll()},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateLayout=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.updateVisual=function(e,r,n,a){this.render(e,r,n,a)},t.prototype.eachRendered=function(e){kl(this.group,e)},t.markUpdateMethod=function(e,r){Gy(e).updateMethod=r},t.protoInitialize=(function(){var e=t.prototype;e.type="chart"})(),t})();function $y(t,e,r){t&&wf(t)&&(e==="emphasis"?cl:ul)(t,r)}function Wy(t,e,r){var n=oa(t,e),a=e&&e.highlightKey!=null?eT(e.highlightKey):null;n!=null?D(_t(n),function(i){$y(t.getItemGraphicEl(i),r,a)}):t.eachItemGraphicEl(function(i){$y(i,r,a)})}_u(dr),Ms(dr);function dM(t){return hM(t.model)}function pM(t){var e=t.model,r=t.ecModel,n=t.api,a=t.payload,i=e.pipelineContext.progressiveRender,o=t.view,s=a&&Gy(a).updateMethod,l=i?"incrementalPrepareRender":s&&o[s]?s:"render";return l!=="render"&&o[l](e,r,n,a),vM[l]}var vM={incrementalPrepareRender:{progress:function(t,e){e.view.incrementalRender(t,e.model,e.ecModel,e.api,e.payload)}},render:{forceFirstProgress:!0,progress:function(t,e){e.view.render(e.model,e.ecModel,e.api,e.payload)}}};function Uy(t,e,r,n,a){var i=t.getArea(),o=i.x,s=i.y,l=i.width,c=i.height,u=r.get(["lineStyle","width"])||0;o-=u/2,s-=u/2,l+=u,c+=u,l=Math.ceil(l),o!==Math.floor(o)&&(o=Math.floor(o),l++);var f=new ft({shape:{x:o,y:s,width:l,height:c}});if(e){var h=t.getBaseAxis(),d=h.isHorizontal(),p=h.inverse;d?(p&&(f.shape.x+=l),f.shape.width=0):(p||(f.shape.y+=c),f.shape.height=0);var m=ye(a)?function(g){a(g,f)}:null;Qr(f,{shape:{width:l,height:c,x:o,y:s}},r,null,n,m)}return f}function Yy(t,e,r){var n=t.getArea(),a=lt(n.r0,1),i=lt(n.r,1),o=new ti({shape:{cx:lt(t.cx,1),cy:lt(t.cy,1),r0:a,r:i,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}});if(e){var s=t.getBaseAxis().dim==="angle";s?o.shape.endAngle=n.startAngle:o.shape.r=a,Qr(o,{shape:{endAngle:n.endAngle,r:i}},r)}return o}function gM(t,e,r,n,a){if(t){if(t.type==="polar")return Yy(t,e,r);if(t.type==="cartesian2d")return Uy(t,e,r,n,a)}else return null;return null}function kh(t,e){return t.type===e}function qy(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function Xy(t){for(var e=1/0,r=1/0,n=-1/0,a=-1/0,i=0;i<t.length;){var o=t[i++],s=t[i++];isNaN(o)||(e=Math.min(o,e),n=Math.max(o,n)),isNaN(s)||(r=Math.min(s,r),a=Math.max(s,a))}return[[e,r],[n,a]]}function Zy(t,e){var r=Xy(t),n=r[0],a=r[1],i=Xy(e),o=i[0],s=i[1];return Math.max(Math.abs(n[0]-o[0]),Math.abs(n[1]-o[1]),Math.abs(a[0]-s[0]),Math.abs(a[1]-s[1]))}function Ky(t){return Ke(t)?t:t?.5:0}function mM(t,e,r){if(!r.valueDim)return[];for(var n=e.count(),a=tn(n*2),i=0;i<n;i++){var o=Fy(r,t,e,i);a[i*2]=o[0],a[i*2+1]=o[1]}return a}function An(t,e,r,n,a){var i=r.getBaseAxis(),o=i.dim==="x"||i.dim==="radius"?0:1,s=[],l=0,c=[],u=[],f=[],h=[];if(a){for(l=0;l<t.length;l+=2){var d=e||t;!isNaN(d[l])&&!isNaN(d[l+1])&&h.push(t[l],t[l+1])}t=h}for(l=0;l<t.length-2;l+=2)switch(f[0]=t[l+2],f[1]=t[l+3],u[0]=t[l],u[1]=t[l+1],s.push(u[0],u[1]),n){case"end":c[o]=f[o],c[1-o]=u[1-o],s.push(c[0],c[1]);break;case"middle":var p=(u[o]+f[o])/2,m=[];c[o]=m[o]=p,c[1-o]=u[1-o],m[1-o]=f[1-o],s.push(c[0],c[1]),s.push(m[0],m[1]);break;default:c[o]=u[o],c[1-o]=f[1-o],s.push(c[0],c[1])}return s.push(t[l++],t[l++]),s}function yM(t,e){var r=[],n=t.length,a,i;function o(u,f,h){var d=u.coord,p=(h-d)/(f.coord-d),m=bS(p,[u.color,f.color]);return{coord:h,color:m}}for(var s=0;s<n;s++){var l=t[s],c=l.coord;if(c<0)a=l;else if(c>e){i?r.push(o(i,l,e)):a&&r.push(o(a,l,0),o(a,l,e));break}else a&&(r.push(o(a,l,0)),a=null),r.push(l),i=l}return r}function _M(t,e,r){var n=t.getVisual("visualMeta");if(!(!n||!n.length||!t.count())&&e.type==="cartesian2d"){for(var a,i,o=n.length-1;o>=0;o--){var s=t.getDimensionInfo(n[o].dimension);if(a=s&&s.coordDim,a==="x"||a==="y"){i=n[o];break}}if(i){var l=e.getAxis(a),c=ue(i.stops,function(b){return{coord:l.toGlobalCoord(l.dataToCoord(b.value)),color:b.color}}),u=c.length,f=i.outerColors.slice();u&&c[0].coord>c[u-1].coord&&(c.reverse(),f.reverse());var h=yM(c,a==="x"?r.getWidth():r.getHeight()),d=h.length;if(!d&&u)return c[0].coord<0?f[1]?f[1]:c[u-1].color:f[0]?f[0]:c[0].color;var p=10,m=h[0].coord-p,g=h[d-1].coord+p,v=g-m;if(v<.001)return"transparent";D(h,function(b){b.offset=(b.coord-m)/v}),h.push({offset:d?h[d-1].offset:.5,color:f[1]||"transparent"}),h.unshift({offset:d?h[0].offset:.5,color:f[0]||"transparent"});var y=new am(0,0,0,0,h,!0);return y[a]=m,y[a+"2"]=g,y}}}function bM(t,e,r){var n=t.get("showAllSymbol"),a=n==="auto";if(!(n&&!a)){var i=r.getAxesByScale("ordinal")[0];if(i&&!(a&&xM(i,e))){var o=e.mapDimension(i.dim),s={};return D(i.getViewLabels(),function(l){var c=i.scale.getRawOrdinalNumber(l.tickValue);s[c]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function xM(t,e){var r=t.getExtent(),n=Math.abs(r[1]-r[0])/t.scale.count();isNaN(n)&&(n=0);for(var a=e.count(),i=Math.max(1,Math.round(a/5)),o=0;o<a;o+=i)if(bh.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>n)return!1;return!0}function wM(t,e){return isNaN(t)||isNaN(e)}function SM(t){for(var e=t.length/2;e>0&&wM(t[e*2-2],t[e*2-1]);e--);return e-1}function jy(t,e){return[t[e*2],t[e*2+1]]}function kM(t,e,r){for(var n=t.length/2,a=r==="x"?0:1,i,o,s=0,l=-1,c=0;c<n;c++)if(o=t[c*2+a],!(isNaN(o)||isNaN(t[c*2+1-a]))){if(c===0){i=o;continue}if(i<=e&&o>=e||i>=e&&o<=e){l=c;break}s=c,i=o}return{range:[s,l],t:(e-i)/(o-i)}}function Qy(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Er.length;e++)if(t.get([Er[e],"endLabel","show"]))return!0;return!1}function Th(t,e,r,n){if(kh(e,"cartesian2d")){var a=n.getModel("endLabel"),i=a.get("valueAnimation"),o=n.getData(),s={lastFrameIndex:0},l=Qy(n)?function(d,p){t._endLabelOnDuring(d,p,o,s,i,a,e)}:null,c=e.getBaseAxis().isHorizontal(),u=Uy(e,r,n,function(){var d=t._endLabel;d&&r&&s.originalX!=null&&d.attr({x:s.originalX,y:s.originalY})},l);if(!n.get("clip",!0)){var f=u.shape,h=Math.max(f.width,f.height);c?(f.y-=h,f.height+=h*2):(f.x-=h,f.width+=h*2)}return l&&l(1,u),u}else return Yy(e,r,n)}function TM(t,e){var r=e.getBaseAxis(),n=r.isHorizontal(),a=r.inverse,i=n?a?"right":"left":"center",o=n?"middle":a?"top":"bottom";return{normal:{align:t.get("align")||i,verticalAlign:t.get("verticalAlign")||o}}}var CM=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new mt,n=new aM;this.group.add(n.group),this._symbolDraw=n,this._lineGroup=r,this._changePolyState=Le(this._changePolyState,this)},e.prototype.render=function(r,n,a){var i=r.coordinateSystem,o=this.group,s=r.getData(),l=r.getModel("lineStyle"),c=r.getModel("areaStyle"),u=s.getLayout("points")||[],f=i.type==="polar",h=this._coordSys,d=this._symbolDraw,p=this._polyline,m=this._polygon,g=this._lineGroup,v=!n.ssr&&r.get("animation"),y=!c.isEmpty(),b=c.get("origin"),x=zy(i,s,b),S=y&&mM(i,s,x),w=r.get("showSymbol"),k=r.get("connectNulls"),T=w&&!f&&bM(r,s,i),C=this._data;C&&C.eachItemGraphicEl(function(we,Ze){we.__temp&&(o.remove(we),C.setItemGraphicEl(Ze,null))}),w||d.remove(),o.add(g);var A=f?!1:r.get("step"),M;i&&i.getArea&&r.get("clip",!0)&&(M=i.getArea(),M.width!=null?(M.x-=.1,M.y-=.1,M.width+=.2,M.height+=.2):M.r0&&(M.r0-=.5,M.r+=.5)),this._clipShapeForSymbol=M;var I=_M(s,i,a)||s.getVisual("style")[s.getVisual("drawType")];if(!(p&&h.type===i.type&&A===this._step))w&&d.updateData(s,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(we){return[u[we*2],u[we*2+1]]}}),v&&this._initSymbolLabelAnimation(s,i,M),A&&(S&&(S=An(S,u,i,A,k)),u=An(u,null,i,A,k)),p=this._newPolyline(u),y?m=this._newPolygon(u,S):m&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,pa(I)),g.setClipPath(Th(this,i,!0,r));else{y&&!m?m=this._newPolygon(u,S):m&&!y&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,pa(I));var L=g.getClipPath();if(L){var P=Th(this,i,!1,r);Qr(L,{shape:P.shape},r)}else g.setClipPath(Th(this,i,!0,r));w&&d.updateData(s,{isIgnore:T,clipShape:M,disableAnimation:!0,getSymbolPoint:function(we){return[u[we*2],u[we*2+1]]}}),(!qy(this._stackedOnPoints,S)||!qy(this._points,u))&&(v?this._doUpdateAnimation(s,S,i,a,A,b,k):(A&&(S&&(S=An(S,u,i,A,k)),u=An(u,null,i,A,k)),p.setShape({points:u}),m&&m.setShape({points:u,stackedOnPoints:S})))}var N=r.getModel("emphasis"),O=N.get("focus"),q=N.get("blurScope"),R=N.get("disabled");if(p.useStyle(Ne(l.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),xf(p,r,"lineStyle"),p.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var z=p.getState("emphasis").style;z.lineWidth=+p.style.lineWidth+1}Ve(p).seriesIndex=r.seriesIndex,fl(p,O,q,R);var F=Ky(r.get("smooth")),X=r.get("smoothMonotone");if(p.setShape({smooth:F,smoothMonotone:X,connectNulls:k}),m){var te=s.getCalculationInfo("stackedOnSeries"),fe=0;m.useStyle(Ne(c.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),te&&(fe=Ky(te.get("smooth"))),m.setShape({smooth:F,stackedOnSmooth:fe,smoothMonotone:X,connectNulls:k}),xf(m,r,"areaStyle"),Ve(m).seriesIndex=r.seriesIndex,fl(m,O,q,R)}var me=this._changePolyState;s.eachItemGraphicEl(function(we){we&&(we.onHoverStateChange=me)}),this._polyline.onHoverStateChange=me,this._data=s,this._coordSys=i,this._stackedOnPoints=S,this._points=u,this._step=A,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,p),m&&this.packEventData(r,m))},e.prototype.packEventData=function(r,n){Ve(n).eventData={componentType:"series",componentSubType:"line",componentIndex:r.componentIndex,seriesIndex:r.seriesIndex,seriesName:r.name,seriesType:"line"}},e.prototype.highlight=function(r,n,a,i){var o=r.getData(),s=oa(o,i);if(this._changePolyState("emphasis"),!(s instanceof Array)&&s!=null&&s>=0){var l=o.getLayout("points"),c=o.getItemGraphicEl(s);if(!c){var u=l[s*2],f=l[s*2+1];if(isNaN(u)||isNaN(f)||this._clipShapeForSymbol&&!this._clipShapeForSymbol.contain(u,f))return;var h=r.get("zlevel")||0,d=r.get("z")||0;c=new bh(o,s),c.x=u,c.y=f,c.setZ(h,d);var p=c.getSymbolPath().getTextContent();p&&(p.zlevel=h,p.z=d,p.z2=this._polyline.z2+1),c.__temp=!0,o.setItemGraphicEl(s,c),c.stopSymbolAnimation(!0),this.group.add(c)}c.highlight()}else dr.prototype.highlight.call(this,r,n,a,i)},e.prototype.downplay=function(r,n,a,i){var o=r.getData(),s=oa(o,i);if(this._changePolyState("normal"),s!=null&&s>=0){var l=o.getItemGraphicEl(s);l&&(l.__temp?(o.setItemGraphicEl(s,null),this.group.remove(l)):l.downplay())}else dr.prototype.downplay.call(this,r,n,a,i)},e.prototype._changePolyState=function(r){var n=this._polygon;Eg(this._polyline,r),n&&Eg(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new cM({shape:{points:r},segmentIgnoreThreshold:2,z2:10}),this._lineGroup.add(n),this._polyline=n,n},e.prototype._newPolygon=function(r,n){var a=this._polygon;return a&&this._lineGroup.remove(a),a=new fM({shape:{points:r,stackedOnPoints:n},segmentIgnoreThreshold:2}),this._lineGroup.add(a),this._polygon=a,a},e.prototype._initSymbolLabelAnimation=function(r,n,a){var i,o,s=n.getBaseAxis(),l=s.inverse;n.type==="cartesian2d"?(i=s.isHorizontal(),o=!1):n.type==="polar"&&(i=s.dim==="angle",o=!0);var c=r.hostModel,u=c.get("animationDuration");ye(u)&&(u=u(null));var f=c.get("animationDelay")||0,h=ye(f)?f(null):f;r.eachItemGraphicEl(function(d,p){var m=d;if(m){var g=[d.x,d.y],v=void 0,y=void 0,b=void 0;if(a)if(o){var x=a,S=n.pointToCoord(g);i?(v=x.startAngle,y=x.endAngle,b=-S[1]/180*Math.PI):(v=x.r0,y=x.r,b=S[0])}else{var w=a;i?(v=w.x,y=w.x+w.width,b=d.x):(v=w.y+w.height,y=w.y,b=d.y)}var k=y===v?0:(b-v)/(y-v);l&&(k=1-k);var T=ye(f)?f(p):u*k+h,C=m.getSymbolPath(),A=C.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),A&&A.animateFrom({style:{opacity:0}},{duration:300,delay:T}),C.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,a){var i=r.getModel("endLabel");if(Qy(r)){var o=r.getData(),s=this._polyline,l=o.getLayout("points");if(!l){s.removeTextContent(),this._endLabel=null;return}var c=this._endLabel;c||(c=this._endLabel=new Pt({z2:200}),c.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var u=SM(l);u>=0&&(Cl(s,Ml(r,"endLabel"),{inheritColor:a,labelFetcher:r,labelDataIndex:u,defaultText:function(f,h,d){return d!=null?Oy(o,d):_h(o,f)},enableTextSetter:!0},TM(i,n)),s.textConfig.position=null)}else this._endLabel&&(this._polyline.removeTextContent(),this._endLabel=null)},e.prototype._endLabelOnDuring=function(r,n,a,i,o,s,l){var c=this._endLabel,u=this._polyline;if(c){r<1&&i.originalX==null&&(i.originalX=c.x,i.originalY=c.y);var f=a.getLayout("points"),h=a.hostModel,d=h.get("connectNulls"),p=s.get("precision"),m=s.get("distance")||0,g=l.getBaseAxis(),v=g.isHorizontal(),y=g.inverse,b=n.shape,x=y?v?b.x:b.y+b.height:v?b.x+b.width:b.y,S=(v?m:0)*(y?-1:1),w=(v?0:-m)*(y?-1:1),k=v?"x":"y",T=kM(f,x,k),C=T.range,A=C[1]-C[0],M=void 0;if(A>=1){if(A>1&&!d){var I=jy(f,C[0]);c.attr({x:I[0]+S,y:I[1]+w}),o&&(M=h.getRawValue(C[0]))}else{var I=u.getPointOn(x,k);I&&c.attr({x:I[0]+S,y:I[1]+w});var L=h.getRawValue(C[0]),P=h.getRawValue(C[1]);o&&(M=Ek(a,p,L,P,T.t))}i.lastFrameIndex=C[0]}else{var N=r===1||i.lastFrameIndex>0?C[0]:0,I=jy(f,N);o&&(M=h.getRawValue(N)),c.attr({x:I[0]+S,y:I[1]+w})}if(o){var O=Al(c);typeof O.setLabelText=="function"&&O.setLabelText(M)}}},e.prototype._doUpdateAnimation=function(r,n,a,i,o,s,l){var c=this._polyline,u=this._polygon,f=r.hostModel,h=lM(this._data,r,this._stackedOnPoints,n,this._coordSys,a,this._valueOrigin),d=h.current,p=h.stackedOnCurrent,m=h.next,g=h.stackedOnNext;if(o&&(p=An(h.stackedOnCurrent,h.current,a,o,l),d=An(h.current,null,a,o,l),g=An(h.stackedOnNext,h.next,a,o,l),m=An(h.next,null,a,o,l)),Zy(d,m)>3e3||u&&Zy(p,g)>3e3){c.stopAnimation(),c.setShape({points:m}),u&&(u.stopAnimation(),u.setShape({points:m,stackedOnPoints:g}));return}c.shape.__points=h.current,c.shape.points=d;var v={shape:{points:m}};h.current!==d&&(v.shape.__points=h.next),c.stopAnimation(),Ut(c,v,f),u&&(u.setShape({points:d,stackedOnPoints:p}),u.stopAnimation(),Ut(u,{shape:{stackedOnPoints:g}},f),c.shape.points!==u.shape.points&&(u.shape.points=c.shape.points));for(var y=[],b=h.status,x=0;x<b.length;x++){var S=b[x].cmd;if(S==="="){var w=r.getItemGraphicEl(b[x].idx1);w&&y.push({el:w,ptIdx:x})}}c.animators&&c.animators.length&&c.animators[0].during(function(){u&&u.dirtyShape();for(var k=c.shape.__points,T=0;T<y.length;T++){var C=y[T].el,A=y[T].ptIdx*2;C.x=k[A],C.y=k[A+1],C.markRedraw()}})},e.prototype.remove=function(r){var n=this.group,a=this._data;this._lineGroup.removeAll(),this._symbolDraw.remove(!0),a&&a.eachItemGraphicEl(function(i,o){i.__temp&&(n.remove(i),a.setItemGraphicEl(o,null))}),this._polyline=this._polygon=this._coordSys=this._points=this._stackedOnPoints=this._endLabel=this._data=null},e.type="line",e})(dr);function MM(t,e){return{seriesType:t,plan:Sh(),reset:function(r){var n=r.getData(),a=r.coordinateSystem;if(r.pipelineContext,!!a){var i=ue(a.dimensions,function(f){return n.mapDimension(f)}).slice(0,2),o=i.length,s=n.getCalculationInfo("stackResultDimension");li(n,i[0])&&(i[0]=s),li(n,i[1])&&(i[1]=s);var l=n.getStore(),c=n.getDimensionIndex(i[0]),u=n.getDimensionIndex(i[1]);return o&&{progress:function(f,h){for(var d=f.end-f.start,p=tn(d*o),m=[],g=[],v=f.start,y=0;v<f.end;v++){var b=void 0;if(o===1){var x=l.get(c,v);b=a.dataToPoint(x,null,g)}else m[0]=l.get(c,v),m[1]=l.get(u,v),b=a.dataToPoint(m,null,g);p[y++]=b[0],p[y++]=b[1]}h.setLayout("points",p)}}}}}}var AM={average:function(t){for(var e=0,r=0,n=0;n<t.length;n++)isNaN(t[n])||(e+=t[n],r++);return r===0?NaN:e/r},sum:function(t){for(var e=0,r=0;r<t.length;r++)e+=t[r]||0;return e},max:function(t){for(var e=-1/0,r=0;r<t.length;r++)t[r]>e&&(e=t[r]);return isFinite(e)?e:NaN},min:function(t){for(var e=1/0,r=0;r<t.length;r++)t[r]<e&&(e=t[r]);return isFinite(e)?e:NaN},nearest:function(t){return t[0]}},DM=function(t){return Math.round(t.length/2)};function Jy(t){return{seriesType:t,reset:function(e,r,n){var a=e.getData(),i=e.get("sampling"),o=e.coordinateSystem,s=a.count();if(s>10&&o.type==="cartesian2d"&&i){var l=o.getBaseAxis(),c=o.getOtherAxis(l),u=l.getExtent(),f=n.getDevicePixelRatio(),h=Math.abs(u[1]-u[0])*(f||1),d=Math.round(s/h);if(isFinite(d)&&d>1){i==="lttb"?e.setData(a.lttbDownSample(a.mapDimension(c.dim),1/d)):i==="minmax"&&e.setData(a.minmaxDownSample(a.mapDimension(c.dim),1/d));var p=void 0;ne(i)?p=AM[i]:ye(i)&&(p=i),p&&e.setData(a.downSample(a.mapDimension(c.dim),1/d,p,DM))}}}}}function IM(t){t.registerChartView(CM),t.registerSeriesModel(rM),t.registerLayout(MM("line")),t.registerVisual({seriesType:"line",reset:function(e){var r=e.getData(),n=e.getModel("lineStyle").getLineStyle();n&&!n.stroke&&(n.stroke=r.getVisual("style").fill),r.setVisual("legendLineStyle",n)}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Jy("line"))}var LM="__ec_stack_";function e0(t){return t.get("stack")||LM+t.seriesIndex}function Ch(t){return t.dim+t.index}function t0(t,e){var r=[];return e.eachSeriesByType(t,function(n){n0(n)&&r.push(n)}),r}function PM(t){var e={};D(t,function(l){var c=l.coordinateSystem,u=c.getBaseAxis();if(!(u.type!=="time"&&u.type!=="value"))for(var f=l.getData(),h=u.dim+"_"+u.index,d=f.getDimensionIndex(f.mapDimension(u.dim)),p=f.getStore(),m=0,g=p.count();m<g;++m){var v=p.get(d,m);e[h]?e[h].push(v):e[h]=[v]}});var r={};for(var n in e)if(e.hasOwnProperty(n)){var a=e[n];if(a){a.sort(function(l,c){return l-c});for(var i=null,o=1;o<a.length;++o){var s=a[o]-a[o-1];s>0&&(i=i===null?s:Math.min(i,s))}r[n]=i}}return r}function r0(t){var e=PM(t),r=[];return D(t,function(n){var a=n.coordinateSystem,i=a.getBaseAxis(),o=i.getExtent(),s;if(i.type==="category")s=i.getBandWidth();else if(i.type==="value"||i.type==="time"){var l=i.dim+"_"+i.index,c=e[l],u=Math.abs(o[1]-o[0]),f=i.scale.getExtent(),h=Math.abs(f[1]-f[0]);s=c?u/h*c:u}else{var d=n.getData();s=Math.abs(o[1]-o[0])/d.count()}var p=At(n.get("barWidth"),s),m=At(n.get("barMaxWidth"),s),g=At(n.get("barMinWidth")||(a0(n)?.5:1),s),v=n.get("barGap"),y=n.get("barCategoryGap");r.push({bandWidth:s,barWidth:p,barMaxWidth:m,barMinWidth:g,barGap:v,barCategoryGap:y,axisKey:Ch(i),stackId:e0(n)})}),RM(r)}function RM(t){var e={};D(t,function(n,a){var i=n.axisKey,o=n.bandWidth,s=e[i]||{bandWidth:o,remainedWidth:o,autoWidthCount:0,categoryGap:null,gap:"20%",stacks:{}},l=s.stacks;e[i]=s;var c=n.stackId;l[c]||s.autoWidthCount++,l[c]=l[c]||{width:0,maxWidth:0};var u=n.barWidth;u&&!l[c].width&&(l[c].width=u,u=Math.min(s.remainedWidth,u),s.remainedWidth-=u);var f=n.barMaxWidth;f&&(l[c].maxWidth=f);var h=n.barMinWidth;h&&(l[c].minWidth=h);var d=n.barGap;d!=null&&(s.gap=d);var p=n.barCategoryGap;p!=null&&(s.categoryGap=p)});var r={};return D(e,function(n,a){r[a]={};var i=n.stacks,o=n.bandWidth,s=n.categoryGap;if(s==null){var l=Qe(i).length;s=Math.max(35-l*4,15)+"%"}var c=At(s,o),u=At(n.gap,1),f=n.remainedWidth,h=n.autoWidthCount,d=(f-c)/(h+(h-1)*u);d=Math.max(d,0),D(i,function(v){var y=v.maxWidth,b=v.minWidth;if(v.width){var x=v.width;y&&(x=Math.min(x,y)),b&&(x=Math.max(x,b)),v.width=x,f-=x+u*x,h--}else{var x=d;y&&y<x&&(x=Math.min(y,f)),b&&b>x&&(x=b),x!==d&&(v.width=x,f-=x+u*x,h--)}}),d=(f-c)/(h+(h-1)*u),d=Math.max(d,0);var p=0,m;D(i,function(v,y){v.width||(v.width=d),m=v,p+=v.width*(1+u)}),m&&(p-=m.width*u);var g=-p/2;D(i,function(v,y){r[a][y]=r[a][y]||{bandWidth:o,offset:g,width:v.width},g+=v.width*(1+u)})}),r}function EM(t,e,r){if(t&&e){var n=t[Ch(e)];return n}}function OM(t,e){var r=t0(t,e),n=r0(r);D(r,function(a){var i=a.getData(),o=a.coordinateSystem,s=o.getBaseAxis(),l=e0(a),c=n[Ch(s)][l],u=c.offset,f=c.width;i.setLayout({bandWidth:c.bandWidth,offset:u,size:f})})}function NM(t){return{seriesType:t,plan:Sh(),reset:function(e){if(n0(e)){var r=e.getData(),n=e.coordinateSystem,a=n.getBaseAxis(),i=n.getOtherAxis(a),o=r.getDimensionIndex(r.mapDimension(i.dim)),s=r.getDimensionIndex(r.mapDimension(a.dim)),l=e.get("showBackground",!0),c=r.mapDimension(i.dim),u=r.getCalculationInfo("stackResultDimension"),f=li(r,c)&&!!r.getCalculationInfo("stackedOnSeries"),h=i.isHorizontal(),d=BM(a,i),p=a0(e),m=e.get("barMinHeight")||0,g=u&&r.getDimensionIndex(u),v=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(b,x){for(var S=b.count,w=p&&tn(S*3),k=p&&l&&tn(S*3),T=p&&tn(S),C=n.master.getRect(),A=h?C.width:C.height,M,I=x.getStore(),L=0;(M=b.next())!=null;){var P=I.get(f?g:o,M),N=I.get(s,M),O=d,q=void 0;f&&(q=+P-I.get(o,M));var R=void 0,z=void 0,F=void 0,X=void 0;if(h){var te=n.dataToPoint([P,N]);if(f){var fe=n.dataToPoint([q,N]);O=fe[0]}R=O,z=te[1]+y,F=te[0]-O,X=v,Math.abs(F)<m&&(F=(F<0?-1:1)*m)}else{var te=n.dataToPoint([N,P]);if(f){var fe=n.dataToPoint([N,q]);O=fe[1]}R=te[0]+y,z=O,F=v,X=te[1]-O,Math.abs(X)<m&&(X=(X<=0?-1:1)*m)}p?(w[L]=R,w[L+1]=z,w[L+2]=h?F:X,k&&(k[L]=h?C.x:R,k[L+1]=h?z:C.y,k[L+2]=A),T[M]=M):x.setItemLayout(M,{x:R,y:z,width:F,height:X}),L+=3}p&&x.setLayout({largePoints:w,largeDataIndices:T,largeBackgroundPoints:k,valueAxisHorizontal:h})}}}}}}function n0(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function a0(t){return t.pipelineContext&&t.pipelineContext.large}function BM(t,e){var r=e.model.get("startValue");return r||(r=0),e.toGlobalCoord(e.dataToCoord(e.type==="log"?r>0?r:1:r))}var Mh=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(r,n){return Qf(null,this,{useEncodeDefaulter:!0})},e.prototype.getMarkerPosition=function(r,n,a){var i=this.coordinateSystem;if(i&&i.clampData){var o=i.clampData(r),s=i.dataToPoint(o);if(a)D(i.getAxes(),function(h,d){if(h.type==="category"&&n!=null){var p=h.getTicksCoords(),m=h.getTickModel().get("alignWithLabel"),g=o[d],v=n[d]==="x1"||n[d]==="y1";if(v&&!m&&(g+=1),p.length<2)return;if(p.length===2){s[d]=h.toGlobalCoord(h.getExtent()[v?1:0]);return}for(var y=void 0,b=void 0,x=1,S=0;S<p.length;S++){var w=p[S].coord,k=S===p.length-1?p[S-1].tickValue+x:p[S].tickValue;if(k===g){b=w;break}else if(k<g)y=w;else if(y!=null&&k>g){b=(w+y)/2;break}S===1&&(x=k-p[0].tickValue)}b==null&&(y?y&&(b=p[p.length-1].coord):b=p[0].coord),s[d]=h.toGlobalCoord(b)}});else{var l=this.getData(),c=l.getLayout("offset"),u=l.getLayout("size"),f=i.getBaseAxis().isHorizontal()?0:1;s[f]+=c+u/2}return s}return[NaN,NaN]},e.type="series.__base_bar__",e.defaultOption={z:2,coordinateSystem:"cartesian2d",legendHoverLink:!0,barMinHeight:0,barMinAngle:0,large:!1,largeThreshold:400,progressive:3e3,progressiveChunkMode:"mod"},e})(Br);Br.registerClass(Mh);var zM=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.getInitialData=function(){return Qf(null,this,{useEncodeDefaulter:!0,createInvertedIndices:!!this.get("realtimeSort",!0)||null})},e.prototype.getProgressive=function(){return this.get("large")?this.get("progressive"):!1},e.prototype.getProgressiveThreshold=function(){var r=this.get("progressiveThreshold"),n=this.get("largeThreshold");return n>r&&(r=n),r},e.prototype.brushSelector=function(r,n,a){return a.rect(n.getItemLayout(r))},e.type="series.bar",e.dependencies=["grid","polar"],e.defaultOption=Jf(Mh.defaultOption,{clip:!0,roundCap:!1,showBackground:!1,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)",borderColor:null,borderWidth:0,borderType:"solid",borderRadius:0,shadowBlur:0,shadowColor:null,shadowOffsetX:0,shadowOffsetY:0,opacity:1},select:{itemStyle:{borderColor:"#212121"}},realtimeSort:!1}),e})(Mh),Kl="\0__throttleOriginMethod",i0="\0__throttleRate",o0="\0__throttleType";function Ah(t,e,r){var n,a=0,i=0,o=null,s,l,c,u;e=e||0;function f(){i=new Date().getTime(),o=null,t.apply(l,c||[])}var h=function(){for(var d=[],p=0;p<arguments.length;p++)d[p]=arguments[p];n=new Date().getTime(),l=this,c=d;var m=u||e,g=u||r;u=null,s=n-(g?a:i)-m,clearTimeout(o),g?o=setTimeout(f,m):s>=0?f():o=setTimeout(f,-s),a=n};return h.clear=function(){o&&(clearTimeout(o),o=null)},h.debounceNextCall=function(d){u=d},h}function Dh(t,e,r,n){var a=t[e];if(a){var i=a[Kl]||a,o=a[o0],s=a[i0];if(s!==r||o!==n){if(r==null||!n)return t[e]=i;a=t[e]=Ah(i,r,n==="debounce"),a[Kl]=i,a[o0]=n,a[i0]=r}return a}}function Ih(t,e){var r=t[e];r&&r[Kl]&&(r.clear&&r.clear(),t[e]=r[Kl])}var FM=(function(){function t(){this.cx=0,this.cy=0,this.r0=0,this.r=0,this.startAngle=0,this.endAngle=Math.PI*2,this.clockwise=!0}return t})(),s0=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new FM},e.prototype.buildPath=function(r,n){var a=n.cx,i=n.cy,o=Math.max(n.r0||0,0),s=Math.max(n.r,0),l=(s-o)*.5,c=o+l,u=n.startAngle,f=n.endAngle,h=n.clockwise,d=Math.PI*2,p=h?f-u<d:u-f<d;p||(u=f-(h?d:-d));var m=Math.cos(u),g=Math.sin(u),v=Math.cos(f),y=Math.sin(f);p?(r.moveTo(m*o+a,g*o+i),r.arc(m*c+a,g*c+i,l,-Math.PI+u,u,!h)):r.moveTo(m*s+a,g*s+i),r.arc(a,i,s,u,f,!h),r.arc(v*c+a,y*c+i,l,f-Math.PI*2,f-Math.PI,!h),o!==0&&r.arc(a,i,o,f,u,h)},e})($e);function HM(t,e){e=e||{};var r=e.isRoundCap;return function(n,a,i){var o=a.position;if(!o||o instanceof Array)return Ls(n,a,i);var s=t(o),l=a.distance!=null?a.distance:5,c=this.shape,u=c.cx,f=c.cy,h=c.r,d=c.r0,p=(h+d)/2,m=c.startAngle,g=c.endAngle,v=(m+g)/2,y=r?Math.abs(h-d)/2:0,b=Math.cos,x=Math.sin,S=u+h*b(m),w=f+h*x(m),k="left",T="top";switch(s){case"startArc":S=u+(d-l)*b(v),w=f+(d-l)*x(v),k="center",T="top";break;case"insideStartArc":S=u+(d+l)*b(v),w=f+(d+l)*x(v),k="center",T="bottom";break;case"startAngle":S=u+p*b(m)+jl(m,l+y,!1),w=f+p*x(m)+Ql(m,l+y,!1),k="right",T="middle";break;case"insideStartAngle":S=u+p*b(m)+jl(m,-l+y,!1),w=f+p*x(m)+Ql(m,-l+y,!1),k="left",T="middle";break;case"middle":S=u+p*b(v),w=f+p*x(v),k="center",T="middle";break;case"endArc":S=u+(h+l)*b(v),w=f+(h+l)*x(v),k="center",T="bottom";break;case"insideEndArc":S=u+(h-l)*b(v),w=f+(h-l)*x(v),k="center",T="top";break;case"endAngle":S=u+p*b(g)+jl(g,l+y,!0),w=f+p*x(g)+Ql(g,l+y,!0),k="left",T="middle";break;case"insideEndAngle":S=u+p*b(g)+jl(g,-l+y,!0),w=f+p*x(g)+Ql(g,-l+y,!0),k="right",T="middle";break;default:return Ls(n,a,i)}return n=n||{},n.x=S,n.y=w,n.align=k,n.verticalAlign=T,n}}function VM(t,e,r,n){if(Ke(n)){t.setTextConfig({rotation:n});return}else if(ee(e)){t.setTextConfig({rotation:0});return}var a=t.shape,i=a.clockwise?a.startAngle:a.endAngle,o=a.clockwise?a.endAngle:a.startAngle,s=(i+o)/2,l,c=r(e);switch(c){case"startArc":case"insideStartArc":case"middle":case"insideEndArc":case"endArc":l=s;break;case"startAngle":case"insideStartAngle":l=i;break;case"endAngle":case"insideEndAngle":l=o;break;default:t.setTextConfig({rotation:0});return}var u=Math.PI*1.5-l;c==="middle"&&u>Math.PI/2&&u<Math.PI*1.5&&(u-=Math.PI),t.setTextConfig({rotation:u})}function jl(t,e,r){return e*Math.sin(t)*(r?-1:1)}function Ql(t,e,r){return e*Math.cos(t)*(r?1:-1)}function GM(t,e,r){var n=t.get("borderRadius");if(n==null)return{cornerRadius:0};ee(n)||(n=[n,n,n,n]);var a=Math.abs(e.r||0-e.r0||0);return{cornerRadius:ue(n,function(i){return dn(i,a)})}}var Lh=Math.max,Ph=Math.min;function $M(t,e){var r=t.getArea&&t.getArea();if(kh(t,"cartesian2d")){var n=t.getBaseAxis();if(n.type!=="category"||!n.onBand){var a=e.getLayout("bandWidth");n.isHorizontal()?(r.x-=a,r.width+=a*2):(r.y-=a,r.height+=a*2)}}return r}var WM=(function(t){Z(e,t);function e(){var r=t.call(this)||this;return r.type=e.type,r._isFirstFrame=!0,r}return e.prototype.render=function(r,n,a,i){this._model=r,this._removeOnRenderedListener(a),this._updateDrawMode(r);var o=r.get("coordinateSystem");(o==="cartesian2d"||o==="polar")&&(this._progressiveEls=null,this._isLargeDraw?this._renderLarge(r,n,a):this._renderNormal(r,n,a,i))},e.prototype.incrementalPrepareRender=function(r){this._clear(),this._updateDrawMode(r),this._updateLargeClip(r)},e.prototype.incrementalRender=function(r,n){this._progressiveEls=[],this._incrementalRenderLarge(r,n)},e.prototype.eachRendered=function(r){kl(this._progressiveEls||this.group,r)},e.prototype._updateDrawMode=function(r){var n=r.pipelineContext.large;(this._isLargeDraw==null||n!==this._isLargeDraw)&&(this._isLargeDraw=n,this._clear())},e.prototype._renderNormal=function(r,n,a,i){var o=this.group,s=r.getData(),l=this._data,c=r.coordinateSystem,u=c.getBaseAxis(),f;c.type==="cartesian2d"?f=u.isHorizontal():c.type==="polar"&&(f=u.dim==="angle");var h=r.isAnimationEnabled()?r:null,d=UM(r,c);d&&this._enableRealtimeSort(d,s,a);var p=r.get("clip",!0)||d,m=$M(c,s);o.removeClipPath();var g=r.get("roundCap",!0),v=r.get("showBackground",!0),y=r.getModel("backgroundStyle"),b=y.get("borderRadius")||0,x=[],S=this._backgroundEls,w=i&&i.isInitSort,k=i&&i.type==="changeAxisOrder";function T(M){var I=Jl[c.type](s,M),L=QM(c,f,I);return L.useStyle(y.getItemStyle()),c.type==="cartesian2d"?L.setShape("r",b):L.setShape("cornerRadius",b),x[M]=L,L}s.diff(l).add(function(M){var I=s.getItemModel(M),L=Jl[c.type](s,M,I);if(v&&T(M),!(!s.hasValue(M)||!h0[c.type](L))){var P=!1;p&&(P=l0[c.type](m,L));var N=c0[c.type](r,s,M,L,f,h,u.model,!1,g);d&&(N.forceLabelAnimation=!0),p0(N,s,M,I,L,r,f,c.type==="polar"),w?N.attr({shape:L}):d?u0(d,h,N,L,M,f,!1,!1):Qr(N,{shape:L},r,M),s.setItemGraphicEl(M,N),o.add(N),N.ignore=P}}).update(function(M,I){var L=s.getItemModel(M),P=Jl[c.type](s,M,L);if(v){var N=void 0;S.length===0?N=T(I):(N=S[I],N.useStyle(y.getItemStyle()),c.type==="cartesian2d"?N.setShape("r",b):N.setShape("cornerRadius",b),x[M]=N);var O=Jl[c.type](s,M),q=y0(f,O,c);Ut(N,{shape:q},h,M)}var R=l.getItemGraphicEl(I);if(!s.hasValue(M)||!h0[c.type](P)){o.remove(R);return}var z=!1;if(p&&(z=l0[c.type](m,P),z&&o.remove(R)),R?om(R):R=c0[c.type](r,s,M,P,f,h,u.model,!!R,g),d&&(R.forceLabelAnimation=!0),k){var F=R.getTextContent();if(F){var X=Al(F);X.prevValue!=null&&(X.prevValue=X.value)}}else p0(R,s,M,L,P,r,f,c.type==="polar");w?R.attr({shape:P}):d?u0(d,h,R,P,M,f,!0,k):Ut(R,{shape:P},r,M,null),s.setItemGraphicEl(M,R),R.ignore=z,o.add(R)}).remove(function(M){var I=l.getItemGraphicEl(M);I&&Rf(I,r,M)}).execute();var C=this._backgroundGroup||(this._backgroundGroup=new mt);C.removeAll();for(var A=0;A<x.length;++A)C.add(x[A]);o.add(C),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(r,n,a){this._clear(),g0(r,this.group),this._updateLargeClip(r)},e.prototype._incrementalRenderLarge=function(r,n){this._removeBackground(),g0(n,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(r){var n=r.get("clip",!0)&&gM(r.coordinateSystem,!1,r),a=this.group;n?a.setClipPath(n):a.removeClipPath()},e.prototype._enableRealtimeSort=function(r,n,a){var i=this;if(n.count()){var o=r.baseAxis;if(this._isFirstFrame)this._dispatchInitSort(n,r,a),this._isFirstFrame=!1;else{var s=function(l){var c=n.getItemGraphicEl(l),u=c&&c.shape;return u&&Math.abs(o.isHorizontal()?u.height:u.width)||0};this._onRendered=function(){i._updateSortWithinSameData(n,s,o,a)},a.getZr().on("rendered",this._onRendered)}}},e.prototype._dataSort=function(r,n,a){var i=[];return r.each(r.mapDimension(n.dim),function(o,s){var l=a(s);l=l??NaN,i.push({dataIndex:s,mappedValue:l,ordinalNumber:o})}),i.sort(function(o,s){return s.mappedValue-o.mappedValue}),{ordinalNumbers:ue(i,function(o){return o.ordinalNumber})}},e.prototype._isOrderChangedWithinSameData=function(r,n,a){for(var i=a.scale,o=r.mapDimension(a.dim),s=Number.MAX_VALUE,l=0,c=i.getOrdinalMeta().categories.length;l<c;++l){var u=r.rawIndexOf(o,i.getRawOrdinalNumber(l)),f=u<0?Number.MIN_VALUE:n(r.indexOfRawIndex(u));if(f>s)return!0;s=f}return!1},e.prototype._isOrderDifferentInView=function(r,n){for(var a=n.scale,i=a.getExtent(),o=Math.max(0,i[0]),s=Math.min(i[1],a.getOrdinalMeta().categories.length-1);o<=s;++o)if(r.ordinalNumbers[o]!==a.getRawOrdinalNumber(o))return!0},e.prototype._updateSortWithinSameData=function(r,n,a,i){if(this._isOrderChangedWithinSameData(r,n,a)){var o=this._dataSort(r,a,n);this._isOrderDifferentInView(o,a)&&(this._removeOnRenderedListener(i),i.dispatchAction({type:"changeAxisOrder",componentType:a.dim+"Axis",axisId:a.index,sortInfo:o}))}},e.prototype._dispatchInitSort=function(r,n,a){var i=n.baseAxis,o=this._dataSort(r,i,function(s){return r.get(r.mapDimension(n.otherAxis.dim),s)});a.dispatchAction({type:"changeAxisOrder",componentType:i.dim+"Axis",isInitSort:!0,axisId:i.index,sortInfo:o})},e.prototype.remove=function(r,n){this._clear(this._model),this._removeOnRenderedListener(n)},e.prototype.dispose=function(r,n){this._removeOnRenderedListener(n)},e.prototype._removeOnRenderedListener=function(r){this._onRendered&&(r.getZr().off("rendered",this._onRendered),this._onRendered=null)},e.prototype._clear=function(r){var n=this.group,a=this._data;r&&r.isAnimationEnabled()&&a&&!this._isLargeDraw?(this._removeBackground(),this._backgroundEls=[],a.eachItemGraphicEl(function(i){Rf(i,r,Ve(i).dataIndex)})):n.removeAll(),this._data=null,this._isFirstFrame=!0},e.prototype._removeBackground=function(){this.group.remove(this._backgroundGroup),this._backgroundGroup=null},e.type="bar",e})(dr),l0={cartesian2d:function(t,e){var r=e.width<0?-1:1,n=e.height<0?-1:1;r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height);var a=t.x+t.width,i=t.y+t.height,o=Lh(e.x,t.x),s=Ph(e.x+e.width,a),l=Lh(e.y,t.y),c=Ph(e.y+e.height,i),u=s<o,f=c<l;return e.x=u&&o>a?s:o,e.y=f&&l>i?c:l,e.width=u?0:s-o,e.height=f?0:c-l,r<0&&(e.x+=e.width,e.width=-e.width),n<0&&(e.y+=e.height,e.height=-e.height),u||f},polar:function(t,e){var r=e.r0<=e.r?1:-1;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}var a=Ph(e.r,t.r),i=Lh(e.r0,t.r0);e.r=a,e.r0=i;var o=a-i<0;if(r<0){var n=e.r;e.r=e.r0,e.r0=n}return o}},c0={cartesian2d:function(t,e,r,n,a,i,o,s,l){var c=new ft({shape:U({},n),z2:1});if(c.__dataIndex=r,c.name="item",i){var u=c.shape,f=a?"height":"width";u[f]=0}return c},polar:function(t,e,r,n,a,i,o,s,l){var c=!a&&l?s0:ti,u=new c({shape:n,z2:1});u.name="item";var f=d0(a);if(u.calculateTextPosition=HM(f,{isRoundCap:c===s0}),i){var h=u.shape,d=a?"r":"endAngle",p={};h[d]=a?n.r0:n.startAngle,p[d]=n[d],(s?Ut:Qr)(u,{shape:p},i)}return u}};function UM(t,e){var r=t.get("realtimeSort",!0),n=e.getBaseAxis();if(r&&n.type==="category"&&e.type==="cartesian2d")return{baseAxis:n,otherAxis:e.getOtherAxis(n)}}function u0(t,e,r,n,a,i,o,s){var l,c;i?(c={x:n.x,width:n.width},l={y:n.y,height:n.height}):(c={y:n.y,height:n.height},l={x:n.x,width:n.width}),s||(o?Ut:Qr)(r,{shape:l},e,a,null);var u=e?t.baseAxis.model:null;(o?Ut:Qr)(r,{shape:c},u,a)}function f0(t,e){for(var r=0;r<e.length;r++)if(!isFinite(t[e[r]]))return!0;return!1}var YM=["x","y","width","height"],qM=["cx","cy","r","startAngle","endAngle"],h0={cartesian2d:function(t){return!f0(t,YM)},polar:function(t){return!f0(t,qM)}},Jl={cartesian2d:function(t,e,r){var n=t.getItemLayout(e),a=r?ZM(r,n):0,i=n.width>0?1:-1,o=n.height>0?1:-1;return{x:n.x+i*a/2,y:n.y+o*a/2,width:n.width-i*a,height:n.height-o*a}},polar:function(t,e,r){var n=t.getItemLayout(e);return{cx:n.cx,cy:n.cy,r0:n.r0,r:n.r,startAngle:n.startAngle,endAngle:n.endAngle,clockwise:n.clockwise}}};function XM(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function d0(t){return(function(e){var r=e?"Arc":"Angle";return function(n){switch(n){case"start":case"insideStart":case"end":case"insideEnd":return n+r;default:return n}}})(t)}function p0(t,e,r,n,a,i,o,s){var l=e.getItemVisual(r,"style");if(s){if(!i.get("roundCap")){var u=t.shape,f=GM(n.getModel("itemStyle"),u);U(u,f),t.setShape(u)}}else{var c=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var h=n.getShallow("cursor");h&&t.attr("cursor",h);var d=s?o?a.r>=a.r0?"endArc":"startArc":a.endAngle>=a.startAngle?"endAngle":"startAngle":o?a.height>=0?"bottom":"top":a.width>=0?"right":"left",p=Ml(n);Cl(t,p,{labelFetcher:i,labelDataIndex:r,defaultText:_h(i.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:d});var m=t.getTextContent();if(s&&m){var g=n.get(["label","position"]);t.textConfig.inside=g==="middle"?!0:null,VM(t,g==="outside"?d:g,d0(o),n.get(["label","rotate"]))}jT(m,p,i.getRawValue(r),function(y){return Oy(e,y)});var v=n.getModel(["emphasis"]);fl(t,v.get("focus"),v.get("blurScope"),v.get("disabled")),xf(t,n),XM(a)&&(t.style.fill="none",t.style.stroke="none",D(t.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function ZM(t,e){var r=t.get(["itemStyle","borderColor"]);if(!r||r==="none")return 0;var n=t.get(["itemStyle","borderWidth"])||0,a=isNaN(e.width)?Number.MAX_VALUE:Math.abs(e.width),i=isNaN(e.height)?Number.MAX_VALUE:Math.abs(e.height);return Math.min(n,a,i)}var KM=(function(){function t(){}return t})(),v0=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new KM},e.prototype.buildPath=function(r,n){for(var a=n.points,i=this.baseDimIdx,o=1-this.baseDimIdx,s=[],l=[],c=this.barWidth,u=0;u<a.length;u+=3)l[i]=c,l[o]=a[u+2],s[i]=a[u+i],s[o]=a[u+o],r.rect(s[0],s[1],l[0],l[1])},e})($e);function g0(t,e,r,n){var a=t.getData(),i=a.getLayout("valueAxisHorizontal")?1:0,o=a.getLayout("largeDataIndices"),s=a.getLayout("size"),l=t.getModel("backgroundStyle"),c=a.getLayout("largeBackgroundPoints");if(c){var u=new v0({shape:{points:c},incremental:!!n,silent:!0,z2:0});u.baseDimIdx=i,u.largeDataIndices=o,u.barWidth=s,u.useStyle(l.getItemStyle()),e.add(u),r&&r.push(u)}var f=new v0({shape:{points:a.getLayout("largePoints")},incremental:!!n,ignoreCoarsePointer:!0,z2:1});f.baseDimIdx=i,f.largeDataIndices=o,f.barWidth=s,e.add(f),f.useStyle(a.getVisual("style")),f.style.stroke=null,Ve(f).seriesIndex=t.seriesIndex,t.get("silent")||(f.on("mousedown",m0),f.on("mousemove",m0)),r&&r.push(f)}var m0=Ah(function(t){var e=this,r=jM(e,t.offsetX,t.offsetY);Ve(e).dataIndex=r>=0?r:null},30,!1);function jM(t,e,r){for(var n=t.baseDimIdx,a=1-n,i=t.shape.points,o=t.largeDataIndices,s=[],l=[],c=t.barWidth,u=0,f=i.length/3;u<f;u++){var h=u*3;if(l[n]=c,l[a]=i[h+2],s[n]=i[h+n],s[a]=i[h+a],l[a]<0&&(s[a]+=l[a],l[a]=-l[a]),e>=s[0]&&e<=s[0]+l[0]&&r>=s[1]&&r<=s[1]+l[1])return o[u]}return-1}function y0(t,e,r){if(kh(r,"cartesian2d")){var n=e,a=r.getArea();return{x:t?n.x:a.x,y:t?a.y:n.y,width:t?n.width:a.width,height:t?a.height:n.height}}else{var a=r.getArea(),i=e;return{cx:a.cx,cy:a.cy,r0:t?a.r0:i.r0,r:t?a.r:i.r,startAngle:t?i.startAngle:0,endAngle:t?i.endAngle:Math.PI*2}}}function QM(t,e,r){var n=t.type==="polar"?ti:ft;return new n({shape:y0(e,r,t),silent:!0,z2:0})}function JM(t){t.registerChartView(WM),t.registerSeriesModel(zM),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,at(OM,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,NM("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Jy("bar")),t.registerAction({type:"changeAxisOrder",event:"changeAxisOrder",update:"update"},function(e,r){var n=e.componentType||"series";r.eachComponent({mainType:n,query:e},function(a){e.sortInfo&&a.axis.setCategorySortInfo(e.sortInfo)})})}function pi(t,e,r,n,a){var i=t+e;r.isSilent(i)||n.eachComponent({mainType:"series",subType:"pie"},function(o){for(var s=o.seriesIndex,l=o.option.selectedMap,c=a.selected,u=0;u<c.length;u++)if(c[u].seriesIndex===s){var f=o.getData(),h=oa(f,a.fromActionPayload);r.trigger(i,{type:i,seriesId:o.id,name:ee(h)?f.getName(h[0]):f.getName(h),selected:ne(l)?l:U({},l)})}})}function eA(t,e,r){t.on("selectchanged",function(n){var a=r.getModel();n.isFromClick?(pi("map","selectchanged",e,a,n),pi("pie","selectchanged",e,a,n)):n.fromAction==="select"?(pi("map","selected",e,a,n),pi("pie","selected",e,a,n)):n.fromAction==="unselect"&&(pi("map","unselected",e,a,n),pi("pie","unselected",e,a,n))})}function tA(t){for(var e=[],r=0;r<t.length;r++){var n=t[r];if(!n.defaultAttr.ignore){var a=n.label,i=a.getComputedTransform(),o=a.getBoundingRect(),s=!i||i[1]<1e-5&&i[2]<1e-5,l=a.style.margin||0,c=o.clone();c.applyTransform(i),c.x-=l/2,c.y-=l/2,c.width+=l,c.height+=l;var u=s?new _l(o,i):null;e.push({label:a,labelLine:n.labelLine,rect:c,localRect:o,obb:u,priority:n.priority,defaultAttr:n.defaultAttr,layoutOption:n.computedLayoutOption,axisAligned:s,transform:i})}}return e}function rA(t){var e=[];t.sort(function(m,g){return g.priority-m.priority});var r=new Fe(0,0,0,0);function n(m){if(!m.ignore){var g=m.ensureState("emphasis");g.ignore==null&&(g.ignore=!1)}m.ignore=!0}for(var a=0;a<t.length;a++){var i=t[a],o=i.axisAligned,s=i.localRect,l=i.transform,c=i.label,u=i.labelLine;r.copy(i.rect),r.width-=.1,r.height-=.1,r.x+=.05,r.y+=.05;for(var f=i.obb,h=!1,d=0;d<e.length;d++){var p=e[d];if(r.intersect(p.rect)){if(o&&p.axisAligned){h=!0;break}if(p.obb||(p.obb=new _l(p.localRect,p.transform)),f||(f=new _l(s,l)),f.intersect(p.obb)){h=!0;break}}}h?(n(c),u&&n(u)):(c.attr("ignore",i.defaultAttr.ignore),u&&u.attr("ignore",i.defaultAttr.labelGuideIgnore),e.push(i))}}var vi=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),nA=(function(){function t(e){this.handler=e,e.on("mousedown",this._dragStart,this),e.on("mousemove",this._drag,this),e.on("mouseup",this._dragEnd,this)}return t.prototype._dragStart=function(e){for(var r=e.target;r&&!r.draggable;)r=r.parent||r.__hostTarget;r&&(this._draggingTarget=r,r.dragging=!0,this._x=e.offsetX,this._y=e.offsetY,this.handler.dispatchToElement(new vi(r,e),"dragstart",e.event))},t.prototype._drag=function(e){var r=this._draggingTarget;if(r){var n=e.offsetX,a=e.offsetY,i=n-this._x,o=a-this._y;this._x=n,this._y=a,r.drift(i,o,e),this.handler.dispatchToElement(new vi(r,e),"drag",e.event);var s=this.handler.findHover(n,a,r).target,l=this._dropTarget;this._dropTarget=s,r!==s&&(l&&s!==l&&this.handler.dispatchToElement(new vi(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new vi(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new vi(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new vi(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),aA=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,Rh=[],iA=ge.browser.firefox&&+ge.browser.version.split(".")[0]<39;function Eh(t,e,r,n){return r=r||{},n?_0(t,e,r):iA&&e.layerX!=null&&e.layerX!==e.offsetX?(r.zrX=e.layerX,r.zrY=e.layerY):e.offsetX!=null?(r.zrX=e.offsetX,r.zrY=e.offsetY):_0(t,e,r),r}function _0(t,e,r){if(ge.domSupported&&t.getBoundingClientRect){var n=e.clientX,a=e.clientY;if(ey(t)){var i=t.getBoundingClientRect();r.zrX=n-i.left,r.zrY=a-i.top;return}else if(rh(Rh,t,n,a)){r.zrX=Rh[0],r.zrY=Rh[1];return}}r.zrX=r.zrY=0}function Oh(t){return t||window.event}function ir(t,e,r){if(e=Oh(e),e.zrX!=null)return e;var n=e.type,a=n&&n.indexOf("touch")>=0;if(a){var o=n!=="touchend"?e.targetTouches[0]:e.changedTouches[0];o&&Eh(t,o,e,r)}else{Eh(t,e,e,r);var i=oA(e);e.zrDelta=i?i/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&aA.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function oA(t){var e=t.wheelDelta;if(e)return e;var r=t.deltaX,n=t.deltaY;if(r==null||n==null)return e;var a=Math.abs(n!==0?n:r),i=n>0?-1:n<0?1:r>0?-1:1;return 3*a*i}function sA(t,e,r,n){t.addEventListener(e,r,n)}function lA(t,e,r,n){t.removeEventListener(e,r,n)}var ec=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function b0(t){return t.which===2||t.which===3}var cA=(function(){function t(){this._track=[]}return t.prototype.recognize=function(e,r,n){return this._doTrack(e,r,n),this._recognize(e)},t.prototype.clear=function(){return this._track.length=0,this},t.prototype._doTrack=function(e,r,n){var a=e.touches;if(a){for(var i={points:[],touches:[],target:r,event:e},o=0,s=a.length;o<s;o++){var l=a[o],c=Eh(n,l,{});i.points.push([c.zrX,c.zrY]),i.touches.push(l)}this._track.push(i)}},t.prototype._recognize=function(e){for(var r in Nh)if(Nh.hasOwnProperty(r)){var n=Nh[r](this._track,e);if(n)return n}},t})();function x0(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function uA(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var Nh={pinch:function(t,e){var r=t.length;if(r){var n=(t[r-1]||{}).points,a=(t[r-2]||{}).points||n;if(a&&a.length>1&&n&&n.length>1){var i=x0(n)/x0(a);!isFinite(i)&&(i=1),e.pinchScale=i;var o=uA(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},w0="silent";function fA(t,e,r){return{type:t,event:r,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:r.zrX,offsetY:r.zrY,gestureEvent:r.gestureEvent,pinchX:r.pinchX,pinchY:r.pinchY,pinchScale:r.pinchScale,wheelDelta:r.zrDelta,zrByTouch:r.zrByTouch,which:r.which,stop:hA}}function hA(){ec(this.event)}var dA=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.handler=null,r}return e.prototype.dispose=function(){},e.prototype.setCursor=function(){},e})(ur),Mo=(function(){function t(e,r){this.x=e,this.y=r}return t})(),pA=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Bh=new Fe(0,0,0,0),S0=(function(t){Z(e,t);function e(r,n,a,i,o){var s=t.call(this)||this;return s._hovered=new Mo(0,0),s.storage=r,s.painter=n,s.painterRoot=i,s._pointerSize=o,a=a||new dA,s.proxy=null,s.setHandlerProxy(a),s._draggingMgr=new nA(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(D(pA,function(n){r.on&&r.on(n,this[n],this)},this),r.handler=this),this.proxy=r},e.prototype.mousemove=function(r){var n=r.zrX,a=r.zrY,i=T0(this,n,a),o=this._hovered,s=o.target;s&&!s.__zr&&(o=this.findHover(o.x,o.y),s=o.target);var l=this._hovered=i?new Mo(n,a):this.findHover(n,a),c=l.target,u=this.proxy;u.setCursor&&u.setCursor(c?c.cursor:"default"),s&&c!==s&&this.dispatchToElement(o,"mouseout",r),this.dispatchToElement(l,"mousemove",r),c&&c!==s&&this.dispatchToElement(l,"mouseover",r)},e.prototype.mouseout=function(r){var n=r.zrEventControl;n!=="only_globalout"&&this.dispatchToElement(this._hovered,"mouseout",r),n!=="no_globalout"&&this.trigger("globalout",{type:"globalout",event:r})},e.prototype.resize=function(){this._hovered=new Mo(0,0)},e.prototype.dispatch=function(r,n){var a=this[r];a&&a.call(this,n)},e.prototype.dispose=function(){this.proxy.dispose(),this.storage=null,this.proxy=null,this.painter=null},e.prototype.setCursorStyle=function(r){var n=this.proxy;n.setCursor&&n.setCursor(r)},e.prototype.dispatchToElement=function(r,n,a){r=r||{};var i=r.target;if(!(i&&i.silent)){for(var o="on"+n,s=fA(n,r,a);i&&(i[o]&&(s.cancelBubble=!!i[o].call(i,s)),i.trigger(n,s),i=i.__hostTarget?i.__hostTarget:i.parent,!s.cancelBubble););s.cancelBubble||(this.trigger(n,s),this.painter&&this.painter.eachOtherLayer&&this.painter.eachOtherLayer(function(l){typeof l[o]=="function"&&l[o].call(l,s),l.trigger&&l.trigger(n,s)}))}},e.prototype.findHover=function(r,n,a){var i=this.storage.getDisplayList(),o=new Mo(r,n);if(k0(i,o,r,n,a),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,c=l/2,u=new Fe(r-c,n-c,l,l),f=i.length-1;f>=0;f--){var h=i[f];h!==a&&!h.ignore&&!h.ignoreCoarsePointer&&(!h.parent||!h.parent.ignoreCoarsePointer)&&(Bh.copy(h.getBoundingRect()),h.transform&&Bh.applyTransform(h.transform),Bh.intersect(u)&&s.push(h))}if(s.length)for(var d=4,p=Math.PI/12,m=Math.PI*2,g=0;g<c;g+=d)for(var v=0;v<m;v+=p){var y=r+g*Math.cos(v),b=n+g*Math.sin(v);if(k0(s,o,y,b,a),o.target)return o}}return o},e.prototype.processGesture=function(r,n){this._gestureMgr||(this._gestureMgr=new cA);var a=this._gestureMgr;n==="start"&&a.clear();var i=a.recognize(r,this.findHover(r.zrX,r.zrY,null).target,this.proxy.dom);if(n==="end"&&a.clear(),i){var o=i.type;r.gestureEvent=o;var s=new Mo;s.target=i.target,this.dispatchToElement(s,o,i.event)}},e})(ur);D(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){S0.prototype[t]=function(e){var r=e.zrX,n=e.zrY,a=T0(this,r,n),i,o;if((t!=="mouseup"||!a)&&(i=this.findHover(r,n),o=i.target),t==="mousedown")this._downEl=o,this._downPoint=[e.zrX,e.zrY],this._upEl=o;else if(t==="mouseup")this._upEl=o;else if(t==="click"){if(this._downEl!==this._upEl||!this._downPoint||uS(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}});function vA(t,e,r){if(t[t.rectHover?"rectContain":"contain"](e,r)){for(var n=t,a=void 0,i=!1;n;){if(n.ignoreClip&&(i=!0),!i){var o=n.getClipPath();if(o&&!o.contain(e,r))return!1}n.silent&&(a=!0);var s=n.__hostTarget;n=s||n.parent}return a?w0:!0}return!1}function k0(t,e,r,n,a){for(var i=t.length-1;i>=0;i--){var o=t[i],s=void 0;if(o!==a&&!o.ignore&&(s=vA(o,r,n))&&(!e.topTarget&&(e.topTarget=o),s!==w0)){e.target=o;break}}}function T0(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var C0=32,Ao=7;function gA(t){for(var e=0;t>=C0;)e|=t&1,t>>=1;return t+e}function M0(t,e,r,n){var a=e+1;if(a===r)return 1;if(n(t[a++],t[e])<0){for(;a<r&&n(t[a],t[a-1])<0;)a++;mA(t,e,a)}else for(;a<r&&n(t[a],t[a-1])>=0;)a++;return a-e}function mA(t,e,r){for(r--;e<r;){var n=t[e];t[e++]=t[r],t[r--]=n}}function A0(t,e,r,n,a){for(n===e&&n++;n<r;n++){for(var i=t[n],o=e,s=n,l;o<s;)l=o+s>>>1,a(i,t[l])<0?s=l:o=l+1;var c=n-o;switch(c){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:for(;c>0;)t[o+c]=t[o+c-1],c--}t[o]=i}}function zh(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])>0){for(s=n-a;l<s&&i(t,e[r+a+l])>0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}else{for(s=a+1;l<s&&i(t,e[r+a-l])<=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])>0?o=u+1:l=u}return l}function Fh(t,e,r,n,a,i){var o=0,s=0,l=1;if(i(t,e[r+a])<0){for(s=a+1;l<s&&i(t,e[r+a-l])<0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s);var c=o;o=a-l,l=a-c}else{for(s=n-a;l<s&&i(t,e[r+a+l])>=0;)o=l,l=(l<<1)+1,l<=0&&(l=s);l>s&&(l=s),o+=a,l+=a}for(o++;o<l;){var u=o+(l-o>>>1);i(t,e[r+u])<0?l=u:o=u+1}return l}function yA(t,e){var r=Ao,n,a,i=0,o=[];n=[],a=[];function s(d,p){n[i]=d,a[i]=p,i+=1}function l(){for(;i>1;){var d=i-2;if(d>=1&&a[d-1]<=a[d]+a[d+1]||d>=2&&a[d-2]<=a[d]+a[d-1])a[d-1]<a[d+1]&&d--;else if(a[d]>a[d+1])break;u(d)}}function c(){for(;i>1;){var d=i-2;d>0&&a[d-1]<a[d+1]&&d--,u(d)}}function u(d){var p=n[d],m=a[d],g=n[d+1],v=a[d+1];a[d]=m+v,d===i-3&&(n[d+1]=n[d+2],a[d+1]=a[d+2]),i--;var y=Fh(t[g],t,p,m,0,e);p+=y,m-=y,m!==0&&(v=zh(t[p+m-1],t,g,v,v-1,e),v!==0&&(m<=v?f(p,m,g,v):h(p,m,g,v)))}function f(d,p,m,g){var v=0;for(v=0;v<p;v++)o[v]=t[d+v];var y=0,b=m,x=d;if(t[x++]=t[b++],--g===0){for(v=0;v<p;v++)t[x+v]=o[y+v];return}if(p===1){for(v=0;v<g;v++)t[x+v]=t[b+v];t[x+g]=o[y];return}for(var S=r,w,k,T;;){w=0,k=0,T=!1;do if(e(t[b],o[y])<0){if(t[x++]=t[b++],k++,w=0,--g===0){T=!0;break}}else if(t[x++]=o[y++],w++,k=0,--p===1){T=!0;break}while((w|k)<S);if(T)break;do{if(w=Fh(t[b],o,y,p,0,e),w!==0){for(v=0;v<w;v++)t[x+v]=o[y+v];if(x+=w,y+=w,p-=w,p<=1){T=!0;break}}if(t[x++]=t[b++],--g===0){T=!0;break}if(k=zh(o[y],t,b,g,0,e),k!==0){for(v=0;v<k;v++)t[x+v]=t[b+v];if(x+=k,b+=k,g-=k,g===0){T=!0;break}}if(t[x++]=o[y++],--p===1){T=!0;break}S--}while(w>=Ao||k>=Ao);if(T)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),p===1){for(v=0;v<g;v++)t[x+v]=t[b+v];t[x+g]=o[y]}else{if(p===0)throw new Error;for(v=0;v<p;v++)t[x+v]=o[y+v]}}function h(d,p,m,g){var v=0;for(v=0;v<g;v++)o[v]=t[m+v];var y=d+p-1,b=g-1,x=m+g-1,S=0,w=0;if(t[x--]=t[y--],--p===0){for(S=x-(g-1),v=0;v<g;v++)t[S+v]=o[v];return}if(g===1){for(x-=p,y-=p,w=x+1,S=y+1,v=p-1;v>=0;v--)t[w+v]=t[S+v];t[x]=o[b];return}for(var k=r;;){var T=0,C=0,A=!1;do if(e(o[b],t[y])<0){if(t[x--]=t[y--],T++,C=0,--p===0){A=!0;break}}else if(t[x--]=o[b--],C++,T=0,--g===1){A=!0;break}while((T|C)<k);if(A)break;do{if(T=p-Fh(o[b],t,d,p,p-1,e),T!==0){for(x-=T,y-=T,p-=T,w=x+1,S=y+1,v=T-1;v>=0;v--)t[w+v]=t[S+v];if(p===0){A=!0;break}}if(t[x--]=o[b--],--g===1){A=!0;break}if(C=g-zh(t[y],o,0,g,g-1,e),C!==0){for(x-=C,b-=C,g-=C,w=x+1,S=b+1,v=0;v<C;v++)t[w+v]=o[S+v];if(g<=1){A=!0;break}}if(t[x--]=t[y--],--p===0){A=!0;break}k--}while(T>=Ao||C>=Ao);if(A)break;k<0&&(k=0),k+=2}if(r=k,r<1&&(r=1),g===1){for(x-=p,y-=p,w=x+1,S=y+1,v=p-1;v>=0;v--)t[w+v]=t[S+v];t[x]=o[b]}else{if(g===0)throw new Error;for(S=x-(g-1),v=0;v<g;v++)t[S+v]=o[v]}}return{mergeRuns:l,forceMergeRuns:c,pushRun:s}}function tc(t,e,r,n){r||(r=0),n||(n=t.length);var a=n-r;if(!(a<2)){var i=0;if(a<C0){i=M0(t,r,n,e),A0(t,r,n,r+i,e);return}var o=yA(t,e),s=gA(a);do{if(i=M0(t,r,n,e),i<s){var l=a;l>s&&(l=s),A0(t,r,r+l,r+i,e),i=l}o.pushRun(r,i),o.mergeRuns(),a-=i,r+=i}while(a!==0);o.forceMergeRuns()}}var D0=!1;function Hh(){D0||(D0=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function I0(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var _A=(function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=I0}return t.prototype.traverse=function(e,r){for(var n=0;n<this._roots.length;n++)this._roots[n].traverse(e,r)},t.prototype.getDisplayList=function(e,r){r=r||!1;var n=this._displayList;return(e||!n.length)&&this.updateDisplayList(r),n},t.prototype.updateDisplayList=function(e){this._displayListLen=0;for(var r=this._roots,n=this._displayList,a=0,i=r.length;a<i;a++)this._updateAndAddDisplayable(r[a],null,e);n.length=this._displayListLen,tc(n,I0)},t.prototype._updateAndAddDisplayable=function(e,r,n){if(!(e.ignore&&!n)){e.beforeUpdate(),e.update(),e.afterUpdate();var a=e.getClipPath();if(e.ignoreClip)r=null;else if(a){r?r=r.slice():r=[];for(var i=a,o=e;i;)i.parent=o,i.updateTransform(),r.push(i),o=i,i=i.getClipPath()}if(e.childrenRef){for(var s=e.childrenRef(),l=0;l<s.length;l++){var c=s[l];e.__dirty&&(c.__dirty|=Wt),this._updateAndAddDisplayable(c,r,n)}e.__dirty=0}else{var u=e;r&&r.length?u.__clipPaths=r:u.__clipPaths&&u.__clipPaths.length>0&&(u.__clipPaths=[]),isNaN(u.z)&&(Hh(),u.z=0),isNaN(u.z2)&&(Hh(),u.z2=0),isNaN(u.zlevel)&&(Hh(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,r,n);var h=e.getTextGuideLine();h&&this._updateAndAddDisplayable(h,r,n);var d=e.getTextContent();d&&this._updateAndAddDisplayable(d,r,n)}},t.prototype.addRoot=function(e){e.__zr&&e.__zr.storage===this||this._roots.push(e)},t.prototype.delRoot=function(e){if(e instanceof Array){for(var r=0,n=e.length;r<n;r++)this.delRoot(e[r]);return}var a=ze(this._roots,e);a>=0&&this._roots.splice(a,1)},t.prototype.delAllRoots=function(){this._roots=[],this._displayList=[],this._displayListLen=0},t.prototype.getRoots=function(){return this._roots},t.prototype.dispose=function(){this._displayList=null,this._roots=null},t})(),rc;rc=ge.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};function gi(){return new Date().getTime()}var bA=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;return n._running=!1,n._time=0,n._pausedTime=0,n._pauseStart=0,n._paused=!1,r=r||{},n.stage=r.stage||{},n}return e.prototype.addClip=function(r){r.animation&&this.removeClip(r),this._head?(this._tail.next=r,r.prev=this._tail,r.next=null,this._tail=r):this._head=this._tail=r,r.animation=this},e.prototype.addAnimator=function(r){r.animation=this;var n=r.getClip();n&&this.addClip(n)},e.prototype.removeClip=function(r){if(r.animation){var n=r.prev,a=r.next;n?n.next=a:this._head=a,a?a.prev=n:this._tail=n,r.next=r.prev=r.animation=null}},e.prototype.removeAnimator=function(r){var n=r.getClip();n&&this.removeClip(n),r.animation=null},e.prototype.update=function(r){for(var n=gi()-this._pausedTime,a=n-this._time,i=this._head;i;){var o=i.next,s=i.step(n,a);s&&(i.ondestroy(),this.removeClip(i)),i=o}this._time=n,r||(this.trigger("frame",a),this.stage.update&&this.stage.update())},e.prototype._startLoop=function(){var r=this;this._running=!0;function n(){r._running&&(rc(n),!r._paused&&r.update())}rc(n)},e.prototype.start=function(){this._running||(this._time=gi(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=gi(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=gi()-this._pauseStart,this._paused=!1)},e.prototype.clear=function(){for(var r=this._head;r;){var n=r.next;r.prev=r.next=r.animation=null,r=n}this._head=this._tail=null},e.prototype.isFinished=function(){return this._head==null},e.prototype.animate=function(r,n){n=n||{},this.start();var a=new Gu(r,n.loop);return this.addAnimator(a),a},e})(ur),xA=300,Vh=ge.domSupported,Gh=(function(){var t=["click","dblclick","mousewheel","wheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],r={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},n=ue(t,function(a){var i=a.replace("mouse","pointer");return r.hasOwnProperty(i)?i:a});return{mouse:t,touch:e,pointer:n}})(),L0={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},P0=!1;function $h(t){var e=t.pointerType;return e==="pen"||e==="touch"}function wA(t){t.touching=!0,t.touchTimer!=null&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout(function(){t.touching=!1,t.touchTimer=null},700)}function Wh(t){t&&(t.zrByTouch=!0)}function SA(t,e){return ir(t.dom,new kA(t,e),!0)}function R0(t,e){for(var r=e,n=!1;r&&r.nodeType!==9&&!(n=r.domBelongToZr||r!==e&&r===t.painterRoot);)r=r.parentNode;return n}var kA=(function(){function t(e,r){this.stopPropagation=Ct,this.stopImmediatePropagation=Ct,this.preventDefault=Ct,this.type=r.type,this.target=this.currentTarget=e.dom,this.pointerType=r.pointerType,this.clientX=r.clientX,this.clientY=r.clientY}return t})(),pr={mousedown:function(t){t=ir(this.dom,t),this.__mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=ir(this.dom,t);var e=this.__mayPointerCapture;e&&(t.zrX!==e[0]||t.zrY!==e[1])&&this.__togglePointerCapture(!0),this.trigger("mousemove",t)},mouseup:function(t){t=ir(this.dom,t),this.__togglePointerCapture(!1),this.trigger("mouseup",t)},mouseout:function(t){t=ir(this.dom,t);var e=t.toElement||t.relatedTarget;R0(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){P0=!0,t=ir(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){P0||(t=ir(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=ir(this.dom,t),Wh(t),this.__lastTouchMoment=new Date,this.handler.processGesture(t,"start"),pr.mousemove.call(this,t),pr.mousedown.call(this,t)},touchmove:function(t){t=ir(this.dom,t),Wh(t),this.handler.processGesture(t,"change"),pr.mousemove.call(this,t)},touchend:function(t){t=ir(this.dom,t),Wh(t),this.handler.processGesture(t,"end"),pr.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<xA&&pr.click.call(this,t)},pointerdown:function(t){pr.mousedown.call(this,t)},pointermove:function(t){$h(t)||pr.mousemove.call(this,t)},pointerup:function(t){pr.mouseup.call(this,t)},pointerout:function(t){$h(t)||pr.mouseout.call(this,t)}};D(["click","dblclick","contextmenu"],function(t){pr[t]=function(e){e=ir(this.dom,e),this.trigger(t,e)}});var Uh={pointermove:function(t){$h(t)||Uh.mousemove.call(this,t)},pointerup:function(t){Uh.mouseup.call(this,t)},mousemove:function(t){this.trigger("mousemove",t)},mouseup:function(t){var e=this.__pointerCapturing;this.__togglePointerCapture(!1),this.trigger("mouseup",t),e&&(t.zrEventControl="only_globalout",this.trigger("mouseout",t))}};function TA(t,e){var r=e.domHandlers;ge.pointerEventsSupported?D(Gh.pointer,function(n){nc(e,n,function(a){r[n].call(t,a)})}):(ge.touchEventsSupported&&D(Gh.touch,function(n){nc(e,n,function(a){r[n].call(t,a),wA(e)})}),D(Gh.mouse,function(n){nc(e,n,function(a){a=Oh(a),e.touching||r[n].call(t,a)})}))}function CA(t,e){ge.pointerEventsSupported?D(L0.pointer,r):ge.touchEventsSupported||D(L0.mouse,r);function r(n){function a(i){i=Oh(i),R0(t,i.target)||(i=SA(t,i),e.domHandlers[n].call(t,i))}nc(e,n,a,{capture:!0})}}function nc(t,e,r,n){t.mounted[e]=r,t.listenerOpts[e]=n,sA(t.domTarget,e,r,n)}function Yh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&lA(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var E0=(function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t})(),MA=(function(t){Z(e,t);function e(r,n){var a=t.call(this)||this;return a.__pointerCapturing=!1,a.dom=r,a.painterRoot=n,a._localHandlerScope=new E0(r,pr),Vh&&(a._globalHandlerScope=new E0(document,Uh)),TA(a,a._localHandlerScope),a}return e.prototype.dispose=function(){Yh(this._localHandlerScope),Vh&&Yh(this._globalHandlerScope)},e.prototype.setCursor=function(r){this.dom.style&&(this.dom.style.cursor=r||"default")},e.prototype.__togglePointerCapture=function(r){if(this.__mayPointerCapture=null,Vh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var n=this._globalHandlerScope;r?CA(this,n):Yh(n)}},e})(ur);var ac={},O0={};function AA(t){delete O0[t]}function DA(t){if(!t)return!1;if(typeof t=="string")return Vs(t,1)<$u;if(t.colorStops){for(var e=t.colorStops,r=0,n=e.length,a=0;a<n;a++)r+=Vs(e[a].color,1);return r/=n,r<$u}return!1}var IA=(function(){function t(e,r,n){var a=this;this._sleepAfterStill=10,this._stillFrameAccum=0,this._needsRefresh=!0,this._needsRefreshHover=!0,this._darkMode=!1,n=n||{},this.dom=r,this.id=e;var i=new _A,o=n.renderer||"canvas";ac[o]||(o=Qe(ac)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var s=new ac[o](r,i,n,e),l=n.ssr||s.ssrOnly;this.storage=i,this.painter=s;var c=!ge.node&&!ge.worker&&!l?new MA(s.getViewportRoot(),s.root):null,u=n.useCoarsePointer,f=u==null||u==="auto"?ge.touchEventsSupported:!!u,h=44,d;f&&(d=Ce(n.pointerSize,h)),this.handler=new S0(i,s,c,s.root,d),this.animation=new bA({stage:{update:l?null:function(){return a._flush(!0)}}}),l||this.animation.start()}return t.prototype.add=function(e){this._disposed||!e||(this.storage.addRoot(e),e.addSelfToZr(this),this.refresh())},t.prototype.remove=function(e){this._disposed||!e||(this.storage.delRoot(e),e.removeSelfFromZr(this),this.refresh())},t.prototype.configLayer=function(e,r){this._disposed||(this.painter.configLayer&&this.painter.configLayer(e,r),this.refresh())},t.prototype.setBackgroundColor=function(e){this._disposed||(this.painter.setBackgroundColor&&this.painter.setBackgroundColor(e),this.refresh(),this._backgroundColor=e,this._darkMode=DA(e))},t.prototype.getBackgroundColor=function(){return this._backgroundColor},t.prototype.setDarkMode=function(e){this._darkMode=e},t.prototype.isDarkMode=function(){return this._darkMode},t.prototype.refreshImmediately=function(e){this._disposed||(e||this.animation.update(!0),this._needsRefresh=!1,this.painter.refresh(),this._needsRefresh=!1)},t.prototype.refresh=function(){this._disposed||(this._needsRefresh=!0,this.animation.start())},t.prototype.flush=function(){this._disposed||this._flush(!1)},t.prototype._flush=function(e){var r,n=gi();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var a=gi();r?(this._stillFrameAccum=0,this.trigger("rendered",{elapsedTime:a-n})):this._sleepAfterStill>0&&(this._stillFrameAccum++,this._stillFrameAccum>this._sleepAfterStill&&this.animation.stop())},t.prototype.setSleepAfterStill=function(e){this._sleepAfterStill=e},t.prototype.wakeUp=function(){this._disposed||(this.animation.start(),this._stillFrameAccum=0)},t.prototype.refreshHover=function(){this._needsRefreshHover=!0},t.prototype.refreshHoverImmediately=function(){this._disposed||(this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.getType()==="canvas"&&this.painter.refreshHover())},t.prototype.resize=function(e){this._disposed||(e=e||{},this.painter.resize(e.width,e.height),this.handler.resize())},t.prototype.clearAnimation=function(){this._disposed||this.animation.clear()},t.prototype.getWidth=function(){if(!this._disposed)return this.painter.getWidth()},t.prototype.getHeight=function(){if(!this._disposed)return this.painter.getHeight()},t.prototype.setCursorStyle=function(e){this._disposed||this.handler.setCursorStyle(e)},t.prototype.findHover=function(e,r){if(!this._disposed)return this.handler.findHover(e,r)},t.prototype.on=function(e,r,n){return this._disposed||this.handler.on(e,r,n),this},t.prototype.off=function(e,r){this._disposed||this.handler.off(e,r)},t.prototype.trigger=function(e,r){this._disposed||this.handler.trigger(e,r)},t.prototype.clear=function(){if(!this._disposed){for(var e=this.storage.getRoots(),r=0;r<e.length;r++)e[r]instanceof mt&&e[r].removeSelfFromZr(this);this.storage.delAllRoots(),this.painter.clear()}},t.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,AA(this.id))},t})();function N0(t,e){var r=new IA(lv(),t,e);return O0[r.id]=r,r}function LA(t,e){ac[t]=e}var B0="";typeof navigator<"u"&&(B0=navigator.platform||"");var mi="rgba(0, 0, 0, 0.2)";const PA={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:mi,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:mi,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:mi,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:mi,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:mi,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:mi,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:B0.match(/^Win/)?"Microsoft YaHei":"sans-serif",fontSize:12,fontStyle:"normal",fontWeight:"normal"},blendMode:null,stateAnimation:{duration:300,easing:"cubicOut"},animation:"auto",animationDuration:1e3,animationDurationUpdate:500,animationEasing:"cubicInOut",animationEasingUpdate:"cubicInOut",animationThreshold:2e3,progressiveThreshold:3e3,progressive:400,hoverLayerThreshold:3e3,useUTC:!1};var RA=de();function EA(t,e,r){var n=RA.get(e);if(!n)return r;var a=n(t);return a?r.concat(a):r}var ic,Do,z0,F0="\0_ec_inner",OA=1,qh=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(r,n,a,i,o,s){i=i||{},this.option=null,this._theme=new et(i),this._locale=new et(o),this._optionManager=s},e.prototype.setOption=function(r,n,a){var i=G0(n);this._optionManager.setOption(r,a,i),this._resetOption(null,i)},e.prototype.resetOption=function(r,n){return this._resetOption(r,G0(n))},e.prototype._resetOption=function(r,n){var a=!1,i=this._optionManager;if(!r||r==="recreate"){var o=i.mountOption(r==="recreate");!this.option||r==="recreate"?z0(this,o):(this.restoreData(),this._mergeOption(o,n)),a=!0}if((r==="timeline"||r==="media")&&this.restoreData(),!r||r==="recreate"||r==="timeline"){var s=i.getTimelineOption(this);s&&(a=!0,this._mergeOption(s,n))}if(!r||r==="recreate"||r==="media"){var l=i.getMediaOption(this);l.length&&D(l,function(c){a=!0,this._mergeOption(c,n)},this)}return a},e.prototype.mergeOption=function(r){this._mergeOption(r,null)},e.prototype._mergeOption=function(r,n){var a=this.option,i=this._componentsMap,o=this._componentsCount,s=[],l=de(),c=n&&n.replaceMergeMainTypeMap;i2(this),D(r,function(f,h){f!=null&&(We.hasClass(h)?h&&(s.push(h),l.set(h,!0)):a[h]=a[h]==null?Te(f):De(a[h],f,!0))}),c&&c.each(function(f,h){We.hasClass(h)&&!l.get(h)&&(s.push(h),l.set(h,!0))}),We.topologicalTravel(s,We.getAllClassMainTypes(),u,this);function u(f){var h=EA(this,f,_t(r[f])),d=i.get(f),p=d?c&&c.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=xk(d,h,p);Ak(m,f,We),a[f]=null,i.set(f,null),o.set(f,0);var g=[],v=[],y=0,b;D(m,function(x,S){var w=x.existing,k=x.newOption;if(!k)w&&(w.mergeOption({},this),w.optionUpdated({},!1));else{var T=f==="series",C=We.getClass(f,x.keyInfo.subType,!T);if(!C)return;if(f==="tooltip"){if(b)return;b=!0}if(w&&w.constructor===C)w.name=x.keyInfo.name,w.mergeOption(k,this),w.optionUpdated(k,!1);else{var A=U({componentIndex:S},x.keyInfo);w=new C(k,this,this,A),U(w,A),x.brandNew&&(w.__requireNewView=!0),w.init(k,this,this),w.optionUpdated(null,!0)}}w?(g.push(w.option),v.push(w),y++):(g.push(void 0),v.push(void 0))},this),a[f]=g,i.set(f,v),o.set(f,y),f==="series"&&ic(this)}this._seriesIndices||ic(this)},e.prototype.getOption=function(){var r=Te(this.option);return D(r,function(n,a){if(We.hasClass(a)){for(var i=_t(n),o=i.length,s=!1,l=o-1;l>=0;l--)i[l]&&!io(i[l])?s=!0:(i[l]=null,!s&&o--);i.length=o,r[a]=i}}),delete r[F0],r},e.prototype.getTheme=function(){return this._theme},e.prototype.getLocaleModel=function(){return this._locale},e.prototype.setUpdatePayload=function(r){this._payload=r},e.prototype.getUpdatePayload=function(){return this._payload},e.prototype.getComponent=function(r,n){var a=this._componentsMap.get(r);if(a){var i=a[n||0];if(i)return i;if(n==null){for(var o=0;o<a.length;o++)if(a[o])return a[o]}}},e.prototype.queryComponents=function(r){var n=r.mainType;if(!n)return[];var a=r.index,i=r.id,o=r.name,s=this._componentsMap.get(n);if(!s||!s.length)return[];var l;return a!=null?(l=[],D(_t(a),function(c){s[c]&&l.push(s[c])})):i!=null?l=H0("id",i,s):o!=null?l=H0("name",o,s):l=dt(s,function(c){return!!c}),V0(l,r)},e.prototype.findComponents=function(r){var n=r.query,a=r.mainType,i=s(n),o=i?this.queryComponents(i):dt(this._componentsMap.get(a),function(c){return!!c});return l(V0(o,r));function s(c){var u=a+"Index",f=a+"Id",h=a+"Name";return c&&(c[u]!=null||c[f]!=null||c[h]!=null)?{mainType:a,index:c[u],id:c[f],name:c[h]}:null}function l(c){return r.filter?dt(c,r.filter):c}},e.prototype.eachComponent=function(r,n,a){var i=this._componentsMap;if(ye(r)){var o=n,s=r;i.each(function(f,h){for(var d=0;f&&d<f.length;d++){var p=f[d];p&&s.call(o,h,p,p.componentIndex)}})}else for(var l=ne(r)?i.get(r):ce(r)?this.findComponents(r):null,c=0;l&&c<l.length;c++){var u=l[c];u&&n.call(a,u,u.componentIndex)}},e.prototype.getSeriesByName=function(r){var n=Rr(r,null);return dt(this._componentsMap.get("series"),function(a){return!!a&&n!=null&&a.name===n})},e.prototype.getSeriesByIndex=function(r){return this._componentsMap.get("series")[r]},e.prototype.getSeriesByType=function(r){return dt(this._componentsMap.get("series"),function(n){return!!n&&n.subType===r})},e.prototype.getSeries=function(){return dt(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,n){Do(this),D(this._seriesIndices,function(a){var i=this._componentsMap.get("series")[a];r.call(n,i,a)},this)},e.prototype.eachRawSeries=function(r,n){D(this._componentsMap.get("series"),function(a){a&&r.call(n,a,a.componentIndex)})},e.prototype.eachSeriesByType=function(r,n,a){Do(this),D(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];o.subType===r&&n.call(a,o,i)},this)},e.prototype.eachRawSeriesByType=function(r,n,a){return D(this.getSeriesByType(r),n,a)},e.prototype.isSeriesFiltered=function(r){return Do(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,n){Do(this);var a=[];D(this._seriesIndices,function(i){var o=this._componentsMap.get("series")[i];r.call(n,o,i)&&a.push(i)},this),this._seriesIndices=a,this._seriesIndicesMap=de(a)},e.prototype.restoreData=function(r){ic(this);var n=this._componentsMap,a=[];n.each(function(i,o){We.hasClass(o)&&a.push(o)}),We.topologicalTravel(a,We.getAllClassMainTypes(),function(i){D(n.get(i),function(o){o&&(i!=="series"||!NA(o,r))&&o.restoreData()})})},e.internalField=(function(){ic=function(r){var n=r._seriesIndices=[];D(r._componentsMap.get("series"),function(a){a&&n.push(a.componentIndex)}),r._seriesIndicesMap=de(n)},Do=function(r){},z0=function(r,n){r.option={},r.option[F0]=OA,r._componentsMap=de({series:[]}),r._componentsCount=de();var a=n.aria;ce(a)&&a.enabled==null&&(a.enabled=!0),BA(n,r._theme.option),De(n,PA,!1),r._mergeOption(n,null)}})(),e})(et);function NA(t,e){if(e){var r=e.seriesIndex,n=e.seriesId,a=e.seriesName;return r!=null&&t.componentIndex!==r||n!=null&&t.id!==n||a!=null&&t.name!==a}}function BA(t,e){var r=t.color&&!t.colorLayer;D(e,function(n,a){a==="colorLayer"&&r||We.hasClass(a)||(typeof n=="object"?t[a]=t[a]?De(t[a],n,!1):Te(n):t[a]==null&&(t[a]=n))})}function H0(t,e,r){if(ee(e)){var n=de();return D(e,function(i){if(i!=null){var o=Rr(i,null);o!=null&&n.set(i,!0)}}),dt(r,function(i){return i&&n.get(i[t])})}else{var a=Rr(e,null);return dt(r,function(i){return i&&a!=null&&i[t]===a})}}function V0(t,e){return e.hasOwnProperty("subType")?dt(t,function(r){return r&&r.subType===e.subType}):t}function G0(t){var e=de();return t&&D(_t(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}Cr(qh,hh);var zA=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],$0=(function(){function t(e){D(zA,function(r){this[r]=Le(e[r],e)},this)}return t})(),FA=/^(min|max)?(.+)$/,HA=(function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,n){e&&(D(_t(e.series),function(o){o&&o.data&&It(o.data)&&yu(o.data)}),D(_t(e.dataset),function(o){o&&o.source&&It(o.source)&&yu(o.source)})),e=Te(e);var a=this._optionBackup,i=VA(e,r,!a);this._newBaseOption=i.baseOption,a?(i.timelineOptions.length&&(a.timelineOptions=i.timelineOptions),i.mediaList.length&&(a.mediaList=i.mediaList),i.mediaDefault&&(a.mediaDefault=i.mediaDefault)):this._optionBackup=i},t.prototype.mountOption=function(e){var r=this._optionBackup;return this._timelineOptions=r.timelineOptions,this._mediaList=r.mediaList,this._mediaDefault=r.mediaDefault,this._currentMediaIndices=[],Te(e?r.baseOption:this._newBaseOption)},t.prototype.getTimelineOption=function(e){var r,n=this._timelineOptions;if(n.length){var a=e.getComponent("timeline");a&&(r=Te(n[a.getCurrentIndex()]))}return r},t.prototype.getMediaOption=function(e){var r=this._api.getWidth(),n=this._api.getHeight(),a=this._mediaList,i=this._mediaDefault,o=[],s=[];if(!a.length&&!i)return s;for(var l=0,c=a.length;l<c;l++)GA(a[l].query,r,n)&&o.push(l);return!o.length&&i&&(o=[-1]),o.length&&!WA(o,this._currentMediaIndices)&&(s=ue(o,function(u){return Te(u===-1?i.option:a[u].option)})),this._currentMediaIndices=o,s},t})();function VA(t,e,r){var n=[],a,i,o=t.baseOption,s=t.timeline,l=t.options,c=t.media,u=!!t.media,f=!!(l||s||o&&o.timeline);o?(i=o,i.timeline||(i.timeline=s)):((f||u)&&(t.options=t.media=null),i=t),u&&ee(c)&&D(c,function(d){d&&d.option&&(d.query?n.push(d):a||(a=d))}),h(i),D(l,function(d){return h(d)}),D(n,function(d){return h(d.option)});function h(d){D(e,function(p){p(d,r)})}return{baseOption:i,timelineOptions:l||[],mediaDefault:a,mediaList:n}}function GA(t,e,r){var n={width:e,height:r,aspectratio:e/r},a=!0;return D(t,function(i,o){var s=o.match(FA);if(!(!s||!s[1]||!s[2])){var l=s[1],c=s[2].toLowerCase();$A(n[c],i,l)||(a=!1)}}),a}function $A(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function WA(t,e){return t.join(",")===e.join(",")}var vr=D,Io=ce,W0=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Xh(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=W0.length;r<n;r++){var a=W0[r],i=e.normal,o=e.emphasis;i&&i[a]&&(t[a]=t[a]||{},t[a].normal?De(t[a].normal,i[a]):t[a].normal=i[a],i[a]=null),o&&o[a]&&(t[a]=t[a]||{},t[a].emphasis?De(t[a].emphasis,o[a]):t[a].emphasis=o[a],o[a]=null)}}function xt(t,e,r){if(t&&t[e]&&(t[e].normal||t[e].emphasis)){var n=t[e].normal,a=t[e].emphasis;n&&(r?(t[e].normal=t[e].emphasis=null,Ne(t[e],n)):t[e]=n),a&&(t.emphasis=t.emphasis||{},t.emphasis[e]=a,a.focus&&(t.emphasis.focus=a.focus),a.blurScope&&(t.emphasis.blurScope=a.blurScope))}}function Lo(t){xt(t,"itemStyle"),xt(t,"lineStyle"),xt(t,"areaStyle"),xt(t,"label"),xt(t,"labelLine"),xt(t,"upperLabel"),xt(t,"edgeLabel")}function ot(t,e){var r=Io(t)&&t[e],n=Io(r)&&r.textStyle;if(n)for(var a=0,i=Sg.length;a<i;a++){var o=Sg[a];n.hasOwnProperty(o)&&(r[o]=n[o])}}function or(t){t&&(Lo(t),ot(t,"label"),t.emphasis&&ot(t.emphasis,"label"))}function UA(t){if(Io(t)){Xh(t),Lo(t),ot(t,"label"),ot(t,"upperLabel"),ot(t,"edgeLabel"),t.emphasis&&(ot(t.emphasis,"label"),ot(t.emphasis,"upperLabel"),ot(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Xh(e),or(e));var r=t.markLine;r&&(Xh(r),or(r));var n=t.markArea;n&&or(n);var a=t.data;if(t.type==="graph"){a=a||t.nodes;var i=t.links||t.edges;if(i&&!It(i))for(var o=0;o<i.length;o++)or(i[o]);D(t.categories,function(c){Lo(c)})}if(a&&!It(a))for(var o=0;o<a.length;o++)or(a[o]);if(e=t.markPoint,e&&e.data)for(var s=e.data,o=0;o<s.length;o++)or(s[o]);if(r=t.markLine,r&&r.data)for(var l=r.data,o=0;o<l.length;o++)ee(l[o])?(or(l[o][0]),or(l[o][1])):or(l[o]);t.type==="gauge"?(ot(t,"axisLabel"),ot(t,"title"),ot(t,"detail")):t.type==="treemap"?(xt(t.breadcrumb,"itemStyle"),D(t.levels,function(c){Lo(c)})):t.type==="tree"&&Lo(t.leaves)}}function rn(t){return ee(t)?t:t?[t]:[]}function U0(t){return(ee(t)?t[0]:t)||{}}function YA(t,e){vr(rn(t.series),function(n){Io(n)&&UA(n)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),vr(r,function(n){vr(rn(t[n]),function(a){a&&(ot(a,"axisLabel"),ot(a.axisPointer,"label"))})}),vr(rn(t.parallel),function(n){var a=n&&n.parallelAxisDefault;ot(a,"axisLabel"),ot(a&&a.axisPointer,"label")}),vr(rn(t.calendar),function(n){xt(n,"itemStyle"),ot(n,"dayLabel"),ot(n,"monthLabel"),ot(n,"yearLabel")}),vr(rn(t.radar),function(n){ot(n,"name"),n.name&&n.axisName==null&&(n.axisName=n.name,delete n.name),n.nameGap!=null&&n.axisNameGap==null&&(n.axisNameGap=n.nameGap,delete n.nameGap)}),vr(rn(t.geo),function(n){Io(n)&&(or(n),vr(rn(n.regions),function(a){or(a)}))}),vr(rn(t.timeline),function(n){or(n),xt(n,"label"),xt(n,"itemStyle"),xt(n,"controlStyle",!0);var a=n.data;ee(a)&&D(a,function(i){ce(i)&&(xt(i,"label"),xt(i,"itemStyle"))})}),vr(rn(t.toolbox),function(n){xt(n,"iconStyle"),vr(n.feature,function(a){xt(a,"iconStyle")})}),ot(U0(t.axisPointer),"label"),ot(U0(t.tooltip).axisPointer,"label")}function qA(t,e){for(var r=e.split(","),n=t,a=0;a<r.length&&(n=n&&n[r[a]],n!=null);a++);return n}function XA(t,e,r,n){for(var a=e.split(","),i=t,o,s=0;s<a.length-1;s++)o=a[s],i[o]==null&&(i[o]={}),i=i[o];i[a[s]]==null&&(i[a[s]]=r)}function Y0(t){t&&D(ZA,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var ZA=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],KA=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Zh=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function Po(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<Zh.length;r++){var n=Zh[r][1],a=Zh[r][0];e[n]!=null&&(e[a]=e[n])}}function q0(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function X0(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function jA(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function Z0(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&Z0(t[r].children,e)}function K0(t,e){YA(t,e),t.series=_t(t.series),D(t.series,function(r){if(ce(r)){var n=r.type;if(n==="line")r.clipOverflow!=null&&(r.clip=r.clipOverflow);else if(n==="pie"||n==="gauge"){r.clockWise!=null&&(r.clockwise=r.clockWise),q0(r.label);var a=r.data;if(a&&!It(a))for(var i=0;i<a.length;i++)q0(a[i]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(n==="gauge"){var o=qA(r,"pointer.color");o!=null&&XA(r,"itemStyle.color",o)}else if(n==="bar"){Po(r),Po(r.backgroundStyle),Po(r.emphasis);var a=r.data;if(a&&!It(a))for(var i=0;i<a.length;i++)typeof a[i]=="object"&&(Po(a[i]),Po(a[i]&&a[i].emphasis))}else if(n==="sunburst"){var s=r.highlightPolicy;s&&(r.emphasis=r.emphasis||{},r.emphasis.focus||(r.emphasis.focus=s)),X0(r),Z0(r.data,X0)}else n==="graph"||n==="sankey"?jA(r):n==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&Ne(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),Y0(r)}}),t.dataRange&&(t.visualMap=t.dataRange),D(KA,function(r){var n=t[r];n&&(ee(n)||(n=[n]),D(n,function(a){Y0(a)}))})}function QA(t){var e=de();t.eachSeries(function(r){var n=r.get("stack");if(n){var a=e.get(n)||e.set(n,[]),i=r.getData(),o={stackResultDimension:i.getCalculationInfo("stackResultDimension"),stackedOverDimension:i.getCalculationInfo("stackedOverDimension"),stackedDimension:i.getCalculationInfo("stackedDimension"),stackedByDimension:i.getCalculationInfo("stackedByDimension"),isStackedByIndex:i.getCalculationInfo("isStackedByIndex"),data:i,seriesModel:r};if(!o.stackedDimension||!(o.isStackedByIndex||o.stackedByDimension))return;a.length&&i.setCalculationInfo("stackedOnSeries",a[a.length-1].seriesModel),a.push(o)}}),e.each(JA)}function JA(t){D(t,function(e,r){var n=[],a=[NaN,NaN],i=[e.stackResultDimension,e.stackedOverDimension],o=e.data,s=e.isStackedByIndex,l=e.seriesModel.get("stackStrategy")||"samesign";o.modify(i,function(c,u,f){var h=o.get(e.stackedDimension,f);if(isNaN(h))return a;var d,p;s?p=o.getRawIndex(f):d=o.get(e.stackedByDimension,f);for(var m=NaN,g=r-1;g>=0;g--){var v=t[g];if(s||(p=v.data.rawIndexOf(v.stackedByDimension,d)),p>=0){var y=v.data.getByRawIndex(v.stackResultDimension,p);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&h>=0&&y>0||l==="samesign"&&h<=0&&y<0){h=vk(h,y),m=y;break}}}return n[0]=h,n[1]=m,n})})}var gr=(function(){function t(){this.group=new mt,this.uid=El("viewComponent")}return t.prototype.init=function(e,r){},t.prototype.render=function(e,r,n,a){},t.prototype.dispose=function(e,r){},t.prototype.updateView=function(e,r,n,a){},t.prototype.updateLayout=function(e,r,n,a){},t.prototype.updateVisual=function(e,r,n,a){},t.prototype.toggleBlurSeries=function(e,r,n){},t.prototype.eachRendered=function(e){var r=this.group;r&&r.traverse(e)},t})();_u(gr),Ms(gr);var j0=it(),Q0={itemStyle:$i(xm,!0),lineStyle:$i(bm,!0)},eD={lineStyle:"stroke",itemStyle:"fill"};function J0(t,e){var r=t.visualStyleMapper||Q0[e];return r||(console.warn("Unknown style type '"+e+"'."),Q0.itemStyle)}function e_(t,e){var r=t.visualDrawType||eD[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var tD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=t.getModel(n),i=J0(t,n),o=i(a),s=a.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=e_(t,n),c=o[l],u=ye(c)?c:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||u||f){var h=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=h,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ye(o.fill)?h:o.fill,o.stroke=o.stroke==="auto"||ye(o.stroke)?h:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&u)return r.setVisual("colorFromPalette",!1),{dataEach:function(d,p){var m=t.getDataParams(p),g=U({},o);g[l]=u(m),d.setItemVisual(p,"style",g)}}}},Ro=new et,rD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=J0(t,n),i=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){Ro.option=l[n];var c=a(Ro),u=o.ensureUniqueItemVisual(s,"style");U(u,c),Ro.option.decal&&(o.setItemVisual(s,"decal",Ro.option.decal),Ro.option.decal.dirty=!0),i in c&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},nD={performRawSeries:!0,overallReset:function(t){var e=de();t.eachSeries(function(r){var n=r.getColorBy();if(!r.isColorBySeries()){var a=r.type+"-"+n,i=e.get(a);i||(i={},e.set(a,i)),j0(r).scope=i}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var n=r.getRawData(),a={},i=r.getData(),o=j0(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=e_(r,s);i.each(function(c){var u=i.getRawIndex(c);a[u]=c}),n.each(function(c){var u=a[c],f=i.getItemVisual(u,"colorFromPalette");if(f){var h=i.ensureUniqueItemVisual(u,"style"),d=n.getName(c)||c+"",p=n.count();h[l]=r.getColorFromPalette(d,o,p)}})}})}},oc=Math.PI;function aD(t,e){e=e||{},Ne(e,{text:"loading",textColor:"#000",fontSize:12,fontWeight:"normal",fontStyle:"normal",fontFamily:"sans-serif",maskColor:"rgba(255, 255, 255, 0.8)",showSpinner:!0,color:"#5470c6",spinnerRadius:10,lineWidth:5,zlevel:0});var r=new mt,n=new ft({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var a=new Pt({style:{text:e.text,fill:e.textColor,fontSize:e.fontSize,fontWeight:e.fontWeight,fontStyle:e.fontStyle,fontFamily:e.fontFamily},zlevel:e.zlevel,z:10001}),i=new ft({style:{fill:"none"},textContent:a,textConfig:{position:"right",distance:10},zlevel:e.zlevel,z:10001});r.add(i);var o;return e.showSpinner&&(o=new gl({shape:{startAngle:-oc/2,endAngle:-oc/2+.1,r:e.spinnerRadius},style:{stroke:e.color,lineCap:"round",lineWidth:e.lineWidth},zlevel:e.zlevel,z:10001}),o.animateShape(!0).when(1e3,{endAngle:oc*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:oc*3/2}).delay(300).start("circularInOut"),r.add(o)),r.resize=function(){var s=a.getBoundingRect().width,l=e.showSpinner?e.spinnerRadius:0,c=(t.getWidth()-l*2-(e.showSpinner&&s?10:0)-s)/2-(e.showSpinner&&s?0:5+s/2)+(e.showSpinner?0:s/2)+(s?0:l),u=t.getHeight()/2;e.showSpinner&&o.setShape({cx:c,cy:u}),i.setShape({x:c-l,y:u-l,width:l*2,height:l*2}),n.setShape({x:0,y:0,width:t.getWidth(),height:t.getHeight()})},r.resize(),r}var t_=(function(){function t(e,r,n,a){this._stageTaskMap=de(),this.ecInstance=e,this.api=r,n=this._dataProcessorHandlers=n.slice(),a=this._visualHandlers=a.slice(),this._allHandlers=n.concat(a)}return t.prototype.restoreData=function(e,r){e.restoreData(r),this._stageTaskMap.each(function(n){var a=n.overallTask;a&&a.dirty()})},t.prototype.getPerformArgs=function(e,r){if(e.__pipeline){var n=this._pipelineMap.get(e.__pipeline.id),a=n.context,i=!r&&n.progressiveEnabled&&(!a||a.progressiveRender)&&e.__idxInPipeline>n.blockIndex,o=i?n.step:null,s=a&&a.modDataCount,l=s!=null?Math.ceil(s/o):null;return{step:o,modBy:l,modDataCount:s}}},t.prototype.getPipeline=function(e){return this._pipelineMap.get(e)},t.prototype.updateStreamModes=function(e,r){var n=this._pipelineMap.get(e.uid),a=e.getData(),i=a.count(),o=n.progressiveEnabled&&r.incrementalPrepareRender&&i>=n.threshold,s=e.get("large")&&i>=e.get("largeThreshold"),l=e.get("progressiveChunkMode")==="mod"?i:null;e.pipelineContext=n.context={progressiveRender:o,modDataCount:l,large:s}},t.prototype.restorePipelines=function(e){var r=this,n=r._pipelineMap=de();e.eachSeries(function(a){var i=a.getProgressive(),o=a.uid;n.set(o,{id:o,head:null,tail:null,threshold:a.getProgressiveThreshold(),progressiveEnabled:i&&!(a.preventIncremental&&a.preventIncremental()),blockIndex:-1,step:Math.round(i||700),count:0}),r._pipe(a,a.dataTask)})},t.prototype.prepareStageTasks=function(){var e=this._stageTaskMap,r=this.api.getModel(),n=this.api;D(this._allHandlers,function(a){var i=e.get(a.uid)||e.set(a.uid,{}),o="";Ur(!(a.reset&&a.overallReset),o),a.reset&&this._createSeriesStageTask(a,i,r,n),a.overallReset&&this._createOverallStageTask(a,i,r,n)},this)},t.prototype.prepareView=function(e,r,n,a){var i=e.renderTask,o=i.context;o.model=r,o.ecModel=n,o.api=a,i.__block=!e.incrementalPrepareRender,this._pipe(r,i)},t.prototype.performDataProcessorTasks=function(e,r){this._performStageTasks(this._dataProcessorHandlers,e,r,{block:!0})},t.prototype.performVisualTasks=function(e,r,n){this._performStageTasks(this._visualHandlers,e,r,n)},t.prototype._performStageTasks=function(e,r,n,a){a=a||{};var i=!1,o=this;D(e,function(l,c){if(!(a.visualType&&a.visualType!==l.visualType)){var u=o._stageTaskMap.get(l.uid),f=u.seriesTaskMap,h=u.overallTask;if(h){var d,p=h.agentStubMap;p.each(function(g){s(a,g)&&(g.dirty(),d=!0)}),d&&h.dirty(),o.updatePayload(h,n);var m=o.getPerformArgs(h,a.block);p.each(function(g){g.perform(m)}),h.perform(m)&&(i=!0)}else f&&f.each(function(g,v){s(a,g)&&g.dirty();var y=o.getPerformArgs(g,a.block);y.skip=!l.performRawSeries&&r.isSeriesFiltered(g.context.model),o.updatePayload(g,n),g.perform(y)&&(i=!0)})}});function s(l,c){return l.setDirty&&(!l.dirtyMap||l.dirtyMap.get(c.__pipeline.id))}this.unfinished=i||this.unfinished},t.prototype.performSeriesTasks=function(e){var r;e.eachSeries(function(n){r=n.dataTask.perform()||r}),this.unfinished=r||this.unfinished},t.prototype.plan=function(){this._pipelineMap.each(function(e){var r=e.tail;do{if(r.__block){e.blockIndex=r.__idxInPipeline;break}r=r.getUpstream()}while(r)})},t.prototype.updatePayload=function(e,r){r!=="remain"&&(e.context.payload=r)},t.prototype._createSeriesStageTask=function(e,r,n,a){var i=this,o=r.seriesTaskMap,s=r.seriesTaskMap=de(),l=e.seriesType,c=e.getTargetSeries;e.createOnAllSeries?n.eachRawSeries(u):l?n.eachRawSeriesByType(l,u):c&&c(n,a).each(u);function u(f){var h=f.uid,d=s.set(h,o&&o.get(h)||To({plan:cD,reset:uD,count:hD}));d.context={model:f,ecModel:n,api:a,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(f,d)}},t.prototype._createOverallStageTask=function(e,r,n,a){var i=this,o=r.overallTask=r.overallTask||To({reset:iD});o.context={ecModel:n,api:a,overallReset:e.overallReset,scheduler:i};var s=o.agentStubMap,l=o.agentStubMap=de(),c=e.seriesType,u=e.getTargetSeries,f=!0,h=!1,d="";Ur(!e.createOnAllSeries,d),c?n.eachRawSeriesByType(c,p):u?u(n,a).each(p):(f=!1,D(n.getSeries(),p));function p(m){var g=m.uid,v=l.set(g,s&&s.get(g)||(h=!0,To({reset:oD,onDirty:lD})));v.context={model:m,overallProgress:f},v.agent=o,v.__block=f,i._pipe(m,v)}h&&o.dirty()},t.prototype._pipe=function(e,r){var n=e.uid,a=this._pipelineMap.get(n);!a.head&&(a.head=r),a.tail&&a.tail.pipe(r),a.tail=r,r.__idxInPipeline=a.count++,r.__pipeline=a},t.wrapStageHandler=function(e,r){return ye(e)&&(e={overallReset:e,seriesType:dD(e)}),e.uid=El("stageHandler"),r&&(e.visualType=r),e},t})();function iD(t){t.overallReset(t.ecModel,t.api,t.payload)}function oD(t){return t.overallProgress&&sD}function sD(){this.agent.dirty(),this.getDownstream().dirty()}function lD(){this.agent&&this.agent.dirty()}function cD(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function uD(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=_t(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?ue(e,function(r,n){return r_(n)}):fD}var fD=r_(0);function r_(t){return function(e,r){var n=r.data,a=r.resetDefines[t];if(a&&a.dataEach)for(var i=e.start;i<e.end;i++)a.dataEach(n,i);else a&&a.progress&&a.progress(e,n)}}function hD(t){return t.data.count()}function dD(t){sc=null;try{t(Eo,n_)}catch{}return sc}var Eo={},n_={},sc;a_(Eo,qh),a_(n_,$0),Eo.eachSeriesByType=Eo.eachRawSeriesByType=function(t){sc=t},Eo.eachComponent=function(t){t.mainType==="series"&&t.subType&&(sc=t.subType)};function a_(t,e){for(var r in e.prototype)t[r]=Ct}var i_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const pD={color:i_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],i_]};var wt="#B9B8CE",o_="#100C2A",lc=function(){return{axisLine:{lineStyle:{color:wt}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},s_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],l_={darkMode:!0,color:s_,backgroundColor:o_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:wt},pageTextStyle:{color:wt}},textStyle:{color:wt},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:wt}},dataZoom:{borderColor:"#71708A",textStyle:{color:wt},brushStyle:{color:"rgba(135,163,206,0.3)"},handleStyle:{color:"#353450",borderColor:"#C5CBE3"},moveHandleStyle:{color:"#B0B6C3",opacity:.3},fillerColor:"rgba(135,163,206,0.2)",emphasis:{handleStyle:{borderColor:"#91B7F2",color:"#4D587D"},moveHandleStyle:{color:"#636D9A",opacity:.7}},dataBackground:{lineStyle:{color:"#71708A",width:1},areaStyle:{color:"#71708A"}},selectedDataBackground:{lineStyle:{color:"#87A3CE"},areaStyle:{color:"#87A3CE"}}},visualMap:{textStyle:{color:wt}},timeline:{lineStyle:{color:wt},label:{color:wt},controlStyle:{color:wt,borderColor:wt}},calendar:{itemStyle:{color:o_},dayLabel:{color:wt},monthLabel:{color:wt},yearLabel:{color:wt}},timeAxis:lc(),logAxis:lc(),valueAxis:lc(),categoryAxis:lc(),line:{symbol:"circle"},graph:{color:s_},gauge:{title:{color:wt},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:wt},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};l_.categoryAxis.splitLine.show=!1;var vD=(function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},n={},a={};if(ne(e)){var i=Ar(e);r.mainType=i.main||null,r.subType=i.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};D(e,function(l,c){for(var u=!1,f=0;f<o.length;f++){var h=o[f],d=c.lastIndexOf(h);if(d>0&&d===c.length-h.length){var p=c.slice(0,d);p!=="data"&&(r.mainType=p,r[h.toLowerCase()]=l,u=!0)}}s.hasOwnProperty(c)&&(n[c]=l,u=!0),u||(a[c]=l)})}return{cptQuery:r,dataQuery:n,otherQuery:a}},t.prototype.filter=function(e,r){var n=this.eventInfo;if(!n)return!0;var a=n.targetEl,i=n.packedEvent,o=n.model,s=n.view;if(!o||!s)return!0;var l=r.cptQuery,c=r.dataQuery;return u(l,o,"mainType")&&u(l,o,"subType")&&u(l,o,"index","componentIndex")&&u(l,o,"name")&&u(l,o,"id")&&u(c,i,"name")&&u(c,i,"dataIndex")&&u(c,i,"dataType")&&(!s.filterForExposedEvent||s.filterForExposedEvent(e,r.otherQuery,a,i));function u(f,h,d,p){return f[d]==null||h[p||d]===f[d]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t})(),Kh=["symbol","symbolSize","symbolRotate","symbolOffset"],c_=Kh.concat(["symbolKeepAspect"]),gD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData();if(t.legendIcon&&r.setVisual("legendIcon",t.legendIcon),!t.hasSymbolVisual)return;for(var n={},a={},i=!1,o=0;o<Kh.length;o++){var s=Kh[o],l=t.get(s);ye(l)?(i=!0,a[s]=l):n[s]=l}if(n.symbol=n.symbol||t.defaultSymbol,r.setVisual(U({legendIcon:t.legendIcon||n.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},n)),e.isSeriesFiltered(t))return;var c=Qe(a);function u(f,h){for(var d=t.getRawValue(h),p=t.getDataParams(h),m=0;m<c.length;m++){var g=c[m];f.setItemVisual(h,g,a[g](d,p))}}return{dataEach:i?u:null}}},mD={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!t.hasSymbolVisual||e.isSeriesFiltered(t))return;var r=t.getData();function n(a,i){for(var o=a.getItemModel(i),s=0;s<c_.length;s++){var l=c_[s],c=o.getShallow(l,!0);c!=null&&a.setItemVisual(i,l,c)}}return{dataEach:r.hasItemOption?n:null}}};function yD(t,e,r){switch(r){case"color":var n=t.getItemVisual(e,"style");return n[t.getVisual("drawType")];case"opacity":return t.getItemVisual(e,"style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getItemVisual(e,r)}}function _D(t,e){switch(e){case"color":var r=t.getVisual("style");return r[t.getVisual("drawType")];case"opacity":return t.getVisual("style").opacity;case"symbol":case"symbolSize":case"liftZ":return t.getVisual(e)}}function Oo(t,e,r){for(var n;t&&!(e(t)&&(n=t,r));)t=t.__hostTarget||t.parent;return n}var bD=Math.round(Math.random()*9),xD=typeof Object.defineProperty=="function",wD=(function(){function t(){this._id="__ec_inner_"+bD++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var n=this._guard(e);return xD?Object.defineProperty(n,this._id,{value:r,enumerable:!1,configurable:!0}):n[this._id]=r,this},t.prototype.delete=function(e){return this.has(e)?(delete this._guard(e)[this._id],!0):!1},t.prototype.has=function(e){return!!this._guard(e)[this._id]},t.prototype._guard=function(e){if(e!==Object(e))throw TypeError("Value of WeakMap is not a non-null object.");return e},t})();function ga(t){return isFinite(t)}function SD(t,e,r){var n=e.x==null?0:e.x,a=e.x2==null?1:e.x2,i=e.y==null?0:e.y,o=e.y2==null?0:e.y2;e.global||(n=n*r.width+r.x,a=a*r.width+r.x,i=i*r.height+r.y,o=o*r.height+r.y),n=ga(n)?n:0,a=ga(a)?a:1,i=ga(i)?i:0,o=ga(o)?o:0;var s=t.createLinearGradient(n,i,a,o);return s}function kD(t,e,r){var n=r.width,a=r.height,i=Math.min(n,a),o=e.x==null?.5:e.x,s=e.y==null?.5:e.y,l=e.r==null?.5:e.r;e.global||(o=o*n+r.x,s=s*a+r.y,l=l*i),o=ga(o)?o:.5,s=ga(s)?s:.5,l=l>=0&&ga(l)?l:.5;var c=t.createRadialGradient(o,s,0,o,s,l);return c}function jh(t,e,r){for(var n=e.type==="radial"?kD(t,e,r):SD(t,e,r),a=e.colorStops,i=0;i<a.length;i++)n.addColorStop(a[i].offset,a[i].color);return n}function TD(t,e){if(t===e||!t&&!e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var r=0;r<t.length;r++)if(t[r]!==e[r])return!0;return!1}function cc(t){return parseInt(t,10)}function uc(t,e,r){var n=["width","height"][e],a=["clientWidth","clientHeight"][e],i=["paddingLeft","paddingTop"][e],o=["paddingRight","paddingBottom"][e];if(r[n]!=null&&r[n]!=="auto")return parseFloat(r[n]);var s=document.defaultView.getComputedStyle(t);return(t[a]||cc(s[n])||cc(t.style[n]))-(cc(s[i])||0)-(cc(s[o])||0)|0}function CD(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:Ke(t)?[t]:ee(t)?t:null}function u_(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&CD(e.lineDash,e.lineWidth),n=e.lineDashOffset;if(r){var a=e.strokeNoScale&&t.getLineScale?t.getLineScale():1;a&&a!==1&&(r=ue(r,function(i){return i/a}),n/=a)}return[r,n]}var MD=new ta(!0);function fc(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function f_(t){return typeof t=="string"&&t!=="none"}function hc(t){var e=t.fill;return e!=null&&e!=="none"}function h_(t,e){if(e.fillOpacity!=null&&e.fillOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.fillOpacity*e.opacity,t.fill(),t.globalAlpha=r}else t.fill()}function d_(t,e){if(e.strokeOpacity!=null&&e.strokeOpacity!==1){var r=t.globalAlpha;t.globalAlpha=e.strokeOpacity*e.opacity,t.stroke(),t.globalAlpha=r}else t.stroke()}function Qh(t,e,r){var n=mv(e.image,e.__image,r);if(As(n)){var a=t.createPattern(n,e.repeat||"repeat");if(typeof DOMMatrix=="function"&&a&&a.setTransform){var i=new DOMMatrix;i.translateSelf(e.x||0,e.y||0),i.rotateSelf(0,0,(e.rotation||0)*Lw),i.scaleSelf(e.scaleX||1,e.scaleY||1),a.setTransform(i)}return a}}function AD(t,e,r,n){var a,i=fc(r),o=hc(r),s=r.strokePercent,l=s<1,c=!e.path;(!e.silent||l)&&c&&e.createPathProxy();var u=e.path||MD,f=e.__dirty;if(!n){var h=r.fill,d=r.stroke,p=o&&!!h.colorStops,m=i&&!!d.colorStops,g=o&&!!h.image,v=i&&!!d.image,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0;(p||m)&&(w=e.getBoundingRect()),p&&(y=f?jh(t,h,w):e.__canvasFillGradient,e.__canvasFillGradient=y),m&&(b=f?jh(t,d,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=b),g&&(x=f||!e.__canvasFillPattern?Qh(t,h,e):e.__canvasFillPattern,e.__canvasFillPattern=x),v&&(S=f||!e.__canvasStrokePattern?Qh(t,d,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),p?t.fillStyle=y:g&&(x?t.fillStyle=x:o=!1),m?t.strokeStyle=b:v&&(S?t.strokeStyle=S:i=!1)}var k=e.getGlobalScale();u.setScale(k[0],k[1],e.segmentIgnoreThreshold);var T,C;t.setLineDash&&r.lineDash&&(a=u_(e),T=a[0],C=a[1]);var A=!0;(c||f&Xa)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),A=!1),u.reset(),e.buildPath(u,e.shape,n),u.toStatic(),e.pathUpdated()),A&&u.rebuildPath(t,l?s:1),T&&(t.setLineDash(T),t.lineDashOffset=C),n||(r.strokeFirst?(i&&d_(t,r),o&&h_(t,r)):(o&&h_(t,r),i&&d_(t,r))),T&&t.setLineDash([])}function DD(t,e,r){var n=e.__image=mv(r.image,e.__image,e,e.onload);if(!(!n||!As(n))){var a=r.x||0,i=r.y||0,o=e.getWidth(),s=e.getHeight(),l=n.width/n.height;if(o==null&&s!=null?o=s*l:s==null&&o!=null?s=o/l:o==null&&s==null&&(o=n.width,s=n.height),r.sWidth&&r.sHeight){var c=r.sx||0,u=r.sy||0;t.drawImage(n,c,u,r.sWidth,r.sHeight,a,i,o,s)}else if(r.sx&&r.sy){var c=r.sx,u=r.sy,f=o-c,h=s-u;t.drawImage(n,c,u,f,h,a,i,o,s)}else t.drawImage(n,a,i,o,s)}}function ID(t,e,r){var n,a=r.text;if(a!=null&&(a+=""),a){t.font=r.font||Hn,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var i=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=u_(e),i=n[0],o=n[1]),i&&(t.setLineDash(i),t.lineDashOffset=o),r.strokeFirst?(fc(r)&&t.strokeText(a,r.x,r.y),hc(r)&&t.fillText(a,r.x,r.y)):(hc(r)&&t.fillText(a,r.x,r.y),fc(r)&&t.strokeText(a,r.x,r.y)),i&&t.setLineDash([])}}var p_=["shadowBlur","shadowOffsetX","shadowOffsetY"],v_=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function g_(t,e,r,n,a){var i=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){zt(t,a),i=!0;var o=Math.max(Math.min(e.opacity,1),0);t.globalAlpha=isNaN(o)?Zn.opacity:o}(n||e.blend!==r.blend)&&(i||(zt(t,a),i=!0),t.globalCompositeOperation=e.blend||Zn.blend);for(var s=0;s<p_.length;s++){var l=p_[s];(n||e[l]!==r[l])&&(i||(zt(t,a),i=!0),t[l]=t.dpr*(e[l]||0))}return(n||e.shadowColor!==r.shadowColor)&&(i||(zt(t,a),i=!0),t.shadowColor=e.shadowColor||Zn.shadowColor),i}function m_(t,e,r,n,a){var i=No(e,a.inHover),o=n?null:r&&No(r,a.inHover)||{};if(i===o)return!1;var s=g_(t,i,o,n,a);if((n||i.fill!==o.fill)&&(s||(zt(t,a),s=!0),f_(i.fill)&&(t.fillStyle=i.fill)),(n||i.stroke!==o.stroke)&&(s||(zt(t,a),s=!0),f_(i.stroke)&&(t.strokeStyle=i.stroke)),(n||i.opacity!==o.opacity)&&(s||(zt(t,a),s=!0),t.globalAlpha=i.opacity==null?1:i.opacity),e.hasStroke()){var l=i.lineWidth,c=l/(i.strokeNoScale&&e.getLineScale?e.getLineScale():1);t.lineWidth!==c&&(s||(zt(t,a),s=!0),t.lineWidth=c)}for(var u=0;u<v_.length;u++){var f=v_[u],h=f[0];(n||i[h]!==o[h])&&(s||(zt(t,a),s=!0),t[h]=i[h]||f[1])}return s}function LD(t,e,r,n,a){return g_(t,No(e,a.inHover),r&&No(r,a.inHover),n,a)}function y_(t,e){var r=e.transform,n=t.dpr||1;r?t.setTransform(n*r[0],n*r[1],n*r[2],n*r[3],n*r[4],n*r[5]):t.setTransform(n,0,0,n,0,0)}function PD(t,e,r){for(var n=!1,a=0;a<t.length;a++){var i=t[a];n=n||i.isZeroArea(),y_(e,i),e.beginPath(),i.buildPath(e,i.shape),e.clip()}r.allClipped=n}function RD(t,e){return t&&e?t[0]!==e[0]||t[1]!==e[1]||t[2]!==e[2]||t[3]!==e[3]||t[4]!==e[4]||t[5]!==e[5]:!(!t&&!e)}var __=1,b_=2,x_=3,w_=4;function ED(t){var e=hc(t),r=fc(t);return!(t.lineDash||!(+e^+r)||e&&typeof t.fill!="string"||r&&typeof t.stroke!="string"||t.strokePercent<1||t.strokeOpacity<1||t.fillOpacity<1)}function zt(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function No(t,e){return e&&t.__hoverStyle||t.style}function S_(t,e){ma(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function ma(t,e,r,n){var a=e.transform;if(!e.shouldBePainted(r.viewWidth,r.viewHeight,!1,!1)){e.__dirty&=~Wt,e.__isRendered=!1;return}var i=e.__clipPaths,o=r.prevElClipPaths,s=!1,l=!1;if((!o||TD(i,o))&&(o&&o.length&&(zt(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),i&&i.length&&(zt(t,r),t.save(),PD(i,t,r),s=!0),r.prevElClipPaths=i),r.allClipped){e.__isRendered=!1;return}e.beforeBrush&&e.beforeBrush(),e.innerBeforeBrush();var c=r.prevEl;c||(l=s=!0);var u=e instanceof $e&&e.autoBatch&&ED(e.style);s||RD(a,c.transform)?(zt(t,r),y_(t,e)):u||zt(t,r);var f=No(e,r.inHover);e instanceof $e?(r.lastDrawType!==__&&(l=!0,r.lastDrawType=__),m_(t,e,c,l,r),(!u||!r.batchFill&&!r.batchStroke)&&t.beginPath(),AD(t,e,f,u),u&&(r.batchFill=f.fill||"",r.batchStroke=f.stroke||"")):e instanceof tl?(r.lastDrawType!==x_&&(l=!0,r.lastDrawType=x_),m_(t,e,c,l,r),ID(t,e,f)):e instanceof bn?(r.lastDrawType!==b_&&(l=!0,r.lastDrawType=b_),LD(t,e,c,l,r),DD(t,e,f)):e.getTemporalDisplayables&&(r.lastDrawType!==w_&&(l=!0,r.lastDrawType=w_),OD(t,e,r)),u&&n&&zt(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function OD(t,e,r){var n=e.getDisplayables(),a=e.getTemporalDisplayables();t.save();var i={prevElClipPaths:null,prevEl:null,allClipped:!1,viewWidth:r.viewWidth,viewHeight:r.viewHeight,inHover:r.inHover},o,s;for(o=e.getCursor(),s=n.length;o<s;o++){var l=n[o];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ma(t,l,i,o===s-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}for(var c=0,u=a.length;c<u;c++){var l=a[c];l.beforeBrush&&l.beforeBrush(),l.innerBeforeBrush(),ma(t,l,i,c===u-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var Jh=new wD,k_=new Wi(100),T_=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function ed(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),n=e.getZr(),a=n.painter.type==="svg";t.dirty&&Jh.delete(t);var i=Jh.get(t);if(i)return i;var o=Ne(t,{symbol:"rect",symbolSize:1,symbolKeepAspect:!0,color:"rgba(0, 0, 0, 0.2)",backgroundColor:null,dashArrayX:5,dashArrayY:5,rotation:0,maxTileWidth:512,maxTileHeight:512});o.backgroundColor==="none"&&(o.backgroundColor=null);var s={repeat:"repeat"};return l(s),s.rotation=o.rotation,s.scaleX=s.scaleY=a?1:1/r,Jh.set(t,s),t.dirty=!1,s;function l(c){for(var u=[r],f=!0,h=0;h<T_.length;++h){var d=o[T_[h]];if(d!=null&&!ee(d)&&!ne(d)&&!Ke(d)&&typeof d!="boolean"){f=!1;break}u.push(d)}var p;if(f){p=u.join(",")+(a?"-svg":"");var m=k_.get(p);m&&(a?c.svgElement=m:c.image=m)}var g=M_(o.dashArrayX),v=ND(o.dashArrayY),y=C_(o.symbol),b=BD(g),x=A_(v),S=!a&&Na.createCanvas(),w=a&&{tag:"g",attrs:{},key:"dcl",children:[]},k=C(),T;S&&(S.width=k.width*r,S.height=k.height*r,T=S.getContext("2d")),A(),f&&k_.put(p,S||w),c.image=S,c.svgElement=w,c.svgWidth=k.width,c.svgHeight=k.height;function C(){for(var M=1,I=0,L=b.length;I<L;++I)M=_g(M,b[I]);for(var P=1,I=0,L=y.length;I<L;++I)P=_g(P,y[I].length);M*=P;var N=x*b.length*y.length;return{width:Math.max(1,Math.min(M,o.maxTileWidth)),height:Math.max(1,Math.min(N,o.maxTileHeight))}}function A(){T&&(T.clearRect(0,0,S.width,S.height),o.backgroundColor&&(T.fillStyle=o.backgroundColor,T.fillRect(0,0,S.width,S.height)));for(var M=0,I=0;I<v.length;++I)M+=v[I];if(M<=0)return;for(var L=-x,P=0,N=0,O=0;L<k.height;){if(P%2===0){for(var q=N/2%y.length,R=0,z=0,F=0;R<k.width*2;){for(var X=0,I=0;I<g[O].length;++I)X+=g[O][I];if(X<=0)break;if(z%2===0){var te=(1-o.symbolSize)*.5,fe=R+g[O][z]*te,me=L+v[P]*te,we=g[O][z]*o.symbolSize,Ze=v[P]*o.symbolSize,Ie=F/2%y[q].length;tt(fe,me,we,Ze,y[q][Ie])}R+=g[O][z],++F,++z,z===g[O].length&&(z=0)}++O,O===g.length&&(O=0)}L+=v[P],++N,++P,P===v.length&&(P=0)}function tt(Ge,Me,re,he,Be){var pe=a?1:r,Se=di(Be,Ge*pe,Me*pe,re*pe,he*pe,o.color,o.symbolKeepAspect);if(a){var ct=n.painter.renderOneToVNode(Se);ct&&w.children.push(ct)}else S_(T,Se)}}}}function C_(t){if(!t||t.length===0)return[["rect"]];if(ne(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!ne(t[r])){e=!1;break}if(e)return C_([t]);for(var n=[],r=0;r<t.length;++r)ne(t[r])?n.push([t[r]]):n.push(t[r]);return n}function M_(t){if(!t||t.length===0)return[[0,0]];if(Ke(t)){var e=Math.ceil(t);return[[e,e]]}for(var r=!0,n=0;n<t.length;++n)if(!Ke(t[n])){r=!1;break}if(r)return M_([t]);for(var a=[],n=0;n<t.length;++n)if(Ke(t[n])){var e=Math.ceil(t[n]);a.push([e,e])}else{var e=ue(t[n],function(s){return Math.ceil(s)});e.length%2===1?a.push(e.concat(e)):a.push(e)}return a}function ND(t){if(!t||typeof t=="object"&&t.length===0)return[0,0];if(Ke(t)){var e=Math.ceil(t);return[e,e]}var r=ue(t,function(n){return Math.ceil(n)});return t.length%2?r.concat(r):r}function BD(t){return ue(t,function(e){return A_(e)})}function A_(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function zD(t,e){t.eachRawSeries(function(r){if(!t.isSeriesFiltered(r)){var n=r.getData();n.hasItemVisual()&&n.each(function(o){var s=n.getItemVisual(o,"decal");if(s){var l=n.ensureUniqueItemVisual(o,"style");l.decal=ed(s,e)}});var a=n.getVisual("decal");if(a){var i=n.getVisual("style");i.decal=ed(a,e)}}})}var mr=new ur,D_={};function FD(t,e){D_[t]=e}function HD(t){return D_[t]}var VD=1,GD=800,$D=900,WD=1e3,UD=2e3,YD=5e3,I_=1e3,qD=1100,td=2e3,L_=3e3,XD=4e3,dc=4500,ZD=4600,KD=5e3,jD=6e3,P_=7e3,QD={PROCESSOR:{FILTER:WD,SERIES_FILTER:GD,STATISTIC:YD},VISUAL:{LAYOUT:I_,PROGRESSIVE_LAYOUT:qD,GLOBAL:td,CHART:L_,POST_CHART_LAYOUT:ZD,COMPONENT:XD,BRUSH:KD,CHART_ITEM:dc,ARIA:jD,DECAL:P_}},St="__flagInMainProcess",Ft="__pendingUpdate",rd="__needsUpdateStatus",R_=/^[a-zA-Z0-9_]+$/,nd="__connectUpdateStatus",E_=0,JD=1,eI=2;function O_(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return B_(this,t,e)}}function N_(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return B_(this,t,e)}}function B_(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),ur.prototype[e].apply(t,r)}var z_=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(ur),F_=z_.prototype;F_.on=N_("on"),F_.off=N_("off");var yi,ad,pc,Dn,id,od,sd,Bo,zo,H_,V_,ld,G_,vc,$_,W_,sr,U_,Y_=(function(t){Z(e,t);function e(r,n,a){var i=t.call(this,new vD)||this;i._chartsViews=[],i._chartsMap={},i._componentsViews=[],i._componentsMap={},i._pendingActions=[],a=a||{},ne(n)&&(n=q_[n]),i._dom=r;var o="canvas",s="auto",l=!1;a.ssr;var c=i._zr=N0(r,{renderer:a.renderer||o,devicePixelRatio:a.devicePixelRatio,width:a.width,height:a.height,ssr:a.ssr,useDirtyRect:Ce(a.useDirtyRect,l),useCoarsePointer:Ce(a.useCoarsePointer,s),pointerSize:a.pointerSize});i._ssr=a.ssr,i._throttledZrFlush=Ah(Le(c.flush,c),17),n=Te(n),n&&K0(n,!0),i._theme=n,i._locale=tC(a.locale||ty),i._coordSysMgr=new jf;var u=i._api=$_(i);function f(h,d){return h.__prio-d.__prio}return tc(mc,f),tc(ud,f),i._scheduler=new t_(i,u,ud,mc),i._messageCenter=new z_,i._initEvents(),i.resize=Le(i.resize,i),c.animation.on("frame",i._onframe,i),H_(c,i),V_(c,i),yu(i),i}return e.prototype._onframe=function(){if(!this._disposed){U_(this);var r=this._scheduler;if(this[Ft]){var n=this[Ft].silent;this[St]=!0;try{yi(this),Dn.update.call(this,null,this[Ft].updateParams)}catch(l){throw this[St]=!1,this[Ft]=null,l}this._zr.flush(),this[St]=!1,this[Ft]=null,Bo.call(this,n),zo.call(this,n)}else if(r.unfinished){var a=VD,i=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(i),r.performDataProcessorTasks(i),od(this,i),r.performVisualTasks(i),vc(this,this._model,o,"remain",{}),a-=+new Date-s}while(a>0&&r.unfinished);r.unfinished||this._zr.flush()}}},e.prototype.getDom=function(){return this._dom},e.prototype.getId=function(){return this.id},e.prototype.getZr=function(){return this._zr},e.prototype.isSSR=function(){return this._ssr},e.prototype.setOption=function(r,n,a){if(!this[St]){if(this._disposed){this.id;return}var i,o,s;if(ce(n)&&(a=n.lazyUpdate,i=n.silent,o=n.replaceMerge,s=n.transition,n=n.notMerge),this[St]=!0,!this._model||n){var l=new HA(this._api),c=this._theme,u=this._model=new qh;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,c,this._locale,l)}this._model.setOption(r,{replaceMerge:o},fd);var f={seriesTransition:s,optionChanged:!0};if(a)this[Ft]={silent:i,updateParams:f},this[St]=!1,this.getZr().wakeUp();else{try{yi(this),Dn.update.call(this,null,f)}catch(h){throw this[Ft]=null,this[St]=!1,h}this._ssr||this._zr.flush(),this[Ft]=null,this[St]=!1,Bo.call(this,i),zo.call(this,i)}}},e.prototype.setTheme=function(){},e.prototype.getModel=function(){return this._model},e.prototype.getOption=function(){return this._model&&this._model.getOption()},e.prototype.getWidth=function(){return this._zr.getWidth()},e.prototype.getHeight=function(){return this._zr.getHeight()},e.prototype.getDevicePixelRatio=function(){return this._zr.painter.dpr||ge.hasGlobalWindow&&window.devicePixelRatio||1},e.prototype.getRenderedCanvas=function(r){return this.renderToCanvas(r)},e.prototype.renderToCanvas=function(r){r=r||{};var n=this._zr.painter;return n.getRenderedCanvas({backgroundColor:r.backgroundColor||this._model.get("backgroundColor"),pixelRatio:r.pixelRatio||this.getDevicePixelRatio()})},e.prototype.renderToSVGString=function(r){r=r||{};var n=this._zr.painter;return n.renderToString({useViewBox:r.useViewBox})},e.prototype.getSvgDataURL=function(){if(ge.svgSupported){var r=this._zr,n=r.storage.getDisplayList();return D(n,function(a){a.stopAnimation(null,!0)}),r.painter.toDataURL()}},e.prototype.getDataURL=function(r){if(this._disposed){this.id;return}r=r||{};var n=r.excludeComponents,a=this._model,i=[],o=this;D(n,function(l){a.eachComponent({mainType:l},function(c){var u=o._componentsMap[c.__viewId];u.group.ignore||(i.push(u),u.group.ignore=!0)})});var s=this._zr.painter.getType()==="svg"?this.getSvgDataURL():this.renderToCanvas(r).toDataURL("image/"+(r&&r.type||"png"));return D(i,function(l){l.group.ignore=!1}),s},e.prototype.getConnectedDataURL=function(r){if(this._disposed){this.id;return}var n=r.type==="svg",a=this.group,i=Math.min,o=Math.max,s=1/0;if(X_[a]){var l=s,c=s,u=-s,f=-s,h=[],d=r&&r.pixelRatio||this.getDevicePixelRatio();D(Ho,function(b,x){if(b.group===a){var S=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(Te(r)),w=b.getDom().getBoundingClientRect();l=i(w.left,l),c=i(w.top,c),u=o(w.right,u),f=o(w.bottom,f),h.push({dom:S,left:w.left,top:w.top})}}),l*=d,c*=d,u*=d,f*=d;var p=u-l,m=f-c,g=Na.createCanvas(),v=N0(g,{renderer:n?"svg":"canvas"});if(v.resize({width:p,height:m}),n){var y="";return D(h,function(b){var x=b.left-l,S=b.top-c;y+='<g transform="translate('+x+","+S+')">'+b.dom+"</g>"}),v.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&v.painter.setBackgroundColor(r.connectedBackgroundColor),v.refreshImmediately(),v.painter.toDataURL()}else return r.connectedBackgroundColor&&v.add(new ft({shape:{x:0,y:0,width:p,height:m},style:{fill:r.connectedBackgroundColor}})),D(h,function(b){var x=new bn({style:{x:b.left*d-l,y:b.top*d-c,image:b.dom}});v.add(x)}),v.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n){return id(this,"convertToPixel",r,n)},e.prototype.convertFromPixel=function(r,n){return id(this,"convertFromPixel",r,n)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var a=this._model,i,o=ff(a,r);return D(o,function(s,l){l.indexOf("Models")>=0&&D(s,function(c){var u=c.coordinateSystem;if(u&&u.containPoint)i=i||!!u.containPoint(n);else if(l==="seriesModels"){var f=this._chartsMap[c.__viewId];f&&f.containPoint&&(i=i||f.containPoint(n,c))}},this)},this),!!i},e.prototype.getVisual=function(r,n){var a=this._model,i=ff(a,r,{defaultMainType:"series"}),o=i.seriesModel,s=o.getData(),l=i.hasOwnProperty("dataIndexInside")?i.dataIndexInside:i.hasOwnProperty("dataIndex")?s.indexOfRawIndex(i.dataIndex):null;return l!=null?yD(s,l,n):_D(s,n)},e.prototype.getViewOfComponentModel=function(r){return this._componentsMap[r.__viewId]},e.prototype.getViewOfSeriesModel=function(r){return this._chartsMap[r.__viewId]},e.prototype._initEvents=function(){var r=this;D(tI,function(n){var a=function(i){var o=r.getModel(),s=i.target,l,c=n==="globalout";if(c?l={}:s&&Oo(s,function(p){var m=Ve(p);if(m&&m.dataIndex!=null){var g=m.dataModel||o.getSeriesByIndex(m.seriesIndex);return l=g&&g.getDataParams(m.dataIndex,m.dataType,s)||{},!0}else if(m.eventData)return l=U({},m.eventData),!0},!0),l){var u=l.componentType,f=l.componentIndex;(u==="markLine"||u==="markPoint"||u==="markArea")&&(u="series",f=l.seriesIndex);var h=u&&f!=null&&o.getComponent(u,f),d=h&&r[h.mainType==="series"?"_chartsMap":"_componentsMap"][h.__viewId];l.event=i,l.type=n,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:h,view:d},r.trigger(n,l)}};a.zrEventfulCallAtLast=!0,r._zr.on(n,a,r)}),D(Fo,function(n,a){r._messageCenter.on(a,function(i){this.trigger(a,i)},r)}),D(["selectchanged"],function(n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),eA(this._messageCenter,this,this._api)},e.prototype.isDisposed=function(){return this._disposed},e.prototype.clear=function(){if(this._disposed){this.id;return}this.setOption({series:[]},!0)},e.prototype.dispose=function(){if(this._disposed){this.id;return}this._disposed=!0;var r=this.getDom();r&&Tg(this.getDom(),dd,"");var n=this,a=n._api,i=n._model;D(n._componentsViews,function(o){o.dispose(i,a)}),D(n._chartsViews,function(o){o.dispose(i,a)}),n._zr.dispose(),n._dom=n._model=n._chartsMap=n._componentsMap=n._chartsViews=n._componentsViews=n._scheduler=n._api=n._zr=n._throttledZrFlush=n._theme=n._coordSysMgr=n._messageCenter=null,delete Ho[n.id]},e.prototype.resize=function(r){if(!this[St]){if(this._disposed){this.id;return}this._zr.resize(r);var n=this._model;if(this._loadingFX&&this._loadingFX.resize(),!!n){var a=n.resetOption("media"),i=r&&r.silent;this[Ft]&&(i==null&&(i=this[Ft].silent),a=!0,this[Ft]=null),this[St]=!0;try{a&&yi(this),Dn.update.call(this,{type:"resize",animation:U({duration:0},r&&r.animation)})}catch(o){throw this[St]=!1,o}this[St]=!1,Bo.call(this,i),zo.call(this,i)}}},e.prototype.showLoading=function(r,n){if(this._disposed){this.id;return}if(ce(r)&&(n=r,r=""),r=r||"default",this.hideLoading(),!!hd[r]){var a=hd[r](this._api,n),i=this._zr;this._loadingFX=a,i.add(a)}},e.prototype.hideLoading=function(){if(this._disposed){this.id;return}this._loadingFX&&this._zr.remove(this._loadingFX),this._loadingFX=null},e.prototype.makeActionFromEvent=function(r){var n=U({},r);return n.type=Fo[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ce(n)||(n={silent:!!n}),!!gc[r.type]&&this._model){if(this[St]){this._pendingActions.push(r);return}var a=n.silent;sd.call(this,r,a);var i=n.flush;i?this._zr.flush():i!==!1&&ge.browser.weChat&&this._throttledZrFlush(),Bo.call(this,a),zo.call(this,a)}},e.prototype.updateLabelLayout=function(){mr.trigger("series:layoutlabels",this._model,this._api,{updatedSeries:[]})},e.prototype.appendData=function(r){if(this._disposed){this.id;return}var n=r.seriesIndex,a=this.getModel(),i=a.getSeriesByIndex(n);i.appendData(r),this._scheduler.unfinished=!0,this.getZr().wakeUp()},e.internalField=(function(){yi=function(f){var h=f._scheduler;h.restorePipelines(f._model),h.prepareStageTasks(),ad(f,!0),ad(f,!1),h.plan()},ad=function(f,h){for(var d=f._model,p=f._scheduler,m=h?f._componentsViews:f._chartsViews,g=h?f._componentsMap:f._chartsMap,v=f._zr,y=f._api,b=0;b<m.length;b++)m[b].__alive=!1;h?d.eachComponent(function(w,k){w!=="series"&&x(k)}):d.eachSeries(x);function x(w){var k=w.__requireNewView;w.__requireNewView=!1;var T="_ec_"+w.id+"_"+w.type,C=!k&&g[T];if(!C){var A=Ar(w.type),M=h?gr.getClass(A.main,A.sub):dr.getClass(A.sub);C=new M,C.init(d,y),g[T]=C,m.push(C),v.add(C.group)}w.__viewId=C.__id=T,C.__alive=!0,C.__model=w,C.group.__ecComponentInfo={mainType:w.mainType,index:w.componentIndex},!h&&p.prepareView(C,w,d,y)}for(var b=0;b<m.length;){var S=m[b];S.__alive?b++:(!h&&S.renderTask.dispose(),v.remove(S.group),S.dispose(d,y),m.splice(b,1),g[S.__id]===S&&delete g[S.__id],S.__id=S.group.__ecComponentInfo=null)}},pc=function(f,h,d,p,m){var g=f._model;if(g.setUpdatePayload(d),!p){D([].concat(f._componentsViews).concat(f._chartsViews),S);return}var v={};v[p+"Id"]=d[p+"Id"],v[p+"Index"]=d[p+"Index"],v[p+"Name"]=d[p+"Name"];var y={mainType:p,query:v};m&&(y.subType=m);var b=d.excludeSeriesId,x;b!=null&&(x=de(),D(_t(b),function(w){var k=Rr(w,null);k!=null&&x.set(k,!0)})),g&&g.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;if(!k)if(Ug(d))if(w instanceof Br)d.type===sa&&!d.notBlur&&!w.get(["emphasis","disabled"])&&Yk(w,d,f._api);else{var T=_f(w.mainType,w.componentIndex,d.name,f._api),C=T.focusSelf,A=T.dispatchers;d.type===sa&&C&&!d.notBlur&&yf(w.mainType,w.componentIndex,f._api),A&&D(A,function(M){d.type===sa?cl(M):ul(M)})}else Sf(d)&&w instanceof Br&&(Zk(w,d,f._api),Gg(w),sr(f))},f),g&&g.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;k||S(f[p==="series"?"_chartsMap":"_componentsMap"][w.__viewId])},f);function S(w){w&&w.__alive&&w[h]&&w[h](w.__model,g,f._api,d)}},Dn={prepareAndUpdate:function(f){yi(this),Dn.update.call(this,f,{optionChanged:f.newOption!=null})},update:function(f,h){var d=this._model,p=this._api,m=this._zr,g=this._coordSysMgr,v=this._scheduler;if(d){d.setUpdatePayload(f),v.restoreData(d,f),v.performSeriesTasks(d),g.create(d,p),v.performDataProcessorTasks(d,f),od(this,d),g.update(d,p),r(d),v.performVisualTasks(d,f),ld(this,d,p,f,h);var y=d.get("backgroundColor")||"transparent",b=d.get("darkMode");m.setBackgroundColor(y),b!=null&&b!=="auto"&&m.setDarkMode(b),mr.trigger("afterupdate",d,p)}},updateTransform:function(f){var h=this,d=this._model,p=this._api;if(d){d.setUpdatePayload(f);var m=[];d.eachComponent(function(v,y){if(v!=="series"){var b=h.getViewOfComponentModel(y);if(b&&b.__alive)if(b.updateTransform){var x=b.updateTransform(y,d,p,f);x&&x.update&&m.push(b)}else m.push(b)}});var g=de();d.eachSeries(function(v){var y=h._chartsMap[v.__viewId];if(y.updateTransform){var b=y.updateTransform(v,d,p,f);b&&b.update&&g.set(v.uid,1)}else g.set(v.uid,1)}),r(d),this._scheduler.performVisualTasks(d,f,{setDirty:!0,dirtyMap:g}),vc(this,d,p,f,{},g),mr.trigger("afterupdate",d,p)}},updateView:function(f){var h=this._model;h&&(h.setUpdatePayload(f),dr.markUpdateMethod(f,"updateView"),r(h),this._scheduler.performVisualTasks(h,f,{setDirty:!0}),ld(this,h,this._api,f,{}),mr.trigger("afterupdate",h,this._api))},updateVisual:function(f){var h=this,d=this._model;d&&(d.setUpdatePayload(f),d.eachSeries(function(p){p.getData().clearAllVisual()}),dr.markUpdateMethod(f,"updateVisual"),r(d),this._scheduler.performVisualTasks(d,f,{visualType:"visual",setDirty:!0}),d.eachComponent(function(p,m){if(p!=="series"){var g=h.getViewOfComponentModel(m);g&&g.__alive&&g.updateVisual(m,d,h._api,f)}}),d.eachSeries(function(p){var m=h._chartsMap[p.__viewId];m.updateVisual(p,d,h._api,f)}),mr.trigger("afterupdate",d,this._api))},updateLayout:function(f){Dn.update.call(this,f)}},id=function(f,h,d,p){if(f._disposed){f.id;return}for(var m=f._model,g=f._coordSysMgr.getCoordinateSystems(),v,y=ff(m,d),b=0;b<g.length;b++){var x=g[b];if(x[h]&&(v=x[h](m,y,p))!=null)return v}},od=function(f,h){var d=f._chartsMap,p=f._scheduler;h.eachSeries(function(m){p.updateStreamModes(m,d[m.__viewId])})},sd=function(f,h){var d=this,p=this.getModel(),m=f.type,g=f.escapeConnect,v=gc[m],y=v.actionInfo,b=(y.update||"update").split(":"),x=b.pop(),S=b[0]!=null&&Ar(b[0]);this[St]=!0;var w=[f],k=!1;f.batch&&(k=!0,w=ue(f.batch,function(P){return P=Ne(U({},P),f),P.batch=null,P}));var T=[],C,A=Sf(f),M=Ug(f);if(M&&Vg(this._api),D(w,function(P){if(C=v.action(P,d._model,d._api),C=C||U({},P),C.type=y.event||C.type,T.push(C),M){var N=hf(f),O=N.queryOptionMap,q=N.mainTypeSpecified,R=q?O.keys()[0]:"series";pc(d,x,P,R),sr(d)}else A?(pc(d,x,P,"series"),sr(d)):S&&pc(d,x,P,S.main,S.sub)}),x!=="none"&&!M&&!A&&!S)try{this[Ft]?(yi(this),Dn.update.call(this,f),this[Ft]=null):Dn[x].call(this,f)}catch(P){throw this[St]=!1,P}if(k?C={type:y.event||m,escapeConnect:g,batch:T}:C=T[0],this[St]=!1,!h){var I=this._messageCenter;if(I.trigger(C.type,C),A){var L={type:"selectchanged",escapeConnect:g,selected:Kk(p),isFromClick:f.isFromClick||!1,fromAction:f.type,fromActionPayload:f};I.trigger(L.type,L)}}},Bo=function(f){for(var h=this._pendingActions;h.length;){var d=h.shift();sd.call(this,d,f)}},zo=function(f){!f&&this.trigger("updated")},H_=function(f,h){f.on("rendered",function(d){h.trigger("rendered",d),f.animation.isFinished()&&!h[Ft]&&!h._scheduler.unfinished&&!h._pendingActions.length&&h.trigger("finished")})},V_=function(f,h){f.on("mouseover",function(d){var p=d.target,m=Oo(p,wf);m&&(qk(m,d,h._api),sr(h))}).on("mouseout",function(d){var p=d.target,m=Oo(p,wf);m&&(Xk(m,d,h._api),sr(h))}).on("click",function(d){var p=d.target,m=Oo(p,function(y){return Ve(y).dataIndex!=null},!0);if(m){var g=m.selected?"unselect":"select",v=Ve(m);h._api.dispatchAction({type:g,dataType:v.dataType,dataIndexInside:v.dataIndex,seriesIndex:v.seriesIndex,isFromClick:!0})}})};function r(f){f.clearColorPalette(),f.eachSeries(function(h){h.clearColorPalette()})}function n(f){var h=[],d=[],p=!1;if(f.eachComponent(function(y,b){var x=b.get("zlevel")||0,S=b.get("z")||0,w=b.getZLevelKey();p=p||!!w,(y==="series"?d:h).push({zlevel:x,z:S,idx:b.componentIndex,type:y,key:w})}),p){var m=h.concat(d),g,v;tc(m,function(y,b){return y.zlevel===b.zlevel?y.z-b.z:y.zlevel-b.zlevel}),D(m,function(y){var b=f.getComponent(y.type,y.idx),x=y.zlevel,S=y.key;g!=null&&(x=Math.max(g,x)),S?(x===g&&S!==v&&x++,v=S):v&&(x===g&&x++,v=""),g=x,b.setZLevel(x)})}}ld=function(f,h,d,p,m){n(h),G_(f,h,d,p,m),D(f._chartsViews,function(g){g.__alive=!1}),vc(f,h,d,p,m),D(f._chartsViews,function(g){g.__alive||g.remove(h,d)})},G_=function(f,h,d,p,m,g){D(g||f._componentsViews,function(v){var y=v.__model;c(y,v),v.render(y,h,d,p),s(y,v),u(y,v)})},vc=function(f,h,d,p,m,g){var v=f._scheduler;m=U(m||{},{updatedSeries:h.getSeries()}),mr.trigger("series:beforeupdate",h,d,m);var y=!1;h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];x.__alive=!0;var S=x.renderTask;v.updatePayload(S,p),c(b,x),g&&g.get(b.uid)&&S.dirty(),S.perform(v.getPerformArgs(S))&&(y=!0),x.group.silent=!!b.get("silent"),o(b,x),Gg(b)}),v.unfinished=y||v.unfinished,mr.trigger("series:layoutlabels",h,d,m),mr.trigger("series:transition",h,d,m),h.eachSeries(function(b){var x=f._chartsMap[b.__viewId];s(b,x),u(b,x)}),i(f,h),mr.trigger("series:afterupdate",h,d,m)},sr=function(f){f[rd]=!0,f.getZr().wakeUp()},U_=function(f){f[rd]&&(f.getZr().storage.traverse(function(h){ho(h)||a(h)}),f[rd]=!1)};function a(f){for(var h=[],d=f.currentStates,p=0;p<d.length;p++){var m=d[p];m==="emphasis"||m==="blur"||m==="select"||h.push(m)}f.selected&&f.states.select&&h.push("select"),f.hoverState===il&&f.states.emphasis?h.push("emphasis"):f.hoverState===al&&f.states.blur&&h.push("blur"),f.useStates(h)}function i(f,h){var d=f._zr,p=d.storage,m=0;p.traverse(function(g){g.isGroup||m++}),m>h.get("hoverLayerThreshold")&&!ge.node&&!ge.worker&&h.eachSeries(function(g){if(!g.preventUsingHoverLayer){var v=f._chartsMap[g.__viewId];v.__alive&&v.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(f,h){var d=f.get("blendMode")||null;h.eachRendered(function(p){p.isGroup||(p.style.blend=d)})}function s(f,h){if(!f.preventAutoZ){var d=f.get("z")||0,p=f.get("zlevel")||0;h.eachRendered(function(m){return l(m,d,p,-1/0),!0})}}function l(f,h,d,p){var m=f.getTextContent(),g=f.getTextGuideLine(),v=f.isGroup;if(v)for(var y=f.childrenRef(),b=0;b<y.length;b++)p=Math.max(l(y[b],h,d,p),p);else f.z=h,f.zlevel=d,p=Math.max(f.z2,p);if(m&&(m.z=h,m.zlevel=d,isFinite(p)&&(m.z2=p+2)),g){var x=f.textGuideLineConfig;g.z=h,g.zlevel=d,isFinite(p)&&(g.z2=p+(x&&x.showAbove?1:-1))}return p}function c(f,h){h.eachRendered(function(d){if(!ho(d)){var p=d.getTextContent(),m=d.getTextGuideLine();d.stateTransition&&(d.stateTransition=null),p&&p.stateTransition&&(p.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),d.hasState()?(d.prevStates=d.currentStates,d.clearStates()):d.prevStates&&(d.prevStates=null)}})}function u(f,h){var d=f.getModel("stateAnimation"),p=f.isAnimationEnabled(),m=d.get("duration"),g=m>0?{duration:m,delay:d.get("delay"),easing:d.get("easing")}:null;h.eachRendered(function(v){if(v.states&&v.states.emphasis){if(ho(v))return;if(v instanceof $e&&tT(v),v.__dirty){var y=v.prevStates;y&&v.useStates(y)}if(p){v.stateTransition=g;var b=v.getTextContent(),x=v.getTextGuideLine();b&&(b.stateTransition=g),x&&(x.stateTransition=g)}v.__dirty&&a(v)}})}$_=function(f){return new((function(h){Z(d,h);function d(){return h!==null&&h.apply(this,arguments)||this}return d.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},d.prototype.getComponentByElement=function(p){for(;p;){var m=p.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);p=p.parent}},d.prototype.enterEmphasis=function(p,m){cl(p,m),sr(f)},d.prototype.leaveEmphasis=function(p,m){ul(p,m),sr(f)},d.prototype.enterBlur=function(p){Uk(p),sr(f)},d.prototype.leaveBlur=function(p){Bg(p),sr(f)},d.prototype.enterSelect=function(p){zg(p),sr(f)},d.prototype.leaveSelect=function(p){Fg(p),sr(f)},d.prototype.getModel=function(){return f.getModel()},d.prototype.getViewOfComponentModel=function(p){return f.getViewOfComponentModel(p)},d.prototype.getViewOfSeriesModel=function(p){return f.getViewOfSeriesModel(p)},d})($0))(f)},W_=function(f){function h(d,p){for(var m=0;m<d.length;m++){var g=d[m];g[nd]=p}}D(Fo,function(d,p){f._messageCenter.on(p,function(m){if(X_[f.group]&&f[nd]!==E_){if(m&&m.escapeConnect)return;var g=f.makeActionFromEvent(m),v=[];D(Ho,function(y){y!==f&&y.group===f.group&&v.push(y)}),h(v,E_),D(v,function(y){y[nd]!==JD&&y.dispatchAction(g)}),h(v,eI)}})})}})(),e})(ur),cd=Y_.prototype;cd.on=O_("on"),cd.off=O_("off"),cd.one=function(t,e,r){var n=this;function a(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];e&&e.apply&&e.apply(this,i),n.off(t,a)}this.on.call(this,t,a,r)};var tI=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function oO(t){}var gc={},Fo={},ud=[],fd=[],mc=[],q_={},hd={},Ho={},X_={},rI=+new Date-0,dd="_echarts_instance_";function nI(t,e,r){var n=!(r&&r.ssr);if(n){var a=aI(t);if(a)return a}var i=new Y_(t,e,r);return i.id="ec_"+rI++,Ho[i.id]=i,n&&Tg(t,dd,i.id),W_(i),mr.trigger("afterinit",i),i}function aI(t){return Ho[Pk(t,dd)]}function Z_(t,e){q_[t]=e}function K_(t){ze(fd,t)<0&&fd.push(t)}function j_(t,e){vd(ud,t,e,UD)}function iI(t){pd("afterinit",t)}function oI(t){pd("afterupdate",t)}function pd(t,e){mr.on(t,e)}function ya(t,e,r){ye(e)&&(r=e,e="");var n=ce(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,!Fo[e]&&(Ur(R_.test(n)&&R_.test(e)),gc[n]||(gc[n]={action:r,actionInfo:t}),Fo[e]=n)}function sI(t,e){jf.register(t,e)}function lI(t,e){vd(mc,t,e,I_,"layout")}function _a(t,e){vd(mc,t,e,L_,"visual")}var Q_=[];function vd(t,e,r,n,a){if((ye(e)||ce(e))&&(r=e,e=n),!(ze(Q_,r)>=0)){Q_.push(r);var i=t_.wrapStageHandler(r,a);i.__prio=e,i.__raw=r,t.push(i)}}function J_(t,e){hd[t]=e}function cI(t,e,r){var n=HD("registerMap");n&&n(t,e,r)}var uI=TC;_a(td,tD),_a(dc,rD),_a(dc,nD),_a(td,gD),_a(dc,mD),_a(P_,zD),K_(K0),j_($D,QA),J_("default",aD),ya({type:sa,event:sa,update:sa},Ct),ya({type:ol,event:ol,update:ol},Ct),ya({type:so,event:so,update:so},Ct),ya({type:sl,event:sl,update:sl},Ct),ya({type:lo,event:lo,update:lo},Ct),Z_("light",pD),Z_("dark",l_);var eb=[],fI={registerPreprocessor:K_,registerProcessor:j_,registerPostInit:iI,registerPostUpdate:oI,registerUpdateLifecycle:pd,registerAction:ya,registerCoordinateSystem:sI,registerLayout:lI,registerVisual:_a,registerTransform:uI,registerLoading:J_,registerMap:cI,registerImpl:FD,PRIORITY:QD,ComponentModel:We,ComponentView:gr,SeriesModel:Br,ChartView:dr,registerComponentModel:function(t){We.registerClass(t)},registerComponentView:function(t){gr.registerClass(t)},registerSeriesModel:function(t){Br.registerClass(t)},registerChartView:function(t){dr.registerClass(t)},registerSubTypeDefaulter:function(t,e){We.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){LA(t,e)}};function In(t){if(ee(t)){D(t,function(e){In(e)});return}ze(eb,t)>=0||(eb.push(t),ye(t)&&(t={install:t}),t.install(fI))}var hI=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.type="grid",e.dependencies=["xAxis","yAxis"],e.layoutMode="box",e.defaultOption={show:!1,z:0,left:"10%",top:60,right:"10%",bottom:70,containLabel:!1,backgroundColor:"rgba(0,0,0,0)",borderWidth:1,borderColor:"#ccc"},e})(We),dI=(function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t})(),gd=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",Et).models[0]},e.type="cartesian2dAxis",e})(We);Cr(gd,dI);var tb={show:!0,z:0,inverse:!1,name:"",nameLocation:"end",nameRotate:null,nameTruncate:{maxWidth:null,ellipsis:"...",placeholder:"."},nameTextStyle:{},nameGap:15,silent:!1,triggerEvent:!1,tooltip:{show:!1},axisPointer:{},axisLine:{show:!0,onZero:!0,onZeroAxisIndex:null,lineStyle:{color:"#6E7079",width:1,type:"solid"},symbol:["none","none"],symbolSize:[10,15]},axisTick:{show:!0,inside:!1,length:5,lineStyle:{width:1}},axisLabel:{show:!0,inside:!1,rotate:0,showMinLabel:null,showMaxLabel:null,margin:8,fontSize:12},splitLine:{show:!0,showMinLine:!0,showMaxLine:!0,lineStyle:{color:["#E0E6F1"],width:1,type:"solid"}},splitArea:{show:!1,areaStyle:{color:["rgba(250,250,250,0.2)","rgba(210,219,238,0.2)"]}}},pI=De({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},tb),md=De({boundaryGap:[0,0],axisLine:{show:"auto"},axisTick:{show:"auto"},splitNumber:5,minorTick:{show:!1,splitNumber:5,length:3,lineStyle:{}},minorSplitLine:{show:!1,lineStyle:{color:"#F4F7FD",width:1}}},tb),vI=De({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},md),gI=Ne({logBase:10},md);const mI={category:pI,value:md,time:vI,log:gI};var yI=0,yd=(function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++yI}return t.createByAxisModel=function(e){var r=e.option,n=r.data,a=n&&ue(n,_I);return new t({categories:a,needCollect:!a,deduplication:r.dedplication!==!1})},t.prototype.getOrdinal=function(e){return this._getOrCreateMap().get(e)},t.prototype.parseAndCollect=function(e){var r,n=this._needCollect;if(!ne(e)&&!n)return e;if(n&&!this._deduplication)return r=this.categories.length,this.categories[r]=e,r;var a=this._getOrCreateMap();return r=a.get(e),r==null&&(n?(r=this.categories.length,this.categories[r]=e,a.set(e,r)):r=NaN),r},t.prototype._getOrCreateMap=function(){return this._map||(this._map=de(this.categories))},t})();function _I(t){return ce(t)&&t.value!=null?t.value:t+""}var bI={value:1,category:1,time:1,log:1};function rb(t,e,r,n){D(bI,function(a,i){var o=De(De({},mI[i],!0),n,!0),s=(function(l){Z(c,l);function c(){var u=l!==null&&l.apply(this,arguments)||this;return u.type=e+"Axis."+i,u}return c.prototype.mergeDefaultAndTheme=function(u,f){var h=ko(this),d=h?ql(u):{},p=f.getTheme();De(u,p.get(i+"Axis")),De(u,this.getDefaultOption()),u.type=nb(u),h&&hi(u,d,h)},c.prototype.optionUpdated=function(){var u=this.option;u.type==="category"&&(this.__ordinalMeta=yd.createByAxisModel(this))},c.prototype.getCategories=function(u){var f=this.option;if(f.type==="category")return u?f.data:this.__ordinalMeta.categories},c.prototype.getOrdinalMeta=function(){return this.__ordinalMeta},c.type=e+"Axis."+i,c.defaultOption=o,c})(r);t.registerComponentModel(s)}),t.registerSubTypeDefaulter(e+"Axis",nb)}function nb(t){return t.type||(t.data?"category":"value")}var zr=(function(){function t(e){this._setting=e||{},this._extent=[1/0,-1/0]}return t.prototype.getSetting=function(e){return this._setting[e]},t.prototype.unionExtent=function(e){var r=this._extent;e[0]<r[0]&&(r[0]=e[0]),e[1]>r[1]&&(r[1]=e[1])},t.prototype.unionExtentFromData=function(e,r){this.unionExtent(e.getApproximateExtent(r))},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.setExtent=function(e,r){var n=this._extent;isNaN(e)||(n[0]=e),isNaN(r)||(n[1]=r)},t.prototype.isInExtentRange=function(e){return this._extent[0]<=e&&this._extent[1]>=e},t.prototype.isBlank=function(){return this._isBlank},t.prototype.setBlank=function(e){this._isBlank=e},t})();Ms(zr);function _d(t){return t.type==="interval"||t.type==="log"}function xI(t,e,r,n){var a={},i=t[1]-t[0],o=a.interval=gg(i/e);r!=null&&o<r&&(o=a.interval=r),n!=null&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=ab(o),l=a.niceTickExtent=[lt(Math.ceil(t[0]/o)*o,s),lt(Math.floor(t[1]/o)*o,s)];return wI(l,t),a}function bd(t){var e=Math.pow(10,cf(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,lt(r*e)}function ab(t){return Zr(t)+2}function ib(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function wI(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),ib(t,0,e),ib(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function yc(t,e){return t>=e[0]&&t<=e[1]}function _c(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function bc(t,e){return t*(e[1]-e[0])+e[0]}var xd=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;n.type="ordinal";var a=n.getSetting("ordinalMeta");return a||(a=new yd({})),ee(a)&&(a=new yd({categories:ue(a,function(i){return ce(i)?i.value:i})})),n._ordinalMeta=a,n._extent=n.getSetting("extent")||[0,a.categories.length-1],n}return e.prototype.parse=function(r){return r==null?NaN:ne(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),yc(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),_c(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(bc(r,this._extent)),this.getRawOrdinalNumber(r)},e.prototype.getTicks=function(){for(var r=[],n=this._extent,a=n[0];a<=n[1];)r.push({value:a}),a++;return r},e.prototype.getMinorTicks=function(r){},e.prototype.setSortInfo=function(r){if(r==null){this._ordinalNumbersByTick=this._ticksByOrdinalNumber=null;return}for(var n=r.ordinalNumbers,a=this._ordinalNumbersByTick=[],i=this._ticksByOrdinalNumber=[],o=0,s=this._ordinalMeta.categories.length,l=Math.min(s,n.length);o<l;++o){var c=n[o];a[o]=c,i[c]=o}for(var u=0;o<s;++o){for(;i[u]!=null;)u++;a.push(u),i[u]=o}},e.prototype._getTickNumber=function(r){var n=this._ticksByOrdinalNumber;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getRawOrdinalNumber=function(r){var n=this._ordinalNumbersByTick;return n&&r>=0&&r<n.length?n[r]:r},e.prototype.getLabel=function(r){if(!this.isBlank()){var n=this.getRawOrdinalNumber(r.value),a=this._ordinalMeta.categories[n];return a==null?"":a+""}},e.prototype.count=function(){return this._extent[1]-this._extent[0]+1},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.isInExtentRange=function(r){return r=this._getTickNumber(r),this._extent[0]<=r&&this._extent[1]>=r},e.prototype.getOrdinalMeta=function(){return this._ordinalMeta},e.prototype.calcNiceTicks=function(){},e.prototype.calcNiceExtent=function(){},e.type="ordinal",e})(zr);zr.registerClass(xd);var ba=lt,_i=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="interval",r._interval=0,r._intervalPrecision=2,r}return e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return yc(r,this._extent)},e.prototype.normalize=function(r){return _c(r,this._extent)},e.prototype.scale=function(r){return bc(r,this._extent)},e.prototype.setExtent=function(r,n){var a=this._extent;isNaN(r)||(a[0]=parseFloat(r)),isNaN(n)||(a[1]=parseFloat(n))},e.prototype.unionExtent=function(r){var n=this._extent;r[0]<n[0]&&(n[0]=r[0]),r[1]>n[1]&&(n[1]=r[1]),this.setExtent(n[0],n[1])},e.prototype.getInterval=function(){return this._interval},e.prototype.setInterval=function(r){this._interval=r,this._niceExtent=this._extent.slice(),this._intervalPrecision=ab(r)},e.prototype.getTicks=function(r){var n=this._interval,a=this._extent,i=this._niceExtent,o=this._intervalPrecision,s=[];if(!n)return s;var l=1e4;a[0]<i[0]&&(r?s.push({value:ba(i[0]-n,o)}):s.push({value:a[0]}));for(var c=i[0];c<=i[1]&&(s.push({value:c}),c=ba(c+n,o),c!==s[s.length-1].value);)if(s.length>l)return[];var u=s.length?s[s.length-1].value:i[1];return a[1]>u&&(r?s.push({value:ba(u+n,o)}):s.push({value:a[1]})),s},e.prototype.getMinorTicks=function(r){for(var n=this.getTicks(!0),a=[],i=this.getExtent(),o=1;o<n.length;o++){for(var s=n[o],l=n[o-1],c=0,u=[],f=s.value-l.value,h=f/r;c<r-1;){var d=ba(l.value+(c+1)*h);d>i[0]&&d<i[1]&&u.push(d),c++}a.push(u)}return a},e.prototype.getLabel=function(r,n){if(r==null)return"";var a=n&&n.precision;a==null?a=Zr(r.value)||0:a==="auto"&&(a=this._intervalPrecision);var i=ba(r.value,a,!0);return py(i)},e.prototype.calcNiceTicks=function(r,n,a){r=r||5;var i=this._extent,o=i[1]-i[0];if(isFinite(o)){o<0&&(o=-o,i.reverse());var s=xI(i,r,n,a);this._intervalPrecision=s.intervalPrecision,this._interval=s.interval,this._niceExtent=s.niceTickExtent}},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1])if(n[0]!==0){var a=Math.abs(n[0]);r.fixMax||(n[1]+=a/2),n[0]-=a/2}else n[1]=1;var i=n[1]-n[0];isFinite(i)||(n[0]=0,n[1]=1),this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval);var o=this._interval;r.fixMin||(n[0]=ba(Math.floor(n[0]/o)*o)),r.fixMax||(n[1]=ba(Math.ceil(n[1]/o)*o))},e.prototype.setNiceExtent=function(r,n){this._niceExtent=[r,n]},e.type="interval",e})(zr);zr.registerClass(_i);var SI=function(t,e,r,n){for(;r<n;){var a=r+n>>>1;t[a][1]<e?r=a+1:n=a}return r},ob=(function(t){Z(e,t);function e(r){var n=t.call(this,r)||this;return n.type="time",n}return e.prototype.getLabel=function(r){var n=this.getSetting("useUTC");return zl(r.value,ay[iC(ui(this._minLevelUnit))]||ay.second,n,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,n,a){var i=this.getSetting("useUTC"),o=this.getSetting("locale");return oC(r,n,a,o,i)},e.prototype.getTicks=function(){var r=this._interval,n=this._extent,a=[];if(!r)return a;a.push({value:n[0],level:0});var i=this.getSetting("useUTC"),o=II(this._minLevelUnit,this._approxInterval,i,n);return a=a.concat(o),a.push({value:n[1],level:0}),a},e.prototype.calcNiceExtent=function(r){var n=this._extent;if(n[0]===n[1]&&(n[0]-=ar,n[1]+=ar),n[1]===-1/0&&n[0]===1/0){var a=new Date;n[1]=+new Date(a.getFullYear(),a.getMonth(),a.getDate()),n[0]=n[1]-ar}this.calcNiceTicks(r.splitNumber,r.minInterval,r.maxInterval)},e.prototype.calcNiceTicks=function(r,n,a){r=r||10;var i=this._extent,o=i[1]-i[0];this._approxInterval=o/r,n!=null&&this._approxInterval<n&&(this._approxInterval=n),a!=null&&this._approxInterval>a&&(this._approxInterval=a);var s=xc.length,l=Math.min(SI(xc,this._approxInterval,0,s),s-1);this._interval=xc[l][1],this._minLevelUnit=xc[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return Ke(r)?r:+Kr(r)},e.prototype.contain=function(r){return yc(this.parse(r),this._extent)},e.prototype.normalize=function(r){return _c(this.parse(r),this._extent)},e.prototype.scale=function(r){return bc(r,this._extent)},e.type="time",e})(_i),xc=[["second",ih],["minute",oh],["hour",bo],["quarter-day",bo*6],["half-day",bo*12],["day",ar*1.2],["half-week",ar*3.5],["week",ar*7],["month",ar*31],["quarter",ar*95],["half-year",ny/2],["year",ny]];function kI(t,e,r,n){var a=Kr(e),i=Kr(r),o=function(p){return sy(a,p,n)===sy(i,p,n)},s=function(){return o("year")},l=function(){return s()&&o("month")},c=function(){return l()&&o("day")},u=function(){return c()&&o("hour")},f=function(){return u()&&o("minute")},h=function(){return f()&&o("second")},d=function(){return h()&&o("millisecond")};switch(t){case"year":return s();case"month":return l();case"day":return c();case"hour":return u();case"minute":return f();case"second":return h();case"millisecond":return d()}}function TI(t,e){return t/=ar,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function CI(t){var e=30*ar;return t/=e,t>6?6:t>3?3:t>2?2:1}function MI(t){return t/=bo,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function sb(t,e){return t/=e?oh:ih,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function AI(t){return gg(t)}function DI(t,e,r){var n=new Date(t);switch(ui(e)){case"year":case"month":n[ly(r)](0);case"day":n[cy(r)](1);case"hour":n[uy(r)](0);case"minute":n[fy(r)](0);case"second":n[hy(r)](0),n[dy(r)](0)}return n.getTime()}function II(t,e,r,n){var a=1e4,i=iy,o=0;function s(A,M,I,L,P,N,O){for(var q=new Date(M),R=M,z=q[L]();R<I&&R<=n[1];)O.push({value:R}),z+=A,q[P](z),R=q.getTime();O.push({value:R,notAdd:!0})}function l(A,M,I){var L=[],P=!M.length;if(!kI(ui(A),n[0],n[1],r)){P&&(M=[{value:DI(new Date(n[0]),A,r)},{value:n[1]}]);for(var N=0;N<M.length-1;N++){var O=M[N].value,q=M[N+1].value;if(O!==q){var R=void 0,z=void 0,F=void 0,X=!1;switch(A){case"year":R=Math.max(1,Math.round(e/ar/365)),z=lh(r),F=sC(r);break;case"half-year":case"quarter":case"month":R=CI(e),z=fi(r),F=ly(r);break;case"week":case"half-week":case"day":R=TI(e),z=Fl(r),F=cy(r),X=!0;break;case"half-day":case"quarter-day":case"hour":R=MI(e),z=wo(r),F=uy(r);break;case"minute":R=sb(e,!0),z=Hl(r),F=fy(r);break;case"second":R=sb(e,!1),z=Vl(r),F=hy(r);break;case"millisecond":R=AI(e),z=Gl(r),F=dy(r);break}s(R,O,q,z,F,X,L),A==="year"&&I.length>1&&N===0&&I.unshift({value:I[0].value-R})}}for(var N=0;N<L.length;N++)I.push(L[N]);return L}}for(var c=[],u=[],f=0,h=0,d=0;d<i.length&&o++<a;++d){var p=ui(i[d]);if(aC(i[d])){l(i[d],c[c.length-1]||[],u);var m=i[d+1]?ui(i[d+1]):null;if(p!==m){if(u.length){h=f,u.sort(function(A,M){return A.value-M.value});for(var g=[],v=0;v<u.length;++v){var y=u[v].value;(v===0||u[v-1].value!==y)&&(g.push(u[v]),y>=n[0]&&y<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&h>b/1.5||(c.push(g),f>b||t===i[d]))break}u=[]}}}for(var x=dt(ue(c,function(A){return dt(A,function(M){return M.value>=n[0]&&M.value<=n[1]&&!M.notAdd})}),function(A){return A.length>0}),S=[],w=x.length-1,d=0;d<x.length;++d)for(var k=x[d],T=0;T<k.length;++T)S.push({value:k[T].value,level:w-d});S.sort(function(A,M){return A.value-M.value});for(var C=[],d=0;d<S.length;++d)(d===0||S[d].value!==S[d-1].value)&&C.push(S[d]);return C}zr.registerClass(ob);var lb=zr.prototype,Vo=_i.prototype,LI=lt,PI=Math.floor,RI=Math.ceil,wc=Math.pow,yr=Math.log,wd=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new _i,r._interval=0,r}return e.prototype.getTicks=function(r){var n=this._originalScale,a=this._extent,i=n.getExtent(),o=Vo.getTicks.call(this,r);return ue(o,function(s){var l=s.value,c=lt(wc(this.base,l));return c=l===a[0]&&this._fixMin?Sc(c,i[0]):c,c=l===a[1]&&this._fixMax?Sc(c,i[1]):c,{value:c}},this)},e.prototype.setExtent=function(r,n){var a=yr(this.base);r=yr(Math.max(0,r))/a,n=yr(Math.max(0,n))/a,Vo.setExtent.call(this,r,n)},e.prototype.getExtent=function(){var r=this.base,n=lb.getExtent.call(this);n[0]=wc(r,n[0]),n[1]=wc(r,n[1]);var a=this._originalScale,i=a.getExtent();return this._fixMin&&(n[0]=Sc(n[0],i[0])),this._fixMax&&(n[1]=Sc(n[1],i[1])),n},e.prototype.unionExtent=function(r){this._originalScale.unionExtent(r);var n=this.base;r[0]=yr(r[0])/yr(n),r[1]=yr(r[1])/yr(n),lb.unionExtent.call(this,r)},e.prototype.unionExtentFromData=function(r,n){this.unionExtent(r.getApproximateExtent(n))},e.prototype.calcNiceTicks=function(r){r=r||10;var n=this._extent,a=n[1]-n[0];if(!(a===1/0||a<=0)){var i=mk(a),o=r/a*i;for(o<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var s=[lt(RI(n[0]/i)*i),lt(PI(n[1]/i)*i)];this._interval=i,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){Vo.calcNiceExtent.call(this,r),this._fixMin=r.fixMin,this._fixMax=r.fixMax},e.prototype.parse=function(r){return r},e.prototype.contain=function(r){return r=yr(r)/yr(this.base),yc(r,this._extent)},e.prototype.normalize=function(r){return r=yr(r)/yr(this.base),_c(r,this._extent)},e.prototype.scale=function(r){return r=bc(r,this._extent),wc(this.base,r)},e.type="log",e})(zr),cb=wd.prototype;cb.getMinorTicks=Vo.getMinorTicks,cb.getLabel=Vo.getLabel;function Sc(t,e){return LI(t,Zr(e))}zr.registerClass(wd);var EI=(function(){function t(e,r,n){this._prepareParams(e,r,n)}return t.prototype._prepareParams=function(e,r,n){n[1]<n[0]&&(n=[NaN,NaN]),this._dataMin=n[0],this._dataMax=n[1];var a=this._isOrdinal=e.type==="ordinal";this._needCrossZero=e.type==="interval"&&r.getNeedCrossZero&&r.getNeedCrossZero();var i=r.get("min",!0);i==null&&(i=r.get("startValue",!0));var o=this._modelMinRaw=i;ye(o)?this._modelMinNum=kc(e,o({min:n[0],max:n[1]})):o!=="dataMin"&&(this._modelMinNum=kc(e,o));var s=this._modelMaxRaw=r.get("max",!0);if(ye(s)?this._modelMaxNum=kc(e,s({min:n[0],max:n[1]})):s!=="dataMax"&&(this._modelMaxNum=kc(e,s)),a)this._axisDataLen=r.getCategories().length;else{var l=r.get("boundaryGap"),c=ee(l)?l:[l||0,l||0];typeof c[0]=="boolean"||typeof c[1]=="boolean"?this._boundaryGapInner=[0,0]:this._boundaryGapInner=[dn(c[0],1),dn(c[1],1)]}},t.prototype.calculate=function(){var e=this._isOrdinal,r=this._dataMin,n=this._dataMax,a=this._axisDataLen,i=this._boundaryGapInner,o=e?null:n-r||Math.abs(r),s=this._modelMinRaw==="dataMin"?r:this._modelMinNum,l=this._modelMaxRaw==="dataMax"?n:this._modelMaxNum,c=s!=null,u=l!=null;s==null&&(s=e?a?0:NaN:r-i[0]*o),l==null&&(l=e?a?a-1:NaN:n+i[1]*o),(s==null||!isFinite(s))&&(s=NaN),(l==null||!isFinite(l))&&(l=NaN);var f=ks(s)||ks(l)||e&&!a;this._needCrossZero&&(s>0&&l>0&&!c&&(s=0),s<0&&l<0&&!u&&(l=0));var h=this._determinedMin,d=this._determinedMax;return h!=null&&(s=h,c=!0),d!=null&&(l=d,u=!0),{min:s,max:l,minFixed:c,maxFixed:u,isBlank:f}},t.prototype.modifyDataMinMax=function(e,r){this[NI[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var n=OI[e];this[n]=r},t.prototype.freeze=function(){this.frozen=!0},t})(),OI={min:"_determinedMin",max:"_determinedMax"},NI={min:"_dataMin",max:"_dataMax"};function ub(t,e,r){var n=t.rawExtentInfo;return n||(n=new EI(t,e,r),t.rawExtentInfo=n,n)}function kc(t,e){return e==null?null:ks(e)?NaN:t.parse(e)}function fb(t,e){var r=t.type,n=ub(t,e,t.getExtent()).calculate();t.setBlank(n.isBlank);var a=n.min,i=n.max,o=e.ecModel;if(o&&r==="time"){var s=t0("bar",o),l=!1;if(D(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var c=r0(s),u=BI(a,i,e,c);a=u.min,i=u.max}}return{extent:[a,i],fixMin:n.minFixed,fixMax:n.maxFixed}}function BI(t,e,r,n){var a=r.axis.getExtent(),i=Math.abs(a[1]-a[0]),o=EM(n,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;D(o,function(d){s=Math.min(d.offset,s)});var l=-1/0;D(o,function(d){l=Math.max(d.offset+d.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,f=1-(s+l)/i,h=u/f-u;return e+=h*(l/c),t-=h*(s/c),{min:t,max:e}}function hb(t,e){var r=e,n=fb(t,r),a=n.extent,i=r.get("splitNumber");t instanceof wd&&(t.base=r.get("logBase"));var o=t.type,s=r.get("interval"),l=o==="interval"||o==="time";t.setExtent(a[0],a[1]),t.calcNiceExtent({splitNumber:i,fixMin:n.fixMin,fixMax:n.fixMax,minInterval:l?r.get("minInterval"):null,maxInterval:l?r.get("maxInterval"):null}),s!=null&&t.setInterval&&t.setInterval(s)}function zI(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new xd({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new ob({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(zr.getClass(e)||_i)}}function FI(t){var e=t.scale.getExtent(),r=e[0],n=e[1];return!(r>0&&n>0||r<0&&n<0)}function bi(t){var e=t.getLabelModel().get("formatter"),r=t.type==="category"?t.scale.getExtent()[0]:null;return t.scale.type==="time"?(function(n){return function(a,i){return t.scale.getFormattedLabel(a,i,n)}})(e):ne(e)?(function(n){return function(a){var i=t.scale.getLabel(a),o=n.replace("{value}",i??"");return o}})(e):ye(e)?(function(n){return function(a,i){return r!=null&&(i=a.value-r),n(Sd(t,a),i,a.level!=null?{level:a.level}:null)}})(e):function(n){return t.scale.getLabel(n)}}function Sd(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function HI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var n,a,i=r.getExtent();r instanceof xd?a=r.count():(n=r.getTicks(),a=n.length);var o=t.getLabelModel(),s=bi(t),l,c=1;a>40&&(c=Math.ceil(a/40));for(var u=0;u<a;u+=c){var f=n?n[u]:{value:i[0]+u},h=s(f,u),d=o.getTextRect(h),p=VI(d,o.get("rotate")||0);l?l.union(p):l=p}return l}}function VI(t,e){var r=e*Math.PI/180,n=t.width,a=t.height,i=n*Math.abs(Math.cos(r))+Math.abs(a*Math.sin(r)),o=n*Math.abs(Math.sin(r))+Math.abs(a*Math.cos(r)),s=new Fe(t.x,t.y,i,o);return s}function kd(t){var e=t.get("interval");return e??"auto"}function db(t){return t.type==="category"&&kd(t.getLabelModel())===0}function pb(t,e){var r={};return D(t.mapDimensionsAll(e),function(n){r[F2(t,n)]=!0}),Qe(r)}function GI(t,e,r){e&&D(pb(e,r),function(n){var a=e.getApproximateExtent(n);a[0]<t[0]&&(t[0]=a[0]),a[1]>t[1]&&(t[1]=a[1])})}var $I=(function(){function t(e){this.type="cartesian",this._dimList=[],this._axes={},this.name=e||""}return t.prototype.getAxis=function(e){return this._axes[e]},t.prototype.getAxes=function(){return ue(this._dimList,function(e){return this._axes[e]},this)},t.prototype.getAxesByScale=function(e){return e=e.toLowerCase(),dt(this.getAxes(),function(r){return r.scale.type===e})},t.prototype.addAxis=function(e){var r=e.dim;this._axes[r]=e,this._dimList.push(r)},t})(),Td=["x","y"];function vb(t){return t.type==="interval"||t.type==="time"}var WI=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=Td,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!vb(r)||!vb(n))){var a=r.getExtent(),i=n.getExtent(),o=this.dataToPoint([a[0],i[0]]),s=this.dataToPoint([a[1],i[1]]),l=a[1]-a[0],c=i[1]-i[0];if(!(!l||!c)){var u=(s[0]-o[0])/l,f=(s[1]-o[1])/c,h=o[0]-a[0]*u,d=o[1]-i[0]*f,p=this._transform=[u,0,0,f,h,d];this._invTransform=ku([],p)}}},e.prototype.getBaseAxis=function(){return this.getAxesByScale("ordinal")[0]||this.getAxesByScale("time")[0]||this.getAxis("x")},e.prototype.containPoint=function(r){var n=this.getAxis("x"),a=this.getAxis("y");return n.contain(n.toLocalCoord(r[0]))&&a.contain(a.toLocalCoord(r[1]))},e.prototype.containData=function(r){return this.getAxis("x").containData(r[0])&&this.getAxis("y").containData(r[1])},e.prototype.containZone=function(r,n){var a=this.dataToPoint(r),i=this.dataToPoint(n),o=this.getArea(),s=new Fe(a[0],a[1],i[0]-a[0],i[1]-a[1]);return o.intersect(s)},e.prototype.dataToPoint=function(r,n,a){a=a||[];var i=r[0],o=r[1];if(this._transform&&i!=null&&isFinite(i)&&o!=null&&isFinite(o))return jt(a,r,this._transform);var s=this.getAxis("x"),l=this.getAxis("y");return a[0]=s.toGlobalCoord(s.dataToCoord(i,n)),a[1]=l.toGlobalCoord(l.dataToCoord(o,n)),a},e.prototype.clampData=function(r,n){var a=this.getAxis("x").scale,i=this.getAxis("y").scale,o=a.getExtent(),s=i.getExtent(),l=a.parse(r[0]),c=i.parse(r[1]);return n=n||[],n[0]=Math.min(Math.max(Math.min(o[0],o[1]),l),Math.max(o[0],o[1])),n[1]=Math.min(Math.max(Math.min(s[0],s[1]),c),Math.max(s[0],s[1])),n},e.prototype.pointToData=function(r,n){var a=[];if(this._invTransform)return jt(a,r,this._invTransform);var i=this.getAxis("x"),o=this.getAxis("y");return a[0]=i.coordToData(i.toLocalCoord(r[0]),n),a[1]=o.coordToData(o.toLocalCoord(r[1]),n),a},e.prototype.getOtherAxis=function(r){return this.getAxis(r.dim==="x"?"y":"x")},e.prototype.getArea=function(r){r=r||0;var n=this.getAxis("x").getGlobalExtent(),a=this.getAxis("y").getGlobalExtent(),i=Math.min(n[0],n[1])-r,o=Math.min(a[0],a[1])-r,s=Math.max(n[0],n[1])-i+r,l=Math.max(a[0],a[1])-o+r;return new Fe(i,o,s,l)},e})($I),Go=it();function gb(t,e){var r=ue(e,function(n){return t.scale.parse(n)});return t.type==="time"&&r.length>0&&(r.sort(),r.unshift(r[0]),r.push(r[r.length-1])),r}function UI(t){var e=t.getLabelModel().get("customValues");if(e){var r=bi(t),n=t.scale.getExtent(),a=gb(t,e),i=dt(a,function(o){return o>=n[0]&&o<=n[1]});return{labels:ue(i,function(o){var s={value:o};return{formattedLabel:r(s),rawLabel:t.scale.getLabel(s),tickValue:o}})}}return t.type==="category"?qI(t):ZI(t)}function YI(t,e){var r=t.getTickModel().get("customValues");if(r){var n=t.scale.getExtent(),a=gb(t,r);return{ticks:dt(a,function(i){return i>=n[0]&&i<=n[1]})}}return t.type==="category"?XI(t,e):{ticks:ue(t.scale.getTicks(),function(i){return i.value})}}function qI(t){var e=t.getLabelModel(),r=mb(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function mb(t,e){var r=yb(t,"labels"),n=kd(e),a=_b(r,n);if(a)return a;var i,o;return ye(n)?i=wb(t,n):(o=n==="auto"?KI(t):n,i=xb(t,o)),bb(r,n,{labels:i,labelCategoryInterval:o})}function XI(t,e){var r=yb(t,"ticks"),n=kd(e),a=_b(r,n);if(a)return a;var i,o;if((!e.get("show")||t.scale.isBlank())&&(i=[]),ye(n))i=wb(t,n,!0);else if(n==="auto"){var s=mb(t,t.getLabelModel());o=s.labelCategoryInterval,i=ue(s.labels,function(l){return l.tickValue})}else o=n,i=xb(t,o,!0);return bb(r,n,{ticks:i,tickCategoryInterval:o})}function ZI(t){var e=t.scale.getTicks(),r=bi(t);return{labels:ue(e,function(n,a){return{level:n.level,formattedLabel:r(n,a),rawLabel:t.scale.getLabel(n),tickValue:n.value}})}}function yb(t,e){return Go(t)[e]||(Go(t)[e]=[])}function _b(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function bb(t,e,r){return t.push({key:e,value:r}),r}function KI(t){var e=Go(t).autoInterval;return e??(Go(t).autoInterval=t.calculateCategoryInterval())}function jI(t){var e=QI(t),r=bi(t),n=(e.axisRotate-e.labelRotate)/180*Math.PI,a=t.scale,i=a.getExtent(),o=a.count();if(i[1]-i[0]<1)return 0;var s=1;o>40&&(s=Math.max(1,Math.floor(o/40)));for(var l=i[0],c=t.dataToCoord(l+1)-t.dataToCoord(l),u=Math.abs(c*Math.cos(n)),f=Math.abs(c*Math.sin(n)),h=0,d=0;l<=i[1];l+=s){var p=0,m=0,g=Tu(r({value:l}),e.font,"center","top");p=g.width*1.3,m=g.height*1.3,h=Math.max(h,p,7),d=Math.max(d,m,7)}var v=h/u,y=d/f;isNaN(v)&&(v=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(v,y))),x=Go(t.model),S=t.getExtent(),w=x.lastAutoInterval,k=x.lastTickCount;return w!=null&&k!=null&&Math.abs(w-b)<=1&&Math.abs(k-o)<=1&&w>b&&x.axisExtent0===S[0]&&x.axisExtent1===S[1]?b=w:(x.lastTickCount=o,x.lastAutoInterval=b,x.axisExtent0=S[0],x.axisExtent1=S[1]),b}function QI(t){var e=t.getLabelModel();return{axisRotate:t.getRotate?t.getRotate():t.isHorizontal&&!t.isHorizontal()?90:0,labelRotate:e.get("rotate")||0,font:e.getFont()}}function xb(t,e,r){var n=bi(t),a=t.scale,i=a.getExtent(),o=t.getLabelModel(),s=[],l=Math.max((e||0)+1,1),c=i[0],u=a.count();c!==0&&l>1&&u/l>2&&(c=Math.round(Math.ceil(c/l)*l));var f=db(t),h=o.get("showMinLabel")||f,d=o.get("showMaxLabel")||f;h&&c!==i[0]&&m(i[0]);for(var p=c;p<=i[1];p+=l)m(p);d&&p-l!==i[1]&&m(i[1]);function m(g){var v={value:g};s.push(r?g:{formattedLabel:n(v),rawLabel:a.getLabel(v),tickValue:g})}return s}function wb(t,e,r){var n=t.scale,a=bi(t),i=[];return D(n.getTicks(),function(o){var s=n.getLabel(o),l=o.value;e(o.value,s)&&i.push(r?l:{formattedLabel:a(o),rawLabel:s,tickValue:l})}),i}var Sb=[0,1],JI=(function(){function t(e,r,n){this.onBand=!1,this.inverse=!1,this.dim=e,this.scale=r,this._extent=n||[0,0]}return t.prototype.contain=function(e){var r=this._extent,n=Math.min(r[0],r[1]),a=Math.max(r[0],r[1]);return e>=n&&e<=a},t.prototype.containData=function(e){return this.scale.contain(e)},t.prototype.getExtent=function(){return this._extent.slice()},t.prototype.getPixelPrecision=function(e){return pg(e||this.scale.getExtent(),this._extent)},t.prototype.setExtent=function(e,r){var n=this._extent;n[0]=e,n[1]=r},t.prototype.dataToCoord=function(e,r){var n=this._extent,a=this.scale;return e=a.normalize(e),this.onBand&&a.type==="ordinal"&&(n=n.slice(),kb(n,a.count())),ia(e,Sb,n,r)},t.prototype.coordToData=function(e,r){var n=this._extent,a=this.scale;this.onBand&&a.type==="ordinal"&&(n=n.slice(),kb(n,a.count()));var i=ia(e,n,Sb,r);return this.scale.scale(i)},t.prototype.pointToData=function(e,r){},t.prototype.getTicksCoords=function(e){e=e||{};var r=e.tickModel||this.getTickModel(),n=YI(this,r),a=n.ticks,i=ue(a,function(s){return{coord:this.dataToCoord(this.scale.type==="ordinal"?this.scale.getRawOrdinalNumber(s):s),tickValue:s}},this),o=r.get("alignWithLabel");return eL(this,i,o,e.clamp),i},t.prototype.getMinorTicksCoords=function(){if(this.scale.type==="ordinal")return[];var e=this.model.getModel("minorTick"),r=e.get("splitNumber");r>0&&r<100||(r=5);var n=this.scale.getMinorTicks(r),a=ue(n,function(i){return ue(i,function(o){return{coord:this.dataToCoord(o),tickValue:o}},this)},this);return a},t.prototype.getViewLabels=function(){return UI(this).labels},t.prototype.getLabelModel=function(){return this.model.getModel("axisLabel")},t.prototype.getTickModel=function(){return this.model.getModel("axisTick")},t.prototype.getBandWidth=function(){var e=this._extent,r=this.scale.getExtent(),n=r[1]-r[0]+(this.onBand?1:0);n===0&&(n=1);var a=Math.abs(e[1]-e[0]);return Math.abs(a)/n},t.prototype.calculateCategoryInterval=function(){return jI(this)},t})();function kb(t,e){var r=t[1]-t[0],n=e,a=r/n/2;t[0]+=a,t[1]-=a}function eL(t,e,r,n){var a=e.length;if(!t.onBand||r||!a)return;var i=t.getExtent(),o,s;if(a===1)e[0].coord=i[0],o=e[1]={coord:i[1],tickValue:e[0].tickValue};else{var l=e[a-1].tickValue-e[0].tickValue,c=(e[a-1].coord-e[0].coord)/l;D(e,function(d){d.coord-=c/2});var u=t.scale.getExtent();s=1+u[1]-e[a-1].tickValue,o={coord:e[a-1].coord+c*s,tickValue:u[1]+1},e.push(o)}var f=i[0]>i[1];h(e[0].coord,i[0])&&(n?e[0].coord=i[0]:e.shift()),n&&h(i[0],e[0].coord)&&e.unshift({coord:i[0]}),h(i[1],o.coord)&&(n?o.coord=i[1]:e.pop()),n&&h(o.coord,i[1])&&e.push({coord:i[1]});function h(d,p){return d=lt(d),p=lt(p),f?d>p:d<p}}var tL=(function(t){Z(e,t);function e(r,n,a,i,o){var s=t.call(this,r,n,a)||this;return s.index=0,s.type=i||"value",s.position=o||"bottom",s}return e.prototype.isHorizontal=function(){var r=this.position;return r==="top"||r==="bottom"},e.prototype.getGlobalExtent=function(r){var n=this.getExtent();return n[0]=this.toGlobalCoord(n[0]),n[1]=this.toGlobalCoord(n[1]),r&&n[0]>n[1]&&n.reverse(),n},e.prototype.pointToData=function(r,n){return this.coordToData(this.toLocalCoord(r[this.dim==="x"?0:1]),n)},e.prototype.setCategorySortInfo=function(r){if(this.type!=="category")return!1;this.model.option.categorySortInfo=r,this.scale.setSortInfo(r)},e})(JI);function Cd(t,e,r){r=r||{};var n=t.coordinateSystem,a=e.axis,i={},o=a.getAxesOnZeroOf()[0],s=a.position,l=o?"onZero":s,c=a.dim,u=n.getRect(),f=[u.x,u.x+u.width,u.y,u.y+u.height],h={left:0,right:1,top:0,bottom:1,onZero:2},d=e.get("offset")||0,p=c==="x"?[f[2]-d,f[3]+d]:[f[0]-d,f[1]+d];if(o){var m=o.toGlobalCoord(o.dataToCoord(0));p[h.onZero]=Math.max(Math.min(m,p[1]),p[0])}i.position=[c==="y"?p[h[l]]:f[0],c==="x"?p[h[l]]:f[3]],i.rotation=Math.PI/2*(c==="x"?0:1);var g={top:-1,bottom:1,left:-1,right:1};i.labelDirection=i.tickDirection=i.nameDirection=g[s],i.labelOffset=o?p[h[s]]-p[h.onZero]:0,e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),Vi(r.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var v=e.get(["axisLabel","rotate"]);return i.labelRotate=l==="top"?-v:v,i.z2=1,i}function Tb(t){return t.get("coordinateSystem")==="cartesian2d"}function Cb(t){var e={xAxisModel:null,yAxisModel:null};return D(e,function(r,n){var a=n.replace(/Model$/,""),i=t.getReferringComponents(a,Et).models[0];e[n]=i}),e}var Md=Math.log;function rL(t,e,r){var n=_i.prototype,a=n.getTicks.call(r),i=n.getTicks.call(r,!0),o=a.length-1,s=n.getInterval.call(r),l=fb(t,e),c=l.extent,u=l.fixMin,f=l.fixMax;if(t.type==="log"){var h=Md(t.base);c=[Md(c[0])/h,Md(c[1])/h]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:f});var d=n.getExtent.call(t);u&&(c[0]=d[0]),f&&(c[1]=d[1]);var p=n.getInterval.call(t),m=c[0],g=c[1];if(u&&f)p=(g-m)/o;else if(u)for(g=c[0]+p*o;g<c[1]&&isFinite(g)&&isFinite(c[1]);)p=bd(p),g=c[0]+p*o;else if(f)for(m=c[1]-p*o;m>c[0]&&isFinite(m)&&isFinite(c[0]);)p=bd(p),m=c[1]-p*o;else{var v=t.getTicks().length-1;v>o&&(p=bd(p));var y=p*o;g=Math.ceil(c[1]/p)*p,m=lt(g-y),m<0&&c[0]>=0?(m=0,g=lt(y)):g>0&&c[1]<=0&&(g=0,m=-lt(y))}var b=(a[0].value-i[0].value)/s,x=(a[o].value-i[o].value)/s;n.setExtent.call(t,m+p*b,g+p*x),n.setInterval.call(t,p),(b||x)&&n.setNiceExtent.call(t,m+p,g-p)}var nL=(function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=Td,this._initCartesian(e,r,n),this.model=e}return t.prototype.getRect=function(){return this._rect},t.prototype.update=function(e,r){var n=this._axesMap;this._updateScale(e,this.model);function a(o){var s,l=Qe(o),c=l.length;if(c){for(var u=[],f=c-1;f>=0;f--){var h=+l[f],d=o[h],p=d.model,m=d.scale;_d(m)&&p.get("alignTicks")&&p.get("interval")==null?u.push(d):(hb(m,p),_d(m)&&(s=d))}u.length&&(s||(s=u.pop(),hb(s.scale,s.model)),D(u,function(g){rL(g.scale,g.model,s.scale)}))}}a(n.x),a(n.y);var i={};D(n.x,function(o){Mb(n,"y",o,i)}),D(n.y,function(o){Mb(n,"x",o,i)}),this.resize(this.model,r)},t.prototype.resize=function(e,r,n){var a=e.getBoxLayoutParams(),i=!n&&e.get("containLabel"),o=Yl(a,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),i&&(D(s,function(c){if(!c.model.get(["axisLabel","inside"])){var u=HI(c);if(u){var f=c.isHorizontal()?"height":"width",h=c.model.get(["axisLabel","margin"]);o[f]-=u[f]+h,c.position==="top"?o.y+=u.height+h:c.position==="left"&&(o.x+=u.width+h)}}}),l()),D(this._coordsList,function(c){c.calcAffineTransform()});function l(){D(s,function(c){var u=c.isHorizontal(),f=u?[0,o.width]:[0,o.height],h=c.inverse?1:0;c.setExtent(f[h],f[1-h]),aL(c,u?o.x:o.y)})}},t.prototype.getAxis=function(e,r){var n=this._axesMap[e];if(n!=null)return n[r||0]},t.prototype.getAxes=function(){return this._axesList.slice()},t.prototype.getCartesian=function(e,r){if(e!=null&&r!=null){var n="x"+e+"y"+r;return this._coordsMap[n]}ce(e)&&(r=e.yAxisIndex,e=e.xAxisIndex);for(var a=0,i=this._coordsList;a<i.length;a++)if(i[a].getAxis("x").index===e||i[a].getAxis("y").index===r)return i[a]},t.prototype.getCartesians=function(){return this._coordsList.slice()},t.prototype.convertToPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.dataToPoint(n):a.axis?a.axis.toGlobalCoord(a.axis.dataToCoord(n)):null},t.prototype.convertFromPixel=function(e,r,n){var a=this._findConvertTarget(r);return a.cartesian?a.cartesian.pointToData(n):a.axis?a.axis.coordToData(a.axis.toLocalCoord(n)):null},t.prototype._findConvertTarget=function(e){var r=e.seriesModel,n=e.xAxisModel||r&&r.getReferringComponents("xAxis",Et).models[0],a=e.yAxisModel||r&&r.getReferringComponents("yAxis",Et).models[0],i=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,ze(o,s)<0&&(s=null);else if(n&&a)s=this.getCartesian(n.componentIndex,a.componentIndex);else if(n)l=this.getAxis("x",n.componentIndex);else if(a)l=this.getAxis("y",a.componentIndex);else if(i){var c=i.coordinateSystem;c===this&&(s=this._coordsList[0])}return{cartesian:s,axis:l}},t.prototype.containPoint=function(e){var r=this._coordsList[0];if(r)return r.containPoint(e)},t.prototype._initCartesian=function(e,r,n){var a=this,i=this,o={left:!1,right:!1,top:!1,bottom:!1},s={x:{},y:{}},l={x:0,y:0};if(r.eachComponent("xAxis",c("x"),this),r.eachComponent("yAxis",c("y"),this),!l.x||!l.y){this._axesMap={},this._axesList=[];return}this._axesMap=s,D(s.x,function(u,f){D(s.y,function(h,d){var p="x"+f+"y"+d,m=new WI(p);m.master=a,m.model=e,a._coordsMap[p]=m,a._coordsList.push(m),m.addAxis(u),m.addAxis(h)})});function c(u){return function(f,h){if(Ad(f,e)){var d=f.get("position");u==="x"?d!=="top"&&d!=="bottom"&&(d=o.bottom?"top":"bottom"):d!=="left"&&d!=="right"&&(d=o.left?"right":"left"),o[d]=!0;var p=new tL(u,zI(f),[0,0],f.get("type"),d),m=p.type==="category";p.onBand=m&&f.get("boundaryGap"),p.inverse=f.get("inverse"),f.axis=p,p.model=f,p.grid=i,p.index=h,i._axesList.push(p),s[u][h]=p,l[u]++}}}},t.prototype._updateScale=function(e,r){D(this._axesList,function(a){if(a.scale.setExtent(1/0,-1/0),a.type==="category"){var i=a.model.get("categorySortInfo");a.scale.setSortInfo(i)}}),e.eachSeries(function(a){if(Tb(a)){var i=Cb(a),o=i.xAxisModel,s=i.yAxisModel;if(!Ad(o,r)||!Ad(s,r))return;var l=this.getCartesian(o.componentIndex,s.componentIndex),c=a.getData(),u=l.getAxis("x"),f=l.getAxis("y");n(c,u),n(c,f)}},this);function n(a,i){D(pb(a,i.dim),function(o){i.scale.unionExtentFromData(a,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],n=[];return D(this.getCartesians(),function(a){var i=e!=null&&e!=="auto"?a.getAxis(e):a.getBaseAxis(),o=a.getOtherAxis(i);ze(r,i)<0&&r.push(i),ze(n,o)<0&&n.push(o)}),{baseAxes:r,otherAxes:n}},t.create=function(e,r){var n=[];return e.eachComponent("grid",function(a,i){var o=new t(a,e,r);o.name="grid_"+i,o.resize(a,r,!0),a.coordinateSystem=o,n.push(o)}),e.eachSeries(function(a){if(Tb(a)){var i=Cb(a),o=i.xAxisModel,s=i.yAxisModel,l=o.getCoordSysModel(),c=l.coordinateSystem;a.coordinateSystem=c.getCartesian(o.componentIndex,s.componentIndex)}}),n},t.dimensions=Td,t})();function Ad(t,e){return t.getCoordSysModel()===e}function Mb(t,e,r,n){r.getAxesOnZeroOf=function(){return i?[i]:[]};var a=t[e],i,o=r.model,s=o.get(["axisLine","onZero"]),l=o.get(["axisLine","onZeroAxisIndex"]);if(!s)return;if(l!=null)Ab(a[l])&&(i=a[l]);else for(var c in a)if(a.hasOwnProperty(c)&&Ab(a[c])&&!n[u(a[c])]){i=a[c];break}i&&(n[u(i)]=!0);function u(f){return f.dim+"_"+f.index}}function Ab(t){return t&&t.type!=="category"&&t.type!=="time"&&FI(t)}function aL(t,e){var r=t.getExtent(),n=r[0]+r[1];t.toGlobalCoord=t.dim==="x"?function(a){return a+e}:function(a){return n-a+e},t.toLocalCoord=t.dim==="x"?function(a){return a-e}:function(a){return n-a+e}}var Ln=Math.PI,Pn=(function(){function t(e,r){this.group=new mt,this.opt=r,this.axisModel=e,Ne(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new mt({x:r.position[0],y:r.position[1],rotation:r.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(e){return!!Db[e]},t.prototype.add=function(e){Db[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,n){var a=vg(r-e),i,o;return rl(a)?(o=n>0?"top":"bottom",i="center"):rl(a-Ln)?(o=n>0?"bottom":"top",i="center"):(o="middle",a>0&&a<Ln?i=n>0?"right":"left":i=n>0?"left":"right"),{rotation:a,textAlign:i,textVerticalAlign:o}},t.makeAxisEventDataBase=function(e){var r={componentType:e.mainType,componentIndex:e.componentIndex};return r[e.mainType+"Index"]=e.componentIndex,r},t.isLabelSilent=function(e){var r=e.get("tooltip");return e.get("silent")||!(e.get("triggerEvent")||r&&r.show)},t})(),Db={axisLine:function(t,e,r,n){var a=e.get(["axisLine","show"]);if(a==="auto"&&t.handleAutoShown&&(a=t.handleAutoShown("axisLine")),!!a){var i=e.axis.getExtent(),o=n.transform,s=[i[0],0],l=[i[1],0],c=s[0]>l[0];o&&(jt(s,s,o),jt(l,l,o));var u=U({lineCap:"round"},e.getModel(["axisLine","lineStyle"]).getLineStyle()),f=new xn({shape:{x1:s[0],y1:s[1],x2:l[0],y2:l[1]},style:u,strokeContainThreshold:t.strokeContainThreshold||5,silent:!0,z2:1});po(f.shape,f.style.lineWidth),f.anid="line",r.add(f);var h=e.get(["axisLine","symbol"]);if(h!=null){var d=e.get(["axisLine","symbolSize"]);ne(h)&&(h=[h,h]),(ne(d)||Ke(d))&&(d=[d,d]);var p=Ey(e.get(["axisLine","symbolOffset"])||0,d),m=d[0],g=d[1];D([{rotate:t.rotation+Math.PI/2,offset:p[0],r:0},{rotate:t.rotation-Math.PI/2,offset:p[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(v,y){if(h[y]!=="none"&&h[y]!=null){var b=di(h[y],-m/2,-g/2,m,g,u.stroke,!0),x=v.r+v.offset,S=c?l:s;b.attr({rotation:v.rotate,x:S[0]+x*Math.cos(t.rotation),y:S[1]-x*Math.sin(t.rotation),silent:!0,z2:11}),r.add(b)}})}}},axisTickLabel:function(t,e,r,n){var a=sL(r,n,e,t),i=cL(r,n,e,t);if(oL(e,i,a),lL(r,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=tA(ue(i,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));rA(o)}},axisName:function(t,e,r,n){var a=Vi(t.axisName,e.get("name"));if(a){var i=e.get("nameLocation"),o=t.nameDirection,s=e.getModel("nameTextStyle"),l=e.get("nameGap")||0,c=e.axis.getExtent(),u=c[0]>c[1]?-1:1,f=[i==="start"?c[0]-u*l:i==="end"?c[1]+u*l:(c[0]+c[1])/2,Lb(i)?t.labelOffset+o*l:0],h,d=e.get("nameRotate");d!=null&&(d=d*Ln/180);var p;Lb(i)?h=Pn.innerTextLayout(t.rotation,d??t.rotation,o):(h=iL(t.rotation,i,d||0,c),p=t.axisNameAvailableWidth,p!=null&&(p=Math.abs(p/Math.sin(h.rotation)),!isFinite(p)&&(p=null)));var m=s.getFont(),g=e.get("nameTruncate",!0)||{},v=g.ellipsis,y=Vi(t.nameTruncateMaxWidth,g.maxWidth,p),b=new Pt({x:f[0],y:f[1],rotation:h.rotation,silent:Pn.isLabelSilent(e),style:ri(s,{text:a,font:m,overflow:"truncate",width:y,ellipsis:v,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||h.textAlign,verticalAlign:s.get("verticalAlign")||h.textVerticalAlign}),z2:1});if(Sl({el:b,componentModel:e,itemName:a}),b.__fullText=a,b.anid="name",e.get("triggerEvent")){var x=Pn.makeAxisEventDataBase(e);x.targetType="axisName",x.name=a,Ve(b).eventData=x}n.add(b),b.updateTransform(),r.add(b),b.decomposeTransform()}}};function iL(t,e,r,n){var a=vg(r-t),i,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return rl(a-Ln/2)?(o=l?"bottom":"top",i="center"):rl(a-Ln*1.5)?(o=l?"top":"bottom",i="center"):(o="middle",a<Ln*1.5&&a>Ln/2?i=l?"left":"right":i=l?"right":"left"),{rotation:a,textAlign:i,textVerticalAlign:o}}function oL(t,e,r){if(!db(t.axis)){var n=t.get(["axisLabel","showMinLabel"]),a=t.get(["axisLabel","showMaxLabel"]);e=e||[],r=r||[];var i=e[0],o=e[1],s=e[e.length-1],l=e[e.length-2],c=r[0],u=r[1],f=r[r.length-1],h=r[r.length-2];n===!1?(lr(i),lr(c)):Ib(i,o)&&(n?(lr(o),lr(u)):(lr(i),lr(c))),a===!1?(lr(s),lr(f)):Ib(l,s)&&(a?(lr(l),lr(h)):(lr(s),lr(f)))}}function lr(t){t&&(t.ignore=!0)}function Ib(t,e){var r=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!r||!n)){var a=xu([]);return Su(a,a,-t.rotation),r.applyTransform(Fa([],a,t.getLocalTransform())),n.applyTransform(Fa([],a,e.getLocalTransform())),r.intersect(n)}}function Lb(t){return t==="middle"||t==="center"}function Pb(t,e,r,n,a){for(var i=[],o=[],s=[],l=0;l<t.length;l++){var c=t[l].coord;o[0]=c,o[1]=0,s[0]=c,s[1]=r,e&&(jt(o,o,e),jt(s,s,e));var u=new xn({shape:{x1:o[0],y1:o[1],x2:s[0],y2:s[1]},style:n,z2:2,autoBatch:!0,silent:!0});po(u.shape,u.style.lineWidth),u.anid=a+"_"+t[l].tickValue,i.push(u)}return i}function sL(t,e,r,n){var a=r.axis,i=r.getModel("axisTick"),o=i.get("show");if(o==="auto"&&n.handleAutoShown&&(o=n.handleAutoShown("axisTick")),!(!o||a.scale.isBlank())){for(var s=i.getModel("lineStyle"),l=n.tickDirection*i.get("length"),c=a.getTicksCoords(),u=Pb(c,e.transform,l,Ne(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),f=0;f<u.length;f++)t.add(u[f]);return u}}function lL(t,e,r,n){var a=r.axis,i=r.getModel("minorTick");if(!(!i.get("show")||a.scale.isBlank())){var o=a.getMinorTicksCoords();if(o.length)for(var s=i.getModel("lineStyle"),l=n*i.get("length"),c=Ne(s.getLineStyle(),Ne(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),u=0;u<o.length;u++)for(var f=Pb(o[u],e.transform,l,c,"minorticks_"+u),h=0;h<f.length;h++)t.add(f[h])}}function cL(t,e,r,n){var a=r.axis,i=Vi(n.axisLabelShow,r.get(["axisLabel","show"]));if(!(!i||a.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=a.getViewLabels(),c=(Vi(n.labelRotate,o.get("rotate"))||0)*Ln/180,u=Pn.innerTextLayout(n.rotation,c,n.labelDirection),f=r.getCategories&&r.getCategories(!0),h=[],d=Pn.isLabelSilent(r),p=r.get("triggerEvent");return D(l,function(m,g){var v=a.scale.type==="ordinal"?a.scale.getRawOrdinalNumber(m.tickValue):m.tickValue,y=m.formattedLabel,b=m.rawLabel,x=o;if(f&&f[v]){var S=f[v];ce(S)&&S.textStyle&&(x=new et(S.textStyle,o,r.ecModel))}var w=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),k=a.dataToCoord(v),T=x.getShallow("align",!0)||u.textAlign,C=Ce(x.getShallow("alignMinLabel",!0),T),A=Ce(x.getShallow("alignMaxLabel",!0),T),M=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||u.textVerticalAlign,I=Ce(x.getShallow("verticalAlignMinLabel",!0),M),L=Ce(x.getShallow("verticalAlignMaxLabel",!0),M),P=new Pt({x:k,y:n.labelOffset+n.labelDirection*s,rotation:u.rotation,silent:d,z2:10+(m.level||0),style:ri(x,{text:y,align:g===0?C:g===l.length-1?A:T,verticalAlign:g===0?I:g===l.length-1?L:M,fill:ye(w)?w(a.type==="category"?b:a.type==="value"?v+"":v,g):w})});if(P.anid="label_"+v,Sl({el:P,componentModel:r,itemName:y,formatterParamsExtra:{isTruncated:function(){return P.isTruncated},value:b,tickIndex:g}}),p){var N=Pn.makeAxisEventDataBase(r);N.targetType="axisLabel",N.value=b,N.tickIndex=g,a.type==="category"&&(N.dataIndex=v),Ve(P).eventData=N}e.add(P),P.updateTransform(),h.push(P),t.add(P),P.decomposeTransform()}),h}}function uL(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return fL(r,t,e),r.seriesInvolved&&dL(r,t),r}function fL(t,e,r){var n=e.getComponent("tooltip"),a=e.getComponent("axisPointer"),i=a.get("link",!0)||[],o=[];D(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=$o(s.model),c=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var u=s.model,f=u.getModel("tooltip",n);if(D(s.getAxes(),at(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var h=f.get("trigger")==="axis",d=f.get(["axisPointer","type"])==="cross",p=s.getTooltipAxes(f.get(["axisPointer","axis"]));(h||d)&&D(p.baseAxes,at(m,d?"cross":!0,h)),d&&D(p.otherAxes,at(m,"cross",!1))}function m(g,v,y){var b=y.model.getModel("axisPointer",a),x=b.get("show");if(!(!x||x==="auto"&&!g&&!Ld(b))){v==null&&(v=b.get("triggerTooltip")),b=g?hL(y,f,a,e,g,v):b;var S=b.get("snap"),w=b.get("triggerEmphasis"),k=$o(y.model),T=v||S||y.type==="category",C=t.axesInfo[k]={key:k,axis:y,coordSys:s,axisPointerModel:b,triggerTooltip:v,triggerEmphasis:w,involveSeries:T,snap:S,useHandle:Ld(b),seriesModels:[],linkGroup:null};c[k]=C,t.seriesInvolved=t.seriesInvolved||T;var A=pL(i,y);if(A!=null){var M=o[A]||(o[A]={axesInfo:{}});M.axesInfo[k]=C,M.mapper=i[A].mapper,C.linkGroup=M}}}})}function hL(t,e,r,n,a,i){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};D(s,function(h){l[h]=Te(o.get(h))}),l.snap=t.type!=="category"&&!!i,o.get("type")==="cross"&&(l.type="line");var c=l.label||(l.label={});if(c.show==null&&(c.show=!1),a==="cross"){var u=o.get(["label","show"]);if(c.show=u??!0,!i){var f=l.lineStyle=o.get("crossStyle");f&&Ne(c,f.textStyle)}}return t.model.getModel("axisPointer",new et(l,r,n))}function dL(t,e){e.eachSeries(function(r){var n=r.coordinateSystem,a=r.get(["tooltip","trigger"],!0),i=r.get(["tooltip","show"],!0);!n||a==="none"||a===!1||a==="item"||i===!1||r.get(["axisPointer","show"],!0)===!1||D(t.coordSysAxesInfo[$o(n.model)],function(o){var s=o.axis;n.getAxis(s.dim)===s&&(o.seriesModels.push(r),o.seriesDataCount==null&&(o.seriesDataCount=0),o.seriesDataCount+=r.getData().count())})})}function pL(t,e){for(var r=e.model,n=e.dim,a=0;a<t.length;a++){var i=t[a]||{};if(Dd(i[n+"AxisId"],r.id)||Dd(i[n+"AxisIndex"],r.componentIndex)||Dd(i[n+"AxisName"],r.name))return a}}function Dd(t,e){return t==="all"||ee(t)&&ze(t,e)>=0||t===e}function vL(t){var e=Id(t);if(e){var r=e.axisPointerModel,n=e.axis.scale,a=r.option,i=r.get("status"),o=r.get("value");o!=null&&(o=n.parse(o));var s=Ld(r);i==null&&(a.status=s?"show":"hide");var l=n.getExtent().slice();l[0]>l[1]&&l.reverse(),(o==null||o>l[1])&&(o=l[1]),o<l[0]&&(o=l[0]),a.value=o,s&&(a.status=e.axis.scale.isBlank()?"hide":"show")}}function Id(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[$o(t)]}function gL(t){var e=Id(t);return e&&e.axisPointerModel}function Ld(t){return!!t.get(["handle","show"])}function $o(t){return t.type+"||"+t.id}var Rb={},Eb=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.axisPointerClass&&vL(r),t.prototype.render.apply(this,arguments),this._doUpdateAxisPointerClass(r,a,!0)},e.prototype.updateAxisPointer=function(r,n,a,i){this._doUpdateAxisPointerClass(r,a,!1)},e.prototype.remove=function(r,n){var a=this._axisPointer;a&&a.remove(n)},e.prototype.dispose=function(r,n){this._disposeAxisPointer(n),t.prototype.dispose.apply(this,arguments)},e.prototype._doUpdateAxisPointerClass=function(r,n,a){var i=e.getAxisPointerClass(this.axisPointerClass);if(i){var o=gL(r);o?(this._axisPointer||(this._axisPointer=new i)).render(r,o,n,a):this._disposeAxisPointer(n)}},e.prototype._disposeAxisPointer=function(r){this._axisPointer&&this._axisPointer.dispose(r),this._axisPointer=null},e.registerAxisPointerClass=function(r,n){Rb[r]=n},e.getAxisPointerClass=function(r){return r&&Rb[r]},e.type="axis",e})(gr),Pd=it();function mL(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitArea"),o=i.getModel("areaStyle"),s=o.get("color"),l=n.coordinateSystem.getRect(),c=a.getTicksCoords({tickModel:i,clamp:!0});if(c.length){var u=s.length,f=Pd(t).splitAreaColors,h=de(),d=0;if(f)for(var p=0;p<c.length;p++){var m=f.get(c[p].tickValue);if(m!=null){d=(m+(u-1)*p)%u;break}}var g=a.toGlobalCoord(c[0].coord),v=o.getAreaStyle();s=ee(s)?s:[s];for(var p=1;p<c.length;p++){var y=a.toGlobalCoord(c[p].coord),b=void 0,x=void 0,S=void 0,w=void 0;a.isHorizontal()?(b=g,x=l.y,S=y-b,w=l.height,g=b+S):(b=l.x,x=g,S=l.width,w=y-x,g=x+w);var k=c[p-1].tickValue;k!=null&&h.set(k,d),e.add(new ft({anid:k!=null?"area_"+k:null,shape:{x:b,y:x,width:S,height:w},style:Ne({fill:s[d]},v),autoBatch:!0,silent:!0})),d=(d+1)%u}Pd(t).splitAreaColors=h}}}function yL(t){Pd(t).splitAreaColors=null}var _L=["axisLine","axisTickLabel","axisName"],bL=["splitArea","splitLine","minorSplitLine"],Ob=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.axisPointerClass="CartesianAxisPointer",r}return e.prototype.render=function(r,n,a,i){this.group.removeAll();var o=this._axisGroup;if(this._axisGroup=new mt,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=Cd(s,r),c=new Pn(r,U({handleAutoShown:function(f){for(var h=s.coordinateSystem.getCartesians(),d=0;d<h.length;d++)if(_d(h[d].getOtherAxis(r.axis).scale))return!0;return!1}},l));D(_L,c.add,c),this._axisGroup.add(c.getGroup()),D(bL,function(f){r.get([f,"show"])&&xL[f](this,this._axisGroup,r,s)},this);var u=i&&i.type==="changeAxisOrder"&&i.isInitSort;u||fm(o,this._axisGroup,r),t.prototype.render.call(this,r,n,a,i)}},e.prototype.remove=function(){yL(this)},e.type="cartesianAxis",e})(Eb),xL={splitLine:function(t,e,r,n){var a=r.axis;if(!a.scale.isBlank()){var i=r.getModel("splitLine"),o=i.getModel("lineStyle"),s=o.get("color"),l=i.get("showMinLine")!==!1,c=i.get("showMaxLine")!==!1;s=ee(s)?s:[s];for(var u=n.coordinateSystem.getRect(),f=a.isHorizontal(),h=0,d=a.getTicksCoords({tickModel:i}),p=[],m=[],g=o.getLineStyle(),v=0;v<d.length;v++){var y=a.toGlobalCoord(d[v].coord);if(!(v===0&&!l||v===d.length-1&&!c)){var b=d[v].tickValue;f?(p[0]=y,p[1]=u.y,m[0]=y,m[1]=u.y+u.height):(p[0]=u.x,p[1]=y,m[0]=u.x+u.width,m[1]=y);var x=h++%s.length,S=new xn({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:p[0],y1:p[1],x2:m[0],y2:m[1]},style:Ne({stroke:s[x]},g),silent:!0});po(S.shape,g.lineWidth),e.add(S)}}}},minorSplitLine:function(t,e,r,n){var a=r.axis,i=r.getModel("minorSplitLine"),o=i.getModel("lineStyle"),s=n.coordinateSystem.getRect(),l=a.isHorizontal(),c=a.getMinorTicksCoords();if(c.length)for(var u=[],f=[],h=o.getLineStyle(),d=0;d<c.length;d++)for(var p=0;p<c[d].length;p++){var m=a.toGlobalCoord(c[d][p].coord);l?(u[0]=m,u[1]=s.y,f[0]=m,f[1]=s.y+s.height):(u[0]=s.x,u[1]=m,f[0]=s.x+s.width,f[1]=m);var g=new xn({anid:"minor_line_"+c[d][p].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:f[0],y2:f[1]},style:h,silent:!0});po(g.shape,h.lineWidth),e.add(g)}},splitArea:function(t,e,r,n){mL(t,e,r,n)}},Nb=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e})(Ob),wL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=Nb.type,r}return e.type="yAxis",e})(Ob),SL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="grid",r}return e.prototype.render=function(r,n){this.group.removeAll(),r.get("show")&&this.group.add(new ft({shape:r.coordinateSystem.getRect(),style:Ne({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e})(gr),Bb={offset:0};function kL(t){t.registerComponentView(SL),t.registerComponentModel(hI),t.registerCoordinateSystem("cartesian2d",nL),rb(t,"x",gd,Bb),rb(t,"y",gd,Bb),t.registerComponentView(Nb),t.registerComponentView(wL),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var zb="\0_ec_interaction_mutex";function Fb(t,e){return!!TL(t)[e]}function TL(t){return t[zb]||(t[zb]={})}ya({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},Ct);var CL=(function(t){Z(e,t);function e(r){var n=t.call(this)||this;n._zr=r;var a=Le(n._mousedownHandler,n),i=Le(n._mousemoveHandler,n),o=Le(n._mouseupHandler,n),s=Le(n._mousewheelHandler,n),l=Le(n._pinchHandler,n);return n.enable=function(c,u){this.disable(),this._opt=Ne(Te(u)||{},{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),c==null&&(c=!0),(c===!0||c==="move"||c==="pan")&&(r.on("mousedown",a),r.on("mousemove",i),r.on("mouseup",o)),(c===!0||c==="scale"||c==="zoom")&&(r.on("mousewheel",s),r.on("pinch",l))},n.disable=function(){r.off("mousedown",a),r.off("mousemove",i),r.off("mouseup",o),r.off("mousewheel",s),r.off("pinch",l)},n}return e.prototype.isDragging=function(){return this._dragging},e.prototype.isPinching=function(){return this._pinching},e.prototype.setPointerChecker=function(r){this.pointerChecker=r},e.prototype.dispose=function(){this.disable()},e.prototype._mousedownHandler=function(r){if(!b0(r)){for(var n=r.target;n;){if(n.draggable)return;n=n.__hostTarget||n.parent}var a=r.offsetX,i=r.offsetY;this.pointerChecker&&this.pointerChecker(r,a,i)&&(this._x=a,this._y=i,this._dragging=!0)}},e.prototype._mousemoveHandler=function(r){if(!(!this._dragging||!Tc("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||Fb(this._zr,"globalPan"))){var n=r.offsetX,a=r.offsetY,i=this._x,o=this._y,s=n-i,l=a-o;this._x=n,this._y=a,this._opt.preventDefaultMouseMove&&ec(r.event),Hb(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:i,oldY:o,newX:n,newY:a,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){b0(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var n=Tc("zoomOnMouseWheel",r,this._opt),a=Tc("moveOnMouseWheel",r,this._opt),i=r.wheelDelta,o=Math.abs(i),s=r.offsetX,l=r.offsetY;if(!(i===0||!n&&!a)){if(n){var c=o>3?1.4:o>1?1.2:1.1,u=i>0?c:1/c;Rd(this,"zoom","zoomOnMouseWheel",r,{scale:u,originX:s,originY:l,isAvailableBehavior:null})}if(a){var f=Math.abs(i),h=(i>0?1:-1)*(f>3?.4:f>1?.15:.05);Rd(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:h,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!Fb(this._zr,"globalPan")){var n=r.pinchScale>1?1.1:1/1.1;Rd(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e})(ur);function Rd(t,e,r,n,a){t.pointerChecker&&t.pointerChecker(n,a.originX,a.originY)&&(ec(n.event),Hb(t,e,r,n,a))}function Hb(t,e,r,n,a){a.isAvailableBehavior=Le(Tc,null,r,n),t.trigger(e,a)}function Tc(t,e,r){var n=r[t];return!t||n&&(!ne(n)||e.event[n+"Key"])}function Ed(t,e,r,n,a,i){t=t||0;var o=r[1]-r[0];if(a!=null&&(a=xi(a,[0,o])),i!=null&&(i=Math.max(i,a??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=xi(s,[0,o]),a=i=xi(s,[a,i]),n=0}e[0]=xi(e[0],r),e[1]=xi(e[1],r);var l=Od(e,n);e[n]+=t;var c=a||0,u=r.slice();l.sign<0?u[0]+=c:u[1]-=c,e[n]=xi(e[n],u);var f;return f=Od(e,n),a!=null&&(f.sign!==l.sign||f.span<a)&&(e[1-n]=e[n]+l.sign*a),f=Od(e,n),i!=null&&f.span>i&&(e[1-n]=e[n]+f.sign*i),e}function Od(t,e){var r=t[e]-t[1-e];return{span:Math.abs(r),sign:r>0?-1:r<0?1:e?-1:1}}function xi(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var xa=it(),Vb=Te,Nd=Le,ML=(function(){function t(){this._dragging=!1,this.animationThreshold=15}return t.prototype.render=function(e,r,n,a){var i=r.get("value"),o=r.get("status");if(this._axisModel=e,this._axisPointerModel=r,this._api=n,!(!a&&this._lastValue===i&&this._lastStatus===o)){this._lastValue=i,this._lastStatus=o;var s=this._group,l=this._handle;if(!o||o==="hide"){s&&s.hide(),l&&l.hide();return}s&&s.show(),l&&l.show();var c={};this.makeElOption(c,i,e,r,n);var u=c.graphicKey;u!==this._lastGraphicKey&&this.clear(n),this._lastGraphicKey=u;var f=this._moveAnimation=this.determineAnimation(e,r);if(!s)s=this._group=new mt,this.createPointerEl(s,c,e,r),this.createLabelEl(s,c,e,r),n.getZr().add(s);else{var h=at(Gb,r,f);this.updatePointerEl(s,c,h),this.updateLabelEl(s,c,h,r)}Ub(s,r,!0),this._renderHandle(i)}},t.prototype.remove=function(e){this.clear(e)},t.prototype.dispose=function(e){this.clear(e)},t.prototype.determineAnimation=function(e,r){var n=r.get("animation"),a=e.axis,i=a.type==="category",o=r.get("snap");if(!o&&!i)return!1;if(n==="auto"||n==null){var s=this.animationThreshold;if(i&&a.getBandWidth()>s)return!0;if(o){var l=Id(e).seriesDataCount,c=a.getExtent();return Math.abs(c[0]-c[1])/l>s}return!1}return n===!0},t.prototype.makeElOption=function(e,r,n,a,i){},t.prototype.createPointerEl=function(e,r,n,a){var i=r.pointer;if(i){var o=xa(e).pointerEl=new YT[i.type](Vb(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,a){if(r.label){var i=xa(e).labelEl=new Pt(Vb(r.label));e.add(i),Wb(i,a)}},t.prototype.updatePointerEl=function(e,r,n){var a=xa(e).pointerEl;a&&r.pointer&&(a.setStyle(r.pointer.style),n(a,{shape:r.pointer.shape}))},t.prototype.updateLabelEl=function(e,r,n,a){var i=xa(e).labelEl;i&&(i.setStyle(r.label.style),n(i,{x:r.label.x,y:r.label.y}),Wb(i,a))},t.prototype._renderHandle=function(e){if(!(this._dragging||!this.updateHandleTransform)){var r=this._axisPointerModel,n=this._api.getZr(),a=this._handle,i=r.getModel("handle"),o=r.get("status");if(!i.get("show")||!o||o==="hide"){a&&n.remove(a),this._handle=null;return}var s;this._handle||(s=!0,a=this._handle=Bf(i.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(c){ec(c.event)},onmousedown:Nd(this._onHandleDragMove,this,0,0),drift:Nd(this._onHandleDragMove,this),ondragend:Nd(this._onHandleDragEnd,this)}),n.add(a)),Ub(a,r,!1),a.setStyle(i.getItemStyle(null,["color","borderColor","borderWidth","opacity","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"]));var l=i.get("size");ee(l)||(l=[l,l]),a.scaleX=l[0]/2,a.scaleY=l[1]/2,Dh(this,"_doDispatchAxisPointer",i.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Gb(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Bd(this.getHandleTransform(e,this._axisModel,this._axisPointerModel)))},t.prototype._onHandleDragMove=function(e,r){var n=this._handle;if(n){this._dragging=!0;var a=this.updateHandleTransform(Bd(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=a,n.stopAnimation(),n.attr(Bd(a)),xa(n).lastProp=null,this._doDispatchAxisPointer()}},t.prototype._doDispatchAxisPointer=function(){var e=this._handle;if(e){var r=this._payloadInfo,n=this._axisModel;this._api.dispatchAction({type:"updateAxisPointer",x:r.cursorPoint[0],y:r.cursorPoint[1],tooltipOption:r.tooltipOption,axesInfo:[{axisDim:n.axis.dim,axisIndex:n.componentIndex}]})}},t.prototype._onHandleDragEnd=function(){this._dragging=!1;var e=this._handle;if(e){var r=this._axisPointerModel.get("value");this._moveHandleToValue(r),this._api.dispatchAction({type:"hideTip"})}},t.prototype.clear=function(e){this._lastValue=null,this._lastStatus=null;var r=e.getZr(),n=this._group,a=this._handle;r&&n&&(this._lastGraphicKey=null,n&&r.remove(n),a&&r.remove(a),this._group=null,this._handle=null,this._payloadInfo=null),Ih(this,"_doDispatchAxisPointer")},t.prototype.doClear=function(){},t.prototype.buildLabel=function(e,r,n){return n=n||0,{x:e[n],y:e[1-n],width:r[n],height:r[1-n]}},t})();function Gb(t,e,r,n){$b(xa(r).lastProp,n)||(xa(r).lastProp=n,e?Ut(r,n,t):(r.stopAnimation(),r.attr(n)))}function $b(t,e){if(ce(t)&&ce(e)){var r=!0;return D(e,function(n,a){r=r&&$b(t[a],n)}),!!r}else return t===e}function Wb(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Bd(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function Ub(t,e,r){var n=e.get("z"),a=e.get("zlevel");t&&t.traverse(function(i){i.type!=="group"&&(n!=null&&(i.z=n),a!=null&&(i.zlevel=a),i.silent=r)})}function AL(t){var e=t.get("type"),r=t.getModel(e+"Style"),n;return e==="line"?(n=r.getLineStyle(),n.fill=null):e==="shadow"&&(n=r.getAreaStyle(),n.stroke=null),n}function DL(t,e,r,n,a){var i=r.get("value"),o=Yb(i,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=$l(s.get("padding")||0),c=s.getFont(),u=Tu(o,c),f=a.position,h=u.width+l[1]+l[3],d=u.height+l[0]+l[2],p=a.align;p==="right"&&(f[0]-=h),p==="center"&&(f[0]-=h/2);var m=a.verticalAlign;m==="bottom"&&(f[1]-=d),m==="middle"&&(f[1]-=d/2),IL(f,h,d,n);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),t.label={x:f[0],y:f[1],style:ri(s,{text:o,font:c,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function IL(t,e,r,n){var a=n.getWidth(),i=n.getHeight();t[0]=Math.min(t[0]+e,a)-e,t[1]=Math.min(t[1]+r,i)-r,t[0]=Math.max(t[0],0),t[1]=Math.max(t[1],0)}function Yb(t,e,r,n,a){t=e.scale.parse(t);var i=e.scale.getLabel({value:t},{precision:a.precision}),o=a.formatter;if(o){var s={value:Sd(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};D(n,function(l){var c=r.getSeriesByIndex(l.seriesIndex),u=l.dataIndexInside,f=c&&c.getDataParams(u);f&&s.seriesData.push(f)}),ne(o)?i=o.replace("{value}",i):ye(o)&&(i=o(s))}return i}function qb(t,e,r){var n=za();return Su(n,n,r.rotation),wu(n,n,r.position),Nf([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function LL(t,e,r,n,a,i){var o=Pn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=a.get(["label","margin"]),DL(e,n,a,i,{position:qb(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function PL(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function RL(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var EL=(function(t){Z(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.makeElOption=function(r,n,a,i,o){var s=a.axis,l=s.grid,c=i.get("type"),u=Xb(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(c&&c!=="none"){var h=AL(i),d=OL[c](s,f,u);d.style=h,r.graphicKey=d.type,r.pointer=d}var p=Cd(l.model,a);LL(n,r,p,a,i,o)},e.prototype.getHandleTransform=function(r,n,a){var i=Cd(n.axis.grid.model,n,{labelInside:!1});i.labelMargin=a.get(["handle","margin"]);var o=qb(n.axis,r,i);return{x:o[0],y:o[1],rotation:i.rotation+(i.labelDirection<0?Math.PI:0)}},e.prototype.updateHandleTransform=function(r,n,a,i){var o=a.axis,s=o.grid,l=o.getGlobalExtent(!0),c=Xb(s,o).getOtherAxis(o).getGlobalExtent(),u=o.dim==="x"?0:1,f=[r.x,r.y];f[u]+=n[u],f[u]=Math.min(l[1],f[u]),f[u]=Math.max(l[0],f[u]);var h=(c[1]+c[0])/2,d=[h,h];d[u]=f[u];var p=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:d,tooltipOption:p[u]}},e})(ML);function Xb(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var OL={line:function(t,e,r){var n=PL([e,r[0]],[e,r[1]],Zb(t));return{type:"Line",subPixelOptimize:!0,shape:n}},shadow:function(t,e,r){var n=Math.max(1,t.getBandWidth()),a=r[1]-r[0];return{type:"Rect",shape:RL([e-n/2,r[0]],[n,a],Zb(t))}}};function Zb(t){return t.dim==="x"?0:1}var NL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="axisPointer",e.defaultOption={show:"auto",z:50,type:"line",snap:!1,triggerTooltip:!0,triggerEmphasis:!0,value:null,status:null,link:[],animation:null,animationDurationUpdate:200,lineStyle:{color:"#B9BEC9",width:1,type:"dashed"},shadowStyle:{color:"rgba(210,219,238,0.2)"},label:{show:!0,formatter:null,precision:"auto",margin:3,color:"#fff",padding:[5,7,5,7],backgroundColor:"auto",borderColor:null,borderWidth:0,borderRadius:3},handle:{show:!1,icon:"M10.7,11.9v-1.3H9.3v1.3c-4.9,0.3-8.8,4.4-8.8,9.4c0,5,3.9,9.1,8.8,9.4h1.3c4.9-0.3,8.8-4.4,8.8-9.4C19.5,16.3,15.6,12.2,10.7,11.9z M13.3,24.4H6.7v-1.2h6.6z M13.3,22H6.7v-1.2h6.6z M13.3,19.6H6.7v-1.2h6.6z",size:45,margin:50,color:"#333",shadowBlur:3,shadowColor:"#aaa",shadowOffsetX:0,shadowOffsetY:2,throttle:40}},e})(We),nn=it(),BL=D;function Kb(t,e,r){if(!ge.node){var n=e.getZr();nn(n).records||(nn(n).records={}),zL(n,e);var a=nn(n).records[t]||(nn(n).records[t]={});a.handler=r}}function zL(t,e){if(nn(t).initialized)return;nn(t).initialized=!0,r("click",at(jb,"click")),r("mousemove",at(jb,"mousemove")),r("globalout",HL);function r(n,a){t.on(n,function(i){var o=VL(e);BL(nn(t).records,function(s){s&&a(s,i,o.dispatchAction)}),FL(o.pendings,e)})}}function FL(t,e){var r=t.showTip.length,n=t.hideTip.length,a;r?a=t.showTip[r-1]:n&&(a=t.hideTip[n-1]),a&&(a.dispatchAction=null,e.dispatchAction(a))}function HL(t,e,r){t.handler("leave",null,r)}function jb(t,e,r,n){e.handler(t,r,n)}function VL(t){var e={showTip:[],hideTip:[]},r=function(n){var a=e[n.type];a?a.push(n):(n.dispatchAction=r,t.dispatchAction(n))};return{dispatchAction:r,pendings:e}}function zd(t,e){if(!ge.node){var r=e.getZr(),n=(nn(r).records||{})[t];n&&(nn(r).records[t]=null)}}var GL=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a){var i=n.getComponent("tooltip"),o=r.get("triggerOn")||i&&i.get("triggerOn")||"mousemove|click";Kb("axisPointer",a,function(s,l,c){o!=="none"&&(s==="leave"||o.indexOf(s)>=0)&&c({type:"updateAxisPointer",currTrigger:s,x:l&&l.offsetX,y:l&&l.offsetY})})},e.prototype.remove=function(r,n){zd("axisPointer",n)},e.prototype.dispose=function(r,n){zd("axisPointer",n)},e.type="axisPointer",e})(gr);function Qb(t,e){var r=[],n=t.seriesIndex,a;if(n==null||!(a=e.getSeriesByIndex(n)))return{point:[]};var i=a.getData(),o=oa(i,t);if(o==null||o<0||ee(o))return{point:[]};var s=i.getItemGraphicEl(o),l=a.coordinateSystem;if(a.getTooltipPosition)r=a.getTooltipPosition(o)||[];else if(l&&l.dataToPoint)if(t.isStacked){var c=l.getBaseAxis(),u=l.getOtherAxis(c),f=u.dim,h=c.dim,d=f==="x"||f==="radius"?1:0,p=i.mapDimension(h),m=[];m[d]=i.get(p,o),m[1-d]=i.get(i.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(i.getValues(ue(l.dimensions,function(v){return i.mapDimension(v)}),o))||[];else if(s){var g=s.getBoundingRect().clone();g.applyTransform(s.transform),r=[g.x+g.width/2,g.y+g.height/2]}return{point:r,el:s}}var Jb=it();function $L(t,e,r){var n=t.currTrigger,a=[t.x,t.y],i=t,o=t.dispatchAction||Le(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){Cc(a)&&(a=Qb({seriesIndex:i.seriesIndex,dataIndex:i.dataIndex},e).point);var l=Cc(a),c=i.axesInfo,u=s.axesInfo,f=n==="leave"||Cc(a),h={},d={},p={list:[],map:{}},m={showPointer:at(UL,d),showTooltip:at(YL,p)};D(s.coordSysMap,function(v,y){var b=l||v.containPoint(a);D(s.coordSysAxesInfo[y],function(x,S){var w=x.axis,k=KL(c,x);if(!f&&b&&(!c||k)){var T=k&&k.value;T==null&&!l&&(T=w.pointToData(a)),T!=null&&ex(x,T,m,!1,h)}})});var g={};return D(u,function(v,y){var b=v.linkGroup;b&&!d[y]&&D(b.axesInfo,function(x,S){var w=d[S];if(x!==v&&w){var k=w.value;b.mapper&&(k=v.axis.scale.parse(b.mapper(k,tx(x),tx(v)))),g[v.key]=k}})}),D(g,function(v,y){ex(u[y],v,m,!0,h)}),qL(d,u,h),XL(p,a,t,o),ZL(u,o,r),h}}function ex(t,e,r,n,a){var i=t.axis;if(!(i.scale.isBlank()||!i.containData(e))){if(!t.involveSeries){r.showPointer(t,e);return}var o=WL(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&a.seriesIndex==null&&U(a,s[0]),!n&&t.snap&&i.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function WL(t,e){var r=e.axis,n=r.dim,a=t,i=[],o=Number.MAX_VALUE,s=-1;return D(e.seriesModels,function(l,c){var u=l.getData().mapDimensionsAll(n),f,h;if(l.getAxisTooltipData){var d=l.getAxisTooltipData(u,t,r);h=d.dataIndices,f=d.nestestValue}else{if(h=l.getData().indicesOfNearest(u[0],t,r.type==="category"?.5:null),!h.length)return;f=l.getData().get(u[0],h[0])}if(!(f==null||!isFinite(f))){var p=t-f,m=Math.abs(p);m<=o&&((m<o||p>=0&&s<0)&&(o=m,s=p,a=f,i.length=0),D(h,function(g){i.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:i,snapToValue:a}}function UL(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function YL(t,e,r,n){var a=r.payloadBatch,i=e.axis,o=i.model,s=e.axisPointerModel;if(!(!e.triggerTooltip||!a.length)){var l=e.coordSys.model,c=$o(l),u=t.map[c];u||(u=t.map[c]={coordSysId:l.id,coordSysIndex:l.componentIndex,coordSysType:l.type,coordSysMainType:l.mainType,dataByAxis:[]},t.list.push(u)),u.dataByAxis.push({axisDim:i.dim,axisIndex:o.componentIndex,axisType:o.type,axisId:o.id,value:n,valueLabelOpt:{precision:s.get(["label","precision"]),formatter:s.get(["label","formatter"])},seriesDataIndices:a.slice()})}}function qL(t,e,r){var n=r.axesInfo=[];D(e,function(a,i){var o=a.axisPointerModel.option,s=t[i];s?(!a.useHandle&&(o.status="show"),o.value=s.value,o.seriesDataIndices=(s.payloadBatch||[]).slice()):!a.useHandle&&(o.status="hide"),o.status==="show"&&n.push({axisDim:a.axis.dim,axisIndex:a.axis.model.componentIndex,value:o.value})})}function XL(t,e,r,n){if(Cc(e)||!t.list.length){n({type:"hideTip"});return}var a=((t.list[0].dataByAxis[0]||{}).seriesDataIndices||[])[0]||{};n({type:"showTip",escapeConnect:!0,x:e[0],y:e[1],tooltipOption:r.tooltipOption,position:r.position,dataIndexInside:a.dataIndexInside,dataIndex:a.dataIndex,seriesIndex:a.seriesIndex,dataByCoordSys:t.list})}function ZL(t,e,r){var n=r.getZr(),a="axisPointerLastHighlights",i=Jb(n)[a]||{},o=Jb(n)[a]={};D(t,function(c,u){var f=c.axisPointerModel.option;f.status==="show"&&c.triggerEmphasis&&D(f.seriesDataIndices,function(h){var d=h.seriesIndex+" | "+h.dataIndex;o[d]=h})});var s=[],l=[];D(i,function(c,u){!o[u]&&l.push(c)}),D(o,function(c,u){!i[u]&&s.push(c)}),l.length&&r.dispatchAction({type:"downplay",escapeConnect:!0,notBlur:!0,batch:l}),s.length&&r.dispatchAction({type:"highlight",escapeConnect:!0,notBlur:!0,batch:s})}function KL(t,e){for(var r=0;r<(t||[]).length;r++){var n=t[r];if(e.axis.dim===n.axisDim&&e.axis.model.componentIndex===n.axisIndex)return n}}function tx(t){var e=t.axis.model,r={},n=r.axisDim=t.axis.dim;return r.axisIndex=r[n+"AxisIndex"]=e.componentIndex,r.axisName=r[n+"AxisName"]=e.name,r.axisId=r[n+"AxisId"]=e.id,r}function Cc(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function rx(t){Eb.registerAxisPointerClass("CartesianAxisPointer",EL),t.registerComponentModel(NL),t.registerComponentView(GL),t.registerPreprocessor(function(e){if(e){(!e.axisPointer||e.axisPointer.length===0)&&(e.axisPointer={});var r=e.axisPointer.link;r&&!ee(r)&&(e.axisPointer.link=[r])}}),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,function(e,r){e.getComponent("axisPointer").coordSysAxesInfo=uL(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},$L)}function jL(t){In(kL),In(rx)}var nx=["x","y","radius","angle","single"],QL=["cartesian2d","polar","singleAxis"];function JL(t){var e=t.get("coordinateSystem");return ze(QL,e)>=0}function wa(t){return t+"Axis"}function eP(t,e){var r=de(),n=[],a=de();t.eachComponent({mainType:"dataZoom",query:e},function(u){a.get(u.uid)||s(u)});var i;do i=!1,t.eachComponent("dataZoom",o);while(i);function o(u){!a.get(u.uid)&&l(u)&&(s(u),i=!0)}function s(u){a.set(u.uid,!0),n.push(u),c(u)}function l(u){var f=!1;return u.eachTargetAxis(function(h,d){var p=r.get(h);p&&p[d]&&(f=!0)}),f}function c(u){u.eachTargetAxis(function(f,h){(r.get(f)||r.set(f,[]))[h]=!0})}return n}function tP(t){var e=t.ecModel,r={infoList:[],infoMap:de()};return t.eachTargetAxis(function(n,a){var i=e.getComponent(wa(n),a);if(i){var o=i.getCoordSysModel();if(o){var s=o.uid,l=r.infoMap.get(s);l||(l={model:o,axisModels:[]},r.infoList.push(l),r.infoMap.set(s,l)),l.axisModels.push(i)}}}),r}var Fd=(function(){function t(){this.indexList=[],this.indexMap=[]}return t.prototype.add=function(e){this.indexMap[e]||(this.indexList.push(e),this.indexMap[e]=!0)},t})(),ax=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r._autoThrottle=!0,r._noTarget=!0,r._rangePropMode=["percent","percent"],r}return e.prototype.init=function(r,n,a){var i=ix(r);this.settledOption=i,this.mergeDefaultAndTheme(r,a),this._doInit(i)},e.prototype.mergeOption=function(r){var n=ix(r);De(this.option,r,!0),De(this.settledOption,n,!0),this._doInit(n)},e.prototype._doInit=function(r){var n=this.option;this._setDefaultThrottle(r),this._updateRangeUse(r);var a=this.settledOption;D([["start","startValue"],["end","endValue"]],function(i,o){this._rangePropMode[o]==="value"&&(n[i[0]]=a[i[0]]=null)},this),this._resetTarget()},e.prototype._resetTarget=function(){var r=this.get("orient",!0),n=this._targetAxisInfoMap=de(),a=this._fillSpecifiedTargetAxis(n);a?this._orient=r||this._makeAutoOrientByTargetAxis():(this._orient=r||"horizontal",this._fillAutoTargetAxisByOrient(n,this._orient)),this._noTarget=!0,n.each(function(i){i.indexList.length&&(this._noTarget=!1)},this)},e.prototype._fillSpecifiedTargetAxis=function(r){var n=!1;return D(nx,function(a){var i=this.getReferringComponents(wa(a),Lk);if(i.specified){n=!0;var o=new Fd;D(i.models,function(s){o.add(s.componentIndex)}),r.set(a,o)}},this),n},e.prototype._fillAutoTargetAxisByOrient=function(r,n){var a=this.ecModel,i=!0;if(i){var o=n==="vertical"?"y":"x",s=a.findComponents({mainType:o+"Axis"});l(s,o)}if(i){var s=a.findComponents({mainType:"singleAxis",filter:function(u){return u.get("orient",!0)===n}});l(s,"single")}function l(c,u){var f=c[0];if(f){var h=new Fd;if(h.add(f.componentIndex),r.set(u,h),i=!1,u==="x"||u==="y"){var d=f.getReferringComponents("grid",Et).models[0];d&&D(c,function(p){f.componentIndex!==p.componentIndex&&d===p.getReferringComponents("grid",Et).models[0]&&h.add(p.componentIndex)})}}}i&&D(nx,function(c){if(i){var u=a.findComponents({mainType:wa(c),filter:function(h){return h.get("type",!0)==="category"}});if(u[0]){var f=new Fd;f.add(u[0].componentIndex),r.set(c,f),i=!1}}},this)},e.prototype._makeAutoOrientByTargetAxis=function(){var r;return this.eachTargetAxis(function(n){!r&&(r=n)},this),r==="y"?"vertical":"horizontal"},e.prototype._setDefaultThrottle=function(r){if(r.hasOwnProperty("throttle")&&(this._autoThrottle=!1),this._autoThrottle){var n=this.ecModel.option;this.option.throttle=n.animation&&n.animationDurationUpdate>0?100:20}},e.prototype._updateRangeUse=function(r){var n=this._rangePropMode,a=this.get("rangeMode");D([["start","startValue"],["end","endValue"]],function(i,o){var s=r[i[0]]!=null,l=r[i[1]]!=null;s&&!l?n[o]="percent":!s&&l?n[o]="value":a?n[o]=a[o]:s&&(n[o]="percent")})},e.prototype.noTarget=function(){return this._noTarget},e.prototype.getFirstTargetAxisModel=function(){var r;return this.eachTargetAxis(function(n,a){r==null&&(r=this.ecModel.getComponent(wa(n),a))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(a,i){D(a.indexList,function(o){r.call(n,i,o)})})},e.prototype.getAxisProxy=function(r,n){var a=this.getAxisModel(r,n);if(a)return a.__dzAxisProxy},e.prototype.getAxisModel=function(r,n){var a=this._targetAxisInfoMap.get(r);if(a&&a.indexMap[n])return this.ecModel.getComponent(wa(r),n)},e.prototype.setRawRange=function(r){var n=this.option,a=this.settledOption;D([["start","startValue"],["end","endValue"]],function(i){(r[i[0]]!=null||r[i[1]]!=null)&&(n[i[0]]=a[i[0]]=r[i[0]],n[i[1]]=a[i[1]]=r[i[1]])},this),this._updateRangeUse(r)},e.prototype.setCalculatedRange=function(r){var n=this.option;D(["start","startValue","end","endValue"],function(a){n[a]=r[a]})},e.prototype.getPercentRange=function(){var r=this.findRepresentativeAxisProxy();if(r)return r.getDataPercentWindow()},e.prototype.getValueRange=function(r,n){if(r==null&&n==null){var a=this.findRepresentativeAxisProxy();if(a)return a.getDataValueWindow()}else return this.getAxisProxy(r,n).getDataValueWindow()},e.prototype.findRepresentativeAxisProxy=function(r){if(r)return r.__dzAxisProxy;for(var n,a=this._targetAxisInfoMap.keys(),i=0;i<a.length;i++)for(var o=a[i],s=this._targetAxisInfoMap.get(o),l=0;l<s.indexList.length;l++){var c=this.getAxisProxy(o,s.indexList[l]);if(c.hostedBy(this))return c;n||(n=c)}return n},e.prototype.getRangePropMode=function(){return this._rangePropMode.slice()},e.prototype.getOrient=function(){return this._orient},e.type="dataZoom",e.dependencies=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","series","toolbox"],e.defaultOption={z:4,filterMode:"filter",start:0,end:100},e})(We);function ix(t){var e={};return D(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var rP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.render=function(r,n,a,i){this.dataZoomModel=r,this.ecModel=n,this.api=a},e.type="dataZoom",e})(gr),wi=D,ox=dk,nP=(function(){function t(e,r,n,a){this._dimName=e,this._axisIndex=r,this.ecModel=a,this._dataZoomModel=n}return t.prototype.hostedBy=function(e){return this._dataZoomModel===e},t.prototype.getDataValueWindow=function(){return this._valueWindow.slice()},t.prototype.getDataPercentWindow=function(){return this._percentWindow.slice()},t.prototype.getTargetSeriesModels=function(){var e=[];return this.ecModel.eachSeries(function(r){if(JL(r)){var n=wa(this._dimName),a=r.getReferringComponents(n,Et).models[0];a&&this._axisIndex===a.componentIndex&&e.push(r)}},this),e},t.prototype.getAxisModel=function(){return this.ecModel.getComponent(this._dimName+"Axis",this._axisIndex)},t.prototype.getMinMaxSpan=function(){return Te(this._minMaxSpan)},t.prototype.calculateDataWindow=function(e){var r=this._dataExtent,n=this.getAxisModel(),a=n.axis.scale,i=this._dataZoomModel.getRangePropMode(),o=[0,100],s=[],l=[],c;wi(["start","end"],function(h,d){var p=e[h],m=e[h+"Value"];i[d]==="percent"?(p==null&&(p=o[d]),m=a.parse(ia(p,o,r))):(c=!0,m=m==null?r[d]:a.parse(m),p=ia(m,r,o)),l[d]=m==null||isNaN(m)?r[d]:m,s[d]=p==null||isNaN(p)?o[d]:p}),ox(l),ox(s);var u=this._minMaxSpan;c?f(l,s,r,o,!1):f(s,l,o,r,!0);function f(h,d,p,m,g){var v=g?"Span":"ValueSpan";Ed(0,h,p,"all",u["min"+v],u["max"+v]);for(var y=0;y<2;y++)d[y]=ia(h[y],p,m,!0),g&&(d[y]=a.parse(d[y]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=aP(this,this._dimName,r),this._updateMinMaxSpan();var n=this.calculateDataWindow(e.settledOption);this._valueWindow=n.valueWindow,this._percentWindow=n.percentWindow,this._setAxisModel()}},t.prototype.filterData=function(e,r){if(e!==this._dataZoomModel)return;var n=this._dimName,a=this.getTargetSeriesModels(),i=e.get("filterMode"),o=this._valueWindow;if(i==="none")return;wi(a,function(l){var c=l.getData(),u=c.mapDimensionsAll(n);if(u.length){if(i==="weakFilter"){var f=c.getStore(),h=ue(u,function(d){return c.getDimensionIndex(d)},c);c.filterSelf(function(d){for(var p,m,g,v=0;v<u.length;v++){var y=f.get(h[v],d),b=!isNaN(y),x=y<o[0],S=y>o[1];if(b&&!x&&!S)return!0;b&&(g=!0),x&&(p=!0),S&&(m=!0)}return g&&p&&m})}else wi(u,function(d){if(i==="empty")l.setData(c=c.map(d,function(m){return s(m)?m:NaN}));else{var p={};p[d]=o,c.selectRange(p)}});wi(u,function(d){c.setApproximateExtent(o,d)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;wi(["min","max"],function(a){var i=r.get(a+"Span"),o=r.get(a+"ValueSpan");o!=null&&(o=this.getAxisModel().axis.scale.parse(o)),o!=null?i=ia(n[0]+o,n,[0,100],!0):i!=null&&(o=ia(i,[0,100],n,!0)-n[0]),e[a+"Span"]=i,e[a+"ValueSpan"]=o},this)},t.prototype._setAxisModel=function(){var e=this.getAxisModel(),r=this._percentWindow,n=this._valueWindow;if(r){var a=pg(n,[0,500]);a=Math.min(a,20);var i=e.axis.scale.rawExtentInfo;r[0]!==0&&i.setDeterminedMinMax("min",+n[0].toFixed(a)),r[1]!==100&&i.setDeterminedMinMax("max",+n[1].toFixed(a)),i.freeze()}},t})();function aP(t,e,r){var n=[1/0,-1/0];wi(r,function(o){GI(n,o.getData(),e)});var a=t.getAxisModel(),i=ub(a.axis.scale,a,n).calculate();return[i.min,i.max]}var iP={getTargetSeries:function(t){function e(a){t.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(o,s){var l=t.getComponent(wa(o),s);a(o,s,l,i)})})}e(function(a,i,o,s){o.__dzAxisProxy=null});var r=[];e(function(a,i,o,s){o.__dzAxisProxy||(o.__dzAxisProxy=new nP(a,i,s,t),r.push(o.__dzAxisProxy))});var n=de();return D(r,function(a){D(a.getTargetSeriesModels(),function(i){n.set(i.uid,i)})}),n},overallReset:function(t,e){t.eachComponent("dataZoom",function(r){r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).reset(r)}),r.eachTargetAxis(function(n,a){r.getAxisProxy(n,a).filterData(r,e)})}),t.eachComponent("dataZoom",function(r){var n=r.findRepresentativeAxisProxy();if(n){var a=n.getDataPercentWindow(),i=n.getDataValueWindow();r.setCalculatedRange({start:a[0],end:a[1],startValue:i[0],endValue:i[1]})}})}};function oP(t){t.registerAction("dataZoom",function(e,r){var n=eP(r,e);D(n,function(a){a.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var sx=!1;function sP(t){sx||(sx=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,iP),oP(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function lP(t,e){var r=$l(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new ft({shape:{x:t.x-r[3],y:t.y-r[0],width:t.width+r[1]+r[3],height:t.height+r[0]+r[2],r:e.get("borderRadius")},style:n,silent:!0,z2:-1}),t}var cP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="tooltip",e.dependencies=["axisPointer"],e.defaultOption={z:60,show:!0,showContent:!0,trigger:"item",triggerOn:"mousemove|click",alwaysShowContent:!1,displayMode:"single",renderMode:"auto",confine:null,showDelay:0,hideDelay:100,transitionDuration:.4,enterable:!1,backgroundColor:"#fff",shadowBlur:10,shadowColor:"rgba(0, 0, 0, .2)",shadowOffsetX:1,shadowOffsetY:2,borderRadius:4,borderWidth:1,padding:null,extraCssText:"",axisPointer:{type:"line",axis:"auto",animation:"auto",animationDurationUpdate:200,animationEasingUpdate:"exponentialOut",crossStyle:{color:"#999",width:1,type:"dashed",textStyle:{}}},textStyle:{color:"#666",fontSize:14}},e})(We);function lx(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function cx(t){if(ge.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r<n;r++)if(t[r]in e)return t[r]}}var ux=cx(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),uP=cx(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function fx(t,e){if(!t)return e;e=vy(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function fP(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?r[e]:null}var hP=fx(uP,"transition"),Hd=fx(ux,"transform"),dP="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(ge.transform3dSupported?"will-change:transform;":"");function pP(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function vP(t,e,r){if(!ne(r)||r==="inside")return"";var n=t.get("backgroundColor"),a=t.get("borderWidth");e=pa(e);var i=pP(r),o=Math.max(Math.round(a)*1.5,6),s="",l=Hd+":",c;ze(["left","right"],i)>-1?(s+="top:50%",l+="translateY(-50%) rotate("+(c=i==="left"?-225:-45)+"deg)"):(s+="left:50%",l+="translateX(-50%) rotate("+(c=i==="top"?225:45)+"deg)");var u=c*Math.PI/180,f=o+a,h=f*Math.abs(Math.cos(u))+f*Math.abs(Math.sin(u)),d=Math.round(((h-Math.SQRT2*a)/2+Math.SQRT2*a-(h-f)/2)*100)/100;s+=";"+i+":-"+d+"px";var p=e+" solid "+a+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+p,"border-right:"+p,"background-color:"+n+";"];return'<div style="'+m.join("")+'"></div>'}function gP(t,e){var r="cubic-bezier(0.23,1,0.32,1)",n=" "+t/2+"s "+r,a="opacity"+n+",visibility"+n;return e||(n=" "+t+"s "+r,a+=ge.transformSupported?","+Hd+n:",left"+n+",top"+n),hP+":"+a}function hx(t,e,r){var n=t.toFixed(0)+"px",a=e.toFixed(0)+"px";if(!ge.transformSupported)return r?"top:"+a+";left:"+n+";":[["top",a],["left",n]];var i=ge.transform3dSupported,o="translate"+(i?"3d":"")+"("+n+","+a+(i?",0":"")+")";return r?"top:0;left:0;"+Hd+":"+o+";":[["top",0],["left",0],[ux,o]]}function mP(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var a=Ce(t.get("lineHeight"),Math.round(r*3/2));r&&e.push("line-height:"+a+"px");var i=t.get("textShadowColor"),o=t.get("textShadowBlur")||0,s=t.get("textShadowOffsetX")||0,l=t.get("textShadowOffsetY")||0;return i&&o&&e.push("text-shadow:"+s+"px "+l+"px "+o+"px "+i),D(["decoration","align"],function(c){var u=t.get(c);u&&e.push("text-"+c+":"+u)}),e.join(";")}function yP(t,e,r){var n=[],a=t.get("transitionDuration"),i=t.get("backgroundColor"),o=t.get("shadowBlur"),s=t.get("shadowColor"),l=t.get("shadowOffsetX"),c=t.get("shadowOffsetY"),u=t.getModel("textStyle"),f=Ly(t,"html"),h=l+"px "+c+"px "+o+"px "+s;return n.push("box-shadow:"+h),e&&a&&n.push(gP(a,r)),i&&n.push("background-color:"+i),D(["width","color","radius"],function(d){var p="border-"+d,m=vy(p),g=t.get(m);g!=null&&n.push(p+":"+g+(d==="color"?"":"px"))}),n.push(mP(u)),f!=null&&n.push("padding:"+$l(f).join("px ")+"px"),n.join(";")+";"}function dx(t,e,r,n,a){var i=e&&e.painter;if(r){var o=i&&i.getViewportRoot();o&&X2(t,o,r,n,a)}else{t[0]=n,t[1]=a;var s=i&&i.getViewportRootOffset();s&&(t[0]+=s.offsetLeft,t[1]+=s.offsetTop)}t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var _P=(function(){function t(e,r){if(this._show=!1,this._styleCoord=[0,0,0,0],this._enterable=!0,this._alwaysShowContent=!1,this._firstShow=!0,this._longHide=!0,ge.wxa)return null;var n=document.createElement("div");n.domBelongToZr=!0,this.el=n;var a=this._zr=e.getZr(),i=r.appendTo,o=i&&(ne(i)?document.querySelector(i):Hi(i)?i:ye(i)&&i(e.getDom()));dx(this._styleCoord,a,o,e.getWidth()/2,e.getHeight()/2),(o||e.getDom()).appendChild(n),this._api=e,this._container=o;var s=this;n.onmouseenter=function(){s._enterable&&(clearTimeout(s._hideTimeout),s._show=!0),s._inContent=!0},n.onmousemove=function(l){if(l=l||window.event,!s._enterable){var c=a.handler,u=a.painter.getViewportRoot();ir(u,l,!0),c.dispatch("mousemove",l)}},n.onmouseleave=function(){s._inContent=!1,s._enterable&&s._show&&s.hideLater(s._hideDelay)}}return t.prototype.update=function(e){if(!this._container){var r=this._api.getDom(),n=fP(r,"position"),a=r.style;a.position!=="absolute"&&n!=="absolute"&&(a.position="relative")}var i=e.get("alwaysShowContent");i&&this._moveIfResized(),this._alwaysShowContent=i,this.el.className=e.get("className")||""},t.prototype.show=function(e,r){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var n=this.el,a=n.style,i=this._styleCoord;n.innerHTML?a.cssText=dP+yP(e,!this._firstShow,this._longHide)+hx(i[0],i[1],!0)+("border-color:"+pa(r)+";")+(e.get("extraCssText")||"")+(";pointer-events:"+(this._enterable?"auto":"none")):a.display="none",this._show=!0,this._firstShow=!1,this._longHide=!1},t.prototype.setContent=function(e,r,n,a,i){var o=this.el;if(e==null){o.innerHTML="";return}var s="";if(ne(i)&&n.get("trigger")==="item"&&!lx(n)&&(s=vP(n,a,i)),ne(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ee(e)||(e=[e]);for(var l=0;l<e.length;l++)Hi(e[l])&&e[l].parentNode!==o&&o.appendChild(e[l]);if(s&&o.childNodes.length){var c=document.createElement("div");c.innerHTML=s,o.appendChild(c)}}},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el;return e?[e.offsetWidth,e.offsetHeight]:[0,0]},t.prototype.moveTo=function(e,r){if(this.el){var n=this._styleCoord;if(dx(n,this._zr,this._container,e,r),n[0]!=null&&n[1]!=null){var a=this.el.style,i=hx(n[0],n[1]);D(i,function(o){a[o[0]]=o[1]})}}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){var e=this,r=this.el.style;r.visibility="hidden",r.opacity="0",ge.transform3dSupported&&(r.willChange=""),this._show=!1,this._longHideTimeout=setTimeout(function(){return e._longHide=!0},500)},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Le(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){clearTimeout(this._hideTimeout),clearTimeout(this._longHideTimeout);var e=this.el.parentNode;e&&e.removeChild(this.el),this.el=this._container=null},t})(),bP=(function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),vx(this._styleCoord,this._zr,e.getWidth()/2,e.getHeight()/2)}return t.prototype.update=function(e){var r=e.get("alwaysShowContent");r&&this._moveIfResized(),this._alwaysShowContent=r},t.prototype.show=function(){this._hideTimeout&&clearTimeout(this._hideTimeout),this.el.show(),this._show=!0},t.prototype.setContent=function(e,r,n,a,i){var o=this;ce(e)&&Rt(""),this.el&&this._zr.remove(this.el);var s=n.getModel("textStyle");this.el=new Pt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:a,textShadowColor:s.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:Ly(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),D(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(c){o.el.style[c]=n.get(c)}),D(["textShadowBlur","textShadowOffsetX","textShadowOffsetY"],function(c){o.el.style[c]=s.get(c)||0}),this._zr.add(this.el);var l=this;this.el.on("mouseover",function(){l._enterable&&(clearTimeout(l._hideTimeout),l._show=!0),l._inContent=!0}),this.el.on("mouseout",function(){l._enterable&&l._show&&l.hideLater(l._hideDelay),l._inContent=!1})},t.prototype.setEnterable=function(e){this._enterable=e},t.prototype.getSize=function(){var e=this.el,r=this.el.getBoundingRect(),n=px(e.style);return[r.width+n.left+n.right,r.height+n.top+n.bottom]},t.prototype.moveTo=function(e,r){var n=this.el;if(n){var a=this._styleCoord;vx(a,this._zr,e,r),e=a[0],r=a[1];var i=n.style,o=Rn(i.borderWidth||0),s=px(i);n.x=e+o+s.left,n.y=r+o+s.top,n.markRedraw()}},t.prototype._moveIfResized=function(){var e=this._styleCoord[2],r=this._styleCoord[3];this.moveTo(e*this._zr.getWidth(),r*this._zr.getHeight())},t.prototype.hide=function(){this.el&&this.el.hide(),this._show=!1},t.prototype.hideLater=function(e){this._show&&!(this._inContent&&this._enterable)&&!this._alwaysShowContent&&(e?(this._hideDelay=e,this._show=!1,this._hideTimeout=setTimeout(Le(this.hide,this),e)):this.hide())},t.prototype.isShow=function(){return this._show},t.prototype.dispose=function(){this._zr.remove(this.el)},t})();function Rn(t){return Math.max(0,t)}function px(t){var e=Rn(t.shadowBlur||0),r=Rn(t.shadowOffsetX||0),n=Rn(t.shadowOffsetY||0);return{left:Rn(e-r),right:Rn(e+r),top:Rn(e-n),bottom:Rn(e+n)}}function vx(t,e,r,n){t[0]=r,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var xP=new ft({shape:{x:-1,y:-1,width:2,height:2}}),wP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.init=function(r,n){if(!(ge.node||!n.getDom())){var a=r.getComponent("tooltip"),i=this._renderMode=Rk(a.get("renderMode"));this._tooltipContent=i==="richText"?new bP(n):new _P(n,{appendTo:a.get("appendToBody",!0)?"body":a.get("appendTo",!0)})}},e.prototype.render=function(r,n,a){if(!(ge.node||!a.getDom())){this.group.removeAll(),this._tooltipModel=r,this._ecModel=n,this._api=a;var i=this._tooltipContent;i.update(r),i.setEnterable(r.get("enterable")),this._initGlobalListener(),this._keepShow(),this._renderMode!=="richText"&&r.get("transitionDuration")?Dh(this,"_updatePosition",50,"fixRate"):Ih(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,n=r.get("triggerOn");Kb("itemTooltip",this._api,Le(function(a,i,o){n!=="none"&&(n.indexOf(a)>=0?this._tryShow(i,o):a==="leave"&&this._hide(o))},this))},e.prototype._keepShow=function(){var r=this._tooltipModel,n=this._ecModel,a=this._api,i=r.get("triggerOn");if(this._lastX!=null&&this._lastY!=null&&i!=="none"&&i!=="click"){var o=this;clearTimeout(this._refreshUpdateTimeout),this._refreshUpdateTimeout=setTimeout(function(){!a.isDisposed()&&o.manuallyShowTip(r,n,a,{x:o._lastX,y:o._lastY,dataByCoordSys:o._lastDataByCoordSys})})}},e.prototype.manuallyShowTip=function(r,n,a,i){if(!(i.from===this.uid||ge.node||!a.getDom())){var o=gx(i,a);this._ticket="";var s=i.dataByCoordSys,l=CP(i,n,a);if(l){var c=l.el.getBoundingRect().clone();c.applyTransform(l.el.transform),this._tryShow({offsetX:c.x+c.width/2,offsetY:c.y+c.height/2,target:l.el,position:i.position,positionDefault:"bottom"},o)}else if(i.tooltip&&i.x!=null&&i.y!=null){var u=xP;u.x=i.x,u.y=i.y,u.update(),Ve(u).tooltipConfig={name:null,option:i.tooltip},this._tryShow({offsetX:i.x,offsetY:i.y,target:u},o)}else if(s)this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,dataByCoordSys:s,tooltipOption:i.tooltipOption},o);else if(i.seriesIndex!=null){if(this._manuallyAxisShowTip(r,n,a,i))return;var f=Qb(i,n),h=f.point[0],d=f.point[1];h!=null&&d!=null&&this._tryShow({offsetX:h,offsetY:d,target:f.el,position:i.position,positionDefault:"bottom"},o)}else i.x!=null&&i.y!=null&&(a.dispatchAction({type:"updateAxisPointer",x:i.x,y:i.y}),this._tryShow({offsetX:i.x,offsetY:i.y,position:i.position,target:a.getZr().findHover(i.x,i.y).target},o))}},e.prototype.manuallyHideTip=function(r,n,a,i){var o=this._tooltipContent;this._tooltipModel&&o.hideLater(this._tooltipModel.get("hideDelay")),this._lastX=this._lastY=this._lastDataByCoordSys=null,i.from!==this.uid&&this._hide(gx(i,a))},e.prototype._manuallyAxisShowTip=function(r,n,a,i){var o=i.seriesIndex,s=i.dataIndex,l=n.getComponent("axisPointer").coordSysAxesInfo;if(!(o==null||s==null||l==null)){var c=n.getSeriesByIndex(o);if(c){var u=c.getData(),f=Wo([u.getItemModel(s),c,(c.coordinateSystem||{}).model],this._tooltipModel);if(f.get("trigger")==="axis")return a.dispatchAction({type:"updateAxisPointer",seriesIndex:o,dataIndex:s,position:i.position}),!0}}},e.prototype._tryShow=function(r,n){var a=r.target,i=this._tooltipModel;if(i){this._lastX=r.offsetX,this._lastY=r.offsetY;var o=r.dataByCoordSys;if(o&&o.length)this._showAxisTooltip(o,r);else if(a){var s=Ve(a);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,c;Oo(a,function(u){if(Ve(u).dataIndex!=null)return l=u,!0;if(Ve(u).tooltipConfig!=null)return c=u,!0},!0),l?this._showSeriesItemTooltip(r,l,n):c?this._showComponentItemTooltip(r,c,n):this._hide(n)}else this._lastDataByCoordSys=null,this._hide(n)}},e.prototype._showOrMove=function(r,n){var a=r.get("showDelay");n=Le(n,this),clearTimeout(this._showTimout),a>0?this._showTimout=setTimeout(n,a):n()},e.prototype._showAxisTooltip=function(r,n){var a=this._ecModel,i=this._tooltipModel,o=[n.offsetX,n.offsetY],s=Wo([n.tooltipOption],i),l=this._renderMode,c=[],u=Co("section",{blocks:[],noHeader:!0}),f=[],h=new gh;D(r,function(y){D(y.dataByAxis,function(b){var x=a.getComponent(b.axisDim+"Axis",b.axisIndex),S=b.value;if(!(!x||S==null)){var w=Yb(S,x.axis,a,b.seriesDataIndices,b.valueLabelOpt),k=Co("section",{header:w,noHeader:!Mr(w),sortBlocks:!0,blocks:[]});u.blocks.push(k),D(b.seriesDataIndices,function(T){var C=a.getSeriesByIndex(T.seriesIndex),A=T.dataIndexInside,M=C.getDataParams(A);if(!(M.dataIndex<0)){M.axisDim=b.axisDim,M.axisIndex=b.axisIndex,M.axisType=b.axisType,M.axisId=b.axisId,M.axisValue=Sd(x.axis,{value:S}),M.axisValueLabel=w,M.marker=h.makeTooltipMarker("item",pa(M.color),l);var I=xy(C.formatTooltip(A,!0,null)),L=I.frag;if(L){var P=Wo([C],i).get("valueFormatter");k.blocks.push(P?U({valueFormatter:P},L):L)}I.text&&f.push(I.text),c.push(M)}})}})}),u.blocks.reverse(),f.reverse();var d=n.position,p=s.get("order"),m=Dy(u,h,l,p,a.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var g=l==="richText"?`
|
|
19
19
|
|
|
20
|
-
`:"<br/>",g=f.join(v);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,c)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,c):this._showTooltipContent(s,g,c,Math.random()+"",o[0],o[1],d,null,h)})},e.prototype._showSeriesItemTooltip=function(r,n,a){var i=this._ecModel,o=Ee(n),s=o.seriesIndex,l=i.getSeriesByIndex(s),c=o.dataModel||l,u=o.dataIndex,f=o.dataType,h=c.getData(f),d=this._renderMode,p=r.positionDefault,m=Co([h.getItemModel(u),c,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),v=m.get("trigger");if(!(v!=null&&v!=="item")){var g=c.getDataParams(u,f),y=new nh;g.marker=y.makeTooltipMarker("item",ra(g.color),d);var b=uy(c.formatTooltip(u,!1,f)),x=m.get("order"),S=m.get("valueFormatter"),w=b.frag,k=w?yy(S?G({valueFormatter:S},w):w,y,d,x,i.get("useUTC"),m.get("textStyle")):b.text,T="item_"+c.name+"_"+u;this._showOrMove(m,function(){this._showTooltipContent(m,k,g,T,r.offsetX,r.offsetY,r.position,r.target,y)}),a({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,a){var i=this._renderMode==="html",o=Ee(n),s=o.tooltipConfig,l=s.option||{},c=l.encodeHTMLContent;if(oe(l)){var u=l;l={content:u,formatter:u},c=!0}c&&i&&l.content&&(l=we(l),l.content=Dt(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,p=Co(f,this._tooltipModel,d?{position:d}:null),m=p.get("content"),v=Math.random()+"",g=new nh;this._showOrMove(p,function(){var y=we(p.get("formatterParams")||{});this._showTooltipContent(p,m,y,v,r.offsetX,r.offsetY,r.position,n,g)}),a({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,a,i,o,s,l,c,u){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,p=this._getNearestPoint([o,s],a,r.get("trigger"),r.get("borderColor")),m=p.color;if(h)if(oe(h)){var v=r.ecModel.get("useUTC"),g=ne(a)?a[0]:a,y=g&&g.axisType&&g.axisType.indexOf("time")>=0;d=h,y&&(d=Al(g.axisValue,d,v)),d=oy(d,a,!0)}else if(ye(h)){var b=Ae(function(x,S){x===this._ticket&&(f.setContent(S,u,r,m,l),this._updatePosition(r,l,o,s,f,a,c))},this);this._ticket=i,d=h(a,i,b)}else d=h;f.setContent(d,u,r,m,l),f.show(r,m),this._updatePosition(r,l,o,s,f,a,c)}},e.prototype._getNearestPoint=function(r,n,a,i){if(a==="axis"||ne(n))return{color:i||(this._renderMode==="html"?"#fff":"none")};if(!ne(n))return{color:i||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,a,i,o,s,l){var c=this._api.getWidth(),u=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ye(n)&&(n=n([a,i],s,o.el,p,{viewSize:[c,u],contentSize:f.slice()})),ne(n))a=_t(n[0],c),i=_t(n[1],u);else if(ce(n)){var m=n;m.width=f[0],m.height=f[1];var v=Nl(m,{width:c,height:u});a=v.x,i=v.y,h=null,d=null}else if(oe(n)&&l){var g=lL(n,p,f,r.get("borderWidth"));a=g[0],i=g[1]}else{var g=oL(a,i,o,c,u,h?null:20,d?null:20);a=g[0],i=g[1]}if(h&&(a-=ox(h)?f[0]/2:h==="right"?f[0]:0),d&&(i-=ox(d)?f[1]/2:d==="bottom"?f[1]:0),jb(r)){var g=sL(a,i,o,c,u);a=g[0],i=g[1]}o.moveTo(a,i)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var a=this._lastDataByCoordSys,i=this._cbParamsList,o=!!a&&a.length===r.length;return o&&D(a,function(s,l){var c=s.dataByAxis||[],u=r[l]||{},f=u.dataByAxis||[];o=o&&c.length===f.length,o&&D(c,function(h,d){var p=f[d]||{},m=h.seriesDataIndices||[],v=p.seriesDataIndices||[];o=o&&h.value===p.value&&h.axisType===p.axisType&&h.axisId===p.axisId&&m.length===v.length,o&&D(m,function(g,y){var b=v[y];o=o&&g.seriesIndex===b.seriesIndex&&g.dataIndex===b.dataIndex}),i&&D(h.seriesDataIndices,function(g){var y=g.seriesIndex,b=n[y],x=i[y];b&&x&&x.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){ve.node||!n.getDom()||(mh(this,"_updatePosition"),this._tooltipContent.dispose(),Td("itemTooltip",n))},e.type="tooltip",e})(lr);function Co(t,e,r){var n=e.ecModel,a;r?(a=new Xe(r,n,n),a=new Xe(e.option,a,n)):a=e;for(var i=t.length-1;i>=0;i--){var o=t[i];o&&(o instanceof Xe&&(o=o.get("tooltip",!0)),oe(o)&&(o={formatter:o}),o&&(a=new Xe(o,a,n)))}return a}function ix(t,e){return t.dispatchAction||Ae(e.dispatchAction,e)}function oL(t,e,r,n,a,i,o){var s=r.getSize(),l=s[0],c=s[1];return i!=null&&(t+l+i+2>n?t-=l+i:t+=i),o!=null&&(e+c+o>a?e-=c+o:e+=o),[t,e]}function sL(t,e,r,n,a){var i=r.getSize(),o=i[0],s=i[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,a)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function lL(t,e,r,n){var a=r[0],i=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-a/2,l=e.y+u/2-i/2;break;case"top":s=e.x+c/2-a/2,l=e.y-i-o;break;case"bottom":s=e.x+c/2-a/2,l=e.y+u+o;break;case"left":s=e.x-a-o,l=e.y+u/2-i/2;break;case"right":s=e.x+c+o,l=e.y+u/2-i/2}return[s,l]}function ox(t){return t==="center"||t==="middle"}function cL(t,e,r){var n=Qu(t).queryOptionMap,a=n.keys()[0];if(!(!a||a==="series")){var i=Gi(e,a,n.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),o=i.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(c){var u=Ee(c).tooltipConfig;if(u&&u.name===t.name)return l=c,!0}),l)return{componentMainType:a,componentIndex:o.componentIndex,el:l}}}}function uL(t){bn(Ub),t.registerComponentModel(YP),t.registerComponentView(iL),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},mt),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},mt)}var fL=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},Ad=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},e.prototype._updateSelector=function(r){var n=r.selector,a=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),ne(n)&&D(n,function(i,o){oe(i)&&(i={type:i}),n[o]=Me(i,fL(a,i.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,a=0;a<r.length;a++){var i=r[a].get("name");if(this.isSelected(i)){this.select(i),n=!0;break}}!n&&this.select(r[0].get("name"))}},e.prototype._updateData=function(r){var n=[],a=[];r.eachRawSeries(function(l){var c=l.name;a.push(c);var u;if(l.legendVisualProvider){var f=l.legendVisualProvider,h=f.getAllNames();r.isSeriesFiltered(l)||(a=a.concat(h)),h.length?n=n.concat(h):u=!0}else u=!0;u&&Ku(l)&&n.push(l.name)}),this._availableNames=a;var i=this.get("data")||n,o=de(),s=fe(i,function(l){return(oe(l)||He(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new Xe(l,this,this.ecModel))},this);this._data=ot(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(r){var n=this.option.selected,a=this.get("selectedMode");if(a==="single"){var i=this._data;D(i,function(o){n[o.get("name")]=!1})}n[r]=!0},e.prototype.unSelect=function(r){this.get("selectedMode")!=="single"&&(this.option.selected[r]=!1)},e.prototype.toggleSelected=function(r){var n=this.option.selected;n.hasOwnProperty(r)||(n[r]=!0),this[n[r]?"unSelect":"select"](r)},e.prototype.allSelect=function(){var r=this._data,n=this.option.selected;D(r,function(a){n[a.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,n=this.option.selected;D(r,function(a){var i=a.get("name",!0);n.hasOwnProperty(i)||(n[i]=!0),n[i]=!n[i]})},e.prototype.isSelected=function(r){var n=this.option.selected;return!(n.hasOwnProperty(r)&&!n[r])&&Pe(this._availableNames,r)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e})(Ne),si=Ke,Dd=D,mc=ct,sx=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new mc),this.group.add(this._selectorGroup=new mc),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,a){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),c=r.get("selectorPosition",!0);l&&(!c||c==="auto")&&(c=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,a,l,s,c);var u=r.getBoxLayoutParams(),f={width:a.getWidth(),height:a.getHeight()},h=r.get("padding"),d=Nl(u,f,h),p=this.layoutInner(r,o,d,i,l,c),m=Nl(Ie({width:p.width,height:p.height},u),f,h);this.group.x=m.x-p.x,this.group.y=m.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=UP(p,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this.getContentGroup(),u=de(),f=n.get("selectedMode"),h=[];a.eachRawSeries(function(d){!d.get("legendHoverLink")&&h.push(d.id)}),Dd(n.getData(),function(d,p){var m=d.get("name");if(!this.newlineDisabled&&(m===""||m===`
|
|
21
|
-
`)){var
|
|
22
|
-
`||a==="")){var i=t.isSelected(a);Dn(r,a)?r[a]=r[a]&&i:r[a]=i}}),r}function vL(t){t.registerAction("legendToggleSelect","legendselectchanged",Ke(Mo,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",Ke(Mo,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",Ke(Mo,"inverseSelect")),t.registerAction("legendSelect","legendselected",Ke(Mo,"select")),t.registerAction("legendUnSelect","legendunselected",Ke(Mo,"unSelect"))}function fx(t){t.registerComponentModel(Ad),t.registerComponentView(sx),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,pL),t.registerSubTypeDefaulter("legend",function(){return"plain"}),vL(t)}var gL=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},e.prototype.init=function(r,n,a){var i=Bl(r);t.prototype.init.call(this,r,n,a),hx(this,r,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),hx(this,this.option,r)},e.type="legend.scroll",e.defaultOption=Hf(Ad.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e})(Ad);function hx(t,e,r){var n=t.getOrient(),a=[1,1];a[n.index]=0,Ka(e,r,{type:"box",ignoreSize:!!a})}var dx=ct,Ld=["width","height"],Rd=["x","y"],mL=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!0,r._currentIndex=0,r}return e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new dx),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new dx)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this;t.prototype.renderInner.call(this,r,n,a,i,o,s,l);var u=this._controllerGroup,f=n.get("pageIconSize",!0),h=ne(f)?f:[f,f];p("pagePrev",0);var d=n.getModel("pageTextStyle");u.add(new kt({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(m,v){var g=m+"DataIndex",y=kf(n.get("pageIcons",!0)[n.getOrient().name][v],{onclick:Ae(c._pageGo,c,g,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});y.name=m,u.add(y)}},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getSelectorGroup(),c=r.getOrient().index,u=Ld[c],f=Rd[c],h=Ld[1-c],d=Rd[1-c];o&&ao("horizontal",l,r.get("selectorItemGap",!0));var p=r.get("selectorButtonGap",!0),m=l.getBoundingRect(),v=[-m.x,-m.y],g=we(a);o&&(g[u]=a[u]-m[u]-p);var y=this._layoutContentAndController(r,i,g,c,u,h,d,f);if(o){if(s==="end")v[c]+=y[u]+p;else{var b=m[u]+p;v[c]-=b,y[f]-=b}y[u]+=m[u]+p,v[1-c]+=y[d]+y[h]/2-m[h]/2,y[h]=Math.max(y[h],m[h]),y[d]=Math.min(y[d],m[d]+v[1-c]),l.x=v[0],l.y=v[1],l.markRedraw()}return y},e.prototype._layoutContentAndController=function(r,n,a,i,o,s,l,c){var u=this.getContentGroup(),f=this._containerGroup,h=this._controllerGroup;ao(r.get("orient"),u,r.get("itemGap"),i?a.width:null,i?null:a.height),ao("horizontal",h,r.get("pageButtonItemGap",!0));var d=u.getBoundingRect(),p=h.getBoundingRect(),m=this._showController=d[o]>a[o],v=[-d.x,-d.y];n||(v[i]=u[c]);var g=[0,0],y=[-p.x,-p.y],b=ke(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var x=r.get("pageButtonPosition",!0);x==="end"?y[i]+=a[o]-p[o]:g[i]+=p[o]+b}y[1-i]+=d[s]/2-p[s]/2,u.setPosition(v),f.setPosition(g),h.setPosition(y);var S={x:0,y:0};if(S[o]=m?a[o]:d[o],S[s]=Math.max(d[s],p[s]),S[l]=Math.min(0,p[l]+y[1-i]),f.__rectSize=a[o],m){var w={x:0,y:0};w[o]=Math.max(a[o]-p[o]-b,0),w[s]=S[s],f.setClipPath(new at({shape:w})),f.__rectSize=w[o]}else h.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var k=this._getPageInfo(r);return k.pageIndex!=null&&Nt(u,{x:k.contentPosition[0],y:k.contentPosition[1]},m?r:null),this._updatePageInfoView(r,k),S},e.prototype._pageGo=function(r,n,a){var i=this._getPageInfo(n)[r];i!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var a=this._controllerGroup;D(["pagePrev","pageNext"],function(u){var f=u+"DataIndex",h=n[f]!=null,d=a.childOfName(u);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var i=a.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,c=n.pageCount;i&&o&&i.setStyle("text",oe(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",c==null?"":c+""):o({current:l,total:c}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),a=this.getContentGroup(),i=this._containerGroup.__rectSize,o=r.getOrient().index,s=Ld[o],l=Rd[o],c=this._findTargetItemIndex(n),u=a.children(),f=u[c],h=u.length,d=h?1:0,p={contentPosition:[a.x,a.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return p;var m=x(f);p.contentPosition[o]=-m.s;for(var v=c+1,g=m,y=m,b=null;v<=h;++v)b=x(u[v]),(!b&&y.e>g.s+i||b&&!S(b,g.s))&&(y.i>g.i?g=y:g=b,g&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=g.i),++p.pageCount)),y=b;for(var v=c-1,g=m,y=m,b=null;v>=-1;--v)b=x(u[v]),(!b||!S(y,b.s))&&g.i<y.i&&(y=g,p.pagePrevDataIndex==null&&(p.pagePrevDataIndex=g.i),++p.pageCount,++p.pageIndex),g=b;return p;function x(w){if(w){var k=w.getBoundingRect(),T=k[l]+w[l];return{s:T,e:T+k[s],i:w.__legendDataIndex}}}function S(w,k){return w.e>=k&&w.s<=k+i}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,a=this.getContentGroup(),i;return a.eachChild(function(o,s){var l=o.__legendDataIndex;i==null&&l!=null&&(i=s),l===r&&(n=s)}),n??i},e.type="legend.scroll",e})(sx);function yL(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(a){a.setScrollDataIndex(n)})})}function _L(t){bn(fx),t.registerComponentModel(gL),t.registerComponentView(mL),yL(t)}function bL(t){bn(fx),bn(_L)}var xL=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=Hf(qb.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e})(qb),Ed=je();function wL(t,e,r){Ed(t).coordSysRecordMap.each(function(n){var a=n.dataZoomInfoMap.get(e.uid);a&&(a.getRange=r)})}function SL(t,e){for(var r=Ed(t).coordSysRecordMap,n=r.keys(),a=0;a<n.length;a++){var i=n[a],o=r.get(i),s=o.dataZoomInfoMap;if(s){var l=e.uid,c=s.get(l);c&&(s.removeKey(l),s.keys().length||px(r,o))}}}function px(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function kL(t,e){var r={model:e,containsPoint:Ke(CL,e),dispatchAction:Ke(TL,t),dataZoomInfoMap:null,controller:null},n=r.controller=new cP(t.getZr());return D(["pan","zoom","scrollMove"],function(a){n.on(a,function(i){var o=[];r.dataZoomInfoMap.each(function(s){if(i.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[a],c=l&&l(s.dzReferCoordSysInfo,r.model.mainType,r.controller,i);!s.model.get("disabled",!0)&&c&&o.push({dataZoomId:s.model.id,start:c[0],end:c[1]})}}),o.length&&r.dispatchAction(o)})}),r}function TL(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function CL(t,e,r,n){return t.coordinateSystem.containPoint([r,n])}function ML(t){var e,r="type_",n={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return t.each(function(i){var o=i.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;n[r+s]>n[r+e]&&(e=s),a=a&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}function AL(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var n=Ed(r),a=n.coordSysRecordMap||(n.coordSysRecordMap=de());a.each(function(i){i.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(i){var o=zP(i);D(o.infoList,function(s){var l=s.model.uid,c=a.get(l)||a.set(l,kL(r,s.model)),u=c.dataZoomInfoMap||(c.dataZoomInfoMap=de());u.set(i.uid,{dzReferCoordSysInfo:s,model:i,getRange:null})})}),a.each(function(i){var o=i.controller,s,l=i.dataZoomInfoMap;if(l){var c=l.keys()[0];c!=null&&(s=l.get(c))}if(!s){px(a,i);return}var u=ML(l);o.enable(u.controlType,u.opt),o.setPointerChecker(i.containsPoint),gh(i,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var DL=(function(t){U(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,a){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),wL(a,r,{pan:Ae(Od.pan,this),zoom:Ae(Od.zoom,this),scrollMove:Ae(Od.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){SL(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e})(FP),Od={zoom:function(t,e,r,n){var a=this.range,i=a.slice(),o=t.axisModels[0];if(o){var s=Nd[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(i[1]-i[0])+i[0],c=Math.max(1/n.scale,0);i[0]=(i[0]-l)*c+l,i[1]=(i[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(xd(0,i,[0,100],0,u.minSpan,u.maxSpan),this.range=i,a[0]!==i[0]||a[1]!==i[1])return i}},pan:vx(function(t,e,r,n,a,i){var o=Nd[n]([i.oldX,i.oldY],[i.newX,i.newY],e,a,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:vx(function(t,e,r,n,a,i){var o=Nd[n]([0,0],[i.scrollDelta,i.scrollDelta],e,a,r);return o.signal*(t[1]-t[0])*i.scrollDelta})};function vx(t){return function(e,r,n,a){var i=this.range,o=i.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,a);if(xd(l,o,[0,100],"all"),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}}}var Nd={grid:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem.getRect();return t=t||[0,0],i.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=i.inverse?-1:1),o},polar:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),c=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=i.inverse?-1:1),o},singleAxis:function(t,e,r,n,a){var i=r.axis,o=a.model.coordinateSystem.getRect(),s={};return t=t||[0,0],i.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=i.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=i.inverse?-1:1),s}};function IL(t){$P(t),t.registerComponentModel(xL),t.registerComponentView(DL),AL(t)}var PL={label:{enabled:!0},decal:{show:!1}},gx=je(),LL={};function RL(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=we(PL);Me(n.label,t.getLocaleModel().get("aria"),!1),Me(r.option,n,!1),a(),i();function a(){var c=r.getModel("decal"),u=c.get("show");if(u){var f=de();t.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),gx(h).scope=d}}),t.eachRawSeries(function(h){if(t.isSeriesFiltered(h))return;if(ye(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var y=ly(h.ecModel,h.name,LL,t.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",x(b,y))}else{var p=h.getRawData(),m={},v=gx(h).scope;d.each(function(S){var w=d.getRawIndex(S);m[w]=S});var g=p.count();p.each(function(S){var w=m[S],k=p.getName(S)||S+"",T=ly(h.ecModel,k,v,g),M=d.getItemVisual(w,"decal");d.setItemVisual(w,"decal",x(M,T))})}function x(S,w){var k=S?G(G({},w),S):w;return k.dirty=!0,k}})}}function i(){var c=e.getZr().dom;if(c){var u=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Ie(f.option,u),!!f.get("enabled")){if(c.setAttribute("role","img"),f.get("description")){c.setAttribute("aria-label",f.get("description"));return}var h=t.getSeriesCount(),d=f.get(["data","maxCount"])||10,p=f.get(["series","maxCount"])||10,m=Math.min(h,p),v;if(!(h<1)){var g=s();if(g){var y=f.get(["general","withTitle"]);v=o(y,{title:g})}else v=f.get(["general","withoutTitle"]);var b=[],x=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);v+=o(x,{seriesCount:h}),t.eachSeries(function(T,M){if(M<m){var A=void 0,C=T.get("name"),I=C?"withName":"withoutName";A=h>1?f.get(["series","multiple",I]):f.get(["series","single",I]),A=o(A,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var P=T.getData();if(P.count()>d){var R=f.get(["data","partialData"]);A+=o(R,{displayCnt:d})}else A+=f.get(["data","allData"]);for(var E=f.get(["data","separator","middle"]),O=f.get(["data","separator","end"]),K=f.get(["data","excludeDimensionId"]),L=[],B=0;B<P.count();B++)if(B<d){var V=P.getName(B),$=K?ot(P.getValues(B),function(ue,_e){return Pe(K,_e)===-1}):P.getValues(B),X=f.get(["data",V?"withName":"withoutName"]);L.push(o(X,{name:V,value:$.join(E)}))}A+=L.join(E)+O,b.push(A)}});var S=f.getModel(["series","multiple","separator"]),w=S.get("middle"),k=S.get("end");v+=b.join(w)+k,c.setAttribute("aria-label",v)}}}}function o(c,u){if(!oe(c))return c;var f=c;return D(u,function(h,d){f=f.replace(new RegExp("\\{\\s*"+d+"\\s*\\}","g"),h)}),f}function s(){var c=t.get("title");return c&&c.length&&(c=c[0]),c&&c.text}function l(c){var u=t.getLocaleModel().get(["series","typeNames"]);return u[c]||u.chart}}function EL(t){if(!(!t||!t.aria)){var e=t.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},D(["description","general","series","data"],function(r){e[r]!=null&&(e.label[r]=e[r])})}}function OL(t){t.registerPreprocessor(EL),t.registerVisual(t.PRIORITY.VISUAL.ARIA,RL)}function mx(t,e,r){var n=ba.createCanvas(),a=e.getWidth(),i=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=a+"px",o.height=i+"px",n.setAttribute("data-zr-dom-id",t)),n.width=a*r,n.height=i*r,n}var Bd=(function(t){U(e,t);function e(r,n,a){var i=t.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var o;a=a||zs,typeof r=="string"?o=mx(r,n,a):ce(r)&&(o=r,r=o.id),i.id=r,i.dom=o;var s=o.style;return s&&(rv(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),i.painter=n,i.dpr=a,i}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=mx("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,a,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,c=new Le(0,0,0,0);function u(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Le(0,0,0,0);b.copy(y),o.push(b)}else{for(var x=!1,S=1/0,w=0,k=0;k<o.length;++k){var T=o[k];if(T.intersect(y)){var M=new Le(0,0,0,0);M.copy(T),M.union(y),o[k]=M,x=!0;break}else if(l){c.copy(y),c.union(T);var A=y.width*y.height,C=T.width*T.height,I=c.width*c.height,P=I-A-C;P<S&&(S=P,w=k)}}if(l&&(o[w].union(y),x=!0),!x){var b=new Le(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=r[f];if(h){var d=h.shouldBePainted(a,i,!0,!0),p=h.__isRendered&&(h.__dirty&Ot||!d)?h.getPrevPaintRect():null;p&&u(p);var m=d&&(h.__dirty&Ot||!h.__isRendered)?h.getPaintRect():null;m&&u(m)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=n[f],d=h&&h.shouldBePainted(a,i,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&u(p)}}var v;do{v=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var g=f+1;g<o.length;)o[f].intersect(o[g])?(v=!0,o[f].union(o[g]),o.splice(g,1)):g++;f++}}while(v);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var a=this.dpr,i=this.dom,o=i.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),i.width=r*a,i.height=n*a,s&&(s.width=r*a,s.height=n*a,a!==1&&this.ctxBack.scale(a,a))},e.prototype.clear=function(r,n,a){var i=this.dom,o=this.ctx,s=i.width,l=i.height;n=n||this.clearColor;var c=this.motionBlur&&!r,u=this.lastFrameAlpha,f=this.dpr,h=this;c&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,s/f,l/f));var d=this.domBack;function p(m,v,g,y){if(o.clearRect(m,v,g,y),n&&n!=="transparent"){var b=void 0;if(ds(n)){var x=n.global||n.__width===g&&n.__height===y;b=x&&n.__canvasGradient||zh(o,n,{x:0,y:0,width:g,height:y}),n.__canvasGradient=b,n.__width=g,n.__height=y}else cw(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=Fh(o,n,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(m,v,g,y),o.restore()}c&&(o.save(),o.globalAlpha=u,o.drawImage(d,m,v,g,y),o.restore())}!a||c?p(0,0,s,l):a.length&&D(a,function(m){p(m.x*f,m.y*f,m.width*f,m.height*f)})},e})(rr),yx=1e5,fa=314159,yc=.01,NL=.001;function BL(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function zL(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var FL=(function(){function t(e,r,n,a){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=G({},n||{}),this.dpr=n.devicePixelRatio||zs,this._singleCanvas=i,this.root=e;var o=e.style;o&&(rv(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(i){var u=e,f=u.width,h=u.height;n.width!=null&&(f=n.width),n.height!=null&&(h=n.height),this.dpr=n.devicePixelRatio||1,u.width=f*this.dpr,u.height=h*this.dpr,this._width=f,this._height=h;var d=new Bd(u,this,this.dpr);d.__builtin__=!0,d.initContext(),l[fa]=d,d.zlevel=fa,s.push(fa),this._domRoot=e}else{this._width=ec(e,0,n),this._height=ec(e,1,n);var c=this._domRoot=zL(this._width,this._height);e.appendChild(c)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,a=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var i=0;i<a.length;i++){var o=a[i],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=i===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var a={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(yx)),i||(i=n.ctx,i.save()),ia(i,s,a,o===r-1))}i&&i.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(yx)},t.prototype.paintOne=function(e,r){h0(e,r)},t.prototype._paintList=function(e,r,n,a){if(this._redrawId===a){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,r,n),o=i.finished,s=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(c){c.afterBrush&&c.afterBrush()});else{var l=this;Yl(function(){l._paintList(e,r,n,a)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(fa).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(a){a.virtual&&e.drawImage(a.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var a=this,i=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],c=this._layers[l];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var u=!0,f=!1,h=function(m){var v=i[m],g=v.ctx,y=o&&v.createRepaintRects(e,r,d._width,d._height),b=n?v.__startIndex:v.__drawIndex,x=!n&&v.incremental&&Date.now,S=x&&Date.now(),w=v.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(v.__startIndex===v.__endIndex)v.clear(!1,w,y);else if(b===v.__startIndex){var k=e[b];(!k.incremental||!k.notClear||n)&&v.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=v.__startIndex);var T,M=function(P){var R={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(T=b;T<v.__endIndex;T++){var E=e[T];if(E.__inHover&&(f=!0),a._doPaintEl(E,v,o,P,R,T===v.__endIndex-1),x){var O=Date.now()-S;if(O>15)break}}R.prevElClipPaths&&g.restore()};if(y)if(y.length===0)T=v.__endIndex;else for(var A=d.dpr,C=0;C<y.length;++C){var I=y[C];g.save(),g.beginPath(),g.rect(I.x*A,I.y*A,I.width*A,I.height*A),g.clip(),M(I),g.restore()}else g.save(),M(),g.restore();v.__drawIndex=T,v.__drawIndex<v.__endIndex&&(u=!1)},d=this,p=0;p<i.length;p++)h(p);return ve.wxa&&D(this._layers,function(m){m&&m.ctx&&m.ctx.draw&&m.ctx.draw()}),{finished:u,needsRefreshHover:f}},t.prototype._doPaintEl=function(e,r,n,a,i,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!a||l&&l.intersect(a))&&(ia(s,e,i,o),e.setPrevPaintRect(l))}else ia(s,e,i,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=fa);var n=this._layers[e];return n||(n=new Bd("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?Me(n,this._layerConfig[e],!0):this._layerConfig[e-yc]&&Me(n,this._layerConfig[e-yc],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,a=this._zlevelList,i=a.length,o=this._domRoot,s=null,l=-1;if(!n[e]&&BL(r)){if(i>0&&e>a[0]){for(l=0;l<i-1&&!(a[l]<e&&a[l+1]>e);l++);s=n[a[l]]}if(a.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var c=s.dom;c.nextSibling?o.insertBefore(r.dom,c.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a];e.call(r,this._layers[i],i)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__&&e.call(r,o,i)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__||e.call(r,o,i)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function r(f){i&&(i.__endIndex!==f&&(i.__dirty=!0),i.__endIndex=f)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var a=e[n];if(a.zlevel!==e[n-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var i=null,o=0,s,l;for(l=0;l<e.length;l++){var a=e[l],c=a.zlevel,u=void 0;s!==c&&(s=c,o=0),a.incremental?(u=this.getLayer(c+NL,this._needsManuallyCompositing),u.incremental=!0,o=1):u=this.getLayer(c+(o>0?yc:0),this._needsManuallyCompositing),u.__builtin__||ru("ZLevel "+c+" has been used by unkown layer "+u.id),u!==i&&(u.__used=!0,u.__startIndex!==l&&(u.__dirty=!0),u.__startIndex=l,u.incremental?u.__drawIndex=-1:u.__drawIndex=l,r(l),i=u),a.__dirty&Ot&&!a.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,D(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?Me(n[e],r,!0):n[e]=r;for(var a=0;a<this._zlevelList.length;a++){var i=this._zlevelList[a];if(i===e||i===e+yc){var o=this._layers[i];Me(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,a=r[e];a&&(a.dom.parentNode.removeChild(a.dom),delete r[e],n.splice(Pe(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var a=this._opts,i=this.root;if(e!=null&&(a.width=e),r!=null&&(a.height=r),e=ec(i,0,a),r=ec(i,1,a),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(fa).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[fa].dom;var r=new Bd("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var a=r.dom.width,i=r.dom.height;this.eachLayer(function(f){f.__builtin__?n.drawImage(f.dom,0,0,a,i):f.renderToCanvas&&(n.save(),f.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,c=s.length;l<c;l++){var u=s[l];ia(n,u,o,l===c-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t})();function HL(t){t.registerPainter("canvas",FL)}bn([OL,NM,HL,IL,EP,bL,dM,uL]);const ha={background:"#ffffff",border:"#dce4e9",muted:"#5b7186",surface:"#ffffff",text:"#0f1e2a",colors:["#2f7f55","#2563eb","#d97706","#7c3aed"]},_x="cf-widget-category-zoom",bx=.68,li=t=>({startIndex:0,endIndex:Math.max(0,t-1)}),Ao=(t,e)=>{if(e<=0)return li(0);let r=e-1,n=Math.max(0,Math.min(r,Math.floor(Math.min(t.startIndex,t.endIndex))));return{startIndex:n,endIndex:Math.max(n,Math.min(r,Math.floor(Math.max(t.startIndex,t.endIndex))))}},xx=(t,e,r)=>{let n=Ao(t,r);if(r<=2)return li(r);let a=n.endIndex-n.startIndex+1,i=e==="in"?Math.max(2,Math.floor(a*bx)):Math.min(r,Math.ceil(a/bx));if(i===a)return n;let o=(n.startIndex+n.endIndex)/2,s=r-i,l=Math.max(0,Math.min(s,Math.round(o-(i-1)/2)));return{startIndex:l,endIndex:l+i-1}},VL=(t,e)=>{let r=t.length;if(r===0)return"No chart points";let n=Ao(e,r);if(n.startIndex===0&&n.endIndex===r-1)return`All ${r} ${r===1?"point":"points"}`;let a=n.endIndex-n.startIndex+1;return`${t[n.startIndex]} – ${t[n.endIndex]} · ${a} of ${r} points`},GL=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},WL=t=>{let e=new Set,r=[];return t.forEach(n=>{let a=n?.trim();!a||e.has(a)||(e.add(a),r.push(a))}),r},zd=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}return null},_c=t=>{if(t===null)return"null:";if(t===void 0)return"undefined:";if(typeof t=="object")try{return`object:${JSON.stringify(t)}`}catch{return"object:"}return`${typeof t}:${String(t)}`},bc=(t,e)=>e?t.columnMetadata?.find(r=>r.key===e):void 0,Fd=(t,e)=>bc(t,e)?.label?.trim()||GL(e),Sx=(t,e,r)=>{if(r==null||r==="")return"Not set";let n=bc(t,e);if(n?.dataType==="boolean"){let a=String(r).trim().toLowerCase();return r===!1||r===0||["0","false","no"].includes(a)?"No":"Yes"}if(n?.dataType==="date"||n?.dataType==="datetime"){let a=new Date(r);if(!Number.isNaN(a.getTime()))try{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:t.timezone||"UTC"}).format(a)}catch{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:"UTC"}).format(a)}}return String(r)},Do=(t,e,r,n=!1)=>{if(e?.dataType==="currency"){let a=e.currencyCode||r?.currency?.code;if(a)return new Intl.NumberFormat(void 0,{style:"currency",currency:a,notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)}return e?.dataType==="percent"?new Intl.NumberFormat(void 0,{style:"percent",maximumFractionDigits:2}).format(Math.abs(t)>1?t/100:t):new Intl.NumberFormat(void 0,{notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)},$L=(t,e)=>{if(t.presentation==="table"||t.presentation==="kpi")return null;if(e)return e;let r=t.chartRecommendation?.type;return r==="line"||r==="bar"||r==="stacked_bar"?r:t.type==="line"||t.type==="bar"||t.type==="stacked_bar"?t.type:null},UL=t=>t.chartRecommendation?.categoryField?.trim()||t.label?.trim()||t.columnMetadata?.find(e=>["date","dimension","geography","boolean"].includes(e.semanticRole))?.key||t.columns?.[0],YL=t=>t.chartRecommendation?.seriesField?.trim()||t.seriesField?.trim()||t.series?.trim()||void 0,qL=(t,e,r)=>{let n=WL([...t.chartRecommendation?.valueFields??[],...t.valueFields??[],t.value,...t.columnMetadata?.filter(i=>i.semanticRole==="measure").map(i=>i.key)??[]]),a=new Set([...t.columns??[],...t.columnMetadata?.map(i=>i.key)??[],...Object.keys(t.rows?.[0]??{})]);return n.filter(i=>i!==e&&i!==r&&a.has(i)).filter(i=>t.rows?.some(o=>zd(o[i])!==null))},XL=(t,e,r,n,a)=>{let i=a?` Showing 4 of ${n.length+a} series.`:"";if(e==="line"){let s=r.length-1,l=n.map(c=>{let u=c.values[s];return u==null?null:`${c.name}: ${Do(u,c.valueColumn,t)}`}).filter(c=>!!c);return l.length?`Latest (${r[s]}): ${l.join("; ")}.${i}`:`No numeric trend values are available.${i}`}let o;return n.forEach(s=>{s.values.forEach((l,c)=>{l===null||o&&l<=o.value||(o={category:r[c]??"Not set",series:s,value:l})})}),o?`Highest: ${o.category}, ${o.series.name} ${Do(o.value,o.series.valueColumn,t)}.${i}`:`No numeric comparison values are available.${i}`},Hd=(t,e)=>{let r=$L(t,e),n=UL(t),a=t.rows??[];if(!r||!n||a.length===0)return null;let i=YL(t),o=qL(t,n,i);if(o.length===0)return null;let s=o.length===1?i:void 0,l=[],c=new Set;a.forEach(m=>{let v=_c(m[n]);c.has(v)||(c.add(v),l.push({key:v,label:Sx(t,n,m[n])}))});let u=l.map(m=>m.label),f=0,h;if(s){let m=[],v=new Set;a.forEach(b=>{let x=_c(b[s]);v.has(x)||(v.add(x),m.push({key:x,label:Sx(t,s,b[s])}))});let g=m.slice(0,4);f=Math.max(0,m.length-g.length);let y=o[0];h=g.map(b=>{let x=new Map;return a.forEach(S=>{if(_c(S[s])!==b.key)return;let w=_c(S[n]);x.has(w)||x.set(w,zd(S[y]))}),{field:y,name:b.label,values:l.map(S=>x.get(S.key)??null),valueColumn:bc(t,y)}})}else f=Math.max(0,o.length-4),h=o.slice(0,4).map(m=>({field:m,name:Fd(t,m),values:a.map(v=>zd(v[m])),valueColumn:bc(t,m)}));if(h.length===0)return null;let d=Fd(t,n),p="Values";return s?p=Fd(t,o[0]):h.length===1&&(p=h[0].name),{type:r,title:t.title?.trim()||`${p} by ${d}`,xAxisTitle:d,yAxisTitle:p,categories:u,series:h,omittedSeriesCount:f,summary:XL(t,r,u,h,f)}},ZL=t=>{if(t.presentation==="table"||t.presentation==="kpi")return[];let e=Hd(t);if(!e)return[];let r=[{type:"line",label:"Line"},{type:"bar",label:"Bar"}];return e.series.length>1&&r.push({type:"stacked_bar",label:"Stacked bar"}),r},KL=(t,{expanded:e=!1,reducedMotion:r=!1,theme:n=ha,zoomWindow:a=li(t.categories.length)}={})=>{let i=t.series.length>1,o=t.type==="stacked_bar",s=t.categories.length>2,l=Ao(a,t.categories.length);return{animation:!r,animationDuration:r?0:260,aria:{enabled:!0,decal:{show:!0},label:{description:`${t.title}. ${t.summary}`}},backgroundColor:"transparent",color:n.colors,textStyle:{color:n.text,fontFamily:"inherit"},grid:{top:i?e?48:42:14,right:12,bottom:e?18:10,left:10,containLabel:!0},legend:{show:i,type:"scroll",top:0,left:"center",itemWidth:12,itemHeight:8,textStyle:{color:n.muted,fontSize:e?11:10}},tooltip:{trigger:"axis",triggerOn:"mousemove|click",confine:!0,backgroundColor:n.surface,borderColor:n.border,borderWidth:1,textStyle:{color:n.text,fontSize:12},axisPointer:{type:"line",lineStyle:{color:n.muted,opacity:.5}}},dataZoom:s?[{id:_x,type:"inside",xAxisIndex:0,startValue:l.startIndex,endValue:l.endIndex,minValueSpan:1,filterMode:"filter",disabled:!0}]:void 0,xAxis:{type:"category",data:t.categories,name:t.xAxisTitle,nameLocation:"middle",nameGap:e?38:32,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLine:{lineStyle:{color:n.border}},axisTick:{show:!1},axisLabel:{color:n.muted,fontSize:e?11:9,hideOverlap:!0,interval:"auto",rotate:!e&&t.categories.length>5?28:0,formatter:c=>c.length>(e?18:11)?`${c.slice(0,e?16:9)}…`:c}},yAxis:{type:"value",name:t.yAxisTitle,nameLocation:"middle",nameGap:e?52:44,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLabel:{color:n.muted,fontSize:e?11:9,formatter:c=>Do(c,t.series[0]?.valueColumn,void 0,!0)},axisLine:{show:!1},axisTick:{show:!1},splitNumber:4,splitLine:{lineStyle:{color:n.border,opacity:.75}}},series:t.series.map(c=>({type:t.type==="line"?"line":"bar",name:c.name,data:c.values,stack:o?"total":void 0,connectNulls:!1,showSymbol:t.type==="line"&&t.categories.length<=18,symbol:"circle",symbolSize:e?7:6,smooth:!1,maxBarWidth:e?38:28,lineStyle:t.type==="line"?{width:e?3:2.5}:void 0,itemStyle:t.type==="line"?{borderColor:n.background,borderWidth:2}:{borderRadius:o?0:[4,4,0,0]},emphasis:{focus:"series"},tooltip:{valueFormatter:u=>Do(u,c.valueColumn)}}))}},jL=t=>{let e=getComputedStyle(t),r=(a,i)=>e.getPropertyValue(a).trim()||i,n=r("--cf-accent",ha.colors[0]);return{background:r("--cf-bg",ha.background),border:r("--cf-border",ha.border),muted:r("--cf-muted",ha.muted),surface:r("--cf-surface",ha.surface),text:r("--cf-text",ha.text),colors:[n,"#2563eb","#d97706","#7c3aed"]}},QL=({model:t,expanded:e=!1})=>{let r=q(null),n=q(null),[a,i]=W(()=>({model:t,window:li(t.categories.length)})),[o,s]=W(!1),l=a.model===t?Ao(a.window,t.categories.length):li(t.categories.length),c=q(l);c.current=l;let u=v=>{let g=Ao(v,t.categories.length);c.current=g,i({model:t,window:g}),n.current?.dispatchAction({type:"dataZoom",dataZoomId:_x,startValue:g.startIndex,endValue:g.endIndex})};he(()=>{let v=r.current;if(!(!v||typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("jsdom")))try{let g=HD(v,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)});n.current=g;let y=()=>g.resize(),b=typeof ResizeObserver>"u"?null:new ResizeObserver(y);return b?.observe(v),b||window.addEventListener("resize",y,{passive:!0}),()=>{b?.disconnect(),b||window.removeEventListener("resize",y),g.dispose(),n.current=null}}catch{s(!0);return}},[]),he(()=>{let v=r.current,g=n.current;if(!v||!g)return;let y=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;g.setOption(KL(t,{expanded:e,reducedMotion:y,theme:jL(v),zoomWindow:c.current}),{lazyUpdate:!0,notMerge:!0}),g.resize()},[e,t]);let f=!o&&t.categories.length>2,h=l.endIndex-l.startIndex+1,d=l.startIndex===0&&l.endIndex===t.categories.length-1,p=f&&h>2,m=f&&!d;return _(Ce,{children:[_("div",{ref:r,class:`cf-analytics-echart${e?" is-expanded":""}`,role:"img","aria-label":`${t.title}. ${t.summary}`,"data-chart-status":o?"fallback":"ready",children:o?_("span",{class:"cf-analytics-echart__fallback",children:t.summary}):null}),f?_("div",{class:"cf-analytics-zoom",children:[_("span",{class:"cf-analytics-zoom__range","aria-live":"polite","aria-atomic":"true",children:VL(t.categories,l)}),_("div",{class:"cf-analytics-zoom__controls",role:"group","aria-label":"Chart zoom controls",children:[_("button",{type:"button","aria-label":"Zoom out chart",title:"Zoom out",disabled:!m,onClick:()=>u(xx(c.current,"out",t.categories.length)),children:"−"}),_("button",{type:"button",class:"cf-analytics-zoom__reset","aria-label":"Reset chart zoom",title:"Reset zoom",disabled:d,onClick:()=>u(li(t.categories.length)),children:"Reset"}),_("button",{type:"button","aria-label":"Zoom in chart",title:"Zoom in",disabled:!p,onClick:()=>u(xx(c.current,"in",t.categories.length)),children:"+"})]})]}):null]})},kx=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},Tx=(t,e)=>(e?.length?e:Object.keys(t[0]??{})).map(r=>typeof r=="string"?{key:r,label:kx(r)}:{...r,label:r.label?.trim()||kx(r.key)}),Cx=(t,e,r)=>{if(t==null||t==="")return"—";if((r?.dataType==="date"||r?.dataType==="datetime")&&typeof t=="string"){let n=new Date(t);if(!Number.isNaN(n.getTime()))return new Intl.DateTimeFormat(e,{dateStyle:"medium",...r.dataType==="datetime"?{timeStyle:"short"}:{}}).format(n)}return r?.dataType==="currency"&&typeof t=="number"?new Intl.NumberFormat(e,{style:"currency",currency:r.currencyCode||"USD",maximumFractionDigits:2}).format(t):typeof t=="number"&&Number.isFinite(t)?new Intl.NumberFormat(e,{maximumFractionDigits:4}).format(t):typeof t=="boolean"?t?"Yes":"No":String(t)},Mx=t=>{let e=String(t??"");return/[",\r\n]/.test(e)?`"${e.replaceAll('"','""')}"`:e},JL=(t,e)=>{let r=Tx(t,e);return[r.map(n=>Mx(n.label)).join(","),...t.map(n=>r.map(a=>Mx(n[a.key])).join(","))].join(`\r
|
|
23
|
-
`)},eR=({rows:t,columns:e,maxRows:r=100,locale:n,expanded:a=!1,classPrefix:i="cr",pageSize:o=10})=>{let s=_r(()=>Tx(t,e),[e,t]),l=s.map(L=>L.key).join("\0"),[c,u]=W(()=>s.map(L=>L.key)),[f,h]=W(""),[d,p]=W(),[m,v]=W("asc"),[g,y]=W([]),[b,x]=W("table"),[S,w]=W(1),[k,T]=W(o);he(()=>{u(s.map(L=>L.key)),p(void 0),y([]),w(1)},[l]);let M=s.filter(L=>c.includes(L.key)),A=_r(()=>{let L=f.toLocaleLowerCase(n),B=t.map((V,$)=>({row:V,index:$})).filter(({row:V})=>M.some($=>Cx(V[$.key],n,$).toLocaleLowerCase(n).includes(L)));return d?B.sort((V,$)=>{let X=V.row[d],ue=$.row[d],_e=typeof X=="number"?X:NaN,Te=typeof ue=="number"?ue:NaN,Ue=!Number.isNaN(_e)&&!Number.isNaN(Te)?_e-Te:String(X??"").localeCompare(String(ue??""),n,{numeric:!0,sensitivity:"base"});return m==="asc"?Ue:-Ue}):B},[M,n,f,t,m,d]),C=A.slice(0,Math.max(1,r)),I=Math.max(1,Math.ceil(C.length/k)),P=Math.min(S,I),R=a?C:C.slice((P-1)*k,P*k),E=R.length>0&&R.every(({index:L})=>g.includes(L)),O=L=>`${i}-${L}`;if(t.length===0||s.length===0)return _("div",{class:O("table-note"),children:"No rows returned."});let K=L=>{let B=new Set(R.map(({index:V})=>V));y(V=>L?[...new Set([...V,...B])]:V.filter($=>!B.has($)))};return _("section",{class:O("data-table"),children:[_("div",{class:O("table-fields"),children:[_("strong",{children:"Fields"}),_("div",{class:O("field-list"),children:s.map(L=>_("span",{class:O("field-chip"),children:L.label},L.key))}),_("span",{class:O("table-field-count"),children:[t.length.toLocaleString(n)," rows"]})]}),_("div",{class:O("table-controls"),children:[_("label",{class:O("table-search"),children:[_("span",{"aria-hidden":"true",children:"⌕"}),_("input",{type:"search",value:f,placeholder:"Search this result...","aria-label":"Search this result",onInput:L=>{h(L.currentTarget.value.trim()),w(1)}})]}),_("div",{class:O("table-modes"),role:"group","aria-label":"Table display mode",children:["table","matrix"].map(L=>_("button",{type:"button",class:`${O("segment")}${b===L?" is-active":""}`,"aria-pressed":b===L,onClick:()=>x(L),children:L==="table"?"Table":"Matrix"},L))})]}),_("div",{class:O("table-column-bar"),children:_("details",{class:O("column-picker"),children:[_("summary",{children:"Columns"}),_("div",{class:O("column-menu"),children:s.map(L=>_("label",{children:[_("input",{type:"checkbox",checked:c.includes(L.key),onChange:B=>{let V=B.currentTarget.checked;u($=>V?[...new Set([...$,L.key])]:$.length>1?$.filter(X=>X!==L.key):$)}}),_("span",{children:L.label})]},L.key))})]})}),_("div",{class:O("table-wrap"),role:"region","aria-label":"Scrollable result table",tabIndex:0,children:_("table",{class:`${O("table")}${b==="matrix"?" is-matrix":""}`,children:[_("caption",{class:O("visually-hidden"),children:["Result table with ",A.length," ",A.length===1?"row":"rows"]}),_("thead",{children:_("tr",{children:[_("th",{class:O("select-cell"),children:_("input",{type:"checkbox","aria-label":"Select all visible rows",checked:E,onChange:L=>K(L.currentTarget.checked)})}),M.map(L=>_("th",{scope:"col",children:_("button",{type:"button",class:O("table-sort"),"aria-label":`Sort by ${L.label}`,onClick:()=>{d===L.key?v(B=>B==="asc"?"desc":"asc"):(p(L.key),v("asc")),w(1)},children:[_("span",{children:L.label}),_("span",{class:O("sort-direction"),"aria-hidden":"true",children:d===L.key?m==="asc"?"↑":"↓":"↕"})]})},L.key))]})}),_("tbody",{children:R.map(({row:L,index:B})=>_("tr",{class:g.includes(B)?"is-selected":void 0,children:[_("td",{class:O("select-cell"),children:_("input",{type:"checkbox","aria-label":`Select row ${B+1}`,checked:g.includes(B),onChange:V=>y($=>V.currentTarget.checked?[...new Set([...$,B])]:$.filter(X=>X!==B))})}),M.map(V=>_("td",{children:Cx(L[V.key],n,V)},V.key))]},B))})]})}),_("div",{class:O("table-summary"),children:[_("span",{children:C.length?`${((P-1)*k+1).toLocaleString(n)}-${Math.min(P*k,C.length).toLocaleString(n)} of ${A.length.toLocaleString(n)}`:`0 of ${A.length.toLocaleString(n)}`}),a?_("span",{children:t.length>r?`First ${r.toLocaleString(n)} rows available`:"All returned rows loaded"}):_("div",{class:O("table-pagination"),"aria-label":"Table pagination",children:[_("label",{children:[_("span",{children:"Rows"}),_("select",{"aria-label":"Rows per page",value:k,onChange:L=>{T(Number(L.currentTarget.value)),w(1)},children:[10,25,50].map(L=>_("option",{value:L,children:L},L))})]}),_("button",{type:"button","aria-label":"Previous page",disabled:P<=1,onClick:()=>w(L=>Math.max(1,L-1)),children:"‹"}),_("span",{children:[P," / ",I]}),_("button",{type:"button","aria-label":"Next page",disabled:P>=I,onClick:()=>w(L=>Math.min(I,L+1)),children:"›"})]})]})]})},tR=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/ogg"],Vd=t=>{const e=globalThis.MediaRecorder;if(typeof e?.isTypeSupported=="function"){for(const r of tR)if(e.isTypeSupported(r))try{return new e(t,{mimeType:r})}catch{}}return new e(t)},Rr=t=>{if(!(!t||t.state!=="recording")){try{t.requestData()}catch{}t.stop()}},rR=[{name:"Smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😋","😛","😜","🤪","🤗","🤭","🤔","🤐","😐","😶","😏","🙄","😴","🥳","😎","🤓","🥺","😢","😭","😤","😠","🤯","😬","😱","🤩","🥱"]},{name:"Gestures",emojis:["👍","👎","👌","🤌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","✋","🖐️","👋","🤝","🙏","💪","👏","🙌","👐","🤲","🫶"]},{name:"Hearts & symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","💔","❣️","💕","💖","💘","💝","✨","⭐","🌟","💫","🔥","🎉","🎊","✅","❌","⚡","💯","🚀"]},{name:"Animals & nature",emojis:["🐶","🐱","🦊","🐻","🐼","🐨","🦁","🐮","🐸","🐵","🐧","🦄","🐝","🦋","🐢","🐬","🌷","🌸","🌹","🌻","🌳","🍀"]},{name:"Food & drink",emojis:["🍎","🍌","🍉","🍓","🍒","🥑","🍔","🍟","🍕","🌮","🍿","🍩","🍪","🎂","☕","🍵","🍺","🥂","🍷"]},{name:"Objects & travel",emojis:["🚀","✈️","🚗","🏠","📦","📱","💻","⌚","📷","💡","🔑","🎁","📌","✏️","📝","📞","📧","💰","📈","⏰","🔔","🎯","🏆","🎮","🎵","💬","👀"]}],Io={inquiry:{title:"Leave a message",submit:"Send message",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"How can we help?"}]},contact:{title:"Share your details",submit:"Save",fields:[{key:"name",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"email",label:"Email",kind:"email",required:!0,identity:"email"},{key:"phone",label:"Phone",kind:"tel",required:!0,identity:"phone"}]},"book-demo":{title:"Book a demo",submit:"Request demo",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"preferredAt",label:"Preferred time",kind:"text",placeholder:"e.g. Thursday 3pm"},{key:"notes",label:"Notes",kind:"textarea",placeholder:"Anything we should know?"}]},"request-callback":{title:"Request a callback",submit:"Request callback",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorPhone",label:"Phone",kind:"tel",required:!0,identity:"phone"},{key:"bestTime",label:"Best time to call",kind:"text",placeholder:"e.g. tomorrow afternoon"},{key:"topic",label:"Topic",kind:"text",placeholder:"What should we call about?"}]},"subscribe-newsletter":{title:"Subscribe",submit:"Subscribe",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"}]}},Gd={openChat:"Open chat",closeChat:"Close chat",muteSounds:"Mute sounds",unmuteSounds:"Unmute sounds",statusOnline:"Online · replies instantly",statusOffline:"Away · leave a message",composerPlaceholder:"Type your message…",send:"Send message",emoji:"Emoji",gifs:"GIFs",attachFile:"Attach a file",recordVoice:"Record a voice message",stopRecording:"Stop recording",stop:"Stop",copy:"Copy",copied:"Copied",retry:"Retry",clearChat:"Clear conversation",clearChatConfirm:"Clear this conversation?",clearChatConfirmBody:"This clears the messages on this device and starts a fresh chat.",clearConfirmCta:"Clear chat",endChat:"End conversation",endChatConfirm:"End this conversation?",endChatConfirmBody:"You won't be able to send more messages in this chat, but you can start a new one anytime.",endConfirmCta:"End conversation",conversationEnded:"This conversation has ended.",startNewChat:"Start a new conversation",pastConversations:"Past conversations",viewingPast:"Viewing a past conversation (read-only)",backToChat:"Back to current chat",historyEnded:"ended",feedbackHelpful:"Helpful",feedbackNotHelpful:"Not helpful",feedbackThanks:"Thanks for the feedback",csatPrompt:"How was this chat?",feedbackCommentPlaceholder:"What went wrong? (optional)",feedbackSend:"Send",cancel:"Cancel",newMessages:"New messages",poweredBy:"Powered by",searchGifs:"Search GIFs…",searchingGifs:"Searching…",noGifs:"No GIFs found",assistantTyping:"Assistant is typing",emptyReply:"Sorry, I couldn't generate a reply.",errorGeneric:"Something went wrong reaching the assistant. Please try again.",errorRateLimit:"You’re sending messages a little fast — give it a second and try again.",attaching:"Reading file…",attachTooLarge:"That file is too large (max 8 MB).",attachFailed:"Couldn’t read that file — try another.",handoffTitle:"Want our team to follow up?",handoffName:"Name (optional)",handoffEmail:"Your email",handoffNotify:"Notify the team",sending:"Sending…",handoffShared:"I’ve shared this with our team — they’ll get back to you at {email}.",formThanks:"Thanks! We’ll be in touch.",formError:"Something went wrong — please try again.",bookingPickTime:"What time works best?",bookingDuration:"30-minute demo",bookingRequested:"Requested for {when} — we’ll confirm by email.",bookingConfirmed:"You’re booked for {when}! A calendar invite is on its way. 📅",bookingSlotTaken:"That time was just taken — please pick another.",bookingViaProvider:"Pick a time that works for you on {provider}.",bookingOpenScheduler:"Open the scheduler",bookingLinkOpened:"Opening the scheduler — pick a time that suits you. 📅",bookingMeetingLink:"Meeting link",previewReply:"👋 This is a preview — replies here are samples. Publish the widget on your site to chat with the live AI.",previewActionNote:"Preview — nothing was actually sent. This works for real once you publish.",previewBanner:"Preview — sample replies, no AI"},xc=(t,e)=>t.replace(/\{(\w+)\}/g,(r,n)=>e[n]??""),nR=t=>t?{...Gd,...t}:Gd,Ax=E1(Gd),aR=Ax.Provider,jr=()=>X1(Ax),ze=(t,e)=>_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",...e,children:t}),iR=t=>_("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"})}),Po=t=>ze(_("path",{d:"m6 9 6 6 6-6"}),t),oR=t=>ze(_(Ce,{children:[_("path",{d:"m22 2-7 20-4-9-9-4Z"}),_("path",{d:"M22 2 11 13"})]}),t),Lo=t=>ze(_(Ce,{children:[_("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),_("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]}),t),sR=t=>ze(_(Ce,{children:[_("path",{d:"M9 9v1a3 3 0 0 0 4.24 2.73"}),_("path",{d:"M15 5.5V5a3 3 0 0 0-5.94-.6"}),_("path",{d:"M19 10v2a7 7 0 0 1-9.9 6.36"}),_("path",{d:"M5 10v2a6.98 6.98 0 0 0 1.11 3.79"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),_("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),t),wc=t=>ze(_(Ce,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M10 14 21 3"}),_("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}),t),lR=t=>ze(_(Ce,{children:[_("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),_("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),_("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),_("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),t),Wd=t=>ze(_(Ce,{children:[_("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),_("path",{d:"m22 7-10 5L2 7"})]}),t),cR=t=>ze(_("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z"}),t),uR=t=>ze(_(Ce,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M8.5 14.5a4 4 0 0 0 7 0"}),_("line",{x1:"9",y1:"9.5",x2:"9.01",y2:"9.5"}),_("line",{x1:"15",y1:"9.5",x2:"15.01",y2:"9.5"})]}),t),kn=t=>ze(_(Ce,{children:[_("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t),fR=t=>ze(_(Ce,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),_("path",{d:"M19 5a9 9 0 0 1 0 14"})]}),t),hR=t=>ze(_(Ce,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("line",{x1:"22",y1:"9",x2:"16",y2:"15"}),_("line",{x1:"16",y1:"9",x2:"22",y2:"15"})]}),t),ci=t=>ze(_("path",{d:"M20 6 9 17l-5-5"}),t),dR=t=>ze(_(Ce,{children:[_("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),t),pR=t=>ze(_(Ce,{children:[_("path",{d:"M1 4v6h6"}),_("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),t),vR=t=>ze(_("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),t),$d=t=>ze(_("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"}),t),Ud=t=>ze(_(Ce,{children:[_("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),_("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),t),gR=t=>ze(_(Ce,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M12 7v5l3 2"})]}),t),Dx=t=>ze(_(Ce,{children:[_("path",{d:"M7 10v12"}),_("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})]}),t),Ix=t=>ze(_(Ce,{children:[_("path",{d:"M17 14V2"}),_("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})]}),t),Yd=t=>ze(_(Ce,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M9 21H3v-6"}),_("path",{d:"M21 3l-7 7"}),_("path",{d:"M3 21l7-7"})]}),t),mR=t=>ze(_(Ce,{children:[_("path",{d:"M9 3v6H3"}),_("path",{d:"M15 21v-6h6"}),_("path",{d:"M9 9 2 2"}),_("path",{d:"M15 15l7 7"})]}),t),yR=t=>ze(_(Ce,{children:[_("rect",{x:"3",y:"4",width:"18",height:"14",rx:"2"}),_("rect",{x:"11",y:"11",width:"8",height:"6",rx:"1",fill:"currentColor",stroke:"none"})]}),t),_R=t=>ze(_(Ce,{children:[_("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),_("path",{d:"M12 15V9"}),_("path",{d:"m8.5 12.5 3.5-3.5 3.5 3.5"})]}),t),bR=t=>ze(_(Ce,{children:[_("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_("path",{d:"m19 12-7 7-7-7"})]}),t),Px=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,xR=t=>t.replace(/([^\n])\s+((?:[-*•]|\d+\.)\s+)(?=(?:\*\*[^*\n]{1,80}\*\*|[A-Z][A-Za-z0-9/& -]{1,50}:))/g,`$1
|
|
24
|
-
$2`),
|
|
20
|
+
`:"<br/>",v=f.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,c)?this._updatePosition(s,d,o[0],o[1],this._tooltipContent,c):this._showTooltipContent(s,v,c,Math.random()+"",o[0],o[1],d,null,h)})},e.prototype._showSeriesItemTooltip=function(r,n,a){var i=this._ecModel,o=Ve(n),s=o.seriesIndex,l=i.getSeriesByIndex(s),c=o.dataModel||l,u=o.dataIndex,f=o.dataType,h=c.getData(f),d=this._renderMode,p=r.positionDefault,m=Wo([h.getItemModel(u),c,l&&(l.coordinateSystem||{}).model],this._tooltipModel,p?{position:p}:null),g=m.get("trigger");if(!(g!=null&&g!=="item")){var v=c.getDataParams(u,f),y=new gh;v.marker=y.makeTooltipMarker("item",pa(v.color),d);var b=xy(c.formatTooltip(u,!1,f)),x=m.get("order"),S=m.get("valueFormatter"),w=b.frag,k=w?Dy(S?U({valueFormatter:S},w):w,y,d,x,i.get("useUTC"),m.get("textStyle")):b.text,T="item_"+c.name+"_"+u;this._showOrMove(m,function(){this._showTooltipContent(m,k,v,T,r.offsetX,r.offsetY,r.position,r.target,y)}),a({type:"showTip",dataIndexInside:u,dataIndex:h.getRawIndex(u),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,a){var i=this._renderMode==="html",o=Ve(n),s=o.tooltipConfig,l=s.option||{},c=l.encodeHTMLContent;if(ne(l)){var u=l;l={content:u,formatter:u},c=!0}c&&i&&l.content&&(l=Te(l),l.content=Bt(l.content));var f=[l],h=this._ecModel.getComponent(o.componentMainType,o.componentIndex);h&&f.push(h),f.push({formatter:l.content});var d=r.positionDefault,p=Wo(f,this._tooltipModel,d?{position:d}:null),m=p.get("content"),g=Math.random()+"",v=new gh;this._showOrMove(p,function(){var y=Te(p.get("formatterParams")||{});this._showTooltipContent(p,m,y,g,r.offsetX,r.offsetY,r.position,n,v)}),a({type:"showTip",from:this.uid})},e.prototype._showTooltipContent=function(r,n,a,i,o,s,l,c,u){if(this._ticket="",!(!r.get("showContent")||!r.get("show"))){var f=this._tooltipContent;f.setEnterable(r.get("enterable"));var h=r.get("formatter");l=l||r.get("position");var d=n,p=this._getNearestPoint([o,s],a,r.get("trigger"),r.get("borderColor")),m=p.color;if(h)if(ne(h)){var g=r.ecModel.get("useUTC"),v=ee(a)?a[0]:a,y=v&&v.axisType&&v.axisType.indexOf("time")>=0;d=h,y&&(d=zl(v.axisValue,d,g)),d=my(d,a,!0)}else if(ye(h)){var b=Le(function(x,S){x===this._ticket&&(f.setContent(S,u,r,m,l),this._updatePosition(r,l,o,s,f,a,c))},this);this._ticket=i,d=h(a,i,b)}else d=h;f.setContent(d,u,r,m,l),f.show(r,m),this._updatePosition(r,l,o,s,f,a,c)}},e.prototype._getNearestPoint=function(r,n,a,i){if(a==="axis"||ee(n))return{color:i||(this._renderMode==="html"?"#fff":"none")};if(!ee(n))return{color:i||n.color||n.borderColor}},e.prototype._updatePosition=function(r,n,a,i,o,s,l){var c=this._api.getWidth(),u=this._api.getHeight();n=n||r.get("position");var f=o.getSize(),h=r.get("align"),d=r.get("verticalAlign"),p=l&&l.getBoundingRect().clone();if(l&&p.applyTransform(l.transform),ye(n)&&(n=n([a,i],s,o.el,p,{viewSize:[c,u],contentSize:f.slice()})),ee(n))a=At(n[0],c),i=At(n[1],u);else if(ce(n)){var m=n;m.width=f[0],m.height=f[1];var g=Yl(m,{width:c,height:u});a=g.x,i=g.y,h=null,d=null}else if(ne(n)&&l){var v=TP(n,p,f,r.get("borderWidth"));a=v[0],i=v[1]}else{var v=SP(a,i,o,c,u,h?null:20,d?null:20);a=v[0],i=v[1]}if(h&&(a-=mx(h)?f[0]/2:h==="right"?f[0]:0),d&&(i-=mx(d)?f[1]/2:d==="bottom"?f[1]:0),lx(r)){var v=kP(a,i,o,c,u);a=v[0],i=v[1]}o.moveTo(a,i)},e.prototype._updateContentNotChangedOnAxis=function(r,n){var a=this._lastDataByCoordSys,i=this._cbParamsList,o=!!a&&a.length===r.length;return o&&D(a,function(s,l){var c=s.dataByAxis||[],u=r[l]||{},f=u.dataByAxis||[];o=o&&c.length===f.length,o&&D(c,function(h,d){var p=f[d]||{},m=h.seriesDataIndices||[],g=p.seriesDataIndices||[];o=o&&h.value===p.value&&h.axisType===p.axisType&&h.axisId===p.axisId&&m.length===g.length,o&&D(m,function(v,y){var b=g[y];o=o&&v.seriesIndex===b.seriesIndex&&v.dataIndex===b.dataIndex}),i&&D(h.seriesDataIndices,function(v){var y=v.seriesIndex,b=n[y],x=i[y];b&&x&&x.data!==b.data&&(o=!1)})})}),this._lastDataByCoordSys=r,this._cbParamsList=n,!!o},e.prototype._hide=function(r){this._lastDataByCoordSys=null,r({type:"hideTip",from:this.uid})},e.prototype.dispose=function(r,n){ge.node||!n.getDom()||(Ih(this,"_updatePosition"),this._tooltipContent.dispose(),zd("itemTooltip",n))},e.type="tooltip",e})(gr);function Wo(t,e,r){var n=e.ecModel,a;r?(a=new et(r,n,n),a=new et(e.option,a,n)):a=e;for(var i=t.length-1;i>=0;i--){var o=t[i];o&&(o instanceof et&&(o=o.get("tooltip",!0)),ne(o)&&(o={formatter:o}),o&&(a=new et(o,a,n)))}return a}function gx(t,e){return t.dispatchAction||Le(e.dispatchAction,e)}function SP(t,e,r,n,a,i,o){var s=r.getSize(),l=s[0],c=s[1];return i!=null&&(t+l+i+2>n?t-=l+i:t+=i),o!=null&&(e+c+o>a?e-=c+o:e+=o),[t,e]}function kP(t,e,r,n,a){var i=r.getSize(),o=i[0],s=i[1];return t=Math.min(t+o,n)-o,e=Math.min(e+s,a)-s,t=Math.max(t,0),e=Math.max(e,0),[t,e]}function TP(t,e,r,n){var a=r[0],i=r[1],o=Math.ceil(Math.SQRT2*n)+8,s=0,l=0,c=e.width,u=e.height;switch(t){case"inside":s=e.x+c/2-a/2,l=e.y+u/2-i/2;break;case"top":s=e.x+c/2-a/2,l=e.y-i-o;break;case"bottom":s=e.x+c/2-a/2,l=e.y+u+o;break;case"left":s=e.x-a-o,l=e.y+u/2-i/2;break;case"right":s=e.x+c+o,l=e.y+u/2-i/2}return[s,l]}function mx(t){return t==="center"||t==="middle"}function CP(t,e,r){var n=hf(t).queryOptionMap,a=n.keys()[0];if(!(!a||a==="series")){var i=oo(e,a,n.get(a),{useDefault:!1,enableAll:!1,enableNone:!1}),o=i.models[0];if(o){var s=r.getViewOfComponentModel(o),l;if(s.group.traverse(function(c){var u=Ve(c).tooltipConfig;if(u&&u.name===t.name)return l=c,!0}),l)return{componentMainType:a,componentIndex:o.componentIndex,el:l}}}}function MP(t){In(rx),t.registerComponentModel(cP),t.registerComponentView(wP),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},Ct),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},Ct)}var AP=function(t,e){if(e==="all")return{type:"all",title:t.getLocaleModel().get(["legend","selector","all"])};if(e==="inverse")return{type:"inverse",title:t.getLocaleModel().get(["legend","selector","inverse"])}},Vd=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.layoutMode={type:"box",ignoreSize:!0},r}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a),r.selected=r.selected||{},this._updateSelector(r)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),this._updateSelector(r)},e.prototype._updateSelector=function(r){var n=r.selector,a=this.ecModel;n===!0&&(n=r.selector=["all","inverse"]),ee(n)&&D(n,function(i,o){ne(i)&&(i={type:i}),n[o]=De(i,AP(a,i.type))})},e.prototype.optionUpdated=function(){this._updateData(this.ecModel);var r=this._data;if(r[0]&&this.get("selectedMode")==="single"){for(var n=!1,a=0;a<r.length;a++){var i=r[a].get("name");if(this.isSelected(i)){this.select(i),n=!0;break}}!n&&this.select(r[0].get("name"))}},e.prototype._updateData=function(r){var n=[],a=[];r.eachRawSeries(function(l){var c=l.name;a.push(c);var u;if(l.legendVisualProvider){var f=l.legendVisualProvider,h=f.getAllNames();r.isSeriesFiltered(l)||(a=a.concat(h)),h.length?n=n.concat(h):u=!0}else u=!0;u&&uf(l)&&n.push(l.name)}),this._availableNames=a;var i=this.get("data")||n,o=de(),s=ue(i,function(l){return(ne(l)||Ke(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new et(l,this,this.ecModel))},this);this._data=dt(s,function(l){return!!l})},e.prototype.getData=function(){return this._data},e.prototype.select=function(r){var n=this.option.selected,a=this.get("selectedMode");if(a==="single"){var i=this._data;D(i,function(o){n[o.get("name")]=!1})}n[r]=!0},e.prototype.unSelect=function(r){this.get("selectedMode")!=="single"&&(this.option.selected[r]=!1)},e.prototype.toggleSelected=function(r){var n=this.option.selected;n.hasOwnProperty(r)||(n[r]=!0),this[n[r]?"unSelect":"select"](r)},e.prototype.allSelect=function(){var r=this._data,n=this.option.selected;D(r,function(a){n[a.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,n=this.option.selected;D(r,function(a){var i=a.get("name",!0);n.hasOwnProperty(i)||(n[i]=!0),n[i]=!n[i]})},e.prototype.isSelected=function(r){var n=this.option.selected;return!(n.hasOwnProperty(r)&&!n[r])&&ze(this._availableNames,r)>=0},e.prototype.getOrient=function(){return this.get("orient")==="vertical"?{index:1,name:"vertical"}:{index:0,name:"horizontal"}},e.type="legend.plain",e.dependencies=["series"],e.defaultOption={z:4,show:!0,orient:"horizontal",left:"center",top:0,align:"auto",backgroundColor:"rgba(0,0,0,0)",borderColor:"#ccc",borderRadius:0,borderWidth:0,padding:5,itemGap:10,itemWidth:25,itemHeight:14,symbolRotate:"inherit",symbolKeepAspect:!0,inactiveColor:"#ccc",inactiveBorderColor:"#ccc",inactiveBorderWidth:"auto",itemStyle:{color:"inherit",opacity:"inherit",borderColor:"inherit",borderWidth:"auto",borderCap:"inherit",borderJoin:"inherit",borderDashOffset:"inherit",borderMiterLimit:"inherit"},lineStyle:{width:"auto",color:"inherit",inactiveColor:"#ccc",inactiveWidth:2,opacity:"inherit",type:"inherit",cap:"inherit",join:"inherit",dashOffset:"inherit",miterLimit:"inherit"},textStyle:{color:"#333"},selectedMode:!0,selector:!1,selectorLabel:{show:!0,borderRadius:10,padding:[3,5,3,5],fontSize:12,fontFamily:"sans-serif",color:"#666",borderWidth:1,borderColor:"#666"},emphasis:{selectorLabel:{show:!0,color:"#eee",backgroundColor:"#666"}},selectorPosition:"auto",selectorItemGap:7,selectorButtonGap:10,tooltip:{show:!1}},e})(We),Si=at,Gd=D,Mc=mt,yx=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!1,r}return e.prototype.init=function(){this.group.add(this._contentGroup=new Mc),this.group.add(this._selectorGroup=new Mc),this._isFirstRender=!0},e.prototype.getContentGroup=function(){return this._contentGroup},e.prototype.getSelectorGroup=function(){return this._selectorGroup},e.prototype.render=function(r,n,a){var i=this._isFirstRender;if(this._isFirstRender=!1,this.resetInner(),!!r.get("show",!0)){var o=r.get("align"),s=r.get("orient");(!o||o==="auto")&&(o=r.get("left")==="right"&&s==="vertical"?"right":"left");var l=r.get("selector",!0),c=r.get("selectorPosition",!0);l&&(!c||c==="auto")&&(c=s==="horizontal"?"end":"start"),this.renderInner(o,r,n,a,l,s,c);var u=r.getBoxLayoutParams(),f={width:a.getWidth(),height:a.getHeight()},h=r.get("padding"),d=Yl(u,f,h),p=this.layoutInner(r,o,d,i,l,c),m=Yl(Ne({width:p.width,height:p.height},u),f,h);this.group.x=m.x-p.x,this.group.y=m.y-p.y,this.group.markRedraw(),this.group.add(this._backgroundEl=lP(p,r))}},e.prototype.resetInner=function(){this.getContentGroup().removeAll(),this._backgroundEl&&this.group.remove(this._backgroundEl),this.getSelectorGroup().removeAll()},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this.getContentGroup(),u=de(),f=n.get("selectedMode"),h=[];a.eachRawSeries(function(d){!d.get("legendHoverLink")&&h.push(d.id)}),Gd(n.getData(),function(d,p){var m=d.get("name");if(!this.newlineDisabled&&(m===""||m===`
|
|
21
|
+
`)){var g=new Mc;g.newline=!0,c.add(g);return}var v=a.getSeriesByName(m)[0];if(!u.get(m))if(v){var y=v.getData(),b=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),S=y.getVisual("style"),w=this._createItem(v,m,p,d,n,r,b,S,x,f,i);w.on("click",Si(_x,m,null,i,h)).on("mouseover",Si($d,v.name,null,i,h)).on("mouseout",Si(Wd,v.name,null,i,h)),a.ssr&&w.eachChild(function(k){var T=Ve(k);T.seriesIndex=v.seriesIndex,T.dataIndex=p,T.ssrType="legend"}),u.set(m,!0)}else a.eachRawSeries(function(k){if(!u.get(m)&&k.legendVisualProvider){var T=k.legendVisualProvider;if(!T.containName(m))return;var C=T.indexOfName(m),A=T.getItemVisual(C,"style"),M=T.getItemVisual(C,"legendIcon"),I=Yr(A.fill);I&&I[3]===0&&(I[3]=.2,A=U(U({},A),{fill:Hs(I,"rgba")}));var L=this._createItem(k,m,p,d,n,r,{},A,M,f,i);L.on("click",Si(_x,null,m,i,h)).on("mouseover",Si($d,null,m,i,h)).on("mouseout",Si(Wd,null,m,i,h)),a.ssr&&L.eachChild(function(P){var N=Ve(P);N.seriesIndex=k.seriesIndex,N.dataIndex=p,N.ssrType="legend"}),u.set(m,!0)}},this)},this),o&&this._createSelector(o,n,i,s,l)},e.prototype._createSelector=function(r,n,a,i,o){var s=this.getSelectorGroup();Gd(r,function(c){var u=c.type,f=new Pt({style:{x:0,y:0,align:"center",verticalAlign:"middle"},onclick:function(){a.dispatchAction({type:u==="all"?"legendAllSelect":"legendInverseSelect",legendId:n.id})}});s.add(f);var h=n.getModel("selectorLabel"),d=n.getModel(["emphasis","selectorLabel"]);Cl(f,{normal:h,emphasis:d},{defaultText:c.title}),bf(f)})},e.prototype._createItem=function(r,n,a,i,o,s,l,c,u,f,h){var d=r.visualDrawType,p=o.get("itemWidth"),m=o.get("itemHeight"),g=o.isSelected(n),v=i.get("symbolRotate"),y=i.get("symbolKeepAspect"),b=i.get("icon");u=b||u||"roundRect";var x=DP(u,i,l,c,d,g,h),S=new Mc,w=i.getModel("textStyle");if(ye(r.getLegendIcon)&&(!b||b==="inherit"))S.add(r.getLegendIcon({itemWidth:p,itemHeight:m,icon:u,iconRotate:v,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var k=b==="inherit"&&r.getData().getVisual("symbol")?v==="inherit"?r.getData().getVisual("symbolRotate"):v:0;S.add(IP({itemWidth:p,itemHeight:m,icon:u,iconRotate:k,itemStyle:x.itemStyle,symbolKeepAspect:y}))}var T=s==="left"?p+5:-5,C=s,A=o.get("formatter"),M=n;ne(A)&&A?M=A.replace("{name}",n??""):ye(A)&&(M=A(n));var I=g?w.getTextColor():i.get("inactiveColor");S.add(new Pt({style:ri(w,{text:M,x:T,y:m/2,fill:I,align:C,verticalAlign:"middle"},{inheritColor:I})}));var L=new ft({shape:S.getBoundingRect(),style:{fill:"transparent"}}),P=i.getModel("tooltip");return P.get("show")&&Sl({el:L,componentModel:o,itemName:n,itemTooltipOption:P.option}),S.add(L),S.eachChild(function(N){N.silent=!0}),L.silent=!f,this.getContentGroup().add(S),bf(S),S.__legendDataIndex=a,S},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getContentGroup(),c=this.getSelectorGroup();So(r.get("orient"),l,r.get("itemGap"),a.width,a.height);var u=l.getBoundingRect(),f=[-u.x,-u.y];if(c.markRedraw(),l.markRedraw(),o){So("horizontal",c,r.get("selectorItemGap",!0));var h=c.getBoundingRect(),d=[-h.x,-h.y],p=r.get("selectorButtonGap",!0),m=r.getOrient().index,g=m===0?"width":"height",v=m===0?"height":"width",y=m===0?"y":"x";s==="end"?d[m]+=u[g]+p:f[m]+=h[g]+p,d[1-m]+=u[v]/2-h[v]/2,c.x=d[0],c.y=d[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[g]=u[g]+p+h[g],b[v]=Math.max(u[v],h[v]),b[y]=Math.min(0,h[y]+d[1-m]),b}else return l.x=f[0],l.y=f[1],this.group.getBoundingRect()},e.prototype.remove=function(){this.getContentGroup().removeAll(),this._isFirstRender=!0},e.type="legend.plain",e})(gr);function DP(t,e,r,n,a,i,o){function s(g,v){g.lineWidth==="auto"&&(g.lineWidth=v.lineWidth>0?2:0),Gd(g,function(y,b){g[b]==="inherit"&&(g[b]=v[b])})}var l=e.getModel("itemStyle"),c=l.getItemStyle(),u=t.lastIndexOf("empty",0)===0?"fill":"stroke",f=l.getShallow("decal");c.decal=!f||f==="inherit"?n.decal:ed(f,o),c.fill==="inherit"&&(c.fill=n[a]),c.stroke==="inherit"&&(c.stroke=n[u]),c.opacity==="inherit"&&(c.opacity=(a==="fill"?n:r).opacity),s(c,n);var h=e.getModel("lineStyle"),d=h.getLineStyle();if(s(d,r),c.fill==="auto"&&(c.fill=n.fill),c.stroke==="auto"&&(c.stroke=n.fill),d.stroke==="auto"&&(d.stroke=n.fill),!i){var p=e.get("inactiveBorderWidth"),m=c[u];c.lineWidth=p==="auto"?n.lineWidth>0&&m?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),d.stroke=h.get("inactiveColor"),d.lineWidth=h.get("inactiveWidth")}return{itemStyle:c,lineStyle:d}}function IP(t){var e=t.icon||"roundRect",r=di(e,0,0,t.itemWidth,t.itemHeight,t.itemStyle.fill,t.symbolKeepAspect);return r.setStyle(t.itemStyle),r.rotation=(t.iconRotate||0)*Math.PI/180,r.setOrigin([t.itemWidth/2,t.itemHeight/2]),e.indexOf("empty")>-1&&(r.style.stroke=r.style.fill,r.style.fill="#fff",r.style.lineWidth=2),r}function _x(t,e,r,n){Wd(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),$d(t,e,r,n)}function bx(t){for(var e=t.getZr().storage.getDisplayList(),r,n=0,a=e.length;n<a&&!(r=e[n].states.emphasis);)n++;return r&&r.hoverLayer}function $d(t,e,r,n){bx(r)||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Wd(t,e,r,n){bx(r)||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function LP(t){var e=t.findComponents({mainType:"legend"});e&&e.length&&t.filterSeries(function(r){for(var n=0;n<e.length;n++)if(!e[n].isSelected(r.name))return!1;return!0})}function Uo(t,e,r){var n=t==="allSelect"||t==="inverseSelect",a={},i=[];r.eachComponent({mainType:"legend",query:e},function(s){n?s[t]():s[t](e.name),xx(s,a),i.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){D(a,function(l,c){s[l?"select":"unSelect"](c)}),xx(s,o)}),n?{selected:o,legendIndex:i}:{name:e.name,selected:o}}function xx(t,e){var r=e||{};return D(t.getData(),function(n){var a=n.get("name");if(!(a===`
|
|
22
|
+
`||a==="")){var i=t.isSelected(a);Vn(r,a)?r[a]=r[a]&&i:r[a]=i}}),r}function PP(t){t.registerAction("legendToggleSelect","legendselectchanged",at(Uo,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",at(Uo,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",at(Uo,"inverseSelect")),t.registerAction("legendSelect","legendselected",at(Uo,"select")),t.registerAction("legendUnSelect","legendunselected",at(Uo,"unSelect"))}function Sx(t){t.registerComponentModel(Vd),t.registerComponentView(yx),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,LP),t.registerSubTypeDefaulter("legend",function(){return"plain"}),PP(t)}var RP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.prototype.setScrollDataIndex=function(r){this.option.scrollDataIndex=r},e.prototype.init=function(r,n,a){var i=ql(r);t.prototype.init.call(this,r,n,a),kx(this,r,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),kx(this,this.option,r)},e.type="legend.scroll",e.defaultOption=Jf(Vd.defaultOption,{scrollDataIndex:0,pageButtonItemGap:5,pageButtonGap:null,pageButtonPosition:"end",pageFormatter:"{current}/{total}",pageIcons:{horizontal:["M0,0L12,-10L12,10z","M0,0L-12,-10L-12,10z"],vertical:["M0,0L20,0L10,-20z","M0,0L20,0L10,20z"]},pageIconColor:"#2f4554",pageIconInactiveColor:"#aaa",pageIconSize:15,pageTextStyle:{color:"#333"},animationDurationUpdate:800}),e})(Vd);function kx(t,e,r){var n=t.getOrient(),a=[1,1];a[n.index]=0,hi(e,r,{type:"box",ignoreSize:!!a})}var Tx=mt,Ud=["width","height"],Yd=["x","y"],EP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r.newlineDisabled=!0,r._currentIndex=0,r}return e.prototype.init=function(){t.prototype.init.call(this),this.group.add(this._containerGroup=new Tx),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new Tx)},e.prototype.resetInner=function(){t.prototype.resetInner.call(this),this._controllerGroup.removeAll(),this._containerGroup.removeClipPath(),this._containerGroup.__rectSize=null},e.prototype.renderInner=function(r,n,a,i,o,s,l){var c=this;t.prototype.renderInner.call(this,r,n,a,i,o,s,l);var u=this._controllerGroup,f=n.get("pageIconSize",!0),h=ee(f)?f:[f,f];p("pagePrev",0);var d=n.getModel("pageTextStyle");u.add(new Pt({name:"pageText",style:{text:"xx/xx",fill:d.getTextColor(),font:d.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),p("pageNext",1);function p(m,g){var v=m+"DataIndex",y=Bf(n.get("pageIcons",!0)[n.getOrient().name][g],{onclick:Le(c._pageGo,c,v,n,i)},{x:-h[0]/2,y:-h[1]/2,width:h[0],height:h[1]});y.name=m,u.add(y)}},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getSelectorGroup(),c=r.getOrient().index,u=Ud[c],f=Yd[c],h=Ud[1-c],d=Yd[1-c];o&&So("horizontal",l,r.get("selectorItemGap",!0));var p=r.get("selectorButtonGap",!0),m=l.getBoundingRect(),g=[-m.x,-m.y],v=Te(a);o&&(v[u]=a[u]-m[u]-p);var y=this._layoutContentAndController(r,i,v,c,u,h,d,f);if(o){if(s==="end")g[c]+=y[u]+p;else{var b=m[u]+p;g[c]-=b,y[f]-=b}y[u]+=m[u]+p,g[1-c]+=y[d]+y[h]/2-m[h]/2,y[h]=Math.max(y[h],m[h]),y[d]=Math.min(y[d],m[d]+g[1-c]),l.x=g[0],l.y=g[1],l.markRedraw()}return y},e.prototype._layoutContentAndController=function(r,n,a,i,o,s,l,c){var u=this.getContentGroup(),f=this._containerGroup,h=this._controllerGroup;So(r.get("orient"),u,r.get("itemGap"),i?a.width:null,i?null:a.height),So("horizontal",h,r.get("pageButtonItemGap",!0));var d=u.getBoundingRect(),p=h.getBoundingRect(),m=this._showController=d[o]>a[o],g=[-d.x,-d.y];n||(g[i]=u[c]);var v=[0,0],y=[-p.x,-p.y],b=Ce(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var x=r.get("pageButtonPosition",!0);x==="end"?y[i]+=a[o]-p[o]:v[i]+=p[o]+b}y[1-i]+=d[s]/2-p[s]/2,u.setPosition(g),f.setPosition(v),h.setPosition(y);var S={x:0,y:0};if(S[o]=m?a[o]:d[o],S[s]=Math.max(d[s],p[s]),S[l]=Math.min(0,p[l]+y[1-i]),f.__rectSize=a[o],m){var w={x:0,y:0};w[o]=Math.max(a[o]-p[o]-b,0),w[s]=S[s],f.setClipPath(new ft({shape:w})),f.__rectSize=w[o]}else h.eachChild(function(T){T.attr({invisible:!0,silent:!0})});var k=this._getPageInfo(r);return k.pageIndex!=null&&Ut(u,{x:k.contentPosition[0],y:k.contentPosition[1]},m?r:null),this._updatePageInfoView(r,k),S},e.prototype._pageGo=function(r,n,a){var i=this._getPageInfo(n)[r];i!=null&&a.dispatchAction({type:"legendScroll",scrollDataIndex:i,legendId:n.id})},e.prototype._updatePageInfoView=function(r,n){var a=this._controllerGroup;D(["pagePrev","pageNext"],function(u){var f=u+"DataIndex",h=n[f]!=null,d=a.childOfName(u);d&&(d.setStyle("fill",h?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),d.cursor=h?"pointer":"default")});var i=a.childOfName("pageText"),o=r.get("pageFormatter"),s=n.pageIndex,l=s!=null?s+1:0,c=n.pageCount;i&&o&&i.setStyle("text",ne(o)?o.replace("{current}",l==null?"":l+"").replace("{total}",c==null?"":c+""):o({current:l,total:c}))},e.prototype._getPageInfo=function(r){var n=r.get("scrollDataIndex",!0),a=this.getContentGroup(),i=this._containerGroup.__rectSize,o=r.getOrient().index,s=Ud[o],l=Yd[o],c=this._findTargetItemIndex(n),u=a.children(),f=u[c],h=u.length,d=h?1:0,p={contentPosition:[a.x,a.y],pageCount:d,pageIndex:d-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return p;var m=x(f);p.contentPosition[o]=-m.s;for(var g=c+1,v=m,y=m,b=null;g<=h;++g)b=x(u[g]),(!b&&y.e>v.s+i||b&&!S(b,v.s))&&(y.i>v.i?v=y:v=b,v&&(p.pageNextDataIndex==null&&(p.pageNextDataIndex=v.i),++p.pageCount)),y=b;for(var g=c-1,v=m,y=m,b=null;g>=-1;--g)b=x(u[g]),(!b||!S(y,b.s))&&v.i<y.i&&(y=v,p.pagePrevDataIndex==null&&(p.pagePrevDataIndex=v.i),++p.pageCount,++p.pageIndex),v=b;return p;function x(w){if(w){var k=w.getBoundingRect(),T=k[l]+w[l];return{s:T,e:T+k[s],i:w.__legendDataIndex}}}function S(w,k){return w.e>=k&&w.s<=k+i}},e.prototype._findTargetItemIndex=function(r){if(!this._showController)return 0;var n,a=this.getContentGroup(),i;return a.eachChild(function(o,s){var l=o.__legendDataIndex;i==null&&l!=null&&(i=s),l===r&&(n=s)}),n??i},e.type="legend.scroll",e})(yx);function OP(t){t.registerAction("legendScroll","legendscroll",function(e,r){var n=e.scrollDataIndex;n!=null&&r.eachComponent({mainType:"legend",subType:"scroll",query:e},function(a){a.setScrollDataIndex(n)})})}function NP(t){In(Sx),t.registerComponentModel(RP),t.registerComponentView(EP),OP(t)}function BP(t){In(Sx),In(NP)}var zP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="dataZoom.inside",e.defaultOption=Jf(ax.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e})(ax),qd=it();function FP(t,e,r){qd(t).coordSysRecordMap.each(function(n){var a=n.dataZoomInfoMap.get(e.uid);a&&(a.getRange=r)})}function HP(t,e){for(var r=qd(t).coordSysRecordMap,n=r.keys(),a=0;a<n.length;a++){var i=n[a],o=r.get(i),s=o.dataZoomInfoMap;if(s){var l=e.uid,c=s.get(l);c&&(s.removeKey(l),s.keys().length||Cx(r,o))}}}function Cx(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function VP(t,e){var r={model:e,containsPoint:at($P,e),dispatchAction:at(GP,t),dataZoomInfoMap:null,controller:null},n=r.controller=new CL(t.getZr());return D(["pan","zoom","scrollMove"],function(a){n.on(a,function(i){var o=[];r.dataZoomInfoMap.each(function(s){if(i.isAvailableBehavior(s.model.option)){var l=(s.getRange||{})[a],c=l&&l(s.dzReferCoordSysInfo,r.model.mainType,r.controller,i);!s.model.get("disabled",!0)&&c&&o.push({dataZoomId:s.model.id,start:c[0],end:c[1]})}}),o.length&&r.dispatchAction(o)})}),r}function GP(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function $P(t,e,r,n){return t.coordinateSystem.containPoint([r,n])}function WP(t){var e,r="type_",n={type_true:2,type_move:1,type_false:0,type_undefined:-1},a=!0;return t.each(function(i){var o=i.model,s=o.get("disabled",!0)?!1:o.get("zoomLock",!0)?"move":!0;n[r+s]>n[r+e]&&(e=s),a=a&&o.get("preventDefaultMouseMove",!0)}),{controlType:e,opt:{zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!0,preventDefaultMouseMove:!!a}}}function UP(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var n=qd(r),a=n.coordSysRecordMap||(n.coordSysRecordMap=de());a.each(function(i){i.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(i){var o=tP(i);D(o.infoList,function(s){var l=s.model.uid,c=a.get(l)||a.set(l,VP(r,s.model)),u=c.dataZoomInfoMap||(c.dataZoomInfoMap=de());u.set(i.uid,{dzReferCoordSysInfo:s,model:i,getRange:null})})}),a.each(function(i){var o=i.controller,s,l=i.dataZoomInfoMap;if(l){var c=l.keys()[0];c!=null&&(s=l.get(c))}if(!s){Cx(a,i);return}var u=WP(l);o.enable(u.controlType,u.opt),o.setPointerChecker(i.containsPoint),Dh(i,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var YP=(function(t){Z(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="dataZoom.inside",r}return e.prototype.render=function(r,n,a){if(t.prototype.render.apply(this,arguments),r.noTarget()){this._clear();return}this.range=r.getPercentRange(),FP(a,r,{pan:Le(Xd.pan,this),zoom:Le(Xd.zoom,this),scrollMove:Le(Xd.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){HP(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e})(rP),Xd={zoom:function(t,e,r,n){var a=this.range,i=a.slice(),o=t.axisModels[0];if(o){var s=Zd[e](null,[n.originX,n.originY],o,r,t),l=(s.signal>0?s.pixelStart+s.pixelLength-s.pixel:s.pixel-s.pixelStart)/s.pixelLength*(i[1]-i[0])+i[0],c=Math.max(1/n.scale,0);i[0]=(i[0]-l)*c+l,i[1]=(i[1]-l)*c+l;var u=this.dataZoomModel.findRepresentativeAxisProxy().getMinMaxSpan();if(Ed(0,i,[0,100],0,u.minSpan,u.maxSpan),this.range=i,a[0]!==i[0]||a[1]!==i[1])return i}},pan:Mx(function(t,e,r,n,a,i){var o=Zd[n]([i.oldX,i.oldY],[i.newX,i.newY],e,a,r);return o.signal*(t[1]-t[0])*o.pixel/o.pixelLength}),scrollMove:Mx(function(t,e,r,n,a,i){var o=Zd[n]([0,0],[i.scrollDelta,i.scrollDelta],e,a,r);return o.signal*(t[1]-t[0])*i.scrollDelta})};function Mx(t){return function(e,r,n,a){var i=this.range,o=i.slice(),s=e.axisModels[0];if(s){var l=t(o,s,e,r,n,a);if(Ed(l,o,[0,100],"all"),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}}}var Zd={grid:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem.getRect();return t=t||[0,0],i.dim==="x"?(o.pixel=e[0]-t[0],o.pixelLength=s.width,o.pixelStart=s.x,o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=s.height,o.pixelStart=s.y,o.signal=i.inverse?-1:1),o},polar:function(t,e,r,n,a){var i=r.axis,o={},s=a.model.coordinateSystem,l=s.getRadiusAxis().getExtent(),c=s.getAngleAxis().getExtent();return t=t?s.pointToCoord(t):[0,0],e=s.pointToCoord(e),r.mainType==="radiusAxis"?(o.pixel=e[0]-t[0],o.pixelLength=l[1]-l[0],o.pixelStart=l[0],o.signal=i.inverse?1:-1):(o.pixel=e[1]-t[1],o.pixelLength=c[1]-c[0],o.pixelStart=c[0],o.signal=i.inverse?-1:1),o},singleAxis:function(t,e,r,n,a){var i=r.axis,o=a.model.coordinateSystem.getRect(),s={};return t=t||[0,0],i.orient==="horizontal"?(s.pixel=e[0]-t[0],s.pixelLength=o.width,s.pixelStart=o.x,s.signal=i.inverse?1:-1):(s.pixel=e[1]-t[1],s.pixelLength=o.height,s.pixelStart=o.y,s.signal=i.inverse?-1:1),s}};function qP(t){sP(t),t.registerComponentModel(zP),t.registerComponentView(YP),UP(t)}var XP={label:{enabled:!0},decal:{show:!1}},Ax=it(),ZP={};function KP(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=Te(XP);De(n.label,t.getLocaleModel().get("aria"),!1),De(r.option,n,!1),a(),i();function a(){var c=r.getModel("decal"),u=c.get("show");if(u){var f=de();t.eachSeries(function(h){if(!h.isColorBySeries()){var d=f.get(h.type);d||(d={},f.set(h.type,d)),Ax(h).scope=d}}),t.eachRawSeries(function(h){if(t.isSeriesFiltered(h))return;if(ye(h.enableAriaDecal)){h.enableAriaDecal();return}var d=h.getData();if(h.isColorBySeries()){var y=_y(h.ecModel,h.name,ZP,t.getSeriesCount()),b=d.getVisual("decal");d.setVisual("decal",x(b,y))}else{var p=h.getRawData(),m={},g=Ax(h).scope;d.each(function(S){var w=d.getRawIndex(S);m[w]=S});var v=p.count();p.each(function(S){var w=m[S],k=p.getName(S)||S+"",T=_y(h.ecModel,k,g,v),C=d.getItemVisual(w,"decal");d.setItemVisual(w,"decal",x(C,T))})}function x(S,w){var k=S?U(U({},w),S):w;return k.dirty=!0,k}})}}function i(){var c=e.getZr().dom;if(c){var u=t.getLocaleModel().get("aria"),f=r.getModel("label");if(f.option=Ne(f.option,u),!!f.get("enabled")){if(c.setAttribute("role","img"),f.get("description")){c.setAttribute("aria-label",f.get("description"));return}var h=t.getSeriesCount(),d=f.get(["data","maxCount"])||10,p=f.get(["series","maxCount"])||10,m=Math.min(h,p),g;if(!(h<1)){var v=s();if(v){var y=f.get(["general","withTitle"]);g=o(y,{title:v})}else g=f.get(["general","withoutTitle"]);var b=[],x=h>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);g+=o(x,{seriesCount:h}),t.eachSeries(function(T,C){if(C<m){var A=void 0,M=T.get("name"),I=M?"withName":"withoutName";A=h>1?f.get(["series","multiple",I]):f.get(["series","single",I]),A=o(A,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var L=T.getData();if(L.count()>d){var P=f.get(["data","partialData"]);A+=o(P,{displayCnt:d})}else A+=f.get(["data","allData"]);for(var N=f.get(["data","separator","middle"]),O=f.get(["data","separator","end"]),q=f.get(["data","excludeDimensionId"]),R=[],z=0;z<L.count();z++)if(z<d){var F=L.getName(z),X=q?dt(L.getValues(z),function(fe,me){return ze(q,me)===-1}):L.getValues(z),te=f.get(["data",F?"withName":"withoutName"]);R.push(o(te,{name:F,value:X.join(N)}))}A+=R.join(N)+O,b.push(A)}});var S=f.getModel(["series","multiple","separator"]),w=S.get("middle"),k=S.get("end");g+=b.join(w)+k,c.setAttribute("aria-label",g)}}}}function o(c,u){if(!ne(c))return c;var f=c;return D(u,function(h,d){f=f.replace(new RegExp("\\{\\s*"+d+"\\s*\\}","g"),h)}),f}function s(){var c=t.get("title");return c&&c.length&&(c=c[0]),c&&c.text}function l(c){var u=t.getLocaleModel().get(["series","typeNames"]);return u[c]||u.chart}}function jP(t){if(!(!t||!t.aria)){var e=t.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},D(["description","general","series","data"],function(r){e[r]!=null&&(e.label[r]=e[r])})}}function QP(t){t.registerPreprocessor(jP),t.registerVisual(t.PRIORITY.VISUAL.ARIA,KP)}function Dx(t,e,r){var n=Na.createCanvas(),a=e.getWidth(),i=e.getHeight(),o=n.style;return o&&(o.position="absolute",o.left="0",o.top="0",o.width=a+"px",o.height=i+"px",n.setAttribute("data-zr-dom-id",t)),n.width=a*r,n.height=i*r,n}var Kd=(function(t){Z(e,t);function e(r,n,a){var i=t.call(this)||this;i.motionBlur=!1,i.lastFrameAlpha=.7,i.dpr=1,i.virtual=!1,i.config={},i.incremental=!1,i.zlevel=0,i.maxRepaintRectCount=5,i.__dirty=!0,i.__firstTimePaint=!0,i.__used=!1,i.__drawIndex=0,i.__startIndex=0,i.__endIndex=0,i.__prevStartIndex=null,i.__prevEndIndex=null;var o;a=a||Xs,typeof r=="string"?o=Dx(r,n,a):ce(r)&&(o=r,r=o.id),i.id=r,i.dom=o;var s=o.style;return s&&(dv(o),o.onselectstart=function(){return!1},s.padding="0",s.margin="0",s.borderWidth="0"),i.painter=n,i.dpr=a,i}return e.prototype.getElementCount=function(){return this.__endIndex-this.__startIndex},e.prototype.afterBrush=function(){this.__prevStartIndex=this.__startIndex,this.__prevEndIndex=this.__endIndex},e.prototype.initContext=function(){this.ctx=this.dom.getContext("2d"),this.ctx.dpr=this.dpr},e.prototype.setUnpainted=function(){this.__firstTimePaint=!0},e.prototype.createBackBuffer=function(){var r=this.dpr;this.domBack=Dx("back-"+this.id,this.painter,r),this.ctxBack=this.domBack.getContext("2d"),r!==1&&this.ctxBack.scale(r,r)},e.prototype.createRepaintRects=function(r,n,a,i){if(this.__firstTimePaint)return this.__firstTimePaint=!1,null;var o=[],s=this.maxRepaintRectCount,l=!1,c=new Fe(0,0,0,0);function u(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Fe(0,0,0,0);b.copy(y),o.push(b)}else{for(var x=!1,S=1/0,w=0,k=0;k<o.length;++k){var T=o[k];if(T.intersect(y)){var C=new Fe(0,0,0,0);C.copy(T),C.union(y),o[k]=C,x=!0;break}else if(l){c.copy(y),c.union(T);var A=y.width*y.height,M=T.width*T.height,I=c.width*c.height,L=I-A-M;L<S&&(S=L,w=k)}}if(l&&(o[w].union(y),x=!0),!x){var b=new Fe(0,0,0,0);b.copy(y),o.push(b)}l||(l=o.length>=s)}}for(var f=this.__startIndex;f<this.__endIndex;++f){var h=r[f];if(h){var d=h.shouldBePainted(a,i,!0,!0),p=h.__isRendered&&(h.__dirty&Wt||!d)?h.getPrevPaintRect():null;p&&u(p);var m=d&&(h.__dirty&Wt||!h.__isRendered)?h.getPaintRect():null;m&&u(m)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var h=n[f],d=h&&h.shouldBePainted(a,i,!0,!0);if(h&&(!d||!h.__zr)&&h.__isRendered){var p=h.getPrevPaintRect();p&&u(p)}}var g;do{g=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var v=f+1;v<o.length;)o[f].intersect(o[v])?(g=!0,o[f].union(o[v]),o.splice(v,1)):v++;f++}}while(g);return this._paintRects=o,o},e.prototype.debugGetPaintRects=function(){return(this._paintRects||[]).slice()},e.prototype.resize=function(r,n){var a=this.dpr,i=this.dom,o=i.style,s=this.domBack;o&&(o.width=r+"px",o.height=n+"px"),i.width=r*a,i.height=n*a,s&&(s.width=r*a,s.height=n*a,a!==1&&this.ctxBack.scale(a,a))},e.prototype.clear=function(r,n,a){var i=this.dom,o=this.ctx,s=i.width,l=i.height;n=n||this.clearColor;var c=this.motionBlur&&!r,u=this.lastFrameAlpha,f=this.dpr,h=this;c&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,s/f,l/f));var d=this.domBack;function p(m,g,v,y){if(o.clearRect(m,g,v,y),n&&n!=="transparent"){var b=void 0;if(Ss(n)){var x=n.global||n.__width===v&&n.__height===y;b=x&&n.__canvasGradient||jh(o,n,{x:0,y:0,width:v,height:y}),n.__canvasGradient=b,n.__width=v,n.__height=y}else Cw(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=Qh(o,n,{dirty:function(){h.setUnpainted(),h.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(m,g,v,y),o.restore()}c&&(o.save(),o.globalAlpha=u,o.drawImage(d,m,g,v,y),o.restore())}!a||c?p(0,0,s,l):a.length&&D(a,function(m){p(m.x*f,m.y*f,m.width*f,m.height*f)})},e})(ur),Ix=1e5,Sa=314159,Ac=.01,JP=.001;function eR(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function tR(t,e){var r=document.createElement("div");return r.style.cssText=["position:relative","width:"+t+"px","height:"+e+"px","padding:0","margin:0","border-width:0"].join(";")+";",r}var rR=(function(){function t(e,r,n,a){this.type="canvas",this._zlevelList=[],this._prevDisplayList=[],this._layers={},this._layerConfig={},this._needsManuallyCompositing=!1,this.type="canvas";var i=!e.nodeName||e.nodeName.toUpperCase()==="CANVAS";this._opts=n=U({},n||{}),this.dpr=n.devicePixelRatio||Xs,this._singleCanvas=i,this.root=e;var o=e.style;o&&(dv(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(i){var u=e,f=u.width,h=u.height;n.width!=null&&(f=n.width),n.height!=null&&(h=n.height),this.dpr=n.devicePixelRatio||1,u.width=f*this.dpr,u.height=h*this.dpr,this._width=f,this._height=h;var d=new Kd(u,this,this.dpr);d.__builtin__=!0,d.initContext(),l[Sa]=d,d.zlevel=Sa,s.push(Sa),this._domRoot=e}else{this._width=uc(e,0,n),this._height=uc(e,1,n);var c=this._domRoot=tR(this._width,this._height);e.appendChild(c)}}return t.prototype.getType=function(){return"canvas"},t.prototype.isSingleCanvas=function(){return this._singleCanvas},t.prototype.getViewportRoot=function(){return this._domRoot},t.prototype.getViewportRootOffset=function(){var e=this.getViewportRoot();if(e)return{offsetLeft:e.offsetLeft||0,offsetTop:e.offsetTop||0}},t.prototype.refresh=function(e){var r=this.storage.getDisplayList(!0),n=this._prevDisplayList,a=this._zlevelList;this._redrawId=Math.random(),this._paintList(r,n,e,this._redrawId);for(var i=0;i<a.length;i++){var o=a[i],s=this._layers[o];if(!s.__builtin__&&s.refresh){var l=i===0?this._backgroundColor:null;s.refresh(l)}}return this._opts.useDirtyRect&&(this._prevDisplayList=r.slice()),this},t.prototype.refreshHover=function(){this._paintHoverList(this.storage.getDisplayList(!1))},t.prototype._paintHoverList=function(e){var r=e.length,n=this._hoverlayer;if(n&&n.clear(),!!r){for(var a={inHover:!0,viewWidth:this._width,viewHeight:this._height},i,o=0;o<r;o++){var s=e[o];s.__inHover&&(n||(n=this._hoverlayer=this.getLayer(Ix)),i||(i=n.ctx,i.save()),ma(i,s,a,o===r-1))}i&&i.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(Ix)},t.prototype.paintOne=function(e,r){S_(e,r)},t.prototype._paintList=function(e,r,n,a){if(this._redrawId===a){n=n||!1,this._updateLayerStatus(e);var i=this._doPaintList(e,r,n),o=i.finished,s=i.needsRefreshHover;if(this._needsManuallyCompositing&&this._compositeManually(),s&&this._paintHoverList(e),o)this.eachLayer(function(c){c.afterBrush&&c.afterBrush()});else{var l=this;rc(function(){l._paintList(e,r,n,a)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(Sa).ctx,r=this._domRoot.width,n=this._domRoot.height;e.clearRect(0,0,r,n),this.eachBuiltinLayer(function(a){a.virtual&&e.drawImage(a.dom,0,0,r,n)})},t.prototype._doPaintList=function(e,r,n){for(var a=this,i=[],o=this._opts.useDirtyRect,s=0;s<this._zlevelList.length;s++){var l=this._zlevelList[s],c=this._layers[l];c.__builtin__&&c!==this._hoverlayer&&(c.__dirty||n)&&i.push(c)}for(var u=!0,f=!1,h=function(m){var g=i[m],v=g.ctx,y=o&&g.createRepaintRects(e,r,d._width,d._height),b=n?g.__startIndex:g.__drawIndex,x=!n&&g.incremental&&Date.now,S=x&&Date.now(),w=g.zlevel===d._zlevelList[0]?d._backgroundColor:null;if(g.__startIndex===g.__endIndex)g.clear(!1,w,y);else if(b===g.__startIndex){var k=e[b];(!k.incremental||!k.notClear||n)&&g.clear(!1,w,y)}b===-1&&(console.error("For some unknown reason. drawIndex is -1"),b=g.__startIndex);var T,C=function(L){var P={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(T=b;T<g.__endIndex;T++){var N=e[T];if(N.__inHover&&(f=!0),a._doPaintEl(N,g,o,L,P,T===g.__endIndex-1),x){var O=Date.now()-S;if(O>15)break}}P.prevElClipPaths&&v.restore()};if(y)if(y.length===0)T=g.__endIndex;else for(var A=d.dpr,M=0;M<y.length;++M){var I=y[M];v.save(),v.beginPath(),v.rect(I.x*A,I.y*A,I.width*A,I.height*A),v.clip(),C(I),v.restore()}else v.save(),C(),v.restore();g.__drawIndex=T,g.__drawIndex<g.__endIndex&&(u=!1)},d=this,p=0;p<i.length;p++)h(p);return ge.wxa&&D(this._layers,function(m){m&&m.ctx&&m.ctx.draw&&m.ctx.draw()}),{finished:u,needsRefreshHover:f}},t.prototype._doPaintEl=function(e,r,n,a,i,o){var s=r.ctx;if(n){var l=e.getPaintRect();(!a||l&&l.intersect(a))&&(ma(s,e,i,o),e.setPrevPaintRect(l))}else ma(s,e,i,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=Sa);var n=this._layers[e];return n||(n=new Kd("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?De(n,this._layerConfig[e],!0):this._layerConfig[e-Ac]&&De(n,this._layerConfig[e-Ac],!0),r&&(n.virtual=r),this.insertLayer(e,n),n.initContext()),n},t.prototype.insertLayer=function(e,r){var n=this._layers,a=this._zlevelList,i=a.length,o=this._domRoot,s=null,l=-1;if(!n[e]&&eR(r)){if(i>0&&e>a[0]){for(l=0;l<i-1&&!(a[l]<e&&a[l+1]>e);l++);s=n[a[l]]}if(a.splice(l+1,0,e),n[e]=r,!r.virtual)if(s){var c=s.dom;c.nextSibling?o.insertBefore(r.dom,c.nextSibling):o.appendChild(r.dom)}else o.firstChild?o.insertBefore(r.dom,o.firstChild):o.appendChild(r.dom);r.painter||(r.painter=this)}},t.prototype.eachLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a];e.call(r,this._layers[i],i)}},t.prototype.eachBuiltinLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__&&e.call(r,o,i)}},t.prototype.eachOtherLayer=function(e,r){for(var n=this._zlevelList,a=0;a<n.length;a++){var i=n[a],o=this._layers[i];o.__builtin__||e.call(r,o,i)}},t.prototype.getLayers=function(){return this._layers},t.prototype._updateLayerStatus=function(e){this.eachBuiltinLayer(function(f,h){f.__dirty=f.__used=!1});function r(f){i&&(i.__endIndex!==f&&(i.__dirty=!0),i.__endIndex=f)}if(this._singleCanvas)for(var n=1;n<e.length;n++){var a=e[n];if(a.zlevel!==e[n-1].zlevel||a.incremental){this._needsManuallyCompositing=!0;break}}var i=null,o=0,s,l;for(l=0;l<e.length;l++){var a=e[l],c=a.zlevel,u=void 0;s!==c&&(s=c,o=0),a.incremental?(u=this.getLayer(c+JP,this._needsManuallyCompositing),u.incremental=!0,o=1):u=this.getLayer(c+(o>0?Ac:0),this._needsManuallyCompositing),u.__builtin__||vu("ZLevel "+c+" has been used by unkown layer "+u.id),u!==i&&(u.__used=!0,u.__startIndex!==l&&(u.__dirty=!0),u.__startIndex=l,u.incremental?u.__drawIndex=-1:u.__drawIndex=l,r(l),i=u),a.__dirty&Wt&&!a.__inHover&&(u.__dirty=!0,u.incremental&&u.__drawIndex<0&&(u.__drawIndex=l))}r(l),this.eachBuiltinLayer(function(f,h){!f.__used&&f.getElementCount()>0&&(f.__dirty=!0,f.__startIndex=f.__endIndex=f.__drawIndex=0),f.__dirty&&f.__drawIndex<0&&(f.__drawIndex=f.__startIndex)})},t.prototype.clear=function(){return this.eachBuiltinLayer(this._clearLayer),this},t.prototype._clearLayer=function(e){e.clear()},t.prototype.setBackgroundColor=function(e){this._backgroundColor=e,D(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?De(n[e],r,!0):n[e]=r;for(var a=0;a<this._zlevelList.length;a++){var i=this._zlevelList[a];if(i===e||i===e+Ac){var o=this._layers[i];De(o,n[e],!0)}}}},t.prototype.delLayer=function(e){var r=this._layers,n=this._zlevelList,a=r[e];a&&(a.dom.parentNode.removeChild(a.dom),delete r[e],n.splice(ze(n,e),1))},t.prototype.resize=function(e,r){if(this._domRoot.style){var n=this._domRoot;n.style.display="none";var a=this._opts,i=this.root;if(e!=null&&(a.width=e),r!=null&&(a.height=r),e=uc(i,0,a),r=uc(i,1,a),n.style.display="",this._width!==e||r!==this._height){n.style.width=e+"px",n.style.height=r+"px";for(var o in this._layers)this._layers.hasOwnProperty(o)&&this._layers[o].resize(e,r);this.refresh(!0)}this._width=e,this._height=r}else{if(e==null||r==null)return;this._width=e,this._height=r,this.getLayer(Sa).resize(e,r)}return this},t.prototype.clearLayer=function(e){var r=this._layers[e];r&&r.clear()},t.prototype.dispose=function(){this.root.innerHTML="",this.root=this.storage=this._domRoot=this._layers=null},t.prototype.getRenderedCanvas=function(e){if(e=e||{},this._singleCanvas&&!this._compositeManually)return this._layers[Sa].dom;var r=new Kd("image",this,e.pixelRatio||this.dpr);r.initContext(),r.clear(!1,e.backgroundColor||this._backgroundColor);var n=r.ctx;if(e.pixelRatio<=this.dpr){this.refresh();var a=r.dom.width,i=r.dom.height;this.eachLayer(function(f){f.__builtin__?n.drawImage(f.dom,0,0,a,i):f.renderToCanvas&&(n.save(),f.renderToCanvas(n),n.restore())})}else for(var o={inHover:!1,viewWidth:this._width,viewHeight:this._height},s=this.storage.getDisplayList(!0),l=0,c=s.length;l<c;l++){var u=s[l];ma(n,u,o,l===c-1)}return r.dom},t.prototype.getWidth=function(){return this._width},t.prototype.getHeight=function(){return this._height},t})();function nR(t){t.registerPainter("canvas",rR)}In([QP,JM,nR,qP,jL,BP,IM,MP]);const ka={background:"#ffffff",border:"#dce4e9",muted:"#5b7186",surface:"#ffffff",text:"#0f1e2a",colors:["#2f7f55","#2563eb","#d97706","#7c3aed"]},Lx="cf-widget-category-zoom",Px=.68,ki=t=>({startIndex:0,endIndex:Math.max(0,t-1)}),Yo=(t,e)=>{if(e<=0)return ki(0);let r=e-1,n=Math.max(0,Math.min(r,Math.floor(Math.min(t.startIndex,t.endIndex))));return{startIndex:n,endIndex:Math.max(n,Math.min(r,Math.floor(Math.max(t.startIndex,t.endIndex))))}},Rx=(t,e,r)=>{let n=Yo(t,r);if(r<=2)return ki(r);let a=n.endIndex-n.startIndex+1,i=e==="in"?Math.max(2,Math.floor(a*Px)):Math.min(r,Math.ceil(a/Px));if(i===a)return n;let o=(n.startIndex+n.endIndex)/2,s=r-i,l=Math.max(0,Math.min(s,Math.round(o-(i-1)/2)));return{startIndex:l,endIndex:l+i-1}},aR=(t,e)=>{let r=t.length;if(r===0)return"No chart points";let n=Yo(e,r);if(n.startIndex===0&&n.endIndex===r-1)return`All ${r} ${r===1?"point":"points"}`;let a=n.endIndex-n.startIndex+1;return`${t[n.startIndex]} – ${t[n.endIndex]} · ${a} of ${r} points`},iR=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},oR=t=>{let e=new Set,r=[];return t.forEach(n=>{let a=n?.trim();!a||e.has(a)||(e.add(a),r.push(a))}),r},jd=t=>{if(typeof t=="number"&&Number.isFinite(t))return t;if(typeof t=="string"&&t.trim()){let e=Number(t);if(Number.isFinite(e))return e}return null},Dc=t=>{if(t===null)return"null:";if(t===void 0)return"undefined:";if(typeof t=="object")try{return`object:${JSON.stringify(t)}`}catch{return"object:"}return`${typeof t}:${String(t)}`},Ic=(t,e)=>e?t.columnMetadata?.find(r=>r.key===e):void 0,Qd=(t,e)=>Ic(t,e)?.label?.trim()||iR(e),Ex=(t,e,r)=>{if(r==null||r==="")return"Not set";let n=Ic(t,e);if(n?.dataType==="boolean"){let a=String(r).trim().toLowerCase();return r===!1||r===0||["0","false","no"].includes(a)?"No":"Yes"}if(n?.dataType==="date"||n?.dataType==="datetime"){let a=new Date(r);if(!Number.isNaN(a.getTime()))try{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:t.timezone||"UTC"}).format(a)}catch{return new Intl.DateTimeFormat(void 0,{month:"short",year:"numeric",timeZone:"UTC"}).format(a)}}return String(r)},qo=(t,e,r,n=!1)=>{if(e?.dataType==="currency"){let a=e.currencyCode||r?.currency?.code;if(a)return new Intl.NumberFormat(void 0,{style:"currency",currency:a,notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)}return e?.dataType==="percent"?new Intl.NumberFormat(void 0,{style:"percent",maximumFractionDigits:2}).format(Math.abs(t)>1?t/100:t):new Intl.NumberFormat(void 0,{notation:n&&Math.abs(t)>=1e4?"compact":"standard",maximumFractionDigits:2}).format(t)},sR=(t,e)=>{if(t.presentation==="table"||t.presentation==="kpi")return null;if(e)return e;let r=t.chartRecommendation?.type;return r==="line"||r==="bar"||r==="stacked_bar"?r:t.type==="line"||t.type==="bar"||t.type==="stacked_bar"?t.type:null},lR=t=>t.chartRecommendation?.categoryField?.trim()||t.label?.trim()||t.columnMetadata?.find(e=>["date","dimension","geography","boolean"].includes(e.semanticRole))?.key||t.columns?.[0],cR=t=>t.chartRecommendation?.seriesField?.trim()||t.seriesField?.trim()||t.series?.trim()||void 0,uR=(t,e,r)=>{let n=oR([...t.chartRecommendation?.valueFields??[],...t.valueFields??[],t.value,...t.columnMetadata?.filter(i=>i.semanticRole==="measure").map(i=>i.key)??[]]),a=new Set([...t.columns??[],...t.columnMetadata?.map(i=>i.key)??[],...Object.keys(t.rows?.[0]??{})]);return n.filter(i=>i!==e&&i!==r&&a.has(i)).filter(i=>t.rows?.some(o=>jd(o[i])!==null))},fR=(t,e,r,n,a)=>{let i=a?` Showing 4 of ${n.length+a} series.`:"";if(e==="line"){let s=r.length-1,l=n.map(c=>{let u=c.values[s];return u==null?null:`${c.name}: ${qo(u,c.valueColumn,t)}`}).filter(c=>!!c);return l.length?`Latest (${r[s]}): ${l.join("; ")}.${i}`:`No numeric trend values are available.${i}`}let o;return n.forEach(s=>{s.values.forEach((l,c)=>{l===null||o&&l<=o.value||(o={category:r[c]??"Not set",series:s,value:l})})}),o?`Highest: ${o.category}, ${o.series.name} ${qo(o.value,o.series.valueColumn,t)}.${i}`:`No numeric comparison values are available.${i}`},Jd=(t,e)=>{let r=sR(t,e),n=lR(t),a=t.rows??[];if(!r||!n||a.length===0)return null;let i=cR(t),o=uR(t,n,i);if(o.length===0)return null;let s=o.length===1?i:void 0,l=[],c=new Set;a.forEach(m=>{let g=Dc(m[n]);c.has(g)||(c.add(g),l.push({key:g,label:Ex(t,n,m[n])}))});let u=l.map(m=>m.label),f=0,h;if(s){let m=[],g=new Set;a.forEach(b=>{let x=Dc(b[s]);g.has(x)||(g.add(x),m.push({key:x,label:Ex(t,s,b[s])}))});let v=m.slice(0,4);f=Math.max(0,m.length-v.length);let y=o[0];h=v.map(b=>{let x=new Map;return a.forEach(S=>{if(Dc(S[s])!==b.key)return;let w=Dc(S[n]);x.has(w)||x.set(w,jd(S[y]))}),{field:y,name:b.label,values:l.map(S=>x.get(S.key)??null),valueColumn:Ic(t,y)}})}else f=Math.max(0,o.length-4),h=o.slice(0,4).map(m=>({field:m,name:Qd(t,m),values:a.map(g=>jd(g[m])),valueColumn:Ic(t,m)}));if(h.length===0)return null;let d=Qd(t,n),p="Values";return s?p=Qd(t,o[0]):h.length===1&&(p=h[0].name),{type:r,title:t.title?.trim()||`${p} by ${d}`,xAxisTitle:d,yAxisTitle:p,categories:u,series:h,omittedSeriesCount:f,summary:fR(t,r,u,h,f)}},hR=t=>{if(t.presentation==="table"||t.presentation==="kpi")return[];let e=Jd(t);if(!e)return[];let r=[{type:"line",label:"Line"},{type:"bar",label:"Bar"}];return e.series.length>1&&r.push({type:"stacked_bar",label:"Stacked bar"}),r},dR=(t,{expanded:e=!1,reducedMotion:r=!1,theme:n=ka,zoomWindow:a=ki(t.categories.length)}={})=>{let i=t.series.length>1,o=t.type==="stacked_bar",s=t.categories.length>2,l=Yo(a,t.categories.length);return{animation:!r,animationDuration:r?0:260,aria:{enabled:!0,decal:{show:!0},label:{description:`${t.title}. ${t.summary}`}},backgroundColor:"transparent",color:n.colors,textStyle:{color:n.text,fontFamily:"inherit"},grid:{top:i?e?48:42:14,right:12,bottom:e?18:10,left:10,containLabel:!0},legend:{show:i,type:"scroll",top:0,left:"center",itemWidth:12,itemHeight:8,textStyle:{color:n.muted,fontSize:e?11:10}},tooltip:{trigger:"axis",triggerOn:"mousemove|click",confine:!0,backgroundColor:n.surface,borderColor:n.border,borderWidth:1,textStyle:{color:n.text,fontSize:12},axisPointer:{type:"line",lineStyle:{color:n.muted,opacity:.5}}},dataZoom:s?[{id:Lx,type:"inside",xAxisIndex:0,startValue:l.startIndex,endValue:l.endIndex,minValueSpan:1,filterMode:"filter",disabled:!0}]:void 0,xAxis:{type:"category",data:t.categories,name:t.xAxisTitle,nameLocation:"middle",nameGap:e?38:32,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLine:{lineStyle:{color:n.border}},axisTick:{show:!1},axisLabel:{color:n.muted,fontSize:e?11:9,hideOverlap:!0,interval:"auto",rotate:!e&&t.categories.length>5?28:0,formatter:c=>c.length>(e?18:11)?`${c.slice(0,e?16:9)}…`:c}},yAxis:{type:"value",name:t.yAxisTitle,nameLocation:"middle",nameGap:e?52:44,nameTextStyle:{color:n.muted,fontSize:e?11:10},axisLabel:{color:n.muted,fontSize:e?11:9,formatter:c=>qo(c,t.series[0]?.valueColumn,void 0,!0)},axisLine:{show:!1},axisTick:{show:!1},splitNumber:4,splitLine:{lineStyle:{color:n.border,opacity:.75}}},series:t.series.map(c=>({type:t.type==="line"?"line":"bar",name:c.name,data:c.values,stack:o?"total":void 0,connectNulls:!1,showSymbol:t.type==="line"&&t.categories.length<=18,symbol:"circle",symbolSize:e?7:6,smooth:!1,maxBarWidth:e?38:28,lineStyle:t.type==="line"?{width:e?3:2.5}:void 0,itemStyle:t.type==="line"?{borderColor:n.background,borderWidth:2}:{borderRadius:o?0:[4,4,0,0]},emphasis:{focus:"series"},tooltip:{valueFormatter:u=>qo(u,c.valueColumn)}}))}},pR=t=>{let e=getComputedStyle(t),r=(a,i)=>e.getPropertyValue(a).trim()||i,n=r("--cf-accent",ka.colors[0]);return{background:r("--cf-bg",ka.background),border:r("--cf-border",ka.border),muted:r("--cf-muted",ka.muted),surface:r("--cf-surface",ka.surface),text:r("--cf-text",ka.text),colors:[n,"#2563eb","#d97706","#7c3aed"]}},vR=({model:t,expanded:e=!1})=>{let r=W(null),n=W(null),[a,i]=V(()=>({model:t,window:ki(t.categories.length)})),[o,s]=V(!1),l=a.model===t?Yo(a.window,t.categories.length):ki(t.categories.length),c=W(l);c.current=l;let u=g=>{let v=Yo(g,t.categories.length);c.current=v,i({model:t,window:v}),n.current?.dispatchAction({type:"dataZoom",dataZoomId:Lx,startValue:v.startIndex,endValue:v.endIndex})};ie(()=>{let g=r.current;if(!(!g||typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("jsdom")))try{let v=nI(g,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)});n.current=v;let y=()=>v.resize(),b=typeof ResizeObserver>"u"?null:new ResizeObserver(y);return b?.observe(g),b||window.addEventListener("resize",y,{passive:!0}),()=>{b?.disconnect(),b||window.removeEventListener("resize",y),v.dispose(),n.current=null}}catch{s(!0);return}},[]),ie(()=>{let g=r.current,v=n.current;if(!g||!v)return;let y=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;v.setOption(dR(t,{expanded:e,reducedMotion:y,theme:pR(g),zoomWindow:c.current}),{lazyUpdate:!0,notMerge:!0}),v.resize()},[e,t]);let f=!o&&t.categories.length>2,h=l.endIndex-l.startIndex+1,d=l.startIndex===0&&l.endIndex===t.categories.length-1,p=f&&h>2,m=f&&!d;return _(Ae,{children:[_("div",{ref:r,class:`cf-analytics-echart${e?" is-expanded":""}`,role:"img","aria-label":`${t.title}. ${t.summary}`,"data-chart-status":o?"fallback":"ready",children:o?_("span",{class:"cf-analytics-echart__fallback",children:t.summary}):null}),f?_("div",{class:"cf-analytics-zoom",children:[_("span",{class:"cf-analytics-zoom__range","aria-live":"polite","aria-atomic":"true",children:aR(t.categories,l)}),_("div",{class:"cf-analytics-zoom__controls",role:"group","aria-label":"Chart zoom controls",children:[_("button",{type:"button","aria-label":"Zoom out chart",title:"Zoom out",disabled:!m,onClick:()=>u(Rx(c.current,"out",t.categories.length)),children:"−"}),_("button",{type:"button",class:"cf-analytics-zoom__reset","aria-label":"Reset chart zoom",title:"Reset zoom",disabled:d,onClick:()=>u(ki(t.categories.length)),children:"Reset"}),_("button",{type:"button","aria-label":"Zoom in chart",title:"Zoom in",disabled:!p,onClick:()=>u(Rx(c.current,"in",t.categories.length)),children:"+"})]})]}):null]})},Ox=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},Nx=(t,e)=>(e?.length?e:Object.keys(t[0]??{})).map(r=>typeof r=="string"?{key:r,label:Ox(r)}:{...r,label:r.label?.trim()||Ox(r.key)}),Bx=(t,e,r)=>{if(t==null||t==="")return"—";if((r?.dataType==="date"||r?.dataType==="datetime")&&typeof t=="string"){let n=new Date(t);if(!Number.isNaN(n.getTime()))return new Intl.DateTimeFormat(e,{dateStyle:"medium",...r.dataType==="datetime"?{timeStyle:"short"}:{}}).format(n)}return r?.dataType==="currency"&&typeof t=="number"?new Intl.NumberFormat(e,{style:"currency",currency:r.currencyCode||"USD",maximumFractionDigits:2}).format(t):typeof t=="number"&&Number.isFinite(t)?new Intl.NumberFormat(e,{maximumFractionDigits:4}).format(t):typeof t=="boolean"?t?"Yes":"No":String(t)},zx=t=>{let e=String(t??"");return/[",\r\n]/.test(e)?`"${e.replaceAll('"','""')}"`:e},gR=(t,e)=>{let r=Nx(t,e);return[r.map(n=>zx(n.label)).join(","),...t.map(n=>r.map(a=>zx(n[a.key])).join(","))].join(`\r
|
|
23
|
+
`)},mR=({rows:t,columns:e,maxRows:r=100,locale:n,expanded:a=!1,classPrefix:i="cr",pageSize:o=10})=>{let s=Kt(()=>Nx(t,e),[e,t]),l=s.map(R=>R.key).join("\0"),[c,u]=V(()=>s.map(R=>R.key)),[f,h]=V(""),[d,p]=V(),[m,g]=V("asc"),[v,y]=V([]),[b,x]=V("table"),[S,w]=V(1),[k,T]=V(o);ie(()=>{u(s.map(R=>R.key)),p(void 0),y([]),w(1)},[l]);let C=s.filter(R=>c.includes(R.key)),A=Kt(()=>{let R=f.toLocaleLowerCase(n),z=t.map((F,X)=>({row:F,index:X})).filter(({row:F})=>C.some(X=>Bx(F[X.key],n,X).toLocaleLowerCase(n).includes(R)));return d?z.sort((F,X)=>{let te=F.row[d],fe=X.row[d],me=typeof te=="number"?te:NaN,we=typeof fe=="number"?fe:NaN,Ze=!Number.isNaN(me)&&!Number.isNaN(we)?me-we:String(te??"").localeCompare(String(fe??""),n,{numeric:!0,sensitivity:"base"});return m==="asc"?Ze:-Ze}):z},[C,n,f,t,m,d]),M=A.slice(0,Math.max(1,r)),I=Math.max(1,Math.ceil(M.length/k)),L=Math.min(S,I),P=a?M:M.slice((L-1)*k,L*k),N=P.length>0&&P.every(({index:R})=>v.includes(R)),O=R=>`${i}-${R}`;if(t.length===0||s.length===0)return _("div",{class:O("table-note"),children:"No rows returned."});let q=R=>{let z=new Set(P.map(({index:F})=>F));y(F=>R?[...new Set([...F,...z])]:F.filter(X=>!z.has(X)))};return _("section",{class:O("data-table"),children:[_("div",{class:O("table-fields"),children:[_("strong",{children:"Fields"}),_("div",{class:O("field-list"),children:s.map(R=>_("span",{class:O("field-chip"),children:R.label},R.key))}),_("span",{class:O("table-field-count"),children:[t.length.toLocaleString(n)," rows"]})]}),_("div",{class:O("table-controls"),children:[_("label",{class:O("table-search"),children:[_("span",{"aria-hidden":"true",children:"⌕"}),_("input",{type:"search",value:f,placeholder:"Search this result...","aria-label":"Search this result",onInput:R=>{h(R.currentTarget.value.trim()),w(1)}})]}),_("div",{class:O("table-modes"),role:"group","aria-label":"Table display mode",children:["table","matrix"].map(R=>_("button",{type:"button",class:`${O("segment")}${b===R?" is-active":""}`,"aria-pressed":b===R,onClick:()=>x(R),children:R==="table"?"Table":"Matrix"},R))})]}),_("div",{class:O("table-column-bar"),children:_("details",{class:O("column-picker"),children:[_("summary",{children:"Columns"}),_("div",{class:O("column-menu"),children:s.map(R=>_("label",{children:[_("input",{type:"checkbox",checked:c.includes(R.key),onChange:z=>{let F=z.currentTarget.checked;u(X=>F?[...new Set([...X,R.key])]:X.length>1?X.filter(te=>te!==R.key):X)}}),_("span",{children:R.label})]},R.key))})]})}),_("div",{class:O("table-wrap"),role:"region","aria-label":"Scrollable result table",tabIndex:0,children:_("table",{class:`${O("table")}${b==="matrix"?" is-matrix":""}`,children:[_("caption",{class:O("visually-hidden"),children:["Result table with ",A.length," ",A.length===1?"row":"rows"]}),_("thead",{children:_("tr",{children:[_("th",{class:O("select-cell"),children:_("input",{type:"checkbox","aria-label":"Select all visible rows",checked:N,onChange:R=>q(R.currentTarget.checked)})}),C.map(R=>_("th",{scope:"col",children:_("button",{type:"button",class:O("table-sort"),"aria-label":`Sort by ${R.label}`,onClick:()=>{d===R.key?g(z=>z==="asc"?"desc":"asc"):(p(R.key),g("asc")),w(1)},children:[_("span",{children:R.label}),_("span",{class:O("sort-direction"),"aria-hidden":"true",children:d===R.key?m==="asc"?"↑":"↓":"↕"})]})},R.key))]})}),_("tbody",{children:P.map(({row:R,index:z})=>_("tr",{class:v.includes(z)?"is-selected":void 0,children:[_("td",{class:O("select-cell"),children:_("input",{type:"checkbox","aria-label":`Select row ${z+1}`,checked:v.includes(z),onChange:F=>y(X=>F.currentTarget.checked?[...new Set([...X,z])]:X.filter(te=>te!==z))})}),C.map(F=>_("td",{children:Bx(R[F.key],n,F)},F.key))]},z))})]})}),_("div",{class:O("table-summary"),children:[_("span",{children:M.length?`${((L-1)*k+1).toLocaleString(n)}-${Math.min(L*k,M.length).toLocaleString(n)} of ${A.length.toLocaleString(n)}`:`0 of ${A.length.toLocaleString(n)}`}),a?_("span",{children:t.length>r?`First ${r.toLocaleString(n)} rows available`:"All returned rows loaded"}):_("div",{class:O("table-pagination"),"aria-label":"Table pagination",children:[_("label",{children:[_("span",{children:"Rows"}),_("select",{"aria-label":"Rows per page",value:k,onChange:R=>{T(Number(R.currentTarget.value)),w(1)},children:[10,25,50].map(R=>_("option",{value:R,children:R},R))})]}),_("button",{type:"button","aria-label":"Previous page",disabled:L<=1,onClick:()=>w(R=>Math.max(1,R-1)),children:"‹"}),_("span",{children:[L," / ",I]}),_("button",{type:"button","aria-label":"Next page",disabled:L>=I,onClick:()=>w(R=>Math.min(I,R+1)),children:"›"})]})]})]})},yR=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/ogg"],_R=()=>{if(typeof navigator>"u"||!navigator.mediaDevices?.getSupportedConstraints)return{};try{return navigator.mediaDevices.getSupportedConstraints()}catch{return{}}},Fx=(t="",e=_R())=>{const r={...t?{deviceId:{exact:t}}:{}};return e.echoCancellation&&(r.echoCancellation={ideal:!0}),e.noiseSuppression&&(r.noiseSuppression={ideal:!0}),e.autoGainControl&&(r.autoGainControl={ideal:!0}),e.channelCount&&(r.channelCount={ideal:1}),e.voiceIsolation&&(r.voiceIsolation={ideal:!0}),r},Hx=(t={})=>{const e=Math.max(2,t.calibrationSamples??6),r=Math.max(e,t.ambientWindowSamples??72),n=Math.min(.5,Math.max(0,t.ambientPercentile??.2)),a=Math.min(1,Math.max(.01,t.smoothing??.22)),i=Math.max(Number.EPSILON,t.minimumNoiseFloor??5e-4),o=Math.max(1.1,t.speechToNoiseRatio??2.7),s=Math.min(o,Math.max(1,t.quietToNoiseRatio??1.55)),l=Math.max(250,t.minimumEndSilenceMs??650),c=Math.max(l,t.maximumEndSilenceMs??1100);let u=[],f=i,h=f*o,d=0;return{observe:g=>{const v=Number.isFinite(g)?Math.max(0,g):0;if(u.length<e||v<=h){u.push(v),u.length>r&&u.shift();const T=[...u].sort((M,I)=>M-I),C=Math.min(T.length-1,Math.floor((T.length-1)*n)),A=Math.max(i,T[C]??i);f+=(A-f)*a}h=f*o;const b=f*s,x=u.length>=e,S=x&&v>=h;S&&(d=Math.max(d,v/Math.max(f,i)));const w=Math.min(1,Math.max(0,(d-o)/o)),k=Math.round(c-(c-l)*w);return{speech:S,quiet:x&&v<=b,calibrated:x,noiseFloor:f,speechThreshold:h,quietThreshold:b,endOfSpeechDelayMs:k}},reset:()=>{u=[],f=i,h=f*o,d=0}}},bR=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result??"").split(",")[1]??""),n.onerror=()=>r(n.error),n.readAsDataURL(t)}),ep=t=>{const e=globalThis.MediaRecorder;if(typeof e?.isTypeSupported=="function"){for(const r of yR)if(e.isTypeSupported(r))try{return new e(t,{mimeType:r})}catch{}}return new e(t)},Fr=t=>{if(!(!t||t.state!=="recording")){try{t.requestData()}catch{}t.stop()}},xR=[{name:"Smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😋","😛","😜","🤪","🤗","🤭","🤔","🤐","😐","😶","😏","🙄","😴","🥳","😎","🤓","🥺","😢","😭","😤","😠","🤯","😬","😱","🤩","🥱"]},{name:"Gestures",emojis:["👍","👎","👌","🤌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","✋","🖐️","👋","🤝","🙏","💪","👏","🙌","👐","🤲","🫶"]},{name:"Hearts & symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","💔","❣️","💕","💖","💘","💝","✨","⭐","🌟","💫","🔥","🎉","🎊","✅","❌","⚡","💯","🚀"]},{name:"Animals & nature",emojis:["🐶","🐱","🦊","🐻","🐼","🐨","🦁","🐮","🐸","🐵","🐧","🦄","🐝","🦋","🐢","🐬","🌷","🌸","🌹","🌻","🌳","🍀"]},{name:"Food & drink",emojis:["🍎","🍌","🍉","🍓","🍒","🥑","🍔","🍟","🍕","🌮","🍿","🍩","🍪","🎂","☕","🍵","🍺","🥂","🍷"]},{name:"Objects & travel",emojis:["🚀","✈️","🚗","🏠","📦","📱","💻","⌚","📷","💡","🔑","🎁","📌","✏️","📝","📞","📧","💰","📈","⏰","🔔","🎯","🏆","🎮","🎵","💬","👀"]}],tp={"contact-support":{title:"Contact support",submit:"Request support",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"subject",label:"Subject",kind:"text",required:!0},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"What do you need help with?"}]},inquiry:{title:"Leave a message",submit:"Send message",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"message",label:"Message",kind:"textarea",required:!0,placeholder:"How can we help?"}]},contact:{title:"Share your details",submit:"Save",fields:[{key:"name",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"email",label:"Email",kind:"email",required:!0,identity:"email"},{key:"phone",label:"Phone",kind:"tel",required:!0,identity:"phone"}]},"book-demo":{title:"Book a demo",submit:"Request demo",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"},{key:"preferredAt",label:"Preferred time",kind:"text",placeholder:"e.g. Thursday 3pm"},{key:"notes",label:"Notes",kind:"textarea",placeholder:"Anything we should know?"}]},"request-callback":{title:"Request a callback",submit:"Request callback",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorPhone",label:"Phone",kind:"tel",required:!0,identity:"phone"},{key:"bestTime",label:"Best time to call",kind:"text",placeholder:"e.g. tomorrow afternoon"},{key:"topic",label:"Topic",kind:"text",placeholder:"What should we call about?"}]},"subscribe-newsletter":{title:"Subscribe",submit:"Subscribe",fields:[{key:"visitorName",label:"Full name",kind:"text",required:!0,identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"}]}},rp={openChat:"Open chat",closeChat:"Close chat",closeHistory:"Close conversation history",unreadMessage:"1 unread message",unreadMessages:"{count} unread messages",muteSounds:"Mute sounds",unmuteSounds:"Unmute sounds",statusOnline:"Online · replies instantly",statusOffline:"Away · leave a message",liveSupport:"Live support",waitingForTeam:"Waiting for the team",assistantName:"Assistant",chatName:"Chat",welcomeLabel:"{name} welcome",welcomeEyebrow:"Ready when you are",welcomePrompt:"Ask a question, leave a message, or book a demo.",agentTyping:"{name} is typing…",expandedAnalyticsResult:"Expanded analytics result",privacyAndData:"Privacy and local data",muteMicrophone:"Mute microphone",unmuteMicrophone:"Unmute microphone",chooseMicrophone:"Choose microphone",defaultMicrophone:"Default microphone",microphone:"Microphone",talkNow:"Talk now",expandView:"Expand view",exitExpandedView:"Exit expanded view",minimizeVoiceChat:"Minimize voice chat",endVoiceChat:"End voice chat",restoreVoiceChat:"Restore voice chat",reopenVoiceChat:"Reopen voice chat with {name}",voiceConnecting:"Connecting…",voiceListening:"Listening…",voiceProcessing:"Thinking…",voiceSpeaking:"Speaking…",voiceNoise:"Background noise detected",voiceMisunderstood:"I could not understand that audio",voiceDenied:"Microphone access is unavailable",composerPlaceholder:"Type your message…",send:"Send message",emoji:"Emoji",gifs:"GIFs",attachFile:"Attach a file",recordVoice:"Record a voice message",stopRecording:"Stop recording",actionTestMode:"Test mode",stop:"Stop",copy:"Copy",copied:"Copied",retry:"Retry",clearChat:"Clear conversation",clearChatConfirm:"Clear this conversation?",clearChatConfirmBody:"This clears the messages on this device and starts a fresh chat.",clearConfirmCta:"Clear chat",endChat:"End conversation",endChatConfirm:"End this conversation?",endChatConfirmBody:"You won't be able to send more messages in this chat, but you can start a new one anytime.",endConfirmCta:"End conversation",conversationEnded:"This conversation has ended.",startNewChat:"Start a new conversation",pastConversations:"Past conversations",viewingPast:"Viewing a past conversation (read-only)",backToChat:"Back to current chat",historyEnded:"ended",feedbackHelpful:"Helpful",feedbackNotHelpful:"Not helpful",feedbackThanks:"Thanks for the feedback",csatPrompt:"How was this chat?",feedbackCommentPlaceholder:"What went wrong? (optional)",feedbackSend:"Send",cancel:"Cancel",newMessages:"New messages",poweredBy:"Powered by",searchGifs:"Search GIFs…",searchingGifs:"Searching…",noGifs:"No GIFs found",assistantTyping:"Assistant is typing",emptyReply:"Sorry, I couldn't generate a reply.",errorGeneric:"Something went wrong reaching the assistant. Please try again.",errorRateLimit:"You’re sending messages a little fast — give it a second and try again.",attaching:"Reading file…",attachTooLarge:"That file is too large (max 8 MB).",attachFailed:"Couldn’t read that file — try another.",removeAttachment:"Remove attachment",dropFileHere:"Drop the file here",clearDeviceData:"Clear conversations from this device",clearDeviceDataBody:"This removes locally stored conversations and visitor details from this browser. It cannot be undone.",clearDeviceDataCta:"Clear this device",handoffTitle:"Want our team to follow up?",handoffName:"Name (optional)",handoffEmail:"Your email",handoffNotify:"Notify the team",sending:"Sending…",handoffShared:"I’ve shared this with our team — they’ll get back to you at {email}.",formThanks:"Thanks! We’ll be in touch.",formError:"Something went wrong — please try again.",actionContactOptions:"Contact options",actionGetInTouch:"Get in touch",actionMore:"+{count} more",actionNeedHelp:"Need help?",actionChoose:"Choose what you want to do",actionFooter:"We’ll ask for your full name and the best email or phone so the team can reach you.",actionCategorySupport:"Support",actionCategorySales:"Talk to sales",actionCategoryMarketing:"Stay in touch",actionClose:"Close",actionAs:"as {identity}",bookingPickTime:"What time works best?",bookingPickDay:"Pick a day",bookingPickTimeLabel:"Pick a time",bookingDuration:"{count}-minute demo",bookingTimezone:"Times shown in {timezone}",bookingSchedulerFallback:"the scheduler",bookingCheckingAvailability:"Checking calendar availability…",bookingNoSlots:"No available times were found in this booking window.",bookingAvailabilityUnavailable:"Calendar availability is temporarily unavailable. Please try again shortly.",bookingEarlierToday:"Earlier today",bookingCalendarBusy:"Busy on the calendar",bookingAlreadyBooked:"Already booked",bookingNotOffered:"Not offered by the calendar",bookingRequested:"Requested for {when} — we’ll confirm by email.",bookingConfirmed:"You’re booked for {when}! A calendar invite is on its way. 📅",bookingSlotTaken:"That time was just taken — please pick another.",bookingViaProvider:"Pick a time that works for you on {provider}.",bookingOpenScheduler:"Open the scheduler",bookingLinkOpened:"Opening the scheduler — pick a time that suits you. 📅",bookingMeetingLink:"Meeting link",previewReply:"👋 This is a preview — replies here are samples. Publish the widget on your site to chat with the live AI.",previewActionNote:"Preview — nothing was actually sent. This works for real once you publish.",previewBanner:"Preview — sample replies, no AI"},qt=(t,e)=>t.replace(/\{(\w+)\}/g,(r,n)=>e[n]??""),wR=t=>t?{...rp,...t}:rp,Vx=j1(rp),SR=Vx.Provider,_r=()=>fw(Vx),Xe=(t,e)=>_("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true",...e,children:t}),kR=t=>_("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:_("path",{"fill-rule":"evenodd","clip-rule":"evenodd",d:"M5 3.25h14A3.75 3.75 0 0 1 22.75 7v6A3.75 3.75 0 0 1 19 16.75h-7.19l-4.26 3.84A.75.75 0 0 1 6.25 20v-3.32A3.75 3.75 0 0 1 2.25 13V7A3.75 3.75 0 0 1 6 3.25Zm3 7.75a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Zm4 0a1.25 1.25 0 1 0 0-2.5 1.25 1.25 0 0 0 0 2.5Z"})}),Ti=t=>Xe(_("path",{d:"m6 9 6 6 6-6"}),t),TR=t=>Xe(_(Ae,{children:[_("path",{d:"m22 2-7 20-4-9-9-4Z"}),_("path",{d:"M22 2 11 13"})]}),t),Xo=t=>Xe(_(Ae,{children:[_("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),_("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]}),t),CR=t=>Xe(_(Ae,{children:[_("path",{d:"M9 9v1a3 3 0 0 0 4.24 2.73"}),_("path",{d:"M15 5.5V5a3 3 0 0 0-5.94-.6"}),_("path",{d:"M19 10v2a7 7 0 0 1-9.9 6.36"}),_("path",{d:"M5 10v2a6.98 6.98 0 0 0 1.11 3.79"}),_("line",{x1:"12",y1:"19",x2:"12",y2:"22"}),_("line",{x1:"2",y1:"2",x2:"22",y2:"22"})]}),t),Lc=t=>Xe(_(Ae,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M10 14 21 3"}),_("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}),t),MR=t=>Xe(_(Ae,{children:[_("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),_("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),_("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),_("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),t),Pc=t=>Xe(_(Ae,{children:[_("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),_("path",{d:"m22 7-10 5L2 7"})]}),t),AR=t=>Xe(_("path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72c.13.96.36 1.9.7 2.81a2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45c.91.34 1.85.57 2.81.7A2 2 0 0 1 22 16.92Z"}),t),DR=t=>Xe(_(Ae,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M8.5 14.5a4 4 0 0 0 7 0"}),_("line",{x1:"9",y1:"9.5",x2:"9.01",y2:"9.5"}),_("line",{x1:"15",y1:"9.5",x2:"15.01",y2:"9.5"})]}),t),Ta=t=>Xe(_(Ae,{children:[_("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t),IR=t=>Xe(_(Ae,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),_("path",{d:"M19 5a9 9 0 0 1 0 14"})]}),t),LR=t=>Xe(_(Ae,{children:[_("path",{d:"M11 5 6 9H2v6h4l5 4z"}),_("line",{x1:"22",y1:"9",x2:"16",y2:"15"}),_("line",{x1:"16",y1:"9",x2:"22",y2:"15"})]}),t),Ca=t=>Xe(_("path",{d:"M20 6 9 17l-5-5"}),t),PR=t=>Xe(_(Ae,{children:[_("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),_("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),t),RR=t=>Xe(_(Ae,{children:[_("path",{d:"M1 4v6h6"}),_("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),t),ER=t=>Xe(_("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),t),np=t=>Xe(_("path",{d:"M21.44 11.05 12.25 20.24a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"}),t),ap=t=>Xe(_(Ae,{children:[_("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),_("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),t),OR=t=>Xe(_(Ae,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M12 7v5l3 2"})]}),t),Gx=t=>Xe(_(Ae,{children:[_("path",{d:"M7 10v12"}),_("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"})]}),t),$x=t=>Xe(_(Ae,{children:[_("path",{d:"M17 14V2"}),_("path",{d:"M9 18.12 10 14H4.17a2 2 0 0 1-1.92-2.56l2.33-8A2 2 0 0 1 6.5 2H20a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2h-2.76a2 2 0 0 0-1.79 1.11L12 22a3.13 3.13 0 0 1-3-3.88Z"})]}),t),ip=t=>Xe(_(Ae,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M9 21H3v-6"}),_("path",{d:"M21 3l-7 7"}),_("path",{d:"M3 21l7-7"})]}),t),NR=t=>Xe(_(Ae,{children:[_("path",{d:"M9 3v6H3"}),_("path",{d:"M15 21v-6h6"}),_("path",{d:"M9 9 2 2"}),_("path",{d:"M15 15l7 7"})]}),t),BR=t=>Xe(_(Ae,{children:[_("rect",{x:"3",y:"4",width:"18",height:"14",rx:"2"}),_("rect",{x:"11",y:"11",width:"8",height:"6",rx:"1",fill:"currentColor",stroke:"none"})]}),t),zR=t=>Xe(_(Ae,{children:[_("rect",{x:"4",y:"5",width:"16",height:"14",rx:"2"}),_("path",{d:"M12 15V9"}),_("path",{d:"m8.5 12.5 3.5-3.5 3.5 3.5"})]}),t),FR=t=>Xe(_(Ae,{children:[_("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_("path",{d:"m19 12-7 7-7-7"})]}),t),Wx=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,HR=t=>t.replace(/([^\n])\s+((?:[-*•]|\d+\.)\s+)(?=(?:\*\*[^*\n]{1,80}\*\*|[A-Z][A-Za-z0-9/& -]{1,50}:))/g,`$1
|
|
24
|
+
$2`),Ci=t=>{const e=[];let r=0,n=0,a;for(Wx.lastIndex=0;(a=Wx.exec(t))!==null;){a.index>r&&e.push(t.slice(r,a.index));const i=a[0];if(i.startsWith("`"))e.push(_("code",{class:"cf-md-code",children:i.slice(1,-1)},n++));else if(i.startsWith("**"))e.push(_("strong",{children:i.slice(2,-2)},n++));else if(i.startsWith("[")){const o=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(i),s=o?o[1]:i,l=o?o[2]:"#";e.push(_("a",{href:l,target:"_blank",rel:"noopener noreferrer nofollow",children:s},n++))}else e.push(_("a",{href:i,target:"_blank",rel:"noopener noreferrer nofollow",children:i},n++));r=a.index+i.length}return r<t.length&&e.push(t.slice(r)),e},VR=/^(```|#{1,6}\s|\s*[-*•]\s|\s*\d+\.\s)/,GR=(t,e,r)=>{const n=`cf-md-h cf-md-h--${Math.min(t,6)}`;return t<=2?_("h3",{class:n,children:e},r):t===3?_("h4",{class:n,children:e},r):_("h5",{class:n,children:e},r)},$R=t=>{const e=HR(t.replace(/\r\n/g,`
|
|
25
25
|
`)).split(`
|
|
26
26
|
`),r=[];let n=0,a=0;for(;a<e.length;){const i=e[a];if(i.trim().startsWith("```")){const u=[];for(a++;a<e.length&&!e[a].trim().startsWith("```");)u.push(e[a]),a++;a++,r.push(_("pre",{class:"cf-md-pre",children:_("code",{children:u.join(`
|
|
27
|
-
`)})},n++));continue}if(i.trim()===""){a++;continue}const o=/^(#{1,6})\s+(.*)$/.exec(i);if(o){r.push(SR(o[1].length,ui(o[2]),n++)),a++;continue}if(/^\s*[-*•]\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*[-*•]\s+/.test(e[a]);)u.push(_("li",{children:ui(e[a].replace(/^\s*[-*•]\s+/,""))},u.length)),a++;r.push(_("ul",{class:"cf-md-list",children:u},n++));continue}if(/^\s*\d+\.\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*\d+\.\s+/.test(e[a]);)u.push(_("li",{children:ui(e[a].replace(/^\s*\d+\.\s+/,""))},u.length)),a++;r.push(_("ol",{class:"cf-md-list",children:u},n++));continue}const s=[i];for(a++;a<e.length&&e[a].trim()!==""&&!wR.test(e[a]);)s.push(e[a]),a++;const l=s.join(" ");if(/:\s*$/.test(l)&&a<e.length&&/^(?:\s*[-*•]\s+|\s*\d+\.\s+)/.test(e[a])){const u=/^(.*[.!?])\s+([^.!?]{2,120}:)$/.exec(l);u&&r.push(_("p",{children:ui(u[1])},n++)),r.push(_("p",{class:"cf-md-list-intro",children:ui(u?.[2]??l)},n++))}else r.push(_("p",{children:ui(l)},n++))}return r},TR=t=>{if(!t)return"Live data";const e=new Date(t);return Number.isNaN(e.getTime())?"Live data":`Updated ${new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(e)}`},CR=({answeredAt:t,reportingPeriod:e,filters:r=[],rowCount:n})=>_("div",{class:"cf-analytics-meta","data-testid":"analytics-result-meta","aria-label":"Result details",children:[_("span",{children:[_("span",{"aria-hidden":"true",class:"cf-analytics-meta__dot"}),TR(t)]}),e?.label?_("span",{children:e.label}):null,typeof n=="number"?_("span",{children:[n," ",n===1?"row":"rows"]}):null,r.length>0?_("span",{children:[r.length," applied ",r.length===1?"filter":"filters"]}):null]}),MR=({label:t,value:e,detail:r})=>_("section",{class:"cf-analytics-kpi","aria-label":t,"data-testid":"analytics-kpi",children:[_("div",{class:"cf-analytics-kpi__label",children:t}),_("div",{class:"cf-analytics-kpi__value",children:e}),r?_("div",{class:"cf-analytics-kpi__detail",children:r}):null]}),AR=({title:t="No matching data",description:e="No approved records matched this question."})=>_("section",{class:"cf-analytics-empty",role:"status","data-testid":"analytics-empty-state",children:[_("p",{children:t}),_("p",{children:e})]}),DR=({explanation:t,onFollowUp:e,showLead:r=!1,maxFollowUps:n=3})=>_("section",{class:"cf-analytics-explanation","data-testid":"inline-analytics-explanation","aria-label":"Analysis and supporting evidence",children:[r?_("div",{class:"cf-analytics-explanation__lead","data-testid":"analytics-explanation-lead",children:[_("div",{class:"cf-analytics-explanation__lead-meta",children:[_("span",{class:"cf-analytics-explanation__eyebrow",children:"Answer from your data"}),_("span",{class:"cf-analytics-explanation__provenance",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__provenance-dot"}),t.source==="ai_grounded"?"AI-assisted · evidence checked":"Based on current values"]})]}),_("h3",{class:"cf-analytics-explanation__headline",children:t.headline}),_("p",{class:"cf-analytics-explanation__summary",children:t.summary})]}):null,_("div",{class:"cf-analytics-explanation__body",children:[(t.evidence?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"What the numbers show"}),_("ul",{class:"cf-analytics-explanation__evidence",children:t.evidence?.slice(0,4).map(a=>_("li",{class:"cf-analytics-explanation__evidence-item",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__evidence-bullet"}),_("span",{children:a})]},a))})]}):null,t.businessMeaning?_("section",{class:"cf-analytics-explanation__meaning",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Why this may matter"}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.businessMeaning})]}):null,(t.possibleDrivers?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("div",{class:"cf-analytics-explanation__section-heading",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Possibilities worth checking"}),_("span",{class:"cf-analytics-explanation__hint",children:"These are not proven causes"})]}),_("div",{class:"cf-analytics-explanation__drivers",children:t.possibleDrivers?.slice(0,2).map(a=>_("article",{class:"cf-analytics-explanation__driver",children:[_("p",{class:"cf-analytics-explanation__driver-title",children:a.hypothesis}),_("p",{class:"cf-analytics-explanation__driver-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"How to check:"})," ",a.howToCheck]})]},`${a.hypothesis}-${a.howToCheck}`))})]}):null,(t.recommendations?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Useful next steps"}),_("div",{class:"cf-analytics-explanation__recommendations",children:t.recommendations?.slice(0,3).map((a,i)=>_("article",{class:"cf-analytics-explanation__recommendation",children:[_("span",{class:"cf-analytics-explanation__recommendation-index",children:i+1}),_("div",{children:[_("p",{class:"cf-analytics-explanation__recommendation-title",children:a.action}),_("p",{class:"cf-analytics-explanation__recommendation-body",children:a.why}),a.successMetric?_("p",{class:"cf-analytics-explanation__recommendation-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"Watch:"})," ",a.successMetric]}):null]})]},`${a.action}-${a.why}`))})]}):null,t.forecast?_("section",{class:"cf-analytics-explanation__outlook",children:[_("div",{class:"cf-analytics-explanation__outlook-header",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Outlook"}),_("span",{class:"cf-analytics-explanation__outlook-badge",children:"Validated estimate"})]}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.forecast.text}),t.forecast.limitations?_("p",{class:"cf-analytics-explanation__recommendation-body",children:t.forecast.limitations}):null]}):null,e&&(t.followUps?.length??0)>0?_("section",{class:"cf-analytics-explanation__section cf-analytics-explanation__follow-up",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Ask a follow-up"}),_("div",{class:"cf-analytics-explanation__questions",children:t.followUps?.slice(0,n).map(a=>_("button",{type:"button",class:"cf-analytics-explanation__question",onClick:()=>e(a),children:a},a))})]}):null,(t.limitations?.length??0)>0?_("details",{class:"cf-analytics-explanation__limits",children:[_("summary",{class:"cf-analytics-explanation__limits-summary",children:"Important limits"}),_("ul",{class:"cf-analytics-explanation__limits-list",children:t.limitations?.map(a=>_("li",{children:a},a))})]}):null]}),_("p",{class:"cf-analytics-explanation__source",children:t.source==="ai_grounded"?"AI-assisted wording, checked against the live values shown here.":"Based only on the live values shown here."})]}),Lx=()=>{const t=q(null);return he(()=>{const e=requestAnimationFrame(()=>t.current?.scrollIntoView({block:"end"}));return()=>cancelAnimationFrame(e)},[]),t},IR=t=>t.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"🤖",Ro=t=>{const e=t?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");return e?` cf-avatar-preset--${e}`:""},PR={"support-guide":"SG","sales-host":"SH","calm-advisor":"CA","technical-guide":"TG","school-desk":"SD","front-office":"FO"},Sc=t=>{const e=t?.avatarId?.trim().toLowerCase();return e&&PR[e]||(t?IR(t.agentName):"·")},Rx=({persona:t,small:e,hideWhenMissing:r})=>{const n=e?"cf-msg__avatar":"cf-header__avatar",a=t?.agentAvatarUrl?.trim();return a?_("span",{class:n,children:_("img",{src:a,alt:""})}):r?null:_("span",{class:`${n}${Ro(t)}`,children:Sc(t)})},LR=()=>{const t=jr(),[e,r]=W(0),n=["Thinking","Checking available information","Preparing your response"];return he(()=>{const a=[window.setTimeout(()=>r(1),1800),window.setTimeout(()=>r(2),5e3)];return()=>a.forEach(i=>window.clearTimeout(i))},[]),_("div",{class:"cf-msg__bubble cf-typing","aria-label":t.assistantTyping,children:[_("span",{class:"cf-typing__label","aria-live":"polite",children:n[e]}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"})]})},RR=3,ER=({msg:t})=>{if(!t.sources||t.sources.length===0)return null;const e=new Set,r=[];for(const i of t.sources){const o=(i.url||i.title||"").toLowerCase();!o||e.has(o)||(e.add(o),r.push(i))}if(r.length===0)return null;const n=r.slice(0,RR),a=r.length-n.length;return _("div",{class:"cf-sources",children:[n.map((i,o)=>i.url?_("a",{class:"cf-source",href:i.url,target:"_blank",rel:"noopener noreferrer nofollow",title:i.title||i.url,children:[_(wc,{}),_("span",{children:i.title||i.url})]},o):_("span",{class:"cf-source",title:i.title,children:[_(wc,{}),_("span",{children:i.title})]},o)),a>0&&_("span",{class:"cf-source cf-source--more",children:["+",a," more"]})]})},OR=({replies:t,onPick:e})=>t&&t.length>0?_("div",{class:"cf-chips",children:t.map((r,n)=>_("button",{type:"button",class:"cf-chip",onClick:()=>e(r),children:r},n))}):null,NR=({persona:t,starters:e,onPick:r,onFocusComposer:n,speaking:a,voiceState:i="idle",replyPending:o=!1,pinned:s=!1,muted:l=!1,onToggleMute:c,onEndCall:u,onTalkNow:f,showTalkNow:h=!1,micLevel:d=0,theaterMode:p=!1,onToggleTheater:m,onMinimize:v,audioDevices:g=[],selectedAudioDeviceId:y="",onSelectAudioDevice:b,connectingOnly:x=!1})=>{if(!t||!(t.talkbackMode==="avatar"||t.widgetModule==="assistant"||t.allowVoiceInput))return null;const w=t.agentAvatarUrl?.trim()||"",k=t.assistantMediaUrl?.trim()||w,T=t.assistantMediaKind==="video"&&!!k,M=e.slice(0,3),A=i!=="idle",C=i!=="idle"?"End voice chat":`Speak with ${t.agentName}`,I=s&&!A&&!a,P=i==="connecting"||i==="processing"||A&&o,R=["cf-assistant-card__stage","cf-assistant-card__stage--local",A?"is-live":"",P?"is-thinking":"",i==="listening"&&!l?"is-listening":"",a||i==="speaking"?"is-speaking":"",l?"is-muted":""].filter(Boolean).join(" "),E=i==="listening"&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,d*8)))}:void 0,O=P&&_("span",{class:"cf-call-ripple","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{})]});if(x)return _("div",{class:"cf-assistant-card cf-assistant-card--connecting","aria-live":"polite",children:[_("div",{class:"cf-assistant-card__connecting-avatar",children:[w?_("img",{src:w,alt:""}):_("span",{class:`cf-assistant-card__connecting-face${Ro(t)}`,children:Sc(t)}),O]}),_("div",{class:"cf-assistant-card__connecting-copy",children:[_("span",{class:"cf-assistant-card__connecting-eyebrow",children:t.agentName}),_("strong",{children:"Connecting with the AI…"})]})]});const K=A&&u&&_(i5,{voiceState:i,muted:l,onToggleMute:c??(()=>{}),onEndCall:u,onTalkNow:f??(()=>{}),showTalkNow:h,micLevel:d,theaterMode:p,onToggleTheater:m??(()=>{}),onMinimize:v??(()=>{}),audioDevices:g,selectedAudioDeviceId:y,onSelectAudioDevice:b??(()=>{})});return I?_("div",{class:"cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact",children:_("button",{type:"button",class:"cf-assistant-card__compact-speak",onClick:n,children:[w?_("span",{class:"cf-assistant-card__compact-avatar",children:_("img",{src:w,alt:""})}):null,_("span",{class:"cf-assistant-card__compact-mic","aria-hidden":"true",children:_(Lo,{})}),_("span",{class:"cf-assistant-card__compact-label",children:C})]})}):_("div",{class:`cf-assistant-card ${s?"cf-assistant-card--pinned":""} ${a?"is-speaking":""}`,children:[(k||t.allowVoiceInput)&&_("div",{class:R,style:E,children:[_("div",{class:`cf-assistant-card__media ${k?"cf-assistant-card__media--uploaded":"cf-assistant-card__media--generated"}${Ro(t)}`,children:[T?_("video",{src:k,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):k?_("img",{src:k,alt:""}):_("div",{class:`cf-assistant-card__avatar-stage${Ro(t)}`,children:_("div",{class:"cf-assistant-card__face",children:[_("span",{class:"cf-assistant-card__initials",children:Sc(t)}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--left"}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--right"}),_("span",{class:"cf-assistant-card__mouth"})]})}),k&&!T&&_("span",{class:"cf-assistant-card__mouth cf-assistant-card__mouth--overlay"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--one","aria-hidden":"true"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--two","aria-hidden":"true"}),_("span",{class:"cf-avatar-listen-ring","aria-hidden":"true"}),_("span",{class:"cf-avatar-wave","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{}),_("span",{})]})]}),O,t.allowVoiceInput&&(K||_("button",{type:"button",class:"cf-assistant-card__speak",onClick:n,children:[_(Lo,{}),C]}))]}),!s&&_(Ce,{children:[t.agentDescription?_("p",{class:"cf-assistant-card__copy",children:t.agentDescription}):_("p",{class:"cf-assistant-card__copy",children:t.greeting}),M.length>0&&_("div",{class:"cf-assistant-card__chips",children:M.map(L=>_("button",{type:"button",class:"cf-assistant-card__chip",onClick:()=>r(L),children:L},L))}),t.disclaimerText||t.assistantPrivacyUrl?_("p",{class:"cf-assistant-card__privacy",children:[t.disclaimerText||"This chat may be recorded for quality and support.",t.assistantPrivacyUrl?_(Ce,{children:[" ",_("a",{href:t.assistantPrivacyUrl,target:"_blank",rel:"noopener noreferrer nofollow",children:"Privacy Policy"})]}):null]}):null]})]})},BR={public_book_demo:{type:"book-demo",label:"Book a demo",description:"Pick a time or request a demo from the team.",Icon:lR},public_submit_inquiry:{type:"inquiry",label:"Leave a message",description:"Send your question and contact details.",Icon:Wd},public_request_callback:{type:"request-callback",label:"Request a callback",description:"Share your phone number and best time to call.",Icon:cR},public_subscribe_newsletter:{type:"subscribe-newsletter",label:"Subscribe",description:"Get product updates and useful announcements.",Icon:Wd}},zR=({field:t,value:e,onInput:r})=>{const n=t.placeholder??t.label,a={class:"cf-form__input",placeholder:t.required?`${n} *`:n,value:e,"aria-label":t.label,onInput:i=>r(i.target.value)};return t.kind==="textarea"?_("textarea",{rows:2,...a}):_("input",{type:t.kind,...a})},FR=({spec:t,visitor:e,onSubmit:r,onCancel:n})=>{const a=jr(),i=Lx(),[o,s]=W(()=>{const g={};for(const y of t.fields)y.identity&&e[y.identity]&&(g[y.key]=e[y.identity]);return g}),[l,c]=W("idle"),[u,f]=W(""),h=g=>!!(g.identity&&e[g.identity]?.trim()),d=t.fields.filter(g=>!h(g)),p=d.every(g=>!g.required||(o[g.key]?.trim()??"")!==""),m=e.email||e.name||"",v=async()=>{if(!p||l==="submitting")return;c("submitting");const g={},y={};for(const b of t.fields){const x=o[b.key]?.trim();x&&(g[b.key]=x,b.identity&&(y[b.identity]=x))}try{const b=await r(g,y);f(b.note||a.formThanks),c("done")}catch{c("error")}};return l==="done"?_("div",{class:"cf-form cf-form--done",children:[_(ci,{}),_("span",{children:u})]}):_("div",{class:"cf-form",ref:i,children:[_("div",{class:"cf-form__title",children:t.title}),d.length===0&&m&&_("div",{class:"cf-form__as",children:["as ",m]}),d.map(g=>_(zR,{field:g,value:o[g.key]??"",onInput:y=>s(b=>({...b,[g.key]:y}))},g.key)),l==="error"&&_("div",{class:"cf-form__err",children:a.formError}),_("div",{class:"cf-form__actions",children:[n&&_("button",{type:"button",class:"cf-form__cancel",onClick:n,children:"Cancel"}),_("button",{type:"button",class:"cf-form__submit",disabled:!p||l==="submitting",onClick:v,children:l==="submitting"?a.sending:t.submit})]})]})},Ex=t=>String(t).padStart(2,"0"),HR=()=>{const t=[];for(let e=9;e<=17;e++)t.push(`${Ex(e)}:00`),t.push(`${Ex(e)}:30`);return t},VR=t=>{const e=new Date;return e.setHours(0,0,0,0),Array.from({length:t},(r,n)=>{const a=new Date(e);return a.setDate(e.getDate()+n),a})},GR=(t,e)=>{const[r,n]=e.split(":").map(Number),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0);try{return new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"}).format(a)}catch{return`${t.toDateString()} ${e}`}},Eo=(t,e)=>{const[r,n]=e.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0)},WR=({visitor:t,onSubmit:e,onCancel:r,onDemoSlots:n,scheduler:a})=>{const i=jr(),o=Lx(),s=_r(()=>VR(14),[]),l=_r(()=>HR(),[]),c=_r(()=>{const J=Date.now();for(let le=0;le<s.length;le++)if(l.some(j=>Eo(s[le],j).getTime()>J))return le;return 0},[s,l]),[u,f]=W(c),[h,d]=W(null),[p,m]=W(t.name??""),[v,g]=W(t.email??""),[y,b]=W("idle"),[x,S]=W(""),[w,k]=W(""),[T,M]=W(""),A=a?.connected&&a.mode==="link",C=async()=>{if(y==="submitting"||!t.name?.trim()&&!p.trim()||!t.email?.trim()&&!v.trim())return;b("submitting"),k("");const J={};v.trim()&&(J.email=v.trim()),p.trim()&&(J.name=p.trim());try{const le=await e({...v.trim()?{visitorEmail:v.trim()}:{},...p.trim()?{visitorName:p.trim()}:{}},J),j=le.booking?.schedulingLink||a?.bookingLink||"";if(!j){b("error");return}try{window.open(j,"_blank","noopener,noreferrer")}catch{}M(j),S(le.note||i.bookingLinkOpened),b("done")}catch{b("error")}},[I,P]=W(new Set),[R,E]=W([]),[O,K]=W(0),[L,B]=W(!1);he(()=>{if(!n)return;let J=!0;const le=new Date,j=new Date;return j.setDate(j.getDate()+15),n(le.toISOString(),j.toISOString()).then(Q=>{J&&(P(new Set(Q.taken.map(F=>Date.parse(F)).filter(F=>!Number.isNaN(F)))),E(Q.busy.map(F=>[Date.parse(F.start),Date.parse(F.end)]).filter(([F,ie])=>!Number.isNaN(F)&&!Number.isNaN(ie))))}).catch(()=>{}),()=>{J=!1}},[n,O]);const V=!!t.email?.trim(),$=!!t.name?.trim(),X=!!h&&($||p.trim()!=="")&&(V||v.trim()!==""),ue=t.email||t.name||"",_e=J=>I.has(Eo(s[u],J).getTime()),Te=J=>Eo(s[u],J).getTime()<=Date.now(),Ue=1800*1e3,We=J=>{const le=Eo(s[u],J).getTime(),j=le+Ue;return R.some(([Q,F])=>le<F&&j>Q)},Ye=async()=>{if(!X||y==="submitting"||!h)return;b("submitting"),B(!1),k("");const J=Eo(s[u],h),le=GR(s[u],h),j={};v.trim()&&(j.email=v.trim()),p.trim()&&(j.name=p.trim());try{const Q=await e({preferredAt:le,slotAt:J.toISOString(),...v.trim()?{visitorEmail:v.trim()}:{},...p.trim()?{visitorName:p.trim()}:{}},j);Q.booking?.confirmed?(S(Q.note||xc(i.bookingConfirmed,{when:le})),M(Q.booking.meetingUrl||Q.booking.eventLink||"")):S(Q.note||xc(i.bookingRequested,{when:le})),b("done")}catch(Q){if(Q?.status===409)P(F=>new Set(F).add(J.getTime())),d(null),B(!0),K(F=>F+1),b("idle");else{const F=Q?.message;k(F&&F.length<120?F:""),b("error")}}};return y==="done"?_("div",{class:"cf-form cf-form--done",children:[_(ci,{}),_("span",{children:x}),T&&_("a",{class:"cf-booking__link",href:T,target:"_blank",rel:"noopener noreferrer",children:[A?i.bookingOpenScheduler:i.bookingMeetingLink," ",_(wc,{})]})]}):A?_("div",{class:"cf-form cf-booking",ref:o,children:[_("div",{class:"cf-form__title",children:Io["book-demo"].title}),_("div",{class:"cf-booking__hint",children:xc(i.bookingViaProvider,{provider:a?.label??"the scheduler"})}),V?ue?_("div",{class:"cf-form__as",children:["as ",ue]}):null:_(Ce,{children:[!t.name?.trim()&&_("input",{class:"cf-form__input",type:"text",placeholder:`${i.handoffName} *`,value:p,"aria-label":i.handoffName,onInput:J=>m(J.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${i.handoffEmail} *`,value:v,"aria-label":i.handoffEmail,onInput:J=>g(J.target.value)})]}),y==="error"&&_("div",{class:"cf-form__err",children:w||i.formError}),_("div",{class:"cf-form__actions",children:[r&&_("button",{type:"button",class:"cf-form__cancel",onClick:r,children:i.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:y==="submitting"||!t.name?.trim()&&p.trim()===""||!V&&v.trim()==="",onClick:C,children:y==="submitting"?i.sending:i.bookingOpenScheduler})]})]}):_("div",{class:"cf-form cf-booking",ref:o,children:[_("div",{class:"cf-form__title",children:Io["book-demo"].title}),_("div",{class:"cf-booking__hint",children:[i.bookingPickTime," · ",_("span",{class:"cf-booking__dur",children:i.bookingDuration})]}),_("div",{class:"cf-booking__dates",role:"tablist","aria-label":"Pick a day",children:s.map((J,le)=>_("button",{type:"button",role:"tab","aria-selected":le===u,class:`cf-booking__date ${le===u?"is-selected":""}`,onClick:()=>{f(le),d(null)},children:[_("span",{class:"cf-booking__dow",children:J.toLocaleDateString(void 0,{weekday:"short"})}),_("span",{class:"cf-booking__dom",children:J.getDate()})]},le))}),_("div",{class:"cf-booking__slots",role:"listbox","aria-label":"Pick a time",children:l.map(J=>{const le=Te(J),j=We(J),Q=_e(J),F=Q||le||j;return _("button",{type:"button",role:"option","aria-selected":h===J,disabled:F,title:le?"Earlier today":j?"Busy on the calendar":Q?"Already booked":void 0,class:`cf-booking__slot ${h===J?"is-selected":""} ${F?"is-taken":""}`,onClick:()=>d(J),children:J},J)})}),L&&_("div",{class:"cf-form__err",children:i.bookingSlotTaken}),ue?_("div",{class:"cf-form__as",children:["as ",ue]}):null,!$&&_("input",{class:"cf-form__input",type:"text",placeholder:`${i.handoffName} *`,value:p,"aria-label":i.handoffName,onInput:J=>m(J.target.value)}),!V&&_(Ce,{children:_("input",{class:"cf-form__input",type:"email",placeholder:`${i.handoffEmail} *`,value:v,"aria-label":i.handoffEmail,onInput:J=>g(J.target.value)})}),y==="error"&&_("div",{class:"cf-form__err",children:w||i.formError}),_("div",{class:"cf-form__actions",children:[r&&_("button",{type:"button",class:"cf-form__cancel",onClick:r,children:i.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!X||y==="submitting",onClick:Ye,children:y==="submitting"?i.sending:Io["book-demo"].submit})]})]})},Ox=({actions:t,visitor:e,onSubmitForm:r,onDemoSlots:n,scheduler:a,exclude:i=[]})=>{const[o,s]=W(null),[l,c]=W(!1),u=(t??[]).map(d=>BR[d]).filter(d=>!!d&&!i.includes(d.type));if(u.length===0)return null;const f=()=>{s(null),c(!1)},h=()=>s(null);if(o==="book-demo")return _("div",{class:"cf-action-drawer is-open",role:"dialog","aria-label":"Book a demo",children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("span",{class:"cf-action-drawer__eyebrow",children:"Contact options"}),_("strong",{children:"Book a demo"})]}),_("button",{type:"button",class:"cf-action-drawer__close",onClick:h,children:_(kn,{})})]}),_(WR,{visitor:e,onCancel:h,onSubmit:(d,p)=>r("book-demo",d,p),onDemoSlots:n,scheduler:a})]});if(o){const d=u.find(p=>p.type===o);return _("div",{class:"cf-action-drawer is-open",role:"dialog","aria-label":d?.label??"Contact",children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("span",{class:"cf-action-drawer__eyebrow",children:"Contact options"}),_("strong",{children:d?.label??Io[o].title})]}),_("button",{type:"button",class:"cf-action-drawer__close",onClick:h,children:_(kn,{})})]}),_(FR,{spec:Io[o],visitor:e,onCancel:h,onSubmit:(p,m)=>r(o,p,m)})]})}return l?_("div",{class:"cf-action-drawer cf-action-drawer--menu",children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("span",{class:"cf-action-drawer__eyebrow",children:"Need help?"}),_("strong",{children:"Choose what you want to do"})]}),_("button",{type:"button",class:"cf-action-drawer__close",onClick:f,children:_(kn,{})})]}),_("div",{class:"cf-action-drawer__grid",children:u.map(({type:d,label:p,description:m,Icon:v})=>_("button",{type:"button",class:"cf-action-card",onClick:()=>s(d),children:[_("span",{class:"cf-action-card__icon",children:_(v,{})}),_("span",{class:"cf-action-card__copy",children:[_("strong",{children:p}),_("small",{children:m})]}),_(Po,{})]},d))}),_("p",{class:"cf-action-drawer__note",children:"We’ll ask for your full name and the best email or phone so the team can reach you."})]}):_("button",{type:"button",class:"cf-action-trigger",onClick:()=>c(!0),children:[_("span",{class:"cf-action-trigger__icon",children:_(Wd,{})}),_("span",{class:"cf-action-trigger__copy",children:[_("strong",{children:"Contact options"}),_("small",{children:"Demo, message, callback"})]}),_(Po,{})]})},$R=({hasEmail:t,visitor:e,question:r,onSubmitForm:n})=>{const a=jr(),[i,o]=W(!1),[s,l]=W(!1),[c,u]=W(e.name??""),[f,h]=W(e.email??"");if(t)return _("div",{class:"cf-handoff cf-handoff--done",children:[_(ci,{}),_("span",{children:"We’ve alerted the team. If someone is available, they can continue here."})]});if(i){const p=e.email||f;return _("div",{class:"cf-handoff cf-handoff--done",children:[_(ci,{}),_("span",{children:xc(a.handoffShared,{email:p})})]})}const d=async()=>{if(!(!f.trim()||s)){l(!0);try{await n("inquiry",{visitorEmail:f.trim(),...c.trim()?{visitorName:c.trim()}:{},message:r||"I had a question the assistant couldn’t answer.",subject:"Help request from chat"},{email:f.trim(),name:c.trim()||void 0}),o(!0)}catch{l(!1)}}};return _("div",{class:"cf-handoff",children:[_("div",{class:"cf-handoff__title",children:a.handoffTitle}),_("input",{class:"cf-form__input",type:"text",placeholder:a.handoffName,value:c,"aria-label":a.handoffName,onInput:p=>u(p.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:f,"aria-label":a.handoffEmail,onInput:p=>h(p.target.value)}),_("button",{type:"button",class:"cf-form__submit",disabled:!f.trim()||s,onClick:d,children:s?a.sending:a.handoffNotify})]})},UR=({text:t})=>{const e=jr(),[r,n]=W(!1);return _("button",{type:"button",class:"cf-tool",onClick:async()=>{try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),1500)}catch{}},"aria-label":e.copy,children:[r?_(ci,{}):_(dR,{}),r?e.copied:e.copy]})},YR=({items:t,onPick:e})=>t.length===0?null:_("div",{class:"cf-starters",children:t.map((r,n)=>_("button",{type:"button",class:"cf-starter",onClick:()=>e(r),children:r},n))}),qR=({items:t})=>{const e=t.filter(r=>r.label.trim()&&r.url.trim()).slice(0,4);return e.length===0?null:_("div",{class:"cf-featured-links",children:e.map((r,n)=>_("a",{class:"cf-featured-link",href:r.url,target:"_blank",rel:"noopener noreferrer nofollow",title:r.label,children:[_(wc,{}),_("span",{children:r.label})]},`${r.url}-${n}`))})},XR=({msg:t,onRate:e})=>{const r=jr(),[n,a]=W(!1),[i,o]=W(""),s=t.feedback,l=()=>{e(t.id,"up"),a(!1)},c=()=>{e(t.id,"down"),a(!0)},u=()=>{e(t.id,"down",i.trim()),a(!1)};return _("div",{class:"cf-feedback",children:[_("div",{class:"cf-feedback__row",children:[_("button",{type:"button",class:`cf-feedback__btn ${s==="up"?"is-active":""}`,"aria-label":r.feedbackHelpful,"aria-pressed":s==="up",onClick:l,children:_(Dx,{})}),_("button",{type:"button",class:`cf-feedback__btn ${s==="down"?"is-active":""}`,"aria-label":r.feedbackNotHelpful,"aria-pressed":s==="down",onClick:c,children:_(Ix,{})}),s&&!n&&_("span",{class:"cf-feedback__thanks",children:r.feedbackThanks})]}),n&&s==="down"&&_("div",{class:"cf-feedback__comment",children:[_("textarea",{class:"cf-feedback__input",rows:2,placeholder:r.feedbackCommentPlaceholder,value:i,onInput:f=>o(f.target.value)}),_("button",{type:"button",class:"cf-feedback__send",onClick:u,children:r.feedbackSend})]})]})},ZR=({msg:t,persona:e,isLast:r,visitor:n,hasEmail:a,lastQuestion:i,showActions:o,onPickReply:s,onSubmitForm:l,onDemoSlots:c,onRetry:u,ratable:f,onRate:h,onExpandVisualization:d})=>{const p=jr(),m=t.role==="user",v=t.liveEventType??"",g=t.content.trim().toLowerCase(),y=v==="handoff_queued"||v==="agent_joined"||v==="agent_left"||v==="conversation_ended"||g.includes("joined the chat")||g.includes("left the chat")||g.includes("support agents will be with you"),b=t.role==="system"||y,x=t.requestedContactFields?.includes("email")===!0,S=r&&!m&&!b&&!!(t.handoffOffered||x),w=S&&!a?["inquiry"]:[],k=!t.pending&&!t.streaming;return b?_("div",{class:"cf-msg cf-msg--system",children:_("div",{class:"cf-system-event",children:[_("div",{class:"cf-system-event__mark","aria-hidden":"true"}),_("div",{class:"cf-system-event__text",children:t.content}),t.createdAt&&_("div",{class:"cf-system-event__time",children:new Date(t.createdAt).toLocaleString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"})})]})}):_("div",{class:`cf-msg cf-msg--${m?"user":"agent"}`,children:[!m&&_(Rx,{persona:e,small:!0}),_("div",{class:"cf-msg__col",children:[t.pending&&t.content===""?_(LR,{}):t.imageUrl?_("div",{class:"cf-msg__bubble cf-msg__bubble--media",children:[_("img",{class:"cf-msg__media",src:t.imageUrl,alt:"GIF"}),t.content&&_("span",{class:"cf-msg__caption",children:t.content})]}):_("div",{class:"cf-msg__bubble",children:[m?t.content:kR(t.content),t.streaming&&_("span",{class:"cf-caret","aria-hidden":"true"})]}),!m&&t.visualization?_(Nx,{visualization:t.visualization,onExpand:d?()=>d(t.id):void 0,expandControlId:t.id}):null,!m&&t.visualization?.explanation?_(DR,{explanation:t.visualization.explanation,onFollowUp:s,showLead:!t.content.toLocaleLowerCase().includes(t.visualization.explanation.headline.toLocaleLowerCase())}):null,m&&t.attachmentName&&_("div",{class:"cf-attach-chip",title:t.attachmentName,children:[_($d,{}),_("span",{children:t.attachmentName})]}),!m&&_(Ce,{children:[k&&(t.error||t.content)&&_("div",{class:"cf-msg__actions",children:[_("div",{class:"cf-msg__tools",children:t.error?_("button",{type:"button",class:"cf-tool",onClick:()=>u(t.id,t.retryText??""),children:[_(pR,{}),p.retry]}):_(UR,{text:t.content})}),f&&!t.error&&t.content&&_(XR,{msg:t,onRate:h})]}),_(ER,{msg:t}),r&&_(OR,{replies:t.suggestedReplies,onPick:s}),S&&_($R,{hasEmail:a,visitor:n,question:i,onSubmitForm:l}),o&&_(Ox,{actions:t.availableActions,visitor:n,onSubmitForm:l,onDemoSlots:c,scheduler:e?.scheduler,exclude:w})]})]})]})},Nx=({visualization:t,expanded:e=!1,onExpand:r,onClose:n,expandControlId:a})=>{const i=_r(()=>Hd(t),[t]),[o,s]=W(i?.type);he(()=>s(i?.type),[i]);const l=_r(()=>ZL(t),[t]),c=_r(()=>Hd(t,o),[o,t]),u=t.rows??[],f=t.columns?.length?t.columns:Object.keys(u[0]??{}),h=f.map(v=>{const g=t.columnMetadata?.find(y=>y.key===v);return g?{key:v,label:g.label,dataType:g.dataType,currencyCode:g.currencyCode}:v});if(u.length===0)return _(AR,{});const d=_(CR,{answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??u.length}),p=()=>t.tableAvailable===!1||f.length===0?null:_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:t.title?.trim()||"Result details"}),d]}),_("div",{class:"cf-analytics-visualization__actions",children:[t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Bx(f,u),children:"Download"}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(kn,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand table","data-visualization-message":a,onClick:r,children:_(Yd,{})}):null]})]}),_(eR,{rows:u,columns:h,maxRows:100,expanded:e,classPrefix:"cf"})]});if(t.presentation==="table"||!t.presentation&&t.type==="table")return p();const m=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??f[1];if(t.presentation==="kpi"||!t.presentation&&t.type==="kpi"){const v=u[0]?.[m??f[0]??""],g=typeof v=="number"?v:Number(v),y=t.columnMetadata?.find(x=>x.key===m),b=Number.isFinite(g)?Do(g,y,t):String(v??"No value");return _("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:"Live metric"}),d]}),e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(kn,{})}):null]}),_(MR,{label:y?.label??m??"Current value",value:b,detail:t.explanation?.summary})]})}return c?_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:c.title}),d]}),_("div",{class:"cf-analytics-visualization__actions",children:[l.length>1?_("label",{class:"cf-analytics-chart-picker",children:[_("span",{children:"Chart"}),_("select",{"aria-label":"Chart type",value:o??c.type,onChange:v=>s(v.currentTarget.value),children:l.map(v=>_("option",{value:v.type,children:v.label},v.type))})]}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(kn,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand chart","data-visualization-message":a,onClick:r,children:_(Yd,{})}):null]})]}),_(QL,{model:c,expanded:e}),_("p",{class:"cf-analytics-chart__summary",children:c.summary}),t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Bx(f,u),children:"Download this data"}):null]}):p()},Bx=(t,e)=>{if(typeof document>"u"||t.length===0)return;const r=JL(e,t),n=URL.createObjectURL(new Blob([r],{type:"text/csv;charset=utf-8"})),a=document.createElement("a");a.href=n,a.download="analytics-result.csv",a.click(),URL.revokeObjectURL(n)},zx=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result).split(",")[1]??""),n.onerror=r,n.readAsDataURL(t)}),KR=({onPick:t})=>_("div",{class:"cf-picker cf-emoji",children:rR.map(e=>_("div",{class:"cf-emoji__group",children:[_("div",{class:"cf-emoji__label",children:e.name}),_("div",{class:"cf-emoji__grid",children:e.emojis.map((r,n)=>_("button",{type:"button",class:"cf-emoji__btn",onClick:()=>t(r),"aria-label":r,children:r},n))})]},e.name))}),jR=({onSearch:t,onPick:e})=>{const r=jr(),[n,a]=W(""),[i,o]=W([]),[s,l]=W(!0);return he(()=>{let c=!0;l(!0);const u=setTimeout(()=>{t(n).then(f=>c&&(o(f),l(!1))).catch(()=>c&&(o([]),l(!1)))},300);return()=>{c=!1,clearTimeout(u)}},[n,t]),_("div",{class:"cf-picker cf-gif",children:[_("input",{class:"cf-gif__search",placeholder:r.searchGifs,value:n,"aria-label":r.searchGifs,onInput:c=>a(c.target.value)}),_("div",{class:"cf-gif__grid",children:s?_("div",{class:"cf-gif__hint",children:r.searchingGifs}):i.length===0?_("div",{class:"cf-gif__hint",children:r.noGifs}):i.map(c=>_("button",{type:"button",class:"cf-gif__item",onClick:()=>e(c.url),"aria-label":c.alt,children:_("img",{src:c.preview,alt:c.alt,loading:"lazy"})},c.id))}),_("div",{class:"cf-gif__powered",children:"via Tenor"})]})},QR=8*1024*1024,JR="image/png,image/jpeg,image/webp,image/gif,application/pdf",e5=12e3,t5=250,r5=t=>{switch(t){case"connecting":return"Connecting with AI…";case"listening":return"Listening now — go ahead.";case"speaking":return"AI is speaking — talk to interrupt.";case"processing":return"Understanding what you said…";case"noise":return"I couldn't hear clear words. Try again closer to the mic.";case"misunderstood":return"I didn't understand that. Please try again.";case"denied":return"Microphone access is blocked. Allow the mic or type your question.";case"muted":return"Muted — tap the mic to unmute.";case"timeout":return"Didn't hear anything for a while — ending the call.";default:return""}},n5=.004,Fx=({muted:t,listening:e,micLevel:r,onToggleMute:n})=>{const a=e&&r>=n5;return _("button",{type:"button",class:`cf-call-btn ${t?"is-muted":""} ${e?"is-listening":""} ${a?"is-hot":""}`,"aria-label":t?"Unmute microphone":"Mute microphone","aria-pressed":t,onClick:n,style:e?{"--cf-wave":String(Math.max(.2,Math.min(1,r*6)))}:void 0,children:t?_(sR,{}):_(Lo,{})})},a5=({audioDevices:t,selectedAudioDeviceId:e,onSelectAudioDevice:r})=>{const[n,a]=W(!1),i=q(null);he(()=>{if(!n)return;const s=l=>{i.current&&!l.composedPath().includes(i.current)&&a(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const o=[{deviceId:"",label:"Default microphone"},...t];return _("div",{class:"cf-call-more",ref:i,children:[_("button",{type:"button",class:"cf-call-btn cf-call-btn--microphones","aria-label":"Choose microphone","aria-expanded":n,onClick:()=>a(s=>!s),children:_(Po,{})}),n&&_("div",{class:"cf-call-menu",role:"menu",children:[_("div",{class:"cf-call-menu__label",children:"Microphone"}),o.map(s=>_("button",{type:"button",role:"menuitemradio","aria-checked":s.deviceId===e,class:`cf-call-menu__item ${s.deviceId===e?"is-active":""}`,onClick:()=>{r(s.deviceId),a(!1)},children:[s.deviceId===e?_(ci,{}):_("span",{class:"cf-call-menu__spacer"}),_("span",{children:s.label})]},s.deviceId))]})]})},i5=({voiceState:t,muted:e,onToggleMute:r,onEndCall:n,onTalkNow:a,showTalkNow:i,micLevel:o,theaterMode:s,onToggleTheater:l,onMinimize:c,audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h})=>_("div",{class:"cf-call-controls",children:[_(Fx,{muted:e,listening:t==="listening"&&!e,micLevel:o,onToggleMute:r}),_(a5,{audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h}),i&&_("button",{type:"button",class:"cf-call-btn cf-call-btn--talk","aria-label":"Talk now",onClick:a,children:_(Lo,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":s?"Exit expanded view":"Expand view","aria-pressed":s,onClick:l,children:s?_(mR,{}):_(Yd,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":"Minimize voice chat",onClick:c,children:_(yR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:n,children:_(Ud,{})})]}),o5=({persona:t,voiceState:e,muted:r,onToggleMute:n,onEndCall:a,micLevel:i,onExpand:o})=>{const s=h=>h.stopPropagation(),l=t?.assistantMediaUrl?.trim()||t?.agentAvatarUrl?.trim()||"",c=t?.assistantMediaKind==="video"&&!!l,u=t?.agentName||"Assistant",f=["cf-floating-call-card",e==="listening"&&!r?"is-listening":"",e==="speaking"?"is-speaking":"",e==="processing"||e==="connecting"?"is-thinking":"",r?"is-muted":""].filter(Boolean).join(" ");return _("div",{class:f,style:e==="listening"&&!r?{"--cf-listen":String(Math.max(.18,Math.min(1,i*8)))}:void 0,role:"button",tabIndex:0,"aria-label":`Reopen voice chat with ${u}`,onClick:o,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o())},children:[_("div",{class:"cf-floating-call-card__media","aria-hidden":"true",children:l?c?_("video",{src:l,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):_("img",{src:l,alt:""}):_("div",{class:`cf-floating-call-card__avatar${Ro(t)}`,children:[_("span",{children:Sc(t)}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--left"}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--right"}),_("span",{class:"cf-floating-call-card__mouth"})]})}),_("div",{class:"cf-floating-call-card__shade","aria-hidden":"true"}),_("div",{class:"cf-floating-call-card__controls",onClick:s,onKeyDown:s,role:"presentation",children:[_(Fx,{muted:r,listening:e==="listening"&&!r,micLevel:i,onToggleMute:n}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--restore","aria-label":"Restore voice chat",onClick:h=>{s(h),o()},children:_(_R,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:h=>{s(h),a()},children:_(Ud,{})})]})]})},s5=({onSend:t,onSendGif:e,onTyping:r,disabled:n,allowVoice:a,onTranscribe:i,gifEnabled:o,onSearchGifs:s,allowAttach:l,onExtract:c,voiceStartSignal:u=0,onVoiceStateChange:f})=>{const h=jr(),[d,p]=W(""),[m,v]=W(!1),[g,y]=W(!1),[b,x]=W("idle"),[S,w]=W("none"),[k,T]=W(null),[M,A]=W(!1),[C,I]=W(""),P=q(null),R=q(null),E=q(null),O=q(null),K=q([]),L=q(void 0),B=q(null),V=q(void 0),$=q(0),X=F=>{x(F),f?.(F)},ue=()=>{L.current&&window.clearTimeout(L.current),L.current=void 0,V.current&&cancelAnimationFrame(V.current),V.current=void 0,B.current?.close().catch(()=>{}),B.current=null};he(()=>{const F=P.current;F&&(F.style.height="auto",F.style.height=`${Math.min(F.scrollHeight,110)}px`)},[d]),he(()=>{if(S==="none")return;const F=ie=>{R.current&&!ie.composedPath().includes(R.current)&&w("none")};return document.addEventListener("mousedown",F),()=>document.removeEventListener("mousedown",F)},[S]);const _e=F=>w(ie=>ie===F?"none":F),Te=F=>{const ie=P.current;if(!ie){p(rt=>rt+F);return}const ge=ie.selectionStart??d.length,Se=ie.selectionEnd??d.length;p(d.slice(0,ge)+F+d.slice(Se)),requestAnimationFrame(()=>{ie.focus();const rt=ge+F.length;ie.setSelectionRange(rt,rt)})},Ue=F=>{w("none"),e(F)},We=async F=>{const ie=F.target,ge=ie.files?.[0];if(ie.value="",!!ge){if(I(""),ge.size>QR){I(h.attachTooLarge);return}A(!0);try{const Se=await zx(ge),rt=await c(Se,ge.type||"application/octet-stream",ge.name);if(!rt){I(h.attachFailed);return}T({name:ge.name,text:rt})}catch{I(h.attachFailed)}finally{A(!1)}}},Ye=(!!d.trim()||!!k)&&!n&&!M&&!g,J=()=>{Ye&&(t(d,k?{attachmentName:k.name,attachmentText:k.text}:void 0),r?.(!1),p(""),T(null),I(""))},le=F=>{const ie=F.trim();if(!ie||n){X("misunderstood"),window.setTimeout(()=>X("idle"),2500);return}const ge=d.trim(),Se=ge?`${ge} ${ie}`:ie;t(Se),r?.(!1),p(""),T(null),I(""),X("idle")},j=F=>{F.key==="Enter"&&!F.shiftKey?(F.preventDefault(),J()):F.key==="Escape"&&S!=="none"&&(F.preventDefault(),F.stopPropagation(),w("none"))},Q=async()=>{if(m){Rr(O.current);return}try{X("connecting");const F=await navigator.mediaDevices.getUserMedia({audio:!0}),ie=Vd(F);K.current=[],$.current=0;try{const ge=window.AudioContext??window.webkitAudioContext;if(ge){const Se=new ge;B.current=Se;const rt=Se.createMediaStreamSource(F),fr=Se.createAnalyser();fr.fftSize=512,rt.connect(fr);const er=new Uint8Array(fr.frequencyBinCount),tr=()=>{fr.getByteTimeDomainData(er);let ut=0;for(const hr of er){const zt=(hr-128)/128;ut+=zt*zt}$.current=Math.max($.current,Math.sqrt(ut/er.length)),V.current=requestAnimationFrame(tr)};tr()}}catch{}ie.ondataavailable=ge=>ge.data.size>0&&K.current.push(ge.data),ie.onstop=async()=>{ue(),F.getTracks().forEach(Se=>Se.stop()),v(!1);const ge=new Blob(K.current,{type:ie.mimeType||"audio/webm"});if(ge.size===0||ge.size<900||$.current<.006){X("noise"),window.setTimeout(()=>X("idle"),3200);return}y(!0),X("processing");try{const Se=await zx(ge);if(!Se.trim()){X("noise"),window.setTimeout(()=>X("idle"),3200);return}const rt=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0,fr=await i(Se,ge.type,rt);le(fr)}catch{X("misunderstood"),window.setTimeout(()=>X("idle"),3e3)}finally{y(!1)}},O.current=ie,ie.start(t5),v(!0),X("listening"),L.current=window.setTimeout(()=>{Rr(O.current)},e5)}catch{X("denied"),window.setTimeout(()=>X("idle"),3500)}};return he(()=>{!u||!a||n||m||g||Q()},[u]),he(()=>()=>ue(),[]),_("div",{class:"cf-composer",ref:R,children:[S==="emoji"&&_(KR,{onPick:Te}),S==="gif"&&_(jR,{onSearch:s,onPick:Ue}),(k||M||C)&&_("div",{class:"cf-attach-row",children:M?_("span",{class:"cf-attach-status",children:h.attaching}):C?_("span",{class:"cf-attach-status cf-attach-status--err",children:C}):k&&_("span",{class:"cf-attach-chip",title:k.name,children:[_($d,{}),_("span",{children:k.name}),_("button",{type:"button",class:"cf-attach-x","aria-label":"Remove attachment",onClick:()=>T(null),children:_(kn,{})})]})}),b!=="idle"&&_("div",{class:"cf-voice-state","aria-live":"polite",children:[_("span",{class:`cf-voice-state__dot ${m?"is-live":""}`}),r5(b)]}),_("div",{class:"cf-composer__field",children:[_("button",{type:"button",class:`cf-iconbtn ${S==="emoji"?"is-active":""}`,"aria-label":h.emoji,"aria-pressed":S==="emoji",onClick:()=>_e("emoji"),children:S==="emoji"?_(kn,{}):_(uR,{})}),o&&_("button",{type:"button",class:`cf-iconbtn cf-gifbtn ${S==="gif"?"is-active":""}`,"aria-label":h.gifs,"aria-pressed":S==="gif",onClick:()=>_e("gif"),children:_("span",{class:"cf-gif-label",children:"GIF"})}),l&&_(Ce,{children:[_("input",{ref:E,type:"file",class:"cf-file-input",accept:JR,onChange:We,tabIndex:-1,"aria-hidden":"true"}),_("button",{type:"button",class:"cf-iconbtn","aria-label":h.attachFile,disabled:M,onClick:()=>E.current?.click(),children:_($d,{})})]}),_("textarea",{ref:P,class:"cf-textarea",rows:1,placeholder:h.composerPlaceholder,value:d,"aria-label":h.composerPlaceholder,disabled:n,onInput:F=>{const ie=F.target.value;p(ie),r?.(!!ie.trim())},onKeyDown:j}),a&&_("button",{type:"button",class:`cf-iconbtn cf-mic ${m?"is-recording":""}`,"aria-label":m?h.stopRecording:h.recordVoice,"aria-pressed":m,disabled:g||n,onClick:Q,children:_(Lo,{})}),_("button",{type:"button",class:"cf-send","aria-label":h.send,disabled:!Ye,onClick:J,children:_(oR,{})})]})]})};let Hx=!0,Oo=null;const l5=t=>{Hx=t},c5=()=>{const t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;if(!Oo)try{Oo=new t}catch{return null}return Oo.state==="suspended"&&Oo.resume(),Oo},No=(t,e,r,n,a,i)=>{const o=t.createOscillator(),s=t.createGain();o.type=a,o.frequency.setValueAtTime(e,r),o.connect(s),s.connect(t.destination),s.gain.setValueAtTime(1e-4,r),s.gain.exponentialRampToValueAtTime(i,r+.012),s.gain.exponentialRampToValueAtTime(1e-4,r+n),o.start(r),o.stop(r+n+.03)},fi=t=>{if(!Hx)return;const e=c5();if(!e)return;const r=e.currentTime;try{t==="open"?(No(e,523,r,.12,"sine",.05),No(e,784,r+.08,.16,"sine",.05)):t==="send"?No(e,660,r,.08,"triangle",.04):t==="receive"&&(No(e,880,r,.1,"sine",.045),No(e,1175,r+.09,.14,"sine",.045))}catch{}},u5=(t,e)=>t?.status===429?e.errorRateLimit:e.errorGeneric,f5=/!?\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,h5=/https?:\/\/[^\s)]+/g,d5=t=>t.replace(/```[\s\S]*?```/g,e=>e.replace(/^```[^\n]*\n?/,"").replace(/```$/,"").trim()),p5=t=>d5(t).replace(f5,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/(^|[\s([{])\*([^*\n]{1,120})\*(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/(^|[\s([{])_([^_\n]{1,120})_(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}[-*+]\s+/gm,"").replace(/^\s{0,3}\d+\.\s+/gm,"").replace(/\s+\*/g," ").replace(/\*\s+/g," ").replace(/[*_]{2,}/g,"").replace(h5,e=>e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")).replace(/[ \t]+\n/g,`
|
|
27
|
+
`)})},n++));continue}if(i.trim()===""){a++;continue}const o=/^(#{1,6})\s+(.*)$/.exec(i);if(o){r.push(GR(o[1].length,Ci(o[2]),n++)),a++;continue}if(/^\s*[-*•]\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*[-*•]\s+/.test(e[a]);)u.push(_("li",{children:Ci(e[a].replace(/^\s*[-*•]\s+/,""))},u.length)),a++;r.push(_("ul",{class:"cf-md-list",children:u},n++));continue}if(/^\s*\d+\.\s+/.test(i)){const u=[];for(;a<e.length&&/^\s*\d+\.\s+/.test(e[a]);)u.push(_("li",{children:Ci(e[a].replace(/^\s*\d+\.\s+/,""))},u.length)),a++;r.push(_("ol",{class:"cf-md-list",children:u},n++));continue}const s=[i];for(a++;a<e.length&&e[a].trim()!==""&&!VR.test(e[a]);)s.push(e[a]),a++;const l=s.join(" ");if(/:\s*$/.test(l)&&a<e.length&&/^(?:\s*[-*•]\s+|\s*\d+\.\s+)/.test(e[a])){const u=/^(.*[.!?])\s+([^.!?]{2,120}:)$/.exec(l);u&&r.push(_("p",{children:Ci(u[1])},n++)),r.push(_("p",{class:"cf-md-list-intro",children:Ci(u?.[2]??l)},n++))}else r.push(_("p",{children:Ci(l)},n++))}return r},WR=t=>{const e=(t??"").trim().toLowerCase().replaceAll("-","_");return e==="low"||e==="low_quality"?"Low-confidence forecast":e==="medium"||e==="directional"?"Directional forecast":e==="high"||e==="validated"||e==="trusted"?"Validated forecast":"Forecast estimate"},UR=t=>{if(!t)return"Live data";const e=new Date(t);return Number.isNaN(e.getTime())?"Live data":`Updated ${new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(e)}`},YR=({answeredAt:t,reportingPeriod:e,filters:r=[],rowCount:n})=>_("div",{class:"cf-analytics-meta","data-testid":"analytics-result-meta","aria-label":"Result details",children:[_("span",{children:[_("span",{"aria-hidden":"true",class:"cf-analytics-meta__dot"}),UR(t)]}),e?.label?_("span",{children:e.label}):null,typeof n=="number"?_("span",{children:[n," ",n===1?"row":"rows"]}):null,r.length>0?_("span",{children:[r.length," applied ",r.length===1?"filter":"filters"]}):null]}),qR=({label:t,value:e})=>_("section",{class:"cf-analytics-kpi","aria-label":t,"data-testid":"analytics-kpi",children:[_("div",{class:"cf-analytics-kpi__label",children:t}),_("div",{class:"cf-analytics-kpi__value",children:e})]}),XR=({title:t="No matching data",description:e="No approved records matched this question."})=>_("section",{class:"cf-analytics-empty",role:"status","data-testid":"analytics-empty-state",children:[_("p",{children:t}),_("p",{children:e})]}),ZR=t=>t==="line"?"Best for change over time.":t==="stacked_bar"?"Compare totals and their parts.":"Compare categories or ranked values.",Ux=({type:t,className:e="cf-chart-type-icon"})=>t==="line"?_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 25h21M6 7v18",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),_("path",{d:"M8 21c4-7 7 2 11-6 2.5-5 4.5-2 7-7",fill:"none",stroke:"#2563EB","stroke-width":"2.1","stroke-linecap":"round","stroke-linejoin":"round"})]}):t==="stacked_bar"?_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 26h21M6 7v19",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),[9,15,21].map((r,n)=>_("g",{children:[_("rect",{x:r,y:18-n*2,width:"4",height:8+n*2,fill:"#2563EB",rx:"0.6"}),_("rect",{x:r,y:13-n,width:"4",height:"5",fill:"#F59E0B",rx:"0.6"}),_("rect",{x:r,y:9-n,width:"4",height:"4",fill:"#22C55E",rx:"0.6"})]},r))]}):_("svg",{viewBox:"0 0 32 32","aria-hidden":"true",class:e,children:[_("path",{d:"M6 26h21M6 7v19",fill:"none",stroke:"#6B7280","stroke-width":"1.4","stroke-linecap":"round","stroke-linejoin":"round"}),_("rect",{x:"9",y:"18",width:"4",height:"8",fill:"#2563EB",rx:"0.7"}),_("rect",{x:"15",y:"13",width:"4",height:"13",fill:"#2563EB",rx:"0.7"}),_("rect",{x:"21",y:"8",width:"4",height:"18",fill:"#2563EB",rx:"0.7"})]}),KR=({explanation:t,onFollowUp:e,showLead:r=!1,maxFollowUps:n=3})=>_("section",{class:"cf-analytics-explanation","data-testid":"inline-analytics-explanation","aria-label":"Analysis and supporting evidence",children:[r?_("div",{class:"cf-analytics-explanation__lead","data-testid":"analytics-explanation-lead",children:[t.conversationalPreface?_("p",{class:"cf-analytics-explanation__summary",children:t.conversationalPreface}):null,_("div",{class:"cf-analytics-explanation__lead-meta",children:[_("span",{class:"cf-analytics-explanation__eyebrow",children:"Answer from your data"}),_("span",{class:"cf-analytics-explanation__provenance",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__provenance-dot"}),t.source==="ai_grounded"?"AI-assisted · evidence checked":"Based on current values"]})]}),_("h3",{class:"cf-analytics-explanation__headline",children:t.headline}),_("p",{class:"cf-analytics-explanation__summary",children:t.summary})]}):null,_("div",{class:"cf-analytics-explanation__body",children:[(t.evidence?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"What the numbers show"}),_("ul",{class:"cf-analytics-explanation__evidence",children:t.evidence?.slice(0,4).map(a=>_("li",{class:"cf-analytics-explanation__evidence-item",children:[_("span",{"aria-hidden":"true",class:"cf-analytics-explanation__evidence-bullet"}),_("span",{children:a})]},a))})]}):null,t.businessMeaning?_("section",{class:"cf-analytics-explanation__meaning",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Why this may matter"}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.businessMeaning})]}):null,(t.possibleDrivers?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("div",{class:"cf-analytics-explanation__section-heading",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Possibilities worth checking"}),_("span",{class:"cf-analytics-explanation__hint",children:"These are not proven causes"})]}),_("div",{class:"cf-analytics-explanation__drivers",children:t.possibleDrivers?.slice(0,2).map(a=>_("article",{class:"cf-analytics-explanation__driver",children:[_("p",{class:"cf-analytics-explanation__driver-title",children:a.hypothesis}),_("p",{class:"cf-analytics-explanation__driver-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"How to check:"})," ",a.howToCheck]})]},`${a.hypothesis}-${a.howToCheck}`))})]}):null,(t.recommendations?.length??0)>0?_("section",{class:"cf-analytics-explanation__section",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Useful next steps"}),_("div",{class:"cf-analytics-explanation__recommendations",children:t.recommendations?.slice(0,3).map((a,i)=>_("article",{class:"cf-analytics-explanation__recommendation",children:[_("span",{class:"cf-analytics-explanation__recommendation-index",children:i+1}),_("div",{children:[_("p",{class:"cf-analytics-explanation__recommendation-title",children:a.action}),_("p",{class:"cf-analytics-explanation__recommendation-body",children:a.why}),a.successMetric?_("p",{class:"cf-analytics-explanation__recommendation-body",children:[_("span",{class:"cf-analytics-explanation__driver-label",children:"Watch:"})," ",a.successMetric]}):null]})]},`${a.action}-${a.why}`))})]}):null,t.forecast?_("section",{class:"cf-analytics-explanation__outlook",children:[_("div",{class:"cf-analytics-explanation__outlook-header",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Outlook"}),_("span",{class:"cf-analytics-explanation__outlook-badge",children:WR(t.forecast.qualityStatus)})]}),_("p",{class:"cf-analytics-explanation__paragraph",children:t.forecast.text}),t.forecast.limitations?_("p",{class:"cf-analytics-explanation__recommendation-body",children:t.forecast.limitations}):null]}):null,e&&(t.followUps?.length??0)>0?_("section",{class:"cf-analytics-explanation__section cf-analytics-explanation__follow-up",children:[_("h4",{class:"cf-analytics-explanation__heading",children:"Ask a follow-up"}),_("div",{class:"cf-analytics-explanation__questions",children:t.followUps?.slice(0,n).map(a=>_("button",{type:"button",class:"cf-analytics-explanation__question",onClick:()=>e(a),children:a},a))})]}):null,(t.limitations?.length??0)>0?_("details",{class:"cf-analytics-explanation__limits",children:[_("summary",{class:"cf-analytics-explanation__limits-summary",children:"Important limits"}),_("ul",{class:"cf-analytics-explanation__limits-list",children:t.limitations?.map(a=>_("li",{children:a},a))})]}):null]}),_("p",{class:"cf-analytics-explanation__source",children:t.source==="ai_grounded"?"AI-assisted wording, checked against the live values shown here.":"Based only on the live values shown here."})]}),op=t=>t.explanation?.source==="ai_grounded"?t.explanation:t.businessAnalysis?.explanation??t.explanation,Yx=()=>{const t=W(null);return ie(()=>{const e=requestAnimationFrame(()=>t.current?.scrollIntoView?.({block:"end"}));return()=>cancelAnimationFrame(e)},[]),t},jR=t=>t.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"🤖",Zo=t=>{const e=t?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");return e?` cf-avatar-preset--${e}`:""},QR={"support-guide":"SG","sales-host":"SH","calm-advisor":"CA","technical-guide":"TG","school-desk":"SD","front-office":"FO"},Rc=t=>{const e=t?.avatarId?.trim().toLowerCase();return e&&QR[e]||(t?jR(t.agentName):"·")},qx=({persona:t,small:e,hideWhenMissing:r})=>{const n=e?"cf-msg__avatar":"cf-header__avatar",a=t?.agentAvatarUrl?.trim();return a?_("span",{class:n,children:_("img",{src:a,alt:""})}):r?null:_("span",{class:`${n}${Zo(t)}`,children:Rc(t)})},JR=()=>{const t=_r(),[e,r]=V(0),n=["Understanding your question","Checking approved information","Preparing your answer"];return ie(()=>{const a=[window.setTimeout(()=>r(1),1800),window.setTimeout(()=>r(2),5e3)];return()=>a.forEach(i=>window.clearTimeout(i))},[]),_("div",{class:"cf-msg__bubble cf-typing","aria-label":t.assistantTyping,children:[_("span",{class:"cf-typing__label","aria-live":"polite",children:n[e]}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"})]})},e5=3,t5=({msg:t})=>{if(!t.sources||t.sources.length===0)return null;const e=new Set,r=[];for(const i of t.sources){const o=(i.url||i.title||"").toLowerCase();!o||e.has(o)||(e.add(o),r.push(i))}if(r.length===0)return null;const n=r.slice(0,e5),a=r.length-n.length;return _("div",{class:"cf-sources",children:[n.map((i,o)=>i.url?_("a",{class:"cf-source",href:i.url,target:"_blank",rel:"noopener noreferrer nofollow",title:i.title||i.url,children:[_(Lc,{}),_("span",{children:i.title||i.url})]},o):_("span",{class:"cf-source",title:i.title,children:[_(Lc,{}),_("span",{children:i.title})]},o)),a>0&&_("span",{class:"cf-source cf-source--more",children:["+",a," more"]})]})},r5=({replies:t,onPick:e})=>t&&t.length>0?_("div",{class:"cf-chips",children:t.map((r,n)=>_("button",{type:"button",class:"cf-chip",onClick:()=>e(r),children:r},n))}):null,n5=({persona:t,starters:e,onPick:r,onFocusComposer:n,speaking:a,voiceState:i="idle",replyPending:o=!1,pinned:s=!1,muted:l=!1,onToggleMute:c,onEndCall:u,onTalkNow:f,showTalkNow:h=!1,micLevel:d=0,theaterMode:p=!1,onToggleTheater:m,onMinimize:g,audioDevices:v=[],selectedAudioDeviceId:y="",onSelectAudioDevice:b,connectingOnly:x=!1})=>{if(!t||!(t.talkbackMode==="avatar"||t.widgetModule==="assistant"||t.allowVoiceInput))return null;const w=t.agentAvatarUrl?.trim()||"",k=t.assistantMediaUrl?.trim()||w,T=t.assistantMediaKind==="video"&&!!k,C=e.slice(0,3),A=i!=="idle",M=i!=="idle"?"End voice chat":`Speak with ${t.agentName}`,I=s&&!A&&!a,L=i==="connecting"||i==="processing"||A&&o,P=["cf-assistant-card__stage","cf-assistant-card__stage--local",A?"is-live":"",L?"is-thinking":"",i==="listening"&&!l?"is-listening":"",a||i==="speaking"?"is-speaking":"",l?"is-muted":""].filter(Boolean).join(" "),N=i==="listening"&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,d*8)))}:void 0,O=L&&_("span",{class:"cf-call-ripple","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{})]});if(x)return _("div",{class:"cf-assistant-card cf-assistant-card--connecting","aria-live":"polite",children:[_("div",{class:"cf-assistant-card__connecting-avatar",children:[w?_("img",{src:w,alt:""}):_("span",{class:`cf-assistant-card__connecting-face${Zo(t)}`,children:Rc(t)}),O]}),_("div",{class:"cf-assistant-card__connecting-copy",children:[_("span",{class:"cf-assistant-card__connecting-eyebrow",children:t.agentName}),_("strong",{children:"Connecting with the AI…"})]})]});const q=A&&u&&_(P5,{voiceState:i,muted:l,onToggleMute:c??(()=>{}),onEndCall:u,onTalkNow:f??(()=>{}),showTalkNow:h,micLevel:d,theaterMode:p,onToggleTheater:m??(()=>{}),onMinimize:g??(()=>{}),audioDevices:v,selectedAudioDeviceId:y,onSelectAudioDevice:b??(()=>{})});return I?_("div",{class:"cf-assistant-card cf-assistant-card--pinned cf-assistant-card--compact",children:_("button",{type:"button",class:"cf-assistant-card__compact-speak",onClick:n,children:[w?_("span",{class:"cf-assistant-card__compact-avatar",children:_("img",{src:w,alt:""})}):null,_("span",{class:"cf-assistant-card__compact-mic","aria-hidden":"true",children:_(Xo,{})}),_("span",{class:"cf-assistant-card__compact-label",children:M})]})}):_("div",{class:`cf-assistant-card ${s?"cf-assistant-card--pinned":""} ${a?"is-speaking":""}`,children:[(k||t.allowVoiceInput)&&_("div",{class:P,style:N,children:[_("div",{class:`cf-assistant-card__media ${k?"cf-assistant-card__media--uploaded":"cf-assistant-card__media--generated"}${Zo(t)}`,children:[T?_("video",{src:k,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):k?_("img",{src:k,alt:""}):_("div",{class:`cf-assistant-card__avatar-stage${Zo(t)}`,children:_("div",{class:"cf-assistant-card__face",children:[_("span",{class:"cf-assistant-card__initials",children:Rc(t)}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--left"}),_("span",{class:"cf-assistant-card__eye cf-assistant-card__eye--right"}),_("span",{class:"cf-assistant-card__mouth"})]})}),k&&!T&&_("span",{class:"cf-assistant-card__mouth cf-assistant-card__mouth--overlay"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--one","aria-hidden":"true"}),_("span",{class:"cf-avatar-aura cf-avatar-aura--two","aria-hidden":"true"}),_("span",{class:"cf-avatar-listen-ring","aria-hidden":"true"}),_("span",{class:"cf-avatar-wave","aria-hidden":"true",children:[_("span",{}),_("span",{}),_("span",{}),_("span",{})]})]}),O,t.allowVoiceInput&&(q||_("button",{type:"button",class:"cf-assistant-card__speak",onClick:n,children:[_(Xo,{}),M]}))]}),!s&&_(Ae,{children:[t.agentDescription?_("p",{class:"cf-assistant-card__copy",children:t.agentDescription}):_("p",{class:"cf-assistant-card__copy",children:t.greeting}),C.length>0&&_("div",{class:"cf-assistant-card__chips",children:C.map(R=>_("button",{type:"button",class:"cf-assistant-card__chip",onClick:()=>r(R),children:R},R))}),t.disclaimerText||t.assistantPrivacyUrl?_("p",{class:"cf-assistant-card__privacy",children:[t.disclaimerText||"This chat may be recorded for quality and support.",t.assistantPrivacyUrl?_(Ae,{children:[" ",_("a",{href:t.assistantPrivacyUrl,target:"_blank",rel:"noopener noreferrer nofollow",children:"Privacy Policy"})]}):null]}):null]})]})},a5={calendar:MR,mail:Pc,phone:AR,lifebuoy:Pc},i5=t=>a5[t]??Pc,o5=t=>{if(t.id==="public_contact_support")return"contact-support";switch(t.endpoint){case"book-demo":return"book-demo";case"request-callback":return"request-callback";case"subscribe-newsletter":return"subscribe-newsletter";case"contact":return"contact";default:return"inquiry"}},s5={public_contact_support:{label:"Contact support",description:"Ask a teammate to join this conversation.",category:"support",icon:"lifebuoy",endpoint:"inquiry"},public_submit_inquiry:{label:"Leave a message",description:"Send your question and contact details.",category:"support",icon:"mail",endpoint:"inquiry"},public_book_demo:{label:"Book a demo",description:"Request a demo from the team.",category:"sales",icon:"calendar",endpoint:"book-demo"},public_request_callback:{label:"Request a callback",description:"Share your number and best time to call.",category:"sales",icon:"phone",endpoint:"request-callback"},public_subscribe_newsletter:{label:"Subscribe",description:"Get product updates.",category:"marketing",icon:"mail",endpoint:"subscribe-newsletter"}},l5=(t,e,r={})=>Array.isArray(t)?t.filter(n=>n.readiness!=="unavailable").map(n=>Xx(n,r[n.id])):(e??[]).flatMap(n=>{const a=s5[n];if(!a)return[];const i=o5({...a,id:n}),o=tp[i];return[{...a,id:n,presentation:i==="book-demo"?"booking":"form",formTitle:o.title,submitLabel:o.submit,fields:o.fields,delivery:"",prompt:"",shortLabel:a.label.toLowerCase(),enabled:!0,readiness:"available",legacyFallback:!0}]}).map(n=>Xx(n,r[n.id])),Xx=(t,e)=>{if(!e)return t;const r=e.fields??{};return{...t,...Object.fromEntries(Object.entries(e).filter(([n,a])=>n!=="fields"&&a!==void 0)),fields:t.fields.map(n=>({...n,...r[n.key]}))}},c5=(t,e)=>{const r=t.map(n=>n.label);return r.length===0?e.actionGetInTouch:r.length<=3?r.join(", "):`${r.slice(0,2).join(", ")} ${qt(e.actionMore,{count:String(r.length-2)})}`},u5=({field:t,value:e,onInput:r})=>{const n=t.placeholder??t.label,a={class:"cf-form__input",placeholder:t.required?`${n} *`:n,value:e,"aria-label":t.label,onInput:i=>r(i.target.value)};return t.kind==="textarea"?_("textarea",{rows:2,...a}):_("input",{type:t.kind,...a})},f5=({spec:t,visitor:e,onSubmit:r,onCancel:n})=>{const a=_r(),i=Yx(),[o,s]=V(()=>{const v={};for(const y of t.fields)y.identity&&e[y.identity]&&(v[y.key]=e[y.identity]);return v}),[l,c]=V("idle"),[u,f]=V(""),h=v=>!!(v.identity&&e[v.identity]?.trim()),d=t.fields.filter(v=>!h(v)),p=d.every(v=>!v.required||(o[v.key]?.trim()??"")!==""),m=e.email||e.name||"",g=async()=>{if(!p||l==="submitting")return;c("submitting");const v={},y={};for(const b of t.fields){const x=o[b.key]?.trim();x&&(v[b.key]=x,b.identity&&(y[b.identity]=x))}try{const b=await r(v,y);f(b.note||a.formThanks),c("done")}catch{c("error")}};return l==="done"?_("div",{class:"cf-form cf-form--done",children:[_(Ca,{}),_("span",{children:u})]}):_("div",{class:"cf-form",ref:i,children:[_("div",{class:"cf-form__title",children:t.title}),d.length===0&&m&&_("div",{class:"cf-form__as",children:qt(a.actionAs,{identity:m})}),d.map(v=>_(u5,{field:v,value:o[v.key]??"",onInput:y=>s(b=>({...b,[v.key]:y}))},v.key)),l==="error"&&_("div",{class:"cf-form__err",children:a.formError}),_("div",{class:"cf-form__actions",children:[n&&_("button",{type:"button",class:"cf-form__cancel",onClick:n,children:a.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!p||l==="submitting",onClick:g,children:l==="submitting"?a.sending:t.submit})]})]})},Zx=t=>String(t).padStart(2,"0"),h5=()=>{const t=[];for(let e=9;e<=17;e++)t.push(`${Zx(e)}:00`),t.push(`${Zx(e)}:30`);return t},d5=t=>{const e=new Date;return e.setHours(0,0,0,0),Array.from({length:t},(r,n)=>{const a=new Date(e);return a.setDate(e.getDate()+n),a})},p5=(t,e)=>{const[r,n]=e.split(":").map(Number),a=new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0);try{return new Intl.DateTimeFormat(void 0,{weekday:"short",day:"numeric",month:"short",year:"numeric",hour:"2-digit",minute:"2-digit",timeZoneName:"short"}).format(a)}catch{return`${t.toDateString()} ${e}`}},an=(t,e)=>{const[r,n]=e.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0)},v5=(t,e)=>{const r=an(t,e);try{return new Intl.DateTimeFormat(void 0,{hour:"numeric",minute:"2-digit"}).format(r)}catch{return e}},Kx=()=>{try{return Intl.DateTimeFormat().resolvedOptions().timeZone||""}catch{return""}},g5=({visitor:t,onSubmit:e,onCancel:r,onDemoSlots:n,scheduler:a,title:i,submitLabel:o})=>{const s=i?.trim()||tp["book-demo"].title,l=o?.trim()||tp["book-demo"].submit,c=_r(),u=Yx(),f=!!(a?.connected&&a.mode==="event"&&(a.availability===void 0||a.availability.calendarIds.length>0)),h=Math.min(60,Math.max(1,a?.availability?.bookingWindowDays??14)),d=Kt(()=>d5(h),[h]),[p,m]=V(null),[g,v]=V(f?"loading":"request_only"),[y,b]=V(a?.availability?.slotDurationMinutes??30),[x,S]=V(Kx()||a?.availability?.timezone||""),w=Kt(()=>f?g!=="available"||p===null?[]:[...new Set([...p].map(G=>{const oe=new Date(G);return`${String(oe.getHours()).padStart(2,"0")}:${String(oe.getMinutes()).padStart(2,"0")}`}))].sort():h5(),[p,g,f]),k=Kt(()=>{const G=Date.now();for(let oe=0;oe<d.length;oe++)if(w.some(_e=>an(d[oe],_e).getTime()>G))return oe;return 0},[d,w]),[T,C]=V(k),[A,M]=V(null),[I,L]=V(t.name??""),[P,N]=V(t.email??""),[O,q]=V("idle"),[R,z]=V(""),[F,X]=V("");ie(()=>{if(!f||g!=="available"||p===null)return;const G=d.findIndex(oe=>w.some(_e=>p.has(an(oe,_e).getTime())));G>=0&&C(G)},[p,g,d,f,w]);const te=a?.connected&&a.mode==="link",fe=async()=>{if(O==="submitting"||!t.name?.trim()&&!I.trim()||!t.email?.trim()&&!P.trim())return;q("submitting");const G={};P.trim()&&(G.email=P.trim()),I.trim()&&(G.name=I.trim());try{const oe=await e({...P.trim()?{visitorEmail:P.trim()}:{},...I.trim()?{visitorName:I.trim()}:{}},G),_e=oe.booking?.schedulingLink||a?.bookingLink||"";if(!_e){q("error");return}try{window.open(_e,"_blank","noopener,noreferrer")}catch{}X(_e),z(oe.note||c.bookingLinkOpened),q("done")}catch{q("error")}},[me,we]=V(new Set),[Ze,Ie]=V([]),[tt,Ge]=V(0),[Me,re]=V(!1);ie(()=>{if(!n)return;let G=!0;const oe=new Date,_e=new Date;return _e.setDate(_e.getDate()+h+1),n(oe.toISOString(),_e.toISOString()).then(Oe=>{if(G)if(we(new Set(Oe.taken.map(Ue=>Date.parse(Ue)).filter(Ue=>!Number.isNaN(Ue)))),Ie(Oe.busy.map(Ue=>[Date.parse(Ue.start),Date.parse(Ue.end)]).filter(([Ue,br])=>!Number.isNaN(Ue)&&!Number.isNaN(br))),b(Oe.slotDurationMinutes??30),S(Kx()||Oe.timezone||""),f){if(Oe.status!=="available"||!Array.isArray(Oe.available)){m(null),v("unavailable");return}m(new Set(Oe.available.map(Ue=>Date.parse(Ue)).filter(Ue=>!Number.isNaN(Ue)))),v("available")}else v(Oe.status??"request_only")}).catch(()=>{!G||!f||(m(null),v("unavailable"))}),()=>{G=!1}},[h,f,n,tt]);const he=!!t.email?.trim(),Be=!!t.name?.trim(),pe=!!A&&(!f||g==="available")&&(Be||I.trim()!=="")&&(he||P.trim()!==""),Se=t.email||t.name||"",ct=G=>me.has(an(d[T],G).getTime()),pt=G=>an(d[T],G).getTime()<=Date.now(),sn=y*60*1e3,cr=G=>{const oe=an(d[T],G).getTime(),_e=oe+sn;return Ze.some(([Oe,Ue])=>oe<Ue&&_e>Oe)},Y=G=>!f||p?.has(an(d[T],G).getTime())===!0,le=async()=>{if(!pe||O==="submitting"||!A)return;q("submitting"),re(!1);const G=an(d[T],A),oe=p5(d[T],A),_e={};P.trim()&&(_e.email=P.trim()),I.trim()&&(_e.name=I.trim());try{const Oe=await e({preferredAt:oe,slotAt:G.toISOString(),...P.trim()?{visitorEmail:P.trim()}:{},...I.trim()?{visitorName:I.trim()}:{}},_e);Oe.booking?.confirmed?(z(Oe.note||qt(c.bookingConfirmed,{when:oe})),X(Oe.booking.meetingUrl||Oe.booking.eventLink||"")):z(Oe.note||qt(c.bookingRequested,{when:oe})),q("done")}catch(Oe){Oe?.status===409?(we(Ue=>new Set(Ue).add(G.getTime())),M(null),re(!0),Ge(Ue=>Ue+1),q("idle")):q("error")}};return O==="done"?_("div",{class:"cf-form cf-form--done",children:[_(Ca,{}),_("span",{children:R}),F&&_("a",{class:"cf-booking__link",href:F,target:"_blank",rel:"noopener noreferrer",children:[te?c.bookingOpenScheduler:c.bookingMeetingLink," ",_(Lc,{})]})]}):te?_("div",{class:"cf-form cf-booking",ref:u,children:[_("div",{class:"cf-form__title",children:s}),_("div",{class:"cf-booking__hint",children:qt(c.bookingViaProvider,{provider:a?.label??c.bookingSchedulerFallback})}),he?Se?_("div",{class:"cf-form__as",children:qt(c.actionAs,{identity:Se})}):null:_(Ae,{children:[!t.name?.trim()&&_("input",{class:"cf-form__input",type:"text",placeholder:`${c.handoffName} *`,value:I,"aria-label":c.handoffName,onInput:G=>L(G.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${c.handoffEmail} *`,value:P,"aria-label":c.handoffEmail,onInput:G=>N(G.target.value)})]}),O==="error"&&_("div",{class:"cf-form__err",children:c.formError}),_("div",{class:"cf-form__actions",children:[r&&_("button",{type:"button",class:"cf-form__cancel",onClick:r,children:c.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:O==="submitting"||!t.name?.trim()&&I.trim()===""||!he&&P.trim()==="",onClick:fe,children:O==="submitting"?c.sending:c.bookingOpenScheduler})]})]}):_("div",{class:"cf-form cf-booking",ref:u,children:[_("div",{class:"cf-form__title",children:s}),_("div",{class:"cf-booking__hint",children:[c.bookingPickTime," ·"," ",_("span",{class:"cf-booking__dur",children:qt(c.bookingDuration,{count:String(y)})}),x?` · ${qt(c.bookingTimezone,{timezone:x})}`:""]}),f&&g==="loading"?_("div",{class:"cf-booking__state",role:"status",children:c.bookingCheckingAvailability}):null,f&&g==="unavailable"?_("div",{class:"cf-form__err",role:"alert",children:c.bookingAvailabilityUnavailable}):null,f&&g==="available"&&w.length===0?_("div",{class:"cf-booking__state",role:"status",children:c.bookingNoSlots}):null,w.length>0?_("div",{class:"cf-booking__dates",role:"tablist","aria-label":c.bookingPickDay,children:d.map((G,oe)=>_("button",{type:"button",role:"tab","aria-selected":oe===T,disabled:f&&g==="available"&&!w.some(_e=>p?.has(an(G,_e).getTime())),class:`cf-booking__date ${oe===T?"is-selected":""}`,onClick:()=>{C(oe),M(null)},children:[_("span",{class:"cf-booking__dow",children:G.toLocaleDateString(void 0,{weekday:"short"})}),_("span",{class:"cf-booking__dom",children:G.getDate()})]},oe))}):null,w.length>0?_("div",{class:"cf-booking__slots",role:"listbox","aria-label":c.bookingPickTimeLabel,children:w.map(G=>{const oe=pt(G),_e=cr(G),Oe=ct(G),Ue=Y(G),br=Oe||oe||_e||!Ue;return _("button",{type:"button",role:"option","aria-selected":A===G,disabled:br,title:oe?c.bookingEarlierToday:_e?c.bookingCalendarBusy:Oe?c.bookingAlreadyBooked:Ue?void 0:c.bookingNotOffered,class:`cf-booking__slot ${A===G?"is-selected":""} ${br?"is-taken":""}`,onClick:()=>M(G),children:v5(d[T],G)},G)})}):null,Me&&_("div",{class:"cf-form__err",children:c.bookingSlotTaken}),Se?_("div",{class:"cf-form__as",children:qt(c.actionAs,{identity:Se})}):null,!Be&&_("input",{class:"cf-form__input",type:"text",placeholder:`${c.handoffName} *`,value:I,"aria-label":c.handoffName,onInput:G=>L(G.target.value)}),!he&&_(Ae,{children:_("input",{class:"cf-form__input",type:"email",placeholder:`${c.handoffEmail} *`,value:P,"aria-label":c.handoffEmail,onInput:G=>N(G.target.value)})}),O==="error"&&_("div",{class:"cf-form__err",children:c.formError}),_("div",{class:"cf-form__actions",children:[r&&_("button",{type:"button",class:"cf-form__cancel",onClick:r,children:c.cancel}),_("button",{type:"button",class:"cf-form__submit",disabled:!pe||O==="submitting",onClick:le,children:O==="submitting"?c.sending:l})]})]})},jx=({actions:t,descriptors:e,visitor:r,onSubmitForm:n,onDemoSlots:a,scheduler:i,exclude:o=[],openAction:s,translations:l={}})=>{const c=_r(),[u,f]=V(null),[h,d]=V(!1),p=W(null),m=W(null),g=W(!1),v=Kt(()=>`cf-actions-${Math.random().toString(36).slice(2,9)}`,[]),y=Kt(()=>l5(e,t,l).filter(T=>!o.includes(T.id)&&!o.includes(T.endpoint)),[e,t,o,l]);ie(()=>{s&&y.some(T=>T.id===s)&&(f(s),d(!0))},[s,y]);const b=u?y.find(T=>T.id===u):void 0,x=Q(()=>{g.current=!0,f(null),d(!1)},[]),S=Q(()=>f(null),[]);rv(()=>{h||!g.current||(g.current=!1,p.current?.focus())},[h]);const w=W({drawerOpen:h,activeId:u});if(w.current={drawerOpen:h,activeId:u},ie(()=>{const T=C=>{if(C.key!=="Escape")return;const{drawerOpen:A,activeId:M}=w.current;!A&&!M||(C.stopPropagation(),M?S():x())};return document.addEventListener("keydown",T),()=>document.removeEventListener("keydown",T)},[S,x]),ie(()=>{h&&m.current?.querySelector("button, input, textarea, select")?.focus()},[h,u]),y.length===0)return null;const k=h?b?_("div",{ref:m,id:v,class:"cf-action-drawer is-open",role:"dialog","aria-modal":"false","aria-label":b.formTitle||b.label,children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("strong",{children:b.formTitle||b.label}),b.legacyFallback?_("small",{class:"cf-action-test-mode",children:c.actionTestMode}):null]}),_("button",{type:"button",class:"cf-action-drawer__close","aria-label":c.actionClose,onClick:S,children:_(Ta,{})})]}),b.readiness==="degraded"&&b.readinessNote?_("p",{class:"cf-action-drawer__note cf-action-drawer__note--warn",role:"status",children:b.readinessNote}):null,(b.presentation??"form")==="booking"?_(g5,{visitor:r,title:b.formTitle,submitLabel:b.submitLabel,onCancel:S,onSubmit:(T,C)=>n(b.id,T,C,b.endpoint),onDemoSlots:a,scheduler:i}):_(f5,{spec:{title:b.formTitle||b.label,submit:b.submitLabel,fields:b.fields},visitor:r,onCancel:S,onSubmit:(T,C)=>n(b.id,T,C,b.endpoint)})]}):_("div",{ref:m,id:v,class:"cf-action-drawer cf-action-drawer--menu",role:"dialog","aria-modal":"false","aria-label":c.actionChoose,children:[_("div",{class:"cf-action-drawer__handle","aria-hidden":"true"}),_("div",{class:"cf-action-drawer__head",children:[_("div",{children:[_("span",{class:"cf-action-drawer__eyebrow",children:c.actionNeedHelp}),_("strong",{children:c.actionChoose})]}),_("button",{type:"button",class:"cf-action-drawer__close","aria-label":c.actionClose,onClick:x,children:_(Ta,{})})]}),_("div",{class:"cf-action-drawer__grid",children:y.map(T=>{const C=i5(T.icon);return _("button",{type:"button",class:"cf-action-card",onClick:()=>f(T.id),children:[_("span",{class:"cf-action-card__icon",children:_(C,{})}),_("span",{class:"cf-action-card__copy",children:[_("strong",{children:T.label}),T.legacyFallback?_("small",{class:"cf-action-test-mode",children:c.actionTestMode}):null,_("small",{children:T.description}),T.readiness==="degraded"&&T.readinessNote?_("small",{class:"cf-action-card__warn",children:T.readinessNote}):null]}),_(Ti,{})]},T.id)})}),_("p",{class:"cf-action-drawer__note",children:c.actionFooter})]}):null;return _("div",{class:"cf-action-shell",children:[_("button",{ref:p,type:"button",class:"cf-action-trigger",hidden:h,"aria-expanded":h,"aria-controls":v,onClick:()=>h?x():d(!0),children:[_("span",{class:"cf-action-trigger__icon",children:_(Pc,{})}),_("span",{class:"cf-action-trigger__copy",children:[_("strong",{children:c.actionContactOptions}),_("small",{children:c5(y,c)})]}),_(Ti,{})]}),k]})},m5=({hasEmail:t,visitor:e,question:r,onSubmitForm:n})=>{const a=_r(),[i,o]=V(!1),[s,l]=V(!1),[c,u]=V(e.name??""),[f,h]=V(e.email??"");if(t)return _("div",{class:"cf-handoff cf-handoff--done",children:[_(Ca,{}),_("span",{children:"We’ve alerted the team. If someone is available, they can continue here."})]});if(i){const p=e.email||f;return _("div",{class:"cf-handoff cf-handoff--done",children:[_(Ca,{}),_("span",{children:qt(a.handoffShared,{email:p})})]})}const d=async()=>{if(!(!f.trim()||s)){l(!0);try{await n("inquiry",{visitorEmail:f.trim(),...c.trim()?{visitorName:c.trim()}:{},message:r||"I had a question the assistant couldn’t answer.",subject:"Help request from chat"},{email:f.trim(),name:c.trim()||void 0}),o(!0)}catch{l(!1)}}};return _("div",{class:"cf-handoff",children:[_("div",{class:"cf-handoff__title",children:a.handoffTitle}),_("input",{class:"cf-form__input",type:"text",placeholder:a.handoffName,value:c,"aria-label":a.handoffName,onInput:p=>u(p.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:f,"aria-label":a.handoffEmail,onInput:p=>h(p.target.value)}),_("button",{type:"button",class:"cf-form__submit",disabled:!f.trim()||s,onClick:d,children:s?a.sending:a.handoffNotify})]})},y5=({text:t})=>{const e=_r(),[r,n]=V(!1);return _("button",{type:"button",class:"cf-tool",onClick:async()=>{try{await navigator.clipboard.writeText(t),n(!0),setTimeout(()=>n(!1),1500)}catch{}},"aria-label":e.copy,children:[r?_(Ca,{}):_(PR,{}),r?e.copied:e.copy]})},_5=({items:t,onPick:e})=>t.length===0?null:_("div",{class:"cf-starters",children:t.map((r,n)=>_("button",{type:"button",class:"cf-starter",onClick:()=>e(r),children:r},n))}),b5=({items:t})=>{const e=t.filter(r=>r.label.trim()&&r.url.trim()).slice(0,4);return e.length===0?null:_("div",{class:"cf-featured-links",children:e.map((r,n)=>_("a",{class:"cf-featured-link",href:r.url,target:"_blank",rel:"noopener noreferrer nofollow",title:r.label,children:[_(Lc,{}),_("span",{children:r.label})]},`${r.url}-${n}`))})},x5=({msg:t,onRate:e})=>{const r=_r(),[n,a]=V(!1),[i,o]=V(""),s=t.feedback,l=()=>{e(t.id,"up"),a(!1)},c=()=>{e(t.id,"down"),a(!0)},u=()=>{e(t.id,"down",i.trim()),a(!1)};return _("div",{class:"cf-feedback",children:[_("div",{class:"cf-feedback__row",children:[_("button",{type:"button",class:`cf-feedback__btn ${s==="up"?"is-active":""}`,"aria-label":r.feedbackHelpful,"aria-pressed":s==="up",onClick:l,children:_(Gx,{})}),_("button",{type:"button",class:`cf-feedback__btn ${s==="down"?"is-active":""}`,"aria-label":r.feedbackNotHelpful,"aria-pressed":s==="down",onClick:c,children:_($x,{})}),s&&!n&&_("span",{class:"cf-feedback__thanks",children:r.feedbackThanks})]}),n&&s==="down"&&_("div",{class:"cf-feedback__comment",children:[_("textarea",{class:"cf-feedback__input",rows:2,placeholder:r.feedbackCommentPlaceholder,value:i,onInput:f=>o(f.target.value)}),_("button",{type:"button",class:"cf-feedback__send",onClick:u,children:r.feedbackSend})]})]})},w5=({msg:t,persona:e,isLast:r,visitor:n,hasEmail:a,lastQuestion:i,showActions:o,onPickReply:s,onSubmitForm:l,onDemoSlots:c,onRetry:u,ratable:f,onRate:h,onExpandVisualization:d})=>{const p=_r(),m=t.role==="user",g=t.liveEventType??"",v=t.content.trim().toLowerCase(),y=g==="handoff_queued"||g==="agent_joined"||g==="agent_left"||g==="conversation_ended"||v.includes("joined the chat")||v.includes("left the chat")||v.includes("support agents will be with you"),b=t.role==="system"||y,x=t.requestedContactFields?.includes("email")===!0,S=r&&!m&&!b&&!!(t.handoffOffered||x),w=S&&!a?["inquiry"]:[],k=!t.pending&&!t.streaming,T=[...t.artifacts??[],...t.visualization&&!(t.artifacts??[]).some(C=>C.type==="visualization")?[{type:"visualization",visualization:t.visualization}]:[]];return b?_("div",{class:"cf-msg cf-msg--system",children:_("div",{class:"cf-system-event",children:[_("div",{class:"cf-system-event__mark","aria-hidden":"true"}),_("div",{class:"cf-system-event__text",children:t.content}),t.createdAt&&_("div",{class:"cf-system-event__time",children:new Date(t.createdAt).toLocaleString(void 0,{day:"2-digit",month:"short",year:"numeric",hour:"numeric",minute:"2-digit"})})]})}):_("div",{class:`cf-msg cf-msg--${m?"user":"agent"}`,children:[!m&&_(qx,{persona:e,small:!0}),_("div",{class:"cf-msg__col",children:[t.pending&&t.content===""?_(JR,{}):t.imageUrl?_("div",{class:"cf-msg__bubble cf-msg__bubble--media",children:[_("img",{class:"cf-msg__media",src:t.imageUrl,alt:"GIF"}),t.content&&_("span",{class:"cf-msg__caption",children:t.content})]}):_("div",{class:"cf-msg__bubble",children:[m?t.content:$R(t.content),t.streaming&&_("span",{class:"cf-caret","aria-hidden":"true"})]}),m?null:T.map((C,A)=>C.type==="visualization"&&C.visualization?_(Qx,{visualization:C.visualization,onExpand:d?()=>d(t.id):void 0,expandControlId:t.id},`visualization-${A}`):C.type==="image"&&(C.data||C.uri?.startsWith("https://"))&&["image/png","image/jpeg","image/webp"].includes(C.mimeType??"")?_("figure",{class:"cf-artifact",children:[C.title?_("figcaption",{children:C.title}):null,_("img",{src:C.uri||`data:${C.mimeType};base64,${C.data}`,alt:C.altText||C.caption||C.title||"Tool result"}),C.caption&&C.caption!==C.title?_("p",{children:C.caption}):null]},`image-${A}`):C.type==="resource_link"&&C.uri?.startsWith("https://")?_("a",{class:"cf-artifact-link",href:C.uri,target:"_blank",rel:"noopener noreferrer nofollow",children:[_("strong",{children:C.title||C.name||"Open result"}),C.caption?_("span",{children:C.caption}):null]},`link-${A}`):null),!m&&t.visualization&&op(t.visualization)?_(KR,{explanation:op(t.visualization),onFollowUp:s,showLead:!t.content.toLocaleLowerCase().includes(op(t.visualization).headline.toLocaleLowerCase())}):null,m&&t.attachmentName&&_("div",{class:"cf-attach-chip",title:t.attachmentName,children:[_(np,{}),_("span",{children:t.attachmentName})]}),!m&&_(Ae,{children:[k&&(t.error||t.content)&&_("div",{class:"cf-msg__actions",children:[_("div",{class:"cf-msg__tools",children:t.error?_("button",{type:"button",class:"cf-tool",onClick:()=>u(t.id,t.retryText??""),children:[_(RR,{}),p.retry]}):_(y5,{text:t.content})}),f&&!t.error&&t.content&&_(x5,{msg:t,onRate:h})]}),_(t5,{msg:t}),r&&_(r5,{replies:t.suggestedReplies,onPick:s}),S&&_(m5,{hasEmail:a,visitor:n,question:i,onSubmitForm:l}),o&&_(jx,{actions:t.availableActions,descriptors:t.actions,openAction:t.selectedAction,visitor:n,onSubmitForm:l,onDemoSlots:c,scheduler:e?.scheduler,exclude:w})]})]})]})},Qx=({visualization:t,expanded:e=!1,onExpand:r,onClose:n,expandControlId:a})=>{const i=W(null),o=Kt(()=>Jd(t),[t]),[s,l]=V(o?.type);ie(()=>l(o?.type),[o]);const c=Kt(()=>hR(t),[t]),u=Kt(()=>Jd(t,s),[s,t]),f=s??u?.type??o?.type,h=c.find(b=>b.type===f),d=t.rows??[],p=t.columns?.length?t.columns:Object.keys(d[0]??{}),m=p.map(b=>{const x=t.columnMetadata?.find(S=>S.key===b);return x?{key:b,label:x.label,dataType:x.dataType,currencyCode:x.currencyCode}:b});if(d.length===0)return _(XR,{});const g=_(YR,{answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??d.length}),v=()=>t.tableAvailable===!1||p.length===0?null:_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:t.title?.trim()||"Result details"}),g]}),_("div",{class:"cf-analytics-visualization__actions",children:[t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Jx(p,d),children:"Download"}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Ta,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand table","data-visualization-message":a,onClick:r,children:_(ip,{})}):null]})]}),_(mR,{rows:d,columns:m,maxRows:100,expanded:e,classPrefix:"cf"})]});if(t.presentation==="table"||!t.presentation&&t.type==="table")return v();const y=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??p[1];if(t.presentation==="kpi"||!t.presentation&&t.type==="kpi"){const b=d[0]?.[y??p[0]??""],x=typeof b=="number"?b:Number(b),S=t.columnMetadata?.find(k=>k.key===y),w=Number.isFinite(x)?qo(x,S,t):String(b??"No value");return _("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:"Live metric"}),g]}),e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Ta,{})}):null]}),_(qR,{label:S?.label??y??"Current value",value:w})]})}return u?_("div",{class:`cf-analytics-visualization${e?" is-expanded":""}`,children:[_("div",{class:"cf-analytics-visualization__header",children:[_("div",{children:[_("div",{class:"cf-analytics-visualization__title",children:u.title}),g]}),_("div",{class:"cf-analytics-visualization__actions",children:[c.length>1?_("details",{ref:i,class:"cf-analytics-chart-picker",children:[_("summary",{"aria-label":"Choose chart type",title:"Choose chart type",children:[_("span",{class:"cf-analytics-chart-picker__current",children:[_(Ux,{type:f??u.type}),_("span",{children:h?.label??"Chart"})]}),_(Ti,{})]}),_("div",{class:"cf-analytics-chart-picker__menu",role:"listbox","aria-label":"Chart type",children:c.map(b=>{const x=b.type===f;return _("button",{type:"button",role:"option","aria-selected":x,class:x?"is-selected":"",onClick:()=>{l(b.type),i.current&&(i.current.open=!1)},children:[_("span",{class:"cf-analytics-chart-picker__icon",children:_(Ux,{type:b.type})}),_("span",{class:"cf-analytics-chart-picker__copy",children:[_("strong",{children:b.label}),_("small",{children:ZR(b.type)})]}),x?_(Ca,{}):null]},b.type)})})]}):null,e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(Ta,{})}):r&&t.expandable!==!1?_("button",{type:"button",class:"cf-analytics-visualization__expand","aria-label":"Expand chart","data-visualization-message":a,onClick:r,children:_(ip,{})}):null]})]}),_(vR,{model:u,expanded:e}),t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Jx(p,d),children:"Download this data"}):null]}):v()},Jx=(t,e)=>{if(typeof document>"u"||t.length===0)return;const r=gR(e,t),n=URL.createObjectURL(new Blob([r],{type:"text/csv;charset=utf-8"})),a=document.createElement("a");a.href=n,a.download="analytics-result.csv",a.click(),URL.revokeObjectURL(n)},e1=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result).split(",")[1]??""),n.onerror=r,n.readAsDataURL(t)}),S5=({onPick:t})=>_("div",{class:"cf-picker cf-emoji",children:xR.map(e=>_("div",{class:"cf-emoji__group",children:[_("div",{class:"cf-emoji__label",children:e.name}),_("div",{class:"cf-emoji__grid",children:e.emojis.map((r,n)=>_("button",{type:"button",class:"cf-emoji__btn",onClick:()=>t(r),"aria-label":r,children:r},n))})]},e.name))}),k5=({onSearch:t,onPick:e})=>{const r=_r(),[n,a]=V(""),[i,o]=V([]),[s,l]=V(!0);return ie(()=>{let c=!0;l(!0);const u=setTimeout(()=>{t(n).then(f=>c&&(o(f),l(!1))).catch(()=>c&&(o([]),l(!1)))},300);return()=>{c=!1,clearTimeout(u)}},[n,t]),_("div",{class:"cf-picker cf-gif",children:[_("input",{class:"cf-gif__search",placeholder:r.searchGifs,value:n,"aria-label":r.searchGifs,onInput:c=>a(c.target.value)}),_("div",{class:"cf-gif__grid",children:s?_("div",{class:"cf-gif__hint",children:r.searchingGifs}):i.length===0?_("div",{class:"cf-gif__hint",children:r.noGifs}):i.map(c=>_("button",{type:"button",class:"cf-gif__item",onClick:()=>e(c.url),"aria-label":c.alt,children:_("img",{src:c.preview,alt:c.alt,loading:"lazy"})},c.id))}),_("div",{class:"cf-gif__powered",children:"via Tenor"})]})},T5=8*1024*1024,C5="image/png,image/jpeg,image/webp,image/gif,application/pdf",M5=12e3,A5=250,D5=t=>{switch(t){case"connecting":return"Connecting with AI…";case"listening":return"Listening now — go ahead.";case"speaking":return"AI is speaking — talk to interrupt.";case"processing":return"Understanding what you said…";case"noise":return"I couldn't hear clear words. Try again closer to the mic.";case"misunderstood":return"I didn't understand that. Please try again.";case"denied":return"Microphone access is blocked. Allow the mic or type your question.";case"muted":return"Muted — tap the mic to unmute.";case"timeout":return"Didn't hear anything for a while — ending the call.";default:return""}},I5=.004,t1=({muted:t,listening:e,micLevel:r,onToggleMute:n})=>{const a=e&&r>=I5;return _("button",{type:"button",class:`cf-call-btn ${t?"is-muted":""} ${e?"is-listening":""} ${a?"is-hot":""}`,"aria-label":t?"Unmute microphone":"Mute microphone","aria-pressed":t,onClick:n,style:e?{"--cf-wave":String(Math.max(.2,Math.min(1,r*6)))}:void 0,children:t?_(CR,{}):_(Xo,{})})},L5=({audioDevices:t,selectedAudioDeviceId:e,onSelectAudioDevice:r})=>{const[n,a]=V(!1),i=W(null);ie(()=>{if(!n)return;const s=l=>{i.current&&!l.composedPath().includes(i.current)&&a(!1)};return document.addEventListener("mousedown",s),()=>document.removeEventListener("mousedown",s)},[n]);const o=[{deviceId:"",label:"Default microphone"},...t];return _("div",{class:"cf-call-more",ref:i,children:[_("button",{type:"button",class:"cf-call-btn cf-call-btn--microphones","aria-label":"Choose microphone","aria-expanded":n,onClick:()=>a(s=>!s),children:_(Ti,{})}),n&&_("div",{class:"cf-call-menu",role:"menu",children:[_("div",{class:"cf-call-menu__label",children:"Microphone"}),o.map(s=>_("button",{type:"button",role:"menuitemradio","aria-checked":s.deviceId===e,class:`cf-call-menu__item ${s.deviceId===e?"is-active":""}`,onClick:()=>{r(s.deviceId),a(!1)},children:[s.deviceId===e?_(Ca,{}):_("span",{class:"cf-call-menu__spacer"}),_("span",{children:s.label})]},s.deviceId))]})]})},P5=({voiceState:t,muted:e,onToggleMute:r,onEndCall:n,onTalkNow:a,showTalkNow:i,micLevel:o,theaterMode:s,onToggleTheater:l,onMinimize:c,audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h})=>_("div",{class:"cf-call-controls",children:[_(t1,{muted:e,listening:t==="listening"&&!e,micLevel:o,onToggleMute:r}),_(L5,{audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:h}),i&&_("button",{type:"button",class:"cf-call-btn cf-call-btn--talk","aria-label":"Talk now",onClick:a,children:_(Xo,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":s?"Exit expanded view":"Expand view","aria-pressed":s,onClick:l,children:s?_(NR,{}):_(ip,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":"Minimize voice chat",onClick:c,children:_(BR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:n,children:_(ap,{})})]}),R5=({persona:t,voiceState:e,muted:r,onToggleMute:n,onEndCall:a,micLevel:i,onExpand:o})=>{const s=h=>h.stopPropagation(),l=t?.assistantMediaUrl?.trim()||t?.agentAvatarUrl?.trim()||"",c=t?.assistantMediaKind==="video"&&!!l,u=t?.agentName||"Assistant",f=["cf-floating-call-card",e==="listening"&&!r?"is-listening":"",e==="speaking"?"is-speaking":"",e==="processing"||e==="connecting"?"is-thinking":"",r?"is-muted":""].filter(Boolean).join(" ");return _("div",{class:f,style:e==="listening"&&!r?{"--cf-listen":String(Math.max(.18,Math.min(1,i*8)))}:void 0,role:"button",tabIndex:0,"aria-label":`Reopen voice chat with ${u}`,onClick:o,onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o())},children:[_("div",{class:"cf-floating-call-card__media","aria-hidden":"true",children:l?c?_("video",{src:l,muted:!0,loop:!0,playsInline:!0,autoPlay:!0}):_("img",{src:l,alt:""}):_("div",{class:`cf-floating-call-card__avatar${Zo(t)}`,children:[_("span",{children:Rc(t)}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--left"}),_("span",{class:"cf-floating-call-card__eye cf-floating-call-card__eye--right"}),_("span",{class:"cf-floating-call-card__mouth"})]})}),_("div",{class:"cf-floating-call-card__shade","aria-hidden":"true"}),_("div",{class:"cf-floating-call-card__controls",onClick:s,onKeyDown:s,role:"presentation",children:[_(t1,{muted:r,listening:e==="listening"&&!r,micLevel:i,onToggleMute:n}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--restore","aria-label":"Restore voice chat",onClick:h=>{s(h),o()},children:_(zR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:h=>{s(h),a()},children:_(ap,{})})]})]})},E5=(t,e)=>{switch(t){case"connecting":return e.voiceConnecting;case"listening":return e.voiceListening;case"processing":return e.voiceProcessing;case"speaking":return e.voiceSpeaking;case"noise":return e.voiceNoise;case"misunderstood":return e.voiceMisunderstood;case"denied":return e.voiceDenied;default:return D5(t)}},O5=({draftStore:t,onSend:e,onSendGif:r,onTyping:n,disabled:a,allowVoice:i,onTranscribe:o,gifEnabled:s,onSearchGifs:l,allowAttach:c,onExtract:u,voiceStartSignal:f=0,onVoiceStateChange:h})=>{const d=_r(),[p,m]=V(()=>t.value),g=Y=>{const le=typeof Y=="function"?Y(p):Y;t.value=le,m(le)},[v,y]=V(!1),[b,x]=V(!1),[S,w]=V("idle"),[k,T]=V("none"),[C,A]=V(null),[M,I]=V(!1),[L,P]=V(!1),[N,O]=V(""),q=W(null),R=W(null),z=W(null),F=W(0),X=W(null),te=W([]),fe=W(void 0),me=W(null),we=W(void 0),Ze=W(0),Ie=Y=>{w(Y),h?.(Y)},tt=()=>{fe.current&&window.clearTimeout(fe.current),fe.current=void 0,we.current&&cancelAnimationFrame(we.current),we.current=void 0,me.current?.close().catch(()=>{}),me.current=null};ie(()=>{const Y=q.current;Y&&(Y.style.height="auto",Y.style.height=`${Math.min(Y.scrollHeight,110)}px`)},[p]),ie(()=>()=>{C?.previewUrl&&URL.revokeObjectURL(C.previewUrl)},[C?.previewUrl]),ie(()=>{if(k==="none")return;const Y=le=>{R.current&&!le.composedPath().includes(R.current)&&T("none")};return document.addEventListener("mousedown",Y),()=>document.removeEventListener("mousedown",Y)},[k]);const Ge=Y=>T(le=>le===Y?"none":Y),Me=Y=>{const le=q.current;if(!le){g(_e=>_e+Y);return}const G=le.selectionStart??p.length,oe=le.selectionEnd??p.length;g(p.slice(0,G)+Y+p.slice(oe)),requestAnimationFrame(()=>{le.focus();const _e=G+Y.length;le.setSelectionRange(_e,_e)})},re=Y=>{T("none"),r(Y)},he=async Y=>{if(!Y)return;const le=++F.current;if(O(""),Y.size>T5){O(d.attachTooLarge);return}I(!0);try{const G=await e1(Y),oe=await u(G,Y.type||"application/octet-stream",Y.name);if(le!==F.current)return;if(!oe){O(d.attachFailed);return}A({name:Y.name,text:oe,mimeType:Y.type||"application/octet-stream",size:Y.size,previewUrl:Y.type.startsWith("image/")?URL.createObjectURL(Y):void 0})}catch{O(d.attachFailed)}finally{le===F.current&&I(!1)}},Be=async Y=>{const le=Y.target,G=le.files?.[0];le.value="",await he(G)},pe=()=>{F.current+=1,I(!1),O("")},Se=(!!p.trim()||!!C)&&!a&&!M&&!b,ct=()=>{Se&&(e(p,C?{attachmentName:C.name,attachmentText:C.text}:void 0),n?.(!1),g(""),A(null),O(""))},pt=Y=>{const le=Y.trim();if(!le||a){Ie("misunderstood"),window.setTimeout(()=>Ie("idle"),2500);return}const G=p.trim(),oe=G?`${G} ${le}`:le;e(oe),n?.(!1),g(""),A(null),O(""),Ie("idle")},sn=Y=>{if(Y.key==="Enter"&&!Y.shiftKey){if(a)return;Y.preventDefault(),ct()}else Y.key==="Escape"&&k!=="none"&&(Y.preventDefault(),Y.stopPropagation(),T("none"))},cr=async()=>{if(v){Fr(X.current);return}try{Ie("connecting");const Y=await navigator.mediaDevices.getUserMedia({audio:Fx()}),le=ep(Y);te.current=[],Ze.current=0;try{const G=window.AudioContext??window.webkitAudioContext;if(G){const oe=new G;me.current=oe;const _e=oe.createMediaStreamSource(Y),Oe=oe.createAnalyser();Oe.fftSize=512,_e.connect(Oe);const Ue=new Uint8Array(Oe.frequencyBinCount),br=()=>{Oe.getByteTimeDomainData(Ue);let Ai=0;for(const ln of Ue){const Di=(ln-128)/128;Ai+=Di*Di}Ze.current=Math.max(Ze.current,Math.sqrt(Ai/Ue.length)),we.current=requestAnimationFrame(br)};br()}}catch{}le.ondataavailable=G=>G.data.size>0&&te.current.push(G.data),le.onstop=async()=>{tt(),Y.getTracks().forEach(oe=>oe.stop()),y(!1);const G=new Blob(te.current,{type:le.mimeType||"audio/webm"});if(G.size===0||G.size<900||Ze.current<.006){Ie("noise"),window.setTimeout(()=>Ie("idle"),3200);return}x(!0),Ie("processing");try{const oe=await e1(G);if(!oe.trim()){Ie("noise"),window.setTimeout(()=>Ie("idle"),3200);return}const _e=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0,Oe=await o(oe,G.type,_e);pt(Oe)}catch{Ie("misunderstood"),window.setTimeout(()=>Ie("idle"),3e3)}finally{x(!1)}},X.current=le,le.start(A5),y(!0),Ie("listening"),fe.current=window.setTimeout(()=>{Fr(X.current)},M5)}catch{Ie("denied"),window.setTimeout(()=>Ie("idle"),3500)}};return ie(()=>{!f||!i||a||v||b||cr()},[f]),ie(()=>()=>{tt();const Y=X.current;if(Y){if(Y.ondataavailable=null,Y.onstop=null,Y.onerror=null,Y.state!=="inactive")try{Y.stop()}catch{}Y.stream.getTracks().forEach(le=>le.stop())}X.current=null,te.current=[]},[]),_("div",{class:`cf-composer ${L?"is-dragging":""}`,ref:R,onDragEnter:Y=>{c&&(Y.preventDefault(),P(!0))},onDragOver:Y=>{c&&Y.preventDefault()},onDragLeave:Y=>{Y.currentTarget===Y.target&&P(!1)},onDrop:Y=>{c&&(Y.preventDefault(),P(!1),he(Y.dataTransfer?.files?.[0]))},children:[k==="emoji"&&_(S5,{onPick:Me}),k==="gif"&&_(k5,{onSearch:l,onPick:re}),(C||M||N)&&_("div",{class:"cf-attach-row",children:M?_("span",{class:"cf-attach-status",children:[_("span",{children:d.attaching}),_("button",{type:"button",onClick:pe,children:d.cancel})]}):N?_("span",{class:"cf-attach-status cf-attach-status--err",children:N}):C&&_("span",{class:"cf-attach-chip",title:C.name,children:[C.previewUrl?_("img",{class:"cf-attach-preview",src:C.previewUrl,alt:""}):_(np,{}),_("span",{class:"cf-attach-copy",children:[_("span",{children:C.name}),_("small",{children:[Math.max(1,Math.ceil(C.size/1024))," KB"]})]}),_("button",{type:"button",class:"cf-attach-x","aria-label":d.removeAttachment,onClick:()=>A(null),children:_(Ta,{})})]})}),S!=="idle"&&_("div",{class:"cf-voice-state","aria-live":"polite",children:[_("span",{class:`cf-voice-state__dot ${v?"is-live":""}`}),E5(S,d)]}),_("div",{class:"cf-composer__field",children:[_("button",{type:"button",class:`cf-iconbtn ${k==="emoji"?"is-active":""}`,"aria-label":d.emoji,"aria-pressed":k==="emoji",onClick:()=>Ge("emoji"),children:k==="emoji"?_(Ta,{}):_(DR,{})}),s&&_("button",{type:"button",class:`cf-iconbtn cf-gifbtn ${k==="gif"?"is-active":""}`,"aria-label":d.gifs,"aria-pressed":k==="gif",onClick:()=>Ge("gif"),children:_("span",{class:"cf-gif-label",children:"GIF"})}),c&&_(Ae,{children:[_("input",{ref:z,type:"file",class:"cf-file-input",accept:C5,onChange:Be,tabIndex:-1,"aria-hidden":"true"}),_("button",{type:"button",class:"cf-iconbtn","aria-label":d.attachFile,disabled:M,onClick:()=>z.current?.click(),children:_(np,{})})]}),_("textarea",{ref:q,class:"cf-textarea",rows:1,placeholder:d.composerPlaceholder,value:p,"aria-label":d.composerPlaceholder,"aria-busy":a,onInput:Y=>{const le=Y.target.value;g(le),n?.(!!le.trim())},onPaste:Y=>{const le=Y.clipboardData?.files?.[0];!c||!le||(Y.preventDefault(),he(le))},onKeyDown:sn}),i&&_("button",{type:"button",class:`cf-iconbtn cf-mic ${v?"is-recording":""}`,"aria-label":v?d.stopRecording:d.recordVoice,"aria-pressed":v,disabled:b||a,onClick:cr,children:_(Xo,{})}),_("button",{type:"button",class:"cf-send","aria-label":d.send,disabled:!Se,onClick:ct,children:_(TR,{})})]})]})};let r1=!0,Ko=null;const N5=t=>{r1=t},B5=()=>{const t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;if(!Ko)try{Ko=new t}catch{return null}return Ko.state==="suspended"&&Ko.resume(),Ko},jo=(t,e,r,n,a,i)=>{const o=t.createOscillator(),s=t.createGain();o.type=a,o.frequency.setValueAtTime(e,r),o.connect(s),s.connect(t.destination),s.gain.setValueAtTime(1e-4,r),s.gain.exponentialRampToValueAtTime(i,r+.012),s.gain.exponentialRampToValueAtTime(1e-4,r+n),o.start(r),o.stop(r+n+.03)},Mi=t=>{if(!r1)return;const e=B5();if(!e)return;const r=e.currentTime;try{t==="open"?(jo(e,523,r,.12,"sine",.05),jo(e,784,r+.08,.16,"sine",.05)):t==="send"?jo(e,660,r,.08,"triangle",.04):t==="receive"&&(jo(e,880,r,.1,"sine",.045),jo(e,1175,r+.09,.14,"sine",.045))}catch{}},z5=(t,e)=>t?.status===429?e.errorRateLimit:e.errorGeneric,sp=()=>typeof performance<"u"&&typeof performance.now=="function"?performance.now():Date.now(),lp=(t,e)=>{const r=sp(),n={stage:t,durationMs:Math.max(0,r-e)};try{performance.measure(`centrinfo-widget:${t}`,{start:e,end:r})}catch{}return typeof window<"u"&&typeof CustomEvent<"u"&&window.dispatchEvent(new CustomEvent("centrinfo:performance",{detail:n})),n},F5=/!?\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,H5=/https?:\/\/[^\s)]+/g,V5=t=>t.replace(/```[\s\S]*?```/g,e=>e.replace(/^```[^\n]*\n?/,"").replace(/```$/,"").trim()),G5=t=>V5(t).replace(F5,"$1").replace(/`([^`]+)`/g,"$1").replace(/\*\*([^*]+)\*\*/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/(^|[\s([{])\*([^*\n]{1,120})\*(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/(^|[\s([{])_([^_\n]{1,120})_(?=[\s.,;:!?)}\]]|$)/g,"$1$2").replace(/^\s{0,3}#{1,6}\s+/gm,"").replace(/^\s{0,3}[-*+]\s+/gm,"").replace(/^\s{0,3}\d+\.\s+/gm,"").replace(/\s+\*/g," ").replace(/\*\s+/g," ").replace(/[*_]{2,}/g,"").replace(H5,e=>e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")).replace(/[ \t]+\n/g,`
|
|
28
28
|
`).replace(/\n{3,}/g,`
|
|
29
29
|
|
|
30
|
-
`).replace(/[ \t]{2,}/g," ").trim(),Qr=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,kc=(t,e)=>{typeof console>"u"||console.warn(`[centrinfo-widget] ${t}`,e??{})},Vx=(t,e,r,n,a=1,i,o=!1,s,l)=>{t.current?.pause(),t.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),e.current=null;const c=()=>{const d=i?.trim();if(!o||!d||typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return!1;const p=new SpeechSynthesisUtterance(d);let m=!1;const v=()=>{m||(m=!0,e.current===p&&(e.current=null,l?.()))};return p.rate=a,p.lang=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en-US",p.onend=v,p.onerror=v,e.current=p,s?.(),window.speechSynthesis.cancel(),window.speechSynthesis.speak(p),!0};if(!r||typeof Audio>"u")return c();const u=new Audio(`data:${n||"audio/mpeg"};base64,${r}`);let f=!1;const h=()=>{f||(f=!0,t.current===u&&(t.current=null,l?.()))};return u.playbackRate=a,u.onended=h,u.onerror=h,t.current=u,u.play().then(()=>{if(t.current!==u){h();return}s?.(Number.isFinite(u.duration)?u.duration*1e3:void 0)}).catch(()=>{c()||h()}),!0},v5=t=>{try{return t==="none"?null:t==="session"?sessionStorage:localStorage}catch{return null}},g5=t=>{let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return(e>>>0).toString(36)},m5=t=>{try{const e=t?.split(".")[1];if(!e)return;const r=e.replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(r.padEnd(Math.ceil(r.length/4)*4,"=")));for(const a of["sub","external_user_id","user_id"]){const i=n[a];if(typeof i=="string"&&i.trim())return i.trim()}}catch{}},y5=t=>{const e=t.user?.externalId?.trim()||t.user?.userId?.trim()||t.user?.email?.trim().toLowerCase()||m5(t.identityToken)||(t.identityToken||t.getIdentityToken?"authenticated":"anonymous");return`${t.token.slice(0,12)}:${t.chatSurface}:${g5(e)}`},Bo=t=>`${t.chatSurface}:${Qr()}`,_5=t=>t.slice(0,12),zo=t=>`centrinfo:session:${t}`,qd=t=>`centrinfo:visitor:${t}`,Tc=(t,e)=>`centrinfo:chat:${t}:${e}`,Xd=t=>`centrinfo:history:${t}`,Gx=20,Zd=720*60*60*1e3,b5=1440*60*1e3,x5=(t,e)=>{try{return JSON.parse(t?.getItem(qd(e))||"{}")}catch{return{}}},w5=(t,e,r)=>{if(!t)return Bo(r);try{const n=zo(e),a=t.getItem(n);if(a)return a;const i=Bo(r);return t.setItem(n,i),i}catch{return Bo(r)}},Wx=(t,e,r)=>{if(!t)return{};try{const n=t.getItem(Tc(e,r));return n?JSON.parse(n):{}}catch{return{}}},$x=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i}=Wx(t,e,r);return Array.isArray(i)?typeof a=="number"&&Date.now()>a?[]:typeof n=="number"&&Date.now()-n>Zd?[]:i:[]},S5=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i,ended:o}=Wx(t,e,r);return!Array.isArray(i)||i.length===0||typeof a=="number"&&Date.now()>a||typeof n=="number"&&Date.now()-n>Zd?!1:o===!0||typeof n=="number"&&Date.now()-n>b5},k5=t=>Number.isFinite(t??NaN)?Math.max(5,Math.min(200,Math.round(t))):50,T5=t=>Number.isFinite(t??NaN)?Math.max(1,Math.min(365,Math.round(t)))*24*60*60*1e3:Zd,Ux=(t,e,r,n,a,i,o,s)=>{if(t)try{if(!i){t.removeItem(Tc(e,r));return}const l=n.filter(u=>!u.pending).slice(-o);if(l.length===0)return;const c=Date.now();t.setItem(Tc(e,r),JSON.stringify({ts:c,expiresAt:c+s,messages:l,ended:a}))}catch{}},C5=(t,e)=>{if(!t)return[];try{const r=t.getItem(Xd(e)),n=r?JSON.parse(r):[];return Array.isArray(n)?n:[]}catch{return[]}},Cc=(t,e,r)=>{if(t)try{t.setItem(Xd(e),JSON.stringify(r.slice(0,Gx)))}catch{}},Yx=(t,e)=>{if(t)try{const r=`centrinfo:chat:${e}:`,n=new Set([zo(e),qd(e),Xd(e)]),a=[];for(let i=0;i<t.length;i++){const o=t.key(i);o&&(n.has(o)||o.startsWith(r))&&a.push(o)}a.forEach(i=>t.removeItem(i))}catch{}},M5=t=>{const n=(t.find(a=>a.role==="user"&&a.content.trim())?.content||t.find(a=>a.content.trim())?.content||"").trim().replace(/\s+/g," ");return n.length>60?n.slice(0,60)+"…":n||"Conversation"},A5=t=>({id:`live:${t.id}`,role:t.type==="chat"||t.type==="ai_resume"?"assistant":"system",content:t.content,authorName:t.authorName,liveEventType:t.type,createdAt:t.createdAt}),D5=(t,e,r=!0)=>{const n=q(v5(e.persistence)).current,a=y5(e),i=q(w5(n,a,e)),o=q(null),s=q(null),l=q(null),c=q(void 0),u=q(null),f=q({}),[h,d]=W(null),[p,m]=W(()=>$x(n,a,i.current)),v=q(p.length>0),g=q(p.some(z=>z.role==="user")),[y,b]=W(!1),[x,S]=W(!1),[w,k]=W(()=>S5(n,a,i.current)),[T,M]=W(()=>x5(n,a)),[A,C]=W(()=>C5(n,a)),[I,P]=W(null),[R,E]=W([]),[O,K]=W("ai"),[L,B]=W(void 0),[V,$]=W(void 0),X=q(new Date().toISOString()),ue=q(void 0),_e=q(!1),Te=q(0),Ue=q(T);he(()=>{Ue.current=T},[T]);const We=h?.memoryEnabled!==!1,Ye=k5(h?.memoryMessageCap),J=T5(h?.memoryRetentionDays),le=re(()=>{o.current?.abort(),Yx(n,a),Yx(n,_5(e.token));const z=Bo(e);i.current=z;try{n?.setItem(zo(a),z)}catch{}P(null),E([]),k(!1),C([]),M({}),K("ai"),B(void 0),$(void 0),X.current=new Date().toISOString(),m(h?[{id:Qr(),role:"assistant",content:h.greeting,availableActions:h.availableActions}]:[])},[n,a,e.token,h]),j=re(z=>{try{n?.setItem(qd(a),JSON.stringify(z))}catch{}},[n,a]),Q=re(z=>{const H=(z.email??"").trim().toLowerCase(),Y=(Ue.current.email??"").trim().toLowerCase();H&&Y&&H!==Y&&le();const ee={};z.email?.trim()&&(ee.email=z.email.trim()),z.phone?.trim()&&(ee.phone=z.phone.trim());const be=[z.firstName,z.lastName].filter(te=>!!te?.trim()).join(" ").trim()||z.name?.trim()||"";be&&(ee.name=be),Object.keys(ee).length>0&&M(te=>{const pe={...ee,...te};return j(pe),pe}),t.identify(i.current,z).catch(()=>{})},[t,j,le]),F=re(z=>{d(z),m(H=>{if(H.length===0)return[{id:Qr(),role:"assistant",content:z.greeting,availableActions:z.availableActions}];const Y=H.some(ae=>ae.role==="user"),ee=H[0];return!Y&&ee?.role==="assistant"?[{...ee,content:z.greeting,availableActions:z.availableActions},...H.slice(1)]:H})},[]);he(()=>{if(h?.memoryEnabled===!1){try{n?.removeItem(Tc(a,i.current))}catch{}Cc(n,a,[]),C([]),P(null),E([]),m(z=>v.current?(v.current=!1,h?[{id:Qr(),role:"assistant",content:h.greeting,availableActions:h.availableActions}]:[]):z)}},[h,n,a]);const ie=re(async()=>{const z=await t.bootstrap();F(z)},[F,t]);he(()=>{let z=!0;const H=Y=>Y.messages.map(ee=>({id:ee.id,role:ee.role,content:ee.content,authorName:ee.authorName,liveEventType:ee.messageType,sources:ee.sources,visualization:ee.visualization,createdAt:ee.createdAt}));return t.history().then(Y=>{if(!z||Y.conversations.length===0)return;const ee=Y.conversations.map(pe=>({sessionId:pe.sessionId,ts:Date.parse(pe.lastSeenAt)||Date.now(),title:pe.title,ended:pe.ended}));for(const pe of Y.conversations)Ux(n,a,pe.sessionId,H(pe),pe.ended,!0,Ye,J);Cc(n,a,ee),C(ee);const ae=Y.conversations.find(pe=>pe.sessionId===Y.activeSessionId);if(!ae||g.current)return;const be=H(ae);i.current=ae.sessionId,v.current=be.length>0;try{n?.setItem(zo(a),ae.sessionId)}catch{}const te=be[be.length-1]?.createdAt;te&&(X.current=te),k(ae.ended),m(be)}).catch(()=>{}),()=>{z=!1}},[Ye,J,a,n,t]),he(()=>{let z=!0;return t.bootstrap().then(H=>{z&&F(H)}),e.user&&Q(e.user),()=>{z=!1}},[F,t]),he(()=>{const z=e.configRefreshSeconds;if(!r||z<=0||typeof window>"u")return;let H=!0,Y=!1;const ee=Math.max(10,z)*1e3,ae=()=>typeof document>"u"||document.visibilityState!=="hidden",be=async()=>{if(!(!H||Y||!ae())){Y=!0;try{await ie()}catch{}finally{Y=!1}}};be();const te=window.setInterval(be,ee),pe=()=>{be()},xe=()=>{be()};return window.addEventListener("focus",pe),document?.addEventListener?.("visibilitychange",xe),()=>{H=!1,window.clearInterval(te),window.removeEventListener("focus",pe),document?.removeEventListener?.("visibilitychange",xe)}},[r,e.configRefreshSeconds,ie]),he(()=>{Ux(n,a,i.current,p,w,We,Ye,J)},[p,w,n,a,We,Ye,J]),he(()=>{if(w||I)return;let z=!0,H=!1;const Y=async()=>{if(!H){H=!0;try{const ae=await t.liveEvents(i.current,X.current);if(!z)return;if(K(ae.mode),B(ae.assignedAgentName||void 0),$(ae.agentTyping?ae.agentTypingName||ae.assignedAgentName||"Agent":void 0),ae.conversationEnded){k(!0),K("ai"),B(void 0),$(void 0),m(be=>be.some(te=>te.id==="live:conversation-ended")?be:[...be,{id:"live:conversation-ended",role:"system",content:e.strings.conversationEnded,liveEventType:"conversation_ended",createdAt:new Date().toISOString()}]);return}if(ae.events.length>0){let be=X.current,te=Date.parse(be);const pe=ae.events.map(xe=>{const it=Date.parse(xe.createdAt);return Number.isFinite(it)&&it>te&&(te=it,be=xe.createdAt),A5(xe)});X.current=be,m(xe=>{const it=new Set(xe.map(nt=>nt.id)),Ze=pe.filter(nt=>!it.has(nt.id));return Ze.length>0?[...xe,...Ze]:xe}),pe.some(xe=>xe.role==="assistant")&&fi("receive")}}catch{}finally{H=!1}}};Y();const ee=window.setInterval(Y,2200);return()=>{z=!1,window.clearInterval(ee)}},[e.strings.conversationEnded,t,w,I]),he(()=>{if(!We){Cc(n,a,[]),C(H=>H.length>0?[]:H);return}p.some(H=>H.role==="user")&&C(H=>{const Y=i.current,ae=[{sessionId:Y,ts:Date.now(),title:M5(p),ended:w},...H.filter(be=>be.sessionId!==Y)];return Cc(n,a,ae),ae.slice(0,Gx)})},[p,w,n,a,We]);const ge=re((z,H)=>{m(Y=>Y.map(ee=>ee.id===z?{...ee,...H}:ee))},[]),Se=re(()=>{c.current!==void 0&&typeof window<"u"&&window.clearInterval(c.current),c.current=void 0},[]),rt=re((z,H)=>{Se(),u.current===z&&(u.current=null),ge(z,{content:H,pending:!1,streaming:!1})},[Se,ge]),fr=re((z,H,Y)=>{const ee=H.trim();if(!ee||typeof window>"u"){rt(z,ee);return}Se(),u.current=z;const ae=ee.match(/\S+\s*/g)??[ee],be=Y&&Y>0?Y:ae.length*95,te=Math.max(28,Math.min(150,be/Math.max(ae.length,1)));let pe=0;ge(z,{content:"",pending:!1,streaming:!0}),c.current=window.setInterval(()=>{pe+=1;const xe=ae.slice(0,pe).join("");ge(z,{content:xe,pending:!1,streaming:pe<ae.length}),pe>=ae.length&&(Se(),u.current===z&&(u.current=null),ge(z,{content:ee,pending:!1,streaming:!1}))},te)},[Se,rt,ge]),er=re(()=>{const z=u.current;Se(),u.current=null,z&&ge(z,{pending:!1,streaming:!1})},[Se,ge]),tr=re(z=>{if(w||I||O==="ai"||typeof window>"u")return;if(ue.current!==void 0&&window.clearTimeout(ue.current),!z){if(!_e.current)return;_e.current=!1,Te.current=0,t.typing(i.current,!1).catch(()=>{});return}const H=Date.now();(!_e.current||H-Te.current>2500)&&(_e.current=!0,Te.current=H,t.typing(i.current,!0).catch(()=>{})),ue.current=window.setTimeout(()=>{_e.current&&(_e.current=!1,Te.current=0,t.typing(i.current,!1).catch(()=>{}))},1600)},[t,w,I,O]);he(()=>()=>{ue.current!==void 0&&typeof window<"u"&&window.clearTimeout(ue.current)},[]),he(()=>()=>Se(),[Se]);const ut=re((z,H,Y={})=>{er(),b(!0);const ee=new AbortController;o.current=ee;const ae=!!(h?.allowVoiceInput&&h?.voiceOutputEnabled&&h.talkbackMode!=="text"),be=!!(Y.forceVoicePlayback&&ae);t.stream(z,i.current,{voicePlaybackRequested:!!Y.forceVoicePlayback,signal:ee.signal,onChunk:te=>{be||(Y.forceVoicePlayback&&te&&(f.current[H]=!0),m(pe=>pe.map(xe=>xe.id===H?{...xe,content:xe.content+te,pending:!1,streaming:!0}:xe)))}}).then(te=>{if(te.liveMode&&(K(te.liveMode),B(te.assignedAgentName||void 0)),te.liveMode&&te.liveMode!=="ai"&&!te.answer.trim()){m(it=>it.filter(Ze=>Ze.id!==H));return}const pe=!!f.current[H];delete f.current[H];const xe=!!(Y.forceVoicePlayback&&ae&&te.audioBase64&&te.answer.trim()&&!pe);if(m(it=>it.map(Ze=>Ze.id===H?{...Ze,content:xe?"":te.answer||Ze.content||e.strings.emptyReply,pending:!1,streaming:xe,error:!1,retryText:void 0,sources:te.sources,suggestedReplies:te.suggestedReplies,availableActions:te.availableActions,handoffOffered:te.handoffOffered,requestedContactFields:te.requestedContactFields,visualization:te.visualization}:Ze)),fi("receive"),Y.forceVoicePlayback&&!te.audioBase64&&kc(ae?"Talkback expected backend TTS audio, but the chat response did not include audioBase64.":"Talkback voice was requested, but the loaded widget token config does not enable provider TTS.",{voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode,voiceProvider:h?.voiceProvider,hasAudioBase64:!!te.audioBase64}),Y.forceVoicePlayback){const it=Vx(s,l,te.audioBase64,te.mimeType,h?.voiceSpeed??1,te.answer,!0,Ze=>{S(!0),xe&&fr(H,te.answer,Ze)},()=>{S(!1),xe&&rt(H,te.answer)});xe&&!it&&rt(H,te.answer)}te.answer&&e.onMessage?.({role:"assistant",content:te.answer}),te.handoffOffered&&e.onHandoff?.(),te.conversationEnded&&k(!0)}).catch(te=>{if(ee.signal.aborted){delete f.current[H],ge(H,{pending:!1,streaming:!1});return}delete f.current[H];const pe=u5(te,e.strings);ge(H,{content:pe,pending:!1,streaming:!1,error:!0,retryText:z})}).finally(()=>{delete f.current[H],b(!1),o.current=null})},[t,e,ge,h?.allowVoiceInput,h?.talkbackMode,h?.voiceOutputEnabled,h?.voiceSpeed,er]),hr=re((z,H={})=>{const Y=z.trim(),{imageUrl:ee,attachmentName:ae,attachmentText:be,forceVoicePlayback:te,userMessageId:pe}=H;if(!Y&&!ee&&!be||y||w)return;g.current=!0;let xe=Y;if(be){const nt=ae?` "${ae}"`:"";xe=`${Y}
|
|
30
|
+
`).replace(/[ \t]{2,}/g," ").trim(),on=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,Ec=(t,e)=>{typeof console>"u"||console.warn(`[centrinfo-widget] ${t}`,e??{})},n1=(t,e,r,n,a=1,i,o=!1,s,l)=>{t.current?.pause(),t.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),e.current=null;const c=()=>{const d=i?.trim();if(!o||!d||typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return!1;const p=new SpeechSynthesisUtterance(d);let m=!1;const g=()=>{m||(m=!0,e.current===p&&(e.current=null,l?.()))};return p.rate=a,p.lang=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en-US",p.onend=g,p.onerror=g,e.current=p,s?.(),window.speechSynthesis.cancel(),window.speechSynthesis.speak(p),!0};if(!r||typeof Audio>"u")return c();const u=new Audio(`data:${n||"audio/mpeg"};base64,${r}`);let f=!1;const h=()=>{f||(f=!0,t.current===u&&(t.current=null,l?.()))};return u.playbackRate=a,u.onended=h,u.onerror=h,t.current=u,u.play().then(()=>{if(t.current!==u){h();return}s?.(Number.isFinite(u.duration)?u.duration*1e3:void 0)}).catch(()=>{c()||h()}),!0},$5=t=>{try{return t==="none"?null:t==="session"?sessionStorage:localStorage}catch{return null}},W5=t=>{let e=2166136261;for(let r=0;r<t.length;r++)e^=t.charCodeAt(r),e=Math.imul(e,16777619);return(e>>>0).toString(36)},U5=t=>{try{const e=t?.split(".")[1];if(!e)return;const r=e.replace(/-/g,"+").replace(/_/g,"/"),n=JSON.parse(atob(r.padEnd(Math.ceil(r.length/4)*4,"=")));for(const a of["sub","external_user_id","user_id"]){const i=n[a];if(typeof i=="string"&&i.trim())return i.trim()}}catch{}},Y5=t=>{const e=t.user?.externalId?.trim()||t.user?.userId?.trim()||t.user?.email?.trim().toLowerCase()||U5(t.identityToken)||(t.identityToken||t.getIdentityToken?"authenticated":"anonymous");return`${t.token.slice(0,12)}:${t.chatSurface}:${W5(e)}`},Qo=t=>`${t.chatSurface}:${on()}`,q5=t=>t.slice(0,12),Jo=t=>`centrinfo:session:${t}`,cp=t=>`centrinfo:visitor:${t}`,Oc=(t,e)=>`centrinfo:chat:${t}:${e}`,up=t=>`centrinfo:history:${t}`,a1=20,fp=720*60*60*1e3,X5=1440*60*1e3,Z5=(t,e)=>{try{return JSON.parse(t?.getItem(cp(e))||"{}")}catch{return{}}},K5=(t,e,r)=>{if(!t)return Qo(r);try{const n=Jo(e),a=t.getItem(n);if(a)return a;const i=Qo(r);return t.setItem(n,i),i}catch{return Qo(r)}},i1=(t,e,r)=>{if(!t)return{};try{const n=t.getItem(Oc(e,r));return n?JSON.parse(n):{}}catch{return{}}},o1=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i}=i1(t,e,r);return Array.isArray(i)?typeof a=="number"&&Date.now()>a?[]:typeof n=="number"&&Date.now()-n>fp?[]:i:[]},j5=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i,ended:o}=i1(t,e,r);return!Array.isArray(i)||i.length===0||typeof a=="number"&&Date.now()>a||typeof n=="number"&&Date.now()-n>fp?!1:o===!0||typeof n=="number"&&Date.now()-n>X5},Q5=t=>Number.isFinite(t??NaN)?Math.max(5,Math.min(200,Math.round(t))):50,J5=t=>Number.isFinite(t??NaN)?Math.max(1,Math.min(365,Math.round(t)))*24*60*60*1e3:fp,s1=(t,e,r,n,a,i,o,s)=>{if(t)try{if(!i){t.removeItem(Oc(e,r));return}const l=n.filter(u=>!u.pending).slice(-o);if(l.length===0)return;const c=Date.now();t.setItem(Oc(e,r),JSON.stringify({ts:c,expiresAt:c+s,messages:l,ended:a}))}catch{}},eE=(t,e)=>{if(!t)return[];try{const r=t.getItem(up(e)),n=r?JSON.parse(r):[];return Array.isArray(n)?n:[]}catch{return[]}},Nc=(t,e,r)=>{if(t)try{t.setItem(up(e),JSON.stringify(r.slice(0,a1)))}catch{}},l1=(t,e)=>{if(t)try{const r=`centrinfo:chat:${e}:`,n=new Set([Jo(e),cp(e),up(e)]),a=[];for(let i=0;i<t.length;i++){const o=t.key(i);o&&(n.has(o)||o.startsWith(r))&&a.push(o)}a.forEach(i=>t.removeItem(i))}catch{}},tE=t=>{const n=(t.find(a=>a.role==="user"&&a.content.trim())?.content||t.find(a=>a.content.trim())?.content||"").trim().replace(/\s+/g," ");return n.length>60?n.slice(0,60)+"…":n||"Conversation"},rE=t=>({id:`live:${t.id}`,role:t.type==="chat"||t.type==="ai_resume"?"assistant":"system",content:t.content,authorName:t.authorName,liveEventType:t.type,createdAt:t.createdAt}),nE=(t,e,r=!0)=>{const n=W($5(e.persistence)).current,a=Y5(e),i=W(K5(n,a,e)),o=W(null),s=W(null),l=W(null),c=W(void 0),u=W(null),f=W({}),[h,d]=V(null),[p,m]=V(()=>o1(n,a,i.current)),g=W(p.length>0),v=W(p.some(B=>B.role==="user")),[y,b]=V(!1),[x,S]=V(!1),[w,k]=V(()=>j5(n,a,i.current)),[T,C]=V(()=>Z5(n,a)),[A,M]=V(()=>eE(n,a)),[I,L]=V(null),[P,N]=V([]),[O,q]=V("ai"),[R,z]=V(void 0),[F,X]=V(void 0),te=W(new Date().toISOString()),fe=W(void 0),me=W(!1),we=W(0),Ze=W(T);ie(()=>{Ze.current=T},[T]);const Ie=h?.memoryEnabled!==!1,tt=Q5(h?.memoryMessageCap),Ge=J5(h?.memoryRetentionDays),Me=Q(()=>{o.current?.abort(),l1(n,a),l1(n,q5(e.token));const B=Qo(e);i.current=B;try{n?.setItem(Jo(a),B)}catch{}L(null),N([]),k(!1),M([]),C({}),q("ai"),z(void 0),X(void 0),te.current=new Date().toISOString(),m(h?[{id:on(),role:"assistant",content:h.greeting,availableActions:h.availableActions,actions:h.actions}]:[])},[n,a,e.token,h]),re=Q(B=>{try{n?.setItem(cp(a),JSON.stringify(B))}catch{}},[n,a]),he=Q(B=>{const H=(B.email??"").trim().toLowerCase(),j=(Ze.current.email??"").trim().toLowerCase();H&&j&&H!==j&&Me();const K={};B.email?.trim()&&(K.email=B.email.trim()),B.phone?.trim()&&(K.phone=B.phone.trim());const se=[B.firstName,B.lastName].filter(ke=>!!ke?.trim()).join(" ").trim()||B.name?.trim()||"";se&&(K.name=se),Object.keys(K).length>0&&C(ke=>{const be={...K,...ke};return re(be),be}),t.identify(i.current,B).catch(()=>{})},[t,re,Me]),Be=Q(B=>{d(B),m(H=>{if(H.length===0)return[{id:on(),role:"assistant",content:B.greeting,availableActions:B.availableActions,actions:B.actions}];const j=H.some(ae=>ae.role==="user"),K=H[0];return!j&&K?.role==="assistant"?[{...K,content:B.greeting,availableActions:B.availableActions,actions:B.actions},...H.slice(1)]:H})},[]);ie(()=>{if(h?.memoryEnabled===!1){try{n?.removeItem(Oc(a,i.current))}catch{}Nc(n,a,[]),M([]),L(null),N([]),m(B=>g.current?(g.current=!1,h?[{id:on(),role:"assistant",content:h.greeting,availableActions:h.availableActions,actions:h.actions}]:[]):B)}},[h,n,a]);const pe=Q(async()=>{const B=await t.bootstrap();Be(B)},[Be,t]);ie(()=>{let B=!0;const H=j=>j.messages.map(K=>({id:K.id,role:K.role,content:K.content,authorName:K.authorName,liveEventType:K.messageType,sources:K.sources,visualization:K.visualization,artifacts:K.artifacts,createdAt:K.createdAt}));return t.history().then(j=>{if(!B||j.conversations.length===0)return;const K=j.conversations.map(be=>({sessionId:be.sessionId,ts:Date.parse(be.lastSeenAt)||Date.now(),title:be.title,ended:be.ended}));for(const be of j.conversations)s1(n,a,be.sessionId,H(be),be.ended,!0,tt,Ge);Nc(n,a,K),M(K);const ae=j.conversations.find(be=>be.sessionId===j.activeSessionId);if(!ae||v.current)return;const se=H(ae);i.current=ae.sessionId,g.current=se.length>0;try{n?.setItem(Jo(a),ae.sessionId)}catch{}const ke=se[se.length-1]?.createdAt;ke&&(te.current=ke),k(ae.ended),m(se)}).catch(()=>{}),()=>{B=!1}},[tt,Ge,a,n,t]),ie(()=>{let B=!0;return t.bootstrap().then(H=>{B&&Be(H)}),e.user&&he(e.user),()=>{B=!1}},[Be,t]),ie(()=>{const B=e.configRefreshSeconds;if(!r||B<=0||typeof window>"u")return;let H=!0,j=!1;const K=Math.max(10,B)*1e3,ae=()=>typeof document>"u"||document.visibilityState!=="hidden",se=async()=>{if(!(!H||j||!ae())){j=!0;try{await pe()}catch{}finally{j=!1}}};se();const ke=window.setInterval(se,K),be=()=>{se()},J=()=>{se()};return window.addEventListener("focus",be),document?.addEventListener?.("visibilitychange",J),()=>{H=!1,window.clearInterval(ke),window.removeEventListener("focus",be),document?.removeEventListener?.("visibilitychange",J)}},[r,e.configRefreshSeconds,pe]),ie(()=>{s1(n,a,i.current,p,w,Ie,tt,Ge)},[p,w,n,a,Ie,tt,Ge]),ie(()=>{if(w||I)return;let B=!0,H=!1;const j=async()=>{if(!H){H=!0;try{const ae=await t.liveEvents(i.current,te.current);if(!B)return;if(q(ae.mode),z(ae.assignedAgentName||void 0),X(ae.agentTyping?ae.agentTypingName||ae.assignedAgentName||"Agent":void 0),ae.conversationEnded){k(!0),q("ai"),z(void 0),X(void 0),m(se=>se.some(ke=>ke.id==="live:conversation-ended")?se:[...se,{id:"live:conversation-ended",role:"system",content:e.strings.conversationEnded,liveEventType:"conversation_ended",createdAt:new Date().toISOString()}]);return}if(ae.events.length>0){let se=te.current,ke=Date.parse(se);const be=ae.events.map(J=>{const ht=Date.parse(J.createdAt);return Number.isFinite(ht)&&ht>ke&&(ke=ht,se=J.createdAt),rE(J)});te.current=se,m(J=>{const ht=new Set(J.map(Je=>Je.id)),rt=be.filter(Je=>!ht.has(Je.id));return rt.length>0?[...J,...rt]:J}),be.some(J=>J.role==="assistant")&&Mi("receive")}}catch{}finally{H=!1}}};j();const K=window.setInterval(j,2200);return()=>{B=!1,window.clearInterval(K)}},[e.strings.conversationEnded,t,w,I]),ie(()=>{if(!Ie){Nc(n,a,[]),M(H=>H.length>0?[]:H);return}p.some(H=>H.role==="user")&&M(H=>{const j=i.current,ae=[{sessionId:j,ts:Date.now(),title:tE(p),ended:w},...H.filter(se=>se.sessionId!==j)];return Nc(n,a,ae),ae.slice(0,a1)})},[p,w,n,a,Ie]);const Se=Q((B,H)=>{m(j=>j.map(K=>K.id===B?{...K,...H}:K))},[]),ct=Q(()=>{c.current!==void 0&&typeof window<"u"&&window.clearInterval(c.current),c.current=void 0},[]),pt=Q((B,H)=>{ct(),u.current===B&&(u.current=null),Se(B,{content:H,pending:!1,streaming:!1})},[ct,Se]),sn=Q((B,H,j)=>{const K=H.trim();if(!K||typeof window>"u"){pt(B,K);return}ct(),u.current=B;const ae=K.match(/\S+\s*/g)??[K],se=j&&j>0?j:ae.length*95,ke=Math.max(28,Math.min(150,se/Math.max(ae.length,1)));let be=0;Se(B,{content:"",pending:!1,streaming:!0}),c.current=window.setInterval(()=>{be+=1;const J=ae.slice(0,be).join("");Se(B,{content:J,pending:!1,streaming:be<ae.length}),be>=ae.length&&(ct(),u.current===B&&(u.current=null),Se(B,{content:K,pending:!1,streaming:!1}))},ke)},[ct,pt,Se]),cr=Q(()=>{const B=u.current;ct(),u.current=null,B&&Se(B,{pending:!1,streaming:!1})},[ct,Se]),Y=Q(B=>{if(w||I||O==="ai"||typeof window>"u")return;if(fe.current!==void 0&&window.clearTimeout(fe.current),!B){if(!me.current)return;me.current=!1,we.current=0,t.typing(i.current,!1).catch(()=>{});return}const H=Date.now();(!me.current||H-we.current>2500)&&(me.current=!0,we.current=H,t.typing(i.current,!0).catch(()=>{})),fe.current=window.setTimeout(()=>{me.current&&(me.current=!1,we.current=0,t.typing(i.current,!1).catch(()=>{}))},1600)},[t,w,I,O]);ie(()=>()=>{fe.current!==void 0&&typeof window<"u"&&window.clearTimeout(fe.current)},[]),ie(()=>()=>ct(),[ct]);const le=Q((B,H,j={})=>{cr(),b(!0);const K=sp();let ae=!1;const se=new AbortController;o.current=se;const ke=!!(h?.allowVoiceInput&&h?.voiceOutputEnabled&&h.talkbackMode!=="text"),be=!!(j.forceVoicePlayback&&ke);t.stream(B,i.current,{voicePlaybackRequested:!!j.forceVoicePlayback,signal:se.signal,onChunk:J=>{J&&!ae&&(ae=!0,lp("data-first-chunk",K)),!be&&(j.forceVoicePlayback&&J&&(f.current[H]=!0),m(ht=>ht.map(rt=>rt.id===H?{...rt,content:rt.content+J,pending:!1,streaming:!0}:rt)))}}).then(J=>{if(J.liveMode&&(q(J.liveMode),z(J.assignedAgentName||void 0)),J.liveMode&&J.liveMode!=="ai"&&!J.answer.trim()){m(Je=>Je.filter(ut=>ut.id!==H));return}const ht=!!f.current[H];delete f.current[H];const rt=!!(j.forceVoicePlayback&&ke&&J.audioBase64&&J.answer.trim()&&!ht);if(m(Je=>Je.map(ut=>ut.id===H?{...ut,content:rt?"":J.answer||ut.content||e.strings.emptyReply,pending:!1,streaming:rt,error:!1,retryText:void 0,sources:J.sources,suggestedReplies:J.suggestedReplies,availableActions:J.availableActions,actions:J.actions,selectedAction:J.selectedAction,handoffOffered:J.handoffOffered,requestedContactFields:J.requestedContactFields,visualization:J.visualization,artifacts:J.artifacts}:ut)),Mi("receive"),j.forceVoicePlayback&&!J.audioBase64&&Ec(ke?"Talkback expected backend TTS audio, but the chat response did not include audioBase64.":"Talkback voice was requested, but the loaded widget token config does not enable provider TTS.",{voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode,voiceProvider:h?.voiceProvider,hasAudioBase64:!!J.audioBase64}),j.forceVoicePlayback){const Je=n1(s,l,J.audioBase64,J.mimeType,h?.voiceSpeed??1,J.answer,!0,ut=>{S(!0),rt&&sn(H,J.answer,ut)},()=>{S(!1),rt&&pt(H,J.answer)});rt&&!Je&&pt(H,J.answer)}J.answer&&e.onMessage?.({role:"assistant",content:J.answer}),J.handoffOffered&&e.onHandoff?.(),J.conversationEnded&&k(!0)}).catch(J=>{if(se.signal.aborted){delete f.current[H],Se(H,{pending:!1,streaming:!1});return}delete f.current[H];const ht=z5(J,e.strings);Se(H,{content:ht,pending:!1,streaming:!1,error:!0,retryText:B})}).finally(()=>{lp("data-complete",K),delete f.current[H],b(!1),o.current=null})},[t,e,Se,h?.allowVoiceInput,h?.talkbackMode,h?.voiceOutputEnabled,h?.voiceSpeed,cr]),G=Q((B,H={})=>{const j=B.trim(),{imageUrl:K,attachmentName:ae,attachmentText:se,forceVoicePlayback:ke,userMessageId:be}=H;if(!j&&!K&&!se||y||w)return;v.current=!0;let J=j;if(se){const Je=ae?` "${ae}"`:"";J=`${j}
|
|
31
31
|
|
|
32
|
-
[Attached file${
|
|
33
|
-
${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,imageUrl:ee,attachmentName:ae},Ze=Qr();m(nt=>[...!!(pe&&nt.some(bt=>bt.id===pe))?nt.map(bt=>bt.id===pe?{...bt,content:Y,pending:!1,streaming:!1,imageUrl:ee,attachmentName:ae}:bt):[...nt,it],{id:Ze,role:"assistant",content:"",pending:!0}]),fi("send"),e.onMessage?.({role:"user",content:xe}),ut(xe,Ze,{forceVoicePlayback:te})},[y,w,e,ut]),zt=re(()=>o.current?.abort(),[]),Jd=re(()=>{er(),s.current?.pause(),s.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),l.current=null,S(!1)},[er]),ep=re(z=>{const H=p5(z);if(!H)return Promise.resolve(!1);const Y=!!(h?.allowVoiceInput&&h?.voiceOutputEnabled&&h.talkbackMode!=="text"),ee=(ae,be)=>new Promise(te=>{let pe=!1;Vx(s,l,ae,be,h?.voiceSpeed??1,H,!0,()=>{pe=!0,S(!0)},()=>{S(!1),te(pe)})||(S(!1),te(!1))});return Y?t.speak(H).then(ae=>ae.audioBase64?ee(ae.audioBase64,ae.mimeType):(kc("Talkback prompt TTS did not return provider audio.",{providerReady:ae.providerReady,message:ae.message,voiceProvider:h?.voiceProvider,voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode}),ee())).catch(ae=>(kc("Talkback prompt TTS request failed before audio playback.",{error:ae instanceof Error?ae.message:String(ae),voiceProvider:h?.voiceProvider,voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode}),ee())):(kc("Talkback prompt wanted voice, but the loaded widget token config has provider TTS disabled.",{voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode,voiceProvider:h?.voiceProvider}),ee())},[h?.allowVoiceInput,h?.talkbackMode,h?.voiceOutputEnabled,h?.voiceSpeed,t]),tp=re((z,H)=>{y||w||!H||(ge(z,{content:"",pending:!0,streaming:!1,error:!1}),fi("send"),ut(H,z))},[y,w,ge,ut]),rp=re((z,H,Y)=>{ge(z,{feedback:H});const ee=p.findIndex(te=>te.id===z),ae=ee>=0?p[ee]?.content:void 0;let be;for(let te=ee-1;te>=0;te--)if(p[te]?.role==="user"){be=p[te]?.content;break}t.sendFeedback({sessionId:i.current,messageId:z,rating:H,comment:Y,question:be,answer:ae}).catch(()=>{})},[t,ge,p]),da=re(async(z,H,Y={})=>{e.onAction?.(z);const ee=await t.action(z,{sessionId:i.current,...H}),ae={};return Y.name?.trim()&&(ae.name=Y.name.trim()),Y.email?.trim()&&(ae.email=Y.email.trim()),Y.phone?.trim()&&(ae.phone=Y.phone.trim()),Object.keys(ae).length>0&&(M(be=>{const te={...be,...ae};return j(te),te}),ae.email&&z!=="contact"&&t.action("contact",{sessionId:i.current,...ae}).catch(()=>{})),fi("receive"),ee},[t,e,j]),np=re(z=>{const H=z.trim();H&&m(Y=>Y.some(ee=>ee.role==="assistant"&&ee.content===H)?Y:[...Y,{id:Qr(),role:"assistant",content:H}])},[]),ap=re(z=>{g.current=!0;const H=Qr();return m(Y=>[...Y,{id:H,role:"user",content:z.trim(),pending:!0}]),H},[]),ip=re((z,H)=>{m(Y=>Y.map(ee=>ee.id===z?{...ee,...H}:ee))},[]),pa=re(z=>{m(H=>H.filter(Y=>Y.id!==z))},[]),Ho=re((z,H)=>{t.sendFeedback({sessionId:i.current,messageId:"__csat__",rating:z,comment:H}).catch(()=>{})},[t]),op=re((z,H,Y,ee)=>t.transcribe(z,H,Y,ee),[t]),va=re((z,H,Y)=>t.extract(z,H,Y),[t]),Ac=re(z=>t.searchGifs(z),[t]),hi=re((z,H)=>t.demoSlots(z,H),[t]),Vo=re(z=>hr("",{imageUrl:z}),[hr]),Je=e.demo||!!e.gifApiKey,st=re(()=>{o.current?.abort(),k(!0),t.endConversation(i.current).catch(()=>{})},[t]),ft=re(()=>{o.current?.abort();const z=Bo(e);i.current=z;try{n?.setItem(zo(a),z)}catch{}P(null),E([]),k(!1),K("ai"),B(void 0),$(void 0),X.current=new Date().toISOString(),m(h?[{id:Qr(),role:"assistant",content:h.greeting,availableActions:h.availableActions}]:[])},[n,a,h]),Er=re(z=>{if(We){if(z===i.current){P(null);return}E($x(n,a,z)),P(z)}},[n,a,We]),ga=re(()=>{P(null),E([])},[]),dr=e.starters.length>0?e.starters:h?.starterQuestions??[],Go=h?.featuredLinks??[];return{persona:h,messages:p,sending:y,assistantSpeaking:x,visitor:T,starters:dr,featuredLinks:Go,hasEmail:!!T.email,liveMode:O,assignedAgentName:L,agentTypingName:V,send:hr,sendGif:Vo,notifyTyping:tr,stop:zt,retry:tp,rateMessage:rp,injectAssistant:np,appendUserDraft:ap,patchMessage:ip,removeMessage:pa,submitCsat:Ho,submitForm:da,transcribe:op,extract:va,searchGifs:Ac,demoSlots:hi,gifEnabled:Je,identify:Q,ended:w,endConversation:st,startNew:ft,history:We?A:[],viewingSessionId:I,viewMessages:R,openConversation:Er,closeHistoryView:ga,shutdown:le,stopSpeaking:Jd,speakAssistantText:ep}},I5=({name:t,greeting:e})=>_("section",{class:"cf-empty-welcome","aria-label":`${t} welcome`,children:[_("span",{class:"cf-empty-welcome__eyebrow",children:"Ready when you are"}),_("h2",{children:t}),e?_("p",{children:e}):_("p",{children:"Ask a question, leave a message, or book a demo."})]}),P5=t=>{const[e,r]=W("light");return he(()=>{if(t!=="auto"||typeof matchMedia>"u")return;const n=matchMedia("(prefers-color-scheme: dark)"),a=()=>r(n.matches?"dark":"light");return a(),n.addEventListener("change",a),()=>n.removeEventListener("change",a)},[t]),t==="auto"?e:t},qx=1e4,L5=1400,R5=.0038,Xx=.0022,Zx=1600,Kx=550,E5=350,O5=.001,jx=6e4,Qx=90,N5=.009,B5=280,z5=250,Jx=250,F5=t=>t.replace(/\[[^\]]{0,60}\]/g," ").replace(/\(([^)]{0,60})\)/g,(e,r)=>e1.has(r.trim().toLowerCase().replace(/[.!?,…]+$/,"").replace(/\s+/g," "))?" ":e).replace(/\*[^*]{0,60}\*/g," ").replace(/\s+/g," ").trim(),e1=new Set(["background noise","engine noise","noise","inaudible","unintelligible","silence","no speech","static","music","laughter","applause","wind","breathing","click","clicks","clicking","mouse click","mouse clicks","beep","beeps","beeping","tap","taps","tapping","typing","keyboard typing","cough","coughing","sigh","hmm","mm","mmm","uh","um","ah","oh"]),H5=t=>{const e=t.trim().toLowerCase().replace(/[()[\]*]/g," ").replace(/[.!?,…]+$/,"").replace(/\s+/g," ").trim();return!e||/^(?:sh+\s*)+$/.test(e)?!0:e1.has(e)},V5=t=>{const e=t.trim().toLowerCase().replace(/\s+/g," ");return e?e.includes("transcribe this audio recording verbatim")||e.includes("preserve the spoken language and any code-switching")||e.includes("output only the transcribed text, no commentary"):!1},t1={end:"end the call",mute:"mute your microphone",minimize:"minimize the chat",expand:"expand the view",shrink:"exit the expanded view"},Kd=t=>t.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu," ").replace(/\s+/g," ").trim(),G5=[{action:"shrink",re:/\b(?:exit|leave|quit|close)\b[\s\w]*\b(?:full ?screen|expanded|theat(?:er|re))\b|\bshrink\b|\bsmaller view\b/},{action:"end",re:/\b(?:end|close|stop|finish|hang ?up|quit|exit)\b[\s\w]*\b(?:call|chat|conversation|convo|session|talking)\b|\bhang ?up\b|\bgood ?bye\b|^bye(?: bye)?$/},{action:"mute",re:/\bmute\b|\bstop listening\b/},{action:"minimize",re:/\bminimi[sz]e\b|\bhide\b[\s\w]*\b(?:chat|call|window|widget)\b/},{action:"expand",re:/\bexpand\b|\bmaximi[sz]e\b|\bfull ?screen\b|\btheat(?:er|re) mode\b|\bbigger view\b/}],W5=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,$5=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,U5=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,Y5=t=>{const e=Kd(t);if(!e)return null;for(const{action:r,re:n}of G5)if(n.test(e)){const a=e.split(" ").length;return{action:r,confident:r==="end"?a<=10:a<=6}}return null},Mc=t=>`I didn't catch yes or no. Say yes to ${t1[t]}, or no to keep talking.`,jd=t=>`I caught some audio, but not enough clear words. Try again a little closer to the mic, or type your question for ${t?.agentName?.trim()||"the assistant"}.`,q5=t=>{const e=Kd(t).replace(/\b(?:um|uh|erm|hmm)\b/g,"").trim();return!e||e.split(/\s+/).length<=2&&/^(?:can|could|would|will|do|does|is|are|what|why|how|where|when)\b/.test(e)?!0:/\b(?:can you|could you|would you|will you|do you|can i|could i|would i|i want to|i need to|tell me about|what about|how about|about|with|to|for|please)$/i.test(e)},X5=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result??"").split(",")[1]??""),n.onerror=()=>r(n.error),n.readAsDataURL(t)}),r1=(t,e)=>{const r=window.AudioContext??window.webkitAudioContext;if(!r)return null;let n,a=!1;const i=new r;try{const o=i.createMediaStreamSource(t),s=i.createAnalyser();s.fftSize=512,o.connect(s);const l=new Uint8Array(s.frequencyBinCount),c=()=>{if(a)return;s.getByteTimeDomainData(l);let u=0;for(const f of l){const h=(f-128)/128;u+=h*h}e(Math.sqrt(u/l.length),performance.now()),a||(n=requestAnimationFrame(c))};c()}catch{return i.close().catch(()=>{}),null}return{stop:()=>{a||(a=!0,n!==void 0&&cancelAnimationFrame(n),n=void 0,i.close().catch(()=>{}))}}},n1=t=>({...t?{deviceId:{exact:t}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),Z5=({transport:t,config:e,bindControls:r})=>{const n=e.strings,[a,i]=W(e.openByDefault),{persona:o,messages:s,sending:l,assistantSpeaking:c,visitor:u,hasEmail:f,liveMode:h,assignedAgentName:d,agentTypingName:p,starters:m,featuredLinks:v,send:g,sendGif:y,notifyTyping:b,stop:x,retry:S,rateMessage:w,injectAssistant:k,appendUserDraft:T,patchMessage:M,removeMessage:A,submitCsat:C,submitForm:I,transcribe:P,extract:R,searchGifs:E,demoSlots:O,gifEnabled:K,identify:L,ended:B,endConversation:V,startNew:$,history:X,viewingSessionId:ue,viewMessages:_e,openConversation:Te,closeHistoryView:Ue,shutdown:We,stopSpeaking:Ye,speakAssistantText:J}=D5(t,e,a),[le,j]=W(0),[Q,F]=W("idle"),[ie,ge]=W(!1),[Se,rt]=W(!1),[fr,er]=W(0),[tr,ut]=W(!1),[hr,zt]=W(null),[Jd,ep]=W([]),[tp,rp]=W(""),[da,np]=W(()=>{try{return localStorage.getItem("centrinfo:muted")==="1"}catch{return!1}}),ap=P5(e.theme),ip=s.some(N=>N.role==="assistant"&&(N.pending||N.streaming)),pa=l||ip||c,Ho=o?.soundEnabled??!0;he(()=>{l5(e.sound&&Ho&&!da)},[e.sound,Ho,da]);const op=re(()=>{np(N=>{const Z=!N;try{localStorage.setItem("centrinfo:muted",Z?"1":"0")}catch{}return Z})},[]),va=q(null),Ac=q(null),hi=q(null),Vo=q(0),Je=q(!1),st=q(!1),ft=q(!1),Er=q(0),ga=q(!1),dr=q(null),Go=q(null),z=q([]),H=q(void 0),Y=q(void 0),ee=q(null),ae=q(0),be=q(0),te=q(!1),pe=q(0),xe=q(null),it=q(null),Ze=q(0),nt=q(null),Wo=q([]),$o=q(0),bt=q(0),Dc=q(0),Jr=q(null),di=q(!1),ma=q(null),Or=q(""),sp=q(()=>{}),lp=q(""),Tn=q(l),l1=q(c),c1=q(pa),u1=q(Q),cp=q(0);he(()=>{Tn.current=l},[l]),he(()=>{l1.current=c},[c]),he(()=>{c1.current=pa},[pa]),he(()=>{u1.current=Q},[Q]);const[f1,Uo]=W(!0),[iE,pi]=W(!1),up=q(0),[vi,Yo]=W(!1),h1=q(null),[d1,Ic]=W(!1),[oE,p1]=W(!1),Fe=!!ue,fp=Fe?_e:s,qo=fp.find(N=>N.id===hr&&N.visualization)?.visualization;he(()=>{!hr||qo||(zt(null),ut(!1))},[qo,hr]);const gi=re(()=>{i(!0),j(0),fi("open"),e.onOpen?.(),e.onShow?.()},[e]),Nr=re(()=>{i(!1),ut(!1),zt(null),e.onClose?.(),e.onHide?.(),Ac.current?.focus()},[e]),Xo=re(()=>a?Nr():gi(),[a,gi,Nr]),sE=re(()=>Yo(!0),[]),lE=re(()=>{V(),Yo(!1)},[V]),cE=re(()=>{$(),pi(!1),Uo(!0)},[$]);he(()=>{vi&&h1.current?.focus()},[vi]),he(()=>{r({open:gi,close:Nr,toggle:Xo,identify:L,startNew:$,endConversation:V,shutdown:We})},[r,gi,Nr,Xo,L,$,V,We]),he(()=>{const N=s.filter(Z=>Z.role==="assistant"&&!Z.pending).length;if(a){Vo.current=N;return}N>Vo.current&&j(N-Vo.current)},[s,a]),he(()=>{e.onUnreadChange?.(le)},[le,e]),he(()=>{const N=e.sessionDurationMinutes;if(!N||N<=0)return;const Z=setTimeout(()=>We(),N*60*1e3);return()=>clearTimeout(Z)},[e.sessionDurationMinutes,s,a,We]),he(()=>{const N=e.customLauncherSelector;if(!N||typeof document>"u")return;let Z=[];try{Z=Array.from(document.querySelectorAll(N))}catch{return}const se=me=>{me.preventDefault(),Xo()};return Z.forEach(me=>me.addEventListener("click",se)),()=>Z.forEach(me=>me.removeEventListener("click",se))},[e.customLauncherSelector,Xo]);const v1=q(!1);he(()=>{const N=e.proactiveMessage?.trim();if(!N||v1.current)return;const Z=e.proactiveOnPaths??[],se=typeof location<"u"?location.pathname:"";if(Z.length>0&&!Z.some(Ve=>se.includes(Ve)))return;const me=`centrinfo:proactive:${e.token.slice(0,12)}`;try{if(sessionStorage.getItem(me)==="1")return}catch{}const qe=setTimeout(()=>{if(!(a||B||s.some(Ve=>Ve.role==="user"))){v1.current=!0;try{sessionStorage.setItem(me,"1")}catch{}k(N),gi()}},Math.max(0,e.proactiveDelaySeconds)*1e3);return()=>clearTimeout(qe)},[e.proactiveMessage]),he(()=>{const N=hi.current;if(!a||!N)return;const Z=s[s.length-1],se=Date.now()<up.current;Z?.role==="user"||f1||se?(requestAnimationFrame(()=>{N.scrollTop=N.scrollHeight}),pi(!1),se&&Uo(!0)):pi(!0)},[s,a,l,f1]);const uE=re(()=>{const N=hi.current;if(!N)return;if(Je.current&&!Fe){Uo(!0),pi(!1);return}const Z=N.scrollHeight-N.scrollTop-N.clientHeight<80;Uo(Z),Z&&pi(!1)},[Fe]),Cn=re(()=>{const N=hi.current;N&&(N.scrollTop=N.scrollHeight),pi(!1),Uo(!0)},[]),Pc=re(()=>{up.current=Date.now()+3e3,requestAnimationFrame(Cn)},[Cn]);he(()=>{if(!a||Fe||!ie||Q==="connecting")return;up.current=Date.now()+6e4,Cn();const N=requestAnimationFrame(()=>{Cn(),requestAnimationFrame(Cn)}),Z=[80,180,360].map(se=>window.setTimeout(Cn,se));return()=>{cancelAnimationFrame(N),Z.forEach(se=>window.clearTimeout(se))}},[c,s,a,Cn,l,ie,Fe,Q]);const g1=re(()=>{va.current?.querySelector(".cf-textarea")?.focus()},[]),m1=re(()=>{H.current&&window.clearTimeout(H.current),H.current=void 0,Y.current&&window.clearTimeout(Y.current),Y.current=void 0,ee.current?.stop(),ee.current=null,er(0)},[]),pr=re(()=>{it.current?.stop(),it.current=null,Rr(nt.current),xe.current?.getTracks().forEach(N=>N.stop()),xe.current=null,Ze.current=0,bt.current=0},[]),mi=re(()=>{m1(),Go.current?.getTracks().forEach(N=>N.stop()),Go.current=null},[m1]),Lt=re(()=>{Je.current=!1,ft.current=!1,st.current=!1,ga.current=!1,Jr.current=null,di.current=!1,ma.current=null,Or.current="",ge(!1),rt(!1),ut(!1),zt(null),pr(),Ye();const N=dr.current;N?.state==="recording"?Rr(N):(mi(),F("idle"))},[pr,Ye,mi]),fE=re(()=>{tr&&zt(null),ut(!tr)},[tr]),hE=re(N=>{zt(N),ut(!0)},[]),dE=re(()=>{const N=hr;zt(null),ut(!1),window.requestAnimationFrame(()=>{Array.from(va.current?.querySelectorAll("[data-visualization-message]")??[]).find(se=>se.dataset.visualizationMessage===N)?.focus()})},[hr]),pE=re(()=>{zt(null),ut(!1)},[]),y1=re((N,Z)=>{if(Date.now()-Er.current>=jx){F("timeout"),Y.current=window.setTimeout(()=>Lt(),2400);return}F(N),Y.current=window.setTimeout(()=>{Je.current&&!st.current&&!l1.current&&Z()},L5)},[Lt]),Zo=re((N,Z,se)=>{Date.now()-Er.current<jx&&!st.current&&(ft.current=!0,J(Z)),y1(N,se)},[y1,J]),_1=re((N,Z)=>{Pc(),Er.current=Date.now(),ft.current=!0,Z&&M(Z,{content:N,pending:!0,streaming:!1});const se=()=>{if(Je.current){if(Tn.current){window.setTimeout(se,80);return}Z&&ma.current===Z&&(ma.current=null),g(N,{forceVoicePlayback:!0,userMessageId:Z})}};se()},[Pc,M,g]),Lc=re(async(N,Z,se,me="normal",qe)=>{let Ve=null;const Mn=gr=>Ve||(Pc(),Ve=ma.current||T(gr),ma.current=Ve,M(Ve,{content:Or.current||gr,pending:!0,streaming:!1}),Ve),vr=()=>{Ve&&(ma.current===Ve&&(ma.current=null),Or.current="",A(Ve),Ve=null)},yi=()=>{Or.current="",F("listening"),window.setTimeout(()=>{Je.current&&!st.current&&!Tn.current&&!dr.current&&se()},120)},CE=N.size===0,ME=N.size<E5&&Z<O5;if(CE||ME){if(me==="barge"){yi();return}const gr=Jr.current;Zo("noise",gr?Mc(gr):jd(o),se),Or.current="";return}F("processing");const AE=++cp.current,vp=Mn("Listening...");try{const gr=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0;M(vp,{content:Or.current?`${Or.current} ...`:"Transcribing...",pending:!0});const Oc=await X5(N);if(!Oc.trim()){if(vr(),me==="barge"){yi();return}Zo("noise",Jr.current?Mc(Jr.current):jd(o),se);return}const DE=F5(await P(Oc,N.type,gr,qe));if(AE!==cp.current){vr();return}const en=[Or.current,DE].map(mr=>mr.trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim();if(!en||H5(en)||V5(en)){if(vr(),me==="barge"){yi();return}const mr=Jr.current;Zo("misunderstood",mr?Mc(mr):jd(o),se);return}const Nc=Jr.current;if(Nc){const mr=Kd(en);if(W5.test(mr)||Nc==="end"&&U5.test(mr)){vr(),Jr.current=null,sp.current(Nc);return}if($5.test(mr)){vr(),Jr.current=null;const C1="Okay, never mind — what would you like to know?";k(C1),ft.current=!0,F("speaking"),J(C1);return}vr();const T1=Mc(Nc);k(T1),ft.current=!0,F("speaking"),J(T1);return}const Qo=Y5(en);if(Qo){if(vr(),Er.current=Date.now(),Qo.confident){sp.current(Qo.action);return}Jr.current=Qo.action;const mr=`Just to confirm — you want me to ${t1[Qo.action]}? Please say yes or no.`;k(mr),ft.current=!0,F("speaking"),J(mr);return}if(M(vp,{content:en,pending:!0}),q5(en)){Or.current=en,F("listening"),se();return}Or.current="",_1(en,vp)}catch(gr){if(vr(),me==="barge"){yi();return}const Oc=gr instanceof Error&&gr.message.trim()?` (${gr.message.trim()})`:"";Zo("misunderstood",`I couldn't convert your speech to text. Please check the speech service configuration or type your question.${Oc}`,se)}},[T,Pc,Zo,k,M,o,A,_1,J,P]),Ft=re(async()=>{if(!(!Je.current||st.current)&&!(!o?.allowVoiceInput||B||Fe)&&!Tn.current&&!dr.current){pr(),ft.current=!1;try{F("connecting");const N=await navigator.mediaDevices.getUserMedia({audio:n1(lp.current)});if(!Je.current||st.current){N.getTracks().forEach(me=>me.stop());return}navigator.mediaDevices.enumerateDevices().then(me=>{ep(me.filter(qe=>qe.kind==="audioinput").map((qe,Ve)=>({deviceId:qe.deviceId,label:qe.label||`Microphone ${Ve+1}`})))}).catch(()=>{});const Z=Vd(N);dr.current=Z,Go.current=N,z.current=[],ae.current=0,te.current=!1,pe.current=0;const se=performance.now();ee.current=r1(N,(me,qe)=>{if(ae.current=Math.max(ae.current,me),me>=R5)te.current=!0,pe.current=0;else if(te.current&&me<=Xx){pe.current||(pe.current=qe);const Ve=qe-pe.current,Mn=qe-se;if(Ve>=Zx&&Mn>=Kx&&Z.state==="recording"){Rr(Z);return}}else pe.current=0;qe-be.current>Qx&&(be.current=qe,er(me))}),Z.ondataavailable=me=>{me.data.size>0&&z.current.push(me.data)},Z.onstop=async()=>{if(mi(),dr.current=null,ga.current){ga.current=!1,Je.current&&!st.current?(F("idle"),Ft()):F(Je.current&&st.current?"muted":"idle");return}if(!Je.current){F("idle");return}const me=new Blob(z.current,{type:Z.mimeType||"audio/webm"});await Lc(me,ae.current,Ft,"normal",Math.max(0,(performance.now()-se)/1e3))},Z.start(Jx),F("listening"),H.current=window.setTimeout(()=>{Rr(dr.current)},qx)}catch{F("denied"),Y.current=window.setTimeout(()=>Lt(),3500)}}},[B,Lt,Lc,o,o?.allowVoiceInput,pr,mi,Fe]),vE=re(()=>{if(Je.current){Lt();return}g1(),!(!o?.allowVoiceInput||Tn.current||B||Fe)&&(Er.current=Date.now(),ft.current=!1,st.current=!1,Je.current=!0,rt(!1),ge(!0),F("connecting"),Ft())},[B,Lt,g1,o,o?.allowVoiceInput,Ft,Fe]),Rc=re(()=>{rt(N=>{const Z=!N;if(st.current=Z,Z){const se=dr.current;se?.state==="recording"?(ga.current=!0,Rr(se)):(mi(),F("muted"))}else Je.current&&!B&&!Fe&&(F("idle"),Ft());return Z})},[B,Ft,mi,Fe]),Ko=re((N,Z)=>{k(N),Z&&(ft.current=!0),F("speaking"),J(N)},[k,J]),b1=re(N=>{switch(Er.current=Date.now(),N){case"end":ft.current=!1,di.current=!0,Ko("Okay — ending our call now. Goodbye!",!1),window.setTimeout(()=>{di.current&&(di.current=!1,Lt())},2e3);break;case"mute":{st.current||Rc();const Z="Muted. Tap the mic button when you want me to listen again.";k(Z),J(Z);break}case"minimize":Nr(),Ko("Minimized — I'm still listening. Tap the call pill to bring the chat back.",!0);break;case"expand":ut(!0),Ko("Sure — expanding the view.",!0);break;case"shrink":zt(null),ut(!1),Ko("Okay — back to the smaller view.",!0);break}},[Nr,Lt,k,J,Ko,Rc]);he(()=>{sp.current=b1},[b1]);const x1=q(!1);he(()=>{x1.current&&!c&&di.current&&(di.current=!1,Lt()),x1.current=c},[c,Lt]);const gE=re(N=>{lp.current=N,rp(N);const Z=dr.current;Z?.state==="recording"&&(ga.current=!0,Rr(Z))},[]),mE=re(()=>{if(!(!Je.current||st.current)){if(pr(),x(),Ye(),Er.current=Date.now(),F("listening"),Tn.current){const N=()=>{if(!(!Je.current||st.current)){if(Tn.current){window.setTimeout(N,70);return}ft.current=!1,Ft()}};window.setTimeout(N,70);return}ft.current=!1,Ft()}},[Ft,x,pr,Ye]),w1=re(async()=>{if(!(xe.current||it.current)&&!(!Je.current||st.current))try{const N=await navigator.mediaDevices.getUserMedia({audio:n1(lp.current)});if(!Je.current||st.current||dr.current||xe.current||!c1.current&&u1.current!=="processing"){N.getTracks().forEach(se=>se.stop());return}xe.current=N,Ze.current=0,bt.current=0,Dc.current=0;const Z=()=>{if(nt.current)return;x(),Ye(),cp.current+=1,Er.current=Date.now(),ft.current=!1,F("listening");const se=Vd(N);nt.current=se,Wo.current=[],$o.current=performance.now(),bt.current=0,se.ondataavailable=me=>{me.data.size>0&&Wo.current.push(me.data)},se.onstop=async()=>{const me=Wo.current,qe=Dc.current,Ve=se.mimeType||"audio/webm";if(nt.current=null,Wo.current=[],pr(),!Je.current)return;const Mn=new Blob(me,{type:Ve});await Lc(Mn,qe,Ft,"barge",Math.max(0,(performance.now()-$o.current)/1e3))},se.start(Jx)};it.current=r1(N,(se,me)=>{if(Dc.current=Math.max(Dc.current,se),me-be.current>Qx&&(be.current=me,er(se)),se>=N5)Ze.current||(Ze.current=me),me-Ze.current>=B5&&Z(),bt.current=0;else if(nt.current&&se<=Xx){bt.current||(bt.current=me);const qe=me-bt.current,Ve=me-$o.current;qe>=Zx&&Ve>=Kx&&nt.current.state==="recording"&&Rr(nt.current)}else nt.current&&me-$o.current>=qx&&nt.current.state==="recording"?Rr(nt.current):(Ze.current=0,bt.current=0)}),it.current||pr()}catch{}},[Lc,Ft,x,pr,Ye]);he(()=>{if(!(ie&&!Se&&!B&&!Fe&&(pa||Q==="processing"))){pr();return}const Z=window.setTimeout(()=>{w1()},z5);return()=>window.clearTimeout(Z)},[pa,B,w1,pr,ie,Se,Q,Fe]);const yE=ie&&!Se&&(l||c||Q==="processing");he(()=>{!ie||Se||c&&F("speaking")},[c,ie,Se]),he(()=>{if(!ie||Se||!ft.current||l||c||!["processing","speaking","noise","misunderstood"].includes(Q))return;const N=window.setTimeout(()=>{!Je.current||st.current||Tn.current||(ft.current=!1,Ft())},700);return()=>window.clearTimeout(N)},[c,l,Ft,ie,Se,Q]),he(()=>()=>Lt(),[Lt]);const[_E,bE]=W(""),S1=q(!1);he(()=>{if(S1.current&&!l){const N=[...s].reverse().find(Z=>Z.role==="assistant"&&!Z.streaming&&!Z.pending&&Z.content);N&&bE(N.content)}S1.current=l},[l,s]),he(()=>{if(!a)return;const N=va.current;vi||N?.querySelector(".cf-textarea")?.focus();const Z=se=>{if(se.key==="Escape"){if(se.preventDefault(),vi){Yo(!1);return}Nr();return}if(se.key!=="Tab"||!N)return;const me=N.querySelectorAll('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])'),qe=Array.from(me).filter(yi=>!yi.hasAttribute("disabled"));if(qe.length===0)return;const Ve=qe[0],Mn=qe[qe.length-1],vr=N.getRootNode()instanceof ShadowRoot?N.getRootNode().activeElement:document.activeElement;se.shiftKey&&vr===Ve?(se.preventDefault(),Mn.focus()):!se.shiftKey&&vr===Mn&&(se.preventDefault(),Ve.focus())};return N?.addEventListener("keydown",Z),()=>N?.removeEventListener("keydown",Z)},[a,Nr,vi]),he(()=>{const N=va.current;N&&(a?N.removeAttribute("inert"):N.setAttribute("inert",""))},[a]);const hp=e.accentColor??e.themeTokens?.accent??o?.accentColor,xE={zIndex:e.zIndex,"--cf-h-pad":`${e.horizontalPadding}px`,"--cf-v-pad":`${e.verticalPadding}px`,...e.themeTokens?.accentText?{"--cf-accent-ink":e.themeTokens.accentText}:{},...e.themeTokens?.accentStrong?{"--cf-accent-2":e.themeTokens.accentStrong}:{},...e.themeTokens?.background?{"--cf-bg":e.themeTokens.background}:{},...e.themeTokens?.surface?{"--cf-surface":e.themeTokens.surface}:{},...e.themeTokens?.surfaceMuted?{"--cf-surface-2":e.themeTokens.surfaceMuted}:{},...e.themeTokens?.text?{"--cf-text":e.themeTokens.text}:{},...e.themeTokens?.mutedText?{"--cf-muted":e.themeTokens.mutedText}:{},...e.themeTokens?.border?{"--cf-border":e.themeTokens.border}:{},...e.themeTokens?.shadow?{"--cf-shadow":e.themeTokens.shadow}:{},...e.themeTokens?.radius?{"--cf-radius":e.themeTokens.radius}:{},...e.themeTokens?.fontFamily?{"--cf-font":e.themeTokens.fontFamily}:{},...hp?{"--cf-accent":hp,"--cf-accent-2":e.themeTokens?.accentStrong??`color-mix(in oklab, ${hp} 76%, #14141f)`}:{}},wE=N=>g(N),SE=[...s].reverse().find(N=>N.role==="user"&&N.content.trim())?.content??"",Ec=s.some(N=>N.role==="user"),k1=o?.talkbackMode==="avatar"||o?.widgetModule==="assistant"||!!o?.allowVoiceInput,jo=!Fe&&k1&&!Ec?fp.filter((N,Z)=>!(Z===0&&N.role==="assistant")):fp,kE=h==="human"&&d?d:o?.agentName??"Chat",TE=h==="human"?"Live support":h==="queued"?"Waiting for the team":o?.offline?n.statusOffline:n.statusOnline,dp=!B&&!Fe?o?.availableActions:void 0,pp=ie&&Q==="connecting"&&!Fe;return _(aR,{value:n,children:_("div",{class:"cf-root","data-theme":ap,"data-align":e.alignment,"data-display":"floating",style:xE,children:[tr&&a&&_("div",{class:"cf-theater-backdrop",onClick:pE}),_("div",{ref:va,class:`cf-panel ${a?"is-open":""} ${ie?"cf-panel--call":""} ${pp?"cf-panel--voice-connecting":""} ${tr&&a?"cf-panel--theater":""} ${qo?"cf-panel--analytics-focus":""}`,role:"dialog","aria-modal":"false","aria-label":`Chat with ${o?.agentName??"us"}`,"aria-hidden":!a,children:[_("div",{class:"cf-header",children:[_(Rx,{persona:o,hideWhenMissing:!0}),_("div",{class:"cf-header__meta",children:[_("div",{class:"cf-header__name",children:kE}),_("div",{class:`cf-header__status ${h==="ai"&&o?.offline?"cf-header__status--offline":""}`,children:_("span",{class:"cf-header__status-text",children:TE})})]}),_("div",{class:"cf-header__actions",children:[X.length>0&&_("button",{type:"button",class:"cf-header__btn","aria-label":n.pastConversations,title:n.pastConversations,"aria-pressed":d1,onClick:()=>Ic(N=>!N),children:_(gR,{})}),Ec&&!B&&!Fe&&_("button",{type:"button",class:"cf-header__btn","aria-label":n.endChat,title:n.endChat,onClick:sE,children:_(Ud,{})}),e.sound&&Ho&&_("button",{type:"button",class:"cf-header__btn","aria-label":da?n.unmuteSounds:n.muteSounds,"aria-pressed":da,onClick:op,children:da?_(hR,{}):_(fR,{})}),_("button",{type:"button",class:"cf-header__btn cf-header__close","aria-label":n.closeChat,onClick:Nr,children:_(Po,{})})]})]}),_("div",{class:"cf-panel__video",children:qo?_("div",{class:"cf-analytics-focus",role:"region","aria-label":"Expanded analytics result",children:_(Nx,{visualization:qo,expanded:!0,onClose:dE})}):!Fe&&k1?_(NR,{persona:o,starters:[],onPick:g,onFocusComposer:vE,speaking:c,voiceState:Q,replyPending:ie&&l&&!c,pinned:!0,muted:Se,onToggleMute:Rc,onEndCall:Lt,onTalkNow:mE,showTalkNow:yE,micLevel:fr,theaterMode:tr,onToggleTheater:fE,onMinimize:Nr,audioDevices:Jd,selectedAudioDeviceId:tp,onSelectAudioDevice:gE,connectingOnly:pp}):null}),!pp&&_("div",{class:"cf-panel__chat",children:[e.preview&&_("div",{class:"cf-preview-banner",children:n.previewBanner}),Fe&&_("div",{class:"cf-viewing-banner",children:n.viewingPast}),_("div",{class:"cf-body",ref:hi,role:"log",onScroll:uE,children:[jo.map((N,Z)=>_(ZR,{msg:N,persona:o,isLast:!Fe&&Z===jo.length-1,visitor:u,hasEmail:f,lastQuestion:SE,showActions:!Fe&&Z===jo.length-1&&!!N.handoffOffered,onPickReply:wE,onSubmitForm:I,onDemoSlots:O,onRetry:S,ratable:!Fe&&jo.slice(0,Z).some(se=>se.role==="user"),onRate:w,onExpandVisualization:Fe?void 0:hE},N.id)),!Ec&&!Fe&&_(Ce,{children:[jo.length===0&&_(I5,{name:o?.agentName??"Assistant",greeting:o?.greeting}),_(YR,{items:m,onPick:g}),_(qR,{items:v})]}),iE&&_("button",{type:"button",class:"cf-newmsg",onClick:Cn,children:[_(bR,{}),n.newMessages]})]}),_("div",{class:"cf-sr-live","aria-live":"polite","aria-atomic":"true",children:_E}),l&&!B&&!Fe&&_("div",{class:"cf-stopbar",children:_("button",{type:"button",class:"cf-stop",onClick:x,children:[_(vR,{}),n.stop]})}),Fe?_("div",{class:"cf-ended",children:_("button",{type:"button",class:"cf-ended__btn",onClick:Ue,children:n.backToChat})}):B?_("div",{class:"cf-ended",children:[_("p",{class:"cf-ended__text",children:n.conversationEnded}),e.csat&&Ec?oE?_("p",{class:"cf-ended__text",children:n.feedbackThanks}):_("div",{class:"cf-csat",children:[_("span",{class:"cf-csat__q",children:n.csatPrompt}),_("button",{type:"button",class:"cf-csat__btn","aria-label":n.feedbackHelpful,onClick:()=>{C("up"),p1(!0)},children:_(Dx,{})}),_("button",{type:"button",class:"cf-csat__btn","aria-label":n.feedbackNotHelpful,onClick:()=>{C("down"),p1(!0)},children:_(Ix,{})})]}):null,_("button",{type:"button",class:"cf-ended__btn",onClick:cE,children:n.startNewChat})]}):_(Ce,{children:[p?_("div",{class:"cf-live-typing","aria-live":"polite",children:[p," is typing…"]}):null,dp&&dp.length>0&&_("div",{class:"cf-footer-actions",children:_(Ox,{actions:dp,visitor:u,onSubmitForm:I,onDemoSlots:O,scheduler:o?.scheduler})}),_(s5,{onSend:g,onSendGif:y,onTyping:b,disabled:l,allowVoice:!!o?.allowVoiceInput,onTranscribe:P,gifEnabled:K,onSearchGifs:E,allowAttach:e.attachments,onExtract:R})]}),!B&&o?.disclaimerText&&_("div",{class:"cf-disclaimer",children:o.disclaimerText}),_("div",{class:"cf-footer",children:[n.poweredBy," ",_("a",{href:"https://accurix.tech/centrinfo",target:"_blank",rel:"noopener noreferrer",children:"Centrinfo"})]})]}),vi&&_("div",{class:"cf-confirm",onClick:()=>Yo(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":n.endChatConfirm,onClick:N=>N.stopPropagation(),children:[_("div",{class:"cf-confirm__title",children:n.endChatConfirm}),_("div",{class:"cf-confirm__body",children:n.endChatConfirmBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{ref:h1,type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Yo(!1),children:n.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:lE,children:n.endConfirmCta})]})]})}),d1&&_("div",{class:"cf-confirm",onClick:()=>Ic(!1),children:_("div",{class:"cf-history",role:"dialog","aria-modal":"true","aria-label":n.pastConversations,onClick:N=>N.stopPropagation(),children:[_("div",{class:"cf-history__head",children:[_("span",{children:n.pastConversations}),_("button",{type:"button",class:"cf-header__btn","aria-label":n.closeChat,onClick:()=>Ic(!1),children:_(Po,{})})]}),_("div",{class:"cf-history__list",children:X.map(N=>_("button",{type:"button",class:`cf-history__item ${N.sessionId===ue?"is-active":""}`,onClick:()=>{Te(N.sessionId),Ic(!1)},children:[_("span",{class:"cf-history__title",children:N.title}),_("span",{class:"cf-history__meta",children:[new Date(N.ts).toLocaleDateString(void 0,{month:"short",day:"numeric"}),N.ended?` · ${n.historyEnded}`:""]})]},N.sessionId))})]})})]}),ie&&!a?_(o5,{persona:o,voiceState:Q,muted:Se,onToggleMute:Rc,onEndCall:Lt,micLevel:fr,onExpand:gi}):tr&&a?null:!e.hideDefaultLauncher&&_("button",{ref:Ac,type:"button",class:"cf-launcher","aria-label":a?n.closeChat:n.openChat,"aria-expanded":a,onClick:Xo,children:[e.launcherIcon?_("img",{class:"cf-launcher__img",src:e.launcherIcon,alt:""}):_(iR,{}),!a&&le>0&&_("span",{class:"cf-launcher__badge",children:le})]})]})})},K5="https://api.accurixtech.com",j5=t=>{if(!t||typeof t.token!="string"||t.token.length===0)throw new Error("[centrinfo-widget] `token` is required — pass your pub_* token to Centrinfo.init({ token }).");return{token:t.token,chatSurface:t.chatSurface??"floating",analyticsContextToken:t.analyticsContextToken,identityToken:t.identityToken,getIdentityToken:t.getIdentityToken,apiBaseUrl:(t.apiBaseUrl??K5).replace(/\/$/,""),accentColor:t.accentColor,themeTokens:t.themeTokens,agentName:t.agentName?.trim()||void 0,agentAvatarUrl:t.agentAvatarUrl?.trim()||void 0,launcherIcon:t.launcherIcon,gifApiKey:t.gifApiKey,theme:t.theme??"auto",openByDefault:t.openByDefault??!1,sound:t.sound??!0,starters:t.starters??[],strings:nR(t.labels),persistence:t.persistence??"local",attachments:t.attachments??!0,zIndex:t.zIndex??2147483e3,demo:t.demo??!1,preview:t.preview??!1,alignment:t.alignment==="left"?"left":"right",horizontalPadding:typeof t.horizontalPadding=="number"?t.horizontalPadding:20,verticalPadding:typeof t.verticalPadding=="number"?t.verticalPadding:20,hideDefaultLauncher:t.hideDefaultLauncher??!1,customLauncherSelector:t.customLauncherSelector,sessionDurationMinutes:typeof t.sessionDurationMinutes=="number"?t.sessionDurationMinutes:0,configRefreshSeconds:typeof t.configRefreshSeconds=="number"?t.configRefreshSeconds:30,proactiveMessage:t.proactiveMessage,proactiveDelaySeconds:typeof t.proactiveDelaySeconds=="number"?t.proactiveDelaySeconds:5,proactiveOnPaths:t.proactiveOnPaths,csat:t.csat??!0,user:t.user,onOpen:t.onOpen,onClose:t.onClose,onShow:t.onShow,onHide:t.onHide,onUnreadChange:t.onUnreadChange,onMessage:t.onMessage,onAction:t.onAction,onHandoff:t.onHandoff}},a1=`
|
|
32
|
+
[Attached file${Je}]:
|
|
33
|
+
${se}`.trim()}else!J&&K&&(J=K);const ht={id:be||on(),role:"user",content:j,imageUrl:K,attachmentName:ae},rt=on();m(Je=>[...!!(be&&Je.some(Vr=>Vr.id===be))?Je.map(Vr=>Vr.id===be?{...Vr,content:j,pending:!1,streaming:!1,imageUrl:K,attachmentName:ae}:Vr):[...Je,ht],{id:rt,role:"assistant",content:"",pending:!0}]),Mi("send"),e.onMessage?.({role:"user",content:J}),le(J,rt,{forceVoicePlayback:ke})},[y,w,e,le]),oe=Q(()=>o.current?.abort(),[]),_e=Q(()=>{cr(),s.current?.pause(),s.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),l.current=null,S(!1)},[cr]),Oe=Q(B=>{const H=G5(B);if(!H)return Promise.resolve(!1);const j=!!(h?.allowVoiceInput&&h?.voiceOutputEnabled&&h.talkbackMode!=="text"),K=(ae,se)=>new Promise(ke=>{let be=!1;n1(s,l,ae,se,h?.voiceSpeed??1,H,!0,()=>{be=!0,S(!0)},()=>{S(!1),ke(be)})||(S(!1),ke(!1))});return j?t.speak(H).then(ae=>ae.audioBase64?K(ae.audioBase64,ae.mimeType):(Ec("Talkback prompt TTS did not return provider audio.",{providerReady:ae.providerReady,message:ae.message,voiceProvider:h?.voiceProvider,voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode}),K())).catch(ae=>(Ec("Talkback prompt TTS request failed before audio playback.",{error:ae instanceof Error?ae.message:String(ae),voiceProvider:h?.voiceProvider,voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode}),K())):(Ec("Talkback prompt wanted voice, but the loaded widget token config has provider TTS disabled.",{voiceOutputEnabled:h?.voiceOutputEnabled,talkbackMode:h?.talkbackMode,voiceProvider:h?.voiceProvider}),K())},[h?.allowVoiceInput,h?.talkbackMode,h?.voiceOutputEnabled,h?.voiceSpeed,t]),Ue=Q((B,H)=>{y||w||!H||(Se(B,{content:"",pending:!0,streaming:!1,error:!1}),Mi("send"),le(H,B))},[y,w,Se,le]),br=Q((B,H,j)=>{Se(B,{feedback:H});const K=p.findIndex(ke=>ke.id===B),ae=K>=0?p[K]?.content:void 0;let se;for(let ke=K-1;ke>=0;ke--)if(p[ke]?.role==="user"){se=p[ke]?.content;break}t.sendFeedback({sessionId:i.current,messageId:B,rating:H,comment:j,question:se,answer:ae}).catch(()=>{})},[t,Se,p]),Ai=Q(async(B,H,j={},K)=>{e.onAction?.(B);const ae=await t.action(B,{sessionId:i.current,...H},K),se={};return j.name?.trim()&&(se.name=j.name.trim()),j.email?.trim()&&(se.email=j.email.trim()),j.phone?.trim()&&(se.phone=j.phone.trim()),Object.keys(se).length>0&&(C(ke=>{const be={...ke,...se};return re(be),be}),se.email&&B!=="contact"&&t.action("contact",{sessionId:i.current,...se}).catch(()=>{})),Mi("receive"),ae},[t,e,re]),ln=Q(B=>{const H=B.trim();H&&m(j=>j.some(K=>K.role==="assistant"&&K.content===H)?j:[...j,{id:on(),role:"assistant",content:H}])},[]),Di=Q(B=>{v.current=!0;const H=on();return m(j=>[...j,{id:H,role:"user",content:B.trim(),pending:!0}]),H},[]),zc=Q((B,H)=>{m(j=>j.map(K=>K.id===B?{...K,...H}:K))},[]),gp=Q(B=>{m(H=>H.filter(j=>j.id!==B))},[]),Ma=Q((B,H)=>{t.sendFeedback({sessionId:i.current,messageId:"__csat__",rating:B,comment:H}).catch(()=>{})},[t]),ts=Q(async(B,H,j,K)=>{const ae=sp();try{if(typeof B!="string"&&t.transcribeAudio)return await t.transcribeAudio(B,H,j,K);const se=typeof B=="string"?B:await bR(B);return await t.transcribe(se,H,j,K)}finally{lp("voice-transcription",ae)}},[t]),mp=Q((B,H,j)=>t.extract(B,H,j),[t]),En=Q(B=>t.searchGifs(B),[t]),Fc=Q((B,H)=>t.demoSlots(B,H),[t]),Ii=Q(B=>G("",{imageUrl:B}),[G]),rs=e.demo||!!e.gifApiKey,st=Q(()=>{o.current?.abort(),k(!0),t.endConversation(i.current).catch(()=>{})},[t]),vt=Q(()=>{o.current?.abort();const B=Qo(e);i.current=B;try{n?.setItem(Jo(a),B)}catch{}L(null),N([]),k(!1),q("ai"),z(void 0),X(void 0),te.current=new Date().toISOString(),m(h?[{id:on(),role:"assistant",content:h.greeting,availableActions:h.availableActions,actions:h.actions}]:[])},[n,a,h]),yt=Q(B=>{if(Ie){if(B===i.current){L(null);return}N(o1(n,a,B)),L(B)}},[n,a,Ie]),Hr=Q(()=>{L(null),N([])},[]),Aa=e.starters.length>0?e.starters:h?.starterQuestions??[],xr=h?.featuredLinks??[];return{persona:h,messages:p,sending:y,assistantSpeaking:x,visitor:T,starters:Aa,featuredLinks:xr,hasEmail:!!T.email,liveMode:O,assignedAgentName:R,agentTypingName:F,send:G,sendGif:Ii,notifyTyping:Y,stop:oe,retry:Ue,rateMessage:br,injectAssistant:ln,appendUserDraft:Di,patchMessage:zc,removeMessage:gp,submitCsat:Ma,submitForm:Ai,transcribe:ts,extract:mp,searchGifs:En,demoSlots:Fc,gifEnabled:rs,identify:he,ended:w,endConversation:st,startNew:vt,history:Ie?A:[],viewingSessionId:I,viewMessages:P,openConversation:yt,closeHistoryView:Hr,shutdown:Me,stopSpeaking:_e,speakAssistantText:Oe}},aE=({name:t,greeting:e})=>{const r=_r();return _("section",{class:"cf-empty-welcome","aria-label":qt(r.welcomeLabel,{name:t}),children:[_("span",{class:"cf-empty-welcome__eyebrow",children:r.welcomeEyebrow}),_("h2",{children:t}),_("p",{children:e||r.welcomePrompt})]})},hp=(t,e,r)=>{if(t.key==="Escape"){t.preventDefault(),t.stopPropagation(),r();return}if(t.key!=="Tab")return;const n=Array.from(e.querySelectorAll('button, [href], textarea, input, select, [tabindex]:not([tabindex="-1"])')).filter(c=>!c.hasAttribute("disabled")&&c.getAttribute("aria-hidden")!=="true"&&c.tabIndex>=0);if(n.length===0)return;const a=e.getRootNode(),i=t.composedPath()[0],o=i instanceof HTMLElement?i:"activeElement"in a?a.activeElement:document.activeElement,s=n[0],l=n[n.length-1];t.shiftKey&&(o===s||!e.contains(o))?(t.preventDefault(),t.stopPropagation(),l.focus()):!t.shiftKey&&(o===l||!e.contains(o))&&(t.preventDefault(),t.stopPropagation(),s.focus())},Bc=new Map,c1=t=>{if(!t||typeof document>"u"||typeof CanvasRenderingContext2D>"u")return;const e=document.createElement("canvas").getContext("2d");if(!e)return;e.fillStyle="#010203",e.fillStyle=t;const r=e.fillStyle;if(r==="#010203"&&t.trim().toLowerCase()!=="#010203")return;const n=r.match(/^#([\da-f]{6})$/i)?.[1];if(n)return[Number.parseInt(n.slice(0,2),16),Number.parseInt(n.slice(2,4),16),Number.parseInt(n.slice(4,6),16),1];const a=r.match(/^rgba?\(([\d.]+)[, ]+([\d.]+)[, ]+([\d.]+)(?:[, /]+([\d.]+))?\)$/i);if(!a)return;const i=a.slice(1,5).map(Number);if(!i.some(o=>!Number.isFinite(o)))return[i[0],i[1],i[2],i[3]??1]},iE=(t,e="#ffffff")=>{const r=`${t??""}|${e}`;if(Bc.has(r))return Bc.get(r);const n=c1(t),a=c1(e)??[255,255,255,1];if(!n){Bc.set(r,void 0);return}const i=n[3],s=n.slice(0,3).map((h,d)=>h*i+a[d]*(1-i)).map(h=>{const d=h/255;return d<=.04045?d/12.92:((d+.055)/1.055)**2.4}),l=s[0]*.2126+s[1]*.7152+s[2]*.0722,c=1.05/(l+.05),u=(l+.05)/.059,f=c>=u?"#ffffff":"#0f1e2a";return Bc.set(r,f),f},oE=t=>{const[e,r]=V("light");return ie(()=>{if(t!=="auto"||typeof matchMedia>"u")return;const n=matchMedia("(prefers-color-scheme: dark)"),a=()=>r(n.matches?"dark":"light");return a(),n.addEventListener("change",a),()=>n.removeEventListener("change",a)},[t]),t==="auto"?e:t},u1=1e4,sE=1400,f1=550,lE=350,cE=.001,h1=6e4,d1=90,uE=280,fE=250,p1=250,hE=t=>t.replace(/\[[^\]]{0,60}\]/g," ").replace(/\(([^)]{0,60})\)/g,(e,r)=>v1.has(r.trim().toLowerCase().replace(/[.!?,…]+$/,"").replace(/\s+/g," "))?" ":e).replace(/\*[^*]{0,60}\*/g," ").replace(/\s+/g," ").trim(),v1=new Set(["background noise","engine noise","noise","inaudible","unintelligible","silence","no speech","static","music","laughter","applause","wind","breathing","click","clicks","clicking","mouse click","mouse clicks","beep","beeps","beeping","tap","taps","tapping","typing","keyboard typing","cough","coughing","sigh","hmm","mm","mmm","uh","um","ah","oh"]),dE=t=>{const e=t.trim().toLowerCase().replace(/[()[\]*]/g," ").replace(/[.!?,…]+$/,"").replace(/\s+/g," ").trim();return!e||/^(?:sh+\s*)+$/.test(e)?!0:v1.has(e)},pE=t=>{const e=t.trim().toLowerCase().replace(/\s+/g," ");return e?e.includes("transcribe this audio recording verbatim")||e.includes("preserve the spoken language and any code-switching")||e.includes("output only the transcribed text, no commentary"):!1},g1={end:"end the call",mute:"mute your microphone",minimize:"minimize the chat",expand:"expand the view",shrink:"exit the expanded view"},dp=t=>t.trim().toLowerCase().replace(/[^\p{L}\p{N}\s']/gu," ").replace(/\s+/g," ").trim(),vE=[{action:"shrink",re:/\b(?:exit|leave|quit|close)\b[\s\w]*\b(?:full ?screen|expanded|theat(?:er|re))\b|\bshrink\b|\bsmaller view\b/},{action:"end",re:/\b(?:end|close|stop|finish|hang ?up|quit|exit)\b[\s\w]*\b(?:call|chat|conversation|convo|session|talking)\b|\bhang ?up\b|\bgood ?bye\b|^bye(?: bye)?$/},{action:"mute",re:/\bmute\b|\bstop listening\b/},{action:"minimize",re:/\bminimi[sz]e\b|\bhide\b[\s\w]*\b(?:chat|call|window|widget)\b/},{action:"expand",re:/\bexpand\b|\bmaximi[sz]e\b|\bfull ?screen\b|\btheat(?:er|re) mode\b|\bbigger view\b/}],gE=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,mE=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,yE=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,_E=t=>{const e=dp(t);if(!e)return null;for(const{action:r,re:n}of vE)if(n.test(e)){const a=e.split(" ").length;return{action:r,confident:r==="end"?a<=10:a<=6}}return null},pp=t=>`I didn't catch yes or no. Say yes to ${g1[t]}, or no to keep talking.`,m1=t=>`I caught some audio, but not enough clear words. Try again a little closer to the mic, or type your question for ${t?.agentName?.trim()||"the assistant"}.`,bE=t=>{const e=dp(t).replace(/\b(?:um|uh|erm|hmm)\b/g,"").trim();return!e||e.split(/\s+/).length<=2&&/^(?:can|could|would|will|do|does|is|are|what|why|how|where|when)\b/.test(e)?!0:/\b(?:can you|could you|would you|will you|do you|can i|could i|would i|i want to|i need to|tell me about|what about|how about|about|with|to|for|please)$/i.test(e)},y1=(t,e)=>{const r=window.AudioContext??window.webkitAudioContext;if(!r)return null;let n,a=!1;const i=new r;try{const o=i.createMediaStreamSource(t),s=i.createAnalyser();s.fftSize=512,o.connect(s);const l=new Uint8Array(s.frequencyBinCount),c=()=>{if(a)return;s.getByteTimeDomainData(l);let u=0;for(const f of l){const h=(f-128)/128;u+=h*h}e(Math.sqrt(u/l.length),performance.now()),a||(n=requestAnimationFrame(c))};c()}catch{return i.close().catch(()=>{}),null}return{stop:()=>{a||(a=!0,n!==void 0&&cancelAnimationFrame(n),n=void 0,i.close().catch(()=>{}))}}},_1=t=>Fx(t),xE=({transport:t,config:e,bindControls:r,composerDraftStore:n})=>{const a=e.strings,[i,o]=V(e.openByDefault),{persona:s,messages:l,sending:c,assistantSpeaking:u,visitor:f,hasEmail:h,liveMode:d,assignedAgentName:p,agentTypingName:m,starters:g,featuredLinks:v,send:y,sendGif:b,notifyTyping:x,stop:S,retry:w,rateMessage:k,injectAssistant:T,appendUserDraft:C,patchMessage:A,removeMessage:M,submitCsat:I,submitForm:L,transcribe:P,extract:N,searchGifs:O,demoSlots:q,gifEnabled:R,identify:z,ended:F,endConversation:X,startNew:te,history:fe,viewingSessionId:me,viewMessages:we,openConversation:Ze,closeHistoryView:Ie,shutdown:tt,stopSpeaking:Ge,speakAssistantText:Me}=nE(t,e,i),[re,he]=V(0),[Be,pe]=V("idle"),[Se,ct]=V(!1),[pt,sn]=V(!1),[cr,Y]=V(0),[le,G]=V(!1),[oe,_e]=V(null),[Oe,Ue]=V([]),[br,Ai]=V(""),[ln,Di]=V(()=>{try{return localStorage.getItem("centrinfo:muted")==="1"}catch{return!1}}),zc=oE(e.theme),gp=l.some(E=>E.role==="assistant"&&(E.pending||E.streaming)),Ma=c||gp||u,ts=s?.soundEnabled??!0;ie(()=>{N5(e.sound&&ts&&!ln)},[e.sound,ts,ln]);const mp=Q(()=>{Di(E=>{const $=!E;try{localStorage.setItem("centrinfo:muted",$?"1":"0")}catch{}return $})},[]),En=W(null),Fc=W(null),Ii=W(null),rs=W(0),st=W(!1),vt=W(!1),yt=W(!1),Hr=W(0),Aa=W(!1),xr=W(null),B=W(null),H=W([]),j=W(void 0),K=W(void 0),ae=W(null),se=W(0),ke=W(0),be=W(!1),J=W(0),ht=W(null),rt=W(null),Je=W(0),ut=W(null),ns=W([]),Vr=W(0),cn=W(0),Hc=W(0),Da=W(null),Li=W(!1),Ia=W(null),Gr=W(""),yp=W(()=>{}),_p=W(""),On=W(c),k1=W(u),T1=W(Ma),C1=W(Be),bp=W(0);ie(()=>{On.current=c},[c]),ie(()=>{k1.current=u},[u]),ie(()=>{T1.current=Ma},[Ma]),ie(()=>{C1.current=Be},[Be]);const[M1,as]=V(!0),[RE,Pi]=V(!1),xp=W(0),[un,Ri]=V(!1),[La,Pa]=V(!1),A1=W(null),[Nn,Ra]=V(!1),EE=W({value:""}),OE=n??EE.current,D1=W({confirmEnd:un,confirmClear:La,showHistory:Nn});D1.current={confirmEnd:un,confirmClear:La,showHistory:Nn};const[NE,I1]=V(!1),qe=!!me,wp=qe?we:l,is=wp.find(E=>E.id===oe&&E.visualization)?.visualization;ie(()=>{!oe||is||(_e(null),G(!1))},[is,oe]);const Ei=Q(()=>{o(!0),he(0),Mi("open"),e.onOpen?.(),e.onShow?.()},[e]),$r=Q(()=>{o(!1),G(!1),_e(null),e.onClose?.(),e.onHide?.(),Fc.current?.focus()},[e]),os=Q(()=>i?$r():Ei(),[i,Ei,$r]),BE=Q(()=>Ri(!0),[]),zE=Q(()=>{X(),Ri(!1)},[X]),FE=Q(()=>{te(),Pi(!1),as(!0)},[te]);ie(()=>{un&&A1.current?.focus()},[un]),ie(()=>{r({open:Ei,close:$r,toggle:os,identify:z,startNew:te,endConversation:X,shutdown:tt})},[r,Ei,$r,os,z,te,X,tt]),ie(()=>{const E=l.filter($=>$.role==="assistant"&&!$.pending).length;if(i){rs.current=E;return}E>rs.current&&he(E-rs.current)},[l,i]),ie(()=>{e.onUnreadChange?.(re)},[re,e]),ie(()=>{const E=e.sessionDurationMinutes;if(!E||E<=0)return;const $=setTimeout(()=>tt(),E*60*1e3);return()=>clearTimeout($)},[e.sessionDurationMinutes,l,i,tt]),ie(()=>{const E=e.customLauncherSelector;if(!E||typeof document>"u")return;let $=[];try{$=Array.from(document.querySelectorAll(E))}catch{return}const xe=Pe=>{Pe.preventDefault(),os()};return $.forEach(Pe=>Pe.addEventListener("click",xe)),()=>$.forEach(Pe=>Pe.removeEventListener("click",xe))},[e.customLauncherSelector,os]);const L1=W(!1);ie(()=>{const E=e.proactiveMessage?.trim();if(!E||L1.current)return;const $=e.proactiveOnPaths??[],xe=typeof location<"u"?location.pathname:"";if($.length>0&&!$.some(Re=>xe.includes(Re)))return;const Pe=`centrinfo:proactive:${e.token.slice(0,12)}`;try{if(sessionStorage.getItem(Pe)==="1")return}catch{}const ve=setTimeout(()=>{if(!(i||F||l.some(Re=>Re.role==="user"))){L1.current=!0;try{sessionStorage.setItem(Pe,"1")}catch{}T(E),Ei()}},Math.max(0,e.proactiveDelaySeconds)*1e3);return()=>clearTimeout(ve)},[e.proactiveMessage]),ie(()=>{const E=Ii.current;if(!i||!E)return;const $=l[l.length-1],xe=Date.now()<xp.current;$?.role==="user"||M1||xe?(requestAnimationFrame(()=>{E.scrollTop=E.scrollHeight}),Pi(!1),xe&&as(!0)):Pi(!0)},[l,i,c,M1]);const HE=Q(()=>{const E=Ii.current;if(!E)return;if(st.current&&!qe){as(!0),Pi(!1);return}const $=E.scrollHeight-E.scrollTop-E.clientHeight<80;as($),$&&Pi(!1)},[qe]),Bn=Q(()=>{const E=Ii.current;E&&(E.scrollTop=E.scrollHeight),Pi(!1),as(!0)},[]),Vc=Q(()=>{xp.current=Date.now()+3e3,requestAnimationFrame(Bn)},[Bn]);ie(()=>{if(!i||qe||!Se||Be==="connecting")return;xp.current=Date.now()+6e4,Bn();const E=requestAnimationFrame(()=>{Bn(),requestAnimationFrame(Bn)}),$=[80,180,360].map(xe=>window.setTimeout(Bn,xe));return()=>{cancelAnimationFrame(E),$.forEach(xe=>window.clearTimeout(xe))}},[u,l,i,Bn,c,Se,qe,Be]);const P1=Q(()=>{En.current?.querySelector(".cf-textarea")?.focus()},[]),R1=Q(()=>{j.current&&window.clearTimeout(j.current),j.current=void 0,K.current&&window.clearTimeout(K.current),K.current=void 0,ae.current?.stop(),ae.current=null,Y(0)},[]),wr=Q(()=>{rt.current?.stop(),rt.current=null,Fr(ut.current),ht.current?.getTracks().forEach(E=>E.stop()),ht.current=null,Je.current=0,cn.current=0},[]),Oi=Q(()=>{R1(),B.current?.getTracks().forEach(E=>E.stop()),B.current=null},[R1]),Ht=Q(()=>{st.current=!1,yt.current=!1,vt.current=!1,Aa.current=!1,Da.current=null,Li.current=!1,Ia.current=null,Gr.current="",ct(!1),sn(!1),G(!1),_e(null),wr(),Ge();const E=xr.current;E?.state==="recording"?Fr(E):(Oi(),pe("idle"))},[wr,Ge,Oi]),VE=Q(()=>{le&&_e(null),G(!le)},[le]),GE=Q(E=>{_e(E),G(!0)},[]),$E=Q(()=>{const E=oe;_e(null),G(!1),window.requestAnimationFrame(()=>{Array.from(En.current?.querySelectorAll("[data-visualization-message]")??[]).find(xe=>xe.dataset.visualizationMessage===E)?.focus()})},[oe]),WE=Q(()=>{_e(null),G(!1)},[]),E1=Q((E,$)=>{if(Date.now()-Hr.current>=h1){pe("timeout"),K.current=window.setTimeout(()=>Ht(),2400);return}pe(E),K.current=window.setTimeout(()=>{st.current&&!vt.current&&!k1.current&&$()},sE)},[Ht]),Gc=Q((E,$,xe)=>{Date.now()-Hr.current<h1&&!vt.current&&(yt.current=!0,Me($)),E1(E,xe)},[E1,Me]),O1=Q((E,$)=>{Vc(),Hr.current=Date.now(),yt.current=!0,$&&A($,{content:E,pending:!0,streaming:!1});const xe=()=>{if(st.current){if(On.current){window.setTimeout(xe,80);return}$&&Ia.current===$&&(Ia.current=null),y(E,{forceVoicePlayback:!0,userMessageId:$})}};xe()},[Vc,A,y]),$c=Q(async(E,$,xe,Pe="normal",ve)=>{let Re=null;const kt=Sr=>Re||(Vc(),Re=Ia.current||C(Sr),Ia.current=Re,A(Re,{content:Gr.current||Sr,pending:!0,streaming:!1}),Re),Tt=()=>{Re&&(Ia.current===Re&&(Ia.current=null),Gr.current="",M(Re),Re=null)},zn=()=>{Gr.current="",pe("listening"),window.setTimeout(()=>{st.current&&!vt.current&&!On.current&&!xr.current&&xe()},120)},qc=E.size===0,Ea=E.size<lE&&$<cE;if(qc||Ea){if(Pe==="barge"){zn();return}const Sr=Da.current;Gc("noise",Sr?pp(Sr):m1(s),xe),Gr.current="";return}pe("processing");const nO=++bp.current,Tp=kt("Listening...");try{const Sr=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0;A(Tp,{content:Gr.current?`${Gr.current} ...`:"Transcribing...",pending:!0});const Cp=hE(await P(E,E.type,Sr,ve));if(nO!==bp.current){Tt();return}const fn=[Gr.current,Cp].map(kr=>kr.trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim();if(!fn||dE(fn)||pE(fn)){if(Tt(),Pe==="barge"){zn();return}const kr=Da.current;Gc("misunderstood",kr?pp(kr):m1(s),xe);return}const Xc=Da.current;if(Xc){const kr=dp(fn);if(gE.test(kr)||Xc==="end"&&yE.test(kr)){Tt(),Da.current=null,yp.current(Xc);return}if(mE.test(kr)){Tt(),Da.current=null;const $1="Okay, never mind — what would you like to know?";T($1),yt.current=!0,pe("speaking"),Me($1);return}Tt();const G1=pp(Xc);T(G1),yt.current=!0,pe("speaking"),Me(G1);return}const cs=_E(fn);if(cs){if(Tt(),Hr.current=Date.now(),cs.confident){yp.current(cs.action);return}Da.current=cs.action;const kr=`Just to confirm — you want me to ${g1[cs.action]}? Please say yes or no.`;T(kr),yt.current=!0,pe("speaking"),Me(kr);return}if(A(Tp,{content:fn,pending:!0}),bE(fn)){Gr.current=fn,pe("listening"),xe();return}Gr.current="",O1(fn,Tp)}catch(Sr){if(Tt(),Pe==="barge"){zn();return}const Cp=Sr instanceof Error&&Sr.message.trim()?` (${Sr.message.trim()})`:"";Gc("misunderstood",`I couldn't convert your speech to text. Please check the speech service configuration or type your question.${Cp}`,xe)}},[C,Vc,Gc,T,A,s,M,O1,Me,P]),Xt=Q(async()=>{if(!(!st.current||vt.current)&&!(!s?.allowVoiceInput||F||qe)&&!On.current&&!xr.current){wr(),yt.current=!1;try{pe("connecting");const E=await navigator.mediaDevices.getUserMedia({audio:_1(_p.current)});if(!st.current||vt.current){E.getTracks().forEach(ve=>ve.stop());return}navigator.mediaDevices.enumerateDevices().then(ve=>{Ue(ve.filter(Re=>Re.kind==="audioinput").map((Re,kt)=>({deviceId:Re.deviceId,label:Re.label||`Microphone ${kt+1}`})))}).catch(()=>{});const $=ep(E);xr.current=$,B.current=E,H.current=[],se.current=0,be.current=!1,J.current=0;const xe=performance.now(),Pe=Hx();ae.current=y1(E,(ve,Re)=>{const kt=Pe.observe(ve);if(se.current=Math.max(se.current,ve),kt.speech)be.current=!0,J.current=0;else if(be.current&&kt.quiet){J.current||(J.current=Re);const Tt=Re-J.current,zn=Re-xe;if(Tt>=kt.endOfSpeechDelayMs&&zn>=f1&&$.state==="recording"){Fr($);return}}else J.current=0;Re-ke.current>d1&&(ke.current=Re,Y(ve))}),$.ondataavailable=ve=>{ve.data.size>0&&H.current.push(ve.data)},$.onstop=async()=>{if(Oi(),xr.current=null,Aa.current){Aa.current=!1,st.current&&!vt.current?(pe("idle"),Xt()):pe(st.current&&vt.current?"muted":"idle");return}if(!st.current){pe("idle");return}const ve=new Blob(H.current,{type:$.mimeType||"audio/webm"});await $c(ve,se.current,Xt,"normal",Math.max(0,(performance.now()-xe)/1e3))},$.start(p1),pe("listening"),j.current=window.setTimeout(()=>{Fr(xr.current)},u1)}catch{pe("denied"),K.current=window.setTimeout(()=>Ht(),3500)}}},[F,Ht,$c,s,s?.allowVoiceInput,wr,Oi,qe]),UE=Q(()=>{if(st.current){Ht();return}P1(),!(!s?.allowVoiceInput||On.current||F||qe)&&(Hr.current=Date.now(),yt.current=!1,vt.current=!1,st.current=!0,sn(!1),ct(!0),pe("connecting"),Xt())},[F,Ht,P1,s,s?.allowVoiceInput,Xt,qe]),Wc=Q(()=>{sn(E=>{const $=!E;if(vt.current=$,$){const xe=xr.current;xe?.state==="recording"?(Aa.current=!0,Fr(xe)):(Oi(),pe("muted"))}else st.current&&!F&&!qe&&(pe("idle"),Xt());return $})},[F,Xt,Oi,qe]),ss=Q((E,$)=>{T(E),$&&(yt.current=!0),pe("speaking"),Me(E)},[T,Me]),N1=Q(E=>{switch(Hr.current=Date.now(),E){case"end":yt.current=!1,Li.current=!0,ss("Okay — ending our call now. Goodbye!",!1),window.setTimeout(()=>{Li.current&&(Li.current=!1,Ht())},2e3);break;case"mute":{vt.current||Wc();const $="Muted. Tap the mic button when you want me to listen again.";T($),Me($);break}case"minimize":$r(),ss("Minimized — I'm still listening. Tap the call pill to bring the chat back.",!0);break;case"expand":G(!0),ss("Sure — expanding the view.",!0);break;case"shrink":_e(null),G(!1),ss("Okay — back to the smaller view.",!0);break}},[$r,Ht,T,Me,ss,Wc]);ie(()=>{yp.current=N1},[N1]);const B1=W(!1);ie(()=>{B1.current&&!u&&Li.current&&(Li.current=!1,Ht()),B1.current=u},[u,Ht]);const YE=Q(E=>{_p.current=E,Ai(E);const $=xr.current;$?.state==="recording"&&(Aa.current=!0,Fr($))},[]),qE=Q(()=>{if(!(!st.current||vt.current)){if(wr(),S(),Ge(),Hr.current=Date.now(),pe("listening"),On.current){const E=()=>{if(!(!st.current||vt.current)){if(On.current){window.setTimeout(E,70);return}yt.current=!1,Xt()}};window.setTimeout(E,70);return}yt.current=!1,Xt()}},[Xt,S,wr,Ge]),z1=Q(async()=>{if(!(ht.current||rt.current)&&!(!st.current||vt.current))try{const E=await navigator.mediaDevices.getUserMedia({audio:_1(_p.current)});if(!st.current||vt.current||xr.current||ht.current||!T1.current&&C1.current!=="processing"){E.getTracks().forEach(Pe=>Pe.stop());return}ht.current=E,Je.current=0,cn.current=0,Hc.current=0;const $=()=>{if(ut.current)return;S(),Ge(),bp.current+=1,Hr.current=Date.now(),yt.current=!1,pe("listening");const Pe=ep(E);ut.current=Pe,ns.current=[],Vr.current=performance.now(),cn.current=0,Pe.ondataavailable=ve=>{ve.data.size>0&&ns.current.push(ve.data)},Pe.onstop=async()=>{const ve=ns.current,Re=Hc.current,kt=Pe.mimeType||"audio/webm";if(ut.current=null,ns.current=[],wr(),!st.current)return;const Tt=new Blob(ve,{type:kt});await $c(Tt,Re,Xt,"barge",Math.max(0,(performance.now()-Vr.current)/1e3))},Pe.start(p1)},xe=Hx({speechToNoiseRatio:3.2});rt.current=y1(E,(Pe,ve)=>{const Re=xe.observe(Pe);if(Hc.current=Math.max(Hc.current,Pe),ve-ke.current>d1&&(ke.current=ve,Y(Pe)),Re.speech)Je.current||(Je.current=ve),ve-Je.current>=uE&&$(),cn.current=0;else if(ut.current&&Re.quiet){cn.current||(cn.current=ve);const kt=ve-cn.current,Tt=ve-Vr.current;kt>=Re.endOfSpeechDelayMs&&Tt>=f1&&ut.current.state==="recording"&&Fr(ut.current)}else ut.current&&ve-Vr.current>=u1&&ut.current.state==="recording"?Fr(ut.current):(Je.current=0,cn.current=0)}),rt.current||wr()}catch{}},[$c,Xt,S,wr,Ge]);ie(()=>{if(!(Se&&!pt&&!F&&!qe&&(Ma||Be==="processing"))){wr();return}const $=window.setTimeout(()=>{z1()},fE);return()=>window.clearTimeout($)},[Ma,F,z1,wr,Se,pt,Be,qe]);const XE=Se&&!pt&&(c||u||Be==="processing");ie(()=>{!Se||pt||u&&pe("speaking")},[u,Se,pt]),ie(()=>{if(!Se||pt||!yt.current||c||u||!["processing","speaking","noise","misunderstood"].includes(Be))return;const E=window.setTimeout(()=>{!st.current||vt.current||On.current||(yt.current=!1,Xt())},700);return()=>window.clearTimeout(E)},[u,c,Xt,Se,pt,Be]),ie(()=>()=>Ht(),[Ht]);const[ZE,KE]=V(""),F1=W(!1);ie(()=>{if(F1.current&&!c){const E=[...l].reverse().find($=>$.role==="assistant"&&!$.streaming&&!$.pending&&$.content);E&&KE(E.content)}F1.current=c},[c,l]),rv(()=>{if(!i)return;const E=En.current,$=un||La?E?.querySelector(".cf-confirm__card"):Nn?E?.querySelector(".cf-history"):null;if(!$)return;const xe=$.getRootNode(),Pe="activeElement"in xe?xe.activeElement:document.activeElement;(!Pe||!$.contains(Pe))&&$.querySelector('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])')?.focus()},[La,un,i,Nn]),ie(()=>{if(!i)return;const E=En.current,$=un||La?E?.querySelector(".cf-confirm__card"):Nn?E?.querySelector(".cf-history"):null,xe=E?.querySelectorAll(":scope > .cf-header, :scope > .cf-panel__video, :scope > .cf-panel__chat");xe?.forEach(ve=>{$?(ve.setAttribute("inert",""),ve.setAttribute("aria-hidden","true")):(ve.removeAttribute("inert"),ve.removeAttribute("aria-hidden"))}),$||requestAnimationFrame(()=>E?.querySelector(".cf-textarea")?.focus());const Pe=ve=>{if(ve.key==="Escape"){ve.preventDefault();const Ea=D1.current;if(Ea.confirmEnd){Ri(!1);return}if(Ea.confirmClear){Pa(!1);return}if(Ea.showHistory){Ra(!1);return}$r();return}if(ve.key!=="Tab"||!$)return;const Re=$.querySelectorAll('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])'),kt=Array.from(Re).filter(Ea=>!Ea.hasAttribute("disabled"));if(kt.length===0)return;const Tt=kt[0],zn=kt[kt.length-1],qc=$.getRootNode()instanceof ShadowRoot?$.getRootNode().activeElement:document.activeElement;ve.shiftKey&&qc===Tt?(ve.preventDefault(),zn.focus()):!ve.shiftKey&&qc===zn&&(ve.preventDefault(),Tt.focus())};return E?.addEventListener("keydown",Pe),()=>{E?.removeEventListener("keydown",Pe),xe?.forEach(ve=>{ve.removeAttribute("inert"),ve.removeAttribute("aria-hidden")})}},[i,$r,un,La,Nn]),ie(()=>{const E=En.current;E&&(i?E.removeAttribute("inert"):E.setAttribute("inert",""))},[i]);const Uc=e.accentColor??e.themeTokens?.accent??s?.accentColor,H1=e.themeTokens?.accentText??iE(Uc,e.themeTokens?.background??(zc==="dark"?"#0f1c27":"#ffffff")),jE={zIndex:e.zIndex,"--cf-h-pad":`${e.horizontalPadding}px`,"--cf-v-pad":`${e.verticalPadding}px`,...H1?{"--cf-accent-ink":H1}:{},...e.themeTokens?.accentStrong?{"--cf-accent-2":e.themeTokens.accentStrong}:{},...e.themeTokens?.background?{"--cf-bg":e.themeTokens.background}:{},...e.themeTokens?.surface?{"--cf-surface":e.themeTokens.surface}:{},...e.themeTokens?.surfaceMuted?{"--cf-surface-2":e.themeTokens.surfaceMuted}:{},...e.themeTokens?.text?{"--cf-text":e.themeTokens.text}:{},...e.themeTokens?.mutedText?{"--cf-muted":e.themeTokens.mutedText}:{},...e.themeTokens?.border?{"--cf-border":e.themeTokens.border}:{},...e.themeTokens?.shadow?{"--cf-shadow":e.themeTokens.shadow}:{},...e.themeTokens?.radius?{"--cf-radius":e.themeTokens.radius}:{},...e.themeTokens?.fontFamily?{"--cf-font":e.themeTokens.fontFamily}:{},...e.themeTokens?.success?{"--cf-success":e.themeTokens.success}:{},...e.themeTokens?.warning?{"--cf-warning":e.themeTokens.warning}:{},...e.themeTokens?.danger?{"--cf-danger":e.themeTokens.danger}:{},...Uc?{"--cf-accent":Uc,"--cf-accent-2":e.themeTokens?.accentStrong??`color-mix(in oklab, ${Uc} 76%, #14141f)`}:{}},QE=E=>y(E),JE=[...l].reverse().find(E=>E.role==="user"&&E.content.trim())?.content??"",Yc=l.some(E=>E.role==="user"),V1=s?.talkbackMode==="avatar"||s?.widgetModule==="assistant"||!!s?.allowVoiceInput,ls=!qe&&V1&&!Yc?wp.filter((E,$)=>!($===0&&E.role==="assistant")):wp,eO=d==="human"&&p?p:s?.agentName??a.chatName,tO=d==="human"?a.liveSupport:d==="queued"?a.waitingForTeam:s?.offline?a.statusOffline:a.statusOnline,Sp=!F&&!qe?s?.availableActions:void 0,rO=!F&&!qe?s?.actions:void 0,kp=Se&&Be==="connecting"&&!qe;return _(SR,{value:a,children:_("div",{class:"cf-root","data-theme":zc,"data-align":e.alignment,"data-display":"floating",style:jE,children:[le&&i&&_("div",{class:"cf-theater-backdrop",onClick:WE}),_("div",{ref:En,class:`cf-panel ${i?"is-open":""} ${Se?"cf-panel--call":""} ${kp?"cf-panel--voice-connecting":""} ${le&&i?"cf-panel--theater":""} ${is?"cf-panel--analytics-focus":""}`,role:"dialog","aria-modal":"false","aria-label":`${a.chatName}: ${s?.agentName??a.assistantName}`,"aria-hidden":!i,children:[_("div",{class:"cf-header",children:[_(qx,{persona:s,hideWhenMissing:!0}),_("div",{class:"cf-header__meta",children:[_("div",{class:"cf-header__name",children:eO}),_("div",{class:`cf-header__status ${d==="ai"&&s?.offline?"cf-header__status--offline":""}`,children:_("span",{class:"cf-header__status-text",children:tO})})]}),_("div",{class:"cf-header__actions",children:[fe.length>0&&_("button",{type:"button",class:"cf-header__btn","aria-label":a.pastConversations,title:a.pastConversations,"aria-pressed":Nn,onClick:()=>Ra(E=>!E),children:_(OR,{})}),Yc&&!F&&!qe&&_("button",{type:"button",class:"cf-header__btn","aria-label":a.endChat,title:a.endChat,onClick:BE,children:_(ap,{})}),e.sound&&ts&&_("button",{type:"button",class:"cf-header__btn","aria-label":ln?a.unmuteSounds:a.muteSounds,"aria-pressed":ln,onClick:mp,children:ln?_(LR,{}):_(IR,{})}),_("button",{type:"button",class:"cf-header__btn cf-header__close","aria-label":a.closeChat,onClick:$r,children:_(Ti,{})})]})]}),_("div",{class:"cf-panel__video",children:is?_("div",{class:"cf-analytics-focus",role:"region","aria-label":a.expandedAnalyticsResult,children:_(Qx,{visualization:is,expanded:!0,onClose:$E})}):!qe&&V1?_(n5,{persona:s,starters:[],onPick:y,onFocusComposer:UE,speaking:u,voiceState:Be,replyPending:Se&&c&&!u,pinned:!0,muted:pt,onToggleMute:Wc,onEndCall:Ht,onTalkNow:qE,showTalkNow:XE,micLevel:cr,theaterMode:le,onToggleTheater:VE,onMinimize:$r,audioDevices:Oe,selectedAudioDeviceId:br,onSelectAudioDevice:YE,connectingOnly:kp}):null}),!kp&&_("div",{class:"cf-panel__chat",children:[e.preview&&_("div",{class:"cf-preview-banner",children:a.previewBanner}),qe&&_("div",{class:"cf-viewing-banner",children:a.viewingPast}),_("div",{class:"cf-body",ref:Ii,role:"log",onScroll:HE,children:[ls.map((E,$)=>_(w5,{msg:E,persona:s,isLast:!qe&&$===ls.length-1,visitor:f,hasEmail:h,lastQuestion:JE,showActions:!qe&&$===ls.length-1&&!!E.handoffOffered,onPickReply:QE,onSubmitForm:L,onDemoSlots:q,onRetry:w,ratable:!qe&&ls.slice(0,$).some(xe=>xe.role==="user"),onRate:k,onExpandVisualization:qe?void 0:GE},E.id)),!Yc&&!qe&&_(Ae,{children:[ls.length===0&&_(aE,{name:s?.agentName??a.assistantName,greeting:s?.greeting}),_(_5,{items:g,onPick:y}),_(b5,{items:v})]}),RE&&_("button",{type:"button",class:"cf-newmsg",onClick:Bn,children:[_(FR,{}),a.newMessages]})]}),_("div",{class:"cf-sr-live","aria-live":"polite","aria-atomic":"true",children:ZE}),c&&!F&&!qe&&_("div",{class:"cf-stopbar",children:_("button",{type:"button",class:"cf-stop",onClick:S,children:[_(ER,{}),a.stop]})}),qe?_("div",{class:"cf-ended",children:_("button",{type:"button",class:"cf-ended__btn",onClick:Ie,children:a.backToChat})}):F?_("div",{class:"cf-ended",children:[_("p",{class:"cf-ended__text",children:a.conversationEnded}),e.csat&&Yc?NE?_("p",{class:"cf-ended__text",children:a.feedbackThanks}):_("div",{class:"cf-csat",children:[_("span",{class:"cf-csat__q",children:a.csatPrompt}),_("button",{type:"button",class:"cf-csat__btn","aria-label":a.feedbackHelpful,onClick:()=>{I("up"),I1(!0)},children:_(Gx,{})}),_("button",{type:"button",class:"cf-csat__btn","aria-label":a.feedbackNotHelpful,onClick:()=>{I("down"),I1(!0)},children:_($x,{})})]}):null,_("button",{type:"button",class:"cf-ended__btn",onClick:FE,children:a.startNewChat})]}):_(Ae,{children:[m?_("div",{class:"cf-live-typing","aria-live":"polite",children:qt(a.agentTyping,{name:m})}):null,Sp&&Sp.length>0&&_("div",{class:"cf-footer-actions",children:_(jx,{actions:Sp,descriptors:rO,visitor:f,onSubmitForm:L,onDemoSlots:q,scheduler:s?.scheduler,translations:e.actionTranslations})},"footer-actions"),_(O5,{draftStore:OE,onSend:y,onSendGif:b,onTyping:x,disabled:c,allowVoice:!!s?.allowVoiceInput,onTranscribe:P,gifEnabled:R,onSearchGifs:O,allowAttach:e.attachments,onExtract:N},"composer")]}),!F&&s?.disclaimerText&&_("div",{class:"cf-disclaimer",children:s.disclaimerText}),_("div",{class:"cf-footer",children:[_("button",{type:"button",class:"cf-footer__privacy","aria-label":a.clearDeviceData,onClick:()=>Pa(!0),children:a.privacyAndData}),_("span",{"aria-hidden":"true",children:"·"}),a.poweredBy," ",_("a",{href:"https://accurix.tech/centrinfo",target:"_blank",rel:"noopener noreferrer",children:"Centrinfo"})]})]}),un&&_("div",{class:"cf-confirm",onClick:()=>Ri(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":a.endChatConfirm,onClick:E=>E.stopPropagation(),onKeyDownCapture:E=>hp(E,E.currentTarget,()=>Ri(!1)),children:[_("div",{class:"cf-confirm__title",children:a.endChatConfirm}),_("div",{class:"cf-confirm__body",children:a.endChatConfirmBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{ref:A1,type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Ri(!1),children:a.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:zE,children:a.endConfirmCta})]})]})},"confirm-end"),Nn&&_("div",{class:"cf-confirm",onClick:()=>Ra(!1),children:_("div",{class:"cf-history",role:"dialog","aria-modal":"true","aria-label":a.pastConversations,onClick:E=>E.stopPropagation(),onKeyDownCapture:E=>hp(E,E.currentTarget,()=>Ra(!1)),children:[_("div",{class:"cf-history__head",children:[_("span",{children:a.pastConversations}),_("button",{type:"button",class:"cf-header__btn","aria-label":a.closeHistory,onClick:()=>Ra(!1),children:_(Ti,{})})]}),_("div",{class:"cf-history__list",children:fe.map(E=>_("button",{type:"button",class:`cf-history__item ${E.sessionId===me?"is-active":""}`,onClick:()=>{Ze(E.sessionId),Ra(!1)},children:[_("span",{class:"cf-history__title",children:E.title}),_("span",{class:"cf-history__meta",children:[new Date(E.ts).toLocaleDateString(void 0,{month:"short",day:"numeric"}),E.ended?` · ${a.historyEnded}`:""]})]},E.sessionId))}),_("div",{class:"cf-history__footer",children:_("button",{type:"button",class:"cf-history__clear",onClick:()=>{Ra(!1),Pa(!0)},children:a.clearDeviceData})})]})},"history"),La&&_("div",{class:"cf-confirm",onClick:()=>Pa(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":a.clearDeviceData,onClick:E=>E.stopPropagation(),onKeyDownCapture:E=>hp(E,E.currentTarget,()=>Pa(!1)),children:[_("div",{class:"cf-confirm__title",children:a.clearDeviceData}),_("div",{class:"cf-confirm__body",children:a.clearDeviceDataBody}),_("div",{class:"cf-confirm__actions",children:[_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Pa(!1),children:a.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:()=>{Pa(!1),tt()},children:a.clearDeviceDataCta})]})]})},"confirm-clear")]}),Se&&!i?_(R5,{persona:s,voiceState:Be,muted:pt,onToggleMute:Wc,onEndCall:Ht,micLevel:cr,onExpand:Ei}):le&&i?null:!e.hideDefaultLauncher&&_("button",{ref:Fc,type:"button",class:"cf-launcher","aria-label":i?a.closeChat:re>0?`${a.openChat}. ${re===1?a.unreadMessage:qt(a.unreadMessages,{count:String(re)})}`:a.openChat,"aria-expanded":i,onClick:os,children:[e.launcherIcon?_("img",{class:"cf-launcher__img",src:e.launcherIcon,alt:""}):_(kR,{}),!i&&re>0&&_("span",{class:"cf-launcher__badge","aria-hidden":"true",children:re>99?"99+":re})]})]})})},wE="https://api.accurixtech.com",SE=()=>typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en",kE=(t,e)=>{if(!t)return;const r=e.trim().toLowerCase(),n=r.split("-")[0]??r,a=Object.entries(t);return a.find(([i])=>i.toLowerCase()===r)?.[1]??a.find(([i])=>i.toLowerCase()===n)?.[1]},TE=t=>{if(!t||typeof t.token!="string"||t.token.length===0)throw new Error("[centrinfo-widget] `token` is required — pass your pub_* token to Centrinfo.init({ token }).");const e=t.locale?.trim()||SE(),r=kE(t.translations,e);return{token:t.token,chatSurface:t.chatSurface??"floating",analyticsContextToken:t.analyticsContextToken,identityToken:t.identityToken,getIdentityToken:t.getIdentityToken,apiBaseUrl:(t.apiBaseUrl??wE).replace(/\/$/,""),accentColor:t.accentColor,themeTokens:t.themeTokens,agentName:t.agentName?.trim()||void 0,agentAvatarUrl:t.agentAvatarUrl?.trim()||void 0,launcherIcon:t.launcherIcon,gifApiKey:t.gifApiKey,theme:t.theme??"auto",openByDefault:t.openByDefault??!1,sound:t.sound??!0,starters:t.starters??[],strings:wR({...r?.labels,...t.labels}),locale:e,actionTranslations:r?.actions??{},persistence:t.persistence??"local",attachments:t.attachments??!0,zIndex:t.zIndex??2147483e3,styleNonce:t.styleNonce?.trim()??"",demo:t.demo??!1,preview:t.preview??!1,alignment:t.alignment==="left"?"left":"right",horizontalPadding:typeof t.horizontalPadding=="number"?t.horizontalPadding:20,verticalPadding:typeof t.verticalPadding=="number"?t.verticalPadding:20,hideDefaultLauncher:t.hideDefaultLauncher??!1,customLauncherSelector:t.customLauncherSelector,sessionDurationMinutes:typeof t.sessionDurationMinutes=="number"?t.sessionDurationMinutes:0,configRefreshSeconds:typeof t.configRefreshSeconds=="number"?t.configRefreshSeconds:30,proactiveMessage:t.proactiveMessage,proactiveDelaySeconds:typeof t.proactiveDelaySeconds=="number"?t.proactiveDelaySeconds:5,proactiveOnPaths:t.proactiveOnPaths,csat:t.csat??!0,user:t.user,onOpen:t.onOpen,onClose:t.onClose,onShow:t.onShow,onHide:t.onHide,onUnreadChange:t.onUnreadChange,onMessage:t.onMessage,onAction:t.onAction,onHandoff:t.onHandoff}},b1=`
|
|
34
34
|
:host {
|
|
35
35
|
all: initial;
|
|
36
36
|
}
|
|
@@ -44,6 +44,7 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
44
44
|
--cf-text: #0f1e2a;
|
|
45
45
|
--cf-muted: #5b7186;
|
|
46
46
|
--cf-border: #e4e9ee;
|
|
47
|
+
--cf-danger: #b42318;
|
|
47
48
|
--cf-shadow: 0 12px 48px -12px rgba(15, 30, 42, 0.4), 0 4px 12px -4px rgba(15, 30, 42, 0.2);
|
|
48
49
|
--cf-radius: 18px;
|
|
49
50
|
--cf-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
|
|
@@ -175,16 +176,15 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
175
176
|
overflow: hidden;
|
|
176
177
|
transform-origin: bottom right;
|
|
177
178
|
opacity: 0;
|
|
178
|
-
transform:
|
|
179
|
+
transform: scale(0.94);
|
|
179
180
|
pointer-events: none;
|
|
180
181
|
transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
|
|
181
182
|
height 0.28s ease, width 0.28s ease;
|
|
182
183
|
}
|
|
183
184
|
.cf-panel.is-open {
|
|
184
185
|
opacity: 1;
|
|
185
|
-
transform:
|
|
186
|
+
transform: scale(1);
|
|
186
187
|
pointer-events: auto;
|
|
187
|
-
animation: cf-panel-open 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
188
188
|
}
|
|
189
189
|
|
|
190
190
|
.cf-panel > .cf-header { grid-area: header; }
|
|
@@ -522,6 +522,30 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
522
522
|
.cf-msg__bubble p:last-child { margin-bottom: 0; }
|
|
523
523
|
.cf-msg__col { min-width: 0; max-width: 85%; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
|
|
524
524
|
.cf-msg--user .cf-msg__col { align-items: flex-end; }
|
|
525
|
+
.cf-artifact {
|
|
526
|
+
width: min(100%, 560px);
|
|
527
|
+
overflow: hidden;
|
|
528
|
+
margin: 0;
|
|
529
|
+
border: 1px solid var(--cf-border);
|
|
530
|
+
border-radius: 12px;
|
|
531
|
+
background: var(--cf-surface);
|
|
532
|
+
}
|
|
533
|
+
.cf-artifact figcaption { padding: 10px 12px 0; color: var(--cf-text); font-size: 12px; font-weight: 750; }
|
|
534
|
+
.cf-artifact img { display: block; width: 100%; height: auto; margin-top: 9px; }
|
|
535
|
+
.cf-artifact p { margin: 0 !important; padding: 8px 12px 10px; color: var(--cf-muted); font-size: 10px; }
|
|
536
|
+
.cf-artifact-link {
|
|
537
|
+
display: grid;
|
|
538
|
+
width: min(100%, 560px);
|
|
539
|
+
gap: 3px;
|
|
540
|
+
border: 1px solid var(--cf-border);
|
|
541
|
+
border-radius: 10px;
|
|
542
|
+
background: var(--cf-surface);
|
|
543
|
+
padding: 10px 12px;
|
|
544
|
+
color: var(--cf-text);
|
|
545
|
+
text-decoration: none;
|
|
546
|
+
}
|
|
547
|
+
.cf-artifact-link:hover { border-color: var(--cf-accent); }
|
|
548
|
+
.cf-artifact-link span { color: var(--cf-muted); font-size: 10px; }
|
|
525
549
|
.cf-system-event {
|
|
526
550
|
width: min(280px, 88%);
|
|
527
551
|
display: flex;
|
|
@@ -918,6 +942,12 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
918
942
|
.cf-action svg { width: 15px; height: 15px; color: var(--cf-accent); }
|
|
919
943
|
|
|
920
944
|
/* ---------- Inline forms + handoff card ---------- */
|
|
945
|
+
.cf-action-shell {
|
|
946
|
+
display: flex;
|
|
947
|
+
flex-direction: column;
|
|
948
|
+
gap: 8px;
|
|
949
|
+
}
|
|
950
|
+
|
|
921
951
|
.cf-form {
|
|
922
952
|
display: flex;
|
|
923
953
|
flex-direction: column;
|
|
@@ -1001,6 +1031,16 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
1001
1031
|
.cf-booking { max-width: 320px; }
|
|
1002
1032
|
.cf-booking__hint { font-size: 12.5px; color: var(--cf-muted); margin-top: -2px; }
|
|
1003
1033
|
.cf-booking__dur { font-weight: 600; color: var(--cf-text); }
|
|
1034
|
+
.cf-booking__state {
|
|
1035
|
+
padding: 12px;
|
|
1036
|
+
border: 1px dashed var(--cf-border);
|
|
1037
|
+
border-radius: 10px;
|
|
1038
|
+
background: var(--cf-bg-soft);
|
|
1039
|
+
color: var(--cf-muted);
|
|
1040
|
+
font-size: 12px;
|
|
1041
|
+
line-height: 1.45;
|
|
1042
|
+
text-align: center;
|
|
1043
|
+
}
|
|
1004
1044
|
.cf-booking__dates {
|
|
1005
1045
|
display: flex;
|
|
1006
1046
|
gap: 6px;
|
|
@@ -1292,6 +1332,9 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
1292
1332
|
cursor: pointer;
|
|
1293
1333
|
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
|
|
1294
1334
|
}
|
|
1335
|
+
.cf-action-trigger[hidden] {
|
|
1336
|
+
display: none;
|
|
1337
|
+
}
|
|
1295
1338
|
.cf-action-trigger:hover {
|
|
1296
1339
|
border-color: color-mix(in oklab, var(--cf-accent) 46%, var(--cf-border));
|
|
1297
1340
|
}
|
|
@@ -1447,6 +1490,21 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
1447
1490
|
font-size: 10px;
|
|
1448
1491
|
line-height: 1.25;
|
|
1449
1492
|
}
|
|
1493
|
+
|
|
1494
|
+
.cf-action-test-mode {
|
|
1495
|
+
display: inline-flex;
|
|
1496
|
+
width: fit-content;
|
|
1497
|
+
margin-top: 3px;
|
|
1498
|
+
padding: 2px 7px;
|
|
1499
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent) 32%, transparent);
|
|
1500
|
+
border-radius: 999px;
|
|
1501
|
+
color: var(--cf-accent-strong);
|
|
1502
|
+
background: color-mix(in srgb, var(--cf-accent) 9%, white);
|
|
1503
|
+
font-size: 10px;
|
|
1504
|
+
font-weight: 700;
|
|
1505
|
+
letter-spacing: 0.04em;
|
|
1506
|
+
text-transform: uppercase;
|
|
1507
|
+
}
|
|
1450
1508
|
.cf-action-drawer .cf-form,
|
|
1451
1509
|
.cf-action-drawer .cf-booking {
|
|
1452
1510
|
max-width: none;
|
|
@@ -2555,23 +2613,6 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
2555
2613
|
from { transform: scale(0); }
|
|
2556
2614
|
to { transform: scale(1); }
|
|
2557
2615
|
}
|
|
2558
|
-
@keyframes cf-panel-open {
|
|
2559
|
-
0% {
|
|
2560
|
-
opacity: 0;
|
|
2561
|
-
transform: translateY(24px) scale(0.93);
|
|
2562
|
-
filter: blur(2px);
|
|
2563
|
-
}
|
|
2564
|
-
58% {
|
|
2565
|
-
opacity: 1;
|
|
2566
|
-
transform: translateY(-3px) scale(1.006);
|
|
2567
|
-
filter: blur(0);
|
|
2568
|
-
}
|
|
2569
|
-
100% {
|
|
2570
|
-
opacity: 1;
|
|
2571
|
-
transform: translateY(0) scale(1);
|
|
2572
|
-
filter: blur(0);
|
|
2573
|
-
}
|
|
2574
|
-
}
|
|
2575
2616
|
@keyframes cf-msg-in {
|
|
2576
2617
|
from { opacity: 0; transform: translateY(8px); }
|
|
2577
2618
|
to { opacity: 1; transform: none; }
|
|
@@ -2640,27 +2681,138 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
2640
2681
|
gap: 6px;
|
|
2641
2682
|
}
|
|
2642
2683
|
.cf-analytics-chart-picker {
|
|
2643
|
-
|
|
2644
|
-
|
|
2645
|
-
|
|
2684
|
+
position: relative;
|
|
2685
|
+
display: inline-flex;
|
|
2686
|
+
min-width: 0;
|
|
2646
2687
|
color: var(--cf-muted);
|
|
2647
2688
|
font-size: 9px;
|
|
2648
2689
|
font-weight: 700;
|
|
2649
2690
|
}
|
|
2650
|
-
|
|
2651
|
-
|
|
2691
|
+
|
|
2692
|
+
.cf-analytics-chart-picker summary {
|
|
2693
|
+
display: inline-flex;
|
|
2694
|
+
min-width: 92px;
|
|
2695
|
+
max-width: 138px;
|
|
2652
2696
|
height: 30px;
|
|
2697
|
+
align-items: center;
|
|
2698
|
+
gap: 6px;
|
|
2653
2699
|
border: 1px solid var(--cf-border);
|
|
2654
2700
|
border-radius: 8px;
|
|
2655
2701
|
background: var(--cf-bg);
|
|
2656
|
-
padding: 0
|
|
2702
|
+
padding: 0 8px;
|
|
2657
2703
|
color: var(--cf-text);
|
|
2658
|
-
|
|
2704
|
+
list-style: none;
|
|
2705
|
+
cursor: pointer;
|
|
2706
|
+
box-shadow: 0 1px 2px rgba(15, 23, 42, .05);
|
|
2707
|
+
transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
|
|
2708
|
+
}
|
|
2709
|
+
|
|
2710
|
+
.cf-analytics-chart-picker summary::-webkit-details-marker { display: none; }
|
|
2711
|
+
.cf-analytics-chart-picker summary:hover,
|
|
2712
|
+
.cf-analytics-chart-picker[open] summary {
|
|
2713
|
+
border-color: var(--cf-accent);
|
|
2714
|
+
background: color-mix(in oklab, var(--cf-accent) 9%, var(--cf-bg));
|
|
2659
2715
|
}
|
|
2660
|
-
.cf-analytics-chart-picker
|
|
2716
|
+
.cf-analytics-chart-picker summary:focus-visible {
|
|
2661
2717
|
outline: 2px solid var(--cf-accent);
|
|
2662
2718
|
outline-offset: 2px;
|
|
2663
2719
|
}
|
|
2720
|
+
.cf-analytics-chart-picker summary > svg:last-child {
|
|
2721
|
+
width: 13px;
|
|
2722
|
+
height: 13px;
|
|
2723
|
+
flex: 0 0 13px;
|
|
2724
|
+
margin-left: auto;
|
|
2725
|
+
color: var(--cf-muted);
|
|
2726
|
+
transition: transform .16s ease;
|
|
2727
|
+
}
|
|
2728
|
+
.cf-analytics-chart-picker[open] summary > svg:last-child { transform: rotate(180deg); }
|
|
2729
|
+
.cf-analytics-chart-picker__current {
|
|
2730
|
+
display: inline-flex;
|
|
2731
|
+
min-width: 0;
|
|
2732
|
+
align-items: center;
|
|
2733
|
+
gap: 6px;
|
|
2734
|
+
}
|
|
2735
|
+
.cf-analytics-chart-picker__current > span {
|
|
2736
|
+
overflow: hidden;
|
|
2737
|
+
text-overflow: ellipsis;
|
|
2738
|
+
white-space: nowrap;
|
|
2739
|
+
}
|
|
2740
|
+
.cf-chart-type-icon {
|
|
2741
|
+
width: 17px;
|
|
2742
|
+
height: 17px;
|
|
2743
|
+
flex: 0 0 17px;
|
|
2744
|
+
}
|
|
2745
|
+
.cf-analytics-chart-picker__menu {
|
|
2746
|
+
position: absolute;
|
|
2747
|
+
top: calc(100% + 7px);
|
|
2748
|
+
right: 0;
|
|
2749
|
+
z-index: 60;
|
|
2750
|
+
display: grid;
|
|
2751
|
+
min-width: 196px;
|
|
2752
|
+
padding: 6px;
|
|
2753
|
+
border: 1px solid var(--cf-border);
|
|
2754
|
+
border-radius: 12px;
|
|
2755
|
+
background: var(--cf-bg);
|
|
2756
|
+
box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
|
|
2757
|
+
}
|
|
2758
|
+
.cf-analytics-chart-picker__menu button {
|
|
2759
|
+
display: flex;
|
|
2760
|
+
width: 100%;
|
|
2761
|
+
min-height: 46px;
|
|
2762
|
+
align-items: flex-start;
|
|
2763
|
+
gap: 8px;
|
|
2764
|
+
border: 0;
|
|
2765
|
+
border-radius: 9px;
|
|
2766
|
+
background: transparent;
|
|
2767
|
+
padding: 7px;
|
|
2768
|
+
color: var(--cf-text);
|
|
2769
|
+
font: inherit;
|
|
2770
|
+
text-align: left;
|
|
2771
|
+
cursor: pointer;
|
|
2772
|
+
}
|
|
2773
|
+
.cf-analytics-chart-picker__menu button:hover,
|
|
2774
|
+
.cf-analytics-chart-picker__menu button.is-selected {
|
|
2775
|
+
background: color-mix(in oklab, var(--cf-accent) 10%, var(--cf-bg));
|
|
2776
|
+
color: var(--cf-accent);
|
|
2777
|
+
}
|
|
2778
|
+
.cf-analytics-chart-picker__menu button > svg:last-child {
|
|
2779
|
+
width: 13px;
|
|
2780
|
+
height: 13px;
|
|
2781
|
+
flex: 0 0 13px;
|
|
2782
|
+
margin-top: 4px;
|
|
2783
|
+
}
|
|
2784
|
+
.cf-analytics-chart-picker__icon {
|
|
2785
|
+
display: inline-flex;
|
|
2786
|
+
width: 30px;
|
|
2787
|
+
height: 30px;
|
|
2788
|
+
flex: 0 0 30px;
|
|
2789
|
+
align-items: center;
|
|
2790
|
+
justify-content: center;
|
|
2791
|
+
border-radius: 9px;
|
|
2792
|
+
background: var(--cf-bg-soft);
|
|
2793
|
+
box-shadow: inset 0 0 0 1px var(--cf-border);
|
|
2794
|
+
}
|
|
2795
|
+
.cf-analytics-chart-picker__icon .cf-chart-type-icon {
|
|
2796
|
+
width: 25px;
|
|
2797
|
+
height: 25px;
|
|
2798
|
+
flex-basis: 25px;
|
|
2799
|
+
}
|
|
2800
|
+
.cf-analytics-chart-picker__copy {
|
|
2801
|
+
display: grid;
|
|
2802
|
+
min-width: 0;
|
|
2803
|
+
flex: 1;
|
|
2804
|
+
gap: 2px;
|
|
2805
|
+
}
|
|
2806
|
+
.cf-analytics-chart-picker__copy strong {
|
|
2807
|
+
font-size: 10px;
|
|
2808
|
+
line-height: 1.25;
|
|
2809
|
+
}
|
|
2810
|
+
.cf-analytics-chart-picker__copy small {
|
|
2811
|
+
color: var(--cf-muted);
|
|
2812
|
+
font-size: 9px;
|
|
2813
|
+
font-weight: 560;
|
|
2814
|
+
line-height: 1.3;
|
|
2815
|
+
}
|
|
2664
2816
|
.cf-analytics-visualization__title {
|
|
2665
2817
|
overflow: hidden;
|
|
2666
2818
|
color: var(--cf-muted);
|
|
@@ -2939,12 +3091,6 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
2939
3091
|
letter-spacing: -.035em;
|
|
2940
3092
|
line-height: 1;
|
|
2941
3093
|
}
|
|
2942
|
-
.cf-analytics-kpi__detail {
|
|
2943
|
-
margin-top: 8px;
|
|
2944
|
-
color: var(--cf-muted);
|
|
2945
|
-
font-size: 10px;
|
|
2946
|
-
line-height: 1.5;
|
|
2947
|
-
}
|
|
2948
3094
|
.cf-analytics-empty {
|
|
2949
3095
|
margin-top: 8px;
|
|
2950
3096
|
border: 1px dashed var(--cf-border);
|
|
@@ -3043,12 +3189,6 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
3043
3189
|
font-size: 10px;
|
|
3044
3190
|
font-weight: 700;
|
|
3045
3191
|
}
|
|
3046
|
-
.cf-analytics-chart__summary {
|
|
3047
|
-
margin: 2px 0 0;
|
|
3048
|
-
color: var(--cf-muted);
|
|
3049
|
-
font-size: 11px;
|
|
3050
|
-
line-height: 1.45;
|
|
3051
|
-
}
|
|
3052
3192
|
.cf-analytics-focus {
|
|
3053
3193
|
height: 100%;
|
|
3054
3194
|
min-height: 0;
|
|
@@ -3306,4 +3446,106 @@ ${be}`.trim()}else!xe&&ee&&(xe=ee);const it={id:pe||Qr(),role:"user",content:Y,i
|
|
|
3306
3446
|
.cf-analytics-focus { padding: 14px; }
|
|
3307
3447
|
.cf-analytics-visualization.is-expanded .cf-analytics-echart { min-height: 260px; }
|
|
3308
3448
|
}
|
|
3309
|
-
|
|
3449
|
+
|
|
3450
|
+
/* Production embed hardening: dynamic mobile viewports, safe areas, and touch. */
|
|
3451
|
+
@supports (height: 100dvh) {
|
|
3452
|
+
.cf-panel { height: min(88dvh, 820px); max-height: calc(100dvh - 40px); }
|
|
3453
|
+
.cf-panel.cf-panel--call { height: min(90dvh, 840px); }
|
|
3454
|
+
.cf-panel.cf-panel--voice-connecting { height: min(72dvh, 560px); }
|
|
3455
|
+
}
|
|
3456
|
+
.cf-history__footer {
|
|
3457
|
+
flex: 0 0 auto;
|
|
3458
|
+
border-top: 1px solid var(--cf-border);
|
|
3459
|
+
padding: 10px 12px;
|
|
3460
|
+
}
|
|
3461
|
+
.cf-history__clear {
|
|
3462
|
+
width: 100%;
|
|
3463
|
+
min-height: 38px;
|
|
3464
|
+
border-radius: 9px !important;
|
|
3465
|
+
color: var(--cf-danger) !important;
|
|
3466
|
+
font-size: 12px;
|
|
3467
|
+
font-weight: 700;
|
|
3468
|
+
}
|
|
3469
|
+
.cf-history__clear:hover { background: color-mix(in srgb, var(--cf-danger) 8%, var(--cf-bg)) !important; }
|
|
3470
|
+
.cf-history__clear:focus-visible { outline: 2px solid var(--cf-danger); outline-offset: 2px; }
|
|
3471
|
+
.cf-footer__privacy {
|
|
3472
|
+
border-radius: 5px !important;
|
|
3473
|
+
color: inherit !important;
|
|
3474
|
+
font: inherit;
|
|
3475
|
+
text-decoration: underline;
|
|
3476
|
+
text-underline-offset: 2px;
|
|
3477
|
+
}
|
|
3478
|
+
.cf-footer__privacy:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
|
|
3479
|
+
.cf-composer.is-dragging { box-shadow: inset 0 0 0 2px var(--cf-accent); }
|
|
3480
|
+
.cf-attach-status { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
|
|
3481
|
+
.cf-attach-status button {
|
|
3482
|
+
min-height: 28px;
|
|
3483
|
+
border-radius: 7px !important;
|
|
3484
|
+
padding: 0 8px !important;
|
|
3485
|
+
color: var(--cf-accent) !important;
|
|
3486
|
+
font-size: 11px;
|
|
3487
|
+
font-weight: 700;
|
|
3488
|
+
}
|
|
3489
|
+
.cf-attach-preview {
|
|
3490
|
+
width: 32px;
|
|
3491
|
+
height: 32px;
|
|
3492
|
+
flex: 0 0 32px;
|
|
3493
|
+
border-radius: 7px;
|
|
3494
|
+
object-fit: cover;
|
|
3495
|
+
}
|
|
3496
|
+
.cf-attach-copy { display: grid; min-width: 0; gap: 1px; }
|
|
3497
|
+
.cf-attach-copy > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
3498
|
+
.cf-attach-copy small { color: var(--cf-muted); font-size: 9px; font-weight: 600; }
|
|
3499
|
+
|
|
3500
|
+
@media (max-width: 639px) {
|
|
3501
|
+
.cf-panel {
|
|
3502
|
+
top: max(8px, env(safe-area-inset-top));
|
|
3503
|
+
right: max(8px, env(safe-area-inset-right));
|
|
3504
|
+
bottom: max(8px, env(safe-area-inset-bottom));
|
|
3505
|
+
left: max(8px, env(safe-area-inset-left));
|
|
3506
|
+
width: auto;
|
|
3507
|
+
height: auto;
|
|
3508
|
+
min-height: 0;
|
|
3509
|
+
max-width: none;
|
|
3510
|
+
max-height: none;
|
|
3511
|
+
border-radius: 16px;
|
|
3512
|
+
}
|
|
3513
|
+
.cf-launcher {
|
|
3514
|
+
right: max(var(--cf-h-pad, 20px), env(safe-area-inset-right));
|
|
3515
|
+
bottom: max(var(--cf-v-pad, 20px), env(safe-area-inset-bottom));
|
|
3516
|
+
}
|
|
3517
|
+
.cf-root[data-align='left'] .cf-launcher {
|
|
3518
|
+
right: auto;
|
|
3519
|
+
left: max(var(--cf-h-pad, 20px), env(safe-area-inset-left));
|
|
3520
|
+
}
|
|
3521
|
+
.cf-root[data-align='left'] .cf-panel {
|
|
3522
|
+
right: max(8px, env(safe-area-inset-right));
|
|
3523
|
+
left: max(8px, env(safe-area-inset-left));
|
|
3524
|
+
}
|
|
3525
|
+
.cf-panel.cf-panel--call,
|
|
3526
|
+
.cf-panel.cf-panel--voice-connecting,
|
|
3527
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
3528
|
+
top: max(8px, env(safe-area-inset-top));
|
|
3529
|
+
right: max(8px, env(safe-area-inset-right));
|
|
3530
|
+
bottom: max(8px, env(safe-area-inset-bottom));
|
|
3531
|
+
left: max(8px, env(safe-area-inset-left));
|
|
3532
|
+
width: auto;
|
|
3533
|
+
height: auto;
|
|
3534
|
+
min-height: 0;
|
|
3535
|
+
max-width: none;
|
|
3536
|
+
max-height: none;
|
|
3537
|
+
}
|
|
3538
|
+
.cf-header__btn { width: 40px; height: 40px; }
|
|
3539
|
+
.cf-feedback__btn { width: 36px; height: 36px; }
|
|
3540
|
+
.cf-iconbtn, .cf-send { min-width: 40px; min-height: 40px; }
|
|
3541
|
+
}
|
|
3542
|
+
@media (min-width: 640px) and (max-height: 599px) {
|
|
3543
|
+
.cf-panel,
|
|
3544
|
+
.cf-panel.cf-panel--call,
|
|
3545
|
+
.cf-panel.cf-panel--voice-connecting {
|
|
3546
|
+
height: calc(100dvh - 24px);
|
|
3547
|
+
min-height: 0;
|
|
3548
|
+
max-height: calc(100dvh - 24px);
|
|
3549
|
+
}
|
|
3550
|
+
}
|
|
3551
|
+
`,vp="centrinfo-widget";class CE extends HTMLElement{constructor(){super(...arguments);Vt(this,"controls",null);Vt(this,"composerDraftStore",{value:""})}mountWith(r){const n=TE(r),a=this.shadowRoot??this.attachShadow({mode:"open"});if(this.style.zIndex=String(n.zIndex),"adoptedStyleSheets"in Document.prototype&&typeof CSSStyleSheet<"u"&&typeof CSSStyleSheet.prototype.replaceSync=="function"){const o=new CSSStyleSheet;o.replaceSync(b1),a.adoptedStyleSheets=[o]}else{const o=document.createElement("style");n.styleNonce&&(o.nonce=n.styleNonce),o.textContent=b1,a.appendChild(o)}const i=n.demo?new lw:n.preview?new cw(new Wp(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken,n.chatSurface),n.strings):new Wp(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken,n.chatSurface);Vp(_(xE,{transport:i,config:n,bindControls:o=>this.controls=o,composerDraftStore:this.composerDraftStore}),a)}open(){this.controls?.open()}close(){this.controls?.close()}toggle(){this.controls?.toggle()}identify(r){this.controls?.identify(r)}clear(){this.controls?.startNew()}shutdown(){this.controls?.shutdown()}unmount(){this.shadowRoot&&Vp(null,this.shadowRoot)}}typeof customElements<"u"&&!customElements.get(vp)&&customElements.define(vp,CE);const ME=(t,e=document.body)=>{if(typeof document>"u")throw new Error("[centrinfo-widget] createWidget must run in a browser.");const r=document.createElement(vp);return r.style.pointerEvents="none",r.style.position="fixed",r.style.inset="0",r.style.width="0",r.style.height="0",e.appendChild(r),r.mountWith(t),{open:()=>r.open(),close:()=>r.close(),toggle:()=>r.toggle(),show:()=>r.open(),hide:()=>r.close(),identify:n=>r.identify(n),update:n=>r.identify(n),clear:()=>r.clear(),shutdown:()=>r.shutdown(),logout:()=>r.shutdown(),destroy:()=>{r.unmount(),r.remove()}}},x1=t=>ME(t);let w1=null;const S1=t=>{w1?.destroy();const e=x1(t);return w1=e,e},AE=t=>t==="light"||t==="dark"||t==="auto"?t:void 0,es=t=>{if(t==null||t.trim()==="")return;const e=Number(t);return Number.isFinite(e)?e:void 0},DE=t=>{if(t)try{const e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}},IE=t=>{const e=n=>t.getAttribute(n),r=e("data-token");return r?{token:r,apiBaseUrl:e("data-api-base")??void 0,accentColor:e("data-accent")??void 0,agentName:e("data-agent-name")??void 0,agentAvatarUrl:e("data-agent-avatar-url")??void 0,launcherIcon:e("data-launcher-icon")??void 0,gifApiKey:e("data-gif-api-key")??void 0,theme:AE(e("data-theme")),sound:e("data-sound")!=="false",openByDefault:e("data-open")==="true",demo:e("data-demo")==="true",preview:e("data-preview")==="true",alignment:e("data-alignment")==="left"?"left":void 0,horizontalPadding:es(e("data-horizontal-padding")),verticalPadding:es(e("data-vertical-padding")),hideDefaultLauncher:e("data-hide-launcher")==="true",styleNonce:(e("data-style-nonce")??t.nonce)||void 0,customLauncherSelector:e("data-custom-launcher-selector")??void 0,sessionDurationMinutes:es(e("data-session-duration")),configRefreshSeconds:es(e("data-config-refresh")),proactiveMessage:e("data-proactive-message")??void 0,proactiveDelaySeconds:es(e("data-proactive-delay")),csat:e("data-csat")==="false"?!1:void 0,user:DE(e("data-user"))}:null},LE=t=>{typeof document>"u"||(document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t,{once:!0}))},PE=()=>{const t=document.currentScript??document.querySelector("script[data-token]");if(!t)return;const e=IE(t);e&&S1(e)};return LE(()=>{try{PE()}catch(t){console.error("[centrinfo-widget]",t)}}),Tr.createWidget=x1,Tr.init=S1,Object.defineProperty(Tr,Symbol.toStringTag,{value:"Module"}),Tr})({});
|