@accurix/centrinfo-widget 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +62 -9
- package/dist/cdn/centrinfo-widget.js +2153 -225
- package/dist/cdn/manifest.json +6 -6
- package/dist/config-CCkOySUT.mjs +29 -0
- package/dist/config-CzrfVSPp.cjs +35 -0
- package/dist/index.cjs +2118 -218
- package/dist/index.d.cts +3 -291
- package/dist/index.d.mts +2 -293
- package/dist/index.d.ts +2 -293
- package/dist/index.mjs +2118 -218
- package/dist/runtime.cjs +1 -0
- package/dist/runtime.d.cts +245 -0
- package/dist/runtime.d.mts +245 -0
- package/dist/runtime.mjs +1 -0
- package/dist/types-DQWp12Cg.d.mts +661 -0
- package/dist/types-rfkc-TtX.d.cts +658 -0
- package/package.json +33 -17
|
@@ -1,14 +1,35 @@
|
|
|
1
|
-
var Centrinfo=(function(ae){"use strict";var xr=Object.defineProperty;var yr=(ae,ee,T)=>ee in ae?xr(ae,ee,{enumerable:!0,configurable:!0,writable:!0,value:T}):ae[ee]=T;var be=(ae,ee,T)=>yr(ae,typeof ee!="symbol"?ee+"":ee,T);var ee,T,At,de,It,Tt,Et,rt,Ue,Te,Nt,at,it,st,Mt,je={},Le=[],En=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Be=Array.isArray;function ce(t,e){for(var n in e)t[n]=e[n];return t}function ct(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function Nn(t,e,n){var o,i,a,s={};for(a in e)a=="key"?o=e[a]:a=="ref"?i=e[a]:s[a]=e[a];if(arguments.length>2&&(s.children=arguments.length>3?ee.call(arguments,2):n),typeof t=="function"&&t.defaultProps!=null)for(a in t.defaultProps)s[a]===void 0&&(s[a]=t.defaultProps[a]);return qe(t,s,o,i,null)}function qe(t,e,n,o,i){var a={type:t,props:e,key:n,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:i??++At,__i:-1,__u:0};return i==null&&T.vnode!=null&&T.vnode(a),a}function R(t){return t.children}function Fe(t,e){this.props=t,this.context=e}function we(t,e){if(e==null)return t.__?we(t.__,t.__i+1):null;for(var n;e<t.__k.length;e++)if((n=t.__k[e])!=null&&n.__e!=null)return n.__e;return typeof t.type=="function"?we(t):null}function Mn(t){if(t.__P&&t.__d){var e=t.__v,n=e.__e,o=[],i=[],a=ce({},e);a.__v=e.__v+1,T.vnode&&T.vnode(a),dt(t.__P,a,e,t.__n,t.__P.namespaceURI,32&e.__u?[n]:null,o,n??we(e),!!(32&e.__u),i),a.__v=e.__v,a.__.__k[a.__i]=a,Rt(o,a,i),e.__e=e.__=null,a.__e!=n&&Pt(a)}}function Pt(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}),Pt(t)}function lt(t){(!t.__d&&(t.__d=!0)&&de.push(t)&&!We.__r++||It!=T.debounceRendering)&&((It=T.debounceRendering)||Tt)(We)}function We(){try{for(var t,e=1;de.length;)de.length>e&&de.sort(Et),t=de.shift(),e=de.length,Mn(t)}finally{de.length=We.__r=0}}function $t(t,e,n,o,i,a,s,d,f,l,u){var c,x,m,g,O,w,y,b=o&&o.__k||Le,I=e.length;for(f=Pn(n,e,b,f,I),c=0;c<I;c++)(m=n.__k[c])!=null&&(x=m.__i!=-1&&b[m.__i]||je,m.__i=c,w=dt(t,m,x,i,a,s,d,f,l,u),g=m.__e,m.ref&&x.ref!=m.ref&&(x.ref&&ut(x.ref,null,m),u.push(m.ref,m.__c||g,m)),O==null&&g!=null&&(O=g),(y=!!(4&m.__u))||x.__k===m.__k?(f=Dt(m,f,t,y),y&&x.__e&&(x.__e=null)):typeof m.type=="function"&&w!==void 0?f=w:g&&(f=g.nextSibling),m.__u&=-7);return n.__e=O,f}function Pn(t,e,n,o,i){var a,s,d,f,l,u=n.length,c=u,x=0;for(t.__k=new Array(i),a=0;a<i;a++)(s=e[a])!=null&&typeof s!="boolean"&&typeof s!="function"?(typeof s=="string"||typeof s=="number"||typeof s=="bigint"||s.constructor==String?s=t.__k[a]=qe(null,s,null,null,null):Be(s)?s=t.__k[a]=qe(R,{children:s},null,null,null):s.constructor===void 0&&s.__b>0?s=t.__k[a]=qe(s.type,s.props,s.key,s.ref?s.ref:null,s.__v):t.__k[a]=s,f=a+x,s.__=t,s.__b=t.__b+1,d=null,(l=s.__i=$n(s,n,f,c))!=-1&&(c--,(d=n[l])&&(d.__u|=2)),d==null||d.__v==null?(l==-1&&(i>u?x--:i<u&&x++),typeof s.type!="function"&&(s.__u|=4)):l!=f&&(l==f-1?x--:l==f+1?x++:(l>f?x--:x++,s.__u|=4))):t.__k[a]=null;if(c)for(a=0;a<u;a++)(d=n[a])!=null&&(2&d.__u)==0&&(d.__e==o&&(o=we(d)),Ut(d,d));return o}function Dt(t,e,n,o){var i,a;if(typeof t.type=="function"){for(i=t.__k,a=0;i&&a<i.length;a++)i[a]&&(i[a].__=t,e=Dt(i[a],e,n,o));return e}t.__e!=e&&(o&&(e&&t.type&&!e.parentNode&&(e=we(t)),n.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function $n(t,e,n,o){var i,a,s,d=t.key,f=t.type,l=e[n],u=l!=null&&(2&l.__u)==0;if(l===null&&d==null||u&&d==l.key&&f==l.type)return n;if(o>(u?1:0)){for(i=n-1,a=n+1;i>=0||a<e.length;)if((l=e[s=i>=0?i--:a++])!=null&&(2&l.__u)==0&&d==l.key&&f==l.type)return s}return-1}function Ot(t,e,n){e[0]=="-"?t.setProperty(e,n??""):t[e]=n==null?"":typeof n!="number"||En.test(e)?n:n+"px"}function Ge(t,e,n,o,i){var a,s;e:if(e=="style")if(typeof n=="string")t.style.cssText=n;else{if(typeof o=="string"&&(t.style.cssText=o=""),o)for(e in o)n&&e in n||Ot(t.style,e,"");if(n)for(e in n)o&&n[e]==o[e]||Ot(t.style,e,n[e])}else if(e[0]=="o"&&e[1]=="n")a=e!=(e=e.replace(Nt,"$1")),s=e.toLowerCase(),e=s in t||e=="onFocusOut"||e=="onFocusIn"?s.slice(2):e.slice(2),t.l||(t.l={}),t.l[e+a]=n,n?o?n[Te]=o[Te]:(n[Te]=at,t.addEventListener(e,a?st:it,a)):t.removeEventListener(e,a?st:it,a);else{if(i=="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]=n??"";break e}catch{}typeof n=="function"||(n==null||n===!1&&e[4]!="-"?t.removeAttribute(e):t.setAttribute(e,e=="popover"&&n==1?"":n))}}function zt(t){return function(e){if(this.l){var n=this.l[e.type+t];if(e[Ue]==null)e[Ue]=at++;else if(e[Ue]<n[Te])return;return n(T.event?T.event(e):e)}}}function dt(t,e,n,o,i,a,s,d,f,l){var u,c,x,m,g,O,w,y,b,I,H,G,X,V,K,$=e.type;if(e.constructor!==void 0)return null;128&n.__u&&(f=!!(32&n.__u),a=[d=e.__e=n.__e]),(u=T.__b)&&u(e);e:if(typeof $=="function")try{if(y=e.props,b=$.prototype&&$.prototype.render,I=(u=$.contextType)&&o[u.__c],H=u?I?I.props.value:u.__:o,n.__c?w=(c=e.__c=n.__c).__=c.__E:(b?e.__c=c=new $(y,H):(e.__c=c=new Fe(y,H),c.constructor=$,c.render=On),I&&I.sub(c),c.state||(c.state={}),c.__n=o,x=c.__d=!0,c.__h=[],c._sb=[]),b&&c.__s==null&&(c.__s=c.state),b&&$.getDerivedStateFromProps!=null&&(c.__s==c.state&&(c.__s=ce({},c.__s)),ce(c.__s,$.getDerivedStateFromProps(y,c.__s))),m=c.props,g=c.state,c.__v=e,x)b&&$.getDerivedStateFromProps==null&&c.componentWillMount!=null&&c.componentWillMount(),b&&c.componentDidMount!=null&&c.__h.push(c.componentDidMount);else{if(b&&$.getDerivedStateFromProps==null&&y!==m&&c.componentWillReceiveProps!=null&&c.componentWillReceiveProps(y,H),e.__v==n.__v||!c.__e&&c.shouldComponentUpdate!=null&&c.shouldComponentUpdate(y,c.__s,H)===!1){e.__v!=n.__v&&(c.props=y,c.state=c.__s,c.__d=!1),e.__e=n.__e,e.__k=n.__k,e.__k.some(function(j){j&&(j.__=e)}),Le.push.apply(c.__h,c._sb),c._sb=[],c.__h.length&&s.push(c);break e}c.componentWillUpdate!=null&&c.componentWillUpdate(y,c.__s,H),b&&c.componentDidUpdate!=null&&c.__h.push(function(){c.componentDidUpdate(m,g,O)})}if(c.context=H,c.props=y,c.__P=t,c.__e=!1,G=T.__r,X=0,b)c.state=c.__s,c.__d=!1,G&&G(e),u=c.render(c.props,c.state,c.context),Le.push.apply(c.__h,c._sb),c._sb=[];else do c.__d=!1,G&&G(e),u=c.render(c.props,c.state,c.context),c.state=c.__s;while(c.__d&&++X<25);c.state=c.__s,c.getChildContext!=null&&(o=ce(ce({},o),c.getChildContext())),b&&!x&&c.getSnapshotBeforeUpdate!=null&&(O=c.getSnapshotBeforeUpdate(m,g)),V=u!=null&&u.type===R&&u.key==null?Ht(u.props.children):u,d=$t(t,Be(V)?V:[V],e,n,o,i,a,s,d,f,l),c.base=e.__e,e.__u&=-161,c.__h.length&&s.push(c),w&&(c.__E=c.__=null)}catch(j){if(e.__v=null,f||a!=null)if(j.then){for(e.__u|=f?160:128;d&&d.nodeType==8&&d.nextSibling;)d=d.nextSibling;a[a.indexOf(d)]=null,e.__e=d}else{for(K=a.length;K--;)ct(a[K]);ft(e)}else e.__e=n.__e,e.__k=n.__k,j.then||ft(e);T.__e(j,e,n)}else a==null&&e.__v==n.__v?(e.__k=n.__k,e.__e=n.__e):d=e.__e=Dn(n.__e,e,n,o,i,a,s,f,l);return(u=T.diffed)&&u(e),128&e.__u?void 0:d}function ft(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(ft))}function Rt(t,e,n){for(var o=0;o<n.length;o++)ut(n[o],n[++o],n[++o]);T.__c&&T.__c(e,t),t.some(function(i){try{t=i.__h,i.__h=[],t.some(function(a){a.call(i)})}catch(a){T.__e(a,i.__v)}})}function Ht(t){return typeof t!="object"||t==null||t.__b>0?t:Be(t)?t.map(Ht):t.constructor!==void 0?null:ce({},t)}function Dn(t,e,n,o,i,a,s,d,f){var l,u,c,x,m,g,O,w=n.props||je,y=e.props,b=e.type;if(b=="svg"?i="http://www.w3.org/2000/svg":b=="math"?i="http://www.w3.org/1998/Math/MathML":i||(i="http://www.w3.org/1999/xhtml"),a!=null){for(l=0;l<a.length;l++)if((m=a[l])&&"setAttribute"in m==!!b&&(b?m.localName==b:m.nodeType==3)){t=m,a[l]=null;break}}if(t==null){if(b==null)return document.createTextNode(y);t=document.createElementNS(i,b,y.is&&y),d&&(T.__m&&T.__m(e,a),d=!1),a=null}if(b==null)w===y||d&&t.data==y||(t.data=y);else{if(a=b=="textarea"&&y.defaultValue!=null?null:a&&ee.call(t.childNodes),!d&&a!=null)for(w={},l=0;l<t.attributes.length;l++)w[(m=t.attributes[l]).name]=m.value;for(l in w)m=w[l],l=="dangerouslySetInnerHTML"?c=m:l=="children"||l in y||l=="value"&&"defaultValue"in y||l=="checked"&&"defaultChecked"in y||Ge(t,l,null,m,i);for(l in y)m=y[l],l=="children"?x=m:l=="dangerouslySetInnerHTML"?u=m:l=="value"?g=m:l=="checked"?O=m:d&&typeof m!="function"||w[l]===m||Ge(t,l,m,w[l],i);if(u)d||c&&(u.__html==c.__html||u.__html==t.innerHTML)||(t.innerHTML=u.__html),e.__k=[];else if(c&&(t.innerHTML=""),$t(e.type=="template"?t.content:t,Be(x)?x:[x],e,n,o,b=="foreignObject"?"http://www.w3.org/1999/xhtml":i,a,s,a?a[0]:n.__k&&we(n,0),d,f),a!=null)for(l=a.length;l--;)ct(a[l]);d&&b!="textarea"||(l="value",b=="progress"&&g==null?t.removeAttribute("value"):g!=null&&(g!==t[l]||b=="progress"&&!g||b=="option"&&g!=w[l])&&Ge(t,l,g,w[l],i),l="checked",O!=null&&O!=t[l]&&Ge(t,l,O,w[l],i))}return t}function ut(t,e,n){try{if(typeof t=="function"){var o=typeof t.__u=="function";o&&t.__u(),o&&e==null||(t.__u=t(e))}else t.current=e}catch(i){T.__e(i,n)}}function Ut(t,e,n){var o,i;if(T.unmount&&T.unmount(t),(o=t.ref)&&(o.current&&o.current!=t.__e||ut(o,null,e)),(o=t.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){T.__e(a,e)}o.base=o.__P=null}if(o=t.__k)for(i=0;i<o.length;i++)o[i]&&Ut(o[i],e,n||typeof t.type!="function");n||ct(t.__e),t.__c=t.__=t.__e=void 0}function On(t,e,n){return this.constructor(t,n)}function jt(t,e,n){var o,i,a,s;e==document&&(e=document.documentElement),T.__&&T.__(t,e),i=(o=!1)?null:e.__k,a=[],s=[],dt(e,t=e.__k=Nn(R,null,[t]),i||je,je,e.namespaceURI,i?null:e.firstChild?ee.call(e.childNodes):null,a,i?i.__e:e.firstChild,o,s),Rt(a,t,s)}function zn(t){function e(n){var o,i;return this.getChildContext||(o=new Set,(i={})[e.__c]=this,this.getChildContext=function(){return i},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(a){this.props.value!=a.value&&o.forEach(function(s){s.__e=!0,lt(s)})},this.sub=function(a){o.add(a);var s=a.componentWillUnmount;a.componentWillUnmount=function(){o&&o.delete(a),s&&s.call(a)}}),n.children}return e.__c="__cC"+Mt++,e.__=t,e.Provider=e.__l=(e.Consumer=function(n,o){return n.children(o)}).contextType=e,e}ee=Le.slice,T={__e:function(t,e,n,o){for(var i,a,s;e=e.__;)if((i=e.__c)&&!i.__)try{if((a=i.constructor)&&a.getDerivedStateFromError!=null&&(i.setState(a.getDerivedStateFromError(t)),s=i.__d),i.componentDidCatch!=null&&(i.componentDidCatch(t,o||{}),s=i.__d),s)return i.__E=i}catch(d){t=d}throw t}},At=0,Fe.prototype.setState=function(t,e){var n;n=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=ce({},this.state),typeof t=="function"&&(t=t(ce({},n),this.props)),t&&ce(n,t),t!=null&&this.__v&&(e&&this._sb.push(e),lt(this))},Fe.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),lt(this))},Fe.prototype.render=R,de=[],Tt=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Et=function(t,e){return t.__v.__b-e.__v.__b},We.__r=0,rt=Math.random().toString(8),Ue="__d"+rt,Te="__a"+rt,Nt=/(PointerCapture)$|Capture$/i,at=0,it=zt(!1),st=zt(!0),Mt=0;var Rn=0;function r(t,e,n,o,i,a){e||(e={});var s,d,f=e;if("ref"in f)for(d in f={},e)d=="ref"?s=e[d]:f[d]=e[d];var l={type:t,props:f,key:n,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rn,__i:-1,__u:0,__source:i,__self:a};if(typeof t=="function"&&(s=t.defaultProps))for(d in s)f[d]===void 0&&(f[d]=s[d]);return T.vnode&&T.vnode(l),l}class Lt extends Error{constructor(n,o){super(o);be(this,"status");this.status=n,this.name="ApiError"}}const ht=()=>({agentName:"Assistant",greeting:"Hi! 👋 How can I help you today?",allowVoiceInput:!1,availableActions:[]});class Bt{constructor(e,n,o){be(this,"baseUrl");be(this,"token");be(this,"gifApiKey");this.baseUrl=e,this.token=n,this.gifApiKey=o}headers(e=!0){const n={Authorization:`Bearer ${this.token}`};return e&&(n["Content-Type"]="application/json"),n}async json(e){let n;try{n=await e.json()}catch{n=void 0}if(!e.ok){const o=Un(n)??`request failed (${e.status})`;throw new Lt(e.status,o)}return n?.data??n}async bootstrap(){try{const e=await fetch(`${this.baseUrl}/public-chat/bootstrap`,{headers:this.headers(!1)});if(!e.ok)return ht();const n=await this.json(e);return{...ht(),...n}}catch{return ht()}}async stream(e,n,o){const i=await fetch(`${this.baseUrl}/public-chat/stream`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:n}),signal:o.signal});return!i.ok||!i.body?this.send(e,n,o):jn(i.body,o)}async send(e,n,o){const i=await fetch(`${this.baseUrl}/public-chat`,{method:"POST",headers:this.headers(),body:JSON.stringify({question:e,sessionId:n}),signal:o.signal}),a=await this.json(i);return o.onChunk(a.answer??""),{answer:a.answer??"",sources:a.sources??[],suggestedReplies:a.suggestedReplies??[],availableActions:a.availableActions??[],handoffOffered:a.handoffOffered??!1,requestedContactFields:qt(a.requestedContactFields),conversationEnded:a.conversationEnded??!1}}async action(e,n){const o=await fetch(`${this.baseUrl}/public-chat/${e}`,{method:"POST",headers:this.headers(),body:JSON.stringify(n)}),i=await this.json(o);return{ok:!0,note:i?.note,booking:i?.booking}}async identify(e,n){if(!(!e||!n))try{const o=await fetch(`${this.baseUrl}/public-chat/identify`,{method:"POST",headers:this.headers(),body:JSON.stringify(Hn(e,n))});if(!o.ok)try{await o.text()}catch{}}catch{}}async transcribe(e,n){const o=await fetch(`${this.baseUrl}/public-chat/transcribe`,{method:"POST",headers:this.headers(),body:JSON.stringify({audioBase64:e,mimeType:n})});return(await this.json(o)).text??""}async endConversation(e){try{const n=await fetch(`${this.baseUrl}/public-chat/end`,{method:"POST",headers:this.headers(),body:JSON.stringify({sessionId:e})});if(!n.ok)try{await n.text()}catch{}}catch{}}async sendFeedback(e){try{const n=await fetch(`${this.baseUrl}/public-chat/feedback`,{method:"POST",headers:this.headers(),body:JSON.stringify(e)});if(!n.ok)try{await n.text()}catch{}}catch{}}async extract(e,n,o){const i=await fetch(`${this.baseUrl}/public-chat/extract`,{method:"POST",headers:this.headers(),body:JSON.stringify({fileBase64:e,mimeType:n,filename:o})});return(await this.json(i)).text??""}async demoSlots(e,n){try{const o=`from=${encodeURIComponent(e)}&to=${encodeURIComponent(n)}`,i=await fetch(`${this.baseUrl}/public-chat/demo-slots?${o}`,{headers:this.headers(!1)});if(!i.ok)return{taken:[],busy:[]};const a=await this.json(i);return{taken:a?.taken??[],busy:a?.busy??[]}}catch{return{taken:[],busy:[]}}}async searchGifs(e){if(!this.gifApiKey)return[];const o=`https://tenor.googleapis.com/v2/search?q=${encodeURIComponent(e.trim()||"trending")}&key=${this.gifApiKey}&limit=24&media_filter=tinygif,gif&contentfilter=high`;try{const i=await fetch(o);return i.ok?((await i.json()).results??[]).map(s=>({id:s.id,url:s.media_formats?.gif?.url??s.media_formats?.tinygif?.url??"",preview:s.media_formats?.tinygif?.url??s.media_formats?.gif?.url??"",alt:s.content_description||"GIF"})).filter(s=>s.url):[]}catch{return[]}}}const Hn=(t,e)=>{const n={...e.customAttributes??{},...e.metadata??{}};e.createdAt!==void 0&&(n.createdAt=e.createdAt),e.avatarUrl&&(n.avatarUrl=e.avatarUrl),e.company&&(n.company=e.company);const o={sessionId:t},i=e.externalId??e.userId;return i&&(o.externalId=i),e.email&&(o.email=e.email),e.firstName&&(o.firstName=e.firstName),e.lastName&&(o.lastName=e.lastName),e.name&&(o.name=e.name),e.phone&&(o.phone=e.phone),Object.keys(n).length>0&&(o.metadata=n),o},Un=t=>{const e=t?.message;if(Array.isArray(e))return e.join(", ");if(typeof e=="string")return e},jn=async(t,e)=>{const n=t.getReader(),o=new TextDecoder,i={answer:"",sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1,requestedContactFields:[],conversationEnded:!1};let a="";for(;;){const{done:s,value:d}=await n.read();if(s)break;a+=o.decode(d,{stream:!0});let f;for(;(f=a.indexOf(`
|
|
1
|
+
var Centrinfo=(function(mr){"use strict";var w5=Object.defineProperty;var S5=(mr,Vt,Ae)=>Vt in mr?w5(mr,Vt,{enumerable:!0,configurable:!0,writable:!0,value:Ae}):mr[Vt]=Ae;var tr=(mr,Vt,Ae)=>S5(mr,typeof Vt!="symbol"?Vt+"":Vt,Ae);var Vt,Ae,pv,tn,gv,mv,yv,Nc,Zo,bi,_v,Bc,zc,Fc,bv,Ko={},jo=[],w1=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Qo=Array.isArray;function Nr(t,e){for(var r in e)t[r]=e[r];return t}function Hc(t){t&&t.parentNode&&t.parentNode.removeChild(t)}function S1(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 Jo(t,o,n,a,null)}function Jo(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??++pv,__i:-1,__u:0};return a==null&&Ae.vnode!=null&&Ae.vnode(i),i}function Se(t){return t.children}function es(t,e){this.props=t,this.context=e}function _a(t,e){if(e==null)return t.__?_a(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"?_a(t):null}function k1(t){if(t.__P&&t.__d){var e=t.__v,r=e.__e,n=[],a=[],i=Nr({},e);i.__v=e.__v+1,Ae.vnode&&Ae.vnode(i),Gc(t.__P,i,e,t.__n,t.__P.namespaceURI,32&e.__u?[r]:null,n,r??_a(e),!!(32&e.__u),a),i.__v=e.__v,i.__.__k[i.__i]=i,Cv(n,i,a),e.__e=e.__=null,i.__e!=r&&xv(i)}}function xv(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}),xv(t)}function Vc(t){(!t.__d&&(t.__d=!0)&&tn.push(t)&&!ts.__r++||gv!=Ae.debounceRendering)&&((gv=Ae.debounceRendering)||mv)(ts)}function ts(){try{for(var t,e=1;tn.length;)tn.length>e&&tn.sort(yv),t=tn.shift(),e=tn.length,k1(t)}finally{tn.length=ts.__r=0}}function wv(t,e,r,n,a,i,o,s,l,c,u){var f,d,h,v,m,g,p,y=n&&n.__k||jo,b=e.length;for(l=T1(r,e,y,l,b),f=0;f<b;f++)(h=r.__k[f])!=null&&(d=h.__i!=-1&&y[h.__i]||Ko,h.__i=f,g=Gc(t,h,d,a,i,o,s,l,c,u),v=h.__e,h.ref&&d.ref!=h.ref&&(d.ref&&Uc(d.ref,null,h),u.push(h.ref,h.__c||v,h)),m==null&&v!=null&&(m=v),(p=!!(4&h.__u))||d.__k===h.__k?(l=Sv(h,l,t,p),p&&d.__e&&(d.__e=null)):typeof h.type=="function"&&g!==void 0?l=g:v&&(l=v.nextSibling),h.__u&=-7);return r.__e=m,l}function T1(t,e,r,n,a){var i,o,s,l,c,u=r.length,f=u,d=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]=Jo(null,o,null,null,null):Qo(o)?o=t.__k[i]=Jo(Se,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=t.__k[i]=Jo(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):t.__k[i]=o,l=i+d,o.__=t,o.__b=t.__b+1,s=null,(c=o.__i=C1(o,r,l,f))!=-1&&(f--,(s=r[c])&&(s.__u|=2)),s==null||s.__v==null?(c==-1&&(a>u?d--:a<u&&d++),typeof o.type!="function"&&(o.__u|=4)):c!=l&&(c==l-1?d--:c==l+1?d++:(c>l?d--:d++,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=_a(s)),Av(s,s));return n}function Sv(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=Sv(a[i],e,r,n));return e}t.__e!=e&&(n&&(e&&t.type&&!e.parentNode&&(e=_a(t)),r.insertBefore(t.__e,e||null)),e=t.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function C1(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 kv(t,e,r){e[0]=="-"?t.setProperty(e,r??""):t[e]=r==null?"":typeof r!="number"||w1.test(e)?r:r+"px"}function rs(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||kv(t.style,e,"");if(r)for(e in r)n&&r[e]==n[e]||kv(t.style,e,r[e])}else if(e[0]=="o"&&e[1]=="n")i=e!=(e=e.replace(_v,"$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[bi]=n[bi]:(r[bi]=Bc,t.addEventListener(e,i?Fc:zc,i)):t.removeEventListener(e,i?Fc:zc,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 Tv(t){return function(e){if(this.l){var r=this.l[e.type+t];if(e[Zo]==null)e[Zo]=Bc++;else if(e[Zo]<r[bi])return;return r(Ae.event?Ae.event(e):e)}}}function Gc(t,e,r,n,a,i,o,s,l,c){var u,f,d,h,v,m,g,p,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=Ae.__b)&&u(e);e:if(typeof M=="function")try{if(p=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?g=(f=e.__c=r.__c).__=f.__E:(y?e.__c=f=new M(p,x):(e.__c=f=new es(p,x),f.constructor=M,f.render=A1),b&&b.sub(f),f.state||(f.state={}),f.__n=n,d=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=Nr({},f.__s)),Nr(f.__s,M.getDerivedStateFromProps(p,f.__s))),h=f.props,v=f.state,f.__v=e,d)y&&M.getDerivedStateFromProps==null&&f.componentWillMount!=null&&f.componentWillMount(),y&&f.componentDidMount!=null&&f.__h.push(f.componentDidMount);else{if(y&&M.getDerivedStateFromProps==null&&p!==h&&f.componentWillReceiveProps!=null&&f.componentWillReceiveProps(p,x),e.__v==r.__v||!f.__e&&f.shouldComponentUpdate!=null&&f.shouldComponentUpdate(p,f.__s,x)===!1){e.__v!=r.__v&&(f.props=p,f.state=f.__s,f.__d=!1),e.__e=r.__e,e.__k=r.__k,e.__k.some(function(D){D&&(D.__=e)}),jo.push.apply(f.__h,f._sb),f._sb=[],f.__h.length&&o.push(f);break e}f.componentWillUpdate!=null&&f.componentWillUpdate(p,f.__s,x),y&&f.componentDidUpdate!=null&&f.__h.push(function(){f.componentDidUpdate(h,v,m)})}if(f.context=x,f.props=p,f.__P=t,f.__e=!1,S=Ae.__r,w=0,y)f.state=f.__s,f.__d=!1,S&&S(e),u=f.render(f.props,f.state,f.context),jo.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=Nr(Nr({},n),f.getChildContext())),y&&!d&&f.getSnapshotBeforeUpdate!=null&&(m=f.getSnapshotBeforeUpdate(h,v)),k=u!=null&&u.type===Se&&u.key==null?Mv(u.props.children):u,s=wv(t,Qo(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(D){if(e.__v=null,l||i!=null)if(D.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--;)Hc(i[T]);Wc(e)}else e.__e=r.__e,e.__k=r.__k,D.then||Wc(e);Ae.__e(D,e,r)}else i==null&&e.__v==r.__v?(e.__k=r.__k,e.__e=r.__e):s=e.__e=M1(r.__e,e,r,n,a,i,o,l,c);return(u=Ae.diffed)&&u(e),128&e.__u?void 0:s}function Wc(t){t&&(t.__c&&(t.__c.__e=!0),t.__k&&t.__k.some(Wc))}function Cv(t,e,r){for(var n=0;n<r.length;n++)Uc(r[n],r[++n],r[++n]);Ae.__c&&Ae.__c(e,t),t.some(function(a){try{t=a.__h,a.__h=[],t.some(function(i){i.call(a)})}catch(i){Ae.__e(i,a.__v)}})}function Mv(t){return typeof t!="object"||t==null||t.__b>0?t:Qo(t)?t.map(Mv):t.constructor!==void 0?null:Nr({},t)}function M1(t,e,r,n,a,i,o,s,l){var c,u,f,d,h,v,m,g=r.props||Ko,p=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((h=i[c])&&"setAttribute"in h==!!y&&(y?h.localName==y:h.nodeType==3)){t=h,i[c]=null;break}}if(t==null){if(y==null)return document.createTextNode(p);t=document.createElementNS(a,y,p.is&&p),s&&(Ae.__m&&Ae.__m(e,i),s=!1),i=null}if(y==null)g===p||s&&t.data==p||(t.data=p);else{if(i=y=="textarea"&&p.defaultValue!=null?null:i&&Vt.call(t.childNodes),!s&&i!=null)for(g={},c=0;c<t.attributes.length;c++)g[(h=t.attributes[c]).name]=h.value;for(c in g)h=g[c],c=="dangerouslySetInnerHTML"?f=h:c=="children"||c in p||c=="value"&&"defaultValue"in p||c=="checked"&&"defaultChecked"in p||rs(t,c,null,h,a);for(c in p)h=p[c],c=="children"?d=h:c=="dangerouslySetInnerHTML"?u=h:c=="value"?v=h:c=="checked"?m=h:s&&typeof h!="function"||g[c]===h||rs(t,c,h,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=""),wv(e.type=="template"?t.content:t,Qo(d)?d:[d],e,r,n,y=="foreignObject"?"http://www.w3.org/1999/xhtml":a,i,o,i?i[0]:r.__k&&_a(r,0),s,l),i!=null)for(c=i.length;c--;)Hc(i[c]);s&&y!="textarea"||(c="value",y=="progress"&&v==null?t.removeAttribute("value"):v!=null&&(v!==t[c]||y=="progress"&&!v||y=="option"&&v!=g[c])&&rs(t,c,v,g[c],a),c="checked",m!=null&&m!=t[c]&&rs(t,c,m,g[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){Ae.__e(a,r)}}function Av(t,e,r){var n,a;if(Ae.unmount&&Ae.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){Ae.__e(i,e)}n.base=n.__P=null}if(n=t.__k)for(a=0;a<n.length;a++)n[a]&&Av(n[a],e,r||typeof t.type!="function");r||Hc(t.__e),t.__c=t.__=t.__e=void 0}function A1(t,e,r){return this.constructor(t,r)}function Dv(t,e,r){var n,a,i,o;e==document&&(e=document.documentElement),Ae.__&&Ae.__(t,e),a=(n=!1)?null:e.__k,i=[],o=[],Gc(e,t=e.__k=S1(Se,null,[t]),a||Ko,Ko,e.namespaceURI,a?null:e.firstChild?Vt.call(e.childNodes):null,i,a?a.__e:e.firstChild,n,o),Cv(i,t,o)}function D1(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,Vc(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"+bv++,e.__=t,e.Provider=e.__l=(e.Consumer=function(r,n){return r.children(n)}).contextType=e,e}Vt=jo.slice,Ae={__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}},pv=0,es.prototype.setState=function(t,e){var r;r=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=Nr({},this.state),typeof t=="function"&&(t=t(Nr({},r),this.props)),t&&Nr(r,t),t!=null&&this.__v&&(e&&this._sb.push(e),Vc(this))},es.prototype.forceUpdate=function(t){this.__v&&(this.__e=!0,t&&this.__h.push(t),Vc(this))},es.prototype.render=Se,tn=[],mv=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,yv=function(t,e){return t.__v.__b-e.__v.__b},ts.__r=0,Nc=Math.random().toString(8),Zo="__d"+Nc,bi="__a"+Nc,_v=/(PointerCapture)$|Capture$/i,Bc=0,zc=Tv(!1),Fc=Tv(!0),bv=0;var I1=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:--I1,__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 Ae.vnode&&Ae.vnode(c),c}class Iv extends Error{constructor(r,n){super(n);tr(this,"status");this.status=r,this.name="ApiError"}}const $c=()=>({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:[]}),P1="Sara is an AI assistant; answers may be imperfect.",L1="Accurix is an AI assistant; answers may be imperfect.",Pv=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.`)},Yc=(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===P1.toLowerCase()||n?.includes("sara is an ai assistant")?L1:t.disclaimerText}};class Lv{constructor(e,r,n,a,i={},o,s){tr(this,"baseUrl");tr(this,"token");tr(this,"gifApiKey");tr(this,"analyticsContextToken");tr(this,"bootstrapOverrides");tr(this,"identityToken");tr(this,"identityTokenProvider");this.baseUrl=e,this.token=r,this.gifApiKey=n,this.analyticsContextToken=a,this.bootstrapOverrides=i,this.identityToken=o,this.identityTokenProvider=s}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=E1(r)??`request failed (${e.status})`;throw new Iv(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 Pv(`bootstrap request failed with ${e.status}`),Yc($c(),this.bootstrapOverrides);const r=await this.json(e);return Yc({...$c(),...r},this.bootstrapOverrides)}catch(e){return Pv(e instanceof Error?e.message:"bootstrap request failed"),Yc($c(),this.bootstrapOverrides)}}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}),signal:n.signal});return!i.ok||!i.body?this.send(e,r,n):O1(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}),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:Rv(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(R1(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 R1=(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},E1=t=>{const e=t?.message;if(Array.isArray(e))return e.join(", ");if(typeof e=="string")return e},O1=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
|
|
4
|
-
`))
|
|
5
|
-
`))}}catch{return{event:e}}},qt=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):[],te=t=>new Promise(e=>setTimeout(e,t)),Ft={agentName:"Sara",agentAvatarUrl:"",greeting:"Hi! 👋 I'm Sara, the Northwind assistant. Ask me anything about tracking, customs, or pricing — or book a demo.",allowVoiceInput:!0,availableActions:["public_book_demo","public_capture_contact","public_submit_inquiry"],agentDescription:"I help with shipment tracking, customs, and pricing.",welcomeSubtitle:"Ask me anything — most answers are instant.",disclaimerText:"Sara is an AI assistant; answers may be imperfect.",starterQuestions:["How do I track a shipment?","How does customs work?","What's your pricing?"]},Bn=[{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:"You can track any shipment in real time from the **Tracking** tab — we merge GPS pings with carrier scan events, so the status is usually fresher than the carrier's own site. Each shipment also has a shareable link you can send to customers.",sources:[{title:"Real-time tracking",url:"https://northwind.example/docs/tracking"},{title:"Shareable tracking links",url:"https://northwind.example/docs/share"}],suggestedReplies:["How fresh is the data?","Can customers track too?"],handoffOffered:!1}},{match:/custom|clear|duty|tariff|import/i,result:{answer:"Customs is automated end-to-end: HS codes are auto-classified from your product catalog, duties are estimated up front, and most lanes are pre-cleared before the freight lands. If a shipment needs a human broker, we flag it early so it never sits at the border.",sources:[{title:"Smart customs",url:"https://northwind.example/docs/customs"}],suggestedReplies:["Which countries are pre-cleared?","What does it cost?"],handoffOffered:!1}},{match:/price|cost|pricing|plan|quote/i,result:{answer:"Pricing is usage-based — you pay per shipment, with volume tiers that kick in automatically. There's no platform fee and no per-seat charge. I can have someone put together a quote for your lanes if you'd like.",sources:[{title:"Pricing",url:"https://northwind.example/pricing"}],suggestedReplies:["How do volume tiers work?","Is there a free trial?"],handoffOffered:!1}}],qn={answer:"That's a great question — I don't have a confident answer from Northwind'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};class Fn{async bootstrap(){return await te(180),Ft}async stream(e,n,o){await te(550);const i=Bn.find(d=>d.match.test(e)),a=i?i.result:qn,s=a.answer.split(/(\s+)/);for(const d of s){if(o.signal?.aborted)break;o.onChunk(d),await te(18+Math.min(40,d.length*6))}return{...a,availableActions:Ft.availableActions}}async action(e,n){return await te(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 transcribe(e,n){return await te(700),"How do I track a shipment?"}async extract(e,n,o){return await te(600),`[Attached file${o?`: ${o}`:""}] Invoice #4821 — 3 pallets, Rotterdam → Lagos, ETA 12 days.`}async identify(e,n){await te(50)}async endConversation(e){await te(50)}async sendFeedback(){await te(50)}async demoSlots(e,n){return await te(150),{taken:[[11,0],[15,0]].map(([i,a])=>{const s=new Date;return s.setHours(i,a,0,0),s.toISOString()}),busy:[]}}async searchGifs(e){await te(280);const n=e.trim().toLowerCase(),o=n?pt.filter(a=>a.alt.includes(n)||a.tags.some(s=>s.includes(n)||n.includes(s))):pt;return(o.length>0?o:pt).map(a=>({id:a.id,url:Wt(a.emoji,a.anim),preview:Wt(a.emoji,a.anim),alt:a.alt}))}}const Ve="<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>",Ke="<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>",Wt=(t,e)=>{const n=`<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(n)}`},pt=[{id:"g1",emoji:"👍",alt:"thumbs up",tags:["thumbs","yes","ok","great","good"],anim:Ve},{id:"g2",emoji:"🎉",alt:"celebrate",tags:["party","yay","congrats","celebrate"],anim:Ke},{id:"g3",emoji:"👋",alt:"wave hello",tags:["hi","hello","hey","wave","bye"],anim:Ke},{id:"g4",emoji:"❤️",alt:"heart",tags:["love","thanks","heart"],anim:Ve},{id:"g5",emoji:"🤔",alt:"thinking",tags:["hmm","think","thinking"],anim:Ke},{id:"g6",emoji:"😂",alt:"laughing",tags:["lol","funny","haha","laugh"],anim:Ve},{id:"g7",emoji:"🔥",alt:"fire",tags:["fire","hot","lit","awesome"],anim:Ve},{id:"g8",emoji:"🚀",alt:"rocket",tags:["rocket","launch","fast","go"],anim:Ke}],mt=t=>new Promise(e=>setTimeout(e,t));class Wn{constructor(e,n){be(this,"real");be(this,"strings");this.real=e,this.strings=n}bootstrap(){return this.real.bootstrap()}async stream(e,n,o){await mt(300);for(const i of this.strings.previewReply.split(/(\s+)/)){if(o.signal?.aborted)break;o.onChunk(i),await mt(16)}return{answer:this.strings.previewReply,sources:[],suggestedReplies:[],availableActions:[],handoffOffered:!1}}async action(){return await mt(250),{ok:!0,note:this.strings.previewActionNote}}async identify(){}async endConversation(){}async sendFeedback(){}async transcribe(){return""}async extract(){return""}async searchGifs(){return[]}async demoSlots(){return{taken:[],busy:[]}}}var Ce,U,_t,Gt,Ee=0,Vt=[],W=T,Kt=W.__b,Jt=W.__r,Yt=W.diffed,Zt=W.__c,Xt=W.unmount,Qt=W.__;function Je(t,e){W.__h&&W.__h(U,t,Ee||e),Ee=0;var n=U.__H||(U.__H={__:[],__h:[]});return t>=n.__.length&&n.__.push({}),n.__[t]}function C(t){return Ee=1,Gn(nn,t)}function Gn(t,e,n){var o=Je(Ce++,2);if(o.t=t,!o.__c&&(o.__=[nn(void 0,e),function(d){var f=o.__N?o.__N[0]:o.__[0],l=o.t(f,d);f!==l&&(o.__N=[l,o.__[1]],o.__c.setState({}))}],o.__c=U,!U.__f)){var i=function(d,f,l){if(!o.__c.__H)return!0;var u=o.__c.__H.__.filter(function(x){return x.__c});if(u.every(function(x){return!x.__N}))return!a||a.call(this,d,f,l);var c=o.__c.props!==d;return u.some(function(x){if(x.__N){var m=x.__[0];x.__=x.__N,x.__N=void 0,m!==x.__[0]&&(c=!0)}}),a&&a.call(this,d,f,l)||c};U.__f=!0;var a=U.shouldComponentUpdate,s=U.componentWillUpdate;U.componentWillUpdate=function(d,f,l){if(this.__e){var u=a;a=void 0,i(d,f,l),a=u}s&&s.call(this,d,f,l)},U.shouldComponentUpdate=i}return o.__N||o.__}function B(t,e){var n=Je(Ce++,3);!W.__s&&tn(n.__H,e)&&(n.__=t,n.u=e,U.__H.__h.push(n))}function J(t){return Ee=5,Ne(function(){return{current:t}},[])}function Ne(t,e){var n=Je(Ce++,7);return tn(n.__H,e)&&(n.__=t(),n.__H=e,n.__h=t),n.__}function M(t,e){return Ee=8,Ne(function(){return t},e)}function Vn(t){var e=U.context[t.__c],n=Je(Ce++,9);return n.c=t,e?(n.__==null&&(n.__=!0,e.sub(U)),e.props.value):t.__}function Kn(){for(var t;t=Vt.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(Ye),e.__h.some(bt),e.__h=[]}catch(n){e.__h=[],W.__e(n,t.__v)}}}W.__b=function(t){U=null,Kt&&Kt(t)},W.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Qt&&Qt(t,e)},W.__r=function(t){Jt&&Jt(t),Ce=0;var e=(U=t.__c).__H;e&&(_t===U?(e.__h=[],U.__h=[],e.__.some(function(n){n.__N&&(n.__=n.__N),n.u=n.__N=void 0})):(e.__h.some(Ye),e.__h.some(bt),e.__h=[],Ce=0)),_t=U},W.diffed=function(t){Yt&&Yt(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Vt.push(e)!==1&&Gt===W.requestAnimationFrame||((Gt=W.requestAnimationFrame)||Jn)(Kn)),e.__H.__.some(function(n){n.u&&(n.__H=n.u),n.u=void 0})),_t=U=null},W.__c=function(t,e){e.some(function(n){try{n.__h.some(Ye),n.__h=n.__h.filter(function(o){return!o.__||bt(o)})}catch(o){e.some(function(i){i.__h&&(i.__h=[])}),e=[],W.__e(o,n.__v)}}),Zt&&Zt(t,e)},W.unmount=function(t){Xt&&Xt(t);var e,n=t.__c;n&&n.__H&&(n.__H.__.some(function(o){try{Ye(o)}catch(i){e=i}}),n.__H=void 0,e&&W.__e(e,n.__v))};var en=typeof requestAnimationFrame=="function";function Jn(t){var e,n=function(){clearTimeout(o),en&&cancelAnimationFrame(e),setTimeout(t)},o=setTimeout(n,35);en&&(e=requestAnimationFrame(n))}function Ye(t){var e=U,n=t.__c;typeof n=="function"&&(t.__c=void 0,n()),U=e}function bt(t){var e=U;t.__c=t.__(),U=e}function tn(t,e){return!t||t.length!==e.length||e.some(function(n,o){return n!==t[o]})}function nn(t,e){return typeof e=="function"?e(t):e}const Yn=[{name:"Smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😋","😛","😜","🤪","🤗","🤭","🤔","🤐","😐","😶","😏","🙄","😴","🥳","😎","🤓","🥺","😢","😭","😤","😠","🤯","😬","😱","🤩","🥱"]},{name:"Gestures",emojis:["👍","👎","👌","🤌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","✋","🖐️","👋","🤝","🙏","💪","👏","🙌","👐","🤲","🫶"]},{name:"Hearts & symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","💔","❣️","💕","💖","💘","💝","✨","⭐","🌟","💫","🔥","🎉","🎊","✅","❌","⚡","💯","🚀"]},{name:"Animals & nature",emojis:["🐶","🐱","🦊","🐻","🐼","🐨","🦁","🐮","🐸","🐵","🐧","🦄","🐝","🦋","🐢","🐬","🌷","🌸","🌹","🌻","🌳","🍀"]},{name:"Food & drink",emojis:["🍎","🍌","🍉","🍓","🍒","🥑","🍔","🍟","🍕","🌮","🍿","🍩","🍪","🎂","☕","🍵","🍺","🥂","🍷"]},{name:"Objects & travel",emojis:["🚀","✈️","🚗","🏠","📦","📱","💻","⌚","📷","💡","🔑","🎁","📌","✏️","📝","📞","📧","💰","📈","⏰","🔔","🎯","🏆","🎮","🎵","💬","👀"]}],Ze={inquiry:{title:"Leave a message",submit:"Send message",fields:[{key:"visitorName",label:"Name",kind:"text",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:"Name",kind:"text",identity:"name"},{key:"email",label:"Email",kind:"email",required:!0,identity:"email"},{key:"phone",label:"Phone",kind:"tel",identity:"phone"}]},"book-demo":{title:"Book a demo",submit:"Request demo",fields:[{key:"visitorName",label:"Name",kind:"text",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:"Name",kind:"text",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:"Name",kind:"text",identity:"name"},{key:"visitorEmail",label:"Email",kind:"email",required:!0,identity:"email"}]}},gt={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"},Xe=(t,e)=>t.replace(/\{(\w+)\}/g,(n,o)=>e[o]??""),Zn=t=>t?{...gt,...t}:gt,on=zn(gt),Xn=on.Provider,le=()=>Vn(on),F=(t,e)=>r("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}),Qn=t=>r("svg",{viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",...t,children:r("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"})}),rn=t=>F(r("path",{d:"m6 9 6 6 6-6"}),t),eo=t=>F(r(R,{children:[r("path",{d:"m22 2-7 20-4-9-9-4Z"}),r("path",{d:"M22 2 11 13"})]}),t),to=t=>F(r(R,{children:[r("path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z"}),r("path",{d:"M19 10v2a7 7 0 0 1-14 0v-2"}),r("line",{x1:"12",y1:"19",x2:"12",y2:"22"})]}),t),vt=t=>F(r(R,{children:[r("path",{d:"M15 3h6v6"}),r("path",{d:"M10 14 21 3"}),r("path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"})]}),t),no=t=>F(r(R,{children:[r("rect",{x:"3",y:"4",width:"18",height:"18",rx:"2"}),r("line",{x1:"16",y1:"2",x2:"16",y2:"6"}),r("line",{x1:"8",y1:"2",x2:"8",y2:"6"}),r("line",{x1:"3",y1:"10",x2:"21",y2:"10"})]}),t),an=t=>F(r(R,{children:[r("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),r("path",{d:"m22 7-10 5L2 7"})]}),t),oo=t=>F(r("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),ro=t=>F(r(R,{children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M8.5 14.5a4 4 0 0 0 7 0"}),r("line",{x1:"9",y1:"9.5",x2:"9.01",y2:"9.5"}),r("line",{x1:"15",y1:"9.5",x2:"15.01",y2:"9.5"})]}),t),sn=t=>F(r(R,{children:[r("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t),ao=t=>F(r(R,{children:[r("path",{d:"M11 5 6 9H2v6h4l5 4z"}),r("path",{d:"M15.5 8.5a5 5 0 0 1 0 7"}),r("path",{d:"M19 5a9 9 0 0 1 0 14"})]}),t),io=t=>F(r(R,{children:[r("path",{d:"M11 5 6 9H2v6h4l5 4z"}),r("line",{x1:"22",y1:"9",x2:"16",y2:"15"}),r("line",{x1:"16",y1:"9",x2:"22",y2:"15"})]}),t),Qe=t=>F(r("path",{d:"M20 6 9 17l-5-5"}),t),so=t=>F(r(R,{children:[r("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),r("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),t),co=t=>F(r(R,{children:[r("path",{d:"M1 4v6h6"}),r("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),t),lo=t=>F(r("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),t),xt=t=>F(r("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),fo=t=>F(r(R,{children:[r("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),r("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),t),uo=t=>F(r(R,{children:[r("circle",{cx:"12",cy:"12",r:"9"}),r("path",{d:"M12 7v5l3 2"})]}),t),cn=t=>F(r(R,{children:[r("path",{d:"M7 10v12"}),r("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),ln=t=>F(r(R,{children:[r("path",{d:"M17 14V2"}),r("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),ho=t=>F(r(R,{children:[r("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),r("path",{d:"m19 12-7 7-7-7"})]}),t),dn=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,et=t=>{const e=[];let n=0,o=0,i;for(dn.lastIndex=0;(i=dn.exec(t))!==null;){i.index>n&&e.push(t.slice(n,i.index));const a=i[0];if(a.startsWith("`"))e.push(r("code",{class:"cf-md-code",children:a.slice(1,-1)},o++));else if(a.startsWith("**"))e.push(r("strong",{children:a.slice(2,-2)},o++));else if(a.startsWith("[")){const s=/^\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)$/.exec(a),d=s?s[1]:a,f=s?s[2]:"#";e.push(r("a",{href:f,target:"_blank",rel:"noopener noreferrer nofollow",children:d},o++))}else e.push(r("a",{href:a,target:"_blank",rel:"noopener noreferrer nofollow",children:a},o++));n=i.index+a.length}return n<t.length&&e.push(t.slice(n)),e},po=/^(```|#{1,6}\s|\s*[-*]\s|\s*\d+\.\s)/,mo=t=>{const e=t.replace(/\r\n/g,`
|
|
3
|
+
`))!==-1;){const c=i.slice(0,l);i=i.slice(l+2);const u=N1(c);if(u){if(u.event==="error")throw new Iv(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.handoffOffered=!!u.data.handoffOffered,a.requestedContactFields=Rv(u.data.requestedContactFields),a.conversationEnded=!!u.data.conversationEnded,a.liveMode=u.data.liveMode,a.assignedAgentName=u.data.assignedAgentName,a.visualization=u.data.visualization,a.audioBase64=u.data.audioBase64,a.mimeType=u.data.mimeType;else if(u.event==="done")return a}}}return a},N1=t=>{let e="message";const r=[];for(const n of t.split(`
|
|
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}}},Rv=t=>Array.isArray(t)?t.filter(e=>typeof e=="string"):[],Rt=t=>new Promise(e=>setTimeout(e,t)),Ev={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"}]},B1=[{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}}],z1={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},F1=t=>B1.find(e=>e.match.test(t))?.result??z1;class H1{async bootstrap(){return await Rt(180),Ev}async stream(e,r,n){await Rt(550);const a=F1(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:Ev.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?qc.filter(i=>i.alt.includes(r)||i.tags.some(o=>o.includes(r)||r.includes(o))):qc;return(n.length>0?n:qc).map(i=>({id:i.id,url:Ov(i.emoji,i.anim),preview:Ov(i.emoji,i.anim),alt:i.alt}))}}const ns="<animateTransform attributeName='transform' attributeType='XML' type='translate' values='0 0;0 -16;0 0' dur='0.7s' repeatCount='indefinite'/>",as="<animateTransform attributeName='transform' attributeType='XML' type='rotate' values='-14 64 110;14 64 110;-14 64 110' dur='0.9s' repeatCount='indefinite'/>",Ov=(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)}`},qc=[{id:"g1",emoji:"👍",alt:"thumbs up",tags:["thumbs","yes","ok","great","good"],anim:ns},{id:"g2",emoji:"🎉",alt:"celebrate",tags:["party","yay","congrats","celebrate"],anim:as},{id:"g3",emoji:"👋",alt:"wave hello",tags:["hi","hello","hey","wave","bye"],anim:as},{id:"g4",emoji:"❤️",alt:"heart",tags:["love","thanks","heart"],anim:ns},{id:"g5",emoji:"🤔",alt:"thinking",tags:["hmm","think","thinking"],anim:as},{id:"g6",emoji:"😂",alt:"laughing",tags:["lol","funny","haha","laugh"],anim:ns},{id:"g7",emoji:"🔥",alt:"fire",tags:["fire","hot","lit","awesome"],anim:ns},{id:"g8",emoji:"🚀",alt:"rocket",tags:["rocket","launch","fast","go"],anim:as}],Xc=t=>new Promise(e=>setTimeout(e,t));class V1{constructor(e,r){tr(this,"real");tr(this,"strings");this.real=e,this.strings=r}bootstrap(){return this.real.bootstrap()}async stream(e,r,n){await Xc(300);for(const a of this.strings.previewReply.split(/(\s+)/)){if(n.signal?.aborted)break;n.onChunk(a),await Xc(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 Xc(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 ba,We,Zc,Nv,xi=0,Bv=[],Qe=Ae,zv=Qe.__b,Fv=Qe.__r,Hv=Qe.diffed,Vv=Qe.__c,Gv=Qe.unmount,Wv=Qe.__;function is(t,e){Qe.__h&&Qe.__h(We,t,xi||e),xi=0;var r=We.__H||(We.__H={__:[],__h:[]});return t>=r.__.length&&r.__.push({}),r.__[t]}function K(t){return xi=1,G1(Yv,t)}function G1(t,e,r){var n=is(ba++,2);if(n.t=t,!n.__c&&(n.__=[Yv(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=We,!We.__f)){var a=function(s,l,c){if(!n.__c.__H)return!0;var u=n.__c.__H.__.filter(function(d){return d.__c});if(u.every(function(d){return!d.__N}))return!i||i.call(this,s,l,c);var f=n.__c.props!==s;return u.some(function(d){if(d.__N){var h=d.__[0];d.__=d.__N,d.__N=void 0,h!==d.__[0]&&(f=!0)}}),i&&i.call(this,s,l,c)||f};We.__f=!0;var i=We.shouldComponentUpdate,o=We.componentWillUpdate;We.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)},We.shouldComponentUpdate=a}return n.__N||n.__}function ve(t,e){var r=is(ba++,3);!Qe.__s&&$v(r.__H,e)&&(r.__=t,r.u=e,We.__H.__h.push(r))}function $(t){return xi=5,xa(function(){return{current:t}},[])}function xa(t,e){var r=is(ba++,7);return $v(r.__H,e)&&(r.__=t(),r.__H=e,r.__h=t),r.__}function J(t,e){return xi=8,xa(function(){return t},e)}function W1(t){var e=We.context[t.__c],r=is(ba++,9);return r.c=t,e?(r.__==null&&(r.__=!0,e.sub(We)),e.props.value):t.__}function U1(){for(var t;t=Bv.shift();){var e=t.__H;if(t.__P&&e)try{e.__h.some(os),e.__h.some(Kc),e.__h=[]}catch(r){e.__h=[],Qe.__e(r,t.__v)}}}Qe.__b=function(t){We=null,zv&&zv(t)},Qe.__=function(t,e){t&&e.__k&&e.__k.__m&&(t.__m=e.__k.__m),Wv&&Wv(t,e)},Qe.__r=function(t){Fv&&Fv(t),ba=0;var e=(We=t.__c).__H;e&&(Zc===We?(e.__h=[],We.__h=[],e.__.some(function(r){r.__N&&(r.__=r.__N),r.u=r.__N=void 0})):(e.__h.some(os),e.__h.some(Kc),e.__h=[],ba=0)),Zc=We},Qe.diffed=function(t){Hv&&Hv(t);var e=t.__c;e&&e.__H&&(e.__H.__h.length&&(Bv.push(e)!==1&&Nv===Qe.requestAnimationFrame||((Nv=Qe.requestAnimationFrame)||$1)(U1)),e.__H.__.some(function(r){r.u&&(r.__H=r.u),r.u=void 0})),Zc=We=null},Qe.__c=function(t,e){e.some(function(r){try{r.__h.some(os),r.__h=r.__h.filter(function(n){return!n.__||Kc(n)})}catch(n){e.some(function(a){a.__h&&(a.__h=[])}),e=[],Qe.__e(n,r.__v)}}),Vv&&Vv(t,e)},Qe.unmount=function(t){Gv&&Gv(t);var e,r=t.__c;r&&r.__H&&(r.__H.__.some(function(n){try{os(n)}catch(a){e=a}}),r.__H=void 0,e&&Qe.__e(e,r.__v))};var Uv=typeof requestAnimationFrame=="function";function $1(t){var e,r=function(){clearTimeout(n),Uv&&cancelAnimationFrame(e),setTimeout(t)},n=setTimeout(r,35);Uv&&(e=requestAnimationFrame(r))}function os(t){var e=We,r=t.__c;typeof r=="function"&&(t.__c=void 0,r()),We=e}function Kc(t){var e=We;t.__c=t.__(),We=e}function $v(t,e){return!t||t.length!==e.length||e.some(function(r,n){return r!==t[n]})}function Yv(t,e){return typeof e=="function"?e(t):e}var jc=function(t,e){return jc=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])},jc(t,e)};function G(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");jc(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}var Qc=12,Y1="sans-serif",Dn=Qc+"px "+Y1,q1=20,X1=100,Z1="007LLmW'55;N0500LLLLLLLLLL00NNNLzWW\\\\WQb\\0FWLg\\bWb\\WQ\\WrWWQ000CL5LLFLL0LL**F*gLLLL5F0LF\\FFF5.5N";function K1(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)/X1;e[n]=a}return e}var j1=K1(Z1),wa={createCanvas:function(){return typeof document<"u"&&document.createElement("canvas")},measureText:(function(){var t,e;return function(r,n){if(!t){var a=wa.createCanvas();t=a&&a.getContext("2d")}if(t)return e!==n&&(e=t.font=n||Dn),t.measureText(r);r=r||"",n=n||Dn;var i=/((?:\d+)?\.?\d*)px/.exec(n),o=i&&+i[1]||Qc,s=0;if(n.indexOf("mono")>=0)s=o*r.length;else for(var l=0;l<r.length;l++){var c=j1[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}},qv=Sa(["Function","RegExp","Date","Error","CanvasGradient","CanvasPattern","Image","Canvas"],function(t,e){return t["[object "+e+"]"]=!0,t},{}),Xv=Sa(["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64"],function(t,e){return t["[object "+e+"Array]"]=!0,t},{}),wi=Object.prototype.toString,ss=Array.prototype,Q1=ss.forEach,J1=ss.filter,Jc=ss.slice,ew=ss.map,Zv=function(){}.constructor,ls=Zv?Zv.prototype:null,eu="__proto__",tw=2311;function Kv(){return tw++}function tu(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];typeof console<"u"&&console.error.apply(console,t)}function ye(t){if(t==null||typeof t!="object")return t;var e=t,r=wi.call(t);if(r==="[object Array]"){if(!Ti(t)){e=[];for(var n=0,a=t.length;n<a;n++)e[n]=ye(t[n])}}else if(Xv[r]){if(!Ti(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(!qv[r]&&!Ti(t)&&!Si(t)){e={};for(var o in t)t.hasOwnProperty(o)&&o!==eu&&(e[o]=ye(t[o]))}return e}function ke(t,e,r){if(!ce(e)||!ce(t))return r?ye(e):t;for(var n in e)if(e.hasOwnProperty(n)&&n!==eu){var a=t[n],i=e[n];ce(i)&&ce(a)&&!ee(i)&&!ee(a)&&!Si(i)&&!Si(a)&&!jv(i)&&!jv(a)&&!Ti(i)&&!Ti(a)?ke(a,i,r):(r||!(n in t))&&(t[n]=ye(e[n]))}return t}function V(t,e){if(Object.assign)Object.assign(t,e);else for(var r in e)e.hasOwnProperty(r)&&r!==eu&&(t[r]=e[r]);return t}function De(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 Ie(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 rw(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 yr(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 De(t,e)}function _t(t){return!t||typeof t=="string"?!1:typeof t.length=="number"}function A(t,e,r){if(t&&e)if(t.forEach&&t.forEach===Q1)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 nu(t);if(t.map&&t.map===ew)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 Sa(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 it(t,e,r){if(!t)return[];if(!e)return nu(t);if(t.filter&&t.filter===J1)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 nw(t,e){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];return function(){return t.apply(e,r.concat(Jc.call(arguments)))}}var Ce=ls&&ge(ls.bind)?ls.call.bind(ls.bind):nw;function qe(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return function(){return t.apply(this,e.concat(Jc.call(arguments)))}}function ee(t){return Array.isArray?Array.isArray(t):wi.call(t)==="[object Array]"}function ge(t){return typeof t=="function"}function ie(t){return typeof t=="string"}function ru(t){return wi.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 jv(t){return!!qv[wi.call(t)]}function bt(t){return!!Xv[wi.call(t)]}function Si(t){return typeof t=="object"&&typeof t.nodeType=="number"&&typeof t.ownerDocument=="object"}function cs(t){return t.colorStops!=null}function aw(t){return t.image!=null}function us(t){return t!==t}function ki(){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 _e(t,e){return t??e}function fs(t,e,r){return t??e??r}function nu(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];return Jc.apply(t,e)}function Qv(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 Br(t,e){if(!t)throw new Error(e)}function _r(t){return t==null?null:typeof t.trim=="function"?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")}var Jv="__ec_primitive__";function au(t){t[Jv]=!0}function Ti(t){return t[Jv]}var iw=(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})(),ep=typeof Map=="function";function ow(){return ep?new Map:new iw}var sw=(function(){function t(e){var r=ee(e);this.data=ow();var n=this;e instanceof t?e.each(a):e&&A(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 ep?Array.from(e):e},t.prototype.removeKey=function(e){this.data.delete(e)},t})();function fe(t){return new sw(t)}function lw(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 hs(t,e){var r;if(Object.create)r=Object.create(t);else{var n=function(){};n.prototype=t,r=new n}return e&&V(r,e),r}function tp(t){var e=t.style;e.webkitUserSelect="none",e.userSelect="none",e.webkitTapHighlightColor="rgba(0,0,0,0)",e["-webkit-touch-callout"]="none"}function In(t,e){return t.hasOwnProperty(e)}function pt(){}var cw=180/Math.PI,uw=(function(){function t(){this.firefox=!1,this.ie=!1,this.edge=!1,this.newEdge=!1,this.weChat=!1}return t})(),fw=(function(){function t(){this.browser=new uw,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})(),he=new fw;typeof wx=="object"&&typeof wx.getSystemInfoSync=="function"?(he.wxa=!0,he.touchEventsSupported=!0):typeof document>"u"&&typeof self<"u"?he.worker=!0:!he.hasGlobalWindow||"Deno"in window?(he.node=!0,he.svgSupported=!0):hw(navigator.userAgent,he);function hw(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 dw=".",Pn="___EC__COMPONENT__CONTAINER___",rp="___EC__EXTENDED_CLASS___";function br(t){var e={main:"",sub:""};if(t){var r=t.split(dw);e.main=r[0]||"",e.sub=r[1]||""}return e}function vw(t){Br(/^[a-zA-Z0-9_]+([.][a-zA-Z0-9_]+)?$/.test(t),'componentType "'+t+'" illegal')}function pw(t){return!!(t&&t[rp])}function iu(t,e){t.$constructor=t,t.extend=function(r){var n=this,a;return gw(n)?a=(function(i){G(o,i);function o(){return i.apply(this,arguments)||this}return o})(n):(a=function(){(r.$constructor||n).apply(this,arguments)},rw(a,this)),V(a.prototype,r),a[rp]=!0,a.extend=this.extend,a.superCall=_w,a.superApply=bw,a.superClass=n,a}}function gw(t){return ge(t)&&/^class\s/.test(Function.prototype.toString.call(t))}function np(t,e){t.extend=e.extend}var mw=Math.round(Math.random()*10);function yw(t){var e=["__\0is_clz",mw++].join("_");t.prototype[e]=!0,t.isInstance=function(r){return!!(r&&r[e])}}function _w(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 bw(t,e,r){return this.superClass.prototype[e].apply(t,r)}function ds(t){var e={};t.registerClass=function(n){var a=n.type||n.prototype.type;if(a){vw(a),n.prototype.type=a;var i=br(a);if(!i.sub)e[i.main]=n;else if(i.sub!==Pn){var o=r(i);o[i.sub]=n}}return n},t.getClass=function(n,a,i){var o=e[n];if(o&&o[Pn]&&(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=br(n),i=[],o=e[a.main];return o&&o[Pn]?A(o,function(s,l){l!==Pn&&i.push(s)}):i.push(o),i},t.hasClass=function(n){var a=br(n);return!!e[a.main]},t.getAllClassMainTypes=function(){var n=[];return A(e,function(a,i){n.push(i)}),n},t.hasSubTypes=function(n){var a=br(n),i=e[a.main];return i&&i[Pn]};function r(n){var a=e[n.main];return(!a||!a[Pn])&&(a=e[n.main]={},a[Pn]=!0),a}}function Ci(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&&Ie(a,l)>=0||i&&Ie(i,l)<0)){var c=n.getShallow(l,e);c!=null&&(o[t[s][0]]=c)}}return o}}var xw=[["fill","color"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["opacity"],["shadowColor"]],ww=Ci(xw),Sw=(function(){function t(){}return t.prototype.getAreaStyle=function(e,r){return ww(this,e,r)},t})(),ap=(function(){function t(e){this.value=e}return t})(),kw=(function(){function t(){this._len=0}return t.prototype.insert=function(e){var r=new ap(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})(),Mi=(function(){function t(e){this._list=new kw,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 ap(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})(),ou=new Mi(50);function Tw(t){if(typeof t=="string"){var e=ou.get(t);return e&&e.image}else return t}function ip(t,e,r,n,a){if(t)if(typeof t=="string"){if(e&&e.__zrImageSrc===t||!r)return e;var i=ou.get(t),o={hostEl:r,cb:n,cbPayload:a};return i?(e=i.image,!vs(e)&&i.pending.push(o)):(e=wa.loadImage(t,op,op),e.__zrImageSrc=t,ou.put(t,e.__cachedImgObj={image:e,pending:[o]})),e}else return t;else return e}function op(){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 vs(t){return t&&t.width&&t.height}function ka(){return[1,0,0,1,0,0]}function su(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=1,t[4]=0,t[5]=0,t}function Cw(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 Ta(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 lu(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 cu(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 Mw(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 uu(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})(),ps=Math.min,gs=Math.max,Ln=new Be,Rn=new Be,En=new Be,On=new Be,Ai=new Be,Di=new Be,Pe=(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=ps(e.x,this.x),n=ps(e.y,this.y);isFinite(this.x)&&isFinite(this.width)?this.width=gs(e.x+e.width,this.x+this.width)-r:this.width=e.width,isFinite(this.y)&&isFinite(this.height)?this.height=gs(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=ka();return lu(i,i,[-r.x,-r.y]),Mw(i,i,[n,a]),lu(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,d=!(i<l||c<a||s<u||f<o);if(r){var h=1/0,v=0,m=Math.abs(i-l),g=Math.abs(c-a),p=Math.abs(s-u),y=Math.abs(f-o),b=Math.min(m,g),x=Math.min(p,y);i<l||c<a?b>v&&(v=b,m<g?Be.set(Di,-m,0):Be.set(Di,g,0)):b<h&&(h=b,m<g?Be.set(Ai,m,0):Be.set(Ai,-g,0)),s<u||f<o?x>v&&(v=x,p<y?Be.set(Di,0,-p):Be.set(Di,0,y)):b<h&&(h=b,p<y?Be.set(Ai,0,p):Be.set(Ai,0,-y))}return r&&Be.copy(r,d?Ai:Di),d},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}Ln.x=En.x=r.x,Ln.y=On.y=r.y,Rn.x=On.x=r.x+r.width,Rn.y=En.y=r.y+r.height,Ln.transform(n),On.transform(n),Rn.transform(n),En.transform(n),e.x=ps(Ln.x,Rn.x,En.x,On.x),e.y=ps(Ln.y,Rn.y,En.y,On.y);var l=gs(Ln.x,Rn.x,En.x,On.x),c=gs(Ln.y,Rn.y,En.y,On.y);e.width=l-e.x,e.height=c-e.y},t})(),sp={};function Et(t,e){e=e||Dn;var r=sp[e];r||(r=sp[e]=new Mi(500));var n=r.get(t);return n==null&&(n=wa.measureText(t,e).width,r.put(t,n)),n}function lp(t,e,r,n){var a=Et(t,e),i=hu(e),o=Ii(0,a,r),s=Ca(0,i,n),l=new Pe(o,s,a,i);return l}function fu(t,e,r,n){var a=((t||"")+"").split(`
|
|
6
|
+
`),i=a.length;if(i===1)return lp(a[0],e,r,n);for(var o=new Pe(0,0,0,0),s=0;s<a.length;s++){var l=lp(a[s],e,r,n);s===0?o.copy(l):o.union(l)}return o}function Ii(t,e,r){return r==="right"?t-=e:r==="center"&&(t-=e/2),t}function Ca(t,e,r){return r==="middle"?t-=e/2:r==="bottom"&&(t-=e),t}function hu(t){return Et("国",t)}function rn(t,e){return typeof t=="string"?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function ms(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+=rn(n[0],r.width),c+=rn(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 du=/\{([a-zA-Z0-9_]+)\|([^}]*)\}/g;function Aw(t,e,r,n,a,i){if(!r){t.text="",t.isTruncated=!1;return}var o=(e+"").split(`
|
|
7
|
+
`);i=cp(r,n,a,i);for(var s=!1,l={},c=0,u=o.length;c<u;c++)up(l,o[c],i),o[c]=l.textLine,s=s||l.isTruncated;t.text=o.join(`
|
|
8
|
+
`),t.isTruncated=s}function cp(t,e,r,n){n=n||{};var a=V({},n);a.font=e,r=_e(r,"..."),a.maxIterations=_e(n.maxIterations,2);var i=a.minChar=_e(n.minChar,0);a.cnCharWidth=Et("国",e);var o=a.ascCharWidth=Et("a",e);a.placeholder=_e(n.placeholder,"");for(var s=t=Math.max(0,t-1),l=0;l<i&&s>=o;l++)s-=o;var c=Et(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 up(t,e,r){var n=r.containerWidth,a=r.font,i=r.contentWidth;if(!n){t.textLine="",t.isTruncated=!1;return}var o=Et(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?Dw(e,i,r.ascCharWidth,r.cnCharWidth):o>0?Math.floor(e.length*i/o):0;e=e.substr(0,l),o=Et(e,a)}e===""&&(e=r.placeholder),t.textLine=e,t.isTruncated=!0}function Dw(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 Iw(t,e){t!=null&&(t+="");var r=e.overflow,n=e.padding,a=e.font,i=r==="truncate",o=hu(a),s=_e(e.lineHeight,o),l=!!e.backgroundColor,c=e.lineOverflow==="truncate",u=!1,f=e.width,d;f!=null&&(r==="break"||r==="breakAll")?d=t?hp(t,e.font,f,r==="breakAll",0).lines:[]:d=t?t.split(`
|
|
9
|
+
`):[];var h=d.length*s,v=_e(e.height,h);if(h>v&&c){var m=Math.floor(v/s);u=u||d.length>m,d=d.slice(0,m)}if(t&&i&&f!=null)for(var g=cp(f,a,e.ellipsis,{minChar:e.truncateMinChar,placeholder:e.placeholder}),p={},y=0;y<d.length;y++)up(p,d[y],g),d[y]=p.textLine,u=u||p.isTruncated;for(var b=v,x=0,y=0;y<d.length;y++)x=Math.max(Et(d[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:d,height:v,outerWidth:S,outerHeight:b,lineHeight:s,calculatedLineHeight:o,contentWidth:x,contentHeight:h,width:f,isTruncated:u}}var Pw=(function(){function t(){}return t})(),fp=(function(){function t(e){this.tokens=[],e&&(this.tokens=e)}return t})(),Lw=(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 Rw(t,e){var r=new Lw;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=du.lastIndex=0,l;(l=du.exec(t))!=null;){var c=l.index;c>s&&vu(r,t.substring(s,c),e,o),vu(r,l[2],e,o,l[1]),s=du.lastIndex}s<t.length&&vu(r,t.substring(s,t.length),e,o);var u=[],f=0,d=0,h=e.padding,v=i==="truncate",m=e.lineOverflow==="truncate",g={};function p(W,ne,te){W.width=ne,W.lineHeight=te,f+=te,d=Math.max(d,ne)}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]||{},M=k.textPadding=T.padding,D=M?M[1]+M[3]:0,C=k.font=T.font||e.font;k.contentHeight=hu(C);var I=_e(T.height,k.contentHeight);if(k.innerHeight=I,M&&(I+=M[0]+M[2]),k.height=I,k.lineHeight=fs(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 P=r.lines.length;w>0?(b.tokens=b.tokens.slice(0,w),p(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<P;break e}var L=T.width,R=L==null||L==="auto";if(typeof L=="string"&&L.charAt(L.length-1)==="%")k.percentWidth=L,u.push(k),k.contentWidth=Et(k.text,C);else{if(R){var N=T.backgroundColor,Z=N&&N.image;Z&&(Z=Tw(Z),vs(Z)&&(k.width=Math.max(k.width,Z.width*I/Z.height)))}var F=v&&n!=null?n-S:null;F!=null&&F<k.width?!R||F<D?(k.text="",k.width=k.contentWidth=0):(Aw(g,k.text,F-D,C,e.ellipsis,{minChar:e.truncateMinChar}),k.text=g.text,r.isTruncated=r.isTruncated||g.isTruncated,k.width=k.contentWidth=Et(k.text,C)):k.contentWidth=Et(k.text,C)}k.width+=D,S+=k.width,T&&(x=Math.max(x,k.lineHeight))}p(b,S,x)}r.outerWidth=r.width=_e(n,d),r.outerHeight=r.height=_e(a,f),r.contentHeight=f,r.contentWidth=d,h&&(r.outerWidth+=h[1]+h[3],r.outerHeight+=h[0]+h[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 vu(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 d=o.padding,h=d?d[1]+d[3]:0;if(o.width!=null&&o.width!=="auto"){var v=rn(o.width,n.width)+h;s.length>0&&v+n.accumWidth>n.width&&(u=e.split(`
|
|
10
|
+
`),c=!0),n.accumWidth=v}else{var m=hp(e,l,n.width,n.breakAll,n.accumWidth);n.accumWidth=m.accumWidth+h,f=m.linesWidths,u=m.lines}}else u=e.split(`
|
|
11
|
+
`);for(var g=0;g<u.length;g++){var p=u[g],y=new Pw;if(y.styleName=a,y.text=p,y.isLineHolder=!p&&!i,typeof o.width=="number"?y.width=o.width:y.width=f?f[g]:Et(p,l),!g&&!c){var b=(s[s.length-1]||(s[0]=new fp)).tokens,x=b.length;x===1&&b[0].isLineHolder?b[0]=y:(p||!x||i)&&b.push(y)}else s.push(new fp([y]))}}function Ew(t){var e=t.charCodeAt(0);return e>=32&&e<=591||e>=880&&e<=4351||e>=4608&&e<=5119||e>=7680&&e<=8303}var Ow=Sa(",&?/;] ".split(""),function(t,e){return t[e]=!0,t},{});function Nw(t){return Ew(t)?!!Ow[t]:!0}function hp(t,e,r,n,a){for(var i=[],o=[],s="",l="",c=0,u=0,f=0;f<t.length;f++){var d=t.charAt(f);if(d===`
|
|
12
|
+
`){l&&(s+=l,u+=c),i.push(s),o.push(u),s="",l="",c=0,u=0;continue}var h=Et(d,e),v=n?!1:!Nw(d);if(i.length?u+h>r:a+u+h>r){u?(s||l)&&(v?(s||(s=l,l="",c=0,u=c),i.push(s),o.push(u-c),l+=d,c+=h,s="",u=c):(l&&(s+=l,l="",c=0),i.push(s),o.push(u),s=d,u=h)):v?(i.push(l),o.push(c),l=d,c=h):(i.push(d),o.push(h));continue}u+=h,v?(l+=d,c+=h):(l&&(s+=l,l="",c=0),s+=d)}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 Ma(t,e){return t==null&&(t=0),e==null&&(e=0),[t,e]}function Bw(t){return[t[0],t[1]]}function dp(t,e,r){return t[0]=e[0]+r[0],t[1]=e[1]+r[1],t}function zw(t,e,r){return t[0]=e[0]-r[0],t[1]=e[1]-r[1],t}function Fw(t){return Math.sqrt(Hw(t))}function Hw(t){return t[0]*t[0]+t[1]*t[1]}function pu(t,e,r){return t[0]=e[0]*r,t[1]=e[1]*r,t}function Vw(t,e){var r=Fw(e);return r===0?(t[0]=0,t[1]=0):(t[0]=e[0]/r,t[1]=e[1]/r),t}function gu(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var Gw=gu;function Ww(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var Aa=Ww;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 Da(t,e,r){return t[0]=Math.min(e[0],r[0]),t[1]=Math.min(e[1],r[1]),t}function Ia(t,e,r){return t[0]=Math.max(e[0],r[0]),t[1]=Math.max(e[1],r[1]),t}var vp=su,pp=5e-5;function Nn(t){return t>pp||t<-pp}var Bn=[],Pa=[],mu=ka(),yu=Math.abs,_u=(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 Nn(this.rotation)||Nn(this.x)||Nn(this.y)||Nn(this.scaleX-1)||Nn(this.scaleY-1)||Nn(this.skewX)||Nn(this.skewY)},t.prototype.updateTransform=function(){var e=this.parent&&this.parent.transform,r=this.needLocalTransform(),n=this.transform;if(!(r||e)){n&&(vp(n),this.invTransform=null);return}n=n||ka(),r?this.getLocalTransform(n):vp(n),e&&(r?Ta(n,e,n):Cw(n,e)),this.transform=n,this._resolveGlobalScaleRatio(n)},t.prototype._resolveGlobalScaleRatio=function(e){var r=this.globalScaleRatio;if(r!=null&&r!==1){this.getGlobalScale(Bn);var n=Bn[0]<0?-1:1,a=Bn[1]<0?-1:1,i=((Bn[0]-n)*r+n)/Bn[0]||0,o=((Bn[1]-a)*r+a)/Bn[1]||0;e[0]*=i,e[1]*=i,e[2]*=o,e[3]*=o}this.invTransform=this.invTransform||ka(),uu(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||ka(),Ta(Pa,e.invTransform,r),r=Pa);var n=this.originX,a=this.originY;(n||a)&&(mu[4]=n,mu[5]=a,Ta(Pa,r,mu),Pa[4]-=n,Pa[5]-=a,r=Pa),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&&yu(e[0]-1)>1e-10&&yu(e[3]-1)>1e-10?Math.sqrt(yu(e[0]*e[3]-e[2]*e[1])):1},t.prototype.copyTransform=function(e){Uw(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,d=e.skewX?Math.tan(e.skewX):0,h=e.skewY?Math.tan(-e.skewY):0;if(n||a||s||l){var v=n+s,m=a+l;r[4]=-v*i-d*m*o,r[5]=-m*o-h*v*i}else r[4]=r[5]=0;return r[0]=i,r[3]=o,r[1]=h*i,r[2]=d*o,c&&cu(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})(),Pi=["x","y","originX","originY","anchorX","anchorY","rotation","scaleX","scaleY","skewX","skewY"];function Uw(t,e){for(var r=0;r<Pi.length;r++){var n=Pi[r];t[n]=e[n]}}var Li={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-Li.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?Li.bounceIn(t*2)*.5:Li.bounceOut(t*2-1)*.5+.5}},ys=Math.pow,nn=Math.sqrt,_s=1e-8,gp=1e-4,mp=nn(3),bs=1/3,xr=Ma(),Wt=Ma(),La=Ma();function an(t){return t>-_s&&t<_s}function yp(t){return t>_s||t<-_s}function st(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 _p(t,e,r,n,a){var i=1-a;return 3*(((e-t)*i+2*(r-e)*a)*i+(n-r)*a*a)}function xs(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,d=l*l-3*s*c,h=0;if(an(u)&&an(f))if(an(s))i[0]=0;else{var v=-l/s;v>=0&&v<=1&&(i[h++]=v)}else{var m=f*f-4*u*d;if(an(m)){var g=f/u,v=-s/o+g,p=-g/2;v>=0&&v<=1&&(i[h++]=v),p>=0&&p<=1&&(i[h++]=p)}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=-ys(-b,bs):b=ys(b,bs),x<0?x=-ys(-x,bs):x=ys(x,bs);var v=(-s-(b+x))/(3*o);v>=0&&v<=1&&(i[h++]=v)}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),v=(-s-2*k*T)/(3*o),p=(-s+k*(T+mp*Math.sin(w)))/(3*o),M=(-s+k*(T-mp*Math.sin(w)))/(3*o);v>=0&&v<=1&&(i[h++]=v),p>=0&&p<=1&&(i[h++]=p),M>=0&&M<=1&&(i[h++]=M)}}return h}function bp(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(yp(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),d=(-i-f)/(2*o);c>=0&&c<=1&&(a[l++]=c),d>=0&&d<=1&&(a[l++]=d)}}return l}function ws(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 $w(t,e,r,n,a,i,o,s,l,c,u){var f,d=.005,h=1/0,v,m,g,p;xr[0]=l,xr[1]=c;for(var y=0;y<1;y+=.05)Wt[0]=st(t,r,a,o,y),Wt[1]=st(e,n,i,s,y),g=Aa(xr,Wt),g<h&&(f=y,h=g);h=1/0;for(var b=0;b<32&&!(d<gp);b++)v=f-d,m=f+d,Wt[0]=st(t,r,a,o,v),Wt[1]=st(e,n,i,s,v),g=Aa(Wt,xr),v>=0&&g<h?(f=v,h=g):(La[0]=st(t,r,a,o,m),La[1]=st(e,n,i,s,m),p=Aa(La,xr),m<=1&&p<h?(f=m,h=p):d*=.5);return nn(h)}function Yw(t,e,r,n,a,i,o,s,l){for(var c=t,u=e,f=0,d=1/l,h=1;h<=l;h++){var v=h*d,m=st(t,r,a,o,v),g=st(e,n,i,s,v),p=m-c,y=g-u;f+=Math.sqrt(p*p+y*y),c=m,u=g}return f}function xt(t,e,r,n){var a=1-n;return a*(a*t+2*n*e)+n*n*r}function xp(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(yp(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),d=(-o-f)/(2*i);c>=0&&c<=1&&(a[l++]=c),d>=0&&d<=1&&(a[l++]=d)}}return l}function wp(t,e,r){var n=t+r-2*e;return n===0?.5:(t-e)/n}function Ss(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 Xw(t,e,r,n,a,i,o,s,l){var c,u=.005,f=1/0;xr[0]=o,xr[1]=s;for(var d=0;d<1;d+=.05){Wt[0]=xt(t,r,a,d),Wt[1]=xt(e,n,i,d);var h=Aa(xr,Wt);h<f&&(c=d,f=h)}f=1/0;for(var v=0;v<32&&!(u<gp);v++){var m=c-u,g=c+u;Wt[0]=xt(t,r,a,m),Wt[1]=xt(e,n,i,m);var h=Aa(Wt,xr);if(m>=0&&h<f)c=m,f=h;else{La[0]=xt(t,r,a,g),La[1]=xt(e,n,i,g);var p=Aa(La,xr);g<=1&&p<f?(c=g,f=p):u*=.5}}return nn(f)}function Zw(t,e,r,n,a,i,o){for(var s=t,l=e,c=0,u=1/o,f=1;f<=o;f++){var d=f*u,h=xt(t,r,a,d),v=xt(e,n,i,d),m=h-s,g=v-l;c+=Math.sqrt(m*m+g*g),s=h,l=v}return c}var Kw=/cubic-bezier\(([0-9,\.e ]+)\)/;function Sp(t){var e=t&&Kw.exec(t);if(e){var r=e[1].split(","),n=+_r(r[0]),a=+_r(r[1]),i=+_r(r[2]),o=+_r(r[3]);if(isNaN(n+a+i+o))return;var s=[];return function(l){return l<=0?0:l>=1?1:xs(0,n,i,1,l,s)&&st(0,a,o,1,s[0])}}}var jw=(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||pt,this.ondestroy=e.ondestroy||pt,this.onrestart=e.onrestart||pt,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=ge(e)?e:Li[e]||Sp(e)},t})(),kp={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 bu(t){return t<0?0:t>1?1:t}function xu(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?on(parseFloat(e)/100*255):on(parseInt(e,10))}function Ri(t){var e=t;return e.length&&e.charAt(e.length-1)==="%"?bu(parseFloat(e)/100):bu(parseFloat(e))}function wu(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 ks(t,e,r){return t+(e-t)*r}function Ut(t,e,r,n,a){return t[0]=e,t[1]=r,t[2]=n,t[3]=a,t}function Su(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var Tp=new Mi(20),Ts=null;function Ra(t,e){Ts&&Su(Ts,e),Ts=Tp.put(t,Ts||e.slice())}function zr(t,e){if(t){e=e||[];var r=Tp.get(t);if(r)return Su(e,r);t=t+"";var n=t.replace(/ /g,"").toLowerCase();if(n in kp)return Su(e,kp[n]),Ra(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)){Ut(e,0,0,0,1);return}return Ut(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),Ra(t,e),e}else if(a===7||a===9){var i=parseInt(n.slice(1,7),16);if(!(i>=0&&i<=16777215)){Ut(e,0,0,0,1);return}return Ut(e,(i&16711680)>>16,(i&65280)>>8,i&255,a===9?parseInt(n.slice(7),16)/255:1),Ra(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?Ut(e,+c[0],+c[1],+c[2],1):Ut(e,0,0,0,1);u=Ri(c.pop());case"rgb":if(c.length>=3)return Ut(e,xu(c[0]),xu(c[1]),xu(c[2]),c.length===3?u:Ri(c[3])),Ra(t,e),e;Ut(e,0,0,0,1);return;case"hsla":if(c.length!==4){Ut(e,0,0,0,1);return}return c[3]=Ri(c[3]),Cp(c,e),Ra(t,e),e;case"hsl":if(c.length!==3){Ut(e,0,0,0,1);return}return Cp(c,e),Ra(t,e),e;default:return}}Ut(e,0,0,0,1)}}function Cp(t,e){var r=(parseFloat(t[0])%360+360)%360/360,n=Ri(t[1]),a=Ri(t[2]),i=a<=.5?a*(n+1):a+n-a*n,o=a*2-i;return e=e||[],Ut(e,on(wu(o,i,r+.3333333333333333)*255),on(wu(o,i,r)*255),on(wu(o,i,r-.3333333333333333)*255),1),t.length===4&&(e[3]=t[3]),e}function Mp(t,e){var r=zr(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 Cs(r,r.length===4?"rgba":"rgb")}}function Qw(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=zr(e[a]),s=zr(e[i]),l=n-a,c=Cs([on(ks(o[0],s[0],l)),on(ks(o[1],s[1],l)),on(ks(o[2],s[2],l)),bu(ks(o[3],s[3],l))],"rgba");return r?{color:c,leftIndex:a,rightIndex:i,value:n}:c}}function Cs(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 Ms(t,e){var r=zr(t);return r?(.299*r[0]+.587*r[1]+.114*r[2])*r[3]/255+(1-r[3])*e:0}var Ap=new Mi(100);function Dp(t){if(ie(t)){var e=Ap.get(t);return e||(e=Mp(t,-.1),Ap.put(t,e)),e}else if(cs(t)){var r=V({},t);return r.colorStops=ue(t.colorStops,function(n){return{offset:n.offset,color:Mp(n.color,-.1)}}),r}return t}function Jw(t){return t.type==="linear"}function eS(t){return t.type==="radial"}(function(){return he.hasGlobalWindow&&ge(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 ku=Array.prototype.slice;function Fr(t,e,r){return(e-t)*r+t}function Tu(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=Fr(e[i],r[i],n);return t}function tS(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]=Fr(e[o][s],r[o][s],n)}return t}function As(t,e,r,n){for(var a=e.length,i=0;i<a;i++)t[i]=e[i]+r[i]*n;return t}function Ip(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 rS(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 nS(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]:ku.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 Ds(t){if(_t(t)){var e=t.length;if(_t(t[0])){for(var r=[],n=0;n<e;n++)r.push(ku.call(t[n]));return r}return ku.call(t)}return t}function Is(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 aS(t){return _t(t&&t[0])?2:1}var Ps=0,Ls=1,Pp=2,Ei=3,Cu=4,Mu=5,Lp=6;function Rp(t){return t===Cu||t===Mu}function Rs(t){return t===Ls||t===Pp}var Oi=[0,0,0,0],iS=(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=Lp,l=r;if(_t(r)){var c=aS(r);s=c,(c===1&&!He(r[0])||c===2&&!He(r[0][0]))&&(o=!0)}else if(He(r)&&!us(r))s=Ps;else if(ie(r))if(!isNaN(+r))s=Ps;else{var u=zr(r);u&&(l=u,s=Ei)}else if(cs(r)){var f=V({},l);f.colorStops=ue(r.colorStops,function(h){return{offset:h.offset,color:zr(h.color)}}),Jw(r)?s=Cu:eS(r)&&(s=Mu),l=f}i===0?this.valType=s:(s!==this.valType||s===Lp)&&(o=!0),this.discrete=this.discrete||o;var d={time:e,value:l,rawValue:r,percent:0};return n&&(d.easing=n,d.easingFunc=ge(n)?n:Li[n]||Sp(n)),a.push(d),d},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=Rs(a),c=Rp(a),u=0;u<i;u++){var f=n[u],d=f.value,h=o.value;f.percent=f.time/e,s||(l&&u!==i-1?nS(d,h,a):c&&rS(d.colorStops,h.colorStops))}if(!s&&a!==Mu&&r&&this.needsAnimate()&&r.needsAnimate()&&a===r.valType&&!r._finished){this._additiveTrack=r;for(var v=n[0].value,u=0;u<i;u++)a===Ps?n[u].additiveValue=n[u].value-v:a===Ei?n[u].additiveValue=As([],n[u].value,v,-1):Rs(a)&&(n[u].additiveValue=a===Ls?As([],n[u].value,v,-1):Ip([],n[u].value,v,-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===Ei,u,f=this._lastFr,d=Math.min,h,v;if(s===1)h=v=o[0];else{if(r<0)u=0;else if(r<this._lastFrP){var m=d(f+1,s-1);for(u=m;u>=0&&!(o[u].percent<=r);u--);u=d(u,s-2)}else{for(u=f;u<s&&!(o[u].percent>r);u++);u=d(u-1,s-2)}v=o[u+1],h=o[u]}if(h&&v){this._lastFr=u,this._lastFrP=r;var g=v.percent-h.percent,p=g===0?1:d((r-h.percent)/g,1);v.easingFunc&&(p=v.easingFunc(p));var y=n?this._additiveValue:c?Oi:e[l];if((Rs(i)||c)&&!y&&(y=this._additiveValue=[]),this.discrete)e[l]=p<1?h.rawValue:v.rawValue;else if(Rs(i))i===Ls?Tu(y,h[a],v[a],p):tS(y,h[a],v[a],p);else if(Rp(i)){var b=h[a],x=v[a],S=i===Cu;e[l]={type:S?"linear":"radial",x:Fr(b.x,x.x,p),y:Fr(b.y,x.y,p),colorStops:ue(b.colorStops,function(k,T){var M=x.colorStops[T];return{offset:Fr(k.offset,M.offset,p),color:Is(Tu([],k.color,M.color,p))}}),global:x.global},S?(e[l].x2=Fr(b.x2,x.x2,p),e[l].y2=Fr(b.y2,x.y2,p)):e[l].r=Fr(b.r,x.r,p)}else if(c)Tu(y,h[a],v[a],p),n||(e[l]=Is(y));else{var w=Fr(h[a],v[a],p);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===Ps?e[n]=e[n]+a:r===Ei?(zr(e[n],Oi),As(Oi,Oi,a,1),e[n]=Is(Oi)):r===Ls?As(e[n],e[n],a,1):r===Pp&&Ip(e[n],e[n],a,1)},t})(),Au=(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){tu("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 iS(s);var c=void 0,u=this._getAdditiveTrack(s);if(u){var f=u.keyframes,d=f[f.length-1];c=d&&d.value,u.valType===Ei&&c&&(c=Is(c))}else c=this._target[s];if(c==null)continue;e>0&&l.addKeyframe(0,Ds(c),a),this._trackKeys.push(s)}l.addKeyframe(e,Ds(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 d=new jw({life:a,loop:this._loop,delay:this._delay||0,onframe:function(h){r._started=2;var v=r._additiveAnimators;if(v){for(var m=!1,g=0;g<v.length;g++)if(v[g]._clip){m=!0;break}m||(r._additiveAnimators=null)}for(var g=0;g<n.length;g++)n[g].step(r._target,h);var p=r._onframeCbs;if(p)for(var g=0;g<p.length;g++)p[g](r._target,h)},ondestroy:function(){r._doneCallback()}});this._clip=d,this.animation&&this.animation.addClip(d),e&&d.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]=Ds(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})(),Ep=1;he.hasGlobalWindow&&(Ep=Math.max(window.devicePixelRatio||window.screen&&window.screen.deviceXDPI/window.screen.logicalXDPI||1,1));var Es=Ep,Du=.4,Iu="#333",Pu="#ccc",oS="#eee",Ot=1,Ni=2,Ea=4,Lu="__zr_normal__",Ru=Pi.concat(["ignore"]),sS=Sa(Pi,function(t,e){return t[e]=!0,t},{ignore:!1}),Oa={},lS=new Pe(0,0,0,0),Os=(function(){function t(e){this.id=Kv(),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=lS;n.layoutRect?u.copy(n.layoutRect):u.copy(this.getBoundingRect()),a||u.applyTransform(this.transform),this.calculateTextPosition?this.calculateTextPosition(Oa,n,u):ms(Oa,n,u),i.x=Oa.x,i.y=Oa.y,o=Oa.align,s=Oa.verticalAlign;var f=n.origin;if(f&&n.rotation!=null){var d=void 0,h=void 0;f==="center"?(d=u.width*.5,h=u.height*.5):(d=rn(f[0],u.width),h=rn(f[1],u.height)),c=!0,i.originX=-i.x+d+(a?0:u.x),i.originY=-i.y+h+(a?0:u.y)}}n.rotation!=null&&(i.rotation=n.rotation);var v=n.offset;v&&(i.x+=v[0],i.y+=v[1],c||(i.originX=-v[0],i.originY=-v[1]));var m=n.inside==null?typeof n.position=="string"&&n.position.indexOf("inside")>=0:n.inside,g=this._innerTextDefaultStyle||(this._innerTextDefaultStyle={}),p=void 0,y=void 0,b=void 0;m&&this.canBeInsideText()?(p=n.insideFill,y=n.insideStroke,(p==null||p==="auto")&&(p=this.getInsideTextFill()),(y==null||y==="auto")&&(y=this.getInsideTextStroke(p),b=!0)):(p=n.outsideFill,y=n.outsideStroke,(p==null||p==="auto")&&(p=this.getOutsideFill()),(y==null||y==="auto")&&(y=this.getOutsideStroke(p),b=!0)),p=p||"#000",(p!==g.fill||y!==g.stroke||b!==g.autoStroke||o!==g.align||s!==g.verticalAlign)&&(l=!0,g.fill=p,g.stroke=y,g.autoStroke=b,g.align=o,g.verticalAlign=s,r.setDefaultTextStyle(g)),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()?Pu:Iu},t.prototype.getOutsideStroke=function(e){var r=this.__zr&&this.__zr.getBackgroundColor(),n=typeof r=="string"&&zr(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,Cs(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||{},V(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!==Lu)){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,Ru)},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(Lu,!1,e)},t.prototype.useState=function(e,r,n,a){var i=e===Lu,o=this.hasState();if(!(!o&&i)){var s=this.currentStates,l=this.stateTransition;if(!(Ie(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){tu("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,d=this._textGuide;return f&&f.useState(e,r,n,u),d&&d.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],d=!!(f&&f.hoverLayer||n);d&&this._toggleHoverLayerFlag(!0);var h=this._mergeStates(a),v=this.stateTransition;this.saveCurrentToNormalState(h),this._applyStateObj(e.join(","),h,this._normalState,!1,!r&&!this.__inHover&&v&&v.duration>0,v);var m=this._textContent,g=this._textGuide;m&&m.useStates(e,r,d),g&&g.useStates(e,r,d),this._updateAnimationTargets(),this.currentStates=e.slice(),this.markRedraw(),!d&&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=Ie(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=Ie(a,e),o=Ie(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];V(r,i),i.textConfig&&(n=n||{},V(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=V({},a?this.textConfig:n.textConfig),V(this.textConfig,r.textConfig)):s&&n.textConfig&&(this.textConfig=n.textConfig);for(var l={},c=!1,u=0;u<Ru.length;u++){var f=Ru[u],d=i&&sS[f];r&&r[f]!=null?d?(c=!0,l[f]=r[f]):this[f]=r[f]:s&&n[f]!=null&&(d?(c=!0,l[f]=n[f]):this[f]=n[f])}if(!i)for(var u=0;u<this.animators.length;u++){var h=this.animators[u],v=h.targetName;h.getLoop()||h.__changeFinalValue(v?(r||n)[v]: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 _u,this._attachComponent(e),this._textContent=e,this.markRedraw())},t.prototype.setTextConfig=function(e){this.textConfig||(this.textConfig={}),V(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 Au(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=Ie(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){Eu(this,e,r,n)},t.prototype.animateFrom=function(e,r,n){Eu(this,e,r,n,!0)},t.prototype._transitionState=function(e,r,n,a){for(var i=Eu(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})();yr(Os,rr),yr(Os,_u);function Eu(t,e,r,n,a){r=r||{};var i=[];Op(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(v,m){r.during(m)});for(var d=0;d<i.length;d++){var h=i[d];u&&h.done(u),f&&h.aborted(f),r.force&&h.duration(r.duration),h.start(r.easing)}return i}function Ou(t,e,r){for(var n=0;n<r;n++)t[n]=e[n]}function cS(t){return _t(t[0])}function uS(t,e,r){if(_t(e[r]))if(_t(t[r])||(t[r]=[]),bt(e[r])){var n=e[r].length;t[r].length!==n&&(t[r]=new e[r].constructor(n),Ou(t[r],e[r],n))}else{var a=e[r],i=t[r],o=a.length;if(cS(a))for(var s=a[0].length,l=0;l<o;l++)i[l]?Ou(i[l],a[l],s):i[l]=Array.prototype.slice.call(a[l]);else Ou(i,a,o);i.length=a.length}else t[r]=e[r]}function fS(t,e){return t===e||_t(t)&&_t(e)&&hS(t,e)}function hS(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 Op(t,e,r,n,a,i,o,s){for(var l=Ge(n),c=a.duration,u=a.delay,f=a.additive,d=a.setToFinal,h=!ce(i),v=t.animators,m=[],g=0;g<l.length;g++){var p=l[g],y=n[p];if(y!=null&&r[p]!=null&&(h||i[p]))if(ce(y)&&!_t(y)&&!cs(y)){if(e){s||(r[p]=y,t.updateDuringAnimation(e));continue}Op(t,p,r[p],y,a,i&&i[p],o,s)}else m.push(p);else s||(r[p]=y,t.updateDuringAnimation(e),m.push(p))}var b=m.length;if(!f&&b)for(var x=0;x<v.length;x++){var S=v[x];if(S.targetName===e){var w=S.stopTracks(m);if(w){var k=Ie(v,S);v.splice(k,1)}}}if(a.force||(m=it(m,function(C){return!fS(n[C],r[C])}),b=m.length),b>0||a.force&&!o.length){var T=void 0,M=void 0,D=void 0;if(s){M={},d&&(T={});for(var x=0;x<b;x++){var p=m[x];M[p]=r[p],d?T[p]=n[p]:r[p]=n[p]}}else if(d){D={};for(var x=0;x<b;x++){var p=m[x];D[p]=Ds(r[p]),uS(r,n,p)}}var S=new Au(r,!1,!1,f?it(v,function(I){return I.targetName===e}):null);S.targetName=e,a.scope&&(S.scope=a.scope),d&&T&&S.whenWithKeys(0,T,m),D&&S.whenWithKeys(0,D,m),S.whenWithKeys(c??500,s?M:n,m).delay(u||0),t.addAnimator(S,e),o.push(S)}}var Nu="__zr_style_"+Math.round(Math.random()*10),zn={shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,shadowColor:"#000",opacity:1,blend:"source-over"},Ns={style:{shadowBlur:!0,shadowOffsetX:!0,shadowOffsetY:!0,shadowColor:!0,opacity:!0}};zn[Nu]=!0;var Np=["z","z2","invisible"],dS=["invisible"],Bi=(function(t){G(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&&vS(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 Pe(0,0,0,0)),n?Pe.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 Pe(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:V(this.style,r),this.dirtyStyle(),this},e.prototype.dirtyStyle=function(r){r||this.markRedraw(),this.__dirty|=Ni,this._rect&&(this._rect=null)},e.prototype.dirty=function(){this.dirtyStyle()},e.prototype.styleChanged=function(){return!!(this.__dirty&Ni)},e.prototype.styleUpdated=function(){this.__dirty&=~Ni},e.prototype.createStyle=function(r){return hs(zn,r)},e.prototype.useStyle=function(r){r[Nu]||(r=this.createStyle(r)),this.__inHover?this.__hoverStyle=r:this.style=r,this.dirtyStyle()},e.prototype.isStyleObject=function(r){return r[Nu]},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,Np)},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),d=0;d<f.length;d++){var h=f[d];h in c&&(c[h]=c[h],this.style[h]=u[h])}for(var v=Ge(c),d=0;d<v.length;d++){var h=v[d];this.style[h]=this.style[h]}this._transitionState(r,{style:c},s,this.getAnimationStyleProps())}else this.useStyle(c);for(var m=this.__inHover?dS:Np,d=0;d<m.length;d++){var h=m[d];n&&n[h]!=null?this[h]=n[h]:l&&a[h]!=null&&(this[h]=a[h])}},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 V(r,n),r},e.prototype.getAnimationStyleProps=function(){return Ns},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|Ni})(),e})(Os),Bu=new Pe(0,0,0,0),zu=new Pe(0,0,0,0);function vS(t,e,r){return Bu.copy(t.getBoundingRect()),t.transform&&Bu.applyTransform(t.transform),zu.width=e,zu.height=r,!Bu.intersect(zu)}var $t=Math.min,Yt=Math.max,Fu=Math.sin,Hu=Math.cos,Fn=Math.PI*2,Bs=Ma(),zs=Ma(),Fs=Ma();function Bp(t,e,r,n,a,i){a[0]=$t(t,r),a[1]=$t(e,n),i[0]=Yt(t,r),i[1]=Yt(e,n)}var zp=[],Fp=[];function pS(t,e,r,n,a,i,o,s,l,c){var u=bp,f=st,d=u(t,r,a,o,zp);l[0]=1/0,l[1]=1/0,c[0]=-1/0,c[1]=-1/0;for(var h=0;h<d;h++){var v=f(t,r,a,o,zp[h]);l[0]=$t(v,l[0]),c[0]=Yt(v,c[0])}d=u(e,n,i,s,Fp);for(var h=0;h<d;h++){var m=f(e,n,i,s,Fp[h]);l[1]=$t(m,l[1]),c[1]=Yt(m,c[1])}l[0]=$t(t,l[0]),c[0]=Yt(t,c[0]),l[0]=$t(o,l[0]),c[0]=Yt(o,c[0]),l[1]=$t(e,l[1]),c[1]=Yt(e,c[1]),l[1]=$t(s,l[1]),c[1]=Yt(s,c[1])}function gS(t,e,r,n,a,i,o,s){var l=wp,c=xt,u=Yt($t(l(t,r,a),1),0),f=Yt($t(l(e,n,i),1),0),d=c(t,r,a,u),h=c(e,n,i,f);o[0]=$t(t,a,d),o[1]=$t(e,i,h),s[0]=Yt(t,a,d),s[1]=Yt(e,i,h)}function mS(t,e,r,n,a,i,o,s,l){var c=Da,u=Ia,f=Math.abs(a-i);if(f%Fn<1e-4&&f>1e-4){s[0]=t-r,s[1]=e-n,l[0]=t+r,l[1]=e+n;return}if(Bs[0]=Hu(a)*r+t,Bs[1]=Fu(a)*n+e,zs[0]=Hu(i)*r+t,zs[1]=Fu(i)*n+e,c(s,Bs,zs),u(l,Bs,zs),a=a%Fn,a<0&&(a=a+Fn),i=i%Fn,i<0&&(i=i+Fn),a>i&&!o?i+=Fn:a<i&&o&&(a+=Fn),o){var d=i;i=a,a=d}for(var h=0;h<i;h+=Math.PI/2)h>a&&(Fs[0]=Hu(h)*r+t,Fs[1]=Fu(h)*n+e,c(s,Fs,s),u(l,Fs,l))}var Le={M:1,L:2,C:3,Q:4,A:5,Z:6,R:7},Hn=[],Vn=[],wr=[],sn=[],Sr=[],kr=[],Vu=Math.min,Gu=Math.max,Gn=Math.cos,Wn=Math.sin,Hr=Math.abs,Wu=Math.PI,ln=Wu*2,Uu=typeof Float32Array<"u",zi=[];function $u(t){var e=Math.round(t/Wu*1e8)/1e8;return e%2*Wu}function yS(t,e){var r=$u(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-$u(r-a)):e&&r<a&&(a=r-(ln-$u(a-r))),t[0]=r,t[1]=a}var Un=(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=Hr(n/Es/e)||0,this._uy=Hr(n/Es/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(Le.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=Hr(e-this._xi),a=Hr(r-this._yi),i=n>this._ux||a>this._uy;if(this.addData(Le.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(Le.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(Le.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(),zi[0]=a,zi[1]=i,yS(zi,o),a=zi[0],i=zi[1];var s=i-a;return this.addData(Le.A,e,r,n,n,a,s,0,o?0:1),this._ctx&&this._ctx.arc(e,r,n,a,i,o),this._xi=Gn(i)*n+e,this._yi=Wn(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(Le.R,e,r,n,a),this},t.prototype.closePath=function(){this._drawPendingPt(),this.addData(Le.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(){wr[0]=wr[1]=Sr[0]=Sr[1]=Number.MAX_VALUE,sn[0]=sn[1]=kr[0]=kr[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 Le.M:r=a=e[o++],n=i=e[o++],Sr[0]=a,Sr[1]=i,kr[0]=a,kr[1]=i;break;case Le.L:Bp(r,n,e[o],e[o+1],Sr,kr),r=e[o++],n=e[o++];break;case Le.C:pS(r,n,e[o++],e[o++],e[o++],e[o++],e[o],e[o+1],Sr,kr),r=e[o++],n=e[o++];break;case Le.Q:gS(r,n,e[o++],e[o++],e[o],e[o+1],Sr,kr),r=e[o++],n=e[o++];break;case Le.A:var c=e[o++],u=e[o++],f=e[o++],d=e[o++],h=e[o++],v=e[o++]+h;o+=1;var m=!e[o++];l&&(a=Gn(h)*f+c,i=Wn(h)*d+u),mS(c,u,f,d,h,v,m,Sr,kr),r=Gn(v)*f+c,n=Wn(v)*d+u;break;case Le.R:a=r=e[o++],i=n=e[o++];var g=e[o++],p=e[o++];Bp(a,i,a+g,i+p,Sr,kr);break;case Le.Z:r=a,n=i;break}Da(wr,wr,Sr),Ia(sn,sn,kr)}return o===0&&(wr[0]=wr[1]=sn[0]=sn[1]=0),new Pe(wr[0],wr[1],sn[0]-wr[0],sn[1]-wr[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,d=0;d<r;){var h=e[d++],v=d===1;v&&(i=e[d],o=e[d+1],s=i,l=o);var m=-1;switch(h){case Le.M:i=s=e[d++],o=l=e[d++];break;case Le.L:{var g=e[d++],p=e[d++],y=g-i,b=p-o;(Hr(y)>n||Hr(b)>a||d===r-1)&&(m=Math.sqrt(y*y+b*b),i=g,o=p);break}case Le.C:{var x=e[d++],S=e[d++],g=e[d++],p=e[d++],w=e[d++],k=e[d++];m=Yw(i,o,x,S,g,p,w,k,10),i=w,o=k;break}case Le.Q:{var x=e[d++],S=e[d++],g=e[d++],p=e[d++];m=Zw(i,o,x,S,g,p,10),i=g,o=p;break}case Le.A:var T=e[d++],M=e[d++],D=e[d++],C=e[d++],I=e[d++],P=e[d++],L=P+I;d+=1,v&&(s=Gn(I)*D+T,l=Wn(I)*C+M),m=Gu(D,C)*Vu(ln,Math.abs(P)),i=Gn(L)*D+T,o=Wn(L)*C+M;break;case Le.R:{s=i=e[d++],l=o=e[d++];var R=e[d++],N=e[d++];m=R*2+N*2;break}case Le.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,d,h=r<1,v,m,g=0,p=0,y,b=0,x,S;if(!(h&&(this._pathSegLen||this._calculateLength(),v=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!==Le.L&&b>0&&(e.lineTo(x,S),b=0),k){case Le.M:s=c=n[w++],l=u=n[w++],e.moveTo(c,u);break;case Le.L:{f=n[w++],d=n[w++];var M=Hr(f-c),D=Hr(d-u);if(M>a||D>i){if(h){var C=v[p++];if(g+C>y){var I=(y-g)/C;e.lineTo(c*(1-I)+f*I,u*(1-I)+d*I);break e}g+=C}e.lineTo(f,d),c=f,u=d,b=0}else{var P=M*M+D*D;P>b&&(x=f,S=d,b=P)}break}case Le.C:{var L=n[w++],R=n[w++],N=n[w++],Z=n[w++],F=n[w++],z=n[w++];if(h){var C=v[p++];if(g+C>y){var I=(y-g)/C;ws(c,L,N,F,I,Hn),ws(u,R,Z,z,I,Vn),e.bezierCurveTo(Hn[1],Vn[1],Hn[2],Vn[2],Hn[3],Vn[3]);break e}g+=C}e.bezierCurveTo(L,R,N,Z,F,z),c=F,u=z;break}case Le.Q:{var L=n[w++],R=n[w++],N=n[w++],Z=n[w++];if(h){var C=v[p++];if(g+C>y){var I=(y-g)/C;Ss(c,L,N,I,Hn),Ss(u,R,Z,I,Vn),e.quadraticCurveTo(Hn[1],Vn[1],Hn[2],Vn[2]);break e}g+=C}e.quadraticCurveTo(L,R,N,Z),c=N,u=Z;break}case Le.A:var W=n[w++],ne=n[w++],te=n[w++],de=n[w++],be=n[w++],xe=n[w++],et=n[w++],at=!n[w++],Ye=te>de?te:de,X=Hr(te-de)>.001,le=be+xe,Y=!1;if(h){var C=v[p++];g+C>y&&(le=be+xe*(y-g)/C,Y=!0),g+=C}if(X&&e.ellipse?e.ellipse(W,ne,te,de,et,be,le,at):e.arc(W,ne,Ye,be,le,at),Y)break e;T&&(s=Gn(be)*te+W,l=Wn(be)*de+ne),c=Gn(le)*te+W,u=Wn(le)*de+ne;break;case Le.R:s=c=n[w],l=u=n[w+1],f=n[w++],d=n[w++];var q=n[w++],B=n[w++];if(h){var C=v[p++];if(g+C>y){var j=y-g;e.moveTo(f,d),e.lineTo(f+Vu(j,q),d),j-=q,j>0&&e.lineTo(f+q,d+Vu(j,B)),j-=B,j>0&&e.lineTo(f+Gu(q-j,0),d+B),j-=q,j>0&&e.lineTo(f,d+Gu(B-j,0));break e}g+=C}e.rect(f,d,q,B);break;case Le.Z:if(h){var C=v[p++];if(g+C>y){var I=(y-g)/C;e.lineTo(c*(1-I)+s*I,u*(1-I)+l*I);break e}g+=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=Le,t.initDefaultProps=(function(){var e=t.prototype;e._saveData=!0,e._ux=0,e._uy=0,e._pendingPtDist=0,e._version=0})(),t})();function Na(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 _S(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 d=$w(t,e,r,n,a,i,o,s,c,u);return d<=f/2}function bS(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=Xw(t,e,r,n,a,i,s,l);return u<=c/2}var Hp=Math.PI*2;function Hs(t){return t%=Hp,t<0&&(t+=Hp),t}var Fi=Math.PI*2;function xS(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)%Fi<1e-4)return!0;if(i){var f=n;n=Hs(a),a=Hs(f)}else n=Hs(n),a=Hs(a);n>a&&(a+=Fi);var d=Math.atan2(l,s);return d<0&&(d+=Fi),d>=n&&d<=a||d+Fi>=n&&d+Fi<=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=Un.CMD,Yn=Math.PI*2,wS=1e-4;function SS(t,e){return Math.abs(t-e)<wS}var gt=[-1,-1,-1],qt=[-1,-1];function kS(){var t=qt[0];qt[0]=qt[1],qt[1]=t}function TS(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=xs(e,n,i,s,c,gt);if(u===0)return 0;for(var f=0,d=-1,h=void 0,v=void 0,m=0;m<u;m++){var g=gt[m],p=g===0||g===1?.5:1,y=st(t,r,a,o,g);y<l||(d<0&&(d=bp(e,n,i,s,qt),qt[1]<qt[0]&&d>1&&kS(),h=st(e,n,i,s,qt[0]),d>1&&(v=st(e,n,i,s,qt[1]))),d===2?g<qt[0]?f+=h<e?p:-p:g<qt[1]?f+=v<h?p:-p:f+=s<v?p:-p:g<qt[0]?f+=h<e?p:-p:f+=s<h?p:-p)}return f}function CS(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,gt);if(l===0)return 0;var c=wp(e,n,i);if(c>=0&&c<=1){for(var u=0,f=xt(e,n,i,c),d=0;d<l;d++){var h=gt[d]===0||gt[d]===1?.5:1,v=xt(t,r,a,gt[d]);v<o||(gt[d]<c?u+=f<e?h:-h:u+=i<f?h:-h)}return u}else{var h=gt[0]===0||gt[0]===1?.5:1,v=xt(t,r,a,gt[0]);return v<o?0:i<e?h:-h}}function MS(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);gt[0]=-l,gt[1]=l;var c=Math.abs(n-a);if(c<1e-4)return 0;if(c>=Yn-1e-4){n=0,a=Yn;var u=i?1:-1;return o>=gt[0]+t&&o<=gt[1]+t?u:0}if(n>a){var f=n;n=a,a=f}n<0&&(n+=Yn,a+=Yn);for(var d=0,h=0;h<2;h++){var v=gt[h];if(v+t>o){var m=Math.atan2(s,v),u=i?1:-1;m<0&&(m=Yn+m),(m>=n&&m<=a||m+Yn>=n&&m+Yn<=a)&&(m>Math.PI/2&&m<Math.PI*1.5&&(u=-u),d+=u)}}return d}function Vp(t,e,r,n,a){for(var i=t.data,o=t.len(),s=0,l=0,c=0,u=0,f=0,d,h,v=0;v<o;){var m=i[v++],g=v===1;switch(m===cn.M&&v>1&&(r||(s+=$n(l,c,u,f,n,a))),g&&(l=i[v],c=i[v+1],u=l,f=c),m){case cn.M:u=i[v++],f=i[v++],l=u,c=f;break;case cn.L:if(r){if(Na(l,c,i[v],i[v+1],e,n,a))return!0}else s+=$n(l,c,i[v],i[v+1],n,a)||0;l=i[v++],c=i[v++];break;case cn.C:if(r){if(_S(l,c,i[v++],i[v++],i[v++],i[v++],i[v],i[v+1],e,n,a))return!0}else s+=TS(l,c,i[v++],i[v++],i[v++],i[v++],i[v],i[v+1],n,a)||0;l=i[v++],c=i[v++];break;case cn.Q:if(r){if(bS(l,c,i[v++],i[v++],i[v],i[v+1],e,n,a))return!0}else s+=CS(l,c,i[v++],i[v++],i[v],i[v+1],n,a)||0;l=i[v++],c=i[v++];break;case cn.A:var p=i[v++],y=i[v++],b=i[v++],x=i[v++],S=i[v++],w=i[v++];v+=1;var k=!!(1-i[v++]);d=Math.cos(S)*b+p,h=Math.sin(S)*x+y,g?(u=d,f=h):s+=$n(l,c,d,h,n,a);var T=(n-p)*x/b+p;if(r){if(xS(p,y,x,S,S+w,k,e,T,a))return!0}else s+=MS(p,y,x,S,S+w,k,T,a);l=Math.cos(S+w)*b+p,c=Math.sin(S+w)*x+y;break;case cn.R:u=l=i[v++],f=c=i[v++];var M=i[v++],D=i[v++];if(d=u+M,h=f+D,r){if(Na(u,f,d,f,e,n,a)||Na(d,f,d,h,e,n,a)||Na(d,h,u,h,e,n,a)||Na(u,h,u,f,e,n,a))return!0}else s+=$n(d,f,d,h,n,a),s+=$n(u,h,u,f,n,a);break;case cn.Z:if(r){if(Na(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&&!SS(c,f)&&(s+=$n(l,c,u,f,n,a)||0),s!==0}function AS(t,e,r){return Vp(t,0,!1,e,r)}function DS(t,e,r,n){return Vp(t,e,!0,r,n)}var Gp=De({fill:"#000",stroke:null,strokePercent:1,fillOpacity:1,strokeOpacity:1,lineDashOffset:0,lineWidth:1,lineCap:"butt",miterLimit:10,strokeNoScale:!1,strokeFirst:!1},zn),IS={style:De({fill:!0,stroke:!0,strokePercent:!0,fillOpacity:!0,strokeOpacity:!0,lineDashOffset:!0,lineWidth:!0,miterLimit:!0},Ns.style)},Yu=Pi.concat(["invisible","culling","z","z2","zlevel","parent"]),Ee=(function(t){G(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<Yu.length;++s)a[Yu[s]]=this[Yu[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?V(this.style,s):this.useStyle(s):o==="shape"?V(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(ie(r)){var n=Ms(r,0);return n>.5?Iu:n>.2?oS:Pu}else if(r)return Pu}return Iu},e.prototype.getInsideTextStroke=function(r){var n=this.style.fill;if(ie(n)){var a=this.__zr,i=!!(a&&a.isDarkMode()),o=Ms(r,0)<Du;if(i===o)return n}},e.prototype.buildPath=function(r,n,a){},e.prototype.pathUpdated=function(){this.__dirty&=~Ea},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 Un(!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&Ea)&&(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)),DS(s,l/c,r,n)))return!0}if(this.hasFill())return AS(s,r,n)}return!1},e.prototype.dirtyShape=function(){this.__dirty|=Ea,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:V(a,r),this.dirtyShape(),this},e.prototype.shapeChanged=function(){return!!(this.__dirty&Ea)},e.prototype.createStyle=function(r){return hs(Gp,r)},e.prototype._innerSaveToNormal=function(r){t.prototype._innerSaveToNormal.call(this,r);var n=this._normalState;r.shape&&!n.shape&&(n.shape=V({},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=V({},a.shape),V(c,n.shape)):(c=V({},i?this.shape:a.shape),V(c,n.shape)):l&&(c=a.shape),c)if(o){this.shape=V({},this.shape);for(var u={},f=Ge(c),d=0;d<f.length;d++){var h=f[d];typeof c[h]=="object"?this.shape[h]=c[h]:u[h]=c[h]}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 IS},e.prototype.isZeroArea=function(){return!1},e.extend=function(r){var n=(function(i){G(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 ye(r.style)},o.prototype.getDefaultShape=function(){return ye(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|Ni|Ea})(),e})(Bi),PS=De({strokeFirst:!0,font:Dn,x:0,y:0,textAlign:"left",textBaseline:"top",miterLimit:2},Gp),Vs=(function(t){G(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 hs(PS,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=fu(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})(Bi);Vs.prototype.type="tspan";var LS=De({x:0,y:0},zn),RS={style:De({x:!0,y:!0,width:!0,height:!0,sx:!0,sy:!0,sWidth:!0,sHeight:!0},Ns.style)};function ES(t){return!!(t&&typeof t!="string"&&t.width&&t.height)}var un=(function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.createStyle=function(r){return hs(LS,r)},e.prototype._getSize=function(r){var n=this.style,a=n[r];if(a!=null)return a;var i=ES(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 RS},e.prototype.getBoundingRect=function(){var r=this.style;return this._rect||(this._rect=new Pe(r.x||0,r.y||0,this.getWidth(),this.getHeight())),this._rect},e})(Bi);un.prototype.type="image";function OS(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 Ba=Math.round;function Wp(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&&(Ba(n*2)===Ba(a*2)&&(t.x1=t.x2=qn(n,s,!0)),Ba(i*2)===Ba(o*2)&&(t.y1=t.y2=qn(i,s,!0))),t}}function Up(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=qn(n,s,!0),t.y=qn(a,s,!0),t.width=Math.max(qn(n+i,s,!1)-t.x,i===0?0:1),t.height=Math.max(qn(a+o,s,!1)-t.y,o===0?0:1)),t}}function qn(t,e,r){if(!e)return t;var n=Ba(t*2);return(n+Ba(e))%2===0?n/2:(n+(r?1:-1))/2}var NS=(function(){function t(){this.x=0,this.y=0,this.width=0,this.height=0}return t})(),BS={},nt=(function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new NS},e.prototype.buildPath=function(r,n){var a,i,o,s;if(this.subPixelOptimize){var l=Up(BS,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?OS(r,n):r.rect(a,i,o,s)},e.prototype.isZeroArea=function(){return!this.shape.width||!this.shape.height},e})(Ee);nt.prototype.type="rect";var $p={fill:"#000"},Yp=2,zS={style:De({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},Ns.style)},wt=(function(t){G(e,t);function e(r){var n=t.call(this)||this;return n.type="text",n._children=[],n._defaultStyle=$p,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,WS(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 Pe(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||$p},e.prototype.setTextContent=function(r){},e.prototype._mergeStyle=function(r,n){if(!n)return r;var a=n.rich,i=r.rich||a&&{};return V(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]||{},V(r[o],n[o])}},e.prototype.getAnimationStyleProps=function(){return zS},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||Dn,a=r.padding,i=Jp(r),o=Iw(i,r),s=qu(r),l=!!r.backgroundColor,c=o.outerHeight,u=o.outerWidth,f=o.contentWidth,d=o.lines,h=o.lineHeight,v=this._defaultStyle;this.isTruncated=!!o.isTruncated;var m=r.x||0,g=r.y||0,p=r.align||v.align||"left",y=r.verticalAlign||v.verticalAlign||"top",b=m,x=Ca(g,o.contentHeight,y);if(s||a){var S=Ii(m,u,p),w=Ca(g,c,y);s&&this._renderBackground(r,r,S,w,u,c)}x+=h/2,a&&(b=Qp(m,p,a),y==="top"?x+=a[0]:y==="bottom"&&(x-=a[2]));for(var k=0,T=!1,M=jp("fill"in r?r.fill:(T=!0,v.fill)),D=Kp("stroke"in r?r.stroke:!l&&(!v.autoStroke||T)?(k=Yp,v.stroke):null),C=r.textShadowBlur>0,I=r.width!=null&&(r.overflow==="truncate"||r.overflow==="break"||r.overflow==="breakAll"),P=o.calculatedLineHeight,L=0;L<d.length;L++){var R=this._getOrCreateChild(Vs),N=R.createStyle();R.useStyle(N),N.text=d[L],N.x=b,N.y=x,N.textAlign=p,N.textBaseline="middle",N.opacity=r.opacity,N.strokeFirst=!0,C&&(N.shadowBlur=r.textShadowBlur||0,N.shadowColor=r.textShadowColor||"transparent",N.shadowOffsetX=r.textShadowOffsetX||0,N.shadowOffsetY=r.textShadowOffsetY||0),N.stroke=D,N.fill=M,D&&(N.lineWidth=r.lineWidth||k,N.lineDash=r.lineDash,N.lineDashOffset=r.lineDashOffset||0),N.font=n,Xp(N,r),x+=h,I&&R.setBoundingRect(new Pe(Ii(N.x,f,N.textAlign),Ca(N.y,P,N.textBaseline),f,P))}},e.prototype._updateRichTexts=function(){var r=this.style,n=Jp(r),a=Rw(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,d=r.align||f.align,h=r.verticalAlign||f.verticalAlign;this.isTruncated=!!a.isTruncated;var v=Ii(c,o,d),m=Ca(u,s,h),g=v,p=m;l&&(g+=l[3],p+=l[0]);var y=g+i;qu(r)&&this._renderBackground(r,r,v,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,D=0,C=g,I=y,P=k-1,L=void 0;D<k&&(L=w[D],!L.align||L.align==="left");)this._placeToken(L,r,T,p,C,"left",b),M-=L.width,C+=L.width,D++;for(;P>=0&&(L=w[P],L.align==="right");)this._placeToken(L,r,T,p,I,"right",b),M-=L.width,I-=L.width,P--;for(C+=(i-(C-g)-(y-I)-M)/2;D<=P;)L=w[D],this._placeToken(L,r,T,p,C+L.width/2,"center",b),C+=L.width,D++;p+=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 d=!r.isLineHolder&&qu(c);d&&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 h=!!c.backgroundColor,v=r.textPadding;v&&(o=Qp(o,s,v),f-=r.height/2-v[0]-r.innerHeight/2);var m=this._getOrCreateChild(Vs),g=m.createStyle();m.useStyle(g);var p=this._defaultStyle,y=!1,b=0,x=jp("fill"in c?c.fill:"fill"in n?n.fill:(y=!0,p.fill)),S=Kp("stroke"in c?c.stroke:"stroke"in n?n.stroke:!h&&!l&&(!p.autoStroke||y)?(b=Yp,p.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||Dn,g.opacity=fs(c.opacity,n.opacity,1),Xp(g,c),S&&(g.lineWidth=fs(c.lineWidth,n.lineWidth,b),g.lineDash=_e(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 Pe(Ii(g.x,k,g.textAlign),Ca(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,d=l&&!f,h=r.borderRadius,v=this,m,g;if(d||r.lineHeight||c&&u){m=this._getOrCreateChild(nt),m.useStyle(m.createStyle()),m.style.fill=null;var p=m.shape;p.x=a,p.y=i,p.width=o,p.height=s,p.r=h,m.dirtyShape()}if(d){var y=m.style;y.fill=l||null,y.fillOpacity=_e(r.fillOpacity,1)}else if(f){g=this._getOrCreateChild(un),g.onload=function(){v.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=_e(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=fs(r.opacity,n.opacity,1)},e.makeFont=function(r){var n="";return GS(r)&&(n=[r.fontStyle,r.fontWeight,VS(r.fontSize),r.fontFamily||"sans-serif"].join(" ")),n&&_r(n)||r.textFont||r.font},e})(Bi),FS={left:!0,right:1,center:1},HS={top:1,bottom:1,middle:1},qp=["fontStyle","fontWeight","fontSize","fontFamily"];function VS(t){return typeof t=="string"&&(t.indexOf("px")!==-1||t.indexOf("rem")!==-1||t.indexOf("em")!==-1)?t:isNaN(+t)?Qc+"px":t+"px"}function Xp(t,e){for(var r=0;r<qp.length;r++){var n=qp[r],a=e[n];a!=null&&(t[n]=a)}}function GS(t){return t.fontSize!=null||t.fontFamily||t.fontWeight}function WS(t){return Zp(t),A(t.rich,Zp),t}function Zp(t){if(t){t.font=wt.makeFont(t);var e=t.align;e==="middle"&&(e="center"),t.align=e==null||FS[e]?e:"left";var r=t.verticalAlign;r==="center"&&(r="middle"),t.verticalAlign=r==null||HS[r]?r:"top";var n=t.padding;n&&(t.padding=Qv(t.padding))}}function Kp(t,e){return t==null||e<=0||t==="transparent"||t==="none"?null:t.image||t.colorStops?"#000":t}function jp(t){return t==null||t==="none"?null:t.image||t.colorStops?"#000":t}function Qp(t,e,r){return e==="right"?t-r[1]:e==="center"?t+r[3]/2-r[1]/2:t+r[3]}function Jp(t){var e=t.text;return e!=null&&(e+=""),e}function qu(t){return!!(t.backgroundColor||t.lineHeight||t.borderWidth&&t.borderColor)}var eg=1e-4,tg=20;function US(t){return t.replace(/^\s+|\s+$/g,"")}function Xn(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 mt(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 ie(t)?US(t).match(/%$/)?parseFloat(t)/100*e:parseFloat(t):t==null?NaN:+t}function Je(t,e,r){return e==null&&(e=10),e=Math.min(Math.max(0,e),tg),t=(+t).toFixed(e),r?t:+t}function $S(t){return t.sort(function(e,r){return e-r}),t}function Vr(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 YS(t)}function YS(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 rg(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(Vr(t),Vr(e)),n=t+e;return r>tg?n:Je(n,r)}function ng(t){var e=Math.PI*2;return(t%e+e)%e}function Gs(t){return t>-eg&&t<eg}var XS=/^(?:(\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 Gr(t){if(t instanceof Date)return t;if(ie(t)){var e=XS.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 ZS(t){return Math.pow(10,Xu(t))}function Xu(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 ag(t,e){var r=Xu(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 Ws(t){var e=parseFloat(t);return e==t&&(e!==0||!ie(t)||t.indexOf("x")<=0)?e:NaN}function KS(t){return!isNaN(Ws(t))}function ig(){return Math.round(Math.random()*9)}function og(t,e){return e===0?t:og(e,t%e)}function sg(t,e){return t==null?e:e==null?t:t*e/og(t,e)}function St(t){throw new Error(t)}function lg(t,e,r){return(e-t)*r+t}var cg="series\0",jS="\0_ec_\0";function ut(t){return t instanceof Array?t:t==null?[]:[t]}function ug(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 fg=["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 Hi(t){return ce(t)&&!ee(t)&&!(t instanceof Date)?t.value:t}function QS(t){return ce(t)&&!(t instanceof Array)}function JS(t,e,r){var n=r==="normalMerge",a=r==="replaceMerge",i=r==="replaceAll";t=t||[],e=(e||[]).slice();var o=fe();A(e,function(l,c){if(!ce(l)){e[c]=null;return}});var s=ek(t,o,r);return(n||a)&&tk(s,t,o,e),n&&rk(s,e),n||a?nk(s,e,a):i&&ak(s,e),ik(s),s}function ek(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"||Gi(i)?null:i,newOption:null,keyInfo:null,brandNew:null})}return n}function tk(t,e,r,n){A(n,function(a,i){if(!(!a||a.id==null)){var o=Vi(a.id),s=r.get(o);if(s!=null){var l=t[s];Br(!l.newOption,'Duplicated option on id "'+o+'".'),l.newOption=a,l.existing=e[s],n[i]=null}}})}function rk(t,e){A(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)&&!Gi(r)&&!Gi(i)&&hg("name",i,r)){t[a].newOption=r,e[n]=null;return}}})}function nk(t,e,r){A(e,function(n){if(n){for(var a,i=0;(a=t[i])&&(a.newOption||Gi(a.existing)||a.existing&&n.id!=null&&!hg("id",n,a.existing));)i++;a?(a.newOption=n,a.brandNew=r):t.push({newOption:n,brandNew:r,existing:null,keyInfo:null}),i++}})}function ak(t,e){A(e,function(r){t.push({newOption:r,brandNew:!0,existing:null,keyInfo:null})})}function ik(t){var e=fe();A(t,function(r){var n=r.existing;n&&e.set(n.id,r)}),A(t,function(r){var n=r.newOption;Br(!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={})}),A(t,function(r,n){var a=r.existing,i=r.newOption,o=r.keyInfo;if(ce(i)){if(o.name=i.name!=null?Vi(i.name):a?a.name:cg+n,a)o.id=Vi(a.id);else if(i.id!=null)o.id=Vi(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 hg(t,e,r){var n=Tr(e[t],null),a=Tr(r[t],null);return n!=null&&a!=null&&n===a}function Vi(t){return Tr(t,"")}function Tr(t,e){return t==null?e:ie(t)?t:He(t)||ru(t)?t+"":e}function Zu(t){var e=t.name;return!!(e&&e.indexOf(cg))}function Gi(t){return t&&t.id!=null&&Vi(t.id).indexOf(jS)===0}function ok(t,e,r){A(t,function(n){var a=n.newOption;ce(a)&&(n.keyInfo.mainType=e,n.keyInfo.subType=sk(e,a,n.existing,r))})}function sk(t,e,r,n){var a=e.type?e.type:r?r.subType:n.determineSubType(t,e);return a}function Zn(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 Xe(){var t="__ec_inner_"+lk++;return function(e){return e[t]||(e[t]={})}}var lk=ig();function Ku(t,e,r){var n=ju(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=Wi(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 ju(t,e){var r;if(ie(t)){var n={};n[t+"Index"]=0,r=n}else r=t;var a=fe(),i={},o=!1;return A(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&&Ie(e.includeMainTypes,u)<0)){o=o||!!u;var d=a.get(u)||a.set(u,{});d[f]=s}}),{mainTypeSpecified:o,queryOptionMap:a,others:i}}var kt={useDefault:!0,enableAll:!1,enableNone:!1},ck={useDefault:!1,enableAll:!0,enableNone:!0};function Wi(t,e,r,n){n=n||kt;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?(Br(n.enableNone,'`"none"` or `false` is not a valid value on index option.'),s.models=[],s):(a==="all"&&(Br(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 dg(t,e,r){t.setAttribute?t.setAttribute(e,r):t[e]=r}function uk(t,e){return t.getAttribute?t.getAttribute(e):t[e]}function fk(t){return t==="auto"?he.domSupported?"html":"richText":t||"html"}function hk(t,e,r,n,a){var i=e==null||e==="auto";if(n==null)return n;if(He(n)){var o=lg(r||0,n,a);return Je(o,i?Math.max(Vr(r||0),Vr(n)):e)}else{if(ie(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 d=t.getDimensionInfo(f);if(d&&d.type==="ordinal")s[f]=(a<1&&l?l:c)[f];else{var h=l&&l[f]?l[f]:0,v=c[f],o=lg(h,v,a);s[f]=Je(o,i?Math.max(Vr(h),Vr(v)):e)}}return s}}var Re=Xe(),dk=function(t,e,r,n){if(n){var a=Re(n);a.dataIndex=r,a.dataType=e,a.seriesIndex=t,a.ssrType="chart",n.type==="group"&&n.traverse(function(i){var o=Re(i);o.seriesIndex=t,o.dataIndex=r,o.dataType=e,o.ssrType="chart"})}},vg=1,pg={},gg=Xe(),Qu=Xe(),Ju=0,Us=1,$s=2,Cr=["emphasis","blur","select"],mg=["normal","emphasis","blur","select"],vk=10,pk=9,Kn="highlight",Ys="downplay",Ui="select",qs="unselect",$i="toggleSelect";function za(t){return t!=null&&t!=="none"}function Xs(t,e,r){t.onHoverStateChange&&(t.hoverState||0)!==r&&t.onHoverStateChange(e),t.hoverState=r}function yg(t){Xs(t,"emphasis",$s)}function _g(t){t.hoverState===$s&&Xs(t,"normal",Ju)}function ef(t){Xs(t,"blur",Us)}function bg(t){t.hoverState===Us&&Xs(t,"normal",Ju)}function gk(t){t.selected=!0}function mk(t){t.selected=!1}function xg(t,e,r){e(t,r)}function Wr(t,e,r){xg(t,e,r),t.isGroup&&t.traverse(function(n){xg(n,e,r)})}function wg(t,e){switch(e){case"emphasis":t.hoverState=$s;break;case"normal":t.hoverState=Ju;break;case"blur":t.hoverState=Us;break;case"select":t.selected=!0}}function yk(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 _k(t,e,r,n){var a=r&&Ie(r,"select")>=0,i=!1;if(t instanceof Ee){var o=gg(t),s=a&&o.selectFill||o.normalFill,l=a&&o.selectStroke||o.normalStroke;if(za(s)||za(l)){n=n||{};var c=n.style||{};c.fill==="inherit"?(i=!0,n=V({},n),c=V({},c),c.fill=s):!za(c.fill)&&za(s)?(i=!0,n=V({},n),c=V({},c),c.fill=Dp(s)):!za(c.stroke)&&za(l)&&(i||(n=V({},n),c=V({},c)),c.stroke=Dp(l)),n.style=c}}if(n&&n.z2==null){i||(n=V({},n));var u=t.z2EmphasisLift;n.z2=t.z2+(u??vk)}return n}function bk(t,e,r){if(r&&r.z2==null){r=V({},r);var n=t.z2SelectLift;r.z2=t.z2+(n??pk)}return r}function xk(t,e,r){var n=Ie(t.currentStates,e)>=0,a=t.style.opacity,i=n?null:yk(t,["opacity"],e,{opacity:1});r=r||{};var o=r.style||{};return o.opacity==null&&(r=V({},r),o=V({opacity:n?a:i.opacity*.1},o),r.style=o),r}function tf(t,e){var r=this.states[t];if(this.style){if(t==="emphasis")return _k(this,t,e,r);if(t==="blur")return xk(this,t,r);if(t==="select")return bk(this,t,r)}return r}function wk(t){t.stateProxy=tf;var e=t.getTextContent(),r=t.getTextGuideLine();e&&(e.stateProxy=tf),r&&(r.stateProxy=tf)}function Sg(t,e){!Ag(t,e)&&!t.__highByOuter&&Wr(t,yg)}function kg(t,e){!Ag(t,e)&&!t.__highByOuter&&Wr(t,_g)}function Zs(t,e){t.__highByOuter|=1<<(e||0),Wr(t,yg)}function Ks(t,e){!(t.__highByOuter&=~(1<<(e||0)))&&Wr(t,_g)}function Sk(t){Wr(t,ef)}function Tg(t){Wr(t,bg)}function Cg(t){Wr(t,gk)}function Mg(t){Wr(t,mk)}function Ag(t,e){return t.__highDownSilentOnTouch&&e.zrByTouch}function Dg(t){var e=t.getModel(),r=[],n=[];e.eachComponent(function(a,i){var o=Qu(i),s=a==="series",l=s?t.getViewOfSeriesModel(i):t.getViewOfComponentModel(i);!s&&n.push(l),o.isBlured&&(l.group.traverse(function(c){bg(c)}),s&&r.push(i)),o.isBlured=!1}),A(n,function(a){a&&a.toggleBlurSeries&&a.toggleBlurSeries(r,!1,e)})}function rf(t,e,r,n){var a=n.getModel();r=r||"coordinateSystem";function i(c,u){for(var f=0;f<u.length;f++){var d=c.getItemGraphicEl(u[f]);d&&Tg(d)}}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 d=f&&s?f===s:u;if(!(r==="series"&&!u||r==="coordinateSystem"&&!d||e==="series"&&u)){var h=n.getViewOfSeriesModel(c);if(h.group.traverse(function(g){g.__highByOuter&&u&&e==="self"||ef(g)}),_t(e))i(c.getData(),e);else if(ce(e))for(var v=Ge(e),m=0;m<v.length;m++)i(c.getData(v[m]),e[v[m]]);l.push(c),Qu(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 nf(t,e,r){if(!(t==null||e==null)){var n=r.getModel().getComponent(t,e);if(n){Qu(n).isBlured=!0;var a=r.getViewOfComponentModel(n);!a||!a.focusBlurEnabled||a.group.traverse(function(i){ef(i)})}}}function kk(t,e,r){var n=t.seriesIndex,a=t.getData(e.dataType);if(a){var i=Zn(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=Re(o);rf(n,c.focus,c.blurScope,r)}else{var u=t.get(["emphasis","focus"]),f=t.get(["emphasis","blurScope"]);u!=null&&rf(n,u,f,r)}}}function af(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(Re(s[c]).focus==="self"){l=!0;break}return{focusSelf:l,dispatchers:s}}function Tk(t,e,r){var n=Re(t),a=af(n.componentMainType,n.componentIndex,n.componentHighDownName,r),i=a.dispatchers,o=a.focusSelf;i?(o&&nf(n.componentMainType,n.componentIndex,r),A(i,function(s){return Sg(s,e)})):(rf(n.seriesIndex,n.focus,n.blurScope,r),n.focus==="self"&&nf(n.componentMainType,n.componentIndex,r),Sg(t,e))}function Ck(t,e,r){Dg(r);var n=Re(t),a=af(n.componentMainType,n.componentIndex,n.componentHighDownName,r).dispatchers;a?A(a,function(i){return kg(i,e)}):kg(t,e)}function Mk(t,e,r){if(cf(e)){var n=e.dataType,a=t.getData(n),i=Zn(a,e);ee(i)||(i=[i]),t[e.type===$i?"toggleSelect":e.type===Ui?"select":"unselect"](i,n)}}function Ig(t){var e=t.getAllData();A(e,function(r){var n=r.data,a=r.type;n.eachItemGraphicEl(function(i,o){t.isSelected(o,a)?Cg(i):Mg(i)})})}function Ak(t){var e=[];return t.eachSeries(function(r){var n=r.getAllData();A(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 of(t,e,r){Lg(t,!0),Wr(t,wk),Ik(t,e,r)}function Dk(t){Lg(t,!1)}function js(t,e,r,n){n?Dk(t):of(t,e,r)}function Ik(t,e,r){var n=Re(t);e!=null?(n.focus=e,n.blurScope=r):n.focus&&(n.focus=null)}var Pg=["emphasis","blur","select"],Pk={itemStyle:"getItemStyle",lineStyle:"getLineStyle",areaStyle:"getAreaStyle"};function sf(t,e,r,n){r=r||"itemStyle";for(var a=0;a<Pg.length;a++){var i=Pg[a],o=e.getModel([i,r]),s=t.ensureState(i);s.style=o[Pk[r]]()}}function Lg(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 lf(t){return!!(t&&t.__highDownDispatcher)}function Lk(t){var e=pg[t];return e==null&&vg<=32&&(e=pg[t]=vg++),e}function cf(t){var e=t.type;return e===Ui||e===qs||e===$i}function Rg(t){var e=t.type;return e===Kn||e===Ys}function Rk(t){var e=gg(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 Fa=Un.CMD,Ek=[[],[],[]],Eg=Math.sqrt,Ok=Math.atan2;function Nk(t,e){if(e){var r=t.data,n=t.len(),a,i,o,s,l,c,u=Fa.M,f=Fa.C,d=Fa.L,h=Fa.R,v=Fa.A,m=Fa.Q;for(o=0,s=0;o<n;){switch(a=r[o++],s=o,i=0,a){case u:i=1;break;case d:i=1;break;case f:i=3;break;case m:i=2;break;case v:var g=e[4],p=e[5],y=Eg(e[0]*e[0]+e[1]*e[1]),b=Eg(e[2]*e[2]+e[3]*e[3]),x=Ok(-e[1]/b,e[0]/y);r[o]*=y,r[o++]+=g,r[o]*=b,r[o++]+=p,r[o++]*=y,r[o++]*=b,r[o++]+=x,r[o++]+=x,o+=2,s=o;break;case h: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=Ek[l];S[0]=r[o++],S[1]=r[o++],Gt(S,S,e),r[s++]=S[0],r[s++]=S[1]}}t.increaseVersion()}}var uf=Math.sqrt,Qs=Math.sin,Js=Math.cos,Yi=Math.PI;function Og(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])}function ff(t,e){return(t[0]*e[0]+t[1]*e[1])/(Og(t)*Og(e))}function Ng(t,e){return(t[0]*e[1]<t[1]*e[0]?-1:1)*Math.acos(ff(t,e))}function Bg(t,e,r,n,a,i,o,s,l,c,u){var f=l*(Yi/180),d=Js(f)*(t-r)/2+Qs(f)*(e-n)/2,h=-1*Qs(f)*(t-r)/2+Js(f)*(e-n)/2,v=d*d/(o*o)+h*h/(s*s);v>1&&(o*=uf(v),s*=uf(v));var m=(a===i?-1:1)*uf((o*o*(s*s)-o*o*(h*h)-s*s*(d*d))/(o*o*(h*h)+s*s*(d*d)))||0,g=m*o*h/s,p=m*-s*d/o,y=(t+r)/2+Js(f)*g-Qs(f)*p,b=(e+n)/2+Qs(f)*g+Js(f)*p,x=Ng([1,0],[(d-g)/o,(h-p)/s]),S=[(d-g)/o,(h-p)/s],w=[(-1*d-g)/o,(-1*h-p)/s],k=Ng(S,w);if(ff(S,w)<=-1&&(k=Yi),ff(S,w)>=1&&(k=0),k<0){var T=Math.round(k/Yi*1e6)/1e6;k=Yi*2+T%2*Yi}u.addData(c,y,b,o,s,x,k,f,i)}var Bk=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/ig,zk=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function Fk(t){var e=new Un;if(!t)return e;var r=0,n=0,a=r,i=n,o,s=Un.CMD,l=t.match(Bk);if(!l)return e;for(var c=0;c<l.length;c++){for(var u=l[c],f=u.charAt(0),d=void 0,h=u.match(zk)||[],v=h.length,m=0;m<v;m++)h[m]=parseFloat(h[m]);for(var g=0;g<v;){var p=void 0,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0,k=void 0,T=r,M=n,D=void 0,C=void 0;switch(f){case"l":r+=h[g++],n+=h[g++],d=s.L,e.addData(d,r,n);break;case"L":r=h[g++],n=h[g++],d=s.L,e.addData(d,r,n);break;case"m":r+=h[g++],n+=h[g++],d=s.M,e.addData(d,r,n),a=r,i=n,f="l";break;case"M":r=h[g++],n=h[g++],d=s.M,e.addData(d,r,n),a=r,i=n,f="L";break;case"h":r+=h[g++],d=s.L,e.addData(d,r,n);break;case"H":r=h[g++],d=s.L,e.addData(d,r,n);break;case"v":n+=h[g++],d=s.L,e.addData(d,r,n);break;case"V":n=h[g++],d=s.L,e.addData(d,r,n);break;case"C":d=s.C,e.addData(d,h[g++],h[g++],h[g++],h[g++],h[g++],h[g++]),r=h[g-2],n=h[g-1];break;case"c":d=s.C,e.addData(d,h[g++]+r,h[g++]+n,h[g++]+r,h[g++]+n,h[g++]+r,h[g++]+n),r+=h[g-2],n+=h[g-1];break;case"S":p=r,y=n,D=e.len(),C=e.data,o===s.C&&(p+=r-C[D-4],y+=n-C[D-3]),d=s.C,T=h[g++],M=h[g++],r=h[g++],n=h[g++],e.addData(d,p,y,T,M,r,n);break;case"s":p=r,y=n,D=e.len(),C=e.data,o===s.C&&(p+=r-C[D-4],y+=n-C[D-3]),d=s.C,T=r+h[g++],M=n+h[g++],r+=h[g++],n+=h[g++],e.addData(d,p,y,T,M,r,n);break;case"Q":T=h[g++],M=h[g++],r=h[g++],n=h[g++],d=s.Q,e.addData(d,T,M,r,n);break;case"q":T=h[g++]+r,M=h[g++]+n,r+=h[g++],n+=h[g++],d=s.Q,e.addData(d,T,M,r,n);break;case"T":p=r,y=n,D=e.len(),C=e.data,o===s.Q&&(p+=r-C[D-4],y+=n-C[D-3]),r=h[g++],n=h[g++],d=s.Q,e.addData(d,p,y,r,n);break;case"t":p=r,y=n,D=e.len(),C=e.data,o===s.Q&&(p+=r-C[D-4],y+=n-C[D-3]),r+=h[g++],n+=h[g++],d=s.Q,e.addData(d,p,y,r,n);break;case"A":b=h[g++],x=h[g++],S=h[g++],w=h[g++],k=h[g++],T=r,M=n,r=h[g++],n=h[g++],d=s.A,Bg(T,M,r,n,w,k,b,x,S,d,e);break;case"a":b=h[g++],x=h[g++],S=h[g++],w=h[g++],k=h[g++],T=r,M=n,r+=h[g++],n+=h[g++],d=s.A,Bg(T,M,r,n,w,k,b,x,S,d,e);break}}(f==="z"||f==="Z")&&(d=s.Z,e.addData(d),r=a,n=i),o=d}return e.toStatic(),e}var zg=(function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.applyTransform=function(r){},e})(Ee);function Fg(t){return t.setData!=null}function Hg(t,e){var r=Fk(t),n=V({},e);return n.buildPath=function(a){if(Fg(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){Nk(r,a),this.dirtyShape()},n}function Hk(t,e){return new zg(Hg(t,e))}function Vk(t,e){var r=Hg(t,e),n=(function(a){G(i,a);function i(o){var s=a.call(this,o)||this;return s.applyTransform=r.applyTransform,s.buildPath=r.buildPath,s}return i})(zg);return n}function Gk(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 Ee(e);return o.createPathProxy(),o.buildPath=function(s){if(Fg(s)){s.appendPath(r);var l=s.getContext();l&&s.rebuildPath(l,1)}},o}var lt=(function(t){G(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=Ie(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=Ie(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 Pe(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?(Pe.applyTransform(n,c,u),o=o||n.clone(),o.union(n)):(o=o||c.clone(),o.union(c))}}return o||n},e})(Os);lt.prototype.type="group";var Wk=(function(){function t(){this.cx=0,this.cy=0,this.r=0}return t})(),el=(function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Wk},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})(Ee);el.prototype.type="circle";var Uk=(function(){function t(){this.cx=0,this.cy=0,this.rx=0,this.ry=0}return t})(),hf=(function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Uk},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})(Ee);hf.prototype.type="ellipse";var Vg=Math.PI,df=Vg*2,jn=Math.sin,Ha=Math.cos,$k=Math.acos,ft=Math.atan2,Gg=Math.abs,qi=Math.sqrt,Xi=Math.max,Mr=Math.min,nr=1e-4;function Yk(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,d=f*l-u*c;if(!(d*d<nr))return d=(u*(e-i)-f*(t-a))/d,[t+d*l,e+d*c]}function tl(t,e,r,n,a,i,o){var s=t-r,l=e-n,c=(o?i:-i)/qi(s*s+l*l),u=c*l,f=-c*s,d=t+u,h=e+f,v=r+u,m=n+f,g=(d+v)/2,p=(h+m)/2,y=v-d,b=m-h,x=y*y+b*b,S=a-i,w=d*m-v*h,k=(b<0?-1:1)*qi(Xi(0,S*S*x-w*w)),T=(w*b-y*k)/x,M=(-w*y-b*k)/x,D=(w*b+y*k)/x,C=(-w*y+b*k)/x,I=T-g,P=M-p,L=D-g,R=C-p;return I*I+P*P>L*L+R*R&&(T=D,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(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 Xk(t,e){var r,n=Xi(e.r,0),a=Xi(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,d=!!e.clockwise,h=Gg(c-l),v=h>df&&h%df;if(v>nr&&(h=v),!(n>nr))t.moveTo(u,f);else if(h>df-nr)t.moveTo(u+n*Ha(l),f+n*jn(l)),t.arc(u,f,n,l,c,!d),a>nr&&(t.moveTo(u+a*Ha(c),f+a*jn(c)),t.arc(u,f,a,c,l,d));else{var m=void 0,g=void 0,p=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,D=void 0,C=void 0,I=void 0,P=void 0,L=void 0,R=n*Ha(l),N=n*jn(l),Z=a*Ha(c),F=a*jn(c),z=h>nr;if(z){var W=e.cornerRadius;W&&(r=qk(W),m=r[0],g=r[1],p=r[2],y=r[3]);var ne=Gg(n-a)/2;if(b=Mr(ne,p),x=Mr(ne,y),S=Mr(ne,m),w=Mr(ne,g),M=k=Xi(b,x),D=T=Xi(S,w),(k>nr||T>nr)&&(C=n*Ha(c),I=n*jn(c),P=a*Ha(l),L=a*jn(l),h<Vg)){var te=Yk(R,N,P,L,C,I,Z,F);if(te){var de=R-te[0],be=N-te[1],xe=C-te[0],et=I-te[1],at=1/jn($k((de*xe+be*et)/(qi(de*de+be*be)*qi(xe*xe+et*et)))/2),Ye=qi(te[0]*te[0]+te[1]*te[1]);M=Mr(k,(n-Ye)/(at+1)),D=Mr(T,(a-Ye)/(at-1))}}}if(!z)t.moveTo(u+R,f+N);else if(M>nr){var X=Mr(p,M),le=Mr(y,M),Y=tl(P,L,R,N,n,X,d),q=tl(C,I,Z,F,n,le,d);t.moveTo(u+Y.cx+Y.x0,f+Y.cy+Y.y0),M<k&&X===le?t.arc(u+Y.cx,f+Y.cy,M,ft(Y.y0,Y.x0),ft(q.y0,q.x0),!d):(X>0&&t.arc(u+Y.cx,f+Y.cy,X,ft(Y.y0,Y.x0),ft(Y.y1,Y.x1),!d),t.arc(u,f,n,ft(Y.cy+Y.y1,Y.cx+Y.x1),ft(q.cy+q.y1,q.cx+q.x1),!d),le>0&&t.arc(u+q.cx,f+q.cy,le,ft(q.y1,q.x1),ft(q.y0,q.x0),!d))}else t.moveTo(u+R,f+N),t.arc(u,f,n,l,c,!d);if(!(a>nr)||!z)t.lineTo(u+Z,f+F);else if(D>nr){var X=Mr(m,D),le=Mr(g,D),Y=tl(Z,F,C,I,a,-le,d),q=tl(R,N,P,L,a,-X,d);t.lineTo(u+Y.cx+Y.x0,f+Y.cy+Y.y0),D<T&&X===le?t.arc(u+Y.cx,f+Y.cy,D,ft(Y.y0,Y.x0),ft(q.y0,q.x0),!d):(le>0&&t.arc(u+Y.cx,f+Y.cy,le,ft(Y.y0,Y.x0),ft(Y.y1,Y.x1),!d),t.arc(u,f,a,ft(Y.cy+Y.y1,Y.cx+Y.x1),ft(q.cy+q.y1,q.cx+q.x1),d),X>0&&t.arc(u+q.cx,f+q.cy,X,ft(q.y1,q.x1),ft(q.y0,q.x0),!d))}else t.lineTo(u+Z,f+F),t.arc(u,f,a,c,l,d)}t.closePath()}}}var Zk=(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})(),Va=(function(t){G(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){Xk(r,n)},e.prototype.isZeroArea=function(){return this.shape.startAngle===this.shape.endAngle||this.shape.r===this.shape.r0},e})(Ee);Va.prototype.type="sector";var Kk=(function(){function t(){this.cx=0,this.cy=0,this.r=0,this.r0=0}return t})(),vf=(function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Kk},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})(Ee);vf.prototype.type="ring";function jk(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 d=0,h=t.length;d<h;d++)Da(u,u,t[d]),Ia(f,f,t[d]);Da(u,u,n[0]),Ia(f,f,n[1])}for(var d=0,h=t.length;d<h;d++){var v=t[d];if(r)l=t[d?d-1:h-1],c=t[(d+1)%h];else if(d===0||d===h-1){a.push(Bw(t[d]));continue}else l=t[d-1],c=t[d+1];zw(i,c,l),pu(i,i,e);var m=gu(v,l),g=gu(v,c),p=m+g;p!==0&&(m/=p,g/=p),pu(o,i,-m),pu(s,i,g);var y=dp([],v,o),b=dp([],v,s);n&&(Ia(y,y,u),Da(y,y,f),Ia(b,b,u),Da(b,b,f)),a.push(y),a.push(b)}return r&&a.push(a.shift()),a}function Wg(t,e,r){var n=e.smooth,a=e.points;if(a&&a.length>=2){if(n){var i=jk(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 Qk=(function(){function t(){this.points=null,this.smooth=0,this.smoothConstraint=null}return t})(),pf=(function(t){G(e,t);function e(r){return t.call(this,r)||this}return e.prototype.getDefaultShape=function(){return new Qk},e.prototype.buildPath=function(r,n){Wg(r,n,!0)},e})(Ee);pf.prototype.type="polygon";var Jk=(function(){function t(){this.points=null,this.percent=1,this.smooth=0,this.smoothConstraint=null}return t})(),gf=(function(t){G(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 Jk},e.prototype.buildPath=function(r,n){Wg(r,n,!1)},e})(Ee);gf.prototype.type="polyline";var eT={},tT=(function(){function t(){this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.percent=1}return t})(),fn=(function(t){G(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,i,o,s;if(this.subPixelOptimize){var l=Wp(eT,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})(Ee);fn.prototype.type="line";var Tt=[],rT=(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?_p:st)(t.x1,t.cpx1,t.cpx2,t.x2,e),(r?_p:st)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(r?xp:xt)(t.x1,t.cpx1,t.x2,e),(r?xp:xt)(t.y1,t.cpy1,t.y2,e)]}var mf=(function(t){G(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 rT},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,d=n.percent;d!==0&&(r.moveTo(a,i),u==null||f==null?(d<1&&(Ss(a,l,o,d,Tt),l=Tt[1],o=Tt[2],Ss(i,c,s,d,Tt),c=Tt[1],s=Tt[2]),r.quadraticCurveTo(l,c,o,s)):(d<1&&(ws(a,l,u,o,d,Tt),l=Tt[1],u=Tt[2],o=Tt[3],ws(i,c,f,s,d,Tt),c=Tt[1],f=Tt[2],s=Tt[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 Vw(n,n)},e})(Ee);mf.prototype.type="bezier-curve";var nT=(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})(),rl=(function(t){G(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 nT},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})(Ee);rl.prototype.type="arc";var aT=(function(t){G(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),Ee.prototype.getBoundingRect.call(this)},e})(Ee),$g=(function(){function t(e){this.colorStops=e||[]}return t.prototype.addColorStop=function(e,r){this.colorStops.push({offset:e,color:r})},t})(),Yg=(function(t){G(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})($g),iT=(function(t){G(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})($g),Qn=[0,0],Jn=[0,0],nl=new Be,al=new Be,il=(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 nl.set(1/0,1/0),al.set(0,0),!this._intersectCheckOneSide(this,e,nl,al,a,1)&&(n=!1,a)||!this._intersectCheckOneSide(e,this,nl,al,a,-1)&&(n=!1,a)||a||Be.copy(r,n?nl:al),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,Qn),this._getProjMinMaxOnAxis(l,r._corners,Jn),Qn[1]<Jn[0]||Qn[0]>Jn[1]){if(s=!1,i)return s;var u=Math.abs(Jn[0]-Qn[1]),f=Math.abs(Qn[0]-Jn[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(Jn[0]-Qn[1]),f=Math.abs(Qn[0]-Jn[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})(),oT=[],sT=(function(t){G(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 Pe(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(oT)),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})(Bi),lT=Xe();function cT(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=_e(n.duration,200),u=_e(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)),ge(f)&&(f=f(r,a)),ge(c)&&(c=c(r));var d={duration:c||0,delay:f,easing:u};return d}else return null}function yf(t,e,r,n,a,i,o){var s=!1,l;ge(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=cT(t,n,a,c?l||{}:null,n&&n.getAnimationDelayParams?n.getAnimationDelayParams(e,a):null);if(u&&u.duration>0){var f=u.duration,d=u.delay,h=u.easing,v={duration:f,delay:d||0,easing:h,done:i,force:!!i||!!o,setToFinal:!c,scope:t,during:o};s?e.animateFrom(r,v):e.animateTo(r,v)}else e.stopAnimation(),!s&&e.attr(r),o&&o(1),i&&i()}function Nt(t,e,r,n,a,i){yf("update",t,e,r,n,a,i)}function Ur(t,e,r,n,a,i){yf("enter",t,e,r,n,a,i)}function Zi(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 ol(t,e,r,n,a,i){Zi(t)||yf("leave",t,e,r,n,a,i)}function qg(t,e,r,n){t.removeTextContent(),t.removeTextGuideLine(),ol(t,{style:{opacity:0}},e,r,n)}function _f(t,e,r){function n(){t.parent&&t.parent.remove(t)}t.isGroup?t.traverse(function(a){a.isGroup||qg(a,e,r,n)}):qg(t,e,r,n)}function Xg(t){lT(t).oldStyle=t.style}var sl=Math.max,ll=Math.min,bf={};function uT(t){return Ee.extend(t)}var fT=Vk;function hT(t,e){return fT(t,e)}function ar(t,e){bf[t]=e}function dT(t){if(bf.hasOwnProperty(t))return bf[t]}function xf(t,e,r,n){var a=Hk(t,e);return r&&(n==="center"&&(r=Kg(r,a.getBoundingRect())),jg(a,r)),a}function Zg(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(Kg(e,i))}}});return n}function Kg(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 vT=Gk;function jg(t,e){if(t.applyTransform){var r=t.getBoundingRect(),n=r.calculateTransform(e);t.applyTransform(n)}}function Ki(t,e){return Wp(t,t,{lineWidth:e}),t}function pT(t){return Up(t.shape,t.shape,t.style),t}var gT=qn;function mT(t,e){for(var r=su([]);t&&t!==e;)Ta(r,t.getLocalTransform(),r),t=t.parent;return r}function wf(t,e,r){return e&&!_t(e)&&(e=_u.getLocalTransform(e)),r&&(e=uu([],e)),Gt([],t,e)}function yT(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=wf(i,e,r),Math.abs(i[0])>Math.abs(i[1])?i[0]>0?"right":"left":i[1]>0?"bottom":"top"}function Qg(t){return!t.isGroup}function _T(t){return t.shape!=null}function Jg(t,e,r){if(!t||!e)return;function n(o){var s={};return o.traverse(function(l){Qg(l)&&l.anid&&(s[l.anid]=l)}),s}function a(o){var s={x:o.x,y:o.y,rotation:o.rotation};return _T(o)&&(s.shape=V({},o.shape)),s}var i=n(t);e.traverse(function(o){if(Qg(o)&&o.anid){var s=i[o.anid];if(s){var l=a(o);o.attr(a(s)),Nt(o,l,r,Re(o).dataIndex)}}})}function bT(t,e){return ue(t,function(r){var n=r[0];n=sl(n,e.x),n=ll(n,e.x+e.width);var a=r[1];return a=sl(a,e.y),a=ll(a,e.y+e.height),[n,a]})}function xT(t,e){var r=sl(t.x,e.x),n=ll(t.x+t.width,e.x+e.width),a=sl(t.y,e.y),i=ll(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 Sf(t,e,r){var n=V({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),De(a,r),new un(n)):xf(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(em(t,e,r,n,s[0],s[1],o[0],o[1]))return!0;o=s}}function em(t,e,r,n,a,i,o,s){var l=r-t,c=n-e,u=o-a,f=s-i,d=kf(u,f,l,c);if(ST(d))return!1;var h=t-a,v=e-i,m=kf(h,v,l,c)/d;if(m<0||m>1)return!1;var g=kf(h,v,u,f)/d;return!(g<0||g>1)}function kf(t,e,r,n){return t*n-r*e}function ST(t){return t<=1e-6&&t>=-1e-6}function cl(t){var e=t.itemTooltipOption,r=t.componentModel,n=t.itemName,a=ie(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&&A(Ge(l),function(u){In(s,u)||(s[u]=l[u],s.$vars.push(u))});var c=Re(t.el);c.componentMainType=i,c.componentIndex=o,c.tooltipConfig={name:n,option:De({content:n,encodeHTMLContent:!0,formatterParams:s},a)}}function tm(t,e){var r;t.isGroup&&(r=e(t)),r||t.traverse(e)}function ul(t,e){if(t)if(ee(t))for(var r=0;r<t.length;r++)tm(t[r],e);else tm(t,e)}ar("circle",el),ar("ellipse",hf),ar("sector",Va),ar("ring",vf),ar("polygon",pf),ar("polyline",gf),ar("rect",nt),ar("line",fn),ar("bezierCurve",mf),ar("arc",rl);const kT=Object.freeze(Object.defineProperty({__proto__:null,Arc:rl,BezierCurve:mf,BoundingRect:Pe,Circle:el,CompoundPath:aT,Ellipse:hf,Group:lt,Image:un,IncrementalDisplayable:sT,Line:fn,LinearGradient:Yg,OrientedBoundingRect:il,Path:Ee,Point:Be,Polygon:pf,Polyline:gf,RadialGradient:iT,Rect:nt,Ring:vf,Sector:Va,Text:wt,applyTransform:wf,clipPointsByRect:bT,clipRectByRect:xT,createIcon:Sf,extendPath:hT,extendShape:uT,getShapeClass:dT,getTransform:mT,groupTransition:Jg,initProps:Ur,isElementRemoved:Zi,lineLineIntersect:em,linePolygonIntersect:wT,makeImage:Zg,makePath:xf,mergePath:vT,registerShape:ar,removeElement:ol,removeElementWithFadeOut:_f,resizePath:jg,setTooltipConfig:cl,subPixelOptimize:gT,subPixelOptimizeLine:Ki,subPixelOptimizeRect:pT,transformDirection:yT,traverseElements:ul,updateProps:Nt},Symbol.toStringTag,{value:"Module"}));var fl={};function TT(t,e){for(var r=0;r<Cr.length;r++){var n=Cr[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 rm(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=ge(t.defaultText)?t.defaultText(a,t,r):t.defaultText);for(var l={normal:s},c=0;c<Cr.length;c++){var u=Cr[c],f=e[u];l[u]=_e(n?n.getFormattedLabel(a,u,null,i,f&&f.get("formatter")):null,s)}return l}function hl(t,e,r,n){r=r||fl;for(var a=t instanceof wt,i=!1,o=0;o<mg.length;o++){var s=e[mg[o]];if(s&&s.getShallow("show")){i=!0;break}}var l=a?t:t.getTextContent();if(i){a||(l||(l=new wt,t.setTextContent(l)),t.stateProxy&&(l.stateProxy=t.stateProxy));var c=rm(r,e),u=e.normal,f=!!u.getShallow("show"),d=Ga(u,n&&n.normal,r,!1,!a);d.text=c.normal,a||t.setTextConfig(nm(u,r,!1));for(var o=0;o<Cr.length;o++){var h=Cr[o],s=e[h];if(s){var v=l.ensureState(h),m=!!_e(s.getShallow("show"),f);if(m!==f&&(v.ignore=!m),v.style=Ga(s,n&&n[h],r,!0,!a),v.style.text=c[h],!a){var g=t.ensureState(h);g.textConfig=nm(s,r,!0)}}}l.silent=!!u.getShallow("silent"),l.style.x!=null&&(d.x=l.style.x),l.style.y!=null&&(d.y=l.style.y),l.ignore=!f,l.useStyle(d),l.dirty(),r.enableTextSetter&&(vl(l).setLabelText=function(p){var y=rm(r,e,p);TT(l,y)})}else l&&(l.ignore=!0);t.dirty()}function dl(t,e){e=e||"label";for(var r={normal:t.getModel(e)},n=0;n<Cr.length;n++){var a=Cr[n];r[a]=t.getModel([a,e])}return r}function Ga(t,e,r,n,a){var i={};return CT(i,t,r,n,a),e&&V(i,e),i}function nm(t,e,r){e=e||{};var n={},a,i=t.getShallow("rotate"),o=_e(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 CT(t,e,r,n,a){r=r||fl;var i=e.ecModel,o=i&&i.option.textStyle,s=MT(e),l;if(s){l={};for(var c in s)if(s.hasOwnProperty(c)){var u=e.getModel(["rich",c]);sm(l[c]={},u,o,r,n,a,!1,!0)}}l&&(t.rich=l);var f=e.get("overflow");f&&(t.overflow=f);var d=e.get("minMargin");d!=null&&(t.margin=d),sm(t,e,o,r,n,a,!0,!1)}function MT(t){for(var e;t&&t!==t.ecModel;){var r=(t.option||fl).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 am=["fontStyle","fontWeight","fontSize","fontFamily","textShadowColor","textShadowBlur","textShadowOffsetX","textShadowOffsetY"],im=["align","lineHeight","width","height","tag","verticalAlign","ellipsis"],om=["padding","borderWidth","borderRadius","borderDashOffset","backgroundColor","borderColor","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"];function sm(t,e,r,n,a,i,o,s){r=!a&&r||fl;var l=n&&n.inheritColor,c=e.getShallow("color"),u=e.getShallow("textBorderColor"),f=_e(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 d=_e(e.getShallow("textBorderWidth"),r.textBorderWidth);d!=null&&(t.lineWidth=d);var h=_e(e.getShallow("textBorderType"),r.textBorderType);h!=null&&(t.lineDash=h);var v=_e(e.getShallow("textBorderDashOffset"),r.textBorderDashOffset);v!=null&&(t.lineDashOffset=v),!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<am.length;m++){var g=am[m],p=_e(e.getShallow(g),r[g]);p!=null&&(t[g]=p)}for(var m=0;m<im.length;m++){var g=im[m],p=e.getShallow(g);p!=null&&(t[g]=p)}if(t.verticalAlign==null){var y=e.getShallow("baseline");y!=null&&(t.verticalAlign=y)}if(!o||!n.disableBox){for(var m=0;m<om.length;m++){var g=om[m],p=e.getShallow(g);p!=null&&(t[g]=p)}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 AT(t,e){var r=e&&e.getModel("textStyle");return _r([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 vl=Xe();function DT(t,e,r,n){if(t){var a=vl(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 IT=["textStyle","color"],Tf=["fontStyle","fontWeight","fontSize","fontFamily","padding","lineHeight","rich","width","height","overflow"],Cf=new wt,PT=(function(){function t(){}return t.prototype.getTextColor=function(e){var r=this.ecModel;return this.getShallow("color")||(!e&&r?r.get(IT):null)},t.prototype.getFont=function(){return AT({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<Tf.length;n++)r[Tf[n]]=this.getShallow(Tf[n]);return Cf.useStyle(r),Cf.update(),Cf.getBoundingRect()},t})(),lm=[["lineWidth","width"],["stroke","color"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","type"],["lineDashOffset","dashOffset"],["lineCap","cap"],["lineJoin","join"],["miterLimit"]],LT=Ci(lm),RT=(function(){function t(){}return t.prototype.getLineStyle=function(e){return LT(this,e)},t})(),cm=[["fill","color"],["stroke","borderColor"],["lineWidth","borderWidth"],["opacity"],["shadowBlur"],["shadowOffsetX"],["shadowOffsetY"],["shadowColor"],["lineDash","borderType"],["lineDashOffset","borderDashOffset"],["lineCap","borderCap"],["lineJoin","borderJoin"],["miterLimit","borderMiterLimit"]],ET=Ci(cm),OT=(function(){function t(){}return t.prototype.getItemStyle=function(e,r){return ET(this,e,r)},t})(),$e=(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){ke(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(ye(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(!he.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})();iu($e),yw($e),yr($e,RT),yr($e,OT),yr($e,Sw),yr($e,PT);function ji(t){return t==null?0:t.length||1}function um(t){return t}var NT=(function(){function t(e,r,n,a,i,o){this._old=e,this._new=r,this._oldKeyGetter=n||um,this._newKeyGetter=a||um,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=ji(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=ji(c),d=ji(u);if(f>1&&d===1)this._updateManyToOne&&this._updateManyToOne(u,c),a[l]=null;else if(f===1&&d>1)this._updateOneToMany&&this._updateOneToMany(u,c),a[l]=null;else if(f===1&&d===1)this._update&&this._update(u,c),a[l]=null;else if(f>1&&d>1)this._updateManyToMany&&this._updateManyToMany(u,c),a[l]=null;else if(f>1)for(var h=0;h<f;h++)this._remove&&this._remove(c[h]);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=ji(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=ji(l);c===0?(r[s]=o,i&&n.push(s)):c===1?r[s]=[l,o]:l.push(o)}}},t})(),fm=fe(["tooltip","label","itemName","itemId","itemGroupId","itemChildGroupId","seriesName"]),Xt="original",Ct="arrayRows",Ar="objectRows",$r="keyedColumns",hn="typedArray",hm="unknown",Yr="column",Wa="row",Bt={Must:1,Might:2,Not:3},dm=Xe();function BT(t){dm(t).datasetMap=fe()}function zT(t,e,r){var n={},a=vm(e);if(!a||!t)return n;var i=[],o=[],s=e.ecModel,l=dm(s).datasetMap,c=a.uid+"_"+r.seriesLayoutBy,u,f;t=t.slice(),A(t,function(m,g){var p=ce(m)?m:t[g]={name:m};p.type==="ordinal"&&u==null&&(u=g,f=v(p)),n[p.name]=[]});var d=l.get(c)||l.set(c,{categoryWayDim:f,valueWayDim:0});A(t,function(m,g){var p=m.name,y=v(m);if(u==null){var b=d.valueWayDim;h(n[p],b,y),h(o,b,y),d.valueWayDim+=y}else if(u===g)h(n[p],0,y),h(i,0,y);else{var b=d.categoryWayDim;h(n[p],b,y),h(o,b,y),d.categoryWayDim+=y}});function h(m,g,p){for(var y=0;y<p;y++)m.push(g+y)}function v(m){var g=m.dimsDef;return g?g.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 Wi(t.ecModel,"dataset",{index:t.get("datasetIndex",!0),id:t.get("datasetId",!0)},kt).models[0]}function FT(t){return!t.get("transform",!0)&&!t.get("fromTransformResult",!0)?[]:Wi(t.ecModel,"dataset",{index:t.get("fromDatasetIndex",!0),id:t.get("fromDatasetId",!0)},kt).models}function pm(t,e){return HT(t.data,t.sourceFormat,t.seriesLayoutBy,t.dimensionsDefine,t.startIndex,e)}function HT(t,e,r,n,a,i){var o,s=5;if(bt(t))return Bt.Not;var l,c;if(n){var u=n[i];ce(u)?(l=u.name,c=u.type):ie(u)&&(l=u)}if(c!=null)return c==="ordinal"?Bt.Must:Bt.Not;if(e===Ct){var f=t;if(r===Wa){for(var d=f[i],h=0;h<(d||[]).length&&h<s;h++)if((o=x(d[a+h]))!=null)return o}else for(var h=0;h<f.length&&h<s;h++){var v=f[a+h];if(v&&(o=x(v[i]))!=null)return o}}else if(e===Ar){var m=t;if(!l)return Bt.Not;for(var h=0;h<m.length&&h<s;h++){var g=m[h];if(g&&(o=x(g[l]))!=null)return o}}else if(e===$r){var p=t;if(!l)return Bt.Not;var d=p[l];if(!d||bt(d))return Bt.Not;for(var h=0;h<d.length&&h<s;h++)if((o=x(d[h]))!=null)return o}else if(e===Xt)for(var y=t,h=0;h<y.length&&h<s;h++){var g=y[h],b=Hi(g);if(!ee(b))return Bt.Not;if((o=x(b[i]))!=null)return o}function x(S){var w=ie(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 pl=(function(){function t(e){this.data=e.data||(e.sourceFormat===$r?{}:[]),this.sourceFormat=e.sourceFormat||hm,this.seriesLayoutBy=e.seriesLayoutBy||Yr,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&&pm(this,n)===Bt.Must&&(a.type="ordinal")}}return t})();function Mf(t){return t instanceof pl}function Af(t,e,r){r=r||mm(t);var n=e.seriesLayoutBy,a=GT(t,r,n,e.sourceHeader,e.dimensions),i=new pl({data:t,sourceFormat:r,seriesLayoutBy:n,dimensionsDefine:a.dimensionsDefine,startIndex:a.startIndex,dimensionsDetectedCount:a.dimensionsDetectedCount,metaRawOption:ye(e)});return i}function gm(t){return new pl({data:t,sourceFormat:bt(t)?hn:Xt})}function VT(t){return new pl({data:t.data,sourceFormat:t.sourceFormat,seriesLayoutBy:t.seriesLayoutBy,dimensionsDefine:ye(t.dimensionsDefine),startIndex:t.startIndex,dimensionsDetectedCount:t.dimensionsDetectedCount})}function mm(t){var e=hm;if(bt(t))e=hn;else if(ee(t)){t.length===0&&(e=Ct);for(var r=0,n=t.length;r<n;r++){var a=t[r];if(a!=null){if(ee(a)||bt(a)){e=Ct;break}else if(ce(a)){e=Ar;break}}}}else if(ce(t)){for(var i in t)if(In(t,i)&&_t(t[i])){e=$r;break}}return e}function GT(t,e,r,n,a){var i,o;if(!t)return{dimensionsDefine:ym(a),startIndex:o,dimensionsDetectedCount:i};if(e===Ct){var s=t;n==="auto"||n==null?_m(function(c){c!=null&&c!=="-"&&(ie(c)?o==null&&(o=1):o=0)},r,s,10):o=He(n)?n:n?1:0,!a&&o===1&&(a=[],_m(function(c,u){a[u]=c!=null?c+"":""},r,s,1/0)),i=a?a.length:r===Wa?s.length:s[0]?s[0].length:null}else if(e===Ar)a||(a=WT(t));else if(e===$r)a||(a=[],A(t,function(c,u){a.push(u)}));else if(e===Xt){var l=Hi(t[0]);i=ee(l)&&l.length||1}return{startIndex:o,dimensionsDefine:ym(a),dimensionsDetectedCount:i}}function WT(t){for(var e=0,r;e<t.length&&!(r=t[e++]););if(r)return Ge(r)}function ym(t){if(t){var e=fe();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 _m(t,e,r,n){if(e===Wa)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 bm(t){var e=t.sourceFormat;return e===Ar||e===$r}var ea,ta,ra,xm,wm,Sm=(function(){function t(e,r){var n=Mf(e)?e:gm(e);this._source=n;var a=this._data=n.data;n.sourceFormat===hn&&(this._offset=0,this._dimSize=r,this._data=a),wm(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;wm=function(o,s,l){var c=l.sourceFormat,u=l.seriesLayoutBy,f=l.startIndex,d=l.dimensionsDefine,h=xm[If(c,u)];if(V(o,h),c===hn)o.getItem=r,o.count=a,o.fillStorage=n;else{var v=Tm(c,u);o.getItem=Ce(v,null,s,f,d);var m=Mm(c,u);o.count=Ce(m,null,s,f,d)}};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,d=0;d<f;d++){for(var h=c[d],v=h[0]==null?1/0:h[0],m=h[1]==null?-1/0:h[1],g=s-o,p=l[d],y=0;y<g;y++){var b=u[y*f+d];p[o+y]=b,b<v&&(v=b),b>m&&(m=b)}h[0]=v,h[1]=m}},a=function(){return this._data?this._data.length/this._dimSize:0};xm=(e={},e[Ct+"_"+Yr]={pure:!0,appendData:i},e[Ct+"_"+Wa]={pure:!0,appendData:function(){throw new Error('Do not support appendData when set seriesLayoutBy: "row".')}},e[Ar]={pure:!0,appendData:i},e[$r]={pure:!0,appendData:function(o){var s=this._data;A(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})(),km=function(t,e,r,n){return t[n]},UT=(ea={},ea[Ct+"_"+Yr]=function(t,e,r,n){return t[n+e]},ea[Ct+"_"+Wa]=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},ea[Ar]=km,ea[$r]=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},ea[Xt]=km,ea);function Tm(t,e){var r=UT[If(t,e)];return r}var Cm=function(t,e,r){return t.length},$T=(ta={},ta[Ct+"_"+Yr]=function(t,e,r){return Math.max(0,t.length-e)},ta[Ct+"_"+Wa]=function(t,e,r){var n=t[0];return n?Math.max(0,n.length-e):0},ta[Ar]=Cm,ta[$r]=function(t,e,r){var n=r[0].name,a=t[n];return a?a.length:0},ta[Xt]=Cm,ta);function Mm(t,e){var r=$T[If(t,e)];return r}var Df=function(t,e,r){return t[e]},YT=(ra={},ra[Ct]=Df,ra[Ar]=function(t,e,r){return t[r]},ra[$r]=Df,ra[Xt]=function(t,e,r){var n=Hi(t);return n instanceof Array?n[e]:n},ra[hn]=Df,ra);function Am(t){var e=YT[t];return e}function If(t,e){return t===Ct?t+"_"+e:t}function Ua(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 Am(i)(n,o,s)}else{var l=n;return i===Xt&&(l=Hi(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 XT(t,e){var r={},n=r.encode={},a=fe(),i=[],o=[],s={};A(t.dimensions,function(d){var h=t.getDimensionInfo(d),v=h.coordDim;if(v){var m=h.coordDimIndex;Pf(n,v)[m]=d,h.isExtraCoord||(a.set(v,1),KT(h.type)&&(i[0]=d),Pf(s,v)[m]=t.getDimensionIndex(h.name)),h.defaultTooltip&&o.push(d)}fm.each(function(g,p){var y=Pf(n,p),b=h.otherDims[p];b!=null&&b!==!1&&(y[b]=h.name)})});var l=[],c={};a.each(function(d,h){var v=n[h];c[h]=v[0],l=l.concat(v)}),r.dataDimsOnCoord=l,r.dataDimIndicesOnCoord=ue(l,function(d){return t.getDimensionInfo(d).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 Pf(t,e){return t.hasOwnProperty(e)||(t[e]=[]),t[e]}function ZT(t){return t==="category"?"ordinal":t==="time"?"time":"float"}function KT(t){return!(t==="ordinal"||t==="time")}var gl=(function(){function t(e){this.otherDims={},e!=null&&V(this,e)}return t})();function ml(t,e){var r=e&&e.type;return r==="ordinal"?t:(r==="time"&&!He(t)&&t!=null&&t!=="-"&&(t=+Gr(t)),t==null||t===""?NaN:Number(t))}fe({number:function(t){return parseFloat(t)},time:function(t){return+Gr(t)},trim:function(t){return ie(t)?_r(t):t}});var jT=(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:Ws(e),a=He(r)?r:Ws(r),i=isNaN(n),o=isNaN(a);if(i&&(n=this._incomparable),o&&(a=this._incomparable),i&&o){var s=ie(e),l=ie(r);s&&(n=l?e:0),l&&(a=s?r:0)}return n<a?this._resultLT:n>a?-this._resultLT:0},t})(),yl="undefined",QT=typeof Uint32Array===yl?Array:Uint32Array,JT=typeof Uint16Array===yl?Array:Uint16Array,Dm=typeof Int32Array===yl?Array:Int32Array,Im=typeof Float64Array===yl?Array:Float64Array,Pm={float:Im,int:Dm,ordinal:Array,number:Array,time:Im},Lf;function $a(t){return t>65535?QT:JT}function Ya(){return[1/0,-1/0]}function e2(t){var e=t.constructor;return e===Array?t.slice():new e(t)}function Lm(t,e,r,n,a){var i=Pm[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 Rf=(function(){function t(){this._chunks=[],this._rawExtent=[],this._extent=[],this._count=0,this._rawCount=0,this._calcDimNameToIdx=fe()}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=Lf[a.sourceFormat];this._dimValueGetter=n||i,this._rawExtent=[],bm(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 Pm[r||"float"](this._rawCount),this._rawExtent[i]=Ya(),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]=Ya());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];Lm(n,c,u.type,l,!0)}for(var f=[],d=s;d<l;d++)for(var h=d-s,v=0;v<i;v++){var u=a[v],m=Lf.arrayRows.call(this,e[h]||f,u.property,h,v);n[v][d]=m;var g=o[v];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]=Ya()),Lm(i,u,f.type,r,n)}if(a.fillStorage)a.fillStorage(e,r,i,l);else for(var d=[],h=e;h<r;h++){d=a.getItem(h,d);for(var v=0;v<s;v++){var m=i[v],g=this._dimValueGetter(d,c[v],h,v);m[h]=g;var p=l[v];g<p[0]&&(p[0]=g),g>p[1]&&(p[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 d=this.getRawIndex(u),h=r-i[d],v=Math.abs(h);v<=n&&((v<s||v===s&&h>=0&&l<0)&&(s=v,l=h,c=0),h===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=$a(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=$a(n._rawCount),o=new i(a),s=[],l=e.length,c=0,u=e[0],f=n._chunks,d=0;d<a;d++){var h=void 0,v=n.getRawIndex(d);if(l===0)h=r(d);else if(l===1){var m=f[u][v];h=r(m,d)}else{for(var g=0;g<l;g++)s[g]=f[e[g]][v];s[g]=d,h=r.apply(null,s)}h&&(o[c++]=v)}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=$a(r._rawCount),l=new s(o),c=0,u=a[0],f=e[u][0],d=e[u][1],h=r._chunks,v=!1;if(!r._indices){var m=0;if(i===1){for(var g=h[a[0]],p=0;p<n;p++){var y=g[p];(y>=f&&y<=d||isNaN(y))&&(l[c++]=m),m++}v=!0}else if(i===2){for(var g=h[a[0]],b=h[a[1]],x=e[a[1]][0],S=e[a[1]][1],p=0;p<n;p++){var y=g[p],w=b[p];(y>=f&&y<=d||isNaN(y))&&(w>=x&&w<=S||isNaN(w))&&(l[c++]=m),m++}v=!0}}if(!v)if(i===1)for(var p=0;p<o;p++){var k=r.getRawIndex(p),y=h[a[0]][k];(y>=f&&y<=d||isNaN(y))&&(l[c++]=k)}else for(var p=0;p<o;p++){for(var T=!0,k=r.getRawIndex(p),M=0;M<i;M++){var D=a[M],y=h[D][k];(y<e[D][0]||y>e[D][1])&&(T=!1)}T&&(l[c++]=r.getRawIndex(p))}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]]=Ya();for(var f=0;f<s;f++){for(var d=e.getRawIndex(f),h=0;h<o;h++)l[h]=a[r[h]][d];l[o]=f;var v=n&&n.apply(null,l);if(v!=null){typeof v!="object"&&(i[0]=v,v=i);for(var u=0;u<v.length;u++){var m=r[u],g=v[u],p=c[m],y=a[m];y&&(y[d]=g),g<p[0]&&(p[0]=g),g>p[1]&&(p[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,d,h=new($a(this._rawCount))(Math.min((Math.ceil(o/l)+2)*2,o));h[s++]=c;for(var v=1;v<o-1;v+=l){for(var m=Math.min(v+l,o-1),g=Math.min(v+l*2,o),p=(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=v,k=Math.min(v+l,o),T=v-1,M=i[c];u=-1,d=w;for(var D=-1,C=0,b=w;b<k;b++){var x=this.getRawIndex(b),S=i[x];if(isNaN(S)){C++,D<0&&(D=x);continue}f=Math.abs((T-p)*(S-M)-(T-b)*(y-M)),f>u&&(u=f,d=x)}C>0&&C<k-w&&(h[s++]=Math.min(D,d),d=Math.max(D,d)),h[s++]=d,c=d}return h[s++]=this.getRawIndex(o-1),n._count=s,n._indices=h,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($a(this._rawCount))(Math.ceil(s/i)*2),c=0,u=0;u<s;u+=i){var f=u,d=o[this.getRawIndex(f)],h=u,v=o[this.getRawIndex(h)],m=i;u+i>s&&(m=s-u);for(var g=0;g<m;g++){var p=this.getRawIndex(u+g),y=o[p];y<d&&(d=y,f=u+g),y>v&&(v=y,h=u+g)}var b=this.getRawIndex(f),x=this.getRawIndex(h);f<h?(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]=Ya(),d=new($a(this._rawCount))(Math.ceil(u/l)),h=0,v=0;v<u;v+=l){l>u-v&&(l=u-v,s.length=l);for(var m=0;m<l;m++){var g=this.getRawIndex(v+m);s[m]=c[g]}var p=n(s),y=this.getRawIndex(Math.min(v+a(s,p)||0,u-1));c[y]=p,p<f[0]&&(f[0]=p),p>f[1]&&(f[1]=p),d[h++]=y}return i._count=h,i._indices=d,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=Ya();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&&Sa(e,function(s,l){return s[l]=!0,s},{});if(i)for(var o=0;o<a.length;o++)n._chunks[o]=i[o]?e2(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=ye(this._extent),e._rawExtent=ye(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 ml(r[i],this._dimensions[i])}Lf={arrayRows:e,objectRows:function(r,n,a,i){return ml(r[n],this._dimensions[i])},keyedColumns:e,original:function(r,n,a,i){var o=r&&(r.value==null?r:r.value);return ml(o instanceof Array?o[i]:o,this._dimensions[i])},typedArray:function(r,n,a,i){return r[i]}}})(),t})(),t2=Xe(),r2={float:"f",int:"i",ordinal:"o",number:"n",time:"t"},Rm=(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=Nm(this.source)))},t.prototype.getSourceDimensionIndex=function(e){return _e(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=bm(this.source),n=!Bm(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 d=this.getSourceDimension(o);d&&(l=r?d.name:null,c=d.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+=r2[c]||"f",u&&(a+=u.uid),a+="$"}var h=this.source,v=[h.seriesLayoutBy,h.startIndex,a].join("$$");return{dimensions:i,hash:v}},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 Em(t){return t instanceof Rm}function Om(t){for(var e=fe(),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 Nm(t){var e=t2(t);return e.dimNameMap||(e.dimNameMap=Om(t.dimensionsDefine))}function Bm(t){return t>30}var Qi=ce,dn=ue,n2=typeof Int32Array>"u"?Array:Int32Array,a2="e\0\0",zm=-1,i2=["hasItemOption","_nameList","_idList","_invertedIndicesMap","_dimSummary","userOutput","_rawData","_dimValueGetter","_nameDimIdx","_idDimIdx","_nameRepeatCount"],o2=["_approximateExtent"],Fm,_l,Ji,eo,Ef,to,Of,s2=(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;Em(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],d=ie(f)?new gl({name:f}):f instanceof gl?f:new gl(f),h=d.name;d.type=d.type||"float",d.coordDim||(d.coordDim=h,d.coordDimIndex=0);var v=d.otherDims=d.otherDims||{};o.push(h),i[h]=d,c[h]!=null&&(l=!0),d.createInvertedIndices&&(s[h]=[]),v.itemName===0&&(this._nameDimIdx=u),v.itemId===0&&(this._idDimIdx=u),a&&(d.storeDimIndex=u)}if(this.dimensions=o,this._dimInfos=i,this._initGetDimensionInfo(l),this.hostModel=r,this._invertedIndicesMap=s,this._dimOmitted){var m=this._dimIdxToName=fe();A(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(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 Rf&&(i=e),!i){var o=this.dimensions,s=Mf(e)||_t(e)?new Sm(e,o.length):e;i=new Rf;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=XT(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&&Of(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&&QS(f)&&(this.hasItemOption=!0),f){var d=f.name;i[u]==null&&d!=null&&(i[u]=Tr(d,null));var h=f.id;o[u]==null&&h!=null&&(o[u]=Tr(h,null))}}if(this._shouldMakeIdFromName())for(var u=e;u<r;u++)Of(this,u);Fm(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){Qi(e)?V(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=Ji(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 _l(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(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)?zm:a},t.prototype.indicesOfNearest=function(e,r,n){return this._store.indicesOfNearest(this._getStoreDimIndex(e),r,n)},t.prototype.each=function(e,r,n){ge(e)&&(n=r,r=e,e=[]);var a=n||this,i=dn(eo(e),this._getStoreDimIndex,this);this._store.each(i,a?Ce(r,a):r)},t.prototype.filterSelf=function(e,r,n){ge(e)&&(n=r,r=e,e=[]);var a=n||this,i=dn(eo(e),this._getStoreDimIndex,this);return this._store=this._store.filter(i,a?Ce(r,a):r),this},t.prototype.selectRange=function(e){var r=this,n={},a=Ge(e);return A(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){ge(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(eo(e),this._getStoreDimIndex,this),s=to(this);return s._store=this._store.map(o,i?Ce(r,i):r),s},t.prototype.modify=function(e,r,n,a){var i=n||a||this,o=dn(eo(e),this._getStoreDimIndex,this);this._store.modify(o,i?Ce(r,i):r)},t.prototype.downSample=function(e,r,n,a){var i=to(this);return i._store=this._store.downSample(this._getStoreDimIndex(e),r,n,a),i},t.prototype.minmaxDownSample=function(e,r){var n=to(this);return n._store=this._store.minmaxDownSample(this._getStoreDimIndex(e),r),n},t.prototype.lttbDownSample=function(e,r){var n=to(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 $e(n,r,r&&r.ecModel)},t.prototype.diff=function(e){var r=this;return new NT(e?e.getStore().getIndices():[],this.getStore().getIndices(),function(n){return _l(e,n)},function(n){return _l(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||{},Qi(e)?V(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():Qi(i)&&(i=V({},i)),a[r]=i),i},t.prototype.setItemVisual=function(e,r,n){var a=this._itemVisuals[e]||{};this._itemVisuals[e]=a,Qi(r)?V(a,r):a[r]=n},t.prototype.clearAllVisual=function(){this._visual={},this._itemVisuals=[]},t.prototype.setLayout=function(e,r){Qi(e)?V(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?V(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;dk(n,this.dataType,e,r),this._graphicEls[e]=r},t.prototype.getItemGraphicEl=function(e){return this._graphicEls[e]},t.prototype.eachItemGraphicEl=function(e,r){A(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)),Ef(e,this),e._store=this._store,e},t.prototype.wrapMethod=function(e,r){var n=this[e];ge(n)&&(this.__wrappedMethods=this.__wrappedMethods||[],this.__wrappedMethods.push(e),this[e]=function(){var a=n.apply(this,arguments);return r.apply(this,[a].concat(nu(arguments)))})},t.internalField=(function(){Fm=function(e){var r=e._invertedIndicesMap;A(r,function(n,a){var i=e._dimInfos[a],o=i.ordinalMeta,s=e._store;if(o){n=r[a]=new n2(o.categories.length);for(var l=0;l<n.length;l++)n[l]=zm;for(var l=0;l<s.count();l++)n[s.get(i.storeDimIndex,l)]=l}})},Ji=function(e,r,n){return Tr(e._getCategory(r,n),null)},_l=function(e,r){var n=e._idList[r];return n==null&&e._idDimIdx!=null&&(n=Ji(e,e._idDimIdx,r)),n==null&&(n=a2+r),n},eo=function(e){return ee(e)||(e=e!=null?[e]:[]),e},to=function(e){var r=new t(e._schema?e._schema:dn(e.dimensions,e._getDimInfo,e),e.hostModel);return Ef(r,e),r},Ef=function(e,r){A(i2.concat(r.__wrappedMethods||[]),function(n){r.hasOwnProperty(n)&&(e[n]=r[n])}),e.__wrappedMethods=r.__wrappedMethods,A(o2,function(n){e[n]=ye(r[n])}),e._calculationInfo=V({},r._calculationInfo)},Of=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=Ji(e,i,r)),l==null&&o!=null&&(a[r]=l=Ji(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 l2(t,e){Mf(t)||(t=gm(t)),e=e||{};var r=e.coordDimensions||[],n=e.dimensionsDefine||t.dimensionsDefine||[],a=fe(),i=[],o=u2(t,r,n,e.dimensionsCount),s=e.canOmitUnusedDimensions&&Bm(o),l=n===t.dimensionsDefine,c=l?Nm(t):Om(n),u=e.encodeDefine;!u&&e.encodeDefaulter&&(u=e.encodeDefaulter(t,o));for(var f=fe(u),d=new Dm(o),h=0;h<d.length;h++)d[h]=-1;function v(M){var D=d[M];if(D<0){var C=n[M],I=ce(C)?C:{name:C},P=new gl,L=I.name;L!=null&&c.get(L)!=null&&(P.name=P.displayName=L),I.type!=null&&(P.type=I.type),I.displayName!=null&&(P.displayName=I.displayName);var R=i.length;return d[M]=R,P.storeDimIndex=M,i.push(P),P}return i[D]}if(!s)for(var h=0;h<o;h++)v(h);f.each(function(M,D){var C=ut(M).slice();if(C.length===1&&!ie(C[0])&&C[0]<0){f.set(D,!1);return}var I=f.set(D,[]);A(C,function(P,L){var R=ie(P)?c.get(P):P;R!=null&&R<o&&(I[L]=R,g(v(R),D,L))})});var m=0;A(r,function(M){var D,C,I,P;if(ie(M))D=M,P={};else{P=M,D=P.name;var L=P.ordinalMeta;P.ordinalMeta=null,P=V({},P),P.ordinalMeta=L,C=P.dimsDef,I=P.otherDims,P.name=P.coordDim=P.coordDimIndex=P.dimsDef=P.otherDims=null}var R=f.get(D);if(R!==!1){if(R=ut(R),!R.length)for(var N=0;N<(C&&C.length||1);N++){for(;m<o&&v(m).coordDim!=null;)m++;m<o&&R.push(m++)}A(R,function(Z,F){var z=v(Z);if(l&&P.type!=null&&(z.type=P.type),g(De(z,P),D,F),z.name==null&&C){var W=C[F];!ce(W)&&(W={name:W}),z.name=z.displayName=W.name,z.defaultTooltip=W.defaultTooltip}I&&De(z.otherDims,I)})}});function g(M,D,C){fm.get(D)!=null?M.otherDims[D]=C:(M.coordDim=D,M.coordDimIndex=C,a.set(D,!0))}var p=e.generateCoord,y=e.generateCoordCount,b=y!=null;y=p?y||1:0;var x=p||"value";function S(M){M.name==null&&(M.name=M.coordDim)}if(s)A(i,function(M){S(M)}),i.sort(function(M,D){return M.storeDimIndex-D.storeDimIndex});else for(var w=0;w<o;w++){var k=v(w),T=k.coordDim;T==null&&(k.coordDim=f2(x,a,b),k.coordDimIndex=0,(!p||y<=0)&&(k.isExtraCoord=!0),y--),S(k),k.type==null&&(pm(t,w)===Bt.Must||k.isExtraCoord&&(k.otherDims.itemName!=null||k.otherDims.seriesName!=null))&&(k.type="ordinal")}return c2(i),new Rm({source:t,dimensions:i,fullDimensionCount:o,dimensionOmitted:s})}function c2(t){for(var e=fe(),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 u2(t,e,r,n){var a=Math.max(t.dimensionsDetectedCount||1,e.length,r.length,n||0);return A(e,function(i){var o;ce(i)&&(o=i.dimsDef)&&(a=Math.max(a,o.length))}),a}function f2(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 Nf={},Bf=(function(){function t(){this._coordinateSystems=[]}return t.prototype.create=function(e,r){var n=[];A(Nf,function(a,i){var o=a.create(e,r);n=n.concat(o||[])}),this._coordinateSystems=n},t.prototype.update=function(e,r){A(this._coordinateSystems,function(n){n.update&&n.update(e,r)})},t.prototype.getCoordinateSystems=function(){return this._coordinateSystems.slice()},t.register=function(e,r){Nf[e]=r},t.get=function(e){return Nf[e]},t})(),h2=(function(){function t(e){this.coordSysDims=[],this.axisMap=fe(),this.categoryAxisMap=fe(),this.coordSysName=e}return t})();function d2(t){var e=t.get("coordinateSystem"),r=new h2(e),n=v2[e];if(n)return n(t,r,r.axisMap,r.categoryAxisMap),r}var v2={cartesian2d:function(t,e,r,n){var a=t.getReferringComponents("xAxis",kt).models[0],i=t.getReferringComponents("yAxis",kt).models[0];e.coordSysDims=["x","y"],r.set("x",a),r.set("y",i),qa(a)&&(n.set("x",a),e.firstCategoryDimIndex=0),qa(i)&&(n.set("y",i),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=1))},singleAxis:function(t,e,r,n){var a=t.getReferringComponents("singleAxis",kt).models[0];e.coordSysDims=["single"],r.set("single",a),qa(a)&&(n.set("single",a),e.firstCategoryDimIndex=0)},polar:function(t,e,r,n){var a=t.getReferringComponents("polar",kt).models[0],i=a.findAxisModel("radiusAxis"),o=a.findAxisModel("angleAxis");e.coordSysDims=["radius","angle"],r.set("radius",i),r.set("angle",o),qa(i)&&(n.set("radius",i),e.firstCategoryDimIndex=0),qa(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();A(i.parallelAxisIndex,function(s,l){var c=a.getComponent("parallelAxis",s),u=o[l];r.set(u,c),qa(c)&&(n.set(u,c),e.firstCategoryDimIndex==null&&(e.firstCategoryDimIndex=l))})}};function qa(t){return t.get("type")==="category"}function p2(t,e,r){r=r||{};var n=r.byIndex,a=r.stackedCoordDimension,i,o,s;g2(e)?i=e:(o=e.schema,i=o.dimensions,s=e.store);var l=!!(t&&t.get("stack")),c,u,f,d;if(A(i,function(y,b){ie(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,d="__\0ecstackedover_"+t.id,c&&(c.createInvertedIndices=!0);var h=u.coordDim,v=u.type,m=0;A(i,function(y){y.coordDim===h&&m++});var g={name:f,coordDim:h,coordDimIndex:m,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length},p={name:d,coordDim:d,coordDimIndex:m+1,type:v,isExtraCoord:!0,isCalculationCoord:!0,storeDimIndex:i.length+1};o?(s&&(g.storeDimIndex=s.ensureCalculationDimension(d,v),p.storeDimIndex=s.ensureCalculationDimension(f,v)),o.appendCalculationDimension(g),o.appendCalculationDimension(p)):(i.push(g),i.push(p))}return{stackedDimension:u&&u.name,stackedByDimension:c&&c.name,isStackedByIndex:n,stackedOverDimension:d,stackResultDimension:f}}function g2(t){return!Em(t.schema)}function Xa(t,e){return!!e&&e===t.getCalculationInfo("stackedDimension")}function m2(t,e){return Xa(t,e)?t.getCalculationInfo("stackResultDimension"):e}function y2(t,e){var r=t.get("coordinateSystem"),n=Bf.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=ZT(l)}return o})),a||(a=n&&(n.getDimensionsInfo?n.getDimensionsInfo():n.dimensions.slice())||["x","y"]),a}function _2(t,e,r){var n,a;return r&&A(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 zf(t,e,r){r=r||{};var n=e.getSourceManager(),a,i=!1;a=n.getSource(),i=a.sourceFormat===Xt;var o=d2(e),s=y2(e,o),l=r.useEncodeDefaulter,c=ge(l)?l:l?qe(zT,s,e):null,u={coordDimensions:s,generateCoord:r.generateCoord,encodeDefine:e.getEncode(),encodeDefaulter:c,canOmitUnusedDimensions:!i},f=l2(a,u),d=_2(f.dimensions,r.createInvertedIndices,o),h=i?null:n.getSharedDataStore(f),v=p2(e,{schema:f,store:h}),m=new s2(f,e);m.setCalculationInfo(v);var g=d!=null&&b2(a)?function(p,y,b,x){return x===d?b:this.defaultDimValueGetter(p,y,b,x)}:null;return m.hasItemOption=!1,m.initData(i?a:h,null,g),m}function b2(t){if(t.sourceFormat===Xt){var e=x2(t.data||[]);return!ee(Hi(e))}}function x2(t){for(var e=0;e<t.length&&t[e]==null;)e++;return t[e]}var w2=Math.round(Math.random()*10);function bl(t){return[t||"",w2++].join("_")}function S2(t){var e={};t.registerSubTypeDefaulter=function(r,n){var a=br(r);e[a.main]=n},t.determineSubType=function(r,n){var a=n.type;if(!a){var i=br(r).main;t.hasSubTypes(r)&&e[i]&&(a=e[i](n))}return a}}function k2(t,e){t.topologicalTravel=function(i,o,s,l){if(!i.length)return;var c=r(o),u=c.graph,f=c.noEntryList,d={};for(A(i,function(y){d[y]=!0});f.length;){var h=f.pop(),v=u[h],m=!!d[h];m&&(s.call(l,h,v.originalDeps.slice()),delete d[h]),A(v.successor,m?p:g)}A(d,function(){var y="";throw new Error(y)});function g(y){u[y].entryCount--,u[y].entryCount===0&&f.push(y)}function p(y){d[y]=!0,g(y)}};function r(i){var o={},s=[];return A(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),A(f,function(d){Ie(c.predecessor,d)<0&&c.predecessor.push(d);var h=n(o,d);Ie(h.successor,d)<0&&h.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 A(i,function(l){Ie(o,l)>=0&&s.push(l)}),s}}function Ff(t,e){return ke(ke({},t,!0),e,!0)}var T2=Math.log(2);function Hf(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)/T2);return t[r][l]}for(var c=n|1<<r,u=r+1;n&1<<u;)u++;for(var f=0,d=0,h=0;d<s;d++){var v=1<<d;v&a||(f+=(h%2?-1:1)*t[r][d]*Hf(t,e-1,u,c,a|v,i),h++)}return i[o]=f,f}function Hm(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=Hf(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)*Hf(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 Vm="___zrEVENTSAVED",Vf=[];function C2(t,e,r,n,a){return Gf(Vf,e,n,a,!0)&&Gf(t,r,Vf[0],Vf[1])}function Gf(t,e,r,n,a){if(e.getBoundingClientRect&&he.domSupported&&!Gm(e)){var i=e[Vm]||(e[Vm]={}),o=M2(e,i),s=A2(o,i,a);if(s)return s(t,r,n),!0}return!1}function M2(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 A2(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,d=u.left,h=u.top;o.push(d,h),l=l&&i&&d===i[f]&&h===i[f+1],s.push(t[c].offsetLeft,t[c].offsetTop)}return l&&a?a:(e.srcCoords=o,e[n]=r?Hm(s,o):Hm(o,s))}function Gm(t){return t.nodeName.toUpperCase()==="CANVAS"}var D2=/([&<>"'])/g,I2={"&":"&","<":"<",">":">",'"':""","'":"'"};function Mt(t){return t==null?"":(t+"").replace(D2,function(e,r){return I2[r]})}const P2={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:". "}}}},L2={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 xl="ZH",Wf="EN",Za=Wf,wl={},Uf={},Wm=he.domSupported?(function(){var t=(document.documentElement.lang||navigator.language||navigator.browserLanguage||Za).toUpperCase();return t.indexOf(xl)>-1?xl:Za})():Za;function Um(t,e){t=t.toUpperCase(),Uf[t]=new $e(e),wl[t]=e}function R2(t){if(ie(t)){var e=wl[t.toUpperCase()]||{};return t===xl||t===Wf?ye(e):ke(ye(e),ye(wl[Za]),!1)}else return ke(ye(t),ye(wl[Za]),!1)}function E2(t){return Uf[t]}function O2(){return Uf[Za]}Um(Wf,P2),Um(xl,L2);var $f=1e3,Yf=$f*60,ro=Yf*60,Zt=ro*24,$m=Zt*365,no={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}"},Sl="{yyyy}-{MM}-{dd}",Ym={year:"{yyyy}",month:"{yyyy}-{MM}",day:Sl,hour:Sl+" "+no.hour,minute:Sl+" "+no.minute,second:Sl+" "+no.second,millisecond:no.none},qf=["year","month","day","hour","minute","second","millisecond"],qm=["year","half-year","quarter","month","week","half-week","day","half-day","quarter-day","hour","minute","second","millisecond"];function vn(t,e){return t+="","0000".substr(0,e-t.length)+t}function Ka(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 N2(t){return t===Ka(t)}function B2(t){switch(t){case"year":case"month":return"day";case"millisecond":return"millisecond";default:return"second"}}function kl(t,e,r,n){var a=Gr(t),i=a[Xf(r)](),o=a[ja(r)]()+1,s=Math.floor((o-1)/3)+1,l=a[Tl(r)](),c=a["get"+(r?"UTC":"")+"Day"](),u=a[ao(r)](),f=(u-1)%12+1,d=a[Cl(r)](),h=a[Ml(r)](),v=a[Al(r)](),m=u>=12?"pm":"am",g=m.toUpperCase(),p=n instanceof $e?n:E2(n||Wm)||O2(),y=p.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,vn(i%100+"",2)).replace(/{Q}/g,s+"").replace(/{MMMM}/g,b[o-1]).replace(/{MMM}/g,x[o-1]).replace(/{MM}/g,vn(o,2)).replace(/{M}/g,o+"").replace(/{dd}/g,vn(l,2)).replace(/{d}/g,l+"").replace(/{eeee}/g,S[c]).replace(/{ee}/g,w[c]).replace(/{e}/g,c+"").replace(/{HH}/g,vn(u,2)).replace(/{H}/g,u+"").replace(/{hh}/g,vn(f+"",2)).replace(/{h}/g,f+"").replace(/{mm}/g,vn(d,2)).replace(/{m}/g,d+"").replace(/{ss}/g,vn(h,2)).replace(/{s}/g,h+"").replace(/{SSS}/g,vn(v,3)).replace(/{S}/g,v+"")}function z2(t,e,r,n,a){var i=null;if(ie(r))i=r;else if(ge(r))i=r(t.value,e,{level:t.level});else{var o=V({},no);if(t.level>0)for(var s=0;s<qf.length;++s)o[qf[s]]="{primary|"+o[qf[s]]+"}";var l=r?r.inherit===!1?r:De(r,o):o,c=Xm(t.value,a);if(l[c])i=l[c];else if(l.inherit){for(var u=qm.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 kl(new Date(t.value),i,a,n)}function Xm(t,e){var r=Gr(t),n=r[ja(e)]()+1,a=r[Tl(e)](),i=r[ao(e)](),o=r[Cl(e)](),s=r[Ml(e)](),l=r[Al(e)](),c=l===0,u=c&&s===0,f=u&&o===0,d=f&&i===0,h=d&&a===1,v=h&&n===1;return v?"year":h?"month":d?"day":f?"hour":u?"minute":c?"second":"millisecond"}function Zm(t,e,r){var n=He(t)?Gr(t):t;switch(e=e||Xm(t,r),e){case"year":return n[Xf(r)]();case"half-year":return n[ja(r)]()>=6?1:0;case"quarter":return Math.floor((n[ja(r)]()+1)/4);case"month":return n[ja(r)]();case"day":return n[Tl(r)]();case"half-day":return n[ao(r)]()/24;case"hour":return n[ao(r)]();case"minute":return n[Cl(r)]();case"second":return n[Ml(r)]();case"millisecond":return n[Al(r)]()}}function Xf(t){return t?"getUTCFullYear":"getFullYear"}function ja(t){return t?"getUTCMonth":"getMonth"}function Tl(t){return t?"getUTCDate":"getDate"}function ao(t){return t?"getUTCHours":"getHours"}function Cl(t){return t?"getUTCMinutes":"getMinutes"}function Ml(t){return t?"getUTCSeconds":"getSeconds"}function Al(t){return t?"getUTCMilliseconds":"getMilliseconds"}function F2(t){return t?"setUTCFullYear":"setFullYear"}function Km(t){return t?"setUTCMonth":"setMonth"}function jm(t){return t?"setUTCDate":"setDate"}function Qm(t){return t?"setUTCHours":"setHours"}function Jm(t){return t?"setUTCMinutes":"setMinutes"}function ey(t){return t?"setUTCSeconds":"setSeconds"}function ty(t){return t?"setUTCMilliseconds":"setMilliseconds"}function ry(t){if(!KS(t))return ie(t)?t:"-";var e=(t+"").split(".");return e[0].replace(/(\d{1,3})(?=(?:\d{3})+(?!\d))/g,"$1,")+(e.length>1?"."+e[1]:"")}function ny(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 Dl=Qv;function Zf(t,e,r){var n="{yyyy}-{MM}-{dd} {HH}:{mm}:{ss}";function a(u){return u&&_r(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?Gr(t):t;if(isNaN(+l)){if(s)return"-"}else return kl(l,n,r)}if(e==="ordinal")return ru(t)?a(t):He(t)&&i(t)?t+"":"-";var c=Ws(t);return i(c)?ry(c):ru(t)?a(t):typeof t=="boolean"?t+"":"-"}var ay=["a","b","c","d","e","f","g"],Kf=function(t,e){return"{"+t+(e??"")+"}"};function iy(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=ay[i];t=t.replace(Kf(o),Kf(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(Kf(ay[l],s),r?Mt(c):c)}return t}function H2(t,e){var r=ie(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:'+Mt(n)+";"+(e||"")+'"></span>':'<span style="display:inline-block;margin-right:4px;border-radius:10px;width:10px;height:10px;background-color:'+Mt(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 na(t,e){return e=e||"transparent",ie(t)?t:ce(t)&&t.colorStops&&(t.colorStops[0]||{}).color||e}var Il=A,V2=["left","right","top","bottom","width","height"],Pl=[["width","left","right"],["height","top","bottom"]];function jf(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),d=f&&f.getBoundingRect(),h,v;if(t==="horizontal"){var m=u.width+(d?-d.x+u.x:0);h=i+m,h>n||l.newline?(i=0,h=m,o+=s+r,s=u.height):s=Math.max(s,u.height)}else{var g=u.height+(d?-d.y+u.y:0);v=o+g,v>a||l.newline?(i+=s+r,o=0,v=g,s=u.width):s=Math.max(s,u.width)}l.newline||(l.x=i,l.y=o,l.markRedraw(),t==="horizontal"?i=h+r:o=v+r)})}var io=jf;qe(jf,"vertical"),qe(jf,"horizontal");function Ll(t,e,r){r=Dl(r||0);var n=e.width,a=e.height,i=mt(t.left,n),o=mt(t.top,a),s=mt(t.right,n),l=mt(t.bottom,a),c=mt(t.width,n),u=mt(t.height,a),f=r[2]+r[0],d=r[1]+r[3],h=t.aspect;switch(isNaN(c)&&(c=n-s-d-i),isNaN(u)&&(u=a-l-f-o),h!=null&&(isNaN(c)&&isNaN(u)&&(h>n/a?c=n*.8:u=a*.8),isNaN(c)&&(c=h*u),isNaN(u)&&(u=c/h)),isNaN(i)&&(i=n-s-c-d),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-d;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-d-i-(s||0)),isNaN(u)&&(u=a-f-o-(l||0));var v=new Pe(i+r[3],o+r[0],c,u);return v.margin=r,v}function oo(t){var e=t.layoutMode||t.constructor.layoutMode;return ce(e)?e:e?{type:e}:null}function Qa(t,e,r){var n=r&&r.ignoreSize;!ee(n)&&(n=[n,n]);var a=o(Pl[0],0),i=o(Pl[1],1);c(Pl[0],t,a),c(Pl[1],t,i);function o(u,f){var d={},h=0,v={},m=0,g=2;if(Il(u,function(b){v[b]=t[b]}),Il(u,function(b){s(e,b)&&(d[b]=v[b]=e[b]),l(d,b)&&h++,l(v,b)&&m++}),n[f])return l(e,u[1])?v[u[2]]=null:l(e,u[2])&&(v[u[1]]=null),v;if(m===g||!h)return v;if(h>=g)return d;for(var p=0;p<u.length;p++){var y=u[p];if(!s(d,y)&&s(t,y)){d[y]=t[y];break}}return d}function s(u,f){return u.hasOwnProperty(f)}function l(u,f){return u[f]!=null&&u[f]!=="auto"}function c(u,f,d){Il(u,function(h){f[h]=d[h]})}}function Rl(t){return G2({},t)}function G2(t,e){return e&&t&&Il(V2,function(r){e.hasOwnProperty(r)&&(t[r]=e[r])}),t}var W2=Xe(),Oe=(function(t){G(e,t);function e(r,n,a){var i=t.call(this,r,n,a)||this;return i.uid=bl("ec_cpt_model"),i}return e.prototype.init=function(r,n,a){this.mergeDefaultAndTheme(r,a)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=oo(this),i=a?Rl(r):{},o=n.getTheme();ke(r,o.get(this.mainType)),ke(r,this.getDefaultOption()),a&&Qa(r,i,a)},e.prototype.mergeOption=function(r,n){ke(this.option,r,!0);var a=oo(this);a&&Qa(this.option,r,a)},e.prototype.optionUpdated=function(r,n){},e.prototype.getDefaultOption=function(){var r=this.constructor;if(!pw(r))return r.defaultOption;var n=W2(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=ke(s,a[l],!0);n.defaultOption=s}return n.defaultOption},e.prototype.getReferringComponents=function(r,n){var a=r+"Index",i=r+"Id";return Wi(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})($e);np(Oe,$e),ds(Oe),S2(Oe),k2(Oe,U2);function U2(t){var e=[];return A(Oe.getClassesByMainType(t),function(r){e=e.concat(r.dependencies||r.prototype.dependencies||[])}),e=ue(e,function(r){return br(r).main}),t!=="dataset"&&Ie(e,"dataset")<=0&&e.unshift("dataset"),e}var oy=Xe(),$2=Xe(),Qf=(function(){function t(){}return t.prototype.getColorFromPalette=function(e,r,n){var a=ut(this.get("color",!0)),i=this.get("colorLayer",!0);return ly(this,oy,a,i,e,r,n)},t.prototype.clearColorPalette=function(){q2(this,oy)},t})();function sy(t,e,r,n){var a=ut(t.get(["aria","decal","decals"]));return ly(t,$2,a,null,e,r,n)}function Y2(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 ly(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:Y2(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 X2=/\{@(.+?)\}/g,Z2=(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,d=f==="series",h=n.userOutput&&n.userOutput.get();return{componentType:f,componentSubType:this.subType,componentIndex:this.componentIndex,seriesType:d?this.subType:null,seriesIndex:this.seriesIndex,seriesId:d?this.id:null,seriesName:d?this.name:null,name:o,dataIndex:i,data:s,dataType:r,value:a,color:c,borderColor:u,dimensionNames:h?h.fullDimensions:null,encode:h?h.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(ge(i))return l.status=r,l.dimensionIndex=a,i(l);if(ie(i)){var u=iy(i,l);return u.replace(X2,function(f,d){var h=d.length,v=d;v.charAt(0)==="["&&v.charAt(h-1)==="]"&&(v=+v.slice(1,h-1));var m=Ua(s,e,v);if(o&&ee(o.interpolatedValue)){var g=s.getDimensionIndex(v);g>=0&&(m=o.interpolatedValue[g])}return m!=null?m+"":""})}},t.prototype.getRawValue=function(e,r){return Ua(this.getData(r),e)},t.prototype.formatTooltip=function(e,r,n){},t})();function cy(t){var e,r;return ce(t)?t.type&&(r=t):e=t,{text:e,frag:r}}function so(t){return new K2(t)}var K2=(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 d=e&&e.step;if(r?this._dueEnd=r._outputDueEnd:this._dueEnd=this._count?this._count(this.context):1/0,this._progress){var h=this._dueIndex,v=Math.min(d!=null?this._dueIndex+d:1/0,this._dueEnd);if(!n&&(f||h<v)){var m=this._progress;if(ee(m))for(var g=0;g<m.length;g++)this._doProgress(m[g],h,v,l,c);else this._doProgress(m,h,v,l,c)}this._dueIndex=v;var p=this._settedOutputEnd!=null?this._settedOutputEnd:v;this._outputDueEnd=p}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){uy.reset(r,n,a,i),this._callingProgress=e,this._callingProgress({start:r,end:n,count:n-r,next:uy.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})(),uy=(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}})(),j2=(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 ml(e,r)},t})();function Q2(t,e){var r=new j2,n=t.data,a=r.sourceFormat=t.sourceFormat,i=t.startIndex,o="";t.seriesLayoutBy!==Yr&&St(o);var s=[],l={},c=t.dimensionsDefine;if(c)A(c,function(m,g){var p=m.name,y={index:g,name:p,displayName:m.displayName};if(s.push(y),p!=null){var b="";In(l,p)&&St(b),l[p]=y}});else for(var u=0;u<t.dimensionsDetectedCount;u++)s.push({index:u});var f=Tm(a,Yr);e.__isBuiltIn&&(r.getRawDataItem=function(m){return f(n,i,s,m)},r.getRawData=Ce(J2,null,t)),r.cloneRawData=Ce(eC,null,t);var d=Mm(a,Yr);r.count=Ce(d,null,n,i,s);var h=Am(a);r.retrieveValue=function(m,g){var p=f(n,i,s,m);return v(p,g)};var v=r.retrieveValueFromItem=function(m,g){if(m!=null){var p=s[g];if(p)return h(m,g,p.name)}};return r.getDimensionInfo=Ce(tC,null,s,l),r.cloneAllDimensionInfo=Ce(rC,null,s),r}function J2(t){var e=t.sourceFormat;if(!Jf(e)){var r="";St(r)}return t.data}function eC(t){var e=t.sourceFormat,r=t.data;if(!Jf(e)){var n="";St(n)}if(e===Ct){for(var a=[],i=0,o=r.length;i<o;i++)a.push(r[i].slice());return a}else if(e===Ar){for(var a=[],i=0,o=r.length;i<o;i++)a.push(V({},r[i]));return a}}function tC(t,e,r){if(r!=null){if(He(r)||!isNaN(r)&&!In(e,r))return t[r];if(In(e,r))return e[r]}}function rC(t){return ye(t)}var fy=fe();function nC(t){t=ye(t);var e=t.type,r="";e||St(r);var n=e.split(":");n.length!==2&&St(r);var a=!1;n[0]==="echarts"&&(e=n[1],a=!0),t.__isBuiltIn=a,fy.set(e,t)}function aC(t,e,r){var n=ut(t),a=n.length,i="";a||St(i);for(var o=0,s=a;o<s;o++){var l=n[o];e=iC(l,e),o!==s-1&&(e.length=Math.max(e.length,1))}return e}function iC(t,e,r,n){var a="";e.length||St(a),ce(t)||St(a);var i=t.type,o=fy.get(i);o||St(a);var s=ue(e,function(c){return Q2(c,o)}),l=ut(o.transform({upstream:s[0],upstreamList:s,config:ye(t.config)}));return ue(l,function(c,u){var f="";ce(c)||St(f),c.data||St(f);var d=mm(c.data);Jf(d)||St(f);var h,v=e[0];if(v&&u===0&&!c.dimensions){var m=v.startIndex;m&&(c.data=v.data.slice(0,m).concat(c.data)),h={seriesLayoutBy:Yr,sourceHeader:m,dimensions:v.metaRawOption.dimensions}}else h={seriesLayoutBy:Yr,sourceHeader:0,dimensions:c.dimensions};return Af(c.data,h,null)})}function Jf(t){return t===Ct||t===Ar}var oC=(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(El(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=bt(s)?hn:Xt,i=[];var f=this._getSourceMetaRawOption()||{},d=c&&c.metaRawOption||{},h=_e(f.seriesLayoutBy,d.seriesLayoutBy)||null,v=_e(f.sourceHeader,d.sourceHeader),m=_e(f.dimensions,d.dimensions),g=h!==d.seriesLayoutBy||!!v!=!!d.sourceHeader||m;a=g?[Af(s,{seriesLayoutBy:h,sourceHeader:v,dimensions:m},l)]:[]}else{var p=e;if(n){var y=this._applyTransform(r);a=y.sourceList,i=y.upstreamSignList}else{var b=p.get("source",!0);a=[Af(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&&hy(i)}var o,s=[],l=[];return A(e,function(c){c.prepareSource();var u=c.getSource(a||0),f="";a!=null&&!u&&hy(f),s.push(u),l.push(c._getVersionSign())}),n?o=aC(n,s,{datasetIndex:r.componentIndex}):a!=null&&(o=[VT(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];El(this._sourceHost)&&l?s=l._innerGetDataStore(e,r,n):(s=new Rf,s.initData(new Sm(r,e.length),e)),o[n]=s}return s},t.prototype._getUpstreamSourceManagers=function(){var e=this._sourceHost;if(El(e)){var r=vm(e);return r?[r.getSourceManager()]:[]}else return ue(FT(e),function(n){return n.getSourceManager()})},t.prototype._getSourceMetaRawOption=function(){var e=this._sourceHost,r,n,a;if(El(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 El(t){return t.mainType==="series"}function hy(t){throw new Error(t)}var sC="line-height:1";function dy(t){var e=t.lineHeight;return e==null?sC:"line-height:"+Mt(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:"+Mt(n+"")+"px;color:"+Mt(r)+";font-weight:"+Mt(a+""),valueStyle:"font-size:"+Mt(o+"")+"px;color:"+Mt(i)+";font-weight:"+Mt(s+"")}:{nameStyle:{fontSize:n,fill:r,fontWeight:a},valueStyle:{fontSize:o,fill:i,fontWeight:s}}}var lC=[0,10,20,30],cC=["",`
|
|
13
|
+
`,`
|
|
14
|
+
|
|
15
|
+
`,`
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
`];function lo(t,e){return e.type=t,e}function eh(t){return t.type==="section"}function py(t){return eh(t)?uC:fC}function gy(t){if(eh(t)){var e=0,r=t.blocks.length,n=r>1||r>0&&!t.noHeader;return A(t.blocks,function(a){var i=gy(a);i>=e&&(e=i+ +(n&&(!i||eh(a)&&!a.noHeader)))}),e}return 0}function uC(t,e,r,n){var a=e.noHeader,i=hC(gy(e)),o=[],s=e.blocks||[];Br(!s||ee(s)),s=s||[];var l=t.orderMode;if(e.sortBlocks&&l){s=s.slice();var c={valueAsc:"asc",valueDesc:"desc"};if(In(c,l)){var u=new jT(c[l],null);s.sort(function(m,g){return u.evaluate(m.sortParam,g.sortParam)})}else l==="seriesDesc"&&s.reverse()}A(s,function(m,g){var p=e.valueFormatter,y=py(m)(p?V(V({},t),{valueFormatter:p}):t,m,g>0?i.html:0,n);y!=null&&o.push(y)});var f=t.renderMode==="richText"?o.join(i.richText):th(n,o.join(""),a?r:i.html);if(a)return f;var d=Zf(e.header,"ordinal",t.useUTC),h=vy(n,t.renderMode).nameStyle,v=dy(n);return t.renderMode==="richText"?yy(t,d,h)+i.richText+f:th(n,'<div style="'+h+";"+v+';">'+Mt(d)+"</div>"+f,r)}function fC(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 Zf(S,ee(h)?h[w]:h,c)})};if(!(i&&o)){var f=s?"":t.markupStyleCreator.makeTooltipMarker(e.markerType,e.markerColor||"#333",a),d=i?"":Zf(l,"ordinal",c),h=e.valueType,v=o?[]:u(e.value,e.dataIndex),m=!s||!i,g=!s&&i,p=vy(n,a),y=p.nameStyle,b=p.valueStyle;return a==="richText"?(s?"":f)+(i?"":yy(t,d,y))+(o?"":pC(t,v,m,g,b)):th(n,(s?"":f)+(i?"":dC(d,!s,y))+(o?"":vC(v,m,g,b)),r)}}function my(t,e,r,n,a,i){if(t){var o=py(t),s={useUTC:a,renderMode:r,orderMode:n,markupStyleCreator:e,valueFormatter:t.valueFormatter};return o(s,t,0,i)}}function hC(t){return{html:lC[t],richText:cC[t]}}function th(t,e,r){var n='<div style="clear:both"></div>',a="margin: "+r+"px 0 0",i=dy(t);return'<div style="'+a+";"+i+';">'+e+n+"</div>"}function dC(t,e,r){var n=e?"margin-left:2px":"";return'<span style="'+r+";"+n+'">'+Mt(t)+"</span>"}function vC(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 Mt(o)}).join(" ")+"</span>"}function yy(t,e,r){return t.markupStyleCreator.wrapRichTextStyle(e,r)}function pC(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 gC(t,e){var r=t.getData().getItemVisual(e,"style"),n=r[t.visualDrawType];return na(n)}function _y(t,e){var r=t.get("padding");return r??(e==="richText"?[8,10]:10)}var rh=(function(){function t(){this.richTextStyles={},this._nextStyleNameId=ig()}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=H2({color:r,type:e,renderMode:n,markerId:a});return ie(i)?i:(this.richTextStyles[a]=i.style,i.content)},t.prototype.wrapRichTextStyle=function(e,r){var n={};ee(r)?A(r,function(i){return V(n,i)}):V(n,r);var a=this._generateStyleName();return this.richTextStyles[a]=n,"{"+a+"|"+e+"}"},t})();function mC(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=gC(e,r),u,f,d,h;if(o>1||l&&!o){var v=yC(s,e,r,i,c);u=v.inlineValues,f=v.inlineValueTypes,d=v.blocks,h=v.inlineValues[0]}else if(o){var m=a.getDimensionInfo(i[0]);h=u=Ua(a,r,i[0]),f=m.type}else h=u=l?s[0]:s;var g=Zu(e),p=g&&e.name||"",y=a.getName(r),b=n?p:y;return lo("section",{header:p,noHeader:n||!g,sortParam:h,blocks:[lo("nameValue",{markerType:"item",markerColor:c,name:b,noName:!_r(b),value:u,valueType:f,dataIndex:r})].concat(d||[])})}function yC(t,e,r,n,a){var i=e.getData(),o=Sa(t,function(f,d,h){var v=i.getDimensionInfo(h);return f=f||v&&v.tooltip!==!1&&v.displayName!=null},!1),s=[],l=[],c=[];n.length?A(n,function(f){u(Ua(i,r,f),f)}):A(t,u);function u(f,d){var h=i.getDimensionInfo(d);!h||h.otherDims.tooltip===!1||(o?c.push(lo("nameValue",{markerType:"subItem",markerColor:a,name:h.displayName,value:f,valueType:h.type})):(s.push(f),l.push(h.type)))}return{inlineValues:s,inlineValueTypes:l,blocks:c}}var pn=Xe();function Ol(t,e){return t.getName(e)||t.getId(e)}var _C="__universalTransitionEnabled",Dr=(function(t){G(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=so({count:xC,reset:wC}),this.dataTask.context={model:this},this.mergeDefaultAndTheme(r,a);var i=pn(this).sourceManager=new oC(this);i.prepareSource();var o=this.getInitialData(r,a);xy(o,this),this.dataTask.context.data=o,pn(this).dataBeforeProcessed=o,by(this),this._initSelectedMapFromData(o)},e.prototype.mergeDefaultAndTheme=function(r,n){var a=oo(this),i=a?Rl(r):{},o=this.subType;Oe.hasClass(o)&&(o+="Series"),ke(r,n.getTheme().get(this.subType)),ke(r,this.getDefaultOption()),ug(r,"label",["show"]),this.fillDataTextStyle(r.data),a&&Qa(r,i,a)},e.prototype.mergeOption=function(r,n){r=ke(this.option,r,!0),this.fillDataTextStyle(r.data);var a=oo(this);a&&Qa(this.option,r,a);var i=pn(this).sourceManager;i.dirty(),i.prepareSource();var o=this.getInitialData(r,n);xy(o,this),this.dataTask.dirty(),this.dataTask.context.data=o,pn(this).dataBeforeProcessed=o,by(this),this._initSelectedMapFromData(o)},e.prototype.fillDataTextStyle=function(r){if(r&&!bt(r))for(var n=["show"],a=0;a<r.length;a++)r[a]&&r[a].label&&ug(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=nh(this);if(n){var a=n.context.data;return r==null||!a.getLinkedData?a:a.getLinkedData(r)}else return pn(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=nh(this);if(n){var a=n.context;a.outputData=r,n!==this.dataTask&&(a.data=r)}pn(this).data=r},e.prototype.getEncode=function(){var r=this.get("encode",!0);if(r)return fe(r)},e.prototype.getSourceManager=function(){return pn(this).sourceManager},e.prototype.getSource=function(){return this.getSourceManager().getSource()},e.prototype.getRawData=function(){return pn(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 mC({series:this,dataIndex:r,multipleSeries:n})},e.prototype.isAnimationEnabled=function(){var r=this.ecModel;if(he.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=Qf.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=Ol(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[Ol(i,r)])&&!i.getItemModel(r).get(["select","disabled"])},e.prototype.isUniversalTransitionEnabled=function(){if(this[_C])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],d=Ol(r,f);c[d]=!0,this._selectedDataIndicesMap[d]=r.getRawIndex(f)}}else if(s==="single"||s===!0){var h=n[l-1],d=Ol(r,h);o.selectedMap=(a={},a[d]=!0,a),this._selectedDataIndicesMap=(i={},i[d]=r.getRawIndex(h),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 Oe.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})(Oe);yr(Dr,Z2),yr(Dr,Qf),np(Dr,Oe);function by(t){var e=t.name;Zu(t)||(t.name=bC(t)||e)}function bC(t){var e=t.getRawData(),r=e.mapDimensionsAll("seriesName"),n=[];return A(r,function(a){var i=e.getDimensionInfo(a);i.displayName&&n.push(i.displayName)}),n.join(" ")}function xC(t){return t.model.getRawData().count()}function wC(t){var e=t.model;return e.setData(e.getRawData().cloneShallow()),SC}function SC(t,e){e.outputData&&t.end>e.outputData.count()&&e.model.getRawData().cloneShallow(e.outputData)}function xy(t,e){A(lw(t.CHANGABLE_METHODS,t.DOWNSAMPLE_METHODS),function(r){t.wrapMethod(r,qe(kC,e))})}function kC(t,e){var r=nh(t);return r&&r.setOutputEnd((e||this).count()),e}function nh(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 TC=Ee.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()}}),CC=Ee.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()}}),MC=Ee.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),d=Math.cos(c),h=o*.6,v=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*h,l+s+d*h,r,n-v,r,n),t.bezierCurveTo(r,n-v,r-u+f*h,l+s+d*h,r-u,l+s),t.closePath()}}),AC=Ee.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()}}),DC={line:fn,rect:nt,roundRect:nt,square:nt,circle:el,diamond:CC,pin:MC,arrow:AC,triangle:TC},IC={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}},ah={};A(DC,function(t,e){ah[e]=new t});var PC=Ee.extend({type:"symbol",shape:{symbolType:"",x:0,y:0,width:0,height:0},calculateTextPosition:function(t,e,r){var n=ms(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=ah[n];a||(n="rect",a=ah[n]),IC[n](e.x,e.y,e.width,e.height,a.shape),a.buildPath(t,a.shape,r)}}});function LC(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=Zg(t.slice(8),new Pe(e,r,n,a),o?"center":"cover"):t.indexOf("path://")===0?l=xf(t.slice(7),{},new Pe(e,r,n,a),o?"center":"cover"):l=new PC({shape:{symbolType:t,x:e,y:r,width:n,height:a}}),l.__isEmptyBrush=s,l.setColor=LC,i&&l.setColor(i),l}function RC(t){return ee(t)||(t=[+t,+t]),[t[0]||0,t[1]||0]}function wy(t,e){if(t!=null)return ee(t)||(t=[t,t]),[mt(t[0],e[0])||0,mt(_e(t[1],t[0]),e[1])||0]}var EC=(function(t){G(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 zf(null,this,{useEncodeDefaulter:!0})},e.prototype.getLegendIcon=function(r){var n=new lt,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})(Dr);function ih(t,e){var r=t.mapDimensionsAll("defaultedLabel"),n=r.length;if(n===1){var a=Ua(t,e,r[0]);return a!=null?a+"":null}else if(n){for(var i=[],o=0;o<r.length;o++)i.push(Ua(t,e,r[o]));return i.join(" ")}}function Sy(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 oh=(function(t){G(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=OC,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(){Zs(this.childAt(0))},e.prototype.downplay=function(){Ks(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 d=this.childAt(0);d.silent=!1;var h={scaleX:l[0]/2,scaleY:l[1]/2};u?d.attr(h):Nt(d,h,s,n),Xg(d)}if(this._updateCommon(r,n,l,a,i),c){var d=this.childAt(0);if(!u){var h={scaleX:this._sizeX,scaleY:this._sizeY,style:{opacity:d.style.opacity}};d.scaleX=d.scaleY=0,d.style.opacity=0,Ur(d,h,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,d,h,v,m,g,p;if(i&&(c=i.emphasisItemStyle,u=i.blurItemStyle,f=i.selectItemStyle,d=i.focus,h=i.blurScope,m=i.labelStatesModels,g=i.hoverScale,p=i.cursorStyle,v=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(),d=b.get("focus"),h=b.get("blurScope"),v=b.get("disabled"),m=dl(y),g=b.getShallow("scale"),p=y.getShallow("cursor")}var x=r.getItemVisual(n,"symbolRotate");s.attr("rotation",(x||0)*Math.PI/180||0);var S=wy(r.getItemVisual(n,"symbolOffset"),a);S&&(s.x=S[0],s.y=S[1]),p&&s.attr("cursor",p);var w=r.getItemVisual(n,"style"),k=w.fill;if(s instanceof un){var T=s.style;s.useStyle(V({image:T.image,x:T.x,y:T.y,width:T.width,height:T.height},w))}else s.__isEmptyBrush?s.useStyle(V({},w)):s.useStyle(w),s.style.decal=null,s.setColor(k,o&&o.symbolInnerColor),s.style.strokeNoScale=!0;var M=r.getItemVisual(n,"liftZ"),D=this._z2;M!=null?D==null&&(this._z2=s.z2,s.z2+=M):D!=null&&(s.z2=D,this._z2=null);var C=o&&o.useNameLabel;hl(s,m,{labelFetcher:l,labelDataIndex:n,defaultText:I,inheritColor:k,defaultOpacity:w.opacity});function I(R){return C?r.getName(R):ih(r,R)}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 L=g==null||g===!0?Math.max(1.1,3/this._sizeY):isFinite(g)&&g>0?+g:1;P.scaleX=this._sizeX*L,P.scaleY=this._sizeY*L,this.setSymbolScale(1),js(this,d,h,v)},e.prototype.setSymbolScale=function(r){this.scaleX=this.scaleY=r},e.prototype.fadeOut=function(r,n,a){var i=this.childAt(0),o=Re(this).dataIndex,s=a&&a.animation;if(this.silent=i.silent=!0,a&&a.fadeLabel){var l=i.getTextContent();l&&ol(l,{style:{opacity:0}},n,{dataIndex:o,removeOpt:s,cb:function(){i.removeTextContent()}})}else i.removeTextContent();ol(i,{style:{opacity:0},scaleX:0,scaleY:0},n,{dataIndex:o,cb:r,removeOpt:s})},e.getSymbolSize=function(r,n){return RC(r.getItemVisual(n,"symbolSize"))},e})(lt);function OC(t,e){this.parent.drift(t,e)}function sh(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 ky(t){return t!=null&&!ce(t)&&(t={isIgnore:t}),t||{}}function Ty(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:dl(e),cursorStyle:e.get("cursor")}}var NC=(function(){function t(e){this.group=new lt,this._SymbolCtor=e||oh}return t.prototype.updateData=function(e,r){this._progressiveEls=null,r=ky(r);var n=this.group,a=e.hostModel,i=this._data,o=this._SymbolCtor,s=r.disableAnimation,l=Ty(e),c={disableAnimation:s},u=r.getSymbolPoint||function(f){return e.getItemLayout(f)};i||n.removeAll(),e.diff(i).add(function(f){var d=u(f);if(sh(e,d,f,r)){var h=new o(e,f,l,c);h.setPosition(d),e.setItemGraphicEl(f,h),n.add(h)}}).update(function(f,d){var h=i.getItemGraphicEl(d),v=u(f);if(!sh(e,v,f,r)){n.remove(h);return}var m=e.getItemVisual(f,"symbol")||"circle",g=h&&h.getSymbolType&&h.getSymbolType();if(!h||g&&g!==m)n.remove(h),h=new o(e,f,l,c),h.setPosition(v);else{h.updateData(e,f,l,c);var p={x:v[0],y:v[1]};s?h.attr(p):Nt(h,p,a)}n.add(h),e.setItemGraphicEl(f,h)}).remove(function(f){var d=i.getItemGraphicEl(f);d&&d.fadeOut(function(){n.remove(d)},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=Ty(e),this._data=null,this.group.removeAll()},t.prototype.incrementalUpdate=function(e,r,n){this._progressiveEls=[],n=ky(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(sh(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){ul(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 Cy(t,e,r){var n=t.getBaseAxis(),a=t.getOtherAxis(n),i=BC(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(v){return e.mapDimension(v)}),d=!1,h=e.getCalculationInfo("stackResultDimension");return Xa(e,f[0])&&(d=!0,f[0]=h),Xa(e,f[1])&&(d=!0,f[1]=h),{dataDimsForPoint:f,valueStart:i,valueAxisDim:s,baseAxisDim:o,stacked:!!d,valueDim:l,baseDim:c,baseDataOffset:u,stackedOverDimension:e.getCalculationInfo("stackedOverDimension")}}function BC(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 My(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 Ay=typeof Float32Array<"u",zC=Ay?Float32Array:Array;function qr(t){return ee(t)?Ay?new Float32Array(t):t:new zC(t)}function FC(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 HC(t,e,r,n,a,i,o,s){for(var l=FC(t,e),c=[],u=[],f=[],d=[],h=[],v=[],m=[],g=Cy(a,e,o),p=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=p[w],M=p[w+1],D=y[k],C=y[k+1];(isNaN(T)||isNaN(M))&&(T=D,M=C),c.push(T,M),u.push(D,C),f.push(r[w],r[w+1]),d.push(n[k],n[k+1]),m.push(e.getRawIndex(x.idx1));break;case"+":var I=x.idx,P=g.dataDimsForPoint,L=a.dataToPoint([e.get(P[0],I),e.get(P[1],I)]);k=I*2,c.push(L[0],L[1]),u.push(y[k],y[k+1]);var R=My(g,a,e,I);f.push(R[0],R[1]),d.push(n[k],n[k+1]),m.push(e.getRawIndex(I));break;case"-":S=!1}S&&(h.push(x),v.push(v.length))}v.sort(function(xe,et){return m[xe]-m[et]});for(var N=c.length,Z=qr(N),F=qr(N),z=qr(N),W=qr(N),ne=[],b=0;b<v.length;b++){var te=v[b],de=b*2,be=te*2;Z[de]=c[be],Z[de+1]=c[be+1],F[de]=u[be],F[de+1]=u[be+1],z[de]=f[be],z[de+1]=f[be+1],W[de]=d[be],W[de+1]=d[be+1],ne[b]=h[te]}return{current:Z,next:F,stackedOnCurrent:z,stackedOnNext:W,status:ne}}var gn=Math.min,mn=Math.max;function aa(t,e){return isNaN(t)||isNaN(e)}function lh(t,e,r,n,a,i,o,s,l){for(var c,u,f,d,h,v,m=r,g=0;g<n;g++){var p=e[m*2],y=e[m*2+1];if(m>=a||m<0)break;if(aa(p,y)){if(l){m+=i;continue}break}if(m===r)t[i>0?"moveTo":"lineTo"](p,y),f=p,d=y;else{var b=p-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===p&&k===y&&g<n;)g++,S+=i,m+=i,w=e[S*2],k=e[S*2+1],p=e[m*2],y=e[m*2+1],b=p-c,x=y-u;var T=g+1;if(l)for(;aa(w,k)&&T<n;)T++,S+=i,w=e[S*2],k=e[S*2+1];var M=.5,D=0,C=0,I=void 0,P=void 0;if(T>=n||aa(w,k))h=p,v=y;else{D=w-c,C=k-u;var L=p-c,R=w-p,N=y-u,Z=k-y,F=void 0,z=void 0;if(s==="x"){F=Math.abs(L),z=Math.abs(R);var W=D>0?1:-1;h=p-W*F*o,v=y,I=p+W*z*o,P=y}else if(s==="y"){F=Math.abs(N),z=Math.abs(Z);var ne=C>0?1:-1;h=p,v=y-ne*F*o,I=p,P=y+ne*z*o}else F=Math.sqrt(L*L+N*N),z=Math.sqrt(R*R+Z*Z),M=z/(z+F),h=p-D*o*(1-M),v=y-C*o*(1-M),I=p+D*o*M,P=y+C*o*M,I=gn(I,mn(w,p)),P=gn(P,mn(k,y)),I=mn(I,gn(w,p)),P=mn(P,gn(k,y)),D=I-p,C=P-y,h=p-D*F/z,v=y-C*F/z,h=gn(h,mn(c,p)),v=gn(v,mn(u,y)),h=mn(h,gn(c,p)),v=mn(v,gn(u,y)),D=p-h,C=y-v,I=p+D*z/F,P=y+C*z/F}t.bezierCurveTo(f,d,h,v,p,y),f=I,d=P}else t.lineTo(p,y)}c=p,u=y,m+=i}return g}var Dy=(function(){function t(){this.smooth=0,this.smoothConstraint=!0}return t})(),VC=(function(t){G(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 Dy},e.prototype.buildPath=function(r,n){var a=n.points,i=0,o=a.length/2;if(n.connectNulls){for(;o>0&&aa(a[o*2-2],a[o*2-1]);o--);for(;i<o&&aa(a[i*2],a[i*2+1]);i++);}for(;i<o;)i+=lh(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=Un.CMD,s,l,c=n==="x",u=[],f=0;f<i.length;){var d=i[f++],h=void 0,v=void 0,m=void 0,g=void 0,p=void 0,y=void 0,b=void 0;switch(d){case o.M:s=i[f++],l=i[f++];break;case o.L:if(h=i[f++],v=i[f++],b=c?(r-s)/(h-s):(r-l)/(v-l),b<=1&&b>=0){var x=c?(v-l)*b+l:(h-s)*b+s;return c?[r,x]:[x,r]}s=h,l=v;break;case o.C:h=i[f++],v=i[f++],m=i[f++],g=i[f++],p=i[f++],y=i[f++];var S=c?xs(s,h,m,p,r,u):xs(l,v,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?st(l,v,g,y,k):st(s,h,m,p,k);return c?[r,x]:[x,r]}}s=p,l=y;break}}},e})(Ee),GC=(function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(Dy),WC=(function(t){G(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 GC},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&&aa(a[s*2-2],a[s*2-1]);s--);for(;o<s&&aa(a[o*2],a[o*2+1]);o++);}for(;o<s;){var c=lh(r,a,o,s,s,1,n.smooth,l,n.connectNulls);lh(r,i,o+c-1,c,s,-1,n.stackedOnSmooth,l,n.connectNulls),o+=c+1,r.closePath()}},e})(Ee);function ch(){var t=Xe();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 Iy=Xe(),UC=ch(),ir=(function(){function t(){this.group=new lt,this.uid=bl("viewChart"),this.renderTask=so({plan:$C,reset:YC}),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&&Ly(i,a,"emphasis")},t.prototype.downplay=function(e,r,n,a){var i=e.getData(a&&a.dataType);i&&Ly(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){ul(this.group,e)},t.markUpdateMethod=function(e,r){Iy(e).updateMethod=r},t.protoInitialize=(function(){var e=t.prototype;e.type="chart"})(),t})();function Py(t,e,r){t&&lf(t)&&(e==="emphasis"?Zs:Ks)(t,r)}function Ly(t,e,r){var n=Zn(t,e),a=e&&e.highlightKey!=null?Lk(e.highlightKey):null;n!=null?A(ut(n),function(i){Py(t.getItemGraphicEl(i),r,a)}):t.eachItemGraphicEl(function(i){Py(i,r,a)})}iu(ir),ds(ir);function $C(t){return UC(t.model)}function YC(t){var e=t.model,r=t.ecModel,n=t.api,a=t.payload,i=e.pipelineContext.progressiveRender,o=t.view,s=a&&Iy(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 Ry(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 nt({shape:{x:o,y:s,width:l,height:c}});if(e){var d=t.getBaseAxis(),h=d.isHorizontal(),v=d.inverse;h?(v&&(f.shape.x+=l),f.shape.width=0):(v||(f.shape.y+=c),f.shape.height=0);var m=ge(a)?function(g){a(g,f)}:null;Ur(f,{shape:{width:l,height:c,x:o,y:s}},r,null,n,m)}return f}function Ey(t,e,r){var n=t.getArea(),a=Je(n.r0,1),i=Je(n.r,1),o=new Va({shape:{cx:Je(t.cx,1),cy:Je(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 XC(t,e,r,n,a){if(t){if(t.type==="polar")return Ey(t,e,r);if(t.type==="cartesian2d")return Ry(t,e,r,n,a)}else return null;return null}function uh(t,e){return t.type===e}function Oy(t,e){if(t.length===e.length){for(var r=0;r<t.length;r++)if(t[r]!==e[r])return;return!0}}function Ny(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 By(t,e){var r=Ny(t),n=r[0],a=r[1],i=Ny(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 zy(t){return He(t)?t:t?.5:0}function ZC(t,e,r){if(!r.valueDim)return[];for(var n=e.count(),a=qr(n*2),i=0;i<n;i++){var o=My(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=[],d=[];if(a){for(l=0;l<t.length;l+=2){var h=e||t;!isNaN(h[l])&&!isNaN(h[l+1])&&d.push(t[l],t[l+1])}t=d}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 v=(u[o]+f[o])/2,m=[];c[o]=m[o]=v,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 KC(t,e){var r=[],n=t.length,a,i;function o(u,f,d){var h=u.coord,v=(d-h)/(f.coord-h),m=Qw(v,[u.color,f.color]);return{coord:d,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 jC(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 d=KC(c,a==="x"?r.getWidth():r.getHeight()),h=d.length;if(!h&&u)return c[0].coord<0?f[1]?f[1]:c[u-1].color:f[0]?f[0]:c[0].color;var v=10,m=d[0].coord-v,g=d[h-1].coord+v,p=g-m;if(p<.001)return"transparent";A(d,function(b){b.offset=(b.coord-m)/p}),d.push({offset:h?d[h-1].offset:.5,color:f[1]||"transparent"}),d.unshift({offset:h?d[0].offset:.5,color:f[0]||"transparent"});var y=new Yg(0,0,0,0,d,!0);return y[a]=m,y[a+"2"]=g,y}}}function QC(t,e,r){var n=t.get("showAllSymbol"),a=n==="auto";if(!(n&&!a)){var i=r.getAxesByScale("ordinal")[0];if(i&&!(a&&JC(i,e))){var o=e.mapDimension(i.dim),s={};return A(i.getViewLabels(),function(l){var c=i.scale.getRawOrdinalNumber(l.tickValue);s[c]=1}),function(l){return!s.hasOwnProperty(e.get(o,l))}}}}function JC(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(oh.getSymbolSize(e,o)[t.isHorizontal()?1:0]*1.5>n)return!1;return!0}function eM(t,e){return isNaN(t)||isNaN(e)}function tM(t){for(var e=t.length/2;e>0&&eM(t[e*2-2],t[e*2-1]);e--);return e-1}function Fy(t,e){return[t[e*2],t[e*2+1]]}function rM(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 Hy(t){if(t.get(["endLabel","show"]))return!0;for(var e=0;e<Cr.length;e++)if(t.get([Cr[e],"endLabel","show"]))return!0;return!1}function fh(t,e,r,n){if(uh(e,"cartesian2d")){var a=n.getModel("endLabel"),i=a.get("valueAnimation"),o=n.getData(),s={lastFrameIndex:0},l=Hy(n)?function(h,v){t._endLabelOnDuring(h,v,o,s,i,a,e)}:null,c=e.getBaseAxis().isHorizontal(),u=Ry(e,r,n,function(){var h=t._endLabel;h&&r&&s.originalX!=null&&h.attr({x:s.originalX,y:s.originalY})},l);if(!n.get("clip",!0)){var f=u.shape,d=Math.max(f.width,f.height);c?(f.y-=d,f.height+=d*2):(f.x-=d,f.width+=d*2)}return l&&l(1,u),u}else return Ey(e,r,n)}function nM(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 aM=(function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.init=function(){var r=new lt,n=new NC;this.group.add(n.group),this._symbolDraw=n,this._lineGroup=r,this._changePolyState=Ce(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",d=this._coordSys,h=this._symbolDraw,v=this._polyline,m=this._polygon,g=this._lineGroup,p=!n.ssr&&r.get("animation"),y=!c.isEmpty(),b=c.get("origin"),x=Cy(i,s,b),S=y&&ZC(i,s,x),w=r.get("showSymbol"),k=r.get("connectNulls"),T=w&&!f&&QC(r,s,i),M=this._data;M&&M.eachItemGraphicEl(function(xe,et){xe.__temp&&(o.remove(xe),M.setItemGraphicEl(et,null))}),w||h.remove(),o.add(g);var D=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=jC(s,i,a)||s.getVisual("style")[s.getVisual("drawType")];if(!(v&&d.type===i.type&&D===this._step))w&&h.updateData(s,{isIgnore:T,clipShape:C,disableAnimation:!0,getSymbolPoint:function(xe){return[u[xe*2],u[xe*2+1]]}}),p&&this._initSymbolLabelAnimation(s,i,C),D&&(S&&(S=yn(S,u,i,D,k)),u=yn(u,null,i,D,k)),v=this._newPolyline(u),y?m=this._newPolygon(u,S):m&&(g.remove(m),m=this._polygon=null),f||this._initOrUpdateEndLabel(r,i,na(I)),g.setClipPath(fh(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,na(I));var P=g.getClipPath();if(P){var L=fh(this,i,!1,r);Ur(P,{shape:L.shape},r)}else g.setClipPath(fh(this,i,!0,r));w&&h.updateData(s,{isIgnore:T,clipShape:C,disableAnimation:!0,getSymbolPoint:function(xe){return[u[xe*2],u[xe*2+1]]}}),(!Oy(this._stackedOnPoints,S)||!Oy(this._points,u))&&(p?this._doUpdateAnimation(s,S,i,a,D,b,k):(D&&(S&&(S=yn(S,u,i,D,k)),u=yn(u,null,i,D,k)),v.setShape({points:u}),m&&m.setShape({points:u,stackedOnPoints:S})))}var R=r.getModel("emphasis"),N=R.get("focus"),Z=R.get("blurScope"),F=R.get("disabled");if(v.useStyle(De(l.getLineStyle(),{fill:"none",stroke:I,lineJoin:"bevel"})),sf(v,r,"lineStyle"),v.style.lineWidth>0&&r.get(["emphasis","lineStyle","width"])==="bolder"){var z=v.getState("emphasis").style;z.lineWidth=+v.style.lineWidth+1}Re(v).seriesIndex=r.seriesIndex,js(v,N,Z,F);var W=zy(r.get("smooth")),ne=r.get("smoothMonotone");if(v.setShape({smooth:W,smoothMonotone:ne,connectNulls:k}),m){var te=s.getCalculationInfo("stackedOnSeries"),de=0;m.useStyle(De(c.getAreaStyle(),{fill:I,opacity:.7,lineJoin:"bevel",decal:s.getVisual("style").decal})),te&&(de=zy(te.get("smooth"))),m.setShape({smooth:W,stackedOnSmooth:de,smoothMonotone:ne,connectNulls:k}),sf(m,r,"areaStyle"),Re(m).seriesIndex=r.seriesIndex,js(m,N,Z,F)}var be=this._changePolyState;s.eachItemGraphicEl(function(xe){xe&&(xe.onHoverStateChange=be)}),this._polyline.onHoverStateChange=be,this._data=s,this._coordSys=i,this._stackedOnPoints=S,this._points=u,this._step=D,this._valueOrigin=b,r.get("triggerLineEvent")&&(this.packEventData(r,v),m&&this.packEventData(r,m))},e.prototype.packEventData=function(r,n){Re(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=Zn(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 d=r.get("zlevel")||0,h=r.get("z")||0;c=new oh(o,s),c.x=u,c.y=f,c.setZ(d,h);var v=c.getSymbolPath().getTextContent();v&&(v.zlevel=d,v.z=h,v.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=Zn(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;wg(this._polyline,r),n&&wg(n,r)},e.prototype._newPolyline=function(r){var n=this._polyline;return n&&this._lineGroup.remove(n),n=new VC({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 WC({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");ge(u)&&(u=u(null));var f=c.get("animationDelay")||0,d=ge(f)?f(null):f;r.eachItemGraphicEl(function(h,v){var m=h;if(m){var g=[h.x,h.y],p=void 0,y=void 0,b=void 0;if(a)if(o){var x=a,S=n.pointToCoord(g);i?(p=x.startAngle,y=x.endAngle,b=-S[1]/180*Math.PI):(p=x.r0,y=x.r,b=S[0])}else{var w=a;i?(p=w.x,y=w.x+w.width,b=h.x):(p=w.y+w.height,y=w.y,b=h.y)}var k=y===p?0:(b-p)/(y-p);l&&(k=1-k);var T=ge(f)?f(v):u*k+d,M=m.getSymbolPath(),D=M.getTextContent();m.attr({scaleX:0,scaleY:0}),m.animateTo({scaleX:1,scaleY:1},{duration:200,setToFinal:!0,delay:T}),D&&D.animateFrom({style:{opacity:0}},{duration:300,delay:T}),M.disableLabelAnimation=!0}})},e.prototype._initOrUpdateEndLabel=function(r,n,a){var i=r.getModel("endLabel");if(Hy(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 wt({z2:200}),c.ignoreClip=!0,s.setTextContent(this._endLabel),s.disableLabelAnimation=!0);var u=tM(l);u>=0&&(hl(s,dl(r,"endLabel"),{inheritColor:a,labelFetcher:r,labelDataIndex:u,defaultText:function(f,d,h){return h!=null?Sy(o,h):ih(o,f)},enableTextSetter:!0},nM(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"),d=a.hostModel,h=d.get("connectNulls"),v=s.get("precision"),m=s.get("distance")||0,g=l.getBaseAxis(),p=g.isHorizontal(),y=g.inverse,b=n.shape,x=y?p?b.x:b.y+b.height:p?b.x+b.width:b.y,S=(p?m:0)*(y?-1:1),w=(p?0:-m)*(y?-1:1),k=p?"x":"y",T=rM(f,x,k),M=T.range,D=M[1]-M[0],C=void 0;if(D>=1){if(D>1&&!h){var I=Fy(f,M[0]);c.attr({x:I[0]+S,y:I[1]+w}),o&&(C=d.getRawValue(M[0]))}else{var I=u.getPointOn(x,k);I&&c.attr({x:I[0]+S,y:I[1]+w});var P=d.getRawValue(M[0]),L=d.getRawValue(M[1]);o&&(C=hk(a,v,P,L,T.t))}i.lastFrameIndex=M[0]}else{var R=r===1||i.lastFrameIndex>0?M[0]:0,I=Fy(f,R);o&&(C=d.getRawValue(R)),c.attr({x:I[0]+S,y:I[1]+w})}if(o){var N=vl(c);typeof N.setLabelText=="function"&&N.setLabelText(C)}}},e.prototype._doUpdateAnimation=function(r,n,a,i,o,s,l){var c=this._polyline,u=this._polygon,f=r.hostModel,d=HC(this._data,r,this._stackedOnPoints,n,this._coordSys,a,this._valueOrigin),h=d.current,v=d.stackedOnCurrent,m=d.next,g=d.stackedOnNext;if(o&&(v=yn(d.stackedOnCurrent,d.current,a,o,l),h=yn(d.current,null,a,o,l),g=yn(d.stackedOnNext,d.next,a,o,l),m=yn(d.next,null,a,o,l)),By(h,m)>3e3||u&&By(v,g)>3e3){c.stopAnimation(),c.setShape({points:m}),u&&(u.stopAnimation(),u.setShape({points:m,stackedOnPoints:g}));return}c.shape.__points=d.current,c.shape.points=h;var p={shape:{points:m}};d.current!==h&&(p.shape.__points=d.next),c.stopAnimation(),Nt(c,p,f),u&&(u.setShape({points:h,stackedOnPoints:v}),u.stopAnimation(),Nt(u,{shape:{stackedOnPoints:g}},f),c.shape.points!==u.shape.points&&(u.shape.points=c.shape.points));for(var y=[],b=d.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,D=y[T].ptIdx*2;M.x=k[D],M.y=k[D+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 iM(t,e){return{seriesType:t,plan:ch(),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");Xa(n,i[0])&&(i[0]=s),Xa(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,d){for(var h=f.end-f.start,v=qr(h*o),m=[],g=[],p=f.start,y=0;p<f.end;p++){var b=void 0;if(o===1){var x=l.get(c,p);b=a.dataToPoint(x,null,g)}else m[0]=l.get(c,p),m[1]=l.get(u,p),b=a.dataToPoint(m,null,g);v[y++]=b[0],v[y++]=b[1]}d.setLayout("points",v)}}}}}}var oM={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]}},sM=function(t){return Math.round(t.length/2)};function Vy(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(),d=Math.abs(u[1]-u[0])*(f||1),h=Math.round(s/d);if(isFinite(h)&&h>1){i==="lttb"?e.setData(a.lttbDownSample(a.mapDimension(c.dim),1/h)):i==="minmax"&&e.setData(a.minmaxDownSample(a.mapDimension(c.dim),1/h));var v=void 0;ie(i)?v=oM[i]:ge(i)&&(v=i),v&&e.setData(a.downSample(a.mapDimension(c.dim),1/h,v,sM))}}}}}function lM(t){t.registerChartView(aM),t.registerSeriesModel(EC),t.registerLayout(iM("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,Vy("line"))}var cM="__ec_stack_";function Gy(t){return t.get("stack")||cM+t.seriesIndex}function hh(t){return t.dim+t.index}function Wy(t,e){var r=[];return e.eachSeriesByType(t,function(n){$y(n)&&r.push(n)}),r}function uM(t){var e={};A(t,function(l){var c=l.coordinateSystem,u=c.getBaseAxis();if(!(u.type!=="time"&&u.type!=="value"))for(var f=l.getData(),d=u.dim+"_"+u.index,h=f.getDimensionIndex(f.mapDimension(u.dim)),v=f.getStore(),m=0,g=v.count();m<g;++m){var p=v.get(h,m);e[d]?e[d].push(p):e[d]=[p]}});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=uM(t),r=[];return A(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(),d=Math.abs(f[1]-f[0]);s=c?u/d*c:u}else{var h=n.getData();s=Math.abs(o[1]-o[0])/h.count()}var v=mt(n.get("barWidth"),s),m=mt(n.get("barMaxWidth"),s),g=mt(n.get("barMinWidth")||(Yy(n)?.5:1),s),p=n.get("barGap"),y=n.get("barCategoryGap");r.push({bandWidth:s,barWidth:v,barMaxWidth:m,barMinWidth:g,barGap:p,barCategoryGap:y,axisKey:hh(i),stackId:Gy(n)})}),fM(r)}function fM(t){var e={};A(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 d=n.barMinWidth;d&&(l[c].minWidth=d);var h=n.barGap;h!=null&&(s.gap=h);var v=n.barCategoryGap;v!=null&&(s.categoryGap=v)});var r={};return A(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=mt(s,o),u=mt(n.gap,1),f=n.remainedWidth,d=n.autoWidthCount,h=(f-c)/(d+(d-1)*u);h=Math.max(h,0),A(i,function(p){var y=p.maxWidth,b=p.minWidth;if(p.width){var x=p.width;y&&(x=Math.min(x,y)),b&&(x=Math.max(x,b)),p.width=x,f-=x+u*x,d--}else{var x=h;y&&y<x&&(x=Math.min(y,f)),b&&b>x&&(x=b),x!==h&&(p.width=x,f-=x+u*x,d--)}}),h=(f-c)/(d+(d-1)*u),h=Math.max(h,0);var v=0,m;A(i,function(p,y){p.width||(p.width=h),m=p,v+=p.width*(1+u)}),m&&(v-=m.width*u);var g=-v/2;A(i,function(p,y){r[a][y]=r[a][y]||{bandWidth:o,offset:g,width:p.width},g+=p.width*(1+u)})}),r}function hM(t,e,r){if(t&&e){var n=t[hh(e)];return n}}function dM(t,e){var r=Wy(t,e),n=Uy(r);A(r,function(a){var i=a.getData(),o=a.coordinateSystem,s=o.getBaseAxis(),l=Gy(a),c=n[hh(s)][l],u=c.offset,f=c.width;i.setLayout({bandWidth:c.bandWidth,offset:u,size:f})})}function vM(t){return{seriesType:t,plan:ch(),reset:function(e){if($y(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=Xa(r,c)&&!!r.getCalculationInfo("stackedOnSeries"),d=i.isHorizontal(),h=pM(a,i),v=Yy(e),m=e.get("barMinHeight")||0,g=u&&r.getDimensionIndex(u),p=r.getLayout("size"),y=r.getLayout("offset");return{progress:function(b,x){for(var S=b.count,w=v&&qr(S*3),k=v&&l&&qr(S*3),T=v&&qr(S),M=n.master.getRect(),D=d?M.width:M.height,C,I=x.getStore(),P=0;(C=b.next())!=null;){var L=I.get(f?g:o,C),R=I.get(s,C),N=h,Z=void 0;f&&(Z=+L-I.get(o,C));var F=void 0,z=void 0,W=void 0,ne=void 0;if(d){var te=n.dataToPoint([L,R]);if(f){var de=n.dataToPoint([Z,R]);N=de[0]}F=N,z=te[1]+y,W=te[0]-N,ne=p,Math.abs(W)<m&&(W=(W<0?-1:1)*m)}else{var te=n.dataToPoint([R,L]);if(f){var de=n.dataToPoint([R,Z]);N=de[1]}F=te[0]+y,z=N,W=p,ne=te[1]-N,Math.abs(ne)<m&&(ne=(ne<=0?-1:1)*m)}v?(w[P]=F,w[P+1]=z,w[P+2]=d?W:ne,k&&(k[P]=d?M.x:F,k[P+1]=d?z:M.y,k[P+2]=D),T[C]=C):x.setItemLayout(C,{x:F,y:z,width:W,height:ne}),P+=3}v&&x.setLayout({largePoints:w,largeDataIndices:T,largeBackgroundPoints:k,valueAxisHorizontal:d})}}}}}}function $y(t){return t.coordinateSystem&&t.coordinateSystem.type==="cartesian2d"}function Yy(t){return t.pipelineContext&&t.pipelineContext.large}function pM(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 dh=(function(t){G(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 zf(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)A(i.getAxes(),function(d,h){if(d.type==="category"&&n!=null){var v=d.getTicksCoords(),m=d.getTickModel().get("alignWithLabel"),g=o[h],p=n[h]==="x1"||n[h]==="y1";if(p&&!m&&(g+=1),v.length<2)return;if(v.length===2){s[h]=d.toGlobalCoord(d.getExtent()[p?1:0]);return}for(var y=void 0,b=void 0,x=1,S=0;S<v.length;S++){var w=v[S].coord,k=S===v.length-1?v[S-1].tickValue+x:v[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-v[0].tickValue)}b==null&&(y?y&&(b=v[v.length-1].coord):b=v[0].coord),s[h]=d.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})(Dr);Dr.registerClass(dh);var gM=(function(t){G(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 zf(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=Ff(dh.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})(dh),Nl="\0__throttleOriginMethod",qy="\0__throttleRate",Xy="\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 d=function(){for(var h=[],v=0;v<arguments.length;v++)h[v]=arguments[v];n=new Date().getTime(),l=this,c=h;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 d.clear=function(){o&&(clearTimeout(o),o=null)},d.debounceNextCall=function(h){u=h},d}function ph(t,e,r,n){var a=t[e];if(a){var i=a[Nl]||a,o=a[Xy],s=a[qy];if(s!==r||o!==n){if(r==null||!n)return t[e]=i;a=t[e]=vh(i,r,n==="debounce"),a[Nl]=i,a[Xy]=n,a[qy]=r}return a}}function gh(t,e){var r=t[e];r&&r[Nl]&&(r.clear&&r.clear(),t[e]=r[Nl])}var mM=(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})(),Zy=(function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.type="sausage",n}return e.prototype.getDefaultShape=function(){return new mM},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,d=n.clockwise,h=Math.PI*2,v=d?f-u<h:u-f<h;v||(u=f-(d?h:-h));var m=Math.cos(u),g=Math.sin(u),p=Math.cos(f),y=Math.sin(f);v?(r.moveTo(m*o+a,g*o+i),r.arc(m*c+a,g*c+i,l,-Math.PI+u,u,!d)):r.moveTo(m*s+a,g*s+i),r.arc(a,i,s,u,f,!d),r.arc(p*c+a,y*c+i,l,f-Math.PI*2,f-Math.PI,!d),o!==0&&r.arc(a,i,o,f,u,d)},e})(Ee);function yM(t,e){e=e||{};var r=e.isRoundCap;return function(n,a,i){var o=a.position;if(!o||o instanceof Array)return ms(n,a,i);var s=t(o),l=a.distance!=null?a.distance:5,c=this.shape,u=c.cx,f=c.cy,d=c.r,h=c.r0,v=(d+h)/2,m=c.startAngle,g=c.endAngle,p=(m+g)/2,y=r?Math.abs(d-h)/2:0,b=Math.cos,x=Math.sin,S=u+d*b(m),w=f+d*x(m),k="left",T="top";switch(s){case"startArc":S=u+(h-l)*b(p),w=f+(h-l)*x(p),k="center",T="top";break;case"insideStartArc":S=u+(h+l)*b(p),w=f+(h+l)*x(p),k="center",T="bottom";break;case"startAngle":S=u+v*b(m)+Bl(m,l+y,!1),w=f+v*x(m)+zl(m,l+y,!1),k="right",T="middle";break;case"insideStartAngle":S=u+v*b(m)+Bl(m,-l+y,!1),w=f+v*x(m)+zl(m,-l+y,!1),k="left",T="middle";break;case"middle":S=u+v*b(p),w=f+v*x(p),k="center",T="middle";break;case"endArc":S=u+(d+l)*b(p),w=f+(d+l)*x(p),k="center",T="bottom";break;case"insideEndArc":S=u+(d-l)*b(p),w=f+(d-l)*x(p),k="center",T="top";break;case"endAngle":S=u+v*b(g)+Bl(g,l+y,!0),w=f+v*x(g)+zl(g,l+y,!0),k="left",T="middle";break;case"insideEndAngle":S=u+v*b(g)+Bl(g,-l+y,!0),w=f+v*x(g)+zl(g,-l+y,!0),k="right",T="middle";break;default:return ms(n,a,i)}return n=n||{},n.x=S,n.y=w,n.align=k,n.verticalAlign=T,n}}function _M(t,e,r,n){if(He(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 Bl(t,e,r){return e*Math.sin(t)*(r?-1:1)}function zl(t,e,r){return e*Math.cos(t)*(r?1:-1)}function bM(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 rn(i,a)})}}var mh=Math.max,yh=Math.min;function xM(t,e){var r=t.getArea&&t.getArea();if(uh(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){G(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){ul(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 d=r.isAnimationEnabled()?r:null,h=SM(r,c);h&&this._enableRealtimeSort(h,s,a);var v=r.get("clip",!0)||h,m=xM(c,s);o.removeClipPath();var g=r.get("roundCap",!0),p=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=Fl[c.type](s,C),P=IM(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=Fl[c.type](s,C,I);if(p&&T(C),!(!s.hasValue(C)||!e_[c.type](P))){var L=!1;v&&(L=Ky[c.type](m,P));var R=jy[c.type](r,s,C,P,f,d,u.model,!1,g);h&&(R.forceLabelAnimation=!0),r_(R,s,C,I,P,r,f,c.type==="polar"),w?R.attr({shape:P}):h?Qy(h,d,R,P,C,f,!1,!1):Ur(R,{shape:P},r,C),s.setItemGraphicEl(C,R),o.add(R),R.ignore=L}}).update(function(C,I){var P=s.getItemModel(C),L=Fl[c.type](s,C,P);if(p){var R=void 0;S.length===0?R=T(I):(R=S[I],R.useStyle(y.getItemStyle()),c.type==="cartesian2d"?R.setShape("r",b):R.setShape("cornerRadius",b),x[C]=R);var N=Fl[c.type](s,C),Z=o_(f,N,c);Nt(R,{shape:Z},d,C)}var F=l.getItemGraphicEl(I);if(!s.hasValue(C)||!e_[c.type](L)){o.remove(F);return}var z=!1;if(v&&(z=Ky[c.type](m,L),z&&o.remove(F)),F?Xg(F):F=jy[c.type](r,s,C,L,f,d,u.model,!!F,g),h&&(F.forceLabelAnimation=!0),k){var W=F.getTextContent();if(W){var ne=vl(W);ne.prevValue!=null&&(ne.prevValue=ne.value)}}else r_(F,s,C,P,L,r,f,c.type==="polar");w?F.attr({shape:L}):h?Qy(h,d,F,L,C,f,!0,k):Nt(F,{shape:L},r,C,null),s.setItemGraphicEl(C,F),F.ignore=z,o.add(F)}).remove(function(C){var I=l.getItemGraphicEl(C);I&&_f(I,r,C)}).execute();var M=this._backgroundGroup||(this._backgroundGroup=new lt);M.removeAll();for(var D=0;D<x.length;++D)M.add(x[D]);o.add(M),this._backgroundEls=x,this._data=s},e.prototype._renderLarge=function(r,n,a){this._clear(),a_(r,this.group),this._updateLargeClip(r)},e.prototype._incrementalRenderLarge=function(r,n){this._removeBackground(),a_(n,this.group,this._progressiveEls,!0)},e.prototype._updateLargeClip=function(r){var n=r.get("clip",!0)&&XC(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){_f(i,r,Re(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),Ky={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=mh(e.x,t.x),s=yh(e.x+e.width,a),l=mh(e.y,t.y),c=yh(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=yh(e.r,t.r),i=mh(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}},jy={cartesian2d:function(t,e,r,n,a,i,o,s,l){var c=new nt({shape:V({},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?Zy:Va,u=new c({shape:n,z2:1});u.name="item";var f=t_(a);if(u.calculateTextPosition=yM(f,{isRoundCap:c===Zy}),i){var d=u.shape,h=a?"r":"endAngle",v={};d[h]=a?n.r0:n.startAngle,v[h]=n[h],(s?Nt:Ur)(u,{shape:v},i)}return u}};function SM(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 Qy(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 Jy(t,e){for(var r=0;r<e.length;r++)if(!isFinite(t[e[r]]))return!0;return!1}var kM=["x","y","width","height"],TM=["cx","cy","r","startAngle","endAngle"],e_={cartesian2d:function(t){return!Jy(t,kM)},polar:function(t){return!Jy(t,TM)}},Fl={cartesian2d:function(t,e,r){var n=t.getItemLayout(e),a=r?MM(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 CM(t){return t.startAngle!=null&&t.endAngle!=null&&t.startAngle===t.endAngle}function t_(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 r_(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=bM(n.getModel("itemStyle"),u);V(u,f),t.setShape(u)}}else{var c=n.get(["itemStyle","borderRadius"])||0;t.setShape("r",c)}t.useStyle(l);var d=n.getShallow("cursor");d&&t.attr("cursor",d);var h=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",v=dl(n);hl(t,v,{labelFetcher:i,labelDataIndex:r,defaultText:ih(i.getData(),r),inheritColor:l.fill,defaultOpacity:l.opacity,defaultOutsidePosition:h});var m=t.getTextContent();if(s&&m){var g=n.get(["label","position"]);t.textConfig.inside=g==="middle"?!0:null,_M(t,g==="outside"?h:g,t_(o),n.get(["label","rotate"]))}DT(m,v,i.getRawValue(r),function(y){return Sy(e,y)});var p=n.getModel(["emphasis"]);js(t,p.get("focus"),p.get("blurScope"),p.get("disabled")),sf(t,n),CM(a)&&(t.style.fill="none",t.style.stroke="none",A(t.states,function(y){y.style&&(y.style.fill=y.style.stroke="none")}))}function MM(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 AM=(function(){function t(){}return t})(),n_=(function(t){G(e,t);function e(r){var n=t.call(this,r)||this;return n.type="largeBar",n}return e.prototype.getDefaultShape=function(){return new AM},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})(Ee);function a_(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 n_({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 n_({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,Re(f).seriesIndex=t.seriesIndex,t.get("silent")||(f.on("mousedown",i_),f.on("mousemove",i_)),r&&r.push(f)}var i_=vh(function(t){var e=this,r=DM(e,t.offsetX,t.offsetY);Re(e).dataIndex=r>=0?r:null},30,!1);function DM(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 d=u*3;if(l[n]=c,l[a]=i[d+2],s[n]=i[d+n],s[a]=i[d+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 o_(t,e,r){if(uh(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 IM(t,e,r){var n=t.type==="polar"?Va:nt;return new n({shape:o_(e,r,t),silent:!0,z2:0})}function PM(t){t.registerChartView(wM),t.registerSeriesModel(gM),t.registerLayout(t.PRIORITY.VISUAL.LAYOUT,qe(dM,"bar")),t.registerLayout(t.PRIORITY.VISUAL.PROGRESSIVE_LAYOUT,vM("bar")),t.registerProcessor(t.PRIORITY.PROCESSOR.STATISTIC,Vy("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 ei(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(),d=Zn(f,a.fromActionPayload);r.trigger(i,{type:i,seriesId:o.id,name:ee(d)?f.getName(d[0]):f.getName(d),selected:ie(l)?l:V({},l)})}})}function LM(t,e,r){t.on("selectchanged",function(n){var a=r.getModel();n.isFromClick?(ei("map","selectchanged",e,a,n),ei("pie","selectchanged",e,a,n)):n.fromAction==="select"?(ei("map","selected",e,a,n),ei("pie","selected",e,a,n)):n.fromAction==="unselect"&&(ei("map","unselected",e,a,n),ei("pie","unselected",e,a,n))})}function RM(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 il(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 EM(t){var e=[];t.sort(function(m,g){return g.priority-m.priority});var r=new Pe(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,d=!1,h=0;h<e.length;h++){var v=e[h];if(r.intersect(v.rect)){if(o&&v.axisAligned){d=!0;break}if(v.obb||(v.obb=new il(v.localRect,v.transform)),f||(f=new il(s,l)),f.intersect(v.obb)){d=!0;break}}}d?(n(c),u&&n(u)):(c.attr("ignore",i.defaultAttr.ignore),u&&u.attr("ignore",i.defaultAttr.labelGuideIgnore),e.push(i))}}var ti=(function(){function t(e,r){this.target=e,this.topTarget=r&&r.topTarget}return t})(),OM=(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 ti(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 ti(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 ti(l,e),"dragleave",e.event),s&&s!==l&&this.handler.dispatchToElement(new ti(s,e),"dragenter",e.event))}},t.prototype._dragEnd=function(e){var r=this._draggingTarget;r&&(r.dragging=!1),this.handler.dispatchToElement(new ti(r,e),"dragend",e.event),this._dropTarget&&this.handler.dispatchToElement(new ti(this._dropTarget,e),"drop",e.event),this._draggingTarget=null,this._dropTarget=null},t})(),NM=/^(?:mouse|pointer|contextmenu|drag|drop)|click/,_h=[],BM=he.browser.firefox&&+he.browser.version.split(".")[0]<39;function bh(t,e,r,n){return r=r||{},n?s_(t,e,r):BM&&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):s_(t,e,r),r}function s_(t,e,r){if(he.domSupported&&t.getBoundingClientRect){var n=e.clientX,a=e.clientY;if(Gm(t)){var i=t.getBoundingClientRect();r.zrX=n-i.left,r.zrY=a-i.top;return}else if(Gf(_h,t,n,a)){r.zrX=_h[0],r.zrY=_h[1];return}}r.zrX=r.zrY=0}function xh(t){return t||window.event}function Kt(t,e,r){if(e=xh(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&&bh(t,o,e,r)}else{bh(t,e,e,r);var i=zM(e);e.zrDelta=i?i/120:-(e.detail||0)/3}var s=e.button;return e.which==null&&s!==void 0&&NM.test(e.type)&&(e.which=s&1?1:s&2?3:s&4?2:0),e}function zM(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 FM(t,e,r,n){t.addEventListener(e,r,n)}function HM(t,e,r,n){t.removeEventListener(e,r,n)}var Hl=function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0};function l_(t){return t.which===2||t.which===3}var VM=(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=bh(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 wh)if(wh.hasOwnProperty(r)){var n=wh[r](this._track,e);if(n)return n}},t})();function c_(t){var e=t[1][0]-t[0][0],r=t[1][1]-t[0][1];return Math.sqrt(e*e+r*r)}function GM(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}var wh={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=c_(n)/c_(a);!isFinite(i)&&(i=1),e.pinchScale=i;var o=GM(n);return e.pinchX=o[0],e.pinchY=o[1],{type:"pinch",target:t[0].target,event:e}}}}},u_="silent";function WM(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:UM}}function UM(){Hl(this.event)}var $M=(function(t){G(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),co=(function(){function t(e,r){this.x=e,this.y=r}return t})(),YM=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],Sh=new Pe(0,0,0,0),f_=(function(t){G(e,t);function e(r,n,a,i,o){var s=t.call(this)||this;return s._hovered=new co(0,0),s.storage=r,s.painter=n,s.painterRoot=i,s._pointerSize=o,a=a||new $M,s.proxy=null,s.setHandlerProxy(a),s._draggingMgr=new OM(s),s}return e.prototype.setHandlerProxy=function(r){this.proxy&&this.proxy.dispose(),r&&(A(YM,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=d_(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 co(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 co(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=WM(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 co(r,n);if(h_(i,o,r,n,a),this._pointerSize&&!o.target){for(var s=[],l=this._pointerSize,c=l/2,u=new Pe(r-c,n-c,l,l),f=i.length-1;f>=0;f--){var d=i[f];d!==a&&!d.ignore&&!d.ignoreCoarsePointer&&(!d.parent||!d.parent.ignoreCoarsePointer)&&(Sh.copy(d.getBoundingRect()),d.transform&&Sh.applyTransform(d.transform),Sh.intersect(u)&&s.push(d))}if(s.length)for(var h=4,v=Math.PI/12,m=Math.PI*2,g=0;g<c;g+=h)for(var p=0;p<m;p+=v){var y=r+g*Math.cos(p),b=n+g*Math.sin(p);if(h_(s,o,y,b,a),o.target)return o}}return o},e.prototype.processGesture=function(r,n){this._gestureMgr||(this._gestureMgr=new VM);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 co;s.target=i.target,this.dispatchToElement(s,o,i.event)}},e})(rr);A(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],function(t){f_.prototype[t]=function(e){var r=e.zrX,n=e.zrY,a=d_(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||Gw(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?u_:!0}return!1}function h_(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!==u_)){e.target=o;break}}}function d_(t,e,r){var n=t.painter;return e<0||e>n.getWidth()||r<0||r>n.getHeight()}var v_=32,uo=7;function XM(t){for(var e=0;t>=v_;)e|=t&1,t>>=1;return t+e}function p_(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++;ZM(t,e,a)}else for(;a<r&&n(t[a],t[a-1])>=0;)a++;return a-e}function ZM(t,e,r){for(r--;e<r;){var n=t[e];t[e++]=t[r],t[r--]=n}}function g_(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 kh(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 Th(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 KM(t,e){var r=uo,n,a,i=0,o=[];n=[],a=[];function s(h,v){n[i]=h,a[i]=v,i+=1}function l(){for(;i>1;){var h=i-2;if(h>=1&&a[h-1]<=a[h]+a[h+1]||h>=2&&a[h-2]<=a[h]+a[h-1])a[h-1]<a[h+1]&&h--;else if(a[h]>a[h+1])break;u(h)}}function c(){for(;i>1;){var h=i-2;h>0&&a[h-1]<a[h+1]&&h--,u(h)}}function u(h){var v=n[h],m=a[h],g=n[h+1],p=a[h+1];a[h]=m+p,h===i-3&&(n[h+1]=n[h+2],a[h+1]=a[h+2]),i--;var y=Th(t[g],t,v,m,0,e);v+=y,m-=y,m!==0&&(p=kh(t[v+m-1],t,g,p,p-1,e),p!==0&&(m<=p?f(v,m,g,p):d(v,m,g,p)))}function f(h,v,m,g){var p=0;for(p=0;p<v;p++)o[p]=t[h+p];var y=0,b=m,x=h;if(t[x++]=t[b++],--g===0){for(p=0;p<v;p++)t[x+p]=o[y+p];return}if(v===1){for(p=0;p<g;p++)t[x+p]=t[b+p];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,--v===1){T=!0;break}while((w|k)<S);if(T)break;do{if(w=Th(t[b],o,y,v,0,e),w!==0){for(p=0;p<w;p++)t[x+p]=o[y+p];if(x+=w,y+=w,v-=w,v<=1){T=!0;break}}if(t[x++]=t[b++],--g===0){T=!0;break}if(k=kh(o[y],t,b,g,0,e),k!==0){for(p=0;p<k;p++)t[x+p]=t[b+p];if(x+=k,b+=k,g-=k,g===0){T=!0;break}}if(t[x++]=o[y++],--v===1){T=!0;break}S--}while(w>=uo||k>=uo);if(T)break;S<0&&(S=0),S+=2}if(r=S,r<1&&(r=1),v===1){for(p=0;p<g;p++)t[x+p]=t[b+p];t[x+g]=o[y]}else{if(v===0)throw new Error;for(p=0;p<v;p++)t[x+p]=o[y+p]}}function d(h,v,m,g){var p=0;for(p=0;p<g;p++)o[p]=t[m+p];var y=h+v-1,b=g-1,x=m+g-1,S=0,w=0;if(t[x--]=t[y--],--v===0){for(S=x-(g-1),p=0;p<g;p++)t[S+p]=o[p];return}if(g===1){for(x-=v,y-=v,w=x+1,S=y+1,p=v-1;p>=0;p--)t[w+p]=t[S+p];t[x]=o[b];return}for(var k=r;;){var T=0,M=0,D=!1;do if(e(o[b],t[y])<0){if(t[x--]=t[y--],T++,M=0,--v===0){D=!0;break}}else if(t[x--]=o[b--],M++,T=0,--g===1){D=!0;break}while((T|M)<k);if(D)break;do{if(T=v-Th(o[b],t,h,v,v-1,e),T!==0){for(x-=T,y-=T,v-=T,w=x+1,S=y+1,p=T-1;p>=0;p--)t[w+p]=t[S+p];if(v===0){D=!0;break}}if(t[x--]=o[b--],--g===1){D=!0;break}if(M=g-kh(t[y],o,0,g,g-1,e),M!==0){for(x-=M,b-=M,g-=M,w=x+1,S=b+1,p=0;p<M;p++)t[w+p]=o[S+p];if(g<=1){D=!0;break}}if(t[x--]=t[y--],--v===0){D=!0;break}k--}while(T>=uo||M>=uo);if(D)break;k<0&&(k=0),k+=2}if(r=k,r<1&&(r=1),g===1){for(x-=v,y-=v,w=x+1,S=y+1,p=v-1;p>=0;p--)t[w+p]=t[S+p];t[x]=o[b]}else{if(g===0)throw new Error;for(S=x-(g-1),p=0;p<g;p++)t[S+p]=o[p]}}return{mergeRuns:l,forceMergeRuns:c,pushRun:s}}function Vl(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=p_(t,r,n,e),g_(t,r,n,r+i,e);return}var o=KM(t,e),s=XM(a);do{if(i=p_(t,r,n,e),i<s){var l=a;l>s&&(l=s),g_(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 m_=!1;function Ch(){m_||(m_=!0,console.warn("z / z2 / zlevel of displayable is invalid, which may cause unexpected errors"))}function y_(t,e){return t.zlevel===e.zlevel?t.z===e.z?t.z2-e.z2:t.z-e.z:t.zlevel-e.zlevel}var jM=(function(){function t(){this._roots=[],this._displayList=[],this._displayListLen=0,this.displayableSortFunc=y_}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,Vl(n,y_)},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)&&(Ch(),u.z=0),isNaN(u.z2)&&(Ch(),u.z2=0),isNaN(u.zlevel)&&(Ch(),u.zlevel=0),this._displayList[this._displayListLen++]=u}var f=e.getDecalElement&&e.getDecalElement();f&&this._updateAndAddDisplayable(f,r,n);var d=e.getTextGuideLine();d&&this._updateAndAddDisplayable(d,r,n);var h=e.getTextContent();h&&this._updateAndAddDisplayable(h,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=Ie(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})(),Gl;Gl=he.hasGlobalWindow&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){return setTimeout(t,16)};function ri(){return new Date().getTime()}var QM=(function(t){G(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=ri()-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&&(Gl(n),!r._paused&&r.update())}Gl(n)},e.prototype.start=function(){this._running||(this._time=ri(),this._pausedTime=0,this._startLoop())},e.prototype.stop=function(){this._running=!1},e.prototype.pause=function(){this._paused||(this._pauseStart=ri(),this._paused=!0)},e.prototype.resume=function(){this._paused&&(this._pausedTime+=ri()-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 Au(r,n.loop);return this.addAnimator(a),a},e})(rr),JM=300,Mh=he.domSupported,Ah=(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}})(),__={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]},b_=!1;function Dh(t){var e=t.pointerType;return e==="pen"||e==="touch"}function eA(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 Ih(t){t&&(t.zrByTouch=!0)}function tA(t,e){return Kt(t.dom,new rA(t,e),!0)}function x_(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 rA=(function(){function t(e,r){this.stopPropagation=pt,this.stopImmediatePropagation=pt,this.preventDefault=pt,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;x_(this,e)||(this.__pointerCapturing&&(t.zrEventControl="no_globalout"),this.trigger("mouseout",t))},wheel:function(t){b_=!0,t=Kt(this.dom,t),this.trigger("mousewheel",t)},mousewheel:function(t){b_||(t=Kt(this.dom,t),this.trigger("mousewheel",t))},touchstart:function(t){t=Kt(this.dom,t),Ih(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),Ih(t),this.handler.processGesture(t,"change"),or.mousemove.call(this,t)},touchend:function(t){t=Kt(this.dom,t),Ih(t),this.handler.processGesture(t,"end"),or.mouseup.call(this,t),+new Date-+this.__lastTouchMoment<JM&&or.click.call(this,t)},pointerdown:function(t){or.mousedown.call(this,t)},pointermove:function(t){Dh(t)||or.mousemove.call(this,t)},pointerup:function(t){or.mouseup.call(this,t)},pointerout:function(t){Dh(t)||or.mouseout.call(this,t)}};A(["click","dblclick","contextmenu"],function(t){or[t]=function(e){e=Kt(this.dom,e),this.trigger(t,e)}});var Ph={pointermove:function(t){Dh(t)||Ph.mousemove.call(this,t)},pointerup:function(t){Ph.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 nA(t,e){var r=e.domHandlers;he.pointerEventsSupported?A(Ah.pointer,function(n){Wl(e,n,function(a){r[n].call(t,a)})}):(he.touchEventsSupported&&A(Ah.touch,function(n){Wl(e,n,function(a){r[n].call(t,a),eA(e)})}),A(Ah.mouse,function(n){Wl(e,n,function(a){a=xh(a),e.touching||r[n].call(t,a)})}))}function aA(t,e){he.pointerEventsSupported?A(__.pointer,r):he.touchEventsSupported||A(__.mouse,r);function r(n){function a(i){i=xh(i),x_(t,i.target)||(i=tA(t,i),e.domHandlers[n].call(t,i))}Wl(e,n,a,{capture:!0})}}function Wl(t,e,r,n){t.mounted[e]=r,t.listenerOpts[e]=n,FM(t.domTarget,e,r,n)}function Lh(t){var e=t.mounted;for(var r in e)e.hasOwnProperty(r)&&HM(t.domTarget,r,e[r],t.listenerOpts[r]);t.mounted={}}var w_=(function(){function t(e,r){this.mounted={},this.listenerOpts={},this.touching=!1,this.domTarget=e,this.domHandlers=r}return t})(),iA=(function(t){G(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 w_(r,or),Mh&&(a._globalHandlerScope=new w_(document,Ph)),nA(a,a._localHandlerScope),a}return e.prototype.dispose=function(){Lh(this._localHandlerScope),Mh&&Lh(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,Mh&&+this.__pointerCapturing^+r){this.__pointerCapturing=r;var n=this._globalHandlerScope;r?aA(this,n):Lh(n)}},e})(rr);var Ul={},S_={};function oA(t){delete S_[t]}function sA(t){if(!t)return!1;if(typeof t=="string")return Ms(t,1)<Du;if(t.colorStops){for(var e=t.colorStops,r=0,n=e.length,a=0;a<n;a++)r+=Ms(e[a].color,1);return r/=n,r<Du}return!1}var lA=(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 jM,o=n.renderer||"canvas";Ul[o]||(o=Ge(Ul)[0]),n.useDirtyRect=n.useDirtyRect==null?!1:n.useDirtyRect;var s=new Ul[o](r,i,n,e),l=n.ssr||s.ssrOnly;this.storage=i,this.painter=s;var c=!he.node&&!he.worker&&!l?new iA(s.getViewportRoot(),s.root):null,u=n.useCoarsePointer,f=u==null||u==="auto"?he.touchEventsSupported:!!u,d=44,h;f&&(h=_e(n.pointerSize,d)),this.handler=new f_(i,s,c,s.root,h),this.animation=new QM({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=sA(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=ri();this._needsRefresh&&(r=!0,this.refreshImmediately(e)),this._needsRefreshHover&&(r=!0,this.refreshHoverImmediately());var a=ri();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 lt&&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,oA(this.id))},t})();function k_(t,e){var r=new lA(Kv(),t,e);return S_[r.id]=r,r}function cA(t,e){Ul[t]=e}var T_="";typeof navigator<"u"&&(T_=navigator.platform||"");var ni="rgba(0, 0, 0, 0.2)";const uA={darkMode:"auto",colorBy:"series",color:["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc"],gradientColor:["#f6efa6","#d88273","#bf444c"],aria:{decal:{decals:[{color:ni,dashArrayX:[1,0],dashArrayY:[2,5],symbolSize:1,rotation:Math.PI/6},{color:ni,symbol:"circle",dashArrayX:[[8,8],[0,8,8,0]],dashArrayY:[6,0],symbolSize:.8},{color:ni,dashArrayX:[1,0],dashArrayY:[4,3],rotation:-Math.PI/4},{color:ni,dashArrayX:[[6,6],[0,6,6,0]],dashArrayY:[6,0]},{color:ni,dashArrayX:[[1,0],[1,6]],dashArrayY:[1,0,6,0],rotation:Math.PI/4},{color:ni,symbol:"triangle",dashArrayX:[[9,9],[0,9,9,0]],dashArrayY:[7,2],symbolSize:.75}]}},textStyle:{fontFamily:T_.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 fA=fe();function hA(t,e,r){var n=fA.get(e);if(!n)return r;var a=n(t);return a?r.concat(a):r}var $l,fo,C_,M_="\0_ec_inner",dA=1,Rh=(function(t){G(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 $e(i),this._locale=new $e(o),this._optionManager=s},e.prototype.setOption=function(r,n,a){var i=I_(n);this._optionManager.setOption(r,a,i),this._resetOption(null,i)},e.prototype.resetOption=function(r,n){return this._resetOption(r,I_(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"?C_(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&&A(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=fe(),c=n&&n.replaceMergeMainTypeMap;BT(this),A(r,function(f,d){f!=null&&(Oe.hasClass(d)?d&&(s.push(d),l.set(d,!0)):a[d]=a[d]==null?ye(f):ke(a[d],f,!0))}),c&&c.each(function(f,d){Oe.hasClass(d)&&!l.get(d)&&(s.push(d),l.set(d,!0))}),Oe.topologicalTravel(s,Oe.getAllClassMainTypes(),u,this);function u(f){var d=hA(this,f,ut(r[f])),h=i.get(f),v=h?c&&c.get(f)?"replaceMerge":"normalMerge":"replaceAll",m=JS(h,d,v);ok(m,f,Oe),a[f]=null,i.set(f,null),o.set(f,0);var g=[],p=[],y=0,b;A(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=Oe.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 D=V({componentIndex:S},x.keyInfo);w=new M(k,this,this,D),V(w,D),x.brandNew&&(w.__requireNewView=!0),w.init(k,this,this),w.optionUpdated(null,!0)}}w?(g.push(w.option),p.push(w),y++):(g.push(void 0),p.push(void 0))},this),a[f]=g,i.set(f,p),o.set(f,y),f==="series"&&$l(this)}this._seriesIndices||$l(this)},e.prototype.getOption=function(){var r=ye(this.option);return A(r,function(n,a){if(Oe.hasClass(a)){for(var i=ut(n),o=i.length,s=!1,l=o-1;l>=0;l--)i[l]&&!Gi(i[l])?s=!0:(i[l]=null,!s&&o--);i.length=o,r[a]=i}}),delete r[M_],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=[],A(ut(a),function(c){s[c]&&l.push(s[c])})):i!=null?l=A_("id",i,s):o!=null?l=A_("name",o,s):l=it(s,function(c){return!!c}),D_(l,r)},e.prototype.findComponents=function(r){var n=r.query,a=r.mainType,i=s(n),o=i?this.queryComponents(i):it(this._componentsMap.get(a),function(c){return!!c});return l(D_(o,r));function s(c){var u=a+"Index",f=a+"Id",d=a+"Name";return c&&(c[u]!=null||c[f]!=null||c[d]!=null)?{mainType:a,index:c[u],id:c[f],name:c[d]}:null}function l(c){return r.filter?it(c,r.filter):c}},e.prototype.eachComponent=function(r,n,a){var i=this._componentsMap;if(ge(r)){var o=n,s=r;i.each(function(f,d){for(var h=0;f&&h<f.length;h++){var v=f[h];v&&s.call(o,d,v,v.componentIndex)}})}else for(var l=ie(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=Tr(r,null);return it(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 it(this._componentsMap.get("series"),function(n){return!!n&&n.subType===r})},e.prototype.getSeries=function(){return it(this._componentsMap.get("series"),function(r){return!!r})},e.prototype.getSeriesCount=function(){return this._componentsCount.get("series")},e.prototype.eachSeries=function(r,n){fo(this),A(this._seriesIndices,function(a){var i=this._componentsMap.get("series")[a];r.call(n,i,a)},this)},e.prototype.eachRawSeries=function(r,n){A(this._componentsMap.get("series"),function(a){a&&r.call(n,a,a.componentIndex)})},e.prototype.eachSeriesByType=function(r,n,a){fo(this),A(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 A(this.getSeriesByType(r),n,a)},e.prototype.isSeriesFiltered=function(r){return fo(this),this._seriesIndicesMap.get(r.componentIndex)==null},e.prototype.getCurrentSeriesIndices=function(){return(this._seriesIndices||[]).slice()},e.prototype.filterSeries=function(r,n){fo(this);var a=[];A(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=fe(a)},e.prototype.restoreData=function(r){$l(this);var n=this._componentsMap,a=[];n.each(function(i,o){Oe.hasClass(o)&&a.push(o)}),Oe.topologicalTravel(a,Oe.getAllClassMainTypes(),function(i){A(n.get(i),function(o){o&&(i!=="series"||!vA(o,r))&&o.restoreData()})})},e.internalField=(function(){$l=function(r){var n=r._seriesIndices=[];A(r._componentsMap.get("series"),function(a){a&&n.push(a.componentIndex)}),r._seriesIndicesMap=fe(n)},fo=function(r){},C_=function(r,n){r.option={},r.option[M_]=dA,r._componentsMap=fe({series:[]}),r._componentsCount=fe();var a=n.aria;ce(a)&&a.enabled==null&&(a.enabled=!0),pA(n,r._theme.option),ke(n,uA,!1),r._mergeOption(n,null)}})(),e})($e);function vA(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 pA(t,e){var r=t.color&&!t.colorLayer;A(e,function(n,a){a==="colorLayer"&&r||Oe.hasClass(a)||(typeof n=="object"?t[a]=t[a]?ke(t[a],n,!1):ye(n):t[a]==null&&(t[a]=n))})}function A_(t,e,r){if(ee(e)){var n=fe();return A(e,function(i){if(i!=null){var o=Tr(i,null);o!=null&&n.set(i,!0)}}),it(r,function(i){return i&&n.get(i[t])})}else{var a=Tr(e,null);return it(r,function(i){return i&&a!=null&&i[t]===a})}}function D_(t,e){return e.hasOwnProperty("subType")?it(t,function(r){return r&&r.subType===e.subType}):t}function I_(t){var e=fe();return t&&A(ut(t.replaceMerge),function(r){e.set(r,!0)}),{replaceMergeMainTypeMap:e}}yr(Rh,Qf);var gA=["getDom","getZr","getWidth","getHeight","getDevicePixelRatio","dispatchAction","isSSR","isDisposed","on","off","getDataURL","getConnectedDataURL","getOption","getId","updateLabelLayout"],P_=(function(){function t(e){A(gA,function(r){this[r]=Ce(e[r],e)},this)}return t})(),mA=/^(min|max)?(.+)$/,yA=(function(){function t(e){this._timelineOptions=[],this._mediaList=[],this._currentMediaIndices=[],this._api=e}return t.prototype.setOption=function(e,r,n){e&&(A(ut(e.series),function(o){o&&o.data&&bt(o.data)&&au(o.data)}),A(ut(e.dataset),function(o){o&&o.source&&bt(o.source)&&au(o.source)})),e=ye(e);var a=this._optionBackup,i=_A(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=[],ye(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=ye(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++)bA(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 ye(u===-1?i.option:a[u].option)})),this._currentMediaIndices=o,s},t})();function _A(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)&&A(c,function(h){h&&h.option&&(h.query?n.push(h):a||(a=h))}),d(i),A(l,function(h){return d(h)}),A(n,function(h){return d(h.option)});function d(h){A(e,function(v){v(h,r)})}return{baseOption:i,timelineOptions:l||[],mediaDefault:a,mediaList:n}}function bA(t,e,r){var n={width:e,height:r,aspectratio:e/r},a=!0;return A(t,function(i,o){var s=o.match(mA);if(!(!s||!s[1]||!s[2])){var l=s[1],c=s[2].toLowerCase();xA(n[c],i,l)||(a=!1)}}),a}function xA(t,e,r){return r==="min"?t>=e:r==="max"?t<=e:t===e}function wA(t,e){return t.join(",")===e.join(",")}var sr=A,ho=ce,L_=["areaStyle","lineStyle","nodeStyle","linkStyle","chordStyle","label","labelLine"];function Eh(t){var e=t&&t.itemStyle;if(e)for(var r=0,n=L_.length;r<n;r++){var a=L_[r],i=e.normal,o=e.emphasis;i&&i[a]&&(t[a]=t[a]||{},t[a].normal?ke(t[a].normal,i[a]):t[a].normal=i[a],i[a]=null),o&&o[a]&&(t[a]=t[a]||{},t[a].emphasis?ke(t[a].emphasis,o[a]):t[a].emphasis=o[a],o[a]=null)}}function ht(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,De(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 vo(t){ht(t,"itemStyle"),ht(t,"lineStyle"),ht(t,"areaStyle"),ht(t,"label"),ht(t,"labelLine"),ht(t,"upperLabel"),ht(t,"edgeLabel")}function Ze(t,e){var r=ho(t)&&t[e],n=ho(r)&&r.textStyle;if(n)for(var a=0,i=fg.length;a<i;a++){var o=fg[a];n.hasOwnProperty(o)&&(r[o]=n[o])}}function jt(t){t&&(vo(t),Ze(t,"label"),t.emphasis&&Ze(t.emphasis,"label"))}function SA(t){if(ho(t)){Eh(t),vo(t),Ze(t,"label"),Ze(t,"upperLabel"),Ze(t,"edgeLabel"),t.emphasis&&(Ze(t.emphasis,"label"),Ze(t.emphasis,"upperLabel"),Ze(t.emphasis,"edgeLabel"));var e=t.markPoint;e&&(Eh(e),jt(e));var r=t.markLine;r&&(Eh(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&&!bt(i))for(var o=0;o<i.length;o++)jt(i[o]);A(t.categories,function(c){vo(c)})}if(a&&!bt(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++)ee(l[o])?(jt(l[o][0]),jt(l[o][1])):jt(l[o]);t.type==="gauge"?(Ze(t,"axisLabel"),Ze(t,"title"),Ze(t,"detail")):t.type==="treemap"?(ht(t.breadcrumb,"itemStyle"),A(t.levels,function(c){vo(c)})):t.type==="tree"&&vo(t.leaves)}}function Xr(t){return ee(t)?t:t?[t]:[]}function R_(t){return(ee(t)?t[0]:t)||{}}function kA(t,e){sr(Xr(t.series),function(n){ho(n)&&SA(n)});var r=["xAxis","yAxis","radiusAxis","angleAxis","singleAxis","parallelAxis","radar"];e&&r.push("valueAxis","categoryAxis","logAxis","timeAxis"),sr(r,function(n){sr(Xr(t[n]),function(a){a&&(Ze(a,"axisLabel"),Ze(a.axisPointer,"label"))})}),sr(Xr(t.parallel),function(n){var a=n&&n.parallelAxisDefault;Ze(a,"axisLabel"),Ze(a&&a.axisPointer,"label")}),sr(Xr(t.calendar),function(n){ht(n,"itemStyle"),Ze(n,"dayLabel"),Ze(n,"monthLabel"),Ze(n,"yearLabel")}),sr(Xr(t.radar),function(n){Ze(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(Xr(t.geo),function(n){ho(n)&&(jt(n),sr(Xr(n.regions),function(a){jt(a)}))}),sr(Xr(t.timeline),function(n){jt(n),ht(n,"label"),ht(n,"itemStyle"),ht(n,"controlStyle",!0);var a=n.data;ee(a)&&A(a,function(i){ce(i)&&(ht(i,"label"),ht(i,"itemStyle"))})}),sr(Xr(t.toolbox),function(n){ht(n,"iconStyle"),sr(n.feature,function(a){ht(a,"iconStyle")})}),Ze(R_(t.axisPointer),"label"),Ze(R_(t.tooltip).axisPointer,"label")}function TA(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 CA(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 E_(t){t&&A(MA,function(e){e[0]in t&&!(e[1]in t)&&(t[e[1]]=t[e[0]])})}var MA=[["x","left"],["y","top"],["x2","right"],["y2","bottom"]],AA=["grid","geo","parallel","legend","toolbox","title","visualMap","dataZoom","timeline"],Oh=[["borderRadius","barBorderRadius"],["borderColor","barBorderColor"],["borderWidth","barBorderWidth"]];function po(t){var e=t&&t.itemStyle;if(e)for(var r=0;r<Oh.length;r++){var n=Oh[r][1],a=Oh[r][0];e[n]!=null&&(e[a]=e[n])}}function O_(t){t&&t.alignTo==="edge"&&t.margin!=null&&t.edgeDistance==null&&(t.edgeDistance=t.margin)}function N_(t){t&&t.downplay&&!t.blur&&(t.blur=t.downplay)}function DA(t){t&&t.focusNodeAdjacency!=null&&(t.emphasis=t.emphasis||{},t.emphasis.focus==null&&(t.emphasis.focus="adjacency"))}function B_(t,e){if(t)for(var r=0;r<t.length;r++)e(t[r]),t[r]&&B_(t[r].children,e)}function z_(t,e){kA(t,e),t.series=ut(t.series),A(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),O_(r.label);var a=r.data;if(a&&!bt(a))for(var i=0;i<a.length;i++)O_(a[i]);r.hoverOffset!=null&&(r.emphasis=r.emphasis||{},(r.emphasis.scaleSize=null)&&(r.emphasis.scaleSize=r.hoverOffset))}else if(n==="gauge"){var o=TA(r,"pointer.color");o!=null&&CA(r,"itemStyle.color",o)}else if(n==="bar"){po(r),po(r.backgroundStyle),po(r.emphasis);var a=r.data;if(a&&!bt(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)),N_(r),B_(r.data,N_)}else n==="graph"||n==="sankey"?DA(r):n==="map"&&(r.mapType&&!r.map&&(r.map=r.mapType),r.mapLocation&&De(r,r.mapLocation));r.hoverAnimation!=null&&(r.emphasis=r.emphasis||{},r.emphasis&&r.emphasis.scale==null&&(r.emphasis.scale=r.hoverAnimation)),E_(r)}}),t.dataRange&&(t.visualMap=t.dataRange),A(AA,function(r){var n=t[r];n&&(ee(n)||(n=[n]),A(n,function(a){E_(a)}))})}function IA(t){var e=fe();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(PA)}function PA(t){A(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 d=o.get(e.stackedDimension,f);if(isNaN(d))return a;var h,v;s?v=o.getRawIndex(f):h=o.get(e.stackedByDimension,f);for(var m=NaN,g=r-1;g>=0;g--){var p=t[g];if(s||(v=p.data.rawIndexOf(p.stackedByDimension,h)),v>=0){var y=p.data.getByRawIndex(p.stackResultDimension,v);if(l==="all"||l==="positive"&&y>0||l==="negative"&&y<0||l==="samesign"&&d>=0&&y>0||l==="samesign"&&d<=0&&y<0){d=qS(d,y),m=y;break}}}return n[0]=d,n[1]=m,n})})}var lr=(function(){function t(){this.group=new lt,this.uid=bl("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})();iu(lr),ds(lr);var F_=Xe(),H_={itemStyle:Ci(cm,!0),lineStyle:Ci(lm,!0)},LA={lineStyle:"stroke",itemStyle:"fill"};function V_(t,e){var r=t.visualStyleMapper||H_[e];return r||(console.warn("Unknown style type '"+e+"'."),H_.itemStyle)}function G_(t,e){var r=t.visualDrawType||LA[e];return r||(console.warn("Unknown style type '"+e+"'."),"fill")}var RA={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=t.getModel(n),i=V_(t,n),o=i(a),s=a.getShallow("decal");s&&(r.setVisual("decal",s),s.dirty=!0);var l=G_(t,n),c=o[l],u=ge(c)?c:null,f=o.fill==="auto"||o.stroke==="auto";if(!o[l]||u||f){var d=t.getColorFromPalette(t.name,null,e.getSeriesCount());o[l]||(o[l]=d,r.setVisual("colorFromPalette",!0)),o.fill=o.fill==="auto"||ge(o.fill)?d:o.fill,o.stroke=o.stroke==="auto"||ge(o.stroke)?d:o.stroke}if(r.setVisual("style",o),r.setVisual("drawType",l),!e.isSeriesFiltered(t)&&u)return r.setVisual("colorFromPalette",!1),{dataEach:function(h,v){var m=t.getDataParams(v),g=V({},o);g[l]=u(m),h.setItemVisual(v,"style",g)}}}},go=new $e,EA={createOnAllSeries:!0,performRawSeries:!0,reset:function(t,e){if(!(t.ignoreStyleOnData||e.isSeriesFiltered(t))){var r=t.getData(),n=t.visualStyleAccessPath||"itemStyle",a=V_(t,n),i=r.getVisual("drawType");return{dataEach:r.hasItemOption?function(o,s){var l=o.getRawDataItem(s);if(l&&l[n]){go.option=l[n];var c=a(go),u=o.ensureUniqueItemVisual(s,"style");V(u,c),go.option.decal&&(o.setItemVisual(s,"decal",go.option.decal),go.option.decal.dirty=!0),i in c&&o.setItemVisual(s,"colorFromPalette",!1)}}:null}}}},OA={performRawSeries:!0,overallReset:function(t){var e=fe();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)),F_(r).scope=i}}),t.eachSeries(function(r){if(!(r.isColorBySeries()||t.isSeriesFiltered(r))){var n=r.getRawData(),a={},i=r.getData(),o=F_(r).scope,s=r.visualStyleAccessPath||"itemStyle",l=G_(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 d=i.ensureUniqueItemVisual(u,"style"),h=n.getName(c)||c+"",v=n.count();d[l]=r.getColorFromPalette(h,o,v)}})}})}},Yl=Math.PI;function NA(t,e){e=e||{},De(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 lt,n=new nt({style:{fill:e.maskColor},zlevel:e.zlevel,z:1e4});r.add(n);var a=new wt({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 nt({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 rl({shape:{startAngle:-Yl/2,endAngle:-Yl/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:Yl*3/2}).start("circularInOut"),o.animateShape(!0).when(1e3,{startAngle:Yl*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 W_=(function(){function t(e,r,n,a){this._stageTaskMap=fe(),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=fe();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;A(this._allHandlers,function(a){var i=e.get(a.uid)||e.set(a.uid,{}),o="";Br(!(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;A(e,function(l,c){if(!(a.visualType&&a.visualType!==l.visualType)){var u=o._stageTaskMap.get(l.uid),f=u.seriesTaskMap,d=u.overallTask;if(d){var h,v=d.agentStubMap;v.each(function(g){s(a,g)&&(g.dirty(),h=!0)}),h&&d.dirty(),o.updatePayload(d,n);var m=o.getPerformArgs(d,a.block);v.each(function(g){g.perform(m)}),d.perform(m)&&(i=!0)}else f&&f.each(function(g,p){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=fe(),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 d=f.uid,h=s.set(d,o&&o.get(d)||so({plan:VA,reset:GA,count:UA}));h.context={model:f,ecModel:n,api:a,useClearVisual:e.isVisual&&!e.isLayout,plan:e.plan,reset:e.reset,scheduler:i},i._pipe(f,h)}},t.prototype._createOverallStageTask=function(e,r,n,a){var i=this,o=r.overallTask=r.overallTask||so({reset:BA});o.context={ecModel:n,api:a,overallReset:e.overallReset,scheduler:i};var s=o.agentStubMap,l=o.agentStubMap=fe(),c=e.seriesType,u=e.getTargetSeries,f=!0,d=!1,h="";Br(!e.createOnAllSeries,h),c?n.eachRawSeriesByType(c,v):u?u(n,a).each(v):(f=!1,A(n.getSeries(),v));function v(m){var g=m.uid,p=l.set(g,s&&s.get(g)||(d=!0,so({reset:zA,onDirty:HA})));p.context={model:m,overallProgress:f},p.agent=o,p.__block=f,i._pipe(m,p)}d&&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 ge(e)&&(e={overallReset:e,seriesType:$A(e)}),e.uid=bl("stageHandler"),r&&(e.visualType=r),e},t})();function BA(t){t.overallReset(t.ecModel,t.api,t.payload)}function zA(t){return t.overallProgress&&FA}function FA(){this.agent.dirty(),this.getDownstream().dirty()}function HA(){this.agent&&this.agent.dirty()}function VA(t){return t.plan?t.plan(t.model,t.ecModel,t.api,t.payload):null}function GA(t){t.useClearVisual&&t.data.clearAllVisual();var e=t.resetDefines=ut(t.reset(t.model,t.ecModel,t.api,t.payload));return e.length>1?ue(e,function(r,n){return U_(n)}):WA}var WA=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 UA(t){return t.data.count()}function $A(t){ql=null;try{t(mo,$_)}catch{}return ql}var mo={},$_={},ql;Y_(mo,Rh),Y_($_,P_),mo.eachSeriesByType=mo.eachRawSeriesByType=function(t){ql=t},mo.eachComponent=function(t){t.mainType==="series"&&t.subType&&(ql=t.subType)};function Y_(t,e){for(var r in e.prototype)t[r]=pt}var q_=["#37A2DA","#32C5E9","#67E0E3","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#E062AE","#E690D1","#e7bcf3","#9d96f5","#8378EA","#96BFFF"];const YA={color:q_,colorLayer:[["#37A2DA","#ffd85c","#fd7b5f"],["#37A2DA","#67E0E3","#FFDB5C","#ff9f7f","#E062AE","#9d96f5"],["#37A2DA","#32C5E9","#9FE6B8","#FFDB5C","#ff9f7f","#fb7293","#e7bcf3","#8378EA","#96BFFF"],q_]};var dt="#B9B8CE",X_="#100C2A",Xl=function(){return{axisLine:{lineStyle:{color:dt}},splitLine:{lineStyle:{color:"#484753"}},splitArea:{areaStyle:{color:["rgba(255,255,255,0.02)","rgba(255,255,255,0.05)"]}},minorSplitLine:{lineStyle:{color:"#20203B"}}}},Z_=["#4992ff","#7cffb2","#fddd60","#ff6e76","#58d9f9","#05c091","#ff8a45","#8d48e3","#dd79ff"],K_={darkMode:!0,color:Z_,backgroundColor:X_,axisPointer:{lineStyle:{color:"#817f91"},crossStyle:{color:"#817f91"},label:{color:"#fff"}},legend:{textStyle:{color:dt},pageTextStyle:{color:dt}},textStyle:{color:dt},title:{textStyle:{color:"#EEF1FA"},subtextStyle:{color:"#B9B8CE"}},toolbox:{iconStyle:{borderColor:dt}},dataZoom:{borderColor:"#71708A",textStyle:{color:dt},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:dt}},timeline:{lineStyle:{color:dt},label:{color:dt},controlStyle:{color:dt,borderColor:dt}},calendar:{itemStyle:{color:X_},dayLabel:{color:dt},monthLabel:{color:dt},yearLabel:{color:dt}},timeAxis:Xl(),logAxis:Xl(),valueAxis:Xl(),categoryAxis:Xl(),line:{symbol:"circle"},graph:{color:Z_},gauge:{title:{color:dt},axisLine:{lineStyle:{color:[[1,"rgba(207,212,219,0.2)"]]}},axisLabel:{color:dt},detail:{color:"#EEF1FA"}},candlestick:{itemStyle:{color:"#f64e56",color0:"#54ea92",borderColor:"#f64e56",borderColor0:"#54ea92"}}};K_.categoryAxis.splitLine.show=!1;var qA=(function(){function t(){}return t.prototype.normalizeQuery=function(e){var r={},n={},a={};if(ie(e)){var i=br(e);r.mainType=i.main||null,r.subType=i.sub||null}else{var o=["Index","Name","Id"],s={name:1,dataIndex:1,dataType:1};A(e,function(l,c){for(var u=!1,f=0;f<o.length;f++){var d=o[f],h=c.lastIndexOf(d);if(h>0&&h===c.length-d.length){var v=c.slice(0,h);v!=="data"&&(r.mainType=v,r[d.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,d,h,v){return f[h]==null||d[v||h]===f[h]}},t.prototype.afterTrigger=function(){this.eventInfo=null},t})(),Nh=["symbol","symbolSize","symbolRotate","symbolOffset"],j_=Nh.concat(["symbolKeepAspect"]),XA={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<Nh.length;o++){var s=Nh[o],l=t.get(s);ge(l)?(i=!0,a[s]=l):n[s]=l}if(n.symbol=n.symbol||t.defaultSymbol,r.setVisual(V({legendIcon:t.legendIcon||n.symbol,symbolKeepAspect:t.get("symbolKeepAspect")},n)),e.isSeriesFiltered(t))return;var c=Ge(a);function u(f,d){for(var h=t.getRawValue(d),v=t.getDataParams(d),m=0;m<c.length;m++){var g=c[m];f.setItemVisual(d,g,a[g](h,v))}}return{dataEach:i?u:null}}},ZA={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<j_.length;s++){var l=j_[s],c=o.getShallow(l,!0);c!=null&&a.setItemVisual(i,l,c)}}return{dataEach:r.hasItemOption?n:null}}};function KA(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 jA(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 yo(t,e,r){for(var n;t&&!(e(t)&&(n=t,r));)t=t.__hostTarget||t.parent;return n}var QA=Math.round(Math.random()*9),JA=typeof Object.defineProperty=="function",eD=(function(){function t(){this._id="__ec_inner_"+QA++}return t.prototype.get=function(e){return this._guard(e)[this._id]},t.prototype.set=function(e,r){var n=this._guard(e);return JA?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 ia(t){return isFinite(t)}function tD(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=ia(n)?n:0,a=ia(a)?a:1,i=ia(i)?i:0,o=ia(o)?o:0;var s=t.createLinearGradient(n,i,a,o);return s}function rD(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=ia(o)?o:.5,s=ia(s)?s:.5,l=l>=0&&ia(l)?l:.5;var c=t.createRadialGradient(o,s,0,o,s,l);return c}function Bh(t,e,r){for(var n=e.type==="radial"?rD(t,e,r):tD(t,e,r),a=e.colorStops,i=0;i<a.length;i++)n.addColorStop(a[i].offset,a[i].color);return n}function nD(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 Zl(t){return parseInt(t,10)}function Kl(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]||Zl(s[n])||Zl(t.style[n]))-(Zl(s[i])||0)-(Zl(s[o])||0)|0}function aD(t,e){return!t||t==="solid"||!(e>0)?null:t==="dashed"?[4*e,2*e]:t==="dotted"?[e]:He(t)?[t]:ee(t)?t:null}function Q_(t){var e=t.style,r=e.lineDash&&e.lineWidth>0&&aD(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 iD=new Un(!0);function jl(t){var e=t.stroke;return!(e==null||e==="none"||!(t.lineWidth>0))}function J_(t){return typeof t=="string"&&t!=="none"}function Ql(t){var e=t.fill;return e!=null&&e!=="none"}function e0(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 t0(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 zh(t,e,r){var n=ip(e.image,e.__image,r);if(vs(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)*cw),i.scaleSelf(e.scaleX||1,e.scaleY||1),a.setTransform(i)}return a}}function oD(t,e,r,n){var a,i=jl(r),o=Ql(r),s=r.strokePercent,l=s<1,c=!e.path;(!e.silent||l)&&c&&e.createPathProxy();var u=e.path||iD,f=e.__dirty;if(!n){var d=r.fill,h=r.stroke,v=o&&!!d.colorStops,m=i&&!!h.colorStops,g=o&&!!d.image,p=i&&!!h.image,y=void 0,b=void 0,x=void 0,S=void 0,w=void 0;(v||m)&&(w=e.getBoundingRect()),v&&(y=f?Bh(t,d,w):e.__canvasFillGradient,e.__canvasFillGradient=y),m&&(b=f?Bh(t,h,w):e.__canvasStrokeGradient,e.__canvasStrokeGradient=b),g&&(x=f||!e.__canvasFillPattern?zh(t,d,e):e.__canvasFillPattern,e.__canvasFillPattern=x),p&&(S=f||!e.__canvasStrokePattern?zh(t,h,e):e.__canvasStrokePattern,e.__canvasStrokePattern=x),v?t.fillStyle=y:g&&(x?t.fillStyle=x:o=!1),m?t.strokeStyle=b:p&&(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=Q_(e),T=a[0],M=a[1]);var D=!0;(c||f&Ea)&&(u.setDPR(t.dpr),l?u.setContext(null):(u.setContext(t),D=!1),u.reset(),e.buildPath(u,e.shape,n),u.toStatic(),e.pathUpdated()),D&&u.rebuildPath(t,l?s:1),T&&(t.setLineDash(T),t.lineDashOffset=M),n||(r.strokeFirst?(i&&t0(t,r),o&&e0(t,r)):(o&&e0(t,r),i&&t0(t,r))),T&&t.setLineDash([])}function sD(t,e,r){var n=e.__image=ip(r.image,e.__image,e,e.onload);if(!(!n||!vs(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,d=s-u;t.drawImage(n,c,u,f,d,a,i,o,s)}else t.drawImage(n,a,i,o,s)}}function lD(t,e,r){var n,a=r.text;if(a!=null&&(a+=""),a){t.font=r.font||Dn,t.textAlign=r.textAlign,t.textBaseline=r.textBaseline;var i=void 0,o=void 0;t.setLineDash&&r.lineDash&&(n=Q_(e),i=n[0],o=n[1]),i&&(t.setLineDash(i),t.lineDashOffset=o),r.strokeFirst?(jl(r)&&t.strokeText(a,r.x,r.y),Ql(r)&&t.fillText(a,r.x,r.y)):(Ql(r)&&t.fillText(a,r.x,r.y),jl(r)&&t.strokeText(a,r.x,r.y)),i&&t.setLineDash([])}}var r0=["shadowBlur","shadowOffsetX","shadowOffsetY"],n0=[["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]];function a0(t,e,r,n,a){var i=!1;if(!n&&(r=r||{},e===r))return!1;if(n||e.opacity!==r.opacity){At(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||(At(t,a),i=!0),t.globalCompositeOperation=e.blend||zn.blend);for(var s=0;s<r0.length;s++){var l=r0[s];(n||e[l]!==r[l])&&(i||(At(t,a),i=!0),t[l]=t.dpr*(e[l]||0))}return(n||e.shadowColor!==r.shadowColor)&&(i||(At(t,a),i=!0),t.shadowColor=e.shadowColor||zn.shadowColor),i}function i0(t,e,r,n,a){var i=_o(e,a.inHover),o=n?null:r&&_o(r,a.inHover)||{};if(i===o)return!1;var s=a0(t,i,o,n,a);if((n||i.fill!==o.fill)&&(s||(At(t,a),s=!0),J_(i.fill)&&(t.fillStyle=i.fill)),(n||i.stroke!==o.stroke)&&(s||(At(t,a),s=!0),J_(i.stroke)&&(t.strokeStyle=i.stroke)),(n||i.opacity!==o.opacity)&&(s||(At(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||(At(t,a),s=!0),t.lineWidth=c)}for(var u=0;u<n0.length;u++){var f=n0[u],d=f[0];(n||i[d]!==o[d])&&(s||(At(t,a),s=!0),t[d]=i[d]||f[1])}return s}function cD(t,e,r,n,a){return a0(t,_o(e,a.inHover),r&&_o(r,a.inHover),n,a)}function o0(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 uD(t,e,r){for(var n=!1,a=0;a<t.length;a++){var i=t[a];n=n||i.isZeroArea(),o0(e,i),e.beginPath(),i.buildPath(e,i.shape),e.clip()}r.allClipped=n}function fD(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 s0=1,l0=2,c0=3,u0=4;function hD(t){var e=Ql(t),r=jl(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 At(t,e){e.batchFill&&t.fill(),e.batchStroke&&t.stroke(),e.batchFill="",e.batchStroke=""}function _o(t,e){return e&&t.__hoverStyle||t.style}function f0(t,e){oa(t,e,{inHover:!1,viewWidth:0,viewHeight:0},!0)}function oa(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||nD(i,o))&&(o&&o.length&&(At(t,r),t.restore(),l=s=!0,r.prevElClipPaths=null,r.allClipped=!1,r.prevEl=null),i&&i.length&&(At(t,r),t.save(),uD(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 Ee&&e.autoBatch&&hD(e.style);s||fD(a,c.transform)?(At(t,r),o0(t,e)):u||At(t,r);var f=_o(e,r.inHover);e instanceof Ee?(r.lastDrawType!==s0&&(l=!0,r.lastDrawType=s0),i0(t,e,c,l,r),(!u||!r.batchFill&&!r.batchStroke)&&t.beginPath(),oD(t,e,f,u),u&&(r.batchFill=f.fill||"",r.batchStroke=f.stroke||"")):e instanceof Vs?(r.lastDrawType!==c0&&(l=!0,r.lastDrawType=c0),i0(t,e,c,l,r),lD(t,e,f)):e instanceof un?(r.lastDrawType!==l0&&(l=!0,r.lastDrawType=l0),cD(t,e,c,l,r),sD(t,e,f)):e.getTemporalDisplayables&&(r.lastDrawType!==u0&&(l=!0,r.lastDrawType=u0),dD(t,e,r)),u&&n&&At(t,r),e.innerAfterBrush(),e.afterBrush&&e.afterBrush(),r.prevEl=e,e.__dirty=0,e.__isRendered=!0}function dD(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(),oa(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(),oa(t,l,i,c===u-1),l.innerAfterBrush(),l.afterBrush&&l.afterBrush(),i.prevEl=l}e.clearTemporalDisplayables(),e.notClear=!0,t.restore()}var Fh=new eD,h0=new Mi(100),d0=["symbol","symbolSize","symbolKeepAspect","color","backgroundColor","dashArrayX","dashArrayY","maxTileWidth","maxTileHeight"];function Hh(t,e){if(t==="none")return null;var r=e.getDevicePixelRatio(),n=e.getZr(),a=n.painter.type==="svg";t.dirty&&Fh.delete(t);var i=Fh.get(t);if(i)return i;var o=De(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,Fh.set(t,s),t.dirty=!1,s;function l(c){for(var u=[r],f=!0,d=0;d<d0.length;++d){var h=o[d0[d]];if(h!=null&&!ee(h)&&!ie(h)&&!He(h)&&typeof h!="boolean"){f=!1;break}u.push(h)}var v;if(f){v=u.join(",")+(a?"-svg":"");var m=h0.get(v);m&&(a?c.svgElement=m:c.image=m)}var g=p0(o.dashArrayX),p=vD(o.dashArrayY),y=v0(o.symbol),b=pD(g),x=g0(p),S=!a&&wa.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")),D(),f&&h0.put(v,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=sg(C,b[I]);for(var L=1,I=0,P=y.length;I<P;++I)L=sg(L,y[I].length);C*=L;var R=x*b.length*y.length;return{width:Math.max(1,Math.min(C,o.maxTileWidth)),height:Math.max(1,Math.min(R,o.maxTileHeight))}}function D(){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<p.length;++I)C+=p[I];if(C<=0)return;for(var P=-x,L=0,R=0,N=0;P<k.height;){if(L%2===0){for(var Z=R/2%y.length,F=0,z=0,W=0;F<k.width*2;){for(var ne=0,I=0;I<g[N].length;++I)ne+=g[N][I];if(ne<=0)break;if(z%2===0){var te=(1-o.symbolSize)*.5,de=F+g[N][z]*te,be=P+p[L]*te,xe=g[N][z]*o.symbolSize,et=p[L]*o.symbolSize,at=W/2%y[Z].length;Ye(de,be,xe,et,y[Z][at])}F+=g[N][z],++W,++z,z===g[N].length&&(z=0)}++N,N===g.length&&(N=0)}P+=p[L],++R,++L,L===p.length&&(L=0)}function Ye(X,le,Y,q,B){var j=a?1:r,Te=Ja(B,X*j,le*j,Y*j,q*j,o.color,o.symbolKeepAspect);if(a){var Ne=n.painter.renderOneToVNode(Te);Ne&&w.children.push(Ne)}else f0(T,Te)}}}}function v0(t){if(!t||t.length===0)return[["rect"]];if(ie(t))return[[t]];for(var e=!0,r=0;r<t.length;++r)if(!ie(t[r])){e=!1;break}if(e)return v0([t]);for(var n=[],r=0;r<t.length;++r)ie(t[r])?n.push([t[r]]):n.push(t[r]);return n}function p0(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 p0([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=ue(t[n],function(s){return Math.ceil(s)});e.length%2===1?a.push(e.concat(e)):a.push(e)}return a}function vD(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=ue(t,function(n){return Math.ceil(n)});return t.length%2?r.concat(r):r}function pD(t){return ue(t,function(e){return g0(e)})}function g0(t){for(var e=0,r=0;r<t.length;++r)e+=t[r];return t.length%2===1?e*2:e}function gD(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=Hh(s,e)}});var a=n.getVisual("decal");if(a){var i=n.getVisual("style");i.decal=Hh(a,e)}}})}var cr=new rr,m0={};function mD(t,e){m0[t]=e}function yD(t){return m0[t]}var _D=1,bD=800,xD=900,wD=1e3,SD=2e3,kD=5e3,y0=1e3,TD=1100,Vh=2e3,_0=3e3,CD=4e3,Jl=4500,MD=4600,AD=5e3,DD=6e3,b0=7e3,ID={PROCESSOR:{FILTER:wD,SERIES_FILTER:bD,STATISTIC:kD},VISUAL:{LAYOUT:y0,PROGRESSIVE_LAYOUT:TD,GLOBAL:Vh,CHART:_0,POST_CHART_LAYOUT:MD,COMPONENT:CD,BRUSH:AD,CHART_ITEM:Jl,ARIA:DD,DECAL:b0}},vt="__flagInMainProcess",Dt="__pendingUpdate",Gh="__needsUpdateStatus",x0=/^[a-zA-Z0-9_]+$/,Wh="__connectUpdateStatus",w0=0,PD=1,LD=2;function S0(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];if(this.isDisposed()){this.id;return}return T0(this,t,e)}}function k0(t){return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return T0(this,t,e)}}function T0(t,e,r){return r[0]=r[0]&&r[0].toLowerCase(),rr.prototype[e].apply(t,r)}var C0=(function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e})(rr),M0=C0.prototype;M0.on=k0("on"),M0.off=k0("off");var ai,Uh,ec,_n,$h,Yh,qh,bo,xo,A0,D0,Xh,I0,tc,P0,L0,Qt,R0,E0=(function(t){G(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||{},ie(n)&&(n=O0[n]),i._dom=r;var o="canvas",s="auto",l=!1;a.ssr;var c=i._zr=k_(r,{renderer:a.renderer||o,devicePixelRatio:a.devicePixelRatio,width:a.width,height:a.height,ssr:a.ssr,useDirtyRect:_e(a.useDirtyRect,l),useCoarsePointer:_e(a.useCoarsePointer,s),pointerSize:a.pointerSize});i._ssr=a.ssr,i._throttledZrFlush=vh(Ce(c.flush,c),17),n=ye(n),n&&z_(n,!0),i._theme=n,i._locale=R2(a.locale||Wm),i._coordSysMgr=new Bf;var u=i._api=P0(i);function f(d,h){return d.__prio-h.__prio}return Vl(nc,f),Vl(Kh,f),i._scheduler=new W_(i,u,Kh,nc),i._messageCenter=new C0,i._initEvents(),i.resize=Ce(i.resize,i),c.animation.on("frame",i._onframe,i),A0(c,i),D0(c,i),au(i),i}return e.prototype._onframe=function(){if(!this._disposed){R0(this);var r=this._scheduler;if(this[Dt]){var n=this[Dt].silent;this[vt]=!0;try{ai(this),_n.update.call(this,null,this[Dt].updateParams)}catch(l){throw this[vt]=!1,this[Dt]=null,l}this._zr.flush(),this[vt]=!1,this[Dt]=null,bo.call(this,n),xo.call(this,n)}else if(r.unfinished){var a=_D,i=this._model,o=this._api;r.unfinished=!1;do{var s=+new Date;r.performSeriesTasks(i),r.performDataProcessorTasks(i),Yh(this,i),r.performVisualTasks(i),tc(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[vt]){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[vt]=!0,!this._model||n){var l=new yA(this._api),c=this._theme,u=this._model=new Rh;u.scheduler=this._scheduler,u.ssr=this._ssr,u.init(null,null,null,c,this._locale,l)}this._model.setOption(r,{replaceMerge:o},jh);var f={seriesTransition:s,optionChanged:!0};if(a)this[Dt]={silent:i,updateParams:f},this[vt]=!1,this.getZr().wakeUp();else{try{ai(this),_n.update.call(this,null,f)}catch(d){throw this[Dt]=null,this[vt]=!1,d}this._ssr||this._zr.flush(),this[Dt]=null,this[vt]=!1,bo.call(this,i),xo.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||he.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(he.svgSupported){var r=this._zr,n=r.storage.getDisplayList();return A(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;A(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 A(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(N0[a]){var l=s,c=s,u=-s,f=-s,d=[],h=r&&r.pixelRatio||this.getDevicePixelRatio();A(So,function(b,x){if(b.group===a){var S=n?b.getZr().painter.getSvgDom().innerHTML:b.renderToCanvas(ye(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),d.push({dom:S,left:w.left,top:w.top})}}),l*=h,c*=h,u*=h,f*=h;var v=u-l,m=f-c,g=wa.createCanvas(),p=k_(g,{renderer:n?"svg":"canvas"});if(p.resize({width:v,height:m}),n){var y="";return A(d,function(b){var x=b.left-l,S=b.top-c;y+='<g transform="translate('+x+","+S+')">'+b.dom+"</g>"}),p.painter.getSvgRoot().innerHTML=y,r.connectedBackgroundColor&&p.painter.setBackgroundColor(r.connectedBackgroundColor),p.refreshImmediately(),p.painter.toDataURL()}else return r.connectedBackgroundColor&&p.add(new nt({shape:{x:0,y:0,width:v,height:m},style:{fill:r.connectedBackgroundColor}})),A(d,function(b){var x=new un({style:{x:b.left*h-l,y:b.top*h-c,image:b.dom}});p.add(x)}),p.refreshImmediately(),g.toDataURL("image/"+(r&&r.type||"png"))}else return this.getDataURL(r)},e.prototype.convertToPixel=function(r,n){return $h(this,"convertToPixel",r,n)},e.prototype.convertFromPixel=function(r,n){return $h(this,"convertFromPixel",r,n)},e.prototype.containPixel=function(r,n){if(this._disposed){this.id;return}var a=this._model,i,o=Ku(a,r);return A(o,function(s,l){l.indexOf("Models")>=0&&A(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=Ku(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?KA(s,l,n):jA(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;A(RD,function(n){var a=function(i){var o=r.getModel(),s=i.target,l,c=n==="globalout";if(c?l={}:s&&yo(s,function(v){var m=Re(v);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=V({},m.eventData),!0},!0),l){var u=l.componentType,f=l.componentIndex;(u==="markLine"||u==="markPoint"||u==="markArea")&&(u="series",f=l.seriesIndex);var d=u&&f!=null&&o.getComponent(u,f),h=d&&r[d.mainType==="series"?"_chartsMap":"_componentsMap"][d.__viewId];l.event=i,l.type=n,r._$eventProcessor.eventInfo={targetEl:s,packedEvent:l,model:d,view:h},r.trigger(n,l)}};a.zrEventfulCallAtLast=!0,r._zr.on(n,a,r)}),A(wo,function(n,a){r._messageCenter.on(a,function(i){this.trigger(a,i)},r)}),A(["selectchanged"],function(n){r._messageCenter.on(n,function(a){this.trigger(n,a)},r)}),LM(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&&dg(this.getDom(),Jh,"");var n=this,a=n._api,i=n._model;A(n._componentsViews,function(o){o.dispose(i,a)}),A(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 So[n.id]},e.prototype.resize=function(r){if(!this[vt]){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[Dt]&&(i==null&&(i=this[Dt].silent),a=!0,this[Dt]=null),this[vt]=!0;try{a&&ai(this),_n.update.call(this,{type:"resize",animation:V({duration:0},r&&r.animation)})}catch(o){throw this[vt]=!1,o}this[vt]=!1,bo.call(this,i),xo.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(),!!Qh[r]){var a=Qh[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=V({},r);return n.type=wo[r.type],n},e.prototype.dispatchAction=function(r,n){if(this._disposed){this.id;return}if(ce(n)||(n={silent:!!n}),!!rc[r.type]&&this._model){if(this[vt]){this._pendingActions.push(r);return}var a=n.silent;qh.call(this,r,a);var i=n.flush;i?this._zr.flush():i!==!1&&he.browser.weChat&&this._throttledZrFlush(),bo.call(this,a),xo.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(){ai=function(f){var d=f._scheduler;d.restorePipelines(f._model),d.prepareStageTasks(),Uh(f,!0),Uh(f,!1),d.plan()},Uh=function(f,d){for(var h=f._model,v=f._scheduler,m=d?f._componentsViews:f._chartsViews,g=d?f._componentsMap:f._chartsMap,p=f._zr,y=f._api,b=0;b<m.length;b++)m[b].__alive=!1;d?h.eachComponent(function(w,k){w!=="series"&&x(k)}):h.eachSeries(x);function x(w){var k=w.__requireNewView;w.__requireNewView=!1;var T="_ec_"+w.id+"_"+w.type,M=!k&&g[T];if(!M){var D=br(w.type),C=d?lr.getClass(D.main,D.sub):ir.getClass(D.sub);M=new C,M.init(h,y),g[T]=M,m.push(M),p.add(M.group)}w.__viewId=M.__id=T,M.__alive=!0,M.__model=w,M.group.__ecComponentInfo={mainType:w.mainType,index:w.componentIndex},!d&&v.prepareView(M,w,h,y)}for(var b=0;b<m.length;){var S=m[b];S.__alive?b++:(!d&&S.renderTask.dispose(),p.remove(S.group),S.dispose(h,y),m.splice(b,1),g[S.__id]===S&&delete g[S.__id],S.__id=S.group.__ecComponentInfo=null)}},ec=function(f,d,h,v,m){var g=f._model;if(g.setUpdatePayload(h),!v){A([].concat(f._componentsViews).concat(f._chartsViews),S);return}var p={};p[v+"Id"]=h[v+"Id"],p[v+"Index"]=h[v+"Index"],p[v+"Name"]=h[v+"Name"];var y={mainType:v,query:p};m&&(y.subType=m);var b=h.excludeSeriesId,x;b!=null&&(x=fe(),A(ut(b),function(w){var k=Tr(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(Rg(h))if(w instanceof Dr)h.type===Kn&&!h.notBlur&&!w.get(["emphasis","disabled"])&&kk(w,h,f._api);else{var T=af(w.mainType,w.componentIndex,h.name,f._api),M=T.focusSelf,D=T.dispatchers;h.type===Kn&&M&&!h.notBlur&&nf(w.mainType,w.componentIndex,f._api),D&&A(D,function(C){h.type===Kn?Zs(C):Ks(C)})}else cf(h)&&w instanceof Dr&&(Mk(w,h,f._api),Ig(w),Qt(f))},f),g&&g.eachComponent(y,function(w){var k=x&&x.get(w.id)!=null;k||S(f[v==="series"?"_chartsMap":"_componentsMap"][w.__viewId])},f);function S(w){w&&w.__alive&&w[d]&&w[d](w.__model,g,f._api,h)}},_n={prepareAndUpdate:function(f){ai(this),_n.update.call(this,f,{optionChanged:f.newOption!=null})},update:function(f,d){var h=this._model,v=this._api,m=this._zr,g=this._coordSysMgr,p=this._scheduler;if(h){h.setUpdatePayload(f),p.restoreData(h,f),p.performSeriesTasks(h),g.create(h,v),p.performDataProcessorTasks(h,f),Yh(this,h),g.update(h,v),r(h),p.performVisualTasks(h,f),Xh(this,h,v,f,d);var y=h.get("backgroundColor")||"transparent",b=h.get("darkMode");m.setBackgroundColor(y),b!=null&&b!=="auto"&&m.setDarkMode(b),cr.trigger("afterupdate",h,v)}},updateTransform:function(f){var d=this,h=this._model,v=this._api;if(h){h.setUpdatePayload(f);var m=[];h.eachComponent(function(p,y){if(p!=="series"){var b=d.getViewOfComponentModel(y);if(b&&b.__alive)if(b.updateTransform){var x=b.updateTransform(y,h,v,f);x&&x.update&&m.push(b)}else m.push(b)}});var g=fe();h.eachSeries(function(p){var y=d._chartsMap[p.__viewId];if(y.updateTransform){var b=y.updateTransform(p,h,v,f);b&&b.update&&g.set(p.uid,1)}else g.set(p.uid,1)}),r(h),this._scheduler.performVisualTasks(h,f,{setDirty:!0,dirtyMap:g}),tc(this,h,v,f,{},g),cr.trigger("afterupdate",h,v)}},updateView:function(f){var d=this._model;d&&(d.setUpdatePayload(f),ir.markUpdateMethod(f,"updateView"),r(d),this._scheduler.performVisualTasks(d,f,{setDirty:!0}),Xh(this,d,this._api,f,{}),cr.trigger("afterupdate",d,this._api))},updateVisual:function(f){var d=this,h=this._model;h&&(h.setUpdatePayload(f),h.eachSeries(function(v){v.getData().clearAllVisual()}),ir.markUpdateMethod(f,"updateVisual"),r(h),this._scheduler.performVisualTasks(h,f,{visualType:"visual",setDirty:!0}),h.eachComponent(function(v,m){if(v!=="series"){var g=d.getViewOfComponentModel(m);g&&g.__alive&&g.updateVisual(m,h,d._api,f)}}),h.eachSeries(function(v){var m=d._chartsMap[v.__viewId];m.updateVisual(v,h,d._api,f)}),cr.trigger("afterupdate",h,this._api))},updateLayout:function(f){_n.update.call(this,f)}},$h=function(f,d,h,v){if(f._disposed){f.id;return}for(var m=f._model,g=f._coordSysMgr.getCoordinateSystems(),p,y=Ku(m,h),b=0;b<g.length;b++){var x=g[b];if(x[d]&&(p=x[d](m,y,v))!=null)return p}},Yh=function(f,d){var h=f._chartsMap,v=f._scheduler;d.eachSeries(function(m){v.updateStreamModes(m,h[m.__viewId])})},qh=function(f,d){var h=this,v=this.getModel(),m=f.type,g=f.escapeConnect,p=rc[m],y=p.actionInfo,b=(y.update||"update").split(":"),x=b.pop(),S=b[0]!=null&&br(b[0]);this[vt]=!0;var w=[f],k=!1;f.batch&&(k=!0,w=ue(f.batch,function(L){return L=De(V({},L),f),L.batch=null,L}));var T=[],M,D=cf(f),C=Rg(f);if(C&&Dg(this._api),A(w,function(L){if(M=p.action(L,h._model,h._api),M=M||V({},L),M.type=y.event||M.type,T.push(M),C){var R=ju(f),N=R.queryOptionMap,Z=R.mainTypeSpecified,F=Z?N.keys()[0]:"series";ec(h,x,L,F),Qt(h)}else D?(ec(h,x,L,"series"),Qt(h)):S&&ec(h,x,L,S.main,S.sub)}),x!=="none"&&!C&&!D&&!S)try{this[Dt]?(ai(this),_n.update.call(this,f),this[Dt]=null):_n[x].call(this,f)}catch(L){throw this[vt]=!1,L}if(k?M={type:y.event||m,escapeConnect:g,batch:T}:M=T[0],this[vt]=!1,!d){var I=this._messageCenter;if(I.trigger(M.type,M),D){var P={type:"selectchanged",escapeConnect:g,selected:Ak(v),isFromClick:f.isFromClick||!1,fromAction:f.type,fromActionPayload:f};I.trigger(P.type,P)}}},bo=function(f){for(var d=this._pendingActions;d.length;){var h=d.shift();qh.call(this,h,f)}},xo=function(f){!f&&this.trigger("updated")},A0=function(f,d){f.on("rendered",function(h){d.trigger("rendered",h),f.animation.isFinished()&&!d[Dt]&&!d._scheduler.unfinished&&!d._pendingActions.length&&d.trigger("finished")})},D0=function(f,d){f.on("mouseover",function(h){var v=h.target,m=yo(v,lf);m&&(Tk(m,h,d._api),Qt(d))}).on("mouseout",function(h){var v=h.target,m=yo(v,lf);m&&(Ck(m,h,d._api),Qt(d))}).on("click",function(h){var v=h.target,m=yo(v,function(y){return Re(y).dataIndex!=null},!0);if(m){var g=m.selected?"unselect":"select",p=Re(m);d._api.dispatchAction({type:g,dataType:p.dataType,dataIndexInside:p.dataIndex,seriesIndex:p.seriesIndex,isFromClick:!0})}})};function r(f){f.clearColorPalette(),f.eachSeries(function(d){d.clearColorPalette()})}function n(f){var d=[],h=[],v=!1;if(f.eachComponent(function(y,b){var x=b.get("zlevel")||0,S=b.get("z")||0,w=b.getZLevelKey();v=v||!!w,(y==="series"?h:d).push({zlevel:x,z:S,idx:b.componentIndex,type:y,key:w})}),v){var m=d.concat(h),g,p;Vl(m,function(y,b){return y.zlevel===b.zlevel?y.z-b.z:y.zlevel-b.zlevel}),A(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!==p&&x++,p=S):p&&(x===g&&x++,p=""),g=x,b.setZLevel(x)})}}Xh=function(f,d,h,v,m){n(d),I0(f,d,h,v,m),A(f._chartsViews,function(g){g.__alive=!1}),tc(f,d,h,v,m),A(f._chartsViews,function(g){g.__alive||g.remove(d,h)})},I0=function(f,d,h,v,m,g){A(g||f._componentsViews,function(p){var y=p.__model;c(y,p),p.render(y,d,h,v),s(y,p),u(y,p)})},tc=function(f,d,h,v,m,g){var p=f._scheduler;m=V(m||{},{updatedSeries:d.getSeries()}),cr.trigger("series:beforeupdate",d,h,m);var y=!1;d.eachSeries(function(b){var x=f._chartsMap[b.__viewId];x.__alive=!0;var S=x.renderTask;p.updatePayload(S,v),c(b,x),g&&g.get(b.uid)&&S.dirty(),S.perform(p.getPerformArgs(S))&&(y=!0),x.group.silent=!!b.get("silent"),o(b,x),Ig(b)}),p.unfinished=y||p.unfinished,cr.trigger("series:layoutlabels",d,h,m),cr.trigger("series:transition",d,h,m),d.eachSeries(function(b){var x=f._chartsMap[b.__viewId];s(b,x),u(b,x)}),i(f,d),cr.trigger("series:afterupdate",d,h,m)},Qt=function(f){f[Gh]=!0,f.getZr().wakeUp()},R0=function(f){f[Gh]&&(f.getZr().storage.traverse(function(d){Zi(d)||a(d)}),f[Gh]=!1)};function a(f){for(var d=[],h=f.currentStates,v=0;v<h.length;v++){var m=h[v];m==="emphasis"||m==="blur"||m==="select"||d.push(m)}f.selected&&f.states.select&&d.push("select"),f.hoverState===$s&&f.states.emphasis?d.push("emphasis"):f.hoverState===Us&&f.states.blur&&d.push("blur"),f.useStates(d)}function i(f,d){var h=f._zr,v=h.storage,m=0;v.traverse(function(g){g.isGroup||m++}),m>d.get("hoverLayerThreshold")&&!he.node&&!he.worker&&d.eachSeries(function(g){if(!g.preventUsingHoverLayer){var p=f._chartsMap[g.__viewId];p.__alive&&p.eachRendered(function(y){y.states.emphasis&&(y.states.emphasis.hoverLayer=!0)})}})}function o(f,d){var h=f.get("blendMode")||null;d.eachRendered(function(v){v.isGroup||(v.style.blend=h)})}function s(f,d){if(!f.preventAutoZ){var h=f.get("z")||0,v=f.get("zlevel")||0;d.eachRendered(function(m){return l(m,h,v,-1/0),!0})}}function l(f,d,h,v){var m=f.getTextContent(),g=f.getTextGuideLine(),p=f.isGroup;if(p)for(var y=f.childrenRef(),b=0;b<y.length;b++)v=Math.max(l(y[b],d,h,v),v);else f.z=d,f.zlevel=h,v=Math.max(f.z2,v);if(m&&(m.z=d,m.zlevel=h,isFinite(v)&&(m.z2=v+2)),g){var x=f.textGuideLineConfig;g.z=d,g.zlevel=h,isFinite(v)&&(g.z2=v+(x&&x.showAbove?1:-1))}return v}function c(f,d){d.eachRendered(function(h){if(!Zi(h)){var v=h.getTextContent(),m=h.getTextGuideLine();h.stateTransition&&(h.stateTransition=null),v&&v.stateTransition&&(v.stateTransition=null),m&&m.stateTransition&&(m.stateTransition=null),h.hasState()?(h.prevStates=h.currentStates,h.clearStates()):h.prevStates&&(h.prevStates=null)}})}function u(f,d){var h=f.getModel("stateAnimation"),v=f.isAnimationEnabled(),m=h.get("duration"),g=m>0?{duration:m,delay:h.get("delay"),easing:h.get("easing")}:null;d.eachRendered(function(p){if(p.states&&p.states.emphasis){if(Zi(p))return;if(p instanceof Ee&&Rk(p),p.__dirty){var y=p.prevStates;y&&p.useStates(y)}if(v){p.stateTransition=g;var b=p.getTextContent(),x=p.getTextGuideLine();b&&(b.stateTransition=g),x&&(x.stateTransition=g)}p.__dirty&&a(p)}})}P0=function(f){return new((function(d){G(h,d);function h(){return d!==null&&d.apply(this,arguments)||this}return h.prototype.getCoordinateSystems=function(){return f._coordSysMgr.getCoordinateSystems()},h.prototype.getComponentByElement=function(v){for(;v;){var m=v.__ecComponentInfo;if(m!=null)return f._model.getComponent(m.mainType,m.index);v=v.parent}},h.prototype.enterEmphasis=function(v,m){Zs(v,m),Qt(f)},h.prototype.leaveEmphasis=function(v,m){Ks(v,m),Qt(f)},h.prototype.enterBlur=function(v){Sk(v),Qt(f)},h.prototype.leaveBlur=function(v){Tg(v),Qt(f)},h.prototype.enterSelect=function(v){Cg(v),Qt(f)},h.prototype.leaveSelect=function(v){Mg(v),Qt(f)},h.prototype.getModel=function(){return f.getModel()},h.prototype.getViewOfComponentModel=function(v){return f.getViewOfComponentModel(v)},h.prototype.getViewOfSeriesModel=function(v){return f.getViewOfSeriesModel(v)},h})(P_))(f)},L0=function(f){function d(h,v){for(var m=0;m<h.length;m++){var g=h[m];g[Wh]=v}}A(wo,function(h,v){f._messageCenter.on(v,function(m){if(N0[f.group]&&f[Wh]!==w0){if(m&&m.escapeConnect)return;var g=f.makeActionFromEvent(m),p=[];A(So,function(y){y!==f&&y.group===f.group&&p.push(y)}),d(p,w0),A(p,function(y){y[Wh]!==PD&&y.dispatchAction(g)}),d(p,LD)}})})}})(),e})(rr),Zh=E0.prototype;Zh.on=S0("on"),Zh.off=S0("off"),Zh.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 RD=["click","dblclick","mouseover","mouseout","mousemove","mousedown","mouseup","globalout","contextmenu"];function k5(t){}var rc={},wo={},Kh=[],jh=[],nc=[],O0={},Qh={},So={},N0={},ED=+new Date-0,Jh="_echarts_instance_";function OD(t,e,r){var n=!(r&&r.ssr);if(n){var a=ND(t);if(a)return a}var i=new E0(t,e,r);return i.id="ec_"+ED++,So[i.id]=i,n&&dg(t,Jh,i.id),L0(i),cr.trigger("afterinit",i),i}function ND(t){return So[uk(t,Jh)]}function B0(t,e){O0[t]=e}function z0(t){Ie(jh,t)<0&&jh.push(t)}function F0(t,e){td(Kh,t,e,SD)}function BD(t){ed("afterinit",t)}function zD(t){ed("afterupdate",t)}function ed(t,e){cr.on(t,e)}function sa(t,e,r){ge(e)&&(r=e,e="");var n=ce(t)?t.type:[t,t={event:e}][0];t.event=(t.event||n).toLowerCase(),e=t.event,!wo[e]&&(Br(x0.test(n)&&x0.test(e)),rc[n]||(rc[n]={action:r,actionInfo:t}),wo[e]=n)}function FD(t,e){Bf.register(t,e)}function HD(t,e){td(nc,t,e,y0,"layout")}function la(t,e){td(nc,t,e,_0,"visual")}var H0=[];function td(t,e,r,n,a){if((ge(e)||ce(e))&&(r=e,e=n),!(Ie(H0,r)>=0)){H0.push(r);var i=W_.wrapStageHandler(r,a);i.__prio=e,i.__raw=r,t.push(i)}}function V0(t,e){Qh[t]=e}function VD(t,e,r){var n=yD("registerMap");n&&n(t,e,r)}var GD=nC;la(Vh,RA),la(Jl,EA),la(Jl,OA),la(Vh,XA),la(Jl,ZA),la(b0,gD),z0(z_),F0(xD,IA),V0("default",NA),sa({type:Kn,event:Kn,update:Kn},pt),sa({type:Ys,event:Ys,update:Ys},pt),sa({type:Ui,event:Ui,update:Ui},pt),sa({type:qs,event:qs,update:qs},pt),sa({type:$i,event:$i,update:$i},pt),B0("light",YA),B0("dark",K_);var G0=[],WD={registerPreprocessor:z0,registerProcessor:F0,registerPostInit:BD,registerPostUpdate:zD,registerUpdateLifecycle:ed,registerAction:sa,registerCoordinateSystem:FD,registerLayout:HD,registerVisual:la,registerTransform:GD,registerLoading:V0,registerMap:VD,registerImpl:mD,PRIORITY:ID,ComponentModel:Oe,ComponentView:lr,SeriesModel:Dr,ChartView:ir,registerComponentModel:function(t){Oe.registerClass(t)},registerComponentView:function(t){lr.registerClass(t)},registerSeriesModel:function(t){Dr.registerClass(t)},registerChartView:function(t){ir.registerClass(t)},registerSubTypeDefaulter:function(t,e){Oe.registerSubTypeDefaulter(t,e)},registerPainter:function(t,e){cA(t,e)}};function bn(t){if(ee(t)){A(t,function(e){bn(e)});return}Ie(G0,t)>=0||(G0.push(t),ge(t)&&(t={install:t}),t.install(WD))}var UD=(function(t){G(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})(Oe),$D=(function(){function t(){}return t.prototype.getNeedCrossZero=function(){var e=this.option;return!e.scale},t.prototype.getCoordSysModel=function(){},t})(),rd=(function(t){G(e,t);function e(){return t!==null&&t.apply(this,arguments)||this}return e.prototype.getCoordSysModel=function(){return this.getReferringComponents("grid",kt).models[0]},e.type="cartesian2dAxis",e})(Oe);yr(rd,$D);var W0={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)"]}}},YD=ke({boundaryGap:!0,deduplication:null,splitLine:{show:!1},axisTick:{alignWithLabel:!1,interval:"auto"},axisLabel:{interval:"auto"}},W0),nd=ke({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}}},W0),qD=ke({splitNumber:6,axisLabel:{showMinLabel:!1,showMaxLabel:!1,rich:{primary:{fontWeight:"bold"}}},splitLine:{show:!1}},nd),XD=De({logBase:10},nd);const ZD={category:YD,value:nd,time:qD,log:XD};var KD=0,ad=(function(){function t(e){this.categories=e.categories||[],this._needCollect=e.needCollect,this._deduplication=e.deduplication,this.uid=++KD}return t.createByAxisModel=function(e){var r=e.option,n=r.data,a=n&&ue(n,jD);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(!ie(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=fe(this.categories))},t})();function jD(t){return ce(t)&&t.value!=null?t.value:t+""}var QD={value:1,category:1,time:1,log:1};function U0(t,e,r,n){A(QD,function(a,i){var o=ke(ke({},ZD[i],!0),n,!0),s=(function(l){G(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 d=oo(this),h=d?Rl(u):{},v=f.getTheme();ke(u,v.get(i+"Axis")),ke(u,this.getDefaultOption()),u.type=$0(u),d&&Qa(u,h,d)},c.prototype.optionUpdated=function(){var u=this.option;u.type==="category"&&(this.__ordinalMeta=ad.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",$0)}function $0(t){return t.type||(t.data?"category":"value")}var Ir=(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})();ds(Ir);function id(t){return t.type==="interval"||t.type==="log"}function JD(t,e,r,n){var a={},i=t[1]-t[0],o=a.interval=ag(i/e);r!=null&&o<r&&(o=a.interval=r),n!=null&&o>n&&(o=a.interval=n);var s=a.intervalPrecision=Y0(o),l=a.niceTickExtent=[Je(Math.ceil(t[0]/o)*o,s),Je(Math.floor(t[1]/o)*o,s)];return eI(l,t),a}function od(t){var e=Math.pow(10,Xu(t)),r=t/e;return r?r===2?r=3:r===3?r=5:r*=2:r=1,Je(r*e)}function Y0(t){return Vr(t)+2}function q0(t,e,r){t[e]=Math.max(Math.min(t[e],r[1]),r[0])}function eI(t,e){!isFinite(t[0])&&(t[0]=e[0]),!isFinite(t[1])&&(t[1]=e[1]),q0(t,0,e),q0(t,1,e),t[0]>t[1]&&(t[0]=t[1])}function ac(t,e){return t>=e[0]&&t<=e[1]}function ic(t,e){return e[1]===e[0]?.5:(t-e[0])/(e[1]-e[0])}function oc(t,e){return t*(e[1]-e[0])+e[0]}var sd=(function(t){G(e,t);function e(r){var n=t.call(this,r)||this;n.type="ordinal";var a=n.getSetting("ordinalMeta");return a||(a=new ad({})),ee(a)&&(a=new ad({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:ie(r)?this._ordinalMeta.getOrdinal(r):Math.round(r)},e.prototype.contain=function(r){return r=this.parse(r),ac(r,this._extent)&&this._ordinalMeta.categories[r]!=null},e.prototype.normalize=function(r){return r=this._getTickNumber(this.parse(r)),ic(r,this._extent)},e.prototype.scale=function(r){return r=Math.round(oc(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})(Ir);Ir.registerClass(sd);var ca=Je,ii=(function(t){G(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 ac(r,this._extent)},e.prototype.normalize=function(r){return ic(r,this._extent)},e.prototype.scale=function(r){return oc(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=Y0(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:ca(i[0]-n,o)}):s.push({value:a[0]}));for(var c=i[0];c<=i[1]&&(s.push({value:c}),c=ca(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:ca(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,d=f/r;c<r-1;){var h=ca(l.value+(c+1)*d);h>i[0]&&h<i[1]&&u.push(h),c++}a.push(u)}return a},e.prototype.getLabel=function(r,n){if(r==null)return"";var a=n&&n.precision;a==null?a=Vr(r.value)||0:a==="auto"&&(a=this._intervalPrecision);var i=ca(r.value,a,!0);return ry(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=JD(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]=ca(Math.floor(n[0]/o)*o)),r.fixMax||(n[1]=ca(Math.ceil(n[1]/o)*o))},e.prototype.setNiceExtent=function(r,n){this._niceExtent=[r,n]},e.type="interval",e})(Ir);Ir.registerClass(ii);var tI=function(t,e,r,n){for(;r<n;){var a=r+n>>>1;t[a][1]<e?r=a+1:n=a}return r},X0=(function(t){G(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 kl(r.value,Ym[B2(Ka(this._minLevelUnit))]||Ym.second,n,this.getSetting("locale"))},e.prototype.getFormattedLabel=function(r,n,a){var i=this.getSetting("useUTC"),o=this.getSetting("locale");return z2(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=lI(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=sc.length,l=Math.min(tI(sc,this._approxInterval,0,s),s-1);this._interval=sc[l][1],this._minLevelUnit=sc[Math.max(l-1,0)][0]},e.prototype.parse=function(r){return He(r)?r:+Gr(r)},e.prototype.contain=function(r){return ac(this.parse(r),this._extent)},e.prototype.normalize=function(r){return ic(this.parse(r),this._extent)},e.prototype.scale=function(r){return oc(r,this._extent)},e.type="time",e})(ii),sc=[["second",$f],["minute",Yf],["hour",ro],["quarter-day",ro*6],["half-day",ro*12],["day",Zt*1.2],["half-week",Zt*3.5],["week",Zt*7],["month",Zt*31],["quarter",Zt*95],["half-year",$m/2],["year",$m]];function rI(t,e,r,n){var a=Gr(e),i=Gr(r),o=function(v){return Zm(a,v,n)===Zm(i,v,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")},d=function(){return f()&&o("second")},h=function(){return d()&&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 d();case"millisecond":return h()}}function nI(t,e){return t/=Zt,t>16?16:t>7.5?7:t>3.5?4:t>1.5?2:1}function aI(t){var e=30*Zt;return t/=e,t>6?6:t>3?3:t>2?2:1}function iI(t){return t/=ro,t>12?12:t>6?6:t>3.5?4:t>2?2:1}function Z0(t,e){return t/=e?Yf:$f,t>30?30:t>20?20:t>15?15:t>10?10:t>5?5:t>2?2:1}function oI(t){return ag(t)}function sI(t,e,r){var n=new Date(t);switch(Ka(e)){case"year":case"month":n[Km(r)](0);case"day":n[jm(r)](1);case"hour":n[Qm(r)](0);case"minute":n[Jm(r)](0);case"second":n[ey(r)](0),n[ty(r)](0)}return n.getTime()}function lI(t,e,r,n){var a=1e4,i=qm,o=0;function s(D,C,I,P,L,R,N){for(var Z=new Date(C),F=C,z=Z[P]();F<I&&F<=n[1];)N.push({value:F}),z+=D,Z[L](z),F=Z.getTime();N.push({value:F,notAdd:!0})}function l(D,C,I){var P=[],L=!C.length;if(!rI(Ka(D),n[0],n[1],r)){L&&(C=[{value:sI(new Date(n[0]),D,r)},{value:n[1]}]);for(var R=0;R<C.length-1;R++){var N=C[R].value,Z=C[R+1].value;if(N!==Z){var F=void 0,z=void 0,W=void 0,ne=!1;switch(D){case"year":F=Math.max(1,Math.round(e/Zt/365)),z=Xf(r),W=F2(r);break;case"half-year":case"quarter":case"month":F=aI(e),z=ja(r),W=Km(r);break;case"week":case"half-week":case"day":F=nI(e),z=Tl(r),W=jm(r),ne=!0;break;case"half-day":case"quarter-day":case"hour":F=iI(e),z=ao(r),W=Qm(r);break;case"minute":F=Z0(e,!0),z=Cl(r),W=Jm(r);break;case"second":F=Z0(e,!1),z=Ml(r),W=ey(r);break;case"millisecond":F=oI(e),z=Al(r),W=ty(r);break}s(F,N,Z,z,W,ne,P),D==="year"&&I.length>1&&R===0&&I.unshift({value:I[0].value-F})}}for(var R=0;R<P.length;R++)I.push(P[R]);return P}}for(var c=[],u=[],f=0,d=0,h=0;h<i.length&&o++<a;++h){var v=Ka(i[h]);if(N2(i[h])){l(i[h],c[c.length-1]||[],u);var m=i[h+1]?Ka(i[h+1]):null;if(v!==m){if(u.length){d=f,u.sort(function(D,C){return D.value-C.value});for(var g=[],p=0;p<u.length;++p){var y=u[p].value;(p===0||u[p-1].value!==y)&&(g.push(u[p]),y>=n[0]&&y<=n[1]&&f++)}var b=(n[1]-n[0])/e;if(f>b*1.5&&d>b/1.5||(c.push(g),f>b||t===i[h]))break}u=[]}}}for(var x=it(ue(c,function(D){return it(D,function(C){return C.value>=n[0]&&C.value<=n[1]&&!C.notAdd})}),function(D){return D.length>0}),S=[],w=x.length-1,h=0;h<x.length;++h)for(var k=x[h],T=0;T<k.length;++T)S.push({value:k[T].value,level:w-h});S.sort(function(D,C){return D.value-C.value});for(var M=[],h=0;h<S.length;++h)(h===0||S[h].value!==S[h-1].value)&&M.push(S[h]);return M}Ir.registerClass(X0);var K0=Ir.prototype,ko=ii.prototype,cI=Je,uI=Math.floor,fI=Math.ceil,lc=Math.pow,ur=Math.log,ld=(function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="log",r.base=10,r._originalScale=new ii,r._interval=0,r}return e.prototype.getTicks=function(r){var n=this._originalScale,a=this._extent,i=n.getExtent(),o=ko.getTicks.call(this,r);return ue(o,function(s){var l=s.value,c=Je(lc(this.base,l));return c=l===a[0]&&this._fixMin?cc(c,i[0]):c,c=l===a[1]&&this._fixMax?cc(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,ko.setExtent.call(this,r,n)},e.prototype.getExtent=function(){var r=this.base,n=K0.getExtent.call(this);n[0]=lc(r,n[0]),n[1]=lc(r,n[1]);var a=this._originalScale,i=a.getExtent();return this._fixMin&&(n[0]=cc(n[0],i[0])),this._fixMax&&(n[1]=cc(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),K0.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=ZS(a),o=r/a*i;for(o<=.5&&(i*=10);!isNaN(i)&&Math.abs(i)<1&&Math.abs(i)>0;)i*=10;var s=[Je(fI(n[0]/i)*i),Je(uI(n[1]/i)*i)];this._interval=i,this._niceExtent=s}},e.prototype.calcNiceExtent=function(r){ko.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),ac(r,this._extent)},e.prototype.normalize=function(r){return r=ur(r)/ur(this.base),ic(r,this._extent)},e.prototype.scale=function(r){return r=oc(r,this._extent),lc(this.base,r)},e.type="log",e})(Ir),j0=ld.prototype;j0.getMinorTicks=ko.getMinorTicks,j0.getLabel=ko.getLabel;function cc(t,e){return cI(t,Vr(e))}Ir.registerClass(ld);var hI=(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;ge(o)?this._modelMinNum=uc(e,o({min:n[0],max:n[1]})):o!=="dataMin"&&(this._modelMinNum=uc(e,o));var s=this._modelMaxRaw=r.get("max",!0);if(ge(s)?this._modelMaxNum=uc(e,s({min:n[0],max:n[1]})):s!=="dataMax"&&(this._modelMaxNum=uc(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=[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=us(s)||us(l)||e&&!a;this._needCrossZero&&(s>0&&l>0&&!c&&(s=0),s<0&&l<0&&!u&&(l=0));var d=this._determinedMin,h=this._determinedMax;return d!=null&&(s=d,c=!0),h!=null&&(l=h,u=!0),{min:s,max:l,minFixed:c,maxFixed:u,isBlank:f}},t.prototype.modifyDataMinMax=function(e,r){this[vI[e]]=r},t.prototype.setDeterminedMinMax=function(e,r){var n=dI[e];this[n]=r},t.prototype.freeze=function(){this.frozen=!0},t})(),dI={min:"_determinedMin",max:"_determinedMax"},vI={min:"_dataMin",max:"_dataMax"};function Q0(t,e,r){var n=t.rawExtentInfo;return n||(n=new hI(t,e,r),t.rawExtentInfo=n,n)}function uc(t,e){return e==null?null:us(e)?NaN:t.parse(e)}function J0(t,e){var r=t.type,n=Q0(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=Wy("bar",o),l=!1;if(A(s,function(f){l=l||f.getBaseAxis()===e.axis}),l){var c=Uy(s),u=pI(a,i,e,c);a=u.min,i=u.max}}return{extent:[a,i],fixMin:n.minFixed,fixMax:n.maxFixed}}function pI(t,e,r,n){var a=r.axis.getExtent(),i=Math.abs(a[1]-a[0]),o=hM(n,r.axis);if(o===void 0)return{min:t,max:e};var s=1/0;A(o,function(h){s=Math.min(h.offset,s)});var l=-1/0;A(o,function(h){l=Math.max(h.offset+h.width,l)}),s=Math.abs(s),l=Math.abs(l);var c=s+l,u=e-t,f=1-(s+l)/i,d=u/f-u;return e+=d*(l/c),t-=d*(s/c),{min:t,max:e}}function eb(t,e){var r=e,n=J0(t,r),a=n.extent,i=r.get("splitNumber");t instanceof ld&&(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 gI(t,e){if(e=e||t.get("type"),e)switch(e){case"category":return new sd({ordinalMeta:t.getOrdinalMeta?t.getOrdinalMeta():t.getCategories(),extent:[1/0,-1/0]});case"time":return new X0({locale:t.ecModel.getLocaleModel(),useUTC:t.ecModel.get("useUTC")});default:return new(Ir.getClass(e)||ii)}}function mI(t){var e=t.scale.getExtent(),r=e[0],n=e[1];return!(r>0&&n>0||r<0&&n<0)}function oi(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):ie(e)?(function(n){return function(a){var i=t.scale.getLabel(a),o=n.replace("{value}",i??"");return o}})(e):ge(e)?(function(n){return function(a,i){return r!=null&&(i=a.value-r),n(cd(t,a),i,a.level!=null?{level:a.level}:null)}})(e):function(n){return t.scale.getLabel(n)}}function cd(t,e){return t.type==="category"?t.scale.getLabel(e):e.value}function yI(t){var e=t.model,r=t.scale;if(!(!e.get(["axisLabel","show"])||r.isBlank())){var n,a,i=r.getExtent();r instanceof sd?a=r.count():(n=r.getTicks(),a=n.length);var o=t.getLabelModel(),s=oi(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},d=s(f,u),h=o.getTextRect(d),v=_I(h,o.get("rotate")||0);l?l.union(v):l=v}return l}}function _I(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 Pe(t.x,t.y,i,o);return s}function ud(t){var e=t.get("interval");return e??"auto"}function tb(t){return t.type==="category"&&ud(t.getLabelModel())===0}function rb(t,e){var r={};return A(t.mapDimensionsAll(e),function(n){r[m2(t,n)]=!0}),Ge(r)}function bI(t,e,r){e&&A(rb(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 xI=(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(),it(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})(),fd=["x","y"];function nb(t){return t.type==="interval"||t.type==="time"}var wI=(function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type="cartesian2d",r.dimensions=fd,r}return e.prototype.calcAffineTransform=function(){this._transform=this._invTransform=null;var r=this.getAxis("x").scale,n=this.getAxis("y").scale;if(!(!nb(r)||!nb(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,d=o[0]-a[0]*u,h=o[1]-i[0]*f,v=this._transform=[u,0,0,f,d,h];this._invTransform=uu([],v)}}},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 Pe(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 Pe(i,o,s,l)},e})(xI),To=Xe();function ab(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 SI(t){var e=t.getLabelModel().get("customValues");if(e){var r=oi(t),n=t.scale.getExtent(),a=ab(t,e),i=it(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"?TI(t):MI(t)}function kI(t,e){var r=t.getTickModel().get("customValues");if(r){var n=t.scale.getExtent(),a=ab(t,r);return{ticks:it(a,function(i){return i>=n[0]&&i<=n[1]})}}return t.type==="category"?CI(t,e):{ticks:ue(t.scale.getTicks(),function(i){return i.value})}}function TI(t){var e=t.getLabelModel(),r=ib(t,e);return!e.get("show")||t.scale.isBlank()?{labels:[],labelCategoryInterval:r.labelCategoryInterval}:r}function ib(t,e){var r=ob(t,"labels"),n=ud(e),a=sb(r,n);if(a)return a;var i,o;return ge(n)?i=ub(t,n):(o=n==="auto"?AI(t):n,i=cb(t,o)),lb(r,n,{labels:i,labelCategoryInterval:o})}function CI(t,e){var r=ob(t,"ticks"),n=ud(e),a=sb(r,n);if(a)return a;var i,o;if((!e.get("show")||t.scale.isBlank())&&(i=[]),ge(n))i=ub(t,n,!0);else if(n==="auto"){var s=ib(t,t.getLabelModel());o=s.labelCategoryInterval,i=ue(s.labels,function(l){return l.tickValue})}else o=n,i=cb(t,o,!0);return lb(r,n,{ticks:i,tickCategoryInterval:o})}function MI(t){var e=t.scale.getTicks(),r=oi(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 ob(t,e){return To(t)[e]||(To(t)[e]=[])}function sb(t,e){for(var r=0;r<t.length;r++)if(t[r].key===e)return t[r].value}function lb(t,e,r){return t.push({key:e,value:r}),r}function AI(t){var e=To(t).autoInterval;return e??(To(t).autoInterval=t.calculateCategoryInterval())}function DI(t){var e=II(t),r=oi(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)),d=0,h=0;l<=i[1];l+=s){var v=0,m=0,g=fu(r({value:l}),e.font,"center","top");v=g.width*1.3,m=g.height*1.3,d=Math.max(d,v,7),h=Math.max(h,m,7)}var p=d/u,y=h/f;isNaN(p)&&(p=1/0),isNaN(y)&&(y=1/0);var b=Math.max(0,Math.floor(Math.min(p,y))),x=To(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 II(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 cb(t,e,r){var n=oi(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=tb(t),d=o.get("showMinLabel")||f,h=o.get("showMaxLabel")||f;d&&c!==i[0]&&m(i[0]);for(var v=c;v<=i[1];v+=l)m(v);h&&v-l!==i[1]&&m(i[1]);function m(g){var p={value:g};s.push(r?g:{formattedLabel:n(p),rawLabel:a.getLabel(p),tickValue:g})}return s}function ub(t,e,r){var n=t.scale,a=oi(t),i=[];return A(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 fb=[0,1],PI=(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 rg(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(),hb(n,a.count())),Xn(e,fb,n,r)},t.prototype.coordToData=function(e,r){var n=this._extent,a=this.scale;this.onBand&&a.type==="ordinal"&&(n=n.slice(),hb(n,a.count()));var i=Xn(e,n,fb,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=kI(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 LI(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 SI(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 DI(this)},t})();function hb(t,e){var r=t[1]-t[0],n=e,a=r/n/2;t[0]+=a,t[1]-=a}function LI(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;A(e,function(h){h.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];d(e[0].coord,i[0])&&(n?e[0].coord=i[0]:e.shift()),n&&d(i[0],e[0].coord)&&e.unshift({coord:i[0]}),d(i[1],o.coord)&&(n?o.coord=i[1]:e.pop()),n&&d(o.coord,i[1])&&e.push({coord:i[1]});function d(h,v){return h=Je(h),v=Je(v),f?h>v:h<v}}var RI=(function(t){G(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})(PI);function hd(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],d={left:0,right:1,top:0,bottom:1,onZero:2},h=e.get("offset")||0,v=c==="x"?[f[2]-h,f[3]+h]:[f[0]-h,f[1]+h];if(o){var m=o.toGlobalCoord(o.dataToCoord(0));v[d.onZero]=Math.max(Math.min(m,v[1]),v[0])}i.position=[c==="y"?v[d[l]]:f[0],c==="x"?v[d[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?v[d[s]]-v[d.onZero]:0,e.get(["axisTick","inside"])&&(i.tickDirection=-i.tickDirection),ki(r.labelInside,e.get(["axisLabel","inside"]))&&(i.labelDirection=-i.labelDirection);var p=e.get(["axisLabel","rotate"]);return i.labelRotate=l==="top"?-p:p,i.z2=1,i}function db(t){return t.get("coordinateSystem")==="cartesian2d"}function vb(t){var e={xAxisModel:null,yAxisModel:null};return A(e,function(r,n){var a=n.replace(/Model$/,""),i=t.getReferringComponents(a,kt).models[0];e[n]=i}),e}var dd=Math.log;function EI(t,e,r){var n=ii.prototype,a=n.getTicks.call(r),i=n.getTicks.call(r,!0),o=a.length-1,s=n.getInterval.call(r),l=J0(t,e),c=l.extent,u=l.fixMin,f=l.fixMax;if(t.type==="log"){var d=dd(t.base);c=[dd(c[0])/d,dd(c[1])/d]}t.setExtent(c[0],c[1]),t.calcNiceExtent({splitNumber:o,fixMin:u,fixMax:f});var h=n.getExtent.call(t);u&&(c[0]=h[0]),f&&(c[1]=h[1]);var v=n.getInterval.call(t),m=c[0],g=c[1];if(u&&f)v=(g-m)/o;else if(u)for(g=c[0]+v*o;g<c[1]&&isFinite(g)&&isFinite(c[1]);)v=od(v),g=c[0]+v*o;else if(f)for(m=c[1]-v*o;m>c[0]&&isFinite(m)&&isFinite(c[0]);)v=od(v),m=c[1]-v*o;else{var p=t.getTicks().length-1;p>o&&(v=od(v));var y=v*o;g=Math.ceil(c[1]/v)*v,m=Je(g-y),m<0&&c[0]>=0?(m=0,g=Je(y)):g>0&&c[1]<=0&&(g=0,m=-Je(y))}var b=(a[0].value-i[0].value)/s,x=(a[o].value-i[o].value)/s;n.setExtent.call(t,m+v*b,g+v*x),n.setInterval.call(t,v),(b||x)&&n.setNiceExtent.call(t,m+v,g-v)}var OI=(function(){function t(e,r,n){this.type="grid",this._coordsMap={},this._coordsList=[],this._axesMap={},this._axesList=[],this.axisPointerEnabled=!0,this.dimensions=fd,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 d=+l[f],h=o[d],v=h.model,m=h.scale;id(m)&&v.get("alignTicks")&&v.get("interval")==null?u.push(h):(eb(m,v),id(m)&&(s=h))}u.length&&(s||(s=u.pop(),eb(s.scale,s.model)),A(u,function(g){EI(g.scale,g.model,s.scale)}))}}a(n.x),a(n.y);var i={};A(n.x,function(o){pb(n,"y",o,i)}),A(n.y,function(o){pb(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=Ll(a,{width:r.getWidth(),height:r.getHeight()});this._rect=o;var s=this._axesList;l(),i&&(A(s,function(c){if(!c.model.get(["axisLabel","inside"])){var u=yI(c);if(u){var f=c.isHorizontal()?"height":"width",d=c.model.get(["axisLabel","margin"]);o[f]-=u[f]+d,c.position==="top"?o.y+=u.height+d:c.position==="left"&&(o.x+=u.width+d)}}}),l()),A(this._coordsList,function(c){c.calcAffineTransform()});function l(){A(s,function(c){var u=c.isHorizontal(),f=u?[0,o.width]:[0,o.height],d=c.inverse?1:0;c.setExtent(f[d],f[1-d]),NI(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",kt).models[0],a=e.yAxisModel||r&&r.getReferringComponents("yAxis",kt).models[0],i=e.gridModel,o=this._coordsList,s,l;if(r)s=r.coordinateSystem,Ie(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,A(s.x,function(u,f){A(s.y,function(d,h){var v="x"+f+"y"+h,m=new wI(v);m.master=a,m.model=e,a._coordsMap[v]=m,a._coordsList.push(m),m.addAxis(u),m.addAxis(d)})});function c(u){return function(f,d){if(vd(f,e)){var h=f.get("position");u==="x"?h!=="top"&&h!=="bottom"&&(h=o.bottom?"top":"bottom"):h!=="left"&&h!=="right"&&(h=o.left?"right":"left"),o[h]=!0;var v=new RI(u,gI(f),[0,0],f.get("type"),h),m=v.type==="category";v.onBand=m&&f.get("boundaryGap"),v.inverse=f.get("inverse"),f.axis=v,v.model=f,v.grid=i,v.index=d,i._axesList.push(v),s[u][d]=v,l[u]++}}}},t.prototype._updateScale=function(e,r){A(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(db(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){A(rb(a,i.dim),function(o){i.scale.unionExtentFromData(a,o)})}},t.prototype.getTooltipAxes=function(e){var r=[],n=[];return A(this.getCartesians(),function(a){var i=e!=null&&e!=="auto"?a.getAxis(e):a.getBaseAxis(),o=a.getOtherAxis(i);Ie(r,i)<0&&r.push(i),Ie(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(db(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=fd,t})();function vd(t,e){return t.getCoordSysModel()===e}function pb(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)gb(a[l])&&(i=a[l]);else for(var c in a)if(a.hasOwnProperty(c)&&gb(a[c])&&!n[u(a[c])]){i=a[c];break}i&&(n[u(i)]=!0);function u(f){return f.dim+"_"+f.index}}function gb(t){return t&&t.type!=="category"&&t.type!=="time"&&mI(t)}function NI(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 lt,this.opt=r,this.axisModel=e,De(r,{labelOffset:0,nameDirection:1,tickDirection:1,labelDirection:1,silent:!0,handleAutoShown:function(){return!0}});var n=new lt({x:r.position[0],y:r.position[1],rotation:r.rotation});n.updateTransform(),this._transformGroup=n}return t.prototype.hasBuilder=function(e){return!!mb[e]},t.prototype.add=function(e){mb[e](this.opt,this.axisModel,this.group,this._transformGroup)},t.prototype.getGroup=function(){return this.group},t.innerTextLayout=function(e,r,n){var a=ng(r-e),i,o;return Gs(a)?(o=n>0?"top":"bottom",i="center"):Gs(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})(),mb={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=V({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});Ki(f.shape,f.style.lineWidth),f.anid="line",r.add(f);var d=e.get(["axisLine","symbol"]);if(d!=null){var h=e.get(["axisLine","symbolSize"]);ie(d)&&(d=[d,d]),(ie(h)||He(h))&&(h=[h,h]);var v=wy(e.get(["axisLine","symbolOffset"])||0,h),m=h[0],g=h[1];A([{rotate:t.rotation+Math.PI/2,offset:v[0],r:0},{rotate:t.rotation-Math.PI/2,offset:v[1],r:Math.sqrt((s[0]-l[0])*(s[0]-l[0])+(s[1]-l[1])*(s[1]-l[1]))}],function(p,y){if(d[y]!=="none"&&d[y]!=null){var b=Ja(d[y],-m/2,-g/2,m,g,u.stroke,!0),x=p.r+p.offset,S=c?l:s;b.attr({rotation:p.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=FI(r,n,e,t),i=VI(r,n,e,t);if(zI(e,i,a),HI(r,n,e,t.tickDirection),e.get(["axisLabel","hideOverlap"])){var o=RM(ue(i,function(s){return{label:s,priority:s.z2,defaultAttr:{ignore:s.ignore}}}));EM(o)}},axisName:function(t,e,r,n){var a=ki(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,_b(i)?t.labelOffset+o*l:0],d,h=e.get("nameRotate");h!=null&&(h=h*xn/180);var v;_b(i)?d=wn.innerTextLayout(t.rotation,h??t.rotation,o):(d=BI(t.rotation,i,h||0,c),v=t.axisNameAvailableWidth,v!=null&&(v=Math.abs(v/Math.sin(d.rotation)),!isFinite(v)&&(v=null)));var m=s.getFont(),g=e.get("nameTruncate",!0)||{},p=g.ellipsis,y=ki(t.nameTruncateMaxWidth,g.maxWidth,v),b=new wt({x:f[0],y:f[1],rotation:d.rotation,silent:wn.isLabelSilent(e),style:Ga(s,{text:a,font:m,overflow:"truncate",width:y,ellipsis:p,fill:s.getTextColor()||e.get(["axisLine","lineStyle","color"]),align:s.get("align")||d.textAlign,verticalAlign:s.get("verticalAlign")||d.textVerticalAlign}),z2:1});if(cl({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,Re(b).eventData=x}n.add(b),b.updateTransform(),r.add(b),b.decomposeTransform()}}};function BI(t,e,r,n){var a=ng(r-t),i,o,s=n[0]>n[1],l=e==="start"&&!s||e!=="start"&&s;return Gs(a-xn/2)?(o=l?"bottom":"top",i="center"):Gs(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 zI(t,e,r){if(!tb(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],d=r[r.length-2];n===!1?(Jt(i),Jt(c)):yb(i,o)&&(n?(Jt(o),Jt(u)):(Jt(i),Jt(c))),a===!1?(Jt(s),Jt(f)):yb(l,s)&&(a?(Jt(l),Jt(d)):(Jt(s),Jt(f)))}}function Jt(t){t&&(t.ignore=!0)}function yb(t,e){var r=t&&t.getBoundingRect().clone(),n=e&&e.getBoundingRect().clone();if(!(!r||!n)){var a=su([]);return cu(a,a,-t.rotation),r.applyTransform(Ta([],a,t.getLocalTransform())),n.applyTransform(Ta([],a,e.getLocalTransform())),r.intersect(n)}}function _b(t){return t==="middle"||t==="center"}function bb(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});Ki(u.shape,u.style.lineWidth),u.anid=a+"_"+t[l].tickValue,i.push(u)}return i}function FI(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=bb(c,e.transform,l,De(s.getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])}),"ticks"),f=0;f<u.length;f++)t.add(u[f]);return u}}function HI(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=De(s.getLineStyle(),De(r.getModel("axisTick").getLineStyle(),{stroke:r.get(["axisLine","lineStyle","color"])})),u=0;u<o.length;u++)for(var f=bb(o[u],e.transform,l,c,"minorticks_"+u),d=0;d<f.length;d++)t.add(f[d])}}function VI(t,e,r,n){var a=r.axis,i=ki(n.axisLabelShow,r.get(["axisLabel","show"]));if(!(!i||a.scale.isBlank())){var o=r.getModel("axisLabel"),s=o.get("margin"),l=a.getViewLabels(),c=(ki(n.labelRotate,o.get("rotate"))||0)*xn/180,u=wn.innerTextLayout(n.rotation,c,n.labelDirection),f=r.getCategories&&r.getCategories(!0),d=[],h=wn.isLabelSilent(r),v=r.get("triggerEvent");return A(l,function(m,g){var p=a.scale.type==="ordinal"?a.scale.getRawOrdinalNumber(m.tickValue):m.tickValue,y=m.formattedLabel,b=m.rawLabel,x=o;if(f&&f[p]){var S=f[p];ce(S)&&S.textStyle&&(x=new $e(S.textStyle,o,r.ecModel))}var w=x.getTextColor()||r.get(["axisLine","lineStyle","color"]),k=a.dataToCoord(p),T=x.getShallow("align",!0)||u.textAlign,M=_e(x.getShallow("alignMinLabel",!0),T),D=_e(x.getShallow("alignMaxLabel",!0),T),C=x.getShallow("verticalAlign",!0)||x.getShallow("baseline",!0)||u.textVerticalAlign,I=_e(x.getShallow("verticalAlignMinLabel",!0),C),P=_e(x.getShallow("verticalAlignMaxLabel",!0),C),L=new wt({x:k,y:n.labelOffset+n.labelDirection*s,rotation:u.rotation,silent:h,z2:10+(m.level||0),style:Ga(x,{text:y,align:g===0?M:g===l.length-1?D:T,verticalAlign:g===0?I:g===l.length-1?P:C,fill:ge(w)?w(a.type==="category"?b:a.type==="value"?p+"":p,g):w})});if(L.anid="label_"+p,cl({el:L,componentModel:r,itemName:y,formatterParamsExtra:{isTruncated:function(){return L.isTruncated},value:b,tickIndex:g}}),v){var R=wn.makeAxisEventDataBase(r);R.targetType="axisLabel",R.value=b,R.tickIndex=g,a.type==="category"&&(R.dataIndex=p),Re(L).eventData=R}e.add(L),L.updateTransform(),d.push(L),t.add(L),L.decomposeTransform()}),d}}function GI(t,e){var r={axesInfo:{},seriesInvolved:!1,coordSysAxesInfo:{},coordSysMap:{}};return WI(r,t,e),r.seriesInvolved&&$I(r,t),r}function WI(t,e,r){var n=e.getComponent("tooltip"),a=e.getComponent("axisPointer"),i=a.get("link",!0)||[],o=[];A(r.getCoordinateSystems(),function(s){if(!s.axisPointerEnabled)return;var l=Co(s.model),c=t.coordSysAxesInfo[l]={};t.coordSysMap[l]=s;var u=s.model,f=u.getModel("tooltip",n);if(A(s.getAxes(),qe(m,!1,null)),s.getTooltipAxes&&n&&f.get("show")){var d=f.get("trigger")==="axis",h=f.get(["axisPointer","type"])==="cross",v=s.getTooltipAxes(f.get(["axisPointer","axis"]));(d||h)&&A(v.baseAxes,qe(m,h?"cross":!0,d)),h&&A(v.otherAxes,qe(m,"cross",!1))}function m(g,p,y){var b=y.model.getModel("axisPointer",a),x=b.get("show");if(!(!x||x==="auto"&&!g&&!md(b))){p==null&&(p=b.get("triggerTooltip")),b=g?UI(y,f,a,e,g,p):b;var S=b.get("snap"),w=b.get("triggerEmphasis"),k=Co(y.model),T=p||S||y.type==="category",M=t.axesInfo[k]={key:k,axis:y,coordSys:s,axisPointerModel:b,triggerTooltip:p,triggerEmphasis:w,involveSeries:T,snap:S,useHandle:md(b),seriesModels:[],linkGroup:null};c[k]=M,t.seriesInvolved=t.seriesInvolved||T;var D=YI(i,y);if(D!=null){var C=o[D]||(o[D]={axesInfo:{}});C.axesInfo[k]=M,C.mapper=i[D].mapper,M.linkGroup=C}}}})}function UI(t,e,r,n,a,i){var o=e.getModel("axisPointer"),s=["type","snap","lineStyle","shadowStyle","label","animation","animationDurationUpdate","animationEasingUpdate","z"],l={};A(s,function(d){l[d]=ye(o.get(d))}),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&&De(c,f.textStyle)}}return t.model.getModel("axisPointer",new $e(l,r,n))}function $I(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||A(t.coordSysAxesInfo[Co(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 YI(t,e){for(var r=e.model,n=e.dim,a=0;a<t.length;a++){var i=t[a]||{};if(pd(i[n+"AxisId"],r.id)||pd(i[n+"AxisIndex"],r.componentIndex)||pd(i[n+"AxisName"],r.name))return a}}function pd(t,e){return t==="all"||ee(t)&&Ie(t,e)>=0||t===e}function qI(t){var e=gd(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=md(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 gd(t){var e=(t.ecModel.getComponent("axisPointer")||{}).coordSysAxesInfo;return e&&e.axesInfo[Co(t)]}function XI(t){var e=gd(t);return e&&e.axisPointerModel}function md(t){return!!t.get(["handle","show"])}function Co(t){return t.type+"||"+t.id}var xb={},wb=(function(t){G(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=XI(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){xb[r]=n},e.getAxisPointerClass=function(r){return r&&xb[r]},e.type="axis",e})(lr),yd=Xe();function ZI(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=yd(t).splitAreaColors,d=fe(),h=0;if(f)for(var v=0;v<c.length;v++){var m=f.get(c[v].tickValue);if(m!=null){h=(m+(u-1)*v)%u;break}}var g=a.toGlobalCoord(c[0].coord),p=o.getAreaStyle();s=ee(s)?s:[s];for(var v=1;v<c.length;v++){var y=a.toGlobalCoord(c[v].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[v-1].tickValue;k!=null&&d.set(k,h),e.add(new nt({anid:k!=null?"area_"+k:null,shape:{x:b,y:x,width:S,height:w},style:De({fill:s[h]},p),autoBatch:!0,silent:!0})),h=(h+1)%u}yd(t).splitAreaColors=d}}}function KI(t){yd(t).splitAreaColors=null}var jI=["axisLine","axisTickLabel","axisName"],QI=["splitArea","splitLine","minorSplitLine"],Sb=(function(t){G(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 lt,this.group.add(this._axisGroup),!!r.get("show")){var s=r.getCoordSysModel(),l=hd(s,r),c=new wn(r,V({handleAutoShown:function(f){for(var d=s.coordinateSystem.getCartesians(),h=0;h<d.length;h++)if(id(d[h].getOtherAxis(r.axis).scale))return!0;return!1}},l));A(jI,c.add,c),this._axisGroup.add(c.getGroup()),A(QI,function(f){r.get([f,"show"])&&JI[f](this,this._axisGroup,r,s)},this);var u=i&&i.type==="changeAxisOrder"&&i.isInitSort;u||Jg(o,this._axisGroup,r),t.prototype.render.call(this,r,n,a,i)}},e.prototype.remove=function(){KI(this)},e.type="cartesianAxis",e})(wb),JI={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(),d=0,h=a.getTicksCoords({tickModel:i}),v=[],m=[],g=o.getLineStyle(),p=0;p<h.length;p++){var y=a.toGlobalCoord(h[p].coord);if(!(p===0&&!l||p===h.length-1&&!c)){var b=h[p].tickValue;f?(v[0]=y,v[1]=u.y,m[0]=y,m[1]=u.y+u.height):(v[0]=u.x,v[1]=y,m[0]=u.x+u.width,m[1]=y);var x=d++%s.length,S=new fn({anid:b!=null?"line_"+b:null,autoBatch:!0,shape:{x1:v[0],y1:v[1],x2:m[0],y2:m[1]},style:De({stroke:s[x]},g),silent:!0});Ki(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=[],d=o.getLineStyle(),h=0;h<c.length;h++)for(var v=0;v<c[h].length;v++){var m=a.toGlobalCoord(c[h][v].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 fn({anid:"minor_line_"+c[h][v].tickValue,autoBatch:!0,shape:{x1:u[0],y1:u[1],x2:f[0],y2:f[1]},style:d,silent:!0});Ki(g.shape,d.lineWidth),e.add(g)}},splitArea:function(t,e,r,n){ZI(t,e,r,n)}},kb=(function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=e.type,r}return e.type="xAxis",e})(Sb),eP=(function(t){G(e,t);function e(){var r=t!==null&&t.apply(this,arguments)||this;return r.type=kb.type,r}return e.type="yAxis",e})(Sb),tP=(function(t){G(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 nt({shape:r.coordinateSystem.getRect(),style:De({fill:r.get("backgroundColor")},r.getItemStyle()),silent:!0,z2:-1}))},e.type="grid",e})(lr),Tb={offset:0};function rP(t){t.registerComponentView(tP),t.registerComponentModel(UD),t.registerCoordinateSystem("cartesian2d",OI),U0(t,"x",rd,Tb),U0(t,"y",rd,Tb),t.registerComponentView(kb),t.registerComponentView(eP),t.registerPreprocessor(function(e){e.xAxis&&e.yAxis&&!e.grid&&(e.grid={})})}var Cb="\0_ec_interaction_mutex";function Mb(t,e){return!!nP(t)[e]}function nP(t){return t[Cb]||(t[Cb]={})}sa({type:"takeGlobalCursor",event:"globalCursorTaken",update:"update"},pt);var aP=(function(t){G(e,t);function e(r){var n=t.call(this)||this;n._zr=r;var a=Ce(n._mousedownHandler,n),i=Ce(n._mousemoveHandler,n),o=Ce(n._mouseupHandler,n),s=Ce(n._mousewheelHandler,n),l=Ce(n._pinchHandler,n);return n.enable=function(c,u){this.disable(),this._opt=De(ye(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(!l_(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||!fc("moveOnMouseMove",r,this._opt)||r.gestureEvent==="pinch"||Mb(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&&Hl(r.event),Ab(this,"pan","moveOnMouseMove",r,{dx:s,dy:l,oldX:i,oldY:o,newX:n,newY:a,isAvailableBehavior:null})}},e.prototype._mouseupHandler=function(r){l_(r)||(this._dragging=!1)},e.prototype._mousewheelHandler=function(r){var n=fc("zoomOnMouseWheel",r,this._opt),a=fc("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;_d(this,"zoom","zoomOnMouseWheel",r,{scale:u,originX:s,originY:l,isAvailableBehavior:null})}if(a){var f=Math.abs(i),d=(i>0?1:-1)*(f>3?.4:f>1?.15:.05);_d(this,"scrollMove","moveOnMouseWheel",r,{scrollDelta:d,originX:s,originY:l,isAvailableBehavior:null})}}},e.prototype._pinchHandler=function(r){if(!Mb(this._zr,"globalPan")){var n=r.pinchScale>1?1.1:1/1.1;_d(this,"zoom",null,r,{scale:n,originX:r.pinchX,originY:r.pinchY,isAvailableBehavior:null})}},e})(rr);function _d(t,e,r,n,a){t.pointerChecker&&t.pointerChecker(n,a.originX,a.originY)&&(Hl(n.event),Ab(t,e,r,n,a))}function Ab(t,e,r,n,a){a.isAvailableBehavior=Ce(fc,null,r,n),t.trigger(e,a)}function fc(t,e,r){var n=r[t];return!t||n&&(!ie(n)||e.event[n+"Key"])}function bd(t,e,r,n,a,i){t=t||0;var o=r[1]-r[0];if(a!=null&&(a=si(a,[0,o])),i!=null&&(i=Math.max(i,a??0)),n==="all"){var s=Math.abs(e[1]-e[0]);s=si(s,[0,o]),a=i=si(s,[a,i]),n=0}e[0]=si(e[0],r),e[1]=si(e[1],r);var l=xd(e,n);e[n]+=t;var c=a||0,u=r.slice();l.sign<0?u[0]+=c:u[1]-=c,e[n]=si(e[n],u);var f;return f=xd(e,n),a!=null&&(f.sign!==l.sign||f.span<a)&&(e[1-n]=e[n]+l.sign*a),f=xd(e,n),i!=null&&f.span>i&&(e[1-n]=e[n]+f.sign*i),e}function xd(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 si(t,e){return Math.min(e[1]!=null?e[1]:1/0,Math.max(e[0]!=null?e[0]:-1/0,t))}var ua=Xe(),Db=ye,wd=Ce,iP=(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 lt,this.createPointerEl(s,c,e,r),this.createLabelEl(s,c,e,r),n.getZr().add(s);else{var d=qe(Ib,r,f);this.updatePointerEl(s,c,d),this.updateLabelEl(s,c,d,r)}Rb(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=gd(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=ua(e).pointerEl=new kT[i.type](Db(r.pointer));e.add(o)}},t.prototype.createLabelEl=function(e,r,n,a){if(r.label){var i=ua(e).labelEl=new wt(Db(r.label));e.add(i),Lb(i,a)}},t.prototype.updatePointerEl=function(e,r,n){var a=ua(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=ua(e).labelEl;i&&(i.setStyle(r.label.style),n(i,{x:r.label.x,y:r.label.y}),Lb(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=Sf(i.get("icon"),{cursor:"move",draggable:!0,onmousemove:function(c){Hl(c.event)},onmousedown:wd(this._onHandleDragMove,this,0,0),drift:wd(this._onHandleDragMove,this),ondragend:wd(this._onHandleDragEnd,this)}),n.add(a)),Rb(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,ph(this,"_doDispatchAxisPointer",i.get("throttle")||0,"fixRate"),this._moveHandleToValue(e,s)}},t.prototype._moveHandleToValue=function(e,r){Ib(this._axisPointerModel,!r&&this._moveAnimation,this._handle,Sd(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(Sd(n),[e,r],this._axisModel,this._axisPointerModel);this._payloadInfo=a,n.stopAnimation(),n.attr(Sd(a)),ua(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),gh(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 Ib(t,e,r,n){Pb(ua(r).lastProp,n)||(ua(r).lastProp=n,e?Nt(r,n,t):(r.stopAnimation(),r.attr(n)))}function Pb(t,e){if(ce(t)&&ce(e)){var r=!0;return A(e,function(n,a){r=r&&Pb(t[a],n)}),!!r}else return t===e}function Lb(t,e){t[e.get(["label","show"])?"show":"hide"]()}function Sd(t){return{x:t.x||0,y:t.y||0,rotation:t.rotation||0}}function Rb(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 oP(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 sP(t,e,r,n,a){var i=r.get("value"),o=Eb(i,e.axis,e.ecModel,r.get("seriesDataIndices"),{precision:r.get(["label","precision"]),formatter:r.get(["label","formatter"])}),s=r.getModel("label"),l=Dl(s.get("padding")||0),c=s.getFont(),u=fu(o,c),f=a.position,d=u.width+l[1]+l[3],h=u.height+l[0]+l[2],v=a.align;v==="right"&&(f[0]-=d),v==="center"&&(f[0]-=d/2);var m=a.verticalAlign;m==="bottom"&&(f[1]-=h),m==="middle"&&(f[1]-=h/2),lP(f,d,h,n);var g=s.get("backgroundColor");(!g||g==="auto")&&(g=e.get(["axisLine","lineStyle","color"])),t.label={x:f[0],y:f[1],style:Ga(s,{text:o,font:c,fill:s.getTextColor(),padding:l,backgroundColor:g}),z2:10}}function lP(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 Eb(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:cd(e,{value:t}),axisDimension:e.dim,axisIndex:e.index,seriesData:[]};A(n,function(l){var c=r.getSeriesByIndex(l.seriesIndex),u=l.dataIndexInside,f=c&&c.getDataParams(u);f&&s.seriesData.push(f)}),ie(o)?i=o.replace("{value}",i):ge(o)&&(i=o(s))}return i}function Ob(t,e,r){var n=ka();return cu(n,n,r.rotation),lu(n,n,r.position),wf([t.dataToCoord(e),(r.labelOffset||0)+(r.labelDirection||1)*(r.labelMargin||0)],n)}function cP(t,e,r,n,a,i){var o=wn.innerTextLayout(r.rotation,0,r.labelDirection);r.labelMargin=a.get(["label","margin"]),sP(e,n,a,i,{position:Ob(n.axis,t,r),align:o.textAlign,verticalAlign:o.textVerticalAlign})}function uP(t,e,r){return r=r||0,{x1:t[r],y1:t[1-r],x2:e[r],y2:e[1-r]}}function fP(t,e,r){return r=r||0,{x:t[r],y:t[1-r],width:e[r],height:e[1-r]}}var hP=(function(t){G(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=Nb(l,s).getOtherAxis(s).getGlobalExtent(),f=s.toGlobalCoord(s.dataToCoord(n,!0));if(c&&c!=="none"){var d=oP(i),h=dP[c](s,f,u);h.style=d,r.graphicKey=h.type,r.pointer=h}var v=hd(l.model,a);cP(n,r,v,a,i,o)},e.prototype.getHandleTransform=function(r,n,a){var i=hd(n.axis.grid.model,n,{labelInside:!1});i.labelMargin=a.get(["handle","margin"]);var o=Ob(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=Nb(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 d=(c[1]+c[0])/2,h=[d,d];h[u]=f[u];var v=[{verticalAlign:"middle"},{align:"center"}];return{x:f[0],y:f[1],rotation:r.rotation,cursorPoint:h,tooltipOption:v[u]}},e})(iP);function Nb(t,e){var r={};return r[e.dim+"AxisIndex"]=e.index,t.getCartesian(r)}var dP={line:function(t,e,r){var n=uP([e,r[0]],[e,r[1]],Bb(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:fP([e-n/2,r[0]],[n,a],Bb(t))}}};function Bb(t){return t.dim==="x"?0:1}var vP=(function(t){G(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})(Oe),Zr=Xe(),pP=A;function zb(t,e,r){if(!he.node){var n=e.getZr();Zr(n).records||(Zr(n).records={}),gP(n,e);var a=Zr(n).records[t]||(Zr(n).records[t]={});a.handler=r}}function gP(t,e){if(Zr(t).initialized)return;Zr(t).initialized=!0,r("click",qe(Fb,"click")),r("mousemove",qe(Fb,"mousemove")),r("globalout",yP);function r(n,a){t.on(n,function(i){var o=_P(e);pP(Zr(t).records,function(s){s&&a(s,i,o.dispatchAction)}),mP(o.pendings,e)})}}function mP(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 yP(t,e,r){t.handler("leave",null,r)}function Fb(t,e,r,n){e.handler(t,r,n)}function _P(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 kd(t,e){if(!he.node){var r=e.getZr(),n=(Zr(r).records||{})[t];n&&(Zr(r).records[t]=null)}}var bP=(function(t){G(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";zb("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){kd("axisPointer",n)},e.prototype.dispose=function(r,n){kd("axisPointer",n)},e.type="axisPointer",e})(lr);function Hb(t,e){var r=[],n=t.seriesIndex,a;if(n==null||!(a=e.getSeriesByIndex(n)))return{point:[]};var i=a.getData(),o=Zn(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,d=c.dim,h=f==="x"||f==="radius"?1:0,v=i.mapDimension(d),m=[];m[h]=i.get(v,o),m[1-h]=i.get(i.getCalculationInfo("stackResultDimension"),o),r=l.dataToPoint(m)||[]}else r=l.dataToPoint(i.getValues(ue(l.dimensions,function(p){return i.mapDimension(p)}),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 Vb=Xe();function xP(t,e,r){var n=t.currTrigger,a=[t.x,t.y],i=t,o=t.dispatchAction||Ce(r.dispatchAction,r),s=e.getComponent("axisPointer").coordSysAxesInfo;if(s){hc(a)&&(a=Hb({seriesIndex:i.seriesIndex,dataIndex:i.dataIndex},e).point);var l=hc(a),c=i.axesInfo,u=s.axesInfo,f=n==="leave"||hc(a),d={},h={},v={list:[],map:{}},m={showPointer:qe(SP,h),showTooltip:qe(kP,v)};A(s.coordSysMap,function(p,y){var b=l||p.containPoint(a);A(s.coordSysAxesInfo[y],function(x,S){var w=x.axis,k=AP(c,x);if(!f&&b&&(!c||k)){var T=k&&k.value;T==null&&!l&&(T=w.pointToData(a)),T!=null&&Gb(x,T,m,!1,d)}})});var g={};return A(u,function(p,y){var b=p.linkGroup;b&&!h[y]&&A(b.axesInfo,function(x,S){var w=h[S];if(x!==p&&w){var k=w.value;b.mapper&&(k=p.axis.scale.parse(b.mapper(k,Wb(x),Wb(p)))),g[p.key]=k}})}),A(g,function(p,y){Gb(u[y],p,m,!0,d)}),TP(h,u,d),CP(v,a,t,o),MP(u,o,r),d}}function Gb(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=wP(e,t),s=o.payloadBatch,l=o.snapToValue;s[0]&&a.seriesIndex==null&&V(a,s[0]),!n&&t.snap&&i.containData(l)&&l!=null&&(e=l),r.showPointer(t,e,s),r.showTooltip(t,o,l)}}function wP(t,e){var r=e.axis,n=r.dim,a=t,i=[],o=Number.MAX_VALUE,s=-1;return A(e.seriesModels,function(l,c){var u=l.getData().mapDimensionsAll(n),f,d;if(l.getAxisTooltipData){var h=l.getAxisTooltipData(u,t,r);d=h.dataIndices,f=h.nestestValue}else{if(d=l.getData().indicesOfNearest(u[0],t,r.type==="category"?.5:null),!d.length)return;f=l.getData().get(u[0],d[0])}if(!(f==null||!isFinite(f))){var v=t-f,m=Math.abs(v);m<=o&&((m<o||v>=0&&s<0)&&(o=m,s=v,a=f,i.length=0),A(d,function(g){i.push({seriesIndex:l.seriesIndex,dataIndexInside:g,dataIndex:l.getData().getRawIndex(g)})}))}}),{payloadBatch:i,snapToValue:a}}function SP(t,e,r,n){t[e.key]={value:r,payloadBatch:n}}function kP(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=Co(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 TP(t,e,r){var n=r.axesInfo=[];A(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 CP(t,e,r,n){if(hc(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 MP(t,e,r){var n=r.getZr(),a="axisPointerLastHighlights",i=Vb(n)[a]||{},o=Vb(n)[a]={};A(t,function(c,u){var f=c.axisPointerModel.option;f.status==="show"&&c.triggerEmphasis&&A(f.seriesDataIndices,function(d){var h=d.seriesIndex+" | "+d.dataIndex;o[h]=d})});var s=[],l=[];A(i,function(c,u){!o[u]&&l.push(c)}),A(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 AP(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 Wb(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 hc(t){return!t||t[0]==null||isNaN(t[0])||t[1]==null||isNaN(t[1])}function Ub(t){wb.registerAxisPointerClass("CartesianAxisPointer",hP),t.registerComponentModel(vP),t.registerComponentView(bP),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=GI(e,r)}),t.registerAction({type:"updateAxisPointer",event:"updateAxisPointer",update:":updateAxisPointer"},xP)}function DP(t){bn(rP),bn(Ub)}var $b=["x","y","radius","angle","single"],IP=["cartesian2d","polar","singleAxis"];function PP(t){var e=t.get("coordinateSystem");return Ie(IP,e)>=0}function fa(t){return t+"Axis"}function LP(t,e){var r=fe(),n=[],a=fe();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(d,h){var v=r.get(d);v&&v[h]&&(f=!0)}),f}function c(u){u.eachTargetAxis(function(f,d){(r.get(f)||r.set(f,[]))[d]=!0})}return n}function RP(t){var e=t.ecModel,r={infoList:[],infoMap:fe()};return t.eachTargetAxis(function(n,a){var i=e.getComponent(fa(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 Td=(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})(),Yb=(function(t){G(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=qb(r);this.settledOption=i,this.mergeDefaultAndTheme(r,a),this._doInit(i)},e.prototype.mergeOption=function(r){var n=qb(r);ke(this.option,r,!0),ke(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;A([["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=fe(),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 A($b,function(a){var i=this.getReferringComponents(fa(a),ck);if(i.specified){n=!0;var o=new Td;A(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 d=new Td;if(d.add(f.componentIndex),r.set(u,d),i=!1,u==="x"||u==="y"){var h=f.getReferringComponents("grid",kt).models[0];h&&A(c,function(v){f.componentIndex!==v.componentIndex&&h===v.getReferringComponents("grid",kt).models[0]&&d.add(v.componentIndex)})}}}i&&A($b,function(c){if(i){var u=a.findComponents({mainType:fa(c),filter:function(d){return d.get("type",!0)==="category"}});if(u[0]){var f=new Td;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");A([["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(fa(n),a))},this),r},e.prototype.eachTargetAxis=function(r,n){this._targetAxisInfoMap.each(function(a,i){A(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(fa(r),n)},e.prototype.setRawRange=function(r){var n=this.option,a=this.settledOption;A([["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;A(["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})(Oe);function qb(t){var e={};return A(["start","end","startValue","endValue","throttle"],function(r){t.hasOwnProperty(r)&&(e[r]=t[r])}),e}var EP=(function(t){G(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),li=A,Xb=$S,OP=(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(PP(r)){var n=fa(this._dimName),a=r.getReferringComponents(n,kt).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 ye(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;li(["start","end"],function(d,h){var v=e[d],m=e[d+"Value"];i[h]==="percent"?(v==null&&(v=o[h]),m=a.parse(Xn(v,o,r))):(c=!0,m=m==null?r[h]:a.parse(m),v=Xn(m,r,o)),l[h]=m==null||isNaN(m)?r[h]:m,s[h]=v==null||isNaN(v)?o[h]:v}),Xb(l),Xb(s);var u=this._minMaxSpan;c?f(l,s,r,o,!1):f(s,l,o,r,!0);function f(d,h,v,m,g){var p=g?"Span":"ValueSpan";bd(0,d,v,"all",u["min"+p],u["max"+p]);for(var y=0;y<2;y++)h[y]=Xn(d[y],v,m,!0),g&&(h[y]=a.parse(h[y]))}return{valueWindow:l,percentWindow:s}},t.prototype.reset=function(e){if(e===this._dataZoomModel){var r=this.getTargetSeriesModels();this._dataExtent=NP(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;li(a,function(l){var c=l.getData(),u=c.mapDimensionsAll(n);if(u.length){if(i==="weakFilter"){var f=c.getStore(),d=ue(u,function(h){return c.getDimensionIndex(h)},c);c.filterSelf(function(h){for(var v,m,g,p=0;p<u.length;p++){var y=f.get(d[p],h),b=!isNaN(y),x=y<o[0],S=y>o[1];if(b&&!x&&!S)return!0;b&&(g=!0),x&&(v=!0),S&&(m=!0)}return g&&v&&m})}else li(u,function(h){if(i==="empty")l.setData(c=c.map(h,function(m){return s(m)?m:NaN}));else{var v={};v[h]=o,c.selectRange(v)}});li(u,function(h){c.setApproximateExtent(o,h)})}});function s(l){return l>=o[0]&&l<=o[1]}},t.prototype._updateMinMaxSpan=function(){var e=this._minMaxSpan={},r=this._dataZoomModel,n=this._dataExtent;li(["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=Xn(n[0]+o,n,[0,100],!0):i!=null&&(o=Xn(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=rg(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 NP(t,e,r){var n=[1/0,-1/0];li(r,function(o){bI(n,o.getData(),e)});var a=t.getAxisModel(),i=Q0(a.axis.scale,a,n).calculate();return[i.min,i.max]}var BP={getTargetSeries:function(t){function e(a){t.eachComponent("dataZoom",function(i){i.eachTargetAxis(function(o,s){var l=t.getComponent(fa(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 OP(a,i,s,t),r.push(o.__dzAxisProxy))});var n=fe();return A(r,function(a){A(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 zP(t){t.registerAction("dataZoom",function(e,r){var n=LP(r,e);A(n,function(a){a.setRawRange({start:e.start,end:e.end,startValue:e.startValue,endValue:e.endValue})})})}var Zb=!1;function FP(t){Zb||(Zb=!0,t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,BP),zP(t),t.registerSubTypeDefaulter("dataZoom",function(){return"slider"}))}function HP(t,e){var r=Dl(e.get("padding")),n=e.getItemStyle(["color","opacity"]);return n.fill=e.get("backgroundColor"),t=new nt({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 VP=(function(t){G(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})(Oe);function Kb(t){var e=t.get("confine");return e!=null?!!e:t.get("renderMode")==="richText"}function jb(t){if(he.domSupported){for(var e=document.documentElement.style,r=0,n=t.length;r<n;r++)if(t[r]in e)return t[r]}}var Qb=jb(["transform","webkitTransform","OTransform","MozTransform","msTransform"]),GP=jb(["webkitTransition","transition","OTransition","MozTransition","msTransition"]);function Jb(t,e){if(!t)return e;e=ny(e,!0);var r=t.indexOf(e);return t=r===-1?e:"-"+t.slice(0,r)+"-"+e,t.toLowerCase()}function WP(t,e){var r=t.currentStyle||document.defaultView&&document.defaultView.getComputedStyle(t);return r?r[e]:null}var UP=Jb(GP,"transition"),Cd=Jb(Qb,"transform"),$P="position:absolute;display:block;border-style:solid;white-space:nowrap;z-index:9999999;"+(he.transform3dSupported?"will-change:transform;":"");function YP(t){return t=t==="left"?"right":t==="right"?"left":t==="top"?"bottom":"top",t}function qP(t,e,r){if(!ie(r)||r==="inside")return"";var n=t.get("backgroundColor"),a=t.get("borderWidth");e=na(e);var i=YP(r),o=Math.max(Math.round(a)*1.5,6),s="",l=Cd+":",c;Ie(["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,d=f*Math.abs(Math.cos(u))+f*Math.abs(Math.sin(u)),h=Math.round(((d-Math.SQRT2*a)/2+Math.SQRT2*a-(d-f)/2)*100)/100;s+=";"+i+":-"+h+"px";var v=e+" solid "+a+"px;",m=["position:absolute;width:"+o+"px;height:"+o+"px;z-index:-1;",s+";"+l+";","border-bottom:"+v,"border-right:"+v,"background-color:"+n+";"];return'<div style="'+m.join("")+'"></div>'}function XP(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+=he.transformSupported?","+Cd+n:",left"+n+",top"+n),UP+":"+a}function ex(t,e,r){var n=t.toFixed(0)+"px",a=e.toFixed(0)+"px";if(!he.transformSupported)return r?"top:"+a+";left:"+n+";":[["top",a],["left",n]];var i=he.transform3dSupported,o="translate"+(i?"3d":"")+"("+n+","+a+(i?",0":"")+")";return r?"top:0;left:0;"+Cd+":"+o+";":[["top",0],["left",0],[Qb,o]]}function ZP(t){var e=[],r=t.get("fontSize"),n=t.getTextColor();n&&e.push("color:"+n),e.push("font:"+t.getFont());var a=_e(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),A(["decoration","align"],function(c){var u=t.get(c);u&&e.push("text-"+c+":"+u)}),e.join(";")}function KP(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=_y(t,"html"),d=l+"px "+c+"px "+o+"px "+s;return n.push("box-shadow:"+d),e&&a&&n.push(XP(a,r)),i&&n.push("background-color:"+i),A(["width","color","radius"],function(h){var v="border-"+h,m=ny(v),g=t.get(m);g!=null&&n.push(v+":"+g+(h==="color"?"":"px"))}),n.push(ZP(u)),f!=null&&n.push("padding:"+Dl(f).join("px ")+"px"),n.join(";")+";"}function tx(t,e,r,n,a){var i=e&&e.painter;if(r){var o=i&&i.getViewportRoot();o&&C2(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 jP=(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,he.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&&(ie(i)?document.querySelector(i):Si(i)?i:ge(i)&&i(e.getDom()));tx(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=WP(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=$P+KP(e,!this._firstShow,this._longHide)+ex(i[0],i[1],!0)+("border-color:"+na(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(ie(i)&&n.get("trigger")==="item"&&!Kb(n)&&(s=qP(n,a,i)),ie(e))o.innerHTML=e+s;else if(e){o.innerHTML="",ee(e)||(e=[e]);for(var l=0;l<e.length;l++)Si(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(tx(n,this._zr,this._container,e,r),n[0]!=null&&n[1]!=null){var a=this.el.style,i=ex(n[0],n[1]);A(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",he.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(Ce(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})(),QP=(function(){function t(e){this._show=!1,this._styleCoord=[0,0,0,0],this._alwaysShowContent=!1,this._enterable=!0,this._zr=e.getZr(),nx(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)&&St(""),this.el&&this._zr.remove(this.el);var s=n.getModel("textStyle");this.el=new wt({style:{rich:r.richTextStyles,text:e,lineHeight:22,borderWidth:1,borderColor:a,textShadowColor:s.get("textShadowColor"),fill:n.get(["textStyle","color"]),padding:_y(n,"richText"),verticalAlign:"top",align:"left"},z:n.get("z")}),A(["backgroundColor","borderRadius","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY"],function(c){o.el.style[c]=n.get(c)}),A(["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=rx(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;nx(a,this._zr,e,r),e=a[0],r=a[1];var i=n.style,o=Sn(i.borderWidth||0),s=rx(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(Ce(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 rx(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 nx(t,e,r,n){t[0]=r,t[1]=n,t[2]=t[0]/e.getWidth(),t[3]=t[1]/e.getHeight()}var JP=new nt({shape:{x:-1,y:-1,width:2,height:2}}),eL=(function(t){G(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(!(he.node||!n.getDom())){var a=r.getComponent("tooltip"),i=this._renderMode=fk(a.get("renderMode"));this._tooltipContent=i==="richText"?new QP(n):new jP(n,{appendTo:a.get("appendToBody",!0)?"body":a.get("appendTo",!0)})}},e.prototype.render=function(r,n,a){if(!(he.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")?ph(this,"_updatePosition",50,"fixRate"):gh(this,"_updatePosition")}},e.prototype._initGlobalListener=function(){var r=this._tooltipModel,n=r.get("triggerOn");zb("itemTooltip",this._api,Ce(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||he.node||!a.getDom())){var o=ax(i,a);this._ticket="";var s=i.dataByCoordSys,l=aL(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=JP;u.x=i.x,u.y=i.y,u.update(),Re(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=Hb(i,n),d=f.point[0],h=f.point[1];d!=null&&h!=null&&this._tryShow({offsetX:d,offsetY:h,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(ax(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=Mo([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=Re(a);if(s.ssrType==="legend")return;this._lastDataByCoordSys=null;var l,c;yo(a,function(u){if(Re(u).dataIndex!=null)return l=u,!0;if(Re(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=Ce(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=Mo([n.tooltipOption],i),l=this._renderMode,c=[],u=lo("section",{blocks:[],noHeader:!0}),f=[],d=new rh;A(r,function(y){A(y.dataByAxis,function(b){var x=a.getComponent(b.axisDim+"Axis",b.axisIndex),S=b.value;if(!(!x||S==null)){var w=Eb(S,x.axis,a,b.seriesDataIndices,b.valueLabelOpt),k=lo("section",{header:w,noHeader:!_r(w),sortBlocks:!0,blocks:[]});u.blocks.push(k),A(b.seriesDataIndices,function(T){var M=a.getSeriesByIndex(T.seriesIndex),D=T.dataIndexInside,C=M.getDataParams(D);if(!(C.dataIndex<0)){C.axisDim=b.axisDim,C.axisIndex=b.axisIndex,C.axisType=b.axisType,C.axisId=b.axisId,C.axisValue=cd(x.axis,{value:S}),C.axisValueLabel=w,C.marker=d.makeTooltipMarker("item",na(C.color),l);var I=cy(M.formatTooltip(D,!0,null)),P=I.frag;if(P){var L=Mo([M],i).get("valueFormatter");k.blocks.push(L?V({valueFormatter:L},P):P)}I.text&&f.push(I.text),c.push(C)}})}})}),u.blocks.reverse(),f.reverse();var h=n.position,v=s.get("order"),m=my(u,d,l,v,a.get("useUTC"),s.get("textStyle"));m&&f.unshift(m);var g=l==="richText"?`
|
|
19
|
+
|
|
20
|
+
`:"<br/>",p=f.join(g);this._showOrMove(s,function(){this._updateContentNotChangedOnAxis(r,c)?this._updatePosition(s,h,o[0],o[1],this._tooltipContent,c):this._showTooltipContent(s,p,c,Math.random()+"",o[0],o[1],h,null,d)})},e.prototype._showSeriesItemTooltip=function(r,n,a){var i=this._ecModel,o=Re(n),s=o.seriesIndex,l=i.getSeriesByIndex(s),c=o.dataModel||l,u=o.dataIndex,f=o.dataType,d=c.getData(f),h=this._renderMode,v=r.positionDefault,m=Mo([d.getItemModel(u),c,l&&(l.coordinateSystem||{}).model],this._tooltipModel,v?{position:v}:null),g=m.get("trigger");if(!(g!=null&&g!=="item")){var p=c.getDataParams(u,f),y=new rh;p.marker=y.makeTooltipMarker("item",na(p.color),h);var b=cy(c.formatTooltip(u,!1,f)),x=m.get("order"),S=m.get("valueFormatter"),w=b.frag,k=w?my(S?V({valueFormatter:S},w):w,y,h,x,i.get("useUTC"),m.get("textStyle")):b.text,T="item_"+c.name+"_"+u;this._showOrMove(m,function(){this._showTooltipContent(m,k,p,T,r.offsetX,r.offsetY,r.position,r.target,y)}),a({type:"showTip",dataIndexInside:u,dataIndex:d.getRawIndex(u),seriesIndex:s,from:this.uid})}},e.prototype._showComponentItemTooltip=function(r,n,a){var i=this._renderMode==="html",o=Re(n),s=o.tooltipConfig,l=s.option||{},c=l.encodeHTMLContent;if(ie(l)){var u=l;l={content:u,formatter:u},c=!0}c&&i&&l.content&&(l=ye(l),l.content=Mt(l.content));var f=[l],d=this._ecModel.getComponent(o.componentMainType,o.componentIndex);d&&f.push(d),f.push({formatter:l.content});var h=r.positionDefault,v=Mo(f,this._tooltipModel,h?{position:h}:null),m=v.get("content"),g=Math.random()+"",p=new rh;this._showOrMove(v,function(){var y=ye(v.get("formatterParams")||{});this._showTooltipContent(v,m,y,g,r.offsetX,r.offsetY,r.position,n,p)}),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 d=r.get("formatter");l=l||r.get("position");var h=n,v=this._getNearestPoint([o,s],a,r.get("trigger"),r.get("borderColor")),m=v.color;if(d)if(ie(d)){var g=r.ecModel.get("useUTC"),p=ee(a)?a[0]:a,y=p&&p.axisType&&p.axisType.indexOf("time")>=0;h=d,y&&(h=kl(p.axisValue,h,g)),h=iy(h,a,!0)}else if(ge(d)){var b=Ce(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,h=d(a,i,b)}else h=d;f.setContent(h,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(),d=r.get("align"),h=r.get("verticalAlign"),v=l&&l.getBoundingRect().clone();if(l&&v.applyTransform(l.transform),ge(n)&&(n=n([a,i],s,o.el,v,{viewSize:[c,u],contentSize:f.slice()})),ee(n))a=mt(n[0],c),i=mt(n[1],u);else if(ce(n)){var m=n;m.width=f[0],m.height=f[1];var g=Ll(m,{width:c,height:u});a=g.x,i=g.y,d=null,h=null}else if(ie(n)&&l){var p=nL(n,v,f,r.get("borderWidth"));a=p[0],i=p[1]}else{var p=tL(a,i,o,c,u,d?null:20,h?null:20);a=p[0],i=p[1]}if(d&&(a-=ix(d)?f[0]/2:d==="right"?f[0]:0),h&&(i-=ix(h)?f[1]/2:h==="bottom"?f[1]:0),Kb(r)){var p=rL(a,i,o,c,u);a=p[0],i=p[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&&A(a,function(s,l){var c=s.dataByAxis||[],u=r[l]||{},f=u.dataByAxis||[];o=o&&c.length===f.length,o&&A(c,function(d,h){var v=f[h]||{},m=d.seriesDataIndices||[],g=v.seriesDataIndices||[];o=o&&d.value===v.value&&d.axisType===v.axisType&&d.axisId===v.axisId&&m.length===g.length,o&&A(m,function(p,y){var b=g[y];o=o&&p.seriesIndex===b.seriesIndex&&p.dataIndex===b.dataIndex}),i&&A(d.seriesDataIndices,function(p){var y=p.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){he.node||!n.getDom()||(gh(this,"_updatePosition"),this._tooltipContent.dispose(),kd("itemTooltip",n))},e.type="tooltip",e})(lr);function Mo(t,e,r){var n=e.ecModel,a;r?(a=new $e(r,n,n),a=new $e(e.option,a,n)):a=e;for(var i=t.length-1;i>=0;i--){var o=t[i];o&&(o instanceof $e&&(o=o.get("tooltip",!0)),ie(o)&&(o={formatter:o}),o&&(a=new $e(o,a,n)))}return a}function ax(t,e){return t.dispatchAction||Ce(e.dispatchAction,e)}function tL(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 rL(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 nL(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 ix(t){return t==="center"||t==="middle"}function aL(t,e,r){var n=ju(t).queryOptionMap,a=n.keys()[0];if(!(!a||a==="series")){var i=Wi(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=Re(c).tooltipConfig;if(u&&u.name===t.name)return l=c,!0}),l)return{componentMainType:a,componentIndex:o.componentIndex,el:l}}}}function iL(t){bn(Ub),t.registerComponentModel(VP),t.registerComponentView(eL),t.registerAction({type:"showTip",event:"showTip",update:"tooltip:manuallyShowTip"},pt),t.registerAction({type:"hideTip",event:"hideTip",update:"tooltip:manuallyHideTip"},pt)}var oL=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"])}},Md=(function(t){G(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)&&A(n,function(i,o){ie(i)&&(i={type:i}),n[o]=ke(i,oL(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,d=f.getAllNames();r.isSeriesFiltered(l)||(a=a.concat(d)),d.length?n=n.concat(d):u=!0}else u=!0;u&&Zu(l)&&n.push(l.name)}),this._availableNames=a;var i=this.get("data")||n,o=fe(),s=ue(i,function(l){return(ie(l)||He(l))&&(l={name:l}),o.get(l.name)?null:(o.set(l.name,!0),new $e(l,this,this.ecModel))},this);this._data=it(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;A(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;A(r,function(a){n[a.get("name",!0)]=!0})},e.prototype.inverseSelect=function(){var r=this._data,n=this.option.selected;A(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])&&Ie(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})(Oe),ci=qe,Ad=A,dc=lt,ox=(function(t){G(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 dc),this.group.add(this._selectorGroup=new dc),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()},d=r.get("padding"),h=Ll(u,f,d),v=this.layoutInner(r,o,h,i,l,c),m=Ll(De({width:v.width,height:v.height},u),f,d);this.group.x=m.x-v.x,this.group.y=m.y-v.y,this.group.markRedraw(),this.group.add(this._backgroundEl=HP(v,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=fe(),f=n.get("selectedMode"),d=[];a.eachRawSeries(function(h){!h.get("legendHoverLink")&&d.push(h.id)}),Ad(n.getData(),function(h,v){var m=h.get("name");if(!this.newlineDisabled&&(m===""||m===`
|
|
21
|
+
`)){var g=new dc;g.newline=!0,c.add(g);return}var p=a.getSeriesByName(m)[0];if(!u.get(m))if(p){var y=p.getData(),b=y.getVisual("legendLineStyle")||{},x=y.getVisual("legendIcon"),S=y.getVisual("style"),w=this._createItem(p,m,v,h,n,r,b,S,x,f,i);w.on("click",ci(sx,m,null,i,d)).on("mouseover",ci(Dd,p.name,null,i,d)).on("mouseout",ci(Id,p.name,null,i,d)),a.ssr&&w.eachChild(function(k){var T=Re(k);T.seriesIndex=p.seriesIndex,T.dataIndex=v,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 M=T.indexOfName(m),D=T.getItemVisual(M,"style"),C=T.getItemVisual(M,"legendIcon"),I=zr(D.fill);I&&I[3]===0&&(I[3]=.2,D=V(V({},D),{fill:Cs(I,"rgba")}));var P=this._createItem(k,m,v,h,n,r,{},D,C,f,i);P.on("click",ci(sx,null,m,i,d)).on("mouseover",ci(Dd,null,m,i,d)).on("mouseout",ci(Id,null,m,i,d)),a.ssr&&P.eachChild(function(L){var R=Re(L);R.seriesIndex=k.seriesIndex,R.dataIndex=v,R.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();Ad(r,function(c){var u=c.type,f=new wt({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 d=n.getModel("selectorLabel"),h=n.getModel(["emphasis","selectorLabel"]);hl(f,{normal:d,emphasis:h},{defaultText:c.title}),of(f)})},e.prototype._createItem=function(r,n,a,i,o,s,l,c,u,f,d){var h=r.visualDrawType,v=o.get("itemWidth"),m=o.get("itemHeight"),g=o.isSelected(n),p=i.get("symbolRotate"),y=i.get("symbolKeepAspect"),b=i.get("icon");u=b||u||"roundRect";var x=sL(u,i,l,c,h,g,d),S=new dc,w=i.getModel("textStyle");if(ge(r.getLegendIcon)&&(!b||b==="inherit"))S.add(r.getLegendIcon({itemWidth:v,itemHeight:m,icon:u,iconRotate:p,itemStyle:x.itemStyle,lineStyle:x.lineStyle,symbolKeepAspect:y}));else{var k=b==="inherit"&&r.getData().getVisual("symbol")?p==="inherit"?r.getData().getVisual("symbolRotate"):p:0;S.add(lL({itemWidth:v,itemHeight:m,icon:u,iconRotate:k,itemStyle:x.itemStyle,symbolKeepAspect:y}))}var T=s==="left"?v+5:-5,M=s,D=o.get("formatter"),C=n;ie(D)&&D?C=D.replace("{name}",n??""):ge(D)&&(C=D(n));var I=g?w.getTextColor():i.get("inactiveColor");S.add(new wt({style:Ga(w,{text:C,x:T,y:m/2,fill:I,align:M,verticalAlign:"middle"},{inheritColor:I})}));var P=new nt({shape:S.getBoundingRect(),style:{fill:"transparent"}}),L=i.getModel("tooltip");return L.get("show")&&cl({el:P,componentModel:o,itemName:n,itemTooltipOption:L.option}),S.add(P),S.eachChild(function(R){R.silent=!0}),P.silent=!f,this.getContentGroup().add(S),of(S),S.__legendDataIndex=a,S},e.prototype.layoutInner=function(r,n,a,i,o,s){var l=this.getContentGroup(),c=this.getSelectorGroup();io(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){io("horizontal",c,r.get("selectorItemGap",!0));var d=c.getBoundingRect(),h=[-d.x,-d.y],v=r.get("selectorButtonGap",!0),m=r.getOrient().index,g=m===0?"width":"height",p=m===0?"height":"width",y=m===0?"y":"x";s==="end"?h[m]+=u[g]+v:f[m]+=d[g]+v,h[1-m]+=u[p]/2-d[p]/2,c.x=h[0],c.y=h[1],l.x=f[0],l.y=f[1];var b={x:0,y:0};return b[g]=u[g]+v+d[g],b[p]=Math.max(u[p],d[p]),b[y]=Math.min(0,d[y]+h[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})(lr);function sL(t,e,r,n,a,i,o){function s(g,p){g.lineWidth==="auto"&&(g.lineWidth=p.lineWidth>0?2:0),Ad(g,function(y,b){g[b]==="inherit"&&(g[b]=p[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:Hh(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 d=e.getModel("lineStyle"),h=d.getLineStyle();if(s(h,r),c.fill==="auto"&&(c.fill=n.fill),c.stroke==="auto"&&(c.stroke=n.fill),h.stroke==="auto"&&(h.stroke=n.fill),!i){var v=e.get("inactiveBorderWidth"),m=c[u];c.lineWidth=v==="auto"?n.lineWidth>0&&m?2:0:c.lineWidth,c.fill=e.get("inactiveColor"),c.stroke=e.get("inactiveBorderColor"),h.stroke=d.get("inactiveColor"),h.lineWidth=d.get("inactiveWidth")}return{itemStyle:c,lineStyle:h}}function lL(t){var e=t.icon||"roundRect",r=Ja(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 sx(t,e,r,n){Id(t,e,r,n),r.dispatchAction({type:"legendToggleSelect",name:t??e}),Dd(t,e,r,n)}function lx(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 Dd(t,e,r,n){lx(r)||r.dispatchAction({type:"highlight",seriesName:t,name:e,excludeSeriesId:n})}function Id(t,e,r,n){lx(r)||r.dispatchAction({type:"downplay",seriesName:t,name:e,excludeSeriesId:n})}function cL(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 Ao(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),cx(s,a),i.push(s.componentIndex)});var o={};return r.eachComponent("legend",function(s){A(a,function(l,c){s[l?"select":"unSelect"](c)}),cx(s,o)}),n?{selected:o,legendIndex:i}:{name:e.name,selected:o}}function cx(t,e){var r=e||{};return A(t.getData(),function(n){var a=n.get("name");if(!(a===`
|
|
22
|
+
`||a==="")){var i=t.isSelected(a);In(r,a)?r[a]=r[a]&&i:r[a]=i}}),r}function uL(t){t.registerAction("legendToggleSelect","legendselectchanged",qe(Ao,"toggleSelected")),t.registerAction("legendAllSelect","legendselectall",qe(Ao,"allSelect")),t.registerAction("legendInverseSelect","legendinverseselect",qe(Ao,"inverseSelect")),t.registerAction("legendSelect","legendselected",qe(Ao,"select")),t.registerAction("legendUnSelect","legendunselected",qe(Ao,"unSelect"))}function ux(t){t.registerComponentModel(Md),t.registerComponentView(ox),t.registerProcessor(t.PRIORITY.PROCESSOR.SERIES_FILTER,cL),t.registerSubTypeDefaulter("legend",function(){return"plain"}),uL(t)}var fL=(function(t){G(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=Rl(r);t.prototype.init.call(this,r,n,a),fx(this,r,i)},e.prototype.mergeOption=function(r,n){t.prototype.mergeOption.call(this,r,n),fx(this,this.option,r)},e.type="legend.scroll",e.defaultOption=Ff(Md.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})(Md);function fx(t,e,r){var n=t.getOrient(),a=[1,1];a[n.index]=0,Qa(e,r,{type:"box",ignoreSize:!!a})}var hx=lt,Pd=["width","height"],Ld=["x","y"],hL=(function(t){G(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 hx),this._containerGroup.add(this.getContentGroup()),this.group.add(this._controllerGroup=new hx)},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),d=ee(f)?f:[f,f];v("pagePrev",0);var h=n.getModel("pageTextStyle");u.add(new wt({name:"pageText",style:{text:"xx/xx",fill:h.getTextColor(),font:h.getFont(),verticalAlign:"middle",align:"center"},silent:!0})),v("pageNext",1);function v(m,g){var p=m+"DataIndex",y=Sf(n.get("pageIcons",!0)[n.getOrient().name][g],{onclick:Ce(c._pageGo,c,p,n,i)},{x:-d[0]/2,y:-d[1]/2,width:d[0],height:d[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=Pd[c],f=Ld[c],d=Pd[1-c],h=Ld[1-c];o&&io("horizontal",l,r.get("selectorItemGap",!0));var v=r.get("selectorButtonGap",!0),m=l.getBoundingRect(),g=[-m.x,-m.y],p=ye(a);o&&(p[u]=a[u]-m[u]-v);var y=this._layoutContentAndController(r,i,p,c,u,d,h,f);if(o){if(s==="end")g[c]+=y[u]+v;else{var b=m[u]+v;g[c]-=b,y[f]-=b}y[u]+=m[u]+v,g[1-c]+=y[h]+y[d]/2-m[d]/2,y[d]=Math.max(y[d],m[d]),y[h]=Math.min(y[h],m[h]+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,d=this._controllerGroup;io(r.get("orient"),u,r.get("itemGap"),i?a.width:null,i?null:a.height),io("horizontal",d,r.get("pageButtonItemGap",!0));var h=u.getBoundingRect(),v=d.getBoundingRect(),m=this._showController=h[o]>a[o],g=[-h.x,-h.y];n||(g[i]=u[c]);var p=[0,0],y=[-v.x,-v.y],b=_e(r.get("pageButtonGap",!0),r.get("itemGap",!0));if(m){var x=r.get("pageButtonPosition",!0);x==="end"?y[i]+=a[o]-v[o]:p[i]+=v[o]+b}y[1-i]+=h[s]/2-v[s]/2,u.setPosition(g),f.setPosition(p),d.setPosition(y);var S={x:0,y:0};if(S[o]=m?a[o]:h[o],S[s]=Math.max(h[s],v[s]),S[l]=Math.min(0,v[l]+y[1-i]),f.__rectSize=a[o],m){var w={x:0,y:0};w[o]=Math.max(a[o]-v[o]-b,0),w[s]=S[s],f.setClipPath(new nt({shape:w})),f.__rectSize=w[o]}else d.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;A(["pagePrev","pageNext"],function(u){var f=u+"DataIndex",d=n[f]!=null,h=a.childOfName(u);h&&(h.setStyle("fill",d?r.get("pageIconColor",!0):r.get("pageIconInactiveColor",!0)),h.cursor=d?"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",ie(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=Pd[o],l=Ld[o],c=this._findTargetItemIndex(n),u=a.children(),f=u[c],d=u.length,h=d?1:0,v={contentPosition:[a.x,a.y],pageCount:h,pageIndex:h-1,pagePrevDataIndex:null,pageNextDataIndex:null};if(!f)return v;var m=x(f);v.contentPosition[o]=-m.s;for(var g=c+1,p=m,y=m,b=null;g<=d;++g)b=x(u[g]),(!b&&y.e>p.s+i||b&&!S(b,p.s))&&(y.i>p.i?p=y:p=b,p&&(v.pageNextDataIndex==null&&(v.pageNextDataIndex=p.i),++v.pageCount)),y=b;for(var g=c-1,p=m,y=m,b=null;g>=-1;--g)b=x(u[g]),(!b||!S(y,b.s))&&p.i<y.i&&(y=p,v.pagePrevDataIndex==null&&(v.pagePrevDataIndex=p.i),++v.pageCount,++v.pageIndex),p=b;return v;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})(ox);function dL(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 vL(t){bn(ux),t.registerComponentModel(fL),t.registerComponentView(hL),dL(t)}function pL(t){bn(ux),bn(vL)}var gL=(function(t){G(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=Ff(Yb.defaultOption,{disabled:!1,zoomLock:!1,zoomOnMouseWheel:!0,moveOnMouseMove:!0,moveOnMouseWheel:!1,preventDefaultMouseMove:!0}),e})(Yb),Rd=Xe();function mL(t,e,r){Rd(t).coordSysRecordMap.each(function(n){var a=n.dataZoomInfoMap.get(e.uid);a&&(a.getRange=r)})}function yL(t,e){for(var r=Rd(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||dx(r,o))}}}function dx(t,e){if(e){t.removeKey(e.model.uid);var r=e.controller;r&&r.dispose()}}function _L(t,e){var r={model:e,containsPoint:qe(xL,e),dispatchAction:qe(bL,t),dataZoomInfoMap:null,controller:null},n=r.controller=new aP(t.getZr());return A(["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 bL(t,e){t.isDisposed()||t.dispatchAction({type:"dataZoom",animation:{easing:"cubicOut",duration:100},batch:e})}function xL(t,e,r,n){return t.coordinateSystem.containPoint([r,n])}function wL(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 SL(t){t.registerProcessor(t.PRIORITY.PROCESSOR.FILTER,function(e,r){var n=Rd(r),a=n.coordSysRecordMap||(n.coordSysRecordMap=fe());a.each(function(i){i.dataZoomInfoMap=null}),e.eachComponent({mainType:"dataZoom",subType:"inside"},function(i){var o=RP(i);A(o.infoList,function(s){var l=s.model.uid,c=a.get(l)||a.set(l,_L(r,s.model)),u=c.dataZoomInfoMap||(c.dataZoomInfoMap=fe());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){dx(a,i);return}var u=wL(l);o.enable(u.controlType,u.opt),o.setPointerChecker(i.containsPoint),ph(i,"dispatchAction",s.model.get("throttle",!0),"fixRate")})})}var kL=(function(t){G(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(),mL(a,r,{pan:Ce(Ed.pan,this),zoom:Ce(Ed.zoom,this),scrollMove:Ce(Ed.scrollMove,this)})},e.prototype.dispose=function(){this._clear(),t.prototype.dispose.apply(this,arguments)},e.prototype._clear=function(){yL(this.api,this.dataZoomModel),this.range=null},e.type="dataZoom.inside",e})(EP),Ed={zoom:function(t,e,r,n){var a=this.range,i=a.slice(),o=t.axisModels[0];if(o){var s=Od[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(bd(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=Od[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=Od[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(bd(l,o,[0,100],"all"),this.range=o,i[0]!==o[0]||i[1]!==o[1])return o}}}var Od={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 TL(t){FP(t),t.registerComponentModel(gL),t.registerComponentView(kL),SL(t)}var CL={label:{enabled:!0},decal:{show:!1}},px=Xe(),ML={};function AL(t,e){var r=t.getModel("aria");if(!r.get("enabled"))return;var n=ye(CL);ke(n.label,t.getLocaleModel().get("aria"),!1),ke(r.option,n,!1),a(),i();function a(){var c=r.getModel("decal"),u=c.get("show");if(u){var f=fe();t.eachSeries(function(d){if(!d.isColorBySeries()){var h=f.get(d.type);h||(h={},f.set(d.type,h)),px(d).scope=h}}),t.eachRawSeries(function(d){if(t.isSeriesFiltered(d))return;if(ge(d.enableAriaDecal)){d.enableAriaDecal();return}var h=d.getData();if(d.isColorBySeries()){var y=sy(d.ecModel,d.name,ML,t.getSeriesCount()),b=h.getVisual("decal");h.setVisual("decal",x(b,y))}else{var v=d.getRawData(),m={},g=px(d).scope;h.each(function(S){var w=h.getRawIndex(S);m[w]=S});var p=v.count();v.each(function(S){var w=m[S],k=v.getName(S)||S+"",T=sy(d.ecModel,k,g,p),M=h.getItemVisual(w,"decal");h.setItemVisual(w,"decal",x(M,T))})}function x(S,w){var k=S?V(V({},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=De(f.option,u),!!f.get("enabled")){if(c.setAttribute("role","img"),f.get("description")){c.setAttribute("aria-label",f.get("description"));return}var d=t.getSeriesCount(),h=f.get(["data","maxCount"])||10,v=f.get(["series","maxCount"])||10,m=Math.min(d,v),g;if(!(d<1)){var p=s();if(p){var y=f.get(["general","withTitle"]);g=o(y,{title:p})}else g=f.get(["general","withoutTitle"]);var b=[],x=d>1?f.get(["series","multiple","prefix"]):f.get(["series","single","prefix"]);g+=o(x,{seriesCount:d}),t.eachSeries(function(T,M){if(M<m){var D=void 0,C=T.get("name"),I=C?"withName":"withoutName";D=d>1?f.get(["series","multiple",I]):f.get(["series","single",I]),D=o(D,{seriesId:T.seriesIndex,seriesName:T.get("name"),seriesType:l(T.subType)});var P=T.getData();if(P.count()>h){var L=f.get(["data","partialData"]);D+=o(L,{displayCnt:h})}else D+=f.get(["data","allData"]);for(var R=f.get(["data","separator","middle"]),N=f.get(["data","separator","end"]),Z=f.get(["data","excludeDimensionId"]),F=[],z=0;z<P.count();z++)if(z<h){var W=P.getName(z),ne=Z?it(P.getValues(z),function(de,be){return Ie(Z,be)===-1}):P.getValues(z),te=f.get(["data",W?"withName":"withoutName"]);F.push(o(te,{name:W,value:ne.join(R)}))}D+=F.join(R)+N,b.push(D)}});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(!ie(c))return c;var f=c;return A(u,function(d,h){f=f.replace(new RegExp("\\{\\s*"+h+"\\s*\\}","g"),d)}),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 DL(t){if(!(!t||!t.aria)){var e=t.aria;e.show!=null&&(e.enabled=e.show),e.label=e.label||{},A(["description","general","series","data"],function(r){e[r]!=null&&(e.label[r]=e[r])})}}function IL(t){t.registerPreprocessor(DL),t.registerVisual(t.PRIORITY.VISUAL.ARIA,AL)}function gx(t,e,r){var n=wa.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 Nd=(function(t){G(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||Es,typeof r=="string"?o=gx(r,n,a):ce(r)&&(o=r,r=o.id),i.id=r,i.dom=o;var s=o.style;return s&&(tp(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=gx("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 Pe(0,0,0,0);function u(y){if(!(!y.isFinite()||y.isZero()))if(o.length===0){var b=new Pe(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 Pe(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 D=y.width*y.height,C=T.width*T.height,I=c.width*c.height,P=I-D-C;P<S&&(S=P,w=k)}}if(l&&(o[w].union(y),x=!0),!x){var b=new Pe(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 d=r[f];if(d){var h=d.shouldBePainted(a,i,!0,!0),v=d.__isRendered&&(d.__dirty&Ot||!h)?d.getPrevPaintRect():null;v&&u(v);var m=h&&(d.__dirty&Ot||!d.__isRendered)?d.getPaintRect():null;m&&u(m)}}for(var f=this.__prevStartIndex;f<this.__prevEndIndex;++f){var d=n[f],h=d&&d.shouldBePainted(a,i,!0,!0);if(d&&(!h||!d.__zr)&&d.__isRendered){var v=d.getPrevPaintRect();v&&u(v)}}var g;do{g=!1;for(var f=0;f<o.length;){if(o[f].isZero()){o.splice(f,1);continue}for(var p=f+1;p<o.length;)o[f].intersect(o[p])?(g=!0,o[f].union(o[p]),o.splice(p,1)):p++;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,d=this;c&&(this.domBack||this.createBackBuffer(),this.ctxBack.globalCompositeOperation="copy",this.ctxBack.drawImage(i,0,0,s/f,l/f));var h=this.domBack;function v(m,g,p,y){if(o.clearRect(m,g,p,y),n&&n!=="transparent"){var b=void 0;if(cs(n)){var x=n.global||n.__width===p&&n.__height===y;b=x&&n.__canvasGradient||Bh(o,n,{x:0,y:0,width:p,height:y}),n.__canvasGradient=b,n.__width=p,n.__height=y}else aw(n)&&(n.scaleX=n.scaleX||f,n.scaleY=n.scaleY||f,b=zh(o,n,{dirty:function(){d.setUnpainted(),d.painter.refresh()}}));o.save(),o.fillStyle=b||n,o.fillRect(m,g,p,y),o.restore()}c&&(o.save(),o.globalAlpha=u,o.drawImage(h,m,g,p,y),o.restore())}!a||c?v(0,0,s,l):a.length&&A(a,function(m){v(m.x*f,m.y*f,m.width*f,m.height*f)})},e})(rr),mx=1e5,ha=314159,vc=.01,PL=.001;function LL(t){return t?t.__builtin__?!0:!(typeof t.resize!="function"||typeof t.refresh!="function"):!1}function RL(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 EL=(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=V({},n||{}),this.dpr=n.devicePixelRatio||Es,this._singleCanvas=i,this.root=e;var o=e.style;o&&(tp(e),e.innerHTML=""),this.storage=r;var s=this._zlevelList;this._prevDisplayList=[];var l=this._layers;if(i){var u=e,f=u.width,d=u.height;n.width!=null&&(f=n.width),n.height!=null&&(d=n.height),this.dpr=n.devicePixelRatio||1,u.width=f*this.dpr,u.height=d*this.dpr,this._width=f,this._height=d;var h=new Nd(u,this,this.dpr);h.__builtin__=!0,h.initContext(),l[ha]=h,h.zlevel=ha,s.push(ha),this._domRoot=e}else{this._width=Kl(e,0,n),this._height=Kl(e,1,n);var c=this._domRoot=RL(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(mx)),i||(i=n.ctx,i.save()),oa(i,s,a,o===r-1))}i&&i.restore()}},t.prototype.getHoverLayer=function(){return this.getLayer(mx)},t.prototype.paintOne=function(e,r){f0(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;Gl(function(){l._paintList(e,r,n,a)})}}},t.prototype._compositeManually=function(){var e=this.getLayer(ha).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,d=function(m){var g=i[m],p=g.ctx,y=o&&g.createRepaintRects(e,r,h._width,h._height),b=n?g.__startIndex:g.__drawIndex,x=!n&&g.incremental&&Date.now,S=x&&Date.now(),w=g.zlevel===h._zlevelList[0]?h._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,M=function(P){var L={inHover:!1,allClipped:!1,prevEl:null,viewWidth:a._width,viewHeight:a._height};for(T=b;T<g.__endIndex;T++){var R=e[T];if(R.__inHover&&(f=!0),a._doPaintEl(R,g,o,P,L,T===g.__endIndex-1),x){var N=Date.now()-S;if(N>15)break}}L.prevElClipPaths&&p.restore()};if(y)if(y.length===0)T=g.__endIndex;else for(var D=h.dpr,C=0;C<y.length;++C){var I=y[C];p.save(),p.beginPath(),p.rect(I.x*D,I.y*D,I.width*D,I.height*D),p.clip(),M(I),p.restore()}else p.save(),M(),p.restore();g.__drawIndex=T,g.__drawIndex<g.__endIndex&&(u=!1)},h=this,v=0;v<i.length;v++)d(v);return he.wxa&&A(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))&&(oa(s,e,i,o),e.setPrevPaintRect(l))}else oa(s,e,i,o)},t.prototype.getLayer=function(e,r){this._singleCanvas&&!this._needsManuallyCompositing&&(e=ha);var n=this._layers[e];return n||(n=new Nd("zr_"+e,this,this.dpr),n.zlevel=e,n.__builtin__=!0,this._layerConfig[e]?ke(n,this._layerConfig[e],!0):this._layerConfig[e-vc]&&ke(n,this._layerConfig[e-vc],!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]&&LL(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,d){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+PL,this._needsManuallyCompositing),u.incremental=!0,o=1):u=this.getLayer(c+(o>0?vc:0),this._needsManuallyCompositing),u.__builtin__||tu("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,d){!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,A(this._layers,function(r){r.setUnpainted()})},t.prototype.configLayer=function(e,r){if(r){var n=this._layerConfig;n[e]?ke(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+vc){var o=this._layers[i];ke(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(Ie(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=Kl(i,0,a),r=Kl(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(ha).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[ha].dom;var r=new Nd("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];oa(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 OL(t){t.registerPainter("canvas",EL)}bn([IL,PM,OL,TL,DP,pL,lM,iL]);const da={background:"#ffffff",border:"#dce4e9",muted:"#5b7186",surface:"#ffffff",text:"#0f1e2a",colors:["#2f7f55","#2563eb","#d97706","#7c3aed"]},yx="cf-widget-category-zoom",_x=.68,ui=t=>({startIndex:0,endIndex:Math.max(0,t-1)}),Do=(t,e)=>{if(e<=0)return ui(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))))}},bx=(t,e,r)=>{let n=Do(t,r);if(r<=2)return ui(r);let a=n.endIndex-n.startIndex+1,i=e==="in"?Math.max(2,Math.floor(a*_x)):Math.min(r,Math.ceil(a/_x));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}},NL=(t,e)=>{let r=t.length;if(r===0)return"No chart points";let n=Do(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`},BL=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},zL=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},Bd=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},pc=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)}`},gc=(t,e)=>e?t.columnMetadata?.find(r=>r.key===e):void 0,zd=(t,e)=>gc(t,e)?.label?.trim()||BL(e),xx=(t,e,r)=>{if(r==null||r==="")return"Not set";let n=gc(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)},Io=(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)},FL=t=>{if(t.presentation==="table"||t.presentation==="kpi")return null;let e=t.chartRecommendation?.type;return e==="line"||e==="bar"||e==="stacked_bar"?e:t.type==="line"||t.type==="bar"||t.type==="stacked_bar"?t.type:null},HL=t=>t.chartRecommendation?.categoryField?.trim()||t.label?.trim()||t.columnMetadata?.find(e=>["date","dimension","geography","boolean"].includes(e.semanticRole))?.key||t.columns?.[0],VL=t=>t.chartRecommendation?.seriesField?.trim()||t.seriesField?.trim()||t.series?.trim()||void 0,GL=(t,e,r)=>{let n=zL([...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=>Bd(o[i])!==null))},WL=(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}: ${Io(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} ${Io(o.value,o.series.valueColumn,t)}.${i}`:`No numeric comparison values are available.${i}`},UL=t=>{let e=FL(t),r=HL(t),n=t.rows??[];if(!e||!r||n.length===0)return null;let a=VL(t),i=GL(t,r,a);if(i.length===0)return null;let o=i.length===1?a:void 0,s=[],l=new Set;n.forEach(v=>{let m=pc(v[r]);l.has(m)||(l.add(m),s.push({key:m,label:xx(t,r,v[r])}))});let c=s.map(v=>v.label),u=0,f;if(o){let v=[],m=new Set;n.forEach(y=>{let b=pc(y[o]);m.has(b)||(m.add(b),v.push({key:b,label:xx(t,o,y[o])}))});let g=v.slice(0,4);u=Math.max(0,v.length-g.length);let p=i[0];f=g.map(y=>{let b=new Map;return n.forEach(x=>{if(pc(x[o])!==y.key)return;let S=pc(x[r]);b.has(S)||b.set(S,Bd(x[p]))}),{field:p,name:y.label,values:s.map(x=>b.get(x.key)??null),valueColumn:gc(t,p)}})}else u=Math.max(0,i.length-4),f=i.slice(0,4).map(v=>({field:v,name:zd(t,v),values:n.map(m=>Bd(m[v])),valueColumn:gc(t,v)}));if(f.length===0)return null;let d=zd(t,r),h="Values";return o?h=zd(t,i[0]):f.length===1&&(h=f[0].name),{type:e,title:t.title?.trim()||`${h} by ${d}`,xAxisTitle:d,yAxisTitle:h,categories:c,series:f,omittedSeriesCount:u,summary:WL(t,e,c,f,u)}},$L=(t,{expanded:e=!1,reducedMotion:r=!1,theme:n=da,zoomWindow:a=ui(t.categories.length)}={})=>{let i=t.series.length>1,o=t.type==="stacked_bar",s=t.categories.length>2,l=Do(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:yx,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=>Io(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=>Io(u,c.valueColumn)}}))}},YL=t=>{let e=getComputedStyle(t),r=(a,i)=>e.getPropertyValue(a).trim()||i,n=r("--cf-accent",da.colors[0]);return{background:r("--cf-bg",da.background),border:r("--cf-border",da.border),muted:r("--cf-muted",da.muted),surface:r("--cf-surface",da.surface),text:r("--cf-text",da.text),colors:[n,"#2563eb","#d97706","#7c3aed"]}},qL=({model:t,expanded:e=!1})=>{let r=$(null),n=$(null),[a,i]=K(()=>({model:t,window:ui(t.categories.length)})),[o,s]=K(!1),l=a.model===t?Do(a.window,t.categories.length):ui(t.categories.length),c=$(l);c.current=l;let u=g=>{let p=Do(g,t.categories.length);c.current=p,i({model:t,window:p}),n.current?.dispatchAction({type:"dataZoom",dataZoomId:yx,startValue:p.startIndex,endValue:p.endIndex})};ve(()=>{let g=r.current;if(!(!g||typeof navigator<"u"&&navigator.userAgent.toLowerCase().includes("jsdom")))try{let p=OD(g,null,{renderer:"canvas",devicePixelRatio:Math.min(window.devicePixelRatio||1,2)});n.current=p;let y=()=>p.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),p.dispose(),n.current=null}}catch{s(!0);return}},[]),ve(()=>{let g=r.current,p=n.current;if(!g||!p)return;let y=typeof matchMedia<"u"&&matchMedia("(prefers-reduced-motion: reduce)").matches;p.setOption($L(t,{expanded:e,reducedMotion:y,theme:YL(g),zoomWindow:c.current}),{lazyUpdate:!0,notMerge:!0}),p.resize()},[e,t]);let f=!o&&t.categories.length>2,d=l.endIndex-l.startIndex+1,h=l.startIndex===0&&l.endIndex===t.categories.length-1,v=f&&d>2,m=f&&!h;return _(Se,{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:NL(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(bx(c.current,"out",t.categories.length)),children:"−"}),_("button",{type:"button",class:"cf-analytics-zoom__reset","aria-label":"Reset chart zoom",title:"Reset zoom",disabled:h,onClick:()=>u(ui(t.categories.length)),children:"Reset"}),_("button",{type:"button","aria-label":"Zoom in chart",title:"Zoom in",disabled:!v,onClick:()=>u(bx(c.current,"in",t.categories.length)),children:"+"})]})]}):null]})},Sx=t=>{let e=t.replaceAll("_"," ").replace(/([a-z])([A-Z])/g,"$1 $2").trim();return e?`${e.charAt(0).toUpperCase()}${e.slice(1)}`:"Value"},kx=(t,e)=>(e?.length?e:Object.keys(t[0]??{})).map(r=>typeof r=="string"?{key:r,label:Sx(r)}:{key:r.key,label:r.label?.trim()||Sx(r.key)}),XL=(t,e)=>t==null||t===""?"—":typeof t=="number"&&Number.isFinite(t)?new Intl.NumberFormat(e,{maximumFractionDigits:4}).format(t):typeof t=="boolean"?t?"Yes":"No":String(t),Tx=t=>{let e=String(t??"");return/[",\r\n]/.test(e)?`"${e.replaceAll('"','""')}"`:e},ZL=(t,e)=>{let r=kx(t,e);return[r.map(n=>Tx(n.label)).join(","),...t.map(n=>r.map(a=>Tx(n[a.key])).join(","))].join(`\r
|
|
23
|
+
`)},KL=({rows:t,columns:e,maxRows:r=6,locale:n,expanded:a=!1,classNames:i,emptyLabel:o="No rows returned."})=>{let s=kx(t,e),l=a?t:t.slice(0,Math.max(1,r));return t.length===0||s.length===0?_("div",{class:i?.note,children:o}):_(Se,{children:[_("div",{class:i?.wrap,role:"region","aria-label":`Result table with ${t.length} ${t.length===1?"row":"rows"}`,tabIndex:0,children:_("table",{class:i?.table,children:[_("caption",{style:"position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)",children:["Result table with ",t.length," ",t.length===1?"row":"rows"]}),_("thead",{children:_("tr",{children:s.map(c=>_("th",{scope:"col",children:c.label},c.key))})}),_("tbody",{children:l.map((c,u)=>_("tr",{children:s.map(f=>_("td",{children:XL(c[f.key],n)},f.key))},u))})]})}),!a&&t.length>l.length?_("div",{class:i?.note,children:["Showing ",l.length," of ",t.length," rows. Expand to view all rows."]}):null]})},jL=["audio/webm;codecs=opus","audio/webm","audio/ogg;codecs=opus","audio/ogg"],Fd=t=>{const e=globalThis.MediaRecorder;if(typeof e?.isTypeSupported=="function"){for(const r of jL)if(e.isTypeSupported(r))try{return new e(t,{mimeType:r})}catch{}}return new e(t)},Pr=t=>{if(!(!t||t.state!=="recording")){try{t.requestData()}catch{}t.stop()}},QL=[{name:"Smileys",emojis:["😀","😃","😄","😁","😅","😂","🤣","😊","😇","🙂","🙃","😉","😌","😍","🥰","😘","😋","😛","😜","🤪","🤗","🤭","🤔","🤐","😐","😶","😏","🙄","😴","🥳","😎","🤓","🥺","😢","😭","😤","😠","🤯","😬","😱","🤩","🥱"]},{name:"Gestures",emojis:["👍","👎","👌","🤌","✌️","🤞","🤟","🤘","🤙","👈","👉","👆","👇","✋","🖐️","👋","🤝","🙏","💪","👏","🙌","👐","🤲","🫶"]},{name:"Hearts & symbols",emojis:["❤️","🧡","💛","💚","💙","💜","🖤","🤍","💔","❣️","💕","💖","💘","💝","✨","⭐","🌟","💫","🔥","🎉","🎊","✅","❌","⚡","💯","🚀"]},{name:"Animals & nature",emojis:["🐶","🐱","🦊","🐻","🐼","🐨","🦁","🐮","🐸","🐵","🐧","🦄","🐝","🦋","🐢","🐬","🌷","🌸","🌹","🌻","🌳","🍀"]},{name:"Food & drink",emojis:["🍎","🍌","🍉","🍓","🍒","🥑","🍔","🍟","🍕","🌮","🍿","🍩","🍪","🎂","☕","🍵","🍺","🥂","🍷"]},{name:"Objects & travel",emojis:["🚀","✈️","🚗","🏠","📦","📱","💻","⌚","📷","💡","🔑","🎁","📌","✏️","📝","📞","📧","💰","📈","⏰","🔔","🎯","🏆","🎮","🎵","💬","👀"]}],Po={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"}]}},Hd={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"},mc=(t,e)=>t.replace(/\{(\w+)\}/g,(r,n)=>e[n]??""),JL=t=>t?{...Hd,...t}:Hd,Cx=D1(Hd),eR=Cx.Provider,Kr=()=>W1(Cx),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}),tR=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"})}),Lo=t=>ze(_("path",{d:"m6 9 6 6 6-6"}),t),rR=t=>ze(_(Se,{children:[_("path",{d:"m22 2-7 20-4-9-9-4Z"}),_("path",{d:"M22 2 11 13"})]}),t),Ro=t=>ze(_(Se,{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),nR=t=>ze(_(Se,{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),yc=t=>ze(_(Se,{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),aR=t=>ze(_(Se,{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),Vd=t=>ze(_(Se,{children:[_("rect",{x:"2",y:"4",width:"20",height:"16",rx:"2"}),_("path",{d:"m22 7-10 5L2 7"})]}),t),iR=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),oR=t=>ze(_(Se,{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(_(Se,{children:[_("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),_("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),t),sR=t=>ze(_(Se,{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=>ze(_(Se,{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),fi=t=>ze(_("path",{d:"M20 6 9 17l-5-5"}),t),cR=t=>ze(_(Se,{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),uR=t=>ze(_(Se,{children:[_("path",{d:"M1 4v6h6"}),_("path",{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"})]}),t),fR=t=>ze(_("rect",{x:"6",y:"6",width:"12",height:"12",rx:"2"}),t),Gd=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),Wd=t=>ze(_(Se,{children:[_("path",{d:"M18.36 6.64a9 9 0 1 1-12.73 0"}),_("line",{x1:"12",y1:"2",x2:"12",y2:"12"})]}),t),hR=t=>ze(_(Se,{children:[_("circle",{cx:"12",cy:"12",r:"9"}),_("path",{d:"M12 7v5l3 2"})]}),t),Mx=t=>ze(_(Se,{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),Ax=t=>ze(_(Se,{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),Ud=t=>ze(_(Se,{children:[_("path",{d:"M15 3h6v6"}),_("path",{d:"M9 21H3v-6"}),_("path",{d:"M21 3l-7 7"}),_("path",{d:"M3 21l7-7"})]}),t),dR=t=>ze(_(Se,{children:[_("path",{d:"M9 3v6H3"}),_("path",{d:"M15 21v-6h6"}),_("path",{d:"M9 9 2 2"}),_("path",{d:"M15 15l7 7"})]}),t),vR=t=>ze(_(Se,{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),pR=t=>ze(_(Se,{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),gR=t=>ze(_(Se,{children:[_("line",{x1:"12",y1:"5",x2:"12",y2:"19"}),_("path",{d:"m19 12-7 7-7-7"})]}),t),Dx=/(`[^`]+`)|(\*\*[^*]+\*\*)|(\[[^\]]+\]\(https?:\/\/[^\s)]+\))|(https?:\/\/[^\s)]+)/g,_c=t=>{const e=[];let r=0,n=0,a;for(Dx.lastIndex=0;(a=Dx.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},mR=/^(```|#{1,6}\s|\s*[-*]\s|\s*\d+\.\s)/,yR=t=>{const e=t.replace(/\r\n/g,`
|
|
6
24
|
`).split(`
|
|
7
|
-
`),
|
|
8
|
-
`)})},o++));continue}if(a.trim()===""){i++;continue}const s=/^(#{1,6})\s+(.*)$/.exec(a);if(s){n.push(r("div",{class:"cf-md-h",children:et(s[2])},o++)),i++;continue}if(/^\s*[-*]\s+/.test(a)){const f=[];for(;i<e.length&&/^\s*[-*]\s+/.test(e[i]);)f.push(r("li",{children:et(e[i].replace(/^\s*[-*]\s+/,""))},f.length)),i++;n.push(r("ul",{class:"cf-md-list",children:f},o++));continue}if(/^\s*\d+\.\s+/.test(a)){const f=[];for(;i<e.length&&/^\s*\d+\.\s+/.test(e[i]);)f.push(r("li",{children:et(e[i].replace(/^\s*\d+\.\s+/,""))},f.length)),i++;n.push(r("ol",{class:"cf-md-list",children:f},o++));continue}const d=[a];for(i++;i<e.length&&e[i].trim()!==""&&!po.test(e[i]);)d.push(e[i]),i++;n.push(r("p",{children:et(d.join(" "))},o++))}return n},fn=()=>{const t=J(null);return B(()=>{const e=requestAnimationFrame(()=>t.current?.scrollIntoView({block:"end"}));return()=>cancelAnimationFrame(e)},[]),t},_o=t=>t.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"🤖",un=({persona:t,small:e})=>{const n=e?"cf-msg__avatar":"cf-header__avatar";return t?.agentAvatarUrl?r("span",{class:n,children:r("img",{src:t.agentAvatarUrl,alt:""})}):r("span",{class:n,children:t?_o(t.agentName):"·"})},bo=()=>{const t=le();return r("div",{class:"cf-msg__bubble cf-typing","aria-label":t.assistantTyping,children:[r("span",{class:"cf-typing__dot"}),r("span",{class:"cf-typing__dot"}),r("span",{class:"cf-typing__dot"})]})},go=3,vo=({msg:t})=>{if(!t.sources||t.sources.length===0)return null;const e=new Set,n=[];for(const a of t.sources){const s=(a.url||a.title||"").toLowerCase();!s||e.has(s)||(e.add(s),n.push(a))}if(n.length===0)return null;const o=n.slice(0,go),i=n.length-o.length;return r("div",{class:"cf-sources",children:[o.map((a,s)=>a.url?r("a",{class:"cf-source",href:a.url,target:"_blank",rel:"noopener noreferrer nofollow",title:a.title||a.url,children:[r(vt,{}),r("span",{children:a.title||a.url})]},s):r("span",{class:"cf-source",title:a.title,children:[r(vt,{}),r("span",{children:a.title})]},s)),i>0&&r("span",{class:"cf-source cf-source--more",children:["+",i," more"]})]})},xo=({replies:t,onPick:e})=>t&&t.length>0?r("div",{class:"cf-chips",children:t.map((n,o)=>r("button",{type:"button",class:"cf-chip",onClick:()=>e(n),children:n},o))}):null,yo={public_book_demo:{type:"book-demo",label:"Book a demo",Icon:no},public_submit_inquiry:{type:"inquiry",label:"Leave a message",Icon:an},public_request_callback:{type:"request-callback",label:"Request a callback",Icon:oo},public_subscribe_newsletter:{type:"subscribe-newsletter",label:"Subscribe",Icon:an}},ko=({field:t,value:e,onInput:n})=>{const o=t.placeholder??t.label,i={class:"cf-form__input",placeholder:t.required?`${o} *`:o,value:e,"aria-label":t.label,onInput:a=>n(a.target.value)};return t.kind==="textarea"?r("textarea",{rows:2,...i}):r("input",{type:t.kind,...i})},wo=({spec:t,visitor:e,onSubmit:n,onCancel:o})=>{const i=le(),a=fn(),[s,d]=C(()=>{const y={};for(const b of t.fields)b.identity&&e[b.identity]&&(y[b.key]=e[b.identity]);return y}),[f,l]=C("idle"),[u,c]=C(""),x=y=>!!(y.identity&&e[y.identity]?.trim()),m=t.fields.filter(y=>!x(y)),g=m.every(y=>!y.required||(s[y.key]?.trim()??"")!==""),O=e.email||e.name||"",w=async()=>{if(!g||f==="submitting")return;l("submitting");const y={},b={};for(const I of t.fields){const H=s[I.key]?.trim();H&&(y[I.key]=H,I.identity&&(b[I.identity]=H))}try{const I=await n(y,b);c(I.note||i.formThanks),l("done")}catch{l("error")}};return f==="done"?r("div",{class:"cf-form cf-form--done",children:[r(Qe,{}),r("span",{children:u})]}):r("div",{class:"cf-form",ref:a,children:[r("div",{class:"cf-form__title",children:t.title}),m.length===0&&O&&r("div",{class:"cf-form__as",children:["as ",O]}),m.map(y=>r(ko,{field:y,value:s[y.key]??"",onInput:b=>d(I=>({...I,[y.key]:b}))},y.key)),f==="error"&&r("div",{class:"cf-form__err",children:i.formError}),r("div",{class:"cf-form__actions",children:[o&&r("button",{type:"button",class:"cf-form__cancel",onClick:o,children:"Cancel"}),r("button",{type:"button",class:"cf-form__submit",disabled:!g||f==="submitting",onClick:w,children:f==="submitting"?i.sending:t.submit})]})]})},hn=t=>String(t).padStart(2,"0"),Co=()=>{const t=[];for(let e=9;e<=17;e++)t.push(`${hn(e)}:00`),t.push(`${hn(e)}:30`);return t},So=t=>{const e=new Date;return e.setHours(0,0,0,0),Array.from({length:t},(n,o)=>{const i=new Date(e);return i.setDate(e.getDate()+o),i})},Ao=(t,e)=>{const[n,o]=e.split(":").map(Number),i=new Date(t.getFullYear(),t.getMonth(),t.getDate(),n??0,o??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(i)}catch{return`${t.toDateString()} ${e}`}},Me=(t,e)=>{const[n,o]=e.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),n??0,o??0)},Io=({visitor:t,onSubmit:e,onCancel:n,onDemoSlots:o,scheduler:i})=>{const a=le(),s=fn(),d=Ne(()=>So(14),[]),f=Ne(()=>Co(),[]),l=Ne(()=>{const A=Date.now();for(let h=0;h<d.length;h++)if(f.some(v=>Me(d[h],v).getTime()>A))return h;return 0},[d,f]),[u,c]=C(l),[x,m]=C(null),[g,O]=C(t.name??""),[w,y]=C(t.email??""),[b,I]=C("idle"),[H,G]=C(""),[X,V]=C(""),[K,$]=C(""),j=i?.connected&&i.mode==="link",oe=async()=>{if(b==="submitting"||!t.email?.trim()&&!w.trim())return;I("submitting"),V("");const A={};w.trim()&&(A.email=w.trim()),g.trim()&&(A.name=g.trim());try{const h=await e({...w.trim()?{visitorEmail:w.trim()}:{},...g.trim()?{visitorName:g.trim()}:{}},A),v=h.booking?.schedulingLink||i?.bookingLink||"";if(!v){I("error");return}try{window.open(v,"_blank","noopener,noreferrer")}catch{}$(v),G(h.note||a.bookingLinkOpened),I("done")}catch{I("error")}},[fe,ue]=C(new Set),[ge,he]=C([]),[re,L]=C(0),[pe,S]=C(!1);B(()=>{if(!o)return;let A=!0;const h=new Date,v=new Date;return v.setDate(v.getDate()+15),o(h.toISOString(),v.toISOString()).then(k=>{A&&(ue(new Set(k.taken.map(_=>Date.parse(_)).filter(_=>!Number.isNaN(_)))),he(k.busy.map(_=>[Date.parse(_.start),Date.parse(_.end)]).filter(([_,E])=>!Number.isNaN(_)&&!Number.isNaN(E))))}).catch(()=>{}),()=>{A=!1}},[o,re]);const N=!!t.email?.trim(),z=!!x&&(N||w.trim()!==""),Z=t.email||t.name||"",Y=A=>fe.has(Me(d[u],A).getTime()),me=A=>Me(d[u],A).getTime()<=Date.now(),ve=1800*1e3,Se=A=>{const h=Me(d[u],A).getTime(),v=h+ve;return ge.some(([k,_])=>h<_&&v>k)},_e=async()=>{if(!z||b==="submitting"||!x)return;I("submitting"),S(!1),V("");const A=Me(d[u],x),h=Ao(d[u],x),v={};w.trim()&&(v.email=w.trim()),g.trim()&&(v.name=g.trim());try{const k=await e({preferredAt:h,slotAt:A.toISOString(),...w.trim()?{visitorEmail:w.trim()}:{},...g.trim()?{visitorName:g.trim()}:{}},v);k.booking?.confirmed?(G(k.note||Xe(a.bookingConfirmed,{when:h})),$(k.booking.meetingUrl||k.booking.eventLink||"")):G(k.note||Xe(a.bookingRequested,{when:h})),I("done")}catch(k){if(k?.status===409)ue(_=>new Set(_).add(A.getTime())),m(null),S(!0),L(_=>_+1),I("idle");else{const _=k?.message;V(_&&_.length<120?_:""),I("error")}}};return b==="done"?r("div",{class:"cf-form cf-form--done",children:[r(Qe,{}),r("span",{children:H}),K&&r("a",{class:"cf-booking__link",href:K,target:"_blank",rel:"noopener noreferrer",children:[j?a.bookingOpenScheduler:a.bookingMeetingLink," ",r(vt,{})]})]}):j?r("div",{class:"cf-form cf-booking",ref:s,children:[r("div",{class:"cf-form__title",children:Ze["book-demo"].title}),r("div",{class:"cf-booking__hint",children:Xe(a.bookingViaProvider,{provider:i?.label??"the scheduler"})}),N?Z?r("div",{class:"cf-form__as",children:["as ",Z]}):null:r(R,{children:[r("input",{class:"cf-form__input",type:"text",placeholder:a.handoffName,value:g,"aria-label":a.handoffName,onInput:A=>O(A.target.value)}),r("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:w,"aria-label":a.handoffEmail,onInput:A=>y(A.target.value)})]}),b==="error"&&r("div",{class:"cf-form__err",children:X||a.formError}),r("div",{class:"cf-form__actions",children:[n&&r("button",{type:"button",class:"cf-form__cancel",onClick:n,children:a.cancel}),r("button",{type:"button",class:"cf-form__submit",disabled:b==="submitting"||!N&&w.trim()==="",onClick:oe,children:b==="submitting"?a.sending:a.bookingOpenScheduler})]})]}):r("div",{class:"cf-form cf-booking",ref:s,children:[r("div",{class:"cf-form__title",children:Ze["book-demo"].title}),r("div",{class:"cf-booking__hint",children:[a.bookingPickTime," · ",r("span",{class:"cf-booking__dur",children:a.bookingDuration})]}),r("div",{class:"cf-booking__dates",role:"tablist","aria-label":"Pick a day",children:d.map((A,h)=>r("button",{type:"button",role:"tab","aria-selected":h===u,class:`cf-booking__date ${h===u?"is-selected":""}`,onClick:()=>{c(h),m(null)},children:[r("span",{class:"cf-booking__dow",children:A.toLocaleDateString(void 0,{weekday:"short"})}),r("span",{class:"cf-booking__dom",children:A.getDate()})]},h))}),r("div",{class:"cf-booking__slots",role:"listbox","aria-label":"Pick a time",children:f.map(A=>{const h=me(A),v=Se(A),k=Y(A),_=k||h||v;return r("button",{type:"button",role:"option","aria-selected":x===A,disabled:_,title:h?"Earlier today":v?"Busy on the calendar":k?"Already booked":void 0,class:`cf-booking__slot ${x===A?"is-selected":""} ${_?"is-taken":""}`,onClick:()=>m(A),children:A},A)})}),pe&&r("div",{class:"cf-form__err",children:a.bookingSlotTaken}),N?Z?r("div",{class:"cf-form__as",children:["as ",Z]}):null:r(R,{children:[r("input",{class:"cf-form__input",type:"text",placeholder:a.handoffName,value:g,"aria-label":a.handoffName,onInput:A=>O(A.target.value)}),r("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:w,"aria-label":a.handoffEmail,onInput:A=>y(A.target.value)})]}),b==="error"&&r("div",{class:"cf-form__err",children:X||a.formError}),r("div",{class:"cf-form__actions",children:[n&&r("button",{type:"button",class:"cf-form__cancel",onClick:n,children:a.cancel}),r("button",{type:"button",class:"cf-form__submit",disabled:!z||b==="submitting",onClick:_e,children:b==="submitting"?a.sending:Ze["book-demo"].submit})]})]})},To=({actions:t,visitor:e,onSubmitForm:n,onDemoSlots:o,scheduler:i,exclude:a=[]})=>{const[s,d]=C(null),f=(t??[]).map(l=>yo[l]).filter(l=>!!l&&!a.includes(l.type));return f.length===0?null:s==="book-demo"?r(Io,{visitor:e,onCancel:()=>d(null),onSubmit:(l,u)=>n("book-demo",l,u),onDemoSlots:o,scheduler:i}):s?r(wo,{spec:Ze[s],visitor:e,onCancel:()=>d(null),onSubmit:(l,u)=>n(s,l,u)}):r("div",{class:"cf-actions",children:f.map(({type:l,label:u,Icon:c})=>r("button",{type:"button",class:"cf-action",onClick:()=>d(l),children:[r(c,{}),u]},l))})},Eo=({hasEmail:t,visitor:e,question:n,onSubmitForm:o})=>{const i=le(),[a,s]=C(!1),[d,f]=C(!1),[l,u]=C(e.name??""),[c,x]=C(e.email??"");if(t)return null;if(a){const g=e.email||c;return r("div",{class:"cf-handoff cf-handoff--done",children:[r(Qe,{}),r("span",{children:Xe(i.handoffShared,{email:g})})]})}const m=async()=>{if(!(!c.trim()||d)){f(!0);try{await o("inquiry",{visitorEmail:c.trim(),...l.trim()?{visitorName:l.trim()}:{},message:n||"I had a question the assistant couldn’t answer.",subject:"Help request from chat"},{email:c.trim(),name:l.trim()||void 0}),s(!0)}catch{f(!1)}}};return r("div",{class:"cf-handoff",children:[r("div",{class:"cf-handoff__title",children:i.handoffTitle}),r("input",{class:"cf-form__input",type:"text",placeholder:i.handoffName,value:l,"aria-label":i.handoffName,onInput:g=>u(g.target.value)}),r("input",{class:"cf-form__input",type:"email",placeholder:`${i.handoffEmail} *`,value:c,"aria-label":i.handoffEmail,onInput:g=>x(g.target.value)}),r("button",{type:"button",class:"cf-form__submit",disabled:!c.trim()||d,onClick:m,children:d?i.sending:i.handoffNotify})]})},No=({text:t})=>{const e=le(),[n,o]=C(!1);return r("button",{type:"button",class:"cf-tool",onClick:async()=>{try{await navigator.clipboard.writeText(t),o(!0),setTimeout(()=>o(!1),1500)}catch{}},"aria-label":e.copy,children:[n?r(Qe,{}):r(so,{}),n?e.copied:e.copy]})},Mo=({items:t,onPick:e})=>t.length===0?null:r("div",{class:"cf-starters",children:t.map((n,o)=>r("button",{type:"button",class:"cf-starter",onClick:()=>e(n),children:n},o))}),Po=({msg:t,onRate:e})=>{const n=le(),[o,i]=C(!1),[a,s]=C(""),d=t.feedback,f=()=>{e(t.id,"up"),i(!1)},l=()=>{e(t.id,"down"),i(!0)},u=()=>{e(t.id,"down",a.trim()),i(!1)};return r("div",{class:"cf-feedback",children:[r("div",{class:"cf-feedback__row",children:[r("button",{type:"button",class:`cf-feedback__btn ${d==="up"?"is-active":""}`,"aria-label":n.feedbackHelpful,"aria-pressed":d==="up",onClick:f,children:r(cn,{})}),r("button",{type:"button",class:`cf-feedback__btn ${d==="down"?"is-active":""}`,"aria-label":n.feedbackNotHelpful,"aria-pressed":d==="down",onClick:l,children:r(ln,{})}),d&&!o&&r("span",{class:"cf-feedback__thanks",children:n.feedbackThanks})]}),o&&d==="down"&&r("div",{class:"cf-feedback__comment",children:[r("textarea",{class:"cf-feedback__input",rows:2,placeholder:n.feedbackCommentPlaceholder,value:a,onInput:c=>s(c.target.value)}),r("button",{type:"button",class:"cf-feedback__send",onClick:u,children:n.feedbackSend})]})]})},$o=({msg:t,persona:e,isLast:n,visitor:o,hasEmail:i,lastQuestion:a,showActions:s,onPickReply:d,onSubmitForm:f,onDemoSlots:l,onRetry:u,ratable:c,onRate:x})=>{const m=le(),g=t.role==="user",O=t.requestedContactFields?.includes("email")===!0,w=n&&!g&&!!(t.handoffOffered||O),y=w&&!i?["inquiry"]:[],b=!t.pending&&!t.streaming;return r("div",{class:`cf-msg cf-msg--${g?"user":"agent"}`,children:[!g&&r(un,{persona:e,small:!0}),r("div",{class:"cf-msg__col",children:[t.pending&&t.content===""?r(bo,{}):t.imageUrl?r("div",{class:"cf-msg__bubble cf-msg__bubble--media",children:[r("img",{class:"cf-msg__media",src:t.imageUrl,alt:"GIF"}),t.content&&r("span",{class:"cf-msg__caption",children:t.content})]}):r("div",{class:"cf-msg__bubble",children:[g?t.content:mo(t.content),t.streaming&&r("span",{class:"cf-caret","aria-hidden":"true"})]}),g&&t.attachmentName&&r("div",{class:"cf-attach-chip",title:t.attachmentName,children:[r(xt,{}),r("span",{children:t.attachmentName})]}),!g&&r(R,{children:[b&&(t.error||t.content)&&r("div",{class:"cf-msg__tools",children:t.error?r("button",{type:"button",class:"cf-tool",onClick:()=>u(t.id,t.retryText??""),children:[r(co,{}),m.retry]}):r(No,{text:t.content})}),b&&c&&!t.error&&t.content&&r(Po,{msg:t,onRate:x}),r(vo,{msg:t}),n&&r(xo,{replies:t.suggestedReplies,onPick:d}),w&&r(Eo,{hasEmail:i,visitor:o,question:a,onSubmitForm:f}),s&&r(To,{actions:t.availableActions,visitor:o,onSubmitForm:f,onDemoSlots:l,scheduler:e?.scheduler,exclude:y})]})]})]})},pn=t=>new Promise((e,n)=>{const o=new FileReader;o.onload=()=>e(String(o.result).split(",")[1]??""),o.onerror=n,o.readAsDataURL(t)}),Do=({onPick:t})=>r("div",{class:"cf-picker cf-emoji",children:Yn.map(e=>r("div",{class:"cf-emoji__group",children:[r("div",{class:"cf-emoji__label",children:e.name}),r("div",{class:"cf-emoji__grid",children:e.emojis.map((n,o)=>r("button",{type:"button",class:"cf-emoji__btn",onClick:()=>t(n),"aria-label":n,children:n},o))})]},e.name))}),Oo=({onSearch:t,onPick:e})=>{const n=le(),[o,i]=C(""),[a,s]=C([]),[d,f]=C(!0);return B(()=>{let l=!0;f(!0);const u=setTimeout(()=>{t(o).then(c=>l&&(s(c),f(!1))).catch(()=>l&&(s([]),f(!1)))},300);return()=>{l=!1,clearTimeout(u)}},[o,t]),r("div",{class:"cf-picker cf-gif",children:[r("input",{class:"cf-gif__search",placeholder:n.searchGifs,value:o,"aria-label":n.searchGifs,onInput:l=>i(l.target.value)}),r("div",{class:"cf-gif__grid",children:d?r("div",{class:"cf-gif__hint",children:n.searchingGifs}):a.length===0?r("div",{class:"cf-gif__hint",children:n.noGifs}):a.map(l=>r("button",{type:"button",class:"cf-gif__item",onClick:()=>e(l.url),"aria-label":l.alt,children:r("img",{src:l.preview,alt:l.alt,loading:"lazy"})},l.id))}),r("div",{class:"cf-gif__powered",children:"via Tenor"})]})},zo=8*1024*1024,Ro="image/png,image/jpeg,image/webp,image/gif,application/pdf",Ho=({onSend:t,onSendGif:e,disabled:n,allowVoice:o,onTranscribe:i,gifEnabled:a,onSearchGifs:s,allowAttach:d,onExtract:f})=>{const l=le(),[u,c]=C(""),[x,m]=C(!1),[g,O]=C("none"),[w,y]=C(null),[b,I]=C(!1),[H,G]=C(""),X=J(null),V=J(null),K=J(null),$=J(null),j=J([]);B(()=>{const S=X.current;S&&(S.style.height="auto",S.style.height=`${Math.min(S.scrollHeight,110)}px`)},[u]),B(()=>{if(g==="none")return;const S=N=>{V.current&&!N.composedPath().includes(V.current)&&O("none")};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[g]);const oe=S=>O(N=>N===S?"none":S),fe=S=>{const N=X.current;if(!N){c(Y=>Y+S);return}const z=N.selectionStart??u.length,Z=N.selectionEnd??u.length;c(u.slice(0,z)+S+u.slice(Z)),requestAnimationFrame(()=>{N.focus();const Y=z+S.length;N.setSelectionRange(Y,Y)})},ue=S=>{O("none"),e(S)},ge=async S=>{const N=S.target,z=N.files?.[0];if(N.value="",!!z){if(G(""),z.size>zo){G(l.attachTooLarge);return}I(!0);try{const Z=await pn(z),Y=await f(Z,z.type||"application/octet-stream",z.name);if(!Y){G(l.attachFailed);return}y({name:z.name,text:Y})}catch{G(l.attachFailed)}finally{I(!1)}}},he=(!!u.trim()||!!w)&&!n&&!b,re=()=>{he&&(t(u,w?{attachmentName:w.name,attachmentText:w.text}:void 0),c(""),y(null),G(""))},L=S=>{S.key==="Enter"&&!S.shiftKey?(S.preventDefault(),re()):S.key==="Escape"&&g!=="none"&&(S.preventDefault(),S.stopPropagation(),O("none"))},pe=async()=>{if(x){$.current?.stop();return}try{const S=await navigator.mediaDevices.getUserMedia({audio:!0}),N=new MediaRecorder(S);j.current=[],N.ondataavailable=z=>z.data.size>0&&j.current.push(z.data),N.onstop=async()=>{S.getTracks().forEach(Z=>Z.stop()),m(!1);const z=new Blob(j.current,{type:N.mimeType||"audio/webm"});try{const Z=await pn(z),Y=await i(Z,z.type);Y&&c(me=>me?`${me} ${Y}`:Y)}catch{}},$.current=N,N.start(),m(!0)}catch{const S=await i("","audio/webm").catch(()=>"");S&&c(N=>N?`${N} ${S}`:S)}};return r("div",{class:"cf-composer",ref:V,children:[g==="emoji"&&r(Do,{onPick:fe}),g==="gif"&&r(Oo,{onSearch:s,onPick:ue}),(w||b||H)&&r("div",{class:"cf-attach-row",children:b?r("span",{class:"cf-attach-status",children:l.attaching}):H?r("span",{class:"cf-attach-status cf-attach-status--err",children:H}):w&&r("span",{class:"cf-attach-chip",title:w.name,children:[r(xt,{}),r("span",{children:w.name}),r("button",{type:"button",class:"cf-attach-x","aria-label":"Remove attachment",onClick:()=>y(null),children:r(sn,{})})]})}),r("div",{class:"cf-composer__field",children:[r("button",{type:"button",class:`cf-iconbtn ${g==="emoji"?"is-active":""}`,"aria-label":l.emoji,"aria-pressed":g==="emoji",onClick:()=>oe("emoji"),children:g==="emoji"?r(sn,{}):r(ro,{})}),a&&r("button",{type:"button",class:`cf-iconbtn cf-gifbtn ${g==="gif"?"is-active":""}`,"aria-label":l.gifs,"aria-pressed":g==="gif",onClick:()=>oe("gif"),children:r("span",{class:"cf-gif-label",children:"GIF"})}),d&&r(R,{children:[r("input",{ref:K,type:"file",class:"cf-file-input",accept:Ro,onChange:ge,tabIndex:-1,"aria-hidden":"true"}),r("button",{type:"button",class:"cf-iconbtn","aria-label":l.attachFile,disabled:b,onClick:()=>K.current?.click(),children:r(xt,{})})]}),r("textarea",{ref:X,class:"cf-textarea",rows:1,placeholder:l.composerPlaceholder,value:u,"aria-label":l.composerPlaceholder,disabled:n,onInput:S=>c(S.target.value),onKeyDown:L}),o&&r("button",{type:"button",class:`cf-iconbtn cf-mic ${x?"is-recording":""}`,"aria-label":x?l.stopRecording:l.recordVoice,"aria-pressed":x,onClick:pe,children:r(to,{})}),r("button",{type:"button",class:"cf-send","aria-label":l.send,disabled:!he,onClick:re,children:r(eo,{})})]})]})};let mn=!0,Pe=null;const Uo=t=>{mn=t},jo=()=>{const t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;if(!Pe)try{Pe=new t}catch{return null}return Pe.state==="suspended"&&Pe.resume(),Pe},$e=(t,e,n,o,i,a)=>{const s=t.createOscillator(),d=t.createGain();s.type=i,s.frequency.setValueAtTime(e,n),s.connect(d),d.connect(t.destination),d.gain.setValueAtTime(1e-4,n),d.gain.exponentialRampToValueAtTime(a,n+.012),d.gain.exponentialRampToValueAtTime(1e-4,n+o),s.start(n),s.stop(n+o+.03)},De=t=>{if(!mn)return;const e=jo();if(!e)return;const n=e.currentTime;try{t==="open"?($e(e,523,n,.12,"sine",.05),$e(e,784,n+.08,.16,"sine",.05)):t==="send"?$e(e,660,n,.08,"triangle",.04):t==="receive"&&($e(e,880,n,.1,"sine",.045),$e(e,1175,n+.09,.14,"sine",.045))}catch{}},ne=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,Lo=t=>{try{return t==="none"?null:t==="session"?sessionStorage:localStorage}catch{return null}},tt=t=>`centrinfo:session:${t.slice(0,12)}`,yt=t=>`centrinfo:visitor:${t.slice(0,12)}`,_n=(t,e)=>`centrinfo:chat:${t.slice(0,12)}:${e}`,kt=t=>`centrinfo:history:${t.slice(0,12)}`,bn=20,gn=720*60*60*1e3,Bo=1440*60*1e3,qo=(t,e)=>{try{return JSON.parse(t?.getItem(yt(e))||"{}")}catch{return{}}},Fo=(t,e)=>{if(!t)return ne();try{const n=tt(e),o=t.getItem(n);if(o)return o;const i=ne();return t.setItem(n,i),i}catch{return ne()}},vn=(t,e,n)=>{if(!t)return{};try{const o=t.getItem(_n(e,n));return o?JSON.parse(o):{}}catch{return{}}},xn=(t,e,n)=>{const{ts:o,messages:i}=vn(t,e,n);return!Array.isArray(i)||typeof o=="number"&&Date.now()-o>gn?[]:i},Wo=(t,e,n)=>{const{ts:o,messages:i,ended:a}=vn(t,e,n);return!Array.isArray(i)||i.length===0||typeof o=="number"&&Date.now()-o>gn?!1:a===!0||typeof o=="number"&&Date.now()-o>Bo},Go=(t,e,n,o,i)=>{if(t)try{const a=o.filter(s=>!s.pending).slice(-50);if(a.length===0)return;t.setItem(_n(e,n),JSON.stringify({ts:Date.now(),messages:a,ended:i}))}catch{}},Vo=(t,e)=>{if(!t)return[];try{const n=t.getItem(kt(e)),o=n?JSON.parse(n):[];return Array.isArray(o)?o:[]}catch{return[]}},Ko=(t,e,n)=>{if(t)try{t.setItem(kt(e),JSON.stringify(n.slice(0,bn)))}catch{}},Jo=(t,e)=>{if(t)try{const n=`centrinfo:chat:${e.slice(0,12)}:`,o=new Set([tt(e),yt(e),kt(e)]),i=[];for(let a=0;a<t.length;a++){const s=t.key(a);s&&(o.has(s)||s.startsWith(n))&&i.push(s)}i.forEach(a=>t.removeItem(a))}catch{}},Yo=t=>{const o=(t.find(i=>i.role==="user"&&i.content.trim())?.content||t.find(i=>i.content.trim())?.content||"").trim().replace(/\s+/g," ");return o.length>60?o.slice(0,60)+"…":o||"Conversation"},Zo=(t,e)=>{const n=J(Lo(e.persistence)).current,o=J(Fo(n,e.token)),i=J(null),[a,s]=C(null),[d,f]=C(()=>xn(n,e.token,o.current)),[l,u]=C(!1),[c,x]=C(()=>Wo(n,e.token,o.current)),[m,g]=C(()=>qo(n,e.token)),[O,w]=C(()=>Vo(n,e.token)),[y,b]=C(null),[I,H]=C([]),G=J(m);B(()=>{G.current=m},[m]);const X=M(()=>{i.current?.abort(),Jo(n,e.token);const h=ne();o.current=h;try{n?.setItem(tt(e.token),h)}catch{}b(null),H([]),x(!1),w([]),g({}),f(a?[{id:ne(),role:"assistant",content:a.greeting,availableActions:a.availableActions}]:[])},[n,e.token,a]),V=M(h=>{try{n?.setItem(yt(e.token),JSON.stringify(h))}catch{}},[n,e.token]),K=M(h=>{const v=(h.email??"").trim().toLowerCase(),k=(G.current.email??"").trim().toLowerCase();v&&k&&v!==k&&X();const _={};h.email?.trim()&&(_.email=h.email.trim()),h.phone?.trim()&&(_.phone=h.phone.trim());const D=[h.firstName,h.lastName].filter(q=>!!q?.trim()).join(" ").trim()||h.name?.trim()||"";D&&(_.name=D),Object.keys(_).length>0&&g(q=>{const xe={..._,...q};return V(xe),xe}),t.identify(o.current,h).catch(()=>{})},[t,V,X]);B(()=>{let h=!0;return t.bootstrap().then(v=>{h&&(s(v),f(k=>k.length>0?k:[{id:ne(),role:"assistant",content:v.greeting,availableActions:v.availableActions}]))}),e.user&&K(e.user),()=>{h=!1}},[]),B(()=>{Go(n,e.token,o.current,d,c)},[d,c,n,e.token]),B(()=>{d.some(v=>v.role==="user")&&w(v=>{const k=o.current,E=[{sessionId:k,ts:Date.now(),title:Yo(d),ended:c},...v.filter(D=>D.sessionId!==k)];return Ko(n,e.token,E),E.slice(0,bn)})},[d,c,n,e.token]);const $=M((h,v)=>{f(k=>k.map(_=>_.id===h?{..._,...v}:_))},[]),j=M((h,v)=>{u(!0);const k=new AbortController;i.current=k,t.stream(h,o.current,{signal:k.signal,onChunk:_=>f(E=>E.map(D=>D.id===v?{...D,content:D.content+_,pending:!1,streaming:!0}:D))}).then(_=>{f(E=>E.map(D=>D.id===v?{...D,content:_.answer||D.content||e.strings.emptyReply,pending:!1,streaming:!1,error:!1,retryText:void 0,sources:_.sources,suggestedReplies:_.suggestedReplies,availableActions:_.availableActions,handoffOffered:_.handoffOffered,requestedContactFields:_.requestedContactFields}:D)),De("receive"),e.onMessage?.({role:"assistant",content:_.answer}),_.handoffOffered&&e.onHandoff?.(),_.conversationEnded&&x(!0)}).catch(_=>{if(k.signal.aborted){$(v,{pending:!1,streaming:!1});return}const E=_?.status===429?e.strings.errorRateLimit:e.strings.errorGeneric;$(v,{content:E,pending:!1,streaming:!1,error:!0,retryText:h})}).finally(()=>{u(!1),i.current=null})},[t,e,$]),oe=M((h,v={})=>{const k=h.trim(),{imageUrl:_,attachmentName:E,attachmentText:D}=v;if(!k&&!_&&!D||l||c)return;let q=k;if(D){const Oe=E?` "${E}"`:"";q=`${k}
|
|
25
|
+
`),r=[];let n=0,a=0;for(;a<e.length;){const i=e[a];if(i.trim().startsWith("```")){const l=[];for(a++;a<e.length&&!e[a].trim().startsWith("```");)l.push(e[a]),a++;a++,r.push(_("pre",{class:"cf-md-pre",children:_("code",{children:l.join(`
|
|
26
|
+
`)})},n++));continue}if(i.trim()===""){a++;continue}const o=/^(#{1,6})\s+(.*)$/.exec(i);if(o){r.push(_("div",{class:"cf-md-h",children:_c(o[2])},n++)),a++;continue}if(/^\s*[-*]\s+/.test(i)){const l=[];for(;a<e.length&&/^\s*[-*]\s+/.test(e[a]);)l.push(_("li",{children:_c(e[a].replace(/^\s*[-*]\s+/,""))},l.length)),a++;r.push(_("ul",{class:"cf-md-list",children:l},n++));continue}if(/^\s*\d+\.\s+/.test(i)){const l=[];for(;a<e.length&&/^\s*\d+\.\s+/.test(e[a]);)l.push(_("li",{children:_c(e[a].replace(/^\s*\d+\.\s+/,""))},l.length)),a++;r.push(_("ol",{class:"cf-md-list",children:l},n++));continue}const s=[i];for(a++;a<e.length&&e[a].trim()!==""&&!mR.test(e[a]);)s.push(e[a]),a++;r.push(_("p",{children:_c(s.join(" "))},n++))}return r},_R=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)}`},bR=t=>t?.name?.trim()?t.version?`${t.name.trim()} · v${t.version}`:t.name.trim():"",xR=({model:t,answeredAt:e,reportingPeriod:r,filters:n=[],rowCount:a})=>{const i=bR(t);return _("div",{class:"cf-analytics-meta","data-testid":"analytics-result-meta","aria-label":"Result details",children:[i?_("span",{class:"cf-analytics-meta__model",children:i}):null,_("span",{children:[_("span",{"aria-hidden":"true",class:"cf-analytics-meta__dot"}),_R(e)]}),r?.label?_("span",{children:r.label}):null,typeof a=="number"?_("span",{children:[a," ",a===1?"row":"rows"]}):null,n.length>0?_("span",{children:[n.length," applied ",n.length===1?"filter":"filters"]}):null]})},wR=({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]}),SR=({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})]}),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:[_("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."})]}),Ix=()=>{const t=$(null);return ve(()=>{const e=requestAnimationFrame(()=>t.current?.scrollIntoView({block:"end"}));return()=>cancelAnimationFrame(e)},[]),t},TR=t=>t.trim().split(/\s+/).slice(0,2).map(e=>e[0]?.toUpperCase()??"").join("")||"🤖",Eo=t=>{const e=t?.avatarId?.trim().toLowerCase().replace(/[^a-z0-9-]/g,"-");return e?` cf-avatar-preset--${e}`:""},CR={"support-guide":"SG","sales-host":"SH","calm-advisor":"CA","technical-guide":"TG","school-desk":"SD","front-office":"FO"},bc=t=>{const e=t?.avatarId?.trim().toLowerCase();return e&&CR[e]||(t?TR(t.agentName):"·")},$d=({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}${Eo(t)}`,children:bc(t)})},MR=()=>{const t=Kr();return _("div",{class:"cf-msg__bubble cf-typing","aria-label":t.assistantTyping,children:[_("span",{class:"cf-typing__label",children:"Thinking"}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"}),_("span",{class:"cf-typing__dot"})]})},AR=3,DR=({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,AR),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:[_(yc,{}),_("span",{children:i.title||i.url})]},o):_("span",{class:"cf-source",title:i.title,children:[_(yc,{}),_("span",{children:i.title})]},o)),a>0&&_("span",{class:"cf-source cf-source--more",children:["+",a," more"]})]})},IR=({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,PR=({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:d=!1,micLevel:h=0,theaterMode:v=!1,onToggleTheater:m,onMinimize:g,audioDevices:p=[],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),D=i!=="idle",C=i!=="idle"?"End voice chat":`Speak with ${t.agentName}`,I=s&&!D&&!a,P=i==="connecting"||i==="processing"||D&&o,L=["cf-assistant-card__stage","cf-assistant-card__stage--local",D?"is-live":"",P?"is-thinking":"",i==="listening"&&!l?"is-listening":"",a||i==="speaking"?"is-speaking":"",l?"is-muted":""].filter(Boolean).join(" "),R=i==="listening"&&!l?{"--cf-listen":String(Math.max(.18,Math.min(1,h*8)))}:void 0,N=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${Eo(t)}`,children:bc(t)}),N]}),_("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 Z=D&&u&&_(eE,{voiceState:i,muted:l,onToggleMute:c??(()=>{}),onEndCall:u,onTalkNow:f??(()=>{}),showTalkNow:d,micLevel:h,theaterMode:v,onToggleTheater:m??(()=>{}),onMinimize:g??(()=>{}),audioDevices:p,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:_(Ro,{})}),_("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:L,style:R,children:[_("div",{class:`cf-assistant-card__media ${k?"cf-assistant-card__media--uploaded":"cf-assistant-card__media--generated"}${Eo(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${Eo(t)}`,children:_("div",{class:"cf-assistant-card__face",children:[_("span",{class:"cf-assistant-card__initials",children:bc(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",{})]})]}),N,t.allowVoiceInput&&(Z||_("button",{type:"button",class:"cf-assistant-card__speak",onClick:n,children:[_(Ro,{}),C]}))]}),!s&&_(Se,{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(F=>_("button",{type:"button",class:"cf-assistant-card__chip",onClick:()=>r(F),children:F},F))}),t.disclaimerText||t.assistantPrivacyUrl?_("p",{class:"cf-assistant-card__privacy",children:[t.disclaimerText||"This chat may be recorded for quality and support.",t.assistantPrivacyUrl?_(Se,{children:[" ",_("a",{href:t.assistantPrivacyUrl,target:"_blank",rel:"noopener noreferrer nofollow",children:"Privacy Policy"})]}):null]}):null]})]})},LR={public_book_demo:{type:"book-demo",label:"Book a demo",description:"Pick a time or request a demo from the team.",Icon:aR},public_submit_inquiry:{type:"inquiry",label:"Leave a message",description:"Send your question and contact details.",Icon:Vd},public_request_callback:{type:"request-callback",label:"Request a callback",description:"Share your phone number and best time to call.",Icon:iR},public_subscribe_newsletter:{type:"subscribe-newsletter",label:"Subscribe",description:"Get product updates and useful announcements.",Icon:Vd}},RR=({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})},ER=({spec:t,visitor:e,onSubmit:r,onCancel:n})=>{const a=Kr(),i=Ix(),[o,s]=K(()=>{const p={};for(const y of t.fields)y.identity&&e[y.identity]&&(p[y.key]=e[y.identity]);return p}),[l,c]=K("idle"),[u,f]=K(""),d=p=>!!(p.identity&&e[p.identity]?.trim()),h=t.fields.filter(p=>!d(p)),v=h.every(p=>!p.required||(o[p.key]?.trim()??"")!==""),m=e.email||e.name||"",g=async()=>{if(!v||l==="submitting")return;c("submitting");const p={},y={};for(const b of t.fields){const x=o[b.key]?.trim();x&&(p[b.key]=x,b.identity&&(y[b.identity]=x))}try{const b=await r(p,y);f(b.note||a.formThanks),c("done")}catch{c("error")}};return l==="done"?_("div",{class:"cf-form cf-form--done",children:[_(fi,{}),_("span",{children:u})]}):_("div",{class:"cf-form",ref:i,children:[_("div",{class:"cf-form__title",children:t.title}),h.length===0&&m&&_("div",{class:"cf-form__as",children:["as ",m]}),h.map(p=>_(RR,{field:p,value:o[p.key]??"",onInput:y=>s(b=>({...b,[p.key]:y}))},p.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:!v||l==="submitting",onClick:g,children:l==="submitting"?a.sending:t.submit})]})]})},Px=t=>String(t).padStart(2,"0"),OR=()=>{const t=[];for(let e=9;e<=17;e++)t.push(`${Px(e)}:00`),t.push(`${Px(e)}:30`);return t},NR=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})},BR=(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}`}},Oo=(t,e)=>{const[r,n]=e.split(":").map(Number);return new Date(t.getFullYear(),t.getMonth(),t.getDate(),r??0,n??0)},zR=({visitor:t,onSubmit:e,onCancel:r,onDemoSlots:n,scheduler:a})=>{const i=Kr(),o=Ix(),s=xa(()=>NR(14),[]),l=xa(()=>OR(),[]),c=xa(()=>{const X=Date.now();for(let le=0;le<s.length;le++)if(l.some(Y=>Oo(s[le],Y).getTime()>X))return le;return 0},[s,l]),[u,f]=K(c),[d,h]=K(null),[v,m]=K(t.name??""),[g,p]=K(t.email??""),[y,b]=K("idle"),[x,S]=K(""),[w,k]=K(""),[T,M]=K(""),D=a?.connected&&a.mode==="link",C=async()=>{if(y==="submitting"||!t.name?.trim()&&!v.trim()||!t.email?.trim()&&!g.trim())return;b("submitting"),k("");const X={};g.trim()&&(X.email=g.trim()),v.trim()&&(X.name=v.trim());try{const le=await e({...g.trim()?{visitorEmail:g.trim()}:{},...v.trim()?{visitorName:v.trim()}:{}},X),Y=le.booking?.schedulingLink||a?.bookingLink||"";if(!Y){b("error");return}try{window.open(Y,"_blank","noopener,noreferrer")}catch{}M(Y),S(le.note||i.bookingLinkOpened),b("done")}catch{b("error")}},[I,P]=K(new Set),[L,R]=K([]),[N,Z]=K(0),[F,z]=K(!1);ve(()=>{if(!n)return;let X=!0;const le=new Date,Y=new Date;return Y.setDate(Y.getDate()+15),n(le.toISOString(),Y.toISOString()).then(q=>{X&&(P(new Set(q.taken.map(B=>Date.parse(B)).filter(B=>!Number.isNaN(B)))),R(q.busy.map(B=>[Date.parse(B.start),Date.parse(B.end)]).filter(([B,j])=>!Number.isNaN(B)&&!Number.isNaN(j))))}).catch(()=>{}),()=>{X=!1}},[n,N]);const W=!!t.email?.trim(),ne=!!t.name?.trim(),te=!!d&&(ne||v.trim()!=="")&&(W||g.trim()!==""),de=t.email||t.name||"",be=X=>I.has(Oo(s[u],X).getTime()),xe=X=>Oo(s[u],X).getTime()<=Date.now(),et=1800*1e3,at=X=>{const le=Oo(s[u],X).getTime(),Y=le+et;return L.some(([q,B])=>le<B&&Y>q)},Ye=async()=>{if(!te||y==="submitting"||!d)return;b("submitting"),z(!1),k("");const X=Oo(s[u],d),le=BR(s[u],d),Y={};g.trim()&&(Y.email=g.trim()),v.trim()&&(Y.name=v.trim());try{const q=await e({preferredAt:le,slotAt:X.toISOString(),...g.trim()?{visitorEmail:g.trim()}:{},...v.trim()?{visitorName:v.trim()}:{}},Y);q.booking?.confirmed?(S(q.note||mc(i.bookingConfirmed,{when:le})),M(q.booking.meetingUrl||q.booking.eventLink||"")):S(q.note||mc(i.bookingRequested,{when:le})),b("done")}catch(q){if(q?.status===409)P(B=>new Set(B).add(X.getTime())),h(null),z(!0),Z(B=>B+1),b("idle");else{const B=q?.message;k(B&&B.length<120?B:""),b("error")}}};return y==="done"?_("div",{class:"cf-form cf-form--done",children:[_(fi,{}),_("span",{children:x}),T&&_("a",{class:"cf-booking__link",href:T,target:"_blank",rel:"noopener noreferrer",children:[D?i.bookingOpenScheduler:i.bookingMeetingLink," ",_(yc,{})]})]}):D?_("div",{class:"cf-form cf-booking",ref:o,children:[_("div",{class:"cf-form__title",children:Po["book-demo"].title}),_("div",{class:"cf-booking__hint",children:mc(i.bookingViaProvider,{provider:a?.label??"the scheduler"})}),W?de?_("div",{class:"cf-form__as",children:["as ",de]}):null:_(Se,{children:[!t.name?.trim()&&_("input",{class:"cf-form__input",type:"text",placeholder:`${i.handoffName} *`,value:v,"aria-label":i.handoffName,onInput:X=>m(X.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${i.handoffEmail} *`,value:g,"aria-label":i.handoffEmail,onInput:X=>p(X.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()&&v.trim()===""||!W&&g.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:Po["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((X,le)=>_("button",{type:"button",role:"tab","aria-selected":le===u,class:`cf-booking__date ${le===u?"is-selected":""}`,onClick:()=>{f(le),h(null)},children:[_("span",{class:"cf-booking__dow",children:X.toLocaleDateString(void 0,{weekday:"short"})}),_("span",{class:"cf-booking__dom",children:X.getDate()})]},le))}),_("div",{class:"cf-booking__slots",role:"listbox","aria-label":"Pick a time",children:l.map(X=>{const le=xe(X),Y=at(X),q=be(X),B=q||le||Y;return _("button",{type:"button",role:"option","aria-selected":d===X,disabled:B,title:le?"Earlier today":Y?"Busy on the calendar":q?"Already booked":void 0,class:`cf-booking__slot ${d===X?"is-selected":""} ${B?"is-taken":""}`,onClick:()=>h(X),children:X},X)})}),F&&_("div",{class:"cf-form__err",children:i.bookingSlotTaken}),de?_("div",{class:"cf-form__as",children:["as ",de]}):null,!ne&&_("input",{class:"cf-form__input",type:"text",placeholder:`${i.handoffName} *`,value:v,"aria-label":i.handoffName,onInput:X=>m(X.target.value)}),!W&&_(Se,{children:_("input",{class:"cf-form__input",type:"email",placeholder:`${i.handoffEmail} *`,value:g,"aria-label":i.handoffEmail,onInput:X=>p(X.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:!te||y==="submitting",onClick:Ye,children:y==="submitting"?i.sending:Po["book-demo"].submit})]})]})},Lx=({actions:t,visitor:e,onSubmitForm:r,onDemoSlots:n,scheduler:a,exclude:i=[]})=>{const[o,s]=K(null),[l,c]=K(!1),u=(t??[]).map(h=>LR[h]).filter(h=>!!h&&!i.includes(h.type));if(u.length===0)return null;const f=()=>{s(null),c(!1)},d=()=>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:d,children:_(kn,{})})]}),_(zR,{visitor:e,onCancel:d,onSubmit:(h,v)=>r("book-demo",h,v),onDemoSlots:n,scheduler:a})]});if(o){const h=u.find(v=>v.type===o);return _("div",{class:"cf-action-drawer is-open",role:"dialog","aria-label":h?.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:h?.label??Po[o].title})]}),_("button",{type:"button",class:"cf-action-drawer__close",onClick:d,children:_(kn,{})})]}),_(ER,{spec:Po[o],visitor:e,onCancel:d,onSubmit:(v,m)=>r(o,v,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:h,label:v,description:m,Icon:g})=>_("button",{type:"button",class:"cf-action-card",onClick:()=>s(h),children:[_("span",{class:"cf-action-card__icon",children:_(g,{})}),_("span",{class:"cf-action-card__copy",children:[_("strong",{children:v}),_("small",{children:m})]}),_(Lo,{})]},h))}),_("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:_(Vd,{})}),_("span",{class:"cf-action-trigger__copy",children:[_("strong",{children:"Contact options"}),_("small",{children:"Demo, message, callback"})]}),_(Lo,{})]})},FR=({hasEmail:t,visitor:e,question:r,onSubmitForm:n})=>{const a=Kr(),[i,o]=K(!1),[s,l]=K(!1),[c,u]=K(e.name??""),[f,d]=K(e.email??"");if(t)return _("div",{class:"cf-handoff cf-handoff--done",children:[_(fi,{}),_("span",{children:"We’ve alerted the team. If someone is available, they can continue here."})]});if(i){const v=e.email||f;return _("div",{class:"cf-handoff cf-handoff--done",children:[_(fi,{}),_("span",{children:mc(a.handoffShared,{email:v})})]})}const h=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:v=>u(v.target.value)}),_("input",{class:"cf-form__input",type:"email",placeholder:`${a.handoffEmail} *`,value:f,"aria-label":a.handoffEmail,onInput:v=>d(v.target.value)}),_("button",{type:"button",class:"cf-form__submit",disabled:!f.trim()||s,onClick:h,children:s?a.sending:a.handoffNotify})]})},HR=({text:t})=>{const e=Kr(),[r,n]=K(!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?_(fi,{}):_(cR,{}),r?e.copied:e.copy]})},VR=({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))}),GR=({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:[_(yc,{}),_("span",{children:r.label})]},`${r.url}-${n}`))})},WR=({msg:t,onRate:e})=>{const r=Kr(),[n,a]=K(!1),[i,o]=K(""),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:_(Mx,{})}),_("button",{type:"button",class:`cf-feedback__btn ${s==="down"?"is-active":""}`,"aria-label":r.feedbackNotHelpful,"aria-pressed":s==="down",onClick:c,children:_(Ax,{})}),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})]})]})},UR=({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:d,onExpandVisualization:h})=>{const v=Kr(),m=t.role==="user",g=t.role==="system",p=t.requestedContactFields?.includes("email")===!0,y=r&&!m&&!g&&!!(t.handoffOffered||p),b=y&&!a?["inquiry"]:[],x=!t.pending&&!t.streaming;return g?_("div",{class:"cf-msg cf-msg--system",children:_("div",{class:"cf-system-event",children:[_("div",{class:"cf-system-event__mark",children:_($d,{persona:e,small:!0})}),_("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&&_($d,{persona:e,small:!0}),_("div",{class:"cf-msg__col",children:[t.pending&&t.content===""?_(MR,{}):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:yR(t.content),t.streaming&&_("span",{class:"cf-caret","aria-hidden":"true"})]}),!m&&t.visualization?_(Rx,{visualization:t.visualization,onExpand:h?()=>h(t.id):void 0,expandControlId:t.id}):null,!m&&t.visualization?.explanation?_(kR,{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:[_(Gd,{}),_("span",{children:t.attachmentName})]}),!m&&_(Se,{children:[x&&(t.error||t.content)&&_("div",{class:"cf-msg__tools",children:t.error?_("button",{type:"button",class:"cf-tool",onClick:()=>u(t.id,t.retryText??""),children:[_(uR,{}),v.retry]}):_(HR,{text:t.content})}),x&&f&&!t.error&&t.content&&_(WR,{msg:t,onRate:d}),_(DR,{msg:t}),r&&_(IR,{replies:t.suggestedReplies,onPick:s}),y&&_(FR,{hasEmail:a,visitor:n,question:i,onSubmitForm:l}),o&&_(Lx,{actions:t.availableActions,visitor:n,onSubmitForm:l,onDemoSlots:c,scheduler:e?.scheduler,exclude:b})]})]})]})},Rx=({visualization:t,expanded:e=!1,onExpand:r,onClose:n,expandControlId:a})=>{const i=xa(()=>UL(t),[t]),o=t.rows??[],s=t.columns??[];if(o.length===0)return _(SR,{});const l=_(xR,{model:t.model,answeredAt:t.freshness?.answeredAt,reportingPeriod:t.reportingPeriod,filters:t.appliedFilters,rowCount:t.rowCount??o.length});if(t.presentation==="table"||!t.presentation&&t.type==="table")return!t.tableAvailable||s.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"}),l]}),_("div",{class:"cf-analytics-visualization__actions",children:[t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Ex(s,o),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:_(Ud,{})}):null]})]}),_(KL,{rows:o,columns:s,maxRows:5,expanded:e,classNames:{wrap:"cf-analytics-table-wrap",table:"cf-analytics-table",note:"cf-analytics-table-note"}})]});const c=t.chartRecommendation?.valueFields?.[0]??t.valueFields?.[0]??t.value??s[1];if(t.presentation==="kpi"||!t.presentation&&t.type==="kpi"){const u=o[0]?.[c??s[0]??""],f=typeof u=="number"?u:Number(u),d=t.columnMetadata?.find(v=>v.key===c),h=Number.isFinite(f)?Io(f,d,t):String(u??"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"}),l]}),e&&n?_("button",{type:"button",class:"cf-analytics-visualization__close","aria-label":"Restore assistant view",onClick:n,children:_(kn,{})}):null]}),_(wR,{label:d?.label??c??"Current value",value:h,detail:t.explanation?.summary})]})}return i?_("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:i.title}),l]}),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:_(Ud,{})}):null]}),_(qL,{model:i,expanded:e}),_("p",{class:"cf-analytics-chart__summary",children:i.summary}),t.downloadAvailable?_("button",{type:"button",class:"cf-analytics-visualization__download",onClick:()=>Ex(s,o),children:"Download this data"}):null]}):null},Ex=(t,e)=>{if(typeof document>"u"||t.length===0)return;const r=ZL(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)},Ox=t=>new Promise((e,r)=>{const n=new FileReader;n.onload=()=>e(String(n.result).split(",")[1]??""),n.onerror=r,n.readAsDataURL(t)}),$R=({onPick:t})=>_("div",{class:"cf-picker cf-emoji",children:QL.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))}),YR=({onSearch:t,onPick:e})=>{const r=Kr(),[n,a]=K(""),[i,o]=K([]),[s,l]=K(!0);return ve(()=>{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,XR="image/png,image/jpeg,image/webp,image/gif,application/pdf",ZR=12e3,KR=250,jR=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""}},QR=.004,Nx=({muted:t,listening:e,micLevel:r,onToggleMute:n})=>{const a=e&&r>=QR;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?_(nR,{}):_(Ro,{})})},JR=({audioDevices:t,selectedAudioDeviceId:e,onSelectAudioDevice:r})=>{const[n,a]=K(!1),i=$(null);ve(()=>{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:_(Lo,{})}),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?_(fi,{}):_("span",{class:"cf-call-menu__spacer"}),_("span",{children:s.label})]},s.deviceId))]})]})},eE=({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:d})=>_("div",{class:"cf-call-controls",children:[_(Nx,{muted:e,listening:t==="listening"&&!e,micLevel:o,onToggleMute:r}),_(JR,{audioDevices:u,selectedAudioDeviceId:f,onSelectAudioDevice:d}),i&&_("button",{type:"button",class:"cf-call-btn cf-call-btn--talk","aria-label":"Talk now",onClick:a,children:_(Ro,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":s?"Exit expanded view":"Expand view","aria-pressed":s,onClick:l,children:s?_(dR,{}):_(Ud,{})}),_("button",{type:"button",class:"cf-call-btn","aria-label":"Minimize voice chat",onClick:c,children:_(vR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:n,children:_(Wd,{})})]}),tE=({persona:t,voiceState:e,muted:r,onToggleMute:n,onEndCall:a,micLevel:i,onExpand:o})=>{const s=d=>d.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:d=>{(d.key==="Enter"||d.key===" ")&&(d.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${Eo(t)}`,children:[_("span",{children:bc(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:[_(Nx,{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:d=>{s(d),o()},children:_(pR,{})}),_("button",{type:"button",class:"cf-call-btn cf-call-btn--end","aria-label":"End voice chat",onClick:d=>{s(d),a()},children:_(Wd,{})})]})]})},rE=({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 d=Kr(),[h,v]=K(""),[m,g]=K(!1),[p,y]=K(!1),[b,x]=K("idle"),[S,w]=K("none"),[k,T]=K(null),[M,D]=K(!1),[C,I]=K(""),P=$(null),L=$(null),R=$(null),N=$(null),Z=$([]),F=$(void 0),z=$(null),W=$(void 0),ne=$(0),te=B=>{x(B),f?.(B)},de=()=>{F.current&&window.clearTimeout(F.current),F.current=void 0,W.current&&cancelAnimationFrame(W.current),W.current=void 0,z.current?.close().catch(()=>{}),z.current=null};ve(()=>{const B=P.current;B&&(B.style.height="auto",B.style.height=`${Math.min(B.scrollHeight,110)}px`)},[h]),ve(()=>{if(S==="none")return;const B=j=>{L.current&&!j.composedPath().includes(L.current)&&w("none")};return document.addEventListener("mousedown",B),()=>document.removeEventListener("mousedown",B)},[S]);const be=B=>w(j=>j===B?"none":B),xe=B=>{const j=P.current;if(!j){v(tt=>tt+B);return}const Te=j.selectionStart??h.length,Ne=j.selectionEnd??h.length;v(h.slice(0,Te)+B+h.slice(Ne)),requestAnimationFrame(()=>{j.focus();const tt=Te+B.length;j.setSelectionRange(tt,tt)})},et=B=>{w("none"),e(B)},at=async B=>{const j=B.target,Te=j.files?.[0];if(j.value="",!!Te){if(I(""),Te.size>qR){I(d.attachTooLarge);return}D(!0);try{const Ne=await Ox(Te),tt=await c(Ne,Te.type||"application/octet-stream",Te.name);if(!tt){I(d.attachFailed);return}T({name:Te.name,text:tt})}catch{I(d.attachFailed)}finally{D(!1)}}},Ye=(!!h.trim()||!!k)&&!n&&!M&&!p,X=()=>{Ye&&(t(h,k?{attachmentName:k.name,attachmentText:k.text}:void 0),r?.(!1),v(""),T(null),I(""))},le=B=>{const j=B.trim();if(!j||n){te("misunderstood"),window.setTimeout(()=>te("idle"),2500);return}const Te=h.trim(),Ne=Te?`${Te} ${j}`:j;t(Ne),r?.(!1),v(""),T(null),I(""),te("idle")},Y=B=>{B.key==="Enter"&&!B.shiftKey?(B.preventDefault(),X()):B.key==="Escape"&&S!=="none"&&(B.preventDefault(),B.stopPropagation(),w("none"))},q=async()=>{if(m){Pr(N.current);return}try{te("connecting");const B=await navigator.mediaDevices.getUserMedia({audio:!0}),j=Fd(B);Z.current=[],ne.current=0;try{const Te=window.AudioContext??window.webkitAudioContext;if(Te){const Ne=new Te;z.current=Ne;const tt=Ne.createMediaStreamSource(B),fr=Ne.createAnalyser();fr.fftSize=512,tt.connect(fr);const er=new Uint8Array(fr.frequencyBinCount),It=()=>{fr.getByteTimeDomainData(er);let Pt=0;for(const jr of er){const Ft=(jr-128)/128;Pt+=Ft*Ft}ne.current=Math.max(ne.current,Math.sqrt(Pt/er.length)),W.current=requestAnimationFrame(It)};It()}}catch{}j.ondataavailable=Te=>Te.data.size>0&&Z.current.push(Te.data),j.onstop=async()=>{de(),B.getTracks().forEach(Ne=>Ne.stop()),g(!1);const Te=new Blob(Z.current,{type:j.mimeType||"audio/webm"});if(Te.size===0||Te.size<900||ne.current<.006){te("noise"),window.setTimeout(()=>te("idle"),3200);return}y(!0),te("processing");try{const Ne=await Ox(Te);if(!Ne.trim()){te("noise"),window.setTimeout(()=>te("idle"),3200);return}const tt=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0,fr=await i(Ne,Te.type,tt);le(fr)}catch{te("misunderstood"),window.setTimeout(()=>te("idle"),3e3)}finally{y(!1)}},N.current=j,j.start(KR),g(!0),te("listening"),F.current=window.setTimeout(()=>{Pr(N.current)},ZR)}catch{te("denied"),window.setTimeout(()=>te("idle"),3500)}};return ve(()=>{!u||!a||n||m||p||q()},[u]),ve(()=>()=>de(),[]),_("div",{class:"cf-composer",ref:L,children:[S==="emoji"&&_($R,{onPick:xe}),S==="gif"&&_(YR,{onSearch:s,onPick:et}),(k||M||C)&&_("div",{class:"cf-attach-row",children:M?_("span",{class:"cf-attach-status",children:d.attaching}):C?_("span",{class:"cf-attach-status cf-attach-status--err",children:C}):k&&_("span",{class:"cf-attach-chip",title:k.name,children:[_(Gd,{}),_("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":""}`}),jR(b)]}),_("div",{class:"cf-composer__field",children:[_("button",{type:"button",class:`cf-iconbtn ${S==="emoji"?"is-active":""}`,"aria-label":d.emoji,"aria-pressed":S==="emoji",onClick:()=>be("emoji"),children:S==="emoji"?_(kn,{}):_(oR,{})}),o&&_("button",{type:"button",class:`cf-iconbtn cf-gifbtn ${S==="gif"?"is-active":""}`,"aria-label":d.gifs,"aria-pressed":S==="gif",onClick:()=>be("gif"),children:_("span",{class:"cf-gif-label",children:"GIF"})}),l&&_(Se,{children:[_("input",{ref:R,type:"file",class:"cf-file-input",accept:XR,onChange:at,tabIndex:-1,"aria-hidden":"true"}),_("button",{type:"button",class:"cf-iconbtn","aria-label":d.attachFile,disabled:M,onClick:()=>R.current?.click(),children:_(Gd,{})})]}),_("textarea",{ref:P,class:"cf-textarea",rows:1,placeholder:d.composerPlaceholder,value:h,"aria-label":d.composerPlaceholder,disabled:n,onInput:B=>{const j=B.target.value;v(j),r?.(!!j.trim())},onKeyDown:Y}),a&&_("button",{type:"button",class:`cf-iconbtn cf-mic ${m?"is-recording":""}`,"aria-label":m?d.stopRecording:d.recordVoice,"aria-pressed":m,disabled:p||n,onClick:q,children:_(Ro,{})}),_("button",{type:"button",class:"cf-send","aria-label":d.send,disabled:!Ye,onClick:X,children:_(rR,{})})]})]})};let Bx=!0,No=null;const nE=t=>{Bx=t},aE=()=>{const t=typeof window<"u"?window.AudioContext??window.webkitAudioContext:void 0;if(!t)return null;if(!No)try{No=new t}catch{return null}return No.state==="suspended"&&No.resume(),No},Bo=(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)},hi=t=>{if(!Bx)return;const e=aE();if(!e)return;const r=e.currentTime;try{t==="open"?(Bo(e,523,r,.12,"sine",.05),Bo(e,784,r+.08,.16,"sine",.05)):t==="send"?Bo(e,660,r,.08,"triangle",.04):t==="receive"&&(Bo(e,880,r,.1,"sine",.045),Bo(e,1175,r+.09,.14,"sine",.045))}catch{}},iE=/!?\[([^\]]+)\]\((https?:\/\/[^\s)]+)\)/g,oE=/https?:\/\/[^\s)]+/g,sE=t=>t.replace(/```[\s\S]*?```/g,e=>e.replace(/^```[^\n]*\n?/,"").replace(/```$/,"").trim()),lE=t=>sE(t).replace(iE,"$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(oE,e=>e.replace(/^https?:\/\//,"").replace(/^www\./,"").replace(/\/$/,"")).replace(/[ \t]+\n/g,`
|
|
27
|
+
`).replace(/\n{3,}/g,`
|
|
9
28
|
|
|
10
|
-
[Attached file${Oe}]:
|
|
11
|
-
${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_,attachmentName:E},ye=ne();f(Oe=>[...Oe,xe,{id:ye,role:"assistant",content:"",pending:!0}]),De("send"),e.onMessage?.({role:"user",content:q}),j(q,ye)},[l,c,e,j]),fe=M(()=>i.current?.abort(),[]),ue=M((h,v)=>{l||c||!v||($(h,{content:"",pending:!0,streaming:!1,error:!1}),De("send"),j(v,h))},[l,c,$,j]),ge=M((h,v,k)=>{$(h,{feedback:v});const _=d.findIndex(q=>q.id===h),E=_>=0?d[_]?.content:void 0;let D;for(let q=_-1;q>=0;q--)if(d[q]?.role==="user"){D=d[q]?.content;break}t.sendFeedback({sessionId:o.current,messageId:h,rating:v,comment:k,question:D,answer:E}).catch(()=>{})},[t,$,d]),he=M(async(h,v,k={})=>{e.onAction?.(h);const _=await t.action(h,{sessionId:o.current,...v}),E={};return k.name?.trim()&&(E.name=k.name.trim()),k.email?.trim()&&(E.email=k.email.trim()),k.phone?.trim()&&(E.phone=k.phone.trim()),Object.keys(E).length>0&&(g(D=>{const q={...D,...E};return V(q),q}),E.email&&h!=="contact"&&t.action("contact",{sessionId:o.current,...E}).catch(()=>{})),De("receive"),_},[t,e,V]),re=M(h=>{const v=h.trim();v&&f(k=>k.some(_=>_.role==="assistant"&&_.content===v)?k:[...k,{id:ne(),role:"assistant",content:v}])},[]),L=M((h,v)=>{t.sendFeedback({sessionId:o.current,messageId:"__csat__",rating:h,comment:v}).catch(()=>{})},[t]),pe=M((h,v)=>t.transcribe(h,v),[t]),S=M((h,v,k)=>t.extract(h,v,k),[t]),N=M(h=>t.searchGifs(h),[t]),z=M((h,v)=>t.demoSlots(h,v),[t]),Z=M(h=>oe("",{imageUrl:h}),[oe]),Y=e.demo||!!e.gifApiKey,me=M(()=>{i.current?.abort(),x(!0),t.endConversation(o.current).catch(()=>{})},[t]),ve=M(()=>{i.current?.abort();const h=ne();o.current=h;try{n?.setItem(tt(e.token),h)}catch{}b(null),H([]),x(!1),f(a?[{id:ne(),role:"assistant",content:a.greeting,availableActions:a.availableActions}]:[])},[n,e.token,a]),Se=M(h=>{if(h===o.current){b(null);return}H(xn(n,e.token,h)),b(h)},[n,e.token]),_e=M(()=>{b(null),H([])},[]),A=e.starters.length>0?e.starters:a?.starterQuestions??[];return{persona:a,messages:d,sending:l,visitor:m,starters:A,hasEmail:!!m.email,send:oe,sendGif:Z,stop:fe,retry:ue,rateMessage:ge,injectAssistant:re,submitCsat:L,submitForm:he,transcribe:pe,extract:S,searchGifs:N,demoSlots:z,gifEnabled:Y,identify:K,ended:c,endConversation:me,startNew:ve,history:O,viewingSessionId:y,viewMessages:I,openConversation:Se,closeHistoryView:_e,shutdown:X}},Xo=t=>{const[e,n]=C("light");return B(()=>{if(t!=="auto"||typeof matchMedia>"u")return;const o=matchMedia("(prefers-color-scheme: dark)"),i=()=>n(o.matches?"dark":"light");return i(),o.addEventListener("change",i),()=>o.removeEventListener("change",i)},[t]),t==="auto"?e:t},Qo=({transport:t,config:e,bindControls:n})=>{const o=e.strings,{persona:i,messages:a,sending:s,visitor:d,hasEmail:f,starters:l,send:u,sendGif:c,stop:x,retry:m,rateMessage:g,injectAssistant:O,submitCsat:w,submitForm:y,transcribe:b,extract:I,searchGifs:H,demoSlots:G,gifEnabled:X,identify:V,ended:K,endConversation:$,startNew:j,history:oe,viewingSessionId:fe,viewMessages:ue,openConversation:ge,closeHistoryView:he,shutdown:re}=Zo(t,e),[L,pe]=C(e.openByDefault),[S,N]=C(0),[z,Z]=C(()=>{try{return localStorage.getItem("centrinfo:muted")==="1"}catch{return!1}}),Y=Xo(e.theme);B(()=>{Uo(e.sound&&!z)},[e.sound,z]);const me=M(()=>{Z(p=>{const P=!p;try{localStorage.setItem("centrinfo:muted",P?"1":"0")}catch{}return P})},[]),ve=J(null),Se=J(null),_e=J(null),A=J(0),[h,v]=C(!0),[k,_]=C(!1),[E,D]=C(!1),q=J(null),[xe,ye]=C(!1),[Oe,Cn]=C(!1),ie=!!fe,ot=ie?ue:a,ze=M(()=>{pe(!0),N(0),De("open"),e.onOpen?.(),e.onShow?.()},[e]),ke=M(()=>{pe(!1),e.onClose?.(),e.onHide?.(),Se.current?.focus()},[e]),Re=M(()=>L?ke():ze(),[L,ze,ke]),cr=M(()=>D(!0),[]),lr=M(()=>{$(),D(!1)},[$]),dr=M(()=>{j(),_(!1),v(!0)},[j]);B(()=>{E&&q.current?.focus()},[E]),B(()=>{n({open:ze,close:ke,toggle:Re,identify:V,startNew:j,endConversation:$,shutdown:re})},[n,ze,ke,Re,V,j,$,re]),B(()=>{const p=a.filter(P=>P.role==="assistant"&&!P.pending).length;if(L){A.current=p;return}p>A.current&&N(p-A.current)},[a,L]),B(()=>{e.onUnreadChange?.(S)},[S,e]),B(()=>{const p=e.sessionDurationMinutes;if(!p||p<=0)return;const P=setTimeout(()=>re(),p*60*1e3);return()=>clearTimeout(P)},[e.sessionDurationMinutes,a,L,re]),B(()=>{const p=e.customLauncherSelector;if(!p||typeof document>"u")return;let P=[];try{P=Array.from(document.querySelectorAll(p))}catch{return}const Q=se=>{se.preventDefault(),Re()};return P.forEach(se=>se.addEventListener("click",Q)),()=>P.forEach(se=>se.removeEventListener("click",Q))},[e.customLauncherSelector,Re]);const Sn=J(!1);B(()=>{const p=e.proactiveMessage?.trim();if(!p||Sn.current)return;const P=e.proactiveOnPaths??[],Q=typeof location<"u"?location.pathname:"";if(P.length>0&&!P.some(Ie=>Q.includes(Ie)))return;const se=`centrinfo:proactive:${e.token.slice(0,12)}`;try{if(sessionStorage.getItem(se)==="1")return}catch{}const Ae=setTimeout(()=>{if(!(L||K||a.some(Ie=>Ie.role==="user"))){Sn.current=!0;try{sessionStorage.setItem(se,"1")}catch{}O(p),ze()}},Math.max(0,e.proactiveDelaySeconds)*1e3);return()=>clearTimeout(Ae)},[e.proactiveMessage]),B(()=>{const p=_e.current;if(!L||!p)return;a[a.length-1]?.role==="user"||h?(p.scrollTop=p.scrollHeight,_(!1)):_(!0)},[a,L,s,h]);const fr=M(()=>{const p=_e.current;if(!p)return;const P=p.scrollHeight-p.scrollTop-p.clientHeight<80;v(P),P&&_(!1)},[]),ur=M(()=>{const p=_e.current;p&&(p.scrollTop=p.scrollHeight),_(!1),v(!0)},[]),[hr,pr]=C(""),An=J(!1);B(()=>{if(An.current&&!s){const p=[...a].reverse().find(P=>P.role==="assistant"&&!P.streaming&&!P.pending&&P.content);p&&pr(p.content)}An.current=s},[s,a]),B(()=>{if(!L)return;const p=ve.current;E||p?.querySelector(".cf-textarea")?.focus();const P=Q=>{if(Q.key==="Escape"){if(Q.preventDefault(),E){D(!1);return}ke();return}if(Q.key!=="Tab"||!p)return;const se=p.querySelectorAll('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])'),Ae=Array.from(se).filter(vr=>!vr.hasAttribute("disabled"));if(Ae.length===0)return;const Ie=Ae[0],In=Ae[Ae.length-1],Tn=p.getRootNode()instanceof ShadowRoot?p.getRootNode().activeElement:document.activeElement;Q.shiftKey&&Tn===Ie?(Q.preventDefault(),In.focus()):!Q.shiftKey&&Tn===In&&(Q.preventDefault(),Ie.focus())};return p?.addEventListener("keydown",P),()=>p?.removeEventListener("keydown",P)},[L,ke,E]),B(()=>{const p=ve.current;p&&(L?p.removeAttribute("inert"):p.setAttribute("inert",""))},[L]);const St=e.accentColor??i?.accentColor,mr={zIndex:e.zIndex,"--cf-h-pad":`${e.horizontalPadding}px`,"--cf-v-pad":`${e.verticalPadding}px`,...St?{"--cf-accent":St,"--cf-accent-2":`color-mix(in oklab, ${St} 76%, #14141f)`}:{}},_r=p=>u(p),br=[...a].reverse().find(p=>p.role==="user"&&p.content.trim())?.content??"",He=a.some(p=>p.role==="user"),gr=!He&&!!(i?.agentDescription||i?.welcomeSubtitle);return r(Xn,{value:o,children:r("div",{class:"cf-root","data-theme":Y,"data-align":e.alignment,style:mr,children:[r("div",{ref:ve,class:`cf-panel ${L?"is-open":""}`,role:"dialog","aria-modal":"false","aria-label":`Chat with ${i?.agentName??"us"}`,"aria-hidden":!L,children:[r("div",{class:"cf-header",children:[r(un,{persona:i}),r("div",{class:"cf-header__meta",children:[r("div",{class:"cf-header__name",children:i?.agentName??"Chat"}),r("div",{class:`cf-header__status ${i?.offline?"cf-header__status--offline":""}`,children:r("span",{class:"cf-header__status-text",children:i?.offline?o.statusOffline:o.statusOnline})})]}),r("div",{class:"cf-header__actions",children:[oe.length>0&&r("button",{type:"button",class:"cf-header__btn","aria-label":o.pastConversations,title:o.pastConversations,"aria-pressed":xe,onClick:()=>ye(p=>!p),children:r(uo,{})}),He&&!K&&!ie&&r("button",{type:"button",class:"cf-header__btn","aria-label":o.endChat,title:o.endChat,onClick:cr,children:r(fo,{})}),e.sound&&r("button",{type:"button",class:"cf-header__btn","aria-label":z?o.unmuteSounds:o.muteSounds,"aria-pressed":z,onClick:me,children:z?r(io,{}):r(ao,{})}),r("button",{type:"button",class:"cf-header__btn","aria-label":o.closeChat,onClick:ke,children:r(rn,{})})]})]}),e.preview&&r("div",{class:"cf-preview-banner",children:o.previewBanner}),ie&&r("div",{class:"cf-viewing-banner",children:o.viewingPast}),r("div",{class:"cf-body",ref:_e,role:"log",onScroll:fr,children:[gr&&!ie&&r("div",{class:"cf-welcome",children:[i?.agentDescription&&r("p",{class:"cf-welcome__desc",children:i.agentDescription}),i?.welcomeSubtitle&&r("p",{class:"cf-welcome__sub",children:i.welcomeSubtitle})]}),ot.map((p,P)=>r($o,{msg:p,persona:i,isLast:!ie&&P===ot.length-1,visitor:d,hasEmail:f,lastQuestion:br,showActions:!ie&&P===ot.length-1&&(!He||!!p.handoffOffered),onPickReply:_r,onSubmitForm:y,onDemoSlots:G,onRetry:m,ratable:!ie&&ot.slice(0,P).some(Q=>Q.role==="user"),onRate:g},p.id)),!He&&!ie&&r(Mo,{items:l,onPick:u}),k&&r("button",{type:"button",class:"cf-newmsg",onClick:ur,children:[r(ho,{}),o.newMessages]})]}),r("div",{class:"cf-sr-live","aria-live":"polite","aria-atomic":"true",children:hr}),s&&!K&&!ie&&r("div",{class:"cf-stopbar",children:r("button",{type:"button",class:"cf-stop",onClick:x,children:[r(lo,{}),o.stop]})}),ie?r("div",{class:"cf-ended",children:r("button",{type:"button",class:"cf-ended__btn",onClick:he,children:o.backToChat})}):K?r("div",{class:"cf-ended",children:[r("p",{class:"cf-ended__text",children:o.conversationEnded}),e.csat&&He?Oe?r("p",{class:"cf-ended__text",children:o.feedbackThanks}):r("div",{class:"cf-csat",children:[r("span",{class:"cf-csat__q",children:o.csatPrompt}),r("button",{type:"button",class:"cf-csat__btn","aria-label":o.feedbackHelpful,onClick:()=>{w("up"),Cn(!0)},children:r(cn,{})}),r("button",{type:"button",class:"cf-csat__btn","aria-label":o.feedbackNotHelpful,onClick:()=>{w("down"),Cn(!0)},children:r(ln,{})})]}):null,r("button",{type:"button",class:"cf-ended__btn",onClick:dr,children:o.startNewChat})]}):r(Ho,{onSend:u,onSendGif:c,disabled:s,allowVoice:!!i?.allowVoiceInput,onTranscribe:b,gifEnabled:X,onSearchGifs:H,allowAttach:e.attachments,onExtract:I}),!K&&i?.disclaimerText&&r("div",{class:"cf-disclaimer",children:i.disclaimerText}),r("div",{class:"cf-footer",children:[o.poweredBy," ",r("a",{href:"https://accurix.tech/centrinfo",target:"_blank",rel:"noopener noreferrer",children:"Centrinfo"})]}),E&&r("div",{class:"cf-confirm",onClick:()=>D(!1),children:r("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":o.endChatConfirm,onClick:p=>p.stopPropagation(),children:[r("div",{class:"cf-confirm__title",children:o.endChatConfirm}),r("div",{class:"cf-confirm__body",children:o.endChatConfirmBody}),r("div",{class:"cf-confirm__actions",children:[r("button",{ref:q,type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>D(!1),children:o.cancel}),r("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:lr,children:o.endConfirmCta})]})]})}),xe&&r("div",{class:"cf-confirm",onClick:()=>ye(!1),children:r("div",{class:"cf-history",role:"dialog","aria-modal":"true","aria-label":o.pastConversations,onClick:p=>p.stopPropagation(),children:[r("div",{class:"cf-history__head",children:[r("span",{children:o.pastConversations}),r("button",{type:"button",class:"cf-header__btn","aria-label":o.closeChat,onClick:()=>ye(!1),children:r(rn,{})})]}),r("div",{class:"cf-history__list",children:oe.map(p=>r("button",{type:"button",class:`cf-history__item ${p.sessionId===fe?"is-active":""}`,onClick:()=>{ge(p.sessionId),ye(!1)},children:[r("span",{class:"cf-history__title",children:p.title}),r("span",{class:"cf-history__meta",children:[new Date(p.ts).toLocaleDateString(void 0,{month:"short",day:"numeric"}),p.ended?` · ${o.historyEnded}`:""]})]},p.sessionId))})]})})]}),!e.hideDefaultLauncher&&r("button",{ref:Se,type:"button",class:"cf-launcher","aria-label":L?o.closeChat:o.openChat,"aria-expanded":L,onClick:Re,children:[e.launcherIcon?r("img",{class:"cf-launcher__img",src:e.launcherIcon,alt:""}):r(Qn,{}),!L&&S>0&&r("span",{class:"cf-launcher__badge",children:S})]})]})})},er="https://api.accurixtech.com",tr=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,apiBaseUrl:(t.apiBaseUrl??er).replace(/\/$/,""),accentColor:t.accentColor,launcherIcon:t.launcherIcon,gifApiKey:t.gifApiKey,theme:t.theme??"auto",openByDefault:t.openByDefault??!1,sound:t.sound??!0,starters:t.starters??[],strings:Zn(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,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}},yn=`
|
|
29
|
+
`).replace(/[ \t]{2,}/g," ").trim(),zt=()=>typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():`${Date.now()}-${Math.round(Math.random()*1e9)}`,xc=(t,e)=>{typeof console>"u"||console.warn(`[centrinfo-widget] ${t}`,e??{})},zx=(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 h=i?.trim();if(!o||!h||typeof window>"u"||!("speechSynthesis"in window)||typeof SpeechSynthesisUtterance>"u")return!1;const v=new SpeechSynthesisUtterance(h);let m=!1;const g=()=>{m||(m=!0,e.current===v&&(e.current=null,l?.()))};return v.rate=a,v.lang=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||"en-US",v.onend=g,v.onerror=g,e.current=v,s?.(),window.speechSynthesis.cancel(),window.speechSynthesis.speak(v),!0};if(!r||typeof Audio>"u")return c();const u=new Audio(`data:${n||"audio/mpeg"};base64,${r}`);let f=!1;const d=()=>{f||(f=!0,t.current===u&&(t.current=null,l?.()))};return u.playbackRate=a,u.onended=d,u.onerror=d,t.current=u,u.play().then(()=>{if(t.current!==u){d();return}s?.(Number.isFinite(u.duration)?u.duration*1e3:void 0)}).catch(()=>{c()||d()}),!0},cE=t=>{try{return t==="none"?null:t==="session"?sessionStorage:localStorage}catch{return null}},wc=t=>`centrinfo:session:${t.slice(0,12)}`,Yd=t=>`centrinfo:visitor:${t.slice(0,12)}`,Sc=(t,e)=>`centrinfo:chat:${t.slice(0,12)}:${e}`,qd=t=>`centrinfo:history:${t.slice(0,12)}`,Fx=20,Xd=720*60*60*1e3,uE=1440*60*1e3,fE=(t,e)=>{try{return JSON.parse(t?.getItem(Yd(e))||"{}")}catch{return{}}},hE=(t,e)=>{if(!t)return zt();try{const r=wc(e),n=t.getItem(r);if(n)return n;const a=zt();return t.setItem(r,a),a}catch{return zt()}},Hx=(t,e,r)=>{if(!t)return{};try{const n=t.getItem(Sc(e,r));return n?JSON.parse(n):{}}catch{return{}}},Vx=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i}=Hx(t,e,r);return Array.isArray(i)?typeof a=="number"&&Date.now()>a?[]:typeof n=="number"&&Date.now()-n>Xd?[]:i:[]},dE=(t,e,r)=>{const{ts:n,expiresAt:a,messages:i,ended:o}=Hx(t,e,r);return!Array.isArray(i)||i.length===0||typeof a=="number"&&Date.now()>a||typeof n=="number"&&Date.now()-n>Xd?!1:o===!0||typeof n=="number"&&Date.now()-n>uE},vE=t=>Number.isFinite(t??NaN)?Math.max(5,Math.min(200,Math.round(t))):50,pE=t=>Number.isFinite(t??NaN)?Math.max(1,Math.min(365,Math.round(t)))*24*60*60*1e3:Xd,gE=(t,e,r,n,a,i,o,s)=>{if(t)try{if(!i){t.removeItem(Sc(e,r));return}const l=n.filter(u=>!u.pending).slice(-o);if(l.length===0)return;const c=Date.now();t.setItem(Sc(e,r),JSON.stringify({ts:c,expiresAt:c+s,messages:l,ended:a}))}catch{}},mE=(t,e)=>{if(!t)return[];try{const r=t.getItem(qd(e)),n=r?JSON.parse(r):[];return Array.isArray(n)?n:[]}catch{return[]}},Zd=(t,e,r)=>{if(t)try{t.setItem(qd(e),JSON.stringify(r.slice(0,Fx)))}catch{}},yE=(t,e)=>{if(t)try{const r=`centrinfo:chat:${e.slice(0,12)}:`,n=new Set([wc(e),Yd(e),qd(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{}},_E=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"},bE=t=>({id:`live:${t.id}`,role:t.role==="assistant"||t.type==="chat"||t.type==="ai_resume"?"assistant":"system",content:t.content,authorName:t.authorName,liveEventType:t.type,createdAt:t.createdAt}),xE=(t,e,r=!0)=>{const n=$(cE(e.persistence)).current,a=$(hE(n,e.token)),i=$(null),o=$(null),s=$(null),l=$(void 0),c=$(null),u=$({}),[f,d]=K(null),[h,v]=K(()=>Vx(n,e.token,a.current)),m=$(h.length>0),[g,p]=K(!1),[y,b]=K(!1),[x,S]=K(()=>dE(n,e.token,a.current)),[w,k]=K(()=>fE(n,e.token)),[T,M]=K(()=>mE(n,e.token)),[D,C]=K(null),[I,P]=K([]),[L,R]=K("ai"),[N,Z]=K(void 0),[F,z]=K(void 0),W=$(new Date().toISOString()),ne=$(void 0),te=$(!1),de=$(0),be=$(w);ve(()=>{be.current=w},[w]);const xe=f?.memoryEnabled!==!1,et=vE(f?.memoryMessageCap),at=pE(f?.memoryRetentionDays),Ye=J(()=>{i.current?.abort(),yE(n,e.token);const O=zt();a.current=O;try{n?.setItem(wc(e.token),O)}catch{}C(null),P([]),S(!1),M([]),k({}),R("ai"),Z(void 0),z(void 0),W.current=new Date().toISOString(),v(f?[{id:zt(),role:"assistant",content:f.greeting,availableActions:f.availableActions}]:[])},[n,e.token,f]),X=J(O=>{try{n?.setItem(Yd(e.token),JSON.stringify(O))}catch{}},[n,e.token]),le=J(O=>{const H=(O.email??"").trim().toLowerCase(),re=(be.current.email??"").trim().toLowerCase();H&&re&&H!==re&&Ye();const oe={};O.email?.trim()&&(oe.email=O.email.trim()),O.phone?.trim()&&(oe.phone=O.phone.trim());const we=[O.firstName,O.lastName].filter(Q=>!!Q?.trim()).join(" ").trim()||O.name?.trim()||"";we&&(oe.name=we),Object.keys(oe).length>0&&k(Q=>{const Me={...oe,...Q};return X(Me),Me}),t.identify(a.current,O).catch(()=>{})},[t,X,Ye]),Y=J(O=>{d(O),v(H=>{if(H.length===0)return[{id:zt(),role:"assistant",content:O.greeting,availableActions:O.availableActions}];const re=H.some(ae=>ae.role==="user"),oe=H[0];return!re&&oe?.role==="assistant"?[{...oe,content:O.greeting,availableActions:O.availableActions},...H.slice(1)]:H})},[]);ve(()=>{if(f?.memoryEnabled===!1){try{n?.removeItem(Sc(e.token,a.current))}catch{}Zd(n,e.token,[]),M([]),C(null),P([]),v(O=>m.current?(m.current=!1,f?[{id:zt(),role:"assistant",content:f.greeting,availableActions:f.availableActions}]:[]):O)}},[f,n,e.token]);const q=J(async()=>{const O=await t.bootstrap();Y(O)},[Y,t]);ve(()=>{let O=!0;return t.bootstrap().then(H=>{O&&Y(H)}),e.user&&le(e.user),()=>{O=!1}},[Y,t]),ve(()=>{const O=e.configRefreshSeconds;if(!r||O<=0||typeof window>"u")return;let H=!0,re=!1;const oe=Math.max(10,O)*1e3,ae=()=>typeof document>"u"||document.visibilityState!=="hidden",we=async()=>{if(!(!H||re||!ae())){re=!0;try{await q()}catch{}finally{re=!1}}};we();const Q=window.setInterval(we,oe),Me=()=>{we()},me=()=>{we()};return window.addEventListener("focus",Me),document?.addEventListener?.("visibilitychange",me),()=>{H=!1,window.clearInterval(Q),window.removeEventListener("focus",Me),document?.removeEventListener?.("visibilitychange",me)}},[r,e.configRefreshSeconds,q]),ve(()=>{gE(n,e.token,a.current,h,x,xe,et,at)},[h,x,n,e.token,xe,et,at]),ve(()=>{if(x||D)return;let O=!0,H=!1;const re=async()=>{if(!H){H=!0;try{const ae=await t.liveEvents(a.current,W.current);if(!O)return;if(R(ae.mode),Z(ae.assignedAgentName||void 0),z(ae.agentTyping?ae.agentTypingName||ae.assignedAgentName||"Agent":void 0),ae.conversationEnded){S(!0),R("ai"),Z(void 0),z(void 0),v(we=>we.some(Q=>Q.id==="live:conversation-ended")?we:[...we,{id:"live:conversation-ended",role:"system",content:e.strings.conversationEnded,liveEventType:"conversation_ended",createdAt:new Date().toISOString()}]);return}if(ae.events.length>0){let we=W.current,Q=Date.parse(we);const Me=ae.events.map(me=>{const je=Date.parse(me.createdAt);return Number.isFinite(je)&&je>Q&&(Q=je,we=me.createdAt),bE(me)});W.current=we,v(me=>{const je=new Set(me.map(yt=>yt.id)),rt=Me.filter(yt=>!je.has(yt.id));return rt.length>0?[...me,...rt]:me}),Me.some(me=>me.role==="assistant")&&hi("receive")}}catch{}finally{H=!1}}};re();const oe=window.setInterval(re,2200);return()=>{O=!1,window.clearInterval(oe)}},[e.strings.conversationEnded,t,x,D]),ve(()=>{if(!xe){Zd(n,e.token,[]),M(H=>H.length>0?[]:H);return}h.some(H=>H.role==="user")&&M(H=>{const re=a.current,ae=[{sessionId:re,ts:Date.now(),title:_E(h),ended:x},...H.filter(we=>we.sessionId!==re)];return Zd(n,e.token,ae),ae.slice(0,Fx)})},[h,x,n,e.token,xe]);const B=J((O,H)=>{v(re=>re.map(oe=>oe.id===O?{...oe,...H}:oe))},[]),j=J(()=>{l.current!==void 0&&typeof window<"u"&&window.clearInterval(l.current),l.current=void 0},[]),Te=J((O,H)=>{j(),c.current===O&&(c.current=null),B(O,{content:H,pending:!1,streaming:!1})},[j,B]),Ne=J((O,H,re)=>{const oe=H.trim();if(!oe||typeof window>"u"){Te(O,oe);return}j(),c.current=O;const ae=oe.match(/\S+\s*/g)??[oe],we=re&&re>0?re:ae.length*95,Q=Math.max(28,Math.min(150,we/Math.max(ae.length,1)));let Me=0;B(O,{content:"",pending:!1,streaming:!0}),l.current=window.setInterval(()=>{Me+=1;const me=ae.slice(0,Me).join("");B(O,{content:me,pending:!1,streaming:Me<ae.length}),Me>=ae.length&&(j(),c.current===O&&(c.current=null),B(O,{content:oe,pending:!1,streaming:!1}))},Q)},[j,Te,B]),tt=J(()=>{const O=c.current;j(),c.current=null,O&&B(O,{pending:!1,streaming:!1})},[j,B]),fr=J(O=>{if(x||D||L==="ai"||typeof window>"u")return;if(ne.current!==void 0&&window.clearTimeout(ne.current),!O){if(!te.current)return;te.current=!1,de.current=0,t.typing(a.current,!1).catch(()=>{});return}const H=Date.now();(!te.current||H-de.current>2500)&&(te.current=!0,de.current=H,t.typing(a.current,!0).catch(()=>{})),ne.current=window.setTimeout(()=>{te.current&&(te.current=!1,de.current=0,t.typing(a.current,!1).catch(()=>{}))},1600)},[t,x,D,L]);ve(()=>()=>{ne.current!==void 0&&typeof window<"u"&&window.clearTimeout(ne.current)},[]),ve(()=>()=>j(),[j]);const er=J((O,H,re={})=>{tt(),p(!0);const oe=new AbortController;i.current=oe;const ae=!!(f?.allowVoiceInput&&f?.voiceOutputEnabled&&f.talkbackMode!=="text"),we=!!(re.forceVoicePlayback&&ae);t.stream(O,a.current,{voicePlaybackRequested:!!re.forceVoicePlayback,signal:oe.signal,onChunk:Q=>{we||(re.forceVoicePlayback&&Q&&(u.current[H]=!0),v(Me=>Me.map(me=>me.id===H?{...me,content:me.content+Q,pending:!1,streaming:!0}:me)))}}).then(Q=>{if(Q.liveMode&&(R(Q.liveMode),Z(Q.assignedAgentName||void 0)),Q.liveMode&&Q.liveMode!=="ai"&&!Q.answer.trim()){v(je=>je.filter(rt=>rt.id!==H));return}const Me=!!u.current[H];delete u.current[H];const me=!!(re.forceVoicePlayback&&ae&&Q.audioBase64&&Q.answer.trim()&&!Me);if(v(je=>je.map(rt=>rt.id===H?{...rt,content:me?"":Q.answer||rt.content||e.strings.emptyReply,pending:!1,streaming:me,error:!1,retryText:void 0,sources:Q.sources,suggestedReplies:Q.suggestedReplies,availableActions:Q.availableActions,handoffOffered:Q.handoffOffered,requestedContactFields:Q.requestedContactFields,visualization:Q.visualization}:rt)),hi("receive"),re.forceVoicePlayback&&!Q.audioBase64&&xc(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:f?.voiceOutputEnabled,talkbackMode:f?.talkbackMode,voiceProvider:f?.voiceProvider,hasAudioBase64:!!Q.audioBase64}),re.forceVoicePlayback){const je=zx(o,s,Q.audioBase64,Q.mimeType,f?.voiceSpeed??1,Q.answer,!0,rt=>{b(!0),me&&Ne(H,Q.answer,rt)},()=>{b(!1),me&&Te(H,Q.answer)});me&&!je&&Te(H,Q.answer)}Q.answer&&e.onMessage?.({role:"assistant",content:Q.answer}),Q.handoffOffered&&e.onHandoff?.(),Q.conversationEnded&&S(!0)}).catch(Q=>{if(oe.signal.aborted){delete u.current[H],B(H,{pending:!1,streaming:!1});return}delete u.current[H];const Me=Q instanceof Error?Q.message.trim():"",me=Q?.status===429?e.strings.errorRateLimit:Me?`${e.strings.errorGeneric} (${Me})`:e.strings.errorGeneric;B(H,{content:me,pending:!1,streaming:!1,error:!0,retryText:O})}).finally(()=>{delete u.current[H],p(!1),i.current=null})},[t,e,B,f?.allowVoiceInput,f?.talkbackMode,f?.voiceOutputEnabled,f?.voiceSpeed,tt]),It=J((O,H={})=>{const re=O.trim(),{imageUrl:oe,attachmentName:ae,attachmentText:we,forceVoicePlayback:Q,userMessageId:Me}=H;if(!re&&!oe&&!we||g||x)return;let me=re;if(we){const yt=ae?` "${ae}"`:"";me=`${re}
|
|
30
|
+
|
|
31
|
+
[Attached file${yt}]:
|
|
32
|
+
${we}`.trim()}else!me&&oe&&(me=oe);const je={id:Me||zt(),role:"user",content:re,imageUrl:oe,attachmentName:ae},rt=zt();v(yt=>[...!!(Me&&yt.some(Rr=>Rr.id===Me))?yt.map(Rr=>Rr.id===Me?{...Rr,content:re,pending:!1,streaming:!1,imageUrl:oe,attachmentName:ae}:Rr):[...yt,je],{id:rt,role:"assistant",content:"",pending:!0}]),hi("send"),e.onMessage?.({role:"user",content:me}),er(me,rt,{forceVoicePlayback:Q})},[g,x,e,er]),Pt=J(()=>i.current?.abort(),[]),jr=J(()=>{tt(),o.current?.pause(),o.current=null,typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),s.current=null,b(!1)},[tt]),Ft=J(O=>{const H=lE(O);if(!H)return Promise.resolve(!1);const re=!!(f?.allowVoiceInput&&f?.voiceOutputEnabled&&f.talkbackMode!=="text"),oe=(ae,we)=>new Promise(Q=>{let Me=!1;zx(o,s,ae,we,f?.voiceSpeed??1,H,!0,()=>{Me=!0,b(!0)},()=>{b(!1),Q(Me)})||(b(!1),Q(!1))});return re?t.speak(H).then(ae=>ae.audioBase64?oe(ae.audioBase64,ae.mimeType):(xc("Talkback prompt TTS did not return provider audio.",{providerReady:ae.providerReady,message:ae.message,voiceProvider:f?.voiceProvider,voiceOutputEnabled:f?.voiceOutputEnabled,talkbackMode:f?.talkbackMode}),oe())).catch(ae=>(xc("Talkback prompt TTS request failed before audio playback.",{error:ae instanceof Error?ae.message:String(ae),voiceProvider:f?.voiceProvider,voiceOutputEnabled:f?.voiceOutputEnabled,talkbackMode:f?.talkbackMode}),oe())):(xc("Talkback prompt wanted voice, but the loaded widget token config has provider TTS disabled.",{voiceOutputEnabled:f?.voiceOutputEnabled,talkbackMode:f?.talkbackMode,voiceProvider:f?.voiceProvider}),oe())},[f?.allowVoiceInput,f?.talkbackMode,f?.voiceOutputEnabled,f?.voiceSpeed,t]),Jd=J((O,H)=>{g||x||!H||(B(O,{content:"",pending:!0,streaming:!1,error:!1}),hi("send"),er(H,O))},[g,x,B,er]),ev=J((O,H,re)=>{B(O,{feedback:H});const oe=h.findIndex(Q=>Q.id===O),ae=oe>=0?h[oe]?.content:void 0;let we;for(let Q=oe-1;Q>=0;Q--)if(h[Q]?.role==="user"){we=h[Q]?.content;break}t.sendFeedback({sessionId:a.current,messageId:O,rating:H,comment:re,question:we,answer:ae}).catch(()=>{})},[t,B,h]),tv=J(async(O,H,re={})=>{e.onAction?.(O);const oe=await t.action(O,{sessionId:a.current,...H}),ae={};return re.name?.trim()&&(ae.name=re.name.trim()),re.email?.trim()&&(ae.email=re.email.trim()),re.phone?.trim()&&(ae.phone=re.phone.trim()),Object.keys(ae).length>0&&(k(we=>{const Q={...we,...ae};return X(Q),Q}),ae.email&&O!=="contact"&&t.action("contact",{sessionId:a.current,...ae}).catch(()=>{})),hi("receive"),oe},[t,e,X]),rv=J(O=>{const H=O.trim();H&&v(re=>re.some(oe=>oe.role==="assistant"&&oe.content===H)?re:[...re,{id:zt(),role:"assistant",content:H}])},[]),va=J(O=>{const H=zt();return v(re=>[...re,{id:H,role:"user",content:O.trim(),pending:!0}]),H},[]),nv=J((O,H)=>{v(re=>re.map(oe=>oe.id===O?{...oe,...H}:oe))},[]),av=J(O=>{v(H=>H.filter(re=>re.id!==O))},[]),Tc=J((O,H)=>{t.sendFeedback({sessionId:a.current,messageId:"__csat__",rating:O,comment:H}).catch(()=>{})},[t]),pa=J((O,H,re,oe)=>t.transcribe(O,H,re,oe),[t]),Fo=J((O,H,re)=>t.extract(O,H,re),[t]),iv=J(O=>t.searchGifs(O),[t]),ga=J((O,H)=>t.demoSlots(O,H),[t]),Cc=J(O=>It("",{imageUrl:O}),[It]),di=e.demo||!!e.gifApiKey,Ho=J(()=>{i.current?.abort(),S(!0),t.endConversation(a.current).catch(()=>{})},[t]),Ke=J(()=>{i.current?.abort();const O=zt();a.current=O;try{n?.setItem(wc(e.token),O)}catch{}C(null),P([]),S(!1),R("ai"),Z(void 0),z(void 0),W.current=new Date().toISOString(),v(f?[{id:zt(),role:"assistant",content:f.greeting,availableActions:f.availableActions}]:[])},[n,e.token,f]),ot=J(O=>{if(xe){if(O===a.current){C(null);return}P(Vx(n,e.token,O)),C(O)}},[n,e.token,xe]),ct=J(()=>{C(null),P([])},[]),Lr=e.starters.length>0?e.starters:f?.starterQuestions??[],ma=f?.featuredLinks??[];return{persona:f,messages:h,sending:g,assistantSpeaking:y,visitor:w,starters:Lr,featuredLinks:ma,hasEmail:!!w.email,liveMode:L,assignedAgentName:N,agentTypingName:F,send:It,sendGif:Cc,notifyTyping:fr,stop:Pt,retry:Jd,rateMessage:ev,injectAssistant:rv,appendUserDraft:va,patchMessage:nv,removeMessage:av,submitCsat:Tc,submitForm:tv,transcribe:pa,extract:Fo,searchGifs:iv,demoSlots:ga,gifEnabled:di,identify:le,ended:x,endConversation:Ho,startNew:Ke,history:xe?T:[],viewingSessionId:D,viewMessages:I,openConversation:ot,closeHistoryView:ct,shutdown:Ye,stopSpeaking:jr,speakAssistantText:Ft}},wE=({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."})]}),SE=t=>{const[e,r]=K("light");return ve(()=>{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},Gx=1e4,kE=1400,TE=.0038,Wx=.0022,Ux=1600,$x=550,CE=350,ME=.001,Yx=6e4,qx=90,AE=.009,DE=280,IE=250,Xx=250,PE=t=>t.replace(/\[[^\]]{0,60}\]/g," ").replace(/\(([^)]{0,60})\)/g,(e,r)=>Zx.has(r.trim().toLowerCase().replace(/[.!?,…]+$/,"").replace(/\s+/g," "))?" ":e).replace(/\*[^*]{0,60}\*/g," ").replace(/\s+/g," ").trim(),Zx=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"]),LE=t=>{const e=t.trim().toLowerCase().replace(/[()[\]*]/g," ").replace(/[.!?,…]+$/,"").replace(/\s+/g," ").trim();return!e||/^(?:sh+\s*)+$/.test(e)?!0:Zx.has(e)},RE=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},Kx={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(),EE=[{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/}],OE=/^(?:yes|yeah|yep|yup|sure|correct|confirm|affirmative|go ahead|do it|please do|ok(?:ay)?)\b/,NE=/^(?:no|nope|nah|cancel|never ?mind|don'?t|stop)\b/,BE=/^(?:end|close|stop|finish|hang ?up|quit|exit|bye|good ?bye)\b/,zE=t=>{const e=Kd(t);if(!e)return null;for(const{action:r,re:n}of EE)if(n.test(e)){const a=e.split(" ").length;return{action:r,confident:r==="end"?a<=10:a<=6}}return null},kc=t=>`I didn't catch yes or no. Say yes to ${Kx[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"}.`,FE=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)},HE=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)}),jx=(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 d=(f-128)/128;u+=d*d}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(()=>{}))}}},Qx=t=>({...t?{deviceId:{exact:t}}:{},echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}),VE=({transport:t,config:e,bindControls:r})=>{const n=e.strings,[a,i]=K(e.openByDefault),{persona:o,messages:s,sending:l,assistantSpeaking:c,visitor:u,hasEmail:f,liveMode:d,assignedAgentName:h,agentTypingName:v,starters:m,featuredLinks:g,send:p,sendGif:y,notifyTyping:b,stop:x,retry:S,rateMessage:w,injectAssistant:k,appendUserDraft:T,patchMessage:M,removeMessage:D,submitCsat:C,submitForm:I,transcribe:P,extract:L,searchGifs:R,demoSlots:N,gifEnabled:Z,identify:F,ended:z,endConversation:W,startNew:ne,history:te,viewingSessionId:de,viewMessages:be,openConversation:xe,closeHistoryView:et,shutdown:at,stopSpeaking:Ye,speakAssistantText:X}=xE(t,e,a),[le,Y]=K(0),[q,B]=K("idle"),[j,Te]=K(!1),[Ne,tt]=K(!1),[fr,er]=K(0),[It,Pt]=K(!1),[jr,Ft]=K(null),[Jd,ev]=K([]),[tv,rv]=K(""),[va,nv]=K(()=>{try{return localStorage.getItem("centrinfo:muted")==="1"}catch{return!1}}),av=SE(e.theme),Tc=s.some(E=>E.role==="assistant"&&(E.pending||E.streaming)),pa=l||Tc||c,Fo=o?.soundEnabled??!0;ve(()=>{nE(e.sound&&Fo&&!va)},[e.sound,Fo,va]);const iv=J(()=>{nv(E=>{const U=!E;try{localStorage.setItem("centrinfo:muted",U?"1":"0")}catch{}return U})},[]),ga=$(null),Cc=$(null),di=$(null),Ho=$(0),Ke=$(!1),ot=$(!1),ct=$(!1),Lr=$(0),ma=$(!1),O=$(null),H=$(null),re=$([]),oe=$(void 0),ae=$(void 0),we=$(null),Q=$(0),Me=$(0),me=$(!1),je=$(0),rt=$(null),yt=$(null),Tn=$(0),hr=$(null),Rr=$([]),Mc=$(0),Qr=$(0),Ac=$(0),Jr=$(null),vi=$(!1),ya=$(null),Er=$(""),ov=$(()=>{}),sv=$(""),Cn=$(l),n1=$(c),a1=$(pa),i1=$(q),lv=$(0);ve(()=>{Cn.current=l},[l]),ve(()=>{n1.current=c},[c]),ve(()=>{a1.current=pa},[pa]),ve(()=>{i1.current=q},[q]);const[o1,Vo]=K(!0),[jE,pi]=K(!1),cv=$(0),[gi,Go]=K(!1),s1=$(null),[l1,Dc]=K(!1),[QE,c1]=K(!1),Fe=!!de,uv=Fe?be:s,Wo=uv.find(E=>E.id===jr&&E.visualization)?.visualization;ve(()=>{!jr||Wo||(Ft(null),Pt(!1))},[Wo,jr]);const mi=J(()=>{i(!0),Y(0),hi("open"),e.onOpen?.(),e.onShow?.()},[e]),Or=J(()=>{i(!1),Pt(!1),Ft(null),e.onClose?.(),e.onHide?.(),Cc.current?.focus()},[e]),Uo=J(()=>a?Or():mi(),[a,mi,Or]),JE=J(()=>Go(!0),[]),e5=J(()=>{W(),Go(!1)},[W]),t5=J(()=>{ne(),pi(!1),Vo(!0)},[ne]);ve(()=>{gi&&s1.current?.focus()},[gi]),ve(()=>{r({open:mi,close:Or,toggle:Uo,identify:F,startNew:ne,endConversation:W,shutdown:at})},[r,mi,Or,Uo,F,ne,W,at]),ve(()=>{const E=s.filter(U=>U.role==="assistant"&&!U.pending).length;if(a){Ho.current=E;return}E>Ho.current&&Y(E-Ho.current)},[s,a]),ve(()=>{e.onUnreadChange?.(le)},[le,e]),ve(()=>{const E=e.sessionDurationMinutes;if(!E||E<=0)return;const U=setTimeout(()=>at(),E*60*1e3);return()=>clearTimeout(U)},[e.sessionDurationMinutes,s,a,at]),ve(()=>{const E=e.customLauncherSelector;if(!E||typeof document>"u")return;let U=[];try{U=Array.from(document.querySelectorAll(E))}catch{return}const se=pe=>{pe.preventDefault(),Uo()};return U.forEach(pe=>pe.addEventListener("click",se)),()=>U.forEach(pe=>pe.removeEventListener("click",se))},[e.customLauncherSelector,Uo]);const u1=$(!1);ve(()=>{const E=e.proactiveMessage?.trim();if(!E||u1.current)return;const U=e.proactiveOnPaths??[],se=typeof location<"u"?location.pathname:"";if(U.length>0&&!U.some(Ve=>se.includes(Ve)))return;const pe=`centrinfo:proactive:${e.token.slice(0,12)}`;try{if(sessionStorage.getItem(pe)==="1")return}catch{}const Ue=setTimeout(()=>{if(!(a||z||s.some(Ve=>Ve.role==="user"))){u1.current=!0;try{sessionStorage.setItem(pe,"1")}catch{}k(E),mi()}},Math.max(0,e.proactiveDelaySeconds)*1e3);return()=>clearTimeout(Ue)},[e.proactiveMessage]),ve(()=>{const E=di.current;if(!a||!E)return;const U=s[s.length-1],se=Date.now()<cv.current;U?.role==="user"||o1||se?(requestAnimationFrame(()=>{E.scrollTop=E.scrollHeight}),pi(!1),se&&Vo(!0)):pi(!0)},[s,a,l,o1]);const r5=J(()=>{const E=di.current;if(!E)return;if(Ke.current&&!Fe){Vo(!0),pi(!1);return}const U=E.scrollHeight-E.scrollTop-E.clientHeight<80;Vo(U),U&&pi(!1)},[Fe]),Mn=J(()=>{const E=di.current;E&&(E.scrollTop=E.scrollHeight),pi(!1),Vo(!0)},[]),Ic=J(()=>{cv.current=Date.now()+3e3,requestAnimationFrame(Mn)},[Mn]);ve(()=>{if(!a||Fe||!j||q==="connecting")return;cv.current=Date.now()+6e4,Mn();const E=requestAnimationFrame(()=>{Mn(),requestAnimationFrame(Mn)}),U=[80,180,360].map(se=>window.setTimeout(Mn,se));return()=>{cancelAnimationFrame(E),U.forEach(se=>window.clearTimeout(se))}},[c,s,a,Mn,l,j,Fe,q]);const f1=J(()=>{ga.current?.querySelector(".cf-textarea")?.focus()},[]),h1=J(()=>{oe.current&&window.clearTimeout(oe.current),oe.current=void 0,ae.current&&window.clearTimeout(ae.current),ae.current=void 0,we.current?.stop(),we.current=null,er(0)},[]),dr=J(()=>{yt.current?.stop(),yt.current=null,Pr(hr.current),rt.current?.getTracks().forEach(E=>E.stop()),rt.current=null,Tn.current=0,Qr.current=0},[]),yi=J(()=>{h1(),H.current?.getTracks().forEach(E=>E.stop()),H.current=null},[h1]),Lt=J(()=>{Ke.current=!1,ct.current=!1,ot.current=!1,ma.current=!1,Jr.current=null,vi.current=!1,ya.current=null,Er.current="",Te(!1),tt(!1),Pt(!1),Ft(null),dr(),Ye();const E=O.current;E?.state==="recording"?Pr(E):(yi(),B("idle"))},[dr,Ye,yi]),n5=J(()=>{It&&Ft(null),Pt(!It)},[It]),a5=J(E=>{Ft(E),Pt(!0)},[]),i5=J(()=>{const E=jr;Ft(null),Pt(!1),window.requestAnimationFrame(()=>{Array.from(ga.current?.querySelectorAll("[data-visualization-message]")??[]).find(se=>se.dataset.visualizationMessage===E)?.focus()})},[jr]),o5=J(()=>{Ft(null),Pt(!1)},[]),d1=J((E,U)=>{if(Date.now()-Lr.current>=Yx){B("timeout"),ae.current=window.setTimeout(()=>Lt(),2400);return}B(E),ae.current=window.setTimeout(()=>{Ke.current&&!ot.current&&!n1.current&&U()},kE)},[Lt]),$o=J((E,U,se)=>{Date.now()-Lr.current<Yx&&!ot.current&&(ct.current=!0,X(U)),d1(E,se)},[d1,X]),v1=J((E,U)=>{Ic(),Lr.current=Date.now(),ct.current=!0,U&&M(U,{content:E,pending:!0,streaming:!1});const se=()=>{if(Ke.current){if(Cn.current){window.setTimeout(se,80);return}U&&ya.current===U&&(ya.current=null),p(E,{forceVoicePlayback:!0,userMessageId:U})}};se()},[Ic,M,p]),Pc=J(async(E,U,se,pe="normal",Ue)=>{let Ve=null;const An=pr=>Ve||(Ic(),Ve=ya.current||T(pr),ya.current=Ve,M(Ve,{content:Er.current||pr,pending:!0,streaming:!1}),Ve),vr=()=>{Ve&&(ya.current===Ve&&(ya.current=null),Er.current="",D(Ve),Ve=null)},_i=()=>{Er.current="",B("listening"),window.setTimeout(()=>{Ke.current&&!ot.current&&!Cn.current&&!O.current&&se()},120)},y5=E.size===0,_5=E.size<CE&&U<ME;if(y5||_5){if(pe==="barge"){_i();return}const pr=Jr.current;$o("noise",pr?kc(pr):jd(o),se),Er.current="";return}B("processing");const b5=++lv.current,vv=An("Listening...");try{const pr=typeof navigator<"u"&&(navigator.languages?.[0]||navigator.language)||void 0;M(vv,{content:Er.current?`${Er.current} ...`:"Transcribing...",pending:!0});const Ec=await HE(E);if(!Ec.trim()){if(vr(),pe==="barge"){_i();return}$o("noise",Jr.current?kc(Jr.current):jd(o),se);return}const x5=PE(await P(Ec,E.type,pr,Ue));if(b5!==lv.current){vr();return}const en=[Er.current,x5].map(gr=>gr.trim()).filter(Boolean).join(" ").replace(/\s+/g," ").trim();if(!en||LE(en)||RE(en)){if(vr(),pe==="barge"){_i();return}const gr=Jr.current;$o("misunderstood",gr?kc(gr):jd(o),se);return}const Oc=Jr.current;if(Oc){const gr=Kd(en);if(OE.test(gr)||Oc==="end"&&BE.test(gr)){vr(),Jr.current=null,ov.current(Oc);return}if(NE.test(gr)){vr(),Jr.current=null;const x1="Okay, never mind — what would you like to know?";k(x1),ct.current=!0,B("speaking"),X(x1);return}vr();const b1=kc(Oc);k(b1),ct.current=!0,B("speaking"),X(b1);return}const Xo=zE(en);if(Xo){if(vr(),Lr.current=Date.now(),Xo.confident){ov.current(Xo.action);return}Jr.current=Xo.action;const gr=`Just to confirm — you want me to ${Kx[Xo.action]}? Please say yes or no.`;k(gr),ct.current=!0,B("speaking"),X(gr);return}if(M(vv,{content:en,pending:!0}),FE(en)){Er.current=en,B("listening"),se();return}Er.current="",v1(en,vv)}catch(pr){if(vr(),pe==="barge"){_i();return}const Ec=pr instanceof Error&&pr.message.trim()?` (${pr.message.trim()})`:"";$o("misunderstood",`I couldn't convert your speech to text. Please check the speech service configuration or type your question.${Ec}`,se)}},[T,Ic,$o,k,M,o,D,v1,X,P]),Ht=J(async()=>{if(!(!Ke.current||ot.current)&&!(!o?.allowVoiceInput||z||Fe)&&!Cn.current&&!O.current){dr(),ct.current=!1;try{B("connecting");const E=await navigator.mediaDevices.getUserMedia({audio:Qx(sv.current)});if(!Ke.current||ot.current){E.getTracks().forEach(pe=>pe.stop());return}navigator.mediaDevices.enumerateDevices().then(pe=>{ev(pe.filter(Ue=>Ue.kind==="audioinput").map((Ue,Ve)=>({deviceId:Ue.deviceId,label:Ue.label||`Microphone ${Ve+1}`})))}).catch(()=>{});const U=Fd(E);O.current=U,H.current=E,re.current=[],Q.current=0,me.current=!1,je.current=0;const se=performance.now();we.current=jx(E,(pe,Ue)=>{if(Q.current=Math.max(Q.current,pe),pe>=TE)me.current=!0,je.current=0;else if(me.current&&pe<=Wx){je.current||(je.current=Ue);const Ve=Ue-je.current,An=Ue-se;if(Ve>=Ux&&An>=$x&&U.state==="recording"){Pr(U);return}}else je.current=0;Ue-Me.current>qx&&(Me.current=Ue,er(pe))}),U.ondataavailable=pe=>{pe.data.size>0&&re.current.push(pe.data)},U.onstop=async()=>{if(yi(),O.current=null,ma.current){ma.current=!1,Ke.current&&!ot.current?(B("idle"),Ht()):B(Ke.current&&ot.current?"muted":"idle");return}if(!Ke.current){B("idle");return}const pe=new Blob(re.current,{type:U.mimeType||"audio/webm"});await Pc(pe,Q.current,Ht,"normal",Math.max(0,(performance.now()-se)/1e3))},U.start(Xx),B("listening"),oe.current=window.setTimeout(()=>{Pr(O.current)},Gx)}catch{B("denied"),ae.current=window.setTimeout(()=>Lt(),3500)}}},[z,Lt,Pc,o,o?.allowVoiceInput,dr,yi,Fe]),s5=J(()=>{if(Ke.current){Lt();return}f1(),!(!o?.allowVoiceInput||Cn.current||z||Fe)&&(Lr.current=Date.now(),ct.current=!1,ot.current=!1,Ke.current=!0,tt(!1),Te(!0),B("connecting"),Ht())},[z,Lt,f1,o,o?.allowVoiceInput,Ht,Fe]),Lc=J(()=>{tt(E=>{const U=!E;if(ot.current=U,U){const se=O.current;se?.state==="recording"?(ma.current=!0,Pr(se)):(yi(),B("muted"))}else Ke.current&&!z&&!Fe&&(B("idle"),Ht());return U})},[z,Ht,yi,Fe]),Yo=J((E,U)=>{k(E),U&&(ct.current=!0),B("speaking"),X(E)},[k,X]),p1=J(E=>{switch(Lr.current=Date.now(),E){case"end":ct.current=!1,vi.current=!0,Yo("Okay — ending our call now. Goodbye!",!1),window.setTimeout(()=>{vi.current&&(vi.current=!1,Lt())},2e3);break;case"mute":{ot.current||Lc();const U="Muted. Tap the mic button when you want me to listen again.";k(U),X(U);break}case"minimize":Or(),Yo("Minimized — I'm still listening. Tap the call pill to bring the chat back.",!0);break;case"expand":Pt(!0),Yo("Sure — expanding the view.",!0);break;case"shrink":Ft(null),Pt(!1),Yo("Okay — back to the smaller view.",!0);break}},[Or,Lt,k,X,Yo,Lc]);ve(()=>{ov.current=p1},[p1]);const g1=$(!1);ve(()=>{g1.current&&!c&&vi.current&&(vi.current=!1,Lt()),g1.current=c},[c,Lt]);const l5=J(E=>{sv.current=E,rv(E);const U=O.current;U?.state==="recording"&&(ma.current=!0,Pr(U))},[]),c5=J(()=>{if(!(!Ke.current||ot.current)){if(dr(),x(),Ye(),Lr.current=Date.now(),B("listening"),Cn.current){const E=()=>{if(!(!Ke.current||ot.current)){if(Cn.current){window.setTimeout(E,70);return}ct.current=!1,Ht()}};window.setTimeout(E,70);return}ct.current=!1,Ht()}},[Ht,x,dr,Ye]),m1=J(async()=>{if(!(rt.current||yt.current)&&!(!Ke.current||ot.current))try{const E=await navigator.mediaDevices.getUserMedia({audio:Qx(sv.current)});if(!Ke.current||ot.current||O.current||rt.current||!a1.current&&i1.current!=="processing"){E.getTracks().forEach(se=>se.stop());return}rt.current=E,Tn.current=0,Qr.current=0,Ac.current=0;const U=()=>{if(hr.current)return;x(),Ye(),lv.current+=1,Lr.current=Date.now(),ct.current=!1,B("listening");const se=Fd(E);hr.current=se,Rr.current=[],Mc.current=performance.now(),Qr.current=0,se.ondataavailable=pe=>{pe.data.size>0&&Rr.current.push(pe.data)},se.onstop=async()=>{const pe=Rr.current,Ue=Ac.current,Ve=se.mimeType||"audio/webm";if(hr.current=null,Rr.current=[],dr(),!Ke.current)return;const An=new Blob(pe,{type:Ve});await Pc(An,Ue,Ht,"barge",Math.max(0,(performance.now()-Mc.current)/1e3))},se.start(Xx)};yt.current=jx(E,(se,pe)=>{if(Ac.current=Math.max(Ac.current,se),pe-Me.current>qx&&(Me.current=pe,er(se)),se>=AE)Tn.current||(Tn.current=pe),pe-Tn.current>=DE&&U(),Qr.current=0;else if(hr.current&&se<=Wx){Qr.current||(Qr.current=pe);const Ue=pe-Qr.current,Ve=pe-Mc.current;Ue>=Ux&&Ve>=$x&&hr.current.state==="recording"&&Pr(hr.current)}else hr.current&&pe-Mc.current>=Gx&&hr.current.state==="recording"?Pr(hr.current):(Tn.current=0,Qr.current=0)}),yt.current||dr()}catch{}},[Pc,Ht,x,dr,Ye]);ve(()=>{if(!(j&&!Ne&&!z&&!Fe&&(pa||q==="processing"))){dr();return}const U=window.setTimeout(()=>{m1()},IE);return()=>window.clearTimeout(U)},[pa,z,m1,dr,j,Ne,q,Fe]);const u5=j&&!Ne&&(l||c||q==="processing");ve(()=>{!j||Ne||c&&B("speaking")},[c,j,Ne]),ve(()=>{if(!j||Ne||!ct.current||l||c||!["processing","speaking","noise","misunderstood"].includes(q))return;const E=window.setTimeout(()=>{!Ke.current||ot.current||Cn.current||(ct.current=!1,Ht())},700);return()=>window.clearTimeout(E)},[c,l,Ht,j,Ne,q]),ve(()=>()=>Lt(),[Lt]);const[f5,h5]=K(""),y1=$(!1);ve(()=>{if(y1.current&&!l){const E=[...s].reverse().find(U=>U.role==="assistant"&&!U.streaming&&!U.pending&&U.content);E&&h5(E.content)}y1.current=l},[l,s]),ve(()=>{if(!a)return;const E=ga.current;gi||E?.querySelector(".cf-textarea")?.focus();const U=se=>{if(se.key==="Escape"){if(se.preventDefault(),gi){Go(!1);return}Or();return}if(se.key!=="Tab"||!E)return;const pe=E.querySelectorAll('button, [href], textarea, input, [tabindex]:not([tabindex="-1"])'),Ue=Array.from(pe).filter(_i=>!_i.hasAttribute("disabled"));if(Ue.length===0)return;const Ve=Ue[0],An=Ue[Ue.length-1],vr=E.getRootNode()instanceof ShadowRoot?E.getRootNode().activeElement:document.activeElement;se.shiftKey&&vr===Ve?(se.preventDefault(),An.focus()):!se.shiftKey&&vr===An&&(se.preventDefault(),Ve.focus())};return E?.addEventListener("keydown",U),()=>E?.removeEventListener("keydown",U)},[a,Or,gi]),ve(()=>{const E=ga.current;E&&(a?E.removeAttribute("inert"):E.setAttribute("inert",""))},[a]);const fv=e.accentColor??o?.accentColor,d5={zIndex:e.zIndex,"--cf-h-pad":`${e.horizontalPadding}px`,"--cf-v-pad":`${e.verticalPadding}px`,...fv?{"--cf-accent":fv,"--cf-accent-2":`color-mix(in oklab, ${fv} 76%, #14141f)`}:{}},v5=E=>p(E),p5=[...s].reverse().find(E=>E.role==="user"&&E.content.trim())?.content??"",Rc=s.some(E=>E.role==="user"),_1=o?.talkbackMode==="avatar"||o?.widgetModule==="assistant"||!!o?.allowVoiceInput,qo=!Fe&&_1&&!Rc?uv.filter((E,U)=>!(U===0&&E.role==="assistant")):uv,g5=d==="human"&&h?h:o?.agentName??"Chat",m5=d==="human"?"Live support":d==="queued"?"Waiting for the team":o?.offline?n.statusOffline:n.statusOnline,hv=!z&&!Fe?o?.availableActions:void 0,dv=j&&q==="connecting"&&!Fe;return _(eR,{value:n,children:_("div",{class:"cf-root","data-theme":av,"data-align":e.alignment,"data-display":"floating",style:d5,children:[It&&a&&_("div",{class:"cf-theater-backdrop",onClick:o5}),_("div",{ref:ga,class:`cf-panel ${a?"is-open":""} ${j?"cf-panel--call":""} ${dv?"cf-panel--voice-connecting":""} ${It&&a?"cf-panel--theater":""} ${Wo?"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:[_($d,{persona:o,hideWhenMissing:!0}),_("div",{class:"cf-header__meta",children:[_("div",{class:"cf-header__name",children:g5}),_("div",{class:`cf-header__status ${d==="ai"&&o?.offline?"cf-header__status--offline":""}`,children:_("span",{class:"cf-header__status-text",children:m5})})]}),_("div",{class:"cf-header__actions",children:[te.length>0&&_("button",{type:"button",class:"cf-header__btn","aria-label":n.pastConversations,title:n.pastConversations,"aria-pressed":l1,onClick:()=>Dc(E=>!E),children:_(hR,{})}),Rc&&!z&&!Fe&&_("button",{type:"button",class:"cf-header__btn","aria-label":n.endChat,title:n.endChat,onClick:JE,children:_(Wd,{})}),e.sound&&Fo&&_("button",{type:"button",class:"cf-header__btn","aria-label":va?n.unmuteSounds:n.muteSounds,"aria-pressed":va,onClick:iv,children:va?_(lR,{}):_(sR,{})}),_("button",{type:"button",class:"cf-header__btn cf-header__close","aria-label":n.closeChat,onClick:Or,children:_(Lo,{})})]})]}),_("div",{class:"cf-panel__video",children:Wo?_("div",{class:"cf-analytics-focus",role:"region","aria-label":"Expanded analytics result",children:_(Rx,{visualization:Wo,expanded:!0,onClose:i5})}):!Fe&&_1?_(PR,{persona:o,starters:[],onPick:p,onFocusComposer:s5,speaking:Tc||c,voiceState:q,replyPending:j&&l&&!c,pinned:!0,muted:Ne,onToggleMute:Lc,onEndCall:Lt,onTalkNow:c5,showTalkNow:u5,micLevel:fr,theaterMode:It,onToggleTheater:n5,onMinimize:Or,audioDevices:Jd,selectedAudioDeviceId:tv,onSelectAudioDevice:l5,connectingOnly:dv}):null}),!dv&&_("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:di,role:"log",onScroll:r5,children:[qo.map((E,U)=>_(UR,{msg:E,persona:o,isLast:!Fe&&U===qo.length-1,visitor:u,hasEmail:f,lastQuestion:p5,showActions:!Fe&&U===qo.length-1&&!!E.handoffOffered,onPickReply:v5,onSubmitForm:I,onDemoSlots:N,onRetry:S,ratable:!Fe&&qo.slice(0,U).some(se=>se.role==="user"),onRate:w,onExpandVisualization:Fe?void 0:a5},E.id)),!Rc&&!Fe&&_(Se,{children:[qo.length===0&&_(wE,{name:o?.agentName??"Assistant",greeting:o?.greeting}),_(VR,{items:m,onPick:p}),_(GR,{items:g})]}),jE&&_("button",{type:"button",class:"cf-newmsg",onClick:Mn,children:[_(gR,{}),n.newMessages]})]}),_("div",{class:"cf-sr-live","aria-live":"polite","aria-atomic":"true",children:f5}),l&&!z&&!Fe&&_("div",{class:"cf-stopbar",children:_("button",{type:"button",class:"cf-stop",onClick:x,children:[_(fR,{}),n.stop]})}),Fe?_("div",{class:"cf-ended",children:_("button",{type:"button",class:"cf-ended__btn",onClick:et,children:n.backToChat})}):z?_("div",{class:"cf-ended",children:[_("p",{class:"cf-ended__text",children:n.conversationEnded}),e.csat&&Rc?QE?_("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"),c1(!0)},children:_(Mx,{})}),_("button",{type:"button",class:"cf-csat__btn","aria-label":n.feedbackNotHelpful,onClick:()=>{C("down"),c1(!0)},children:_(Ax,{})})]}):null,_("button",{type:"button",class:"cf-ended__btn",onClick:t5,children:n.startNewChat})]}):_(Se,{children:[v?_("div",{class:"cf-live-typing","aria-live":"polite",children:[v," is typing…"]}):null,hv&&hv.length>0&&_("div",{class:"cf-footer-actions",children:_(Lx,{actions:hv,visitor:u,onSubmitForm:I,onDemoSlots:N,scheduler:o?.scheduler})}),_(rE,{onSend:p,onSendGif:y,onTyping:b,disabled:l,allowVoice:!!o?.allowVoiceInput,onTranscribe:P,gifEnabled:Z,onSearchGifs:R,allowAttach:e.attachments,onExtract:L})]}),!z&&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"})]})]}),gi&&_("div",{class:"cf-confirm",onClick:()=>Go(!1),children:_("div",{class:"cf-confirm__card",role:"alertdialog","aria-modal":"true","aria-label":n.endChatConfirm,onClick:E=>E.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:s1,type:"button",class:"cf-confirm__btn cf-confirm__btn--cancel",onClick:()=>Go(!1),children:n.cancel}),_("button",{type:"button",class:"cf-confirm__btn cf-confirm__btn--danger",onClick:e5,children:n.endConfirmCta})]})]})}),l1&&_("div",{class:"cf-confirm",onClick:()=>Dc(!1),children:_("div",{class:"cf-history",role:"dialog","aria-modal":"true","aria-label":n.pastConversations,onClick:E=>E.stopPropagation(),children:[_("div",{class:"cf-history__head",children:[_("span",{children:n.pastConversations}),_("button",{type:"button",class:"cf-header__btn","aria-label":n.closeChat,onClick:()=>Dc(!1),children:_(Lo,{})})]}),_("div",{class:"cf-history__list",children:te.map(E=>_("button",{type:"button",class:`cf-history__item ${E.sessionId===de?"is-active":""}`,onClick:()=>{xe(E.sessionId),Dc(!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?` · ${n.historyEnded}`:""]})]},E.sessionId))})]})})]}),j&&!a?_(tE,{persona:o,voiceState:q,muted:Ne,onToggleMute:Lc,onEndCall:Lt,micLevel:fr,onExpand:mi}):It&&a?null:!e.hideDefaultLauncher&&_("button",{ref:Cc,type:"button",class:"cf-launcher","aria-label":a?n.closeChat:n.openChat,"aria-expanded":a,onClick:Uo,children:[e.launcherIcon?_("img",{class:"cf-launcher__img",src:e.launcherIcon,alt:""}):_(tR,{}),!a&&le>0&&_("span",{class:"cf-launcher__badge",children:le})]})]})})},GE="https://api.accurixtech.com",WE=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,analyticsContextToken:t.analyticsContextToken,identityToken:t.identityToken,getIdentityToken:t.getIdentityToken,apiBaseUrl:(t.apiBaseUrl??GE).replace(/\/$/,""),accentColor:t.accentColor,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:JL(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}},Jx=`
|
|
12
33
|
:host {
|
|
13
34
|
all: initial;
|
|
14
35
|
}
|
|
@@ -30,8 +51,8 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
30
51
|
bottom: 0;
|
|
31
52
|
right: 0;
|
|
32
53
|
font-family: var(--cf-font);
|
|
33
|
-
font-size:
|
|
34
|
-
line-height: 1.
|
|
54
|
+
font-size: 14px;
|
|
55
|
+
line-height: 1.45;
|
|
35
56
|
color: var(--cf-text);
|
|
36
57
|
-webkit-font-smoothing: antialiased;
|
|
37
58
|
}
|
|
@@ -138,24 +159,132 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
138
159
|
z-index: 2;
|
|
139
160
|
width: 384px;
|
|
140
161
|
max-width: calc(100vw - 32px);
|
|
141
|
-
height:
|
|
162
|
+
height: min(88vh, 820px);
|
|
163
|
+
min-height: 560px;
|
|
142
164
|
max-height: calc(100vh - 40px);
|
|
143
165
|
background: var(--cf-bg);
|
|
144
166
|
border-radius: var(--cf-radius);
|
|
145
167
|
box-shadow: var(--cf-shadow);
|
|
146
|
-
|
|
147
|
-
|
|
168
|
+
/* Grid (not flex) so theater mode below can reflow header/video/chat into a
|
|
169
|
+
two-column split purely in CSS, without reordering the DOM. */
|
|
170
|
+
display: grid;
|
|
171
|
+
grid-template-columns: 1fr;
|
|
172
|
+
grid-template-rows: auto auto minmax(0, 1fr);
|
|
173
|
+
grid-template-areas: 'header' 'video' 'chat';
|
|
148
174
|
overflow: hidden;
|
|
149
175
|
transform-origin: bottom right;
|
|
150
176
|
opacity: 0;
|
|
151
|
-
transform: translateY(
|
|
177
|
+
transform: translateY(22px) scale(0.94);
|
|
152
178
|
pointer-events: none;
|
|
153
|
-
transition: opacity 0.
|
|
179
|
+
transition: opacity 0.22s ease, transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
|
|
180
|
+
height 0.28s ease, width 0.28s ease;
|
|
154
181
|
}
|
|
155
182
|
.cf-panel.is-open {
|
|
156
183
|
opacity: 1;
|
|
157
184
|
transform: translateY(0) scale(1);
|
|
158
185
|
pointer-events: auto;
|
|
186
|
+
animation: cf-panel-open 0.34s cubic-bezier(0.16, 1, 0.3, 1) both;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.cf-panel > .cf-header { grid-area: header; }
|
|
190
|
+
/* Stacked ABOVE .cf-panel__chat (which sits right below it in the docked
|
|
191
|
+
layout) so the call bar's popover — which opens downward and overlaps
|
|
192
|
+
that space — paints over the transcript instead of getting interleaved
|
|
193
|
+
with message bubbles underneath it. */
|
|
194
|
+
.cf-panel__video {
|
|
195
|
+
grid-area: video;
|
|
196
|
+
position: relative;
|
|
197
|
+
z-index: 5;
|
|
198
|
+
min-width: 0;
|
|
199
|
+
}
|
|
200
|
+
.cf-panel__chat {
|
|
201
|
+
grid-area: chat;
|
|
202
|
+
display: flex;
|
|
203
|
+
flex-direction: column;
|
|
204
|
+
min-height: 0;
|
|
205
|
+
min-width: 0;
|
|
206
|
+
}
|
|
207
|
+
/* A live voice call gets more room for the transcript underneath the avatar card. */
|
|
208
|
+
.cf-panel.cf-panel--call {
|
|
209
|
+
height: min(90vh, 840px);
|
|
210
|
+
}
|
|
211
|
+
.cf-panel.cf-panel--voice-connecting {
|
|
212
|
+
height: min(72vh, 560px);
|
|
213
|
+
min-height: 420px;
|
|
214
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
215
|
+
grid-template-areas: 'header' 'video';
|
|
216
|
+
}
|
|
217
|
+
.cf-panel--voice-connecting .cf-panel__video {
|
|
218
|
+
display: grid;
|
|
219
|
+
min-height: 0;
|
|
220
|
+
}
|
|
221
|
+
/* Expanded "theater" view — video and chat side by side in a large centered
|
|
222
|
+
modal instead of the corner bubble. Only reachable from an active call's
|
|
223
|
+
expand button, so it never applies below the existing mobile breakpoint. */
|
|
224
|
+
@media (min-width: 640px) {
|
|
225
|
+
.cf-panel.cf-panel--theater {
|
|
226
|
+
inset: 0;
|
|
227
|
+
margin: auto;
|
|
228
|
+
width: min(1040px, calc(100vw - 48px));
|
|
229
|
+
height: min(760px, calc(100vh - 48px));
|
|
230
|
+
max-width: none;
|
|
231
|
+
max-height: none;
|
|
232
|
+
grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
|
|
233
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
234
|
+
grid-template-areas: 'header header' 'video chat';
|
|
235
|
+
}
|
|
236
|
+
.cf-panel.cf-panel--theater.is-open {
|
|
237
|
+
transform: none;
|
|
238
|
+
}
|
|
239
|
+
.cf-panel--theater .cf-panel__video { height: 100%; }
|
|
240
|
+
.cf-panel--theater .cf-assistant-card--pinned {
|
|
241
|
+
height: 100%;
|
|
242
|
+
margin: 0;
|
|
243
|
+
padding: 0;
|
|
244
|
+
border: 0;
|
|
245
|
+
border-right: 1px solid var(--cf-border);
|
|
246
|
+
}
|
|
247
|
+
.cf-panel--theater .cf-assistant-card--pinned .cf-assistant-card__stage {
|
|
248
|
+
height: 100%;
|
|
249
|
+
border-radius: 0;
|
|
250
|
+
}
|
|
251
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__face {
|
|
252
|
+
width: min(220px, 38vw);
|
|
253
|
+
height: min(220px, 38vw);
|
|
254
|
+
}
|
|
255
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__initials {
|
|
256
|
+
font-size: clamp(42px, 7vw, 76px);
|
|
257
|
+
transform: translateY(-14px);
|
|
258
|
+
}
|
|
259
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye {
|
|
260
|
+
top: 43%;
|
|
261
|
+
width: 11px;
|
|
262
|
+
height: 11px;
|
|
263
|
+
}
|
|
264
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye--left { left: 34%; }
|
|
265
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__eye--right { right: 34%; }
|
|
266
|
+
.cf-panel--theater .cf-assistant-card__media--generated .cf-assistant-card__mouth {
|
|
267
|
+
bottom: 27%;
|
|
268
|
+
width: 52px;
|
|
269
|
+
height: 8px;
|
|
270
|
+
}
|
|
271
|
+
.cf-panel--theater .cf-avatar-wave {
|
|
272
|
+
bottom: 92px;
|
|
273
|
+
}
|
|
274
|
+
/* The call bar sits near the BOTTOM of the full-height theater video pane
|
|
275
|
+
(vs. near the top of the short docked card), so its popover flips to
|
|
276
|
+
open upward here — there's room above it, none below. */
|
|
277
|
+
.cf-panel--theater .cf-call-menu {
|
|
278
|
+
top: auto;
|
|
279
|
+
bottom: calc(100% + 8px);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
.cf-theater-backdrop {
|
|
283
|
+
position: fixed;
|
|
284
|
+
inset: 0;
|
|
285
|
+
z-index: 1;
|
|
286
|
+
background: rgba(10, 14, 20, 0.55);
|
|
287
|
+
pointer-events: auto;
|
|
159
288
|
}
|
|
160
289
|
|
|
161
290
|
/* Left-aligned messenger (alignment: 'left') — dock to the left edge. */
|
|
@@ -191,6 +320,10 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
191
320
|
height: 100%;
|
|
192
321
|
object-fit: cover;
|
|
193
322
|
}
|
|
323
|
+
.cf-header__avatar[class*='cf-avatar-preset--'],
|
|
324
|
+
.cf-msg__avatar[class*='cf-avatar-preset--'] {
|
|
325
|
+
background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
|
|
326
|
+
}
|
|
194
327
|
.cf-header__meta {
|
|
195
328
|
min-width: 0;
|
|
196
329
|
flex: 1 1 auto;
|
|
@@ -279,12 +412,13 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
279
412
|
|
|
280
413
|
/* ---------- Body / messages ---------- */
|
|
281
414
|
.cf-body {
|
|
282
|
-
flex: 1;
|
|
415
|
+
flex: 1 1 0;
|
|
416
|
+
min-height: 0;
|
|
283
417
|
overflow-y: auto;
|
|
284
418
|
/* Never scroll/shift horizontally — a long source pill or code line is
|
|
285
419
|
clipped, not allowed to push the whole thread sideways. */
|
|
286
420
|
overflow-x: hidden;
|
|
287
|
-
padding:
|
|
421
|
+
padding: 12px 14px 8px;
|
|
288
422
|
display: flex;
|
|
289
423
|
flex-direction: column;
|
|
290
424
|
gap: 12px;
|
|
@@ -298,6 +432,38 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
298
432
|
background: var(--cf-border);
|
|
299
433
|
border-radius: 4px;
|
|
300
434
|
}
|
|
435
|
+
.cf-empty-welcome {
|
|
436
|
+
display: flex;
|
|
437
|
+
flex-direction: column;
|
|
438
|
+
gap: 5px;
|
|
439
|
+
margin: 4px 0 2px;
|
|
440
|
+
padding: 14px 14px 13px;
|
|
441
|
+
border-radius: 18px;
|
|
442
|
+
background:
|
|
443
|
+
radial-gradient(circle at 14% 0%, color-mix(in oklab, var(--cf-accent) 20%, transparent), transparent 34%),
|
|
444
|
+
linear-gradient(135deg, color-mix(in oklab, var(--cf-surface) 88%, var(--cf-bg)), var(--cf-bg));
|
|
445
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 78%, var(--cf-accent));
|
|
446
|
+
}
|
|
447
|
+
.cf-empty-welcome__eyebrow {
|
|
448
|
+
color: var(--cf-accent);
|
|
449
|
+
font-size: 10px;
|
|
450
|
+
font-weight: 800;
|
|
451
|
+
letter-spacing: 0.11em;
|
|
452
|
+
text-transform: uppercase;
|
|
453
|
+
}
|
|
454
|
+
.cf-empty-welcome h2 {
|
|
455
|
+
margin: 0;
|
|
456
|
+
color: var(--cf-text);
|
|
457
|
+
font-size: 17px;
|
|
458
|
+
line-height: 1.15;
|
|
459
|
+
letter-spacing: -0.02em;
|
|
460
|
+
}
|
|
461
|
+
.cf-empty-welcome p {
|
|
462
|
+
margin: 0;
|
|
463
|
+
color: var(--cf-muted);
|
|
464
|
+
font-size: 12.8px;
|
|
465
|
+
line-height: 1.45;
|
|
466
|
+
}
|
|
301
467
|
.cf-msg {
|
|
302
468
|
display: flex;
|
|
303
469
|
gap: 8px;
|
|
@@ -307,6 +473,10 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
307
473
|
.cf-msg--user {
|
|
308
474
|
justify-content: flex-end;
|
|
309
475
|
}
|
|
476
|
+
.cf-msg--system {
|
|
477
|
+
justify-content: center;
|
|
478
|
+
margin: 4px 0;
|
|
479
|
+
}
|
|
310
480
|
.cf-msg__avatar {
|
|
311
481
|
width: 26px;
|
|
312
482
|
height: 26px;
|
|
@@ -330,7 +500,7 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
330
500
|
words like "Hello" never split mid-word. */
|
|
331
501
|
overflow-wrap: break-word;
|
|
332
502
|
white-space: pre-wrap;
|
|
333
|
-
font-size:
|
|
503
|
+
font-size: 13.5px;
|
|
334
504
|
}
|
|
335
505
|
.cf-msg--agent .cf-msg__bubble {
|
|
336
506
|
background: var(--cf-surface);
|
|
@@ -351,6 +521,39 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
351
521
|
.cf-msg__bubble p:last-child { margin-bottom: 0; }
|
|
352
522
|
.cf-msg__col { min-width: 0; max-width: 85%; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
|
|
353
523
|
.cf-msg--user .cf-msg__col { align-items: flex-end; }
|
|
524
|
+
.cf-system-event {
|
|
525
|
+
width: min(220px, 86%);
|
|
526
|
+
display: grid;
|
|
527
|
+
justify-items: center;
|
|
528
|
+
gap: 6px;
|
|
529
|
+
text-align: center;
|
|
530
|
+
color: var(--cf-muted);
|
|
531
|
+
}
|
|
532
|
+
.cf-system-event__mark {
|
|
533
|
+
width: 40px;
|
|
534
|
+
height: 40px;
|
|
535
|
+
border-radius: 999px;
|
|
536
|
+
display: grid;
|
|
537
|
+
place-items: center;
|
|
538
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent, #2f7f55) 38%, transparent);
|
|
539
|
+
background: color-mix(in srgb, var(--cf-accent, #2f7f55) 8%, transparent);
|
|
540
|
+
}
|
|
541
|
+
.cf-system-event__mark .cf-msg__avatar {
|
|
542
|
+
align-self: center;
|
|
543
|
+
width: 28px;
|
|
544
|
+
height: 28px;
|
|
545
|
+
}
|
|
546
|
+
.cf-system-event__text {
|
|
547
|
+
font-size: 14px;
|
|
548
|
+
font-weight: 700;
|
|
549
|
+
line-height: 1.25;
|
|
550
|
+
color: var(--cf-text);
|
|
551
|
+
}
|
|
552
|
+
.cf-system-event__time {
|
|
553
|
+
font-size: 12px;
|
|
554
|
+
line-height: 1.2;
|
|
555
|
+
color: var(--cf-muted);
|
|
556
|
+
}
|
|
354
557
|
|
|
355
558
|
/* ---------- Markdown in answers ---------- */
|
|
356
559
|
.cf-msg__bubble .cf-md-h { font-weight: 700; font-size: 14.5px; margin: 4px 0 2px; }
|
|
@@ -459,20 +662,85 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
459
662
|
.cf-feedback__send:hover { opacity: 0.9; }
|
|
460
663
|
|
|
461
664
|
/* conversation starters */
|
|
462
|
-
.cf-starters {
|
|
665
|
+
.cf-starters {
|
|
666
|
+
display: flex;
|
|
667
|
+
flex-direction: column;
|
|
668
|
+
align-items: flex-start;
|
|
669
|
+
min-width: 0;
|
|
670
|
+
gap: 8px;
|
|
671
|
+
margin: 2px 0 4px 34px;
|
|
672
|
+
}
|
|
463
673
|
.cf-starter {
|
|
464
|
-
|
|
674
|
+
max-width: 100%;
|
|
675
|
+
padding: 8px 12px;
|
|
465
676
|
border-radius: 14px;
|
|
466
677
|
border: 1px solid var(--cf-border);
|
|
467
678
|
background: var(--cf-bg);
|
|
468
679
|
color: var(--cf-text);
|
|
469
|
-
font-size:
|
|
680
|
+
font-size: 12.8px;
|
|
470
681
|
font-weight: 500;
|
|
471
682
|
text-align: left;
|
|
683
|
+
overflow-wrap: anywhere;
|
|
472
684
|
transition: border-color 0.15s ease, transform 0.1s ease;
|
|
473
685
|
}
|
|
474
686
|
.cf-starter:hover { border-color: var(--cf-accent); }
|
|
475
687
|
.cf-starter:active { transform: scale(0.98); }
|
|
688
|
+
.cf-starter:focus-visible {
|
|
689
|
+
outline: 2px solid var(--cf-accent-2);
|
|
690
|
+
outline-offset: 2px;
|
|
691
|
+
}
|
|
692
|
+
.cf-featured-links {
|
|
693
|
+
display: flex;
|
|
694
|
+
flex-wrap: wrap;
|
|
695
|
+
align-items: flex-start;
|
|
696
|
+
min-width: 0;
|
|
697
|
+
gap: 8px;
|
|
698
|
+
margin: 2px 0 4px;
|
|
699
|
+
}
|
|
700
|
+
.cf-featured-link {
|
|
701
|
+
flex: 0 1 auto;
|
|
702
|
+
min-width: 0;
|
|
703
|
+
max-width: 100%;
|
|
704
|
+
display: inline-flex;
|
|
705
|
+
align-items: center;
|
|
706
|
+
gap: 7px;
|
|
707
|
+
min-width: 0;
|
|
708
|
+
min-height: 34px;
|
|
709
|
+
padding: 7px 11px;
|
|
710
|
+
border-radius: 999px;
|
|
711
|
+
border: 1px solid color-mix(in srgb, var(--cf-accent) 55%, var(--cf-border));
|
|
712
|
+
background: color-mix(in srgb, var(--cf-accent) 10%, var(--cf-bg));
|
|
713
|
+
color: var(--cf-text);
|
|
714
|
+
font-size: 13px;
|
|
715
|
+
font-weight: 500;
|
|
716
|
+
text-decoration: none;
|
|
717
|
+
transition: border-color 0.15s ease, background-color 0.15s ease;
|
|
718
|
+
}
|
|
719
|
+
.cf-featured-link svg {
|
|
720
|
+
width: 14px;
|
|
721
|
+
height: 14px;
|
|
722
|
+
flex: 0 0 14px;
|
|
723
|
+
}
|
|
724
|
+
.cf-featured-link svg {
|
|
725
|
+
width: 14px;
|
|
726
|
+
height: 14px;
|
|
727
|
+
flex: 0 0 14px;
|
|
728
|
+
color: var(--cf-accent);
|
|
729
|
+
}
|
|
730
|
+
.cf-featured-link span {
|
|
731
|
+
min-width: 0;
|
|
732
|
+
overflow: hidden;
|
|
733
|
+
text-overflow: ellipsis;
|
|
734
|
+
white-space: nowrap;
|
|
735
|
+
}
|
|
736
|
+
.cf-featured-link:hover {
|
|
737
|
+
border-color: var(--cf-accent);
|
|
738
|
+
background: color-mix(in srgb, var(--cf-accent) 16%, var(--cf-bg));
|
|
739
|
+
}
|
|
740
|
+
.cf-featured-link:focus-visible {
|
|
741
|
+
outline: 2px solid var(--cf-accent-2);
|
|
742
|
+
outline-offset: 2px;
|
|
743
|
+
}
|
|
476
744
|
|
|
477
745
|
/* stop generating */
|
|
478
746
|
.cf-stopbar { display: flex; justify-content: center; padding: 6px 0 2px; flex-shrink: 0; }
|
|
@@ -496,12 +764,20 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
496
764
|
/* typing */
|
|
497
765
|
.cf-typing {
|
|
498
766
|
display: inline-flex;
|
|
767
|
+
align-items: center;
|
|
499
768
|
gap: 4px;
|
|
500
|
-
padding: 13px
|
|
769
|
+
padding: 10px 13px;
|
|
770
|
+
min-width: 98px;
|
|
771
|
+
}
|
|
772
|
+
.cf-typing__label {
|
|
773
|
+
margin-right: 3px;
|
|
774
|
+
color: var(--cf-muted);
|
|
775
|
+
font-size: 12px;
|
|
776
|
+
font-weight: 650;
|
|
501
777
|
}
|
|
502
778
|
.cf-typing__dot {
|
|
503
|
-
width:
|
|
504
|
-
height:
|
|
779
|
+
width: 5px;
|
|
780
|
+
height: 5px;
|
|
505
781
|
border-radius: 50%;
|
|
506
782
|
background: var(--cf-muted);
|
|
507
783
|
animation: cf-typing 1.1s infinite ease-in-out;
|
|
@@ -568,7 +844,7 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
568
844
|
background: var(--cf-surface);
|
|
569
845
|
border: 1px solid var(--cf-border);
|
|
570
846
|
color: var(--cf-text);
|
|
571
|
-
font-size:
|
|
847
|
+
font-size: 12.8px;
|
|
572
848
|
font-weight: 600;
|
|
573
849
|
transition: border-color 0.15s ease, transform 0.1s ease;
|
|
574
850
|
}
|
|
@@ -759,6 +1035,13 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
759
1035
|
border-top: 1px solid var(--cf-border);
|
|
760
1036
|
background: var(--cf-bg);
|
|
761
1037
|
}
|
|
1038
|
+
.cf-live-typing {
|
|
1039
|
+
flex-shrink: 0;
|
|
1040
|
+
padding: 8px 14px 0;
|
|
1041
|
+
color: var(--cf-muted);
|
|
1042
|
+
font-size: 12px;
|
|
1043
|
+
background: var(--cf-bg);
|
|
1044
|
+
}
|
|
762
1045
|
.cf-composer__field {
|
|
763
1046
|
display: flex;
|
|
764
1047
|
align-items: flex-end;
|
|
@@ -770,6 +1053,23 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
770
1053
|
transition: border-color 0.15s ease;
|
|
771
1054
|
}
|
|
772
1055
|
.cf-composer__field:focus-within { border-color: var(--cf-accent); }
|
|
1056
|
+
.cf-voice-state {
|
|
1057
|
+
display: inline-flex;
|
|
1058
|
+
align-items: center;
|
|
1059
|
+
gap: 8px;
|
|
1060
|
+
margin: 0 0 8px 2px;
|
|
1061
|
+
color: var(--cf-muted);
|
|
1062
|
+
font-size: 12.5px;
|
|
1063
|
+
}
|
|
1064
|
+
.cf-voice-state__dot {
|
|
1065
|
+
width: 8px;
|
|
1066
|
+
height: 8px;
|
|
1067
|
+
border-radius: 999px;
|
|
1068
|
+
background: var(--cf-accent);
|
|
1069
|
+
}
|
|
1070
|
+
.cf-voice-state__dot.is-live {
|
|
1071
|
+
animation: cf-pulse 1s infinite;
|
|
1072
|
+
}
|
|
773
1073
|
.cf-textarea {
|
|
774
1074
|
flex: 1;
|
|
775
1075
|
border: none;
|
|
@@ -902,255 +1202,1883 @@ ${D}`.trim()}else!q&&_&&(q=_);const xe={id:ne(),role:"user",content:k,imageUrl:_
|
|
|
902
1202
|
.cf-footer a { color: var(--cf-muted); text-decoration: none; font-weight: 600; }
|
|
903
1203
|
.cf-footer a:hover { color: var(--cf-accent); }
|
|
904
1204
|
|
|
905
|
-
/* ----------
|
|
906
|
-
.cf-
|
|
907
|
-
.cf-welcome__desc { margin: 0 0 4px; font-size: 14px; font-weight: 600; color: var(--cf-text); }
|
|
908
|
-
.cf-welcome__sub { margin: 0; font-size: 12.5px; color: var(--cf-muted); }
|
|
909
|
-
|
|
910
|
-
/* Offline presence dot (amber instead of green). */
|
|
911
|
-
.cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
|
|
912
|
-
|
|
913
|
-
/* Disclaimer fine-print under the composer. */
|
|
914
|
-
.cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
|
|
915
|
-
|
|
916
|
-
/* Read-only banner shown while viewing a past conversation. */
|
|
917
|
-
.cf-viewing-banner {
|
|
918
|
-
padding: 7px 16px;
|
|
919
|
-
font-size: 12px;
|
|
920
|
-
font-weight: 600;
|
|
921
|
-
text-align: center;
|
|
922
|
-
color: var(--cf-muted);
|
|
923
|
-
background: var(--cf-surface);
|
|
924
|
-
border-bottom: 1px solid var(--cf-border);
|
|
1205
|
+
/* ---------- Footer lead actions ---------- */
|
|
1206
|
+
.cf-footer-actions {
|
|
925
1207
|
flex-shrink: 0;
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
/* Past-conversations history panel (over the chat, like the confirm dialog). */
|
|
929
|
-
.cf-history {
|
|
930
|
-
width: min(340px, 90%);
|
|
931
|
-
max-height: 70%;
|
|
932
|
-
display: flex;
|
|
933
|
-
flex-direction: column;
|
|
1208
|
+
padding: 6px 14px 5px;
|
|
934
1209
|
background: var(--cf-bg);
|
|
1210
|
+
border-top: 1px solid var(--cf-border);
|
|
1211
|
+
}
|
|
1212
|
+
.cf-action-trigger {
|
|
1213
|
+
display: grid;
|
|
1214
|
+
grid-template-columns: 28px minmax(0, 1fr) 16px;
|
|
1215
|
+
align-items: center;
|
|
1216
|
+
gap: 8px;
|
|
1217
|
+
width: 100%;
|
|
1218
|
+
min-height: 40px;
|
|
1219
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
|
|
935
1220
|
border-radius: 14px;
|
|
936
|
-
|
|
1221
|
+
padding: 6px 9px;
|
|
1222
|
+
background:
|
|
1223
|
+
radial-gradient(circle at 15% 0%, color-mix(in oklab, var(--cf-accent) 15%, transparent), transparent 40%),
|
|
1224
|
+
color-mix(in oklab, var(--cf-bg-soft) 78%, transparent);
|
|
1225
|
+
color: var(--cf-text);
|
|
1226
|
+
text-align: left;
|
|
1227
|
+
cursor: pointer;
|
|
1228
|
+
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
|
|
1229
|
+
}
|
|
1230
|
+
.cf-action-trigger:hover {
|
|
1231
|
+
border-color: color-mix(in oklab, var(--cf-accent) 46%, var(--cf-border));
|
|
1232
|
+
}
|
|
1233
|
+
.cf-action-trigger > svg {
|
|
1234
|
+
width: 14px;
|
|
1235
|
+
height: 14px;
|
|
1236
|
+
color: var(--cf-muted);
|
|
1237
|
+
}
|
|
1238
|
+
.cf-action-trigger__icon {
|
|
1239
|
+
display: inline-flex;
|
|
1240
|
+
align-items: center;
|
|
1241
|
+
justify-content: center;
|
|
1242
|
+
width: 28px;
|
|
1243
|
+
height: 28px;
|
|
1244
|
+
border-radius: 10px;
|
|
1245
|
+
background: color-mix(in oklab, var(--cf-accent) 15%, transparent);
|
|
1246
|
+
color: var(--cf-accent);
|
|
1247
|
+
}
|
|
1248
|
+
.cf-action-trigger__icon svg { width: 14px; height: 14px; }
|
|
1249
|
+
.cf-action-trigger__copy {
|
|
1250
|
+
display: grid;
|
|
1251
|
+
gap: 1px;
|
|
1252
|
+
min-width: 0;
|
|
1253
|
+
}
|
|
1254
|
+
.cf-action-trigger__copy strong {
|
|
1255
|
+
font-size: 12px;
|
|
1256
|
+
line-height: 1.1;
|
|
1257
|
+
}
|
|
1258
|
+
.cf-action-trigger__copy small {
|
|
937
1259
|
overflow: hidden;
|
|
1260
|
+
color: var(--cf-muted);
|
|
1261
|
+
font-size: 10.5px;
|
|
1262
|
+
line-height: 1.2;
|
|
1263
|
+
text-overflow: ellipsis;
|
|
1264
|
+
white-space: nowrap;
|
|
938
1265
|
}
|
|
939
|
-
.cf-
|
|
1266
|
+
.cf-action-drawer {
|
|
1267
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 86%, var(--cf-accent));
|
|
1268
|
+
border-radius: 18px 18px 12px 12px;
|
|
1269
|
+
padding: 7px;
|
|
1270
|
+
background:
|
|
1271
|
+
radial-gradient(circle at 18% 0%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 38%),
|
|
1272
|
+
color-mix(in oklab, var(--cf-bg) 94%, #ffffff);
|
|
1273
|
+
box-shadow: 0 -10px 34px rgba(15, 23, 42, 0.14);
|
|
1274
|
+
animation: cf-drawer-up 0.24s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1275
|
+
}
|
|
1276
|
+
.cf-action-drawer__handle {
|
|
1277
|
+
width: 36px;
|
|
1278
|
+
height: 3px;
|
|
1279
|
+
margin: 0 auto 6px;
|
|
1280
|
+
border-radius: 999px;
|
|
1281
|
+
background: color-mix(in oklab, var(--cf-muted) 42%, transparent);
|
|
1282
|
+
}
|
|
1283
|
+
.cf-action-drawer__head {
|
|
940
1284
|
display: flex;
|
|
941
1285
|
align-items: center;
|
|
942
1286
|
justify-content: space-between;
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
font-weight: 700;
|
|
1287
|
+
gap: 10px;
|
|
1288
|
+
padding: 0 3px 6px;
|
|
946
1289
|
color: var(--cf-text);
|
|
947
|
-
border-bottom: 1px solid var(--cf-border);
|
|
948
1290
|
}
|
|
949
|
-
.cf-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
1291
|
+
.cf-action-drawer__head strong {
|
|
1292
|
+
display: block;
|
|
1293
|
+
font-size: 13px;
|
|
1294
|
+
line-height: 1.2;
|
|
1295
|
+
}
|
|
1296
|
+
.cf-action-drawer__eyebrow {
|
|
1297
|
+
display: block;
|
|
1298
|
+
margin-bottom: 2px;
|
|
1299
|
+
font-size: 9px;
|
|
1300
|
+
font-weight: 800;
|
|
1301
|
+
letter-spacing: 0.16em;
|
|
1302
|
+
text-transform: uppercase;
|
|
1303
|
+
color: var(--cf-muted);
|
|
1304
|
+
}
|
|
1305
|
+
.cf-action-drawer__close {
|
|
1306
|
+
display: inline-flex;
|
|
1307
|
+
align-items: center;
|
|
1308
|
+
justify-content: center;
|
|
1309
|
+
width: 28px;
|
|
1310
|
+
height: 28px;
|
|
1311
|
+
border: 1px solid var(--cf-border);
|
|
1312
|
+
border-radius: 999px;
|
|
1313
|
+
background: var(--cf-bg-soft);
|
|
1314
|
+
color: var(--cf-muted);
|
|
958
1315
|
cursor: pointer;
|
|
959
|
-
transition: background 0.15s ease;
|
|
960
1316
|
}
|
|
961
|
-
.cf-
|
|
962
|
-
.cf-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
flex-direction: column;
|
|
1317
|
+
.cf-action-drawer__close svg { width: 14px; height: 14px; }
|
|
1318
|
+
.cf-action-drawer__grid {
|
|
1319
|
+
display: grid;
|
|
1320
|
+
gap: 6px;
|
|
1321
|
+
}
|
|
1322
|
+
.cf-action-card {
|
|
1323
|
+
display: grid;
|
|
1324
|
+
grid-template-columns: 30px minmax(0, 1fr) 14px;
|
|
970
1325
|
align-items: center;
|
|
971
|
-
gap:
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
1326
|
+
gap: 8px;
|
|
1327
|
+
width: 100%;
|
|
1328
|
+
border: 1px solid var(--cf-border);
|
|
1329
|
+
border-radius: 14px;
|
|
1330
|
+
padding: 7px 8px;
|
|
1331
|
+
background: color-mix(in oklab, var(--cf-bg-soft) 72%, transparent);
|
|
1332
|
+
color: var(--cf-text);
|
|
1333
|
+
text-align: left;
|
|
1334
|
+
cursor: pointer;
|
|
1335
|
+
transition:
|
|
1336
|
+
transform 0.16s ease,
|
|
1337
|
+
border-color 0.16s ease,
|
|
1338
|
+
background 0.16s ease;
|
|
1339
|
+
}
|
|
1340
|
+
.cf-action-card:hover {
|
|
1341
|
+
border-color: color-mix(in oklab, var(--cf-accent) 44%, var(--cf-border));
|
|
1342
|
+
background: color-mix(in oklab, var(--cf-accent) 9%, var(--cf-bg-soft));
|
|
1343
|
+
}
|
|
1344
|
+
.cf-action-card:active { transform: translateY(1px); }
|
|
1345
|
+
.cf-action-card > svg {
|
|
1346
|
+
width: 13px;
|
|
1347
|
+
height: 13px;
|
|
1348
|
+
color: var(--cf-muted);
|
|
1349
|
+
transform: rotate(-90deg);
|
|
975
1350
|
}
|
|
976
|
-
.cf-
|
|
977
|
-
.cf-csat { display: inline-flex; align-items: center; gap: 8px; }
|
|
978
|
-
.cf-csat__q { font-size: 12.5px; color: var(--cf-muted); }
|
|
979
|
-
.cf-csat__btn {
|
|
1351
|
+
.cf-action-card__icon {
|
|
980
1352
|
display: inline-flex;
|
|
981
1353
|
align-items: center;
|
|
982
1354
|
justify-content: center;
|
|
983
1355
|
width: 30px;
|
|
984
1356
|
height: 30px;
|
|
985
|
-
border-radius:
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
transition: background 0.15s ease, color 0.15s ease;
|
|
1357
|
+
border-radius: 10px;
|
|
1358
|
+
background: color-mix(in oklab, var(--cf-accent) 14%, transparent);
|
|
1359
|
+
color: var(--cf-accent);
|
|
989
1360
|
}
|
|
990
|
-
.cf-
|
|
991
|
-
.cf-
|
|
992
|
-
|
|
1361
|
+
.cf-action-card__icon svg { width: 14px; height: 14px; }
|
|
1362
|
+
.cf-action-card__copy {
|
|
1363
|
+
display: grid;
|
|
1364
|
+
gap: 2px;
|
|
1365
|
+
min-width: 0;
|
|
1366
|
+
}
|
|
1367
|
+
.cf-action-card__copy strong {
|
|
1368
|
+
font-size: 12px;
|
|
1369
|
+
line-height: 1.2;
|
|
1370
|
+
}
|
|
1371
|
+
.cf-action-card__copy small {
|
|
1372
|
+
overflow: hidden;
|
|
1373
|
+
color: var(--cf-muted);
|
|
1374
|
+
font-size: 10.5px;
|
|
1375
|
+
line-height: 1.25;
|
|
1376
|
+
text-overflow: ellipsis;
|
|
1377
|
+
white-space: nowrap;
|
|
1378
|
+
}
|
|
1379
|
+
.cf-action-drawer__note {
|
|
1380
|
+
margin: 6px 3px 0;
|
|
1381
|
+
color: var(--cf-muted);
|
|
1382
|
+
font-size: 10px;
|
|
1383
|
+
line-height: 1.25;
|
|
1384
|
+
}
|
|
1385
|
+
.cf-action-drawer .cf-form,
|
|
1386
|
+
.cf-action-drawer .cf-booking {
|
|
1387
|
+
max-width: none;
|
|
1388
|
+
margin: 0;
|
|
1389
|
+
border: 0;
|
|
1390
|
+
background: transparent;
|
|
1391
|
+
box-shadow: none;
|
|
1392
|
+
}
|
|
1393
|
+
.cf-footer-actions .cf-actions {
|
|
1394
|
+
display: grid;
|
|
1395
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
1396
|
+
gap: 7px;
|
|
1397
|
+
}
|
|
1398
|
+
.cf-footer-actions .cf-action {
|
|
1399
|
+
justify-content: center;
|
|
1400
|
+
min-width: 0;
|
|
1401
|
+
gap: 5px;
|
|
1402
|
+
min-height: 32px;
|
|
1403
|
+
border-radius: 11px;
|
|
1404
|
+
padding: 6px 8px;
|
|
1405
|
+
font-size: 12px;
|
|
1406
|
+
line-height: 1.15;
|
|
1407
|
+
font-weight: 650;
|
|
1408
|
+
}
|
|
1409
|
+
.cf-footer-actions .cf-action svg {
|
|
1410
|
+
width: 13px;
|
|
1411
|
+
height: 13px;
|
|
1412
|
+
}
|
|
1413
|
+
.cf-footer-actions .cf-form,
|
|
1414
|
+
.cf-footer-actions .cf-booking {
|
|
1415
|
+
max-width: none;
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
@keyframes cf-drawer-up {
|
|
1419
|
+
from {
|
|
1420
|
+
opacity: 0;
|
|
1421
|
+
transform: translateY(14px) scale(0.98);
|
|
1422
|
+
}
|
|
1423
|
+
to {
|
|
1424
|
+
opacity: 1;
|
|
1425
|
+
transform: translateY(0) scale(1);
|
|
1426
|
+
}
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
/* ---------- Assistant card module ---------- */
|
|
1430
|
+
.cf-assistant-card {
|
|
1431
|
+
display: flex;
|
|
1432
|
+
flex-direction: column;
|
|
1433
|
+
gap: 12px;
|
|
1434
|
+
margin: 0 2px 4px;
|
|
1435
|
+
animation: cf-msg-in 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1436
|
+
}
|
|
1437
|
+
.cf-assistant-card--pinned {
|
|
1438
|
+
flex-shrink: 0;
|
|
1439
|
+
gap: 0;
|
|
1440
|
+
margin: 0;
|
|
1441
|
+
padding: 8px 14px 10px;
|
|
1442
|
+
border-bottom: 1px solid var(--cf-border);
|
|
1443
|
+
background: var(--cf-bg);
|
|
1444
|
+
}
|
|
1445
|
+
.cf-assistant-card--compact {
|
|
1446
|
+
align-items: flex-start;
|
|
1447
|
+
padding-top: 10px;
|
|
1448
|
+
padding-bottom: 12px;
|
|
1449
|
+
}
|
|
1450
|
+
.cf-assistant-card__compact-speak {
|
|
1451
|
+
position: relative;
|
|
1452
|
+
isolation: isolate;
|
|
1453
|
+
display: inline-flex;
|
|
1454
|
+
align-items: center;
|
|
1455
|
+
gap: 8px;
|
|
1456
|
+
max-width: 100%;
|
|
1457
|
+
min-height: 44px;
|
|
1458
|
+
padding: 5px 15px 5px 6px;
|
|
1459
|
+
border-radius: 999px;
|
|
1460
|
+
background:
|
|
1461
|
+
linear-gradient(180deg, color-mix(in oklab, var(--cf-accent) 13%, var(--cf-surface)), color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface))),
|
|
1462
|
+
var(--cf-bg);
|
|
1463
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 58%, var(--cf-border));
|
|
1464
|
+
color: var(--cf-text);
|
|
1465
|
+
box-shadow:
|
|
1466
|
+
inset 0 1px 0 color-mix(in oklab, #fff 13%, transparent),
|
|
1467
|
+
0 13px 30px -22px color-mix(in oklab, var(--cf-accent) 60%, #000);
|
|
1468
|
+
font-size: 12.25px;
|
|
1469
|
+
font-weight: 750;
|
|
1470
|
+
line-height: 1;
|
|
1471
|
+
transition: border-color 0.15s ease, transform 0.12s ease, background 0.15s ease, box-shadow 0.15s ease;
|
|
1472
|
+
overflow: hidden;
|
|
1473
|
+
}
|
|
1474
|
+
.cf-assistant-card__compact-speak::before {
|
|
1475
|
+
content: '';
|
|
1476
|
+
position: absolute;
|
|
1477
|
+
inset: 1px;
|
|
1478
|
+
z-index: -1;
|
|
1479
|
+
border-radius: inherit;
|
|
1480
|
+
background:
|
|
1481
|
+
radial-gradient(circle at 20% 10%, color-mix(in oklab, var(--cf-accent) 28%, transparent), transparent 42%),
|
|
1482
|
+
radial-gradient(circle at 85% 100%, color-mix(in oklab, var(--cf-accent-2) 18%, transparent), transparent 38%);
|
|
1483
|
+
opacity: 0.76;
|
|
1484
|
+
pointer-events: none;
|
|
1485
|
+
}
|
|
1486
|
+
.cf-assistant-card__compact-speak:hover {
|
|
1487
|
+
border-color: color-mix(in oklab, var(--cf-accent) 82%, var(--cf-border));
|
|
1488
|
+
box-shadow:
|
|
1489
|
+
inset 0 1px 0 color-mix(in oklab, #fff 15%, transparent),
|
|
1490
|
+
0 16px 34px -22px color-mix(in oklab, var(--cf-accent) 76%, #000);
|
|
1491
|
+
}
|
|
1492
|
+
.cf-assistant-card__compact-speak:active { transform: scale(0.98); }
|
|
1493
|
+
.cf-assistant-card__compact-speak:focus-visible {
|
|
1494
|
+
outline: 2px solid var(--cf-accent-2);
|
|
1495
|
+
outline-offset: 2px;
|
|
1496
|
+
}
|
|
1497
|
+
.cf-assistant-card__compact-mic {
|
|
1498
|
+
width: 24px;
|
|
1499
|
+
height: 24px;
|
|
1500
|
+
margin-left: -14px;
|
|
1501
|
+
border-radius: 999px;
|
|
1502
|
+
display: inline-flex;
|
|
1503
|
+
align-items: center;
|
|
1504
|
+
justify-content: center;
|
|
1505
|
+
flex-shrink: 0;
|
|
1506
|
+
color: var(--cf-accent);
|
|
1507
|
+
background: color-mix(in oklab, var(--cf-bg) 90%, transparent);
|
|
1508
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 48%, var(--cf-border));
|
|
1509
|
+
box-shadow: 0 7px 18px -12px rgba(0, 0, 0, 0.75);
|
|
1510
|
+
}
|
|
1511
|
+
.cf-assistant-card__compact-mic svg {
|
|
1512
|
+
width: 13px;
|
|
1513
|
+
height: 13px;
|
|
1514
|
+
color: var(--cf-accent);
|
|
1515
|
+
flex-shrink: 0;
|
|
1516
|
+
}
|
|
1517
|
+
.cf-assistant-card__compact-mic:first-child {
|
|
1518
|
+
margin-left: 0;
|
|
1519
|
+
}
|
|
1520
|
+
.cf-assistant-card__compact-label {
|
|
1521
|
+
min-width: 0;
|
|
1522
|
+
overflow: hidden;
|
|
1523
|
+
text-overflow: ellipsis;
|
|
1524
|
+
white-space: nowrap;
|
|
1525
|
+
letter-spacing: 0.01em;
|
|
1526
|
+
}
|
|
1527
|
+
.cf-assistant-card__compact-avatar {
|
|
1528
|
+
width: 34px;
|
|
1529
|
+
height: 34px;
|
|
1530
|
+
border-radius: 999px;
|
|
1531
|
+
display: grid;
|
|
1532
|
+
place-items: center;
|
|
1533
|
+
flex-shrink: 0;
|
|
1534
|
+
overflow: hidden;
|
|
1535
|
+
color: #fff;
|
|
1536
|
+
background: linear-gradient(135deg, var(--cf-avatar-a, var(--cf-accent)), var(--cf-avatar-b, var(--cf-accent-2)));
|
|
1537
|
+
border: 1px solid color-mix(in oklab, #fff 24%, transparent);
|
|
1538
|
+
box-shadow:
|
|
1539
|
+
0 0 0 3px color-mix(in oklab, var(--cf-accent) 16%, transparent),
|
|
1540
|
+
inset 0 1px 0 color-mix(in oklab, #fff 18%, transparent);
|
|
1541
|
+
font-size: 11px;
|
|
1542
|
+
font-weight: 800;
|
|
1543
|
+
}
|
|
1544
|
+
.cf-assistant-card__compact-avatar img {
|
|
1545
|
+
width: 100%;
|
|
1546
|
+
height: 100%;
|
|
1547
|
+
object-fit: cover;
|
|
1548
|
+
}
|
|
1549
|
+
.cf-assistant-card--pinned .cf-assistant-card__stage {
|
|
1550
|
+
height: 132px;
|
|
1551
|
+
min-height: 0;
|
|
1552
|
+
border-radius: 13px;
|
|
1553
|
+
}
|
|
1554
|
+
/* The stage sizes/positions the card's video area; .cf-assistant-card__media
|
|
1555
|
+
inside it stays overflow: hidden for the rounded image/video corners,
|
|
1556
|
+
while interactive controls sit as a stage sibling so their popovers
|
|
1557
|
+
aren't clipped by it. */
|
|
1558
|
+
.cf-assistant-card__stage {
|
|
1559
|
+
position: relative;
|
|
1560
|
+
border-radius: 12px;
|
|
1561
|
+
aspect-ratio: 16 / 9;
|
|
1562
|
+
}
|
|
1563
|
+
.cf-assistant-card__voice-only {
|
|
1564
|
+
position: relative;
|
|
1565
|
+
display: flex;
|
|
1566
|
+
align-items: center;
|
|
1567
|
+
justify-content: center;
|
|
1568
|
+
width: 100%;
|
|
1569
|
+
min-height: 44px;
|
|
1570
|
+
align-self: stretch;
|
|
1571
|
+
}
|
|
1572
|
+
.cf-assistant-card__media {
|
|
1573
|
+
position: absolute;
|
|
1574
|
+
inset: 0;
|
|
1575
|
+
overflow: hidden;
|
|
1576
|
+
border-radius: inherit;
|
|
1577
|
+
background: var(--cf-surface);
|
|
1578
|
+
border: 1px solid var(--cf-border);
|
|
1579
|
+
}
|
|
1580
|
+
.cf-assistant-card__stage--local {
|
|
1581
|
+
isolation: isolate;
|
|
1582
|
+
overflow: hidden;
|
|
1583
|
+
background:
|
|
1584
|
+
radial-gradient(circle at 30% 18%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 36%),
|
|
1585
|
+
linear-gradient(145deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
|
|
1586
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 82%, var(--cf-accent));
|
|
1587
|
+
box-shadow:
|
|
1588
|
+
inset 0 1px 0 color-mix(in oklab, #fff 9%, transparent),
|
|
1589
|
+
0 22px 44px -34px color-mix(in oklab, var(--cf-accent) 46%, #000);
|
|
1590
|
+
}
|
|
1591
|
+
.cf-assistant-card__stage--local.is-live {
|
|
1592
|
+
height: 188px;
|
|
1593
|
+
aspect-ratio: auto;
|
|
1594
|
+
}
|
|
1595
|
+
.cf-assistant-card--pinned .cf-assistant-card__stage--local.is-live {
|
|
1596
|
+
height: 154px;
|
|
1597
|
+
}
|
|
1598
|
+
.cf-assistant-card__stage--local.is-speaking {
|
|
1599
|
+
box-shadow:
|
|
1600
|
+
inset 0 1px 0 color-mix(in oklab, #fff 11%, transparent),
|
|
1601
|
+
0 20px 54px -28px color-mix(in oklab, var(--cf-accent) 72%, #000);
|
|
1602
|
+
}
|
|
1603
|
+
.cf-assistant-card__stage--local.is-listening {
|
|
1604
|
+
border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
|
|
1605
|
+
}
|
|
1606
|
+
.cf-assistant-card__stage--local.is-muted {
|
|
1607
|
+
filter: saturate(0.72);
|
|
1608
|
+
}
|
|
1609
|
+
.cf-assistant-card__stage--local .cf-assistant-card__media {
|
|
1610
|
+
z-index: 1;
|
|
1611
|
+
border: 0;
|
|
1612
|
+
background:
|
|
1613
|
+
radial-gradient(circle at 50% 42%, color-mix(in oklab, var(--cf-accent) 18%, transparent), transparent 38%),
|
|
1614
|
+
color-mix(in oklab, var(--cf-bg) 92%, var(--cf-surface));
|
|
1615
|
+
}
|
|
1616
|
+
.cf-assistant-card__media--uploaded::after {
|
|
1617
|
+
content: '';
|
|
1618
|
+
position: absolute;
|
|
1619
|
+
inset: 0;
|
|
1620
|
+
pointer-events: none;
|
|
1621
|
+
background:
|
|
1622
|
+
radial-gradient(circle at 50% 50%, transparent 28%, rgba(2, 6, 23, 0.08) 62%, rgba(2, 6, 23, 0.34) 100%),
|
|
1623
|
+
linear-gradient(180deg, transparent 52%, rgba(2, 6, 23, 0.26));
|
|
1624
|
+
}
|
|
1625
|
+
.cf-assistant-card__media img,
|
|
1626
|
+
.cf-assistant-card__media video {
|
|
1627
|
+
width: 100%;
|
|
1628
|
+
height: 100%;
|
|
1629
|
+
display: block;
|
|
1630
|
+
object-fit: cover;
|
|
1631
|
+
}
|
|
1632
|
+
.cf-avatar-aura {
|
|
1633
|
+
position: absolute;
|
|
1634
|
+
left: 50%;
|
|
1635
|
+
top: 50%;
|
|
1636
|
+
width: 104px;
|
|
1637
|
+
height: 104px;
|
|
1638
|
+
border-radius: 999px;
|
|
1639
|
+
transform: translate(-50%, -50%) scale(0.88);
|
|
1640
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 42%, transparent);
|
|
1641
|
+
opacity: 0;
|
|
1642
|
+
pointer-events: none;
|
|
1643
|
+
z-index: 3;
|
|
1644
|
+
}
|
|
1645
|
+
.cf-avatar-aura--two {
|
|
1646
|
+
width: 142px;
|
|
1647
|
+
height: 142px;
|
|
1648
|
+
}
|
|
1649
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--one {
|
|
1650
|
+
animation: cf-avatar-breathe 1.35s ease-in-out infinite;
|
|
1651
|
+
}
|
|
1652
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-aura--two {
|
|
1653
|
+
animation: cf-avatar-breathe 1.35s ease-in-out infinite 0.32s;
|
|
1654
|
+
}
|
|
1655
|
+
.cf-avatar-listen-ring {
|
|
1656
|
+
position: absolute;
|
|
1657
|
+
left: 50%;
|
|
1658
|
+
top: 50%;
|
|
1659
|
+
width: calc(112px + (var(--cf-listen, 0.2) * 42px));
|
|
1660
|
+
height: calc(112px + (var(--cf-listen, 0.2) * 42px));
|
|
1661
|
+
border-radius: 999px;
|
|
1662
|
+
transform: translate(-50%, -50%);
|
|
1663
|
+
border: 2px solid color-mix(in oklab, var(--cf-accent) 58%, transparent);
|
|
1664
|
+
box-shadow: 0 0 calc(14px + (var(--cf-listen, 0.2) * 24px)) color-mix(in oklab, var(--cf-accent) 34%, transparent);
|
|
1665
|
+
opacity: 0;
|
|
1666
|
+
pointer-events: none;
|
|
1667
|
+
z-index: 4;
|
|
1668
|
+
}
|
|
1669
|
+
.cf-assistant-card__stage--local.is-listening .cf-avatar-listen-ring {
|
|
1670
|
+
opacity: calc(0.36 + (var(--cf-listen, 0.2) * 0.42));
|
|
1671
|
+
}
|
|
1672
|
+
.cf-avatar-wave {
|
|
1673
|
+
position: absolute;
|
|
1674
|
+
left: 50%;
|
|
1675
|
+
bottom: 46px;
|
|
1676
|
+
z-index: 6;
|
|
1677
|
+
display: inline-flex;
|
|
1678
|
+
align-items: center;
|
|
1679
|
+
justify-content: center;
|
|
1680
|
+
gap: 4px;
|
|
1681
|
+
min-width: 58px;
|
|
1682
|
+
height: 25px;
|
|
1683
|
+
padding: 5px 8px;
|
|
1684
|
+
border-radius: 999px;
|
|
1685
|
+
transform: translateX(-50%) translateY(8px);
|
|
1686
|
+
background: color-mix(in oklab, var(--cf-bg) 82%, transparent);
|
|
1687
|
+
border: 1px solid color-mix(in oklab, var(--cf-accent) 36%, transparent);
|
|
1688
|
+
opacity: 0;
|
|
1689
|
+
pointer-events: none;
|
|
1690
|
+
backdrop-filter: blur(10px);
|
|
1691
|
+
}
|
|
1692
|
+
.cf-avatar-wave span {
|
|
1693
|
+
width: 4px;
|
|
1694
|
+
height: 8px;
|
|
1695
|
+
border-radius: 999px;
|
|
1696
|
+
background: color-mix(in oklab, var(--cf-accent) 88%, #fff);
|
|
1697
|
+
transform-origin: center;
|
|
1698
|
+
}
|
|
1699
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave {
|
|
1700
|
+
opacity: 1;
|
|
1701
|
+
transform: translateX(-50%) translateY(0);
|
|
1702
|
+
}
|
|
1703
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span {
|
|
1704
|
+
animation: cf-avatar-wave 0.58s ease-in-out infinite;
|
|
1705
|
+
}
|
|
1706
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(2) { animation-delay: 0.1s; }
|
|
1707
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(3) { animation-delay: 0.2s; }
|
|
1708
|
+
.cf-assistant-card__stage--local.is-speaking .cf-avatar-wave span:nth-child(4) { animation-delay: 0.3s; }
|
|
1709
|
+
.cf-assistant-card__stage--local.is-thinking .cf-assistant-card__media::before {
|
|
1710
|
+
content: '';
|
|
1711
|
+
position: absolute;
|
|
1712
|
+
inset: -35%;
|
|
1713
|
+
z-index: 5;
|
|
1714
|
+
pointer-events: none;
|
|
1715
|
+
background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 20%, transparent) 50%, transparent 58%);
|
|
1716
|
+
animation: cf-avatar-thinking 1.45s ease-in-out infinite;
|
|
1717
|
+
}
|
|
1718
|
+
.cf-assistant-card__avatar-stage {
|
|
1719
|
+
position: absolute;
|
|
1720
|
+
inset: 0;
|
|
1721
|
+
display: grid;
|
|
1722
|
+
place-items: center;
|
|
1723
|
+
--cf-avatar-a: var(--cf-accent);
|
|
1724
|
+
--cf-avatar-b: color-mix(in oklab, var(--cf-accent) 70%, #0f1f2e);
|
|
1725
|
+
--cf-avatar-glow: color-mix(in oklab, var(--cf-accent) 38%, transparent);
|
|
1726
|
+
background:
|
|
1727
|
+
radial-gradient(circle at 35% 30%, var(--cf-avatar-glow), transparent 32%),
|
|
1728
|
+
linear-gradient(145deg, color-mix(in oklab, var(--cf-avatar-a) 18%, var(--cf-bg)), var(--cf-surface-2));
|
|
1729
|
+
}
|
|
1730
|
+
.cf-assistant-card__face {
|
|
1731
|
+
position: relative;
|
|
1732
|
+
width: 128px;
|
|
1733
|
+
height: 128px;
|
|
1734
|
+
border-radius: 999px;
|
|
1735
|
+
display: grid;
|
|
1736
|
+
place-items: center;
|
|
1737
|
+
color: #fff;
|
|
1738
|
+
background: linear-gradient(145deg, var(--cf-avatar-a), var(--cf-avatar-b));
|
|
1739
|
+
box-shadow: 0 22px 44px -28px rgba(0, 0, 0, 0.75);
|
|
1740
|
+
z-index: 2;
|
|
1741
|
+
}
|
|
1742
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__face {
|
|
1743
|
+
animation: cf-avatar-nod 1.6s ease-in-out infinite;
|
|
1744
|
+
}
|
|
1745
|
+
.cf-assistant-card__stage--local.is-listening .cf-assistant-card__face {
|
|
1746
|
+
box-shadow:
|
|
1747
|
+
0 22px 44px -28px rgba(0, 0, 0, 0.75),
|
|
1748
|
+
0 0 0 calc(5px + (var(--cf-listen, 0.2) * 6px)) color-mix(in oklab, var(--cf-accent) 16%, transparent);
|
|
1749
|
+
}
|
|
1750
|
+
.cf-assistant-card--pinned .cf-assistant-card__face {
|
|
1751
|
+
width: 72px;
|
|
1752
|
+
height: 72px;
|
|
1753
|
+
}
|
|
1754
|
+
.cf-avatar-preset--support-guide {
|
|
1755
|
+
--cf-avatar-a: #10b981;
|
|
1756
|
+
--cf-avatar-b: #0f766e;
|
|
1757
|
+
--cf-avatar-glow: rgba(16, 185, 129, 0.34);
|
|
1758
|
+
}
|
|
1759
|
+
.cf-avatar-preset--sales-host {
|
|
1760
|
+
--cf-avatar-a: #3b82f6;
|
|
1761
|
+
--cf-avatar-b: #4338ca;
|
|
1762
|
+
--cf-avatar-glow: rgba(59, 130, 246, 0.34);
|
|
1763
|
+
}
|
|
1764
|
+
.cf-avatar-preset--calm-advisor {
|
|
1765
|
+
--cf-avatar-a: #64748b;
|
|
1766
|
+
--cf-avatar-b: #0f172a;
|
|
1767
|
+
--cf-avatar-glow: rgba(100, 116, 139, 0.34);
|
|
1768
|
+
}
|
|
1769
|
+
.cf-avatar-preset--technical-guide {
|
|
1770
|
+
--cf-avatar-a: #06b6d4;
|
|
1771
|
+
--cf-avatar-b: #1d4ed8;
|
|
1772
|
+
--cf-avatar-glow: rgba(6, 182, 212, 0.34);
|
|
1773
|
+
}
|
|
1774
|
+
.cf-avatar-preset--school-desk {
|
|
1775
|
+
--cf-avatar-a: #8b5cf6;
|
|
1776
|
+
--cf-avatar-b: #6d28d9;
|
|
1777
|
+
--cf-avatar-glow: rgba(139, 92, 246, 0.34);
|
|
1778
|
+
}
|
|
1779
|
+
.cf-avatar-preset--front-office {
|
|
1780
|
+
--cf-avatar-a: #f59e0b;
|
|
1781
|
+
--cf-avatar-b: #c2410c;
|
|
1782
|
+
--cf-avatar-glow: rgba(245, 158, 11, 0.34);
|
|
1783
|
+
}
|
|
1784
|
+
.cf-assistant-card__initials {
|
|
1785
|
+
transform: translateY(-12px);
|
|
1786
|
+
font-size: 34px;
|
|
1787
|
+
font-weight: 800;
|
|
1788
|
+
}
|
|
1789
|
+
.cf-assistant-card--pinned .cf-assistant-card__initials {
|
|
1790
|
+
transform: translateY(-6px);
|
|
1791
|
+
font-size: 19px;
|
|
1792
|
+
}
|
|
1793
|
+
.cf-assistant-card__eye {
|
|
1794
|
+
position: absolute;
|
|
1795
|
+
top: 58px;
|
|
1796
|
+
width: 8px;
|
|
1797
|
+
height: 8px;
|
|
1798
|
+
border-radius: 999px;
|
|
1799
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1800
|
+
}
|
|
1801
|
+
.cf-assistant-card__eye--left { left: 42px; }
|
|
1802
|
+
.cf-assistant-card__eye--right { right: 42px; }
|
|
1803
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye {
|
|
1804
|
+
top: 33px;
|
|
1805
|
+
width: 5px;
|
|
1806
|
+
height: 5px;
|
|
1807
|
+
}
|
|
1808
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye--left { left: 23px; }
|
|
1809
|
+
.cf-assistant-card--pinned .cf-assistant-card__eye--right { right: 23px; }
|
|
1810
|
+
.cf-assistant-card__mouth {
|
|
1811
|
+
position: absolute;
|
|
1812
|
+
left: 50%;
|
|
1813
|
+
bottom: 31px;
|
|
1814
|
+
width: 34px;
|
|
1815
|
+
height: 6px;
|
|
1816
|
+
transform: translateX(-50%);
|
|
1817
|
+
border-radius: 999px;
|
|
1818
|
+
background: rgba(255, 255, 255, 0.9);
|
|
1819
|
+
}
|
|
1820
|
+
.cf-assistant-card--pinned .cf-assistant-card__mouth {
|
|
1821
|
+
bottom: 18px;
|
|
1822
|
+
width: 20px;
|
|
1823
|
+
height: 4px;
|
|
1824
|
+
}
|
|
1825
|
+
.cf-assistant-card.is-speaking .cf-assistant-card__mouth {
|
|
1826
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
1827
|
+
}
|
|
1828
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth {
|
|
1829
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
1830
|
+
}
|
|
1831
|
+
.cf-assistant-card__mouth--overlay {
|
|
1832
|
+
z-index: 6;
|
|
1833
|
+
bottom: 39px;
|
|
1834
|
+
width: 42px;
|
|
1835
|
+
height: 7px;
|
|
1836
|
+
opacity: 0;
|
|
1837
|
+
background: color-mix(in oklab, #fff 90%, var(--cf-accent));
|
|
1838
|
+
box-shadow:
|
|
1839
|
+
0 0 0 4px rgba(2, 6, 23, 0.22),
|
|
1840
|
+
0 10px 22px -10px rgba(0, 0, 0, 0.85);
|
|
1841
|
+
}
|
|
1842
|
+
.cf-assistant-card__stage--local.is-speaking .cf-assistant-card__mouth--overlay {
|
|
1843
|
+
opacity: 1;
|
|
1844
|
+
}
|
|
1845
|
+
.cf-assistant-card--pinned .cf-assistant-card__mouth--overlay {
|
|
1846
|
+
bottom: 42px;
|
|
1847
|
+
}
|
|
1848
|
+
@keyframes cf-mouth-talk {
|
|
1849
|
+
from { height: 5px; width: 28px; border-radius: 999px; }
|
|
1850
|
+
to { height: 20px; width: 22px; border-radius: 45% 45% 55% 55%; }
|
|
1851
|
+
}
|
|
1852
|
+
@keyframes cf-avatar-breathe {
|
|
1853
|
+
0%, 100% { opacity: 0.16; transform: translate(-50%, -50%) scale(0.82); }
|
|
1854
|
+
50% { opacity: 0.58; transform: translate(-50%, -50%) scale(1.12); }
|
|
1855
|
+
}
|
|
1856
|
+
@keyframes cf-avatar-wave {
|
|
1857
|
+
0%, 100% { transform: scaleY(0.62); opacity: 0.72; }
|
|
1858
|
+
50% { transform: scaleY(1.85); opacity: 1; }
|
|
1859
|
+
}
|
|
1860
|
+
@keyframes cf-avatar-thinking {
|
|
1861
|
+
0% { transform: translateX(-18%); opacity: 0; }
|
|
1862
|
+
38% { opacity: 1; }
|
|
1863
|
+
100% { transform: translateX(18%); opacity: 0; }
|
|
1864
|
+
}
|
|
1865
|
+
@keyframes cf-avatar-nod {
|
|
1866
|
+
0%, 100% { transform: translateY(0) scale(1); }
|
|
1867
|
+
45% { transform: translateY(-2px) scale(1.012); }
|
|
1868
|
+
}
|
|
1869
|
+
.cf-assistant-card__speak {
|
|
1870
|
+
position: absolute;
|
|
1871
|
+
left: 50%;
|
|
1872
|
+
bottom: 12px;
|
|
1873
|
+
transform: translateX(-50%);
|
|
1874
|
+
display: inline-flex;
|
|
1875
|
+
align-items: center;
|
|
1876
|
+
gap: 7px;
|
|
1877
|
+
max-width: calc(100% - 24px);
|
|
1878
|
+
padding: 8px 12px;
|
|
1879
|
+
border-radius: 999px;
|
|
1880
|
+
background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
|
|
1881
|
+
color: var(--cf-accent);
|
|
1882
|
+
box-shadow: 0 10px 22px -14px rgba(15, 30, 42, 0.6);
|
|
1883
|
+
font-size: 12.5px;
|
|
1884
|
+
font-weight: 700;
|
|
1885
|
+
white-space: nowrap;
|
|
1886
|
+
}
|
|
1887
|
+
.cf-assistant-card--pinned .cf-assistant-card__speak {
|
|
1888
|
+
padding: 6px 10px;
|
|
1889
|
+
font-size: 11.5px;
|
|
1890
|
+
}
|
|
1891
|
+
.cf-assistant-card__speak svg { width: 15px; height: 15px; }
|
|
1892
|
+
.cf-assistant-card__voice-only .cf-assistant-card__speak,
|
|
1893
|
+
.cf-assistant-card__voice-only .cf-call-controls {
|
|
1894
|
+
position: static;
|
|
1895
|
+
transform: none;
|
|
1896
|
+
max-width: 100%;
|
|
1897
|
+
}
|
|
1898
|
+
.cf-assistant-card--connecting {
|
|
1899
|
+
min-height: 100%;
|
|
1900
|
+
display: grid;
|
|
1901
|
+
place-items: center;
|
|
1902
|
+
align-content: center;
|
|
1903
|
+
gap: 18px;
|
|
1904
|
+
padding: 34px 24px 42px;
|
|
1905
|
+
text-align: center;
|
|
1906
|
+
border-top: 1px solid var(--cf-border);
|
|
1907
|
+
background:
|
|
1908
|
+
radial-gradient(circle at 50% 38%, color-mix(in oklab, var(--cf-accent) 16%, transparent), transparent 36%),
|
|
1909
|
+
linear-gradient(180deg, color-mix(in oklab, var(--cf-surface) 72%, var(--cf-bg)), var(--cf-bg));
|
|
1910
|
+
}
|
|
1911
|
+
.cf-assistant-card__connecting-avatar {
|
|
1912
|
+
position: relative;
|
|
1913
|
+
width: 118px;
|
|
1914
|
+
height: 118px;
|
|
1915
|
+
display: grid;
|
|
1916
|
+
place-items: center;
|
|
1917
|
+
}
|
|
1918
|
+
.cf-assistant-card__connecting-avatar img,
|
|
1919
|
+
.cf-assistant-card__connecting-face {
|
|
1920
|
+
width: 92px;
|
|
1921
|
+
height: 92px;
|
|
1922
|
+
border-radius: 999px;
|
|
1923
|
+
display: grid;
|
|
1924
|
+
place-items: center;
|
|
1925
|
+
object-fit: cover;
|
|
1926
|
+
color: #fff;
|
|
1927
|
+
font-size: 28px;
|
|
1928
|
+
font-weight: 850;
|
|
1929
|
+
letter-spacing: -0.04em;
|
|
1930
|
+
background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
|
|
1931
|
+
border: 1px solid color-mix(in oklab, #fff 30%, transparent);
|
|
1932
|
+
box-shadow:
|
|
1933
|
+
0 22px 48px -24px color-mix(in oklab, var(--cf-accent) 60%, #000),
|
|
1934
|
+
0 0 0 8px color-mix(in oklab, var(--cf-accent) 10%, transparent);
|
|
1935
|
+
z-index: 2;
|
|
1936
|
+
}
|
|
1937
|
+
.cf-assistant-card__connecting-copy {
|
|
1938
|
+
display: grid;
|
|
1939
|
+
gap: 6px;
|
|
1940
|
+
}
|
|
1941
|
+
.cf-assistant-card__connecting-eyebrow {
|
|
1942
|
+
color: var(--cf-muted);
|
|
1943
|
+
font-size: 11px;
|
|
1944
|
+
font-weight: 800;
|
|
1945
|
+
letter-spacing: 0.12em;
|
|
1946
|
+
text-transform: uppercase;
|
|
1947
|
+
}
|
|
1948
|
+
.cf-assistant-card__connecting-copy strong {
|
|
1949
|
+
color: var(--cf-text);
|
|
1950
|
+
font-size: 18px;
|
|
1951
|
+
line-height: 1.25;
|
|
1952
|
+
}
|
|
1953
|
+
.cf-assistant-card--connecting .cf-call-ripple {
|
|
1954
|
+
inset: -18px;
|
|
1955
|
+
border-radius: 999px;
|
|
1956
|
+
}
|
|
1957
|
+
.cf-assistant-card--connecting .cf-call-ripple span {
|
|
1958
|
+
width: 92px;
|
|
1959
|
+
height: 92px;
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1962
|
+
/* ---------- Call "working" ripple ----------
|
|
1963
|
+
Concentric rings pulsing out from the avatar's center while the call is
|
|
1964
|
+
connecting / transcribing / waiting for the reply — the classic "ringing
|
|
1965
|
+
call" cue, so busy moments read as live activity instead of a freeze. */
|
|
1966
|
+
.cf-call-ripple {
|
|
1967
|
+
position: absolute;
|
|
1968
|
+
inset: 0;
|
|
1969
|
+
display: grid;
|
|
1970
|
+
place-items: center;
|
|
1971
|
+
pointer-events: none;
|
|
1972
|
+
overflow: hidden;
|
|
1973
|
+
border-radius: inherit;
|
|
1974
|
+
}
|
|
1975
|
+
.cf-call-ripple span {
|
|
1976
|
+
position: absolute;
|
|
1977
|
+
width: 74px;
|
|
1978
|
+
height: 74px;
|
|
1979
|
+
border-radius: 999px;
|
|
1980
|
+
border: 2px solid var(--cf-accent);
|
|
1981
|
+
opacity: 0;
|
|
1982
|
+
animation: cf-call-ripple 1.8s ease-out infinite;
|
|
1983
|
+
}
|
|
1984
|
+
.cf-call-ripple span:nth-child(2) { animation-delay: 0.6s; }
|
|
1985
|
+
.cf-call-ripple span:nth-child(3) { animation-delay: 1.2s; }
|
|
1986
|
+
@keyframes cf-call-ripple {
|
|
1987
|
+
0% { transform: scale(0.9); opacity: 0.55; }
|
|
1988
|
+
100% { transform: scale(2.6); opacity: 0; }
|
|
1989
|
+
}
|
|
1990
|
+
@media (prefers-reduced-motion: reduce) {
|
|
1991
|
+
.cf-call-ripple span { animation: none; opacity: 0.25; transform: scale(1.4); }
|
|
1992
|
+
.cf-call-ripple span:nth-child(2), .cf-call-ripple span:nth-child(3) { display: none; }
|
|
1993
|
+
}
|
|
1994
|
+
|
|
1995
|
+
/* ---------- In-call controls (mic / audio picker / expand / minimize / end) ---------- */
|
|
1996
|
+
.cf-call-controls {
|
|
1997
|
+
position: absolute;
|
|
1998
|
+
left: 50%;
|
|
1999
|
+
bottom: 12px;
|
|
2000
|
+
transform: translateX(-50%);
|
|
2001
|
+
display: inline-flex;
|
|
2002
|
+
align-items: center;
|
|
2003
|
+
gap: 4px;
|
|
2004
|
+
max-width: calc(100% - 24px);
|
|
2005
|
+
padding: 5px 7px;
|
|
2006
|
+
border-radius: 999px;
|
|
2007
|
+
background: color-mix(in oklab, var(--cf-bg) 94%, transparent);
|
|
2008
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 72%, transparent);
|
|
2009
|
+
box-shadow: 0 14px 34px -16px rgba(0, 0, 0, 0.7);
|
|
2010
|
+
z-index: 30;
|
|
2011
|
+
}
|
|
2012
|
+
.cf-assistant-card--pinned .cf-call-controls { padding: 4px 6px; gap: 4px; }
|
|
2013
|
+
.cf-call-btn {
|
|
2014
|
+
position: relative;
|
|
2015
|
+
flex-shrink: 0;
|
|
2016
|
+
width: 30px;
|
|
2017
|
+
height: 30px;
|
|
2018
|
+
border-radius: 999px;
|
|
2019
|
+
display: inline-flex;
|
|
2020
|
+
align-items: center;
|
|
2021
|
+
justify-content: center;
|
|
2022
|
+
gap: 6px;
|
|
2023
|
+
color: var(--cf-text);
|
|
2024
|
+
background: color-mix(in oklab, var(--cf-surface) 88%, transparent);
|
|
2025
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 76%, transparent);
|
|
2026
|
+
transition: background 0.15s ease, transform 0.12s ease, color 0.15s ease;
|
|
2027
|
+
}
|
|
2028
|
+
.cf-call-btn:hover { background: color-mix(in oklab, var(--cf-accent) 10%, var(--cf-surface)); }
|
|
2029
|
+
.cf-call-btn:active { transform: scale(0.94); }
|
|
2030
|
+
.cf-call-btn svg { width: 14px; height: 14px; }
|
|
2031
|
+
.cf-call-btn--microphones {
|
|
2032
|
+
width: 24px;
|
|
2033
|
+
margin-left: -5px;
|
|
2034
|
+
border-top-left-radius: 10px;
|
|
2035
|
+
border-bottom-left-radius: 10px;
|
|
2036
|
+
}
|
|
2037
|
+
.cf-call-btn--microphones svg { width: 13px; height: 13px; }
|
|
2038
|
+
.cf-call-btn--restore svg { width: 15px; height: 15px; }
|
|
2039
|
+
.cf-call-btn.is-muted {
|
|
2040
|
+
color: #fff;
|
|
2041
|
+
background: var(--cf-muted);
|
|
2042
|
+
border-color: transparent;
|
|
2043
|
+
}
|
|
2044
|
+
/* Live-listening cue: a soft ring around the mic button that breathes with
|
|
2045
|
+
the mic level, instead of a separate waveform element eating up row width. */
|
|
2046
|
+
.cf-call-btn.is-listening::after {
|
|
2047
|
+
content: '';
|
|
2048
|
+
position: absolute;
|
|
2049
|
+
inset: -4px;
|
|
2050
|
+
border-radius: inherit;
|
|
2051
|
+
border: 2px solid var(--cf-accent);
|
|
2052
|
+
opacity: calc(0.25 + var(--cf-wave, 0.2) * 0.5);
|
|
2053
|
+
transform: scale(calc(1 + var(--cf-wave, 0.2) * 0.22));
|
|
2054
|
+
transition: transform 0.09s ease, opacity 0.09s ease;
|
|
2055
|
+
pointer-events: none;
|
|
2056
|
+
}
|
|
2057
|
+
/* Your voice is actually registering: the mic fills with the accent color
|
|
2058
|
+
and the ring flares, so "it hears me" is unmistakable at a glance. */
|
|
2059
|
+
.cf-call-btn.is-listening.is-hot {
|
|
2060
|
+
color: var(--cf-accent-ink);
|
|
2061
|
+
background: var(--cf-accent);
|
|
2062
|
+
border-color: transparent;
|
|
2063
|
+
}
|
|
2064
|
+
.cf-call-btn.is-listening.is-hot::after {
|
|
2065
|
+
border-width: 3px;
|
|
2066
|
+
opacity: calc(0.5 + var(--cf-wave, 0.2) * 0.5);
|
|
2067
|
+
transform: scale(calc(1.08 + var(--cf-wave, 0.2) * 0.35));
|
|
2068
|
+
box-shadow: 0 0 12px 2px color-mix(in oklab, var(--cf-accent) 55%, transparent);
|
|
2069
|
+
}
|
|
2070
|
+
.cf-call-btn--talk {
|
|
2071
|
+
color: var(--cf-accent-ink);
|
|
2072
|
+
background: var(--cf-accent);
|
|
2073
|
+
border-color: transparent;
|
|
2074
|
+
}
|
|
2075
|
+
.cf-call-btn--end {
|
|
2076
|
+
color: #fff;
|
|
2077
|
+
background: #e5484d;
|
|
2078
|
+
border-color: transparent;
|
|
2079
|
+
}
|
|
2080
|
+
.cf-call-btn--end:hover { background: #dc3d42; }
|
|
2081
|
+
/* Microphone selector popover. */
|
|
2082
|
+
.cf-call-more { position: static; display: inline-flex; z-index: 40; }
|
|
2083
|
+
.cf-call-menu {
|
|
2084
|
+
position: absolute;
|
|
2085
|
+
top: calc(100% + 8px);
|
|
2086
|
+
bottom: auto;
|
|
2087
|
+
left: 50%;
|
|
2088
|
+
transform: translateX(-50%);
|
|
2089
|
+
display: flex;
|
|
2090
|
+
flex-direction: column;
|
|
2091
|
+
gap: 2px;
|
|
2092
|
+
width: min(240px, calc(var(--cf-panel-w, 388px) - 72px), calc(100vw - 64px));
|
|
2093
|
+
min-width: 0;
|
|
2094
|
+
max-width: calc(100vw - 64px);
|
|
2095
|
+
max-height: min(300px, calc(100vh - 220px));
|
|
2096
|
+
overflow-y: auto;
|
|
2097
|
+
padding: 8px;
|
|
2098
|
+
border-radius: 14px;
|
|
2099
|
+
background: color-mix(in oklab, var(--cf-bg) 98%, #000);
|
|
2100
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
|
|
2101
|
+
box-shadow: 0 18px 45px -20px rgba(0, 0, 0, 0.78);
|
|
2102
|
+
z-index: 60;
|
|
2103
|
+
}
|
|
2104
|
+
.cf-call-menu__label {
|
|
2105
|
+
margin: 8px 8px 4px;
|
|
2106
|
+
color: var(--cf-muted);
|
|
2107
|
+
font-size: 11px;
|
|
2108
|
+
font-weight: 700;
|
|
2109
|
+
text-transform: uppercase;
|
|
2110
|
+
letter-spacing: 0.08em;
|
|
2111
|
+
}
|
|
2112
|
+
.cf-call-menu__item {
|
|
2113
|
+
display: flex;
|
|
2114
|
+
align-items: center;
|
|
2115
|
+
gap: 8px;
|
|
2116
|
+
min-width: 0;
|
|
2117
|
+
padding: 8px 9px;
|
|
2118
|
+
border-radius: 10px;
|
|
2119
|
+
color: var(--cf-text);
|
|
2120
|
+
font-size: 12.5px;
|
|
2121
|
+
text-align: left;
|
|
2122
|
+
white-space: nowrap;
|
|
2123
|
+
overflow: hidden;
|
|
2124
|
+
}
|
|
2125
|
+
.cf-call-menu__item span:last-child {
|
|
2126
|
+
min-width: 0;
|
|
2127
|
+
overflow: hidden;
|
|
2128
|
+
text-overflow: ellipsis;
|
|
2129
|
+
}
|
|
2130
|
+
.cf-call-menu__item:hover { background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-surface)); }
|
|
2131
|
+
.cf-call-menu__item.is-active { color: var(--cf-accent); font-weight: 600; }
|
|
2132
|
+
.cf-call-menu__item svg { width: 13px; height: 13px; flex-shrink: 0; }
|
|
2133
|
+
.cf-call-menu__spacer { width: 13px; flex-shrink: 0; }
|
|
2134
|
+
/* Detached floating avatar card — replaces the launcher while a call runs minimized. */
|
|
2135
|
+
.cf-floating-call-card {
|
|
2136
|
+
position: fixed;
|
|
2137
|
+
bottom: var(--cf-v-pad, 20px);
|
|
2138
|
+
right: var(--cf-h-pad, 20px);
|
|
2139
|
+
z-index: 1;
|
|
2140
|
+
pointer-events: auto;
|
|
2141
|
+
width: min(340px, calc(100vw - 32px));
|
|
2142
|
+
aspect-ratio: 16 / 9;
|
|
2143
|
+
overflow: hidden;
|
|
2144
|
+
border-radius: 14px;
|
|
2145
|
+
background: var(--cf-bg);
|
|
2146
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 74%, transparent);
|
|
2147
|
+
box-shadow: 0 20px 48px -20px rgba(0, 0, 0, 0.72);
|
|
2148
|
+
animation: cf-pop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
|
|
2149
|
+
}
|
|
2150
|
+
.cf-root[data-align='left'] .cf-floating-call-card { right: auto; left: var(--cf-h-pad, 20px); }
|
|
2151
|
+
.cf-floating-call-card__media,
|
|
2152
|
+
.cf-floating-call-card__shade {
|
|
2153
|
+
position: absolute;
|
|
2154
|
+
inset: 0;
|
|
2155
|
+
}
|
|
2156
|
+
.cf-floating-call-card__media img,
|
|
2157
|
+
.cf-floating-call-card__media video {
|
|
2158
|
+
width: 100%;
|
|
2159
|
+
height: 100%;
|
|
2160
|
+
object-fit: cover;
|
|
2161
|
+
}
|
|
2162
|
+
.cf-floating-call-card__shade {
|
|
2163
|
+
background:
|
|
2164
|
+
linear-gradient(to bottom, rgba(0, 0, 0, 0.06), rgba(0, 0, 0, 0.18)),
|
|
2165
|
+
radial-gradient(circle at 50% 100%, rgba(255, 255, 255, 0.08), transparent 42%);
|
|
2166
|
+
pointer-events: none;
|
|
2167
|
+
}
|
|
2168
|
+
.cf-floating-call-card__avatar {
|
|
2169
|
+
position: absolute;
|
|
2170
|
+
inset: 0;
|
|
2171
|
+
display: flex;
|
|
2172
|
+
align-items: center;
|
|
2173
|
+
justify-content: center;
|
|
2174
|
+
color: #fff;
|
|
2175
|
+
background: linear-gradient(145deg, var(--cf-accent), var(--cf-accent-2));
|
|
2176
|
+
}
|
|
2177
|
+
.cf-floating-call-card.is-muted {
|
|
2178
|
+
filter: saturate(0.72);
|
|
2179
|
+
}
|
|
2180
|
+
.cf-floating-call-card.is-listening {
|
|
2181
|
+
border-color: color-mix(in oklab, var(--cf-accent) 62%, var(--cf-border));
|
|
2182
|
+
box-shadow:
|
|
2183
|
+
0 20px 48px -20px rgba(0, 0, 0, 0.72),
|
|
2184
|
+
0 0 calc(12px + (var(--cf-listen, 0.2) * 18px)) color-mix(in oklab, var(--cf-accent) 28%, transparent);
|
|
2185
|
+
}
|
|
2186
|
+
.cf-floating-call-card.is-thinking .cf-floating-call-card__shade::before {
|
|
2187
|
+
content: '';
|
|
2188
|
+
position: absolute;
|
|
2189
|
+
inset: -45%;
|
|
2190
|
+
background: linear-gradient(115deg, transparent 42%, color-mix(in oklab, var(--cf-accent) 22%, transparent) 50%, transparent 58%);
|
|
2191
|
+
animation: cf-avatar-thinking 1.45s ease-in-out infinite;
|
|
2192
|
+
}
|
|
2193
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__avatar,
|
|
2194
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__media img {
|
|
2195
|
+
animation: cf-avatar-nod 1.6s ease-in-out infinite;
|
|
2196
|
+
}
|
|
2197
|
+
.cf-floating-call-card__avatar > span:first-child {
|
|
2198
|
+
font-size: clamp(64px, 22vw, 118px);
|
|
2199
|
+
font-weight: 800;
|
|
2200
|
+
line-height: 1;
|
|
2201
|
+
}
|
|
2202
|
+
.cf-floating-call-card__eye,
|
|
2203
|
+
.cf-floating-call-card__mouth {
|
|
2204
|
+
position: absolute;
|
|
2205
|
+
background: rgba(255, 255, 255, 0.9);
|
|
2206
|
+
}
|
|
2207
|
+
.cf-floating-call-card__eye {
|
|
2208
|
+
top: 37%;
|
|
2209
|
+
width: 8px;
|
|
2210
|
+
height: 8px;
|
|
2211
|
+
border-radius: 999px;
|
|
2212
|
+
}
|
|
2213
|
+
.cf-floating-call-card__eye--left { left: 38%; }
|
|
2214
|
+
.cf-floating-call-card__eye--right { right: 38%; }
|
|
2215
|
+
.cf-floating-call-card__mouth {
|
|
2216
|
+
bottom: 31%;
|
|
2217
|
+
width: 34px;
|
|
2218
|
+
height: 6px;
|
|
2219
|
+
border-radius: 999px;
|
|
2220
|
+
}
|
|
2221
|
+
.cf-floating-call-card.is-speaking .cf-floating-call-card__mouth {
|
|
2222
|
+
animation: cf-mouth-talk 0.24s ease-in-out infinite alternate;
|
|
2223
|
+
}
|
|
2224
|
+
.cf-floating-call-card__controls {
|
|
2225
|
+
position: absolute;
|
|
2226
|
+
left: 50%;
|
|
2227
|
+
bottom: 12px;
|
|
2228
|
+
transform: translateX(-50%);
|
|
2229
|
+
display: inline-flex;
|
|
2230
|
+
align-items: center;
|
|
2231
|
+
gap: 4px;
|
|
2232
|
+
padding: 5px 7px;
|
|
2233
|
+
border-radius: 999px;
|
|
2234
|
+
background: color-mix(in oklab, var(--cf-bg) 92%, transparent);
|
|
2235
|
+
border: 1px solid color-mix(in oklab, var(--cf-border) 70%, transparent);
|
|
2236
|
+
box-shadow: 0 14px 30px -16px rgba(0, 0, 0, 0.74);
|
|
2237
|
+
}
|
|
2238
|
+
.cf-assistant-card__copy {
|
|
2239
|
+
margin: 0;
|
|
2240
|
+
color: var(--cf-text);
|
|
2241
|
+
font-size: 14px;
|
|
2242
|
+
line-height: 1.55;
|
|
2243
|
+
}
|
|
2244
|
+
.cf-assistant-card__chips {
|
|
2245
|
+
display: flex;
|
|
2246
|
+
flex-wrap: wrap;
|
|
2247
|
+
gap: 7px;
|
|
2248
|
+
}
|
|
2249
|
+
.cf-assistant-card__chip {
|
|
2250
|
+
max-width: 100%;
|
|
2251
|
+
border-radius: 6px;
|
|
2252
|
+
padding: 7px 9px;
|
|
2253
|
+
background: color-mix(in oklab, var(--cf-accent) 12%, var(--cf-bg));
|
|
2254
|
+
color: var(--cf-accent);
|
|
2255
|
+
font-size: 12.5px;
|
|
2256
|
+
line-height: 1.2;
|
|
2257
|
+
}
|
|
2258
|
+
.cf-assistant-card__chip:hover { background: color-mix(in oklab, var(--cf-accent) 18%, var(--cf-bg)); }
|
|
2259
|
+
.cf-assistant-card__privacy {
|
|
2260
|
+
margin: -2px 0 0;
|
|
2261
|
+
color: var(--cf-muted);
|
|
2262
|
+
font-size: 10.5px;
|
|
2263
|
+
line-height: 1.4;
|
|
2264
|
+
text-align: center;
|
|
2265
|
+
}
|
|
2266
|
+
.cf-assistant-card__privacy a {
|
|
2267
|
+
color: var(--cf-muted);
|
|
2268
|
+
text-decoration: underline;
|
|
2269
|
+
text-underline-offset: 2px;
|
|
2270
|
+
}
|
|
2271
|
+
|
|
2272
|
+
/* Offline presence dot (amber instead of green). */
|
|
2273
|
+
.cf-header__status--offline::before { background: #e2c07e; box-shadow: 0 0 0 2px rgba(226, 192, 126, 0.3); }
|
|
2274
|
+
|
|
2275
|
+
/* Disclaimer fine-print under the composer. */
|
|
2276
|
+
.cf-disclaimer { padding: 0 16px 2px; font-size: 10.5px; line-height: 1.45; color: var(--cf-muted); text-align: center; }
|
|
2277
|
+
|
|
2278
|
+
/* Read-only banner shown while viewing a past conversation. */
|
|
2279
|
+
.cf-viewing-banner {
|
|
2280
|
+
padding: 7px 16px;
|
|
2281
|
+
font-size: 12px;
|
|
2282
|
+
font-weight: 600;
|
|
2283
|
+
text-align: center;
|
|
2284
|
+
color: var(--cf-muted);
|
|
2285
|
+
background: var(--cf-surface);
|
|
2286
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2287
|
+
flex-shrink: 0;
|
|
2288
|
+
}
|
|
2289
|
+
|
|
2290
|
+
/* Past-conversations history panel (over the chat, like the confirm dialog). */
|
|
2291
|
+
.cf-history {
|
|
2292
|
+
width: min(340px, 90%);
|
|
2293
|
+
max-height: 70%;
|
|
2294
|
+
display: flex;
|
|
2295
|
+
flex-direction: column;
|
|
2296
|
+
background: var(--cf-bg);
|
|
2297
|
+
border-radius: 14px;
|
|
2298
|
+
box-shadow: var(--cf-shadow);
|
|
2299
|
+
overflow: hidden;
|
|
2300
|
+
}
|
|
2301
|
+
.cf-history__head {
|
|
2302
|
+
display: flex;
|
|
2303
|
+
align-items: center;
|
|
2304
|
+
justify-content: space-between;
|
|
2305
|
+
padding: 12px 14px;
|
|
2306
|
+
font-size: 14px;
|
|
2307
|
+
font-weight: 700;
|
|
2308
|
+
color: var(--cf-text);
|
|
2309
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2310
|
+
}
|
|
2311
|
+
.cf-history__list { overflow-y: auto; padding: 6px; }
|
|
2312
|
+
.cf-history__item {
|
|
2313
|
+
display: flex;
|
|
2314
|
+
flex-direction: column;
|
|
2315
|
+
gap: 2px;
|
|
2316
|
+
width: 100%;
|
|
2317
|
+
text-align: left;
|
|
2318
|
+
padding: 9px 10px;
|
|
2319
|
+
border-radius: 9px;
|
|
2320
|
+
cursor: pointer;
|
|
2321
|
+
transition: background 0.15s ease;
|
|
2322
|
+
}
|
|
2323
|
+
.cf-history__item:hover { background: var(--cf-surface); }
|
|
2324
|
+
.cf-history__item.is-active { background: var(--cf-surface); }
|
|
2325
|
+
.cf-history__title { font-size: 13px; color: var(--cf-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
|
|
2326
|
+
.cf-history__meta { font-size: 11px; color: var(--cf-muted); }
|
|
2327
|
+
|
|
2328
|
+
/* Ended-conversation bar — replaces the composer once the chat is closed. */
|
|
2329
|
+
.cf-ended {
|
|
2330
|
+
display: flex;
|
|
2331
|
+
flex-direction: column;
|
|
2332
|
+
align-items: center;
|
|
2333
|
+
gap: 10px;
|
|
2334
|
+
padding: 14px 16px 16px;
|
|
2335
|
+
flex-shrink: 0;
|
|
2336
|
+
text-align: center;
|
|
2337
|
+
}
|
|
2338
|
+
.cf-ended__text { margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--cf-muted); }
|
|
2339
|
+
.cf-csat { display: inline-flex; align-items: center; gap: 8px; }
|
|
2340
|
+
.cf-csat__q { font-size: 12.5px; color: var(--cf-muted); }
|
|
2341
|
+
.cf-csat__btn {
|
|
2342
|
+
display: inline-flex;
|
|
2343
|
+
align-items: center;
|
|
2344
|
+
justify-content: center;
|
|
2345
|
+
width: 30px;
|
|
2346
|
+
height: 30px;
|
|
2347
|
+
border-radius: 8px;
|
|
2348
|
+
color: var(--cf-muted);
|
|
2349
|
+
cursor: pointer;
|
|
2350
|
+
transition: background 0.15s ease, color 0.15s ease;
|
|
2351
|
+
}
|
|
2352
|
+
.cf-csat__btn:hover { background: var(--cf-surface); color: var(--cf-accent); }
|
|
2353
|
+
.cf-csat__btn svg { width: 16px; height: 16px; }
|
|
2354
|
+
.cf-ended__btn {
|
|
993
2355
|
font-size: 13px;
|
|
994
2356
|
font-weight: 600;
|
|
995
|
-
color: var(--cf-accent-ink);
|
|
996
|
-
background: var(--cf-accent);
|
|
997
|
-
border: none;
|
|
2357
|
+
color: var(--cf-accent-ink);
|
|
2358
|
+
background: var(--cf-accent);
|
|
2359
|
+
border: none;
|
|
2360
|
+
border-radius: 999px;
|
|
2361
|
+
padding: 9px 18px;
|
|
2362
|
+
cursor: pointer;
|
|
2363
|
+
transition: opacity 0.15s ease;
|
|
2364
|
+
}
|
|
2365
|
+
.cf-ended__btn:hover { opacity: 0.9; }
|
|
2366
|
+
.cf-ended__btn:focus-visible { outline: 2px solid var(--cf-accent); outline-offset: 2px; }
|
|
2367
|
+
|
|
2368
|
+
/* "↓ New messages" pill — shown when a reply streams in while scrolled up. */
|
|
2369
|
+
.cf-newmsg {
|
|
2370
|
+
/* Sticky inside the scroll body: pins to the bottom of the visible thread,
|
|
2371
|
+
just above the composer (never overlapping it). Horizontal centering via
|
|
2372
|
+
align-self so it doesn't fight the entrance animation's transform. */
|
|
2373
|
+
position: sticky;
|
|
2374
|
+
bottom: 10px;
|
|
2375
|
+
align-self: center;
|
|
2376
|
+
z-index: 3;
|
|
2377
|
+
pointer-events: auto;
|
|
2378
|
+
display: inline-flex;
|
|
2379
|
+
align-items: center;
|
|
2380
|
+
gap: 6px;
|
|
2381
|
+
font-size: 12.5px;
|
|
2382
|
+
font-weight: 600;
|
|
2383
|
+
color: var(--cf-accent-ink);
|
|
2384
|
+
background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
|
|
2385
|
+
border-radius: 999px;
|
|
2386
|
+
padding: 7px 14px;
|
|
2387
|
+
box-shadow: var(--cf-shadow);
|
|
2388
|
+
animation: cf-msg-in 0.2s ease both;
|
|
2389
|
+
}
|
|
2390
|
+
.cf-newmsg svg { width: 14px; height: 14px; }
|
|
2391
|
+
|
|
2392
|
+
/* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
|
|
2393
|
+
.cf-confirm {
|
|
2394
|
+
position: absolute;
|
|
2395
|
+
inset: 0;
|
|
2396
|
+
z-index: 6;
|
|
2397
|
+
pointer-events: auto;
|
|
2398
|
+
display: grid;
|
|
2399
|
+
place-items: center;
|
|
2400
|
+
padding: 22px;
|
|
2401
|
+
background: color-mix(in oklab, var(--cf-bg) 62%, transparent);
|
|
2402
|
+
backdrop-filter: blur(2px);
|
|
2403
|
+
animation: cf-fade-in 0.14s ease both;
|
|
2404
|
+
}
|
|
2405
|
+
.cf-confirm__card {
|
|
2406
|
+
width: 100%;
|
|
2407
|
+
max-width: 300px;
|
|
2408
|
+
background: var(--cf-bg);
|
|
2409
|
+
border: 1px solid var(--cf-border);
|
|
2410
|
+
border-radius: 16px;
|
|
2411
|
+
box-shadow: var(--cf-shadow);
|
|
2412
|
+
padding: 18px;
|
|
2413
|
+
text-align: center;
|
|
2414
|
+
animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
2415
|
+
}
|
|
2416
|
+
.cf-confirm__title { font-size: 15px; font-weight: 700; color: var(--cf-text); }
|
|
2417
|
+
.cf-confirm__body { margin-top: 6px; font-size: 13px; line-height: 1.45; color: var(--cf-muted); }
|
|
2418
|
+
.cf-confirm__actions { margin-top: 16px; display: flex; gap: 8px; justify-content: center; }
|
|
2419
|
+
.cf-confirm__btn {
|
|
2420
|
+
padding: 9px 16px;
|
|
2421
|
+
border-radius: 10px;
|
|
2422
|
+
font-size: 13.5px;
|
|
2423
|
+
font-weight: 600;
|
|
2424
|
+
transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
2425
|
+
}
|
|
2426
|
+
.cf-confirm__btn:active { transform: scale(0.97); }
|
|
2427
|
+
.cf-confirm__btn:focus-visible { outline: 2px solid var(--cf-accent-2); outline-offset: 2px; }
|
|
2428
|
+
.cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
|
|
2429
|
+
.cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
|
|
2430
|
+
.cf-confirm__btn--danger { background: #f25767; color: #fff; }
|
|
2431
|
+
.cf-confirm__btn--danger:hover { opacity: 0.9; }
|
|
2432
|
+
|
|
2433
|
+
/* Visually-hidden live region (announces the final answer only). */
|
|
2434
|
+
.cf-sr-live {
|
|
2435
|
+
position: absolute;
|
|
2436
|
+
width: 1px;
|
|
2437
|
+
height: 1px;
|
|
2438
|
+
padding: 0;
|
|
2439
|
+
margin: -1px;
|
|
2440
|
+
overflow: hidden;
|
|
2441
|
+
clip: rect(0 0 0 0);
|
|
2442
|
+
white-space: nowrap;
|
|
2443
|
+
border: 0;
|
|
2444
|
+
}
|
|
2445
|
+
|
|
2446
|
+
/* ---------- Attachments ---------- */
|
|
2447
|
+
.cf-file-input { display: none; }
|
|
2448
|
+
.cf-iconbtn:disabled { opacity: 0.4; cursor: default; }
|
|
2449
|
+
.cf-attach-row { padding: 0 4px 8px; }
|
|
2450
|
+
.cf-attach-status { font-size: 12px; color: var(--cf-muted); }
|
|
2451
|
+
.cf-attach-status--err { color: #f25767; }
|
|
2452
|
+
.cf-attach-chip {
|
|
2453
|
+
display: inline-flex;
|
|
2454
|
+
align-items: center;
|
|
2455
|
+
gap: 6px;
|
|
2456
|
+
max-width: 100%;
|
|
2457
|
+
padding: 5px 6px 5px 10px;
|
|
998
2458
|
border-radius: 999px;
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
2459
|
+
background: var(--cf-surface-2);
|
|
2460
|
+
border: 1px solid var(--cf-border);
|
|
2461
|
+
color: var(--cf-text);
|
|
2462
|
+
font-size: 12px;
|
|
2463
|
+
}
|
|
2464
|
+
.cf-attach-chip > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
2465
|
+
.cf-attach-chip svg { width: 13px; height: 13px; flex-shrink: 0; color: var(--cf-muted); }
|
|
2466
|
+
.cf-attach-x { display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; color: var(--cf-muted); flex-shrink: 0; }
|
|
2467
|
+
.cf-attach-x:hover { background: var(--cf-surface); color: var(--cf-text); }
|
|
2468
|
+
.cf-attach-x svg { width: 11px; height: 11px; }
|
|
2469
|
+
|
|
2470
|
+
/* ---------- Mobile: full-screen panel ---------- */
|
|
2471
|
+
@media (max-width: 480px) {
|
|
2472
|
+
.cf-panel {
|
|
2473
|
+
bottom: 0;
|
|
2474
|
+
right: 0;
|
|
2475
|
+
width: 100vw;
|
|
2476
|
+
max-width: 100vw;
|
|
2477
|
+
height: 100dvh;
|
|
2478
|
+
max-height: 100dvh;
|
|
2479
|
+
border-radius: 0;
|
|
2480
|
+
}
|
|
2481
|
+
.cf-launcher { bottom: 16px; right: 16px; }
|
|
2482
|
+
}
|
|
2483
|
+
|
|
2484
|
+
/* ---------- Keyframes ---------- */
|
|
2485
|
+
@keyframes cf-pop {
|
|
2486
|
+
from { transform: scale(0); opacity: 0; }
|
|
2487
|
+
to { transform: scale(1); opacity: 1; }
|
|
2488
|
+
}
|
|
2489
|
+
@keyframes cf-badge-pop {
|
|
2490
|
+
from { transform: scale(0); }
|
|
2491
|
+
to { transform: scale(1); }
|
|
2492
|
+
}
|
|
2493
|
+
@keyframes cf-panel-open {
|
|
2494
|
+
0% {
|
|
2495
|
+
opacity: 0;
|
|
2496
|
+
transform: translateY(24px) scale(0.93);
|
|
2497
|
+
filter: blur(2px);
|
|
2498
|
+
}
|
|
2499
|
+
58% {
|
|
2500
|
+
opacity: 1;
|
|
2501
|
+
transform: translateY(-3px) scale(1.006);
|
|
2502
|
+
filter: blur(0);
|
|
2503
|
+
}
|
|
2504
|
+
100% {
|
|
2505
|
+
opacity: 1;
|
|
2506
|
+
transform: translateY(0) scale(1);
|
|
2507
|
+
filter: blur(0);
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
@keyframes cf-msg-in {
|
|
2511
|
+
from { opacity: 0; transform: translateY(8px); }
|
|
2512
|
+
to { opacity: 1; transform: none; }
|
|
2513
|
+
}
|
|
2514
|
+
@keyframes cf-fade-in {
|
|
2515
|
+
from { opacity: 0; }
|
|
2516
|
+
to { opacity: 1; }
|
|
2517
|
+
}
|
|
2518
|
+
@keyframes cf-typing {
|
|
2519
|
+
0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
|
|
2520
|
+
40% { opacity: 1; transform: translateY(-4px); }
|
|
2521
|
+
}
|
|
2522
|
+
@keyframes cf-pulse {
|
|
2523
|
+
0%, 100% { opacity: 1; }
|
|
2524
|
+
50% { opacity: 0.4; }
|
|
2525
|
+
}
|
|
2526
|
+
|
|
2527
|
+
@media (prefers-reduced-motion: reduce) {
|
|
2528
|
+
.cf-root *, .cf-root *::before, .cf-root *::after {
|
|
2529
|
+
animation-duration: 0.01ms !important;
|
|
2530
|
+
animation-iteration-count: 1 !important;
|
|
2531
|
+
transition-duration: 0.01ms !important;
|
|
2532
|
+
scroll-behavior: auto !important;
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
.cf-analytics-visualization {
|
|
2536
|
+
box-sizing: border-box;
|
|
2537
|
+
width: 100%;
|
|
2538
|
+
max-width: 100%;
|
|
2539
|
+
margin-top: 8px;
|
|
2540
|
+
min-width: 0;
|
|
2541
|
+
overflow: hidden;
|
|
2542
|
+
border: 1px solid var(--cf-border);
|
|
2543
|
+
border-radius: 13px;
|
|
2544
|
+
background: var(--cf-surface);
|
|
2545
|
+
padding: 12px;
|
|
2546
|
+
color: var(--cf-muted);
|
|
2547
|
+
font-size: 11px;
|
|
2548
|
+
}
|
|
2549
|
+
.cf-analytics-visualization.is-expanded {
|
|
2550
|
+
display: flex;
|
|
2551
|
+
min-height: 100%;
|
|
2552
|
+
flex-direction: column;
|
|
2553
|
+
margin: 0;
|
|
2554
|
+
border: 0;
|
|
2555
|
+
border-radius: 0;
|
|
2556
|
+
background: transparent;
|
|
2557
|
+
padding: 0;
|
|
2558
|
+
}
|
|
2559
|
+
.cf-analytics-visualization__header {
|
|
2560
|
+
display: flex;
|
|
2561
|
+
width: 100%;
|
|
2562
|
+
min-width: 0;
|
|
2563
|
+
min-height: 32px;
|
|
2564
|
+
align-items: center;
|
|
2565
|
+
justify-content: space-between;
|
|
2566
|
+
gap: 10px;
|
|
2567
|
+
}
|
|
2568
|
+
.cf-analytics-visualization__header > div:first-child {
|
|
2569
|
+
min-width: 0;
|
|
2570
|
+
}
|
|
2571
|
+
.cf-analytics-visualization__actions {
|
|
2572
|
+
display: flex;
|
|
2573
|
+
flex: 0 0 auto;
|
|
2574
|
+
align-items: center;
|
|
2575
|
+
gap: 6px;
|
|
2576
|
+
}
|
|
2577
|
+
.cf-analytics-visualization__title {
|
|
2578
|
+
overflow: hidden;
|
|
2579
|
+
color: var(--cf-muted);
|
|
2580
|
+
font-size: 10px;
|
|
2581
|
+
font-weight: 750;
|
|
2582
|
+
letter-spacing: .08em;
|
|
2583
|
+
text-overflow: ellipsis;
|
|
2584
|
+
text-transform: uppercase;
|
|
2585
|
+
white-space: nowrap;
|
|
2586
|
+
}
|
|
2587
|
+
.cf-analytics-meta {
|
|
2588
|
+
display: flex;
|
|
2589
|
+
flex-wrap: wrap;
|
|
2590
|
+
align-items: center;
|
|
2591
|
+
gap: 3px 7px;
|
|
2592
|
+
margin-top: 4px;
|
|
2593
|
+
color: var(--cf-muted);
|
|
2594
|
+
font-size: 9px;
|
|
2595
|
+
line-height: 1.35;
|
|
2596
|
+
}
|
|
2597
|
+
.cf-analytics-meta__model {
|
|
2598
|
+
border-radius: 999px;
|
|
2599
|
+
background: color-mix(in srgb, var(--cf-accent) 12%, transparent);
|
|
2600
|
+
padding: 2px 6px;
|
|
2601
|
+
color: var(--cf-accent);
|
|
2602
|
+
font-weight: 700;
|
|
2603
|
+
}
|
|
2604
|
+
.cf-analytics-meta__dot {
|
|
2605
|
+
display: inline-block;
|
|
2606
|
+
width: 5px;
|
|
2607
|
+
height: 5px;
|
|
2608
|
+
margin-right: 4px;
|
|
2609
|
+
border-radius: 999px;
|
|
2610
|
+
background: var(--cf-accent);
|
|
2611
|
+
}
|
|
2612
|
+
.cf-analytics-visualization__download {
|
|
2613
|
+
width: fit-content;
|
|
2614
|
+
border: 1px solid var(--cf-border) !important;
|
|
2615
|
+
border-radius: 8px;
|
|
2616
|
+
background: var(--cf-surface) !important;
|
|
2617
|
+
padding: 6px 9px;
|
|
2618
|
+
color: var(--cf-text) !important;
|
|
2619
|
+
font-size: 10px;
|
|
2620
|
+
font-weight: 700;
|
|
2621
|
+
}
|
|
2622
|
+
.cf-analytics-visualization__download:hover {
|
|
2623
|
+
border-color: var(--cf-accent) !important;
|
|
2624
|
+
color: var(--cf-accent) !important;
|
|
2625
|
+
}
|
|
2626
|
+
.cf-analytics-table-wrap {
|
|
2627
|
+
box-sizing: border-box;
|
|
2628
|
+
width: 100%;
|
|
2629
|
+
max-width: 100%;
|
|
2630
|
+
margin-top: 9px;
|
|
2631
|
+
max-height: 210px;
|
|
2632
|
+
overflow: auto;
|
|
2633
|
+
border: 1px solid var(--cf-border);
|
|
2634
|
+
border-radius: 9px;
|
|
2635
|
+
scrollbar-width: thin;
|
|
2636
|
+
}
|
|
2637
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-table-wrap {
|
|
2638
|
+
min-height: 0;
|
|
2639
|
+
max-height: none;
|
|
2640
|
+
flex: 1;
|
|
2641
|
+
margin-top: 14px;
|
|
2642
|
+
}
|
|
2643
|
+
.cf-analytics-table {
|
|
2644
|
+
width: 100%;
|
|
2645
|
+
border-collapse: collapse;
|
|
2646
|
+
color: var(--cf-text);
|
|
2647
|
+
font-size: 10px;
|
|
2648
|
+
white-space: nowrap;
|
|
2649
|
+
}
|
|
2650
|
+
.cf-analytics-table th,
|
|
2651
|
+
.cf-analytics-table td {
|
|
2652
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2653
|
+
padding: 8px 9px;
|
|
2654
|
+
text-align: left;
|
|
2655
|
+
}
|
|
2656
|
+
.cf-analytics-table th {
|
|
2657
|
+
position: sticky;
|
|
2658
|
+
top: 0;
|
|
2659
|
+
background: var(--cf-surface-2);
|
|
2660
|
+
color: var(--cf-muted);
|
|
2661
|
+
font-weight: 700;
|
|
2662
|
+
text-transform: capitalize;
|
|
2663
|
+
}
|
|
2664
|
+
.cf-analytics-table tbody tr:last-child td { border-bottom: 0; }
|
|
2665
|
+
.cf-analytics-table-note {
|
|
2666
|
+
margin: 7px 2px 0;
|
|
2667
|
+
color: var(--cf-muted);
|
|
2668
|
+
font-size: 9px;
|
|
2669
|
+
line-height: 1.4;
|
|
2670
|
+
}
|
|
2671
|
+
.cf-analytics-visualization__expand,
|
|
2672
|
+
.cf-analytics-visualization__close {
|
|
2673
|
+
display: grid;
|
|
2674
|
+
width: 30px;
|
|
2675
|
+
height: 30px;
|
|
2676
|
+
flex: 0 0 auto;
|
|
2677
|
+
place-items: center;
|
|
2678
|
+
border: 1px solid var(--cf-border) !important;
|
|
2679
|
+
border-radius: 9px;
|
|
2680
|
+
background: var(--cf-bg) !important;
|
|
2681
|
+
color: var(--cf-text) !important;
|
|
2682
|
+
}
|
|
2683
|
+
.cf-analytics-visualization__expand:hover,
|
|
2684
|
+
.cf-analytics-visualization__close:hover { background: var(--cf-surface-2) !important; }
|
|
2685
|
+
.cf-analytics-visualization__expand:focus-visible,
|
|
2686
|
+
.cf-analytics-visualization__close:focus-visible {
|
|
2687
|
+
outline: 2px solid var(--cf-accent);
|
|
2688
|
+
outline-offset: 2px;
|
|
2689
|
+
}
|
|
2690
|
+
.cf-analytics-visualization__expand svg,
|
|
2691
|
+
.cf-analytics-visualization__close svg { width: 15px; height: 15px; }
|
|
2692
|
+
.cf-analytics-visualization__kpi {
|
|
2693
|
+
padding: 8px 0 6px;
|
|
2694
|
+
color: var(--cf-text);
|
|
2695
|
+
font-size: 30px;
|
|
2696
|
+
font-weight: 750;
|
|
2697
|
+
letter-spacing: -.035em;
|
|
2698
|
+
}
|
|
2699
|
+
.cf-analytics-kpi {
|
|
2700
|
+
padding: 9px 0 5px;
|
|
2701
|
+
}
|
|
2702
|
+
.cf-analytics-kpi__label {
|
|
2703
|
+
color: var(--cf-muted);
|
|
2704
|
+
font-size: 9px;
|
|
2705
|
+
font-weight: 700;
|
|
2706
|
+
letter-spacing: .06em;
|
|
2707
|
+
text-transform: uppercase;
|
|
2708
|
+
}
|
|
2709
|
+
.cf-analytics-kpi__value {
|
|
2710
|
+
margin-top: 5px;
|
|
2711
|
+
color: var(--cf-text);
|
|
2712
|
+
font-size: 30px;
|
|
2713
|
+
font-weight: 750;
|
|
2714
|
+
letter-spacing: -.035em;
|
|
2715
|
+
line-height: 1;
|
|
2716
|
+
}
|
|
2717
|
+
.cf-analytics-kpi__detail {
|
|
2718
|
+
margin-top: 8px;
|
|
2719
|
+
color: var(--cf-muted);
|
|
2720
|
+
font-size: 10px;
|
|
2721
|
+
line-height: 1.5;
|
|
2722
|
+
}
|
|
2723
|
+
.cf-analytics-empty {
|
|
2724
|
+
margin-top: 8px;
|
|
2725
|
+
border: 1px dashed var(--cf-border);
|
|
2726
|
+
border-radius: 11px;
|
|
2727
|
+
padding: 18px 14px;
|
|
2728
|
+
color: var(--cf-text);
|
|
2729
|
+
text-align: center;
|
|
2730
|
+
}
|
|
2731
|
+
.cf-analytics-empty p { margin: 0; }
|
|
2732
|
+
.cf-analytics-empty p + p {
|
|
2733
|
+
margin-top: 4px;
|
|
2734
|
+
color: var(--cf-muted);
|
|
2735
|
+
font-size: 10px;
|
|
2736
|
+
}
|
|
2737
|
+
.cf-analytics-echart {
|
|
2738
|
+
position: relative;
|
|
2739
|
+
width: 100%;
|
|
2740
|
+
height: 196px;
|
|
2741
|
+
min-width: 0;
|
|
2742
|
+
}
|
|
2743
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-echart {
|
|
2744
|
+
height: auto;
|
|
2745
|
+
min-height: 310px;
|
|
2746
|
+
flex: 1;
|
|
2747
|
+
}
|
|
2748
|
+
.cf-analytics-echart canvas:focus-visible {
|
|
2749
|
+
outline: 2px solid var(--cf-accent);
|
|
2750
|
+
outline-offset: -2px;
|
|
2751
|
+
}
|
|
2752
|
+
.cf-analytics-echart__fallback {
|
|
2753
|
+
display: grid;
|
|
2754
|
+
height: 100%;
|
|
2755
|
+
place-items: center;
|
|
2756
|
+
border: 1px dashed var(--cf-border);
|
|
2757
|
+
border-radius: 9px;
|
|
2758
|
+
padding: 16px;
|
|
2759
|
+
color: var(--cf-muted);
|
|
2760
|
+
text-align: center;
|
|
2761
|
+
line-height: 1.5;
|
|
2762
|
+
}
|
|
2763
|
+
.cf-analytics-zoom {
|
|
2764
|
+
display: flex;
|
|
2765
|
+
min-width: 0;
|
|
2766
|
+
align-items: center;
|
|
2767
|
+
justify-content: space-between;
|
|
2768
|
+
gap: 8px;
|
|
2769
|
+
margin-top: 4px;
|
|
2770
|
+
border-top: 1px solid var(--cf-border);
|
|
2771
|
+
padding-top: 8px;
|
|
1002
2772
|
}
|
|
1003
|
-
.cf-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
z-index: 3;
|
|
1015
|
-
pointer-events: auto;
|
|
2773
|
+
.cf-analytics-zoom__range {
|
|
2774
|
+
min-width: 0;
|
|
2775
|
+
overflow: hidden;
|
|
2776
|
+
color: var(--cf-muted);
|
|
2777
|
+
font-size: 10px;
|
|
2778
|
+
font-weight: 650;
|
|
2779
|
+
line-height: 1.3;
|
|
2780
|
+
text-overflow: ellipsis;
|
|
2781
|
+
white-space: nowrap;
|
|
2782
|
+
}
|
|
2783
|
+
.cf-analytics-zoom__controls {
|
|
1016
2784
|
display: inline-flex;
|
|
2785
|
+
flex: 0 0 auto;
|
|
1017
2786
|
align-items: center;
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
background: linear-gradient(135deg, var(--cf-accent, #2f7f55) 0%, var(--cf-accent-2, #2f7de8) 160%);
|
|
1023
|
-
border-radius: 999px;
|
|
1024
|
-
padding: 7px 14px;
|
|
1025
|
-
box-shadow: var(--cf-shadow);
|
|
1026
|
-
animation: cf-msg-in 0.2s ease both;
|
|
2787
|
+
overflow: hidden;
|
|
2788
|
+
border: 1px solid var(--cf-border);
|
|
2789
|
+
border-radius: 9px;
|
|
2790
|
+
background: var(--cf-bg);
|
|
1027
2791
|
}
|
|
1028
|
-
.cf-
|
|
1029
|
-
|
|
1030
|
-
/* ---------- Clear-chat confirm dialog (in-widget, replaces window.confirm) ---------- */
|
|
1031
|
-
.cf-confirm {
|
|
1032
|
-
position: absolute;
|
|
1033
|
-
inset: 0;
|
|
1034
|
-
z-index: 6;
|
|
1035
|
-
pointer-events: auto;
|
|
2792
|
+
.cf-analytics-zoom__controls button {
|
|
1036
2793
|
display: grid;
|
|
2794
|
+
min-width: 40px;
|
|
2795
|
+
height: 40px;
|
|
1037
2796
|
place-items: center;
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
2797
|
+
border: 0 !important;
|
|
2798
|
+
border-radius: 0;
|
|
2799
|
+
background: transparent !important;
|
|
2800
|
+
color: var(--cf-text) !important;
|
|
2801
|
+
font: inherit;
|
|
2802
|
+
font-size: 16px;
|
|
2803
|
+
font-weight: 700;
|
|
2804
|
+
line-height: 1;
|
|
1042
2805
|
}
|
|
1043
|
-
.cf-
|
|
1044
|
-
|
|
1045
|
-
|
|
2806
|
+
.cf-analytics-zoom__controls button + button { border-left: 1px solid var(--cf-border) !important; }
|
|
2807
|
+
.cf-analytics-zoom__controls button:hover:not(:disabled) { background: var(--cf-surface-2) !important; }
|
|
2808
|
+
.cf-analytics-zoom__controls button:focus-visible {
|
|
2809
|
+
position: relative;
|
|
2810
|
+
z-index: 1;
|
|
2811
|
+
outline: 2px solid var(--cf-accent);
|
|
2812
|
+
outline-offset: -2px;
|
|
2813
|
+
}
|
|
2814
|
+
.cf-analytics-zoom__controls button:disabled { cursor: not-allowed; opacity: .38; }
|
|
2815
|
+
.cf-analytics-zoom__controls .cf-analytics-zoom__reset {
|
|
2816
|
+
min-width: 56px;
|
|
2817
|
+
padding: 0 10px;
|
|
2818
|
+
font-size: 10px;
|
|
2819
|
+
font-weight: 700;
|
|
2820
|
+
}
|
|
2821
|
+
.cf-analytics-chart__summary {
|
|
2822
|
+
margin: 2px 0 0;
|
|
2823
|
+
color: var(--cf-muted);
|
|
2824
|
+
font-size: 11px;
|
|
2825
|
+
line-height: 1.45;
|
|
2826
|
+
}
|
|
2827
|
+
.cf-analytics-focus {
|
|
2828
|
+
height: 100%;
|
|
2829
|
+
min-height: 0;
|
|
2830
|
+
overflow: auto;
|
|
1046
2831
|
background: var(--cf-bg);
|
|
1047
|
-
border: 1px solid var(--cf-border);
|
|
1048
|
-
border-radius: 16px;
|
|
1049
|
-
box-shadow: var(--cf-shadow);
|
|
1050
2832
|
padding: 18px;
|
|
1051
|
-
text-align: center;
|
|
1052
|
-
animation: cf-msg-in 0.18s cubic-bezier(0.22, 1, 0.36, 1) both;
|
|
1053
2833
|
}
|
|
1054
|
-
|
|
1055
|
-
.cf-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
transition: transform 0.1s ease, opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
|
|
2834
|
+
@media (min-width: 640px) {
|
|
2835
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
2836
|
+
grid-template-columns: minmax(0, 1fr);
|
|
2837
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
2838
|
+
grid-template-areas: 'header' 'video';
|
|
2839
|
+
}
|
|
2840
|
+
.cf-panel--analytics-focus .cf-panel__video { height: 100%; }
|
|
2841
|
+
.cf-panel--analytics-focus .cf-panel__chat { display: none; }
|
|
1063
2842
|
}
|
|
1064
|
-
.cf-
|
|
1065
|
-
|
|
1066
|
-
.cf-confirm__btn--cancel { background: var(--cf-surface); color: var(--cf-text); border: 1px solid var(--cf-border); }
|
|
1067
|
-
.cf-confirm__btn--cancel:hover { border-color: var(--cf-accent); }
|
|
1068
|
-
.cf-confirm__btn--danger { background: #f25767; color: #fff; }
|
|
1069
|
-
.cf-confirm__btn--danger:hover { opacity: 0.9; }
|
|
1070
|
-
|
|
1071
|
-
/* Visually-hidden live region (announces the final answer only). */
|
|
1072
|
-
.cf-sr-live {
|
|
1073
|
-
position: absolute;
|
|
1074
|
-
width: 1px;
|
|
1075
|
-
height: 1px;
|
|
1076
|
-
padding: 0;
|
|
1077
|
-
margin: -1px;
|
|
2843
|
+
.cf-analytics-explanation {
|
|
2844
|
+
margin-top: 10px;
|
|
1078
2845
|
overflow: hidden;
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
2846
|
+
border: 1px solid var(--cf-border);
|
|
2847
|
+
border-radius: 12px;
|
|
2848
|
+
background: var(--cf-surface);
|
|
2849
|
+
color: var(--cf-text);
|
|
2850
|
+
font-size: 12px;
|
|
2851
|
+
line-height: 1.55;
|
|
1082
2852
|
}
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
.cf-
|
|
1086
|
-
.cf-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
.cf-
|
|
2853
|
+
.cf-analytics-explanation h3,
|
|
2854
|
+
.cf-analytics-explanation h4,
|
|
2855
|
+
.cf-analytics-explanation p { margin: 0; }
|
|
2856
|
+
.cf-analytics-explanation__lead {
|
|
2857
|
+
border-bottom: 1px solid var(--cf-border);
|
|
2858
|
+
padding: 12px;
|
|
2859
|
+
}
|
|
2860
|
+
.cf-analytics-explanation__lead-meta {
|
|
2861
|
+
display: flex;
|
|
2862
|
+
flex-wrap: wrap;
|
|
2863
|
+
align-items: center;
|
|
2864
|
+
gap: 5px 8px;
|
|
2865
|
+
}
|
|
2866
|
+
.cf-analytics-explanation__eyebrow {
|
|
2867
|
+
color: var(--cf-accent);
|
|
2868
|
+
font-size: 9px;
|
|
2869
|
+
font-weight: 750;
|
|
2870
|
+
letter-spacing: .1em;
|
|
2871
|
+
text-transform: uppercase;
|
|
2872
|
+
}
|
|
2873
|
+
.cf-analytics-explanation__provenance {
|
|
1091
2874
|
display: inline-flex;
|
|
1092
2875
|
align-items: center;
|
|
1093
|
-
gap:
|
|
1094
|
-
|
|
1095
|
-
|
|
2876
|
+
gap: 5px;
|
|
2877
|
+
color: var(--cf-muted);
|
|
2878
|
+
font-size: 9px;
|
|
2879
|
+
font-weight: 650;
|
|
2880
|
+
}
|
|
2881
|
+
.cf-analytics-explanation__provenance-dot {
|
|
2882
|
+
width: 5px;
|
|
2883
|
+
height: 5px;
|
|
1096
2884
|
border-radius: 999px;
|
|
1097
|
-
background: var(--cf-
|
|
1098
|
-
|
|
2885
|
+
background: var(--cf-accent);
|
|
2886
|
+
}
|
|
2887
|
+
.cf-analytics-explanation__headline {
|
|
2888
|
+
margin-top: 8px !important;
|
|
2889
|
+
color: var(--cf-text);
|
|
2890
|
+
font-size: 15px;
|
|
2891
|
+
font-weight: 750;
|
|
2892
|
+
letter-spacing: -.012em;
|
|
2893
|
+
line-height: 1.45;
|
|
2894
|
+
}
|
|
2895
|
+
.cf-analytics-explanation__summary {
|
|
2896
|
+
margin-top: 5px !important;
|
|
2897
|
+
color: var(--cf-muted);
|
|
2898
|
+
font-size: 12px;
|
|
2899
|
+
line-height: 1.6;
|
|
2900
|
+
}
|
|
2901
|
+
.cf-analytics-explanation__body {
|
|
2902
|
+
display: grid;
|
|
2903
|
+
gap: 14px;
|
|
2904
|
+
padding: 12px;
|
|
2905
|
+
}
|
|
2906
|
+
.cf-analytics-explanation__status { color: var(--cf-muted); }
|
|
2907
|
+
.cf-analytics-explanation__error {
|
|
2908
|
+
border-radius: 8px;
|
|
2909
|
+
background: color-mix(in srgb, #d97706 10%, var(--cf-surface));
|
|
2910
|
+
padding: 9px 10px;
|
|
2911
|
+
color: var(--cf-text);
|
|
2912
|
+
}
|
|
2913
|
+
.cf-analytics-explanation__heading {
|
|
1099
2914
|
color: var(--cf-text);
|
|
1100
2915
|
font-size: 12px;
|
|
2916
|
+
font-weight: 750;
|
|
2917
|
+
line-height: 1.45;
|
|
1101
2918
|
}
|
|
1102
|
-
.cf-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
@media (max-width: 480px) {
|
|
1110
|
-
.cf-panel {
|
|
1111
|
-
bottom: 0;
|
|
1112
|
-
right: 0;
|
|
1113
|
-
width: 100vw;
|
|
1114
|
-
max-width: 100vw;
|
|
1115
|
-
height: 100dvh;
|
|
1116
|
-
max-height: 100dvh;
|
|
1117
|
-
border-radius: 0;
|
|
1118
|
-
}
|
|
1119
|
-
.cf-launcher { bottom: 16px; right: 16px; }
|
|
2919
|
+
.cf-analytics-explanation__evidence {
|
|
2920
|
+
display: grid;
|
|
2921
|
+
gap: 7px;
|
|
2922
|
+
margin: 8px 0 0;
|
|
2923
|
+
padding: 0;
|
|
2924
|
+
list-style: none;
|
|
2925
|
+
color: var(--cf-muted);
|
|
1120
2926
|
}
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
to { transform: scale(1); opacity: 1; }
|
|
2927
|
+
.cf-analytics-explanation__evidence-item {
|
|
2928
|
+
display: flex;
|
|
2929
|
+
gap: 8px;
|
|
2930
|
+
align-items: flex-start;
|
|
1126
2931
|
}
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
2932
|
+
.cf-analytics-explanation__evidence-bullet {
|
|
2933
|
+
width: 5px;
|
|
2934
|
+
height: 5px;
|
|
2935
|
+
flex: 0 0 auto;
|
|
2936
|
+
margin-top: 7px;
|
|
2937
|
+
border-radius: 999px;
|
|
2938
|
+
background: var(--cf-accent);
|
|
1130
2939
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
2940
|
+
.cf-analytics-explanation__meaning {
|
|
2941
|
+
border-left: 2px solid var(--cf-accent);
|
|
2942
|
+
border-radius: 0 8px 8px 0;
|
|
2943
|
+
background: color-mix(in srgb, var(--cf-accent) 7%, var(--cf-surface));
|
|
2944
|
+
padding: 10px 11px;
|
|
1134
2945
|
}
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
2946
|
+
.cf-analytics-explanation__paragraph {
|
|
2947
|
+
margin-top: 5px !important;
|
|
2948
|
+
color: var(--cf-muted);
|
|
1138
2949
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
2950
|
+
.cf-analytics-explanation__section-heading,
|
|
2951
|
+
.cf-analytics-explanation__outlook-header {
|
|
2952
|
+
display: flex;
|
|
2953
|
+
flex-wrap: wrap;
|
|
2954
|
+
align-items: baseline;
|
|
2955
|
+
justify-content: space-between;
|
|
2956
|
+
gap: 4px 8px;
|
|
1142
2957
|
}
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
2958
|
+
.cf-analytics-explanation__hint,
|
|
2959
|
+
.cf-analytics-explanation__outlook-badge {
|
|
2960
|
+
color: var(--cf-muted);
|
|
2961
|
+
font-size: 9px;
|
|
2962
|
+
font-weight: 650;
|
|
2963
|
+
}
|
|
2964
|
+
.cf-analytics-explanation__outlook-badge {
|
|
2965
|
+
color: var(--cf-accent);
|
|
2966
|
+
letter-spacing: .06em;
|
|
2967
|
+
text-transform: uppercase;
|
|
2968
|
+
}
|
|
2969
|
+
.cf-analytics-explanation__drivers,
|
|
2970
|
+
.cf-analytics-explanation__recommendations {
|
|
2971
|
+
display: grid;
|
|
2972
|
+
gap: 7px;
|
|
2973
|
+
margin-top: 8px;
|
|
2974
|
+
}
|
|
2975
|
+
.cf-analytics-explanation__driver {
|
|
2976
|
+
border-radius: 8px;
|
|
2977
|
+
background: var(--cf-bg);
|
|
2978
|
+
padding: 9px 10px;
|
|
2979
|
+
}
|
|
2980
|
+
.cf-analytics-explanation__driver-title,
|
|
2981
|
+
.cf-analytics-explanation__recommendation-title {
|
|
2982
|
+
color: var(--cf-text);
|
|
2983
|
+
font-weight: 750;
|
|
2984
|
+
}
|
|
2985
|
+
.cf-analytics-explanation__driver-body,
|
|
2986
|
+
.cf-analytics-explanation__recommendation-body {
|
|
2987
|
+
margin-top: 3px !important;
|
|
2988
|
+
color: var(--cf-muted);
|
|
2989
|
+
font-size: 11px;
|
|
2990
|
+
}
|
|
2991
|
+
.cf-analytics-explanation__driver-label { color: var(--cf-text); font-weight: 700; }
|
|
2992
|
+
.cf-analytics-explanation__recommendation {
|
|
2993
|
+
display: grid;
|
|
2994
|
+
grid-template-columns: 22px minmax(0, 1fr);
|
|
2995
|
+
gap: 8px;
|
|
2996
|
+
border-radius: 8px;
|
|
2997
|
+
background: var(--cf-bg);
|
|
2998
|
+
padding: 9px 10px;
|
|
2999
|
+
}
|
|
3000
|
+
.cf-analytics-explanation__recommendation-index {
|
|
3001
|
+
display: grid;
|
|
3002
|
+
width: 22px;
|
|
3003
|
+
height: 22px;
|
|
3004
|
+
place-items: center;
|
|
3005
|
+
border-radius: 999px;
|
|
3006
|
+
background: color-mix(in srgb, var(--cf-accent) 12%, var(--cf-surface));
|
|
3007
|
+
color: var(--cf-accent);
|
|
3008
|
+
font-size: 10px;
|
|
3009
|
+
font-weight: 750;
|
|
3010
|
+
}
|
|
3011
|
+
.cf-analytics-explanation__outlook {
|
|
3012
|
+
border-radius: 8px;
|
|
3013
|
+
background: var(--cf-bg);
|
|
3014
|
+
padding: 10px 11px;
|
|
3015
|
+
}
|
|
3016
|
+
.cf-analytics-explanation__follow-up {
|
|
3017
|
+
border-top: 1px solid var(--cf-border);
|
|
3018
|
+
padding-top: 12px;
|
|
3019
|
+
}
|
|
3020
|
+
.cf-analytics-explanation__questions {
|
|
3021
|
+
display: grid;
|
|
3022
|
+
gap: 6px;
|
|
3023
|
+
margin-top: 8px;
|
|
3024
|
+
}
|
|
3025
|
+
.cf-analytics-explanation__question {
|
|
3026
|
+
width: 100%;
|
|
3027
|
+
border: 1px solid var(--cf-border);
|
|
3028
|
+
border-radius: 8px;
|
|
3029
|
+
background: var(--cf-bg);
|
|
3030
|
+
padding: 8px 9px;
|
|
3031
|
+
color: var(--cf-text);
|
|
3032
|
+
font: inherit;
|
|
3033
|
+
text-align: left;
|
|
3034
|
+
cursor: pointer;
|
|
3035
|
+
}
|
|
3036
|
+
.cf-analytics-explanation__question:hover {
|
|
3037
|
+
border-color: color-mix(in srgb, var(--cf-accent) 45%, var(--cf-border));
|
|
3038
|
+
background: color-mix(in srgb, var(--cf-accent) 6%, var(--cf-bg));
|
|
3039
|
+
}
|
|
3040
|
+
.cf-analytics-explanation__question:focus-visible,
|
|
3041
|
+
.cf-analytics-explanation__limits-summary:focus-visible {
|
|
3042
|
+
outline: 2px solid var(--cf-accent);
|
|
3043
|
+
outline-offset: 2px;
|
|
3044
|
+
}
|
|
3045
|
+
.cf-analytics-explanation__limits {
|
|
3046
|
+
border-top: 1px solid var(--cf-border);
|
|
3047
|
+
padding-top: 10px;
|
|
3048
|
+
}
|
|
3049
|
+
.cf-analytics-explanation__limits-summary {
|
|
3050
|
+
cursor: pointer;
|
|
3051
|
+
color: var(--cf-text);
|
|
3052
|
+
font-weight: 700;
|
|
3053
|
+
}
|
|
3054
|
+
.cf-analytics-explanation__limits-list {
|
|
3055
|
+
margin: 8px 0 0;
|
|
3056
|
+
padding-left: 17px;
|
|
3057
|
+
color: var(--cf-muted);
|
|
3058
|
+
}
|
|
3059
|
+
.cf-analytics-explanation__source {
|
|
3060
|
+
border-top: 1px solid var(--cf-border);
|
|
3061
|
+
margin: 0;
|
|
3062
|
+
padding: 9px 12px;
|
|
3063
|
+
color: var(--cf-muted);
|
|
3064
|
+
font-size: 10px;
|
|
1146
3065
|
}
|
|
1147
3066
|
|
|
1148
|
-
@media (
|
|
1149
|
-
.cf-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
3067
|
+
@media (max-width: 639px) {
|
|
3068
|
+
.cf-panel.cf-panel--analytics-focus {
|
|
3069
|
+
inset: 12px;
|
|
3070
|
+
width: auto;
|
|
3071
|
+
height: auto;
|
|
3072
|
+
min-height: 0;
|
|
3073
|
+
max-width: none;
|
|
3074
|
+
max-height: none;
|
|
3075
|
+
grid-template-rows: auto minmax(0, 1fr);
|
|
3076
|
+
grid-template-areas: 'header' 'video';
|
|
3077
|
+
transform-origin: center;
|
|
1154
3078
|
}
|
|
3079
|
+
.cf-panel--analytics-focus .cf-panel__video { height: 100%; }
|
|
3080
|
+
.cf-panel--analytics-focus .cf-panel__chat { display: none; }
|
|
3081
|
+
.cf-analytics-focus { padding: 14px; }
|
|
3082
|
+
.cf-analytics-visualization.is-expanded .cf-analytics-echart { min-height: 260px; }
|
|
1155
3083
|
}
|
|
1156
|
-
`,
|
|
3084
|
+
`,Qd="centrinfo-widget";class UE extends HTMLElement{constructor(){super(...arguments);tr(this,"controls",null)}mountWith(r){const n=WE(r),a=this.shadowRoot??this.attachShadow({mode:"open"});if("adoptedStyleSheets"in Document.prototype&&typeof CSSStyleSheet<"u"){const o=new CSSStyleSheet;o.replaceSync(Jx),a.adoptedStyleSheets=[o]}else{const o=document.createElement("style");o.textContent=Jx,a.appendChild(o)}const i=n.demo?new H1:n.preview?new V1(new Lv(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken),n.strings):new Lv(n.apiBaseUrl,n.token,n.gifApiKey,n.analyticsContextToken,{agentName:n.agentName,agentAvatarUrl:n.agentAvatarUrl},n.identityToken,n.getIdentityToken);Dv(_(VE,{transport:i,config:n,bindControls:o=>this.controls=o}),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&&Dv(null,this.shadowRoot)}}typeof customElements<"u"&&!customElements.get(Qd)&&customElements.define(Qd,UE);const $E=(t,e=document.body)=>{if(typeof document>"u")throw new Error("[centrinfo-widget] createWidget must run in a browser.");const r=document.createElement(Qd);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()}}},e1=t=>$E(t);let t1=null;const r1=t=>{t1?.destroy();const e=e1(t);return t1=e,e},YE=t=>t==="light"||t==="dark"||t==="auto"?t:void 0,zo=t=>{if(t==null||t.trim()==="")return;const e=Number(t);return Number.isFinite(e)?e:void 0},qE=t=>{if(t)try{const e=JSON.parse(t);return e&&typeof e=="object"?e:void 0}catch{return}},XE=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:YE(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:zo(e("data-horizontal-padding")),verticalPadding:zo(e("data-vertical-padding")),hideDefaultLauncher:e("data-hide-launcher")==="true",customLauncherSelector:e("data-custom-launcher-selector")??void 0,sessionDurationMinutes:zo(e("data-session-duration")),configRefreshSeconds:zo(e("data-config-refresh")),proactiveMessage:e("data-proactive-message")??void 0,proactiveDelaySeconds:zo(e("data-proactive-delay")),csat:e("data-csat")==="false"?!1:void 0,user:qE(e("data-user"))}:null},ZE=t=>{typeof document>"u"||(document.readyState!=="loading"?t():document.addEventListener("DOMContentLoaded",t,{once:!0}))},KE=()=>{const t=document.currentScript??document.querySelector("script[data-token]");if(!t)return;const e=XE(t);e&&r1(e)};return ZE(()=>{try{KE()}catch(t){console.error("[centrinfo-widget]",t)}}),mr.createWidget=e1,mr.init=r1,Object.defineProperty(mr,Symbol.toStringTag,{value:"Module"}),mr})({});
|