diff --git a/DESCRIPTION b/DESCRIPTION index 11e3fde..ef8b5b9 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: vchartr Title: Interactive Charts with the JavaScript 'VChart' Library -Version: 0.0.0.9000 +Version: 0.0.0.9100 Authors@R: c( person("Victor", "Perrier", email = "victor.perrier@dreamrs.fr", role = c("aut", "cre")), person("Fanny", "Meyer", role = "aut")) diff --git a/inst/htmlwidgets/vchart.js b/inst/htmlwidgets/vchart.js index e449d63..63692bd 100644 --- a/inst/htmlwidgets/vchart.js +++ b/inst/htmlwidgets/vchart.js @@ -1 +1 @@ -(()=>{var t={4353:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",s="second",n="minute",r="hour",a="day",o="week",l="month",h="quarter",d="year",c="date",u="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},_=function(t,e,i){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(i)+t},f={s:_,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),s=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+_(s,2,"0")+":"+_(n,2,"0")},m:function t(e,i){if(e.date()1)return t(a[0])}else{var o=e.name;y[o]=e,n=o}return!s&&n&&(v=n),n||!s&&v},M=function(t,e){if(x(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new A(i)},k=f;k.l=S,k.i=x,k.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function m(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var _=m.prototype;return _.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(p);if(s){var n=s[2]-1||0,r=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(e)}(t),this.init()},_.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},_.$utils=function(){return k},_.isValid=function(){return!(this.$d.toString()===u)},_.isSame=function(t,e){var i=M(t);return this.startOf(e)<=i&&i<=this.endOf(e)},_.isAfter=function(t,e){return M(t)12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},3309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-iq",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},9865:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-kw",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},5592:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ly",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:6,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},meridiem:function(t){return t>12?"م":"ص"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},1289:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ma",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},539:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-sa",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},4405:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-tn",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},2338:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r={name:"ar",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),months:i,monthsShort:i,weekStart:6,meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"بعد %s",past:"منذ %s",s:"ثانية واحدة",m:"دقيقة واحدة",mm:"%d دقائق",h:"ساعة واحدة",hh:"%d ساعات",d:"يوم واحد",dd:"%d أيام",M:"شهر واحد",MM:"%d أشهر",y:"عام واحد",yy:"%d أعوام"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(r,null,!0),r}(i(4353))},1130:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"be",weekdays:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),months:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),weekStart:1,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},9990:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bg",weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekStart:1,ordinal:function(t){var e=t%100;if(e>10&&e<20)return t+"-ти";var i=t%10;return 1===i?t+"-ви":2===i?t+"-ри":7===i||8===i?t+"-ми":t+"-ти"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5944:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return e.default.locale(i,null,!0),i}(i(4353))},1092:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4608:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn-bd",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),weekStart:0,preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){var e=["ই","লা","রা","ঠা","শে"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY খ্রিস্টাব্দ",LL:"D MMMM YYYY খ্রিস্টাব্দ",LLL:"D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়",LLLL:"dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়"},meridiem:function(t){return t<4?"রাত":t<6?"ভোর":t<12?"সকাল":t<15?"দুপুর":t<18?"বিকাল":t<20?"সন্ধ্যা":"রাত"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},2509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){return t},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},9294:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bo",weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ལ་",past:"%s སྔོན་ལ་",s:"ཏོག་ཙམ་",m:"སྐར་མ་གཅིག་",mm:"སྐར་མ་ %d",h:"ཆུ་ཚོད་གཅིག་",hh:"ཆུ་ཚོད་ %d",d:"ཉིན་གཅིག་",dd:"ཉིན་ %d",M:"ཟླ་བ་གཅིག་",MM:"ཟླ་བ་ %d",y:"ལོ་གཅིག་",yy:"ལོ་ %d"}};return e.default.locale(i,null,!0),i}(i(4353))},2745:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>9?i(t%10):t}function s(t,e,i){return t+" "+function(t,e){return 2===e?function(t){return{m:"v",b:"v",d:"z"}[t.charAt(0)]+t.substring(1)}(t):t}({mm:"munutenn",MM:"miz",dd:"devezh"}[i],t)}var n={name:"br",weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),weekStart:1,weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:s,h:"un eur",hh:"%d eur",d:"un devezh",dd:s,M:"ur miz",MM:s,y:"ur bloaz",yy:function(t){switch(i(t)){case 1:case 3:case 4:case 5:case 9:return t+" bloaz";default:return t+" vloaz"}}},meridiem:function(t){return t<12?"a.m.":"g.m."}};return e.default.locale(n,null,!0),n}(i(4353))},5530:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bs",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5993:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(t){return t+(1===t||3===t?"r":2===t?"n":4===t?"t":"è")}};return e.default.locale(i,null,!0),i}(i(4353))},9751:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekund":"pár sekundami";case"m":return e?"minuta":n?"minutu":"minutou";case"mm":return e||n?r+(i(t)?"minuty":"minut"):r+"minutami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodin"):r+"hodinami";case"d":return e||n?"den":"dnem";case"dd":return e||n?r+(i(t)?"dny":"dní"):r+"dny";case"M":return e||n?"měsíc":"měsícem";case"MM":return e||n?r+(i(t)?"měsíce":"měsíců"):r+"měsíci";case"y":return e||n?"rok":"rokem";case"yy":return e||n?r+(i(t)?"roky":"let"):r+"lety"}}var n={name:"cs",weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),months:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),monthsShort:"led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"před %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},4780:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cv",weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),weekStart:1,weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5681:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cy",weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),weekStart:1,weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"}};return e.default.locale(i,null,!0),i}(i(4353))},2706:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"da",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn._man._tirs._ons._tors._fre._lør.".split("_"),weekdaysMin:"sø._ma._ti._on._to._fr._lø.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2878:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-at",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},3672:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-ch",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},494:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},2187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"dv",weekdays:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),months:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekStart:7,weekdaysShort:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),monthsShort:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4072:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"el",weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),months:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ".split("_"),ordinal:function(t){return t},weekStart:1,relativeTime:{future:"σε %s",past:"πριν %s",s:"μερικά δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένα μήνα",MM:"%d μήνες",y:"ένα χρόνο",yy:"%d χρόνια"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},9881:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-au",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},1995:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ca",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2026:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-gb",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},7329:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ie",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},7690:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-il",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},912:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-in",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5571:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-nz",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2673:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-sg",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2619:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-tt",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}}}()},3713:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eo",weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"}};return e.default.locale(i,null,!0),i}(i(4353))},1219:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-do",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekStart:1,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},4719:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-mx",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},3532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-pr",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},2498:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},7317:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},4288:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:["%d minuti","%d minutit"],h:["ühe tunni","tund aega","üks tund"],hh:["%d tunni","%d tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:["%d kuu","%d kuud"],y:["ühe aasta","aasta","üks aasta"],yy:["%d aasta","%d aastat"]};return e?(n[i][2]?n[i][2]:n[i][1]).replace("%d",t):(s?n[i][0]:n[i][1]).replace("%d",t)}var s={name:"et",weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s pärast",past:"%s tagasi",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:"%d päeva",M:i,MM:i,y:i,yy:i},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},4007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"}};return e.default.locale(i,null,!0),i}(i(4353))},292:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fa",weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},9964:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:"muutama sekunti",m:"minuutti",mm:"%d minuuttia",h:"tunti",hh:"%d tuntia",d:"päivä",dd:"%d päivää",M:"kuukausi",MM:"%d kuukautta",y:"vuosi",yy:"%d vuotta",numbers:"nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän".split("_")},r={s:"muutaman sekunnin",m:"minuutin",mm:"%d minuutin",h:"tunnin",hh:"%d tunnin",d:"päivän",dd:"%d päivän",M:"kuukauden",MM:"%d kuukauden",y:"vuoden",yy:"%d vuoden",numbers:"nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän".split("_")},a=s&&!e?r:n,o=a[i];return t<10?o.replace("%d",a.numbers[t]):o.replace("%d",t)}var s={name:"fi",weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"%s päästä",past:"%s sitten",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM[ta] YYYY",LLL:"D. MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, D. MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [klo] HH.mm",llll:"ddd, D. MMM YYYY, [klo] HH.mm"}};return e.default.locale(s,null,!0),s}(i(4353))},7674:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fo",weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"}};return e.default.locale(i,null,!0),i}(i(4353))},6290:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ca",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},3433:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ch",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekStart:1,weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},813:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return e.default.locale(i,null,!0),i}(i(4353))},9836:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fy",weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),weekStart:1,weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"}};return e.default.locale(i,null,!0),i}(i(4353))},4061:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ga",weekdays:"Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn".split("_"),months:"Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig".split("_"),weekStart:1,weekdaysShort:"Dom_Lua_Mái_Céa_Déa_hAo_Sat".split("_"),monthsShort:"Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll".split("_"),weekdaysMin:"Do_Lu_Má_Ce_Dé_hA_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"}};return e.default.locale(i,null,!0),i}(i(4353))},8418:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return e.default.locale(i,null,!0),i}(i(4353))},3562:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gl",weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},8660:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gom-latn",weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),weekStart:1,weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"}};return e.default.locale(i,null,!0),i}(i(4353))},7409:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gu",weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"}};return e.default.locale(i,null,!0),i}(i(4353))},2010:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:"%d שעות",hh2:"שעתיים",d:"יום",dd:"%d ימים",dd2:"יומיים",M:"חודש",MM:"%d חודשים",MM2:"חודשיים",y:"שנה",yy:"%d שנים",yy2:"שנתיים"};function s(t,e,s){return(i[s+(2===t?"2":"")]||i[s]).replace("%d",t)}var n={name:"he",weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳".split("_"),months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ".split("_"),relativeTime:{future:"בעוד %s",past:"לפני %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinal:function(t){return t},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"}};return e.default.locale(n,null,!0),n}(i(4353))},2830:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hi",weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"}};return e.default.locale(i,null,!0),i}(i(4353))},5811:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),s="siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"hr",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:r,monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},relativeTime:{future:"za %s",past:"prije %s",s:"sekunda",m:"minuta",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mjesec",MM:"%d mjeseci",y:"godina",yy:"%d godine"},ordinal:function(t){return t+"."}};return e.default.locale(a,null,!0),a}(i(4353))},8809:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ht",weekdays:"dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi".split("_"),months:"janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm".split("_"),weekdaysShort:"dim._len._mad._mèk._jed._van._sam.".split("_"),monthsShort:"jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.".split("_"),weekdaysMin:"di_le_ma_mè_je_va_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"nan %s",past:"sa gen %s",s:"kèk segond",m:"yon minit",mm:"%d minit",h:"inèdtan",hh:"%d zè",d:"yon jou",dd:"%d jou",M:"yon mwa",MM:"%d mwa",y:"yon ane",yy:"%d ane"}};return e.default.locale(i,null,!0),i}(i(4353))},8298:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hu",weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s múlva",past:"%s",s:function(t,e,i,s){return"néhány másodperc"+(s||e?"":"e")},m:function(t,e,i,s){return"egy perc"+(s||e?"":"e")},mm:function(t,e,i,s){return t+" perc"+(s||e?"":"e")},h:function(t,e,i,s){return"egy "+(s||e?"óra":"órája")},hh:function(t,e,i,s){return t+" "+(s||e?"óra":"órája")},d:function(t,e,i,s){return"egy "+(s||e?"nap":"napja")},dd:function(t,e,i,s){return t+" "+(s||e?"nap":"napja")},M:function(t,e,i,s){return"egy "+(s||e?"hónap":"hónapja")},MM:function(t,e,i,s){return t+" "+(s||e?"hónap":"hónapja")},y:function(t,e,i,s){return"egy "+(s||e?"év":"éve")},yy:function(t,e,i,s){return t+" "+(s||e?"év":"éve")}},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return e.default.locale(i,null,!0),i}(i(4353))},7420:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"id",weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},5513:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:["nokkrar sekúndur","nokkrar sekúndur","nokkrum sekúndum"],m:["mínúta","mínútu","mínútu"],mm:["mínútur","mínútur","mínútum"],h:["klukkustund","klukkustund","klukkustund"],hh:["klukkustundir","klukkustundir","klukkustundum"],d:["dagur","dag","degi"],dd:["dagar","daga","dögum"],M:["mánuður","mánuð","mánuði"],MM:["mánuðir","mánuði","mánuðum"],y:["ár","ár","ári"],yy:["ár","ár","árum"]};function s(t,e,s,n){var r=function(t,e,s,n){var r=n?0:s?1:2,a=2===t.length&&e%10==1?t[0]:t,o=i[a][r];return 1===t.length?o:"%d "+o}(s,t,n,e);return r.replace("%d",t)}var n={name:"is",weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9286:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it-ch",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};return e.default.locale(i,null,!0),i}(i(4353))},3900:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},952:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t){return t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(t){return t<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return e.default.locale(i,null,!0),i}(i(4353))},7741:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"jv",weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),weekStart:1,weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"}};return e.default.locale(i,null,!0),i}(i(4353))},6481:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ka",weekdays:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"%s შემდეგ",past:"%s წინ",s:"წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათის",d:"დღეს",dd:"%d დღის განმავლობაში",M:"თვის",MM:"%d თვის",y:"წელი",yy:"%d წლის"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1335:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},6101:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"km",weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekStart:1,weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"}};return e.default.locale(i,null,!0),i}(i(4353))},6364:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return e.default.locale(i,null,!0),i}(i(4353))},8003:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(t){return t+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(t){return t<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return e.default.locale(i,null,!0),i}(i(4353))},6605:function(t,e,i){!function(t,e){"use strict";var i=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(e),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانوونی دووەم","شوبات","ئادار","نیسان","ئایار","حوزەیران","تەممووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانوونی یەکەم"],a={name:"ku",months:r,monthsShort:r,weekdays:"یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە".split("_"),weekdaysShort:"یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە".split("_"),weekStart:6,weekdaysMin:"ی_د_س_چ_پ_هـ_ش".split("_"),preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiem:function(t){return t<12?"پ.ن":"د.ن"},relativeTime:{future:"لە %s",past:"لەمەوپێش %s",s:"چەند چرکەیەک",m:"یەک خولەک",mm:"%d خولەک",h:"یەک کاتژمێر",hh:"%d کاتژمێر",d:"یەک ڕۆژ",dd:"%d ڕۆژ",M:"یەک مانگ",MM:"%d مانگ",y:"یەک ساڵ",yy:"%d ساڵ"}};i.default.locale(a,null,!0),t.default=a,t.englishToArabicNumbersMap=s,Object.defineProperty(t,"__esModule",{value:!0})}(e,i(4353))},4457:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ky",weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),weekStart:1,weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"}};return e.default.locale(i,null,!0),i}(i(4353))},8615:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lb",weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"}};return e.default.locale(i,null,!0),i}(i(4353))},3860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lo",weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"}};return e.default.locale(i,null,!0),i}(i(4353))},4485:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),s="sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),n=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"lt",weekdays:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),weekdaysShort:"sek_pir_ant_tre_ket_pen_šeš".split("_"),weekdaysMin:"s_p_a_t_k_pn_š".split("_"),months:r,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"už %s",past:"prieš %s",s:"kelias sekundes",m:"minutę",mm:"%d minutes",h:"valandą",hh:"%d valandas",d:"dieną",dd:"%d dienas",M:"mėnesį",MM:"%d mėnesius",y:"metus",yy:"%d metus"},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"}};return e.default.locale(a,null,!0),a}(i(4353))},6467:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},relativeTime:{future:"pēc %s",past:"pirms %s",s:"dažām sekundēm",m:"minūtes",mm:"%d minūtēm",h:"stundas",hh:"%d stundām",d:"dienas",dd:"%d dienām",M:"mēneša",MM:"%d mēnešiem",y:"gada",yy:"%d gadiem"}};return e.default.locale(i,null,!0),i}(i(4353))},623:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"me",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},2739:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mi",weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),weekStart:1,weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"}};return e.default.locale(i,null,!0),i}(i(4353))},5877:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mk",weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),weekStart:1,weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5376:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ml",weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"}};return e.default.locale(i,null,!0),i}(i(4353))},2698:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mn",weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},relativeTime:{future:"%s",past:"%s",s:"саяхан",m:"м",mm:"%dм",h:"1ц",hh:"%dц",d:"1ө",dd:"%dө",M:"1с",MM:"%dс",y:"1ж",yy:"%dж"}};return e.default.locale(i,null,!0),i}(i(4353))},6462:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mr",weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"}};return e.default.locale(i,null,!0),i}(i(4353))},6400:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms-my",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),weekStart:1,weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"}};return e.default.locale(i,null,!0),i}(i(4353))},9677:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH.mm",LLLL:"dddd, D MMMM YYYY HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},9464:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mt",weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),weekStart:1,weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"}};return e.default.locale(i,null,!0),i}(i(4353))},6803:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"my",weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),weekStart:1,weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"}};return e.default.locale(i,null,!0),i}(i(4353))},7205:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nb",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},880:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ne",weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),relativeTime:{future:"%s पछि",past:"%s अघि",s:"सेकेन्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"घन्टा",hh:"%d घन्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक वर्ष",yy:"%d वर्ष"},ordinal:function(t){return(""+t).replace(/\d/g,(function(t){return"०१२३४५६७८९"[t]}))},formats:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"}};return e.default.locale(i,null,!0),i}(i(4353))},465:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl-be",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),weekStart:1,weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},9423:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(t){return"["+t+(1===t||8===t||t>=20?"ste":"de")+"]"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},3473:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nn",weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eitt minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månadar",y:"eitt år",yy:"%d år"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"oc-lnc",weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"Dg_Dl_Dm_Dc_Dj_Dv_Ds".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),months:"genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),monthsShort:"gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},9252:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pa-in",weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"}};return e.default.locale(i,null,!0),i}(i(4353))},3225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function s(t,e,s){var n=t+" ";switch(s){case"m":return e?"minuta":"minutę";case"mm":return n+(i(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return n+(i(t)?"godziny":"godzin");case"MM":return n+(i(t)?"miesiące":"miesięcy");case"yy":return n+(i(t)?"lata":"lat")}}var n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),r="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),a=/D MMMM/,o=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};o.s=r,o.f=n;var l={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:o,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:s,y:"rok",yy:s},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(l,null,!0),l}(i(4353))},2218:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},2369:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},4509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rn",weekdays:"Ku wa Mungu_Ku wa Mbere_Ku wa Kabiri_Ku wa Gatatu_Ku wa Kane_Ku wa Gatanu_Ku wa Gatandatu".split("_"),weekdaysShort:"Kngu_Kmbr_Kbri_Ktat_Kkan_Ktan_Kdat".split("_"),weekdaysMin:"K7_K1_K2_K3_K4_K5_K6".split("_"),months:"Nzero_Ruhuhuma_Ntwarante_Ndamukiza_Rusama_Ruhenshi_Mukakaro_Myandagaro_Nyakanga_Gitugutu_Munyonyo_Kigarama".split("_"),monthsShort:"Nzer_Ruhuh_Ntwar_Ndam_Rus_Ruhen_Muk_Myand_Nyak_Git_Muny_Kig".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4334:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ro",weekdays:"Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),months:"Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),monthsShort:"Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"peste %s",past:"acum %s",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},2796:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),s="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),n="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),r="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),a=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function o(t,e,i){var s,n;return"m"===i?e?"минута":"минуту":t+" "+(s=+t,n={mm:e?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var l=function(t,e){return a.test(e)?i[t.month()]:s[t.month()]};l.s=s,l.f=i;var h=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};h.s=r,h.f=n;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:l,monthsShort:h,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:o,mm:o,h:"час",hh:o,d:"день",dd:o,M:"месяц",MM:o,y:"год",yy:o},ordinal:function(t){return t},meridiem:function(t){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"}};return e.default.locale(d,null,!0),d}(i(4353))},5414:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rw",weekdays:"Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu".split("_"),months:"Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza".split("_"),relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},3222:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sd",weekdays:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),months:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekStart:1,weekdaysShort:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),monthsShort:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekdaysMin:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},5285:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"se",weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),weekStart:1,weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"}};return e.default.locale(i,null,!0),i}(i(4353))},5665:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"si",weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),months:"දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),monthsShort:"දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),ordinal:function(t){return t},formats:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"විනාඩිය",mm:"විනාඩි %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6847:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekúnd":"pár sekundami";case"m":return e?"minúta":n?"minútu":"minútou";case"mm":return e||n?r+(i(t)?"minúty":"minút"):r+"minútami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodín"):r+"hodinami";case"d":return e||n?"deň":"dňom";case"dd":return e||n?r+(i(t)?"dni":"dní"):r+"dňami";case"M":return e||n?"mesiac":"mesiacom";case"MM":return e||n?r+(i(t)?"mesiace":"mesiacov"):r+"mesiacmi";case"y":return e||n?"rok":"rokom";case"yy":return e||n?r+(i(t)?"roky":"rokov"):r+"rokmi"}}var n={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9998:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%100==2}function s(t){return t%100==3||t%100==4}function n(t,e,n,r){var a=t+" ";switch(n){case"s":return e||r?"nekaj sekund":"nekaj sekundami";case"m":return e?"ena minuta":"eno minuto";case"mm":return i(t)?a+(e||r?"minuti":"minutama"):s(t)?a+(e||r?"minute":"minutami"):a+(e||r?"minut":"minutami");case"h":return e?"ena ura":"eno uro";case"hh":return i(t)?a+(e||r?"uri":"urama"):s(t)?a+(e||r?"ure":"urami"):a+(e||r?"ur":"urami");case"d":return e||r?"en dan":"enim dnem";case"dd":return i(t)?a+(e||r?"dneva":"dnevoma"):a+(e||r?"dni":"dnevi");case"M":return e||r?"en mesec":"enim mesecem";case"MM":return i(t)?a+(e||r?"meseca":"mesecema"):s(t)?a+(e||r?"mesece":"meseci"):a+(e||r?"mesecev":"meseci");case"y":return e||r?"eno leto":"enim letom";case"yy":return i(t)?a+(e||r?"leti":"letoma"):s(t)?a+(e||r?"leta":"leti"):a+(e||r?"let":"leti")}}var r={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"čez %s",past:"pred %s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n}};return e.default.locale(r,null,!0),r}(i(4353))},5977:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sq",weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),weekStart:1,weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"}};return e.default.locale(i,null,!0),i}(i(4353))},7439:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["један минут","једног минута"],mm:["%d минут","%d минута","%d минута"],h:["један сат","једног сата"],hh:["%d сат","%d сата","%d сати"],d:["један дан","једног дана"],dd:["%d дан","%d дана","%d дана"],M:["један месец","једног месеца"],MM:["%d месец","%d месеца","%d месеци"],y:["једну годину","једне године"],yy:["%d годину","%d године","%d година"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"једна година":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d годину"===a?t+" година":a.replace("%d",t)}},s={name:"sr-cyrl",weekdays:"Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота".split("_"),weekdaysShort:"Нед._Пон._Уто._Сре._Чет._Пет._Суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),months:"Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар".split("_"),monthsShort:"Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},5616:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["jedan minut","jednog minuta"],mm:["%d minut","%d minuta","%d minuta"],h:["jedan sat","jednog sata"],hh:["%d sat","%d sata","%d sati"],d:["jedan dan","jednog dana"],dd:["%d dan","%d dana","%d dana"],M:["jedan mesec","jednog meseca"],MM:["%d mesec","%d meseca","%d meseci"],y:["jednu godinu","jedne godine"],yy:["%d godinu","%d godine","%d godina"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"jedna godina":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d godinu"===a?t+" godina":a.replace("%d",t)}},s={name:"sr",weekdays:"Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota".split("_"),weekdaysShort:"Ned._Pon._Uto._Sre._Čet._Pet._Sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:"Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.".split("_"),weekStart:1,relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},2487:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ss",weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),weekStart:1,weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"}};return e.default.locale(i,null,!0),i}(i(4353))},9160:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv-fi",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY, [kl.] HH.mm",LLLL:"dddd, D. MMMM YYYY, [kl.] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [kl.] HH.mm",llll:"ddd, D. MMM YYYY, [kl.] HH.mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},1340:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2979:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sw",weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},7250:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ta",weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"}};return e.default.locale(i,null,!0),i}(i(4353))},7406:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"te",weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"}};return e.default.locale(i,null,!0),i}(i(4353))},8928:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tet",weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),weekStart:1,weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"}};return e.default.locale(i,null,!0),i}(i(4353))},5012:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tg",weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"}};return e.default.locale(i,null,!0),i}(i(4353))},7081:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},2544:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tk",weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},8142:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return e.default.locale(i,null,!0),i}(i(4353))},321:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tlh",weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),weekStart:1,weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4895:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},3187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzl",weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),weekStart:1,weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"}};return e.default.locale(i,null,!0),i}(i(4353))},8804:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm-latn",weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekStart:6,weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"}};return e.default.locale(i,null,!0),i}(i(4353))},5084:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm",weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekStart:6,weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"}};return e.default.locale(i,null,!0),i}(i(4353))},9911:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ug-cn",weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekStart:1,weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"}};return e.default.locale(i,null,!0),i}(i(4353))},4173:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),s="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function r(t,e,i){var s,n;return"m"===i?e?"хвилина":"хвилину":"h"===i?e?"година":"годину":t+" "+(s=+t,n={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var a=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};a.s=s,a.f=i;var o={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:a,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:r,mm:r,h:r,hh:r,d:"день",dd:r,M:"місяць",MM:r,y:"рік",yy:r},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return e.default.locale(o,null,!0),o}(i(4353))},1750:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ur",weekdays:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),months:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekStart:1,weekdaysShort:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),monthsShort:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekdaysMin:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},950:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return e.default.locale(i,null,!0),i}(i(4353))},4734:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz",weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Якин %s ичида",past:"%s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"}};return e.default.locale(i,null,!0),i}(i(4353))},860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return e.default.locale(i,null,!0),i}(i(4353))},5760:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"x-pseudo",weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),weekStart:1,weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"}};return e.default.locale(i,null,!0),i}(i(4353))},7933:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"yo",weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),weekStart:1,weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6033:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},122:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-hk",months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d 分鐘",h:"一小時",hh:"%d 小時",d:"一天",dd:"%d 天",M:"一個月",MM:"%d 個月",y:"一年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},1349:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},6007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},8569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(i,s,n){var r,a=function(t,i,s){void 0===s&&(s={});var n=new Date(t),r=function(t,i){void 0===i&&(i={});var s=i.timeZoneName||"short",n=t+"|"+s,r=e[n];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),e[n]=r),r}(i,s);return r.formatToParts(n)},o=function(e,i){for(var s=a(e,i),r=[],o=0;o=0&&(r[c]=parseInt(d,10))}var u=r[3],p=24===u?0:u,g=r[0]+"-"+r[1]+"-"+r[2]+" "+p+":"+r[4]+":"+r[5]+":000",m=+e;return(n.utc(g).valueOf()-(m-=m%1e3))/6e4},l=s.prototype;l.tz=function(t,e){void 0===t&&(t=r);var i,s=this.utcOffset(),a=this.toDate(),o=a.toLocaleString("en-US",{timeZone:t}),l=Math.round((a-new Date(o))/1e3/60),h=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(h)){if(i=n(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),e){var d=i.utcOffset();i=i.add(s-d,"minute")}}else i=this.utcOffset(0,e);return i.$x.$timezone=t,i},l.offsetName=function(t){var e=this.$x.$timezone||n.tz.guess(),i=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return i&&i.value};var h=l.startOf;l.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return h.call(this,t,e);var i=n(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(i,t,e).tz(this.$x.$timezone,!0)},n.tz=function(t,e,i){var s=i&&e,a=i||e||r,l=o(+n(),a);if("string"!=typeof t)return n(t).tz(a);var h=function(t,e,i){var s=t-60*e*1e3,n=o(s,i);if(e===n)return[s,e];var r=o(s-=60*(n-e)*1e3,i);return n===r?[s,n]:[t-60*Math.min(n,r)*1e3,Math.max(n,r)]}(n.utc(t,s).valueOf(),l,a),d=h[0],c=h[1],u=n(d).utcOffset(c);return u.$x.$timezone=a,u},n.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},n.tz.setDefault=function(t){r=t}}}()},3826:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,n,r){var a=n.prototype;r.utc=function(t){return new n({date:t,utc:!0,args:arguments})},a.utc=function(e){var i=r(this.toDate(),{locale:this.$L,utc:!0});return e?i.add(this.utcOffset(),t):i},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var l=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var h=a.utcOffset;a.utcOffset=function(s,n){var r=this.$utils().u;if(r(s))return this.$u?0:r(this.$offset)?h.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(e);if(!s)return null;var n=(""+s[0]).match(i)||["-",0,0],r=n[0],a=60*+n[1]+ +n[2];return 0===a?0:"+"===r?a:-a}(s),null===s))return this;var a=Math.abs(s)<=16?60*s:s,o=this;if(n)return o.$offset=a,o.$u=0===s,o;if(0!==s){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(a+l,t)).$offset=a,o.$x.$localOffset=l}else o=this.utc();return o};var d=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var c=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=a.diff;a.diff=function(t,e,i){if(t&&this.$u===t.$u)return u.call(this,t,e,i);var s=this.local(),n=r(t).local();return u.call(s,n,e,i)}}}()},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n{var s=i(833);function n(e,i){var s=e.geometry,n=s.type;if("LineString"===n)s.coordinates=t.exports.simplify(s.coordinates,i);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r{var s=i(1447),n=function(t,e){for(var i=0,r=0,a=1;a<=t.length-2;a++){var o=new s(t[0],t[t.length-1]).perpendicularDistance(t[a]);o>i&&(r=a,i=o)}if(i>e)var l=n(t.slice(0,r),e),h=n(t.slice(r,t.length),e),d=l.concat(h);else d=t.length>1?[t[0],t[t.length-1]]:[t[0]];return d};t.exports=n},1447:t=>{var e=function(t,e){this.p1=t,this.p2=e};e.prototype.rise=function(){return this.p2[1]-this.p1[1]},e.prototype.run=function(){return this.p2[0]-this.p1[0]},e.prototype.slope=function(){return this.rise()/this.run()},e.prototype.yIntercept=function(){return this.p1[1]-this.p1[0]*this.slope(this.p1,this.p2)},e.prototype.isVertical=function(){return!isFinite(this.slope())},e.prototype.isHorizontal=function(){return this.p1[1]==this.p2[1]},e.prototype._perpendicularDistanceHorizontal=function(t){return Math.abs(this.p1[1]-t[1])},e.prototype._perpendicularDistanceVertical=function(t){return Math.abs(this.p1[0]-t[0])},e.prototype._perpendicularDistanceHasSlope=function(t){var e=this.slope(),i=this.yIntercept();return Math.abs(e*t[0]-t[1]+i)/Math.sqrt(Math.pow(e,2)+1)},e.prototype.perpendicularDistance=function(t){return this.isVertical()?this._perpendicularDistanceVertical(t):this.isHorizontal()?this._perpendicularDistanceHorizontal(t):this._perpendicularDistanceHasSlope(t)},t.exports=e}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";i.r(s),i.d(s,{d3_format:()=>uq,d3_format_locale:()=>mq,dayjs:()=>JX});var t={};i.r(t),i.d(t,{Zr:()=>Yb}),window.HTMLWidgets;const e=t=>t;var n,r;!function(t){t["desktop-browser"]="desktop-browser",t["mobile-browser"]="mobile-browser",t.node="node",t.worker="worker",t.miniApp="miniApp",t.wx="wx",t.tt="tt",t.harmony="harmony",t["desktop-miniApp"]="desktop-miniApp",t.lynx="lynx"}(n||(n={})),function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.mapLabel="mapLabel",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(r||(r={}));var a=i(228),o=i.n(a);const l=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,h=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||l(t,"Number")},d="undefined"!=typeof console;function c(t,e,i){const s=[e].concat([].slice.call(i));d&&console[t].apply(console,s)}var u,p;(p=u||(u={}))[p.None=0]="None",p[p.Error=1]="Error",p[p.Warn=2]="Warn",p[p.Info=3]="Info",p[p.Debug=4]="Debug";class g{static getInstance(t,e){return g._instance&&h(t)?g._instance.level(t):g._instance||(g._instance=new g(t,e)),g._instance}static setInstance(t){return g._instance=t}static setInstanceLevel(t){g._instance?g._instance.level(t):g._instance=new g(t)}static clearInstance(){g._instance=null}constructor(t=u.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=u.Info}canLogDebug(){return this._level>=u.Debug}canLogError(){return this._level>=u.Error}canLogWarn(){return this._level>=u.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=u.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):c(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=u.Warn&&c(this._method||"warn","WARN",t),this}info(...t){return this._level>=u.Info&&c(this._method||"log","INFO",t),this}debug(...t){return this._level>=u.Debug&&c(this._method||"log","DEBUG",t),this}}g._instance=null;let m=0;function _(t="dataset"){return m>1e8&&(m=0),t+"_"+m++}class f{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new(o()),i=(null==t?void 0:t.name)?t.name:_("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:g.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let s=this._callMap.get(i);s||(s=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,s)})),this._callMap.set(i,s)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const s=this._callMap.get(i);s&&t.forEach((t=>{t.target.removeListener(e,s)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const v=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||l(t,"Boolean"),y=t=>Array.isArray?Array.isArray(t):l(t,"Array"),b=(t,e,i)=>{const s=!v(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!y(t))throw new TypeError("Invalid data: must be DataView array!");return y(i.rawData)&&i.rawData.forEach((t=>{t.target&&(t.target.removeListener("change",i.reRunAllTransform),t.target.removeListener("markRunning",i.markRunning))})),s&&t.forEach((t=>{t.target.addListener("change",i.reRunAllTransform),t.target.addListener("markRunning",i.markRunning)})),t},x=t=>l(t,"Date"),S=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||l(t,"String")},M=t=>null!=t;function k(t,e,i){let s;if(!M(t)||"object"!=typeof t||e&&e(t))return t;const n=y(t),r=t.length;s=n?new Array(r):"object"==typeof t?{}:v(t)||h(t)||S(t)?t:x(t)?new Date(+t):void 0;const a=n?void 0:Object.keys(Object(t));let o=-1;if(s)for(;++o<(a||t).length;){const n=a?a[o]:o,r=t[n];i&&i.includes(n.toString())?s[n]=r:s[n]=k(r,e,i)}return s}const A=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},w=function(t){if(!(t=>"object"==typeof t&&null!==t)(t)||!l(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function T(t,e,i=!1,s=!1){if(e){if(t===e)return;if(M(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!M(n[a])||"object"!=typeof n[a]||s&&y(t[a])?L(t,a,n[a]):C(t,e,a,i,s)}}}}function C(t,e,i,s=!1,n=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(y(a)){if(s)o=[];else if(y(r))o=r;else if(A(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++tnull==t,D=(t,e)=>{var i,s;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],a={},o=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const l=n[e];if(!l.type){let s=r;e in r||(s=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof s[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(h)),(null===(s=l.domain)||void 0===s?void 0:s.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let s=0;s(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),this.isLastTransform(e)&&this.diffLastData()})),this.isRunning=!1,!1!==t.emitMessage&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:_("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var s;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(s=this.dataSet.getParser(e.type))&&void 0!==s?s:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:i,emitMessage:s}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==s&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[O]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[O]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[O]"fields"===t.type));!P(this._fields)&&P(i)?(this.dataSet.registerTransform("fields",D),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class I{static GenAutoIncrementId(){return I.auto_increment_id++}}I.auto_increment_id=0;class B{constructor(t){this.id=I.GenAutoIncrementId(),this.registry=t}}const F="named",Y="inject",j="multi_inject",H="inversify:tagged",z="inversify:paramtypes",N=function(t){var e;return function(t){Object.prototype.hasOwnProperty;const e="function"==typeof Symbol,i=e&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=(e&&void 0!==Symbol.iterator&&Symbol.iterator,Object.create,Object.getPrototypeOf(Function)),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=(Set,new WeakMap);function a(t,e,i){let s=r.get(t);if(d(s)){if(!i)return;s=new n,r.set(t,s)}let a=s.get(e);if(d(a)){if(!i)return;a=new n,s.set(e,a)}return a}function o(t,e,i){if(l(t,e,i))return!0;const s=m(e);return!c(s)&&o(t,s,i)}function l(t,e,i){const s=a(e,i,!1);return!d(s)&&!!s.has(t)}function h(t,e,i){if(l(t,e,i))return function(t,e,i){const s=a(e,i,!1);if(!d(s))return s.get(t)}(t,e,i);const s=m(e);return c(s)?void 0:h(t,s,i)}function d(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function p(t){const e=function(t,e){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const s=3===e?"string":5===e?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,i);if(void 0!==n){const e=n.call(t,s);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function m(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===s)return e;if(e!==s)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,s){if(!u(i))throw new TypeError;return n=t,r=e,void a(i,s,!0).set(n,r);var n,r})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),o(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),l(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),h(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function V(){return function(t){return N.defineMetadata(z,null,t),t}}class W{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===F?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}function G(t){return(e,i,s)=>{!function(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};N.hasOwnMetadata(t,e)&&(r=N.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,N.defineMetadata(t,r,e)}(H,t,i.toString(),s)}(e,0,s,t)}}function U(t){return e=>(i,s,n)=>G(new W(t,e))(i,s,n)}const $=U(Y);function K(t){return G(new W(F,t))}const X=Symbol("ContributionProvider");class q{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Z(t,e){t(X).toDynamicValue((({container:t})=>new q(e,t))).inSingletonScope().whenTargetNamed(e)}class J{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let s;if("string"==typeof e)s={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw new Error("Missing name for tap");return s=Object.assign({type:t,fn:i},s),s}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let s=this.taps.length;for(;s>0;){s--;const t=this.taps[s];this.taps[s+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){s++;break}}this.taps[s]=t}}class Q extends J{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const tt=Symbol.for("EnvContribution"),et=Symbol.for("VGlobal");var it=function(t,e){return function(i,s){e(i,s,t)}};let st=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=I.GenAutoIncrementId(),this.hooks={onSetEnv:new Q(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const s=i.configure(this,t);s&&s.then&&e.push(s)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const s=this.bindContribution(e);if(s&&s.then)return s.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};st=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),it(0,$(X)),it(0,K(tt)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],st);const nt=1e-12,rt=Math.PI,at=rt/2,ot=2*rt,lt=2*Math.PI,ht=Math.abs,dt=Math.atan2,ct=Math.cos,ut=Math.max,pt=Math.min,gt=Math.sin,mt=Math.sqrt,_t=Math.pow;function ft(t){return t>=1?at:t<=-1?-at:Math.asin(t)}function vt(t,e,i,s,n){let r=i,a=s;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof s&&(a=(1-n)*e+n*s),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}function bt(t,e){let i=0;for(let s=0;s0?i:0}function Mt(t,e){return xt(t+e,10**Math.max(St(t),St(e)))}function kt(t,e){return xt(t-e,10**Math.max(St(t),St(e)))}function At(t){return t*(Math.PI/180)}function wt(t){return 180*t/Math.PI}function Tt(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Ct(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Lt(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Et(t){return(t=Lt(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}class Pt{constructor(t=1,e=0,i=0,s=1,n=0,r=0){this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,s,n,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,s=this.d,n=this.e,r=this.f,a=new Pt,o=t*s-e*i;return a.a=s/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-s*n)/o,a.f=-(t*r-e*n)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,n=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),r=(1-s)*e+n*i,a=(1-s)*i-n*e,o=s*this.a-n*this.b,l=n*this.a+s*this.b,h=s*this.c-n*this.d,d=n*this.c+s*this.d,c=s*this.e-n*this.f+r,u=n*this.e+s*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=d,this.e=c,this.f=u,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,s,n,r){return this.multiply(t,e,i,s,n,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,s,n,r){const a=this.a,o=this.b,l=this.c,h=this.d,d=a*t+l*e,c=o*t+h*e,u=a*i+l*s,p=o*i+h*s,g=a*n+l*r+this.e,m=o*n+h*r+this.f;return this.a=d,this.b=c,this.c=u,this.d=p,this.e=g,this.f=m,this}interpolate(t,e){const i=new Pt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:s,c:n,d:r,e:a,f:o}=this,l=i*r-s*n,h=r/l,d=-s/l,c=-n/l,u=i/l,p=(n*o-r*a)/l,g=-(i*o-s*a)/l,{x:m,y:_}=t;e.x=m*h+_*c+p,e.y=m*d+_*u+g}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Pt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,s=this.d,n=t*s-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=n/a,r.skewX=(t*i+e*s)/n,r.skewY=0}else if(0!==i||0!==s){const a=Math.sqrt(i*i+s*s);r.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=n/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*s)/n}return r.rotateDeg=wt(r.rotateDeg),r}}const Dt=ot-1e-8;class Ot{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>Dt)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,d=1/0,c=-1/0,u=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),lc&&(c=l),hp&&(p=h)}if(g(s),g(n),n!==s)if((s%=ot)<0&&(s+=ot),(n%=ot)<0&&(n+=ot),nn;++o,a-=at)g(a);else for(a=s-s%at+at,o=0;o<4&&athis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return y(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const s=this.rotatedPoints(t,e,i);return this.clear().add(s[0],s[1]).add(s[2],s[3]).add(s[4],s[5]).add(s[6],s[7])}scale(t=0,e=0,i=0,s=0){const n=this.scalePoints(t,e,i,s);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)}contains(t=0,e=0){return!(tthis.x2||ethis.y2)}containsPoint(t){return!(t.xthis.x2||t.ythis.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Rt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,d=i-e*l-i*o;return[o*s-l*n+h,l*s+o*n+d,o*s-l*a+h,l*s+o*a+d,o*r-l*n+h,l*r+o*n+d,o*r-l*a+h,l*r+o*a+d]}scalePoints(t,e,i,s){const{x1:n,y1:r,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*r+(1-e)*s,t*a+(1-t)*i,e*o+(1-e)*s]}}class Bt extends It{}class Ft{constructor(){this.curves=[],this.bounds=new Bt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Yt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,jt={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7};let Ht,zt,Nt,Vt,Wt,Gt;var Ut,$t,Kt,Xt,qt,Zt,Jt,Qt,te;function ee(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,d=-o*a,c=o*r,u=l*a,p=Math.cos(s),g=Math.sin(s),m=Math.cos(n),_=Math.sin(n),f=.5*(n-s),v=Math.sin(.5*f),y=8/3*v*v/Math.sin(f),b=e+p-y*g,x=i+g+y*p,S=e+m,M=i+_,k=S+y*_,A=M-y*m;return[h*b+d*x,c*b+u*x,h*k+d*A,c*k+u*A,h*S+d*M,c*S+u*M]}function ie(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=At(a),d=Math.sin(h),c=Math.cos(h),u=c*(o-t)*.5+d*(l-e)*.5,p=c*(l-e)*.5-d*(o-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const m=c/i,_=d/i,f=-d/s,v=c/s,y=m*o+_*l,b=f*o+v*l,x=m*t+_*e,S=f*t+v*e;let M=1/((x-y)*(x-y)+(S-b)*(S-b))-.25;M<0&&(M=0);let k=Math.sqrt(M);r===n&&(k=-k);const A=.5*(y+x)-k*(S-b),w=.5*(b+S)+k*(x-y),T=Math.atan2(b-w,y-A);let C=Math.atan2(S-w,x-A)-T;C<0&&1===r?C+=ot:C>0&&0===r&&(C-=ot);const L=Math.ceil(Math.abs(C/(at+.001))),E=[];for(let t=0;te.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function ne(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;ot+e.getLength()),0)),this.length}}class me extends ge{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function _e(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function fe(t,e,i){const s=null!=e?e:ht(i[i.length-1].x-i[0].x)>ht(i[i.length-1].y-i[0].y)?Jt.ROW:Jt.COLUMN;return"monotoneY"===t?new me(t,s):new ge(t,s)}class ve{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function ye(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=fe("linear",i,t);return function(t,e){_e(t,e,1)}(new ve(n,s),t),n}function be(t,e,i,s,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class xe{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&be(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:be(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Se(t){return t<0?-1:1}function Me(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(Se(r)+Se(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function ke(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function Ae(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,s,t.lastPoint1)}class we{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:Ae(this,this._t0,ke(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,Ae(this,ke(this,e=Me(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:Ae(this,this._t0,e=Me(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class Te extends we{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}class Ce{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Le(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new ge("step",null!=s?s:ht(t[t.length-1].x-t[0].x)>ht(t[t.length-1].y-t[0].y)?Jt.ROW:Jt.COLUMN);return function(t,e){_e(t,e,1)}(new Ce(r,e,n),t),r}class Ee extends ve{lineEnd(){this.context.closePath()}}function Pe(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>nt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>nt){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function De(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return ye(i,n);const o=fe(t,r,i);return _e(new e(o,s,a),i,2),o}}const Oe=De("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Pe(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}),Re=De("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Pe(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function Ie(t,e,i){var s,n;switch(e){case"linear":default:return ye(t,i);case"basis":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return ye(t,e);const n=fe("basis",i,t);return function(t,e){_e(t,e,2)}(new xe(n,s),t),n}(t,i);case"monotoneX":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return ye(t,e);const n=fe("monotoneX",i,t);return function(t,e){_e(t,e,2)}(new we(n,s),t),n}(t,i);case"monotoneY":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return ye(t,e);const n=fe("monotoneY",i,t);return function(t,e){_e(t,e,2)}(new Te(n,s),t),n}(t,i);case"step":return Le(t,.5,i);case"stepBefore":return Le(t,0,i);case"stepAfter":return Le(t,1,i);case"catmullRom":return Oe(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return Re(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=fe("linear",i,t);return function(t,e){_e(t,e,1)}(new Ee(n,s),t),n}(t,i)}}class Be extends Ft{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Ot(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([6,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([5,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([7,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([2,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([1,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([4,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([8,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([0,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([3]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[6]=t=>`M${t[1]} ${t[2]}`,t[5]=t=>`L${t[1]} ${t[2]}`,t[7]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[2]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[0]=t=>{const e=[];((t,e,i,s,n,r,a)=>{const o=Math.abs(i-e),l=4*Math.tan(o/4)/3,h=i`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[3]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,r=e.length;tGt){let t;for(let e=1,s=i.length;e{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,n=1){let r,a,o,l,h,d=null,c=0,u=0,p=0,g=0;for(let m=0,_=t.length;m<_;++m){switch(r=t[m],1===s&&1===n||(r=Ye(r,s,n)),r[0]){case"l":c+=r[1],u+=r[2],this.lineTo(c+e,u+i);break;case"L":c=r[1],u=r[2],this.lineTo(c+e,u+i);break;case"h":c+=r[1],this.lineTo(c+e,u+i);break;case"H":c=r[1],this.lineTo(c+e,u+i);break;case"v":u+=r[1],this.lineTo(c+e,u+i);break;case"V":u=r[1],this.lineTo(c+e,u+i);break;case"m":c+=r[1],u+=r[2],this.moveTo(c+e,u+i);break;case"M":c=r[1],u=r[2],this.moveTo(c+e,u+i);break;case"c":a=c+r[5],o=u+r[6],p=c+r[3],g=u+r[4],this.bezierCurveTo(c+r[1]+e,u+r[2]+i,p+e,g+i,a+e,o+i),c=a,u=o;break;case"C":c=r[5],u=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,c+e,u+i);break;case"s":a=c+r[3],o=u+r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,c+r[1]+e,u+r[2]+i,a+e,o+i),p=c+r[1],g=u+r[2],c=a,u=o;break;case"S":a=r[3],o=r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"q":a=c+r[3],o=u+r[4],p=c+r[1],g=u+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"t":a=c+r[1],o=u+r[2],null===d[0].match(/[QqTt]/)?(p=c,g=u):"t"===d[0]?(p=2*c-l,g=2*u-h):"q"===d[0]&&(p=2*c-p,g=2*u-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o,p=c+r[1],g=u+r[2];break;case"T":a=r[1],o=r[2],p=2*c-p,g=2*u-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"a":ie(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+c+e,r[7]+u+i]),c+=r[6],u+=r[7];break;case"A":ie(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),c=r[6],u=r[7];break;case"z":case"Z":this.closePath()}d=r}}_runCommandList(t,e=0,i=0,s=1,n=1){if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;rt.slice()))}_updateBounds(){this.bounds.clear(),ne(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===Jt.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(t.p0.y-e.p1.y)}if(this.direction===Jt.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}}const Fe=["l",0,0,0,0,0,0,0];function Ye(t,e,i){const s=Fe[0]=t[0];if("a"===s||"A"===s)Fe[1]=e*t[1],Fe[2]=i*t[2],Fe[3]=t[3],Fe[4]=t[4],Fe[5]=t[5],Fe[6]=e*t[6],Fe[7]=i*t[7];else if("h"===s||"H"===s)Fe[1]=e*t[1];else if("v"===s||"V"===s)Fe[1]=i*t[1];else for(let s=1,n=t.length;s{g.getInstance().warn("空函数")}}),ti=Object.assign(Object.assign({},Ue),{points:[],cornerRadius:0,closePath:!0}),ei=Object.assign(Object.assign({},Ue),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),ii=(Object.assign(Object.assign({},Ue),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Object.assign(Object.assign({},Ue),{symbolType:"circle",size:10,keepDirIn3d:!0})),si=Object.assign(Object.assign(Object.assign({},Ue),Ve),{strokeBoundsBuffer:0,keepDirIn3d:!0}),ni=Object.assign(Object.assign(Object.assign({},Ue),Ve),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),ri=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},Ue),{fill:!0,cornerRadius:0}),ai=Object.assign(Object.assign({},ri),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),oi=new class{},li={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},hi=(String.fromCharCode(160),/\w|\(|\)|-/),di=/[.?!,;:/,。?!、;:]/,ci=/\S/,ui=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})};function pi(t,e,i,s,n){if(!e||e<=0)return 0;const r=oi.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(r.measureText(h,i).width);for(;l>e||d<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(r.measureText(h,i).width)}return n&&(a=gi(t,a)),a}function gi(t,e){let i=e;for(;hi.test(t[i-1])&&hi.test(t[i])||di.test(t[i]);)if(i--,i<=0)return e;return i}function mi(t,e){const i=oi.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(s.width=Math.floor(i.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(i.width),s.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),s.ascent=Math.floor(i.actualBoundingBoxAscent),s.descent=s.height-s.ascent),s}let _i=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,{fontSize:e=si.fontSize}){let i=0,s=0;for(let e=0;e{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let a=0,o=0;for(;o1){const n=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(s&&n.str!==t[o].text){let i="",s=0;for(let e=0;ei)return{str:"",width:0};const r=this._clipText(t,e,i,0,t.length-1,"end",!1);if(s&&r.str!==t){const i=gi(t,r.str.length);i!==r.str.length&&(r.str=t.substring(0,i),r.width=this.measureTextWidth(r.str,e))}return r}_clipText(t,e,i,s,n,r,a){let o;if("start"===r)o=this._clipTextStart(t,e,i,s,n),a&&(o.result=a+o.str);else if("middle"===r){const s=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:s.width,result:s.left+a+s.right}}else o=this._clipTextEnd(t,e,i,s,n),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,s,n){const r=Math.floor((s+n)/2),a=t.substring(0,r+1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(0,r);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextEnd(t,e,i,s,r)}if(o=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(0,r+2);return l=this.measureTextWidth(s,e),l>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,r,n)}return{str:a,width:o}}_clipTextStart(t,e,i,s,n){const r=Math.ceil((s+n)/2),a=t.substring(r-1,t.length-1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const s=t.substring(r,t.length-1);return l=this.measureTextWidth(s,e),l<=i?{str:s,width:l}:this._clipTextStart(t,e,i,r,t.length-1)}if(o=i?{str:a,width:o}:this._clipTextStart(t,e,i,s,r)}return{str:a,width:o}}_clipTextMiddle(t,e,i,s,n,r,a,o){const l=t.substring(0,o),h=this.measureTextWidth(l,e);if(h+a>i)return{left:s,right:n,width:r+a};const d=t.substring(t.length-o,t.length),c=this.measureTextWidth(d,e);return h+c>i?{left:l,right:n,width:h+a}:this._clipTextMiddle(t,e,i,l,d,h,c,o+1)}clipTextWithSuffixVertical(t,e,i,s,n,r){if(""===s)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,n);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(s,e);if(o>i)return a;let l;if(i-=o,"start"===r){const r=this.revertVerticalList(t);l=this.clipTextVertical(r,e,i,n);const a=this.revertVerticalList(l.verticalList);a.unshift({text:s,direction:1,width:o}),l.verticalList=a}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),a=this.revertVerticalList(t),h=this.clipTextVertical(a,e,i/2,n);r.verticalList.push({text:s,direction:1,width:o}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),l={verticalList:r.verticalList,width:r.width+h.width}}else l=this.clipTextVertical(t,e,i,n),l.verticalList.push({text:s,direction:1,width:o});return l.width+=o,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,s,n,r,a=!1){if(""===s)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const l=this.measureTextWidth(s,e);if(l>i)return{str:"",width:0};if(a&&o+l<=i)return{str:t+s,width:o+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,r,s);if(n&&h.str!==t){const i=gi(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else a&&h.str===t&&(h.result=t+s);return h.str=h.result,h.width+=l,h}};_i=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],_i);const fi=Symbol.for("TextMeasureContribution");let vi=class extends _i{};vi=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],vi);const yi=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,s=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,s=e<<10|i,s+=65536),12288===s||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":8361===s||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||172===s||175===s||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":161===s||164===s||167<=s&&s<=168||170===s||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||198===s||208===s||215<=s&&s<=216||222<=s&&s<=225||230===s||232<=s&&s<=234||236<=s&&s<=237||240===s||242<=s&&s<=243||247<=s&&s<=250||252===s||254===s||257===s||273===s||275===s||283===s||294<=s&&s<=295||299===s||305<=s&&s<=307||312===s||319<=s&&s<=322||324===s||328<=s&&s<=331||333===s||338<=s&&s<=339||358<=s&&s<=359||363===s||462===s||464===s||466===s||468===s||470===s||472===s||474===s||476===s||593===s||609===s||708===s||711===s||713<=s&&s<=715||717===s||720===s||728<=s&&s<=731||733===s||735===s||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||1025===s||1040<=s&&s<=1103||1105===s||8208===s||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||8240===s||8242<=s&&s<=8243||8245===s||8251===s||8254===s||8308===s||8319===s||8321<=s&&s<=8324||8364===s||8451===s||8453===s||8457===s||8467===s||8470===s||8481<=s&&s<=8482||8486===s||8491===s||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||8585===s||8592<=s&&s<=8601||8632<=s&&s<=8633||8658===s||8660===s||8679===s||8704===s||8706<=s&&s<=8707||8711<=s&&s<=8712||8715===s||8719===s||8721===s||8725===s||8730===s||8733<=s&&s<=8736||8739===s||8741===s||8743<=s&&s<=8748||8750===s||8756<=s&&s<=8759||8764<=s&&s<=8765||8776===s||8780===s||8786===s||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||8853===s||8857===s||8869===s||8895===s||8978===s||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||9675===s||9678<=s&&s<=9681||9698<=s&&s<=9701||9711===s||9733<=s&&s<=9734||9737===s||9742<=s&&s<=9743||9748<=s&&s<=9749||9756===s||9758===s||9792===s||9794===s||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||9839===s||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||9955===s||9960<=s&&s<=9983||10045===s||10071===s||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||65533===s||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"};function bi(t,e={},i){i||(i=1);const{fontStyle:s=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(s?s+" ":"")+(n?n+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class xi{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),M(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=M(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(P(this._canvas)&&(M(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),P(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&M(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),P(this._context)&&M(this._canvas)){const t=this._canvas.getContext("2d");M(t)&&(t.save(),t.font=bi(this.textSpec),this._contextSaved=!0,this._context=t)}return!P(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:s={}}=this._option,{fontStyle:n=s.fontStyle,fontVariant:r=s.fontVariant,fontWeight:a=(null!==(t=s.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=s.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=s.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(S(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:n,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:d,textBaseline:u,ellipsis:p,limit:g,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(P(t))return{width:0,height:0};if(P(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:a,limit:o,lineHeight:l}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:l});h={width:d.width(),height:d.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:s,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:s}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;it.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=n)&&void 0!==i?i:s)+1)+1}}return e(t.toString())}_measureNumberChar(){if(P(this._numberCharSize)){const t=this._standardMethod(xi.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/xi.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return P(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(xi.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(P(this._letterCharSize)){const t=this._standardMethod(xi.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/xi.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return M(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){M(this._canvas)&&(this._canvas=null),M(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}xi.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",xi.NUMBERS_CHAR_SET="0123456789",xi.FULL_SIZE_CHAR="字";const Si="Singleton",Mi="Transient",ki="ConstantValue",Ai="Instance";class wi{constructor(t,e){this.id=I.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type="Invalid",this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new wi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Si&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class Ti{getConstructorMetadata(t){return{compilerGeneratedMetadata:N.getMetadata(z,t),userGeneratedMetadata:N.getMetadata(H,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Ci=(Li=F,t=>{const e=e=>{if(null==e)return!1;if(e.key===Li&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;ee.container.get(t)))}}const Di=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Mi,this.options=e,this.id=I.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new Ti}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,F,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new wi(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new Pi(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),n=e=>i=>{const s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,s){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:s}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),s=Object.keys(i),n=[];for(let t=0;t{s[t.key]=t.value}));const r={inject:s[Y],multiInject:s[j]},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};n.push(l)}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case ki:case"Function":e=t.cache;break;case Ai:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Si&&(t.cache=e,t.activated=!0)}},Oi=Symbol.for("CanvasFactory"),Ri=Symbol.for("Context2dFactory");function Ii(t){return Di.getNamed(Oi,oi.global.env)(t)}Math.sqrt(3);const Bi=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Ii(Object.assign({nativeCanvas:oi.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Ii(Object.assign({nativeCanvas:oi.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Fi=Symbol.for("VWindow"),Yi=Symbol.for("WindowHandlerContribution");let ji=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new Q(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Di.getNamed(Yi,t.env).configure(this,t),this.actived=!0)},this._uid=I.GenAutoIncrementId(),this.global=oi.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const s=this._handler.getWH();this._width=s.width,this._height=s.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,s,n,r){this._handler.setViewBoxTransform(t,e,i,s,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),s={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},s),s.x-=i.x1,s.y-=i.y1,s}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};ji=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ji);var Hi=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},zi=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},Ni=function(t,e){return function(i,s){e(i,s,t)}};let Vi=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=oi.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=Bi.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var s;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(s=e.fontSize)&&void 0!==s?s:Ve.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new xi(Object.assign({defaultFontParams:{fontFamily:Ve.fontFamily,fontSize:Ve.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+xi.ALPHABET_CHAR_SET+xi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const s=Di.get(Fi),n=t.AABBBounds,r=n.width(),a=n.height(),o=-n.x1,l=-n.y1;s.create({viewBox:{x1:o,y1:l,x2:n.x2,y2:n.y2},width:r,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(s,[t],{transMatrix:s.getViewBoxTransform(),viewBox:s.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const d=s.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};var Wi;Vi=Hi([V(),Ni(0,$(X)),Ni(0,K(fi)),zi("design:paramtypes",[Object])],Vi),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(Wi||(Wi={}));const Gi=new Pt;let Ui=class{constructor(){this.matrix=new Pt}init(t){return this.mode=Wi.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=Wi.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const s=this.outSourceMatrix;if(Gi.setValue(s.a,s.b,s.c,s.d,s.e,s.f),this.outTargetMatrix.reset(),i){const{x:s,y:n}=i;this.outTargetMatrix.translate(s,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-s,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(Gi.a,Gi.b,Gi.c,Gi.d,Gi.e,Gi.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(Gi.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:s}=e;this.outTargetMatrix.translate(i,s),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-s)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(Gi.a,Gi.b,Gi.c,Gi.d,Gi.e,Gi.f),this}scale(t,e,i){return this.mode===Wi.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===Wi.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return Gi.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(Gi.a,Gi.b,Gi.c,Gi.d,Gi.e,Gi.f),this}translate(t,e){return this.mode===Wi.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===Wi.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};Ui=Hi([V(),zi("design:paramtypes",[])],Ui);const $i={arc:$e,area:Ke,circle:Xe,line:Je,path:Qe,symbol:ii,text:si,rect:ei,polygon:ti,richtext:ni,richtextIcon:ai,image:ri,group:qe,glyph:Ze},Ki=Object.keys($i);function Xi(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const qi={arc:Object.assign({},$i.arc),area:Object.assign({},$i.area),circle:Object.assign({},$i.circle),line:Object.assign({},$i.line),path:Object.assign({},$i.path),symbol:Object.assign({},$i.symbol),text:Object.assign({},$i.text),rect:Object.assign({},$i.rect),polygon:Object.assign({},$i.polygon),richtext:Object.assign({},$i.richtext),richtextIcon:Object.assign({},$i.richtextIcon),image:Object.assign({},$i.image),group:Object.assign({},$i.group),glyph:Object.assign({},$i.glyph)};class Zi{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},Ki.forEach((t=>{this._defaultTheme[t]=Object.create(qi[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,g.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;Ki.forEach((s=>{const n=Object.create(qi[s]);t&&t[s]&&Xi(n,t[s]),i[s]&&Xi(n,i[s]),e[s]&&Xi(n,e[s]),this.combinedTheme[s]=n})),e.common&&Ki.forEach((t=>{Xi(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const Ji=new Zi;function Qi(t,e){return t.glyphHost?Qi(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):Ji.getTheme()}return null}(t)||t.attachedThemeGraphic&&Qi(t.attachedThemeGraphic)||Ji.getTheme()}const ts=Object.prototype.hasOwnProperty,es=(t,e)=>null!=t&&ts.call(t,e),is=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),ss=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),ns=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},rs=t=>"function"==typeof t;class as extends(o()){get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=I.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return i=this,s=void 0,r=function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}},new((n=void 0)||(n=Promise))((function(t,e){function a(t){try{l(r.next(t))}catch(t){e(t)}}function o(t){try{l(r.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(t){t(i)}))).then(a,o)}l((r=r.apply(i,s||[])).next())}));var i,s,n,r}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&g.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(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}static bounceIn(t){return 1-ds.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ds.bounceIn(2*t):.5*ds.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*lt/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/lt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*lt/e)*.5+1}}}ds.quadIn=ds.getPowIn(2),ds.quadOut=ds.getPowOut(2),ds.quadInOut=ds.getPowInOut(2),ds.cubicIn=ds.getPowIn(3),ds.cubicOut=ds.getPowOut(3),ds.cubicInOut=ds.getPowInOut(3),ds.quartIn=ds.getPowIn(4),ds.quartOut=ds.getPowOut(4),ds.quartInOut=ds.getPowInOut(4),ds.quintIn=ds.getPowIn(5),ds.quintOut=ds.getPowOut(5),ds.quintInOut=ds.getPowInOut(5),ds.backIn=ds.getBackIn(1.7),ds.backOut=ds.getBackOut(1.7),ds.backInOut=ds.getBackInOut(1.7),ds.elasticIn=ds.getElasticIn(1,.3),ds.elasticOut=ds.getElasticOut(1,.3),ds.elasticInOut=ds.getElasticInOut(1,.3*1.5);class cs{constructor(){this.id=I.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===Xt.END?this.removeAnimate(e):e.status===Xt.RUNNING||e.status===Xt.INITIAL?(this.animateCount++,e.advance(t)):e.status===Xt.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const us=new cs;class ps{constructor(t,e,i,s,n){this.from=t,this.to=e,this.duration=i,this.easing=s,this.params=n,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class gs extends ps{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class ms{constructor(t=I.GenAutoIncrementId(),e=us){this.id=t,this.timeline=e,this.status=Xt.INITIAL,this.tailAnimate=new _s(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this)}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=ut(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){ms.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=ms.mode){t&&e&qt.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:Kt.ANIMATE_PLAY})}runCb(t){const e=new gs((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=ms.interpolateMap.get(t)||ms.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===Xt.RUNNING&&(this.status=Xt.PAUSED)}resume(){this.status===Xt.PAUSED&&(this.status=Xt.RUNNING)}to(t,e,i,s){if(this.tailAnimate.to(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,s){if(this.tailAnimate.from(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new _s(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTimet()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===Xt.RUNNING&&(this.status=Xt.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const s=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=n;if(r&&(t=n),t===s)return r;for(let s=0;s=t));s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=Xt.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}ms.mode=qt.NORMAL,ms.interpolateMap=new Map;class _s{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new fs(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,s="string"==typeof i?ds[i]:i,n=this._addStep(e,null,s);return n.type=Zt.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,s){(null==e||e<0)&&(e=0);const n="string"==typeof i?ds[i]:i,r=this._addStep(e,null,n);return r.type=Zt.to,this._appendProps(t,r,!!s&&s.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),s&&s.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,s){this.to(t,0,i,s);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,s),this.stepTail.type=Zt.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=Zt.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const s=new fs(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(s),this.stepTail=s,s}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let s=e.prev;const n=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));s.prev;)s.props&&(s.propKeys||(s.propKeys=Object.keys(s.props)),s.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=s.props[t])}))),e.propKeys=Object.keys(e.props),s=s.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,s=this.loop,n=this.rawPosition;let r,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t=s*i+i,o&&(a=i,r=s,t=a*r+i),t===n)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=s;)i=r,r=i.next;let a=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return g.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class fs{constructor(t,e,i,s){this.duration=e,this.position=t,this.props=i,this.easing=s}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const vs=function(t,e,i){return ti?i:t};function ys(t,e,i){e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=s*(1-Math.abs(t/60%2-1)),r=i-s/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=s,o=n,l=0):60<=t&&t<120?(a=n,o=s,l=0):120<=t&&t<180?(a=0,o=s,l=n):180<=t&&t<240?(a=0,o=n,l=s):240<=t&&t<300?(a=n,o=0,l=s):300<=t&&t<360&&(a=s,o=0,l=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function bs(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),r=n-s;let a=0,o=0,l=0;return a=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(n+s)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l}}const xs=/^#([0-9a-f]{3,8})$/,Ss={transparent:4294967040},Ms={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function ks(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function As(t){return h(t)?new Es(t>>16,t>>8&255,255&t,1):y(t)?new Es(t[0],t[1],t[2]):new Es(255,255,255)}function ws(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function Ts(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Cs=(t,e)=>{const i=xs.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Es((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?As(t):8===e?new Es(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Ls{static Brighter(t,e=1){return 1===e?t:new Ls(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new Ls(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof Ls?t:new Ls(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(M(Ss[t]))return function(t){return h(t)?new Es(t>>>24,t>>>16&255,t>>>8&255,255&t):y(t)?new Es(t[0],t[1],t[2],t[3]):new Es(255,255,255,1)}(Ss[t]);if(M(Ms[t]))return As(Ms[t]);const e=`${t}`.trim().toLowerCase(),i=Cs(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Es(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=ys(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Es(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Ls.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Es(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t))),this}add(t){const{r:e,g:i,b:s}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,s+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const s=this.color.opacity,n=bs(this.color.r,this.color.g,this.color.b),r=ys(P(t)?n.h:vs(t,0,360),P(e)?n.s:e>=0&&e<=1?100*e:e,P(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new Es(r.r,r.g,r.b,s),this}setRGB(t,e,i){return!P(t)&&(this.color.r=t),!P(e)&&(this.color.g=e),!P(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Cs(e,!0);return null!=i?i:this}setColorName(t){const e=Ms[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Ls(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=ws(t.color.r),this.color.g=ws(t.color.g),this.color.b=ws(t.color.b),this}copyLinearToSRGB(t){return this.color.r=Ts(t.color.r),this.color.g=Ts(t.color.g),this.color.b=Ts(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Es{constructor(t,e,i,s){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),M(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${ks(this.r)+ks(this.g)+ks(this.b)+(1===this.opacity?"":ks(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:s}=bs(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var Ps;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Ps||(Ps={}));class Ds{static Get(t,e=Ps.Color1,i=[0,0,0,1]){if(e===Ps.Color1){const e=Ds.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=Ls.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Ds.store1[t]=e,Ds.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=Ds.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=Ls.parseColorString(t);return n&&(Ds.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],Ds.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===Ps.Color1){if(Ds.store1[t])return;Ds.store1[t]=i,Ds.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Ds.store255[t])return;Ds.store255[t]=i,Ds.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function Os(t,e=!1){return Array.isArray(t)&&h(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Rs(t,e,i,s,n){return Array.isArray(t)&&!h(t[0])||Array.isArray(e)&&!h(e[0])?new Array(4).fill(0).map(((n,r)=>Is(y(t)?t[r]:t,y(e)?e[r]:e,i,s))):Is(t,e,i,s,n)}function Is(t,e,i,s,n){if(!t||!e)return t&&Os(t)||e&&Os(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Ds.Get(t,Ps.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Ds.Get(e,Ps.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:Os(a)})))});return o?Rs(r,l,i,s,n):Rs(l,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Ys(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Ys(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Ys(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(r,a),Os(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),s)}Ds.store255={},Ds.store1={};const Bs=[0,0,0,0],Fs=[0,0,0,0];function Ys(t,e,i){return Ds.Get(t,Ps.Color255,Bs),Ds.Get(e,Ps.Color255,Fs),`rgba(${Math.round(Bs[0]+(Fs[0]-Bs[0])*i)},${Math.round(Bs[1]+(Fs[1]-Bs[1])*i)},${Math.round(Bs[2]+(Fs[2]-Bs[2])*i)},${Bs[3]+(Fs[3]-Bs[3])*i})`}class js{static GetImage(t,e){var i;const s=js.cache.get(t);s?"fail"===s.loadState?oi.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):js.loadImage(t,e)}static GetSvg(t,e){var i;let s=js.cache.get(t);s?"fail"===s.loadState?oi.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},js.cache.set(t,s),s.dataPromise=oi.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=js.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},js.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=oi.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=oi.global.loadBlob(t):"json"===e&&(i.dataPromise=oi.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!js.isLoading&&js.toLoadAueue.length){js.isLoading=!0;const t=js.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(js.cache.set(i,n),n.dataPromise=oi.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{js.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),js.loading()})).catch((t=>{console.error(t),js.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),js.loading()}))}}),0)}static loadImage(t,e){const i=Hs(t,js.toLoadAueue);if(-1!==i)return js.toLoadAueue[i].marks.push(e),void js.loading();js.toLoadAueue.push({url:t,marks:[e]}),js.loading()}static improveImageLoading(t){const e=Hs(t,js.toLoadAueue);if(-1!==e){const t=js.toLoadAueue.splice(e,1);js.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function Hs(t,e){for(let i=0;it?y(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(Vs[0]=t[0],Vs[2]=t[0],Vs[1]=t[1],Vs[3]=t[1],Vs):t:t:0,Gs=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],Us=[1,2,3,0,1,2,3,0];function $s(t,e,i,s){for(;t>=lt;)t-=lt;for(;t<0;)t+=lt;for(;t>e;)e+=lt;Gs[0].x=i,Gs[1].y=i,Gs[2].x=-i,Gs[3].y=-i;const n=Math.ceil(t/at)%4,r=Math.ceil(e/at)%4;if(s.add(ct(t)*i,gt(t)*i),s.add(ct(e)*i,gt(e)*i),n!==r||e-t>rt){let t=!1;for(let e=0;ee.length){s=e.map((t=>{const e=new re(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{const e=new re(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}Zs.TimeOut=1e3/60;const Js=new Zs,Qs=(t,e)=>S(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t,tn=new Pt,en=new Bt,sn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],nn=["x","y"],rn=["scaleX","scaleY"],an=["angle"],on=new re,ln={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class hn extends as{static mixin(t){const e=Object.keys(t);for(let i=0;i{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(oi.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!P(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,s){var n,r,a,o;if(i){const i=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let d;i.forEach((e=>{l[e]?(d||(d={}),d[e]=t[e]):h[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate();c.stateNames=e,c.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:200,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:"cubicOut"),d&&this.setAttributes(d,!1,{type:Kt.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:Kt.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const s=i.getEndProps();es(s,t)&&(e=s[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=Ut.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=Ut.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=Ut.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&Ut.UPDATE_SHAPE_AND_BOUNDS)===Ut.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=Ut.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ut.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=Ut.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=Ut.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=Ut.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=Ut.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=Ut.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&Ut.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],s=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:s}=this.attribute;return en.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(en),this.setAttributes({scaleX:t,scaleY:i,angle:s}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=s();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=s();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=je.x,y:e=je.y,scaleX:i=je.scaleX,scaleY:s=je.scaleY,angle:n=je.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,d=e.c,c=e.d,u=e.e,p=e.f,g=ct(a),m=gt(a);let _,f;o?(_=o[0],f=o[1]):(_=i,f=s);const v=_-i,y=f-s,b=l*g+d*m,x=h*g+c*m,S=d*g-l*m,M=c*g-h*m;t.a=n*b,t.b=n*x,t.c=r*S,t.d=r*M,t.e=u+l*_+d*f-b*v-S*y,t.f=p+h*_+c*f-x*v-M*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h),oi.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const d=this.getOffsetXY(je);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,o){const t=tn.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),oi.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:Kt.ANIMATE_END})}onStep(t,e,i,s,n){const r={};if(i.customAnimate)i.customAnimate.update(n,s,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,s,n,a,void 0,o,l)}this.setAttributes(r,!1,{type:Kt.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,r,a,o,l,h){h||(h=Object.keys(a),s.propKeys=h),r?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const d=a[r],c=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,s);if(null==d||null==c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,c,d,i),u||(u=e.customInterpolate(r,n,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,l,n)||this._interpolate(r,n,c,d,i))})),s.parsedProps=l}defaultInterpolate(t,e,i,s,n,r){if(Number.isFinite(t))return s[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const a=n.fillColorArray,o=Rs(e,null!=a?a:t,r,!1,((t,e)=>{n.fillColorArray=e}));return o&&(s[i]=o),!0}if("stroke"===i){n||(n={});const a=n.strokeColorArray,o=Rs(e,null!=a?a:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return o&&(s[i]=o),!0}if("shadowColor"===i){n||(n={});const a=n.shadowColorArray,o=Rs(e,null!=a?a:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return o&&(s[i]=o),!0}return!1}_interpolate(t,e,i,s,n){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:oi.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return S(t,!0)?this.pathProxy=(new Be).fromString(t):this.pathProxy=new Be,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",oi.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new ls(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}}hn.mixin(hs);function dn(t,e,i,s=0){return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let cn=0;function un(){return cn++}var pn;function gn(t){const e=[];let i=0,s="";for(let n=0;nmn.set(t,!0)));const _n=new Map;function fn(t){if(mn.has(t))return!0;if(_n.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>_n.set(t,!0)));const vn=un(),yn=un(),bn=un(),xn=un(),Sn=un(),Mn=un(),kn=un(),An=un(),wn=un(),Tn=un(),Cn=un(),Ln=un(),En=un(),Pn=un(),Dn=un(),On=un(),Rn=Symbol.for("GraphicService"),In=Symbol.for("GraphicCreator"),Bn=(Object.keys({"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"}),{"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"}),Fn=Object.keys(Bn);var Yn;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Yn||(Yn={}));class jn extends hn{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Mn,this._childUpdateTag=Ut.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new Zi),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new Zi)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===$t.GLOBAL){const i=new re(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&Ut.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;oi.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),oi.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=je.x,y:e=je.y,dx:i=je.dx,dy:s=je.dy,scaleX:n=je.scaleX,scaleY:r=je.scaleY,angle:a=je.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==n||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return Qi(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip,display:l}=t;return a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),o||this.forEachChildren((t=>{i.union(t.AABBBounds)})),oi.graphicService.updateTempAABBBounds(i),oi.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=Ut.CLEAR_BOUNDS,this._childUpdateTag&=Ut.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=Ut.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&Ut.UPDATE_BOUNDS||(this._childUpdateTag|=Ut.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),oi.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),oi.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,oi.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{oi.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),oi.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&Ut.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let s=this._getChildByName(t);return s?s.setAttributes(e):(s=oi.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new jn(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return jn.NOWORK_ANIMATE_ATTR}}function Hn(t){return new jn(t)}jn.NOWORK_ANIMATE_ATTR=ln;class zn extends jn{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,s){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=s.main,this.layerHandler=s.layerHandler,this.layerHandler.init(this,i,{main:s.main,canvasId:s.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=s.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new Zi,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{oi.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{oi.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const Nn=Symbol.for("TransformUtil"),Vn=Symbol.for("GraphicUtil"),Wn=Symbol.for("LayerService"),Gn=Symbol.for("StaticLayerHandlerContribution"),Un=Symbol.for("DynamicLayerHandlerContribution"),$n=Symbol.for("VirtualLayerHandlerContribution");var Kn;let Xn=Kn=class{static GenerateLayerId(){return`${Kn.idprefix}_${Kn.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=oi.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Di.get(Gn):"dynamic"===t?Di.get(Un):Di.get($n),e}createLayer(t,e={main:!1}){var i;this.tryInit();let s=this.getRecommendedLayerType(e.layerMode);s=e.main||e.canvasId?"static":s;const n=this.getLayerHandler(s),r=new zn(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:s,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:Kn.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(t)||[];return a.push(r),this.layerMap.set(t,a),this.staticLayerCountInEnv--,r}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}};Xn.idprefix="visactor_layer",Xn.prefix_count=0,Xn=Kn=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Xn);const qn=new B((t=>{t(et).to(st).inSingletonScope(),t(Fi).to(ji),t(Vn).to(Vi).inSingletonScope(),t(Nn).to(Ui).inSingletonScope(),t(Wn).to(Xn).inSingletonScope()})),Zn=Symbol.for("IncrementalDrawContribution"),Jn=Symbol.for("ArcRender"),Qn=Symbol.for("Arc3dRender"),tr=Symbol.for("AreaRender"),er=Symbol.for("CircleRender"),ir=Symbol.for("GraphicRender"),sr=Symbol.for("GroupRender"),nr=Symbol.for("LineRender"),rr=Symbol.for("PathRender"),ar=Symbol.for("PolygonRender"),or=Symbol.for("RectRender"),lr=Symbol.for("Rect3DRender"),hr=Symbol.for("SymbolRender"),dr=Symbol.for("TextRender"),cr=Symbol.for("RichTextRender"),ur=Symbol.for("Pyramid3dRender"),pr=Symbol.for("GlyphRender"),gr=Symbol.for("ImageRender"),mr=(Symbol.for("RenderSelector"),Symbol.for("DrawContribution"));const _r=Symbol.for("RenderService");Symbol.for("BeforeRenderConstribution");let fr=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};var vr,yr;fr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),(vr=0,yr=$(mr),function(t,e){yr(t,e,vr)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fr);const br=new B((t=>{t(_r).to(fr)})),xr=(Symbol.for("GraphicPicker"),Symbol.for("PickerService")),Sr=(Symbol.for("BoundsPicker"),Symbol.for("GlobalPickerService"));function Mr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function kr(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,d,c,u,p,g,m,_,f;return e===t?(t[12]=e[0]*s+e[4]*n+e[8]*r+e[12],t[13]=e[1]*s+e[5]*n+e[9]*r+e[13],t[14]=e[2]*s+e[6]*n+e[10]*r+e[14],t[15]=e[3]*s+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],d=e[4],c=e[5],u=e[6],p=e[7],g=e[8],m=e[9],_=e[10],f=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=d,t[5]=c,t[6]=u,t[7]=p,t[8]=g,t[9]=m,t[10]=_,t[11]=f,t[12]=a*s+d*n+g*r+e[12],t[13]=o*s+c*n+m*r+e[13],t[14]=l*s+u*n+_*r+e[14],t[15]=h*s+p*n+f*r+e[15]),t}function Ar(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function wr(t,e,i){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],d=e[7],c=e[8],u=e[9],p=e[10],g=e[11],m=e[12],_=e[13],f=e[14],v=e[15];let y=i[0],b=i[1],x=i[2],S=i[3];return t[0]=y*s+b*o+x*c+S*m,t[1]=y*n+b*l+x*u+S*_,t[2]=y*r+b*h+x*p+S*f,t[3]=y*a+b*d+x*g+S*v,y=i[4],b=i[5],x=i[6],S=i[7],t[4]=y*s+b*o+x*c+S*m,t[5]=y*n+b*l+x*u+S*_,t[6]=y*r+b*h+x*p+S*f,t[7]=y*a+b*d+x*g+S*v,y=i[8],b=i[9],x=i[10],S=i[11],t[8]=y*s+b*o+x*c+S*m,t[9]=y*n+b*l+x*u+S*_,t[10]=y*r+b*h+x*p+S*f,t[11]=y*a+b*d+x*g+S*v,y=i[12],b=i[13],x=i[14],S=i[15],t[12]=y*s+b*o+x*c+S*m,t[13]=y*n+b*l+x*u+S*_,t[14]=y*r+b*h+x*p+S*f,t[15]=y*a+b*d+x*g+S*v,t}function Tr(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}Symbol.for("MatrixAllocate"),Symbol.for("Mat4Allocate");class Cr{constructor(){this.pools=[]}static identity(t){return Mr(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Cr.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i{let n,r=!1,a=!1;if(e.forEachChildren((t=>(r=t.numberType===yn,!r))),e.forEachChildren((t=>(a=!!t.findFace,!a))),r){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,s,n,r;let a=(null!==(s=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==s?s:0)/2,o=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;a<0;)a+=lt;for(;o<0;)o+=lt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),s.hack_pieFace="outside",n=i(r,a),n&&n.graphic||(s.hack_pieFace="inside",n=i(r,a)),n&&n.graphic||(s.hack_pieFace="top",n=i(r,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const s=e.getChildren(),o=s.map((e=>({ave_z:e.findFace().vertices.map((i=>{var s;return t.view(i[0],i[1],null!==(s=i[2]+e.attribute.z)&&void 0!==s?s:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),n=i(r,a),e.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),e.update(),s.forEach((t=>{e.add(t)}))}else n=i(r,a);return n};var Dr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const Or=Symbol.for("PickItemInterceptor");let Rr=class{constructor(){this.order=1}afterPickItem(t,e,i,s,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,s,n):null}beforePickItem(t,e,i,s,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,s,n):null}_pickItem(t,e,i,s,n){var r;if(!t.shadowRoot)return null;const{parentMatrix:a}=n||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const l=null===(r=Qi(t))||void 0===r?void 0:r[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,d=t.shadowRoot,c=Lr.allocateByObj(a),u=new re(c.a*i.x+c.c*i.y+c.e,c.b*i.x+c.d*i.y+c.f),p=e.pickGroup(d,u,c,s);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}};Rr=Dr([V()],Rr);let Ir=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){const r=t.baseGraphic;if(r&&r.parent){const t=new re(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const a=r.parent.globalTransMatrix;a.transformPoint(t,t);const o=r.isContainer?e.pickGroup(r,t.clone(),a,s):e.pickItem(r,t.clone(),a,s);return n.highPerformanceRestore(),o}return null}};Ir=Dr([V()],Ir);let Br=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){if(!t.in3dMode||s.in3dInterceptor)return null;const r=e.pickContext,a=t.stage;if(!r||!a)return null;if(s.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=a.camera,t.isContainer){const a=Pr(r,t,(()=>e.pickGroup(t,i,n.parentMatrix,s)),s);return r.camera=null,s.in3dInterceptor=!1,r.restore(),a}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};Br=Dr([V()],Br);const Fr=new B(((t,e,i)=>{i(xr)||(t(Sr).toSelf(),t(xr).toService(Sr)),t(Br).toSelf().inSingletonScope(),t(Or).toService(Br),t(Rr).toSelf().inSingletonScope(),t(Or).toService(Rr),t(Ir).toSelf().inSingletonScope(),t(Or).toService(Ir),Z(t,Or)}));function Yr(t,e=0,i=0){if(!t)return{width:e,height:i};let s;try{s=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){s=()=>({})}const n=s(t);if(/^(\d*\.?\d+)(px)$/.exec(n.width)){const s=parseFloat(n.width)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)||t.clientWidth-1,r=parseFloat(n.height)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)||t.clientHeight-1;return{width:s<=0?e:s,height:r<=0?i:r}}return{width:e,height:i}}function jr(t,e){let i=t.parentNode;for(;null!==i;){if(i===e)return!0;i=i.parentNode}return!1}const Hr=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();function zr(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function Nr(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function Vr(t,e,i){var s;const{x:n=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:m=i.angle,anchor3d:_=e.attribute.anchor,anchor:f}=e.attribute,v=[0,0,0];if(_){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=_[1];v[2]=null!==(s=_[2])&&void 0!==s?s:0}if(Mr(t),kr(t,t,[n+o,r+l,a+h]),kr(t,t,[v[0],v[1],v[2]]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*n+h*s,t[5]=a*n+d*s,t[6]=o*n+c*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=d*n-a*s,t[10]=c*n-o*s,t[11]=u*n-l*s}(t,t,g),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n-h*s,t[1]=a*n-d*s,t[2]=o*n-c*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+d*n,t[10]=o*s+c*n,t[11]=l*s+u*n}(t,t,p),kr(t,t,[-v[0],-v[1],v[2]]),function(t,e,i){const s=i[0],n=i[1],r=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[d,c,u]),m){const i=Er.allocate(),s=[0,0];if(f){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=_[1]}kr(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],d=e[5],c=e[6],u=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n+h*s,t[1]=a*n+d*s,t[2]=o*n+c*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=d*n-a*s,t[6]=c*n-o*s,t[7]=u*n-l*s}(i,i,m),kr(i,i,[-s[0],-s[1],0]),wr(t,t,i)}}let Wr=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new Q(["graphic"]),onSetStage:new Q(["graphic","stage"]),onRemove:new Q(["graphic"]),onRelease:new Q(["graphic"]),onAddIncremental:new Q(["graphic","group","stage"]),onClearIncremental:new Q(["graphic","group","stage"]),beforeUpdateAABBBounds:new Q(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Q(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new Bt,this.tempAABBBounds2=new Bt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,n)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new Ot(t);return ne(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=h(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=Nr(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=h(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=zr(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l&&(dn(c,(l+h)/Math.abs(n+r),s,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)),o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;dn(c,o/Math.abs(n+r)*2,!1,d+1),c.translate(s,a),e.union(c)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Rt(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(!s.valid)return i.clear(),!1;const{visible:n=e.visible}=t;return!!n||(i.clear(),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};Wr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(In)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Wr);const Gr=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}},Ur=new B((t=>{t(Rn).to(Wr).inSingletonScope(),t(In).toConstantValue(Gr)})),$r=Symbol.for("AutoEnablePlugins"),Kr=Symbol.for("PluginService");var Xr=function(t,e){return function(i,s){e(i,s,t)}};let qr=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Di.isBound($r)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};qr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Xr(0,$(X)),Xr(0,K($r)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],qr);const Zr=new B((t=>{t(Kr).to(qr),function(t,e){t(X).toDynamicValue((({container:t})=>new q(e,t))).whenTargetNamed(e)}(t,$r)})),Jr=new B((t=>{Z(t,tt)})),Qr=new B((t=>{t(fi).to(vi).inSingletonScope(),Z(t,fi)}));let ta=class{constructor(){this.type="static",this.offscreen=!1,this.global=oi.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const s=e.getContext().getCanvas().nativeCanvas,n=Ii({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:s.offsetLeft,y:s.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var s;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(s=e.background)&&void 0!==s?s:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var s;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(s=i.background)&&void 0!==s?s:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};ta=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ta);const ea=new B((t=>{t(ta).toSelf(),t(Gn).toService(ta)})),ia=U(j);var sa;function na(t,e,i){const s={},n=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],n.push(i))}),i),n.sort(((t,e)=>i?e-t:t-e)),{childMap:s,zIdxArray:n}}function ra(t,e,i,s=!1,n=!1){let r=!1;if(n)r=!0;else{let i;t.forEachChildren(((t,s)=>{const{zIndex:n=e}=t.attribute;if(0===s)i=n;else if(i!==n)return r=!0,!0;return!1}),s)}if(r){const{childMap:r,zIdxArray:a}=na(t,e,s);let o=!1;for(let t=0;t{var i,n;return(s?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t{const{zIndex:s=i}=t.attribute;if(0===e);else if(void 0!==s)return n=!0,!0;return!1}),s);let r=null,a=!1;if(n){const{childMap:n,zIdxArray:o}=na(t,i,s);let l=!1;for(let t=0;ta?(r=t,!0):(t._uid===e&&(a=!0),!1)),s);return r}function la(t,e,i){t[0]=e[0]-i[0],t[1]=e[1]-i[1]}function ha(t,e,i,s){let n=t[0],r=e[0],a=i[0],o=s[0];return r=l||n<=o||r>=d||a<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(s,o),y1:Math.max(r,h),x2:Math.min(n,l),y2:Math.min(a,d)}}!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(sa||(sa={}));const ca=(t,e,i)=>{let s=t.x1,n=t.x2,r=t.y1,a=t.y2,o=e.x1,l=e.x2,h=e.y1,d=e.y2;return i&&(s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),o>l&&([o,l]=[l,o]),h>d&&([h,d]=[d,h])),{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}};function ua(t,e,i){if(!t||!e)return sa.NONE;const{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}=ca(t,e,i);return s>o&&nh&&as&&lr&&de.x2||t.x2e.y2||t.y2l||nd||a=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let s=e.x1,n=e.x2,r=e.y1,a=e.y2;return s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),t.x>=s&&t.x<=n&&t.y>=r&&t.y<=a}function ma(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function _a({x:t,y:e},i,s={x:0,y:0}){return{x:(t-s.x)*Math.cos(i)+(e-s.y)*Math.sin(i)+s.x,y:(t-s.x)*Math.sin(i)+(s.y-e)*Math.cos(i)+s.y}}function fa(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function va(t,e){const i=e?t.angle:At(t.angle),s=fa(t);return[_a({x:t.x1,y:t.y1},i,s),_a({x:t.x2,y:t.y1},i,s),_a({x:t.x2,y:t.y2},i,s),_a({x:t.x1,y:t.y2},i,s)]}const ya=Symbol.for("DrawItemInterceptor"),ba=new Bt,xa=new Bt;class Sa{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,s,n),!1}beforeDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),s.dirtyBounds&&s.backupDirtyBounds){ba.copy(s.dirtyBounds),xa.copy(s.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();s.dirtyBounds.copy(s.backupDirtyBounds).transformWithMatrix(e),s.backupDirtyBounds.copy(s.dirtyBounds)}return s.renderGroup(t.shadowRoot,i,Lr.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),s.dirtyBounds&&s.backupDirtyBounds&&(s.dirtyBounds.copy(ba),s.backupDirtyBounds.copy(xa)),!0}}class Ma{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(a.x1,a.y1,a.width(),a.height()),r.highPerformanceRestore(),!0}}let ka=class{constructor(){this.order=1,this.interceptors=[new Sa,new wa,new Aa,new Ma]}afterDrawItem(t,e,i,s,n){for(let r=0;r=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ka);class Aa{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,s,n):this.beforeSetInteractive(t,e,i,s,n))}beforeSetInteractive(t,e,i,s,n){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,s,n){const r=t.baseGraphic;if(!r.stage){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?s.renderGroup(r,i,r.parent.globalTransMatrix):s.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=Gr.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class wa{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:a}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=a.camera;const o=r.currentMatrix;o.a/=r.dpr,o.b/=r.dpr,o.c/=r.dpr,o.d/=r.dpr,o.e/=r.dpr,o.f/=r.dpr;const l=Er.allocate();Ar(l,o);const h=r.modelMatrix;if(h){if(l){const t=Er.allocate();r.modelMatrix=wr(t,h,l)}}else r.modelMatrix=l;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?Pr(r,t,((e,n)=>s.renderGroup(t,i,t.parent.globalTransMatrix,!e&&n)),i):s.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==h&&Er.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}const Ta=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s){if(f(s)){f(t.startCall)||i("Missing (");const s=function(){const s=n();return s&&(f(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:u(p)}}();return f(t.endCall)||i("Missing )"),s}}(s)}function r(){return _("directional",t.sideOrCorner,1)||_("angular",t.angleValue,1)}function a(){return _("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,f(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=_("shape",/^(circle)/i,0);return t&&(t.style=m()||h()),t}()||function(){const t=_("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=d();else{const e=h();if(e){t=e;const i=d();i&&(t.at=i)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return _("extent-keyword",t.extentKeywords,1)}function d(){if(_("position",/^at/,0)){const t=c();return t||i("Missing positioning value"),t}}function c(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let s=e();const n=[];if(s)for(n.push(s);f(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=_("hex",t.hexColor,1)||_("rgba",t.rgbaColor,1)||_("rgb",t.rgbColor,1)||_("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return _("%",t.percentageValue,1)||_("position-keyword",t.positionKeywords,1)||m()}function m(){return _("px",t.pixelValue,1)||_("em",t.emValue,1)}function _(t,e,i){const s=f(e);if(s)return{type:t,value:s[i]}}function f(t){const i=/^[\n\r\t\s]+/.exec(e);i&&v(i[0].length);const s=t.exec(e);return s&&v(s[0].length),s}function v(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Ca{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Ca.IsGradientStr(t))try{const e=Ta(t)[0];if(e){if("linear"===e.type)return Ca.ParseLinear(e);if("radial"===e.type)return Ca.ParseRadial(e);if("conic"===e.type)return Ca.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=rt/2,n=parseFloat(e.value)/180*rt-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+lt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,s=rt/2;let n="angular"===e.type?parseFloat(e.value)/180*rt:0;for(;n<0;)n+=lt;for(;n>lt;)n-=lt;let r=0,a=0,o=0,l=0;return n({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function La(t,e,i){let s=e;const{a:n,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(s=s/Math.abs(l+h)*2*i,s)}function Ea(t,e,i,s=0,n=0){if(!e||!0===e)return"black";let r,a;if(y(e))for(let t=0;t{d.addColorStop(t.offset,t.color)})),d}(t,a,h,d,o,l):"conical"===a.gradient?r=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern(n+i,r+s,void 0)}(t,a,h,d,o,l):"radial"===a.gradient&&(r=function(t,e,i,s,n,r){var a,o,l,h,d,c;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(d=e.y1)&&void 0!==d?d:.5)*r,Math.max(n,r)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,a,h,d,o,l))}return r||"orange"}Symbol.for("BoundsAllocate");const Pa=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new Bt)}allocate(t,e,i,s){if(!this.pools.length)return(new Bt).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new Bt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};var Da=function(t,e){return function(i,s){e(i,s,t)}};let Oa=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new It,this.backupDirtyBounds=new It,this.global=oi.global,this.layerService=oi.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:s,viewBox:n,transMatrix:r}=e;if(!i)return;const a=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(s.dirtyBounds&&!s.dirtyBounds.empty()){const t=da(a,s.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}const o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),s.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Ue.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:Ue.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,Lr.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=oa(e,i,Ue.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,s){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!pa(t.AABBBounds,this.dirtyBounds,!1))return;let n,r=i;if(this.useDirtyBounds){n=Pa.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=Lr.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;s?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):ra(t,Ue.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),Pa.free(n),Lr.free(r))}_increaseRender(t,e){const{layer:i,stage:s}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(s),zIndex:n.size,group:t},n.set(t._uid,r));const a=r.layer.getNativeHandler().getContext(),o=r.drawContribution||Di.get(Zn);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:r.layer,context:a,startAtId:t._uid,break:!1})),r.drawContribution=o;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=n.get(l._uid);t||(t={layer:this.layerService.createLayer(s),zIndex:n.size},n.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let s=0;s=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Da(0,ia(ir)),Da(1,$(X)),Da(1,K(ya)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object])],Oa);const Ba=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n0)&&(s=r)}return s},Fa=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;nt||void 0===t)):!!t,i&&e>0}function Ga(t,e,i){return i&&t*e>0}function Ua(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function $a(t,e){return t*e>0}function Ka(t,e,i,s){return t*e>0&&0!==i&&0!==s}function Xa(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),d=h*l,c=-h*o,u=t+d,p=e+c,g=i+d,m=s+c,_=(u+g)/2,f=(p+m)/2,v=g-u,y=m-p,b=v*v+y*y,x=n-r,S=u*m-g*p,M=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S));let k=(S*y-v*M)/b,A=(-S*v-y*M)/b;const w=(S*y+v*M)/b,T=(-S*v+y*M)/b,C=k-_,L=A-f,E=w-_,P=T-f;return C*C+L*L>E*E+P*P&&(k=w,A=T),{cx:k,cy:A,x01:-d,y01:-c,x11:k*(n/x-1),y11:A*(n/x-1)}}function qa(t,e,i,s,n){const r=ht(i-e),a=t.getParsedCornerRadius(),o=y(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:c,innerEndAngle:u,innerStartAngle:p}=t.getParsePadAngle(e,i),g=o?a[0]:a,m=o?a[1]:a,_=o?a[2]:a,f=o?a[3]:a,v=Math.max(m,g),b=Math.max(_,f);let x=v,S=b;const M=n*ct(d),k=n*gt(d),A=s*ct(u),w=s*gt(u);let T,C,L,E;if((b>nt||v>nt)&&(T=n*ct(c),C=n*gt(c),L=s*ct(p),E=s*gt(p),r1?0:P<-1?rt:Math.acos(P))/2),l=mt(t[0]*t[0]+t[1]*t[1]);S=pt(b,(s-l)/(o-1)),x=pt(v,(n-l)/(o+1))}}var P;return{outerDeltaAngle:l,xors:M,yors:k,xirs:L,yirs:E,xore:T,yore:C,xire:A,yire:w,limitedOcr:x,limitedIcr:S,outerCornerRadiusStart:g,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:b,outerStartAngle:d,outerEndAngle:c,innerDeltaAngle:h,innerEndAngle:u,innerStartAngle:p,innerCornerRadiusStart:f,innerCornerRadiusEnd:_}}function Za(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(n=lt-nt)e.moveTo(i+n*ct(o),s+n*gt(o)),e.arc(i,s,n,o,l,!d),r>nt&&(e.moveTo(i+r*ct(l),s+r*gt(l)),e.arc(i,s,r,l,o,d));else{const{outerDeltaAngle:h,xors:u,yors:p,xirs:g,yirs:m,limitedOcr:_,outerCornerRadiusStart:f,outerCornerRadiusEnd:v,maxOuterCornerRadius:y,xore:b,yore:x,xire:S,yire:M,outerStartAngle:k,outerEndAngle:A,limitedIcr:w,innerDeltaAngle:T,innerEndAngle:C,innerStartAngle:L,innerCornerRadiusStart:E,innerCornerRadiusEnd:P,maxInnerCornerRadius:D}=qa(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+u,s+p),c=!0;else if(_>nt){const t=pt(f,_),r=pt(v,_),o=Xa(g,m,u,p,n,t,Number(d)),l=Xa(b,x,S,M,n,r,Number(d));_0&&e.arc(i+o.cx,s+o.cy,t,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,n,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),!d),r>0&&e.arc(i+l.cx,s+l.cy,r,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):r>0?e.moveTo(i+l.cx+r*ct(dt(l.y01,l.x01)),s+l.cy+r*gt(dt(l.y01,l.x01))):e.moveTo(i+b,s+n*gt(A))}else!a||a[0]?(e.moveTo(i+u,s+p),e.arc(i,s,n,k,A,!d)):e.moveTo(i+n*ct(A),s+n*gt(A));if(!(r>nt)||T<.001)!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),c=!0;else if(w>nt){const t=pt(E,w),n=pt(P,w),o=Xa(S,M,b,x,r,-n,Number(d)),l=Xa(u,p,g,m,r,-t,Number(d));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),w0&&e.arc(i+o.cx,s+o.cy,n,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,r,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),d),t>0&&e.arc(i+l.cx,s+l.cy,t,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):t>0?e.moveTo(i+l.cx+t*ct(dt(l.y01,l.x01)),s+l.cy+t*gt(dt(l.y01,l.x01))):e.moveTo(i+g,s+m)}else!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),!a||a[2]?e.arc(i,s,r,C,L,d):e.moveTo(i+r*ct(L),s+r*gt(L))}return a?a[3]&&e.lineTo(i+n*ct(o),s+n*gt(o)):e.closePath(),c}const Ja=Symbol.for("ArcRenderContribution"),Qa=Symbol.for("AreaRenderContribution"),to=Symbol.for("CircleRenderContribution"),eo=Symbol.for("GroupRenderContribution"),io=Symbol.for("ImageRenderContribution"),so=Symbol.for("PathRenderContribution"),no=Symbol.for("PolygonRenderContribution"),ro=Symbol.for("RectRenderContribution"),ao=Symbol.for("SymbolRenderContribution"),oo=Symbol.for("TextRenderContribution"),lo=(Symbol.for("CommonRenderContribution"),Symbol.for("InteractiveSubRenderContribution"));var ho=function(t,e){return function(i,s){e(i,s,t)}};class co{constructor(){this.time=te.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;const{background:g,backgroundOpacity:m=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:_=l.opacity,backgroundMode:f=l.backgroundMode,backgroundFit:v=l.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Qi(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*_,this.doDrawImage(e,n.data,r,f,v),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*_,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s,n){if("no-repeat"===s)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),a=i.height();let o=r,l=a;if(n&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(o=i*(a/n),l=a):"repeat-y"===s&&(l=n*(r/i),o=r);const h=t.dpr,d=Bi.allocate({width:o,height:l,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=d.nativeCanvas),Bi.free(d)}const h=t.dpr,d=t.createPattern(e,s);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}}const uo=new co;let po=class{constructor(t){this.subRenderContribitions=t,this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}};po=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),ho(0,$(X)),ho(0,K(lo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],po);const go=new class extends co{constructor(){super(...arguments),this.time=te.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{background:u,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const s=t.AABBBounds;this.doDrawImage(e,i.data,s,p,g),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}};var mo=function(t,e){return function(i,s){e(i,s,t)}};let _o=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Mn}drawShape(t,e,i,s,n,r,a,o){const l=Qi(t,null==r?void 0:r.theme).group,{fill:h=l.fill,background:d,stroke:c=l.stroke,opacity:u=l.opacity,width:p=l.width,height:g=l.height,clip:m=l.clip,fillOpacity:_=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,cornerRadius:v=l.cornerRadius,path:b=l.path,lineWidth:x=l.lineWidth,visible:S=l.visible}=t.attribute,M=Ua(u,_,p,g,h),k=Ka(u,f,p,g),A=Va(h,d),w=Wa(c,x);if(!t.valid||!S)return;if(!m){if(!A&&!w)return;if(!(M||k||a||o||d))return}if(b&&b.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,s=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,b.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=s}else 0===v||y(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(i,s,p,g)):(e.beginPath(),Na(e,i,s,p,g,v));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(go));const T={doFill:A,doStroke:w};this._groupRenderContribitions.forEach((r=>{r.time===te.beforeFillStroke&&r.drawShape(t,e,i,s,A,w,M,k,l,n,a,o,T)})),m&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),T.doFill&&(a?a(e,t.attribute,l):M&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fill())),T.doStroke&&(o?o(e,t.attribute,l):k&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),this._groupRenderContribitions.forEach((r=>{r.time===te.afterFillStroke&&r.drawShape(t,e,i,s,A,w,M,k,l,n,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;const{clip:r,baseOpacity:a=1}=t.attribute;r?n.save():n.highPerformanceSave();const o=n.baseGlobalAlpha;n.baseGlobalAlpha*=a;const l=Qi(t,null==s?void 0:s.theme).group,h=n.modelMatrix;if(n.camera){const e=Er.allocate(),i=Er.allocate();Vr(i,t,l),wr(e,h||e,i),n.modelMatrix=e,Er.free(i),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(t.transMatrix,!0);n.beginPath(),s.skipDraw?this.drawShape(t,n,0,0,i,s,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i);const{scrollX:d=l.scrollX,scrollY:c=l.scrollY}=t.attribute;let u;(d||c)&&n.translate(d,c),s&&s.drawingCb&&(u=s.drawingCb()),n.modelMatrix!==h&&Er.free(n.modelMatrix),n.modelMatrix=h,n.baseGlobalAlpha=o,u&&u.then?u.then((()=>{r?n.restore():n.highPerformanceRestore()})):r?n.restore():n.highPerformanceRestore()}};_o=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),mo(0,$(X)),mo(0,K(eo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_o);const fo={x:0,y:0,z:0,lastModelMatrix:null};class vo{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===te.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===te.afterFillStroke)))}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}valid(t,e,i,s){const{fill:n=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=Ga(o,l,n),p=$a(o,d),g=Va(n,r),m=Wa(a,h);return!(!t.valid||!c)&&!(!g&&!m)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:m}}transform(t,e,i,s=!1){const{x:n=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:d}=t.attribute,c=i.modelMatrix,u=i.camera;fo.x=n,fo.y=r,fo.z=a,fo.lastModelMatrix=c;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!d:1===o&&1===l&&0===h&&!d;if(p){const s=Er.allocate(),n=Er.allocate();Vr(n,t,e),wr(s,c||s,n),fo.x=0,fo.y=0,fo.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Er.free(n)}if(g&&!c){const s=t.getOffsetXY(e);fo.x+=s.x,fo.y+=s.y,fo.z=a,i.setTransformForCurrent()}else if(p)fo.x=0,fo.y=0,fo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);fo.x+=s.x,fo.y+=s.y,this.transformWithoutTranslate(i,fo.x,fo.y,fo.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),fo.x=0,fo.y=0,fo.z=0;return fo}transformUseContext2d(t,e,i,s){const n=s.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,a=s.project(0,0,i),o=s.project(n,0,i),l=s.project(n,r,i),h={x:0,y:0},d={x:n,y:0},c={x:n,y:r};s.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),p=-(h.y*(l.x-o.x)-d.y*l.x+c.y*o.x+(d.y-c.y)*a.x)*u,g=(d.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-d.y)*a.y)*u,m=(h.x*(l.x-o.x)-d.x*l.x+c.x*o.x+(d.x-c.x)*a.x)*u,_=-(d.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-d.x)*a.y)*u,f=(h.x*(c.y*o.x-d.y*l.x)+h.y*(d.x*l.x-c.x*o.x)+(c.x*d.y-d.x*c.y)*a.x)*u,v=(h.x*(c.y*o.y-d.y*l.y)+h.y*(d.x*l.y-c.x*o.y)+(c.x*d.y-d.x*c.y)*a.y)*u;s.setTransform(p,g,m,_,f,v,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,n,r,a){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(n,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,n){const{context:r}=s;if(!r)return;const{renderable:a}=t.attribute;if(!1===a)return;r.highPerformanceSave();const o=this.transform(t,e,r,i),{x:l,y:h,z:d,lastModelMatrix:c}=o;this.z=d,function(t,e,i,s,n,r){if(!t.pathProxy)return!1;const a=Qi(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:o=a.fill,stroke:l=a.stroke,opacity:h=a.opacity,fillOpacity:d=a.fillOpacity,lineWidth:c=a.lineWidth,strokeOpacity:u=a.strokeOpacity,visible:p=a.visible,x:g=a.x,y:m=a.y}=t.attribute,_=Ga(h,d,o),f=$a(h,u),v=Va(o),y=Wa(l,c);return!p||!v&&!y||!(_||f)||(e.beginPath(),ne(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),y&&f&&(e.setStrokeStyle(t,t.attribute,i-g,s-m,a),e.stroke()),v&&_&&(e.setCommonStyle(t,t.attribute,i-g,s-m,a),e.fill()),!0)}(t,r,l,h,0,n)||(this.drawShape(t,r,l,h,s,n),this.z=0,r.modelMatrix!==c&&Er.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}function yo(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=de(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function bo(t,e,i,s,n,r,a){var o;let l=e.p0,h=s;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)s||(t.lineTo(l.x+n,l.y+r,a),h=!s);else{const{originP1:i,originP2:d}=e;let c;if(i&&!1!==i.defined?c=l:i&&!1!==d.defined&&(c=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=c?c.x:e.p0.x,o=c?c.y:e.p0.y;t.moveTo(i+n,o+r,a)}else c&&(h=!s,t.lineTo(c.x+n,c.y+r,a))}return h}function xo(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let d=!0;const{curves:c}=e;if(i>=1){if(h){let e,i=!0;c.forEach(((s,n)=>{s.originP1!==s.originP2?(i=bo(t,s,e,i,r,a,o),e=s):e=s}))}else c.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+r,e.p0.y+a,o),yo(t,e,1,n),d=!1):d=!0}));return}if(i<=0)return;let u;"x"===s?u=Jt.ROW:"y"===s?u=Jt.COLUMN:"auto"===s&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,m=!0,_=null;for(let e=0,i=c.length;et.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,a,o);const{x:S=0,x:M=0}=a;!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,a,S-d,M-c,o),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,a,S-d,M-c,o),t.stroke()));let{connectedType:k,connectedX:A,connectedY:w,connectedStyle:T}=a;if(y(o)?(k=null!==(_=null!=k?k:o[0].connectedType)&&void 0!==_?_:o[1].connectedType,A=null!==(f=null!=A?A:o[0].connectedX)&&void 0!==f?f:o[1].connectedX,w=null!==(v=null!=w?w:o[0].connectedY)&&void 0!==v?v:o[1].connectedY,T=null!==(b=null!=T?T:o[0].connectedStyle)&&void 0!==b?b:o[1].connectedStyle):(k=null!=k?k:o.connectedType,A=null!=A?A:o.connectedX,w=null!=w?w:o.connectedY,T=null!=T?T:o.connectedStyle),"connect"!==k&&"zero"!==k&&(k="none"),"none"!==k){t.beginPath(),xo(t.camera?t:t.nativeContext,e,l,h,{offsetX:d,offsetY:c,offsetZ:x,drawConnect:!0,mode:k,zeroX:A,zeroY:w});const m=[];y(o)?o.forEach((t=>m.push(t))):m.push(o),m.push(a),!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,T,S-d,M-c,m),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,T,S-d,M-c,m),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:m}=t.attribute,_=m[0];e.moveTo(_.x+a,_.y+o,g);for(let t=1;t!1===t.defined))&&"linear"===f)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,c,u,i,s,l,n,r,a,o);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,s=e;if(i&&i.length){let e,s;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(s={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:s.endX,y:s.endY,defined:s.curves[s.curves.length-1].defined}:i>1&&(e.x=s.endX,e.y=s.endY,e.defined=s.curves[s.curves.length-1].defined);const n=Ie(t.points,f,{startPoint:e,curveTension:_});return s=n,n})).filter((t=>!!t)),"linearClosed"===f){let e;for(let i=0;it.points.length));if(1===n[0].points.length&&n.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!d,c,u,n[g],[l,t.attribute],v,y,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,m=!1;t.cache.forEach(((r,_)=>{if(m)return;const f=r.getLength(),v=(p-g)/f;g+=f,v>0&&(m=this.drawSegmentItem(e,r,!!h,!!d,c,u,n[_],[l,t.attribute],pt(v,1),y,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!d,c,u,t.attribute,l,v,y,i,s,t,a,o)}};So=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],So);let Mo=class extends So{constructor(){super(...arguments),this.numberType=An}drawShape(t,e,i,s,n,r,a,o){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=Qi(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:m=h.lineWidth,visible:_=h.visible}=t.attribute,f=Ga(u,p,d),v=$a(u,g),y=Va(d),b=Wa(c,m);if(!t.valid||!_)return;if(!y&&!b)return;if(!(f||v||a||o))return;const{context:x}=n;for(let n=e;n{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,a,o,r),e.stroke())}};function ko(t,e,i,s){if(e.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0,mode:o}=s||{};let l=e[0];t.moveTo(l.p0.x+n,l.p0.y+r,a),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+n,h.y+r,a),l=i[i.length-1],t.lineTo(l.p0.x+n,l.p0.y+r,a),l=i[0],h=l.p3||l.p1,t.lineTo(h.x+n,h.y+r,a),t.closePath()}function Ao(t,e,i,s){const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+n,e.p0.y+r,a),yo(t,e,1,s),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(o&&t.lineTo(l.p0.x+n,l.p0.y+r,a),yo(t,l,1,s),o=!1):o=!0}t.closePath()}Mo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Mo);class wo{constructor(){this.time=te.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=Bi.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),n(r,l);const h=s.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),Bi.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,lt),e.fill()}))}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{const n=t/2,r=n;s.fillStyle=i,s.moveTo(n,r-e),s.lineTo(e+n,r),s.lineTo(n,r+e),s.lineTo(n-e,r),s.closePath(),s.fill()}))}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*s,t)}))}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*s)}))}createBiasLRLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(0,0),s.lineTo(t,t);const n=t/2,r=-n;s.moveTo(n,r),s.lineTo(n+t,r+t),s.moveTo(-n,-r),s.lineTo(-n+t,-r+t),s.stroke()}))}createBiasRLLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(t,0),s.lineTo(0,t);const n=t/2,r=n;s.moveTo(t+n,r),s.lineTo(n,r+t),s.moveTo(t-n,-r),s.lineTo(-n,-r+t),s.stroke()}))}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,t,t),s.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:m=l.textureSize,texturePadding:_=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,g,m,_)}drawTexture(t,e,i,s,n,r,a,o,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(o,l,a,i);break;case"diamond":h=this.createDiamondPattern(o,l,a,i);break;case"rect":h=this.createRectPattern(o,l,a,i);break;case"vertical-line":h=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":h=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":h=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":h=this.createGridPattern(o,l,a,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,n,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}const To=new wo,Co=new class extends wo{constructor(){super(...arguments),this.time=te.afterFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:f=t.attribute}=u||{},{texture:v=(null!==(p=t.attribute.texture)&&void 0!==p?p:qs(l,"texture")),textureColor:y=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:qs(l,"textureColor")),textureSize:b=(null!==(m=t.attribute.textureSize)&&void 0!==m?m:qs(l,"textureSize")),texturePadding:x=(null!==(_=t.attribute.texturePadding)&&void 0!==_?_:qs(l,"texturePadding"))}=f;v&&this.drawTexture(v,t,e,i,s,l,y,b,x)}},Lo=uo;var Eo=function(t,e){return function(i,s){e(i,s,t)}};let Po=class extends vo{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=bn,this.builtinContributions=[Co,Lo],this.init(t)}drawLinearAreaHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_,f;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,x=v[0];e.moveTo(x.x+a,x.y+o,b);for(let t=1;t=0;t--){const i=v[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+a,(null!==(m=i.y1)&&void 0!==m?m:i.y)+o,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute});const{x:S=0,x:M=0}=t.attribute;if(!1!==i&&(c?c(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,S-a,M-o,l),e.fill())),this.afterRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute}),s){const{stroke:i=l&&l.stroke}=t.attribute;if(y(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(x.x+a,x.y+o,b);for(let t=1;t=0;t--){const i=v[t];e.lineTo((null!==(_=i.x1)&&void 0!==_?_:i.x)+a,(null!==(f=i.y1)&&void 0!==f?f:i.y)+o,b)}}u?u(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,S-a,M-o,l),e.stroke())}}drawShape(t,e,i,s,n,r,a,o){var l,h,d,c,u,p;const g=Qi(t,null==r?void 0:r.theme).area,{fill:m=g.fill,stroke:_=g.stroke,fillOpacity:f=g.fillOpacity,z:v=g.z,strokeOpacity:y=g.strokeOpacity,curveTension:b=g.curveTension}=t.attribute,x=this.valid(t,g,a,o);if(!x)return;const{doFill:S}=x,M=x.doStroke&&x.sVisible,{clipRange:k=g.clipRange,closePath:A,points:w,segments:T}=t.attribute;let{curveType:C=g.curveType}=t.attribute;if(A&&"linear"===C&&(C="linearClosed"),1===k&&!T&&!w.some((t=>!1===t.defined))&&"linear"===C)return this.drawLinearAreaHighPerformance(t,e,!!m,M,f,y,i,s,g,n,r,a,o);if(t.shouldUpdateShape()){if(T&&T.length){let e,i;const s=T.map(((t,s)=>{if(t.points.length<=1&&0===s)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===s?e={x:i.endX,y:i.endY}:s>1&&(e.x=i.endX,e.y=i.endY);const n=Ie(t.points,C,{startPoint:e,curveTension:b});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=T.length-1;t>=0;t--){const e=T[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=T[t-1].points,s=e[e.length-1];s&&i.push({x:null!==(d=s.x1)&&void 0!==d?d:s.x,y:null!==(c=s.y1)&&void 0!==c?c:s.y})}i.length>1&&(n=Ie(i,"stepBefore"===C?"stepAfter":"stepAfter"===C?"stepBefore":C,{curveTension:b}),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!w||!w.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=w,i=[];for(let t=w.length-1;t>=0;t--)i.push({x:null!==(u=w[t].x1)&&void 0!==u?u:w[t].x,y:null!==(p=w[t].y1)&&void 0!==p?p:w[t].y});const s=Ie(e,C,{curveTension:b}),n=Ie(i,"stepBefore"===C?"stepAfter":"stepAfter"===C?"stepBefore":C,{curveTension:b});t.cacheArea={top:s,bottom:n}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===k){let l=!1;t.cacheArea.forEach(((h,d)=>{l||(l=this.drawSegmentItem(e,h,S,f,M,y,r[d],[g,t.attribute],k,i,s,v,t,n,a,o))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=k*l;let d=0,c=!1;t.cacheArea.forEach(((l,u)=>{if(c)return;const p=l.top.getLength(),m=(h-d)/p;d+=p,m>0&&(c=this.drawSegmentItem(e,l,S,f,M,y,r[u],[g,t.attribute],pt(m,1),i,s,v,t,n,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,S,f,M,y,t.attribute,g,k,i,s,v,t,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).area;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m){let _=!1;return _=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!1,g,m),_=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!0,g,m),_}_drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f,v,b,x;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:S,connectedX:M,connectedY:k,connectedStyle:A}=a;const w=[];if(g&&(y(o)?(S=null!==(f=null!=S?S:o[0].connectedType)&&void 0!==f?f:o[1].connectedType,M=null!==(v=null!=M?M:o[0].connectedX)&&void 0!==v?v:o[1].connectedX,k=null!==(b=null!=k?k:o[0].connectedY)&&void 0!==b?b:o[1].connectedY,A=null!==(x=null!=A?A:o[0].connectedStyle)&&void 0!==x?x:o[1].connectedStyle):(S=null!=S?S:o.connectedType,M=null!=M?M:o.connectedX,k=null!=k?k:o.connectedY,A=null!=A?A:o.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),y(o)?o.forEach((t=>w.push(t))):w.push(o),w.push(a)),g&&"none"===S)return!1;t.beginPath();const{points:T,segments:C}=u.attribute;let L,E,P=Jt.ROW;if(C){const t=C[C.length-1];E=C[0].points[0],L=t.points[t.points.length-1]}else E=T[0],L=T[T.length-1];const D=ht(L.x-E.x),O=ht(L.y-E.y);P=null==L.x1?Jt.ROW:null==L.y1?Jt.COLUMN:Number.isFinite(D+O)?D>O?Jt.ROW:Jt.COLUMN:Jt.ROW,function(t,e,i,s){var n;const{drawConnect:r=!1,mode:a="none"}=s||{};if(r&&"none"===a)return;const{top:o,bottom:l}=e;if(o.curves.length!==l.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;if(r){let n,r,a=!0;const h=o.curves.length;o.curves.forEach(((o,d)=>{const c=l.curves[h-d-1];let u=o,p=c;if(o.originP1===o.originP2)return n=o,void(r=c);if(n&&n.originP1===n.originP2&&(u=n,p=r),o.defined)a||(e.push(u),i.push(p),ko(t,e,i,s),e.length=0,i.length=0,a=!a);else{const{originP1:n,originP2:r}=o;let l,h;n&&!1!==n.defined?(l=u,h=p):n&&!1!==r.defined&&(l=o,h=c),a?(a=!a,e.push(l||o),i.push(h||c)):l&&(a=!a,e.push(l||o),i.push(h||c),ko(t,e,i,s),e.length=0,i.length=0)}n=o})),ko(t,e,i,s)}else{for(let r=0,a=o.curves.length;rp?Jt.ROW:Jt.COLUMN,Number.isFinite(u)||(h=Jt.COLUMN),Number.isFinite(p)||(h=Jt.ROW);const g=i*(h===Jt.ROW?u:p);let m=0,_=!0;const f=[],v=[];let y,b,x=!0;for(let e=0,i=o.curves.length;e=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Eo(0,$(X)),Eo(0,K(Qa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Po);let Do=class extends Po{constructor(){super(...arguments),this.numberType=bn}drawShape(t,e,i,s,n,r,a){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:o}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(r>l.length)return;const h=Qi(t).area,{fill:d=h.fill,fillOpacity:c=h.fillOpacity,opacity:u=h.opacity,visible:p=h.visible}=t.attribute,g=Ga(u,c,d),m=Va(d);if(!t.valid||!p)return;if(!m)return;if(!g&&!a)return;for(let n=r;n{var a,o,l,h;const d=e&&0===s?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const s=i[e];t.lineTo(null!==(a=s.x1)&&void 0!==a?a:s.x,null!==(o=s.y1)&&void 0!==o?o:s.y)}t.lineTo(null!==(l=d.x1)&&void 0!==l?l:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,a,o,r),e.fill())}};Do=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Do);var Oo,Ro=function(t,e){return function(i,s){e(i,s,t)}},Io=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Oo||(Oo={}));let Bo=class extends Oa{constructor(t,e,i,s){super(t,s),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Oo.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Q([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return Io(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:s,viewBox:n}=e;s&&(s.inuse=!0,s.clearMatrix(),s.setTransformForCurrent(!0),s.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,s,e),s.translate(n.x1,n.y1,!0),s.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Ue.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:Ue.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{s.restore(),s.restore(),s.draw(),s.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return Io(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return Io(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Io(this,void 0,void 0,(function*(){if(2!==t.count)yield aa(t,Ue.zIndex,((i,s)=>{if(this.status===Oo.STOP)return!0;if(i.isContainer)return!1;if(s{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return Io(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return Io(this,void 0,void 0,(function*(){this.rendering&&(this.status=Oo.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Oo.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return Io(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Io(this,void 0,void 0,(function*(){yield aa(t,Ue.zIndex,(t=>Io(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};Bo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Ro(0,ia(ir)),Ro(1,$(Mo)),Ro(2,$(Do)),Ro(3,$(X)),Ro(3,K(ya)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object,Object,Object])],Bo);const Fo=new B((t=>{t(co).toSelf().inSingletonScope(),t(wo).toSelf().inSingletonScope(),t(mr).to(Oa),t(Zn).to(Bo),t(sr).to(_o).inSingletonScope(),t(ir).toService(sr),Z(t,eo),t(po).toSelf().inSingletonScope(),Z(t,lo),Z(t,ir),t(ka).toSelf().inSingletonScope(),t(ya).toService(ka),Z(t,ya)}));function Yo(){var t;Yo.__loaded||(Yo.__loaded=!0,Di.load(qn),Di.load(Ur),Di.load(br),Di.load(Fr),Di.load(Zr),(t=Di).load(Jr),t.load(Qr),t.load(ea),function(t){t.load(Fo)}(Di))}Yo.__loaded=!1,Yo();const jo=Di.get(et);oi.global=jo;const Ho=Di.get(Vn);oi.graphicUtil=Ho;const zo=Di.get(Nn);oi.transformUtil=zo;const No=Di.get(Rn);oi.graphicService=No;const Vo=Di.get(Wn);oi.layerService=Vo;const Wo=t=>h(t)&&Number.isFinite(t);let Go=!1;try{Go="function"==typeof requestAnimationFrame&&"function"==typeof cancelAnimationFrame}catch(t){Go=!1}Go=!1;const Uo=function(t,e,i){let s,n,r,a,o,l,h=0,d=!1,c=!1,u=!0;const p=!e&&0!==e&&Go;if("function"!=typeof t)throw new TypeError("Expected a function");function g(e){const i=s,r=n;return s=n=void 0,h=e,a=t.apply(r,i),a}function m(t,e){return p?(cancelAnimationFrame(o),requestAnimationFrame(t)):setTimeout(t,e)}function _(t){const i=t-l;return void 0===l||i>=e||i<0||c&&t-h>=r}function f(){const t=Date.now();if(_(t))return v(t);o=m(f,function(t){const i=t-h,s=e-(t-l);return c?Math.min(s,r-i):s}(t))}function v(t){return o=void 0,u&&s?g(t):(s=n=void 0,a)}function y(...t){const i=Date.now(),r=_(i);if(s=t,n=this,l=i,r){if(void 0===o)return function(t){return h=t,o=m(f,e),d?g(t):a}(l);if(c)return o=m(f,e),g(l)}return void 0===o&&(o=m(f,e)),a}return e=+e||0,ns(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(Wo(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==o&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,s=l=n=o=void 0},y.flush=function(){return void 0===o?a:v(Date.now())},y.pending=function(){return void 0!==o},y};function $o(t,e={data:t=>t}){if(!t)return t;if(t.constructor===Object){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(e[s]){i[s]=e[s](t[s]);continue}i[s]=$o(t[s],e)}return i}return y(t)?t.map((t=>$o(t,e))):t}function Ko(t,e){if(!t)return t;if(w(t)){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(S(t[s])&&e.getFunction(t[s])){i[s]=e.getFunction(t[s]);continue}i[s]=Ko(t[s],e)}return i}return y(t)?t.map((t=>Ko(t,e))):t}let Xo=0;function qo(){return Xo>=9999999&&(Xo=0),Xo++}function Zo(t){return null!=t&&""!==t&&(!!h(t)||+t==+t)}function Jo(t){return!(!t||0===t.length)&&!P(t[0])&&!P(t[0].dataId)&&y(t[0].fields)}function Qo(t){switch(t){case"left":case"right":case"top":case"bottom":return!0;default:return!1}}function tl(t){return!!S(t)&&!!t.endsWith("%")&&Zo(t.substring(0,t.length-1))}function el(t,e,i,s=0){var n,r;return h(t)?t:tl(t)?Number(t.substring(0,t.length-1))*e/100:rs(t)?t(i):ns(t)?e*(null!==(n=t.percent)&&void 0!==n?n:0)+(null!==(r=t.offset)&&void 0!==r?r:0):s}function il(t,e,i){var s,n,r,a;const o={top:0,bottom:0,left:0,right:0};return Object.values(t).every((t=>h(t)))?(o.top=null!==(s=t.top)&&void 0!==s?s:0,o.right=null!==(n=t.right)&&void 0!==n?n:0,o.bottom=null!==(r=t.bottom)&&void 0!==r?r:0,o.left=null!==(a=t.left)&&void 0!==a?a:0,o):([{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach((e=>{e.orients.forEach((s=>{o[s]=el(t[s],e.size,i)}))})),o)}function sl(t){let e={};return y(t)?(P(t[0])||(e.top=e.left=e.bottom=e.right=t[0]),P(t[1])||(e.left=e.right=t[1]),P(t[2])||(e.bottom=t[2]),P(t[3])||(e.left=t[3]),e):h(t)||tl(t)||rs(t)||ns(i=t)&&("percent"in i||"offset"in i)?(e.top=e.left=e.bottom=e.right=t,e):ns(t)?(e=Object.assign({},t),e):e;var i}function nl(t,e,i){return i?{x:t.x+e.x,y:t.y+e.y}:t}const rl=(t,e)=>{const i=Number(t),s=t.toString();return isNaN(i)&&"%"===s[s.length-1]?e*(Number(s.slice(0,s.length-1))/100):i};let al;function ol(){!function(){if(null==al)try{const t=document.createElement("canvas"),e=t.getContext("2d");al=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),al&&(al=!!document.createElement)}catch(t){al=!1}}();const t=oi.global&&oi.global.env;return t?"browser"===t:al}const ll=ol(),hl=ll&&globalThis?globalThis.document:void 0;function dl(t){return("desktop-browser"===t||"mobile-browser"===t)&&ll}function cl(t){return ul(t)||"mobile-browser"===t}function ul(t){return t.includes("miniApp")||"lynx"===t||"wx"===t||"harmony"===t}const pl=(t,e)=>(rs(ml.warnHandler)&&ml.warnHandler.call(null,t,e),e?g.getInstance().warn(`[VChart warn]: ${t}`,e):g.getInstance().warn(`[VChart warn]: ${t}`)),gl=(t,e,i)=>{if(!ml.silent){if(!rs(ml.errorHandler))throw new Error(t);ml.errorHandler.call(null,t,e)}},ml={silent:!1,warnHandler:!1,errorHandler:!1};var _l,fl;function vl(t){var e,i;const{type:s}=t;return s===_l.sankey?null!==(e=t.direction)&&void 0!==e?e:"horizontal":null!==(i=t.direction)&&void 0!==i?i:"vertical"}!function(t){t.area="area",t.line="line",t.bar="bar",t.bar3d="bar3d",t.rangeColumn="rangeColumn",t.rangeColumn3d="rangeColumn3d",t.rangeArea="rangeArea",t.dot="dot",t.geo="geo",t.link="link",t.map="map",t.pie="pie",t.pie3d="pie3d",t.radar="radar",t.rose="rose",t.scatter="scatter",t.circularProgress="circularProgress",t.wordCloud="wordCloud",t.wordCloud3d="wordCloud3d",t.funnel="funnel",t.funnel3d="funnel3d",t.linearProgress="linearProgress",t.boxPlot="boxPlot",t.sankey="sankey",t.gaugePointer="gaugePointer",t.gauge="gauge",t.treemap="treemap",t.sunburst="sunburst",t.circlePacking="circlePacking",t.waterfall="waterfall",t.heatmap="heatmap",t.correlation="correlation",t.liquid="liquid",t.venn="venn",t.mosaic="mosaic"}(_l||(_l={})),function(t){t.label="label",t.point="point",t.line="line",t.area="area",t.bar="bar",t.bar3d="bar3d",t.boxPlot="boxPlot",t.outlier="outlier",t.circlePacking="circlePacking",t.group="group",t.gridBackground="gridBackground",t.grid="grid",t.dot="dot",t.title="title",t.subTitle="subTitle",t.symbol="symbol",t.funnel="funnel",t.funnel3d="funnel3d",t.transform="transform",t.transform3d="transform3d",t.transformLabel="transformLabel",t.outerLabel="outerLabel",t.outerLabelLine="outerLabelLine",t.pin="pin",t.pinBackground="pinBackground",t.pointer="pointer",t.segment="segment",t.track="track",t.cell="cell",t.cellBackground="cellBackground",t.link="link",t.arrow="arrow",t.pie="pie",t.pie3d="pie3d",t.labelLine="labelLine",t.progress="progress",t.minLabel="minLabel",t.maxLabel="maxLabel",t.rose="rose",t.node="node",t.sunburst="sunburst",t.nonLeaf="nonLeaf",t.leaf="leaf",t.nonLeafLabel="nonLeafLabel",t.leaderLine="leaderLine",t.stackLabel="stackLabel",t.word="word",t.fillingWord="fillingWord",t.wordMask="wordMask",t.nodePoint="nodePoint",t.ripplePoint="ripplePoint",t.centerPoint="centerPoint",t.centerLabel="centerLabel",t.barBackground="barBackground",t.lineLabel="lineLabel",t.areaLabel="areaLabel",t.liquidGroup="liquidGroup",t.liquid="liquid",t.liquidBackground="liquidBackground",t.liquidOutline="liquidOutline",t.circle="circle",t.overlap="overlap",t.overlapLabel="overlapLabel"}(fl||(fl={}));const yl={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},bl={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function xl(t,e){var i;if(!t)return[];const s=wl(t,e);if(!s||y(s))return null!==(i=s)&&void 0!==i?i:[];if(ns(s)){const{dataScheme:i}=s;return i?Al(i)?i.map((i=>Object.assign(Object.assign({},i),{scheme:i.scheme.map((i=>kl(i)?Ml(t,i,e):i)).filter(M)}))):i.map((i=>kl(i)?Ml(t,i,e):i)).filter(M):[]}return[]}function Sl(t,e){var i,s;return Al(t)?null!==(s=null===(i=t.find((t=>M(t.isAvailable)?rs(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!M(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength)))||void 0===i?void 0:i.scheme)&&void 0!==s?s:t[t.length-1].scheme:t}function Ml(t,e,i){var s;const n=wl(t,i);if(!n)return;let r;const{palette:a}=n;if(ns(a)&&(r=null!==(s=function(t,e){const i=yl[e];if(i&&t[i])return t[i];if(t[e])return t[e];const s=bl[e];return s?t[s]:void 0}(a,e.key))&&void 0!==s?s:e.default),!r)return;if(P(e.a)&&P(e.l)||!S(r))return r;let o=new Ls(r);if(M(e.l)){const{r:t,g:i,b:s}=o.color,{h:n,s:r}=bs(t,i,s),a=ys(n,r,e.l),l=new Ls(`rgb(${a.r}, ${a.g}, ${a.b})`);l.setOpacity(o.color.opacity),o=l}return M(e.a)&&o.setOpacity(e.a),o.toRGBA()}function kl(t){return t&&"palette"===t.type&&!!t.key}function Al(t){return!(!y(t)||0===t.length)&&t.every((t=>M(t.scheme)))}function wl(t,e){var i,s;const{type:n}=null!=e?e:{};let r;if(!e||P(n))r=null==t?void 0:t.default;else{const a=vl(e);r=null!==(s=null!==(i=null==t?void 0:t[`${n}_${a}`])&&void 0!==i?i:null==t?void 0:t[n])&&void 0!==s?s:null==t?void 0:t.default}return r}function Tl(t,...e){let i=-1;const s=e.length;for(;++i{if(ns(e))e.type===n&&(y(t[n])?t[n].length>=e.index&&(t[n][e.index]=s?Tl({},t[n][e.index],i):i):t[n]=s?Tl({},t[n],i):i);else if(y(t[n])){const r=t[n].findIndex((t=>t.id===e));r>=0&&(t[n][r]=s?Tl({},t[n][r],i):i)}else t.id===e&&(t[n]=s?Tl({},t[n],i):i)}))}var Ll={},El={};function Pl(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Dl(t){var e=Object.create(null),i=[];return t.forEach((function(t){for(var s in t)s in e||i.push(e[s]=s)})),i}function Ol(t,e){var i=t+"",s=i.length;return s=r?l=!0:10===(s=t.charCodeAt(a++))?h=!0:13===s&&(h=!0,10===t.charCodeAt(a)&&++a),t.slice(n+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+Ol(s,6):Ol(s,4))+"-"+Ol(i.getUTCMonth()+1,2)+"-"+Ol(i.getUTCDate(),2)+(o?"T"+Ol(n,2)+":"+Ol(r,2)+":"+Ol(a,2)+"."+Ol(o,3)+"Z":a?"T"+Ol(n,2)+":"+Ol(r,2)+":"+Ol(a,2)+"Z":r||n?"T"+Ol(n,2)+":"+Ol(r,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var i,s,n,r,a,o}return{parse:function(t,e){var i,n,r=s(t,(function(t,s){if(i)return i(t,s-1);n=t,i=e?function(t,e){var i=Pl(t);return function(s,n){return e(i(s),n,t)}}(t,e):Pl(t)}));return r.columns=n||[],r},parseRows:s,format:function(e,i){return null==i&&(i=Dl(e)),[i.map(a).join(t)].concat(n(e,i)).join("\n")},formatBody:function(t,e){return null==e&&(e=Dl(t)),n(t,e).join("\n")},formatRows:function(t){return t.map(r).join("\n")},formatRow:r,formatValue:a}}var Il,Bl=Rl(","),Fl=Bl.parse,Yl=(Bl.parseRows,Bl.format,Bl.formatBody,Bl.formatRows,Bl.formatRow,Bl.formatValue,Rl("\t")),jl=Yl.parse;Yl.parseRows,Yl.format,Yl.formatBody,Yl.formatRows,Yl.formatRow,Yl.formatValue,function(t){t.DSV="dsv",t.TREE="tree",t.GEO="geo",t.BYTE="bytejson",t.HEX="hex",t.GRAPH="graph",t.TABLE="table",t.GEO_GRATICULE="geo-graticule"}(Il||(Il={}));const Hl=function(t,...e){return function(t,...e){t||(t={});let i=-1;const s=e.length;for(;++i{i.type=Il.DSV;const s=Hl(Vl,e),{delimiter:n}=s;if(!S(n))throw new TypeError("Invalid delimiter: must be a string!");return Rl(n).parse(t)},Gl=(t,e={},i)=>(i.type=Il.DSV,Fl(t)),Ul=(t,e={},i)=>(i.type=Il.DSV,jl(t));class $l{static registerChart(t,e){$l._charts[t]=e}static registerSeries(t,e){$l._series[t]=e}static registerComponent(t,e,i){$l._components[t]={cmp:e,alwaysCheck:i}}static registerMark(t,e){$l._marks[t]=e}static registerRegion(t,e){$l._regions[t]=e}static registerTransform(t,e){$l.transforms[t]=e}static registerLayout(t,e){$l._layout[t]=e}static registerAnimation(t,e){$l._animations[t]=e}static registerImplement(t,e){$l._implements[t]=e}static registerChartPlugin(t,e){$l._chartPlugin[t]=e}static registerComponentPlugin(t,e){$l._componentPlugin[t]=e}static createChart(t,e,i){return $l._charts[t]?new(0,$l._charts[t])(e,i):null}static createChartSpecTransformer(t,e){if(!$l._charts[t])return null;const i=$l._charts[t];return new(0,i.transformerConstructor)(Object.assign({seriesType:i.seriesType},e))}static createRegion(t,e,i){return $l._regions[t]?new(0,$l._regions[t])(e,i):null}static createRegionSpecTransformer(t,e){return $l._regions[t]?new(0,$l._regions[t].transformerConstructor)(e):null}static createSeries(t,e,i){return $l._series[t]?new(0,$l._series[t])(e,i):null}static createSeriesSpecTransformer(t,e){return $l._series[t]?new(0,$l._series[t].transformerConstructor)(e):null}static createMark(t,e,i){if(!$l._marks[t])return null;const s=new(0,$l._marks[t])(e,i);return"group"===s.type&&s.setInteractive(!1),s}static getComponents(){return Object.values($l._components)}static getComponentInKey(t){return $l._components[t].cmp}static getLayout(){return Object.values($l._layout)}static getLayoutInKey(t){return $l._layout[t]}static getSeries(){return Object.values($l._series)}static getSeriesInType(t){return $l._series[t]}static getRegionInType(t){return $l._regions[t]}static getAnimationInKey(t){return $l._animations[t]}static getImplementInKey(t){return $l._implements[t]}static getSeriesMarkMap(t){return $l._series[t]?$l._series[t].mark:{}}static getChartPlugins(){return Object.values($l._chartPlugin)}static getComponentPlugins(){return Object.values($l._componentPlugin)}static getComponentPluginInType(t){return $l._componentPlugin[t]}static registerFormatter(t){this._formatter=t}static getFormatter(){return this._formatter}}function Kl(t,...e){return Tl(Xl(t),...e.map(Xl))}function Xl(t){var e;if(!t)return t;const i=function(t){return t&&(t=Object.keys(t).reduce(((e,i)=>{const s=t[i];return e[i]=function(t){return y(t)?{dataScheme:t}:t}(s),e}),{})),t}(t.colorScheme);return Object.assign({},t,{colorScheme:i,token:null!==(e=t.token)&&void 0!==e?e:{},series:Object.assign({},t.series)})}$l._charts={},$l._series={},$l._components={},$l._marks={},$l._regions={},$l._animations={},$l._implements={},$l._chartPlugin={},$l._componentPlugin={},$l.transforms={fields:D,filter:(t,e)=>{const{callback:i}=e;return i&&(t=t.filter(i)),t},fold:(t,e)=>{const{fields:i,key:s,value:n,retains:r}=e,a=[];for(let e=0;e{const l={};if(l[s]=o,l[n]=t[e][o],r)r.forEach((i=>{l[i]=t[e][i]}));else for(const s in t[e])-1===i.indexOf(s)&&(l[s]=t[e][s]);a.push(l)}));return a}},$l.dataParser={csv:Gl,dsv:Wl,tsv:Ul},$l._layout={};const ql=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],Zl={default:{dataScheme:ql,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2",discreteLegendPagerTextColor:"rgb(51, 51, 51)",discreteLegendPagerHandlerColor:"rgb(47, 69, 84)",discreteLegendPagerHandlerDisableColor:"rgb(170, 170, 170)",emptyCircleColor:"#e3e5e8"}}},Jl=t=>{const e={label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}};return e[t?"transform3d":"transform"]={style:{fill:{type:"palette",key:"axisGridColor"}}},e},Ql=Jl(),th=Jl(!0),eh="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",ih={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:eh,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:eh,fill:"#ddd"}}},sh="__VCHART",nh=500,rh=500,ah=`${sh}_ARC_TRANSFORM_VALUE`,oh=`${sh}_ARC_RATIO`,lh=`${sh}_ARC_START_ANGLE`,hh=`${sh}_ARC_END_ANGLE`,dh=`${sh}_ARC_K`,ch=`${sh}_ARC_MIDDLE_ANGLE`,uh=`${sh}_ARC_QUADRANT`,ph=`${sh}_ARC_RADIAN`,gh=-Math.PI/2,mh=3*Math.PI/2,_h=.6,fh={scatter:{point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"},bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:"palette",key:"emptyCircleColor"},fillOpacity:1}}},pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}},map:{defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:{type:"token",key:"l6FontSize"},lineHeight:{type:"token",key:"l6LineHeight"},textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},dot:{dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},link:{arrow:{style:{size:10}}},wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},funnel:Ql,funnel3d:th,linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:"#E7EBED",fillOpacity:1}}},circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},waterfall:{seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:{type:"token",key:"l4FontSize"}}},label:{visible:!1,offset:12,position:"inside",style:{lineWidth:2}}},gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},gaugePointer:ih,treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}},sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},sankey:{link:{style:{fillOpacity:.15,round:!0}}},rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}},correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}},venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},vh={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},yh=Object.assign(Object.assign({},vh),{label:{space:0}}),bh=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),xh={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:bh(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:bh(!0)},Sh=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),Mh={title:{visible:!0,autoLimit:!1,autoFit:!1,style:Sh("l1FontSize","primaryFontColor")},content:{visible:!0,style:Sh("l2FontSize","tertiaryFontColor")}},kh={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},Ah=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},kh),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},wh={horizontal:Ah(!0),vertical:Ah(!1)},Th=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},kh),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},Ch={horizontal:Th(!0),vertical:Th(!1)},Lh={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Eh=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),Ph={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:Eh(!1),endSymbol:Eh(!0),label:{refY:5,style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Dh={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}},Oh={fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14,l1FontSize:32,l1LineHeight:"150%",l2FontSize:20,l2LineHeight:"140%",l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%"},Rh={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:Zl,token:Oh,mark:{text:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1}}},markByName:{label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1,lineJoin:"bevel"}},area:{style:{fillOpacity:.2}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontSize:null}},fillingWord:{style:{fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},series:fh,component:{discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},colorLegend:wh,sizeLegend:Ch,axis:{domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:4,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},axisBand:{domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},axisLinear:{domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},axisX:vh,axisY:{label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},axisZ:yh,axisAngle:{grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},axisRadius:{grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},markLine:Ph,markArea:Lh,markPoint:Dh,polarMarkLine:Ph,polarMarkArea:Lh,polarMarkPoint:Dh,geoMarkPoint:Dh,tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},dataZoom:xh,crosshair:{trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},indicator:Mh,title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}},mapLabel:{visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"red"}}},poptip:{visible:!0,position:"auto",padding:8,titleStyle:{fontSize:{type:"token",key:"l5FontSize"},fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}},scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},animationThreshold:2e3},Ih=["animationThreshold","colorScheme","name","padding"];function Bh(t,e,i,s){if(!t)return t;e||(e=t.colorScheme),i||(i=t.token);const n={};return Object.keys(t).forEach((r=>{const a=t[r];Ih.includes(r)?n[r]=a:w(a)?kl(a)?n[r]=((t,e,i)=>{if(e&&kl(t)){const s=Ml(e,t,i);if(s)return s}return t})(a,e,s):function(t){return t&&"token"===t.type&&!!t.key}(a)?n[r]=function(t,e){return t&&e.key in t?t[e.key]:e.default}(i,a):n[r]=Bh(a,e,i,s):n[r]=a})),n}const Fh={[Rh.name]:Rh},Yh=Rh.name,jh=new Map(Object.keys(Fh).map((t=>[t,Fh[t]]))),Hh=new Map(Object.keys(Fh).map((t=>[t,Bh(Fh[t])]))),zh=new Map(Object.keys(Fh).map((t=>[t,t===Yh]))),Nh=(t,e)=>{if(!t)return;const i=Wh(e);jh.set(t,i),Hh.set(t,Bh(i)),zh.set(t,!0)},Vh=(t=Yh,e=!1)=>(zh.has(t)&&!zh.get(t)&&Nh(t,jh.get(t)),e?Hh.get(t):jh.get(t)),Wh=t=>{var e;const i=null!==(e=t.type)&&void 0!==e?e:Yh;return Kl({},Vh(i),t)};class Gh{static registerInstance(t){Gh.instances.set(t.id,t)}static unregisterInstance(t){Gh.instances.delete(t.id)}static getInstance(t){return Gh.instances.get(t)}static instanceExist(t){return Gh.instances.has(t)}static forEach(t,e=[],i){const s=Ra(e);return Gh.instances.forEach(((e,i,n)=>{s.includes(i)||t(e,i,n)}),i)}}Gh.instances=new Map;class Uh{static registerTheme(t,e){Nh(t,e)}static getTheme(t,e=!1){return Vh(t,e)}static removeTheme(t){return(t=>jh.delete(t)&&Hh.delete(t)&&zh.delete(t))(t)}static themeExist(t){return(t=>!!S(t)&&jh.has(t))(t)}static getDefaultTheme(){return Uh.themes.get(Yh)}static setCurrentTheme(t){Uh.themeExist(t)&&(Uh._currentThemeName=t,Gh.forEach((e=>null==e?void 0:e.setCurrentTheme(t))))}static getCurrentTheme(t=!1){return Uh.getTheme(Uh._currentThemeName,t)}static getCurrentThemeName(){return Uh._currentThemeName}}function $h(t,e){return S(t)?Uh.themeExist(t)?Uh.getTheme(t,e):{}:ns(t)?t:{}}var Kh,Xh,qh;Uh.themes=jh,Uh._currentThemeName=Yh,function(t){t.dimensionHover="dimensionHover",t.dimensionClick="dimensionClick"}(Kh||(Kh={})),(qh=Xh||(Xh={})).Identity="identity",qh.Linear="linear",qh.Log="log",qh.Pow="pow",qh.Sqrt="sqrt",qh.Symlog="symlog",qh.Time="time",qh.Quantile="quantile",qh.Quantize="quantize",qh.Threshold="threshold",qh.Ordinal="ordinal",qh.Point="point",qh.Band="band";const Zh={};function Jh(t){switch(t){case Xh.Linear:case Xh.Log:case Xh.Pow:case Xh.Sqrt:case Xh.Symlog:case Xh.Time:return!0;default:return!1}}function Qh(t){return!!Zh[t]}function td(t){switch(t){case Xh.Ordinal:case Xh.Point:case Xh.Band:return!0;default:return!1}}Object.values(Xh).forEach((t=>{Zh[t]=!0}));const ed=(t,e)=>{var i,s;return t===e||!P(t)&&!P(e)&&t.value===e.value&&(null===(i=t.axis)||void 0===i?void 0:i.id)===(null===(s=e.axis)||void 0===s?void 0:s.id)},id=(t,e,i,s)=>{var n;const r=td(e.getScale().type),a=[],o=e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes);for(const l of o)if(l.coordinate===i){const i=Ra(s(l)),o=null===(n=l.getViewData())||void 0===n?void 0:n.latestData;if(i&&o)if(r){const e=[],s=[];o.forEach(((n,r)=>{var a;(null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())&&(e.push(n),s.push(r))})),a.push({series:l,datum:e,key:sd(l,s)})}else if(M(i[1])){const e=[],s=[];o.forEach(((n,r)=>{var a;((null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())||M(n[i[0]])&&M(n[i[1]])&&t>=n[i[0]]&&t{if(M(e[i[0]])){const a=e[i[0]]-t;a>=n[0]&&a<=n[1]&&(r.push(e),h.push(s))}}));else{let e=1/0,s=0;o.forEach(((n,a)=>{if(M(n[i[0]])){const o=Math.abs(n[i[0]]-t),l=Math.sign(n[i[0]]-t);o`${t.id}_${e.join("_")}`,nd=(t,e,i)=>{const s=t.getAllComponents().filter((s=>"axes"===s.specKey&&e(s)&&((t,e,i)=>{const s=t.getRegionsInIds(Ra(e.layout.layoutBindRegionID));return null==s?void 0:s.some((t=>{const e=t.getLayoutRect(),s=t.getLayoutStartPoint();return((t,e,i)=>t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y)(i,{x:s.x,y:s.y},{x:e.width+s.x,y:e.height+s.y})}))})(t,s,i)));return s.length?s:null};function rd(t,e,i,s){let n,r,a=-1;t.forEach((t=>{n=e(t),r=i(t),!P(n)&&(n=+n)>=n&&!P(r)&&(r=+r)>=r&&s(n,r,++a)}))}function ad(t,e,i,s,n){let r=0,a=0;return rd(t,e,i,((t,e)=>{const i=e-n(t),o=e-s;r+=i*i,a+=o*o})),1-r/a}const od=1e-10,ld=1e-10;function hd(t,e,i=ld,s=od){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function dd(t,e,i,s){return t>e&&!hd(t,e,i,s)}function cd(t,e,i,s){return te?1:t>=e?0:NaN}function pd(t){return Number(t)}const gd=hd;function md(t,e){const i=[];return t.forEach((t=>{const s=+t[e];Wo(s)&&i.push(s)})),0===i.length?null:Fa(i)}function _d(t,e){const i=[];return t.forEach((t=>{const s=+t[e];Wo(s)&&i.push(s)})),0===i.length?null:Ba(i)}function fd(t,e){return t.reduce(((t,i)=>{const s=e?+i[e]:+i;return Wo(s)&&(t+=s),t}),0)}function vd(t,e){let i=0,s=0;return t.forEach((t=>{const n=e?+t[e]:+t;Wo(n)&&(i+=n,s++)})),i/s}function yd(t,e){const i=vd(t,e);return t.length<=1?0:t.reduce(((t,s)=>t+(e?+s[e]:+s-i)**2),0)/(t.length-1)}function bd(t,e){const i=xd(t),s=xd(e),n=Math.asin((t.x*e.y-e.x*t.y)/i/s),r=Math.acos((t.x*e.x+t.y*e.y)/i/s);return n<0?-r:r}function xd(t,e={x:0,y:0}){return ae.distancePP(t,e)}const Sd=(t,e)=>{if(!t)return null;const i=nd(t,(t=>"angle"===t.getOrient()),e),s=nd(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&td(i.type)){const l=i.domain(),h=i.range(),d=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-d.x,y:o-t.getLayoutStartPoint().y-d.y};let u=bd({x:1,y:0},c);u=((t,e)=>{const i=2*Math.PI,s=Fa(e),n=Ba(e);return tn&&(t-=Math.ceil((t-n)/i)*i),t})(u,h);const p=xd(c),g=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==g?void 0:g.range();if((u-(null==h?void 0:h[0]))*(u-(null==h?void 0:h[1]))>0||(p-(null==m?void 0:m[0]))*(p-(null==m?void 0:m[1]))>0)return;const _=t.invert(u);if(P(_))return;let f=l.findIndex((t=>(null==t?void 0:t.toString())===_.toString()));f<0&&(f=void 0);const v=id(_,t,"polar",r);n.push({index:f,value:_,position:i.scale(_),axis:t,data:v})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&td(s.type)){const h=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let c=bd({x:1,y:0},d);c<-Math.PI/2&&(c=2*Math.PI+c);const u=xd(d),p=null===(e=i[0])||void 0===e?void 0:e.getScale(),g=null==p?void 0:p.range();if((c-(null==g?void 0:g[0]))*(c-(null==g?void 0:g[1]))>0||(u-(null==l?void 0:l[0]))*(u-(null==l?void 0:l[1]))>0)return;const m=s.invert(u);if(P(m))return;let _=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));_<0&&(_=void 0);const f=id(m,t,"polar",r);n.push({index:_,value:m,position:s.scale(m),axis:t,data:f})}})),n.length?n:null};function Md(t){return"bottom"===t||"top"===t}function kd(t){return"left"===t||"right"===t}function Ad(t){return"z"===t}function wd(t,e){return Qo(t.orient)||e&&e.includes(t.orient)?t.orient:"left"}function Td(t){return"top"===t||"bottom"===t?"horizontal":"vertical"}function Cd(t,e){var i;const s=null!==(i=t.type)&&void 0!==i?i:function(t,e){return e?Md(t)?"linear":"band":Md(t)?"band":"linear"}(t.orient,e);return{axisType:s,componentName:`${r.cartesianAxis}-${s}`}}const Ld=t=>t.fieldX[0],Ed=t=>t.fieldY[0],Pd=t=>{var e;return[t.fieldX[0],null!==(e=t.fieldX2)&&void 0!==e?e:t.fieldX[1]]},Dd=t=>{var e;return[t.fieldY[0],null!==(e=t.fieldY2)&&void 0!==e?e:t.fieldY[1]]},Od=(t,e)=>t?e?Ld:Pd:e?Ed:Dd,Rd=(t,e,i)=>{var s,n;if(!t)return null;const{x:r,y:a}=e,o=null!==(s=nd(t,(t=>Md(t.getOrient())),e))&&void 0!==s?s:[],l=null!==(n=nd(t,(t=>kd(t.getOrient())),e))&&void 0!==n?n:[];if(!o.length&&!l.length)return null;const h=new Set,d=new Set,c=new Set;[o,l].forEach((t=>t.forEach((t=>{td(t.getScale().type)?h.add(t):d.add(t),i&&t.getSpec().hasDimensionTooltip&&c.add(t)}))));const u=[],p=t=>{const e="x"===t,i=e?r:a;(e?o:l).forEach((t=>{if(c.size>0){if(c.has(t)){const s=Id(t,i,Od(e,td(t.getScale().type)));s&&u.push(s)}}else{const s=h.size>0;if((s?h:d).has(t)){const n=Id(t,i,Od(e,s));n&&u.push(n)}}}))};return"horizontal"===t.getSpec().direction?(p("y"),0===u.length&&p("x")):(p("x"),0===u.length&&p("y")),u.length?u:null},Id=(t,e,i)=>{const s=t.positionToData(e,!0);return P(s)?null:Bd(t,s,i)},Bd=(t,e,i)=>{const s=t.getScale();if(P(e))return null;let n=s.domain().findIndex((t=>(null==t?void 0:t.toString())===e.toString()));n<0&&(n=void 0);const r=id(e,t,"cartesian",null!=i?i:Md(t.getOrient())?Ld:Ed);return{index:n,value:e,position:s.scale(e),axis:t,data:r}};class Fd{constructor(t,e){this._eventDispatcher=t,this._mode=e}get chart(){var t,e;return this._chart||(this._chart=null===(e=(t=this._eventDispatcher.globalInstance).getChart)||void 0===e?void 0:e.call(t)),this._chart}register(t,e){var i,s;(null!==(s=null===(i=this.chart)||void 0===i?void 0:i.getOption().onError)&&void 0!==s?s:gl)("Method not implemented.")}unregister(){var t,e;(null!==(e=null===(t=this.chart)||void 0===t?void 0:t.getOption().onError)&&void 0!==e?e:gl)("Method not implemented.")}getTargetDimensionInfo(t,e){var i,s;const n=null!==(i=Rd(this.chart,{x:t,y:e}))&&void 0!==i?i:[],r=null!==(s=Sd(this.chart,{x:t,y:e}))&&void 0!==s?s:[],a=[].concat(n,r);return 0===a.length?null:a}dispatch(t,e){var i;const s=null===(i=this.chart)||void 0===i?void 0:i.getAllComponents().filter((t=>"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t)))),n=s.filter((t=>td(t.getScale().type))),r=n.length?n:s.filter((t=>{const e=t.getOrient();return Md(e)||"angle"===e})),a=[];return r.forEach((e=>{const i=Bd(e,t);i&&a.push(i)})),this._callback.call(null,{action:"enter",dimensionInfo:a}),a}}const Yd=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];var jd,Hd,zd;!function(t){t.initialized="initialized",t.rendered="rendered",t.renderFinished="renderFinished",t.animationFinished="animationFinished",t.regionSeriesDataFilterOver="regionSeriesDataFilterOver",t.afterInitData="afterInitData",t.afterInitEvent="afterInitEvent",t.afterInitMark="afterInitMark",t.rawDataUpdate="rawDataUpdate",t.viewDataFilterOver="viewDataFilterOver",t.viewDataUpdate="viewDataUpdate",t.viewDataStatisticsUpdate="viewDataStatisticsUpdate",t.markDeltaYUpdate="markDeltaYUpdate",t.viewDataLabelUpdate="viewDataLabelUpdate",t.scaleDomainUpdate="scaleDomainUpdate",t.scaleUpdate="scaleUpdate",t.dataZoomChange="dataZoomChange",t.drill="drill",t.layoutStart="layoutStart",t.layoutEnd="layoutEnd",t.layoutRectUpdate="layoutRectUpdate",t.playerPlay="playerPlay",t.playerPause="playerPause",t.playerEnd="playerEnd",t.playerChange="playerChange",t.playerForward="playerForward",t.playerBackward="playerBackward",t.scrollBarChange="scrollBarChange",t.brushStart="brushStart",t.brushChange="brushChange",t.brushEnd="brushEnd",t.brushClear="brushClear",t.legendSelectedDataChange="legendSelectedDataChange",t.legendFilter="legendFilter",t.legendItemClick="legendItemClick",t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.tooltipShow="tooltipShow",t.tooltipHide="tooltipHide",t.tooltipRelease="tooltipRelease",t.afterResize="afterResize",t.afterRender="afterRender",t.afterLayout="afterLayout"}(jd||(jd={})),function(t){t.chart="chart",t.window="window",t.canvas="canvas"}(Hd||(Hd={})),function(t){t.vchart="vchart",t.chart="chart",t.model="model",t.mark="mark"}(zd||(zd={}));const Nd={[Kh.dimensionHover]:class extends Fd{constructor(){super(...arguments),this._cacheDimensionInfo=null,this.onMouseMove=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);null===s&&null!==this._cacheDimensionInfo?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo.slice()})),this._cacheDimensionInfo=s):null===s||null!==this._cacheDimensionInfo&&s.length===this._cacheDimensionInfo.length&&!s.some(((t,e)=>!ed(t,this._cacheDimensionInfo[e])))?null!==s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"move",dimensionInfo:s.slice()})):(this._callback.call(null,Object.assign(Object.assign({},t),{action:"enter",dimensionInfo:s.slice()})),this._cacheDimensionInfo=s)},this.onMouseOut=t=>{t&&(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo?this._cacheDimensionInfo.slice():[]})),this._cacheDimensionInfo=null)}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:Hd.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:Hd.canvas}),callback:this.onMouseOut}),cl(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:Hd.chart}),callback:this.onMouseMove})}unregister(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),cl(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}},[Kh.dimensionClick]:class extends Fd{constructor(){super(...arguments),this.onClick=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"click",dimensionInfo:s.slice()}))}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:Hd.chart}),callback:this.onClick})}unregister(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}};class Vd{getComposedEventMap(){return this._composedEventMap}constructor(t,e){this._composedEventMap=new Map,this._eventDispatcher=t,this._mode=e}on(t,e,i){const s="function"==typeof e?{query:null,callback:e}:{query:e,callback:i};if(Nd[t]){const e=new Nd[t](this._eventDispatcher,this._mode);e.register(t,s),this._composedEventMap.set(i,{eventType:t,event:e})}else this._eventDispatcher.register(t,s);return this}off(t,e,i){var s,n;const r=null!=i?i:e;if(Nd[t])if(r)null===(s=this._composedEventMap.get(r))||void 0===s||s.event.unregister(),this._composedEventMap.delete(r);else for(const e of this._composedEventMap.entries())e[1].eventType===t&&(null===(n=this._composedEventMap.get(e[0]))||void 0===n||n.event.unregister(),this._composedEventMap.delete(e[0]));else if(r){const i={callback:r,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,i)}else this._eventDispatcher.unregister(t);return this}emit(t,e,i){return this._eventDispatcher.dispatch(t,e,i),this}prevent(t,e){return this._eventDispatcher.prevent(t,e),this}allow(t){return this._eventDispatcher.allow(t),this}release(){this._eventDispatcher.clear(),this._composedEventMap.clear()}}class Wd{constructor(){this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(zd.vchart,[]),this._levelNodes.set(zd.chart,[]),this._levelNodes.set(zd.model,[]),this._levelNodes.set(zd.mark,[])}addHandler(t,e){var i;const s={level:e,handler:t};return null===(i=this._levelNodes.get(e))||void 0===i||i.push(s),this._map.set(t.callback,s),this}removeHandler(t){const e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);const i=this._levelNodes.get(e.level),s=null==i?void 0:i.findIndex((e=>e.handler.callback===t.callback));return void 0!==s&&s>=0&&(null==i||i.splice(s,1)),this}preventHandler(t){return t&&(t.prevented=!0),this}allowHandler(t){return t&&(t.prevented=!1),this}getHandlers(t){var e;return(null===(e=this._levelNodes.get(t))||void 0===e?void 0:e.map((t=>t.handler)))||[]}getAllHandlers(){return Array.from(this._map.values()).map((t=>t.handler))||[]}getCount(){return this._map.size}release(){this._map.clear(),this._levelNodes.clear()}}const Gd=(t,e,i)=>{const s=S(e)?e.split("."):e;for(let e=0;e{pc._transforms[t]&&!pc._transforms[t].isBuiltIn&&(pc._transforms[t]=null)}))}static registerGrammar(t,e,i){pc._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=pc._grammars[t])||void 0===s?void 0:s.grammarClass;return n?new n(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return pc._glyphs[t]}static createInteraction(t,e,i){const s=pc._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!pc._interactions[t]}}pc._plotMarks={},pc._marks={},pc._components={},pc._graphicComponents={},pc._transforms={},pc._grammars={},pc._glyphs={},pc._animations={},pc._interactions={},pc._graphics={},pc._stageEventPlugins={},pc.registerGlyph=(t,e,i,s,n)=>(pc._glyphs[t]=new uc(e,i,s,n),pc._glyphs[t]),pc.registerAnimationType=(t,e)=>{pc._animations[t]=e},pc.getAnimationType=t=>pc._animations[t],pc.registerInteraction=(t,e)=>{pc._interactions[t]=e},pc.registerGraphic=(t,e)=>{pc._graphics[t]=e},pc.getGraphicType=t=>pc._graphics[t],pc.createGraphic=(t,e)=>{const i=pc._graphics[t];return i?i(e):null},pc.registerDefaultLayout=t=>{pc.defaultLayout=t},pc.getDefaultLayout=()=>pc.defaultLayout,pc.registerStageEventPlugin=(t,e)=>{pc._stageEventPlugins[t]=e},pc.getStageEventPlugin=t=>pc._stageEventPlugins[t];const gc={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend",label:"label",markLine:"markLine",markArea:"markArea",markPoint:"markPoint",polarMarkLine:"polarMarkLine",polarMarkArea:"polarMarkArea",polarMarkPoint:"polarMarkPoint",geoMarkPoint:"geoMarkPoint"};class mc{constructor(t,e){this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this._onDelegate=t=>{var e;const i=this.globalInstance.getChart(),s=M(t.modelId)&&(null==i?void 0:i.getModelById(t.modelId))||void 0,n=M(t.markId)&&(null==i?void 0:i.getMarkById(t.markId))||null,r=new Map;let a=null===(e=t.item)||void 0===e?void 0:e.mark;for(a&&M(a.id())&&r.set(a.id(),t.item);null==a?void 0:a.elements;){const t=a.id();M(t)&&!r.has(t)&&r.set(t,a.elements[0]),a=a.group}const o={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:r,chart:i,model:s,mark:null!=n?n:void 0,node:Gd(t.event,"target")};this.dispatch(t.type,o)},this._onDelegateInteractionEvent=t=>{const e=this.globalInstance.getChart(),i=t.event;let s=null;i.elements&&(s=i.elements);const n={event:t.event,chart:e,items:s,datums:s&&s.map((t=>t.getDatum()))};this.dispatch(t.type,n)},this.globalInstance=t,this._compiler=e}register(t,e){var i,s,n,r,a;this._parseQuery(e);const o=this.getEventBubble((null===(i=e.filter)||void 0===i?void 0:i.source)||Hd.chart),l=this.getEventListeners((null===(s=e.filter)||void 0===s?void 0:s.source)||Hd.chart);if(o.get(t)||o.set(t,new Wd),o.get(t).addHandler(e,null===(n=e.filter)||void 0===n?void 0:n.level),this._isValidEvent(t)&&!l.has(t)){const i=this._onDelegate.bind(this);this._compiler.addEventListener(null===(r=e.filter)||void 0===r?void 0:r.source,t,i),l.set(t,i)}else if(this._isInteractionEvent(t)&&!l.has(t)){const i=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null===(a=e.filter)||void 0===a?void 0:a.source,t,i),l.set(t,i)}return this}unregister(t,e){var i,s,n,r;let a=!1;const o=this.getEventBubble((null===(i=null==e?void 0:e.filter)||void 0===i?void 0:i.source)||Hd.chart),l=this.getEventListeners((null===(s=null==e?void 0:e.filter)||void 0===s?void 0:s.source)||Hd.chart);if(e){const i=o.get(t);null==i||i.removeHandler(e),0===(null==i?void 0:i.getCount())&&(null==i||i.release(),o.delete(t),a=!0),(null===(n=null==e?void 0:e.wrappedCallback)||void 0===n?void 0:n.cancel)&&e.wrappedCallback.cancel()}else{const e=o.get(t);null==e||e.release(),o.delete(t),a=!0}if(a&&this._isValidEvent(t)){const i=l.get(t);this._compiler.removeEventListener((null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.source)||Hd.chart,t,i),l.delete(t)}return this}dispatch(t,e,i){const s=this.getEventBubble(e.source||Hd.chart).get(t);if(!s)return this;let n=!1;if(i){const r=s.getHandlers(i);n=this._invoke(r,t,e)}else{const i=[zd.mark,zd.model,zd.chart,zd.vchart];let r=0;for(;!n&&r{const s=this.getEventBubble(i).get(t);s&&s.getAllHandlers().forEach((t=>{e&&t.callback===e||s.preventHandler(t)}))})),this}allow(t){return["canvas","chart","window"].forEach((e=>{const i=this.getEventBubble(e).get(t);i&&i.getAllHandlers().forEach((t=>i.allowHandler(t)))})),this}clear(){[Hd.chart,Hd.window,Hd.canvas].forEach((t=>{const e=this.getEventListeners(t);for(const i of e.entries())this._compiler.removeEventListener(t,i[0],i[1]);e.clear()})),[this._viewBubbles,this._windowBubbles,this._canvasBubbles].forEach((t=>{for(const e of t.values())e.release();t.clear()}))}release(){this.clear(),this.globalInstance=null,this._compiler=null}_filter(t,e,i){var s,n,r;if(rs(t.filter)&&!t.filter(i))return!1;if(t.nodeName&&Gd(i,"node.name")!==t.nodeName)return!1;if(t.markName&&(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.name)!==t.markName)return!1;let a=null===(n=i.model)||void 0===n?void 0:n.type;return gc[a]&&(a=gc[a]),!(t.type&&a!==t.type||"mark"===t.level&&!t.type&&!(null==i?void 0:i.mark)||"model"===t.level&&!t.type&&!(null==i?void 0:i.model)||M(t.userId)&&(null===(r=i.model)||void 0===r?void 0:r.userId)!==t.userId)}_prepareParams(t,e){if(t.markName&&e.mark&&e.itemMap){const t=e.mark.getProductId(),i=e.itemMap.get(t),s=null==i?void 0:i.getDatum();return Object.assign(Object.assign({},e),{item:i,datum:s})}return Object.assign({},e)}_invoke(t,e,i){return t.map((t=>{var s,n,r;const a=t.filter;if(!t.prevented&&(!t.query||this._filter(a,e,i))){const e=(t.wrappedCallback||t.callback).call(null,this._prepareParams(a,i)),o=null!=e?e:null===(s=t.query)||void 0===s?void 0:s.consume;return o&&(null===(n=i.event)||void 0===n||n.stopPropagation(),null===(r=i.event)||void 0===r||r.preventDefault()),!!o}})).some((t=>!0===t))}_getQueryLevel(t){return t?t.level?t.level:M(t.id)?zd.model:zd.vchart:zd.vchart}_parseQuery(t){var e;const i=t.query;(null==i?void 0:i.throttle)?t.wrappedCallback=Ud(t.callback,i.throttle):(null==i?void 0:i.debounce)&&(t.wrappedCallback=Uo(t.callback,i.debounce));let s=this._getQueryLevel(i),n=null,r=Hd.chart,a=null,o=null,l=null;return(null==i?void 0:i.nodeName)&&(a=i.nodeName),(null==i?void 0:i.markName)&&(o=i.markName),!(null==i?void 0:i.type)||s!==zd.model&&s!==zd.mark||(n=i.type),(null==i?void 0:i.source)&&(r=i.source),M(null==i?void 0:i.id)&&(l=null==i?void 0:i.id,s=zd.model),t.filter={level:s,markName:o,type:n,source:r,nodeName:a,userId:l,filter:null!==(e=null==i?void 0:i.filter)&&void 0!==e?e:null},t}getEventBubble(t){switch(t){case Hd.chart:return this._viewBubbles;case Hd.window:return this._windowBubbles;case Hd.canvas:return this._canvasBubbles;default:return this._viewBubbles}}getEventListeners(t){switch(t){case Hd.chart:return this._viewListeners;case Hd.window:return this._windowListeners;case Hd.canvas:return this._canvasListeners;default:return this._viewListeners}}_isValidEvent(t){return Yd.includes(t)||Object.values(rc).includes(t)}_isInteractionEvent(t){let e;return t&&(e=t.split(":")[0],e)&&pc.hasInteraction(e)}}function _c(t){return t}function fc(t,e){t&&yc.hasOwnProperty(t.type)&&yc[t.type](t,e)}var vc={Feature:function(t,e){fc(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,s=-1,n=i.length;++s0?1:t<0?-1:0},Vc=Math.sqrt,Wc=Math.tan;function Gc(t){return t>1?0:t<-1?Cc:Math.acos(t)}function Uc(t){return t>1?Lc:t<-1?-Lc:Math.asin(t)}function $c(){}var Kc,Xc,qc,Zc,Jc=Mc(),Qc=Mc(),tu={point:$c,lineStart:$c,lineEnd:$c,polygonStart:function(){tu.lineStart=eu,tu.lineEnd=nu},polygonEnd:function(){tu.lineStart=tu.lineEnd=tu.point=$c,Jc.add(Rc(Qc)),Qc.reset()},result:function(){var t=Jc/2;return Jc.reset(),t}};function eu(){tu.point=iu}function iu(t,e){tu.point=su,Kc=qc=t,Xc=Zc=e}function su(t,e){Qc.add(Zc*t-qc*e),qc=t,Zc=e}function nu(){su(Kc,Xc)}const ru=tu;var au=1/0,ou=au,lu=-au,hu=lu,du={point:function(t,e){tlu&&(lu=t),ehu&&(hu=e)},lineStart:$c,lineEnd:$c,polygonStart:$c,polygonEnd:$c,result:function(){var t=[[au,ou],[lu,hu]];return lu=hu=-(ou=au=1/0),t}};const cu=du;var uu,pu,gu,mu,_u=0,fu=0,vu=0,yu=0,bu=0,xu=0,Su=0,Mu=0,ku=0,Au={point:wu,lineStart:Tu,lineEnd:Eu,polygonStart:function(){Au.lineStart=Pu,Au.lineEnd=Du},polygonEnd:function(){Au.point=wu,Au.lineStart=Tu,Au.lineEnd=Eu},result:function(){var t=ku?[Su/ku,Mu/ku]:xu?[yu/xu,bu/xu]:vu?[_u/vu,fu/vu]:[NaN,NaN];return _u=fu=vu=yu=bu=xu=Su=Mu=ku=0,t}};function wu(t,e){_u+=t,fu+=e,++vu}function Tu(){Au.point=Cu}function Cu(t,e){Au.point=Lu,wu(gu=t,mu=e)}function Lu(t,e){var i=t-gu,s=e-mu,n=Vc(i*i+s*s);yu+=n*(gu+t)/2,bu+=n*(mu+e)/2,xu+=n,wu(gu=t,mu=e)}function Eu(){Au.point=wu}function Pu(){Au.point=Ou}function Du(){Ru(uu,pu)}function Ou(t,e){Au.point=Ru,wu(uu=gu=t,pu=mu=e)}function Ru(t,e){var i=t-gu,s=e-mu,n=Vc(i*i+s*s);yu+=n*(gu+t)/2,bu+=n*(mu+e)/2,xu+=n,Su+=(n=mu*t-gu*e)*(gu+t),Mu+=n*(mu+e),ku+=3*n,wu(gu=t,mu=e)}const Iu=Au;function Bu(t){this._context=t}Bu.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Pc)}},result:$c};var Fu,Yu,ju,Hu,zu,Nu=Mc(),Vu={point:$c,lineStart:function(){Vu.point=Wu},lineEnd:function(){Fu&&Gu(Yu,ju),Vu.point=$c},polygonStart:function(){Fu=!0},polygonEnd:function(){Fu=null},result:function(){var t=+Nu;return Nu.reset(),t}};function Wu(t,e){Vu.point=Gu,Yu=Hu=t,ju=zu=e}function Gu(t,e){Hu-=t,zu-=e,Nu.add(Vc(Hu*Hu+zu*zu)),Hu=t,zu=e}const Uu=Vu;function $u(){this._string=[]}function Ku(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Xu(t,e){var i,s,n=4.5;function r(t){return t&&("function"==typeof n&&s.pointRadius(+n.apply(this,arguments)),Sc(t,i(s))),s.result()}return r.area=function(t){return Sc(t,i(ru)),ru.result()},r.measure=function(t){return Sc(t,i(Uu)),Uu.result()},r.bounds=function(t){return Sc(t,i(cu)),cu.result()},r.centroid=function(t){return Sc(t,i(Iu)),Iu.result()},r.projection=function(e){return arguments.length?(i=null==e?(t=null,_c):(t=e).stream,r):t},r.context=function(t){return arguments.length?(s=null==t?(e=null,new $u):new Bu(e=t),"function"!=typeof n&&s.pointRadius(n),r):e},r.pointRadius=function(t){return arguments.length?(n="function"==typeof t?t:(s.pointRadius(+t),+t),r):n},r.projection(t).context(e)}function qu(t){var e={type:"Feature"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"properties":case"geometry":return;default:e[i]=t[i]}})),e.properties=Zu(t.properties),e.geometry=Ju(t.geometry),e}function Zu(t){var e={};return t?(Object.keys(t).forEach((function(i){var s=t[i];"object"==typeof s?null===s?e[i]=null:Array.isArray(s)?e[i]=s.map((function(t){return t})):e[i]=Zu(s):e[i]=s})),e):e}function Ju(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return Ju(t)})),e):(e.coordinates=Qu(t.coordinates),e)}function Qu(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return Qu(t)}))}$u.prototype={_radius:4.5,_circle:Ku(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Ku(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var tp=6371008.8,ep={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*tp,kilometers:6371.0088,kilometres:6371.0088,meters:tp,metres:tp,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:tp/1852,radians:1,yards:6967335.223679999};function ip(t,e,i){void 0===i&&(i={});var s={type:"Feature"};return(0===i.id||i.id)&&(s.id=i.id),i.bbox&&(s.bbox=i.bbox),s.properties=e||{},s.geometry=t,s}function sp(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function np(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function rp(t){for(var e,i,s=np(t),n=0,r=1;r0}function ap(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i is required");if("boolean"!=typeof s)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return qu(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"features":return;default:e[i]=t[i]}})),e.features=t.features.map((function(t){return qu(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return Ju(t);default:throw new Error("unknown GeoJSON type")}}(t));var r=[];switch(t.type){case"GeometryCollection":return op(t,(function(t){lp(t,s)})),t;case"FeatureCollection":return ap(t,(function(t){ap(lp(t,s),(function(t){r.push(t)}))})),sp(r)}return lp(t,s)},up=function(t){if(!t)throw new Error("geojson is required");var e=[];return function(t,e){op(t,(function(t,i,s,n,r){var a,o=null===t?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return!1!==e(ip(t,s,{bbox:n,id:r}),i,0)&&void 0}switch(o){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l{if(t.geometry.type.startsWith("Multi")){const e=up(t).features[0];return Object.assign(Object.assign({},e),e.properties)}return Object.assign(Object.assign({},t),t.properties)},_p=(t,e={},i)=>{i.type=Il.GEO;const s=Hl(gp,e),{centroid:n,name:r,bbox:a,rewind:o}=s;if(Array.isArray(t))return(t=>{const e=[];return t.forEach((t=>{"FeatureCollection"===t.type?t.features.forEach((t=>{e.push(mp(t))})):e.push(mp(t))})),e})(t);let l=t.features;return o&&(l=cp(t,{reverse:!ns(o)||o.reverse}).features),l.forEach((t=>{if(n){const e=pp.centroid(t);t.centroidX=e[0],t.centroidY=e[1]}if(r&&(t.name=t.properties.name),a){const e=pp.bounds(t);t.bbox=e}})),t.features=l,t};function fp(t){return t}function vp(t,e){var i=e.id,s=e.bbox,n=null==e.properties?{}:e.properties,r=function(t,e){var i=function(t){if(null==t)return fp;var e,i,s=t.scale[0],n=t.scale[1],r=t.translate[0],a=t.translate[1];return function(t,o){o||(e=i=0);var l=2,h=t.length,d=new Array(h);for(d[0]=(e+=t[0])*s+r,d[1]=(i+=t[1])*n+a;l{i.type=Il.GEO;const s=Hl(gp,yp,e),{object:n}=s;if(!S(n))throw new TypeError("Invalid object: must be a string!");const r=(a=t,"string"==typeof(o=t.objects[n])&&(o=a.objects[o]),"GeometryCollection"===o.type?{type:"FeatureCollection",features:o.geometries.map((function(t){return vp(a,t)}))}:vp(a,o));var a,o;return _p(r,s,i)};var xp=i(4028),Sp=i.n(xp);const Mp={tolerance:.01},kp=(t,e)=>{const i=Hl(Mp,e),{tolerance:s}=i;return Sp()(t,s)};function Ap(t,e,i){t.getTransform(e)||t.registerTransform(e,i)}function wp(t,e,i){t.getParser(e)||t.registerParser(e,i)}const Tp=new Map;let Cp;function Lp(){Cp||(Cp=new f,wp(Cp,"geojson",_p),wp(Cp,"topojson",bp),Ap(Cp,"simplify",kp))}function Ep(t,e,i={type:"geojson",centroid:!0}){Tp.has(t)&&pl(`map type of '${t}' already exists, will be overwritten.`),Lp();const s=new R(Cp),n=E({},{centroid:!0,simplify:!1},i);"topojson"===i.type?s.parse(e,{type:"topojson",options:n}):s.parse(e,{type:"geojson",options:n});const{simplify:r}=i;!0===r?s.transform({type:"simplify"}):ns(r)&&s.transform({type:"simplify",options:r}),Tp.set(t,s)}function Pp(t){Tp.has(t)?Tp.delete(t):pl(`map type of '${t}' does not exists.`)}function Dp(t,e=!1){let i=e;return t.latestData instanceof R&&(i=!1),i?k(t.latestData):t.latestData&&t.latestData.slice()}const Op=(t,e)=>0===t.length?[]:1===t.length?Dp(t[0],null==e?void 0:e.deep):t.map((t=>Dp(t,null==e?void 0:e.deep)));function Rp(t,e,i){Ap(e=e instanceof f?e:t.dataSet,"copyDataView",Op);const s=new R(e,i);return s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView",level:Fp.copyDataView}),s}function Ip(t,e,i=[],s={}){var n,r,a;if(t instanceof R)return t;const{id:o,values:l=[],fromDataIndex:h,fromDataId:d,transforms:c=[]}=t,u=t.parser?k(t.parser):{clone:!0},p=k(t.fields);let g;u.clone=!(!1===u.clone);const m=i.find((t=>t.name===o));if(m)g=m;else{const t={name:o};if(p&&(t.fields=p),g=new R(e,t),"string"==typeof d){const t=i.find((t=>t.name===d));if(!t)return(null!==(n=s.onError)&&void 0!==n?n:gl)(`no data matches fromDataId ${d}`),null;g.parse([t],{type:"dataview"}),g.transform({type:"copyDataView"})}else if("number"==typeof h){const t=i[h];if(!t)return(null!==(r=s.onError)&&void 0!==r?r:gl)(`no data matches fromDataIndex ${h}`),null;g.parse([t],{type:"dataview"}),g.transform({type:"copyDataView"})}else Array.isArray(l)?g.parse(l,u):!S(l)||u&&!["csv","dsv","tsv"].includes(u.type)?(g.parse([]),pl("values should be array")):g.parse(l,null!==(a=u)&&void 0!==a?a:{type:"csv"});c&&c.length&&c.forEach((t=>{e.getTransform(t.type)&&g.transform(t)}))}return g}function Bp(t,e,i){t&&(e.fields&&t.setFields(e.fields,i),t.parseNewData(e.values,e.parser))}var Fp,Yp;function jp(t,e){return Ra(t).reduce(((t,i)=>{const s=S(i)?e.getGrammarById(i):i;return s&&t.push(s),t}),[])}function Hp(t,e){if(P(t))return[];if(!rs(i=t)&&(null==i?void 0:i.signal)){const i=t.signal;if(S(i))return Ra(e.getGrammarById(i));if("signal"===(null==i?void 0:i.grammarType))return[i]}else if(function(t){return!rs(t)&&!!(null==t?void 0:t.callback)}(t))return jp(t.dependency,e);var i;return[]}function zp(t){return rs(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function Np(t,e,i,s){if(P(t))return t;if(rs(t))return s?t.call(null,i,s,e):t.call(null,i,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?s?t.callback.call(null,i,s,e):t.callback.call(null,i,e):t}function Vp(t,e){return Wp(t)?t.output():e[t]}!function(t){t[t.copyDataView=-10]="copyDataView",t[t.treemapFilter=-8]="treemapFilter",t[t.treemapFlatten=-7]="treemapFlatten",t[t.dotObjFlat=-7]="dotObjFlat",t[t.linkDotInfo=-7]="linkDotInfo",t[t.sankeyLayout=-7]="sankeyLayout",t[t.dataZoomFilter=-6]="dataZoomFilter",t[t.legendFilter=-5]="legendFilter"}(Fp||(Fp={})),function(t){t.appear="appear",t.disappear="disappear",t.enter="enter",t.update="update",t.state="state",t.exit="exit",t.normal="normal",t.none="none"}(Yp||(Yp={}));const Wp=t=>t&&!P(t.grammarType),Gp=t=>rs(t)?t:e=>e[t],Up=(t,e)=>Wp(t)?t.output():t&&ns(t)?rs(t.callback)?i=>t.callback(i,e):rs(t.value)?t.value(e):t:t,$p=(t,e)=>t?ns(t)?Object.keys(t).reduce(((i,s)=>{const n=t[s];return i[s]=Up(n,e),i}),{}):t.map((t=>Up(t,e))):t;let Kp=-1;class Xp extends(o()){constructor(t){super(),this.spec={},this.references=new Map,this.targets=[],this.transforms=[],this.view=t,this.uid=++Kp}parse(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}depend(t){var e;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){const t=Ra(this.spec.dependency).map((t=>S(t)?this.view.getGrammarById(t):t));this.detach(t)}this.spec.dependency=t;const i=Ra(t).map((t=>S(t)?this.view.getGrammarById(t):t));return this.attach(i),this.commit(),this}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}emit(t,...e){var i,s;return null===(s=null===(i=this.view)||void 0===i?void 0:i.emit)||void 0===s||s.call(i,t,...e),super.emit(t,...e)}emitGrammarEvent(t,...e){return super.emit(t,...e)}evaluateTransform(t,e,i){if(!t||!t.length)return e;let s=e,n=0;const r=t.length;for(;n!P(t))).forEach((i=>{var s;P(t)||(i.targets.includes(this)||i.targets.push(this),this.references.set(i,(null!==(s=this.references.get(i))&&void 0!==s?s:0)+e))})),this}detach(t,e=1){return Ra(t).filter((t=>!P(t))).forEach((t=>{const i=this.references.get(t)-e;i>0?this.references.set(t,i-1):(this.references.delete(t),t.targets.includes(this)&&(t.targets=t.targets.filter((t=>t!==this))))})),this}detachAll(){this.references.forEach(((t,e)=>{this.detach(e,t)}))}link(t){this.grammarSource=t}run(){var t;const e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}commit(){this.view.commit(this)}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}getSpec(){return this.spec}reuse(t){return this}clear(){this.spec=null,this.view=null}release(){this.clear()}setFunctionSpec(t,e){return P(this.spec[e])||this.detach(Hp(this.spec[e],this.view)),this.spec[e]=t,this.attach(Hp(t,this.view)),this.commit(),this}}const qp=(t,e,i)=>{var s,n;if("callback"===t&&rs(e))return{references:[],value:{callback:e,dependency:[]}};if(!P(e.data)){const t=i.getDataById(e.data);return{references:[t],value:t}}if(!P(e.customized)){const t=i.getCustomizedById(e.customized);return{references:[t],value:t}}if(!P(e.scale)){const t=i.getScaleById(e.scale);return{references:[t],value:t}}if((n=e)&&(n.signal||n.callback)){const t=Hp(e,i);return{references:t,value:e.callback?{value:e.callback,dependency:t}:null!==(s=null==t?void 0:t[0])&&void 0!==s?s:e}}return{value:e}},Zp=(t,e)=>{if(null==t?void 0:t.length){const i=[];let s=[];return t.forEach((t=>{var n;const r=((t,e)=>{const i=pc.getTransform(t.type);if(!i)return;const s={};let n=[];return Object.keys(t).forEach((i=>{var r;if("type"===i)return;const a=t[i];if("dependency"===i)return void((null==a?void 0:a.length)&&(n=n.concat(jp(a,e))));const o=((t,e,i)=>{if(P(e))return{value:e};if(y(e)){const s=e.map((e=>qp(t,e,i)));return{references:s.reduce(((t,e)=>(e.references&&t.concat(e.references),t)),[]),value:s.map((t=>t.value))}}return qp(t,e,i)})(i,a,e);o&&((null===(r=o.references)||void 0===r?void 0:r.length)&&(n=n.concat(o.references)),s[i]=o.value)})),{markPhase:i.markPhase,transform:i.transform,canProgressive:i.canProgressive,type:i.type,options:s,references:n}})(t,e);r&&((null===(n=r.references)||void 0===n?void 0:n.length)&&(s=s.concat(r.references)),i.push(r))})),{transforms:i,refs:s}}return null},Jp={csv:Gl,dsv:Wl,tsv:Ul,json:(t,e={},i)=>{if(!S(t))return Ra(t);try{return Ra(JSON.parse(t))}catch(t){return[]}}};class Qp extends Xp{constructor(t,e,i){super(t),this.grammarType="data",this.spec={},this._dataIDKey=`VGRAMMAR_DATA_ID_KEY_${this.uid}`,this._loadTasks=[],this._postFilters=[],this.ingest=t=>{const e=function(t,e){if(P(t))return t;if(rs(t))return t.call(null,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?t.callback.call(null,e):t}(t.format,this.parameters());return this._input=((t,e)=>{if(!e||!Jp[e.type])return Ra(t);const i="dsv"===e.type?{delimiter:e.delimiter}:{};return Jp[e.type](t,i,new R(new f))})(t.values,e),this._input},this.load=t=>{if(t.values)return this.ingest(t)},this.relay=t=>t[0],this._loadTasks=[],P(e)||this.values(e,i)}parse(t){return super.parse(t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}parseDataSource(t){const e=[],i=[],s=t.format?Hp(t.format,this.view)[0]:null;if(s&&e.push(s),t.values){const s=Hp(t.values,this.view)[0];s&&e.push(s),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){const n=Hp(t.url,this.view)[0];n&&e.push(n),i.push({type:"load",transform:this.load,options:{url:null!=n?n:t.url,format:null!=s?s:t.format}})}else if(t.source){const s=[];Ra(t.source).forEach((t=>{const i=Wp(t)?t:this.view.getDataById(t);i&&(e.push(i),s.push(i))})),s.length&&(i.push({type:"relay",transform:this.relay,options:s}),this.grammarSource=s[0])}return{transforms:i,refs:e}}evaluate(t,e){this.view.emit(rc.BEFORE_EVALUATE_DATA);const i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);const s=this.evaluateTransform(i,this._input,e),n=this._evaluateFilter(s,e);return this.setValues(n),this._isLoaded=!0,this.view.emit(rc.AFTER_EVALUATE_DATA),this}output(){return this._values}getDataIDKey(){return this._dataIDKey}values(t,e,i=!0){const s=Object.assign({},this.spec,{values:t,format:e});return P(t)||(s.url=void 0,s.source=void 0),i?this.parseLoad(s):this}url(t,e,i=!0){const s=Object.assign({},this.spec,{url:t,format:e});return P(t)||(s.values=void 0,s.source=void 0),i?this.parseLoad(s):this}source(t,e,i=!0){const s=Object.assign({},this.spec,{source:t,format:e});return P(t)||(s.values=void 0,s.url=void 0),i?this.parseLoad(s):this}parseLoad(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;const e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}setValues(t){this._values=Ra(t).map(((t,e)=>{const i=t===Object(t)?t:{data:t};return i[this._dataIDKey]=e,i}))}field(t){return this._values.map((e=>e[t]))}transform(t){const e=Zp(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;const i=Zp(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}getValue(){return this._values}getInput(){return this._input}addDataFilter(t){return this._postFilters=this._postFilters.concat(Ra(t)),this._postFilters.sort(((t,e)=>{var i,s;return(null!==(i=t.rank)&&void 0!==i?i:0)-(null!==(s=e.rank)&&void 0!==s?s:0)})),this}removeDataFilter(t){const e=Ra(t);return this._postFilters=this._postFilters.filter((t=>!e.includes(t))),this}_evaluateFilter(t,e){return this._postFilters.reduce(((t,i)=>i.filter(t,e)),t)}reuse(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}clear(){super.clear(),this._input=null,this._values=null}}function tg(t,e,i,s){let n,r;const a=t[e];for(;e>i&&(r=Math.floor((e-1)/2),n=t[r],a&&n&&s(a,n)<0);)t[e]=n,e=r;return t[e]=a}function eg(t,e,i,s){const n=e,r=null!=i?i:t.length,a=t[e];let o,l=2*e+1;for(;l=0&&(l=o),t[e]=t[l],l=2*(e=l)+1;return t[e]=a,tg(t,e,n,s)}class ig{constructor(t){this.compare=t,this.nodes=[]}size(){return this.nodes.length}last(){return this.nodes[0]}validate(){for(let t=this.nodes.length-1;t>0;t-=1){const e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}push(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);return tg(this.nodes,e,0,this.compare),eg(this.nodes,e,null,this.compare)}return this.nodes.push(t),tg(this.nodes,this.nodes.length-1,0,this.compare)}remove(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),tg(this.nodes,e,0,this.compare),eg(this.nodes,e,null,this.compare)}}pop(){const t=this.nodes.pop();let e;return this.nodes.length?(e=this.nodes[0],this.nodes[0]=t,eg(this.nodes,0,null,this.compare)):e=t,e}clear(){this.nodes=[]}}const sg=t=>t,ng=t=>0;class rg{constructor(t){this.list=[],this.ids={},this.idFunc=t||sg}add(t){const e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}remove(t){const e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter((e=>e!==t))),this}forEach(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}filter(t){return this.list.filter(t)}get length(){return this.list.length}getElementByIndex(t){return this.list[t]}}class ag{constructor(){this.grammars=[],this.logger=g.getInstance(),this._curRank=0,this._committed=new rg((t=>t.uid)),this._heap=new ig(((t,e)=>(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank))),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}add(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}remove(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter((e=>e!==t)))}_setRankOfGrammar(t){t&&(t.rank=++this._curRank)}_reRank(t){const e=[t];for(;e.length;){const i=e.pop();this._setRankOfGrammar(i);const s=i.targets;s&&s.forEach((i=>{e.push(i),i===t&&this.logger.error("Cycle detected in dataflow graph.")}))}}_enqueue(t){t&&(t.qrank=t.rank,this._heap.push(t))}_logGrammarRunInfo(t){if(this.logger.canLogError()){const e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce(((t,e,i)=>P(e.value)?t:`${t}${i?" , ":""}${e.key}: ${e.value}`),"");this.logger.debug("Run Operator: ",t,e)}}hasCommitted(){return!!this._committed.length}commit(t){return this._committed.add(t),this}_beforeEvaluate(){this.grammars.forEach((t=>{t.targets.some((e=>(null==e?void 0:e.rank)<(null==t?void 0:t.rank)))&&this._reRank(t)})),this._committed.forEach((t=>this._enqueue(t))),this._committed=new rg((t=>t.uid))}_enqueueTargets(t){t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach((t=>this._enqueue(t)))}evaluate(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;let t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();this._heap.size()>0;)t=this._heap.pop(),t&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info(`> ${i} grammars updated; ${e} ms`)),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}runBefore(t){this._beforeRunner=t}runAfter(t){this._afterRunner=t}release(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}const og=(t,e,i,s,n)=>{const r=t=>{if(n||!t||s&&!s(t)||i.call(null,t),t.markType===Xd.group){const i=t[e];i&&i.forEach((t=>{r(t)}))}n&&(!t||s&&!s(t)||i.call(null,t))};r(t)},lg="__vgrammar_scene_item__",hg=[Xd.line,Xd.area],dg=[Xd.arc3d,Xd.rect3d,Xd.pyramid3d],cg="key",ug=[{}],pg=["key"],gg=!0,mg=!0,_g=!1,fg=!0,vg="VGRAMMAR_IMMEDIATE_ANIMATION",yg=0,bg=1e3,xg=0,Sg=0,Mg=!1,kg=!1,Ag="quintInOut",wg={stopWhenStateChange:!1,immediatelyApply:!0},Tg="VGRAMMAR_ANIMATION_PARAMETERS",Cg="_mo_hide_",Lg=t=>void 0===t;class Eg extends os{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g){throw new Error("Method not implemented.")}}class Pg extends Eg{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const s=new Pg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}class Dg extends Eg{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const s=new Dg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}Dg.DOM_DELTA_PIXEL=0,Dg.DOM_DELTA_LINE=1,Dg.DOM_DELTA_PAGE=2;const Og="object"==typeof performance&&performance.now?performance:Date;function Rg(t){return"mouse"===t||"pen"===t}class Ig{constructor(t,e){this.dispatch=new(o()),this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof Pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(Rg(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,s;if(!(t instanceof Pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=Rg(n.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let s=null==o?void 0:o.parent;for(;s&&s!==this.rootTarget.parent&&s!==n.target;)s=s.parent;if(!s||s===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let s=o;for(;s&&s!==this.rootTarget;)i.add(s),s=s.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(s=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor()),a.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,s;if(!(t instanceof Pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),a=Rg(r.pointerType);this.dispatchEvent(r,"pointerover"),a&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(s=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof Pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=Rg(t.pointerType),s=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",s||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",s||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof Pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=Og.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(Rg(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),a=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=a;if(a&&!n.composedPath().includes(a)){let e=a;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(Rg(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:s});const a=r.clicksByButton[t.button];a.target===e.target&&s-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=s,e.detail=a.clickCount,Rg(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof Pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(s){let e=s;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):Rg(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof Dg))return void g.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,s,n,r,a,o;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(s=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===s?void 0:s.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===r?void 0:r.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?h=this._prePointTargetCache[d]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:h,stageRenderCount:null!==(o=null==h?void 0:h.stage.renderCount)&&void 0!==o?o:-1})),l)for(let e=0,i=l.length;e=0;s--)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=Og.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let s=0,n=i.length;s{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,s=i.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:s,global:n,autoPreventDefault:r=!1,clickInterval:a,supportsTouchEvents:o=n.supportsTouchEvents,supportsPointerEvents:l=n.supportsPointerEvents}=t;this.manager=new Ig(s,{clickInterval:a}),this.globalObj=n,this.supportsPointerEvents=l,this.supportsTouchEvents=o,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new Pg,this.rootWheelEvent=new Dg,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:s}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?s.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(s.style,n):i&&S(t)&&!es(this.cursorStyles,t)&&(s.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const s=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(s)return s;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:n-a.left,y:r-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,s=t.changedTouches.length;i0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class Yg{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,oi.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),oi.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),oi.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));oi.graphicService.hooks.onAttributeUpdate.taps=e(oi.graphicService.hooks.onAttributeUpdate.taps),oi.graphicService.hooks.onSetStage.taps=e(oi.graphicService.hooks.onSetStage.taps),oi.graphicService.hooks.onRemove.taps=e(oi.graphicService.hooks.onRemove.taps)}}class jg{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,oi.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,s)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),oi.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){oi.graphicService.hooks.onAddIncremental.taps=oi.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),oi.graphicService.hooks.onClearIncremental.taps=oi.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,oi.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const s=e.layer.subLayers.get(e._uid);s&&s.drawContribution&&s.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:s.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const Hg=new Bt;class zg{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),oi.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,s)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Hg.setValue(s.x1,s.y1,s.x2,s.y2),e.dirty(Hg,t.parent&&t.parent.globalTransMatrix)))})),oi.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,s,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(s.globalAABBBounds))})),oi.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){oi.graphicService.hooks.beforeUpdateAABBBounds.taps=oi.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),oi.graphicService.hooks.afterUpdateAABBBounds.taps=oi.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),oi.graphicService.hooks.onRemove.taps=oi.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}var Ng;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(Ng||(Ng={}));class Vg{static Avaliable(){return!!oi.global.getRequestAnimationFrame()}avaliable(){return Vg.Avaliable()}tick(t,e){oi.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class Wg{static Avaliable(){return!0}avaliable(){return Wg.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}const Gg=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===Ng.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=Ng.INITIAL,oi.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),oi.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Vg},{mode:"timeout",cons:Wg}];for(let e=0;e{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==Ng.INITIAL&&(this.status=Ng.PAUSE,!0)}resume(){return this.status!==Ng.INITIAL&&(this.status=Ng.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===Ng.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===Ng.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=Ng.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=Ng.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};Gg.addTimeline(us),Gg.setFPS(60);class Ug{static registerPlugin(t,e){Ug._pluginClasses[t]=e}static getPlugin(t){return Ug._pluginClasses[t]}}Ug._pluginClasses={};const $g="white";class Kg extends jn{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:$g}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new Zi,this.hooks={beforeRender:new Q(["stage"]),afterRender:new Q(["stage"])},this.global=oi.global,!this.global.env&&ol()&&this.global.setEnv("browser"),this.window=Di.get(Fi),this.renderService=Di.get(_r),this.pluginService=Di.get(Kr),this.layerService=Di.get(Wn),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:$g,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||Gg,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new cs,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&S(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(){this._skipRender=-1}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new Fg(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:s=0,beta:n=0,camera:r,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:s,beta:n,camera:r,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,s,n,r,a;this.option3d=t;const o=this.get3dOptions(t),{light:l,center:h,camera:d,alpha:c,beta:u,fieldRatio:p,fieldDepth:g}=o,{dir:m=[1,1,-1],color:_="white",ambient:f}=l,v=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),y=(null!==(s=h.y)&&void 0!==s?s:this.height/2)+(null!==(n=h.dy)&&void 0!==n?n:0),b=[v,y,(null!==(r=h.z)&&void 0!==r?r:0)+(null!==(a=h.dz)&&void 0!==a?a:0)];let x=0,S=0,M=0;d||(x=Math.sin(c)+v,S=Math.sin(u)+y,M=Math.cos(c)*Math.cos(u)*1);const k=Ug.getPlugin("DirectionalLight");k&&(this.light=new k(m,_,f));const A={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:g,viewParams:{pos:[x,S,M],center:b,up:[0,1,0]}};if(this.camera)this.camera.params=A;else{const t=Ug.getPlugin("OrthoCamera");t&&(this.camera=new t(A))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=Ug.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new Yg))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new jg))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new It;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new zg,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=Ug.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=Ug.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=Ug.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e,i=!0){"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,s,n){let r=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(r=!1)):(this.viewBox.setValue(t,e,t+i,e+s),!1===n&&(r=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),r&&this.render()}setDpr(t,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;this.pickerService||(this.pickerService=Di.get(xr));const i=this.pickerService.pick(this.children,new re(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.release(),this.interactiveLayer.removeAllChild()),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(t=!0,e){if("released"===this.releaseStatus)return;const i=Di.get(Fi),s=e?-e.x1:0,n=e?-e.y1:0,r=e?e.x2:this.viewWidth,a=e?e.y2:this.viewHeight,o=e?e.width():this.viewWidth,l=e?e.height():this.viewHeight;return i.create({viewBox:{x1:s,y1:n,x2:r,y2:a},width:o,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}}class Xg{constructor(t){this.handleAfterNextRender=()=>{this._stage&&!this._viewOptions.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._view.emit(rc.AFTER_VRENDER_DRAW),this._view.emit(rc.AFTER_VRENDER_NEXT_RENDER)},this._view=t}initialize(t,e,i,s){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=s,this.initStage(),this}stage(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}gestureController(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}canvas(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}context(){return this._stage?this._stage.window.getContext().nativeContext:null}combineIncrementalLayers(){return this._stage&&function(t){return e=this,i=void 0,n=function*(){const e=[],i=t.getChildren();yield new Promise((t=>{oi.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)},new((s=void 0)||(s=Promise))((function(t,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(a,o)}l((n=n.apply(e,i||[])).next())}));var e,i,s,n}(this._stage).then((()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()})),this}background(t){if(this._stage)return this._stage.background=t,this}setDpr(t,e){var i,s;return null===(s=null===(i=this._stage)||void 0===i?void 0:i.setDpr)||void 0===s||s.call(i,t),e&&this.renderNextFrame(),this}shouldResize(t,e){return t!==this._width||e!==this._height}resize(t,e){return this._view.emit(rc.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(rc.AFTER_STAGE_RESIZE),this}setViewBox(t,e=!0){return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}render(t=!1){return this._view.emit(rc.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(rc.AFTER_VRENDER_DRAW)),this}renderNextFrame(){return this.initStage(),this._stage.renderNextFrame(),this}toCanvas(){return this._stage?this._stage.toCanvas():null}preventRender(t){this._stage&&this._stage.preventRender(t)}release(){var t;this._view.traverseMarkTree((t=>{t.release()})),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}createStage(){var t,e,i,s,n;this._view.emit(rc.BEFORE_CREATE_VRENDER_STAGE);const r=this._viewOptions,a=null!==(t=r.stage)&&void 0!==t?t:(o={width:this._width,height:this._height,renderStyle:r.renderStyle,viewBox:r.viewBox,dpr:r.dpr,canvas:r.renderCanvas,canvasControled:r.canvasControled,container:r.container,title:r.rendererTitle,beforeRender:r.beforeRender,afterRender:r.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:r.pluginList,enableHtmlAttribute:r.enableHtmlAttribute,optimize:r.optimize,ticker:r.ticker,supportsTouchEvents:r.supportsTouchEvents,supportsPointerEvents:r.supportsPointerEvents,ReactDOM:r.ReactDOM},new Kg(o));var o;(null===(e=r.options3d)||void 0===e?void 0:e.enable)&&a.set3dOptions(r.options3d),a.enableIncrementalAutoRender(),this._viewBox=r.viewBox,this._view.emit(rc.AFTER_CREATE_VRENDER_STAGE),this._view.emit(rc.BEFORE_CREATE_VRENDER_LAYER);const l=null!==(i=r.layer)&&void 0!==i?i:a.defaultLayer;if(this._view.emit(rc.AFTER_CREATE_VRENDER_LAYER),(null===(s=this._eventConfig)||void 0===s?void 0:s.drag)&&pc.getStageEventPlugin("drag")&&(this._dragController=new(pc.getStageEventPlugin("drag"))(a)),(null===(n=this._eventConfig)||void 0===n?void 0:n.gesture)&&pc.getStageEventPlugin("gesture")){const t=ns(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new(pc.getStageEventPlugin("gesture"))(a,t)}return{stage:a,layer:l}}initStage(){if(!this._stage){const{stage:t,layer:e}=this.createStage();this._stage=t,this._layer=e;const i=this._view.background();this.background(i)}}}function qg(t){return P(t.offsetX)?P(t.x)?t.changedTouches&&t.changedTouches.length?function(t){const e=t.changedTouches[0];return{canvasX:e.x,canvasY:e.y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function Zg(t,e,i=!0){const s=["canvasX","canvasY"];return i&&(s.push("clientX"),s.push("clientY")),s.forEach((i=>{Wo(e[i])&&Object.defineProperty(t,i,{value:e[i],writable:!0})})),[e.canvasX,e.canvasY]}const Jg="window",Qg="view",tm="width",em="height",im="viewWidth",sm="viewHeight",nm="padding",rm="viewBox",am="autoFit";function om(t,e,i,s,n){return n===Jg&&function(t){["touches","changedTouches","targetTouches"].forEach((e=>{t[e]&&t[e].length&&Array.from(t[e]).forEach((t=>{Zg(t,qg(t),!1)}))}));const e=qg(t);Zg(t,e)}(e.changedTouches?e.changedTouches[0]:e),e.element=i,e}class lm extends Xp{constructor(){super(...arguments),this.grammarType="signal",this.spec={value:null,update:null}}parse(t){return super.parse(t),this.value(t.value),this.update(t.update),this.commit(),this}evaluate(t,e){return this._signal=this.spec.update?Np(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}output(){return this._signal}getValue(){return this.output()}set(t){if(y(t)&&y(this.value)&&t.length===this.value.length){for(let e=0;e{var e,i,s,n;return h(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0,left:null!==(s=null==t?void 0:t.left)&&void 0!==s?s:0,right:null!==(n=null==t?void 0:t.right)&&void 0!==n?n:0}};function um(t,e){switch(e){case"line":return t.some((t=>["x","y","defined"].includes(t)));case"area":return t.some((t=>["x","y","x1","y1","defined"].includes(t)));case"largeRects":return t.some((t=>["x","y","width","y1"].includes(t)));case"largeSymbols":return t.some((t=>["x","y"].includes(t)))}return!1}const pm=["fillOpacity"],gm=(t,e,i)=>{var s;return"fillOpacity"===e?(t.fillOpacity=null!==(s=i.fillOpacity)&&void 0!==s?s:1,["fillOpacity"]):[]},mm={rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;Wo(e.width)||!Wo(e.x1)&&Wo(i.width)?(t.x=Math.min(null!==(s=i.x)&&void 0!==s?s:0,null!==(n=i.x1)&&void 0!==n?n:1/0),t.width=i.width):Wo(e.x1)||!Wo(e.width)&&Wo(i.x1)?(t.x=Math.min(i.x,i.x1),t.width=Math.abs(i.x1-i.x)):(t.x=Math.min(null!==(r=i.x)&&void 0!==r?r:0,null!==(a=i.x1)&&void 0!==a?a:1/0),t.width=i.width),Wo(e.height)||!Wo(e.y1)&&Wo(i.height)?(t.y=Math.min(null!==(o=i.y)&&void 0!==o?o:0,null!==(l=i.y1)&&void 0!==l?l:1/0),t.height=i.height):Wo(e.y1)||!Wo(e.height)&&Wo(i.y1)?(t.y=Math.min(i.y,i.y1),t.height=Math.abs(i.y1-i.y)):(t.y=Math.min(null!==(h=i.y)&&void 0!==h?h:0,null!==(d=i.y1)&&void 0!==d?d:1/0),t.height=i.height),Wo(e.length)||!Wo(e.z1)&&Wo(i.length)?(t.z=Math.min(null!==(c=i.z)&&void 0!==c?c:0,null!==(u=i.z1)&&void 0!==u?u:1/0),t.length=i.length):Wo(e.z1)||!Wo(e.length)&&Wo(i.z1)?(t.z=Math.min(i.z,i.z1),t.length=Math.abs(i.z1-i.z)):(t.z=Math.min(null!==(p=i.z)&&void 0!==p?p:0,null!==(g=i.z1)&&void 0!==g?g:1/0),t.length=i.length)},storedAttrs:"sizeAttrs"}],[Xd.text]:[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:(t,e,i)=>{var s,n;const r=null!==(s=i.limit)&&void 0!==s?s:1/0,a=null!==(n=i.autoLimit)&&void 0!==n?n:1/0,o=Math.min(r,a),l=w(i.text)&&!P(i.text.text),h=l?i.text.text:i.text;Array.isArray(h),t.maxLineWidth=o===1/0?i.maxLineWidth:o,!l&&!i.textType||"rich"!==i.text.type&&"rich"!==i.textType?t.text=h:t.textConfig=h},storedAttrs:"limitAttrs"}],[Xd.rule]:[{channels:["x","y","x1","y1"],transform:(t,e,i)=>{const s=function(t){const{x:e,y:i,x1:s,y1:n}=t;return Wo(e)&&Wo(i)&&Wo(s)&&Wo(n)?[{x:e,y:i},{x:s,y:n}]:[]}(i);t.points=s,t.x=0,t.y=0},storedAttrs:"pointAttrs"}],[Xd.symbol]:[{channels:["shape","symbolType"],transform:(t,e,i)=>{var s;t.symbolType=null!==(s=e.shape)&&void 0!==s?s:e.symbolType}},{channels:["image","fill","background"],transform:(t,e,i)=>{e.image?(t.background=e.image,t.fill=!1):i.image?(t.background=i.image,t.fill=!1):(t.fill=i.fill,t.background=i.background)},storedAttrs:"imageAttrs"}]},_m=(t,e,i,s)=>{const n={},r=e?Object.keys(e):[],a=S(t)?mm[t]:t;if(a&&a.length){const t=[];r.forEach((r=>{let o=!1;a.forEach(((a,l)=>{if(a.channels.includes(r)){if(!t[l])if(a.storedAttrs){const t=function(t,e,i,s,n,r){const a=n.getGraphicAttribute(t,!1,r);if(a)return e.forEach((t=>{t in s&&(a[t]=s[t])})),a;const o={};return e.forEach((t=>{o[t]=s[t]})),i[t]=o,o}(a.storedAttrs,a.channels,n,e,i,s);a.transform(n,e,t)}else a.transform(n,e,null);t[l]=!0,o=!0}})),o||(pm.includes(r)?gm(n,r,e):n[r]=e[r])}))}else r.forEach((t=>{pm.includes(t)?gm(n,t,e):n[t]=e[t]}));return n};function fm(t,e,i={}){var s;const n=pc.getGraphicType(e)?pc.createGraphic(e,i):pc.createGraphicComponent(e,i,{skipDefault:null===(s=null==t?void 0:t.spec)||void 0===s?void 0:s.skipTheme});return n||g.getInstance().error(`create ${e} graphic failed!`),n}const vm=t=>{t&&(t[lg]=null,t.release(),t.parent&&t.parent.removeChild(t))};function ym(t,e,i){const s=new Map;if(!t||0===t.length)return{keys:[],data:s};if(!e)return s.set(cg,i?t.slice().sort(i):t.slice()),{keys:pg,data:s};const n=Gp(e);if(1===t.length){const e=n(t[0]);return s.set(e,[t[0]]),{keys:[e],data:s}}const r=new Set;return t.forEach((t=>{var e;const i=n(t),a=null!==(e=s.get(i))&&void 0!==e?e:[];a.push(t),s.set(i,a),r.add(i)})),i&&r.forEach((t=>{s.get(t).sort(i)})),{keys:Array.from(r),data:s}}class bm{constructor(t,e,i){this.prevData=(null==t?void 0:t.length)?ym(t,null!=e?e:null,i):null}setCurrentData(t){this.currentData=t}getCurrentData(){return this.currentData}doDiff(){if(this.callback)if(this.currentData&&this.prevData){const t=new Map(this.prevData.data);this.currentData.keys.forEach((e=>{this.callback(e,this.currentData.data.get(e),t.get(e)),t.delete(e)})),this.prevData.keys.forEach((e=>{t.has(e)&&this.callback(e,null,t.get(e))}))}else this.currentData?this.currentData.keys.forEach((t=>{this.callback(t,this.currentData.data.get(t),null)})):this.prevData&&this.prevData.keys.forEach((t=>{this.callback(t,null,this.prevData.data.get(t))}))}setCallback(t){this.callback=t}updateToCurrent(){this.prevData=this.currentData,this.currentData=null}reset(){this.prevData=null}}function xm(t){return!!(null==t?void 0:t.scale)}function Sm(t){return!!(null==t?void 0:t.field)}function Mm(t,e){if(!t)return[];let i=[];return t.scale&&(i=Wp(t.scale)?[t.scale]:Ra(e.getScaleById(t.scale))),i.concat(Hp(t,e))}const km=t=>e=>Gd(e,t),Am=t=>{g.getInstance().error(t)},wm=(t,e,i={})=>{if(rs(t))return t;const s=(t=>{const e=[],i=t.length;let s,n,r,a=null,o=0,l="";t+="";const h=()=>{e.push(l+t.substring(s,n)),l="",s=n+1};for(s=0,n=0;ns&&h(),s=n+1,o=s):"]"===r&&(o||Am("Access path missing open bracket: "+t),o>0&&h(),o=0,s=n+1):n>s?h():s=n+1}return o&&Am("Access path missing closing bracket: "+t),a&&Am("Access path missing closing quote: "+t),n>s&&(n+=1,h()),e})(t),n=1===s.length?s[0]:t;return((t,e,i)=>(t.fields=e||[],t.fname=i,t))((i&&i.get||km)(s),[n],e||n)},Tm=(t,e,i={})=>{if(y(t)){const s=t.map((t=>wm(t,e,i)));return t=>s.map((e=>e(t)))}return wm(t,e,i)};function Cm(t,e,i,s,n){i&&(zp(i)?e.forEach((e=>{const n=Np(i,s,e.datum,t);Object.assign(e.nextAttrs,n)})):Object.keys(i).forEach((r=>{var a,o;const l=i[r],d=n&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case Xd.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case Xd.group:case Xd.rect:case Xd.image:return["width","height","y1"].includes(e);case Xd.path:case Xd.shape:return["path","customPath"].includes(e);case Xd.line:return"defined"===e;case Xd.area:return["x1","y1","defined"].includes(e);case Xd.rule:return["x1","y1"].includes(e);case Xd.symbol:return"size"===e;case Xd.polygon:return"points"===e;case Xd.text:return"text"===e}return!1}(t.mark.markType,r)?[e[0]]:e;if(xm(l)){const t=Vp(l.scale,s),e=null!==(a=null==l?void 0:l.offset)&&void 0!==a?a:0,i=!P(l.band)&&t.bandwidth?t.bandwidth()*l.band:null,n=S(null==l?void 0:l.field),c=n?Tm(l.field):null;let u=n?null:P(null==l?void 0:l.value)?0:null===(o=t.scale)||void 0===o?void 0:o.call(t,l.value);d.forEach((s=>{var a;n&&(u=null===(a=t.scale)||void 0===a?void 0:a.call(t,c(s.datum))),s.nextAttrs[r]=h(u)||h(i)?u+e+i:u}))}else if(Sm(l)){const t=Tm(l.field);d.forEach((e=>{e.nextAttrs[r]=t(e.datum)}))}else d.forEach((e=>{e.nextAttrs[r]=Np(l,s,e.datum,t)}))})))}function Lm(t,e,i,s){if(!t)return null;if(zp(t))return Np(t,s,e,i);const n={};return Object.keys(t).forEach((r=>{var a,o,l;const d=t[r];if(xm(d)){const t=Vp(d.scale,s),i=null!==(a=null==d?void 0:d.offset)&&void 0!==a?a:0,c=!P(d.band)&&t.bandwidth?t.bandwidth()*d.band:null,u=S(null==d?void 0:d.field),p=u?Tm(d.field):null,g=u?null===(o=t.scale)||void 0===o?void 0:o.call(t,p(e)):P(null==d?void 0:d.value)?0:null===(l=t.scale)||void 0===l?void 0:l.call(t,d.value);n[r]=h(g)||h(c)?g+i+c:g}else if(Sm(d)){const t=Tm(d.field);n[r]=t(e)}else n[r]=Np(d,s,e,i)})),n}function Em(t){return Object.prototype.toString.call(t)}function Pm(t){return Object.keys(t)}function Dm(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Em(t)!==Em(e))return!1;if(rs(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(y(t)){if(t.length!==e.length)return!1;for(let s=t.length-1;s>=0;s--)if(!Dm(t[s],e[s],i))return!1;return!0}if(!w(t))return!1;const s=Pm(t),n=Pm(e);if(s.length!==n.length)return!1;s.sort(),n.sort();for(let t=s.length-1;t>=0;t--)if(s[t]!=n[t])return!1;for(let n=s.length-1;n>=0;n--){const r=s[n];if(!Dm(t[r],e[r],i))return!1}return!0}const Om=Object.prototype,Rm=Object.prototype.hasOwnProperty,Im=function(t){if(P(t))return!0;if(A(t))return!t.length;const e=(t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")))(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Om)}(t))return!Object.keys(t).length;for(const e in t)if(Rm.call(t,e))return!1;return!0},Bm=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],Fm=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(Bm);function Ym(t,e,i){var s;if(!t||t.length<=1)return null;const n="area"===(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.markType)?Fm:Bm,r=[];let a=null;return t.forEach(((t,e)=>{a&&n.every((e=>((t,e,i)=>!(!P(t)||!P(e))||!P(t)&&!P(e)&&("lineDash"===i?((t,e)=>t.length===e.length&&t.join("-")===e.join("-"))(t,e):"stroke"===i||"fill"===i?((t,e)=>{if(t===e)return!0;if(typeof t!=typeof e)return!1;if(S(t))return!1;if(t.gradient!==e.gradient)return!1;const i=Object.keys(t),s=Object.keys(e);return i.length===s.length&&i.every((i=>"stops"===i?((t,e)=>{var i,s;if(t===e)return!0;const n=null!==(i=t&&t.length)&&void 0!==i?i:0;return n===(null!==(s=e&&e.length)&&void 0!==s?s:0)&&0!==n&&t.every(((t,i)=>!t&&!e[i]||t&&e[i]&&t.color===e[i].color&&t.offset===e[i].offset))})(t[i],e[i]):t[i]===e[i]))})(t,e):t===e))(a[e],t[e],e)))||(r.length&&(r[r.length-1].endIndex=e),a=t,r.push({attrs:a,startIndex:e}))})),r.length>=2?r.map((t=>{const i=jm(t.attrs);return i.points=e.slice(t.startIndex,P(t.endIndex)?e.length:t.endIndex),i})):null}function jm(t){const e={};if(!t)return e;const i=["x","y","x1","y1","defined","size","width","height","context"];return Object.keys(t).forEach((s=>{i.includes(s)||(e[s]=t[s])})),e}class Hm{constructor(t){this.data=null,this.states=[],this.diffState=Kd.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!P(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t];if(!o)return{};if(rs(o))return o(this.getDatum(),this,t,e);if(!a&&(null===(r=this.graphicItem.states)||void 0===r?void 0:r[t]))return this.graphicItem.states[t];const l=this.items.map((t=>Object.assign({},t,{nextAttrs:{}})));Cm(this,l,o,this.mark.parameters());const h=this.transformElementItems(l,this.mark.markType);return this.graphicItem.states?this.graphicItem.states[t]||(this.graphicItem.states[t]=h):this.graphicItem.states={[t]:h},h},this.mark=t}initGraphicItem(t={}){if(this.graphicItem)return;const e=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(e?_m(e,t,this):t,this.groupKey),this.graphicItem&&(this.graphicItem[lg]=this,e&&(this.graphicItem.onBeforeAttributeUpdate=t=>this.mark?_m(e,t,this):t),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(Object.assign({},t)),this.setFinalGraphicAttributes(Object.assign({},t))))}updateGraphicItem(){var t;if(!this.graphicItem)return;this.diffState===Kd.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");e&&0!==e.length&&(this.graphicItem.stateAnimateConfig=e[0].originConfig)}getGraphicItem(){return this.graphicItem}removeGraphicItem(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,(t=>t.stop()))),this.graphicItem&&(vm(this.graphicItem),this.graphicItem[lg]=null,this.graphicItem=null)}resetGraphicItem(){this.graphicItem&&(this.graphicItem=null)}getBounds(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}getStates(){return this.states}updateData(t,e,i){var s;this.mark.emit(rc.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;const n=Gp(i);return this.items=e.map((t=>({datum:t,key:n(t),view:this.mark.view,nextAttrs:{}}))),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(s=this.items)||void 0===s?void 0:s[0].key,this.mark.emit(rc.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}state(t,e){var i;const s=this.mark.isCollectionMark(),n=this.states,r=Ra(Np(t,e,this.getDatum(),this)),a=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;a&&r.length&&r.sort(a);const o=r.length!==n.length||r.some(((t,e)=>t!==n[e]));this.states=r,!s&&o&&this.diffState===Kd.unChange&&(this.diffState=Kd.update)}encodeGraphic(t){this.coordinateTransformEncode(this.items);const e=this.transformElementItems(this.items,this.mark.markType);t&&Object.assign(e,t),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,Cg in this.graphicItem.attribute&&"visible"in e&&delete this.graphicItem.attribute[Cg],this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==Kd.enter&&this.diffState!==Kd.update||!this.states.length||this.useStates(this.states),this.mark.markType===Xd.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach((t=>{t.nextAttrs={}})),this._setCustomizedShape()}_setCustomizedShape(){var t;if(!this.graphicItem)return;const e=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;e&&(this.graphicItem.pathProxy=t=>e(this.data,t,new Be))}encodeItems(t,e,i=!1,s){const n=this.mark.isCollectionMark(),r=e[$d.update],a=e[$d.enter],o=e[$d.exit],l=this.mark.isLargeMode()||n&&!this.mark.getSpec().enableSegments;this.diffState===Kd.enter?(a&&Cm(this,t,a,s,l),r&&Cm(this,t,r,s,l)):this.diffState===Kd.update?((n&&a||i)&&Cm(this,t,a,s,l),r&&Cm(this,t,r,s,l)):this.diffState===Kd.exit&&o&&(i&&Cm(this,t,a,s,l),Cm(this,t,o,s,l))}coordinateTransformEncode(t){if(!this.mark.coord||"arc"===this.mark.markType||!0===this.mark.disableCoordinateTransform)return;const e=this.mark.coord.output();t.forEach((t=>{const i=t.nextAttrs,s=e.convert(i);Object.assign(i,s)}))}hasStateAnimation(){var t;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");return e&&e.length>0}clearStates(t){const e=v(t)?t:this.hasStateAnimation();this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}_updateRuntimeStates(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}hasState(t){return this.states&&t&&this.states.includes(t)}updateStates(t){if(!this.graphicItem)return!1;let e=this.states.slice();const i=this.mark.getSpec().encode;let s=!1,n=!1;return Object.keys(t).forEach((r=>{var a;if(!r)return;const o=t[r];if(ns(o)&&!Dm(o,null===(a=this.runtimeStatesEncoder)||void 0===a?void 0:a[r]))e.includes(r)?s=!0:e.push(r),this._updateRuntimeStates(r,o),n=!0;else if(o)!e.includes(r)&&(null==i?void 0:i[r])&&(e.push(r),n=!0);else if(e.length){const t=e.filter((t=>t!==r));t.length!==e.length&&(n=!0,e=t),this.runtimeStatesEncoder&&this.runtimeStatesEncoder[r]&&(this.runtimeStatesEncoder[r]=null)}})),s&&this.graphicItem.clearStates(),!!n&&(this.useStates(e),!0)}addState(t,e){var i;if(!this.graphicItem)return!1;if(e&&S(t)&&!Dm(e,null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t])){const i=this.states.slice();return i.includes(t)?this.graphicItem.clearStates():i.push(t),this._updateRuntimeStates(t,e),this.useStates(i),!0}const s=this.mark.getSpec().encode,n=Ra(t).reduce(((t,e)=>(e&&!t.includes(e)&&(null==s?void 0:s[e])&&t.push(e),t)),this.states.slice());return n.length!==this.states.length&&(this.useStates(n),!0)}removeState(t){if(!this.graphicItem)return!1;const e=Ra(t);if(!e.length)return!1;const i=this.states.filter((t=>!e.includes(t)));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&e.forEach((t=>{this.runtimeStatesEncoder[t]=null})),this.useStates(i),!0)}useStates(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(rc.BEFORE_ELEMENT_STATE,{states:t},this);const s=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;s&&t.sort(s),this.states=t;const n=v(e)?e:this.hasStateAnimation();return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,n),this.mark.emit(rc.AFTER_ELEMENT_STATE,{states:t},this),!0}diffAttributes(t){const e={},i=this.getFinalGraphicAttributes();for(const s in t)es(i,s)&&Dm(i[s],t[s])||(e[s]=t[s]);return e}transformElementItems(t,e,i){var s,n,r,a,o;const l=t[0];if(!l.nextAttrs||0===Object.keys(l.nextAttrs).length)return{};let h=l.nextAttrs;if(function(t){return[Xd.line,Xd.area,Xd.largeRects,Xd.largeSymbols].includes(t)}(e)&&t&&t.length&&P(null===(s=l.nextAttrs)||void 0===s?void 0:s.points)&&(!0===i||um(Object.keys(l.nextAttrs),this.mark.markType))){const i=this.mark.getSpec(),s=this.getGraphicAttribute("points",!1),l=this.getGraphicAttribute("segments",!1),d=i.enableSegments,c=null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[$d.connectNulls],u=t.map((t=>t.nextAttrs)),p=this.mark.isProgressive();if(h=jm(h),e===Xd.line||e===Xd.area){const i=function(t,e,i,s){return t&&t.length&&(t.length,1)?t.some((t=>um(Object.keys(t.nextAttrs),"line")))?t.map(((t,e)=>{var n;const r=t.nextAttrs,{x:a,y:o,x1:l,y1:h,defined:d}=null!==(n=null==i?void 0:i[e])&&void 0!==n?n:{};return P(r.x)&&(r.x=a),P(r.y)&&(r.y=o),P(r.defined)&&!1===d&&(r.defined=!1),r.context=t.key,s&&(P(r.x1)&&(r.x1=l),P(r.y1)&&(r.y1=h)),r})):null!=i?i:[]:[]}(t,0,s,e===Xd.area);if(p)h.segments=(null!==(o=null===(a=null===(r=this.graphicItem)||void 0===r?void 0:r.attribute)||void 0===a?void 0:a.segments)&&void 0!==o?o:[]).concat([{points:i}]);else if(c){if(h.segments=function(t,e,i){if(!t||t.length<=1)return null;const s=!!i&&i.mark.getSpec().enableSegments;let n,r,a=[],o=null;if(t.forEach(((t,i)=>{o=e[i],o&&!1!==o.defined?(n||(r={items:[],points:[]},a.push(r)),r.points.push(o),r.items.push(t),!1===n&&(r.isConnect=!0,r={items:[],points:[]},a.push(r)),n=!0):n=!1})),a=a.filter((t=>t.points.length>0)),a.length>=2){const t=[];return a.forEach((e=>{if(e.isConnect)return void t.push({points:e.points,isConnect:!0});if(s){const s=Ym(e.items,e.points,i);if(s)return void s.forEach((e=>{t.push(e)}))}const n=jm(e.items[0]);n.points=e.points,t.push(n)})),t}return s?Ym(t,e,i):null}(u,i,this),h.segments&&h.segments.some((t=>t.isConnect))){const t=Lm(c,this.getDatum(),this,this.mark.parameters());t&&h.segments.forEach((e=>{e.isConnect&&Object.assign(e,t)}))}h.points=i}else if(d){const t=i&&0!==i.length?i:function(t){return t?t.reduce(((t,e)=>t.concat(e.points)),[]):null}(l),e=Ym(u,t,this);e?(h.segments=e,h.points=null):(h.segments=null,h.points=t),h=function(t,e){var i;if(!t||!t.segments||!t.segments.length)return t;const s="area"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.markType)?["fillOpacity","strokeOpacity"]:["strokeOpacity"],n={};return Object.keys(t).forEach((e=>{s.includes(e)||(n[e]=t[e])})),n}(h,this)}else h.points=i,h.segments=null}else e===Xd.largeRects?h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(4*t.length);return t.forEach(((t,e)=>{var n,r,a,o;const l=t.nextAttrs,h=null!==(n=l.x)&&void 0!==n?n:i[4*e],d=null!==(r=l.y)&&void 0!==r?r:i[4*e+1],c=null!==(a=l.width)&&void 0!==a?a:i[4*e+2],u=null!==(o=l.y1)&&void 0!==o?o:i[4*e+3];s[4*e]=h,s[4*e+1]=d,s[4*e+2]=c,s[4*e+3]=u-d})),s}(t,!0,s):e===Xd.largeSymbols&&(h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(2*t.length);return t.forEach(((t,e)=>{var n,r;const a=t.nextAttrs,o=null!==(n=a.x)&&void 0!==n?n:i[2*e],l=null!==(r=a.y)&&void 0!==r?r:i[2*e+1];s[2*e]=o,s[2*e+1]=l})),s}(t,!0,s))}return h}applyGraphicAttributes(t){var e,i,s;if(!Im(t))if(this.mark.needAnimate()){const n=this.diffAttributes(t),r=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},a=null!==(i=this.getFinalGraphicAttributes())&&void 0!==i?i:{};Object.keys(n).forEach((t=>{r[t]=this.getGraphicAttribute(t),a[t]=n[t]})),this.setNextGraphicAttributes(n),this.setPrevGraphicAttributes(r),this.setFinalGraphicAttributes(a);const o=((null===(s=this.mark.animate)||void 0===s?void 0:s.getElementAnimators(this))||[]).reduce(((t,e)=>Object.assign(t,e.getEndAttributes())),{}),l=Object.assign({},o,a);this.graphicItem.setAttributes(l)}else this.graphicItem.setAttributes(t)}getGraphicAttribute(t,e=!1){var i;if(!this.graphicItem)return;if(e){let e;const i=this.getPrevGraphicAttributes();if(!P(e=Gd(i,t)))return e}const s=this.mark.getAttributeTransforms();let n=[t];if(s&&s.length){const e=s.find((e=>e.storedAttrs&&e.channels.includes(t)));e&&(n=[e.storedAttrs,t])}return Gd(null===(i=this.graphicItem)||void 0===i?void 0:i.attribute,n)}setGraphicAttribute(t,e,i=!0){if(!this.graphicItem)return;const s=this.getFinalGraphicAttributes(),n=this.getPrevGraphicAttributes();i&&s&&(s[t]=e),n&&!es(n,t)&&(n[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}setGraphicAttributes(t,e=!0){if(!this.graphicItem)return;const i=this.getFinalGraphicAttributes(),s=this.getPrevGraphicAttributes();Object.keys(t).forEach((n=>{i&&e&&(i[n]=t[n]),s&&!es(s,n)&&(s[n]=this.graphicItem.attribute[n])})),this.graphicItem.setAttributes(t)}getFinalGraphicAttributes(){return this.graphicItem.finalAttrs}setFinalGraphicAttributes(t){this.graphicItem.finalAttrs=t}getPrevGraphicAttributes(){return this.graphicItem.prevAttrs}setPrevGraphicAttributes(t){this.graphicItem.prevAttrs=t}getNextGraphicAttributes(){return this.graphicItem.nextAttrs}getFinalAnimationAttribute(t){var e,i;return null!==(i=null===(e=this.getFinalGraphicAttributes())||void 0===e?void 0:e[t])&&void 0!==i?i:this.getGraphicAttribute(t)}getFinalAnimationAttributes(){var t;return null!==(t=this.getFinalGraphicAttributes())&&void 0!==t?t:this.graphicItem.attribute}setNextGraphicAttributes(t){this.graphicItem.nextAttrs=t}clearChangedGraphicAttributes(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}clearGraphicAttributes(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}remove(){this.graphicItem&&(vm(this.graphicItem),this.graphicItem=null)}release(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}getItemAttribute(t){var e,i;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?P(t)?this.items.map((t=>t.nextAttrs)):this.items.map((e=>{var i;return null===(i=e.nextAttrs)||void 0===i?void 0:i[t]})):P(t)?this.items[0].nextAttrs:null===(i=this.items[0].nextAttrs)||void 0===i?void 0:i[t]}setItemAttributes(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?y(t)&&this.items.forEach(((e,i)=>{Object.assign(e.nextAttrs,t[i])})):Object.assign(this.items[0].nextAttrs,t))}getItem(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}getDatum(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}class zm extends Xp{constructor(t,e,i){super(t),this.grammarType="mark",this.elements=[],this.elementMap=new Map,this.isUpdated=!0,this._isReentered=!1,this.differ=new bm([]),this.markType=e,this.spec.type=e,this.spec.encode={update:{}},this.spec.group=i,i&&(this.group=i,this.attach(i),i.appendChild(this))}parse(t){var e,i,s;if(super.parse(t),this.spec.group){const t=S(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(t)}const n=S(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(n),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(i=this.spec.encode)&&void 0!==i?i:{}).forEach((t=>{this.encodeState(t,{},!0)})),Object.keys(null!==(s=t.encode)&&void 0!==s?s:{}).forEach((e=>{this.encodeState(e,t.encode[e])})),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}parameters(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:super.parameters()}parseAddition(t){return this}reuse(t){var e;if(t.grammarType!==this.grammarType)return this;const i=t;return this.markType=i.markType,this.coord=i.coord,this.elementMap=i.elementMap,this.elements=i.elements,this.elementMap.forEach((t=>t.mark=this)),this.differ=i.differ,null===(e=this.reuseAnimate)||void 0===e||e.call(this,i),this._context=i._context,this.graphicItem=i.graphicItem,this.graphicIndex=i.graphicIndex,this.graphicParent=i.graphicParent,this.needClear=i.needClear,this.isUpdated=i.isUpdated,this}needLayout(){return!P(this.spec.layout)}handleLayoutEnd(){}handleRenderEnd(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach((t=>{t.diffState===Kd.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()})),this.differ.updateToCurrent(),this.needClear=!1)}evaluateMainTasks(t,e){var i;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===nc.before)return this;const s=null===(i=this.view.renderer)||void 0===i?void 0:i.stage();this.init(s,e);const n=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:ug,e);let r=(null==n?void 0:n.progressive)?t:n;return this.evaluateGroup(r),this.renderContext=this.parseRenderContext(r,e),this.renderContext.progressive?(this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive()):((null==n?void 0:n.progressive)&&(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=n.progressive,r=n.progressive.output()),this.emit(rc.BEFORE_MARK_JOIN),this.evaluateJoin(r),this.emit(rc.AFTER_MARK_JOIN),this.emit(rc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(rc.AFTER_MARK_STATE),this.emit(rc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(rc.AFTER_MARK_ENCODE)),this.emit(rc.BEFORE_MARK_UPDATE),this.update(this.spec),this.emit(rc.AFTER_MARK_UPDATE),this}evaluateGroup(t){if(this.markType===Xd.group)return;const e=ym(null!=t?t:ug,this.spec.groupBy,this.spec.groupSort),i=e.keys;this._groupKeys=i,this._groupEncodeResult=null,this.differ.setCurrentData(e)}_getTransformsAfterEncodeItems(){return this.transforms&&this.transforms.filter((t=>"afterEncodeItems"===t.markPhase))}_getTransformsAfterEncode(){return this.transforms&&this.transforms.filter((t=>P(t.markPhase)||"afterEncode"===t.markPhase))}_getTransformsBeforeJoin(){return this.transforms?this.transforms.filter((t=>"beforeJoin"===t.markPhase)):[]}evaluate(t,e){var i;return this.evaluateMainTasks(t,e),(null===(i=this.renderContext)||void 0===i?void 0:i.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}output(){return this}join(t,e,i,s,n){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,P(t)||(S(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=s,this.spec.groupSort=n,this.commit(),this}coordinate(t){return S(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}state(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}encode(t,e,i){return this.encodeState(Kd.update,t,e,i)}encodeState(t,e,i,s){if(t===Kd.enter&&(this._isReentered=!0),this.spec.encode[t]){const n=this.spec.encode[t];if(zp(n))this.detach(Mm(n,this.view));else{const r=S(e);r&&s||!r&&i?(Object.keys(n).forEach((t=>{this.detach(Mm(n[t],this.view))})),this.spec.encode[t]={}):r?this.detach(Mm(n[e],this.view)):Object.keys(e).forEach((t=>{this.detach(Mm(n[t],this.view))}))}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),S(e)?(this.spec.encode[t][e]=i,this.attach(Mm(i,this.view))):zp(e)?(this.spec.encode[t]=e,this.attach(Mm(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach((t=>{this.attach(Mm(t,this.view))})))),this.commit(),this}_getEncoders(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}animation(t){return this.spec.animation=t,this}animationState(t){return this.setFunctionSpec(t,"animationState")}layout(t){return this.spec.layout=t,this.commit(),this}morph(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}transform(t){const e=Zp(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);const i=Zp(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}configure(t){const e=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?(e.forEach((t=>{P(this.spec[t])||(this.spec[t]=void 0)})),this):(e.forEach((e=>{P(t[e])||(this.spec[e]=t[e])})),this)}context(t){return this.spec.context=t,this._context=t,this}isCollectionMark(){return hg.includes(this.markType)}needAnimate(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!P(this.spec.animation)}getAllElements(){const t=this.elements.slice();return this.elementMap.forEach((e=>{e.diffState!==Kd.exit||t.includes(e)||t.push(e)})),this.spec.sort&&t.sort(((t,e)=>this.spec.sort(t.getDatum(),e.getDatum()))),t}getScales(){const t={};return this.references.forEach(((e,i)=>{i.grammarType===ac.scale&&(t[i.id()]=i.output())})),t}getScalesByChannel(){const t=this.spec.encode;if(!t)return{};const e={},i=this.parameters();return Object.keys(t).forEach((s=>{const n=t[s];n&&!zp(n)&&Object.keys(n).forEach((t=>{xm(n[t])&&(e[t]=Vp(n[t].scale,i))}))})),e}getFieldsByChannel(){const t=this.spec.encode;if(!t)return{};const e={};return Object.keys(t).forEach((i=>{const s=t[i];zp(s)||Object.keys(s).forEach((t=>{Sm(s[t])&&(e[t]=s[t].field)}))})),e}init(t,e){var i,s,n,r,a;if(this._delegateEvent||(this._delegateEvent=(t,e)=>{var i;const s=null===(i=t.target)||void 0===i?void 0:i[lg];if((null==s?void 0:s.mark)===this){const i=om(this.view,t,s,0,Qg);this.emitGrammarEvent(e,i,s)}},this.initEvent()),null===(i=this.initAnimate)||void 0===i||i.call(this,this.spec),!this.group){const t=Vp(this.spec.group,e);this.group=t,t&&t.appendChild(this)}const o=this.group?this.group.getGroupGraphicItem():t.defaultLayer,l=null!==(r=null===(n=null===(s=this.group)||void 0===s?void 0:s.children)||void 0===n?void 0:n.indexOf(this))&&void 0!==r?r:0;if(this.markType!==Xd.group){if(!this.graphicItem){const t=fm(this,Xd.group,{pickable:!1,zIndex:null!==(a=this.spec.zIndex)&&void 0!==a?a:0});(this.spec.support3d||dg.includes(this.markType))&&t.setMode("3d"),t.name=`${this.id()||this.markType}`,this.graphicItem=t}this.graphicParent=this.graphicItem,!o||this.graphicIndex===l&&this.graphicItem.parent===o||o.insertIntoKeepIdx(this.graphicItem,l)}else this.graphicParent=o;this.graphicIndex=l}update(t){var e;if(this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||null===(e=this.updateAnimate)||void 0===e||e.call(this,t),this.markType!==Xd.group){if(P(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),P(t.clip)||this.graphicItem.setAttribute("clip",t.clip),!P(t.clipPath)){const e=y(t.clipPath)?t.clipPath:t.clipPath(this.elements);e&&e.length?this.graphicItem.setAttribute("path",e):this.graphicItem.setAttributes({path:e,clip:!1})}this.elementMap.forEach((t=>{t.updateGraphicItem()}))}else this.elementMap.forEach((t=>{t.updateGraphicItem()}))}createElement(){return new Hm(this)}evaluateJoin(t){var e,i,s,n;this.needClear=!0;const r=Gp(null!==(s=null!==(e=this.spec.key)&&void 0!==e?e:null===(i=this.grammarSource)||void 0===i?void 0:i.getDataIDKey())&&void 0!==s?s:()=>cg),a=Gp(null!==(n=this.spec.groupBy)&&void 0!==n?n:()=>cg),o=this.spec.sort,l=this.isCollectionMark(),h=new Set(this.elements.filter((t=>t.diffState===Kd.enter))),d=[];this.differ.setCallback(((t,e,i)=>{var s;const n=t;let o;if(P(e))o=this.elementMap.get(n),o&&(o.diffState=Kd.exit);else if(P(i)){if(o=this.elementMap.has(n)?this.elementMap.get(n):this.createElement(),o.diffState===Kd.exit){o.diffState=Kd.enter;const t=null===(s=this.animate)||void 0===s?void 0:s.getElementAnimators(o,Kd.exit);t&&t.forEach((t=>t.stop("start")))}o.diffState=Kd.enter;const i=l?t:a(e[0]);o.updateData(i,e,r),this.elementMap.set(n,o),d.push(o)}else if(o=this.elementMap.get(n),o){o.diffState=Kd.update;const i=l?t:a(e[0]);o.updateData(i,e,r),d.push(o)}h.delete(o)}));const c=null!=t?t:ug;l||this.differ.setCurrentData(ym(c,(t=>`${a(t)}-${r(t)}`),void 0)),this.differ.doDiff(),h.forEach((t=>{this.elementMap.delete(l?t.groupKey:`${t.groupKey}-${t.key}`),t.remove(),t.release()})),this.elements=d,o&&this.elements.length>=2&&this.elements.sort(((t,e)=>o(t.getDatum(),e.getDatum())))}evaluateState(t,e,i){e&&t.forEach((t=>{t.state(e,i)}))}evaluateGroupEncode(t,e,i){if(!this._groupKeys||!e)return;const s={};return this._groupKeys.forEach((n=>{const r=t.find((t=>t.groupKey===n));r&&(s[n]=Lm(e,r.items&&r.items[0]&&r.items[0].datum,r,i))})),this._groupEncodeResult=s,s}getChannelsFromConfig(t){const e=this.spec;return P(e.interactive)?null:{pickable:e.interactive}}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(rc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[$d.group],i);t.forEach((t=>{this.markType===Xd.glyph&&this._groupEncodeResult?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,this._groupEncodeResult[t.groupKey])})):(null==r?void 0:r[t.groupKey])&&!this.isCollectionMark()?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,r[t.groupKey])})):n&&t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n)})),t.encodeItems(t.items,e,this._isReentered,i),this.isCollectionMark()&&(null==r?void 0:r[t.groupKey])&&M(r[t.groupKey].defined)&&(t.items.forEach((e=>{e.nextAttrs.defined=r[t.groupKey].defined})),delete r[t.groupKey].defined)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic(this.isCollectionMark()?null==r?void 0:r[t.groupKey]:null)})),this.emit(rc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){var s;const n=null!=i?i:fm(this,this.markType,t);if(n){if(null===(s=this.renderContext)||void 0===s?void 0:s.progressive){let t;if(this._groupKeys){const i=this._groupKeys.indexOf(e);i>=0&&(t=this.graphicParent.getChildAt(i))}else t=this.graphicParent.at(0);this.isCollectionMark()?(n.incremental=1,t.appendChild(n)):t.incrementalAppendChild(n)}else this.graphicParent.appendChild(n);return n}}parseRenderContext(t,e){const i=this.markType!==Xd.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep0&&t.length>=this.spec.largeThreshold;if(i){const i=this.differ.getCurrentData();return i&&i.keys&&i.keys.some((t=>i.data.get(t).length>this.spec.progressiveThreshold))?{large:s,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:i.keys.reduce(((t,e)=>Math.max(Math.ceil(i.data.get(e).length/this.spec.progressiveStep),t)),1),groupedData:i.data}}:{large:s}}return{large:s}}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}canAnimateAfterProgressive(){return this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.canAnimate()}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex{t.incrementalClearChild()})),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}evaluateJoinProgressive(){var t,e,i;const s=this.renderContext.progressive.currentIndex,n=Gp(null!==(i=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==i?i:()=>cg),r=[];if(this.isCollectionMark())return this._groupKeys.forEach(((t,e)=>{const i=this.renderContext.progressive.groupedData.get(t),a=this.renderContext.progressive.step,o=i.slice(s*a,(s+1)*a);if(0===s){const e=this.createElement();e.diffState=Kd.enter,e.updateData(t,o,n),r.push(e)}else{const i=this.elements[e];i.updateData(t,o,n),r.push(i)}})),r;const a={};return this._groupKeys.forEach((t=>{const e=this.renderContext.progressive.groupedData.get(t),i=this.renderContext.progressive.step,o=e.slice(s*i,(s+1)*i),l=[];o.forEach((e=>{const i=this.createElement();i.diffState=Kd.enter,i.updateData(t,[e],n),l.push(i),r.push(i)})),a[t]=l})),{groupElements:a,elements:r}}evaluateEncodeProgressive(t,e,i){const s=this.renderContext.progressive.currentIndex;if(0===s){if(this.evaluateEncode(t,e,i),0===s&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==Xd.glyph){const e=t[0],i=e.getGraphicItem(),s=null==i?void 0:i.parent;s&&this._groupEncodeResult[e.groupKey]&&s.setTheme({common:this._groupEncodeResult[e.groupKey]})}}else this.evaluateEncode(t,e,i,!0)}evaluateProgressive(){var t,e,i;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){this.renderContext.beforeTransformProgressive.progressiveRun();const t=this.renderContext.beforeTransformProgressive.output();return this.emit(rc.BEFORE_MARK_JOIN),this.evaluateJoin(t),this.emit(rc.AFTER_MARK_JOIN),this.emit(rc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(rc.AFTER_MARK_STATE),this.emit(rc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(rc.AFTER_MARK_ENCODE)}if(!(null===(e=this.renderContext)||void 0===e?void 0:e.progressive))return;const s=this.renderContext.parameters;this.emit(rc.BEFORE_MARK_JOIN);const n=this.evaluateJoinProgressive(),r=Array.isArray(n)?n:n.elements;if(this.emit(rc.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupKeys.forEach((t=>{const e=fm(this,Xd.group,{pickable:!1,zIndex:this.spec.zIndex});e.incremental=this.renderContext.progressive.step,this.graphicParent.appendChild(e)})),this.elements=r):this.elements=this.elements.concat(r),this.emit(rc.BEFORE_MARK_STATE),this.evaluateState(r,this.spec.state,s),this.emit(rc.AFTER_MARK_STATE),this.emit(rc.BEFORE_MARK_ENCODE),Array.isArray(n))this.evaluateEncodeProgressive(r,this._getEncoders(),s);else{const t=n.groupElements;Object.keys(t).forEach((e=>{this.evaluateEncodeProgressive(t[e],this._getEncoders(),s)}))}this.emit(rc.AFTER_MARK_ENCODE);const a=null===(i=this._getTransformsAfterEncode())||void 0===i?void 0:i.filter((t=>!0===t.canProgressive));(null==a?void 0:a.length)&&this.evaluateTransform(a,this.elements,s),this.renderContext.progressive.currentIndex+=1}isLargeMode(){return this.renderContext&&this.renderContext.large}cleanExitElements(){this.elementMap.forEach(((t,e)=>{t.diffState!==Kd.exit||t.isReserved||(this.elementMap.delete(e),t.remove(),t.release())}))}getGroupGraphicItem(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}getBounds(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}getMorphConfig(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}getAttributeTransforms(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:mm[this.markType]}getContext(){return this._context}needSkipBeforeLayout(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;let i=this.group;for(;i;){if(!0===(null===(e=i.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;i=i.group}return!1}initEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}releaseEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}clear(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,super.clear()}prepareRelease(){var t;null===(t=this.animate)||void 0===t||t.stop(),this.elementMap.forEach((t=>t.diffState=Kd.exit)),this._finalParameters=this.parameters()}release(){this.releaseEvent(),this.elements.forEach((t=>t.release())),this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&vm(this.graphicItem),this.detachAll(),super.release()}}class Nm extends zm{constructor(t,e){super(t,Xd.group,e),this.children=[]}parseRenderContext(){return{large:!1}}appendChild(t){return this.children.push(t),this}removeChild(t){return this.children=this.children.filter((e=>e!==t)),this}includesChild(t,e=!0){return!!this.children.includes(t)||!!e&&this.children.some((e=>e.markType===Xd.group&&e.includesChild(t,!0)))}updateLayoutChildren(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter((t=>t.needLayout())),this):this}getAttributeTransforms(){return mm.rect}evaluateJoin(t){if(!this.elements.length){const t=this.createElement();t.updateData(cg,ug,(()=>"")),this.elements=[t],this.elementMap.set(cg,t)}}getChannelsFromConfig(t){const e=this.spec,i={};if(P(e.clip)||(i.clip=e.clip),P(e.zIndex)||(i.zIndex=e.zIndex),!P(e.clipPath)){const s=rs(e.clipPath)?e.clipPath([t]):e.clipPath;s&&s.length?i.path=s:(i.path=null,i.clip=!1)}return P(e.interactive)||(i.pickable=e.interactive),i}evaluateGroupEncode(t,e,i){var s;const n=this.elements[0],r={};return Cm(n,[Object.assign({},null===(s=n.items)||void 0===s?void 0:s[0],{nextAttrs:r})],e,i),this._groupEncodeResult=r,r}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(rc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[$d.group],i);t.forEach((t=>{t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n,r)})),t.encodeItems(t.items,e,this._isReentered,i)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic()})),this.emit(rc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){const s=null!=i?i:fm(this,this.markType,t);if(s)return this.emit(rc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),s.name=`${this.id()||this.markType}`,this.graphicParent.insertIntoKeepIdx(s,this.graphicIndex),this.emit(rc.AFTER_ADD_VRENDER_MARK,{graphicItem:s}),s}}class Vm{constructor(t,e){this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=S(t)?e=>e[t]:t,this._warning=e}record(t){var e,i;const s=t.grammarType,n=this._mapKey(t);return this._grammarMap[s]?(this._grammars[s].push(t),P(n)||(this._grammarMap[s][n]?null===(e=this._warning)||void 0===e||e.call(this,n,t):this._grammarMap[s][n]=t)):(this._grammars.customized.push(t),P(n)||(this._grammarMap.customized[n]?null===(i=this._warning)||void 0===i||i.call(this,n,t):this._grammarMap.customized[n]=t)),this._size+=1,this}unrecord(t){const e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter((e=>e!==t)),P(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter((e=>e!==t)),P(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}size(){return this._size}getSignal(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}getData(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}getScale(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}getCoordinate(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}getMark(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}getCustomized(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}getGrammar(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}getAllSignals(){return this._grammars.signal}getAllData(){return this._grammars.data}getAllScales(){return this._grammars.scale}getAllCoordinates(){return this._grammars.coordinate}getAllMarks(){return this._grammars.mark}getAllCustomized(){return this._grammars.customized}traverse(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach((e=>(null!=e?e:[]).forEach((e=>{t.call(null,e)}))))}find(t){let e=null;return this.traverse((i=>!0===t.call(null,i)&&(e=i,!0))),e}filter(t){const e=[];return this.traverse((i=>{!0===t.call(null,i)&&e.push(i)})),e}clear(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}release(){this._size=0,this._grammars=null,this._grammarMap=null}}class Wm extends Vm{constructor(){super(...arguments),this._markNodes=[]}record(t){if(super.record(t),"mark"===t.grammarType){const e=t,i={mark:e,parent:null,children:[]};this._markNodes.forEach((t=>{const s=t.mark;s.markType===Xd.group&&s.includesChild(e,!1)?(t.children.push(i),i.parent=t):e.markType===Xd.group&&e.includesChild(s,!1)&&(i.children.push(t),t.parent=i)})),this._markNodes.push(i)}return this}unrecord(t){if(super.unrecord(t),"mark"===t.grammarType){const e=t,i=this._markNodes.find((t=>t.mark===e));this._markNodes.forEach((t=>{t.mark.markType===Xd.group&&t.children.includes(i)?(t.children=t.children.filter((t=>t!==i)),i.parent=null):e.markType===Xd.group&&i.children.includes(t)&&(i.children=i.children.filter((e=>e!==t)),t.parent=null)})),this._markNodes=this._markNodes.filter((t=>t!==i))}return this}getAllMarkNodes(){return this._markNodes}clear(){super.clear(),this._markNodes=[]}release(){super.release(),this._markNodes=null}}class Gm extends zm{addGraphicItem(t,e){const i=t&&t.limitAttrs,s=fm(this,i&&("rich"===i.textType||i.text&&"rich"===i.text.type)?Xd.richtext:Xd.text,t);return super.addGraphicItem(t,e,s)}release(){super.release()}}Gm.markType=Xd.text;const Um={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},$m={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},Km=Object.assign({},Um);Km.axis=Object.assign({},Km.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Km.circleAxis=Object.assign({},Km.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Km.grid=Object.assign({},Km.grid,{style:{stroke:"#404349"}}),Km.circleGrid=Object.assign({},Km.circleGrid,{style:{stroke:"#404349"}}),Km.rectLabel=Object.assign({},Km.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Km.lineLabel=Object.assign({},Km.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Km.symbolLabel=Object.assign({},Km.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Km.title=Object.assign({},Km.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});const Xm={name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:$m,components:Km},qm={name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:$m,components:Um};class Zm{static registerTheme(t,e){t&&Zm._themes.set(t,e)}static unregisterTheme(t){Zm._themes.delete(t)}static getTheme(t){return Zm._themes.get(t)}static getDefaultTheme(){return Zm.getTheme("default")}}Zm._themes=new Map,Zm.registerTheme("default",qm),Zm.registerTheme("dark",Xm);class Jm extends zm{constructor(t,e,i,s){super(t,Xd.component,i),this._componentDatum={[cg]:0},this.componentType=e,this.spec.type="component",this.spec.componentType=e,this.mode=s,this._updateComponentEncoders()}configureComponent(t){return this.spec.componentConfig=t,this.commit(),this}addGraphicItem(t,e,i){const s=null!=i?i:pc.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return s&&(this.emit(rc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),this.graphicParent.appendChild(s),this.emit(rc.AFTER_ADD_VRENDER_MARK,{graphicItem:s})),s}join(t){return super.join(t,cg)}encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(),this}parseRenderContext(){return{large:!1}}_prepareRejoin(){this._componentDatum[cg]+=1}evaluateJoin(t){return this.spec.key=cg,t?(t[cg]=this._componentDatum[cg],this._componentDatum=t):this._componentDatum={[cg]:this._componentDatum[cg]},super.evaluateJoin([this._componentDatum])}_updateComponentEncoders(){this._encoders=this.spec.encode}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}const Qm=Symbol.for("key");class t_{diffGrammar(t,e){return function(t,e,i){const s={enter:[],exit:[],update:[]},n=new bm(t,i);return n.setCallback(((t,e,i)=>{P(e)?s.exit.push({prev:i[0]}):P(i)?s.enter.push({next:e[0]}):s.update.push({next:e[0],prev:i[0]})})),n.setCurrentData(ym(e,i)),n.doDiff(),s}(t,e,(t=>{var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()}))}diffMark(t,e,i){const s={enter:[],exit:[],update:[]};let n=[],r=[];t.forEach((t=>{t.markType!==Xd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?n.push(t):s.exit.push({prev:[t]})})),e.forEach((t=>{t.markType!==Xd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?r.push(t):s.enter.push({next:[t]})}));const a=this.diffUpdateByGroup(n,r,(t=>t.getMorphConfig().morphKey),(t=>t.getMorphConfig().morphKey));n=a.prev,r=a.next,s.update=s.update.concat(a.update);const o=this.diffUpdateByGroup(n,r,(t=>t.id()),(t=>t.id()));n=o.prev,r=o.next,s.update=s.update.concat(o.update);const l=ym(n,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)})),h=ym(r,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)}));return Object.keys(h).forEach((t=>{const e=l.data.get(t),i=h.data.get(t);if(e&&i){for(let t=0;t!e.includes(t))),r=r.filter((t=>!i.includes(t)))}})),n.forEach((t=>s.exit.push({prev:[t]}))),r.forEach((t=>s.enter.push({next:[t]}))),s}diffUpdateByGroup(t,e,i,s){const n=ym(t,(t=>{var e;return null!==(e=i(t))&&void 0!==e?e:Qm})),r=ym(e,(t=>{var e;return null!==(e=s(t))&&void 0!==e?e:Qm}));let a=t,o=e;const l=[];return r.keys.forEach((t=>{if(t!==Qm){const e=n.data.get(t),i=r.data.get(t);e&&i&&(l.push({prev:e,next:i}),a=a.filter((t=>!e.includes(t))),o=o.filter((t=>!i.includes(t))))}})),{prev:a,next:o,update:l}}}class e_ extends(o()){static useRegisters(t){t.forEach((t=>{t()}))}constructor(t={},e={}){super(),this._observer=null,this._onResize=Uo(((...t)=>{const e=this._getContainerSize();e&&this.resize(e.width,e.height)}),100),this.delegateEvent=(t,e)=>{var i;const s=null===(i=t.target)||void 0===i?void 0:i[lg],n=om(0,t,s,0,Qg);this.emit(e,n,s)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach((t=>{t.isDoingProgressive()&&t.evaluateProgressive()})),this.doPreProgressive()},this._config=e,this._options=Object.assign({mode:"browser"},t),this.initialize()}getGrammarById(t){return this.grammars.getGrammar(t)}getSignalById(t){return this.grammars.getSignal(t)}getDataById(t){return this.grammars.getData(t)}getScaleById(t){return this.grammars.getScale(t)}getCoordinateById(t){return this.grammars.getCoordinate(t)}getMarkById(t){return this.grammars.getMark(t)}getCustomizedById(t){return this.grammars.getCustomized(t)}getGrammarsByName(t){return this.grammars.filter((e=>e.name()===t))}getGrammarsByType(t){return this.grammars.filter((e=>e.grammarType===t))}getMarksByType(t){return this.grammars.getAllMarks().filter((e=>e.markType===t))}getMarksByName(t){return this.grammars.getAllMarks().filter((e=>e.name()===t))}getMarksBySelector(t){if(!t)return null;const e=Ra(t),i=[];return e.forEach((t=>{if(Wp(t))return void i.push(t);if("#"===t[0]){const e=this.getMarkById(t.slice(1));return void(e&&i.push(e))}const e="@"===t[0]?this.getMarksByName(t.slice(1)):Xd[t]?this.getMarksByType(t):null;e&&e.length&&e.forEach((t=>{i.push(t)}))})),i}updateSignal(t,e){S(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}signal(t,e){const i=new lm(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}data(t){const e=new Qp(this,t);return this.grammars.record(e),this._dataflow.add(e),e}scale(t){const e=pc.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}coordinate(t){const e=pc.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}mark(t,e,i){const s=S(e)?this.getMarkById(e):e;let n;switch(t){case Xd.group:n=new Nm(this,s);break;case Xd.glyph:const e=pc.getMark(Xd.glyph);e&&(n=new e(this,null==i?void 0:i.glyphType,s));break;case Xd.component:n=pc.hasComponent(null==i?void 0:i.componentType)?pc.createComponent(null==i?void 0:i.componentType,this,s,null==i?void 0:i.mode):new Jm(this,null==i?void 0:i.componentType,s,null==i?void 0:i.mode);break;case Xd.text:n=new Gm(this,t,s);break;default:n=pc.hasMark(t)?pc.createMark(t,this,s):new zm(this,t,s)}return this.grammars.record(n),this._dataflow.add(n),n}group(t){return this.mark(Xd.group,t)}glyph(t,e){return this.mark(Xd.glyph,e,{glyphType:t})}component(t,e,i="2d"){return this.mark(Xd.component,e,{componentType:t,mode:i})}axis(t,e="2d"){return this.mark(Xd.component,t,{componentType:qd.axis,mode:e})}grid(t,e="2d"){return this.mark(Xd.component,t,{componentType:qd.grid,mode:e})}legend(t){return this.mark(Xd.component,t,{componentType:qd.legend})}slider(t){return this.mark(Xd.component,t,{componentType:qd.slider})}label(t){return this.mark(Xd.component,t,{componentType:qd.label})}datazoom(t){return this.mark(Xd.component,t,{componentType:qd.datazoom})}player(t){return this.mark(Xd.component,t,{componentType:qd.player})}title(t){return this.mark(Xd.component,t,{componentType:qd.title})}scrollbar(t){return this.mark(Xd.component,t,{componentType:qd.scrollbar})}customized(t,e){const i=pc.createGrammar(t,this,null==e?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}addGrammar(t){return this.grammars.find((e=>e.uid===t.uid))||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}removeGrammar(t){const e=S(t)?this.getGrammarById(t):t;return e&&this.grammars.find((t=>t.uid===e.uid))?("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}removeAllGrammars(){return this.grammars.traverse((t=>{"signal"===t.grammarType&&dm.includes(t.id())||"mark"===t.grammarType&&"root"===t.id()||this.removeGrammar(t)})),this}removeAllGraphicItems(){return this.traverseMarkTree((t=>{t.graphicItem&&(vm(t.graphicItem),t.elementMap.forEach((t=>{t.resetGraphicItem()})),t.graphicItem=null)})),this}parseSpec(t){var e,i,s,n,r,a,o,l;if(this.emit(rc.BEFORE_PARSE_VIEW),this._spec=t,(t=>{var e;const i=(t,e)=>{var s,n;t.group=e;const r=null!==(s=t.id)&&void 0!==s?s:"VGRAMMAR_MARK_"+ ++hm;t.id=r,(null!==(n=t.marks)&&void 0!==n?n:[]).forEach((t=>i(t,r)))};(null!==(e=t.marks)&&void 0!==e?e:[]).forEach((t=>i(t,"root")))})(t),t.theme?this.theme(t.theme):this.theme(Zm.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==i?i:this._theme.padding),!this.width()||!this.height()){const t=this._getContainerSize();t&&(this.updateSignal(tm,t.width),this.updateSignal(em,t.height))}(null===(s=t.signals)||void 0===s?void 0:s.length)&&t.signals.forEach((t=>{this.signal().parse(t)})),(null===(n=t.data)||void 0===n?void 0:n.length)&&t.data.forEach((t=>{this.data(null).parse(t)})),(null===(r=t.coordinates)||void 0===r?void 0:r.length)&&t.coordinates.forEach((t=>{var e;null===(e=this.coordinate(t.type))||void 0===e||e.parse(t)})),(null===(a=t.scales)||void 0===a?void 0:a.length)&&t.scales.forEach((t=>{var e;null===(e=this.scale(t.type))||void 0===e||e.parse(t)}));const h=pc.getGrammars();return Object.keys(h).forEach((e=>{const{specKey:i}=h[e];t[i]&&t[i].length&&t[i].forEach((t=>{this.customized(e,t)}))})),t.marks&&t.marks.length&&t.marks.forEach((t=>{this.parseMarkSpec(t)})),t.events&&t.events.length&&t.events.forEach((t=>{var e;null===(e=this.event)||void 0===e||e.call(this,t)})),t.interactions&&t.interactions.length&&t.interactions.forEach((t=>{this.interaction(t.type,t)})),!1===t.animation?null===(o=this.animate)||void 0===o||o.disable():null===(l=this.animate)||void 0===l||l.enable(),this.emit(rc.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=nc.before,this}updateSpec(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}parseBuiltIn(){((t,e,i)=>{var s,n,r,a,o;return[{id:tm,value:null!==(s=t[tm])&&void 0!==s?s:0},{id:em,value:null!==(n=t[em])&&void 0!==n?n:0},{id:nm,value:cm(null!==(a=null!==(r=t[nm])&&void 0!==r?r:e[nm])&&void 0!==a?a:null==i?void 0:i.padding)},{id:im,update:{callback:(t,e)=>{const i=cm(e[nm]);return e[tm]-i.left-i.right},dependency:[tm,nm]}},{id:sm,update:{callback:(t,e)=>{const i=cm(e[nm]);return e[em]-i.top-i.bottom},dependency:[em,nm]}},{id:rm,update:{callback:(t,e)=>{const i=cm(e[nm]);return(t||new It).setValue(i.left,i.top,i.left+e[im],i.top+e[sm])},dependency:[im,sm,nm]}},{id:am,value:null!==(o=t[am])&&void 0!==o?o:e[am]}]})(this._options,this._config,this.getCurrentTheme()).forEach((t=>{const e=this.signal().parse(t);t.value&&e.set(t.value)})),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}parseMarkSpec(t){var e;const i=t.type===Xd.glyph?{glyphType:t.glyphType}:t.type===Xd.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),null===(e=t.marks)||void 0===e||e.forEach((t=>{this.parseMarkSpec(t)}))}theme(t){var e,i,s,n,r,a;S(t)?this._theme=null!==(e=Zm.getTheme(t))&&void 0!==e?e:Zm.getDefaultTheme():this._theme=t;const{background:o,padding:l}=null!==(i=this._spec)&&void 0!==i?i:{};return this._theme?(this.background(null!==(s=null!=o?o:this._options.background)&&void 0!==s?s:this._theme.background),this.padding(null!==(n=null!=l?l:this._options.padding)&&void 0!==n?n:this._theme.padding),null===(a=null===(r=this.renderer.stage())||void 0===r?void 0:r.setTheme)||void 0===a||a.call(r,Object.assign({},this._theme.marks))):(this.background(null!=o?o:this._options.background),this.padding(null!=l?l:this._options.padding)),this}getCurrentTheme(){return this._theme}setCurrentTheme(t,e=!0){return this.theme(t),this.grammars.getAllMarks().forEach((t=>{t.commit()})),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}background(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}width(t){const e=this.getSignalById(tm);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}height(t){const e=this.getSignalById(em);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}viewWidth(t){const e=this.getSignalById(im);if(arguments.length){const e=this.padding();return this.width(t+e.left+e.right),t}return e.output()}viewHeight(t){const e=this.getSignalById(sm);if(arguments.length){const e=this.padding();return this.height(t+e.top+e.bottom),t}return e.output()}padding(t){const e=this.getSignalById(nm);if(arguments.length){const i=cm(t);return this.updateSignal(e,i),i}return cm(e.output())}autoFit(t){const e=this.getSignalById(am);return arguments.length?(this.updateSignal(e,t),t):e.output()}getViewBox(){const t=this.getSignalById(rm);return null==t?void 0:t.output()}updateLayoutTag(){return this._layoutState=nc.before,this}getLayoutState(){return this._layoutState}buildLayoutTree(){const t={},e=[];this.traverseMarkTree((i=>{t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===Xd.group&&i.updateLayoutChildren()}),(t=>t.needLayout())),this._layoutMarks=e}doLayout(){var t;const e=this._options.doLayout||pc.getDefaultLayout();e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(rc.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(rc.AFTER_DO_LAYOUT))}handleLayoutEnd(){this.emit(rc.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach((t=>{og(t,"layoutChildren",(t=>{t.handleLayoutEnd()}),(e=>e!==t))})),this.emit(rc.AFTER_MARK_LAYOUT_END)}handleRenderEnd(){this.emit(rc.BEFORE_MARK_RENDER_END),og(this.rootMark,"children",(t=>{t.handleRenderEnd()})),this.emit(rc.AFTER_MARK_RENDER_END)}commit(t){return this._dataflow.commit(t),this}run(t){return this.evaluate(t),this}doRender(t){this.emit(rc.BEFORE_DO_RENDER),this.renderer&&(!this._progressiveMarks&&this.animate?this.animate.animate():this.traverseMarkTree((t=>{t.cleanExitElements()}),null,!0),this.renderer.render(t),this.handleRenderEnd()),this.emit(rc.AFTER_DO_RENDER)}evaluate(t){var e,i;const s=(t=>{var e,i,s,n,r;const{reuse:a=gg,morph:o=mg,morphAll:l=_g,animation:h={},enableExitAnimation:d=fg}=null!=t?t:{};return{reuse:a,morph:o,morphAll:l,animation:{easing:null!==(e=h.easing)&&void 0!==e?e:Ag,delay:null!==(i=h.delay)&&void 0!==i?i:xg,duration:null!==(s=h.duration)&&void 0!==s?s:bg,oneByOne:null!==(n=h.oneByOne)&&void 0!==n?n:kg,splitPath:null!==(r=h.splitPath)&&void 0!==r?r:null},enableExitAnimation:d}})(t),n=this._cachedGrammars.size()>0;n&&(this.reuseCachedGrammars(s),this.detachCachedGrammar());const r=this._resizeRenderer(),a=this._dataflow.hasCommitted();return n||a||this._layoutState||r?(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=nc.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=nc.reevaluate,this._dataflow.evaluate()),this._layoutState=nc.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(i=this.morph)||void 0===i||i.call(this,s),this.releaseCachedGrammars(s),this.doRender(!0),this.doPreProgressive(),this):this}reuseCachedGrammars(t){if(t.reuse){const t=t=>{t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),this._cachedGrammars.unrecord(t.prev)};this._differ.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter((t=>!dm.includes(t.id())))).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(t)}this._differ.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter((t=>"root"!==t.id())),t).update.forEach((e=>{var i;const s=1===e.prev.length&&1===e.next.length&&e.prev[0].markType===e.next[0].markType,n=e.prev.every((t=>t.getMorphConfig().morph))&&e.next.every((t=>t.getMorphConfig().morph));t.morph&&n||t.morphAll?null===(i=this.addMorphMarks)||void 0===i||i.call(this,{prev:e.prev,next:e.next}):s&&t.reuse&&(e.next[0].reuse(e.prev[0]),e.prev[0].detachAll(),e.prev[0].clear(),this._cachedGrammars.unrecord(e.prev[0]))}))}detachCachedGrammar(){this._cachedGrammars.traverse((t=>{var e,i;if(t.detachAll(),"mark"===t.grammarType){const s=t;null===(i=null===(e=s.group)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,s)}}))}releaseCachedGrammars(t){this._cachedGrammars.traverse((t=>{"mark"!==t.grammarType&&t.release()}));const e=this._cachedGrammars.getAllMarkNodes();e.forEach((e=>{var i;null===(i=e.mark.animate)||void 0===i||i.stop(),t.enableExitAnimation&&this.animate&&this.animate.animateAddition(e.mark)}));const i=t=>{if(t.mark.view&&(!t.mark.animate||0===t.mark.animate.getAnimatorCount())&&(!t.children||0===t.children.length)){t.mark.release();const e=t.parent;e&&(t.parent.children=t.parent.children.filter((e=>e!==t)),t.parent=null,i(e))}};e.forEach((t=>{const e=t.mark;e.animate&&0===e.animate.getAnimatorCount()?i(t):e.addEventListener("animationEnd",(()=>{e.animate&&0===e.animate.getAnimatorCount()&&i(t)}))})),this._cachedGrammars.clear()}runAfter(t){return this._dataflow.runAfter((()=>{t.call(null,this)})),this}runBefore(t){return this._dataflow.runBefore((()=>{t.call(null,this)})),this}getImageBuffer(){var t,e;if("node"!==this._options.mode)return void this.logger.error(new TypeError("getImageBuffer() now only support node environment."));const i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}traverseMarkTree(t,e,i){return og(this.rootMark,"children",t,e,i),this}_bindResizeEvent(){var t,e,i,s,n,r;if(this.autoFit()){const a=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(a){const t=window.ResizeObserver;this._observer=new t(this._onResize),null===(r=this._observer)||void 0===r||r.observe(a)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}_getContainerSize(){var t,e,i,s,n,r,a,o,l,h,d;const c=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(c){const{width:t,height:e}=Yr(c);return{width:null!==(o=null!==(a=null===(r=this._spec)||void 0===r?void 0:r.width)&&void 0!==a?a:this._options.width)&&void 0!==o?o:t,height:null!==(d=null!==(h=null===(l=this._spec)||void 0===l?void 0:l.height)&&void 0!==h?h:this._options.height)&&void 0!==d?d:e}}return null}resize(t,e,i=!0){let s=!1;return t!==this.width()&&(s=!0,this.updateSignal(tm,t)),e!==this.height()&&(s=!0,this.updateSignal(em,e)),s&&(i?this.evaluate():this._dataflow.evaluate()),this}_resizeRenderer(){const t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}interaction(t,e){const i=pc.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}removeInteraction(t,e){if(this._boundInteractions){const i=this._boundInteractions.filter((i=>{var s;return P(e)?S(t)?i.type===t:t?i===t:void 0:(null===(s=i.options)||void 0===s?void 0:s.id)===e}));i.length&&i.forEach((t=>{t.unbind()}))}return this}removeAllInteractions(){return this._boundInteractions&&(this._boundInteractions.forEach((t=>{t.unbind()})),this._boundInteractions=null),this}initializeEventConfig(t){const e=Object.assign({defaults:{}},t),i=(t,e)=>{e.forEach((e=>{y(t[e])&&(t[e]=t[e].reduce(((t,e)=>(t[e]=!0,t)),{}))}))};return i(e.defaults,["prevent","allow"]),i(e,[Qg,Jg]),e}initEvent(){const t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}releaseStageEvent(){const t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}initializeRenderer(){const t=this._options.width,e=this._options.height;this.renderer=new Xg(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}initialize(){var t,e,i;this.grammars=new Vm((t=>t.id()),((t,e)=>this.logger.warn(`Grammar id '${t}' has been occupied`,e))),this._cachedGrammars=new Wm((t=>t.id())),this._options.logger&&g.setInstance(this._options.logger),this.logger=g.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new ag,this.animate=null===(e=this.initAnimate)||void 0===e?void 0:e.call(this,this),this._differ=new t_,this._options.hooks&&(Object.keys(this._options.hooks).forEach((t=>{this.on(t,this._options.hooks[t])})),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=this.initializeEventConfig(this._options.eventConfig),this._theme=this._options.disableTheme?null:Zm.getDefaultTheme(),this.parseBuiltIn(),(i=this._options).mode&&jo.setEnv(i.mode,i.modeParams||{}),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=nc.before,this.theme(this._theme)}pauseProgressive(){return!1}resumeProgressive(){return!1}restartProgressive(){return!1}findProgressiveMarks(){const t=[];return this.traverseMarkTree((e=>{t.push(e)}),(t=>t.markType!==Xd.group&&t.isProgressive())),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some((t=>t.isDoingProgressive()))){const t=jo.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}else this._progressiveMarks&&this._progressiveMarks.every((t=>t.canAnimateAfterProgressive()))?this.animate.animate():this._progressiveMarks&&(this._progressiveMarks=null)}clearProgressive(){this._progressiveRafId&&jo.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach((t=>{t.clearProgressive()})),this._progressiveMarks=null)}release(){var t,e,i,s;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),pc.unregisterRuntimeTransforms(),g.setInstance(null),null===(t=this.animate)||void 0===t||t.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(i=null===(e=this.renderer)||void 0===e?void 0:e.release)||void 0===i||i.call(e),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(s=this._eventListeners)||void 0===s||s.forEach((t=>{t.source.removeEventListener(t.type,t.handler)})),this._eventListeners=null}}var i_;function s_(t){switch(t){case n["desktop-browser"]:case n["mobile-browser"]:return"browser";case n.node:case n.worker:return"node";case n.miniApp:case n["desktop-miniApp"]:return"feishu";case n.lynx:return"lynx";case n.wx:return"wx";case n.tt:return"tt";case n.harmony:return"harmony"}return"browser"}!function(t){t.data="data",t.signal="signal",t.mark="mark"}(i_||(i_={}));class n_{getVGrammarView(){return this._view}getModel(){return this._model}constructor(t,e){this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._released=!1,this._model={[i_.signal]:{},[i_.data]:{},[i_.mark]:{}},this._compileChart=null,this.handleStageRender=()=>{var t,e;null===(e=null===(t=this._compileChart)||void 0===t?void 0:t.getEvent())||void 0===e||e.emit(jd.afterRender,{chart:this._compileChart})},this._container=t,this._option=e}getRenderer(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer}getCanvas(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.canvas()}getStage(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.stage()}initView(){var t,e,i,s;if(this._released)return;if(this.isInited=!0,this._view)return;const n=new g(null!==(t=this._option.logLevel)&&void 0!==t?t:u.Error);(null===(e=this._option)||void 0===e?void 0:e.onError)&&n.addErrorHandler(((...t)=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.onError)||void 0===i||i.call(e,...t)})),this._view=new e_(Object.assign(Object.assign({width:this._width,height:this._height,container:null!==(i=this._container.dom)&&void 0!==i?i:null,renderCanvas:null!==(s=this._container.canvas)&&void 0!==s?s:null,hooks:this._option.performanceHook},this._option),{mode:s_(this._option.mode),autoFit:!1,eventConfig:{gesture:cl(this._option.mode),disable:!1===this._option.interactive},doLayout:()=>{var t;null===(t=this._compileChart)||void 0===t||t.onLayout(this._view)},logger:n,logLevel:n.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==this._option.interactive&&this._viewListeners.forEach((t=>{var e;null===(e=this._view)||void 0===e||e.addEventListener(t.type,t.callback)}))}_setCanvasStyle(){if(this._view&&this._container.dom&&!S(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";const t=this.getCanvas();t&&(t.style.display="block")}}compileInteractions(){var t;if(this._view.removeAllInteractions(),null===(t=this._interactions)||void 0===t?void 0:t.length){const t={};this._interactions.forEach((e=>{var i;if(e.regionId){const s=`${e.regionId}-${e.type}-${null!==(i=e.id)&&void 0!==i?i:""}`,n=t[s];t[s]=n?Object.assign(Object.assign(Object.assign({},n),e),{selector:[...n.selector,...e.selector]}):e}else this._view.interaction(e.type,e)})),Object.keys(t).forEach((e=>{const i=this._view.interaction(t[e].type,t[e]);if(this._compileChart){const s=this._compileChart.getRegionsInIds([t[e].regionId])[0];s&&s.interaction.addVgrammarInteraction(i.getStartState(),i)}}))}}compile(t,e){if(this._released)return;const{chart:i}=t;this._compileChart=i,this.initView(),this._view&&(i.compile(),i.afterCompile(),this.updateDepend(),this.compileInteractions())}clearNextRender(){return!!this._nextRafId&&(jo.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null,!0)}clear(t,e=!1){const{chart:i}=t;this.clearNextRender(),i.clear(),this.releaseGrammar(e)}renderNextTick(t){this._released||this._nextRafId||(this._nextRafId=jo.getRequestAnimationFrame()((()=>{this._nextRafId=null,this.render(t)})))}render(t){var e,i;this._released||(this.initView(),this._view&&(null===(e=this._view)||void 0===e||e.run(t),this.clearNextRender()&&(null===(i=this._view)||void 0===i||i.run(t))))}updateViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}resize(t,e,i=!0){this._view&&(this._width=t,this._height=e,this._view.resize(t,e),i&&this.render({morph:!1}))}setBackground(t){var e;null===(e=this._view)||void 0===e||e.background(t)}setSize(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}setViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}addEventListener(t,e,i){var s,n;if(!1!==this._option.interactive)if(t===Hd.chart){const n=function(s,n){var r,a,o;const l=null!==(a=null===(r=null==n?void 0:n.mark)||void 0===r?void 0:r.getContext())&&void 0!==a?a:{},h=M(l.modelId)?l.modelId:null,d=M(l.markId)?l.markId:null,c=M(l.modelUserId)?l.modelUserId:null,u=M(l.markUserId)?l.markUserId:null,p={event:s,type:e,source:t,item:n,datum:(null===(o=null==n?void 0:n.getDatum)||void 0===o?void 0:o.call(n))||null,markId:d,modelId:h,markUserId:u,modelUserId:c};i.call(null,p)}.bind(this);this._viewListeners.set(i,{type:e,callback:n}),null===(s=this._view)||void 0===s||s.addEventListener(e,n)}else if(t===Hd.window){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._windowListeners.set(i,{type:e,callback:s});const n=this._getGlobalThis();null==n||n.addEventListener(e,s)}else if(t===Hd.canvas){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._canvasListeners.set(i,{type:e,callback:s});const r=null===(n=this.getStage())||void 0===n?void 0:n.window;null==r||r.addEventListener(e,s)}}removeEventListener(t,e,i){var s,n,r,a,o;if(!1!==this._option.interactive)if(t===Hd.chart){const t=null===(s=this._viewListeners.get(i))||void 0===s?void 0:s.callback;t&&(null===(n=this._view)||void 0===n||n.removeEventListener(e,t)),this._viewListeners.delete(i)}else if(t===Hd.window){const t=this._getGlobalThis(),s=null===(r=this._windowListeners.get(i))||void 0===r?void 0:r.callback;s&&(null==t||t.removeEventListener(e,s)),this._windowListeners.delete(i)}else if(t===Hd.canvas){const t=null===(a=this.getStage())||void 0===a?void 0:a.window,s=null===(o=this._canvasListeners.get(i))||void 0===o?void 0:o.callback;t&&s&&(null==t||t.removeEventListener(e,s)),this._canvasListeners.delete(i)}}releaseEvent(){const t=this.getStage();t&&t.hooks.afterRender.unTap("chart-event",this.handleStageRender),this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}release(){var t;this.clearNextRender(),this.releaseEvent(),this._option=this._container=null,this._releaseModel(),null===(t=this._view)||void 0===t||t.release(),this._view=null,this.isInited=!1,this._compileChart=null,this._released=!0}releaseGrammar(t=!1){var e,i;this._releaseModel(),t&&(null===(e=this._view)||void 0===e||e.removeAllGraphicItems()),null===(i=this._view)||void 0===i||i.removeAllGrammars()}_releaseModel(){Object.keys(this._model).forEach((t=>{Object.values(this._model[t]).forEach((t=>{Object.values(t).forEach((t=>{t.removeProduct(!0)}))})),this._model[t]={}}))}addGrammarItem(t){const e=t.getProduct();if(P(e))return;const i=e.id(),s=t.grammarType;P(this._model[s][i])&&(this._model[s][i]={}),this._model[s][i][t.id]=t}removeGrammarItem(t,e){var i;const s=t.getProduct();if(P(s))return;const n=s.id(),r=t.grammarType,a=this._model[r][n];M(a)&&(delete a[t.id],0===Object.keys(a).length&&delete this._model[r][n]),e||null===(i=this._view)||void 0===i||i.removeGrammar(s)}addInteraction(t){this._interactions||(this._interactions=[]),this._interactions.push(t)}removeInteraction(t){this._interactions&&(this._interactions=this._interactions.filter((e=>e.seriesId!==t)))}updateDepend(t){return M(t)&&t.length>0?t.every((t=>t.updateDepend())):(Object.values(this._model).forEach((t=>{Object.values(t).forEach((t=>{const e=Object.values(t),i=e[0].getProduct(),s=e.reduce(((t,e)=>e.getDepend().length>0?t.concat(e.getDepend()):t),[]).filter((t=>!!t)).map((t=>t.getProduct()));i.depend(s)}))})),!0)}_getGlobalThis(){var t;return dl(this._option.mode)?globalThis:null===(t=this.getStage())||void 0===t?void 0:t.window}}function r_(t,e){var i,s,n,r,a;return s=this,n=void 0,a=function*(){if(!t)return"";try{if(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)return function(t){return new Promise((e=>{t.convertToBlob().then((t=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>{e(i.result)}}))}))}(t)}catch(t){(null!==(i=null==e?void 0:e.onError)&&void 0!==i?i:gl)(`getCanvasDataURL error : ${t.toString()}`)}return t.toDataURL()},new((r=void 0)||(r=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(t){e(t)}}function o(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var s;e.done?t(e.value):(s=e.value,s instanceof r?s:new r((function(t){t(s)}))).then(i,o)}l((a=a.apply(s,n||[])).next())}))}const a_={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},o_={poptip:E({},a_)};function l_(){l_.__loaded||(l_.__loaded=!0,Gr.RegisterGraphicCreator("group",Hn))}l_.__loaded=!1;const h_=l_;class d_{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,s,n,r,a,o,l){const h=[],d=[e,i],c=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===s||"start"===s||("center"===s?c[0]=d[0]/-2:"right"!==s&&"end"!==s||(c[0]=-d[0])),"top"===n||("middle"===n?c[1]=d[1]/-2:"bottom"===n&&(c[1]=-d[1]));const u={xOffset:c[0],yOffset:c[1],width:d[0],height:d[1]};return this.layoutWithBBox(u,h,s,n,r)}GetLayoutByLines(t,e,i,s,n="",r,a,o="end"){t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,s=t.length;iMath.max(t,e.width)),0);const d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,l,e,i,s)}layoutWithBBox(t,e,i,s,n){const r=[0,0],a=e.length*n;"top"===s||("middle"===s?r[1]=(t.height-a)/2:"bottom"===s&&(r[1]=t.height-a));for(let a=0;at.text)).join("")!==e.text.toString():null!=this.clipedText&&this.clipedText!==e.text.toString())}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=On,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return y(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return Qi(this).text}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=oi.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;return o&&(dn(n,o/Math.abs(r+a),!0,l),i.union(n)),oi.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||oi.graphicService.updateHTMLTextAABBBounds(t,e,i),Rt(i,i,this.transMatrix),i}updateWrapAABBBounds(t){var e,i,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:m=r.fontWeight,ignoreBuf:_=r.ignoreBuf,suffixPosition:f=r.suffixPosition,heightLimit:v=0,lineClamp:b}=this.attribute,x=null!==(e=Qs(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,S=_?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}const M=oi.graphicUtil.textMeasure,k=new d_(a,{fontSize:h,fontWeight:m,fontFamily:a},M),A=y(t)?t.map((t=>t.toString())):[t.toString()],w=[],T=[0,0];let C=1/0;if(v>0&&(C=Math.max(Math.floor(v/x),1)),b&&(C=Math.min(C,b)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t{t=Math.max(t,e.width)})),T[0]=t}else{let t,e,i=0;for(let s=0,n=A.length;s{const e=t.direction===pn.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:p,fontFamily:g});a+=e,t.width=e})),this.cache.verticalList=S,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const M=zr(b,a),k=Nr(x,y,u);return this._AABBBounds.set(k,M,k+y,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),{wrap:n=s.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,fontWeight:d=s.fontWeight,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:p=s.stroke,lineWidth:g=s.lineWidth,whiteSpace:m=s.whiteSpace,suffixPosition:_=s.suffixPosition}=r,f=null!==(e=Qs(r.lineHeight,r.fontSize||s.fontSize))&&void 0!==e?e:r.fontSize||s.fontSize;if("normal"===m)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const v=oi.graphicUtil.textMeasure,y=new d_(a,{fontSize:h,fontWeight:d,fontFamily:a},v).GetLayoutByLines(t,o,l,f,!0===c?s.ellipsis:c||void 0,!1,u,_),{bbox:b}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),r=oi.graphicUtil.textMeasure;let a;const o=this.attribute,{ignoreBuf:l=n.ignoreBuf}=o,h=l?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontFamily:u=n.fontFamily,fontSize:p=n.fontSize,fontWeight:g=n.fontWeight,stroke:m=n.stroke,lineWidth:_=n.lineWidth,verticalMode:f=n.verticalMode,suffixPosition:v=n.suffixPosition}=o,y=null!==(e=Qs(o.lineHeight,o.fontSize||n.fontSize))&&void 0!==e?e:(o.fontSize||n.fontSize)+h;let{textAlign:b=n.textAlign,textBaseline:x=n.textBaseline}=o;if(!f){const t=b;b=null!==(i=u_.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(s=u_.alignMapBaseline[t])&&void 0!==s?s:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=ut(e,a)}));const t=zr(b,a),e=this.cache.verticalList.length*y,i=Nr(x,e,p);return this._AABBBounds.set(i,t,i+e,t+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}const S=t.map((t=>gn(t.toString())));S.forEach(((t,e)=>{if(Number.isFinite(d))if(c){const i=!0===c?n.ellipsis:c,s=r.clipTextWithSuffixVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,i,!1,v);S[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,!1);S[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===pn.HORIZONTAL?p:r.measureTextWidth(t.text,{fontSize:p,fontWeight:g,fontFamily:u});a+=e,t.width=e}))})),this.cache.verticalList=S,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=ut(e,a)}));const M=zr(b,a),k=this.cache.verticalList.length*y,A=Nr(x,k,p);return this._AABBBounds.set(A,M,A+k,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}needUpdateTags(t,e=c_){return super.needUpdateTags(t,e)}needUpdateTag(t,e=c_){return super.needUpdateTag(t,e)}clone(){return new u_(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return u_.NOWORK_ANIMATE_ATTR}}function p_(t){return new u_(t)}let g_,m_;function __(t){return g_||(g_=Gr.CreateGraphic("text",{})),g_.initAttributes(t),g_.AABBBounds}u_.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},ln),u_.baselineMapAlign={top:"left",bottom:"right",middle:"center"},u_.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const f_=new class extends co{constructor(){super(...arguments),this.time=te.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){var u,p,g,m,_,f,v,y,b,x;const{backgroundMode:S=l.backgroundMode,backgroundFit:M=l.backgroundFit}=t.attribute;let k,{background:A}=t.attribute;if(!A)return;const w=()=>{"richtext"===t.type&&(e.restore(),e.save(),k&&e.setTransformFromMatrix(k,!0,1))};let T;"richtext"===t.type&&(k=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const C=ns(A)&&A.background,L=t.transMatrix.onlyTranslate();if(C){const e=t.AABBBounds,i=(null!==(u=A.x)&&void 0!==u?u:e.x1)+(null!==(p=A.dx)&&void 0!==p?p:0),s=(null!==(g=A.y)&&void 0!==g?g:e.y1)+(null!==(m=A.dy)&&void 0!==m?m:0),n=null!==(_=A.width)&&void 0!==_?_:e.width(),r=null!==(f=A.height)&&void 0!==f?f:e.height();if(T=Pa.allocate(i,s,i+n,s+r),A=A.background,!L){const t=T.width(),e=T.height();T.set((null!==(v=A.x)&&void 0!==v?v:0)+(null!==(y=A.dx)&&void 0!==y?y:0),(null!==(b=A.y)&&void 0!==b?b:0)+(null!==(x=A.dy)&&void 0!==x?x:0),t,e)}}else T=t.AABBBounds,L||(T=__(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const n=t.resources.get(A);if("success"!==n.state||!n.data)return void w();e.highPerformanceSave(),L&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,T,S,M),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=A,n?(Na(e,T.x1,T.y1,T.width(),T.height(),n),e.fill()):e.fillRect(T.x1,T.y1,T.width(),T.height()),e.highPerformanceRestore()}C&&Pa.free(T),w()}};var v_=function(t,e){return function(i,s){e(i,s,t)}};let y_=class extends vo{constructor(t){super(),this.textRenderContribitions=t,this.numberType=On,this.builtinContributions=[f_],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=Qi(t,null==r?void 0:r.theme).text,{text:u,underline:p=c.underline,lineThrough:g=c.lineThrough,keepDirIn3d:m=c.keepDirIn3d,direction:_=c.direction,fontSize:f=c.fontSize,verticalMode:v=c.verticalMode,x:y=c.x,y:b=c.y}=t.attribute;let{textAlign:x=c.textAlign,textBaseline:S=c.textBaseline}=t.attribute;if(!v&&"vertical"===_){const e=x;x=null!==(l=t.getBaselineMapAlign()[S])&&void 0!==l?l:"left",S=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const M=null!==(d=Qs(t.attribute.lineHeight,f))&&void 0!==d?d:f,k=this.valid(t,c,a,o);if(!k)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:C}=k,L=!m,E=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,T,C,A,w,c,n,a,o),L&&this.transformUseContext2d(t,c,E,e);const P=(n,r,l,h)=>{let d=i+r;const u=s+l;if(h){e.highPerformanceSave(),d+=f;const t=Lr.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,u),e.transformFromMatrix(t,!0),Lr.free(t)}C&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),e.strokeText(n,d,u,E))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),e.fillText(n,d,u,E),this.drawUnderLine(p,g,t,d,u,E,c,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,E),"horizontal"===_){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;C&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,E)})))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((n=>{var a;e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,E),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s-(a=f,"top"=="bottom"?Math.ceil(.79*a):Math.round(-.21*a))-.05*f,E,c,e,{width:n.width})}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:s}=i;e.textAlign="left",e.textBaseline="top";const n=M*s.length;let r=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);r=ut(e,r)}));let a=0,o=0;"bottom"===S?o=-n:"middle"===S&&(o=-n/2),"center"===x?a-=r/2:"right"===x&&(a-=r),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),s=r-i;let l=a;"center"===x?l+=s/2:"right"===x&&(l+=s),t.forEach((t=>{const{text:i,width:s,direction:r}=t;P(i,n-(e+1)*M+o,l,r),l+=s}))}))}else if("horizontal"===_){e.setTextStyle(t.attribute,c,E);const i=t.clipedText;let s=0;M!==f&&("top"===S?s=(M-f)/2:"middle"===S||"bottom"===S&&(s=-(M-f)/2)),P(i,0,s,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,c,E);const{verticalList:s}=i;let n=0;const r=s[0].reduce(((t,e)=>t+(e.width||0)),0);let a=0;"bottom"===S?a=-M:"middle"===S&&(a=-M/2),"center"===x?n-=r/2:"right"===x&&(n-=r),e.textAlign="left",e.textBaseline="top",s[0].forEach((t=>{const{text:e,width:i,direction:s}=t;P(e,a,n,s),n+=i}))}}L&&this.restoreTransformUseContext2d(t,c,E,e),this.afterRenderStep(t,e,i,s,T,C,A,w,c,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:d=a.textBaseline,fontSize:c=a.fontSize,fill:u=a.fill,opacity:p=a.opacity,underlineOffset:g=a.underlineOffset,underlineDash:m=a.underlineDash,fillOpacity:_=a.fillOpacity}=i.attribute,f=!P(l),v=f?l.width:i.clipedWidth,y=f?0:zr(h,v),b=Nr(f?"alphabetic":d,c,c),x={lineWidth:0,stroke:u,opacity:p,strokeOpacity:_};let S=f?-3:0;if(t){x.lineWidth=t,o.setStrokeStyle(i,x,s,n,a),m&&o.setLineDash(m),o.beginPath();const e=n+b+c+g+S;o.moveTo(s+y,e,r),o.lineTo(s+y+v,e,r),o.stroke()}if(f&&(S=-1),e){x.lineWidth=e,o.setStrokeStyle(i,x,s,n,a),o.beginPath();const t=n+b+c/2+S;o.moveTo(s+y,t,r),o.lineTo(s+y+v,t,r),o.stroke()}}};y_=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),v_(0,$(X)),v_(0,K(oo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],y_);let b_=!1;const x_=new B((t=>{b_||(b_=!0,t(dr).to(y_).inSingletonScope(),t(ir).toService(dr),t(oo).toService(po),Z(t,oo))})),S_=ol(),M_=Symbol.for("MathPickerContribution"),k_=Symbol.for("MathArcPicker"),A_=Symbol.for("MathAreaPicker"),w_=Symbol.for("MathCirclePicker"),T_=Symbol.for("MathImagePicker"),C_=Symbol.for("MathLinePicker"),L_=Symbol.for("MathPathPicker"),E_=Symbol.for("MathRectPicker"),P_=Symbol.for("MathSymbolPicker"),D_=Symbol.for("MathTextPicker"),O_=Symbol.for("MathPolygonPicker"),R_=Symbol.for("MathGlyphPicker"),I_=Symbol.for("CanvasArcPicker"),B_=Symbol.for("CanvasArc3dPicker"),F_=Symbol.for("CanvasAreaPicker"),Y_=Symbol.for("CanvasCirclePicker"),j_=Symbol.for("CanvasImagePicker"),H_=Symbol.for("CanvasLinePicker"),z_=Symbol.for("CanvasPathPicker"),N_=Symbol.for("CanvasRectPicker"),V_=Symbol.for("CanvasRect3dPicker"),W_=Symbol.for("CanvasSymbolPicker"),G_=Symbol.for("CanvasTextPicker"),U_=Symbol.for("CanvasPolygonPicker"),$_=Symbol.for("CanvasPyramid3dPicker"),K_=Symbol.for("CanvasRichTextPicker"),X_=Symbol.for("CanvasGlyphPicker"),q_=Symbol.for("CanvasGroupPicker"),Z_=Symbol.for("CanvasPickerContribution");class J_ extends vo{contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();const r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=e;if(s.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Er.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let Q_=class extends J_{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=On}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.AABBBounds;if(!s.camera)return!!n.containsPoint(e);s.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,s,o),{x:h,y:d,z:c,lastModelMatrix:u}=l;this.canvasRenderer.z=c;let p=e;if(s.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,s,h,d,{},null,((e,i,s)=>{if(g)return!0;const{fontSize:n=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,u=l.height(),m=l.width(),_=Nr(a,u,n),f=zr(o,m);return e.rect(f+h,_+d,m,u,c),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,s.modelMatrix!==u&&Er.free(s.modelMatrix),s.modelMatrix=u,s.highPerformanceRestore(),g}};Q_=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(dr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Q_);let tf=!1;const ef=new B(((t,e,i,s)=>{tf||(tf=!0,t(G_).to(Q_).inSingletonScope(),t(Z_).toService(G_))}));let sf=class{constructor(){this.type="text",this.numberType=On}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};sf=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],sf);let nf=!1;const rf=new B(((t,e,i,s)=>{nf||(nf=!0,t(D_).to(sf).inSingletonScope(),t(M_).toService(D_))}));function af(){af.__loaded||(af.__loaded=!0,Gr.RegisterGraphicCreator("text",p_),Di.load(x_),Di.load(S_?ef:rf))}af.__loaded=!1;const of=af;class lf{bounds(t,e){if(h(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function hf(t,e,i,s,n){return n?t.arc(i,s,e,0,ot,!1,n):t.arc(i,s,e,0,ot),!1}const df=new class extends lf{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,n){return hf(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return hf(t,e/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}},cf=new class extends lf{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,e/6,i,s,n)}drawOffset(t,e,i,s,n,r){return function(t,e,i,s,n,r){return t.moveTo(-3*e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-3*e+s-n,r),t.lineTo(e+i+n,-3*e+s-n,r),t.lineTo(e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,e+s+n,r),t.lineTo(e+i+n,e+s+n,r),t.lineTo(e+i+n,3*e+s+n,r),t.lineTo(-e+i-n,3*e+s+n,r),t.lineTo(-e+i-n,e+s+n,r),t.lineTo(-3*e+i-n,e+s+n,r),t.closePath(),!0}(t,e/6,i,s,n,r)}};function uf(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}const pf=new class extends lf{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return uf(t,e/2,i,s,n)}drawFitDir(t,e,i,s,n){return uf(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return uf(t,e/2+n,i,s,r)}};function gf(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}const mf=new class extends lf{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return gf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return gf(t,e/2+n,i,s)}};function _f(t,e,i,s,n=0){return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class ff extends lf{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return _f(t,e/2,i,s)}drawOffset(t,e,i,s,n){return _f(t,e/2,i,s,n)}}const vf=new ff,yf=new class extends ff{constructor(){super(...arguments),this.type="triangle"}},bf=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),xf=Math.sin(ot/10)*bf,Sf=-Math.cos(ot/10)*bf;function Mf(t,e,i,s){const n=xf*e,r=Sf*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=ot*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}const kf=new class extends lf{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return Mf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Mf(t,e/2+n,i,s)}},Af=mt(3);function wf(t,e,i,s){const n=e,r=n/Af,a=r/5,o=e;return t.moveTo(0+i,-n+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,o+s),t.lineTo(-a/2+i,o+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}const Tf=new class extends lf{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return wf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return wf(t,e/2+n,i,s)}};function Cf(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}const Lf=new class extends lf{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Cf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Cf(t,e/2+n,i,s)}};function Ef(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}const Pf=new class extends lf{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Ef(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Ef(t,e/2+n,i,s)}},Df=-.5,Of=mt(3)/2,Rf=1/mt(12);function If(t,e,i,s){const n=e/2,r=e*Rf,a=n,o=e*Rf+e,l=-a,h=o;return t.moveTo(n+i,r+s),t.lineTo(a+i,o+s),t.lineTo(l+i,h+s),t.lineTo(Df*n-Of*r+i,Of*n+Df*r+s),t.lineTo(Df*a-Of*o+i,Of*a+Df*o+s),t.lineTo(Df*l-Of*h+i,Of*l+Df*h+s),t.lineTo(Df*n+Of*r+i,Df*r-Of*n+s),t.lineTo(Df*a+Of*o+i,Df*o-Of*a+s),t.lineTo(Df*l+Of*h+i,Df*h-Of*l+s),t.closePath(),!1}const Bf=new class extends lf{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return If(t,e/2,i,s)}drawOffset(t,e,i,s,n){return If(t,e/2+n,i,s)}};function Ff(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}const Yf=new class extends lf{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return Ff(t,e/2,i,s,0)}drawOffset(t,e,i,s,n){return Ff(t,e/2,i,s,n)}};function jf(t,e,i,s,n=0){return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}const Hf=new class extends lf{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return jf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return jf(t,e/2,i,s,n)}};function zf(t,e,i,s,n=0){return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}const Nf=new class extends lf{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return zf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return zf(t,e/2,i,s,n)}},Vf=mt(3);function Wf(t,e,i,s){const n=e*Vf;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}const Gf=new class extends lf{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return Wf(t,e/2/Vf,i,s)}drawOffset(t,e,i,s,n){return Wf(t,e/2/Vf+n,i,s)}};function Uf(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}const $f=new class extends lf{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return Uf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Uf(t,e/4+n,i,s)}};function Kf(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}const Xf=new class extends lf{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return Kf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Kf(t,e/4+n,i,s)}};function qf(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}const Zf=new class extends lf{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return qf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return qf(t,e/4+n,i,s)}};function Jf(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}const Qf=new class extends lf{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return Jf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Jf(t,e/4+n,i,s)}};function tv(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}const ev=new class extends lf{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return tv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return tv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function iv(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}const sv=new class extends lf{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return iv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return iv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function nv(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}const rv=new class extends lf{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,n){return nv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return nv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function av(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function ov(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}const lv=new class extends lf{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return h(e)?ov(t,e,i,s):av(t,e,i,s)}drawOffset(t,e,i,s,n){return h(e)?ov(t,e+2*n,i,s):av(t,[e[0]+2*n,e[1]+2*n],i,s)}},hv={};[df,cf,pf,mf,Gf,yf,kf,Tf,Lf,Pf,Bf,Yf,Hf,vf,Nf,$f,Xf,Zf,Qf,lv,ev,sv,rv].forEach((t=>{hv[t.type]=t}));const dv={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},cv=new Bt;class uv{constructor(t,e,i=!1){this.pathStr="",this.type=t,y(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),ne(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(ne(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return this.drawOffset(t,e,i,s,0,n,r)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{cv.x1=i.bounds.x1*t,cv.y1=i.bounds.y1*t,cv.x2=i.bounds.x2*t,cv.y2=i.bounds.y2*t,e.union(cv)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}class pv{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function gv(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function mv(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r",r,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",r=e}else if("?"===t[r+1])r=mv(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=gv(t,"--\x3e",r+4,"Comment is not closed.");else{const a=mv(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,d=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);const t=new pv(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new pv(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=d}else s+=t[r];return e.child}}function vv(t,e){return yv(t)}function yv(t,e){const i={};for(let n=0;n{const e=(new Be).fromString(t.d),i={};Fn.forEach((e=>{t[e]&&(i[Bn[e]]=t[e])})),n.push({path:e,attribute:i}),Mv.union(e.bounds)}));const r=Mv.width(),a=Mv.height(),o=1/ut(r,a);return n.forEach((t=>t.path.transform(0,0,o,o))),this._parsedPath=new uv(e,n,!0),Av.userSymbolMap[e]=this._parsedPath,this._parsedPath}var s;const n=(new Be).fromString(e),r=n.bounds.width(),a=n.bounds.height(),o=1/ut(r,a);return n.transform(0,0,o,o),this._parsedPath=new uv(e,n),Av.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return Qi(this).symbol}updateAABBBounds(t,e,i,s){if(!oi.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=oi.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=s;dn(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return oi.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(y(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,kv)}needUpdateTag(t){return super.needUpdateTag(t,kv)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=y(e)?e:[e,e];return t.path?(new Be).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new Be).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new Av(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Av.NOWORK_ANIMATE_ATTR}}function wv(t){return new Av(t)}Av.userSymbolMap={},Av.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},ln);const Tv=new class{constructor(){this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,m=p&&!1!==p.visible,_=g&&!1!==g.visible;if(!m&&!_)return;const{size:f=l.size,opacity:v=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY}=t.attribute,M=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=La(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,f,i,s,d*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,n,(y-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};m&&M(p,"outerBorder"),_&&M(g,"innerBorder")}},Cv=To,Lv=uo;var Ev=function(t,e){return function(i,s){e(i,s,t)}};let Pv=class extends vo{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Dn,this.builtinContributions=[Tv,Lv,Cv],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=Qi(t,null==r?void 0:r.theme).symbol,{size:d=h.size,x:c=h.x,y:u=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY}=t.attribute,m=this.valid(t,h,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:b}=m,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:S=h.keepDirIn3d}=t.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();const k=(n,r)=>{var l,d,m;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(l=r.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(d=r.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(m=r.stroke)&&void 0!==m?m:t.attribute.stroke,r=e}r.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-s,h),e.fill())),r.stroke&&(o?o(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/p,(u-s)/g,h),e.stroke()))};if(S&&e.camera&&e.project){const t=e.project(i,s,M),n=e.camera;e.camera=null,!1===x.draw(e,y(d)?[d[0]*p,d[1]*g]:d*p,t.x,t.y,void 0,k)&&e.closePath(),e.camera=n}else!1===x.draw(e,d,i,s,M,k)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,v,b,_,f,h,n,a,o),v&&!x.isSvg&&(a?a(e,t.attribute,h):_&&(e.setCommonStyle(t,t.attribute,c-i,u-s,h),e.fill())),b&&!x.isSvg&&(o?o(e,t.attribute,h):f&&(e.setStrokeStyle(t,t.attribute,(c-i)/p,(u-s)/g,h),e.stroke())),this.afterRenderStep(t,e,i,s,v,b,_,f,h,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Pv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Ev(0,$(X)),Ev(0,K(ao)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Pv);let Dv=!1;const Ov=new B((t=>{Dv||(Dv=!0,t(Pv).toSelf().inSingletonScope(),t(hr).to(Pv).inSingletonScope(),t(ir).toService(hr),t(ao).toService(po),Z(t,ao))}));let Rv=class extends J_{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Dn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getParsedPath();if(!s.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}s.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,s),{x:o,y:l,z:h,lastModelMatrix:d}=a;let c=e;if(s.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=La(s,n+r,s.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==d&&Er.free(s.modelMatrix),s.modelMatrix=d,s.highPerformanceRestore(),u}};Rv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(hr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Rv);let Iv=!1;const Bv=new B(((t,e,i,s)=>{Iv||(Iv=!0,t(W_).to(Rv).inSingletonScope(),t(Z_).toService(W_))}));class Fv{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();let{x:r=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,a+=e.y,s.setTransformForCurrent()}else r=0,a=0,s.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,s,r,a,{},null,((t,i,s)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,n)=>{if(o)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return s.lineWidth=La(s,r+a,s.dpr),o=t.isPointInStroke(e.x,e.y),o})),s.highPerformanceRestore(),o}}let Yv=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Dn}};Yv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(hr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Yv);let jv=!1;const Hv=new B(((t,e,i,s)=>{jv||(jv=!0,t(P_).to(Yv).inSingletonScope(),t(M_).toService(P_))}));function zv(){zv.__loaded||(zv.__loaded=!0,Gr.RegisterGraphicCreator("symbol",wv),Di.load(Ov),Di.load(S_?Bv:Hv))}zv.__loaded=!1;const Nv=zv,Vv=(t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}return i},Wv=["width","x1","y1","height","cornerRadius",...sn];class Gv extends hn{constructor(t){super(t),this.type="rect",this.numberType=Ln}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return Qi(this).rect}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=oi.graphicService.updateTempAABBBounds(i);return Vv(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),oi.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,Wv)}needUpdateTag(t){return super.needUpdateTag(t,Wv)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:s,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=P(t.width)?t.x1-t.x:t.width,i=P(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(t),r=new Be;return r.moveTo(e,i),r.rect(e,i,s,n),r}clone(){return new Gv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Gv.NOWORK_ANIMATE_ATTR}}function Uv(t){return new Gv(t)}Gv.NOWORK_ANIMATE_ATTR=ln;var $v=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class Kv{constructor(){this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{cornerRadius:_=l.cornerRadius,opacity:f=l.opacity,x:v=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY,x1:M,y1:k}=t.attribute;let{width:A,height:w}=t.attribute;A=(null!=A?A:M-i)||0,w=(null!=w?w:k-s)||0;const T=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,d=La(e,h,e.dpr),u=i+o*d,p=s+o*d,g=2*d;if(0===_||y(_)&&_.every((t=>0===t))?(e.beginPath(),e.rect(u,p,A-o*g,w-o*g)):(e.beginPath(),Na(e,u,p,A-o*g,w-o*g,_)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=f,e.setStrokeStyle(t,n,(v-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder")}}let Xv=class{constructor(){this.time=te.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};Xv=$v([V()],Xv);let qv=class{constructor(){this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{x1:u,y1:p,x:g=l.x,y:m=l.y,stroke:_=l.stroke,cornerRadius:f=l.cornerRadius}=t.attribute;let{width:v,height:b}=t.attribute;if(v=(null!=v?v:u-g)||0,b=(null!=b?b:p-m)||0,Array.isArray(_)&&_.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===f||y(f)&&f.every((t=>0===t)))){let n,r=0;return Na(e,i,s,v,b,f,new Array(4).fill(0).map(((a,o)=>(a,h,d,c)=>{_[o]&&(r===o-1&&_[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:_[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=_[o]),r=o,e.lineTo(d,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),_[0]?e.lineTo(i+v,s):e.moveTo(i+v,s),_[1]?e.lineTo(i+v,s+b):e.moveTo(i+v,s+b),_[2]?e.lineTo(i,s+b):e.moveTo(i,s+b),_[3]){const t=_[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};qv=$v([V()],qv);const Zv=new Kv,Jv=To,Qv=uo;var ty=function(t,e){return function(i,s){e(i,s,t)}};let ey=class extends vo{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Ln,this.builtinContributions=[Zv,Qv,Jv],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:Qi(t,null==r?void 0:r.theme).rect,{fill:d=h.fill,background:c,stroke:u=h.stroke,cornerRadius:p=h.cornerRadius,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:_=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:v=h.visible,x1:b,y1:x,x:S=h.x,y:M=h.y}=t.attribute;let{width:k,height:A}=t.attribute;k=(null!=k?k:b-S)||0,A=(null!=A?A:x-M)||0;const w=Ua(g,m,k,A,d),T=Ka(g,f,k,A),C=Va(d,c),L=Wa(u,_);if(!t.valid||!v)return;if(!C&&!L)return;if(!(w||T||a||o||c))return;0===p||y(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,s,k,A)):(e.beginPath(),Na(e,i,s,k,A,p));const E={doFill:C,doStroke:L};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,C,L,w,T,h,n,a,o,E),E.doFill&&(a?a(e,t.attribute,h):w&&(e.setCommonStyle(t,t.attribute,S-i,M-s,h),e.fill())),E.doStroke&&(o?o(e,t.attribute,h):T&&(e.setStrokeStyle(t,t.attribute,S-i,M-s,h),e.stroke())),this.afterRenderStep(t,e,i,s,C,L,w,T,h,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};ey=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),ty(0,$(X)),ty(0,K(ro)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ey);let iy=!1;const sy=new B((t=>{iy||(iy=!0,t(ey).toSelf().inSingletonScope(),t(or).to(ey).inSingletonScope(),t(ir).toService(or),t(qv).toSelf(),t(Xv).toSelf(),t(ro).toService(qv),t(ro).toService(Xv),t(ro).toService(po),Z(t,ro))})),ny=new Bt;class ry{constructor(){this.type="rect",this.numberType=Ln}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:a=n.x,y:o=n.y}=t.attribute;s.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);a+=e.x,o+=e.y,s.setTransformForCurrent()}else a=0,o=0,l=!1,s.transformFromMatrix(t.transMatrix,!0);let d=!0;if(!l||t.shadowRoot||h(r,!0)&&0!==r||y(r)&&r.some((t=>0!==t)))d=!1,this.canvasRenderer.drawShape(t,s,a,o,{},null,((t,i,s)=>!!d||(d=t.isPointInPath(e.x,e.y),d)),((t,i,n)=>{if(d)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return s.lineWidth=La(s,r+a,s.dpr),d=t.isPointInStroke(e.x,e.y),d}));else{const{fill:i=n.fill,stroke:s=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)d=!0;else if(s){const i=t.AABBBounds;ny.setValue(i.x1,i.y1,i.x2,i.y2),ny.expand(-r/2),d=!ny.containsPoint(e)}}return s.highPerformanceRestore(),d}}let ay=class extends ry{constructor(t){super(),this.canvasRenderer=t}};ay=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(or)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ay);let oy=!1;const ly=new B(((t,e,i,s)=>{oy||(oy=!0,t(N_).to(ay).inSingletonScope(),t(Z_).toService(N_))}));let hy=class extends ry{constructor(t){super(),this.canvasRenderer=t}};hy=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(or)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],hy);let dy=!1;const cy=new B(((t,e,i,s)=>{dy||(dy=!0,t(E_).to(hy).inSingletonScope(),t(M_).toService(E_))}));function uy(){uy.__loaded||(uy.__loaded=!0,Gr.RegisterGraphicCreator("rect",Uv),Di.load(sy),Di.load(S_?ly:cy))}uy.__loaded=!1;const py=uy;function gy(t){t.crosshair=Ra(t.crosshair||{}).map((e=>Tl({["horizontal"===t.direction?"yField":"xField"]:{visible:!0,line:{visible:!0,type:"rect"}}},e)))}function my(t,e,i){var s;const{width:n,height:r}=t;if(M(n)&&M(r))return{width:n,height:r};let a=i.width,o=i.height;const l=e.container,h=e.canvas;if(l){const{width:t,height:e}=Yr(l,i.width,i.height);a=t,o=e}else if(h&&dl(e.mode)){let t;t=S(h)?jo.getElementById(h):h;const{width:e,height:s}=Yr(t,i.width,i.height);a=e,o=s}else if(ul(e.mode)&&(null===(s=e.modeParams)||void 0===s?void 0:s.domref)){const t=e.modeParams.domref;a=t.width,o=t.height}return a=null!=n?n:a,o=null!=r?r:o,{width:a,height:o}}function _y(t,...e){const i=i=>e.reduce(((t,e)=>t||(null==e?void 0:e[i])),t[i]);return Object.assign(t,{change:i("change"),reCompile:i("reCompile"),reMake:i("reMake"),reRender:i("reRender"),reSize:i("reSize"),reTransformSpec:i("reTransformSpec"),changeTheme:i("changeTheme"),changeBackground:i("changeBackground")}),t}function fy(t,e){return"line"===t||"area"===t||"common"===t&&e.series.every((t=>"area"===t.type||"line"===t.type))?{paddingInner:1,paddingOuter:0}:{paddingOuter:0}}var vy,yy,by;(by=vy||(vy={})).STATE_NORMAL="normal",by.STATE_HOVER="hover",by.STATE_HOVER_REVERSE="hover_reverse",by.STATE_DIMENSION_HOVER="dimension_hover",by.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",by.STATE_SELECTED="selected",by.STATE_SELECTED_REVERSE="selected_reverse",by.STATE_SANKEY_EMPHASIS="selected",by.STATE_SANKEY_EMPHASIS_REVERSE="blur",function(t){t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED_REVERSE="selected_reverse"}(yy||(yy={}));class xy{constructor(){this._children=[],this._markNameMap={},this._infoMap=new Map}getMarkNameMap(){return this._markNameMap}addMark(t,e){P(t)||(this._children.push(t),this._markNameMap[t.name]=t,this._infoMap.set(t,E({},xy.defaultMarkInfo,e)))}removeMark(t){const e=this._children.findIndex((e=>e.name===t));e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}clear(){this._children=[],this._markNameMap={},this._infoMap.clear()}forEach(t){this._children.forEach(t)}includes(t,e){return this._children.includes(t,e)}get(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}getMarks(){return this._children.slice()}getMarksInType(t){const e=Ra(t);return this._children.filter((t=>e.includes(t.type)))}getMarkInId(t){return this._children.find((e=>e.id===t))}getMarkWithInfo(t){return this._children.find((e=>Object.keys(t).every((i=>t[i]===this._infoMap.get(e)[i]))))}}xy.defaultMarkInfo={};class Sy{get hover(){return this._hover}get select(){return this._select}constructor(t){this._marks=new xy,this._markReverse=new xy,this.onHover=t=>{switch(t.action){case"enter":this.interaction.getEventElement(vy.STATE_DIMENSION_HOVER).forEach((t=>this.interaction.addEventElement(vy.STATE_DIMENSION_HOVER_REVERSE,t))),this.interaction.clearEventElement(vy.STATE_DIMENSION_HOVER,!1),this.getEventElement(t).forEach((t=>this.interaction.addEventElement(vy.STATE_DIMENSION_HOVER,t))),this.interaction.reverseEventElement(vy.STATE_DIMENSION_HOVER);break;case"leave":this.interaction.clearEventElement(vy.STATE_DIMENSION_HOVER,!0),t=null}},this._option=t,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=t.interaction,this.initConfig(t.mode)}setStateKeys(t){}registerMark(t){Im(t.stateStyle[vy.STATE_DIMENSION_HOVER])||this._marks.addMark(t),Im(t.stateStyle[vy.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}init(){this.initEvent()}release(){this.releaseEvent()}initEvent(){this.event.on(Kh.dimensionHover,this.onHover)}releaseEvent(){this.event.release()}initConfig(t){}getEventElement(t,e=!1){const i=[];return t.dimensionInfo.forEach((t=>{t.data.forEach((t=>{(e?this._markReverse:this._marks).getMarks().filter((e=>e.model===t.series&&e.getVisible())).forEach((s=>{const n=s.getProduct();if(!n||!n.elements)return;const r=n.elements.filter((i=>{const s=i.getDatum();let n;return n=y(s)?s.every(((e,i)=>e===t.datum[i])):t.datum.some((t=>t===s)),e?!n:n}));i.push(...r)}))}))})),i}}const My={};Object.values(vy).forEach((t=>{My[t]=!0}));const ky={[vy.STATE_HOVER]:vy.STATE_HOVER_REVERSE,[vy.STATE_SELECTED]:vy.STATE_SELECTED_REVERSE,[vy.STATE_DIMENSION_HOVER]:vy.STATE_DIMENSION_HOVER_REVERSE};function Ay(t){return ky[t]}class wy{constructor(){this._stateMarks=new Map,this._stateElements=new Map,this._vgrammarInteractions=new Map,this._disableTriggerEvent=!1}addVgrammarInteraction(t,e){t&&(this._vgrammarInteractions.get(t)?this._vgrammarInteractions.get(t).push(e):this._vgrammarInteractions.set(t,[e]))}static markStateEnable(t,e){return!Im(t.stateStyle[e])}setDisableActiveEffect(t){this._disableTriggerEvent=t}registerMark(t,e){var i;this._stateMarks.has(t)||this._stateMarks.set(t,[]),null===(i=this._stateMarks.get(t))||void 0===i||i.push(e)}getStateMark(t){return this._stateMarks.get(t)}filterEventMark(t,e){var i;return!(!t.mark||!(null===(i=this._stateMarks.get(e))||void 0===i?void 0:i.includes(t.mark)))}getEventElement(t){var e;return null!==(e=this._stateElements.get(t))&&void 0!==e?e:[]}getEventElementData(t){return this.getEventElement(t).map((t=>t.getDatum()))}exchangeEventElement(t,e){var i;if(this._disableTriggerEvent)return;const s=Ay(t);null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t),s&&this.addEventElement(s,e)})),e.getStates().includes(t)||(e.addState(t),s&&e.removeState(s)),this._stateElements.set(t,[e])}removeEventElement(t,e){var i,s;if(this._disableTriggerEvent)return;e.removeState(t);const n=null!==(s=null===(i=this._stateElements.get(t))||void 0===i?void 0:i.filter((t=>t!==e)))&&void 0!==s?s:[];this._stateElements.set(t,n);const r=Ay(t);r&&(0===n.length?this.clearEventElement(r,!1):this.addEventElement(r,e))}addEventElement(t,e){var i;if(this._disableTriggerEvent)return;e.getStates().includes(t)||e.addState(t);const s=null!==(i=this._stateElements.get(t))&&void 0!==i?i:[];s.push(e),this._stateElements.set(t,s)}clearEventElement(t,e){var i;if(!this._disableTriggerEvent&&(null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t)})),this._stateElements.set(t,[]),e)){const e=Ay(t);e&&this.clearEventElement(e,!1)}}reverseEventElement(t){if(this._disableTriggerEvent)return;const e=Ay(t);if(!e)return;const i=this.getStateMark(e);if(!i)return;const s=this.getEventElement(t);s.length&&(this.getEventElement(e).length||(1===s.length?i.forEach((t=>{t.getProduct().elements.filter((t=>t!==s[0])).forEach((t=>{this.addEventElement(e,t)}))})):i.forEach((t=>{t.getProduct().elements.filter((t=>!s.includes(t))).forEach((t=>{this.addEventElement(e,t)}))}))))}startInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.start(e)}))}resetInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.reset(e)}))}}var Ty,Cy,Ly;!function(t){t[t.Axis_Grid=50]="Axis_Grid",t[t.CrossHair_Grid=100]="CrossHair_Grid",t[t.Region=450]="Region",t[t.Mark=300]="Mark",t[t.Node=400]="Node",t[t.Axis=100]="Axis",t[t.MarkLine=500]="MarkLine",t[t.MarkArea=100]="MarkArea",t[t.MarkPoint=500]="MarkPoint",t[t.DataZoom=500]="DataZoom",t[t.ScrollBar=500]="ScrollBar",t[t.Player=500]="Player",t[t.Legend=500]="Legend",t[t.CrossHair=500]="CrossHair",t[t.Indicator=500]="Indicator",t[t.Title=500]="Title",t[t.Label=500]="Label",t[t.Brush=500]="Brush",t[t.CustomMark=500]="CustomMark",t[t.Interaction=700]="Interaction"}(Ty||(Ty={})),function(t){t[t.Indicator=10]="Indicator",t[t.Region=20]="Region",t[t.Axis=30]="Axis",t[t.DataZoom=40]="DataZoom",t[t.Player=40]="Player",t[t.ScrollBar=40]="ScrollBar",t[t.Legend=50]="Legend",t[t.Title=70]="Title",t[t.CustomMark=70]="CustomMark"}(Cy||(Cy={})),function(t){t[t.Default=0]="Default",t[t.Theme=1]="Theme",t[t.Chart=2]="Chart",t[t.Base_Series=3]="Base_Series",t[t.Series=4]="Series",t[t.Mark=5]="Mark",t[t.User_Chart=6]="User_Chart",t[t.User_Series=7]="User_Series",t[t.User_Mark=8]="User_Mark",t[t.User_SeriesStyle=9]="User_SeriesStyle",t[t.Built_In=99]="Built_In"}(Ly||(Ly={}));class Ey{getOption(){return this._option}constructor(t){this._option=t,this.getCompiler=this._option.getCompiler}getVGrammarView(){var t;return null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView()}release(){this._option=null,this.getCompiler=null}}class Py extends Ey{constructor(){super(...arguments),this.id=qo(),this._compiledProductId=null,this._depend=[]}getProduct(){if(M(this._product))return this._product;const t=this.getVGrammarView(),e=this.getProductId();return M(e)&&M(t)&&(this._product=this._lookupGrammar(e)),this._product}getProductId(){var t;return null!==(t=this._compiledProductId)&&void 0!==t?t:this.generateProductId()}getDepend(){return this._depend}setDepend(...t){this._depend=t}compile(t){this._compileProduct(t),this._afterCompile(t)}_afterCompile(t){var e;M(this._product)&&(null===(e=this.getCompiler())||void 0===e||e.addGrammarItem(this))}updateDepend(){if(M(this._product)){const t=this.getDepend().map((t=>t.getProduct())).filter(M);return this._product.depend(t),t.length===this.getDepend().length}return!1}release(){this.removeProduct(),super.release(),this._depend=[]}removeProduct(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}class Dy extends Py{getValue(){return this._value}getUpdateFunc(){return this._updateFunc}constructor(t,e,i,s){super(t),this.grammarType=i_.signal,this.name=e,this._value=i,this._updateFunc=s}updateSignal(t,e){this._value=t,this._updateFunc=e,this.compile()}_compileProduct(){const t=this.getVGrammarView();if(t){if(!this.getProduct()){const e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}M(this._value)&&this._product.value(this._value),M(this._updateFunc)&&this._product.update(this._updateFunc)}}generateProductId(){return this.name}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getSignalById(t)}}class Oy extends Ey{constructor(){super(...arguments),this._signalMap={}}getSignalMap(){return this._signalMap}getSignal(t){return this._signalMap[t]}updateSignal(t,e,i){this._signalMap[t]?this._signalMap[t].updateSignal(e,i):(this._signalMap[t]=new Dy(this._option,t,e,i),this._signalMap[t].compile())}compile(){Object.values(this._signalMap).forEach((t=>{t.compile()}))}release(){super.release(),Object.values(this._signalMap).forEach((t=>{t.release()})),this._signalMap={}}}class Ry extends Oy{getStateMap(){return this._stateMap}_getDefaultStateMap(){return{}}constructor(t){super(t),t.stateKeyToSignalName?this.stateKeyToSignalName=t.stateKeyToSignalName:this.stateKeyToSignalName=()=>"state_signal",this.initStateMap()}initStateMap(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}compile(t){const e=null!=t?t:this._stateMap;Object.keys(e).forEach((t=>{const i=this.stateKeyToSignalName(t),s=e[t];this.updateSignal(i,s)}))}updateState(t,e){if(t&&(E(this._stateMap,t),this.compile(t),!e))return this.getCompiler().renderNextTick()}}class Iy extends Ry{constructor(){super(...arguments),this.id=qo(),this.stateKeyToSignalName=t=>`${sh}_animate_${this.id}_${t}`}getAnimationStateSignalName(){return this.stateKeyToSignalName("animationState")}updateAnimateState(t,e){t===Yp.update?this.updateState({animationState:{callback:(t,e)=>e.diffState}},e):t===Yp.appear?this.updateState({animationState:{callback:(t,e)=>"exit"===e.diffState?Yp.none:Yp.appear}},e):this.updateState({animationState:{callback:(e,i)=>t}},e)}_getDefaultStateMap(){return{animationState:{callback:(t,e)=>"exit"===e.diffState?Yp.exit:"update"===e.diffState?Yp.update:Yp.appear}}}}class By{constructor(t){this._option=t,this.type=t.type}_initTheme(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}getTheme(t,e){}transformSpec(t,e,i){this._transformSpecBeforeMergingTheme(t,e,i);const s=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(s.spec,e,i),s}_transformSpecBeforeMergingTheme(t,e,i){}_transformSpecAfterMergingTheme(t,e,i){}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>Tl({},i,s,t);return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}_shouldMergeThemeToSpec(){return!0}_getDefaultSpecFromChart(t){}}const Fy=(t,e,i)=>{if(P(e))return t;const s=e[0];return P(s)?t:1===e.length?(t[s]=i,t):(P(t[s])&&("number"==typeof e[1]?t[s]=[]:t[s]={}),Fy(t[s],e.slice(1),i))};class Yy extends Ey{getSpec(){return this._spec||{}}getSpecPath(){var t;return null===(t=this._option)||void 0===t?void 0:t.specPath}getSpecInfoPath(){var t,e,i;return null!==(e=null===(t=this._option)||void 0===t?void 0:t.specInfoPath)&&void 0!==e?e:null===(i=this._option)||void 0===i?void 0:i.specPath}getData(){return this._data}get layout(){return this._layout}getOption(){return this._option}getMarks(){var t,e;return null!==(e=null===(t=this._marks)||void 0===t?void 0:t.getMarks())&&void 0!==e?e:[]}getMarkNameMap(){var t;return null===(t=this._marks)||void 0===t?void 0:t.getMarkNameMap()}getMarkSet(){return this._marks}getChart(){return this._option.getChart()}get _theme(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.theme}constructor(t,e){var i;super(e),this.transformerConstructor=By,this.type="null",this.modelType="null",this.userId=void 0,this._data=null,this._layout=null,this.specKey="",this._marks=new xy,this._lastLayoutRect=null,this.id=qo(),this.userId=t.id,this._spec=t,this.effect={},this.event=new Vd(e.eventDispatcher,e.mode),null===(i=e.map)||void 0===i||i.set(this.id,this)}_releaseEvent(){this.event.release()}created(){this.setAttrFromSpec()}init(t){}afterInit(){}getVisible(){var t;return!1!==(null===(t=this._spec)||void 0===t?void 0:t.visible)}onLayoutStart(t,e,i){var s;null===(s=this._layout)||void 0===s||s.onLayoutStart(t,e,i)}onLayoutEnd(t){var e;null===(e=this._layout)||void 0===e||e.onLayoutEnd(t),this.getMarks().forEach((t=>t.updateLayoutState(!0,!0)))}onEvaluateEnd(t){}onDataUpdate(){}beforeRelease(){}release(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach((t=>t.release())),null===(t=this._data)||void 0===t||t.release(),this._data=null,this._marks.clear(),super.release()}updateSpec(t){const e=this._compareSpec(t,this._spec);return this._spec=t,e}_compareSpec(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}reInit(t){t&&(this._spec=t),this.setAttrFromSpec()}updateLayoutAttribute(){}setAttrFromSpec(){var t;null===(t=this._layout)||void 0===t||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}_convertMarkStyle(t){return Object.assign({},t)}setMarkStyle(t,e,i,s){M(t)&&M(e)&&t.setStyle(this._convertMarkStyle(e),i,s)}initMarkStyleWithSpec(t,e,i){if(!M(t)||!M(e))return;const{style:s,state:n}=e,r=Object.assign({},e);s&&(r.style=this._convertMarkStyle(s)),n&&(r.state={},Object.keys(n).forEach((t=>{r.state[t]=this._convertMarkStyle(n[t])}))),t.initStyleWithSpec(r,i)}stateKeyToSignalName(t,e){let i=`${sh}_${this.modelType}_${this.type}_${this.id}_${t}`;return e&&(i+=`_${e}`),i}compileData(){var t;null===(t=this._data)||void 0===t||t.compile()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t})}))}_createMark(t,e={}){const{type:i,name:s}=t,n=$l.createMark(i,s,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return null==n||n.created(),n}_getDataIdKey(){}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}getSpecInfo(){var t,e,i;return((t,e)=>{if(!P(e))return Gd(t,e,void 0)})(null!==(i=null===(e=(t=this._option).getSpecInfo)||void 0===e?void 0:e.call(t))&&void 0!==i?i:{},this.getSpecInfoPath())}getSpecIndex(){const t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;const e=Number(t[t.length-1]);return isNaN(e)?0:e}}class jy{getSpec(){return this._spec||{}}getLayoutStartPoint(){return this._layoutStartPoint}get layoutRectLevelMap(){return this._layoutRectLevelMap}get minWidth(){return this._minWidth}set minWidth(t){this._minWidth=t}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth=t}get minHeight(){return this._minHeight}set minHeight(t){this._minHeight=t}get maxHeight(){return this._maxHeight}set maxHeight(t){this._maxHeight=t}getLastComputeOutBounds(){return this._lastComputeOutBounds}get layoutOrient(){return this._layoutOrient}set layoutOrient(t){this._layoutOrient=t}get model(){return this._model}get type(){return this._model.type}constructor(t,e){var i;this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:0,height:0},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=()=>this._layoutRect,this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=Cy.Region,this._model=t,this._option=e,this.layoutLevel=e.layoutLevel,this.layoutType=e.layoutType,e.layoutOrient&&(this.layoutOrient=e.layoutOrient),this._spec=null===(i=null==t?void 0:t.getSpec)||void 0===i?void 0:i.call(t)}_setLayoutAttributeFromSpec(t,e){var i,s,n,r;if(this._spec&&!1!==this._spec.visible){const a=il(sl(t.padding),e,e);this.layoutPaddingLeft=a.left,this.layoutPaddingRight=a.right,this.layoutPaddingTop=a.top,this.layoutPaddingBottom=a.bottom,this._minHeight=P(t.minHeight)?null!==(i=this._minHeight)&&void 0!==i?i:null:el(t.minHeight,e.height,e),this._maxHeight=P(t.maxHeight)?null!==(s=this._maxHeight)&&void 0!==s?s:null:el(t.maxHeight,e.height,e),this._minWidth=P(t.minWidth)?null!==(n=this._minWidth)&&void 0!==n?n:null:el(t.minWidth,e.width,e),this._maxWidth=P(t.maxWidth)?null!==(r=this._maxWidth)&&void 0!==r?r:null:el(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:el(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:el(t.height,e.height,e)},{height:9}),P(t.offsetX)||(this.layoutOffsetX=el(t.offsetX,e.width,e)),P(t.offsetY)||(this.layoutOffsetY=el(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}setAttrFromSpec(t,e){var i,s,n,r;this._spec=t,this.layoutType=null!==(i=t.layoutType)&&void 0!==i?i:this.layoutType,this.layoutLevel=null!==(s=t.layoutLevel)&&void 0!==s?s:this.layoutLevel,this.layoutOrient=null!==(n=t.orient)&&void 0!==n?n:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!==(r=t.clip)&&void 0!==r?r:this.layoutClip}onLayoutStart(t,e,i){this._setLayoutAttributeFromSpec(this._spec,e)}onLayoutEnd(t){}_getAbsoluteSpecValue(t){const e={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach((i=>{P(this._spec[i])||(e[i]=el(this._spec[i],"top"===i||"bottom"===i?t.height:t.width,t))})),e}absoluteLayoutInRect(t){const{top:e,bottom:i,left:s,right:n}=this._getAbsoluteSpecValue(t),r={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};P(s)||(r.width-=s),P(n)||(r.width-=n),P(e)||(r.height-=e),P(i)||(r.height-=i),this.setLayoutRect(r);const{width:a,height:o}=this.computeBoundsInRect(this.getLayoutRect());this.setLayoutRect({width:a,height:o});const l={x:t.x,y:t.y};!0===this._spec.center?(l.x=t.x+.5*t.width-.5*a,l.y=t.y+.5*t.height-.5*o):(P(s)?P(n)||(l.x=t.x+t.width-this.layoutPaddingRight-n-a):l.x=t.x+s+this.layoutPaddingLeft,P(e)?P(i)||(l.y=t.y+t.height-this.layoutPaddingBottom-i-o):l.y=t.y+e+this.layoutPaddingTop),this.setLayoutStartPosition(l)}setLayoutStartPosition(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),Wo(t.x)&&(this._layoutStartPoint.x=t.x),Wo(t.y)&&(this._layoutStartPoint.y=t.y),null===(i=(e=this._model).afterSetLayoutStartPoint)||void 0===i||i.call(e,this._layoutStartPoint)}setLayoutRect({width:t,height:e},i){var s,n,r,a;Wo(t)&&(null!==(s=null==i?void 0:i.width)&&void 0!==s?s:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=t,this._layoutRectLevelMap.width=null!==(n=null==i?void 0:i.width)&&void 0!==n?n:0),Wo(e)&&(null!==(r=null==i?void 0:i.height)&&void 0!==r?r:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=e,this._layoutRectLevelMap.height=null!==(a=null==i?void 0:i.height)&&void 0!==a?a:0),this.setRectInSpec(this._layoutRect)}getLayout(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}mergeLayoutRect({width:t,height:e}){const i={width:t,height:e};return this._layoutRectLevelMap.width>0&&(i.width=this._layoutRect.width),this._layoutRectLevelMap.height>0&&(i.height=this._layoutRect.height),i}getOrientPosAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"x":"y"}getOrientSizeAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"width":"height"}changeBoundsBySetting(t){return this._layoutRectLevelMap.width>0&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>0&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}setRectInSpec(t){const e=Object.assign({},t);return this._layoutRectLevelMap.width<9?(P(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),P(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?(P(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),P(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}computeBoundsInRect(t){if(this._lastComputeRect=t,!("region-relative"!==this.layoutType&&"region-relative-overlap"!==this.layoutType||(9!==this._layoutRectLevelMap.width||"left"!==this.layoutOrient&&"right"!==this.layoutOrient)&&(9!==this._layoutRectLevelMap.height||"bottom"!==this.layoutOrient&&"top"!==this.layoutOrient)))return this._layoutRect;const e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));let i=this.setRectInSpec(function(t,e){return t?{width:Math.ceil(Math.min(t.x2-t.x1,e.width)),height:Math.ceil(Math.min(t.y2-t.y1,e.height))}:{width:0,height:0}}(e,t));return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}getModelId(){return this._model.id}getModelVisible(){return this._model.getVisible()}}class Hy extends Yy{constructor(){super(...arguments),this.layoutType="normal",this.layoutLevel=0,this.layoutZIndex=0,this._forceLayoutTag=!1,this._layout=null,this._orient=null,this._layoutRect={width:0,height:0},this._layoutStartPos={x:0,y:0},this._isLayout=!0,this.getGraphicBounds=()=>this._layout?{x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0},this._transformLayoutRect=null,this._transformLayoutPosition=null}get layoutOrient(){return this._orient}set layoutOrient(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}initLayout(){"none"!==this.layoutType&&(this._layout=new jy(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}onLayoutStart(t,e,i){this._isLayout=!0,super.onLayoutStart(t,e,i)}onLayoutEnd(t){super.onLayoutEnd(t),this.updateLayoutAttribute();const e=this.getLayoutRect();!this._forceLayoutTag&&Dm(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}afterSetLayoutStartPoint(t){}_forceLayout(){var t;this._isLayout||(this._forceLayoutTag=!0,null===(t=this._option.globalInstance.getChart())||void 0===t||t.setLayoutTag(!0))}getLayoutStartPoint(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}setLayoutStartPosition(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=E(this._layoutStartPos,t)}getLayoutRect(){return this._layout?this._layout.getLayoutRect():this._layoutRect}setLayoutRect(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=E(this._layoutRect,t)}getLastComputeOutBounds(){var t;return null===(t=this._layout)||void 0===t?void 0:t.getLastComputeOutBounds()}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.layoutClip=null!==(t=this._spec.clip)&&void 0!==t?t:this.layoutClip,this.layoutZIndex=null!==(e=this._spec.zIndex)&&void 0!==e?e:this.layoutZIndex,this.layoutType=null!==(i=this._spec.layoutType)&&void 0!==i?i:this.layoutType,this._orient=null!==(s=this._spec.orient)&&void 0!==s?s:this._orient,this.layoutLevel=null!==(n=this._spec.layoutLevel)&&void 0!==n?n:this.layoutLevel}}class zy extends By{_initTheme(t,e){return{spec:t,theme:this._theme}}}class Ny extends Hy{getMaxWidth(){return this._layout.maxWidth}setMaxWidth(t){this._layout.maxWidth=t}getMaxHeight(){return this._layout.maxHeight}setMaxHeight(t){this._layout.maxHeight=t}getGroupMark(){return this._groupMark}getInteractionMark(){return this._interactionMark}getStackInverse(){return!0===this._spec.stackInverse}getStackSort(){return!0===this._spec.stackSort}constructor(t,e){var i;super(t,e),this.transformerConstructor=zy,this.modelType="region",this.specKey="region",this.type=Ny.type,this._series=[],this.layoutType="region",this.layoutZIndex=Ty.Region,this.interaction=new wy,this.seriesDataFilterOver=()=>{this.event.emit(jd.regionSeriesDataFilterOver,{model:this,chart:this.getChart()}),this._series.forEach((t=>{t.getViewDataFilter()&&t.reTransformViewData()}))},this.getBoundsInRect=()=>({x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}),this.userId=t.id,this.coordinate=null!==(i=t.coordinate)&&void 0!==i?i:"cartesian",this._option.animation&&(this.animate=new Iy({getCompiler:e.getCompiler})),this.interaction.setDisableActiveEffect(this._option.disableTriggerEvent)}_getClipDefaultValue(){var t,e,i,s;const n=this._option.getChart().getSpec(),r=null===(e=null===(t=n.dataZoom)||void 0===t?void 0:t.some)||void 0===e?void 0:e.call(t,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"filter")})),a=null===(s=null===(i=n.scrollBar)||void 0===i?void 0:i.some)||void 0===s?void 0:s.call(i,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"axis")}));return!(!r&&!a)||this._layout.layoutClip}created(){var t;this.initLayout(),super.created();const e=null!==(t=this._spec.clip)&&void 0!==t?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",this.userId+"_interaction",Ty.Interaction),Im(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),e&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach((t=>{t&&(t.created(),this.setMarkStyle(t,{width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height},"normal",Ly.Built_In),this._groupMark.addMark(t))})),this._backgroundMark&&this._backgroundMark.setZIndex(0),this._foregroundMark&&this._foregroundMark.setZIndex(Ty.Mark+1)),this.createTrigger()}_createGroupMark(t,e,i){var s,n;const r=this._createMark({type:"group",name:t});r.setUserId(e),r.setZIndex(i);const a=null!==(s=this._spec.clip)&&void 0!==s?s:this._getClipDefaultValue();return this.setMarkStyle(r,{x:()=>this.getLayoutStartPoint().x,y:()=>this.getLayoutStartPoint().y,width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height,clip:a},"normal",Ly.Built_In),this.setMarkStyle(r,{cornerRadius:null===(n=this._spec.style)||void 0===n?void 0:n.cornerRadius},"normal",Ly.User_Mark),this._marks.addMark(r),r}init(t){super.init(t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}initMark(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}_initBackgroundMarkStyle(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:(null===(t=this._spec.style)||void 0===t?void 0:t.fill)?1:0},this._spec.style),"normal",Ly.User_Mark),(null!==(e=this._spec.clip)&&void 0!==e?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",Ly.Built_In))}_initForegroundMarkStyle(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",Ly.User_Mark)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Dm(null==e?void 0:e.style,null==t?void 0:t.style)||(i.reMake=!0),i}reInit(t){super.reInit(t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}addSeries(t){t&&(this._series.includes(t)||this._series.push(t))}removeSeries(t){if(!t)return;const e=this._series.findIndex((e=>e===t));e>=0&&this._series.splice(e,1)}getSeries(t={}){return this._series.filter((e=>{var i,s;return(!t.name||(null==e?void 0:e.name)===t.name)&&(!t.userId||Ra(t.userId).includes(e.userId))&&(!M(t.specIndex)||Ra(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||(null===(s=null===(i=e.getRawData)||void 0===i?void 0:i.call(e))||void 0===s?void 0:s.name)===t.dataName)}))}getSeriesInName(t){return this.getSeries({name:t})[0]}getSeriesInUserId(t){return this.getSeries({userId:t})[0]}getSeriesInId(t){return this.getSeries({id:t})[0]}getSeriesInType(t){return this.getSeries({type:t})}getSeriesInCoordinateType(t){return this.getSeries({coordinateType:t})}getSeriesInDataName(t){return this.getSeries({dataName:t})}onRender(t){}initSeriesDataflow(){const t=this._series.map((t=>{var e;return null!==(e=t.getViewDataFilter())&&void 0!==e?e:t.getViewData()})).filter((t=>!!t));this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}release(){super.release(),this._series=[]}createTrigger(){const t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new Sy(t)}initTrigger(){this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{this._trigger.registerMark(t)}))})),this._trigger.init()}initInteraction(){this._option.disableTriggerEvent||this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{for(const e in yy)Im(t.stateStyle[yy[e]])||this.interaction.registerMark(yy[e],t)}))}))}compileMarks(t){this.getMarks().forEach((e=>{var i;e.compile({group:t}),null===(i=e.getProduct())||void 0===i||i.configure({context:{model:this}}).layout(((t,e,i,s)=>{}))}))}compile(){var t;null===(t=this.animate)||void 0===t||t.compile(),this.compileMarks()}onLayoutEnd(t){this._series.forEach((e=>e.onLayoutEnd(t))),super.onLayoutEnd(t)}}function Vy(t){const e=[],i=[],s=[];return t.forEach((t=>{P(t.getSpec().position)||"start"===t.getSpec().position?e.push(t):"middle"===t.getSpec().position?i.push(t):"end"===t.getSpec().position&&s.push(t)})),{startItems:e,endItems:s,middleItems:i}}function Wy(t,e,i){e?t.forEach((t=>{const e=Ia(t),s=e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+n})}))})):t.forEach((t=>{const e=Ia(t),s=e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+n,y:t.getLayoutStartPoint().y})}))}))}function Gy(t,e,i,s){let n;t.forEach(((t,r)=>{t.length>1&&(n=i[r],t.forEach((t=>{if(!t.alignSelf||"start"===t.alignSelf)return;const i=t.getLayoutStartPoint(),r="middle"===t.alignSelf?.5:1,a=e?n-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):n-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:i.x+s*a*r,y:i.y}):t.setLayoutStartPosition({x:i.x,y:i.y+s*a*r})})))}))}function Uy(t,e,i,s,n){if(t.length){let r=0;const a="right"===n,o=a?-1:1;let l=a?e.rightCurrent:e.leftCurrent,h=e.topCurrent;const d=[];let c=[];const u=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=a?-n.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:h+t.layoutOffsetY+t.layoutPaddingTop}),h+=p,h>i&&c.length?(u.push(r),l+=o*r,r=g,h=e.topCurrent+p,t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),d.push(c),c=[t]):(r=Math.max(r,g),c.push(t))})),u.push(r),d.push(c),Gy(d,!0,u,o),s&&Wy(d,!0,i),a?e.rightCurrent=l+o*r:e.leftCurrent=l+o*r}}function $y(t,e,i,s){if(t.length){let i=0;const n="right"===s,r=n?-1:1;let a=n?e.rightCurrent:e.leftCurrent,o=e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),c=t.computeBoundsInRect(s);t.setLayoutRect(c);const u=c.height+t.layoutPaddingTop+t.layoutPaddingBottom,p=c.width+t.layoutPaddingLeft+t.layoutPaddingRight,g=n?-c.width-t.layoutPaddingRight:t.layoutPaddingLeft;o{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=r?t.layoutPaddingTop:-n.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:l+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),l+=g,l>i&&c.length?(u.push(o),l=e.leftCurrent+g,h+=a*o,o=p,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),d.push(c),c=[t]):(o=Math.max(o,p),c.push(t))})),u.push(o),d.push(c),Gy(d,!1,u,a),s&&Wy(d,!1,i),r?e.topCurrent=h+a*o:e.bottomCurrent=h+a*o}}function Xy(t,e,i,s){if(t.length){const i="top"===s,n=i?1:-1;let r=0,a=e.rightCurrent,o=i?e.topCurrent:e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),d=t.computeBoundsInRect(s);t.setLayoutRect(d);const c=d.height+t.layoutPaddingTop+t.layoutPaddingBottom,u=d.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=i?t.layoutPaddingTop:-d.height-t.layoutPaddingBottom;ae.layoutLevel-t.layoutLevel))}_layoutNormalItems(t){this.layoutNormalInlineItems(t.filter((t=>"normal-inline"===t.layoutType))),this.layoutNormalItems(t.filter((t=>"normal"===t.layoutType)))}_groupItems(t){const e=t.filter((t=>"region"===t.layoutType)),i=t.filter((t=>"region-relative"===t.layoutType)),s=t.filter((t=>"region-relative-overlap"===t.layoutType)),n=i.concat(s),r={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return s.forEach((t=>{r[t.layoutOrient].items.push(t)})),{regionItems:e,relativeItems:i,relativeOverlapItems:s,allRelatives:n,overlapItems:r}}layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},{regionItems:r,relativeItems:a,relativeOverlapItems:o,allRelatives:l,overlapItems:h}=this._groupItems(e);this.layoutRegionItems(r,a,o,h),this._processAutoIndent(r,a,o,h,l,n),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType)))}_processAutoIndent(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},n,r){if(n.some((t=>t.autoIndent))){const{top:a,bottom:o,left:l,right:h}=this._checkAutoIndent(n,r);(a||o||l||h)&&(this.topCurrent=r.top+a,this.bottomCurrent=r.bottom-o,this.leftCurrent=r.left+l,this.rightCurrent=r.right-h,this.layoutRegionItems(t,e,i,s))}}layoutNormalItems(t){t.forEach((t=>{const e=this.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(e);t.setLayoutRect(i),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"top"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"right"===t.layoutOrient?(t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"bottom"===t.layoutOrient&&(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingRight,y:this.bottomCurrent+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom)}))}layoutNormalInlineItems(t){const e=t.filter((t=>"left"===t.layoutOrient)),i=t.filter((t=>"right"===t.layoutOrient)),s=t.filter((t=>"top"===t.layoutOrient)),n=t.filter((t=>"bottom"===t.layoutOrient)),r=this._chartLayoutRect.width+this._chartLayoutRect.x,a=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Vy(t);s.length&&Uy(s,e,i,!1,"left"),n.length&&Uy(n,e,i,!0,"left"),r.length&&$y(r,e,0,"left")}(e,this,a),s.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Vy(t);s.length&&Ky(s,e,i,!1,"top"),n.length&&Ky(n,e,i,!0,"top"),r.length&&Xy(r,e,0,"top")}(s,this,r),i.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Vy(t);s.length&&Uy(s,e,i,!1,"right"),n.length&&Uy(n,e,i,!0,"right"),r.length&&$y(r,e,0,"right")}(i,this,a),n.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Vy(t);s.length&&Ky(s,e,i,!1,"bottom"),n.length&&Ky(n,e,i,!0,"bottom"),r.length&&Xy(r,e,0,"bottom")}(n,this,r)}_layoutRelativeOverlap(t,e){e.items.forEach((t=>{const i=this.getItemComputeLayoutRect(t),s=t.computeBoundsInRect(i);e.rect.width=Math.max(s.width+t.layoutPaddingLeft+t.layoutPaddingRight,e.rect.width),e.rect.height=Math.max(s.height+t.layoutPaddingTop+t.layoutPaddingBottom,e.rect.height)})),e.items.forEach((i=>{i.setLayoutRect(e.rect),"left"===t?i.setLayoutStartPosition({x:this.leftCurrent+i.layoutOffsetX}):"right"===t?i.setLayoutStartPosition({x:this.rightCurrent-e.rect.width+i.layoutOffsetX}):"top"===t?i.setLayoutStartPosition({x:this.topCurrent+i.layoutOffsetY}):i.setLayoutStartPosition({x:this.bottomCurrent-e.rect.height+i.layoutOffsetY})})),"left"===t?this.leftCurrent+=e.rect.width:"right"===t?this.rightCurrent-=e.rect.width:"top"===t?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}_layoutRelativeItem(t,e){const i=t.computeBoundsInRect(e);"left"===t.layoutOrient||"right"===t.layoutOrient?t.setLayoutRect({width:i.width}):t.setLayoutRect({height:i.height}),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"right"===t.layoutOrient?(this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):"top"===t.layoutOrient?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"bottom"===t.layoutOrient&&(this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}_layoutRegionItem(t,e,i){const s=Math.max(Math.min(e,...t.map((t=>{var e;return null!==(e=t.maxWidth)&&void 0!==e?e:Number.MAX_VALUE}))),0),n=Math.max(Math.min(i,...t.map((t=>{var e;return null!==(e=t.maxHeight)&&void 0!==e?e:Number.MAX_VALUE}))),0);return t.forEach((t=>{const e=s-t.layoutPaddingLeft-t.layoutPaddingRight,i=n-t.layoutPaddingTop-t.layoutPaddingBottom;t.setLayoutRect({width:e,height:i}),t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop})})),{regionHeight:n,regionWidth:s}}layoutRegionItems(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}}){let n=this.rightCurrent-this.leftCurrent,r=this.bottomCurrent-this.topCurrent;e.filter((t=>"left"===t.layoutOrient||"right"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("left",s.left),this._layoutRelativeOverlap("right",s.right),n=this.rightCurrent-this.leftCurrent,e.filter((t=>"top"===t.layoutOrient||"bottom"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("top",s.top),this._layoutRelativeOverlap("bottom",s.bottom),r=this.bottomCurrent-this.topCurrent;const{regionWidth:a,regionHeight:o}=this._layoutRegionItem(t,n,r);e.concat(i).forEach((e=>{if(["left","right"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({height:i.getLayoutRect().height}),e.setLayoutStartPosition({y:i.getLayoutStartPoint().y+e.layoutOffsetY+e.layoutPaddingTop}),"right"===e.layoutOrient&&e.setLayoutStartPosition({x:e.getLayoutStartPoint().x+a-n})}else if(["top","bottom"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({width:i.getLayoutRect().width}),e.setLayoutStartPosition({x:i.getLayoutStartPoint().x+e.layoutOffsetX+e.layoutPaddingLeft}),"bottom"===e.layoutOrient&&e.setLayoutStartPosition({y:e.getLayoutStartPoint().y+o-r})}}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}filterRegionsWithID(t,e){var i;const s=t.find((t=>t.getModelId()===e));return s||(null!==(i=this._onError)&&void 0!==i?i:gl)("can not find target region item, invalid id"),s}getItemComputeLayoutRect(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}_checkAutoIndent(t,e){const i={top:0,left:0,bottom:0,right:0};return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,n=t.getLastComputeOutBounds(),r=this._getOutInLayout(n,t,e);s?(i.top=Math.max(i.top,r.top),i.bottom=Math.max(i.bottom,r.bottom)):(i.left=Math.max(i.left,r.left),i.right=Math.max(i.right,r.right))})),i}_getOutInLayout(t,e,i){const{x:s,y:n}=e.getLayoutStartPoint(),{width:r,height:a}=e.getLayoutRect();return{left:i.left-(s-t.x1),right:s+r+t.x2-i.right,top:i.top-(n-t.y1),bottom:n+a+t.y2-i.bottom}}}function Zy(t,e,i){M(e)||(e=t,t=0),M(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s{let e=null,i=null;return(...s)=>(e&&s.every(((t,i)=>t===e[i]))||(e=s,i=t(...s)),i)};function Qy(t,e,i=0,s){for(P(s)&&(s=t.length);i>>1;ud(t[n],e)>0?s=n:i=n+1}return i}const tb=(t,e)=>eb(0,t.length,(i=>e(t[i]))),eb=(t,e,i)=>{let s=t,n=e;for(;s=0?n=t:s=t+1}return s};function ib(t){return t}const sb=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),nb=t=>t<0?-t*t:t*t,rb=t=>-Math.log(-t),ab=t=>-Math.exp(-t),ob=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,lb=t=>10===t?ob:t===Math.E?Math.exp:e=>Math.pow(t,e),hb=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),db=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),cb=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function ub(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function pb(t,e,i){const s=t[0],n=t[1],r=e[0],a=e[1];let o,l;return nl(o(t))}function gb(t,e,i){let s;return s=1===t?t+2*i:t-e+2*i,t?s>0?s:1:0}function mb(t,e,i,s){return 1===i&&(i=0),gb(t,i,s)*(e/(1-i))}function _b(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}function fb(t,e,i){const s=Math.min(t.length,e.length)-1,n=new Array(s),r=new Array(s);let a=-1;for(t[s]{const i=Math.floor(Math.log10(t)),s=t/Math.pow(10,i);let n;return n=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,n*Math.pow(10,i)},yb=Math.sqrt(50),bb=Math.sqrt(10),xb=Math.sqrt(2),Sb=[1,2,5,10],Mb=(t,e,i)=>{let s=1,n=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?s=Tb(a).step:(i||a>1)&&(n=Math.floor(t)-r*s),s>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*s)),Zy(0,e).map((t=>n+t*s))):t>0?Ab(0,-(e-1)/s,s):Ab((e-1)/s,0,s)},kb=Jy(((t,e,i,s)=>{let n,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e0){let i=Math.round(t/o),s=Math.round(e/o);for(i*oe&&--s,a=new Array(r=s-i+1);++le&&--s,a=new Array(r=s-i+1);++l{let s,n,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*ie&&--o,n=new Array(s=o-a+1);++re&&--o,n=new Array(s=o-a+1);++r{let n,r,a;if(i=+i,(t=+t)==(e=+e))return Mb(t,i,null==s?void 0:s.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return Mb(t,i,null==s?void 0:s.noDecimals);(n=e0){let s=1;const{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;s<=5&&(r=Ab(t,e,l),r.length>i+1)&&i>2;)l+=h,s+=1;i>2&&r.length{let s;const n=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(s=a;s>=1;s--)e.push(n-s*i);return e.concat(t)}if(n>=0){for(s=1;s<=a;s++)t.push(r+s*i);return t}let o=[];const l=[];for(s=1;s<=a;s++)s%2==0?o=[n-Math.floor(s/2)*i].concat(o):l.push(r+Math.ceil(s/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==s?void 0:s.noDecimals)&&l<0&&(l=1),r=Ab(t,e,l);return n&&r.reverse(),r})),Tb=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let s=Sb[0];return i>=yb?s=Sb[3]:i>=bb?s=Sb[2]:i>=xb&&(s=Sb[1]),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function Cb(t,e,i){const s=(e-t)/Math.max(0,i);return Tb(s)}function Lb(t,e,i){let s;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(s=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(s))return[];const n=new Array(i);for(let e=0;e0;){if(s=Cb(a,o,e).step,s===i)return t[n]=a,t[r]=o,t;if(s>0)a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s;else{if(!(s<0))break;a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s}i=s}}function Db(t,e){const i=h(e.forceMin),s=h(e.forceMax);let n=null;const r=[];let a=null;const o=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:h(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),s?r[1]=e.forceMax:h(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),h(r[0])&&h(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=h(r[0])||h(r[1])?h(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}const Ob=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i),Rb=Jy(((t,e,i,s,n,r,a)=>{let o=t,l=e;const h=l0){for(;u<=p;++u)for(d=1;dl)break;g.push(c)}}else for(;u<=p;++u)for(d=s-1;d>=1;--d)if(c=u>0?d/r(-u):d*r(u),!(cl)break;g.push(c)}2*g.length0!==t)),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map((t=>Math.floor(t)))))),h?g.reverse():g})),Ib=Jy(((t,e,i,s,n,r)=>{const a=[],o={},l=n(t),h=n(e);let d=[];if(Number.isInteger(s))d=wb(l,h,i);else{const t=(h-l)/(i-1);for(let e=0;e{const n=r(i),l=Number.isInteger(s)?Ob(t,e,n):Ob(t,e,vb(n)),h=Ob(t,e,((t,e)=>{let i,s;return e[0]1&&(o[h]=1,a.push(h))})),a})),Bb=Jy(((t,e,i,s,n)=>Lb(s(t),s(e),i).map((t=>vb(n(t))))));Jy(((t,e,i,s,n)=>Eb(s(t),s(e),i).map((t=>vb(n(t))))));class Fb{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=_b(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):M(this._rangeFactorStart)&&M(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return P(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!P(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return P(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!P(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,n=this.range(),r=n[0],a=n[n.length-1],o=Math.min(r,a),l=Math.max(r,a),h=vs(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,l),d=P(s)?(l-o)*i:s;let c=Math.exp(e);c=c/(c-1)*d;const u=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-h);if(e>=d)return t;if(e<=1e-6)return h;const i=c*(1-Math.exp(-e*u))/e*.75+.25;return h+(t-h)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}function Yb(t,e){const i=t.r,s=e.r,n=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+s*t),d=Math.round(n*(1-t)+r*t),c=Math.round(a*(1-t)+o*t);return new Es(e,d,c,l*(1-t)+h*t)}}function jb(t,e){return i=>t*(1-i)+e*i}function Hb(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const zb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Nb=new RegExp(zb.source,"g"),{Zr:Vb}=t;function Wb(t,e){const i=typeof e;let s;if(P(e)||"boolean"===i)return()=>e;if("number"===i)return jb(t,e);if("string"===i){if(s=Ls.parseColorString(e)){const e=Vb(Ls.parseColorString(t),s);return t=>e(t).formatRgb()}return jb(Number(t),Number(e))}return e instanceof Es?Vb(t,e):e instanceof Ls?Vb(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}(t,e):jb(Number(t),Number(e))}function Gb(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}class Ub extends Fb{constructor(t=ib,e=ib){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=ib,this._piecewise=pb,this._interpolate=Wb}calculateVisibleDomain(t){var e;return M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),jb)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,pd);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Hb,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=i.length,n=this._range.length;let r=Math.min(s,n);if(s&&s=2?(e-i[s-2])/t:0;for(let n=1;n<=t;n++)i[s-2+n]=e-a*(t-n);r=n}return this._autoClamp&&(this._clamp=Gb(i[0],i[r-1])),this._piecewise=r>2?fb:pb,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:ib),this.rescale(i)):this._clamp!==ib}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return P(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return P(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class $b extends Ub{constructor(){super(...arguments),this.type=Xh.Linear}clone(){return(new $b).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return kb(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(rs(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=s[0],a=s[s.length-1];let o=wb(n[0],n[n.length-1],t,e);if(!o.length)return o;if(this._domainValidator)o=o.filter(this._domainValidator);else if((o[0]!==r||o[o.length-1]!==a)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=o[0],t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&o[0]!==r?(t[0]=o[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&o[o.length-1]!==a&&(t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);o=o.filter((t=>t>=e&&t<=i))}}return o}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Lb(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Eb(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;const n=this._domain;let r=[];if(e){const t=Db(n,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Pb(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=r[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Pb(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Pb(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}const Kb=Symbol("implicit");class Xb extends Fb{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=Xh.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Kb}clone(){const t=(new Xb).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let s=this._index.get(e);if(!s){if(this._unknown!==Kb)return this._unknown;s=this._domain.push(t),this._index.set(e,s)}const n=this._ordinalRange[(s-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;ei&&a>1;)a-=1,r=Math.floor((e-t)/a);return qb(t,e,r,n)}class Jb extends Xb{constructor(t){super(),this.type=Xh.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),s=super.domain().length,n=i[1]this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=i,this._isFixed=!1)}if(this.isBandwidthFixed()){const i=mb(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),s=Math.min((t[1]-t[0])/i,1);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)){if(i>0){const e=t[0]-i*this._rangeFactorStart,s=e+i;this._wholeRange=[e,s]}else{const e=t[1]+i*(1-this._rangeFactorEnd),s=e-i;this._wholeRange=[s,e]}const n=this._rangeFactorStart+s<=1,r=this._rangeFactorEnd-s>=0;"rangeFactorStart"===e&&n?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&r?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?n?this._rangeFactorEnd=this._rangeFactorStart+s:r?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):r?this._rangeFactorStart=this._rangeFactorEnd-s:n?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),s=this._getInvertIndex(t[1]);return e.slice(Math.min(i,s),Math.max(i,s)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[pd(t[0]),pd(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[pd(t[0]),pd(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return-1===t?e:Zb(0,e.length-1,t,!1).map((t=>e[t]))}tickData(t=10){return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Zb(0,e.length-1,t,!0).filter((t=>te[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let s;if(i=Gb(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),s=ee[t]))}_getInvertIndex(t){let e=0;const i=this.step()/2,s=this.bandwidth()/2,n=this._domain.length,r=this.range(),a=r[0]>r[r.length-1];for(e=0;e=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return P(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return P(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&h(this._userBandwidth)}clone(){var t,e,i;return new Jb(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}class Qb{constructor(){this.type=Xh.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!P(t)&&Wo(+t)?this._range[Qy(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new Qb).domain(this._domain).range(this._range).unknown(this._unknown)}}class tx extends Xb{range(t){return t?(this._range=t,this._resetRange(),this):super.range()}domain(t){return t?(super.domain(t),this._resetRange(),this):super.domain()}_resetRange(){if(!Al(this._range))return void super.range(this._range);const t=Sl(this._range,this._domain);super.range(t)}}const ex={linear:$b,band:Jb,point:class extends Jb{constructor(t){super(!1),this.type=Xh.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},ordinal:Xb,threshold:Qb,colorOrdinal:tx};function ix(t){const e=ex[t];return e?new e:null}function sx(t,e){if(!e)return t;const i=e.range(),s=Math.min(i[0],i[i.length-1]),n=Math.max(i[0],i[i.length-1]);return Math.min(Math.max(s,t),n)}function nx(t){return M(null==t?void 0:t.field)&&M(null==t?void 0:t.scale)}const rx=["linear","radial","conical"],ax={linear:{x0:0,y0:0,x1:1,y1:1},radial:{x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},conical:{x:.5,y:.5,startAngle:0,endAngle:2*Math.PI}},ox=["line","area","trail"];function lx(t){return ox.includes(t)}class hx extends Ry{getStateInfoList(){return this._stateInfoList}constructor(t,e){super(t),this._stateInfoList=[],this._mark=e}_getDefaultStateMap(){return{markUpdateRank:1}}getStateInfo(t){return this._stateInfoList.find((e=>e.stateValue===t))}addStateInfo(t){if(this.getStateInfo(t.stateValue))return;t.level=t.level||0;let e=!0;for(let i=0;it.level){this._stateInfoList.splice(i,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}_clearStateBeforeSet(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}changeStateInfo(t){const e=this.getStateInfo(t.stateValue);if(e){if(void 0!==t.datums&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),void 0!==t.items&&(this._clearStateBeforeSet(e),e.items=t.items),void 0!==t.fields)if(this._clearStateBeforeSet(e),null===t.fields)e.fields=t.fields;else{e.fields=e.fields||{};for(const i in t.fields){const s=t.fields[i];e.fields[i]=e.fields[i]||{};const n=e.fields[i];M(s.domain)&&(n.domain=s.domain),M(s.type)&&(n.type=s.type)}}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}clearStateInfo(t){t.forEach((t=>{this.getStateInfo(t)&&this.changeStateInfo({stateValue:t,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})}))}checkOneState(t,e,i,s){var n;s=v(lx)?s:!t.mark||lx(t.mark.markType);let r=!1,a=!1;if(M(i.datums)&&i.datums.length>0)r=this.checkDatumState(i,e,s),a=!0;else if(i.items)r=null!==(n=this.checkItemsState(i,t))&&void 0!==n&&n,a=!0;else if(i.fields)r=this.checkFieldsState(i,e,t,s),a=!0;else if(!r&&i.filter){const s={mark:this._mark,renderNode:t,type:t.mark.markType};r=i.filter(e,s),a=!0}return a?r?"in":"out":"skip"}checkState(t,e){const i=t.getStates().filter((t=>!!My[t])).map((t=>[t,10])),s=!t.mark||lx(t.mark.markType);for(let n=0;nt[0]))}checkDatumState(t,e,i){let s=!1;const n=i?e[0]:e;if(y(t.datums)){const e=t.datumKeys||Object.keys(t.datums[0]).filter((t=>!t.startsWith(sh)));s=t.datums.some((t=>i&&y(null==t?void 0:t.items)?e.every((e=>{var i,s;return(null===(s=null===(i=null==t?void 0:t.items)||void 0===i?void 0:i[0])||void 0===s?void 0:s[e])===(null==n?void 0:n[e])})):e.every((e=>(null==t?void 0:t[e])===(null==n?void 0:n[e])))))}else s=ns(t.datums)?(t.datumKeys||Object.keys(t.datums).filter((t=>!t.startsWith(sh)))).every((e=>{var s,r;return i?(null===(s=t.datums.items)||void 0===s?void 0:s[0][e])===n[e]:(null===(r=t.datums)||void 0===r?void 0:r[e])===n[e]})):e===t.datums;return s}checkItemsState(t,e){var i;return null===(i=t.items)||void 0===i?void 0:i.includes(e)}checkFieldsState(t,e,i,s){var n;let r=!0;for(const a in t.fields){const o=t.fields[a],l=o.type,h=o.domain,d=s?null===(n=e[0])||void 0===n?void 0:n[a]:e[a];if(Jh(l)&&h.length>1){if(this.checkLinearFieldState(h,a,e,i,s)){r=!1;break}r=!0}else{if(!h.some((t=>t===d))){r=!1;break}r=!0}}return r}checkLinearFieldState(t,e,i,s,n){var r;const a=n?null===(r=i[0])||void 0===r?void 0:r[e]:i[e];return at[t.length-1]}updateLayoutState(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}compileState(t,e){t.state({callback:(t,e)=>this.checkState(e,t)},e)}}class dx extends Py{getDataView(){return this._data}setDataView(t){this._data=t}getLatestData(){var t;return null===(t=this._data)||void 0===t?void 0:t.latestData}constructor(t,e){super(t),this.grammarType=i_.data,this._data=null,this._data=e}release(){super.release(),this._data=null}updateData(t){const e=this.getProduct(),i=this.getLatestData();if(e&&i&&(e.values(i),!t))return this.getCompiler().renderNextTick()}_compileProduct(){const t=this.getLatestData();P(t)||(P(this.getProduct())?this._initProduct(t):this._product.values(t))}_initProduct(t){var e,i;const s=this.getVGrammarView();if(!s||!t)return;const n=this.getProductId();this._product=null===(i=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e.call(s,t))||void 0===i?void 0:i.id(n),this._compiledProductId=n}generateProductId(){var t;return`${null===(t=this.getDataView())||void 0===t?void 0:t.name}`}_lookupGrammar(t){var e,i;return null===(i=null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getDataById)||void 0===i?void 0:i.call(e,t)}}class cx extends dx{constructor(t){super(t),this._mark=t.mark}setCompiledProductId(t){this._compiledProductId=t}generateProductId(){const t=super.generateProductId();return M(t)?t:`${sh}_markData_${this._mark.id}`}_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;P(e)||M(this.getProduct())||this._initProduct(e)}}var ux=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{this._unCompileChannel[t]||(this._option.noSeparateStyle||function(t,e,i){var s;const n=null===(s=e[t])||void 0===s?void 0:s.style;return!!function(t,e){return("fill"===t||"stroke"===t)&&(null==e?void 0:e.gradient)&&(null==e?void 0:e.stops)}(t,n)||!!rs(n)||!(!(null==n?void 0:n.scale)||n.field===i)}(t,i,this.getFacet())?n[t]={callback:this.compileCommonAttributeCallback(t,"normal"),dependency:[this.stateKeyToSignalName("markUpdateRank")]}:s[t]=this.compileCommonAttributeCallback(t,"normal"))})),{enterStyles:s,updateStyles:n}}compileEncode(){const t=this.stateStyle,e=vy.STATE_NORMAL,i=(t[e],ux(t,["symbol"==typeof e?e:e+""])),{enterStyles:s,updateStyles:n}=this._separateStyle();this._product.encode(n,!0),this._product.encodeState("group",s,!0),Object.keys(i).forEach((t=>{const e={};Object.keys(i[t]).forEach((i=>{this._unCompileChannel[i]||(e[i]={callback:this.compileCommonAttributeCallback(i,t),dependency:[this.stateKeyToSignalName("markUpdateRank")]})})),this._product.encodeState(t,e,!0)})),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}compileState(){this.state.compileState(this._product,this._stateSort)}compileAnimation(){var t,e,i,s;if(this._animationConfig){let n;if("component"===this.type)n=null===(t=this.model.animate)||void 0===t?void 0:t.getAnimationStateSignalName();else{const t=null===(i=(e=this.model).getRegion)||void 0===i?void 0:i.call(e);n=null===(s=null==t?void 0:t.animate)||void 0===s?void 0:s.getAnimationStateSignalName()}this._product.animation(this._animationConfig),this._product.animationState({callback:(t,e,i)=>{var s;return null===(s=i[n])||void 0===s?void 0:s.callback(t,e)},dependency:n}),this._animationConfig.normal&&(this._animationConfig.appear?this._event.on(rc.ANIMATION_END,(({event:t})=>{t.mark===this.getProduct()&&t.animationState===Yp.appear&&this.runAnimationByState(Yp.normal)})):this._event.on(rc.AFTER_DO_RENDER,(()=>{this.runAnimationByState(Yp.normal)})))}}compileContext(){const t={interactive:this.getInteractive(),zIndex:this.getZIndex(),context:{markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},skipTheme:this.getSkipTheme(),support3d:this.getSupport3d(),enableSegments:!!this._enableSegments,clip:!!this._clip||!1!==this._clip&&void 0,clipPath:this._clip||void 0};this._progressiveConfig&&(t.progressiveStep=this._progressiveConfig.progressiveStep,t.progressiveThreshold=this._progressiveConfig.progressiveThreshold,t.large=this._progressiveConfig.large,t.largeThreshold=this._progressiveConfig.largeThreshold),t.morph=this._morph,t.morphKey=this._morphKey,t.morphElementKey=this._morphElementKey,this._setCustomizedShape&&(t.setCustomizedShape=this._setCustomizedShape),this._product.configure(t)}compileSignal(){this.state.compile()}_computeAttribute(t,e){return(t,e)=>{}}compileCommonAttributeCallback(t,e){const i=this._computeAttribute(t,e),s={mark:null,parent:null,element:null};return(t,e)=>(s.mark=e.mark,s.parent=e.mark.group,s.element=e,i(t,s))}compileTransform(){var t;(null===(t=this._transform)||void 0===t?void 0:t.length)&&this.getProduct().transform(this._transform)}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getMarkById(t)}updateState(t,e){return this.state.updateState(t,e)}updateLayoutState(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach((t=>t.state.updateLayoutState(!0))),this.state.updateLayoutState(t)}updateMarkState(t){if(!this._product)return;const e=this.state.getStateInfo(t);this._product.elements.forEach((i=>{"in"===this.state.checkOneState(i,i.getDatum(),e)?i.addState(t):i.removeState(t)}))}getMarks(){return[]}runAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.runAnimationByState(t)}stopAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.stopAnimationByState(t)}pauseAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.pauseAnimationByState(t)}resumeAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.resumeAnimationByState(t)}getProductElements(){const t=this.getProduct();if(t)return t.elements}release(){super.release(),this.state.release()}}var gx=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);ne(t(...i)):e(t)}convertAngleToRadian(t){return this._transformStyleValue(t,At)}isUserLevel(t){return[Ly.User_Mark,Ly.User_Series,Ly.User_Chart,Ly.User_SeriesStyle].includes(t)}setStyle(t,e="normal",i=0,s=this.stateStyle){if(P(t))return;void 0===s[e]&&(s[e]={});const n=this.isUserLevel(i);Object.keys(t).forEach((r=>{let a=t[r];P(a)||(a=this._filterAttribute(r,a,e,i,n,s),this.setAttribute(r,a,e,i,s))}))}getStyle(t,e="normal"){var i;return null===(i=this.stateStyle[e][t])||void 0===i?void 0:i.style}_filterAttribute(t,e,i,s,n,r=this.stateStyle){let a=this._styleConvert(e);if(n)switch(t){case"angle":a=this.convertAngleToRadian(a);break;case"innerPadding":case"outerPadding":a=this._transformStyleValue(a,(t=>-t));break;case"curveType":a=this._transformStyleValue(a,(t=>{return e=t,i=this._option.model.direction,"monotone"===e?"horizontal"===i?"monotoneY":"monotoneX":e;var e,i}))}return a}setReferer(t,e,i,s=this.stateStyle){var n;if(t)if(e&&i){const r=null!==(n=s[i])&&void 0!==n?n:{[e]:{}};s[i][e]=Object.assign(Object.assign({},r[e]),{referer:t})}else Object.entries(s).forEach((([e,i])=>{Object.entries(i).forEach((([i,n])=>{s[e][i].referer=t}))}))}setPostProcess(t,e,i="normal"){var s;(null===(s=this.stateStyle[i])||void 0===s?void 0:s[t])&&(this.stateStyle[i][t].postProcess=e)}getAttribute(t,e,i="normal",s){return this._computeAttribute(t,i)(e,s)}setAttribute(t,e,i="normal",s=0,n=this.stateStyle){var r;void 0===n[i]&&(n[i]={}),void 0===n[i][t]&&(n[i][t]={level:s,style:e,referer:void 0});const a=null===(r=n[i][t])||void 0===r?void 0:r.level;M(a)&&a<=s&&Tl(n[i][t],{style:e,level:s}),"normal"!==i&&t in this._extensionChannel&&this._extensionChannel[t].forEach((t=>{void 0===n[i][t]&&(n[i][t]=n.normal[t])}))}_getDefaultStyle(){return{visible:!0,x:0,y:0}}_styleConvert(t){if(!t)return t;if(Qh(t.type)||t.scale){const e=function(t,e){if("scale"in t&&t.scale)return S(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;const i=ix(t.type);return i&&function(t,e){t&&e&&(e.domain&&t.domain(e.domain),e.range&&t.range(e.range),e.specified&&t.specified&&t.specified(e.specified))}(i,t),i}(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}_computeAttribute(t,e){var i;let s=null===(i=this.stateStyle[e])||void 0===i?void 0:i[t];s||(s=this.stateStyle.normal[t]);const n=this._computeStateAttribute(s,t,e),r=rs(null==s?void 0:s.postProcess),a=t in this._computeExChannel;if(r&&a){const i=this._computeExChannel[t];return(r,a)=>{let o=n(r,a);return o=s.postProcess(o,r,this._attributeContext,a,this.getDataView()),i(t,r,e,a,o)}}if(r)return(t,e)=>s.postProcess(n(t,e),t,this._attributeContext,e,this.getDataView());if(a){const i=this._computeExChannel[t];return(s,r)=>i(t,s,e,r,n(s,r))}return n}_computeStateAttribute(t,e,i){var s;return t?t.referer?t.referer._computeAttribute(e,i):t.style?"function"==typeof t.style?(e,i)=>t.style(e,this._attributeContext,i,this.getDataView()):rx.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):Qh(null===(s=t.style.scale)||void 0===s?void 0:s.type)?(e,i)=>{let s=e;return"series"===this.model.modelType&&this.model.getMarkData&&(s=this.model.getMarkData(e)),t.style.scale.scale(s[t.style.field])}:(e,i)=>t.style:(e,i)=>t.style:(t,e)=>{}}_initStyle(){const t=this._getDefaultStyle();this.setStyle(t,"normal",0)}_initSpecStyle(t,e,i){t.style&&this.setStyle(t.style,"normal",Ly.User_Mark,e);const s=t.state;s&&Object.keys(s).forEach((t=>{const i=s[t];if("style"in i){const s=i.style;let n={stateValue:t};"level"in i&&(n.level=i.level),"filter"in i&&(n=rs(i.filter)?Object.assign({filter:i.filter},n):Object.assign(Object.assign({},i.filter),n)),this.state.addStateInfo(n),this.setStyle(s,t,Ly.User_Mark,e)}else this.setStyle(i,t,Ly.User_Mark,e)}))}_computeGradientAttr(t){var e,i;const{gradient:s,scale:n,field:r}=t,a=gx(t,["gradient","scale","field"]);let o=n,l=r;if(!(n&&r||"series"!==this.model.modelType)){const{scale:t,field:e}=this.model.getColorAttribute();n||(o=t),l||(l=e)}const h=Sl(xl(this.model.getColorScheme(),"series"===this.model.modelType?null===(i=(e=this.model).getSpec)||void 0===i?void 0:i.call(e):void 0),this.model.getDefaultColorDomain()),d=Object.assign(Object.assign({},ax[s]),a);return(t,e)=>{const i={},n=this.getDataView();return Object.keys(d).forEach((s=>{const r=d[s];"stops"===s?i.stops=r.map((i=>{const{opacity:s,color:r,offset:a}=i;let d=null!=r?r:null==o?void 0:o.scale(t[l]);return rs(r)&&(d=r(t,this._attributeContext,e,n)),M(s)&&(d=Ls.SetOpacity(d,s)),{offset:rs(a)?a(t,this._attributeContext,e,n):a,color:d||h[0]}})):rs(r)?i[s]=r(t,this._attributeContext,e,n):i[s]=r})),i.gradient=s,i}}_computeBorderAttr(t){const{scale:e,field:i}=t,s=gx(t,["scale","field"]);return(t,n)=>{var r,a,o;const l={};if(Object.keys(s).forEach((e=>{const i=s[e];rs(i)?l[e]=i(t,this._attributeContext,n,this.getDataView()):l[e]=i})),"stroke"in l)rx.includes(null===(o=s.stroke)||void 0===o?void 0:o.gradient)&&(l.stroke=this._computeGradientAttr(s.stroke)(t,n));else{const s=Sl(xl(this.model.getColorScheme(),"series"===this.model.modelType?null===(a=(r=this.model).getSpec)||void 0===a?void 0:a.call(r):void 0),this.model.getDefaultColorDomain());let n=e,o=i;if(!(e&&i||"series"!==this.model.modelType)){const{scale:i,field:r}=this.model.getColorAttribute();e||(n=i),o||(o=r),l.stroke=(null==n?void 0:n.scale(t[o]))||s[0]}}return l}}}class _x extends jn{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function fx(t){return new _x(t)}function vx(){vx.__loaded||(vx.__loaded=!0,Gr.RegisterGraphicCreator("shadowRoot",fx))}vx.__loaded=!1;const yx=vx,bx=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...sn];class xx extends hn{constructor(t){super(t),this.type="arc",this.numberType=vn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(h(t,!0)?t:a*parseFloat(t)/100,a/2);if(y(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=((t=0)=>{if(t<0)for(;t<-ot;)t+=ot;else if(t>0)for(;t>ot;)t-=ot;return t})(e),i=e+r,s&&ht(r)nt&&o>nt)return{startAngle:e-n*u*r,endAngle:i+n*u*a,sc:n*u*r,ec:n*u*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=mt(a*a+o*o)}=this.attribute,h=ht(e-t);let d=t,c=e,u=t,p=e;const g=r/2;let m=h,_=h;if(g>nt&&l>nt){const i=e>t?1:-1;let s=ft(Number(l)/o*gt(g)),n=ft(Number(l)/a*gt(g));return(m-=2*s)>nt?(s*=i,u+=s,p-=s):(m=0,u=p=(t+e)/2),(_-=2*n)>nt?(n*=i,d+=n,c-=n):(_=0,d=c=(t+e)/2),{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}return{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}getGraphicTheme(){return Qi(this).arc}updateAABBBounds(t,e,i,s){if(!oi.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=oi.graphicService.updateTempAABBBounds(i);Vv(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return oi.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,so){const t=l;l=o,o=t}return s<=nt?i.set(0,0,0,0):Math.abs(o-l)>lt-nt?i.set(-s,-s,s,s):($s(l,o,s,i),$s(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,bx)}needUpdateTag(t){return super.needUpdateTag(t,bx)}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let s=t.innerRadius-(t.innerPadding||0),n=t.outerRadius-(t.outerPadding||0);const r=ht(i-e),a=i>e;if(n=lt-nt)o.moveTo(0+n*ct(e),0+n*gt(e)),o.arc(0,0,n,e,i,!a),s>nt&&(o.moveTo(0+s*ct(i),0+s*gt(i)),o.arc(0,0,s,i,e,a));else{const t=n*ct(e),r=n*gt(e),l=s*ct(i),h=s*gt(i);o.moveTo(0+t,0+r),o.arc(0,0,n,e,i,!a),o.lineTo(0+l,0+h),o.arc(0,0,s,i,e,a),o.closePath()}return o}clone(){return new xx(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return xx.NOWORK_ANIMATE_ATTR}}function Sx(t){return new xx(t)}xx.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ln);class Mx{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:s=this.L_TIME,R_COUNT:n=this.R_COUNT}=e;if(t.size{r++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length=n)););if(is;)t.timestamp.shift()})),r}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:s=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>s&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();t.forEach((t=>{for(;s-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();for(;s-t.timestamp[0]>i;)t.timestamp.shift()}}class kx{static GetCanvas(){try{return kx.canvas||(kx.canvas=oi.global.createCanvas({})),kx.canvas}catch(t){return null}}static GetCtx(){if(!kx.ctx){const t=kx.GetCanvas();kx.ctx=t.getContext("2d")}return kx.ctx}}class Ax extends Mx{static getInstance(){return Ax._instance||(Ax._instance=new Ax),Ax._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=kx.GetCanvas(),s=kx.GetCtx();if(i.width=e,i.height=1,!s)return;if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");const n=s.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),s.fillStyle=n,s.fillRect(0,0,e,1),this.rgbaSet=s.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,s,n=[],r=100){let a=`${t}${e}${i}${s}`;n.forEach((t=>a+=t.join())),a+=r;let o=this.dataMap.get(a);return o||(o={data:new Ax(n,r),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class wx{static GetSize(t){for(let e=0;e=t)return wx.ImageSize[e];return t}static Get(t,e,i,s,n,r,a){const o=wx.GenKey(t,e,i,s,n),l=wx.cache[o];if(!l||0===l.length)return null;for(let t=0;t=r&&l[t].height>=a)return l[t].pattern;return null}static Set(t,e,i,s,n,r,a,o){const l=wx.GenKey(t,e,i,s,n);wx.cache[l]?wx.cache[l].push({width:a,height:o,pattern:r}):wx.cache[l]=[{width:a,height:o,pattern:r}]}static GenKey(t,e,i,s,n){return`${e},${i},${s},${n},${t.join()}`}}wx.cache={},wx.ImageSize=[20,40,80,160,320,640,1280,2560];const Tx=new class{constructor(){this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{innerPadding:_=l.innerPadding,outerPadding:f=l.outerPadding,startAngle:v=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x=l.x,y:S=l.y,scaleX:M=l.scaleX,scaleY:k=l.scaleY}=t.attribute;let{innerRadius:A=l.innerRadius,outerRadius:w=l.outerRadius}=t.attribute;w+=f,A-=_;const T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=La(e,o,e.dpr),d=o/w,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:w+u*h,innerRadius:A-u*h,startAngle:v-u*d,endAngle:y+u*d}),e.beginPath(),Za(t,e,i,s,w+u*h,A-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/M,(S-s)/k,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder"),t.setAttributes({outerRadius:w,innerRadius:A,startAngle:v,endAngle:y})}},Cx=To,Lx=uo;var Ex=function(t,e){return function(i,s){e(i,s,t)}};let Px=class extends vo{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=vn,this.builtinContributions=[Tx,Lx,Cx],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),d=h.startAngle;let c=h.endAngle;c=o,ht(c-d);const u=c>d;let p=!1;if(nnt){const t=pt(b,y),r=pt(x,y),a=Xa(f,v,m,_,n,t,Number(u)),o=Xa(M,k,A,w,n,r,Number(u));if(y0&&e.arc(i+o.cx,s+o.cy,r,dt(o.y11,o.x11),dt(o.y01,o.x01),!u)}}else e.moveTo(i+m,s+_);if(!(r>nt)||C<.001)e.lineTo(i+A,s+w),p=!0;else if(T>nt){const t=pt(E,T),n=pt(P,T),a=Xa(A,w,M,k,r,-n,Number(u)),o=Xa(m,_,f,v,r,-t,Number(u));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),T0&&e.arc(i+a.cx,s+a.cy,n,dt(a.y01,a.x01),dt(a.y11,a.x11),!u);const t=dt(a.cy+a.y11,a.cx+a.x11),o=c-l-.03;e.arc(i,s,r,t,o,u)}}else e.lineTo(i+r*ct(L),s+r*gt(L));return p}drawShape(t,e,i,s,n,r,a,o){const l=Qi(t,null==r?void 0:r.theme).arc,{fill:h=l.fill,stroke:d=l.stroke,x:c=l.x,y:u=l.y}=t.attribute,p=this.valid(t,l,a,o);if(!p)return;const{fVisible:g,sVisible:m,doFill:_,doStroke:f}=p,{outerPadding:y=l.outerPadding,innerPadding:b=l.innerPadding,cap:x=l.cap,forceShowCap:S=l.forceShowCap}=t.attribute;let{outerRadius:M=l.outerRadius,innerRadius:k=l.innerRadius}=t.attribute;M+=y,k-=b;let A=0;const w=(v(x)&&x||x[0])&&"conical"===h.gradient;if(w){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ht(s-i){var e;let i=!0;if(v(t,!0)){for(let s=0;s<4;s++)Ns[s]=t,i&&(i=!(null!==(e=Ns[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)Ns[e]=!!t[e],i&&(i=!!Ns[e]);else Ns[0]=!1,Ns[1]=!1,Ns[2]=!1,Ns[3]=!1;return{isFullStroke:i,stroke:Ns}})(d);if((_||C)&&(e.beginPath(),Za(t,e,i,s,M,k),T=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),_&&(a?a(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill())),f&&C&&(o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke()))),!C&&f&&(e.beginPath(),Za(t,e,i,s,M,k,L),T||this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),(v(x)&&x||x[1])&&S){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(ht(h-r)>=lt-nt){e.beginPath();const r=Math.abs(M-k)/2/M,{endAngle:h=l.endAngle,fill:d=l.fill}=t.attribute,c=h;if(this.drawArcTailCapPath(t,e,i,s,M,k,c,c+r),T||this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),_){const n=d;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=lt;for(;i>lt;)i-=lt;if(ia)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),Rs(o.color,l.color,h,!1)}(0,0,h,n);a||Ga&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=r,e.fill())}}f&&(o||m&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke()))}}this.afterRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),w&&(h.startAngle+=A,h.endAngle+=A)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Px=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Ex(0,$(X)),Ex(0,K(Ja)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Px);let Dx=!1;const Ox=new B((t=>{Dx||(Dx=!0,t(Px).toSelf().inSingletonScope(),t(Jn).to(Px).inSingletonScope(),t(ir).toService(Jn),t(Ja).toService(po),Z(t,Ja))}));let Rx=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=vn}};Rx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Jn)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Rx);let Ix=!1;const Bx=new B(((t,e,i,s)=>{Ix||(Ix=!0,t(I_).to(Rx).inSingletonScope(),t(Z_).toService(I_))}));let Fx=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=vn}};Fx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Jn)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Fx);let Yx=!1;const jx=new B(((t,e,i,s)=>{Yx||(Yx=!0,t(k_).to(Fx).inSingletonScope(),t(M_).toService(k_))}));function Hx(){Hx.__loaded||(Hx.__loaded=!0,Gr.RegisterGraphicCreator("arc",Sx),Di.load(Ox),Di.load(S_?Bx:jx))}Hx.__loaded=!1;const zx=Hx;class Nx extends xx{constructor(t){super(t),this.type="arc3d",this.numberType=yn}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:n=e.outerRadius,height:r=0}=t,a=n+r;return i.setValue(-a,-a,a,a),oi.graphicService.updateTempAABBBounds(i),oi.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Nx.NOWORK_ANIMATE_ATTR}}function Vx(t){return new Nx(t)}Nx.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},ln);class Wx{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Ds.Get(e,Ps.Color1),this.ambient=i;const s=mt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/s,t[1]/s,t[2]/s]}computeColor(t,e){const i=this.formatedDir,s=pt(ut((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=S(e)?Ds.Get(e,Ps.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*s}, ${r[1]*n[1]*s}, ${r[2]*n[2]*s})`}}const Gx=()=>{Ug.registerPlugin("DirectionalLight",Wx)};class Ux{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Er.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Er.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,s){let n,r,a,o,l,h,d,c,u,p;const g=e[0],m=e[1],_=e[2],f=s[0],v=s[1],y=s[2],b=i[0],x=i[1],S=i[2];Math.abs(g-b){Ug.registerPlugin("OrthoCamera",Ux)};let Kx=class extends vo{constructor(){super(...arguments),this.numberType=yn}drawShape(t,e,i,s,n,r,a,o){var l;const h=Qi(t,null==r?void 0:r.theme).arc,{fill:d=h.fill}=t.attribute,c=this.valid(t,h,a,o);if(!c)return;const{fVisible:u,sVisible:p,doFill:g,doStroke:m}=c,_=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:f=h.outerPadding,innerPadding:v=h.innerPadding,height:y=10}=t.attribute;let{outerRadius:b=h.outerRadius,innerRadius:x=h.innerRadius}=t.attribute;b+=f,x-=v;const S=Ds.Get(d,Ps.Color255),{light:M}=n.stage||{},k=n.hack_pieFace,A={top:_,bottom:_+y},w={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===k||"top"===k?(e.beginPath(),function(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(r=lt-nt)e.moveTo(i+r*ct(o),s+r*gt(o),n),e.arc(i,s,r,o,l,!d,n),a>nt&&(e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,o,d,n));else{const{outerDeltaAngle:h,innerDeltaAngle:u,outerStartAngle:p,outerEndAngle:g,innerEndAngle:m,innerStartAngle:_}=t.getParsePadAngle(o,l),f=r*ct(p),v=r*gt(p),y=a*ct(m),b=a*gt(m);h<.001?c=!0:(e.moveTo(i+f,s+v,n),e.arc(i,s,r,p,g,!d,n)),!(a>nt)||u<.001?(e.lineTo(i+y,s+b,n),c=!0):(e.lineTo(i+y,s+b,n),e.arc(i,s,a,m,_,d,n))}e.closePath()}(t,e,i,s,A[k],b,x),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))):"outside"!==k&&"inside"!==k||("inside"===k&&(e.save(),e.beginPath(),e.arc(i,s,x,0,lt,!0,A.top),e.clip()),e.beginPath(),function(t,e,i,s,n,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),d=ht(h-l),c=h>l;let u=!1;if(a<=nt)e.moveTo(i,s,n);else if(d>=lt-nt)e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,h,!c,n),e.lineTo(i+a*ct(h),s+a*gt(h),r),e.arc(i,s,a,h,l,c,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:p}=o(l,h),g=a*ct(d),m=a*gt(d),_=a*ct(p),f=a*gt(p);t<.001?u=!0:(e.moveTo(i+g,s+m,n),e.arc(i,s,a,d,p,!c,n),e.lineTo(i+_,s+f,r),e.arc(i,s,a,p,d,c,r))}e.closePath()}(t,e,i,s,A.top,A.bottom,"outside"===k?b:x,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:n,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===k?{innerouterDeltaAngle:s,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),"inside"===k&&e.restore())}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Kx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Kx);let Xx=!1;const qx=new B((t=>{Xx||(Xx=!0,t(Qn).to(Kx).inSingletonScope(),t(ir).toService(Qn))}));let Zx=class extends J_{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=yn,this.themeType="arc"}};Zx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Qn)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Zx);let Jx=!1;const Qx=new B(((t,e,i,s)=>{Jx||(Jx=!0,t(B_).to(Zx).inSingletonScope(),t(Z_).toService(B_))}));function tS(){tS.__loaded||(tS.__loaded=!0,Gr.RegisterGraphicCreator("arc3d",Vx),Gx(),$x(),Di.load(qx),Di.load(Qx))}tS.__loaded=!1;const eS=tS,iS=["points","cornerRadius",...sn];class sS extends hn{constructor(t){super(t),this.type="polygon",this.numberType=Tn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return Qi(this).polygon}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),oi.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return oi.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:s=e.points}=t;return s.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,s,n){"points"===t&&(n.points=Xs(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,iS)}needUpdateTag(t){return super.needUpdateTag(t,iS)}toCustomPath(){const t=this.attribute.points,e=new Be;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new sS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return sS.NOWORK_ANIMATE_ATTR}}function nS(t){return new sS(t)}sS.NOWORK_ANIMATE_ATTR=ln;class rS extends sS{constructor(t){super(t),this.type="pyramid3d",this.numberType=Cn}updateAABBBounds(t,e,i){const s=this.stage;return s&&s.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],s=t[1];i.add(e,s)})),oi.graphicService.updateTempAABBBounds(i),oi.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const s=3===i?t[0]:t[i+1],n=e.x-s.x;return 0===n?0:(e.y-s.y)/n})),i=t.map((t=>({p:t,d:0})));let s=!1,n=0;for(let t=0;t=0;e--){const s=t[e];i.unshift({p:s,d:0})}for(let e=0;e{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return rS.NOWORK_ANIMATE_ATTR}}function aS(t){return new rS(t)}rS.NOWORK_ANIMATE_ATTR=ln;class oS extends vo{stroke(t,e,i,s,n){const r=s.vertices;s.edges.forEach((s=>{const a=r[s[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[s[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()}))}fill(t,e,i,s,n,r,a,o,l,h,d){const c=Ds.Get(r,Ps.Color255),u=s.vertices,p=u.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];s.polygons.forEach(((t,e)=>{if(n&&!n[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,s=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=s+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((s=>{const{polygon:n,normal:p}=s.polygon,g=u[n[0]],m=u[n[1]],_=u[n[2]],f=u[n[3]],v={x:t+g[0],y:e+g[1],z:i+g[2]},y={x:t+m[0],y:e+m[1],z:i+m[2]},b={x:t+_[0],y:e+_[1],z:i+_[2]},x={x:t+f[0],y:e+f[1],z:i+f[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.closePath(),d?d(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,c):r,a.fill())}))}}let lS=class extends oS{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Cn}drawShape(t,e,i,s,n,r,a,o){var l;const h=Qi(t,null==r?void 0:r.theme).polygon,{fill:d=h.fill,stroke:c=h.stroke,face:u=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=n.stage||{},m=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,s,h);let n=d;"string"!=typeof n&&(n="black"),this.fill(i,s,p,m,u,n,e,g,t,h,a)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,p,m,e))}draw(t,e,i){const s=Qi(t).polygon;this._draw(t,s,!1,i)}};lS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],lS);let hS=!1;const dS=new B((t=>{hS||(hS=!0,t(ur).to(lS).inSingletonScope(),t(ir).toService(ur))}));let cS=class extends J_{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Cn,this.themeType="polygon"}};cS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(ur)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],cS);let uS=!1;const pS=new B(((t,e,i,s)=>{uS||(uS=!0,t($_).to(cS).inSingletonScope(),t(Z_).toService($_))}));function gS(){gS.__loaded||(gS.__loaded=!0,Gr.RegisterGraphicCreator("pyramid3d",aS),Gx(),$x(),Di.load(dS),Di.load(pS))}gS.__loaded=!1;const mS=gS,_S=["segments","points","curveType","curveTension",...sn];class fS extends hn{constructor(t){super(t),this.type="area",this.numberType=bn}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return Qi(this).area}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),oi.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return oi.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){const{points:n=e.points}=t,r=i;return n.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,s,n){"points"===t&&(n.points=Xs(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,_S)}needUpdateTag(t){return super.needUpdateTag(t,_S)}toCustomPath(){const t=new Be,e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0;const s=[];if(e.forEach((e=>{var n,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),s.length){for(let e=s.length-1;e>=0;e--)t.lineTo(s[e].x,s[e].y);t.closePath()}}};return e.points?s(e.points):i&&i.length&&i.forEach((t=>{s(t.points)})),t}clone(){return new fS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return fS.NOWORK_ANIMATE_ATTR}}function vS(t){return new fS(t)}fS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},ln);let yS=!1;const bS=new B((t=>{yS||(yS=!0,t(Po).toSelf().inSingletonScope(),t(tr).to(Po).inSingletonScope(),t(ir).toService(tr),t(Qa).toService(po),Z(t,Qa),t(Do).toSelf().inSingletonScope())}));let xS=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=bn}};xS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],xS);let SS=!1;const MS=new B(((t,e,i,s)=>{SS||(SS=!0,t(F_).to(xS).inSingletonScope(),t(Z_).toService(F_))}));let kS=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=bn}};kS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],kS);let AS=!1;const wS=new B(((t,e,i,s)=>{AS||(AS=!0,t(A_).to(kS).inSingletonScope(),t(M_).toService(A_))}));function TS(){TS.__loaded||(TS.__loaded=!0,Gr.RegisterGraphicCreator("area",vS),Di.load(bS),Di.load(S_?MS:wS))}TS.__loaded=!1;const CS=TS,LS=["width","height","image",...sn];class ES extends hn{constructor(t){super(t),this.type="image",this.numberType=kn,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return Qi(this).image}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;if(!this.updatePathProxyAABBBounds(i)){const{width:s=e.width,height:n=e.height}=t;i.set(0,0,s,n)}const{tb1:s,tb2:n}=oi.graphicService.updateTempAABBBounds(i);return Vv(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),oi.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return ri[t]}needUpdateTags(t){return super.needUpdateTags(t,LS)}needUpdateTag(t){return super.needUpdateTag(t,LS)}clone(){return new ES(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ES.NOWORK_ANIMATE_ATTR}}function PS(t){return new ES(t)}ES.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},ln);const DS=new class extends Kv{constructor(){super(...arguments),this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){return super.drawShape(t,e,i,s,n,r,a,o,l,h,d,c)}},OS=new class extends co{constructor(){super(...arguments),this.time=te.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,d,c,u){const{background:p,backgroundMode:g=l.backgroundMode,backgroundFit:m=l.backgroundFit}=t.attribute;if(p)if(t.backgroundImg){const i=t.resources.get(p);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=Qi(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}const s=t.AABBBounds;this.doDrawImage(e,i.data,s,g,m),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(ns(p)){const{stroke:i,fill:s,lineWidth:n=1,cornerRadius:r=0,expandX:a=0,expandY:o=0}=p;if(!i&&!s)return;e.beginPath();const{x:l,y:d,width:c,height:u}=function(t){const e=Ws(t.attribute.boundsPadding),i=t.AABBBounds;let s=i.x1,n=i.y1,r=i.width(),a=i.height();return h(e)?(s+=e,n+=e,r-=2*e,a-=2*e):(s+=e[3],n+=e[0],r-=e[1]+e[3],a-=e[0]+e[2]),{x:s,y:n,width:r,height:a}}(t);r?Na(e,l-a,d-o,c+2*a,u+2*o,r):e.rect(l-a,d-o,c+2*a,u+2*o),e.globalAlpha=1,s&&(e.fillStyle=s,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();const n=t.AABBBounds;e.rect(i,s,n.width(),n.height()),e.fillStyle=p,e.globalAlpha=1,e.fill()}}};var RS=function(t,e){return function(i,s){e(i,s,t)}};const IS=["","repeat-x","repeat-y","repeat"];let BS=class extends vo{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=kn,this.builtinContributions=[DS,OS],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Qi(t).image,{width:h=l.width,height:d=l.height,repeatX:c=l.repeatX,repeatY:u=l.repeatY,x:p=l.x,y:g=l.y,cornerRadius:m=l.cornerRadius,image:_}=t.attribute,f=this.valid(t,l,a);if(!f)return;const{fVisible:v,sVisible:b,doFill:x,doStroke:S}=f;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,l),this.beforeRenderStep(t,e,i,s,x,!1,v,!1,l,n,a),x)if(a)a(e,t.attribute,l);else if(v){if(!_||!t.resources)return;const n=t.resources.get(_);if("success"!==n.state)return;let r=!1;0===m||y(m)&&m.every((t=>0===t))||(e.beginPath(),Na(e,i,s,h,d,m),e.save(),e.clip(),r=!0),e.setCommonStyle(t,t.attribute,i,s,l);let a=0;if("repeat"===c&&(a|=1),"repeat"===u&&(a|=2),a){const t=e.createPattern(n.data,IS[a]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,h,d),e.translate(-i,-s,!0)}else e.drawImage(n.data,i,s,h,d);r&&e.restore()}S&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,p-i,g-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,x,!1,v,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&S(s))return void js.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=Qi(t).image;this._draw(t,a,!1,i)}};BS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),RS(0,$(X)),RS(0,K(io)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],BS);let FS=!1;const YS=new B((t=>{FS||(FS=!0,t(gr).to(BS).inSingletonScope(),t(ir).toService(gr),t(io).toService(po),Z(t,io))}));let jS=class{constructor(){this.type="image",this.numberType=kn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};jS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],jS);let HS=!1;const zS=new B(((t,e,i,s)=>{HS||(HS=!0,t(j_).to(jS).inSingletonScope(),t(Z_).toService(j_))}));let NS=class{constructor(){this.type="image",this.numberType=kn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};NS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],NS);let VS=!1;const WS=new B(((t,e,i,s)=>{VS||(VS=!0,t(T_).to(NS).inSingletonScope(),t(NS).toService(T_))}));function GS(){GS.__loaded||(GS.__loaded=!0,Gr.RegisterGraphicCreator("image",PS),Di.load(YS),Di.load(S_?zS:WS))}GS.__loaded=!1;const US=GS,$S=["segments","points","curveType","curveTension",...sn];class KS extends hn{constructor(t={}){super(t),this.type="line",this.numberType=An}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,s,n){"points"===t&&(n.points=Xs(i,s,e))}getGraphicTheme(){return Qi(this).line}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),oi.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return oi.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){const{points:n=e.points,connectedType:r}=t,a=i;return n.forEach((t=>{!1===t.defined&&"zero"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments,connectedType:r}=t,a=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"zero"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,$S)}needUpdateTag(t){return super.needUpdateTag(t,$S)}toCustomPath(){const t=this.attribute,e=new Be,i=t.segments,s=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{s(t.points)})):t.points&&s(t.points),e}clone(){return new KS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return KS.NOWORK_ANIMATE_ATTR}}function XS(t){return new KS(t)}KS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},ln);let qS=!1;const ZS=new B((t=>{qS||(qS=!0,t(So).toSelf().inSingletonScope(),t(Mo).toSelf().inSingletonScope(),t(nr).to(So).inSingletonScope(),t(ir).toService(nr))}));class JS extends vo{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;s.highPerformanceSave();const n=t.getGraphicTheme(),r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=e;if(s.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=La(s,n+r,s.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Er.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let QS=class extends JS{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=An}};QS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(nr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],QS);let tM=!1;const eM=new B(((t,e,i,s)=>{tM||(tM=!0,t(H_).to(QS).inSingletonScope(),t(Z_).toService(H_))}));let iM=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=An}};iM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(nr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],iM);let sM=!1;const nM=new B(((t,e,i,s)=>{sM||(sM=!0,t(C_).to(iM).inSingletonScope(),t(M_).toService(C_))}));function rM(){rM.__loaded||(rM.__loaded=!0,Gr.RegisterGraphicCreator("line",XS),Di.load(ZS),Di.load(S_?eM:nM))}rM.__loaded=!1;const aM=rM,oM=["path","customPath",...sn];class lM extends hn{constructor(t){super(t),this.type="path",this.numberType=wn}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof Be?e.path:(P(this.cache)&&this.doUpdatePathShape(),this.cache instanceof Be?this.cache:t.path)}getGraphicTheme(){return Qi(this).path}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=oi.graphicService.updateTempAABBBounds(i);Vv(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return oi.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;S(t.path,!0)?this.cache=(new Be).fromString(t.path):t.customPath&&(this.cache=new Be,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,oM)}needUpdateTag(t){return super.needUpdateTag(t,oM)}toCustomPath(){return(new Be).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new lM(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return lM.NOWORK_ANIMATE_ATTR}}function hM(t){return new lM(t)}lM.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},ln);const dM=To,cM=uo;var uM=function(t,e){return function(i,s){e(i,s,t)}};let pM=class extends vo{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=wn,this.builtinContributions=[cM,dM],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=null!==(l=this.tempTheme)&&void 0!==l?l:Qi(t,null==r?void 0:r.theme).path,{x:u=c.x,y:p=c.y}=t.attribute,g=null!==(h=this.z)&&void 0!==h?h:0,m=this.valid(t,c,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:y}=m;e.beginPath(),t.pathShape?ne(t.pathShape.commandList,e,i,s,1,1,g):ne((null!==(d=t.attribute.path)&&void 0!==d?d:c.path).commandList,e,i,s,1,1,g),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,v,y,_,f,c,n,a,o),y&&(o?o(e,t.attribute,c):f&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,c),e.stroke())),v&&(a?a(e,t.attribute,c):_&&(e.setCommonStyle(t,t.attribute,u-i,p-s,c),e.fill())),this.afterRenderStep(t,e,i,s,v,y,_,f,c,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};pM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),uM(0,$(X)),uM(0,K(so)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],pM);let gM=!1;const mM=new B((t=>{gM||(gM=!0,t(pM).toSelf().inSingletonScope(),t(rr).to(pM).inSingletonScope(),t(ir).toService(rr),t(so).toService(po),Z(t,so))}));let _M=class extends JS{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=wn}};_M=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(rr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_M);let fM=!1;const vM=new B(((t,e,i,s)=>{fM||(fM=!0,t(z_).to(_M).inSingletonScope(),t(Z_).toService(z_))}));let yM=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=wn}};yM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(rr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],yM);let bM=!1;const xM=new B(((t,e,i,s)=>{bM||(bM=!0,t(L_).to(yM).inSingletonScope(),t(M_).toService(L_))}));function SM(){SM.__loaded||(SM.__loaded=!0,Gr.RegisterGraphicCreator("path",hM),Di.load(mM),Di.load(S_?vM:xM))}SM.__loaded=!1;const MM=SM,kM=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class AM extends Gv{constructor(t){super(t),this.type="rect3d",this.numberType=En}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:s,x:n,y:r,length:a=pt(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:s-r;for(let e=0;e=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],TM);let CM=!1;const LM=new B((t=>{CM||(CM=!0,t(lr).to(TM).inSingletonScope(),t(ir).toService(lr))}));let EM=class extends J_{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=En,this.themeType="rect"}};EM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(lr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],EM);let PM=!1;const DM=new B(((t,e,i,s)=>{PM||(PM=!0,t(V_).to(EM).inSingletonScope(),t(Z_).toService(V_))}));function OM(){OM.__loaded||(OM.__loaded=!0,Gr.RegisterGraphicCreator("rect3d",wM),Di.load(LM),Di.load(DM))}OM.__loaded=!1;const RM=OM;class IM{constructor(t,e,i,s,n,r,a,o,l,h,d,c,u,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=li[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=c,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-n:"center"===this.globalAlign&&(o=-n/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;ithis[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;ithis[this.directionKey.top]+l||rthis[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;it&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width;let n=this.height||s||0;n=Math.min(n,s);let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;ithis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+n>this[this.directionKey.top]+r||at&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+nthis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class BM{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const s=Qs(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof s?s>this.fontSize?s:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:a,width:o}=mi(t,i);let l=0,h=0,d=0;this.height>r&&(l=(this.height-r)/2,h=Math.ceil(l),d=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=r-l):"bottom"===this.textBaseline?(this.ascent=r-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=a+d),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=mi(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,s,n){let r=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)r=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)r+=this.ellipsisStr,"right"!==n&&"end"!==n||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=pi(r,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,r.length-1);if(r=r.slice(0,t),r+=this.ellipsisStr,"right"===n||"end"===n){const{width:e}=mi(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||false;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,ui(t,e)}(t,this.character),t.strokeText(r,a,e)),function(t,e){const i=e&&e.fill||true;if(!i)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.fillStyle=i,ui(t,e)}(t,this.character),this.character.fill&&t.fillText(r,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=pi(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=mi(this.text.slice(t),this.character);return i+this.ellipsisWidth-s}return i}}class FM extends ES{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=Ws(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(y(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=Ws(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=ri.width,height:e=ri.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class YM{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof FM?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=li[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof BM){const e=ci.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,s=this.height;let n=this.left,r=0;this.actualWidtht.overflow)))){let t=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s.overflow)continue;if(s instanceof FM)break;if("vertical"===this.direction&&"vertical"!==s.direction){s.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";s.ellipsisStr=r;const{width:a}=mi(r,s.character),o=a||0;if(o<=this.blankWidth+t){e&&(s.ellipsis="add");break}if(o<=this.blankWidth+t+s.width){s.ellipsis="replace",s.ellipsisWidth=o,s.ellipsisOtherParagraphWidth=this.blankWidth+t;break}s.ellipsis="hide",t+=s.width}}this.paragraphs.map(((e,n)=>{if(e instanceof FM)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+e._y,this.ascent);e.draw(t,s+this.ascent,i,0===n,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof FM)break;const{width:n}=mi(t,s.character),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof FM?t.width:t.getWidthWithEllips(this.direction)})),i}}class jM{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=li[this.direction]}store(t){if(t instanceof FM){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new YM(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof FM?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=pi(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new BM(i,t.newLine,t.character),new BM(s,!0,t.character)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const HM=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...sn];class zM extends hn{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Pn}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:ni.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:ni.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:ni.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:ni.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:ni.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:ni.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:ni.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:ni.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return Qi(this).richtext}updateAABBBounds(t,e,i){if(!oi.graphicService.validCheck(t,e,i,this))return i;const{width:s=e.width,height:n=e.height,maxWidth:r=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:l=e.textBaseline}=t;if(s>0&&n>0)i.set(0,0,s,n);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let l=s||e||0,h=n||o||0;h="number"==typeof a&&h>a?a:h||0,l="number"==typeof r&&l>r?r:l||0,i.set(0,0,l,h)}let h=0;switch(l){case"top":h=0;break;case"middle":h=-i.height()/2;break;case"bottom":h=-i.height()}let d=0;switch(o){case"left":d=0;break;case"center":d=-i.width()/2;break;case"right":d=-i.width()}return i.translate(d,h),oi.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||oi.graphicService.updateHTMLTextAABBBounds(t,e,i),oi.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,HM)}needUpdateTag(t){return super.needUpdateTag(t,HM)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}combinedStyleToCharacter(t){const{fill:e,stroke:i,fontSize:s,fontFamily:n,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:d}=this.attribute;return Object.assign({fill:e,stroke:i,fontSize:s,fontFamily:n,fontStyle:r,fontWeight:a,lineWidth:o,opacity:l,fillOpacity:h,strokeOpacity:d},t)}doUpdateFrameCache(t){var e;const{textConfig:i=[],maxWidth:s,maxHeight:n,width:r,height:a,ellipsis:o,wordBreak:l,verticalDirection:d,textAlign:c,textBaseline:u,layoutDirection:p,singleLine:g,disableAutoWrapLine:m}=this.attribute,_=[],f=null!=t?t:i;for(let t=0;t{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,_.push(t)}}else{const e=this.combinedStyleToCharacter(f[t]);if(h(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i0,y="number"==typeof n&&Number.isFinite(n)&&n>0,b="number"==typeof r&&Number.isFinite(r)&&r>0&&(!v||r<=s),x="number"==typeof a&&Number.isFinite(a)&&a>0&&(!y||a<=n),S=new IM(0,0,(b?r:v?s:0)||0,(x?a:y?n:0)||0,o,l,d,c,u,p||"horizontal",!b&&v,!x&&y,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),M=new jM(S);if(m){let t=0,e=!1;for(let i=0;i<_.length;i++){const s=_[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,!s.newLine&&S.lines[S.lines.length-1].paragraphs.push(s)):M.deal(s,!0),S.lines.length!==t&&(t=S.lines.length,M.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,S.lines[S.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,M.lineWidth=0),M.send()}}else for(let t=0;t<_.length;t++)M.deal(_[t]);if(M.send(),!("horizontal"===S.layoutDirection?b:x)){const t=S.getActualSizeWidthEllipsis();let e="horizontal"===S.layoutDirection?t.width:t.height;("horizontal"===S.layoutDirection?v:y)&&(e=Math.min(e,"horizontal"===S.layoutDirection?s:n)),S.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=S}clone(){return new zM(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{var e,i,s,n,r;const a=this.pickIcon(t.global);a&&a===this._currentHoverIcon||(a?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=a,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(a.attribute.cursor),null===(s=this.stage)||void 0===s||s.renderNextFrame()):!a&&this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame()))})),this.addEventListener("pointerleave",(t=>{var e,i;this._currentHoverIcon&&(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(e=this.stage)||void 0===e||e.setCursor(),null===(i=this.stage)||void 0===i||i.renderNextFrame())}))}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;return e.icons.forEach((e=>{var r,a;const o=e.AABBBounds.clone();o.translate(e._marginArray[3],e._marginArray[0]),o.containsPoint({x:t.x-i,y:t.y-s})&&(n=e,n.globalX=(null!==(r=n.attribute.x)&&void 0!==r?r:0)+i+e._marginArray[3],n.globalY=(null!==(a=n.attribute.y)&&void 0!==a?a:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return zM.NOWORK_ANIMATE_ATTR}}function NM(t){return new zM(t)}zM.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},ln);let VM=class extends vo{constructor(){super(),this.numberType=Pn,this.builtinContributions=[f_],this.init()}drawShape(t,e,i,s,n){const r=Qi(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const d=Ga(o,l,!0),c=Ga(o,a,!0);d&&(e.translate(i,s),this.beforeRenderStep(t,e,i,s,d,c,d,c,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,d,c,d,c,r,n))}drawIcon(t,e,i,s,n){var r;const a=Qi(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:d,backgroundFill:c=a.backgroundFill,backgroundFillOpacity:u=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:m=a.backgroundRadius,margin:_}=t.attribute,{backgroundWidth:f=o,backgroundHeight:v=l}=t.attribute;if(_&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){const t=(f-o)/2,n=(v-l)/2;0===m?(e.beginPath(),e.rect(i-t,s-n,f,v)):(e.beginPath(),Na(e,i-t,s-n,f,v,m)),c&&(e.globalAlpha=u,e.fillStyle=c,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const y=d&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(d));y&&"success"===y.state&&(e.globalAlpha=h,e.drawImage(y.data,i,s,o,l))}draw(t,e,i){const s=Qi(t).richtext;this._draw(t,s,!1,i)}};VM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],VM);let WM=!1;const GM=new B((t=>{WM||(WM=!0,t(cr).to(VM).inSingletonScope(),t(ir).toService(cr))}));let UM=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Pn}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};UM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(cr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],UM);let $M=!1;const KM=new B(((t,e,i,s)=>{$M||($M=!0,t(K_).to(UM).inSingletonScope(),t(Z_).toService(K_))}));let XM=!1;const qM=new B(((t,e,i,s)=>{XM||(XM=!0,t(T_).to(NS).inSingletonScope(),t(NS).toService(T_))}));function ZM(){ZM.__loaded||(ZM.__loaded=!0,Gr.RegisterGraphicCreator("richtext",NM),Di.load(GM),Di.load(S_?KM:qM))}ZM.__loaded=!1;const JM=ZM;function QM(t,e,i,s){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n0===t))?QM(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void QM(t,e,i,s);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+s));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],d=e[(r+1)%e.length],c=h.x-o.x,u=h.y-o.y,p=h.x-d.x,g=h.y-d.y,m=(Math.atan2(u,c)-Math.atan2(g,p))/2,_=Math.abs(Math.tan(m));let f=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,v=f/_;const y=tk(c,u),b=tk(p,g),x=Math.min(y,b);v>x&&(v=x,f=x*_);const S=ek(h,v,y,c,u),M=ek(h,v,b,p,g),k=2*h.x-S.x-M.x,A=2*h.y-S.y-M.y,w=tk(k,A),T=ek(h,tk(v,f),w,k,A);let C=Math.atan2(S.y-T.y,S.x-T.x);const L=Math.atan2(M.y-T.y,M.x-T.x);let E=L-C;E<0&&(C=L,E=-E),E>Math.PI&&(E-=Math.PI),0===r?t.moveTo(S.x+i,S.y+s):t.lineTo(S.x+i,S.y+s),E&&t.arcTo(h.x+i,h.y+s,M.x+i,M.y+s,f),t.lineTo(M.x+i,M.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,d,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,v,m,_,l,n,a,o),f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill())),v&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,f,v,m,_,l,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};rk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),nk(0,$(X)),nk(0,K(no)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],rk);let ak=!1;const ok=new B((t=>{ak||(ak=!0,t(ar).to(rk).inSingletonScope(),t(ir).toService(ar),t(no).toService(po),Z(t,no))}));let lk=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Tn}};lk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],lk);let hk=!1;const dk=new B(((t,e,i,s)=>{hk||(hk=!0,t(U_).to(lk).inSingletonScope(),t(Z_).toService(U_))}));let ck=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=Tn}};ck=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ck);let uk=!1;const pk=new B(((t,e,i,s)=>{uk||(uk=!0,t(O_).to(ck).inSingletonScope(),t(M_).toService(O_))}));function gk(){gk.__loaded||(gk.__loaded=!0,Gr.RegisterGraphicCreator("polygon",nS),Di.load(ok),Di.load(S_?dk:pk))}gk.__loaded=!1;const mk=gk;class _k extends hn{constructor(t){super(t),this.type="glyph",this.numberType=Sn,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,s){super.setAttribute(t,e,i,s),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return Qi(this).glyph}updateAABBBounds(t,e,i){return oi.graphicService.validCheck(t,e,i,this)?(this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i):i}doUpdateAABBBounds(){this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates();const s={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(s,r.attributes),(null===(i=r.subAttributes)||void 0===i?void 0:i.length)&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,s)=>{i.updateNormalAttrs(n[s]),i.applyStateAttrs(n[s],t,e)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new _k(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return _k.NOWORK_ANIMATE_ATTR}}function fk(t){return new _k(t)}_k.NOWORK_ANIMATE_ATTR=ln;let vk=class{constructor(){this.numberType=Sn}drawShape(t,e,i,s,n,r,a,o){n.drawContribution&&t.getSubGraphic().forEach((t=>{const l=n.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,s,n,r,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;if(n.highPerformanceSave(),!i.drawContribution)return;const r=Qi(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:r})})),n.highPerformanceRestore()}};vk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],vk);let yk=!1;const bk=new B((t=>{yk||(yk=!0,t(pr).to(vk).inSingletonScope(),t(ir).toService(pr))}));class xk{constructor(){this.type="glyph",this.numberType=Sn}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=null==i?void 0:i.pickerService;if(n){let s=!1;return t.getSubGraphic().forEach((t=>{if(s)return;const r=n.pickItem(t,e,null,i);s=!(!r||!r.graphic)})),s}return!1}}let Sk=class extends xk{constructor(t){super(),this.canvasRenderer=t}};Sk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(pr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Sk);let Mk=!1;const kk=new B(((t,e,i,s)=>{Mk||(Mk=!0,t(X_).to(Sk).inSingletonScope(),t(Z_).toService(X_))}));let Ak=class extends xk{constructor(t){super(),this.canvasRenderer=t}};Ak=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(pr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ak);let wk=!1;const Tk=new B(((t,e,i,s)=>{wk||(wk=!0,t(R_).to(Ak).inSingletonScope(),t(Ak).toService(R_))}));function Ck(){Ck.__loaded||(Ck.__loaded=!0,Gr.RegisterGraphicCreator("glyph",fk),Di.load(bk),Di.load(S_?kk:Tk))}Ck.__loaded=!1;const Lk=Ck,Ek=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Pk extends jn{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i){w(this.attribute[t])&&w(e)&&!rs(this.attribute[t])&&!rs(e)?E(this.attribute[t],e):this.attribute[t]=e,Ek.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>Ek.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){P(e)&&(e=Object.keys(t));for(let i=0;i=.5:i<.5}return s?Ik(t,e)>s:"largeText"===i?Ik(t,e)>3:Ik(t,e)>4.5}function Ik(t,e){const i=Bk(t),s=Bk(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function Bk(t){const e=function(t){let e="",i="",s="";const n="#"===t[0]?1:0;for(let r=n;r{const i=e(t);t.isContainer&&!i&&Yk(t,e)}))}const jk=t=>!P(t)&&!1!==t.visible;function Hk(t){return t>=0&&t3*Math.PI/2&&t<=2*Math.PI}function zk(t,e,i){return Math.abs(t-e)Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":eMath.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:eMath.PI&&!i.includes("inside")?"bottom":"top"}}const Vk=-.5*Math.PI,Wk=1.5*Math.PI,Gk="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var Uk;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Uk||(Uk={}));const $k={[Uk.selectedReverse]:{},[Uk.selected]:{},[Uk.hover]:{},[Uk.hoverReverse]:{}},Kk={container:"",width:30,height:30,style:{}},Xk=(t,e,i,s)=>new xi(Object.assign({defaultFontParams:Object.assign({fontFamily:Gk,fontSize:14},s),getTextBounds:i?void 0:__,specialCharSet:"-/: .,@%'\"~"+xi.ALPHABET_CHAR_SET+xi.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function qk(t,e,i={}){if(!t)return{width:0,height:0};const s=__({text:t,fontFamily:e.fontFamily||i.fontFamily||Gk,fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:s.width(),height:s.height()}}function Zk(t,e="type"){var i,s;return ns(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}function Jk(t){var e,i;return t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.maxWidth=t.maxLineWidth,t.textConfig=t.text.text||t.text,t}function Qk(t,e="type"){const i=Zk(t,e);return"rich"===i?Gr.richtext(Jk(t)):("html"===i?t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.html=s,t.text=i,t.renderable=!1,t}(t):"react"===i&&(t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.react=s,t.text=i,t.renderable=!1,t}(t)),Gr.text(t))}function tA(t,e,i,s,n){"right"===t?"center"===i?e.setAttribute("x",s-n/2):"right"===i||"end"===i?e.setAttribute("x",s):e.setAttribute("x",s-n):"center"===i?e.setAttribute("x",s+n/2):"right"===i||"end"===i?e.setAttribute("x",s+n):e.setAttribute("x",s)}const eA=new Uint32Array(33),iA=new Uint32Array(33);iA[0]=0,eA[0]=~iA[0];for(let t=1;t<=32;++t)iA[t]=iA[t-1]<<1|1,eA[t]=~iA[t];function sA(t,e,i={top:0,left:0,right:0,bottom:0}){const{top:s=0,left:n=0,right:r=0,bottom:a=0}=i,o=Math.max(1,Math.sqrt(t*e/1e6)),l=~~((t+n+r+o)/o),h=~~((e+s+a+o)/o),d=t=>~~(t/o);return d.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+32)/32));function s(t,e){i[t]|=e}function n(t,e){i[t]&=e}return{array:i,get:(e,s)=>{const n=s*t+e;return i[n>>>5]&1<<(31&n)},set:(e,i)=>{const n=i*t+e;s(n>>>5,1<<(31&n))},clear:(e,i)=>{const s=i*t+e;n(s>>>5,~(1<<(31&s)))},getRange:({x1:s,y1:n,x2:r,y2:a})=>{if(r<0||a<0||s>t||n>e)return!0;let o,l,h,d,c=a;for(;c>=n;--c)if(o=c*t+s,l=c*t+r,h=o>>>5,d=l>>>5,h===d){if(i[h]&eA[31&o]&iA[1+(31&l)])return!0}else{if(i[h]&eA[31&o])return!0;if(i[d]&iA[1+(31&l)])return!0;for(let t=h+1;t{if(r<0||a<0||i>t||n>e)return;let o,l,h,d,c;for(;n<=a;++n)if(o=n*t+i,l=n*t+r,h=o>>>5,d=l>>>5,h===d)s(h,eA[31&o]&iA[1+(31&l)]);else for(s(h,eA[31&o]),s(d,iA[1+(31&l)]),c=h+1;c{let a,o,l,h,d;for(;i<=r;++i)if(a=i*t+e,o=i*t+s,l=a>>>5,h=o>>>5,l===h)n(l,iA[31&a]|eA[1+(31&o)]);else for(n(l,iA[31&a]),n(h,eA[1+(31&o)]),d=l+1;di<0||s<0||r>=e||n>=t,toImageData:s=>{const n=s.createImageData(t,e),r=n.data;for(let s=0;s>>5]&1<<(31&n);r[a+0]=255*o,r[a+1]=255*o,r[a+2]=255*o,r[a+3]=31}return n}}}(l,h),d.x=t=>~~((t+n)/o),d.y=t=>~~((t+s)/o),d.ratio=o,d.padding=i,d.width=t,d.height=e,d}function nA(t,e,i=!1){if(i){const{x1:i,x2:s,y1:n,y2:r}=e,a=vs(i,0,t.width),o=vs(s,0,t.width),l=vs(n,0,t.height),h=vs(r,0,t.height);return{x1:t.x(a),x2:t.x(o),y1:t.y(l),y2:t.y(h)}}return{x1:t.x(e.x1),x2:t.x(e.x2),y1:t.y(e.y1),y2:t.y(e.y2)}}function rA(t,e,i,s=!0,n=0){let r=i;return n>0&&(r={x1:i.x1-n,x2:i.x2+n,y1:i.y1-n,y2:i.y2+n}),r=nA(t,r),!(s&&e.outOfBounds(r)||e.getRange(r))}function aA(t,e,i,s=[],n=!0,r=0){const a=s.filter((t=>M(t)));for(let s=0;sa(n.AABBBounds,r,t,s.offset)));return aA(t,e,n,o,h,d)}return!1}var c;if("moveY"===i.type){const s=(i.offset?rs(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return aA(t,e,n,s,h,d)}if("moveX"===i.type){const s=(i.offset?rs(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return aA(t,e,n,s,h,d)}return!1}const lA=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],hA=["top","inside-top","inside"];function dA(t,e,i){const{x1:s,x2:n,y1:r,y2:a}=t.AABBBounds,o=Math.min(s,n),l=Math.max(s,n),h=Math.min(r,a),d=Math.max(r,a);let c=0,u=0;return o<0&&l-o<=e?c=-o:l>e&&o-(l-e)>=0&&(c=e-l),h<0&&d-h<=i?u=-h:d>i&&h-(d-i)>=0&&(u=i-d),{dx:c,dy:u}}class cA extends ps{constructor(t,e,i,s,n){super(t,e,i,s,n)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,s,n,r,a,o;this.fromNumber=h(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=h(null===(s=this.to)||void 0===s?void 0:s.text)?null===(n=this.to)||void 0===n?void 0:n.text:Number.parseFloat(null===(r=this.to)||void 0===r?void 0:r.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max(St(this.fromNumber),St(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}var uA;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(uA||(uA={}));class pA extends ps{constructor(t,e,i,s,n){var r,a;super(t,e,i,s,n),this.newPointAnimateType=null!==(r=null==n?void 0:n.newPointAnimateType)&&void 0!==r?r:"grow",this.clipRangeByDimension=null!==(a=null==n?void 0:n.clipRangeByDimension)&&void 0!==a?a:"x"}getPoints(t,e=!1){if(t.points)return t.points;if(t.segments){const i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map((t=>{var s,n;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!==(n=null===(s=t.points)||void 0===s?void 0:s.length)&&void 0!==n?n:0)})),i}return[]}onBind(){const t=this.getPoints(this.from),e=this.getPoints(this.to,!0);this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let s,n,r=1/0,a=-1/0;for(let t=0;t=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,n=i.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(a)?(this.clipRange=this.toPoints[a][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],Wo(this.clipRange)?this.clipRange=vs(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const l=i.get(t.context);return l?(o=l,[l,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:ea&&n?[n,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],s=new re(e.x,e.y,e.x1,e.y1);return s.defined=i.defined,s.context=i.context,s}))}onUpdate(t,e,i){if(this.points=this.points.map(((t,i)=>{const s=Ks(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return s.context=t.context,s})),this.clipRange&&(i.clipRange=this.clipRange+(1-this.clipRange)*e),this.segmentsCache&&this.to.segments){let t=0;i.segments=this.to.segments.map(((e,i)=>{const s=this.points.slice(t,this.segmentsCache[t]);return t+=this.segmentsCache[t],Object.assign(Object.assign({},e),{points:s})}))}else i.points=this.points}}class gA extends ps{constructor(t,e,i,s,n){super(null,null,i,s,n),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==n?void 0:n.group,this._clipGraphic=null==n?void 0:n.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:Kt.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:Kt.ANIMATE_END})}onUpdate(t,e,i){if(!this._clipGraphic)return;const s={};Object.keys(this.clipFromAttribute).forEach((t=>{s[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*e})),this._clipGraphic.setAttributes(s,!1,{type:Kt.ANIMATE_UPDATE,animationState:{ratio:e,end:t}})}}class mA extends gA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p,g,m,_;const f=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},v=null!==(o=f.width)&&void 0!==o?o:0,y=null!==(l=f.height)&&void 0!==l?l:0,b=null!==(h=null==n?void 0:n.animationType)&&void 0!==h?h:"in",x=null!==(d=null==n?void 0:n.startAngle)&&void 0!==d?d:0,S=null!==(c=null==n?void 0:n.orient)&&void 0!==c?c:"clockwise";let M=0,k=0;"anticlockwise"===S?(k="in"===b?x+2*Math.PI:x,k=x+2*Math.PI):(M=x,k="out"===b?x+2*Math.PI:x);const A=oi.graphicService.creator.arc({x:null!==(p=null===(u=null==n?void 0:n.center)||void 0===u?void 0:u.x)&&void 0!==p?p:v/2,y:null!==(m=null===(g=null==n?void 0:n.center)||void 0===g?void 0:g.y)&&void 0!==m?m:y/2,outerRadius:null!==(_=null==n?void 0:n.radius)&&void 0!==_?_:(v+y)/2,innerRadius:0,startAngle:M,endAngle:k,fill:!0});let w,T;"anticlockwise"===S?(w={startAngle:x+2*Math.PI},T={startAngle:x}):(w={endAngle:x},T={endAngle:x+2*Math.PI}),super("in"===b?w:T,"in"===b?T:w,i,s,{group:null==n?void 0:n.group,clipGraphic:A})}}class _A extends gA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p;const g=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},m=null!==(l=null!==(o=null==n?void 0:n.width)&&void 0!==o?o:g.width)&&void 0!==l?l:0,_=null!==(d=null!==(h=null==n?void 0:n.height)&&void 0!==h?h:g.height)&&void 0!==d?d:0,f=null!==(c=null==n?void 0:n.animationType)&&void 0!==c?c:"in",v=null!==(u=null==n?void 0:n.direction)&&void 0!==u?u:"x",y=null!==(p=null==n?void 0:n.orient)&&void 0!==p?p:"positive",b=oi.graphicService.creator.rect({x:0,y:0,width:"in"===f&&"x"===v?0:m,height:"in"===f&&"y"===v?0:_,fill:!0});let x={},S={};"y"===v?"negative"===y?(x={y:_,height:0},S={y:0,height:_}):(x={height:0},S={height:_}):"negative"===y?(x={x:m,width:0},S={x:0,width:m}):(x={width:0},S={width:m}),super("in"===f?x:S,"in"===f?S:x,i,s,{group:null==n?void 0:n.group,clipGraphic:b})}}class fA extends ps{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),n=this.target.getComputedAttribute("z"),r=Math.acos((s-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));n-t.z<0&&(a=lt-a),this.theta=a,this.phi=r}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:s,r:n,cb:r}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,l=this.phi,h=n*Math.sin(l)*Math.cos(o)+s.x,d=n*Math.cos(l)+s.y,c=n*Math.sin(l)*Math.sin(o)+s.z;for(i.x=h,i.y=d,i.z=c,i.alpha=o+rt/2;i.alpha>lt;)i.alpha-=lt;i.alpha=lt-i.alpha,i.zIndex=-1e4*i.z,r&&r(i)}}class vA extends ps{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((s=>{const n=s.easing,r="string"==typeof n?ds[n]:n;e=r(e),s.onUpdate(t,e,i)})),this.updating=!1)}}const yA={fadeIn:(t={})=>{var e,i,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1}}},fadeOut:(t={})=>{var e,i,s;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function bA(t,e){var i,s;return null!==(s=null===(i=yA[e])||void 0===i?void 0:i.call(yA,t))&&void 0!==s?s:{from:{},to:{}}}function xA(t,e,i,s){t.attribute.text!==e.attribute.text&&Wo(Number(t.attribute.text)*Number(e.attribute.text))&&t.animate().play(new cA({text:t.attribute.text},{text:e.attribute.text},i,s))}const SA={mode:"same-time",duration:300,easing:"linear"};function MA(t){return 3===t||4===t}function kA(t,e){const{x1:i,y1:s,x2:n,y2:r}=t,{x1:a,y1:o,x2:l,y2:h}=e;return!(i<=a&&n<=a||i>=l&&n>=l||s<=o&&r<=o||s>=h&&r>=h)}const AA=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function wA(t,e,i,s,n,r){return Math.abs(e/t)0?n:-n),y:s+e*n/Math.abs(t)}:{x:i+t*r/Math.abs(e),y:s+(e>0?r:-r)}}h_(),of(),JM(),aM();class TA extends Pk{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=t.target;e===this._lastHover||Im(e.states)||(e.addState(Uk.hover,!0),Yk(this,(t=>{t===e||Im(t.states)||t.addState(Uk.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(Yk(this,(t=>{Im(t.states)||(t.removeState(Uk.hoverReverse),t.removeState(Uk.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void Yk(this,(t=>{Im(t.states)||(t.removeState(Uk.selectedReverse),t.removeState(Uk.selected))}));Im(e.states)||(e.addState(Uk.selected,!0),Yk(this,(t=>{t===e||Im(t.states)||t.addState(Uk.selectedReverse,!0)})),this._lastSelect=e)},this._handleRelatedGraphicSetState=t=>{var e,i,s,n,r;if((null===(e=t.detail)||void 0===e?void 0:e.type)===Kt.STATE||(null===(i=t.detail)||void 0===i?void 0:i.type)===Kt.ANIMATE_UPDATE&&(null===(s=t.detail.animationState)||void 0===s?void 0:s.isFirstFrameOfStep)){const e=null!==(r=null===(n=t.target)||void 0===n?void 0:n.currentStates)&&void 0!==r?r:[],i=this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)];this.updateStatesOfLabels(i,e)}}}labeling(t,e,i,s){}_getLabelLinePoints(t,e){return function(t,e){if(!t||!e)return;if(pa(t,e,!0))return;const i=Math.min(t.x1,t.x2),s=Math.min(t.y1,t.y2),n=Math.min(e.x1,e.x2),r=Math.min(e.y1,e.y2),a=Math.abs(t.x2-i)/2,o=Math.abs(t.y2-s)/2,l=Math.abs(e.x2-n)/2,h=Math.abs(e.y2-r)/2,d=i+a,c=s+o,u=n+l,p=r+h,g=u-d,m=p-c;return[wA(g,m,d,c,a,o),wA(-g,-m,u,p,l,h)]}(t.AABBBounds,null==e?void 0:e.AABBBounds)}_createLabelLine(t,e){const i=this._getLabelLinePoints(t,e);if(i){const s=Gr.line({points:i}),{line:n={}}=t.attribute;if(n.customShape){const e=n.customShape;s.pathProxy=i=>e(t.attribute,i,new Be)}return e&&e.attribute.fill&&s.setAttribute("stroke",e.attribute.fill),this.attribute.line&&!Im(this.attribute.line.style)&&s.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(s),s}}render(){if(this._prepare(),P(this._idToGraphic)||this._isCollectionBase&&P(this._idToPoint))return;const{overlap:t,smartInvert:e,dataFilter:i,customLayoutFunc:s,customOverlapFunc:n}=this.attribute;let r=this.attribute.data;rs(i)&&(r=i(r));let a=this._initText(r);a=rs(s)?s(r,a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(a),rs(n)?a=n(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(a=this._overlapping(a)),rs(this.attribute.onAfterOverlapping)&&this.attribute.onAfterOverlapping(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null),a&&a.length&&a.forEach((t=>{this._bindEvent(t),this._setStatesOfText(t)})),!1!==e&&this._smartInvert(a),this._renderLabels(a)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const e=this.attribute.state;e&&!Im(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;const e=this.attribute.labelLineState;e&&!Im(e)&&(t.states=e)}_createLabelText(t){var e,i;return Qk(Object.assign(Object.assign({},null===(i=null===(e=this.stage)||void 0===e?void 0:e.getTheme())||void 0===i?void 0:i.text),t),"textType")}_prepare(){var t,e,i,s,n;const r=[];let a;if(a=rs(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),a.forEach((t=>{"willRelease"!==t.releaseStatus&&r.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(e=this._idToPoint)||void 0===e||e.clear(),this._baseMarks=r,this._isCollectionBase="line-data"===this.attribute.type,!r||0===r.length)return;const{data:o}=this.attribute;if(o&&0!==o.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let e=0;e!!t&&!0!==t)):r.attribute.stroke:r.attribute.fill},e),n),o=this._createLabelText(a);i.push(o)}return i}_layout(t){const{position:e,offset:i}=this.attribute;for(let s=0;s"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&_.setRange(nA(m,t.AABBBounds,!0))}))),p.length>0&&p.forEach((t=>{S(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&_.setRange(nA(m,t.AABBBounds,!0))})):t.AABBBounds&&_.setRange(nA(m,t.AABBBounds,!0))}));for(let e=0;ee.name===t),!0)}getGraphicBounds(t,e={}){if(t){if(!1!==t.attribute.visible)return t.AABBBounds;const{x:e,y:i}=t.attribute;return{x1:e,x2:e,y1:i,y2:i}}const{x:i,y:s}=e;return{x1:i,x2:i,y1:s,y2:s}}_renderLabels(t){!1===this._enableAnimation||!1===this.attribute.animation?this._renderWithOutAnimation(t):this._renderWithAnimation(t)}_renderWithAnimation(t){var e;const{syncState:i}=this.attribute,s=new Map,n=this._graphicToText||new Map,r=[],a=[],{visible:o}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t&&t.forEach(((t,e)=>{var l;const h=this.getRelatedGraphic(t.attribute),d=t.attribute.id,c=this._isCollectionBase?d:h,u=(null==n?void 0:n.get(c))?"update":"enter";let p;if(o&&(p=this._createLabelLine(t,h)),i&&this.updateStatesOfLabels([p?{text:t,labelLine:p}:{text:t}],null!==(l=h.currentStates)&&void 0!==l?l:[]),"enter"===u){if(r.push(t),s.set(c,p?{text:t,labelLine:p}:{text:t}),h){const{from:i,to:s}=bA(t.attribute,"fadeIn");this.add(t),p&&(a.push(p),this.add(p)),this._syncStateWithRelatedGraphic(h),this._animationConfig.enter.duration>0&&h.once("animate-bind",(n=>{t.setAttributes(i),p&&p.setAttributes(i);const o=this._afterRelatedGraphicAttributeUpdate(t,r,p,a,e,h,s,this._animationConfig.enter);h.on("afterAttributeUpdate",o)}))}}else if("update"===u){const e=n.get(c);n.delete(c),s.set(c,e);const i=e.text,{duration:r,easing:a}=this._animationConfig.update;(function(t,e,i){if(!y(i)){const{duration:s,easing:n,increaseEffect:r=!0}=i;return t.animate().to(e.attribute,s,n),void(r&&xA(t,e,s,n))}i.forEach(((i,s)=>{const{duration:n,easing:r,increaseEffect:a=!0,channel:o}=i,{from:l,to:h}=((t,e,i,s)=>{const n=Object.assign({},t.attribute),r=Object.assign({},e.attribute);return Ra(null==s?void 0:s.excludeChannels).forEach((t=>{delete r[t]})),Object.keys(r).forEach((t=>{i&&!i.includes(t)&&delete r[t]})),{from:n,to:r}})(t,e,o,i.options);Im(h)||t.animate().to(h,n,r),"text"in l&&"text"in h&&a&&xA(t,e,n,r)}))})(i,t,this._animationConfig.update),e.labelLine&&p&&e.labelLine.animate().to(p.attribute,r,a)}})),n.forEach((t=>{var e;null===(e=t.text)||void 0===e||e.animate().to(bA(t.text.attribute,"fadeOut").to,this._animationConfig.exit.duration,this._animationConfig.exit.easing).onEnd((()=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)}))})),this._graphicToText=s}_renderWithOutAnimation(t){var e;const{syncState:i}=this.attribute,s=new Map,n=this._graphicToText||new Map,r=[],{visible:a}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t&&t.forEach((t=>{var e;const o=this.getRelatedGraphic(t.attribute),l=(null==n?void 0:n.get(o))?"update":"enter",h=this._isCollectionBase?t.attribute.id:o;let d;if(a&&(d=this._createLabelLine(t,o)),i&&this.updateStatesOfLabels([d?{text:t,labelLine:d}:{text:t}],null!==(e=o.currentStates)&&void 0!==e?e:[]),"enter"===l)r.push(t),s.set(h,d?{text:t,labelLine:d}:{text:t}),this.add(t),d&&this.add(d),this._syncStateWithRelatedGraphic(o);else if("update"===l){const e=n.get(h);n.delete(h),s.set(h,e),e.text.setAttributes(t.attribute),e.labelLine&&d&&e.labelLine.setAttributes(d.attribute)}})),n.forEach((t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)})),this._graphicToText=s}updateStatesOfLabels(t,e){t.forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,s,n,r,a,{mode:o,duration:l,easing:h,delay:d}){const c=u=>{var p,g,m;const{detail:_}=u;if(!_)return{};const f=null===(p=_.animationState)||void 0===p?void 0:p.step;if(_.type!==Kt.ANIMATE_UPDATE||!f||"wait"===f.type&&null==(null===(g=f.prev)||void 0===g?void 0:g.type))return{};if(_.type===Kt.ANIMATE_END)return t.setAttributes(a),void(i&&i.setAttributes(a));const v=()=>{r&&(r.onAnimateBind=void 0,r.removeEventListener("afterAttributeUpdate",c))};switch(o){case"after":_.animationState.end&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h));break;case"after-all":n===e.length-1&&_.animationState.end&&(e.forEach((t=>{t.animate({onStart:v}).wait(d).to(a,l,h)})),s.forEach((t=>{t.animate().wait(d).to(a,l,h)})));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!r.containsPoint(e.x,e.y,$t.LOCAL,null===(m=this.stage)||void 0===m?void 0:m.pickerService)||(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}else _.animationState.isFirstFrameOfStep&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}};return c}_smartInvert(t){var e,i,s,n,r;const a=ns(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:o,contrastRatiosThreshold:l,alternativeColors:h,mode:d}=a,c=null!==(e=a.fillStrategy)&&void 0!==e?e:"invertBase",u=null!==(i=a.strokeStrategy)&&void 0!==i?i:"base",p=null!==(s=a.brightColor)&&void 0!==s?s:"#ffffff",g=null!==(n=a.darkColor)&&void 0!==n?n:"#000000",m=null!==(r=a.outsideEnable)&&void 0!==r&&r;if("null"!==c||"null"!==u)for(let e=0;e{CA[t]=e};class EA{constructor(t,e,i,s,n,r,a,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=n,this.middleAngle=r,this.innerRadius=a,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0,this.labelLimit=0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class PA extends TA{constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nthis.getGraphicBounds(t))),s=Object.assign(Object.assign({},this.attribute.textStyle),{text:"…"});let n=1/0;if(!1!==s.ellipsis){const t=this._createLabelText(s),e=this.getGraphicBounds(t);n=e.x2-e.x1}const r=e.map((t=>t.attribute)),a=this.layoutArcLabels(this.attribute.position,this.attribute,Array.from(this._idToGraphic.values()),r,i,n);for(let t=0;t{var e;return(null===(e=t.refDatum)||void 0===e?void 0:e.id)===i.id}));if(s){const i={visible:s.labelVisible,x:s.labelPosition.x,y:s.labelPosition.y,angle:s.angle,maxLineWidth:s.labelLimit,points:s.pointA&&s.pointB&&s.pointC?[s.pointA,s.pointB,s.pointC]:void 0,line:s.labelLine};"richtext"===e[t].type&&(i.width=s.labelLimit),e[t].setAttributes(i)}}return e}layoutArcLabels(t,e,i,s,n,r){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=r;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)})),s.forEach(((t,i)=>{var r,o;const l=this._idToGraphic.get(t.id).attribute,h={x:null!==(r=null==l?void 0:l.x)&&void 0!==r?r:0,y:null!==(o=null==l?void 0:l.y)&&void 0!==o?o:0};if(!P(s[i])&&!P(n[i])){const t=s[i]?s[i]:null,r=n[i]?n[i]:{x1:0,x2:0,y1:0,y2:0},o=(l.startAngle+l.endAngle)/2,c=l.endAngle-l.startAngle,u=Et(l.endAngle-c/2),p=Tt(h,l.outerRadius,o),g=Tt(h,a+e.line.line1MinLength,o),m=new EA(t,p,g,u,c,o,l.innerRadius,l.outerRadius,h);m.pointA=Tt(h,this.computeDatumRadius(2*h.x,2*h.y,l.outerRadius),m.middleAngle),m.labelSize={width:r.x2-r.x1,height:r.y2-r.y1},1===(d=m.quadrant)||2===d?this._arcRight.set(m.refDatum,m):MA(m.quadrant)&&this._arcLeft.set(m.refDatum,m)}var d}));const o=Array.from(this._arcLeft.values()),l=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":case"inside-center":h.push(...this._layoutInsideLabels(l,e,i)),h.push(...this._layoutInsideLabels(o,e,i));break;default:h.push(...this._layoutOutsideLabels(l,e,i)),h.push(...this._layoutOutsideLabels(o,e,i))}return h}_layoutInsideLabels(t,e,i){var s,n;const r=e,a=r.spaceWidth,o=null!==(s=r.position)&&void 0!==s?s:"inside",l=null!==(n=r.offsetRadius)&&void 0!==n?n:-a;return t.forEach((t=>{var i,s,n;const{labelSize:h,radian:d}=t,c=t.innerRadius,u=t.outerRadius;let p;if(d<(g=u,(m=h.height)>2*g?NaN:2*Math.asin(m/2/g)))p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=u-t-a}var g,m;!0!==r.rotate&&(p=u-a);const _=this._getFormatLabelText(t.refDatum,p);t.labelText=_;const f=Math.min(p,t.labelSize.width),v=this._computeAlign(t,e);let y,b=0;if("inside"===o&&(b="left"===v?f:"right"===v?0:f/2),y="inside-inner"===o?c-l+b:"inside-center"===o?c+(u-c)/2:u+l-b,t.labelPosition=Tt(t.circleCenter,y,t.middleAngle),t.labelLimit=f,dd(f,0)||(t.labelVisible=!1),!1!==r.rotate){t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:t.middleAngle;let a=null!==(n=r.offsetAngle)&&void 0!==n?n:0;["inside-inner","inside-outer"].includes(o)&&(a+=Math.PI/2),t.angle+=a}})),t}_layoutOutsideLabels(t,e,i){var s,n,r;const a=null!==(s=i[0].attribute.x)&&void 0!==s?s:0,o=2*(null!==(n=i[0].attribute.y)&&void 0!==n?n:0),l=e.line.line2MinLength,h=e.layout,d=e.spaceWidth;if(t.forEach((t=>{const e=MA(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+l+d),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==e.coverEnable||"none"===h.strategy){for(const s of t){const{labelPosition:t,labelSize:n}=s;s.labelLimit=n.width,s.pointB=MA(s.quadrant)?{x:t.x+n.width/2+l+d,y:t.y}:{x:t.x-n.width/2-l-d,y:t.y},this._computeX(s,e,i)}!1===e.coverEnable&&"none"===h.strategy&&this._coverLabels(t)}else{const s=o/((null===(r=e.textStyle)||void 0===r?void 0:r.fontSize)||16);this._adjustY(t,s,e,i);const{minY:n,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(o,Math.max(s,t.maxY)),t}),{minY:1/0,maxY:-1/0}),l=Math.max(Math.abs(o/2-n),Math.abs(a-o/2)),h=this._computeLayoutRadius(l,e,i);for(const s of t)this._computePointB(s,h,e,i),this._computeX(s,e,i)}const c=2*a;return t.forEach((t=>{var i,s;t.labelVisible&&(cd(t.pointB.x,l+d)||dd(t.pointB.x,c-l-d))&&(t.labelVisible=!1),t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:0,e.offsetAngle&&(t.angle+=e.offsetAngle),t.labelLine=Object.assign({},e.line)})),t}_computeX(t,e,i){var s;const n=t.circleCenter,r=2*n.x;n.y;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=e.line.line1MinLength,h=e.line.line2MinLength,d=null===(s=e.layout)||void 0===s?void 0:s.align,c=e.spaceWidth,{labelPosition:u,quadrant:p,pointB:g}=t;Wo(g.x*g.y)||(t.pointC={x:NaN,y:NaN},u.x=NaN,t.labelLimit=0);const m=this.computeRadius(o,e.width,e.height),_=MA(p)?-1:1;let f=0,v=(_>0?r-g.x:g.x)-h-c;"labelLine"===d&&(f=(m+l+h)*_+n.x,v=(_>0?r-f:f)-c);const y=this._getFormatLabelText(t.refDatum,v);t.labelText=y;let b=Math.min(v,t.labelSize.width);switch(d){case"labelLine":break;case"edge":f=_>0?r-b-c:b+c;break;default:f=g.x+_*h}b=Math.max(this._ellipsisWidth,b),t.labelLimit=b,t.pointC={x:f,y:u.y};const x=.5*(t.labelLimit0?r+t:t)-_*x}else{const t=0;u.x=f+t+_*(c+x)}}_computeAlign(t,e){var i,s,n,r,a,o;const l=e,h=null!==(s=null===(i=l.textStyle)||void 0===i?void 0:i.textAlign)&&void 0!==s?s:null===(n=l.textStyle)||void 0===n?void 0:n.align,d=null!==(a=null===(r=l.layout)||void 0===r?void 0:r.textAlign)&&void 0!==a?a:null===(o=l.layout)||void 0===o?void 0:o.align;return"inside"!==l.position?P(h)||"auto"===h?"edge"===d?MA(t.quadrant)?"left":"right":MA(t.quadrant)?"right":"left":h:P(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,e,i,s){var n;s[0].attribute.x;const r=2*(null!==(n=s[0].attribute.y)&&void 0!==n?n:0),a=i.layout;if("vertical"===a.strategy){let e,i=0;const s=t.length;if(s<=0)return;for(let n=0;n=0&&t[e].getLabelBounds().y2>r;e--)t[e].labelVisible=!1}else if("none"!==a.strategy){const n=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));n.sort(((t,e)=>e.arc.radian-t.arc.radian)),n.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let o=1/0,l=-1/0;for(let h=0;hi?e.labelPosition.y=i-g.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,g,u)}else if(-1!==c&&-1===u){const i=p.labelPosition.y;ds?(e.labelPosition.y=s-g.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,p,e,n[h].originIndex)):d=0&&e0&&so)return r}r=e}return i}_findNextVisibleIndex(t,e,i,s){const n=(i-e)*s;for(let i=1;i<=n;i++){const n=e+i*s;if(t[n].labelVisible)return n}return-1}_computePointB(t,e,i,s){const n=i;let r=0;s.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,i.width,i.height),o=n.line.line1MinLength;if("none"===n.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const s=t.circleCenter,n=this.computeRadius(a,i.width,i.height),{labelPosition:r,quadrant:l}=t,h=e-Math.max(n+o,t.outerRadius),d=Math.sqrt(e**2-Math.abs(s.y-r.y)**2)-h;Wo(d)?t.pointB={x:s.x+d*(MA(l)?-1:1),y:r.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){const s=t.circleCenter,n={width:2*s.x,height:2*s.y};let r=0;i.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,e.width,e.height),o=e.line.line1MinLength,{width:l,height:h}=n,d=this.computeRadius(a,e.width,e.height),c=this._computeLayoutRadius(h/2,e,i),u=Math.abs(t.center.x-l/2),p=t.center.y-h/2;let g,m,_;if(hd(l/2,u))g=0,m=1,_=-p;else if(hd(h/2,p))g=1,m=0,_=-u;else{const t=-1/(p/u);g=t,m=-1,_=p-t*u}const f=function(t,e,i,s,n,r){if(0===t&&0===e||r<=0)return[];if(0===t){const t=-i/e,n=r**2-(t-0)**2;return n<0?[]:0===n?[{x:s,y:t}]:[{x:Math.sqrt(n)+s,y:t},{x:-Math.sqrt(n)+s,y:t}]}if(0===e){const e=-i/t,n=r**2-(e-s)**2;return n<0?[]:0===n?[{x:e,y:0}]:[{x:e,y:Math.sqrt(n)+0},{x:e,y:0-Math.sqrt(n)}]}const a=(e/t)**2+1,o=2*((i/t+s)*(e/t)-0),l=o**2-4*a*((i/t+s)**2+0-r**2);if(l<0)return[];const h=(-o+Math.sqrt(l))/(2*a),d=(-o-Math.sqrt(l))/(2*a),c=-(e*h+i)/t;return 0===l?[{x:c,y:h}]:[{x:c,y:h},{x:-(e*d+i)/t,y:d}]}(g,m,_,o+d-c,0,c);if(f.length<2)return;let v,y;f[0].x>f[1].x&&f.reverse(),f[0].x<0?hd(f[0].y,f[1].y)?dd(t.middleAngle,-Math.PI)&&cd(t.middleAngle,0)||dd(t.middleAngle,Math.PI)&&cd(t.middleAngle,2*Math.PI)?(v=0,y=f[1].y+h/2):(v=f[1].y+h/2,y=h):f[0].y{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+r,h=l-n;return Math.max((h**2+t**2)/(2*h),l)}_findNeighborIndex(t,e){const i=e.originIndex;let s=-1,n=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[])),s&&0!==s.length||(s=[e]);const r="start"===i?0:s.length-1;return s[r]?{x1:s[r].x,x2:s[r].x,y1:s[r].y,y2:s[r].y}:void 0}labeling(t,e,i="end",s=0){return function(t,e,i="end",s=0){if(!t||!e)return{x:1/0,y:1/0};const{x1:n,x2:r}=t,a=Math.abs(r-n),o=e.x1;let l=o;return"end"===i?l=o+a/2+s:"start"===i&&(l=o-a/2-s),{x:l,y:e.y1}}(t,e,i,s)}}DA.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};const OA=()=>{LA("line",DA),LA("area",DA)};class RA extends TA{constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if(!t)return;const{x1:n,y1:r,x2:a,y2:o}=t,l=Math.abs(a-n),h=Math.abs(o-r),d=(e.x1+e.x2)/2,c=(e.y1+e.y2)/2;let u=0,p=0,g=0,m=0;e&&(g=Math.abs(e.x1-e.x2)/2,m=Math.abs(e.y1-e.y2)/2);const _={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":u=-1;break;case"right":u=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":u=Math.sin(_[i]*(Math.PI/180)),p=Math.cos(_[i]*(Math.PI/180));break;case"center":u=0,p=0}return{x:d+u*(s+g)+Math.sign(u)*(l/2),y:c+p*(s+m)+Math.sign(p)*(h/2)}})(t,e,i,s)}}RA.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};const IA=()=>{LA("symbol",RA),LA("line-data",RA)},BA=(t,e)=>{const{x1:i,x2:s,y1:n,y2:r}=t,a=Math.abs(s-i),o=Math.abs(r-n);let l=(i+s)/2,h=(n+r)/2,d=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":d=-.5;break;case"right":case"inside-right":d=.5;break;case"top-right":d=.5,c=-.5;break;case"top-left":d=-.5,c=-.5;break;case"bottom-right":d=.5,c=.5;break;case"bottom-left":d=-.5,c=.5}return l+=d*a,h+=c*o,{x:l,y:h}};class FA extends TA{constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{yx(),MM(),pc.registerGraphic(Xd.path,hM)},jA=()=>{yx(),py(),LA("rect",FA),pc.registerGraphic(Xd.rect,Uv)},HA=()=>{yx(),aM(),pc.registerGraphic(Xd.rule,XS)},zA=()=>{yx(),Nv(),IA(),pc.registerGraphic(Xd.symbol,wv)},NA=()=>{yx(),of(),JM(),pc.registerGraphic(Xd.text,p_)},VA=()=>{yx(),Lk(),pc.registerGraphic(Xd.glyph,fk)};class WA extends mx{constructor(){super(...arguments),this.type=WA.type,this._marks=[]}getMarks(){return this._marks}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}isMarkExist(t){return void 0!==this._marks.find((e=>e.id===t.id||e.name===t.name))}addMark(t){return this.isMarkExist(t)?(pl("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}removeMark(t){const e=this._marks.findIndex((e=>e.id===t.id||e.name===t.name));return-1===e?(pl("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}getMarkInType(t){return this._marks.filter((e=>e.type===t))}getMarkInId(t){return this._marks.find((e=>e.id===t))}getMarkInName(t){return this._marks.find((e=>e.name===t))}_compileProduct(t){super._compileProduct(t),this._product.configure({zIndex:this.getZIndex()}),(null==t?void 0:t.ignoreChildren)||this.getMarks().forEach((t=>{t.getProduct()&&t.removeProduct(),t.compile({group:this._product})}))}}WA.type="group";const GA=()=>{yx(),h_(),pc.registerGraphic(Xd.group,Hn),$l.registerMark(WA.type,WA)},UA=(t,e)=>{const i=e.x-t.x,s=e.y-t.y;return Math.abs(i)>Math.abs(s)?i>0?"right":"left":s>0?"down":"up"},$A=(t,e)=>{const i=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);return Math.sqrt(i*i+s*s)};class KA extends(o()){constructor(t,e={}){var i,s,n,r,a,o,l,h,d,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=Og.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,s=0,n=0;for(;n{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const s=t.clone(),{x:n,y:r,pointerId:a}=s;for(let t=0,e=i.length;t({x:t.x,y:t.y}))),h=Og.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=o,1===e.length){const t=e[0],i=n-t.x,a=r-t.y,h=this.direction||UA(t,o);this.direction=h;const d=this.getEventType(o);return s.direction=h,s.deltaX=i,s.deltaY=a,s.points=l,this.triggerStartEvent(d,s),void this.triggerEvent(d,s)}const{startDistance:d}=this,c=$A(l[0],l[1]);s.scale=c/d,s.center=this.center,s.points=l,this.triggerStartEvent("pinch",s),this.triggerEvent("pinch",s)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:s}=this,n=i.map((t=>({x:t.x,y:t.y})));if(e.points=n,this.triggerEndEvent(e),1===i.length){const i=Og.now(),n=this.lastMoveTime;if(i-n<100){const t=n-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||s[0],n=this.lastMovePoint||s[0],r=$A(i,n),a=r/t;a>this.config.swipe.velocity&&r>this.config.swipe.threshold&&(e.velocity=a,e.direction=UA(i,n),this.triggerEvent("swipe",e))}}i-this.lastTapTime0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(s=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==s?s:251,threshold:null!==(r=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==r?r:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(c=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==c?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:s}=this;if(e)return e;let n;return n=Og.now()-i>this.config.press.time&&$A(s[0],t){for(let t=0,e=s.length;t{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let s=0,n=i.length;s{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(rc.ALL_ANIMATION_START,{}),this._animations=this._animations.concat({config:t.animationConfig,mark:t.mark})},this._onAnimationEnd=t=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),this._animations=this._animations.filter((e=>e.config!==t.animationConfig||e.mark!==t.mark)),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(rc.ALL_ANIMATION_END,{})},this._view=t,this._view.addEventListener(rc.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(rc.ANIMATION_END,this._onAnimationEnd)}stop(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}pause(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this}resume(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this}enable(){return this.isEnabled=!0,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).enable)||void 0===i||i.call(e))})),this}disable(){return this.isEnabled=!1,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).disable)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}enableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).enableAnimationState)||void 0===s||s.call(i,t))})),this}disableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).disableAnimationState)||void 0===s||s.call(i,t))})),this}isAnimating(){return 0!==this._animations.length||this._additionalAnimateMarks.some((t=>{var e;return(null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating())||!1}))}animate(){return this.isEnabled?(this._view.traverseMarkTree((t=>{t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1}),null,!0),this):this}animateAddition(t){var e;const i=null===(e=t.animate)||void 0===e?void 0:e.animate();return i&&i.isAnimating()&&this._additionalAnimateMarks.push(t),this}release(){this._additionalAnimateMarks=[],this._animations=[],this._view.removeEventListener(rc.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(rc.ALL_ANIMATION_END,this._onAnimationEnd),this._view=null}}class ZA{initAnimate(t){return this.animate=new qA(t),this.animate}}const JA=(t,e)=>{if(!t)return null;if(t.from){const i=t.from,s=Object.keys(i);s.forEach((t=>{P(i[t])&&delete i[t]}));const n=um(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.from=e.transformElementItems(s,e.mark.markType,n)}}if(t.to){const i=t.to,s=Object.keys(i);s.forEach((t=>{P(i[t])&&delete i[t]}));const n=um(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.to=e.transformElementItems(s,e.mark.markType,n)}}return t},QA=(t,e,i,s,n)=>rs(i)?i(t.getDatum(),t,n):i;class tw extends ps{constructor(t,e,i,s,n){super(t,e,i,s,n),this._interpolator=null==n?void 0:n.interpolator,this._element=null==n?void 0:n.element}onBind(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}getEndProps(){return this.to}onUpdate(t,e,i){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,i,this._element.getDatum(),this._element,this.params.parameters)}}class ew extends ps{getEndProps(){return this.to}onBind(){var t;const e=null!==(t=this.target.constructor.NOWORK_ANIMATE_ATTR)&&void 0!==t?t:ln,i=Object.keys(e).filter((t=>0!==e[t]));this.subAnimate.animate.preventAttrs(i);const s=Object.assign({},this.from),n=Object.assign({},this.to),r=[];Object.keys(n).forEach((t=>{i.includes(t)?(s[t]=n[t],this.from[t]=n[t]):P(s[t])?s[t]=this.target.getComputedAttribute(t):r.push(t)})),this.target.animates.forEach((t=>{t!==this.subAnimate.animate&&t.preventAttrs(r)})),this._fromAttribute=s,this._toAttribute=n}onStart(){if(this._fromAttribute){const t={};Object.keys(this._fromAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._fromAttribute[e])})),this.target.setAttributes(t,!1,{type:Kt.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}})}}onEnd(){if(this._toAttribute){const t={};Object.keys(this._toAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._toAttribute[e])})),this.target.setAttributes(t,!1,{type:Kt.ANIMATE_END})}}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1;const s=this.step.getLastProps();Object.keys(s).forEach((t=>{this.subAnimate.animate.validAttr(t)&&(i[t]=s[t])})),this.onUpdate(t,e,i),t&&this.onEnd()}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this._toAttribute,this._fromAttribute)}}ms.mode|=qt.SET_ATTR_IMMEDIATELY;let iw=0;const sw=t=>{var e;if(P(t)||P(t.prototype))return!1;const i=null!==(e=t.prototype)&&void 0!==e?e:{};return i instanceof ps||"onBind"in i&&"onStart"in i&&"onEnd"in i&&"onUpdate"in i};class nw{constructor(t,e,i){this.id=iw++,this.isAnimating=!1,this.runnings=[],this.element=t,this.animationOptions=i,this.unit=e}callback(t){return this.callbackFunction=t,this}animate(t,e){return this.isAnimating=!0,this.animateElement(t,e),0===this.runnings.length&&this.animationEnd(),this}stop(t="end",e=!0){return this.runnings.forEach((e=>e.stop(t))),this.animationEnd(e),this}pause(){return this.runnings.forEach((t=>t.pause())),this}resume(){return this.runnings.forEach((t=>t.resume())),this}startAt(t){return this.runnings.forEach((e=>{const i=this.unit.initialDelay;e.startAt(i+t)})),this}getTotalAnimationTime(){var t;const e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return null!==(t=this.unit.totalTime)&&void 0!==t?t:e}getEndAttributes(){return this.runnings.reduce(((t,e)=>Object.assign(t,e.getEndProps())),{})}animationEnd(t=!0){var e;this.isAnimating=!1,this.runnings=null,t&&(null===(e=this.callbackFunction)||void 0===e||e.call(null))}animateElement(t,e){const i=this.element.getGraphicItem();if(!i)return;const s=i.animate();this.runnings.push(s),s.startAt(this.unit.initialDelay),s.wait(this.unit.loopDelay),this.unit.timeSlices.forEach((i=>{this.animateTimeSlice(s,i,t,e)})),s.wait(this.unit.loopDelayAfter),s.loop(this.unit.loopCount-1),Wo(this.unit.totalTime)&&setTimeout((()=>{s&&s.stop("end")}),this.unit.totalTime),s.onEnd((()=>{this.runnings=this.runnings.filter((t=>t!==s)),0===this.runnings.length&&this.animationEnd()}))}animateTimeSlice(t,e,i,s){const n=e.delay,r=e.delayAfter,a=e.duration,o=e.effects;if(n>0&&t.wait(n),o.length<0)t.wait(a);else{const e=o.map(((t,e)=>{var n;const r=null!==(n=t.type?function(t,e,i,s){const n=rs(e.options)?e.options.call(null,t.getDatum(),t,s):e.options;if(!e.type||!pc.getAnimationType(e.type))return null;const r=pc.getAnimationType(e.type)(t,n,i);return JA(r,t)}(this.element,t,i,s):t.channel?function(t,e,i,s){const n=e.channel;let r=null;return y(n)?r=n.reduce(((e,i)=>(e.from[i]=t.getGraphicAttribute(i,!0),e.to[i]=t.getGraphicAttribute(i,!1),e)),{from:{},to:{}}):ns(n)&&(r=Object.keys(n).reduce(((e,i)=>{var r,a;const o=!P(null===(r=n[i])||void 0===r?void 0:r.from),l=!P(null===(a=n[i])||void 0===a?void 0:a.to);return(o||l)&&(e.from[i]=o?QA(t,0,n[i].from,0,s):void 0,e.to[i]=l?QA(t,0,n[i].to,0,s):t.getGraphicAttribute(i,!1)),e}),{from:{},to:{}})),JA(r,t)}(this.element,t,0,s):void 0)&&void 0!==n?n:{},o=r.custom||(null==t?void 0:t.custom),l=(null==r?void 0:r.customParameters)||(null==t?void 0:t.customParameters);r.from&&Object.keys(r.from).length&&this.unit&&this.animationOptions.timeline.controlOptions.immediatelyApply&&"component"!==this.element.mark.markType&&this.element.getGraphicItem().setAttributes(r.from);const h=sw(o);return P(o)||sw(o)?h?new o(r.from,r.to,a,t.easing,l):r.to?new ew(r.from,r.to,a,t.easing):void 0:new tw(r.from,r.to,a,t.easing,{interpolator:o,element:this.element,parameters:l})})).filter((t=>!P(t)));1===e.length?t.play(e[0]):e.length>1&&t.play(new vA(a,e))}r>0&&t.wait(r)}}function rw(t){let e=[];return Object.keys(t).forEach((i=>{e=e.concat(aw(i,t[i]))})),e}function aw(t,e,i=0){const s=[];let n=i;return Ra(e).forEach((e=>{var i;const r=function(t){var e,i,s,n,r,a,o,l,h,d,c,u;if(P(t.timeSlices)){const h=t;return{startTime:null!==(e=h.startTime)&&void 0!==e?e:yg,totalTime:h.totalTime,oneByOne:null!==(i=h.oneByOne)&&void 0!==i?i:kg,loop:null!==(s=h.loop)&&void 0!==s?s:Mg,controlOptions:E({},wg,null!==(n=h.controlOptions)&&void 0!==n?n:{}),timeSlices:[{duration:null!==(r=h.duration)&&void 0!==r?r:bg,delay:null!==(a=h.delay)&&void 0!==a?a:xg,delayAfter:null!==(o=h.delayAfter)&&void 0!==o?o:Sg,effects:[{type:h.type,channel:h.channel,custom:h.custom,easing:null!==(l=h.easing)&&void 0!==l?l:Ag,customParameters:h.customParameters,options:h.options}]}]}}const p=Ra(t.timeSlices).filter((t=>t.effects&&Ra(t.effects).filter((t=>t.channel||t.type)).length));if(p.length)return{startTime:null!==(h=t.startTime)&&void 0!==h?h:yg,totalTime:t.totalTime,oneByOne:null!==(d=t.oneByOne)&&void 0!==d?d:kg,loop:null!==(c=t.loop)&&void 0!==c?c:Mg,controlOptions:E({},wg,null!==(u=t.controlOptions)&&void 0!==u?u:{}),timeSlices:p.map((t=>{var e,i;return{duration:t.duration,delay:null!==(e=t.delay)&&void 0!==e?e:xg,delayAfter:null!==(i=t.delayAfter)&&void 0!==i?i:Sg,effects:Ra(t.effects).filter((t=>t.channel||t.type)).map((t=>{var e;return{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(e=t.easing)&&void 0!==e?e:Ag,customParameters:t.customParameters,options:t.options}}))}})),partitioner:t.partitioner,sort:t.sort}}(e);r&&(s.push({state:t,id:null!==(i=r.id)&&void 0!==i?i:`${t}-${n}`,timeline:r,originConfig:e}),n+=1)})),s}function ow(t,e,i){return rs(t)?t.call(null,e.getDatum(),e,i):t}class lw{constructor(t){this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=t.filter((t=>!P(t))),this.totalTime=this.animators.reduce(((t,e)=>Math.max(t,e.getTotalAnimationTime())),0)}parallel(t){const e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach((t=>{t.parallelArrangers=e})),this.arrangeTime(),this}after(t){return this.afterArranger=t,this.arrangeTime(),this}arrangeTime(){const t=this.parallelArrangers.reduce(((t,e)=>Math.max(t,e.totalTime)),this.totalTime),e=this.parallelArrangers.reduce(((t,e)=>{var i,s;return Math.max(t,null!==(s=null===(i=e.afterArranger)||void 0===i?void 0:i.endTime)&&void 0!==s?s:0)}),0);this.parallelArrangers.forEach((i=>{i.startTime=e,i.endTime=e+t,i.animators.forEach((t=>{t.startAt(e)}))}))}}class hw{constructor(t,e){this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=t,this.configs=rw(null!=e?e:{})}getAnimationConfigs(t){var e;return this.isEnabled?(null!==(e=this.configs)&&void 0!==e?e:[]).filter((e=>e.state===t)):[]}updateConfig(t){this.configs=rw(null!=t?t:{})}updateState(t){this.state=t}animate(){if(!this.isEnabled||!this.configs||!this.configs.length)return;const t=this.mark.getAllElements(),e=this.mark.parameters();return t.forEach((t=>{var e;t.isReserved&&t.diffState!==Kd.exit&&(t.isReserved=!1);const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.prevState;this.configs.some((e=>i!==t.diffState&&e.state===i&&e.timeline.controlOptions.stopWhenStateChange))&&this.clearElementAnimation(t,!1)})),this.configs.forEach((i=>{this.animateByTimeline(i,t,e)})),this.mark.cleanExitElements(),this}runAnimationByState(t){if(!this.isEnabled)return;const e=this.configs.filter((e=>e.state===t)),i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new lw(n)}stopAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.stop())),this}pauseAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.pause())),this}resumeAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.resume())),this}run(t){if(!this.isEnabled)return;const e=aw(vg,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(e);const i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new lw(n)}stop(){return this.animators.forEach((t=>{t.forEach((t=>t.stop()))})),this}pause(){return this.animators.forEach((t=>t.forEach((t=>t.pause())))),this}resume(){return this.animators.forEach((t=>t.forEach((t=>t.resume())))),this}reverse(){return this}restart(){return this}record(){return this}recordEnd(){return this}isAnimating(){let t=!1;return this.animators.forEach((e=>{t=t||e.some((t=>t.isAnimating))})),t}isElementAnimating(t){var e;const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.count;return P(i)||Object.values(i).every((t=>0===t))}getAnimatorCount(){let t=0;return this.animators.forEach((e=>t+=e.length)),t}getAllAnimators(){const t=[];return this.animators.forEach((e=>{t.push(...e)})),t}getElementAnimators(t,e){var i;const s=Ra(t);let n=[];return e?n=null!==(i=this.animators.get(e))&&void 0!==i?i:[]:this.animators.forEach((t=>{n=n.concat(t)})),n.filter((t=>s.includes(t.element)))}enable(){return this.isEnabled=!0,this}disable(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}enableAnimationState(t){const e=Ra(t);return this.disabledStates=this.disabledStates.filter((t=>!e.includes(t))),this}disableAnimationState(t){const e=Ra(t);return this.disabledStates=this.disabledStates.concat(e),this}release(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}animateByTimeline(t,e,i,s=!1){var n;const r=[],a=e.filter((e=>{const n=!(e.isReserved&&e.diffState===Kd.exit),r=this.getAnimationState(e),a=!this.disabledStates.includes(r),o=s||r===t.state,l=!t.timeline.partitioner||t.timeline.partitioner(e.getDatum(),e,i);return n&&a&&o&&l}));if(a.length){P(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&a.sort(((e,s)=>t.timeline.sort(e.getDatum(),s.getDatum(),e,s,i)));const e={width:this.mark.view.width(),height:this.mark.view.height(),group:null!==(n=this.mark.group)&&void 0!==n?n:null,mark:this.mark,view:this.mark.view,elementCount:a.length,elementIndex:0};a.forEach(((s,n)=>{e.elementIndex=n;const o=Object.assign({[Tg]:e},i),l=this.getAnimationUnit(t.timeline,s,n,a.length,o);r.push(this.animateElement(t,l,s,e,o))}))}return r}animateElement(t,e,i,s,n){var r,a;const o=new nw(i,e,t);if(o.animate(s,n),!o.isAnimating)return;i.diffState===Kd.exit&&(i.isReserved=!0);const l=0===this.timelineCount[t.id];this.timelineCount[t.id]+=1;const h=null!==(r=this.elementRecorder.get(i))&&void 0!==r?r:{prevState:t.state,count:{}};h.prevState=t.state,h.count[t.state]=(null!==(a=h.count[t.state])&&void 0!==a?a:0)+1,this.elementRecorder.set(i,h);const d=this.animators.get(t.state);d?d.push(o):this.animators.set(t.state,[o]),o.callback((()=>{this.handleAnimatorEnd(o)}));const c={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return l&&this.mark.emit(rc.ANIMATION_START,c),this.mark.emit(rc.ELEMENT_ANIMATION_START,c,i),o}getAnimationState(t){const e=Np(this.state,this.mark.parameters(),t.getDatum(),t);return null!=e?e:t.diffState}getAnimationUnit(t,e,i,s,n){const r=[],a=ow(t.startTime,e,n),o=ow(t.totalTime,e,n),l=ow(t.oneByOne,e,n),d=ow(t.loop,e,n);let c=0;t.timeSlices.forEach((t=>{var i;const a=ow(t.delay,e,n),l=ow(t.delayAfter,e,n),h=null!==(i=ow(t.duration,e,n))&&void 0!==i?i:o/s,d=Ra(t.effects).map((t=>Object.assign({},t,{customParameters:ow(t.customParameters,e,n)})));r.push({effects:d,duration:h,delay:a,delayAfter:l}),c+=a+h+l}));const u=h(l)?l:!0===l?c:0;return{initialDelay:a,loopCount:h(d)?d:!0===d?1/0:1,loopDelay:u*i,loopDelayAfter:u*(s-i-1),loopAnimateDuration:c,loopDuration:c+u*(s-1),totalTime:o,timeSlices:r}}clearElementAnimation(t,e=!0){this.animators.forEach((i=>{i.forEach((i=>{i.element===t&&(i.animationOptions.state===Kd.exit?i.stop("start",!1):i.stop("end",!1),this.handleAnimatorEnd(i,e))}))})),this.elementRecorder.delete(t)}clearAllElements(){const t=this.mark.getAllElements();t&&t.forEach(((e,i)=>{this.clearElement(e,i===t.length-1)}))}clearElement(t,e=!0){this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===Kd.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}handleAnimatorEnd(t,e=!0){const i=t.element,s=t.animationOptions,n=s.state,r=n===vg,a=this.elementRecorder.get(i).count;a[n]-=1,this.animators.set(n,this.animators.get(n).filter((e=>e!==t))),0===this.animators.get(n).length&&this.animators.delete(n),this.timelineCount[s.id]-=1;const o=0===this.timelineCount[s.id],l=r?this.immediateConfigs.find((t=>t.id===s.id)).originConfig:this.configs.find((t=>t.id===s.id)).originConfig;o&&(delete this.timelineCount[s.id],r&&(this.immediateConfigs=this.immediateConfigs.filter((t=>t.id!==s.id)))),e&&(0===Object.keys(this.timelineCount).length?this.clearAllElements():n===Kd.exit&&0===a[Kd.exit]&&this.clearElement(i));const h={mark:this.mark,animationState:n,animationConfig:l};o&&this.mark.emit(rc.ANIMATION_END,h),this.mark.emit(rc.ELEMENT_ANIMATION_END,h,i)}}class dw{constructor(){this.animate=new hw(this,{})}initAnimate(t){this.animate||(this.animate=new hw(this,t.animation),this.needAnimate()&&this.animate.updateState(t.animationState))}reuseAnimate(t){this.animate=t.animate,this.animate.mark=this}updateAnimate(t){t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)}}const cw={measureText:(t,e,i,s)=>((t,e,i)=>Xk(t,e,i,{fontFamily:Oh.fontFamily,fontSize:Oh.fontSize}))(e,i,s).measure(t)};class uw{static instance(){return uw.instance_||(uw.instance_=new uw),uw.instance_}constructor(){this.functions={}}registerFunction(t,e){t&&e&&(this.functions[t]=e)}unregisterFunction(t){t&&delete this.functions[t]}getFunction(t){return this.functions[t]||null}getFunctionNameList(){return Object.keys(this.functions)}}const pw={WIDTH:500,HEIGHT:500,DPR:1};class gw{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:s=pw.WIDTH,height:n=pw.HEIGHT,dpr:r=pw.DPR,x:a,y:o,id:l,canvasControled:h=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=s*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=s,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,s){return this._context.getImageData(t,e,i,s)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}gw.env="browser";const mw=[0,0,0];let _w=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},He),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},Ne),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},Ve),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Pt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Pt(1,0,0,1,0,0),this._clearMatrix=new Pt(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&g.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Pt(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Lr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Lr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Lr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,s,n,r,a){if(a=a||0,this.camera){const o=[];((t,e,i,s,n,r,a,o)=>{if(o)for(;i>e;)i-=lt;else for(;ie?1:-1);let h=e,d=h;for(;d!==i;){d=l>0?Math.min(d+l,i):Math.max(d+l,i);const e=Math.abs(d-h),o=4*Math.tan(e/4)/3,c=da);t++){const e=v.getColor(t);c.beginPath(),c.rotate(f),c.moveTo(0,0),c.lineTo(m,-2*y),c.lineTo(m,0),c.fillStyle=e,c.closePath(),c.fill()}const b=c.getImageData(0,0,u,p);return d.width=b.width,d.height=b.height,c.putImageData(b,0,0),g=t.createPattern(d,"no-repeat"),g&&wx.Set(e,i,s,r,a,g,u,p),g}(a,this.stops,t,e,h,i,s,o,l),r=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,s){this.nativeContext.fillRect(t,e,i,s)}clearRect(t,e,i,s){this.nativeContext.clearRect(t,e,i,s)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(Tr(mw,[t,e,i],this.modelMatrix),t=mw[0],e=mw[1],i=mw[2]);const s=this.camera.vp(t,e,i);t=s.x,e=s.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(Tr(mw,[t,e,i],this.modelMatrix),t=mw[0],e=mw[1],i=mw[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(Tr(mw,[e,i,s],this.modelMatrix),e=mw[0],i=mw[1],s=mw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,s){return this.nativeContext.getImageData(t,e,i,s)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=oi.global.measureTextMethod){var i,s;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=oi.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const n=null!==(i=this.fontFamily)&&void 0!==i?i:Ve.fontFamily,r=null!==(s=this.fontSize)&&void 0!==s?s:Ve.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,s){this.nativeContext.strokeRect(t,e,i,s)}strokeText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(Tr(mw,[e,i,s],this.modelMatrix),e=mw[0],i=mw[1],s=mw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setCommonStyle(t,e,i,s,r)}return this._setCommonStyle(t,e,i,s,n)}_setCommonStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:a=n.fillOpacity,opacity:o=n.opacity,fill:l=n.fill}=e;r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12&&(r.fillStyle=Ea(this,l,t,i,s))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const s=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setShadowBlendStyle(t,e,s)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const s=this.nativeContext;i||(i=this.fillAttributes);const{opacity:n=i.opacity,shadowBlur:r=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(r||o||l?(s.shadowBlur=r*this.dpr,s.shadowColor=a,s.shadowOffsetX=o*this.dpr,s.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0),h?(s.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(s.filter="blur(0px)",this._clearFilterStyle=!1),d?(s.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(s.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setStrokeStyle(t,e,i,s,r)}return this._setStrokeStyle(t,e,i,s,n)}_setStrokeStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:a=n.strokeOpacity,opacity:o=n.opacity}=e;if(r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12){const{lineWidth:a=n.lineWidth,stroke:o=n.stroke,lineJoin:l=n.lineJoin,lineDash:h=n.lineDash,lineCap:d=n.lineCap,miterLimit:c=n.miterLimit}=e;r.lineWidth=La(this,a,this.dpr),r.strokeStyle=Ea(this,o,t,i,s),r.lineJoin=l,h&&r.setLineDash(h),r.lineCap=d,r.miterLimit=c}}setTextStyleWithoutAlignBaseline(t,e,i){const s=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:n=e.scaleIn3d}=t;t.font?s.font=t.font:s.font=bi(t,e,n&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=r,this.fontSize=a,s.textAlign="left",s.textBaseline="alphabetic"}setTextStyle(t,e,i){var s,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=bi(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,r.textAlign=null!==(s=t.textAlign)&&void 0!==s?s:e.textAlign,r.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Lr.free(t))),this.stack.length=0}};_w.env="browser",_w=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],_w);let fw=class extends gw{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=oi.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new _w(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:s=this._dpr,x:n=this._x,y:r=this._y}=t,{nativeCanvas:a}=this;a.width=e*s,a.height=i*s,!a.style||this.setCanvasStyle(a,n,r,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,s,n){this.controled&&(t.style.width=`${s}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function vw(t,e){return new B((i=>{i(Oi).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(Ri).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}fw.env="browser",fw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],fw);const yw=vw(fw,_w);var bw=function(t,e){return function(i,s){e(i,s,t)}};let xw=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=oi.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let s={graphic:null,group:null};i.pickerService=this;const n=i.bounds.width(),r=i.bounds.height();if(!(new Bt).setValue(0,0,n,r).containsPoint(e))return s;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new Pt(1,0,0,1,0,0);let o;for(let n=t.length-1;n>=0&&(s=t[n].isContainer?this.pickGroup(t[n],e,a,i):this.pickItem(t[n],e,a,i),!s.graphic);n--)o||(o=s.group);if(s.graphic||(s.group=o),this.pickContext&&(this.pickContext.inuse=!1),s.graphic){let t=s.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(s.params={shadowTarget:s.graphic},s.graphic=t.shadowHost)}return s}containsPoint(t,e,i){var s;return!!(null===(s=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===s?void 0:s.graphic)}pickGroup(t,e,i,s){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;const r=s.pickContext,a=r.modelMatrix;if(r.camera){const e=t.transMatrix,i=Er.allocate();if(Ar(i,e),a){if(i){const t=Er.allocate();r.modelMatrix=wr(t,a,i),Er.free(i)}}else Ar(i,t.globalTransMatrix),r.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n{if(r.isContainer){const i=new re(e.x,e.y),a=Qi(t).group,{scrollX:o=a.scrollX,scrollY:h=a.scrollY}=t.attribute;i.x-=o,i.y-=h,n=this.pickGroup(r,i,l,s)}else{const a=new re(e.x,e.y);l.transformPoint(a,a);const o=Qi(t).group,{scrollX:h=o.scrollX,scrollY:d=o.scrollY}=t.attribute;a.x-=h,a.y-=d;const c=this.pickItem(r,a,i,s);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params)}return!!n.graphic||!!n.group}),!0,!!r.camera),r.modelMatrix!==a&&Er.free(r.modelMatrix),r.modelMatrix=a,n.graphic||n.group||!u||t.stage.camera||(n.group=t),Lr.free(l),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};xw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),bw(0,$(X)),bw(0,K(Or)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],xw);var Sw=function(t,e){return function(i,s){e(i,s,t)}};let Mw=class extends xw{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=Bi.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,s){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Sw(0,$(X)),Sw(0,K(Z_)),Sw(1,$(mr)),Sw(2,$(X)),Sw(2,K(Or)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object,Object])],Mw);let kw=class{constructor(){this.type="group",this.numberType=Mn}contains(t,e,i){return!1}};kw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],kw);const Aw=new B(((t,e,i,s)=>{Aw.__vloaded||(Aw.__vloaded=!0,t(q_).to(kw).inSingletonScope(),t(Z_).toService(q_),Z(t,Z_))}));Aw.__vloaded=!1;const ww=Aw,Tw=new B(((t,e,i,s)=>{i(Mw)||t(Mw).toSelf().inSingletonScope(),i(xr)?s(xr).toService(Mw):t(xr).toService(Mw)}));let Cw=class{constructor(){this._uid=I.GenAutoIncrementId(),this.viewBox=new Bt,this.modelMatrix=new Pt(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,s,n,r){this.modelMatrix.setValue(t,e,i,s,n,r)}getViewBoxTransform(){return this.modelMatrix}};Cw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Cw);var Lw;let Ew=Lw=class extends Cw{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Lw.idprefix}_${Lw.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=oi.global,this.viewBox=new Bt,this.modelMatrix=new Pt(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>s)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const s={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Lw.GenerateCanvasId(),canvasControled:!0};this.canvas=new fw(s)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let s=t.width,n=t.height;if(null==s||null==n||!t.canvasControled){const t=i.getBoundingClientRect();s=t.width,n=t.height}let r=t.dpr;null==r&&(r=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/s),this.canvas=new fw({width:s,height:n,dpr:r,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),s=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(s,0,0,s,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};Ew.env="browser",Ew.idprefix="visactor_window",Ew.prefix_count=0,Ew=Lw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Ew);const Pw=new B((t=>{t(Ew).toSelf(),t(Yi).toDynamicValue((t=>t.container.get(Ew))).whenTargetNamed(Ew.env)}));let Dw=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new Bt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};Dw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Dw);class Ow{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function Rw(t,e=!1){const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let Iw=class extends Dw{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,s;let n=0,r=0,a=0,o=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0,a=n,o=r}else n=t.clientX||0,r=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=n,i=r,a=e.getBoundingClientRect(),o=null===(s=e.getNativeHandler)||void 0===s?void 0:s.call(e).nativeCanvas;let l,h;return o&&(l=a.width/o.offsetWidth,h=a.height/o.offsetHeight),{x:(t-a.left)/(Wo(l)?l:1),y:(i-a.top)/(Wo(h)?h:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Ow(t)}return new Bt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:s,style:n}=e;return n&&(S(n)?t.setAttribute("style",n):Object.keys(n).forEach((e=>{t.style[e]=n[e]}))),null!=i&&(t.style.width=`${i}px`),null!=s&&(t.style.height=`${s}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,s=document.createElement(e);if(this.updateDom(s,t),i){const t=S(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(s)}return s}loadImage(t){return Rw(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Rw(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const s=document.createElement("canvas");t.id&&(s.id=null!==(e=t.id)&&void 0!==e?e:I.GenAutoIncrementId().toString());const n=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(s.style.width=`${t.width}px`,s.style.height=`${t.height}px`,s.width=t.width*n,s.height=t.height*n),s}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let i=t.offsetTop,s=t.offsetParent;for(;null!==s;)i+=s.offsetTop,s=s.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,s=t.offsetParent;for(;null!==s;)i+=s.offsetLeft,s=s.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,s=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent;return{top:i,left:s}}};Iw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Iw);const Bw=new B((t=>{Bw.isBrowserBound||(Bw.isBrowserBound=!0,t(Iw).toSelf().inSingletonScope(),t(tt).toService(Iw))}));function Fw(t,e=!0){Fw.__loaded||(Fw.__loaded=!0,t.load(Bw),t.load(yw),t.load(Pw),e&&function(t){t.load(ww),t.load(Tw)}(t))}Bw.isBrowserBound=!1,Fw.__loaded=!1;let Yw=class extends _w{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Pt(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};Yw.env="node",Yw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],Yw);let jw=class extends gw{constructor(t){super(t)}init(){this._context=new Yw(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...t){this._nativeCanvas.release&&rs(this._nativeCanvas.release)&&this._nativeCanvas.release()}};jw.env="node",jw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],jw);const Hw=vw(jw,Yw);let zw=class extends Cw{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:I.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new jw(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,s=t.height;null!=i&&null!=s&&t.canvasControled||(i=e.width,s=e.height),this.canvas=new jw({width:i,height:s,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};zw.env="node",zw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(et)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],zw);const Nw=new B((t=>{t(zw).toSelf(),t(Yi).toDynamicValue((t=>t.container.get(zw))).whenTargetNamed(zw.env)}));let Vw=class extends Dw{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return Js.call(t)}}getCancelAnimationFrame(){return t=>{Js.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};Vw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Vw);const Ww=new B((t=>{Ww.isNodeBound||(Ww.isNodeBound=!0,t(Vw).toSelf().inSingletonScope(),t(tt).toService(Vw))}));function Gw(t,e=!0){Gw.__loaded||(Gw.__loaded=!0,t.load(Ww),t.load(Hw),t.load(Nw))}Ww.isNodeBound=!1,Gw.__loaded=!1;const Uw={name:"dark",colorScheme:{default:{dataScheme:ql,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff",discreteLegendPagerTextColor:"#BBBDC3",discreteLegendPagerHandlerColor:"#BBBDC3",discreteLegendPagerHandlerDisableColor:"#55595F",emptyCircleColor:"#bbbdc3"}}},component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}};class $w{constructor(){this.id=qo(),this._plugins=[]}add(t){if(!t||0===t.length)return null;const e=[];return t.forEach((t=>{this._plugins.find((e=>e.id===t.id))?pl("不要重复添加相同的plugin"):(this._plugins.push(t),e.push(t),t.onAdd&&t.onAdd(this))})),e}load(t){const e=this.add(t);e&&e.length&&this.activate(t)}activate(t){t.length&&t.forEach((t=>{t.init&&t.init()}))}get(t){return this._plugins.find((e=>e.id===t))}getAll(){return this._plugins.slice()}release(t){const e=this.get(t);e&&(e.release(this),this._plugins=this._plugins.filter((t=>t!==e)))}releaseAll(){this._plugins.forEach((t=>{t.release(this)})),this._plugins=[]}clear(t){const e=this.get(t);e&&e.clear(this)}clearAll(){this._plugins.forEach((t=>{var e;null===(e=t.clear)||void 0===e||e.call(t,this)}))}}class Kw extends $w{constructor(t){super(),this.globalInstance=t}onInit(t){this._plugins.forEach((e=>{e.onInit&&e.onInit(this,t)}))}onBeforeResize(t,e){this._plugins.forEach((i=>{i.onBeforeResize&&i.onBeforeResize(this,t,e)}))}onAfterChartSpecTransform(t,e){this._plugins.forEach((i=>{i.onAfterChartSpecTransform&&i.onAfterChartSpecTransform(this,t,e)}))}onBeforeInitChart(t,e){this._plugins.forEach((i=>{i.onBeforeInitChart&&i.onBeforeInitChart(this,t,e)}))}releaseAll(){super.releaseAll(),this.globalInstance=null}}class Xw{constructor(t,e){this.references=new Map,this.view=t,this.depend(null==e?void 0:e.dependency)}getStartState(){return null}depend(t){this.references.clear(),Ra(t).map((t=>S(t)?this.view.getGrammarById(t):t)).filter((t=>!P(t))).forEach((t=>{var e;this.references.set(t,(null!==(e=this.references.get(t))&&void 0!==e?e:0)+1)}))}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}bind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.addEventListener(e,t.handler)})):"none"!==t.type&&this.view.addEventListener(t.type,t.handler))}))}unbind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.removeEventListener(e,t.handler)})):"none"!==t.type&&this.view.removeEventListener(t.type,t.handler))}))}start(t){}reset(t){}dispatchEvent(t,e){this.view.emit(`${this.type}:${t}`,e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}class qw extends Xw{constructor(t,e){super(t,e),this.type=qw.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},qw.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){t&&this._marks&&this._marks.includes(t.mark)&&t.addState(this.options.state)}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&t.removeState(this.options.state)}}qw.type="element-active",qw.defaultOptions={state:oc.active,trigger:"pointerover",triggerOff:"pointerout"};const Zw=t=>t.filterField?e=>{var i;return null===(i=e.getDatum())||void 0===i?void 0:i[t.filterField]}:e=>e[t.filterType],Jw=(t,e)=>{if(!e||!t)return null;const i={};return t.forEach((t=>{const s=t&&t.getSpec(),n=s&&s.encode;n&&e.forEach((e=>{e&&n[e]&&(i[e]||(i[e]=[]),i[e].push(t))}))})),i};class Qw extends Xw{constructor(t,e){super(t,e),this.type=Qw.type,this._resetType=[],this.clearPrevElements=()=>{const{state:t,reverseState:e}=this.options;this._statedElements&&this._statedElements.length&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:this._statedElements,options:this.options}),this._statedElements=[])},this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},Qw.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=Jw(this._marks,[this.options.state,this.options.reverseState])}getStartState(){return this.options.state}getEvents(){const t=this.options.triggerOff,e=this.options.trigger,i=[{type:e,handler:this.handleStart}],{eventNames:s,resetType:n}=(t=>{const e=Ra(t),i=[],s=[];return e.forEach((t=>{"empty"===t?i.push("view"):S(t)&&"none"!==t?t.includes("view:")?(s.push(t.replace("view:","")),i.push("view")):(s.push(t),i.push("self")):h(t)&&i.push("timeout")})),{eventNames:s,resetType:i}})(t);return s.forEach((t=>{t&&(y(e)?!e.includes(t):t!==e)&&i.push({type:t,handler:this.handleReset})})),this._resetType=n,i}start(t){const{state:e,reverseState:i,isMultiple:s}=this.options;if(t&&this._marks&&this._marks.includes(t.mark))if(t.hasState(e)){if(this._resetType.includes("self")){const s=this._statedElements&&this._statedElements.filter((e=>e!==t));s&&s.length?this._statedElements=this.updateStates(s,this._statedElements,e,i):this.clearPrevElements()}}else this._timer&&clearTimeout(this._timer),t.addState(e),this._statedElements=this.updateStates(s&&this._statedElements?[...this._statedElements,t]:[t],this._statedElements,e,i),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),this._resetType.includes("timeout")&&(this._timer=setTimeout((()=>{this.clearPrevElements()}),this.options.triggerOff));else this._resetType.includes("view")&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);(this._resetType.includes("view")&&!e||this._resetType.includes("self")&&e)&&this.clearPrevElements()}}Qw.type="element-select",Qw.defaultOptions={state:oc.selected,trigger:"click"};class tT extends Xw{constructor(t,e){super(t,e),this.type=tT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},tT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=Jw(this._marks,[this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getEvents(){const t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}];let i=t;return S(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}clearPrevElements(){const{highlightState:t,blurState:e}=this.options;this._lastElement&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const{highlightState:e,blurState:i}=this.options;if(this._lastElement===t)return;this._statedElements=this.updateStates([t],this._statedElements,e,i),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options})}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}tT.type="element-highlight",tT.defaultOptions={highlightState:oc.highlight,blurState:oc.blur,trigger:"pointerover",triggerOff:"pointerout"};class eT extends Xw{constructor(t,e){super(t,e),this.type=eT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{t.element&&this._marks&&this._marks.includes(t.element.mark)&&this.clearPrevElements()},this.options=Object.assign({},eT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(P(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(P(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}}eT.type="element-highlight-by-key",eT.defaultOptions={highlightState:oc.highlight,blurState:oc.blur,trigger:"pointerover",triggerOff:"pointerout"};class iT extends Xw{constructor(t,e){super(t,e),this.type=iT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},iT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.groupKey;if(P(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.groupKey===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&this.clearPrevElements()}}iT.type="element-highlight-by-group",iT.defaultOptions={highlightState:oc.highlight,blurState:oc.blur,trigger:"pointerover",triggerOff:"pointerout"};const sT=16,nT=8,rT=12;var aT,oT,lT;!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(aT||(aT={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick",t.legendItemAttributeUpdate="legendItemAttributeUpdate"}(oT||(oT={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(lT||(lT={}));class hT extends Xw{constructor(t,e){super(t,e),this.type=hT.type,this.handleStart=t=>{var e,i;this.start(null===(i=null===(e=t.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},hT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:oT.legendItemHover,handler:this.handleStart},{type:oT.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){const e=t;if(P(e))return;const i=Zw(this.options);this._marks.forEach((t=>{t.elements.forEach((t=>{i(t)===e?t.addState(this.options.state):t.removeState(this.options.state)}))}))}reset(){this._marks.forEach((t=>{t.elements.forEach((t=>{t.removeState(this.options.state)}))}))}}hT.type="element-active-by-legend",hT.defaultOptions={state:oc.active,filterType:"groupKey"};class dT extends Xw{constructor(t,e){super(t,e),this.type=dT.type,this.handleStart=(t,e)=>{var i,s;this.start(null===(s=null===(i=t.detail)||void 0===i?void 0:i.data)||void 0===s?void 0:s.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},dT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:oT.legendItemHover,handler:this.handleStart},{type:oT.legendItemUnHover,handler:this.handleReset}]}start(t){if(P(t))return;const e=Zw(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}dT.type="element-highlight-by-legend",dT.defaultOptions={highlightState:oc.highlight,blurState:oc.blur,filterType:"groupKey"};class cT extends Xw{constructor(t,e){super(t,e),this.type=cT.type,this.handleStart=(t,e)=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const i=this._parseTargetKey(t,e);this.start(i)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.reset()},this.options=Object.assign({},cT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;const i=Ra(this.options.graphicName);return(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.name)&&i.includes(t.target.name)}_parseTargetKey(t,e){return this.options.parseData?this.options.parseData(t):"text"===t.target.type?t.target.attribute.text:null}start(t){if(P(t))return;const e=Zw(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}cT.type="element-highlight-by-name",cT.defaultOptions={trigger:"pointerover",triggerOff:"pointerout",highlightState:oc.highlight,blurState:oc.blur,filterType:"groupKey"};class uT{updateStates(t,e,i,s){return t&&t.length?(i&&s?e&&e.length?(this.toggleReverseStateOfElements(t,e,s),this.toggleStateOfElements(t,e,i)):this.addBothStateOfElements(t,i,s):i&&(e&&e.length?this.toggleStateOfElements(t,e,i):this.addStateOfElements(t,i)),t):null}toggleReverseStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)}))}toggleStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)}))}addBothStateOfElements(t,e,i){this._marks.forEach((s=>{const n=i&&this._stateMarks[i]&&this._stateMarks[i].includes(s),r=e&&this._stateMarks[e]&&this._stateMarks[e].includes(s);(n||r)&&s.elements.forEach((s=>{t&&t.includes(s)?r&&s.addState(e):n&&s.addState(i)}))}))}addStateOfElements(t,e){this._marks.forEach((i=>{const s=e&&this._stateMarks[e]&&this._stateMarks[e].includes(i);s&&i.elements.forEach((i=>{t&&t.includes(i)&&s&&i.addState(e)}))}))}clearAllStates(t,e){this._statedElements&&this._statedElements.length&&this._marks.forEach((i=>{e&&this._stateMarks[e]&&this._stateMarks[e].includes(i)&&i.elements.forEach((t=>{t.removeState(e)})),t&&this._stateMarks[t]&&this._stateMarks[t].includes(i)&&i.elements.forEach((e=>{this._statedElements.includes(e)&&e.removeState(t)}))}))}}var pT=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};class gT{static useRegisters(t){t.forEach((t=>{"function"==typeof t?t():console.error("Invalid function:",t)}))}static useChart(t){t.forEach((t=>$l.registerChart(t.type,t)))}static useSeries(t){t.forEach((t=>$l.registerSeries(t.type,t)))}static useComponent(t){t.forEach((t=>$l.registerComponent(t.type,t)))}static useMark(t){t.forEach((t=>{var e;return $l.registerMark(null!==(e=t.constructorType)&&void 0!==e?e:t.type,t)}))}static useLayout(t){t.forEach((t=>$l.registerLayout(t.type,t)))}static registerDataSetTransform(t,e){$l.registerTransform(t,e)}static registerFunction(t,e){t&&e&&uw.instance().registerFunction(t,e)}static unregisterFunction(t){t&&uw.instance().unregisterFunction(t)}static getFunction(t){return t?uw.instance().getFunction(t):null}static getFunctionList(){return uw.instance().getFunctionNameList()}static registerMap(t,e,i){const s=$l.getImplementInKey("registerMap");s&&s(t,e,i)}static unregisterMap(t){const e=$l.getImplementInKey("unregisterMap");e&&e(t)}static getMap(t){return e=t,Tp.get(e);var e}static hideTooltip(t=[]){Gh.forEach((t=>{var e;return null===(e=null==t?void 0:t.hideTooltip)||void 0===e?void 0:e.call(t)}),t)}static getLogger(){return g.getInstance()}getSpec(){return this._spec}getSpecInfo(){return this._specInfo}getDataSet(){return this._dataSet}constructor(t,e){var i,s,r,a,o,l;this.id=qo(),this._userEvents=[],this._autoSize=!0,this._option={mode:n["desktop-browser"],onError:t=>{throw new Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._onResize=Uo(((...t)=>{this._doResize()}),100),this._renderSync=(t={})=>{var e;return this._beforeRender(t)?(null===(e=this._compiler)||void 0===e||e.render(t.morphConfig),this._afterRender(),this):this},this._updateSpec=(t,e=!1,i)=>{var s,n;const r=this._spec,a={reTransformSpec:!1,change:!1,reMake:!1,reCompile:!1,reSize:!1,changeTheme:!1};if(!this._setNewSpec(t,e))return;Dm(r.theme,this._spec.theme)?Dm(this._spec.background,r.background)||(a.reMake=!0,a.changeBackground=!0):a.changeTheme=!0;const o=this._shouldChartResize(r);if(a.reSize=o,null===(n=null===(s=this._compiler)||void 0===s?void 0:s.getVGrammarView())||void 0===n||n.updateLayoutTag(),this._spec.type!==r.type)return a.reMake=!0,a.reTransformSpec=!0,a.change=!0,a.changeTheme=!0,a;this._initChartSpec(this._spec,"render");const l=_y(this._chart.updateSpec(this._spec),a);return i?Object.assign(Object.assign({},l),i):l},this._option=E(this._option,{animation:!1!==t.animation},e),this._onError=null===(i=this._option)||void 0===i?void 0:i.onError;const h=this._option,{dom:d,renderCanvas:c,mode:u,stage:p,poptip:g}=h,m=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{this._event.emit(jd.animationFinished,{chart:this._chart,vchart:this})})),this._compiler.getVGrammarView().addEventListener(rc.AFTER_VRENDER_NEXT_RENDER,(()=>{this._event.emit(jd.renderFinished,{chart:this._chart,vchart:this})})))}_bindResizeEvent(){var t;if(this._autoSize){if(this._container){const e=window.ResizeObserver;e&&(this._observer=new e(this._onResize),null===(t=this._observer)||void 0===t||t.observe(this._container))}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}getCurrentSize(){var t,e,i,s;return my(this._spec,{container:this._container,canvas:this._canvas,mode:this._getMode(),modeParams:this._option.modeParams},{width:null!==(e=null===(t=this._currentSize)||void 0===t?void 0:t.width)&&void 0!==e?e:nh,height:null!==(s=null===(i=this._currentSize)||void 0===i?void 0:i.height)&&void 0!==s?s:rh})}_doResize(){const{width:t,height:e}=this.getCurrentSize();this._currentSize.width===t&&this._currentSize.height===e||(this._currentSize={width:t,height:e},this.resizeSync(t,e))}_initDataSet(t){this._dataSet=t instanceof f?t:new f,wp(this._dataSet,"dataview",b),wp(this._dataSet,"array",e),Ap(this._dataSet,"copyDataView",Op);for(const t in $l.transforms)Ap(this._dataSet,t,$l.transforms[t]);for(const t in $l.dataParser)wp(this._dataSet,t,$l.dataParser[t])}updateCustomConfigAndRerender(t,e,i={}){if(!this._isReleased&&t)return rs(t)&&(t=t()),t.reAnimate&&(this.stopAnimation(),this._updateAnimateState(!0)),this._reCompile(t),e?this._renderSync(i):this._renderAsync(i)}_updateCustomConfigAndRecompile(t,e={}){return!!t&&(this._reCompile(t),this._beforeRender(e))}_reCompile(t,e){var i,s,n,r,a,o,l,h,d,c;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,null===(i=this._chart)||void 0===i||i.release(),this._chart=null,t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(s=this._currentTheme)||void 0===s?void 0:s.fontFamily)):t.changeBackground&&(null===(n=this._compiler)||void 0===n||n.setBackground(this._getBackground())),null===(r=this._compiler)||void 0===r||r.releaseGrammar(!1===(null===(a=this._option)||void 0===a?void 0:a.animation)||!1===(null===(o=this._spec)||void 0===o?void 0:o.animation)),this._userEvents.forEach((t=>{var e;return null===(e=this._event)||void 0===e?void 0:e.on(t.eType,t.query,t.handler)})),t.reSize&&this._doResize();else if(t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(l=this._currentTheme)||void 0===l?void 0:l.fontFamily)):t.changeBackground&&(null===(h=this._compiler)||void 0===h||h.setBackground(this._getBackground())),t.reCompile&&(null===(d=this._compiler)||void 0===d||d.clear({chart:this._chart,vChart:this},!this._option.animation||!this._spec.animation),null===(c=this._compiler)||void 0===c||c.compile({chart:this._chart,vChart:this},{})),t.reSize){const{width:t,height:e}=this.getCurrentSize();this._chart.onResize(t,e,!1),this._compiler.resize(t,e,!1)}}_beforeRender(t={}){var e,i,s,n,r,a,o,l;if(this._isReleased)return!1;if(this._chart)return!0;const{transformSpec:h,actionSource:d}=t;return h&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,d),null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeInitializeChart)||void 0===i||i.call(e),this._initChart(this._spec),null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterInitializeChart)||void 0===n||n.call(s),!(!this._chart||!this._compiler||(null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.beforeCompileToVGrammar)||void 0===a||a.call(r),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),null===(l=null===(o=this._option.performanceHook)||void 0===o?void 0:o.afterCompileToVGrammar)||void 0===l||l.call(o),0))}_afterRender(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(jd.rendered,{chart:this._chart,vchart:this}),!0)}renderSync(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}renderAsync(t){return pT(this,void 0,void 0,(function*(){return this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"})}))}_renderAsync(t={}){return pT(this,void 0,void 0,(function*(){return this._renderSync(t)}))}_updateAnimateState(t){var e,i;if(this._option.animation){const s=t?Yp.appear:Yp.update;null===(e=this._chart)||void 0===e||e.getAllRegions().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)})),null===(i=this._chart)||void 0===i||i.getAllComponents().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)}))}}release(){var t,e,i,s;(null===(t=this._onResize)||void 0===t?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null===(e=this._chart)||void 0===e||e.release(),null===(i=this._eventDispatcher)||void 0===i||i.release(),null===(s=this._compiler)||void 0===s||s.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._option=null,this._chart=null,this._compiler=null,this._spec=null,this._specInfo=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,Gh.unregisterInstance(this)}updateData(t,e,i,s){return pT(this,void 0,void 0,(function*(){return this.updateDataSync(t,e,i,s)}))}_updateDataById(t,e,i){const s=this._spec.data.find((e=>e.name===t||e.id===t));s?s.id===t?s.values=e:s.name===t&&s.parse(e,i):y(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}updateDataInBatches(t){return pT(this,void 0,void 0,(function*(){return this._chart?(this._chart.updateFullData(t.map((({id:t,data:e,options:i})=>({id:t,values:e,parser:i})))),this._chart.updateGlobalScaleDomain(),this._compiler.render(),this):(this._spec.data=Ra(this._spec.data),t.forEach((({id:t,data:e,options:i})=>{this._updateDataById(t,e,i)})),this)}))}updateDataSync(t,e,i,s){return P(this._dataSet)?this:this._chart?((null==s?void 0:s.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateData(t,e,!0,i),this._compiler.render(),this):(this._spec.data=Ra(this._spec.data),this._updateDataById(t,e,i),this)}updateFullDataSync(t,e=!0,i){if(this._chart)return(null==i?void 0:i.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateFullData(t),e&&this._compiler.render(),this;const s=Ra(this._spec.data);return Ra(t).forEach((t=>{var e;const{id:i,values:n,parser:r,fields:a}=t,o=s.find((t=>t.name===i));if(o)o instanceof R?(o.setFields(k(a)),o.parse(n,k(r))):(o.values=n,M(r)&&(o.parser=r),M(a)&&(o.fields=a));else{const i=Ip(t,this._dataSet,s,{onError:null===(e=this._option)||void 0===e?void 0:e.onError});y(this._spec.data)&&this._spec.data.push(i)}})),this}updateFullData(t,e=!0){return pT(this,void 0,void 0,(function*(){return this.updateFullDataSync(t,e)}))}updateSpec(t,e=!1,i,s){return pT(this,void 0,void 0,(function*(){const n=this._updateSpec(t,e,s);return n?(yield this.updateCustomConfigAndRerender(n,!1,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}))}updateSpecSync(t,e=!1,i,s){const n=this._updateSpec(t,e,s);return n?(this.updateCustomConfigAndRerender(n,!0,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}updateSpecAndRecompile(t,e=!1,i={}){const s=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(s,Object.assign({actionSource:"updateSpecAndRecompile"},i))}updateModelSpec(t,e,i=!1,s){return pT(this,void 0,void 0,(function*(){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),rs(t)||Cl(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!1,i,s)}return this}))}updateModelSpecSync(t,e,i=!1,s){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),rs(t)||Cl(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!0,i,s)}return this}_updateModelSpec(t,e,i=!1,s=!1,n){s&&(e=Tl({},t.getSpec(),e));const r=t.updateSpec(e);return t.reInit(e),(r.change||r.reCompile||r.reMake||r.reSize||r.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(r,i,{morphConfig:n,transformSpec:!1,actionSource:"updateModelSpec"})}resize(t,e){return pT(this,void 0,void 0,(function*(){return this.resizeSync(t,e)}))}resizeSync(t,e){var i,s;return this._beforeResize(t,e)?(null===(s=(i=this._compiler).resize)||void 0===s||s.call(i,t,e),this._afterResize()):this}_beforeResize(t,e){var i,s,n,r;if(!this._chart||!this._compiler)return!1;const a=this._chart.getCanvasRect();return!(a&&a.width===t&&a.height===e||(this._chartPluginApply("onBeforeResize",t,e),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.beforeResizeWithUpdate)||void 0===s||s.call(i),this._chart.onResize(t,e,!1),null===(r=null===(n=this._option.performanceHook)||void 0===n?void 0:n.afterResizeWithUpdate)||void 0===r||r.call(n),0))}_afterResize(){return this._isReleased||this._event.emit(jd.afterResize,{chart:this._chart}),this}updateViewBox(t,e=!0,i=!0){return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,i),i&&(this._compiler.render(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}on(t,e,i){var s;this._userEvents&&(this._userEvents.push({eType:t,query:"function"==typeof e?null:e,handler:"function"==typeof e?e:i}),null===(s=this._event)||void 0===s||s.on(t,e,i))}off(t,e){var i;if(this._userEvents&&0!==this._userEvents.length)if(e){const s=this._userEvents.findIndex((i=>i.eType===t&&i.handler===e));s>=0&&(this._userEvents.splice(s,1),null===(i=this._event)||void 0===i||i.off(t,e))}else this._userEvents.forEach((e=>{var i;e.eType===t&&(null===(i=this._event)||void 0===i||i.off(t,e.handler))})),this._userEvents=this._userEvents.filter((e=>e.eType!==t))}updateState(t,e){this._chart&&this._chart.updateState(t,e)}setSelected(t,e,i){this._chart&&this._chart.setSelected(t,e,i)}setHovered(t,e,i){this._chart&&this._chart.setHovered(t,e,i)}clearState(t){this._chart&&this._chart.clearState(t)}clearSelected(){this._chart&&this._chart.clearSelected()}clearHovered(){this._chart&&this._chart.clearHovered()}_updateCurrentTheme(t){var e,i,s,n,r,a;const o=this._option.theme,l=null===(e=this._spec)||void 0===e?void 0:e.theme,h=null===(i=this._spec)||void 0===i?void 0:i.type;let d;if(t&&(this._currentThemeName=t),Im(o)&&Im(l))d=$h(this._currentThemeName,!0),this._currentTheme=Kl({},d,null===(r=d.chart)||void 0===r?void 0:r[h]);else if(S(o)&&(!l||S(l))||S(l)&&(!o||S(o))){d=$h(this._currentThemeName,!0);const t=Kl({},d,null===(s=d.chart)||void 0===s?void 0:s[h],$h(o,!0),$h(l,!0));this._currentTheme=t}else{d=$h(this._currentThemeName);const t=Kl({},d,null===(n=d.chart)||void 0===n?void 0:n[h],$h(o),$h(l));this._currentTheme=Bh(t)}var c;c=Gd(this._currentTheme,"component.poptip"),E(o_.poptip,a_,c),null===(a=this._compiler)||void 0===a||a.setBackground(this._getBackground())}_shouldChartResize(t){var e,i;let s=!1;P(this._spec.width)?!P(t.width)&&(this._spec.width=t.width):this._spec.width!==t.width&&(s=!0),P(this._spec.height)?!P(t.height)&&(this._spec.height=t.height):this._spec.height!==t.height&&(s=!0);const n=this._autoSize;return this._autoSize=!!dl(this._option.mode)&&(null===(i=null!==(e=this._spec.autoFit)&&void 0!==e?e:this._option.autoFit)||void 0===i||i),this._autoSize!==n&&(s=!0),s}_getBackground(){return("string"==typeof this._spec.background||ns(this._spec.background)&&this._spec.background.gradient?this._spec.background:null)||this._currentTheme.background||this._option.background}getCurrentTheme(){return $h(this._currentThemeName)}getCurrentThemeName(){return this._currentThemeName}setCurrentTheme(t){var e;return pT(this,void 0,void 0,(function*(){if(!Uh.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),yield this.updateCustomConfigAndRerender(i,!1,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}))}setCurrentThemeSync(t){var e;if(!Uh.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),this.updateCustomConfigAndRerender(i,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}_setCurrentTheme(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null===(e=this._chart)||void 0===e||e.setCurrentTheme(),{change:!0,reMake:!1}}_setFontFamilyTheme(t){var e;t&&(null===(e=this.getStage())||void 0===e||e.setTheme({text:{fontFamily:t}}))}_getTooltipComponent(){var t;return null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(r.tooltip)[0]}setTooltipHandler(t){var e,i;this._context.tooltipHandler=t;const s=this._getTooltipComponent();s&&(null===(i=null===(e=s.tooltipHandler)||void 0===e?void 0:e.release)||void 0===i||i.call(e),s.tooltipHandler=t)}getTooltipHandlerByUser(){var t;return null===(t=this._context)||void 0===t?void 0:t.tooltipHandler}getTooltipHandler(){const t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}showTooltip(t,e){var i;const s=this._getTooltipComponent();return null!==(i=M(t)&&"none"!==(null==s?void 0:s.showTooltip(t,e)))&&void 0!==i&&i}hideTooltip(){var t;const e=this._getTooltipComponent();return null!==(t=null==e?void 0:e.hideTooltip())&&void 0!==t&&t}getLegendDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}getLegendDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getLegendData():[]}getLegendSelectedDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}getLegendSelectedDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getSelectedData():[]}setLegendSelectedDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.setSelectedData(e)}setLegendSelectedDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.discreteLegend);s&&s[t]&&s[t].setSelectedData(e)}getDataURL(){var t;return pT(this,void 0,void 0,(function*(){const e=this.getStage();if(this._chart&&e){e.render();const t=this._chart.getCanvas();return yield r_(t,{onError:this._onError})}return null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined")),null}))}exportImg(t){var e,i;return pT(this,void 0,void 0,(function*(){if(!dl(this._option.mode))return void(null===(e=this._option)||void 0===e||e.onError(new TypeError("non-browser environment can not export img")));const s=yield this.getDataURL();s?function(t="vchart",e){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("target","_blank"),i.setAttribute("download",`${t}.png`),i.dispatchEvent(new MouseEvent("click"))}(t,s):null===(i=this._option)||void 0===i||i.onError(new ReferenceError("render is not defined"))}))}exportCanvas(){var t;const e=this.getStage();if(this._chart&&e)return e.toCanvas();null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined"))}getImageBuffer(){var t,e;if("node"!==this._option.mode)return void(null===(t=this._option)||void 0===t||t.onError(new TypeError("getImageBuffer() now only support node environment.")));const i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):(null===(e=this._option)||void 0===e||e.onError(new ReferenceError("render is not defined")),null)}setLayout(t){var e;this._option.layout=t,null===(e=this._chart)||void 0===e||e.setLayout(t)}reLayout(){var t;null===(t=this._chart)||void 0===t||t.setLayoutTag(!0)}getCompiler(){return this._compiler}getChart(){return this._chart}getStage(){return this._compiler.getStage()}getCanvas(){var t;return null===(t=this._compiler)||void 0===t?void 0:t.getCanvas()}getContainer(){var t;if(M(this._container))return this._container;let e;return e=S(this._canvas)?jo.getElementById(this._canvas):this._canvas,M(e)?e.parentElement:null===(t=this.getCanvas())||void 0===t?void 0:t.parentElement}getComponents(){return this._chart.getAllComponents()}getScale(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getGlobalScale();return null==i?void 0:i.getScale(t)}setDimensionIndex(t,e={}){var i;return null===(i=this._chart)||void 0===i?void 0:i.setDimensionIndex(t,e)}stopAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.stop()}pauseAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.pause()}resumeAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.resume()}convertDatumToPosition(t,e={},i=!1,s){var n;if(!this._chart)return null;if(Im(t))return null;const{seriesId:r,seriesIndex:a=0}=e;let o;if(M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o){const e=Object.keys(t),n=o.getViewData().latestData.find((i=>e.every((e=>i[e]==t[e])))),r=o.getRegion().getLayoutStartPoint();let a;return a=n?o.dataToPosition(n,s):o.dataToPosition(t,s),a?nl(a,r,i):null}return null}convertValueToPosition(t,e,i=!1){var s,n;if(!this._chart||P(t)||Im(e))return null;if(!y(t)){const{axisId:n,axisIndex:r}=e;let a;if(M(n)?a=this._chart.getComponentsByKey("axes").find((t=>t.userId===n)):M(r)&&(a=null===(s=this._chart.getComponentsByKey("axes"))||void 0===s?void 0:s[r]),!a)return pl("Please check whether the `axisId` or `axisIndex` is set!"),null;const o=null==a?void 0:a.valueToPosition(t);if(i){const t=a.getLayoutStartPoint(),e=a.getOrient();return o+("bottom"===e||"top"===e?t.x:t.y)}return o}const{seriesId:r,seriesIndex:a}=e;let o;return M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o?nl(o.valueToPosition(t[0],t[1]),o.getRegion().getLayoutStartPoint(),i):(pl("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}getFunction(t){return uw.instance().getFunction(t)}registerFunction(t,e){t&&e&&uw.instance().registerFunction(t,e)}unregisterFunction(t){t&&uw.instance().unregisterFunction(t)}getFunctionList(){return uw.instance().getFunctionNameList()}setRuntimeSpec(t){this._spec=t,this._updateSpecInfo()}updateIndicatorDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.updateDatum(e)}updateIndicatorDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.indicator);s&&s[t]&&s[t].updateDatum(e)}geoZoomByIndex(t=0,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionIndex:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}geoZoomById(t,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionId:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}_initChartPlugin(){const t=$l.getChartPlugins();t.length>0&&(this._chartPlugin=new Kw(this),this._chartPlugin.load(t.map((t=>new t))),this._chartPluginApply("onInit",this._spec))}_chartPluginApply(t,...e){this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,e)}_getMode(){return this._option.mode||n["desktop-browser"]}_getChartOption(t){return{type:t,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._getMode(),modeParams:this._option.modeParams,getCompiler:()=>this._compiler,performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:()=>{var t;return null!==(t=this._currentTheme)&&void 0!==t?t:{}},getSpecInfo:()=>{var t;return null!==(t=this._specInfo)&&void 0!==t?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent}}}gT.InstanceManager=Gh,gT.ThemeManager=Uh,gT.globalConfig={uniqueTooltip:!0},gT.Utils=cw,gT.vglobal=jo,$l.registerRegion("region",Ny),$l.registerLayout("base",qy),GA(),e_.useRegisters([()=>{pc.registerStageEventPlugin("gesture",KA)}]),XA(tT,uT),pc.registerInteraction(tT.type,tT),XA(Qw,uT),pc.registerInteraction(Qw.type,Qw),Nh(Uw.name,Uw),g.getInstance(u.Error);const mT=`${sh}_DEFAULT_DATA_INDEX`,_T=`${sh}_DEFAULT_DATA_KEY`,fT=`${sh}_DEFAULT_DATA_SERIES_FIELD`,vT=`${sh}_DEFAULT_SERIES_STYLE_NAME`,yT=`${sh}_STACK_KEY`,bT=`${sh}_STACK_START`,xT=`${sh}_STACK_END`,ST=`${sh}_STACK_START_PERCENT`,MT=`${sh}_STACK_END_PERCENT`,kT=`${sh}_STACK_START_OffsetSilhouette`,AT=`${sh}_STACK_END_OffsetSilhouette`,wT=`${sh}_STACK_TOTAL`,TT=`${sh}_STACK_TOTAL_PERCENT`,CT=`${sh}_STACK_TOTAL_TOP`,LT=`${sh}_STACK_TOTAL_BOTTOM`,ET=`${sh}_SEGMENT_START`,PT=`${sh}_SEGMENT_END`;function DT(t,e){for(let i=0;it.key===e))}function RT(t,e){var i;if(!t)return null!=e?e:null;const s=t.getFields();return s&&s[e]?null!==(i=s[e].alias)&&void 0!==i?i:e:null!=e?e:null}function IT(t,e,i){const s=t.getStackSort(),n={};let r=null;return s&&(r={},t.getSeries().forEach((t=>{const e=t.getSeriesField();if(e){const i=t.getRawDataStatisticsByField(e);i.values&&(r[e]||(r[e]={lastIndex:0,sort:{}}),i.values.forEach(((t,i)=>{t in r[e].sort||(r[e].sort[t]=r[e].lastIndex,r[e].lastIndex++)})))}}))),t.getSeries().forEach((t=>{var s;const a=t.getStackData(),o=t.getStackValue(),l=t.getStackValueField(),h=!i||i(t);a&&l&&h&&(n[o]=null!==(s=n[o])&&void 0!==s?s:{groupField:a.groupField,nodes:{}},HT(t,a,n[o],l,e,r))})),s?BT(n,r):n}function BT(t,e){var i;for(const s in t)(null===(i=t[s].sortDatums)||void 0===i?void 0:i.length)?(t[s].sortDatums.sort(((t,e)=>t.index-e.index)),t[s].values=t[s].sortDatums.map((t=>t.datum))):BT(t[s].nodes,e);return t}function FT(t,e){if("values"in t&&t.values.length){const i=fd(t.values,e),s=_d(t.values,MT);t.values.forEach((t=>{t[wT]=i,t[TT]=s}))}else for(const i in t.nodes)FT(t.nodes[i],e)}function YT(t){if(!t.values.length)return;const e=t.values[t.values.length-1][xT]/2;for(let i=0;i0){let s=0,o=0,l=1,h=0,d=null,c=null;const u=t.values.length;for(let i=0;i=0?(l[n.start]=s,s+=l[n.end],l[n.end]=s):(l[n.start]=o,o+=l[n.end],l[n.end]=o),l[n.key]=t.key,a&&(delete l[n.max],(!c||l[n.end]>c[n.end])&&(c=l)),r&&(delete l[n.min],(!d||l[n.start]=0?s:o;l=h>=0?1:-1,r[n.startPercent]=0===a?0:Math.min(1,r[n.start]/a)*l,r[n.endPercent]=0===a?0:Math.min(1,r[n.end]/a)*l}}for(const r in t.nodes)jT(t.nodes[r],e,i,s,n)}function HT(t,e,i,s,n,r,a){var o;if("values"in e)if(n&&e.values.forEach((t=>t[xT]=function(t){if(Wo(t))return t;const e=+t;return Wo(e)?e:0}(t[s]))),i.series.push({s:t,values:e.values}),r){const s=t.getSeriesField();e.values.forEach((e=>{i.sortDatums.push({series:t,datum:e,index:s?r[s].sort[e[s]]:0})}))}else i.values.push(...e.values);else for(const l in e.nodes){const h=a?`${a}_${l}`:l;i.nodes[l]||(i.nodes[l]={values:[],series:[],nodes:{},sortDatums:[],key:h},M(null===(o=e.nodes[l])||void 0===o?void 0:o.groupField)&&(i.nodes[l].groupField=e.nodes[l].groupField)),HT(t,e.nodes[l],i.nodes[l],s,n,r,h)}}const zT=(t,e)=>{const i=e.beforeCall();return t&&t.forEach(((t,s)=>e.call(t,s,i))),i.keyMap&&(i.keyMap.clear(),i.keyMap=null),t};class NT{constructor(){this.activeTriggerSet={mark:new Set,dimension:new Set,group:new Set},this.ignoreTriggerSet={mark:new Set,dimension:new Set,group:new Set}}}class VT extends NT{constructor(t){super(),this._getSeriesCacheInfo=()=>{var t,e,i;const{series:s}=this,n=s.getSeriesField();return{seriesFields:M(n)?Ra(n):null!==(t=s.getSeriesKeys())&&void 0!==t?t:[],dimensionFields:null!==(e=s.getDimensionField())&&void 0!==e?e:[],measureFields:null!==(i=s.getMeasureField())&&void 0!==i?i:[],type:s.type}},this._getDimensionData=t=>{const{dimensionFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getMeasureData=t=>{const{measureFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getSeriesFieldData=t=>{const{dimensionFields:e,seriesFields:i}=this._seriesCacheInfo;if(M(i[0])&&(null==t?void 0:t[i[0]]))return null==t?void 0:t[i[0]];const s=e[e.length-1];return e.length>1&&(0===i.length||this.series.getSeriesKeys().length),null==t?void 0:t[s]},this._getSeriesStyle=(t,e,i)=>{var s;for(const i of Ra(e)){const e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(M(e))return e}return i},this.markTooltipKeyCallback=(t,e)=>this._getSeriesFieldData(t),this.markTooltipValueCallback=(t,e)=>this._getMeasureData(t),this.shapeTypeCallback=(t,e)=>{var i;return null!==(i=this._getSeriesStyle(t,"shape",null))&&void 0!==i?i:this._getSeriesStyle(t,"symbolType",this.series.getDefaultShapeType())},this.shapeColorCallback=(t,e)=>this._getSeriesStyle(t,["fill","stroke"]),this.shapeStrokeCallback=(t,e)=>this._getSeriesStyle(t,["stroke","fill"]),this.dimensionTooltipTitleCallback=(t,e)=>this._getDimensionData(t),this.groupTooltipTitleCallback=(t,e)=>this._getSeriesFieldData(t),this.groupTooltipKeyCallback=(t,e)=>{const{seriesFields:i}=this._seriesCacheInfo;let s=this._seriesCacheInfo.dimensionFields;return i[0]&&(s=s.filter((t=>t!==i[0]))),s.map((e=>null==t?void 0:t[e])).join("-")},this.series=t,this.updateTooltipSpec()}updateTooltipSpec(){var t;const e=null===(t=this.series.getSpec())||void 0===t?void 0:t.tooltip;this.spec=e,this._seriesCacheInfo=this._getSeriesCacheInfo()}getDefaultTooltipPattern(t,e){switch(t){case"mark":return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{seriesId:this.series.id,key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"group":return{visible:!0,activeType:t,title:{key:void 0,value:this.groupTooltipTitleCallback,hasShape:!1},content:[{seriesId:this.series.id,key:this.groupTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"dimension":if(e){const i={key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},s=[];return e.forEach((({data:t})=>t.forEach((({series:t})=>{s.push({seriesId:t.id,key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1})})))),{visible:!0,activeType:t,title:i,content:s}}}return null}}const WT={min:t=>t.length?Fa(t.map((t=>1*t))):0,max:t=>t.length?Ba(t.map((t=>1*t))):0,"array-min":t=>t.length?Fa(t.map((t=>1*t))):0,"array-max":t=>t.length?Ba(t.map((t=>1*t))):0,values:t=>{const e={},i=[];for(const s of t)e[s]||(i.push(s),e[s]=1);return i}},GT=(t,e)=>{var i,s;let n=e.fields;if(rs(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return{};n=DT([],n);const r="parser"===e.target?"parserData":"latestData",a=t[0][r]?t[0][r]:t||[],o=null===(s=(i=t[0]).getFields)||void 0===s?void 0:s.call(i);return UT(a,n,o)},UT=(t,e,i)=>{const s={};let n=[],r=[];return e.forEach((e=>{const a=e.key;s[a]={};const o=null==i?void 0:i[a],l=e.operations,h=l.some((t=>"min"===t||"max"===t||"allValid"===t));let d=!0;n.length=0,t&&t.forEach((t=>{t&&n.push(t[a])}));const c=n.length;if(h){r.length=0,n.forEach(((t,e)=>{Zo(t)&&r.push(t)}));const t=n;n=r,r=t,d=n.length===c}else n=l.some((t=>"array-min"===t||"array-max"===t))?n.reduce(((t,e)=>(e&&e.forEach((e=>{Zo(e)&&t.push(e)})),t)),[]):n.filter((t=>void 0!==t));e.filter&&(n=n.filter(e.filter)),l.forEach((t=>{if(e.customize)s[a][t]=e.customize;else{if(o&&o.lockStatisticsByDomain&&!P(o.domain)){if("values"===t)return void(s[a][t]=o.domain.slice())}else if("allValid"===t)return;s[a][t]=WT[t](n),"array-max"===t&&(s[a].max=s[a][t]),"array-min"===t&&(s[a].min=s[a][t])}})),h&&(s[a].allValid=d)})),s},$T=(t,e)=>{const{config:i}=e;if(!i)return t;const{invalidType:s,checkField:n}=i();return"zero"!==s||n&&n.length&&t.forEach((t=>{n.forEach((e=>{Zo(t[e])||(t[e]=0)}))})),t};class KT extends dx{_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;P(e)||M(this.getProduct())||this._initProduct([])}generateProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.name}}const XT=`${sh}_HIERARCHY_DEPTH`,qT=`${sh}_HIERARCHY_ROOT`,ZT=`${sh}_HIERARCHY_ROOT_INDEX`;function JT(){return{keyMap:new Map,needDefaultSeriesField:!this._seriesField,defaultSeriesField:this._seriesField?null:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey)}}function QT(t,e,i){t&&(i.needDefaultSeriesField&&(t[fT]=i.defaultSeriesField),t[mT]=e,t[_T]=i.getKey(t,e,i))}function tC(){return{keyMap:new Map,needDefaultSeriesField:!0,defaultSeriesField:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey),categoryField:this.getCategoryField()}}function eC(t,e,i,s=0,n,r){void 0===r&&(r=e),QT(t,e,i),t[XT]=s,t[qT]=n||t[i.categoryField],t[ZT]=r,t.children&&t.children.length&&t.children.forEach(((e,s)=>eC(e,s,i,t[XT]+1,t[qT],r)))}const iC={label:{name:"label",type:"text"}},sC=`${sh}_rect_x`,nC=`${sh}_rect_x1`,rC=`${sh}_rect_y`,aC=`${sh}_rect_y1`,oC={data:!0},lC={animation:!0,animationAppear:!0,animationEnter:!0,animationUpdate:!0,animationExit:!0,animationNormal:!0},hC={type:"fadeIn"};function dC(t,e){switch(e){case"grow":return(t=>({type:"horizontal"===t.direction?"growPointsXIn":"growPointsYIn",options:{orient:"horizontal"===t.direction?"positive":"negative"}}))(t);case"fadeIn":return hC;default:return(t=>({type:"clipIn",options:{clipDimension:"horizontal"===t.direction?"y":"x"}}))(t)}}const cC=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!1),r=null!==(s=t.getGraphicAttribute("clipRange",!1))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:0,clipRangeByDimension:e.clipDimension},to:{clipRange:r,clipRangeByDimension:n}}:{from:{clipRange:0},to:{clipRange:r}}},uC=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!0),r=null!==(s=t.getGraphicAttribute("clipRange",!0))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:r,clipRangeByDimension:e.clipDimension},to:{clipRange:0,clipRangeByDimension:n}}:{from:{clipRange:r},to:{clipRange:0}}},pC=(t,e,i)=>{var s,n,r,a;const o=null!==(s=t.getFinalAnimationAttributes())&&void 0!==s?s:{};return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(n=o.opacity)&&void 0!==n?n:1,fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(a=o.strokeOpacity)&&void 0!==a?a:1}}},gC=(t,e,i)=>{var s,n,r;return{from:{opacity:null!==(s=t.getGraphicAttribute("opacity",!0))&&void 0!==s?s:1,fillOpacity:null!==(n=t.getGraphicAttribute("fillOpacity",!0))&&void 0!==n?n:1,strokeOpacity:null!==(r=t.getGraphicAttribute("strokeOpacity",!0))&&void 0!==r?r:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},mC=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{from:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0},to:{x:e,x1:i,width:s}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{from:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0},to:{y:e,y1:i,height:s}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width"),n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height"),o={};return M(s)?(o.x=e+s/2,o.width=0,o.x1=void 0):(o.x=(e+i)/2,o.x1=(e+i)/2,o.width=void 0),M(a)?(o.y=n+a/2,o.height=0,o.y1=void 0):(o.y=(n+r)/2,o.y1=(n+r)/2,o.height=void 0),{from:o,to:{x:e,y:n,x1:i,y1:r,width:s,height:a}}}}},_C=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{to:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{to:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("width"),a=t.getFinalAnimationAttribute("height"),o={};return M(r)?(o.x=e+r/2,o.width=0,o.x1=void 0):(o.x=(e+s)/2,o.x1=(e+s)/2,o.width=void 0),M(a)?(o.y=i+a/2,o.height=0,o.y1=void 0):(o.y=(i+n)/2,o.y1=(i+n)/2,o.height=void 0),{to:o}}}},fC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x"),r=t.getFinalAnimationAttribute("x1"),a=t.getFinalAnimationAttribute("width");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=o):o=i.width:o=h(null==e?void 0:e.overall)?null==e?void 0:e.overall:0,{from:{x:o,x1:P(r)?void 0:o,width:P(a)?void 0:0},to:{x:n,x1:r,width:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{x:t,x1:P(s)?void 0:t,width:P(n)?void 0:0},to:{x:i,x1:s,width:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{x:r,x1:P(s)?void 0:r,width:P(n)?void 0:0},to:{x:i,x1:s,width:n}}}(t,e)},vC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x1"),r=t.getFinalAnimationAttribute("width");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=a):a=i.width:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{x:a,x1:P(n)?void 0:a,width:P(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{x:t,x1:P(s)?void 0:t,width:P(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{x:r,x1:P(s)?void 0:r,width:P(n)?void 0:0}}}(t,e)},yC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=o):o=i.height:o=h(null==e?void 0:e.overall)?e.overall:0,{from:{y:o,y1:P(r)?void 0:o,height:P(a)?void 0:0},to:{y:n,y1:r,height:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{y:t,y1:P(s)?void 0:t,height:P(n)?void 0:0},to:{y:i,y1:s,height:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{y:r,y1:P(s)?void 0:r,height:P(n)?void 0:0},to:{y:i,y1:s,height:n}}}(t,e)},bC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("height");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=a):a=i.height:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{y:a,y1:P(n)?void 0:a,height:P(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{y:t,y1:P(s)?void 0:t,height:P(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{y:r,y1:P(s)?void 0:r,height:P(n)?void 0:0}}}(t,e)},xC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes();if(e&&"anticlockwise"===e.orient){const t=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t,endAngle:t},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}}const s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:s,endAngle:s},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:null==i?void 0:i.endAngle},to:{startAngle:null==i?void 0:i.startAngle}}:{from:{endAngle:null==i?void 0:i.startAngle},to:{endAngle:null==i?void 0:i.endAngle}}})(t,e)},SC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{if(e&&"anticlockwise"===e.orient){const i=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}}const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:t.getGraphicAttribute("startAngle",!0)},to:{startAngle:null==i?void 0:i.endAngle}}:{from:{endAngle:t.getGraphicAttribute("endAngle",!0)},to:{endAngle:null==i?void 0:i.startAngle}}})(t,e)},MC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes(),s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:s,outerRadius:s},to:{innerRadius:null==i?void 0:i.innerRadius,outerRadius:null==i?void 0:i.outerRadius}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:null==i?void 0:i.outerRadius},to:{innerRadius:null==i?void 0:i.innerRadius}}:{from:{outerRadius:null==i?void 0:i.innerRadius},to:{outerRadius:null==i?void 0:i.outerRadius}}})(t,e)},kC=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0),outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{innerRadius:i,outerRadius:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0)},to:{innerRadius:null==i?void 0:i.outerRadius}}:{from:{outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{outerRadius:null==i?void 0:i.innerRadius}}})(t,e)},AC=(t,e,i)=>{const s=t.getGraphicAttribute("points",!1),n={x:0,y:0};return s.forEach((t=>{n.x+=t.x,n.y+=t.y})),n.x/=s.length,n.y/=s.length,e&&e.center&&(Wo(e.center.x)&&(n.x=e.center.x),Wo(e.center.y)&&(n.y=e.center.y)),"area"===t.mark.markType&&(n.x1=n.x,n.y1=n.y),s.map((t=>Object.assign({},t,n)))},wC=(t,e,i)=>({from:{points:AC(t,e)},to:{points:t.getGraphicAttribute("points",!1)}}),TC=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:AC(t,e)}}),CC=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.width;return i.group&&(e=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=e),Object.assign(Object.assign({},t),{x:e,y:t.y,x1:e,y1:t.y1,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:0,y:t.y,x1:0,y1:t.y1,defined:!1!==t.defined})})),LC=(t,e,i)=>({from:{points:CC(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),EC=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:CC(t,e,i)}}),PC=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.height;return i.group&&(e=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=e),Object.assign(Object.assign({},t),{x:t.x,y:e,x1:t.x1,y1:e,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:t.x,y:0,x1:t.x1,y1:0,defined:!1!==t.defined})})),DC=(t,e,i)=>({from:{points:PC(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),OC=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:PC(t,e,i)}}),RC=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l,excludeChannels:h=[]}=null!=e?e:{};let d=0,c=0;"negative"===a&&(i.group?(d=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),c=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupWidth=d,i.groupHeight=c):(d=i.width,c=i.height)),d+=r,c+=r;const u=rs(l)?l.call(null,t.getDatum(),t,i):l,p=u&&Wo(u.x)?u.x:d,g=u&&Wo(u.y)?u.y:c,m=h.includes("x")?t.getGraphicAttribute("x"):t.getFinalAnimationAttribute("x"),_=h.includes("y")?t.getGraphicAttribute("y"):t.getFinalAnimationAttribute("y");switch(o){case"x":return{from:{x:p},to:{x:m}};case"y":return{from:{y:g},to:{y:_}};default:return{from:{x:p,y:g},to:{x:m,y:_}}}},IC=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l}=null!=e?e:{},h=i.group?i.group.getBounds():null,d=null!==(s=null==h?void 0:h.width())&&void 0!==s?s:i.width,c=null!==(n=null==h?void 0:h.height())&&void 0!==n?n:i.height,u=("negative"===a?d:0)+r,p=("negative"===a?c:0)+r,g=rs(l)?l.call(null,t.getDatum(),t,i):l,m=g&&Wo(g.x)?g.x:u,_=g&&Wo(g.y)?g.y:p;switch(o){case"x":return{from:{x:t.getGraphicAttribute("x",!0)},to:{x:m}};case"y":return{from:{y:t.getGraphicAttribute("y",!0)},to:{y:_}};default:return{from:{x:t.getGraphicAttribute("x",!0),y:t.getGraphicAttribute("y",!0)},to:{x:m,y:_}}}},BC=(t,e,i)=>{var s,n,r,a;const o=t.getFinalAnimationAttributes();switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:0},to:{scaleX:null!==(s=null==o?void 0:o.scaleX)&&void 0!==s?s:1}};case"y":return{from:{scaleY:0},to:{scaleY:null!==(n=null==o?void 0:o.scaleY)&&void 0!==n?n:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:null!==(r=null==o?void 0:o.scaleX)&&void 0!==r?r:1,scaleY:null!==(a=null==o?void 0:o.scaleY)&&void 0!==a?a:1}}}},FC=(t,e,i)=>{var s,n,r,a;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:null!==(s=t.getGraphicAttribute("scaleX",!0))&&void 0!==s?s:1},to:{scaleX:0}};case"y":return{from:{scaleY:null!==(n=t.getGraphicAttribute("scaleY",!0))&&void 0!==n?n:1},to:{scaleY:0}};default:return{from:{scaleX:null!==(r=t.getGraphicAttribute("scaleX",!0))&&void 0!==r?r:1,scaleY:null!==(a=t.getGraphicAttribute("scaleY",!0))&&void 0!==a?a:1},to:{scaleX:0,scaleY:0}}}},YC={symbol:["_mo_hide_","visible"]},jC=(t,e,i)=>{const s=Object.assign({},t.getPrevGraphicAttributes()),n=Object.assign({},t.getNextGraphicAttributes());let r;e&&Ra(e.excludeChannels).forEach((t=>{delete s[t],delete n[t]})),t.mark&&t.mark.markType&&(r=YC[t.mark.markType])&&r.forEach((t=>{delete s[t],delete n[t]})),Object.keys(n).forEach((t=>{Dm(s[t],n[t])&&(delete s[t],delete n[t])}));const a=t.getFinalGraphicAttributes();return Object.keys(s).forEach((t=>{P(n[t])&&(P(a[t])||Dm(s[t],a[t])?delete s[t]:n[t]=a[t])})),{from:s,to:n}},HC=(t,e,i)=>{var s;const n=null!==(s=t.getFinalAnimationAttribute("angle"))&&void 0!==s?s:0;let r=0;return r=hd(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:Wo(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:r},to:{angle:n}}},zC=(t,e,i)=>{var s;const n=null!==(s=t.getGraphicAttribute("angle",!0))&&void 0!==s?s:0;let r=0;return r=hd(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:Wo(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:n},to:{angle:r}}},NC=()=>{pc.registerAnimationType("clipIn",cC)},VC=()=>{pc.registerAnimationType("clipOut",uC)},WC=()=>{pc.registerAnimationType("fadeIn",pC)},GC=()=>{pc.registerAnimationType("fadeOut",gC)},UC=()=>{pc.registerAnimationType("growCenterIn",mC)},$C=()=>{pc.registerAnimationType("growCenterOut",_C)},KC=()=>{pc.registerAnimationType("growHeightIn",yC)},XC=()=>{pc.registerAnimationType("growHeightOut",bC)},qC=()=>{pc.registerAnimationType("growWidthIn",fC)},ZC=()=>{pc.registerAnimationType("growWidthOut",vC)},JC=()=>{pc.registerAnimationType("growPointsIn",wC)},QC=()=>{pc.registerAnimationType("growPointsOut",TC)},tL=()=>{pc.registerAnimationType("growPointsXIn",LC)},eL=()=>{pc.registerAnimationType("growPointsXOut",EC)},iL=()=>{pc.registerAnimationType("growPointsYIn",DC)},sL=()=>{pc.registerAnimationType("growPointsYOut",OC)},nL=()=>{pc.registerAnimationType("growAngleIn",xC)},rL=()=>{pc.registerAnimationType("growAngleOut",SC)},aL=()=>{pc.registerAnimationType("growRadiusIn",MC)},oL=()=>{pc.registerAnimationType("growRadiusOut",kC)},lL=()=>{pc.registerAnimationType("moveIn",RC)},hL=()=>{pc.registerAnimationType("moveOut",IC)},dL=()=>{pc.registerAnimationType("scaleIn",BC)},cL=()=>{pc.registerAnimationType("scaleOut",FC)},uL=()=>{pc.registerAnimationType("rotateIn",HC)},pL=()=>{pc.registerAnimationType("rotateOut",zC)},gL=()=>{pc.registerAnimationType("update",jC)},mL={appear:{duration:1e3,easing:"cubicOut"},update:{type:"update",duration:300,easing:"linear"},enter:{duration:300,easing:"linear"},exit:{duration:300,easing:"linear"},disappear:{duration:500,easing:"cubicIn"},state:{duration:300,easing:"linear"}},_L={appear:{type:"scaleIn"},enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:{type:"scaleOut"}},fL={appear:{type:"fadeIn"},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}},vL=()=>{$l.registerAnimation("scaleInOut",(()=>_L))},yL=()=>{$l.registerAnimation("fadeInOut",(()=>fL))},bL=(t,e)=>({appear:dC(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},update:[{type:"update",options:{excludeChannels:["points","defined","segments"]}},{channel:["points","segments"],custom:pA,duration:mL.update.duration,easing:mL.update.easing,customParameters:{clipRangeByDimension:"horizontal"===t.direction?"y":"x"}}],disappear:{type:"clipOut"}}),xL=()=>{$l.registerAnimation("line",bL)},SL=()=>{e_.useRegisters([KC,XC,qC,ZC,UC,$C])},ML=()=>{e_.useRegisters([aL,oL,nL,rL])},kL=()=>{e_.useRegisters([JC,QC,tL,eL,iL,sL,NC,VC])},AL=()=>{e_.useRegisters([JC,QC])},wL=[...Object.keys(mL),"normal"];function TL(t={},e,i){const s={};for(let n=0;n{t.controlOptions={stopWhenStateChange:!0}})),a?(l=y(a)?a.map(((t,e)=>{var s;let n=t;return DL(n)&&delete n.type,n.oneByOne&&(n=LL(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:EL,null==i?void 0:i.dataCount)),n})):o.map(((t,e)=>{var s;let n=Tl({},o[e],a);return DL(n)&&delete n.type,n.oneByOne&&(n=LL(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:EL,null==i?void 0:i.dataCount)),n})),s[r]=l):s[r]=o}return s}function CL(t,e,i){var s,n,r,a,o,l;const h={};return M(e.animationAppear)&&(h.appear=null!==(s=e.animationAppear[t])&&void 0!==s?s:e.animationAppear),M(e.animationDisappear)&&(h.disappear=null!==(n=e.animationDisappear[t])&&void 0!==n?n:e.animationDisappear),M(e.animationEnter)&&(h.enter=null!==(r=e.animationEnter[t])&&void 0!==r?r:e.animationEnter),M(e.animationExit)&&(h.exit=null!==(a=e.animationExit[t])&&void 0!==a?a:e.animationExit),M(e.animationUpdate)&&(h.update=null!==(o=e.animationUpdate[t])&&void 0!==o?o:e.animationUpdate),M(e.animationState)&&(h.state=null!==(l=e.animationState[t])&&void 0!==l?l:e.animationState),e.animationNormal&&e.animationNormal[t]&&(h.normal=e.animationNormal[t]),function(t,e){return t?(OL(t=k(t),(t=>{var i;return rs(t)&&(null===(i=t.prototype)||void 0===i?void 0:i.constructor)!==t?(...i)=>t(...i,e):t})),t):t}(h,i)}function LL(t,e,i){const{oneByOne:s,duration:n,delay:r,delayAfter:a}=t;return t.delay=(t,i,a)=>{const o=e(t,a),l=rs(n)?n(t,i,a):Wo(n)?n:0,h=rs(r)?r(t,i,a):Wo(r)?r:0;let d=rs(s)?s(t,i,a):s;return!1===d?h:(d=!0===d?0:d,h+o*(l+d))},t.delayAfter=(t,r,o)=>{const l=e(t,o),h=rs(n)?n(t,r,o):Wo(n)?n:0,d=rs(a)?a(t,r,o):Wo(a)?a:0;let c=rs(s)?s(t,r,o):s;return!1===c?d:(c=!0===c?0:c,d+((i?i():r.mark.elements.length)-l)*(h+c))},delete t.oneByOne,t}function EL(t,e){var i,s;return null!==(i=null==t?void 0:t[mT])&&void 0!==i?i:null===(s=null==e?void 0:e.VGRAMMAR_ANIMATION_PARAMETERS)||void 0===s?void 0:s.elementIndex}function PL(t,e){var i,s,n,r,a;if(!1===t.animation)return!1;if(!1===(null===(i=t.morph)||void 0===i?void 0:i.enable))return!1;const o=!1!==(null!==(n=null===(s=t.animationAppear)||void 0===s?void 0:s[e])&&void 0!==n?n:t.animationAppear),l=!1!==(null!==(a=null===(r=t.animationUpdate)||void 0===r?void 0:r[e])&&void 0!==a?a:t.animationUpdate);return!(!o||!l)}function DL(t){return!function(t){return M(t.timeSlices)}(t)&&M(t.channel)}function OL(t,e){if(y(t))t.forEach(((i,s)=>{t[s]=e(t[s],s),OL(t[s],e)}));else if(ns(t))for(const i in t)t[i]=e(t[i],i),OL(t[i],e)}function RL(t){var e,i,s,n;const r=t.getSpec();if(!1===r.animation)return!1;if(!M(t.getRegion().animate))return!1;let a=null!==(e=r.animationThreshold)&&void 0!==e?e:Number.MAX_SAFE_INTEGER;return null===(i=t.getMarks())||void 0===i||i.forEach((t=>{const e=t.getProgressiveConfig();e&&(e.large&&e.largeThreshold&&(a=Math.min(a,e.largeThreshold)),e.progressiveThreshold&&(a=Math.min(a,e.progressiveThreshold)))})),!((null===(n=null===(s=t.getRawData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)>=a)}class IL extends By{constructor(){super(...arguments),this.markLabelSpec={}}getLabelSpec(t){return this.markLabelSpec[t]}setLabelSpec(t,e){this.markLabelSpec[t]=Ra(e)}addLabelSpec(t,e,i=!1){this.markLabelSpec[t]||(this.markLabelSpec[t]=[]),i?this.markLabelSpec[t].unshift(e):this.markLabelSpec[t].push(e)}getTheme(t,e){var i,s,n;const r=vl(t),a=null===(i=this._option)||void 0===i?void 0:i.getTheme(),{markByName:o,mark:l}=a,h=this._option.type,d=$l.getSeriesMarkMap(h)?function(t,e,i,s){const n=$l.getSeriesMarkMap(e);if(!n)return t;const r={};return Object.values(n).forEach((({type:e,name:n})=>{r[n]=Tl({},null==i?void 0:i[Ra(e)[0]],null==s?void 0:s[n],null==t?void 0:t[n])})),Object.assign(Object.assign({},t),r)}(Gd(a,`series.${h}`),h,l,o):{},c=Gd(a,`series.${h}_${r}`);return Tl({},d,c,(null!==(n=null!==(s=this.stack)&&void 0!==s?s:null==c?void 0:c.stack)&&void 0!==n?n:null==d?void 0:d.stack)?Gd(a,`series.${h}_stack`):void 0)}transformSpec(t,e,i){this._transformStack(t);const s=super.transformSpec(t,e,i);return this._transformLabelSpec(s.spec),Object.assign(Object.assign({},s),{markLabelSpec:this.markLabelSpec,stack:this.stack})}_transformLabelSpec(t){}_transformStack(t){v(t.stack)&&(this.stack=t.stack),v(t.percent)&&(this.stack=t.percent||this.stack),P(this.stack)&&this._supportStack&&t.seriesField&&(this.stack=!0)}_addMarkLabelSpec(t,e,i="label",s="initLabelMarkStyle",n,r){t&&Ra(t[i]).forEach((i=>{i&&i.visible&&this.addLabelSpec(e,Object.assign(Object.assign({animation:null!=n?n:t.animation},i),{getStyleHandler:t=>{var e;return null===(e=t[s])||void 0===e?void 0:e.bind(t)}}),r)}))}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{outerRadius:s,innerRadius:n,direction:r}=t;return M(s)&&(i.outerRadius=s),M(n)&&(i.innerRadius=n),M(r)&&(i.direction=r),Object.keys(i).length>0?i:void 0}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>{const e=Tl({},i,s,t),n=i.label;return n&&ns(n)&&y(e.label)&&(e.label=e.label.map((t=>Tl({},n,t)))),e};return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}}class BL extends Yy{getRegion(){return this._region}getLayoutStartPoint(){return this._region.getLayoutStartPoint()}getRootMark(){return this._rootMark}getSeriesMark(){return this._seriesMark}getRawData(){return this._rawData}getViewDataFilter(){return this._viewDataFilter}getViewData(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}getViewDataProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.getProductId()}getViewDataStatistics(){return this._viewDataStatistics}getViewStackData(){return this._viewStackData}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t,this.getMarks().filter((t=>t.getDataView()===this.getViewData())).forEach((t=>{t.setFacet(this._seriesField)})))}getGroups(){return this._groups}getStack(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.stack}getStackValue(){var t;return null!==(t=this._spec.stackValue)&&void 0!==t?t:`${sh}_series_${this.type}`}getPercent(){return this._spec.percent}getStackOffsetSilhouette(){return this._spec.stackOffsetSilhouette}get tooltipHelper(){return this._tooltipHelper||this.initTooltip(),this._tooltipHelper}getInvalidType(){return this._invalidType}setInvalidType(t){var e;this._invalidType=t,null===(e=this.getViewData())||void 0===e||e.reRunAllTransform()}getMarkAttributeContext(){return this._markAttributeContext}constructor(t,e){var i;super(t,e),this.specKey="series",this.type="series",this.layoutType="absolute",this.modelType="series",this.name=void 0,this.transformerConstructor=IL,this.coordinate="none",this._region=null,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:null,height:null},this.getLayoutRect=()=>{var t,e;return{width:null!==(t=this._layoutRect.width)&&void 0!==t?t:this._region.getLayoutRect().width,height:null!==(e=this._layoutRect.height)&&void 0!==e?e:this._region.getLayoutRect().height}},this._rootMark=null,this._seriesMark=null,this._viewDataMap=new Map,this._viewDataFilter=null,this._data=null,this.layoutZIndex=0,this._invalidType="break",this._region=e.region,this._dataSet=e.dataSet,(null===(i=this._spec)||void 0===i?void 0:i.name)&&(this.name=this._spec.name)}created(){super.created(),this._buildMarkAttributeContext(),this.initData(),this.initGroups(),this.initStatisticalData(),this.event.emit(jd.afterInitData,{model:this}),this.initRootMark(),this.initMark();const t=RL(this);this._initExtensionMark({hasAnimation:t}),this.initMarkStyle(),this.initMarkState(),t&&this.initAnimation(),this._option.disableTriggerEvent||this.initInteraction(),this.afterInitMark(),this.initEvent(),this.event.emit(jd.afterInitEvent,{model:this})}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},seriesColor:t=>{var e;return P(t)&&(t=this.getSeriesKeys()[0]),null===(e=this._option.globalScale.getScale("color"))||void 0===e?void 0:e.scale(t)},getRegion:()=>this._region}}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),M(this._spec.invalidType)&&(this._invalidType=this._spec.invalidType)}getInvalidCheckFields(){return[this.getStackValueField()]}initInvalidDataTransform(){var t,e;"zero"===this._invalidType&&(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Ap(this._rawData.dataSet,"invalidTravel",$T),null===(e=this._rawData)||void 0===e||e.transform({type:"invalidTravel",options:{config:()=>({invalidType:this._invalidType,checkField:this.getInvalidCheckFields()})}},!1))}initData(){var t,e,i,s;const n=null!==(t=this._spec.data)&&void 0!==t?t:this._option.getSeriesData(this._spec.dataId,this._spec.dataIndex);if(n&&(this._rawData=Ip(n,this._dataSet,this._option.sourceDataList,{onError:null===(e=this._option)||void 0===e?void 0:e.onError})),null===(s=null===(i=this._rawData)||void 0===i?void 0:i.target)||void 0===s||s.addListener("change",this.rawDataUpdate.bind(this)),this._addDataIndexAndKey(),this._rawData){this.getStack()&&(this._viewDataFilter=Rp(this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewDataFilter`}));const t=Rp(this.getStack()?this._viewDataFilter:this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewData`});this._data=new KT(this._option,t),this.getStack()&&this._viewDataFilter.target.removeListener("change",t.reRunAllTransform)}this.initInvalidDataTransform()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups={fields:t})}initStatisticalData(){this._data&&this._statisticViewData()}getRawDataStatisticsByField(t,e){var i,s,n;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]||e&&(P(this._rawStatisticsCache[t].min)||P(this._rawStatisticsCache[t].max))||!e&&P(this._rawStatisticsCache[t].values))if(this._viewDataStatistics&&(!this._viewDataFilter||this._viewDataFilter.transformsArr.length<=1)&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t]))this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t];else if(this._rawData){const i=null===(s=this._rawData.getFields())||void 0===s?void 0:s[t];if(i&&i.lockStatisticsByDomain&&i.domain)this._rawStatisticsCache[t]={},e?(this._rawStatisticsCache[t].min=Fa(i.domain),this._rawStatisticsCache[t].max=Ba(i.domain)):this._rawStatisticsCache[t].values=i.domain;else{const i=UT(this._rawData.latestData,[{key:t,operations:e?["min","max"]:["values"]}])[t];this._rawStatisticsCache[t]=E(null!==(n=this._rawStatisticsCache[t])&&void 0!==n?n:{},i)}}return this._rawStatisticsCache[t]}_statisticViewData(){Ap(this._dataSet,"dimensionStatistics",GT);const t=`${this.type}_${this.id}_viewDataStatic`;this._viewDataStatistics=new R(this._dataSet,{name:t}),this._viewDataStatistics.parse([this._data.getDataView()],{type:"dataview"}),this._viewDataStatistics.transform({type:"dimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&DT(t,[{key:this._seriesField,operations:["values"]}]),t},target:"latest"}},!1),this._data.getDataView().target.removeListener("change",this._viewDataStatistics.reRunAllTransform),this.getStack()&&this.createdStackData()}createStatisticalData(t,e,i){Ap(this._dataSet,"dimensionStatistics",GT);const s=new R(this._dataSet,{name:t});return s.parse([e],{type:"dataview"}),s.transform({type:"dimensionStatistics",options:{operations:["max","min","values"],fields:()=>{var t;const s=DT(this.getStatisticFields(),null!==(t=null==i?void 0:i(e.name))&&void 0!==t?t:[]);return this._seriesField&&DT(s,[{key:this._seriesField,operations:["values"]}]),s},target:"latest"}},!1),s}createdStackData(){const t=`${this.type}_${this.id}_viewStackData`;this._viewStackData=new R(this._dataSet,{name:t}),this._viewStackData.parse([this._viewDataFilter],{type:"dataview"}),this._viewStackData.transform({type:"stackSplit",options:{fields:this.getStackGroupFields()}},!1)}_noAnimationDataKey(t,e){return e}generateDefaultDataKey(t){var e;return P(t)?(t,e,i)=>{if(!1===this._spec.animation){const i=this._noAnimationDataKey(t,e);if(void 0!==i)return i}const{keyMap:s}=i,n=this._getSeriesDataKey(t);return void 0===s.get(n)?(s.set(n,0),n):(s.set(n,s.get(n)+1),`${n}_${s.get(n)}`)}:S(t)?e=>e[t]:y(t)&&t.every((t=>S(t)))?e=>t.map((t=>e[t])).join("-"):rs(t)?(e,i)=>t(e,i):(null===(e=this._option)||void 0===e||e.onError(`invalid dataKey: ${t}`),(t,e)=>{})}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Ap(this._rawData.dataSet,"addVChartProperty",zT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:JT.bind(this),call:QT}},!1))}updateRawData(t){this._rawData&&this._rawData.updateRawData(t)}rawDataUpdate(t){var e;null===(e=this._rawDataStatistics)||void 0===e||e.reRunAllTransform(),this._rawStatisticsCache=null,this.event.emit(jd.rawDataUpdate,{model:this})}viewDataFilterOver(t){this.event.emit(jd.viewDataFilterOver,{model:this})}viewDataUpdate(t){var e;this.event.emit(jd.viewDataUpdate,{model:this}),null===(e=this._data)||void 0===e||e.updateData(),this._viewDataStatistics&&this._viewDataStatistics.reRunAllTransform()}viewDataStatisticsUpdate(t){this.event.emit(jd.viewDataStatisticsUpdate,{model:this})}getDatumPositionValue(t,e){return!t||P(e)?null:t[e]}getDatumPositionValues(t,e){return!t||P(e)?[]:S(e)?[t[e]]:e.map((e=>t[e]))}setValueFieldToStack(){}setValueFieldToPercent(){}setValueFieldToStackOffsetSilhouette(){}initRootMark(){var t,e;this._rootMark=this._createMark({type:"group",name:`seriesGroup_${this.type}_${this.id}`},{parent:null===(e=(t=this._region).getGroupMark)||void 0===e?void 0:e.call(t),dataView:!1}),this._rootMark.setZIndex(this.layoutZIndex)}_getExtensionMarkNamePrefix(){return`${this.type}_${this.id}_extensionMark`}_initExtensionMark(t){var e;if(!this._spec.extensionMark)return;const i=this.getMarksWithoutRoot();t.depend=i,null===(e=this._spec.extensionMark)||void 0===e||e.forEach(((e,i)=>{this._createExtensionMark(e,null,this._getExtensionMarkNamePrefix(),i,t)}))}_createExtensionMark(t,e,i,s,n){var r;const a=this._createMark({type:t.type,name:`${i}_${s}`},{skipBeforeLayouted:!0,markSpec:t,parent:e,dataView:!1,customShape:null==t?void 0:t.customShape,componentType:t.componentType,depend:n.depend,key:t.dataKey});if(a){if(n.hasAnimation){const e=TL({},CL(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if("group"===t.type)i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}));else if(!(e||P(t.dataId)&&P(t.dataIndex))){const e=this._option.getSeriesData(t.dataId,t.dataIndex);e===this._rawData?a.setDataView(this.getViewData(),this.getViewDataProductId()):(a.setDataView(e),e.target.addListener("change",(()=>{a.getData().updateData()})))}}}_updateExtensionMarkSpec(){var t;null===(t=this._spec.extensionMark)||void 0===t||t.forEach(((t,e)=>{const i=this._marks.getMarkWithInfo({name:`${this._getExtensionMarkNamePrefix()}_${e}`});i&&(this.initMarkStyleWithSpec(i,t),i.updateStaticEncode(),i.updateLayoutState())}))}getStackData(){var t;return null===(t=this._viewStackData)||void 0===t?void 0:t.latestData}_parseSelectorOfInteraction(t,e){if(!e||!e.length)return[];const i=[];return t.markIds?e.filter((e=>{t.markIds.includes(e.getProductId())&&i.push(`#${e.getProductId()}`)})):t.markNames?e.forEach((e=>{t.markNames.includes(e.name)&&i.push(`#${e.getProductId()}`)})):e.forEach((t=>{i.push(`#${t.getProductId()}`)})),i}_parseDefaultInteractionConfig(t){if(!(null==t?void 0:t.length))return[];const e=(i=this._option.mode)===n["desktop-browser"]||i===n["desktop-miniApp"]?{hover:{enable:!0,trigger:"pointermove",triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"pointertap"}}:cl(i)||ul(i)?{hover:{enable:!0,trigger:["pointerdown","pointermove"],triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"tap"}}:null;var i;let s=Object.assign({},null==e?void 0:e.hover),r=Object.assign({},null==e?void 0:e.select);const a=this._spec.hover;v(a)?s.enable=a:ns(a)&&(s.enable=!0,s=Tl(s,a));const o=this._spec.select;v(o)?r.enable=o:ns(o)&&(r.enable=!0,r=Tl(r,o));const l=[];if(s.enable){const e=this._parseSelectorOfInteraction(s,t);e.length&&l.push({seriesId:this.id,regionId:this._region.id,selector:e,type:"element-highlight",trigger:s.trigger,triggerOff:s.triggerOff,blurState:vy.STATE_HOVER_REVERSE,highlightState:vy.STATE_HOVER})}if(r.enable){const e=this._parseSelectorOfInteraction(r,t),i="multiple"===r.mode,s=M(r.triggerOff)?r.triggerOff:i?["empty"]:["empty",r.trigger];e.length&&l.push({type:"element-select",seriesId:this.id,regionId:this._region.id,selector:e,trigger:r.trigger,triggerOff:s,reverseState:vy.STATE_SELECTED_REVERSE,state:vy.STATE_SELECTED,isMultiple:i})}return l}_parseInteractionConfig(t){const e=this.getCompiler();if(!e)return;const{interactions:i}=this._spec,s=this._parseDefaultInteractionConfig(t);s&&s.length&&s.forEach((t=>{e.addInteraction(t)})),i&&i.length&&i.forEach((t=>{const i=this._parseSelectorOfInteraction(t,this.getMarks());i.length&&e.addInteraction(Object.assign(Object.assign({},t),{selector:i,seriesId:this.id,regionId:this._region.id}))}))}initInteraction(){const t=this.getMarksWithoutRoot();this._parseInteractionConfig(t)}initAnimation(){}initMarkState(){this.initSeriesStyleState()}initSeriesStyleState(){var t;const e=this._spec.seriesStyle;if(!e||!e.length)return;const i=null!==(t=this._seriesField)&&void 0!==t?t:fT;this.getMarksWithoutRoot().forEach((t=>{const s={},n={},r={};e.forEach((e=>{var i;const a=null===(i=e[t.name])||void 0===i?void 0:i.style;a&&(s[e.name]=!0,r[e.name]=r[e.name]||{},Object.keys(a).forEach((t=>{n[t]=!0,r[e.name][t]=a[t]})))})),t.state.addStateInfo({stateValue:vT,level:-1,filter:t=>Array.isArray(t)?0!==t.length&&!0===s[t[0][i]]:!0===s[t[i]]});const a={};Object.keys(n).forEach((e=>{a[e]=s=>{var n,a;let o;if(Array.isArray(s)){if(0===s.length)return;o=null===(n=r[s[0][i]])||void 0===n?void 0:n[e]}return o=null===(a=r[s[i]])||void 0===a?void 0:a[e],M(o)?o:t.getAttribute(e,s)}})),this.setMarkStyle(t,a,vT,Ly.User_SeriesStyle)}))}afterInitMark(){this.event.emit(jd.afterInitMark,{model:this}),this.setSeriesField(this._spec.seriesField),this.getMarks().forEach((t=>{var e,i;(null===(i=null===(e=t.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&t.setAttribute("stroke",this.getColorAttribute(),"normal",Ly.Base_Series)}))}getMarksWithoutRoot(){return this.getMarks().filter((t=>!t.name.includes("seriesGroup")))}getMarksInType(t){return this._marks.getMarksInType(t)}getMarkInName(t){return this._marks.get(t)}getMarkInId(t){return this.getMarks().find((e=>e.id===t))}initEvent(){var t,e,i;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.target.addListener("change",this.viewDataUpdate.bind(this)),null===(i=this._viewDataStatistics)||void 0===i||i.target.addListener("change",this.viewDataStatisticsUpdate.bind(this))}_releaseEvent(){super._releaseEvent(),this.getCompiler().removeInteraction(this.id)}initTooltip(){this._tooltipHelper=new VT(this)}_compareSpec(t,e,i){var s,n;const r=super._compareSpec(t,e),a=Object.keys(e||{}).sort();return Dm(a,Object.keys(t||{}).sort())?((i=Object.assign(Object.assign(Object.assign({},oC),lC),i)).invalidType=!0,t.invalidType!==e.invalidType&&(r.reCompile=!0),i.extensionMark=!0,(Ra(t.extensionMark).length!==Ra(e.extensionMark).length||(null===(s=e.extensionMark)||void 0===s?void 0:s.some(((e,i)=>e.type!==t.extensionMark[i].type||e.id!==t.extensionMark[i].id))))&&(r.reMake=!0),r.reMake?r:((null===(n=e.extensionMark)||void 0===n?void 0:n.some(((e,i)=>e.visible!==t.extensionMark[i].visible)))&&(r.reCompile=!0),this._marks.getMarks().some((s=>{var n,r;return i[s.name]=!0,(null===(n=e[s.name])||void 0===n?void 0:n.visible)!==(null===(r=t[s.name])||void 0===r?void 0:r.visible)}))&&(r.reCompile=!0),a.some((i=>lC[i]&&!Dm(t[i],e[i])))&&(r.reCompile=!0),a.some((s=>!i[s]&&!Dm(t[s],e[s])))?(r.reMake=!0,r):r)):(r.reMake=!0,r)}_updateSpecData(){!this._rawData||!this._spec.data||this._spec.data instanceof R||Bp(this._rawData,this._spec.data,!0)}reInit(t){super.reInit(t);const e=this.getMarksWithoutRoot();e.forEach((t=>{this._spec[t.name]&&this.initMarkStyleWithSpec(t,this._spec[t.name])})),this.initMarkStyle(),e.forEach((t=>{t.updateStaticEncode(),t.updateLayoutState(!0)})),this._updateExtensionMarkSpec(),this._updateSpecData(),this._tooltipHelper&&this._tooltipHelper.updateTooltipSpec(),RL(this)&&this.initAnimation()}onEvaluateEnd(t){this._data.updateData()}onRender(t){}release(){var t,e,i;super.release(),this._viewDataMap.clear();const s=null===(e=null===(t=this._rawData)||void 0===t?void 0:t.transformsArr)||void 0===e?void 0:e.findIndex((t=>"addVChartProperty"===t.type));s>=0&&this._rawData.transformsArr.splice(s,1),null===(i=this._data)||void 0===i||i.release(),this._dataSet=this._data=this._rawData=this._rawDataStatistics=this._spec=this._region=this._viewDataStatistics=this._viewStackData=null}setLayoutStartPosition(t){Wo(t.x)&&(this._layoutStartPoint.x=t.x),Wo(t.y)&&(this._layoutStartPoint.y=t.y)}setLayoutRect({width:t,height:e},i){Wo(t)&&(this._layoutRect.width=t),Wo(e)&&(this._layoutRect.height=e)}getSeriesKeys(){var t,e;return this._seriesField?null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}getSeriesStyle(t){return e=>{var i,s;return null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0}}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesInfoInField(t){var e,i;return this._getSeriesInfo(t,null!==(i=null===(e=this.getRawDataStatisticsByField(t))||void 0===e?void 0:e.values)&&void 0!==i?i:[])}getSeriesInfoList(){var t;return this._getSeriesInfo(null!==(t=this._seriesField)&&void 0!==t?t:fT,this.getSeriesKeys())}_getDefaultColorScale(){var t,e;const i=this.getDefaultColorDomain(),s=this._getDataScheme();return null===(e=(t=(new tx).domain(i)).range)||void 0===e?void 0:e.call(t,s)}_getDataScheme(){return xl(this.getColorScheme(),this.type)}getDefaultColorDomain(){var t,e;return this._seriesField?null===(e=null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesField])||void 0===e?void 0:e.values:[]}getColorAttribute(){var t,e;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(e=this._seriesField)&&void 0!==e?e:fT}}getDimensionField(){return[]}getMeasureField(){return[]}onMarkPositionUpdate(){this.onMarkTreePositionUpdate(this.getMarksWithoutRoot())}onMarkTreePositionUpdate(t){}_createMark(t,e={}){var i,s,n,r;const{key:a,groupKey:o,skipBeforeLayouted:l,themeSpec:h={},markSpec:d,dataView:c,dataProductId:u,parent:p,isSeriesMark:g,depend:m,progressive:_,support3d:f=this._spec.support3d||!!this._spec.zField,morph:y=!1,clip:b,customShape:x,stateSort:S,noSeparateStyle:k=!1}=e,A=super._createMark(t,{key:null!=a?a:this._getDataIdKey(),support3d:f,seriesId:this.id,attributeContext:this._markAttributeContext,componentType:e.componentType,noSeparateStyle:k});if(M(A)){this._marks.addMark(A,{name:t.name}),g&&(this._seriesMark=A),P(p)?null===(i=this._rootMark)||void 0===i||i.addMark(A):!1!==p&&p.addMark(A),P(c)?(A.setDataView(this.getViewData(),this.getViewDataProductId()),A.setSkipBeforeLayouted(!0)):!1!==c&&A.setDataView(c,u),v(l)&&A.setSkipBeforeLayouted(l),M(m)&&A.setDepend(...Ra(m));const a=this.getSpec()||{};A.setMorph(y),A.setMorphKey((null===(s=a.morph)||void 0===s?void 0:s.morphKey)||`${this.getSpecIndex()}_${this.getMarks().length}`),A.setMorphElementKey(null!==(r=null===(n=a.morph)||void 0===n?void 0:n.morphElementKey)&&void 0!==r?r:e.defaultMorphElementKey),P(_)||A.setProgressiveConfig(_),P(o)||A.setGroupKey(o),x&&A.setCustomizedShapeCallback(x),S&&A.setStateSortCallback(S),b&&A.setClip(b),this.initMarkStyleWithSpec(A,Tl({},h,d||a[A.name]))}return A}_getDataIdKey(){var t;return null!==(t=super._getDataIdKey())&&void 0!==t?t:_T}_getSeriesDataKey(t){let e="";if(!t)return e;const i=this.getDimensionField();e=i.map((e=>t[e])).join("_");const s=this.getSeriesField();return s&&!i.includes(s)&&(e+=`_${t[s]}`),e}addViewDataFilter(t){var e,i;null===(i=null!==(e=this._viewDataFilter)&&void 0!==e?e:this.getViewData())||void 0===i||i.transform(t,!1)}reFilterViewData(){var t,e;null===(e=null!==(t=this._viewDataFilter)&&void 0!==t?t:this.getViewData())||void 0===e||e.reRunAllTransform()}reTransformViewData(){var t,e;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}fillData(){var t;null===(t=this.getRawData())||void 0===t||t.reRunAllTransform()}compile(){this.compileData()}getDefaultShapeType(){return"circle"}getFieldAlias(t){var e;return t!==xT&&t!==MT&&t!==bT&&t!==ST||(t=this.getStackValueField()),null!==(e=RT(this.getRawData(),t))&&void 0!==e?e:t}_getInvalidConnectType(){return"zero"===this._invalidType?"zero":"link"===this._invalidType?"connect":"none"}_getInvalidDefined(t){const e=this.getInvalidCheckFields();return!e.length||e.every((e=>Zo(t[e])))}_getRelatedComponentSpecInfo(t){var e;const i=this.getSpecIndex(),s=null===(e=this._option.getSpecInfo().component[t])||void 0===e?void 0:e.filter((t=>t.seriesIndexes.includes(i)));return null!=s?s:[]}_forEachStackGroup(t,e){var i,s;(e=null!=e?e:null===(i=this._viewStackData)||void 0===i?void 0:i.latestData)&&((null===(s=e.values)||void 0===s?void 0:s.length)?t(e):e.nodes&&Object.values(e.nodes).forEach((e=>{this._forEachStackGroup(t,e)})))}isDatumInViewData(t){if(!t)return!1;const e=this.getViewData().latestData;return!!e&&(!!e.includes(t)||e.some((e=>Object.keys(t).every((i=>t[i]===e[i])))))}getSeriesFieldValue(t,e){var i;return t[null!==(i=null!=e?e:this.getSeriesField())&&void 0!==i?i:fT]}}function FL(t,e,i){const s=t.getScale(0),n="isInverse"in t&&t.isInverse();Jh(s.type)?i.sort(((t,i)=>(t[e]-i[e])*(n?-1:1))):i.sort(((t,i)=>(s.index(t[e])-s.index(i[e]))*(n?-1:1)))}function YL(t){return{dataIndex:e=>{var i,s;const n="horizontal"===t.direction?t.fieldY[0]:t.fieldX[0],r=null==e?void 0:e[n],a="horizontal"===t.direction?t.scaleY:t.scaleX;return(null!==(s=null===(i=null==a?void 0:a.domain)||void 0===i?void 0:i.call(a))&&void 0!==s?s:[]).indexOf(r)||0},dataCount:()=>{var e,i,s;const n="horizontal"===t.direction?t.scaleY:t.scaleX;return null!==(s=(null!==(i=null===(e=null==n?void 0:n.domain)||void 0===e?void 0:e.call(n))&&void 0!==i?i:[]).length)&&void 0!==s?s:0}}}BL.mark=iC,BL.transformerConstructor=IL;class jL extends BL{constructor(){super(...arguments),this.coordinate="cartesian",this._bandPosition=.5,this._scaleConfig={bandPosition:this._bandPosition},this._direction="vertical",this._sortDataByAxis=!1,this._getPositionXEncoder=()=>{var t;return null===(t=this._positionXEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionXEncoder=t=>{this._positionXEncoder=t.bind(this)},this._getPositionYEncoder=()=>{var t;return null===(t=this._positionYEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionYEncoder=t=>{this._positionYEncoder=t.bind(this)}}_buildScaleConfig(){this._scaleConfig={bandPosition:this._bandPosition}}get fieldX(){return this._fieldX}setFieldX(t){this._fieldX=Ra(t)}get fieldY(){return this._fieldY}setFieldY(t){this._fieldY=Ra(t)}get fieldZ(){return this._fieldZ}setFieldZ(t){this._fieldZ=t&&Ra(t)}get fieldX2(){return this._fieldX2}setFieldX2(t){this._fieldX2=t}get fieldY2(){return this._fieldY2}setFieldY2(t){this._fieldY2=t}get direction(){return this._direction}get scaleX(){return this._scaleX}setScaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}setScaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}setScaleZ(t){this._scaleZ=t}getXAxisHelper(){return this._xAxisHelper}setXAxisHelper(t){this._xAxisHelper=t,this.onXAxisHelperUpdate()}getYAxisHelper(){return this._yAxisHelper}setYAxisHelper(t){this._yAxisHelper=t,this.onYAxisHelperUpdate()}getZAxisHelper(){return this._zAxisHelper}setZAxisHelper(t){this._zAxisHelper=t,this.onYAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}getStatisticFields(){const t=[];return[{axisHelper:this.getXAxisHelper(),fields:this._fieldX2?[...this._fieldX,this._fieldX2]:this._fieldX},{axisHelper:this.getYAxisHelper(),fields:this._fieldY2?[...this._fieldY,this._fieldY2]:this._fieldY},{axisHelper:this.getZAxisHelper(),fields:this._fieldZ}].forEach((e=>{e.axisHelper&&e.axisHelper.getScale&&e.fields&&e.fields.forEach((i=>{const s={key:i,operations:[]},n=e.axisHelper.getScale(0);Jh(n.type)?(s.operations=["max","min"],"log"===n.type&&(s.filter=t=>t>0)):s.operations=["values"],t.push(s)}))})),this.getStack()&&t.push({key:this.getStackValueField(),operations:["allValid"]}),t}getGroupFields(){return"vertical"===this.direction?this._fieldX:this._fieldY}getStackGroupFields(){return this.getGroupFields()}getStackValue(){var t,e;const i=null===(t="horizontal"===this.direction?this.getXAxisHelper():this.getYAxisHelper())||void 0===t?void 0:t.getAxisId();return null!==(e=this._spec.stackValue)&&void 0!==e?e:`${sh}_series_${this.type}_${i}`}getStackValueField(){return"horizontal"===this.direction?Ra(this._spec.xField)[0]:Ra(this._spec.yField)[0]}setValueFieldToStack(){"horizontal"===this.direction?(this.setFieldX(xT),this.setFieldX2(bT)):(this.setFieldY(xT),this.setFieldY2(bT))}setValueFieldToPercent(){"horizontal"===this.direction?(this.setFieldX(MT),this.setFieldX2(ST)):(this.setFieldY(MT),this.setFieldY2(ST))}setValueFieldToStackOffsetSilhouette(){"horizontal"===this.direction?(this.setFieldX(AT),this.setFieldX2(kT)):(this.setFieldY(AT),this.setFieldY2(kT))}onXAxisHelperUpdate(){this.onMarkPositionUpdate()}onYAxisHelperUpdate(){this.onMarkPositionUpdate()}onZAxisHelperUpdate(){this.onMarkPositionUpdate()}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setFieldX(this._spec.xField),this.setFieldY(this._spec.yField),this.setFieldZ(this._spec.zField),this._specXField=Ra(this._spec.xField),this._specYField=Ra(this._spec.yField),M(this._spec.direction)&&(this._direction=this._spec.direction),this.setFieldX2(null===(t=this._spec)||void 0===t?void 0:t.x2Field),this.setFieldY2(null===(e=this._spec)||void 0===e?void 0:e.y2Field),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent(),this.getStackOffsetSilhouette()&&this.setValueFieldToStackOffsetSilhouette(),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}dataToPosition(t,e){return t?e&&!this.isDatumInViewData(t)?null:{x:this.dataToPositionX(t),y:this.dataToPositionY(t)}:null}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToX=this.valueToPositionX.bind(this),this._markAttributeContext.valueToY=this.valueToPositionY.bind(this),this._markAttributeContext.xBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getXAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.yBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getYAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this)}valueToPosition(t,e){return{x:this.valueToPositionX(t),y:this.valueToPositionY(e)}}_axisPosition(t,e,i){return this._scaleConfig.datum=i,t.isContinuous?t.valueToPosition(e,this._scaleConfig):t.dataToPosition(Ra(e),this._scaleConfig)}valueToPositionX(t,e){return this._axisPosition(this._xAxisHelper,t,e)}valueToPositionY(t,e){return this._axisPosition(this._yAxisHelper,t,e)}_dataToPosition(t,e,i,s,n,r){const a=n();if(a)return a(t);if(!e)return r((t=>Number.NaN)),Number.NaN;const o=(e.getFields?e.getFields():i).slice(0,s);return o&&0!==o.length?(e.isContinuous?r((t=>(this._scaleConfig.datum=t,e.valueToPosition(this.getDatumPositionValue(t,o[0]),this._scaleConfig)))):r((t=>(this._scaleConfig.datum=t,e.dataToPosition(Ra(this.getDatumPositionValues(t,o)),this._scaleConfig)))),n()(t)):(r((t=>null)),null)}dataToPositionX(t){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,void 0,this._getPositionXEncoder,this._setPositionXEncoder)}dataToPositionY(t){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,void 0,this._getPositionYEncoder,this._setPositionYEncoder)}dataToPositionZ(t){if(!this._zAxisHelper)return Number.NaN;const{dataToPosition:e}=this._zAxisHelper;return e(this.getDatumPositionValues(t,this._fieldZ),{bandPosition:this._bandPosition})}dataToPositionX1(t){return this._xAxisHelper?this._fieldX2&&this._fieldX2 in t?this.valueToPositionX(this.getDatumPositionValues(t,this._fieldX2)):this.valueToPositionX(0):Number.NaN}dataToPositionY1(t){return this._yAxisHelper?this._fieldY2&&this._fieldY2 in t?this.valueToPositionY(this.getDatumPositionValues(t,this._fieldY2)):this.valueToPositionY(0):Number.NaN}positionToData(t){return t?{x:this.positionToDataX(t.x),y:this.positionToDataY(t.y)}:null}positionToDataX(t){return this._scaleX?this._scaleX.invert(t):null}positionToDataY(t){return this._scaleY?this._scaleY.invert(t):null}getRegionRectLeft(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[0]}getRegionRectRight(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[1]}afterInitMark(){super.afterInitMark(),this.setFieldX(this._fieldX),this.setFieldY(this._fieldY),this._buildScaleConfig()}getDimensionField(){return"horizontal"===this._direction?this._specYField:this._specXField}getDimensionContinuousField(){return"horizontal"===this._direction?[this.fieldY[0],this.fieldY2]:[this.fieldX[0],this.fieldX2]}getMeasureField(){return"horizontal"===this._direction?this._specXField:this._specYField}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(jd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e,i;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&(FL("horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,"horizontal"===this._direction?this._fieldY[0]:this._fieldX[0],this.getViewData().latestData),null===(i=this._data)||void 0===i||i.updateData(!0))}getInvalidCheckFields(){const t=[];return this._xAxisHelper&&this._xAxisHelper.isContinuous&&this._xAxisHelper.getAxisType()!==r.geoCoordinate&&(this._xAxisHelper.getFields?this._xAxisHelper.getFields():this._specXField).forEach((e=>{t.push(e)})),this._yAxisHelper&&this._yAxisHelper.isContinuous&&this._yAxisHelper.getAxisType()!==r.geoCoordinate&&(this._yAxisHelper.getFields?this._yAxisHelper.getFields():this._specYField).forEach((e=>{t.push(e)})),t}reInit(t){this._positionXEncoder&&(this._positionXEncoder=null),this._positionYEncoder&&(this._positionYEncoder=null),super.reInit(t)}}const HL="monotone",zL="linear",NL={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}};class VL{addSamplingCompile(){if(this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}addOverlapCompile(){var t;if(this._spec.markOverlap){const e=[];e.push({type:"markoverlap",direction:"horizontal"===this._direction&&"cartesian"===this.coordinate?2:1,delta:this._spec.pointDis,deltaMul:this._spec.pointDisMul,groupBy:this._seriesField}),null===(t=this._symbolMark)||void 0===t||t.getProduct().transform(e)}}reCompileSampling(){this._spec.sampling&&this.compile()}initLineMark(t,e){var i,s;return this._lineMark=this._createMark(NL.line,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:null==e||e,progressive:t,customShape:null===(i=this._spec.line)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.line)||void 0===s?void 0:s.stateSort}),this._lineMark}initLineMarkStyle(t,e){var i,s;const n=this._lineMark;if(n){if(this.setMarkStyle(n,{stroke:this.getColorAttribute()},"normal",Ly.Series),"zero"!==this._invalidType&&this.setMarkStyle(n,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Ly.Series),this.event.on(jd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(n,"defined")})),"polar"===this.coordinate)this.setMarkStyle(n,{lineJoin:"bevel",curveType:zL,closePath:!0},"normal",Ly.Series);else{const r=null!=e?e:null===(s=null===(i=this.getSpec().line)||void 0===i?void 0:i.style)||void 0===s?void 0:s.curveType,a=r===HL?"horizontal"===t?"monotoneY":"monotoneX":r;this.setMarkStyle(n,{curveType:a},"normal",Ly.Built_In)}this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Ly.Series)}return n}_getEventElement(t,e=!1){let i=[];return t.dimensionInfo.some((t=>(t.data.some((t=>t.series===this&&(i=t.datum,!0))),!i.length))),i}_dimensionTrigger(t){const e=this._getEventElement(t);switch(t.action){case"enter":this._symbolActiveMark.getDataView().parse(e),this._symbolActiveMark.getData().updateData(!1);break;case"leave":this._symbolActiveMark.getDataView().parse([]),this._symbolActiveMark.getData().updateData(!1)}}initSymbolMark(t,e){const i=this._spec.point||{};if(!1!==i.visible&&(this._symbolMark=this._createMark(NL.point,{morph:PL(this._spec,NL.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:t,isSeriesMark:!!e,customShape:i.customShape,stateSort:i.stateSort})),!0===this._spec.activePoint){const t=new R(this._option.dataSet,{name:`${sh}_series_${this.id}_active_point`});t.parse([]),this._symbolActiveMark=this._createMark({name:`active_point_${this.id}`,type:"symbol"},{morph:!1,groupKey:this._seriesField,isSeriesMark:!1,dataView:t,parent:this._region.getInteractionMark(),customShape:i.customShape,stateSort:i.stateSort}),this._symbolActiveMark.setVisible(!1)}return this._symbolMark}initSymbolMarkStyle(){const t=this._symbolMark;if(!t)return this._initSymbolActiveMarkAlone(),t;if(this._initSymbolMark(t),this._symbolActiveMark&&this._symbolMark.stateStyle.dimension_hover){this._symbolActiveMark.setVisible(!0),this.event.on(Kh.dimensionHover,this._dimensionTrigger.bind(this));for(const e in this._symbolMark.stateStyle){this._symbolActiveMark.stateStyle[e]={};for(const i in this._symbolMark.stateStyle[e])this._symbolActiveMark.stateStyle[e][i]={style:null,level:Ly.Series,referer:t}}this._symbolActiveMark.state.changeStateInfo({stateValue:vy.STATE_DIMENSION_HOVER,filter:()=>!0})}return t}_initSymbolMark(t){t&&(this.setMarkStyle(t,{fill:this.getColorAttribute()},"normal",Ly.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Ly.Series),this.event.on(jd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Ly.Series))}_initSymbolActiveMarkAlone(){var t,e;const i=this._symbolActiveMark;i&&(this._initSymbolMark(i),i&&(null===(e=null===(t=this._spec[NL.point.name])||void 0===t?void 0:t.state)||void 0===e?void 0:e.dimension_hover)&&(i.setVisible(!0),this.event.on(Kh.dimensionHover,this._dimensionTrigger.bind(this)),this.initMarkStyleWithSpec(i,Tl({},this._spec[NL.point.name],{visible:!0})),this._symbolActiveMark.state.changeStateInfo({stateValue:vy.STATE_DIMENSION_HOVER,filter:()=>!0})))}initLabelMarkStyle(t){var e;t&&("symbol"!==(null===(e=t.getTarget())||void 0===e?void 0:e.type)&&t.setRule("line-data"),this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null}),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Ly.Series),this.event.on(jd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})))}initLineLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getSeriesField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}encodeDefined(t,e){var i,s,n,r;if(!t)return;const a=this._isFieldAllValid();if("zero"===this._invalidType||a){if(!0===(null===(s=null===(i=t.stateStyle.normal)||void 0===i?void 0:i[e])||void 0===s?void 0:s.style))return;this.setMarkStyle(t,{[e]:!0},"normal",Ly.Series)}else{if(!0!==(null===(r=null===(n=t.stateStyle.normal)||void 0===n?void 0:n[e])||void 0===r?void 0:r.style))return;this.setMarkStyle(t,{[e]:this._getInvalidDefined.bind(this)},"normal",Ly.Series)}t.getProduct()&&t.compileEncode()}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.getStackValueField();return!!(t&&t.latestData&&e)&&t.latestData[e]&&t.latestData[e].allValid}}const WL=Object.assign(Object.assign({},iC),NL);class GL extends mx{setStyle(t,e="normal",i=0,s=this.stateStyle){if(P(t))return;void 0===s[e]&&(s[e]={});const n=this._getIgnoreAttributes(),r=["strokeWidth","lineWidth","lineDash","strokeDash","lineJoin","stroke","strokeOpacity","opacity","fill","fillOpacity","texture","texturePadding","textureSize","textureColor"],a=this.isUserLevel(i);let o=!1;Object.keys(t).forEach((l=>{const h=t[l];if(P(h)||n.includes(l))return;a&&r.includes(l)&&(Qh(null==h?void 0:h.type)||(null==h?void 0:h.scale)||rs(h))&&(o=!0);const d=this._filterAttribute(l,h,e,i,a,s);this.setAttribute(l,d,e,i,s)})),o&&this.setEnableSegments(o)}}class UL extends GL{constructor(){super(...arguments),this.type=UL.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:1})}_getIgnoreAttributes(){var t,e;return(null===(t=this.model)||void 0===t?void 0:t.type)===_l.radar&&"polar"===(null===(e=this.model)||void 0===e?void 0:e.coordinate)?[]:["fill","fillOpacity"]}}UL.type="line";const $L=()=>{$l.registerMark(UL.type,UL),yx(),aM(),OA(),IA(),pc.registerGraphic(Xd.line,XS),kL()};class KL extends mx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{size:1,symbolType:"circle",fill:void 0,lineWidth:0})}}class XL extends KL{constructor(){super(...arguments),this.type=XL.type}}XL.type="symbol";const qL=()=>{$l.registerMark(XL.type,XL),zA()},ZL=(t,e,i)=>e.filter((e=>t.callback(e,i))),JL=(t,e,i)=>{const s=t.callback,n=t.as;if(!t.all)return e.forEach((t=>{const e=s(t,i);if(!P(n)){if(P(t))return;t[n]=e}return e})),e;const r=s(e,i);return P(n)||P(e)?r:(e[n]=r,e)};function QL(t){return t.reduce(((t,e)=>t+e),0)}const tE={min:Fa,max:Ba,average:function(t){return 0===t.length?0:QL(t)/t.length},sum:QL};function eE(t,e,i,s){const n=Math.floor(e.length/t),r=[],a=e.length;let o,l,h,d=0,c=0;r[c++]=d;for(let t=1;to&&(o=l,h=t))}r[c++]=h,d=h}return r[c-1]!==a-1&&(r[c++]=a-1),r.map((t=>i?e[t].i:t))}function iE(t,e,i,s,n){let r=Math.floor(e.length/t);const a=[],o=e.length;let l=0,h=[];a.push(l),e[l][n]=e[l][n];for(let t=1;to-t&&(r=o-t,h.length=r),h=[];for(let i=0;ii?e[t].i:t))}function sE(t,e,i,s){return iE(t,e,i,"min",s)}function nE(t,e,i,s){return iE(t,e,i,"max",s)}function rE(t,e,i,s){return iE(t,e,i,"average",s)}function aE(t,e,i,s){return iE(t,e,i,"sum",s)}const oE=(t,e)=>{let i=t.size;const s=t.factor||1;if(Array.isArray(i)&&(i=Math.floor(i[1]-i[0])),i*=s,i<=0)return[];if(e.length<=i)return e;if(t.skipfirst)return e.slice(0,1);const{mode:n,yfield:r,groupBy:a}=t,o=null!=r?r:"y";let l=eE;if("min"===n?l=sE:"max"===n?l=nE:"average"===n?l=rE:"sum"===n&&(l=aE),e.length){const t={};if(a){for(let i=0,s=e.length;i{const r=t[n];if(r.length<=i){const t=r.map((t=>t.i));s=s.concat(t)}else{const t=l(i,r,!0,o);s=s.concat(t),r.forEach((t=>e[t.i][o]=t[o]))}})),s.sort(((t,e)=>t-e)),s.map((t=>e[t]))}return l(i,e,!1,o).map((t=>e[t]))}return[]},lE=(t,e)=>{if(!e||0===e.length)return;let{radius:i}=t;P(i)&&"symbol"===e[0].mark.markType&&(i=!0);const{direction:s,delta:n,deltaMul:r=1,groupBy:a}=t,o=e=>{!function(t){t.forEach((t=>{t.getGraphicAttribute(Cg)&&(t.setGraphicAttribute("visible",!0),t.setGraphicAttribute(Cg,!1))}))}(e);const a=t.sort?e.slice().sort(((t,e)=>t.getGraphicAttribute("x")-e.getGraphicAttribute("x"))):e;0===s?function(t,e,i,s){if(s){const s=-1/0;let n=-1/0,r=0,a=0;const o=P(e);let l=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,h=t.getGraphicAttribute("x"),d=t.getGraphicAttribute("y");o&&(l=(e+r)*i),a=(s-h)**2+(n-d)**2,a<(l+r+e)**2?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(Cg,!0),t.setGraphicAttribute("visible",!1)):n=d,r=e}))}}(a,n,r,i):1===s?function(t,e,i,s){if(s){let s=-1/0,n=0;const r=P(e);let a=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("x");r&&(a=(e+n)*i),Math.abs(o-s){if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("y");r&&(a=(e+n)*i),Math.abs(o-s){const i=e.getDatum()[a];return t[i]?t[i].push(e):t[i]=[e],t}),{});Object.keys(t).forEach((e=>{o(t[e])}))}else o(e);return e},hE=()=>{pc.registerTransform("sampling",{transform:oE,markPhase:"afterEncode"},!0)},dE=()=>{pc.registerTransform("markoverlap",{transform:lE,markPhase:"afterEncode"},!0)};class cE extends IL{_transformLabelSpec(t){var e,i,s;!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)?this._addMarkLabelSpec(t,"point"):this._addMarkLabelSpec(t,"line"),this._addMarkLabelSpec(t,"line","lineLabel","initLineLabelMarkStyle",void 0,!0)}}function uE(t,e,i){let s=!1;if(e&&rs(e))for(const n of t)for(const t of n.getSeries(i))if(s=!!e.call(null,t),s)return s;return s}function pE(t,e){const i=[];for(const s of t)for(const t of s.getSeries(e))i.push(t);return i}const gE=(t,e)=>{for(let i=0;i=t[0]}function _E(t,e){const i=e[1]-e[0],s=e[1]*e[0]<0;let n=e[0]<=0?0-e[0]:0,r=e[1]>0?e[1]-0:0;0===i?e[0]<0?(n=1,r=0):e[0]>0&&(n=0,r=1):(n/=i,r/=i);const a=t.getDomainSpec();return{total:i,negative:n,positive:r,includeZero:s,domain:e,extendable_min:!Wo(a.min),extendable_max:!Wo(a.max)}}function fE(t,e){const{positive:i,negative:s,extendable_min:n,extendable_max:r,domain:a}=t,{positive:o,negative:l,extendable_min:h,extendable_max:d,domain:c}=e;if(o>0){if(!h)return!1;let t=s/i;r&&(t=s/Math.max(i,o),a[1]=-a[0]/t),c[0]=-c[1]*t}else if(l>0){if(!d)return!1;let t=i/s;n&&(t=i/Math.max(s,s),a[0]=-a[1]/t),c[1]=-c[0]*t}return!0}function vE(t,e){const{extendable_min:i,extendable_max:s,domain:n}=t,{positive:r,negative:a,domain:o}=e;return!(0===r&&0===a||r>0&&!s||a>0&&!i||(n[0]=o[0],n[1]=o[1],0))}function yE(t,e){const{positive:i,negative:s,extendable_max:n,domain:r}=t,{positive:a,negative:o,extendable_min:l,domain:h}=e;if(n&&l){const t=Math.max(s,o)/Math.max(i,a);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(l){const t=s/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=o/a;r[1]=-r[0]/t}}return!0}function bE(t,e){const{extendable_min:i,domain:s}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(s[0]=-s[1],r[1]=-r[0],0))}const xE=t=>t.map(((t,e)=>({index:e,value:t}))),SE=(t,e,i=0)=>{const s=new Bt(t).expand(i/2),n=new Bt(e).expand(i/2);return s.intersects(n)};function ME(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function kE(t,e){for(let i,s=1,n=t.length,r=t[0];sit?Math.min(t-e/2,i-e):i{var s;const{labelStyle:n,axisOrientType:r,labelFlush:a,labelFormatter:o,startAngle:l=0}=i;let h=null!==(s=n.angle)&&void 0!==s?s:0;"vertical"===n.direction&&(h+=At(90));const d=["bottom","top"].includes(r),c=["left","right"].includes(r);let u=1,p=0;d||(c?(u=0,p=1):l&&(u=Math.cos(l),p=-Math.sin(l)));const g=Xk(n),m=t.range(),_=e.map(((i,s)=>{var r,l;const _=o?o(i):`${i}`,{width:f,height:v}=g.quickMeasure(_),y=Math.max(f,12),b=Math.max(v,12),x=t.scale(i),S=u*x,M=p*x;let k,A,w=S,T=M;a&&d&&0===s?w=AE(S,y,m[0],m[m.length-1]):a&&d&&s===e.length-1?w=AE(S,y,m[m.length-1],m[0]):k=null!==(r=n.textAlign)&&void 0!==r?r:"center","right"===k?w-=y:"center"===k&&(w-=y/2),a&&c&&0===s?T=AE(M,b,m[0],m[m.length-1]):a&&c&&s===e.length-1?T=AE(M,b,m[m.length-1],m[0]):A=null!==(l=n.textBaseline)&&void 0!==l?l:"middle","bottom"===A?T-=b:"middle"===A&&(T-=b/2);const C=(new Bt).set(w,T,w+y,T+b);return h&&C.rotate(h,S,M),C}));return _},TE=(t,e)=>{var i,s,n,r,a;if(!t)return t;const o=null===(i=null==e?void 0:e.targetAxis)||void 0===i?void 0:i.call(e);if(!o)return t;const l=null===(s=null==e?void 0:e.currentAxis)||void 0===s?void 0:s.call(e);if(!l)return t;const h=null===(n=l.getTickData())||void 0===n?void 0:n.getDataView();if(!h)return t;if(!h.transformsArr.find((t=>t.type.includes("ticks"))))return t;const d=l.getScale();if(!d)return t;const c=null===(a=null===(r=o.getTickData())||void 0===r?void 0:r.getDataView())||void 0===a?void 0:a.latestData;if(!(null==c?void 0:c.length))return t;const u=o.getScale();if(!u)return t;const p=u.domain(),g=p[1]-p[0];if(0===g)return t;const m=d.domain(),_=m[1]-m[0];if(0===g)return t;const f=c.map((t=>{const e=(t.value-p[0])/g;return _*e+m[0]}));return xE(f)};class CE{constructor(t){this.id=qo(),this.name=`${t}_${this.id}`}onAdd(t){this.service=t}release(){this.service=null}}class LE extends CE{constructor(){super(LE.type),this.type="AxisSyncPlugin"}_checkEnableSync(t){if(!Jh(t.getScale().type))return!1;const e=t.getSpec().sync;return!!(null==e?void 0:e.axisId)&&e}_getTargetAxis(t,e){const i=t.getOption().getChart().getComponentByUserId(e.axisId);return(null==i?void 0:i.type.startsWith("cartesianAxis"))?i:null}onInit(t,e){const i=this._checkEnableSync(e);if(!i)return;if(!i.zeroAlign)return;const s=this._getTargetAxis(e,i);s&&e.event.on(jd.scaleDomainUpdate,{filter:({model:t})=>t.id===e.id||t.id===s.id},(()=>{((t,e)=>{var i,s,n,r,a,o;const l=t.getScale(),h=e.getScale();if(!l||!h)return;const d=null!==(n=null===(s=(i=t).getDomainAfterSpec)||void 0===s?void 0:s.call(i))&&void 0!==n?n:[0,1],c=null!==(o=null===(a=(r=e).getDomainAfterSpec)||void 0===a?void 0:a.call(r))&&void 0!==o?o:[0,1];if(!(d&&c&&mE(d)&&mE(c)))return;const u=_E(t,d),p=_E(e,c),{positive:g,negative:m,extendable_min:_,extendable_max:f,includeZero:v}=u,{positive:y,negative:b,extendable_min:x,extendable_max:S,includeZero:M}=p;if(0===g&&0===m){if(!vE(u,p))return}else if(0===y&&0===b){if(!vE(p,u))return}else if(v||M)if(v&&!M){if(!fE(u,p))return}else if(M&&!v){if(!fE(p,u))return}else{if(m===b)return;if(m>b){if(!yE(u,p))return}else if(!yE(p,u))return}else{if(0===m&&0===y){if(!bE(u,p))return}else if(0===b&&0===g&&!bE(p,u))return;if(0===m&&0===b)if(0===d[0]&&c[0]>0){if(!x)return;c[0]=0}else{if(!(0===c[0]&&d[0]>0))return;if(!_)return;d[0]=0}if(0===g&&0===y)if(0===d[1]&&c[1]>0){if(!S)return;c[1]=0}else{if(!(0===c[1]&&d[1]>0))return;if(!f)return;d[1]=0}}l.domain(d),h.domain(c)})(s,e)}))}onDidCompile(t,e){const i=this._checkEnableSync(e);if(!i)return;const s=this._getTargetAxis(e,i);if(s&&i.tickAlign){Ap(e.getOption().dataSet,"tickAlign",TE);const t={targetAxis:()=>s,currentAxis:()=>e};e.addTransformToTickData({type:"tickAlign",options:t,level:Number.MAX_SAFE_INTEGER},!1)}}}function EE(t={}){const e=Object.assign({},t);if(rs(t.style)?e.style=(e,i,s,n)=>OE(t.style(e,i,s,n)):Im(t.style)||(e.style=OE(t.style)),!Im(t.state)){const i={};Object.keys(t.state).forEach((e=>{rs(t.state[e])?i[e]=(i,s,n,r)=>OE(t.state[e](i,s,n,r)):Im(t.state[e])||(i[e]=OE(t.state[e]))})),e.state=i}return e}function PE(t){if(Im(t))return null;const e={};return Object.keys(t).forEach((i=>{rs(t[i])?e[i]=(e,s,n,r)=>OE(t[i](e,s,n,r)):Im(t[i])||(e[i]=OE(t[i]))})),e}function DE(t,e){if(Im(t))return null;const i={};return Object.keys(t).forEach((s=>{rs(t[s])?i[s]=t[s](e):i[s]=t[s]})),OE(i)}function OE(t){return(null==t?void 0:t.angle)&&(t.angle=At(t.angle)),t}function RE(t,e){return Gd(e,`component.${t}`)}function IE(t,e,i,s){if(t)return{formatFunc:t,args:[i,s]};const n=$l.getFormatter();return e&&n?{formatFunc:n,args:[i,s,e]}:{}}LE.pluginType="component",LE.type="AxisSyncPlugin";const BE={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}};function FE(t){let e=0;return Gd(t,"tick.visible")&&(e+=Gd(t,"tick.tickSize")),Gd(t,"label.visible")&&(e+=Gd(t,"label.space")),e}function YE(t,e){var i,s,n,r,a,o;return{min:null!==(n=null!==(i=t.min)&&void 0!==i?i:null===(s=t.range)||void 0===s?void 0:s.min)&&void 0!==n?n:null==e?void 0:e.min,max:null!==(o=null!==(r=t.max)&&void 0!==r?r:null===(a=t.range)||void 0===a?void 0:a.max)&&void 0!==o?o:null==e?void 0:e.max}}function jE(t){const e=null==t?void 0:t.orient;return"top"===e||"bottom"===e||"left"===e||"right"===e||"z"===e}function HE(t){const e=null==t?void 0:t.orient;return"angle"===e||"radius"===e}const zE=(t,e,i)=>{var s;const n=null!==(s="band"===e?RE("axisBand",i):["linear","log","symlog"].includes(e)?RE("axisLinear",i):{})&&void 0!==s?s:{},r=Md(t)?RE("axisX",i):kd(t)?RE("axisY",i):RE("axisZ",i);return Tl({},RE("axis",i),n,r)},NE=(t,e,i)=>{var s;const n=null!==(s="band"===e?RE("axisBand",i):"linear"===e?RE("axisLinear",i):{})&&void 0!==s?s:{},r=RE("angle"===t?"axisAngle":"axisRadius",i);return Tl({},RE("axis",i),n,r)},VE=t=>"band"===t||"ordinal"===t||"point"===t;function WE(t,e){return{id:t,label:t,value:e,rawValue:t}}class GE extends $w{constructor(t){super(),this.component=t}releaseAll(){super.releaseAll(),this.component=null}}function UE(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:d=0,dy:c=0}=t.attribute;let u=0,p=0;an&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+d),p&&t.setAttribute("dy",p+c)}function $E(t,e,i,s){for(let n=0,r=t.length;n=e)return r}}return null}const KE=(t,e)=>{var i;const s=Tl({},e,e[Td(null!==(i=t.orient)&&void 0!==i?i:e.orient)]);return delete s.horizontal,delete s.vertical,s};class XE extends By{getTheme(t,e){return function(t,e,i,s){switch(t){case r.cartesianBandAxis:return zE(wd(i,["z"]),"band",e);case r.cartesianLinearAxis:return zE(wd(i,["z"]),"linear",e);case r.cartesianLogAxis:return zE(wd(i,["z"]),"log",e);case r.cartesianSymlogAxis:return zE(wd(i,["z"]),"symlog",e);case r.cartesianAxis:case r.cartesianTimeAxis:return zE(wd(i),void 0,e);case r.polarBandAxis:return NE(i.orient,"band",e);case r.polarLinearAxis:return NE(i.orient,"linear",e);case r.polarAxis:return NE(i.orient,void 0,e);case r.cartesianCrosshair:return((t,e)=>{var i,s;const n=Ra(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,xField:l,yField:h}=null!==(s=RE(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>Md(t.orient)));let c;c=M(d)?Tl({},VE(d.type)?a:o,l):l;const u=n.find((t=>kd(t.orient)));let p;return p=M(u)?Tl({},td(u.type)?a:o,h):h,{xField:c,yField:p}})(e,s);case r.polarCrosshair:return((t,e)=>{var i,s;const n=Ra(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,categoryField:l,valueField:h}=null!==(s=RE(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>"angle"===t.orient));let c;c=M(d)?Tl({},VE(d.type)?a:o,l):l;const u=n.find((t=>"radius"===t.orient));let p;return p=M(u)?Tl({},td(u.type)?a:o,h):h,{categoryField:c,valueField:p}})(e,s);case r.colorLegend:case r.sizeLegend:case r.discreteLegend:case r.dataZoom:case r.scrollBar:return KE(i,RE(t,e));default:return RE(t,e)}}(this.type,this._option.getTheme(),t,e)}_mergeThemeToSpec(t,e){const{spec:i,theme:s}=super._mergeThemeToSpec(t,e);return this._adjustPadding(i),{spec:i,theme:s}}_adjustPadding(t){const{padding:e,noOuterPadding:i=!0,orient:s}=t;i&&e&&s&&(t.padding=Object.assign(Object.assign({},sl(e)),{[s]:0}))}}class qE extends Hy{static createComponent(t,e){const{spec:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{var r,a;e instanceof ls||this.event.emit(i,{model:this,node:t,event:e,item:s,datum:n,source:Hd.chart,chart:null===(a=null===(r=this._option)||void 0===r?void 0:r.globalInstance)||void 0===a?void 0:a.getChart()},"model")},this._option.animation&&(this.animate=new Iy({getCompiler:e.getCompiler}))}initLayout(){var t;super.initLayout(),this._regions=null!==(t=this._regions)&&void 0!==t?t:this._option.getRegionsInIndex(),this._layout&&(this._layout.layoutBindRegionID=this._regions.map((t=>null==t?void 0:t.id)))}changeRegions(t){throw new Error("Method not implemented.")}_getNeedClearVRenderComponents(){throw new Error("Method not implemented.")}onRender(t){throw new Error("Method not implemented.")}getVRenderComponents(){return this._getNeedClearVRenderComponents()}callPlugin(t){this.pluginService&&this.pluginService.getAll().forEach((e=>t(e)))}getContainer(){var t;return this._container||(this._container=null===(t=this._option)||void 0===t?void 0:t.globalInstance.getStage().find((t=>"root"===t.name),!0)),this._container}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||(i.reMake=["seriesId","seriesIndex","regionId","regionIndex"].some((i=>!Dm(null==e?void 0:e[i],t[i])))),(null==e?void 0:e.visible)!==t.visible&&(i.reCompile=!0),i}release(){var t;super.release(),this.clear(),null===(t=this.pluginService)||void 0===t||t.releaseAll(),this.pluginService=null}clear(){var t;const e=this._getNeedClearVRenderComponents();e&&e.length&&e.forEach((t=>{var e;t&&(null===(e=this.getContainer())||void 0===e||e.removeChild(t),t=null)})),this._container=null,null===(t=this.pluginService)||void 0===t||t.clearAll()}compile(){this.compileMarks(),this.reAppendComponents()}compileMarks(t){this.getMarks().forEach((e=>{var i;e.compile({group:t}),null===(i=e.getProduct())||void 0===i||i.configure({context:{model:this}})}))}reAppendComponents(){const t=this._getNeedClearVRenderComponents();t&&t.length&&t.forEach((t=>{var e;t&&!t.stage&&(null===(e=this.getContainer())||void 0===e||e.appendChild(t))}))}getBoundsInRect(t,e){return{x1:0,x2:0,y1:0,y2:0}}}function ZE(t,e){if(!t||!w(t))return t;const i={};return Object.keys(t).forEach((s=>{const n=t[s];let r=!1;e.forEach((t=>{(S(t)&&t===s||t instanceof RegExp&&s.match(t))&&(r=!0)})),r||(i[s]=n)})),i}qE.transformerConstructor=XE;class JE extends mx{constructor(t,e){super(t,e),this.type="component",this._componentType=e.componentType,this._mode=e.mode}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(Xd.component,null!=t?t:e.rootMark,{componentType:this._componentType,mode:this._mode}).id(i),this._compiledProductId=i}}JE.type="component";const QE=()=>{$l.registerMark(JE.type,JE)};class tP extends ps{constructor(){super(...arguments),this.mode=qt.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._newElementAttrMap={},Yk(t,(t=>{var i,s,n,r,a,o;if("group"!==t.type&&t.id){const l=e[t.id];if(l){if(!Dm(t.attribute,l.attribute)){const e=k(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},e),{opacity:null!==(i=e.opacity)&&void 0!==i?i:1,fillOpacity:null!==(s=e.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(n=e.strokeOpacity)&&void 0!==n?n:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(r=t.attribute.opacity)&&void 0!==r?r:1,fillOpacity:null!==(a=t.attribute.fillOpacity)&&void 0!==a?a:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,e=this.easing;this._newElementAttrMap&&Object.keys(this._newElementAttrMap).forEach((i=>{var s;const{node:n,attrs:r,state:a}=this._newElementAttrMap[i];if("enter"===a){const{enter:i={}}=null!==(s=this.params)&&void 0!==s?s:{};t=Wo(i.duration)?i.duration:t,e=i.easing?i.easing:e}"path"===n.type?n.animate({interpolate:(t,e,i,s,n)=>"path"===t&&(n.path=function(t,e){let i,s,n,r=zb.lastIndex=Nb.lastIndex=0,a=-1;const o=[],l=[];for(t+="",e+="";(i=zb.exec(t))&&(s=Nb.exec(e));)(n=s.index)>r&&(n=e.slice(r,n),o[a]?o[a]+=n:o[++a]=n),(i=i[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:jb(i,s)})),r=Nb.lastIndex;return rt;class nP extends qE{getOrient(){return this._orient}getScale(){return this._scale}getScales(){return this._scales}getTickData(t=0){return this._tickData[t]}get visible(){return this._visible}getInverse(){return this._inverse}getCoordinateType(){return this._coordinateType}constructor(t,e){var i;super(t,e),this.specKey="axes",this._scales=[],this._tickData=[],this._visible=!0,this._tick=void 0,this._visible=null===(i=t.visible)||void 0===i||i,this._coordinateType="none"}_getNeedClearVRenderComponents(){return[]}getVRenderComponents(){var t,e,i,s;return[null===(e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct())||void 0===e?void 0:e.getGroupGraphicItem(),null===(s=null===(i=this._gridMark)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.getGroupGraphicItem()].filter(M)}created(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_;if(super.created(),this.setSeriesAndRegionsFromSpec(),this.initEvent(),this.initScales(),this.updateSeriesScale(),this._shouldComputeTickData()&&this._initData(),this._visible){const f=this._createMark({type:"component",name:`axis-${this.getOrient()}`},{componentType:"angle"===this.getOrient()?"circleAxis":"axis",mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});if(this._axisMark=f,f.setZIndex(this.layoutZIndex),M(this._spec.id)&&f.setUserId(this._spec.id),this._marks.addMark(f),null===(t=this._spec.grid)||void 0===t?void 0:t.visible){const t=this._createMark({type:"component",name:`axis-${this.getOrient()}-grid`},{componentType:"angle"===this.getOrient()?Qd.circleAxisGrid:Qd.lineAxisGrid,mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});t.setZIndex(null!==(r=null!==(s=null===(i=null===(e=this._spec.grid)||void 0===e?void 0:e.style)||void 0===i?void 0:i.zIndex)&&void 0!==s?s:null===(n=this._spec.grid)||void 0===n?void 0:n.zIndex)&&void 0!==r?r:Ty.Axis_Grid),t.setInteractive(!1),this._marks.addMark(t),this._gridMark=t}if(v(this._spec.interactive)&&this._marks.forEach((t=>t.setInteractive(this._spec.interactive))),!1!==this._option.animation&&!1!==Gd(this._option.getChart().getSpec(),"animation")&&!0===this._spec.animation){const t=TL(null===(a=$l.getAnimationInKey("axis"))||void 0===a?void 0:a(),{appear:null!==(l=null!==(o=this._spec.animationAppear)&&void 0!==o?o:Gd(this._option.getChart().getSpec(),"animationAppear.axis"))&&void 0!==l?l:Gd(this._option.getChart().getSpec(),"animationAppear"),disappear:null!==(d=null!==(h=this._spec.animationDisappear)&&void 0!==h?h:Gd(this._option.getChart().getSpec(),"animationDisappear.axis"))&&void 0!==d?d:Gd(this._option.getChart().getSpec(),"animationDisappear"),enter:null!==(u=null!==(c=this._spec.animationEnter)&&void 0!==c?c:Gd(this._option.getChart().getSpec(),"animationEnter.axis"))&&void 0!==u?u:Gd(this._option.getChart().getSpec(),"animationEnter"),exit:null!==(g=null!==(p=this._spec.animationExit)&&void 0!==p?p:Gd(this._option.getChart().getSpec(),"animationExit.axis"))&&void 0!==g?g:Gd(this._option.getChart().getSpec(),"animationExit"),update:null!==(_=null!==(m=this._spec.animationUpdate)&&void 0!==m?m:Gd(this._option.getChart().getSpec(),"animationUpdate.axis"))&&void 0!==_?_:Gd(this._option.getChart().getSpec(),"animationUpdate")});t.enter&&(t.update[0].customParameters={enter:t.enter[0]}),this._marks.forEach((e=>e.setAnimationConfig(t)))}}}_shouldComputeTickData(){return this.getVisible()||this._spec.forceInitTick}_initData(){const t=this._initTickDataSet(this._tickTransformOption());t.target.addListener("change",this._forceLayout.bind(this)),this._tickData=[new dx(this._option,t)]}collectData(t,e){const i=[];return uE(this._regions,(s=>{var n;let r=this.collectSeriesField(t,s);if(r=y(r)?Jh(this._scale.type)?r:[r[0]]:[r],t||(this._dataFieldText=s.getFieldAlias(r[0])),r){const t=s.getViewData();if(e)r.forEach((t=>{i.push(s.getRawDataStatisticsByField(t,!1))}));else if(t&&t.latestData&&t.latestData.length){const t=null===(n=s.getViewDataStatistics)||void 0===n?void 0:n.call(s);r.forEach((e=>{var s;(null===(s=null==t?void 0:t.latestData)||void 0===s?void 0:s[e])&&i.push(t.latestData[e])}))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),i}isSeriesDataEnable(){let t=!0;return uE(this._regions,(e=>{var i;y(null===(i=e.getViewDataStatistics())||void 0===i?void 0:i.latestData)&&(t=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}setSeriesAndRegionsFromSpec(){const{seriesId:t,seriesIndex:e,regionId:i,regionIndex:s}=this._spec;M(t)&&(this._seriesUserId=Ra(t)),M(i)&&(this._regionUserId=Ra(i)),M(e)&&(this._seriesIndex=Ra(e)),M(s)&&(this._regionIndex=Ra(s)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionIndex),this.layout.layoutBindRegionID=this._regions.map((t=>t.id))}getBindSeriesFilter(){return{userId:this._seriesUserId,specIndex:this._seriesIndex}}initEvent(){this.event.on(jd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));const t=pE(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}).map((t=>t.getViewDataStatistics())).filter((t=>!!t));t.length>1?this._option.dataSet.multipleDataViewAddListener(t,"change",(()=>{this.updateScaleDomain()})):1===t.length&&t[0].target.addListener("change",(()=>{this.updateScaleDomain()})),uE(this._regions,(t=>{t.event.on(jd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._clearRawDomain()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}updateScaleDomain(){}_clearRawDomain(){}onLayoutEnd(t){this.updateScaleRange(),this.event.emit(jd.scaleUpdate,{model:this,value:"range"}),super.onLayoutEnd(t)}computeData(t){!this._tickData||!this._tickData.length||"force"!==t&&Dm(this._scale.range(),[0,1])||this._tickData.forEach((t=>{t.getDataView().reRunAllTransform(),t.updateData()}))}initScales(){this._scales=[this._scale];const t=[];if(uE(this._regions,(e=>{const i=e.getGroups();i&&t.push(i)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),0!==t.length){const e=Ba(t.map((t=>t.fields.length)));for(let t=1;t{var s,n;return(null===(s=null==e?void 0:e[i])||void 0===s?void 0:s.visible)!==(null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.visible)})),i))}_delegateAxisContainerEvent(t){0===t.listenerCount("*")&&t.addEventListener("*",((e,i)=>this._delegateEvent(t,e,i)))}_getAxisAttributes(){const t=this._spec,e={orient:this.getOrient(),select:!0!==this._option.disableTriggerEvent&&t.select,hover:!0!==this._option.disableTriggerEvent&&t.hover};if(t.domainLine&&t.domainLine.visible?e.line=((i=EE(i=t.domainLine)).startSymbol=EE(i.startSymbol),i.endSymbol=EE(i.endSymbol),i):e.line={visible:!1},t.label&&t.label.visible){const i=ZE(t.label,["style","formatMethod","state"]);e.label=i,t.label.style&&(e.label.style=rs(t.label.style)?(e,i,s,n)=>{var r;const a=t.label.style(e.rawValue,i,e,s,n);return OE(Tl({},null===(r=this._theme.label)||void 0===r?void 0:r.style,a))}:OE(t.label.style)),(t.label.formatMethod||t.label.formatter)&&(e.label.formatMethod=this._getLabelFormatMethod()),t.label.state&&(e.label.state=function(t){if(Im(t))return null;const e={};return Object.keys(t).forEach((i=>{rs(t[i])?e[i]=(e,s,n,r)=>OE(t[i](e.rawValue,s,e,n,r)):Im(t[i])||(e[i]=OE(t[i]))})),e}(t.label.state))}else e.label={visible:!1};var i;if(t.tick&&t.tick.visible?(e.tick={visible:t.tick.visible,length:t.tick.tickSize,inside:t.tick.inside,alignWithLabel:t.tick.alignWithLabel,dataFilter:t.tick.dataFilter},t.tick.style&&(e.tick.style=rs(t.tick.style)?(e,i,s,n)=>{var r;const a=t.tick.style(e,i,s,n);return OE(Tl({},null===(r=this._theme.tick)||void 0===r?void 0:r.style,a))}:OE(t.tick.style)),t.tick.state&&(e.tick.state=PE(t.tick.state))):e.tick={visible:!1},t.subTick&&t.subTick.visible?(e.subTick={visible:t.subTick.visible,length:t.subTick.tickSize,inside:t.subTick.inside,count:t.subTick.tickCount},t.subTick.style&&(e.subTick.style=rs(t.subTick.style)?(e,i,s,n)=>{var r;const a=t.subTick.style(e,i,s,n);return OE(Tl({},null===(r=this._theme.subTick)||void 0===r?void 0:r.style,a))}:OE(t.subTick.style)),t.subTick.state&&(e.subTick.state=PE(t.subTick.state))):e.subTick={visible:!1},t.title&&t.title.visible){const i=t.title,{autoRotate:s,angle:n,style:r={},background:a,state:o,shape:l}=i,h=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n(e,i)=>{var s,n;const r=t.grid.style(null===(s=e.datum)||void 0===s?void 0:s.rawValue,i,e.datum);return OE(Tl({},null===(n=this._theme.grid)||void 0===n?void 0:n.style,r))}:OE(t.grid.style),subGrid:!1===t.subGrid.visible?{visible:!1}:{type:"line",visible:t.subGrid.visible,alternateColor:t.subGrid.alternateColor,style:OE(t.subGrid.style)}}}_getLabelFormatMethod(){const{formatMethod:t,formatter:e}=this._spec.label,{formatFunc:i}=IE(t,e);return i?(t,s,n)=>i(s.rawValue,s,e):null}_initTickDataSet(t,e=0){wp(this._option.dataSet,"scale",sP);const i=this.registerTicksTransform();return new R(this._option.dataSet,{name:`${this.type}_${this.id}_ticks_${e}`}).parse(this._scales[e],{type:"scale"}).transform({type:i,options:t},!1)}_tickTransformOption(){const t=this._tick||{},e=this._spec.label||{},{tickCount:i,forceTickCount:s,tickStep:n,tickMode:r}=t,{style:a,formatMethod:o,minGap:l}=e;return{sampling:!1!==this._spec.sampling,tickCount:i,forceTickCount:s,tickStep:n,tickMode:r,axisOrientType:this._orient,coordinateType:this._coordinateType,labelStyle:a,labelFormatter:o,labelGap:l}}addTransformToTickData(t,e){this._tickData.forEach((i=>{var s;null===(s=null==i?void 0:i.getDataView())||void 0===s||s.transform(t,e)}))}dataToPosition(t){return this._scale.scale(t)}}nP.specKey="axes";const rP=()=>{QE(),$l.registerAnimation("axis",(()=>({appear:{custom:eP},update:{custom:tP},exit:{custom:iP}})))};var aP=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{this.computeData(null==t?void 0:t.value),uE(this._regions,(t=>{const e=this.getOrient();Md(e)?t.setXAxisHelper(this.axisHelper()):kd(e)?t.setYAxisHelper(this.axisHelper()):Ad(e)&&t.setZAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{let{x:e,y:i}=t;return Wo(e)&&(e+=Number("left"===this._orient)*this.getLayoutRect().width),Wo(i)&&(i+=Number("top"===this._orient)*this.getLayoutRect().height),{x:e,y:i}},this._transformLayoutRect=t=>{if(!this._visible)return t;const e=this._latestBounds.clone().translate(-this.getLayoutStartPoint().x,-this.getLayoutStartPoint().y);switch(this._layout.layoutOrient){case"left":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x1<0?-e.x1:0);break;case"right":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x2>0?e.x2:0);break;case"top":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y1<0?-e.y1:0);break;case"bottom":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y2>0?e.y2:0)}return t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),this._layout.setRectInSpec(this._layoutCacheProcessing(t))},this._updateAxisLayout=()=>{const t=this.getLayoutStartPoint(),e=this._getUpdateAttribute(!1),{grid:i}=e,s=aP(e,["grid"]),n=this._axisMark.getProduct(),r=Tl({x:t.x,y:t.y},this._axisStyle,s);n.encode(r),this._gridMark&&this._gridMark.getProduct().encode(Tl({x:t.x,y:t.y},this._getGridAttributes(),i))},this._fixAxisOnZero=()=>{const{onZero:t,visible:e}=this._spec.domainLine;if(this.visible&&t&&!1!==e){const{onZeroAxisId:t,onZeroAxisIndex:e}=this._spec.domainLine,i=this._option.getComponentsByKey("axes"),s=Md(this.getOrient()),n=t=>{var e;return(s?!Md(t.getOrient()):Md(t.getOrient()))&&Jh(t.getScale().type)&&(t.getTickData()?null===(e=t.getTickData().getLatestData())||void 0===e?void 0:e.find((t=>0===t.value)):t.getScale().domain()[0]<=0&&t.getScale().domain()[1]>=0)},r=i.filter((t=>n(t)));if(r.length){let a;if(M(t))a=r.find((e=>e.id===t));else if(M(e)){const t=i[e];n(t)&&(a=t)}else a=r[0];if(a){const t=this._axisMark.getProduct(),e=a.valueToPosition(0);s?t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dy:"bottom"===this._orient?-(a.getScale().range()[0]-e):e})}):t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dx:"left"===this._orient?e:-(a.getScale().range()[1]-e)})})}}}},this._orient=wd(t,["z"]),Ad(this._orient)&&(this.layoutType="absolute"),this._dataSet=e.dataSet,this._coordinateType="cartesian"}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;const i="horizontal"===t.direction;if(!y(e)){if(!jE(e))return null;const{axisType:t,componentName:s}=Cd(e,i);return e.type=t,[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:s}]}let s=!0;if(e.filter((t=>"z"===t.orient))[0]){const t=e.filter((t=>"bottom"===t.orient))[0],i=e.filter((t=>kd(t.orient)))[0];s=3===e.length&&t&&i}let n=e.map(((t,e)=>({spec:t,index:e})));s||(n=n.filter((({spec:t})=>"z"!==t.orient)));const r=[];return n.forEach((({spec:t,index:e})=>{if(!jE(t))return;const{axisType:s,componentName:n}=Cd(t,i);t.type=s,r.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:n})})),r}static createComponent(t,e){const{spec:i}=t,s=aP(t,["spec"]),n=$l.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}initLayout(){super.initLayout(),this._layout.autoIndent=!1!==this._spec.autoIndent,this._layout.layoutOrient=this._orient}setLayout3dBox(t){this.layout3dBox=t}updateScaleRange(){let t=!1;const{width:e,height:i}=this.getLayoutRect(),{left:s,right:n,top:r,bottom:a}=this._innerOffset;let o=[];Md(this.getOrient())?Wo(e)&&(o=this._inverse?[e-n,s]:[s,e-n]):Ad(this.getOrient())?Wo(e)&&(o=this._inverse?[e-n,s]:[s,e-n],this._scale.range(o)):Wo(i)&&(o=this._inverse?[r,i-a]:[i-a,r]);const[l,h]=this._scale.range();return o[0]===l&&o[1]===h||(t=!0,this._scale.range(o)),t}init(t){var e;super.init(t),null===(e=this.pluginService)||void 0===e||e.load(oP.map((t=>new t))),this.callPlugin((t=>{this.pluginService&&t.onInit&&t.onInit(this.pluginService,this)}))}setAttrFromSpec(){var t;if(super.setAttrFromSpec(),this.visible){Md(this.getOrient())?Lg(this._spec.maxHeight)&&(this._spec.maxHeight="30%"):Lg(this._spec.maxWidth)&&(this._spec.maxWidth="30%");const t=this._getAxisAttributes();t.label.formatMethod=this._getLabelFormatMethod(),t.verticalFactor="top"===this.getOrient()||"right"===this.getOrient()?-1:1,this._axisStyle=t}this._tick=this._spec.tick;const e=null===(t=this._option.getChart())||void 0===t?void 0:t.getSpec();this._inverse=function(t,e){let i=t.inverse;return e&&!Md(t.orient)&&(i=!M(t.inverse)||!t.inverse),i}(this._spec,"horizontal"===(null==e?void 0:e.direction))}onLayoutStart(t,e,i){if(super.onLayoutStart(t,e,i),!Ad(this.getOrient())&&this._spec.innerOffset){const t=this._spec;kd(this.getOrient())?["top","bottom"].forEach((i=>{this._innerOffset[i]=el(t.innerOffset[i],e.height,e)})):["left","right"].forEach((i=>{this._innerOffset[i]=el(t.innerOffset[i],e.width,e)}))}}getSeriesStatisticsField(t){let e;return e=Md(this.getOrient())?t.fieldX:Ad(this.getOrient())?t.fieldZ:t.fieldY,Jh(this._scale.type)?e:[e[0]]}_tickTransformOption(){var t,e,i;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimals:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,labelLastVisible:null===(e=this._spec.label)||void 0===e?void 0:e.lastVisible,labelFlush:null===(i=this._spec.label)||void 0===i?void 0:i.flush})}axisHelper(){return{isContinuous:Jh(this._scale.type),dataToPosition:this.dataToPosition.bind(this),getScale:(t=0)=>this._scales[t],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!0===this._inverse,getSpec:()=>this._spec}}afterCompile(){var t;const e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct();e&&e.addEventListener(rc.AFTER_ELEMENT_ENCODE,(()=>{if(!1===this._isLayout&&(Md(this.getOrient())?this.callPlugin((t=>{this.pluginService&&t.onDidLayoutHorizontal&&t.onDidLayoutHorizontal(this.pluginService,this)})):this.callPlugin((t=>{this.pluginService&&t.onDidLayoutVertical&&t.onDidLayoutVertical(this.pluginService,this)})),this._delegateAxisContainerEvent(e.getGroupGraphicItem()),this._unitText)){const{x:t,y:e}=this.getLayoutStartPoint(),i=Md(this._orient)?{x:Ba(this._scale.range())+t,y:e}:{x:t,y:Fa(this._scale.range())+e};this._unitText.setAttributes(i)}})),this.callPlugin((t=>{this.pluginService&&t.onDidCompile&&t.onDidCompile(this.pluginService,this)}))}onRender(t){}changeRegions(t){}update(t){}resize(t){}collectScale(){const t=[];return uE(this._regions,(e=>{t.push("left"===this.getOrient()||"right"===this.getOrient()?e.scaleY:e.scaleX)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:Md(this.getOrient())?e.getSpec().x2Field?[...e.fieldX,e.fieldX2]:e.fieldX:Ad(this.getOrient())?e.fieldZ:e.getSpec().y2Field?[...e.fieldY,e.fieldY2]:e.fieldY,n}updateSeriesScale(){const t=this.getOrient();uE(this._regions,(e=>{Md(t)?(e.setScaleX(this._scale),e.setXAxisHelper(this.axisHelper())):kd(t)?(e.setScaleY(this._scale),e.setYAxisHelper(this.axisHelper())):Ad(t)&&(e.setScaleZ(this._scale),e.setZAxisHelper(this.axisHelper()))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getBoundsInRect(t){var e;let i={x1:0,y1:0,x2:0,y2:0};if(!this._visible)return i;this._verticalLimitSize=Md(this.getOrient())?t.height:t.width,this.setLayoutRect(t),!this.updateScaleRange()&&y(null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData())||this.computeData("range");const s={skipLayout:!1},n=Md(this.getOrient());this.pluginService&&(n?this.callPlugin((t=>{t.onWillLayoutHorizontal&&t.onWillLayoutHorizontal(this.pluginService,s,this)})):this.callPlugin((t=>{t.onWillLayoutVertical&&t.onWillLayoutVertical(this.pluginService,s,this)})));const r=this._axisMark.getProduct();let a=!1;if(!s.skipLayout){const t=this._getUpdateAttribute(!0),e=r.getGroupGraphicItem(),s=Tl(Object.assign({},this.getLayoutStartPoint()),this._axisStyle,t,{line:{visible:!1}}),o=e.getBoundsWithoutRender(s);a=!0,this._latestBounds=o,isFinite(o.width())&&(i=this._appendAxisUnit(o,n))}return a||(this._latestBounds=r.getBounds()),i}positionToData(t,e){const i=Md(this.getOrient());e&&(t-=i?this.getLayoutStartPoint().x:this.getLayoutStartPoint().y),this._innerOffset&&(t=i?vs(t,this._innerOffset.left,this.getLayoutRect().width-this._innerOffset.right):vs(t,this._innerOffset.top,this.getLayoutRect().height-this._innerOffset.bottom));const s=this._scale.range();return(t-s[0])*(t-s[1])>0?null:this._scale.invert(t)}_getTitleLimit(t){var e,i,s,n,r;if(this._spec.title.visible&&P(null===(e=this._spec.title.style)||void 0===e?void 0:e.maxLineWidth)){const e=null!==(r=null!==(s=null===(i=this._axisStyle.title)||void 0===i?void 0:i.angle)&&void 0!==s?s:null===(n=this._spec.title.style)||void 0===n?void 0:n.angle)&&void 0!==r?r:0;if(t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(e));return i<1e-6?1/0:t/i}const a=this.getLayoutRect().height,o=Math.abs(Math.sin(e));return o<1e-6?1/0:a/o}return null}_getUpdateAttribute(t){var e;let i=0,s=0;if(!t){const t=this.getRegions();let{x:e,y:n}=t[0].getLayoutStartPoint(),r=e+t[0].getLayoutRect().width,a=n+t[0].getLayoutRect().height;for(let i=1;i{const i=this._getNormalizedValue([e.value],t);return WE(e.value,i)})).filter((t=>t.value>=0&&t.value<=1))]:[]}initEvent(){super.initEvent(),this.visible&&(this.event.on(jd.layoutEnd,this._updateAxisLayout),this.event.on(jd.layoutEnd,this._fixAxisOnZero),this.event.on(jd.layoutRectUpdate,(()=>{this._clearLayoutCache()})))}_getNormalizedValue(t,e){return 0===e?0:this.dataToPosition(t)/e}_layoutCacheProcessing(t){return["width","height"].forEach((e=>{t[e]{this.layout.getLastComputeOutBounds()[t]=this._layoutCache._lastComputeOutBounds[t]})):(this._hasAutoIndent=!0,["x1","x2","y1","y2"].forEach((t=>{this.layout.getLastComputeOutBounds()[t]t.x2?h.x2-t.x2:0,t.y2+=h.y2>t.y2?h.y2-t.y2:0):(t.x1+=h.x11)for(let e=0;e{i>0&&(e.range([0,t.bandwidth()]),t=e)}))}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const s=Math.min(t.length,this._scales.length);for(let i=0;ithis._rawDomainIndex[t][e]-this._rawDomainIndex[t][i])))}this.transformScaleDomain(),this.event.emit(jd.scaleDomainUpdate,{model:this}),this.event.emit(jd.scaleUpdate,{model:this,value:"domain"})}getLabelItems(t){const e=[];let i=[];return this._scales.forEach(((s,n)=>{var r;const a=this._tickDataMap[n],o=null===(r=null==a?void 0:a.getLatestData())||void 0===r?void 0:r.length,l=o?a.getLatestData().map((t=>t.value)):s.domain();if(l&&l.length)if(i&&i.length){const s=[],n=[];i.forEach((e=>{l.forEach((i=>{const r=Ra(e).concat(i);if(n.push(r),o){const e=WE(i,this._getNormalizedValue(r,t));s.push(e)}}))})),o&&e.push(s.filter((t=>t.value>=0&&t.value<=1))),i=n}else l.forEach((t=>{i.push(t)})),o&&e.push(a.getLatestData().map((e=>WE(e.value,this._getNormalizedValue([e.value],t)))).filter((t=>t.value>=0&&t.value<=1)))})),e.reverse()}_updateRawDomain(){this._rawDomainIndex=[];const t=this._spec.domain;for(let e=0;ethis._rawDomainIndex[e][t]=i))}}_clearRawDomain(){this._rawDomainIndex=[]}}function dP(t){if(Wo(t))return[t,t,t,t];if(y(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(ns(t)){const{top:e=0,right:i=0,bottom:s=0,left:n=0}=t;return[e,i,s,n]}return[0,0,0,0]}function cP(){h_(),aM(),mk(),Nv()}function uP(){h_(),aM(),zx(),Nv()}cP();class pP extends Pk{getStartAngle(){return Lt(this._startAngle)}getEndAngle(){return Lt(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},pP.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(Wo(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(Ha(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var n,r;const a=Gr.line(Object.assign(Object.assign({points:t},y(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),Im(null==s?void 0:s.line)||(a.states=y(s.line)?null!==(r=s.line[e])&&void 0!==r?r:s.line[s.line.length-1]:s.line),this.add(a),this.lines.push(a)}))}else{let t=Gr.line;Ra(i)[0].cornerRadius&&(t=Gr.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Ra(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),Im(null==s?void 0:s.line)||(e.states=[].concat(s.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:s=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:d=0,refY:c=0,refAngle:u=0,style:p,symbolType:g,size:m=12}=t;let _,f;"start"===i?(_={x:l.x+(Wo(r)?d*Math.cos(r)+c*Math.cos(r-Math.PI/2):0),y:l.y+(Wo(r)?d*Math.sin(r)+c*Math.sin(r-Math.PI/2):0)},f=this._computeStartRotate(this._startAngle)):(_={x:h.x+(Wo(a)?d*Math.cos(a)+c*Math.cos(a-Math.PI/2):0),y:h.y+(Wo(a)?d*Math.sin(a)+c*Math.sin(a-Math.PI/2):0)},f=this._computeEndRotate(this._endAngle)),n=Gr.symbol(Object.assign(Object.assign(Object.assign({},_),{symbolType:g,size:m,angle:s?f+u:0,strokeBoundsBuffer:0}),p)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),Im(null==o?void 0:o.symbol)||(n.states=o.symbol),"start"===i?Im(null==o?void 0:o.startSymbol)||(n.states=o.startSymbol):Im(null==o?void 0:o.endSymbol)||(n.states=o.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let s;return s=e?Wo(i)?t[i]:Ha(t):t,this._mainSegmentPoints=s,s}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let s=t;if(e.visible){const i=e.clip?e.size||10:0;s=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...s.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};s=[...s.slice(0,s.length-1),n]}return s}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],s=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[n.x-s.x,n.y-s.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}function gP(t,e){return[t[0]*e,t[1]*e]}function mP(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}var _P,fP;pP.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background",t.axisLabelBackground="axis-label-background"}(_P||(_P={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(fP||(fP={}));const vP={[fP.selectedReverse]:{},[fP.selected]:{},[fP.hover]:{},[fP.hoverReverse]:{}},yP={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}};function bP(){h_(),py(),Nv(),JM(),of()}var xP=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);ne(C.attribute,t,new Be)}this._bgRect=t}}else{const o=Object.assign(Object.assign({text:ns(s)&&"type"in s&&"text"===s.type?s.text:s,visible:M(s)&&!1!==u,lineHeight:null==n?void 0:n.fontSize},n),{x:k,y:0});P(o.lineHeight)&&(o.lineHeight=n.fontSize),C=y.createOrUpdateChild("tag-text",o,"text"),Im(null==p?void 0:p.text)||(C.states=p.text);const c=qk(o.text,n,null===(e=null===(t=this.stage)||void 0===t?void 0:t.getTheme())||void 0===e?void 0:e.text),g=c.width,w=c.height;x+=g;const T=null!==(i=r.size)&&void 0!==i?i:10,L=h(T)?T:Math.max(T[0],T[1]);S+=Math.max(w,r.visible?L:0);const{textAlign:E,textBaseline:D}=n;(M(l)||M(d))&&(M(l)&&xd&&(x=d,C.setAttribute("maxLineWidth",d-f[1]-f[2])));let O=0,R=0,I=0;"left"===E||"start"===E?I=1:"right"===E||"end"===E?I=-1:"center"===E&&(I=0),I?I<0?(O-=x,b&&b.setAttribute("x",(b.attribute.x||0)-g),y.setAttribute("x",-f[1]-A)):I>0&&y.setAttribute("x",f[3]):(O-=x/2,b&&b.setAttribute("x",(b.attribute.x||0)-g/2),y.setAttribute("x",-A/2));const B="right"===_||"end"===_,F="left"===_||"start"===_;if((_?"center"===_:m)&&I){const t=x-f[1]-f[3],e=g+A,i=1===I?(t-e)/2+A+g/2:f[0]+A-(x/2+e/2-A)+g/2;if(C.setAttributes({x:i,textAlign:"center"}),b){const t=i-g/2-A+L/2;b.setAttributes({x:t})}}if(F&&1!==I){const t=x-f[1]-f[3],e=0===I?-t/2+A/2:-x+f[3]+f[1]+A,i=e+A;if(C.setAttributes({x:i,textAlign:"left"}),b){const t=e+L/2;b.setAttributes({x:t})}}if(B&&-1!==I){const t=x-f[1]-f[3],e=0===I?t/2+A/2:t;if(C.setAttributes({x:e,textAlign:"right"}),b){const t=e-g-A+L/2;b.setAttributes({x:t})}}"middle"===D?(R-=S/2,b&&b.setAttribute("y",0)):"bottom"===D?(R-=S,b&&b.setAttribute("y",-w/2),y.setAttribute("y",-f[2])):"top"===D&&(y.setAttribute("y",f[0]),b&&b.setAttribute("y",w/2));const{visible:Y}=a,j=xP(a,["visible"]);if(u&&v(Y)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},j),{visible:Y&&!!s,x:O,y:R,width:x,height:S}),"rect");if(Im(null==p?void 0:p.panel)||(t.states=p.panel),j.customShape){const e=j.customShape;t.pathProxy=t=>e(C.attribute,t,new Be)}this._bgRect=t}}this._textShape=C,this._symbol=b,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:E({},SP.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(s=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===s?void 0:s.slice())&&void 0!==n?n:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(d=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==d?d:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.clearStates(),null===(u=this._symbol)||void 0===u||u.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}SP.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const MP=(t=0)=>{if(t<0)for(;t<0;)t+=ot;else if(t>0)for(;t>ot;)t-=ot;return t};function kP(t,e,i){return!cd(t,e,0,1e-6)&&!dd(t,i,0,1e-6)}function AP(t,e,i,s){const n=__(Object.assign({text:i},s)),r=n.width(),a=n.height(),o=MP(Math.atan2(e[1],e[0]))-Math.PI,l=3*Math.PI/4,h=Math.PI/4,d=Math.PI/2,c=t.x;let u=0;u=kP(o,-l,-h)?((o+l)/d-.5)*r:kP(o,h,l)?(.5-(o-h)/d)*r:Math.cos(o)>=0?.5*r:.5*-r;const p=c-u,g=t.y;let m=0;return m=kP(o,-l,-h)?.5*-a:kP(o,h,l)?.5*a:Math.cos(o)>=0?(.5-(h-o)/d)*a:(.5-MP(o-l)/d)*a,{x:p,y:g-m}}function wP(t){const e={};return Yk(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}function TP(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function CP(t,e,i,s=!1,n=!1){const r=[e.x-i.x,e.y-i.y];return gP(r,(s?-1:1)*(n?-1:1)*t/mP(r))}function LP(t,e,i,s,n){const r=[],a=n-s;for(let n=0;n{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}const PP=(t,e,i)=>{const s=t.target;return s!==i&&s.name&&!Im(s.states)?(s.addState(Uk.hover,!0),Yk(e,(t=>{t!==s&&t.name&&!Im(t.states)&&t.addState(Uk.hoverReverse,!0)})),s):i},DP=(t,e,i)=>i?(Yk(e,(t=>{t.name&&!Im(t.states)&&(t.removeState(Uk.hoverReverse),t.removeState(Uk.hover))})),null):i,OP=(t,e,i)=>{const s=t.target;return i===s&&s.hasState(Uk.selected)?(Yk(e,(t=>{t.name&&!Im(t.states)&&(t.removeState(Uk.selectedReverse),t.removeState(Uk.selected))})),null):s.name&&!Im(s.states)?(s.addState(Uk.selected,!0),Yk(e,(t=>{t!==s&&t.name&&!Im(t.states)&&t.addState(Uk.selectedReverse,!0)})),s):i};class RP extends Pk{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=PP(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=DP(0,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=OP(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=k(this.attribute);E(this.attribute,t);const i=Gr.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&wP(this._innerView),this.removeAllChild(!0),this._innerView=Gr.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:s,line:n,items:r}=this.attribute,a=Gr.group({x:0,y:0,zIndex:1,pickable:!1});if(a.name=_P.axisContainer,a.id=this._getNodeId("container"),a.setMode(this.mode),this.axisContainer=a,t.add(a),n&&n.visible&&this.renderLine(a),r&&r.length&&(this.data=this._transformItems(r[0]),s&&s.visible&&this.renderTicks(a),i&&i.visible)){const t=Gr.group({x:0,y:0,pickable:!1});t.name=_P.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,a.add(t),r.forEach(((e,i)=>{const s=this.renderLabels(t,e,i),n=s.getChildren();this.beforeLabelsOverlap(n,e,s,i,r.length),this.handleLabelsOverlap(n,e,s,i,r.length),this.afterLabelsOverlap(n,e,s,i,r.length);let a=0,o=0,l="center",h="middle",d=0;n.forEach(((t,e)=>{var i;const s=t.attribute,n=null!==(i=s.angle)&&void 0!==i?i:0,r=t.AABBBounds;let c=r.width(),u=r.height();n&&(c=Math.abs(c*Math.cos(n)),u=Math.abs(u*Math.sin(n))),a=Math.max(a,c),o=Math.max(o,u),l=s.textAlign,h=s.textBaseline,0===e&&(d=s.x)})),this.axisLabelLayerSize[i]={width:a,height:o,labelPos:d,textAlign:l,textBaseline:h}}))}e&&e.visible&&this.renderTitle(a)}renderTicks(t){const e=this.getTickLineItems(),i=Gr.group({x:0,y:0,pickable:!1});i.name=_P.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach(((t,s)=>{var n;const r=Gr.line(Object.assign({},this._getTickLineAttribute("tick",t,s,e)));if(r.name=_P.tick,r.id=this._getNodeId(t.id),Im(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))r.states=$k;else{const t=this.data[s],e=E({},$k,this.attribute.tick.state);Object.keys(e).forEach((i=>{rs(e[i])&&(e[i]=e[i](t.rawValue,s,t,this.data))})),r.states=e}i.add(r)})),this.tickLineItems=e;const{subTick:s}=this.attribute;if(s&&s.visible){const t=this.getSubTickLineItems();t.length&&t.forEach(((t,n)=>{const r=Gr.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(r.name=_P.subTick,r.id=this._getNodeId(`${n}`),Im(s.state))r.states=$k;else{const i=E({},$k,s.state);Object.keys(i).forEach((s=>{rs(i[s])&&(i[s]=i[s](t.value,n,t,e))})),r.states=i}i.add(r)})),this.subTickLineItems=t}}renderLabels(t,e,i){const{dataFilter:s}=this.attribute.label;s&&rs(s)&&(e=s(e,i));const n=this._transformItems(e),r=Gr.group({x:0,y:0,pickable:!1});return r.name=`${_P.labelContainer}-layer-${i}`,r.id=this._getNodeId(`label-container-layer-${i}`),t.add(r),n.forEach(((t,e)=>{var s;const a=Qk(this._getLabelAttribute(t,e,n,i));if(a.name=_P.label,a.id=this._getNodeId(`layer${i}-label-${t.id}`),Im(null===(s=this.attribute.label)||void 0===s?void 0:s.state))a.states=$k;else{const s=E({},$k,this.attribute.label.state);Object.keys(s).forEach((r=>{rs(s[r])&&(s[r]=s[r](t,e,n,i))})),a.states=s}r.add(a)})),r}renderTitle(t){const e=this.getTitleAttribute(),i=new SP(Object.assign({},e));i.name=_P.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return TP(t,this.getVerticalVector(e,i,t))}getTextAlign(t){let e="center";return hd(t[0],0)?hd(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:s,inside:n=!1,length:r,dataFilter:a}=t;let o=1;return e.length>=2&&(o=e[1].value-e[0].value),(a&&rs(a)?a(e):e).forEach((t=>{let e=t.point,a=t.value;if(!s){const i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),a=i}const l=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const s=this.getVerticalVector(r,n,e);let o=0,h=0;ht(s[0])>ht(s[1])?o=rt/2*(l.x>e.x?1:-1):h=rt/2*(l.y>e.y?-1:1),i.push({start:e,end:l,value:a,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else i.push({start:e,end:l,value:a,id:`tick-${t.id}`})})),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:n=2}=t,r=this.tickLineItems,a=r.length;if(a>=2)for(let t=0;t0&&(0===p[1]?c+=(this.axisLabelLayerSize[s-1].height+Gd(this.attribute,"label.space",4))*s:c+=(this.axisLabelLayerSize[s-1].width+Gd(this.attribute,"label.space",4))*s);const g=this.getVerticalCoord(t.point,c,o),m=this.getVerticalVector(c||1,o,g),_=l?l(`${t.label}`,t,e,i,s):t.label;let{style:f}=this.attribute.label;return f=rs(f)?E({},yP.label.style,f(t,e,i,s)):f,f=E(this.getLabelAlign(m,o,f.angle),f),rs(f.text)&&(f.text=f.text({label:t.label,value:t.rawValue,index:t.index,layer:s})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(g,m,_,f)),{text:null!=d?d:_,_originText:t.label,lineHeight:null==f?void 0:f.fontSize,type:h}),f)}getLabelPosition(t,e,i,s){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}function IP(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(r=e.centerX,a=e.centerY,o=e.angle,l=t.attribute.x,h=t.attribute.y,{x:(r-l)*Math.cos(o)+(a-h)*Math.sin(o)+l,y:(r-l)*Math.sin(o)+(h-a)*Math.cos(o)+h}),s=i.x-e.centerX,n=i.y-e.centerY;var r,a,o,l,h;e.x1+=s,e.x2+=s,e.y1+=n,e.y2+=n,e.centerX+=s,e.centerY+=n,t.rotatedBounds=e}))}const BP={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,s)=>s&&FP(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function FP(t,e,i){const s=t.AABBBounds,n=e.AABBBounds;return i>Math.max(n.x1-s.x2,s.x1-n.x2,n.y1-s.y2,s.y1-n.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function YP(t,e){for(let i,s=1,n=t.length,r=t[0];s1&&e.height()>1}function HP(t){for(let s=1;s[e.x-t.x,e.y-t.y];s&&(s.save(),s.fillStyle="red",s.globalAlpha=.6,n.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore(),s.save(),s.fillStyle="green",s.globalAlpha=.6,r.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore());const o=fa(t),l=fa(e);s&&s.fillRect(o.x,o.y,2,2),s&&s.fillRect(l.x,l.y,2,2);const h=a(o,l),d=a(n[0],n[1]),c=a(n[1],n[2]),u=a(r[0],r[1]),p=a(r[1],r[2]),g=i?t.angle:At(t.angle);let m=i?t.angle+at:At(90-t.angle);const _=i?e.angle:At(e.angle);let f=i?e.angle+at:At(90-e.angle);m>lt&&(m-=lt),f>lt&&(f-=lt);const v=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(ma(n,i)+ma(n,s))/2>ma(n,h)};return v((t.x2-t.x1)/2,g,u,p)&&v((t.y2-t.y1)/2,m,u,p)&&v((e.x2-e.x1)/2,_,d,c)&&v((e.y2-e.y1)/2,f,d,c)}(e.rotatedBounds,i.rotatedBounds,!0)))return!0;var e,i;return!1}function zP(t,e){"bottom"!==t&&"top"!==t||function(t,e){e.forEach((e=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},VP(t,e.attribute.angle)),{angle:NP(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},WP(t,e.attribute.angle)),{angle:NP(e.attribute.angle)}))}))}(t,e),IP(e)}function NP(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function VP(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],s=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],s=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=NP(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}function WP(t,e=0){let i=["right","right","center","left","left","left","center","right","right"],s=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","left","center","right","right","right","center","left","left"],s=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);const n=(e=NP(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}class GP{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:s=1}=this.attribute,n=function(t){let e=mP(t);return e>0&&(e=1/e),[t[0]*e,t[1]*e]}(this.getRelativeVector());return gP([n[1],-1*n[0]],t*(e?1:-1)*s)}}const UP=["radius","startAngle","endAngle",...sn];class $P extends hn{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=xn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return Qi(this).circle}updateAABBBounds(t,e,i,s){if(!oi.graphicService.validCheck(t,e,i,this))return i;this.updatePathProxyAABBBounds(i)||(s?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=oi.graphicService.updateTempAABBBounds(i);return Vv(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),oi.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:s=e.radius}=t;return i.set(-s,-s,s,s),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:s=e.startAngle,endAngle:n=e.endAngle,radius:r=e.radius}=t;return n-s>lt-nt?i.set(-r,-r,r,r):$s(s,n,r,i),i}needUpdateTags(t){return super.needUpdateTags(t,UP)}needUpdateTag(t){return super.needUpdateTag(t,UP)}toCustomPath(){var t,e,i;const s=this.attribute,n=null!==(t=s.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),r=null!==(e=s.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=s.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new Be;return o.arc(0,0,n,r,a),o}clone(){return new $P(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return $P.NOWORK_ANIMATE_ATTR}}function KP(t){return new $P(t)}$P.NOWORK_ANIMATE_ATTR=ln;const XP=new class{constructor(){this.time=te.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{radius:_=l.radius,startAngle:f=l.startAngle,endAngle:v=l.endAngle,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:S=l.scaleX,scaleY:M=l.scaleY}=t.attribute,k=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=La(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),e.arc(i,s,_+d*h,f,v),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=y,e.setStrokeStyle(t,n,(b-i)/S,(x-s)/M,l[r]),l[r].opacity=a,e.stroke()}};g&&k(u,"outerBorder"),m&&k(p,"innerBorder")}},qP=To,ZP=uo;var JP=function(t,e){return function(i,s){e(i,s,t)}};let QP=class extends vo{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=xn,this.builtinContributions=[XP,ZP,qP],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=Qi(t,null==r?void 0:r.theme).circle,{radius:h=l.radius,startAngle:d=l.startAngle,endAngle:c=l.endAngle,x:u=l.x,y:p=l.y}=t.attribute,g=this.valid(t,l,a,o);if(!g)return;const{fVisible:m,sVisible:_,doFill:f,doStroke:v}=g;e.beginPath(),e.arc(i,s,h,d,c),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,v,m,_,l,n,a,o),f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,p-s,l),e.fill())),v&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,f,v,m,_,l,n,a,o)}draw(t,e,i,s){const n=Qi(t,null==s?void 0:s.theme).circle;this._draw(t,n,!1,i,s)}};QP=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),JP(0,$(X)),JP(0,K(to)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],QP);let tD=!1;const eD=new B((t=>{tD||(tD=!0,t(QP).toSelf().inSingletonScope(),t(er).to(QP).inSingletonScope(),t(ir).toService(er),t(to).toService(po),Z(t,to))}));let iD=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=xn}};iD=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(er)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],iD);let sD=!1;const nD=new B(((t,e,i,s)=>{sD||(sD=!0,t(Y_).to(iD).inSingletonScope(),t(Z_).toService(Y_))}));let rD=class extends Fv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=xn}};rD=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(er)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],rD);let aD=!1;const oD=new B(((t,e,i,s)=>{aD||(aD=!0,t(w_).to(rD).inSingletonScope(),t(M_).toService(w_))}));function lD(){lD.__loaded||(lD.__loaded=!0,Gr.RegisterGraphicCreator("circle",KP),Di.load(eD),Di.load(S_?nD:oD))}lD.__loaded=!1;const hD=lD;function dD(){h_(),aM(),JM(),of()}var cD=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);ni?Math.min(s.x2-i,s.width()):0:s.x1{v+=this.axisLabelLayerSize[e].width+(i>0?t:0)}))}let y=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));const b=y+v+r,x=this.getVerticalCoord(_,b,!1),S=this.getVerticalVector(b,!1,{x:0,y:0});let M,k,{angle:A}=u;if(M="start"===n?"start":"end"===n?"end":"center",P(A)&&o){A=function(t,e,i){const s=function(t,e){const[i,s]=t,[n,r]=e,a=Math.sqrt((i*i+s*s)*(n*n+r*r)),o=a&&(i*n+s*r)/a;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),n=yt(t,e)>=0;return i?n?2*Math.PI-s:s:n?s:2*Math.PI-s}(f,[1,0],!0);const{verticalFactor:t=1}=this.attribute;k=1==-1*t?"bottom":"top"}else M=this.getTextAlign(S),k=this.getTextBaseline(S,!1);let w=c;if(P(w)){const{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,s=Math.min(t||1/0,e||1/0);if(Wo(s))if("bottom"===i||"top"===i)if(A!==Math.PI/2){const t=Math.abs(Math.cos(null!=A?A:0));w=t<1e-6?1/0:this.attribute.end.x/t}else w=s-b;else if(A&&0!==A){const t=Math.abs(Math.sin(A));w=t<1e-6?1/0:this.attribute.end.y/t}else w=s-b}const T=Object.assign(Object.assign(Object.assign({},x),u),{maxWidth:w,textStyle:Object.assign({textAlign:M,textBaseline:k},a),state:{text:E({},vP,d.text),shape:E({},vP,d.shape),panel:E({},vP,d.background)}});return T.angle=A,l&&l.visible&&(T.shape=Object.assign({visible:!0},l.style),l.space&&(T.space=l.space)),h&&h.visible&&(T.panel=Object.assign({visible:!0},h.style)),T}getTextBaseline(t,e){let i="middle";const{verticalFactor:s=1}=this.attribute,n=(e?1:-1)*s;return hd(t[1],0)?i=!hd(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const s=this.attribute.orient;if(["top","bottom","right","left"].includes(s)||0===t[0]&&0===t[1]){if("top"===s||"bottom"===s)return VP(e?"bottom"===s?"top":"bottom":s,i);if("left"===s||"right"===s)return WP(e?"left"===s?"right":"left":s,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,s,n){var r,a,o,l;const{flush:h=!1}=this.attribute.label||{};if(h&&t.length){const{orient:e,start:i,end:s}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=Ia(t),c=n?h.attribute.x>d.attribute.x:h.attribute.yo&&(e.attribute.angle?e.setAttributes({dx:(null!==(a=e.attribute.dx)&&void 0!==a?a:0)+o-u}):e.setAttributes({x:o,textAlign:"right"}))}else{const t=c?d:h,e=c?h:d,n=t.AABBBounds.y2,r=e.AABBBounds.y1,a=i.y,u=s.y;ru&&(t.attribute.angle?t.setAttributes({dy:(null!==(l=t.attribute.dy)&&void 0!==l?l:0)+u-n}):t.setAttributes({y:u,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,s,n){if(Im(t))return;const{verticalLimitSize:r,label:a,orient:o}=this.attribute,l=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:u,limitEllipsis:p,autoHide:g,autoHideMethod:m,autoHideSeparation:_,lastVisible:f}=a;if(rs(h))h(t,e,s,this);else{if(d&&function(t,e){if(Im(t))return;const{orient:i,labelRotateAngle:s=[0,45,90]}=e;if(0===s.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(s&&s.length>0&&(r=s.length);n{t.attribute.angle=At(e)})),zP(i,t),!HP(t))break}}(t,{labelRotateAngle:c,orient:o}),u&&Wo(l)&&l>0){const e="left"===o||"right"===o,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);!function(t,e){const{limitLength:i,verticalLimitLength:s,ellipsis:n="...",orient:r,axisLength:a}=e;if(Im(t)||!Wo(i))return;const o=Math.sin(Math.PI/10);t.forEach((t=>{var e;const l=t.attribute.angle,h=!P(l),d=h?Math.cos(l):1,c=h?Math.sin(l):0,u=!h||Math.abs(c)<=o,p=h&&Math.abs(d)<=o,g="top"===r||"bottom"===r;if(g){if(p&&Math.floor(t.AABBBounds.height())<=i)return;if(u&&Math.floor(t.AABBBounds.width())<=s)return}const m=t.attribute.direction;if(!g){if("vertical"===m&&Math.floor(t.AABBBounds.height())<=s)return;if("vertical"!==m){if(u&&Math.floor(t.AABBBounds.width())<=i)return;if(p&&Math.floor(t.AABBBounds.height())<=s)return}}let _=null;if(u||p)_=g?u?s:i:"vertical"===m||p?s:i;else if(g){const{x1:e,x2:s}=t.AABBBounds,n=c/d;_=n>0&&e<=a&&i/n+e>a?(a-e)/Math.abs(d):n<0&&s>=0&&i/n+s<0?s/Math.abs(d):Math.abs(i/c)}else _=Math.abs(i/d);Wo(t.attribute.maxLineWidth)&&(_=Wo(_)?Math.min(t.attribute.maxLineWidth,_):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:_,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})}))}(t,{limitLength:l,verticalLimitLength:e?i/t.length:g||d?1/0:i/t.length,ellipsis:p,orient:o,axisLength:i})}g&&function(t,e){if(Im(t))return;const i=t.filter(jP);if(Im(i))return;let s;s=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(i),IP(s);const{method:n="parity",separation:r=0}=e,a=rs(n)?n:BP[n]||BP.parity;if(s.length>=3&&YP(s,r)){do{s=a(s,r)}while(s.length>=3&&YP(s,r));if(s.length<3||e.lastVisible){const t=Ia(i);if(!t.attribute.opacity){const e=s.length;if(e>1){t.setAttribute("opacity",1);for(let i=e-1;i>=0&&FP(s[i],t,r);i--)s[i].setAttribute("opacity",0)}}}}i.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}(t,{orient:o,method:m,separation:_,lastVisible:f})}}afterLabelsOverlap(t,e,i,s,n){const{verticalLimitSize:r,orient:a}=this.attribute,o="bottom"===a||"top"===a,l=i.AABBBounds;let h=o?l.height():l.width();const{verticalMinSize:d}=this.attribute;if(Wo(d)&&(!Wo(r)||d<=r)){const t=this._getAxisLabelLimitLength(d,n);let e,s;h=Math.max(h,t),"left"===a?(e=l.x2-h,s=l.y1):"right"===a?(e=l.x1,s=l.y1):"top"===a?(e=l.x1,s=l.y2-h):"bottom"===a&&(e=l.x1,s=l.y1);const r=Gr.rect({x:e,y:s,width:o?l.width():h,height:o?h:l.height(),pickable:!1});r.name=_P.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(M(this.attribute.label.containerAlign)){let e;"left"===a?e=l.x2-h:"right"===a?e=l.x1:"top"===a?e=l.y2-h:"bottom"===a&&(e=l.y1),function(t,e,i,s,n){"left"===s||"right"===s?"left"===n?t.forEach((t=>{var i;t.setAttributes({dx:(null!==(i=t.attribute.dx)&&void 0!==i?i:0)+e-t.AABBBounds.x1})})):"right"===n?t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i-t.AABBBounds.x2})})):"center"===n&&t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.x1+t.AABBBounds.x2)/2})})):"bottom"!==s&&"top"!==s||("top"===n?t.forEach((t=>{var i;t.setAttributes({dy:(null!==(i=t.attribute.dy)&&void 0!==i?i:0)+e-t.AABBBounds.y1})})):"bottom"===n?t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i-t.AABBBounds.y2})})):"middle"===n&&t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.y1+t.AABBBounds.y2)/2})})))}(t,e,h,a,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,s,n,r,a;const{label:o,title:l,line:h,tick:d}=this.attribute,c=null!==(i=o.space)&&void 0!==i?i:4;let u=t,p=0,g=0;const m=h&&h.visible?null!==(s=h.style.lineWidth)&&void 0!==s?s:1:0,_=d&&d.visible?null!==(n=d.length)&&void 0!==n?n:4:0;if(l&&l.visible&&"string"==typeof l.text){p=qk(l.text,l.textStyle,null===(a=null===(r=this.stage)||void 0===r?void 0:r.getTheme())||void 0===a?void 0:a.text).height;const t=dP(l.padding);g=l.space+t[0]+t[2]}return u&&(u=(u-c-g-p-m-_)/e),u}}uD.defaultAttributes=yP,XA(uD,GP);class pD{isInValidValue(t){const{startAngle:e=Vk,endAngle:i=Wk}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=Vk,endAngle:i=Wk,center:s,radius:n,inside:r=!1,innerRadius:a=0}=this.attribute;return Tt(s,r&&a>0?a:n,e+(i-e)*t)}getVerticalVector(t,e=!1,i){return CP(t,i,this.attribute.center,e,this.attribute.inside)}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}dD(),hD();class gD extends RP{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},gD.defaultAttributes,t))}renderLine(t){const{startAngle:e=Vk,endAngle:i=Wk,radius:s,center:n,innerRadius:r=0,line:a={},inside:o=!1,sides:l}=this.attribute;let h,d=s,c=r;if(o&&r>0&&(d=r,c=0),Wo(l)&&l>=3){const t=LP(n,l,d,e,i);h=Gr.path(Object.assign(Object.assign({},a.style),{path:EP(t,!0)}))}else{const t=Object.assign(Object.assign(Object.assign({},n),{startAngle:e,endAngle:i,radius:d,innerRadius:c}),a.style);h=Gr.circle(t)}h.name=_P.line,h.id=this._getNodeId("line"),Im(a.state)||(h.states=E({},vP,a.state)),t.add(h)}getTitleAttribute(){var t,e,i;const{center:s,radius:n,innerRadius:r=0}=this.attribute,a=this.attribute.title,{space:o=4,textStyle:l={},shape:h,background:d,state:c={}}=a,u=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n=2){const i=this.data[1].value-this.data[0].value,h=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t0&&t[1]>Math.abs(t[0])?e="top":t[1]<0&&Math.abs(t[1])>Math.abs(t[0])&&(e="bottom"),e}beforeLabelsOverlap(t,e,i,s,n){}handleLabelsOverlap(t,e,i,s,n){}afterLabelsOverlap(t,e,i,s,n){}getLabelAlign(t,e,i){return{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,s){return AP(t,e,i,s)}}gD.defaultAttributes=yP,XA(gD,pD);class mD extends Jm{parseAddition(t){return super.parseAddition(t),this.scale(t.scale),this}scale(t){if(this.spec.scale){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this.detach(t),this.spec.scale=void 0}const e=S(t)?this.view.getScaleById(t):t;return this.spec.scale=e,this.attach(e),this._updateComponentEncoders(),this.commit(),this}getScale(){return S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale}}const _D=(t,e,i,s,n,r)=>{var a;const o=t.getCoordinateAxisPosition();n&&"auto"===n.position&&(n.position=i?"content":o);const l=t.getCoordinateAxisPoints(s);if(l){const s={start:l[0],end:l[1],verticalFactor:("top"===o||"left"===o?-1:1)*(i?-1:1)*((null===(a=t.getSpec().range)||void 0===a?void 0:a.reversed)?-1:1)};if(r&&"polar"===e.type){const t=e.angle();s.center=e.origin(),s.startAngle=t[0],s.endAngle=t[1]}return s}const h=e.radius(),d=e.angle();return{center:e.origin(),radius:h[1],innerRadius:h[0],inside:i,startAngle:d[0],endAngle:d[1]}};class fD extends mD{constructor(t,e,i){super(t,qd.axis,e),this.spec.componentType=qd.axis,this.mode=i}parseAddition(t){return super.parseAddition(t),this.axisType(t.axisType),this.tickCount(t.tickCount),this.inside(t.inside),this.baseValue(t.baseValue),this}scale(t){return super.scale(t),this._axisComponentType=null,this}axisType(t){return this.spec.axisType=t,this._axisComponentType=null,this._prepareRejoin(),this.commit(),this}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=pc.createGraphicComponent(this._getAxisComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}getAxisComponentType(){return this._axisComponentType}_updateComponentEncoders(){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=Object.assign({update:{}},this.spec.encode),i=Object.keys(e).reduce(((i,s)=>{const n=e[s];return n&&(i[s]={callback:(e,i,s)=>{var r,a;const o=this.spec.skipTheme?null:this.view.getCurrentTheme();let l=Lm(n,e,i,s);const h=Np(this.spec.inside,s,e,i),d=Np(this.spec.baseValue,s,e,i),c=null===(r=null==t?void 0:t.getCoordinate)||void 0===r?void 0:r.call(t);c&&(l=Object.assign(_D(t,c,h,d,this.spec.layout),l));const u=null===(a=null==t?void 0:t.getScale)||void 0===a?void 0:a.call(t),p=Np(this.spec.tickCount,s,e,i);switch(this._getAxisComponentType()){case Jd.lineAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.axis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p);case Jd.circleAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleAxis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p)}return l}}),i}),{});this._encoders=i}_getAxisComponentType(){var t;if(this._axisComponentType)return this._axisComponentType;let e=this.spec.axisType;if(P(e)){const i=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;e=(null===(t=null==i?void 0:i.getCoordinate)||void 0===t?void 0:t.call(i))?i.getCoordinateAxisPoints()?"line":"circle":"line"}return this._axisComponentType="circle"===e?Jd.circleAxis:Jd.lineAxis,this._axisComponentType}}fD.componentType=qd.axis;const vD=()=>{pc.registerGraphicComponent(Jd.lineAxis,((t,e)=>new uD(t,e))),pc.registerComponent(qd.axis,fD)},yD=()=>{pc.registerGraphicComponent(Jd.circleAxis,(t=>new gD(t))),pc.registerComponent(qd.axis,fD)};function bD(t,e,i,s){let n="";if(!t||0===e.length)return n;const r=e[0],a=ae.distancePP(t,r),o=i?0:1;return s?n+=`M${t.x},${t.y-a}A${a},${a},0,0,${o},${t.x},${t.y+a}A${a},${a},0,0,${o},${t.x},${t.y-a}Z`:e.forEach(((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${a},${a},0,0,${o},${t.x},${t.y}`})),n}function xD(t,e,i){const{type:s,closed:n}=i,r=e.slice(0).reverse();let a="",o="";if("line"===s&&i.smoothLink&&i.center){const e=t[0],s=r[0],l=i.center;a=EP(t,!!n),o=EP(r,!!n);const h=ae.distancePP(s,l),d=ae.distancePP(e,l);a+=`A${h},${h},0,0,1,${s.x},${s.y}L${s.x},${s.y}`,o+=`A${d},${d},0,0,0,${e.x},${e.y}`}else if("circle"===s){const{center:e}=i;a=bD(e,t,!1,!!n),o=bD(e,r,!0,!!n)}else"line"!==s&&"polygon"!==s||(a=EP(t,!!n),o=EP(r,!!n));return n?a+=o:(o="L"+o.substring(1),a+=o,a+="Z"),a}class SD extends Pk{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this._prevInnerView=this._innerView&&wP(this._innerView),this.removeAllChild(!0),this._innerView=Gr.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){return TP(t,this.getVerticalVector(e,i,t))}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){const i=E({},this.attribute,this.getGridAttribute(t)),{type:s,items:n,style:r,closed:a,alternateColor:o,depth:l=0}=i,h=t?`${_P.grid}-sub`:`${_P.grid}`;if(n.forEach(((t,i)=>{const{id:n,points:o}=t;let d="";if("line"===s||"polygon"===s)d=EP(o,!!a);else if("circle"===s){const{center:t}=this.attribute;d=bD(t,o,!1,!!a)}const c=Gr.path(Object.assign({path:d,z:l},rs(r)?E({},this.skipDefault?null:SD.defaultAttributes.style,r(t,i)):r));c.name=`${h}-line`,c.id=this._getNodeId(`${h}-path-${n}`),e.add(c)})),l&&"line"===s&&n.forEach(((t,i)=>{const{id:s,points:n}=t,o=[];o.push(n[0]);const d=n[1].x-n[0].x,c=n[1].y-n[0].y,u=Math.sqrt(d*d+c*c),p=l/u;o.push({x:n[0].x+d*p,y:n[0].y+c*p});const g=EP(o,!!a),m=ht(o[0].x-o[1].x),_=ht(o[0].y-o[1].y),f=Gr.path(Object.assign({path:g,z:0,alpha:m>_?(n[1].x-n[0].x>0?-1:1)*rt/2:0,beta:m<_?-rt/2:0,anchor3d:m>_?[o[0].x,0]:[0,o[0].y]},rs(r)?E({},this.skipDefault?null:SD.defaultAttributes.style,r(t,i)):r));f.name=`${h}-line`,f.id=this._getNodeId(`${h}-path-${s}`),e.add(f)})),n.length>1&&o){const t=y(o)?o:[o,"transparent"],s=e=>t[e%t.length];for(let t=0;t=2&&(t=this.data[1].value-this.data[0].value),t}_getPointsOfSubGrid(t,e){const i=this.data.length,s=[];return i>=2&&this.data.forEach((i=>{let n=i.value;if(!e){const e=i.value-t/2;if(this.isInValidValue(e))return;n=e}s.push({value:n})})),s}release(){super.release(),this._prevInnerView=null,this._innerView=null}}SD.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}},h_(),MM();class MD extends SD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},SD.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if("line"===t){const{length:t}=this.attribute;i=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:s=6,startAngle:n=Vk,endAngle:r=Wk}=this.attribute;i=LP(t,s,ae.distancePP(t,e),n,r)}return i}getGridAttribute(t){const{type:e,alignWithLabel:i=!0}=this.attribute,s=this._parseTickSegment();let n,r=[];if(t){n=E({},this.attribute,this.attribute.subGrid);const t=[],{count:a=4}=this.attribute.subGrid||{};if(this.data.length>=2){const n=this._getPointsOfSubGrid(s,i);for(let i=0;i{let{point:r}=n;if(!i){const t=n.value-s/2;if(this.isInValidValue(t))return;r=this.getTickCoord(t)}t.push({id:n.label,datum:n,points:this._getGridPoint(e,r)})})),r=t}return Object.assign(Object.assign({},n),{items:r})}}XA(MD,GP);h_(),MM();class kD extends SD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},SD.defaultAttributes,t),e)}getGridAttribute(t){let e,i=[];const s=this.attribute,{radius:n,innerRadius:r=0,startAngle:a=Vk,endAngle:o=Wk,center:l,subGrid:h}=s,d=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n=2){const e=this._getPointsOfSubGrid(p,c);for(let i=0;i{let{point:i}=e;if(!c){const t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,u,!0);t.push({id:e.id,points:[i,s],datum:e})})),i=t}return Object.assign(Object.assign({},e),{items:i,center:l,type:"line"})}}XA(kD,pD);class AD extends mD{constructor(t,e,i){super(t,qd.grid,e),this.spec.componentType=qd.grid,this.mode=i}parseAddition(t){return super.parseAddition(t),this.target(t.target),this.gridType(t.gridType),this.gridShape(t.gridShape),this}scale(t){return super.scale(t),this._gridComponentType=null,this}gridType(t){return this.spec.gridType=t,this._gridComponentType=null,this._prepareRejoin(),this.commit(),this}gridShape(t){return this.spec.gridShape=t,this.commit(),this}target(t){if(this.spec.target){const t=S(this.spec.target)?this.view.getMarkById(this.spec.target):this.spec.target;this.detach(t)}this.spec.target=t;const e=S(t)?this.view.getMarkById(t):t;return this.attach(e),this._targetAxis=e,this._gridComponentType=null,this._updateComponentEncoders(),this.commit(),this}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=pc.createGraphicComponent(this._getGridComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=this.spec.skipTheme?null:this.view.getCurrentTheme();let h,d=Lm(s,t,e,i);const c=Np(this.spec.baseValue,i,t,e);if(this._targetAxis){const t=null===(n=this._targetAxis.getSpec())||void 0===n?void 0:n.scale;h=S(t)?this.view.getScaleById(t):t;const e=this._targetAxis.elements[0];if(e)switch(this._getGridComponentType()){case Qd.lineAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),start:e.getGraphicAttribute("start"),end:e.getGraphicAttribute("end"),verticalFactor:null!==(r=e.getGraphicAttribute("verticalFactor"))&&void 0!==r?r:1},d);break;case Qd.circleAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),center:e.getGraphicAttribute("center"),radius:e.getGraphicAttribute("radius"),innerRadius:e.getGraphicAttribute("innerRadius"),inside:e.getGraphicAttribute("inside"),startAngle:e.getGraphicAttribute("startAngle"),endAngle:e.getGraphicAttribute("endAngle")},d)}}else{h=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;const s=Np(this.spec.inside,i,t,e),n=null===(a=null==h?void 0:h.getCoordinate)||void 0===a?void 0:a.call(h);n&&(d=Object.assign(_D(h,n,s,c,this.spec.layout,!0),d))}this._getGridComponentType()===Qd.lineAxisGrid&&(d="line"!==this.spec.gridShape&&this.spec.gridShape?Object.assign({center:d.start,closed:!0},d,{type:this.spec.gridShape}):Object.assign({},d,{type:"line"}));const u=null===(o=null==h?void 0:h.getScale)||void 0===o?void 0:o.call(h),p=Np(this.spec.tickCount,i,t,e);switch(this._getGridComponentType()){case Qd.lineAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.grid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p);case Qd.circleAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleGrid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p)}return d}}),e}),{});this._encoders=e}_getGridComponentType(){var t;if(this._gridComponentType)return this._gridComponentType;if(this.spec.gridType)"circle"===this.spec.gridType?this._gridComponentType=Qd.circleAxisGrid:this._gridComponentType=Qd.lineAxisGrid;else if(this._targetAxis)switch(this._targetAxis.getAxisComponentType()){case Jd.circleAxis:this._gridComponentType=Qd.circleAxisGrid;break;case Jd.lineAxis:default:this._gridComponentType=Qd.lineAxisGrid}else if(this.spec.scale){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this._gridComponentType=(null===(t=null==e?void 0:e.getCoordinate)||void 0===t?void 0:t.call(e))?e.getCoordinateAxisPoints()?Qd.lineAxisGrid:Qd.circleAxisGrid:Qd.lineAxisGrid}else this._gridComponentType=Qd.lineAxisGrid;return this._gridComponentType}}AD.componentType=qd.grid;const wD=()=>{pc.registerGraphicComponent(Qd.lineAxisGrid,((t,e)=>new MD(t,e))),pc.registerComponent(qd.grid,AD)},TD=()=>{pc.registerGraphicComponent(Qd.circleAxisGrid,((t,e)=>new kD(t,e))),pc.registerComponent(qd.grid,AD)},CD=(t,e,i,s)=>wE(t,e,i).map((t=>s?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])),LD=(t,e,i=0)=>Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2,ED=(t,e)=>t[1]{var i;const s=t.domain();if(!s.length)return[];const{tickCount:n,forceTickCount:r,tickStep:a,labelGap:o=4,axisOrientType:l,labelStyle:h}=e,d=(t=>["bottom","top","z"].includes(t))(l),c=t.range(),u=t.calculateWholeRangeSize();if(u<2)return e.labelLastVisible?xE([s[s.length-1]]):xE([s[0]]);let p;if(M(a))p=t.stepTicks(a);else if(M(r))p=t.forceTicks(r);else if(M(n)){const e=rs(n)?n({axisLength:u,labelStyle:h}):n;p=t.ticks(e)}else if(e.sampling){const n=(null!==(i=e.labelStyle.fontSize)&&void 0!==i?i:12)+2,r=Fa(c),a=Ba(c);if(s.length<=u/n){const i=(a-r)/s.length,n=CD(t,s,e,d),l=Math.min(...n.map((t=>t[2]))),h=DD(s,n,o,e.labelLastVisible,Math.floor(l/i),!1);p=t.stepTicks(h.step),e.labelLastVisible&&(h.delCount&&(p=p.slice(0,p.length-h.delCount)),p.push(s[s.length-1]))}else{const i=[s[0],s[Math.floor(s.length/2)],s[s.length-1]],n=CD(t,i,e,d);let l=null;n.forEach((t=>{l?l[2]0?Math.ceil(s.length*(o+l[2])/(a-r-o)):s.length-1;p=t.stepTicks(h),!e.labelLastVisible||p.length&&p[p.length-1]===s[s.length-1]||(p.length&&Math.abs(t.scale(p[p.length-1])-t.scale(s[s.length-1])){let a=0,o=0,l=-1,h=Number.MAX_VALUE;const d=s=>{let n=!0,r=0;do{r+sd(t)?1:-1));let u=c;do{if(u>c&&!r&&!d(u))u++;else{if(!s){o=u;break}{const s=t.length-1;let n,r=0;n=t.length%u>0?t.length-t.length%u+u:t.length;do{if(n-=u,n!==s&&!LD(e[n],e[s],i))break;r++}while(n>0);if(n===s){o=u,a=r;break}{const i=Math.floor(t.length/u)-r+1;if(i=0?ED(e[n-u],e[n]):t,c=Math.abs(t-d);if(cthis._scales[t];return{isContinuous:!1,dataToPosition:this.dataToPosition.bind(this),getScale:t,getBandwidth:(e=0)=>t(e).bandwidth(),getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>this._inverse,getSpec:()=>this._spec}}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,PD),t}transformScaleDomain(){this.updateFixedWholeLength()}updateFixedWholeLength(){if(this._scale){const{bandSize:t,maxBandSize:e,minBandSize:i}=this._getOuterBandSizeFromSpec();if(t&&this._scale.bandwidth(t),e&&this._scale.maxBandwidth(e),i&&this._scale.minBandwidth(i),this._scale.isBandwidthFixed()&&this._spec.autoRegionSize&&(t||e)){const i=mb(this._scale.domain().length,null!=t?t:e,this._scale.paddingInner(),this._scale.paddingOuter());["bottom","top"].includes(this._orient)?this._regions.forEach((t=>t.setMaxWidth(i))):["left","right"].includes(this._orient)&&this._regions.forEach((t=>t.setMaxHeight(i)))}}}_getOuterBandSizeFromSpec(){var t;let{bandSize:e,maxBandSize:i,minBandSize:s,bandSizeLevel:n=0}=this._spec;const{gap:r,extend:a=0}=null!==(t=this._spec.bandSizeExtend)&&void 0!==t?t:{};n=Math.min(n,this._scales.length-1);for(let t=n;t>0;t--){const o=this._scales[t],l=o.domain(),h=o.paddingInner(),d=o.paddingOuter(),c=e=>{const i=t===n?a:0;return P(r)||t{vD(),wD(),rP(),$l.registerComponent(OD.type,OD)},ID=Math.sqrt(50),BD=Math.sqrt(10),FD=Math.sqrt(2);class YD{constructor(){this._extend={},this.niceLabelFormatter=null}setExtraAttrFromSpec(){M(this._spec.nice)&&(this._nice=this._spec.nice),M(this._spec.zero)&&(this._zero=this._spec.zero),this._expand=this._spec.expand,this._domain=YE(this._spec)}transformScaleDomain(){this.setScaleNice()}setLinearScaleNice(){var t;if(!this._nice)return!1;let e=5;const i=this._spec.tick||{};if(Wo(i.forceTickCount))e=i.forceTickCount;else if(rs(i.tickCount)){const t=this._scale.range();let s=Math.abs(t[t.length-1]-t[0]);1===s&&this._option&&(s=Md(this._orient)?this._option.getChartViewRect().width:this._option.getChartViewRect().height),e=i.tickCount({axisLength:s,labelStyle:this._spec.label&&this._spec.label.style})}else e=Wo(i.tickCount)?i.tickCount:5;"accurateFirst"===this._spec.niceType&&(e=Math.max(5,e));const{min:s,max:n}=null!==(t=this._domain)&&void 0!==t?t:{};return P(s)&&P(n)&&P(this._softMaxValue)&&P(this._softMinValue)?this._scale.nice(e):(M(s)||M(this._softMinValue))&&P(n)&&P(this._softMaxValue)?this._scale.niceMax(e):!(!P(s)||!P(this._softMinValue)||!M(n)&&!M(this._softMaxValue))&&this._scale.niceMin(e)}setLogScaleNice(){var t;if(!this._nice)return!1;const{min:e,max:i}=null!==(t=this._domain)&&void 0!==t?t:{};return P(e)&&P(i)&&P(this._softMaxValue)&&P(this._softMinValue)?this._scale.nice():(M(e)||M(this._softMinValue))&&P(i)&&P(this._softMaxValue)?this._scale.niceMax():!(!P(e)||!P(this._softMinValue)||!M(i)&&!M(this._softMaxValue))&&this._scale.niceMin()}setScaleNice(){return"log"===this._spec.type?this.setLogScaleNice():this.setLinearScaleNice()}dataToPosition(t,e){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){const e=[];return t.length?t.forEach((t=>{const{min:i,max:s}=t;e[0]=void 0===e[0]?i:Math.min(e[0],i),e[1]=void 0===e[1]?s:Math.max(e[1],s)})):(e[0]=0,e[1]=0),this.setSoftDomainMinMax(e),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this._expand)return;let e=t[0],i=t[t.length-1];e===i&&(0===i?i=1:i>0?e=0:i<0&&(i=0)),M(this._expand.min)&&(t[0]=e-(i-e)*this._expand.min),M(this._expand.max)&&(t[t.length-1]=i+(i-e)*this._expand.max)}niceDomain(t){const{min:e,max:i}=YE(this._spec);if(M(e)||M(i)||"linear"!==this._spec.type)return t;if(Math.abs(Fa(t)-Ba(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[1]=1;else{let i=e/5;const s=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,s);i=(n>=ID?10:n>=BD?5:n>=FD?2:1)*Math.pow(10,s),t[0]=0,t[1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[1]*=-1)}return t}includeZero(t){this._zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(t[t.length-1],0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this.event.emit(jd.scaleUpdate,{model:this,value:"domain"})}extendDomain(t){let e;const i=t.length-1,s=t[0]-t[i]>0,n=s?i:0,r=s?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e=t[1]&&(t[1]=e),this._softMaxValue=e}}setZero(t){this._zero!==t&&(this._zero=t,this.updateScaleDomain())}updateScaleDomain(){if(!this.isSeriesDataEnable())return;const t=this.collectData(),e=this.computeLinearDomain(t);this.updateScaleDomainByModel(e)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this._updateNiceLabelFormatter(t),this._domainAfterSpec=this._scale.domain(),this.event.emit(jd.scaleDomainUpdate,{model:this}),this.event.emit(jd.scaleUpdate,{model:this,value:"domain"})}getDomainAfterSpec(){return this._domainAfterSpec}_updateNiceLabelFormatter(t){const e=Math.abs(t[1]-t[0]),i=Math.max(-Math.floor(Math.log10(e)),0)+2,s=Math.pow(10,i);this.niceLabelFormatter=t=>Wo(+t)?Math.round(+t*s)/s:t}}const jD=(t,e)=>{if(!Jh(t.type))return xE(t.domain());const i=t.range(),s=Math.abs(i[i.length-1]-i[0]);if(s<2)return xE([t.domain()[0]]);const{tickCount:n,forceTickCount:r,tickStep:a,noDecimals:o=!1,labelStyle:l}=e;let h;if(M(a))h=t.stepTicks(a);else if(M(r))h=t.forceTicks(r);else if("d3"===e.tickMode){const e=rs(n)?n({axisLength:s,labelStyle:l}):n;h=t.d3Ticks(null!=e?e:5,{noDecimals:o})}else{const i=rs(n)?n({axisLength:s,labelStyle:l}):n,r=rs(e.tickMode)?e.tickMode:void 0;h=t.ticks(null!=i?i:5,{noDecimals:o,customTicks:r})}if(e.sampling&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:i=4,labelFlush:s}=e;let n=wE(t,h,e).map(((t,e)=>({AABBBounds:t,value:h[e]})));for(;n.length>=3&&kE(n,i);)n=HD.parity(n);const r=n.map((t=>t.value));r.length<3&&s&&(r.length>1&&r.pop(),Ia(r)!==Ia(h)&&r.push(Ia(h))),h=r}return xE(h)},HD={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let i;return t.filter(((t,s)=>!(s&&ME(i.AABBBounds,t.AABBBounds,e)||(i=t,0))))}};class zD extends lP{constructor(){super(...arguments),this.type=r.cartesianLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new $b}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){var t,e;super.initScales();const i=[0,1];M(null===(t=this._domain)||void 0===t?void 0:t.min)&&(i[0]=this._domain.min),M(null===(e=this._domain)||void 0===e?void 0:e.max)&&(i[1]=this._domain.max),this._scale.domain(i)}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t.valueToPosition=this.valueToPosition.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,jD),t}}zD.type=r.cartesianLinearAxis,zD.specKey="axes",XA(zD,YD);const ND=()=>{vD(),wD(),rP(),$l.registerComponent(zD.type,zD)};class VD extends jL{constructor(){super(...arguments),this.type=_l.line,this.transformerConstructor=cE,this._sortDataByAxis=!1}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},i=null!==(t=this._spec.seriesMark)&&void 0!==t?t:"line";this.initLineMark(e,"line"===i),this.initSymbolMark(e,"point"===i)}initTooltip(){super.initTooltip();const{dimension:t,group:e,mark:i}=this._tooltipHelper.activeTriggerSet;this._lineMark&&(t.add(this._lineMark),e.add(this._lineMark)),this._symbolMark&&(i.add(this._symbolMark),e.add(this._symbolMark))}initMarkStyle(){this.initLineMarkStyle(this._direction),this.initSymbolMarkStyle()}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._lineMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("line"))||void 0===i?void 0:i(n,r),CL("line",this._spec,this._markAttributeContext))),this._symbolMark){const t=YL(this);this._symbolMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),CL("point",this._spec,this._markAttributeContext),t))}}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){var e;const i="point"!==(null===(e=this._spec)||void 0===e?void 0:e.seriesMark);return e=>{var s,n;return i&&"fill"===e&&(e="stroke"),null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._lineMark,this._symbolMark]}}VD.type=_l.line,VD.mark=WL,VD.transformerConstructor=cE,XA(VD,VL);const WD=(t,e)=>{var i;const s=t.spec,{regionId:n,regionIndex:r}=s;if(M(n)){const t=Ra(n);return null===(i=e.region)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Ra(r).map((t=>{var i;return null===(i=e.region)||void 0===i?void 0:i[t]})).filter(M)};class GD{constructor(t){this._option=t,this.type=t.type,this.seriesType=t.seriesType}initChartSpec(t){return this.transformSpec(t),this.transformModelSpec(t)}transformSpec(t){t.region&&0!==t.region.length||(t.region=[{}]),void 0===t.tooltip&&(t.tooltip={}),M(t.stackInverse)&&t.region.forEach((e=>{!M(e.stackInverse)&&(e.stackInverse=t.stackInverse)})),M(t.stackSort)&&t.region.forEach((e=>{!M(e.stackSort)&&(e.stackSort=t.stackSort)}))}transformModelSpec(t){return this.createSpecInfo(t,((e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})).transformSpec(n,t,s);Fy(t,r,l.spec),Fy(s,null!=a?a:r,Object.assign(Object.assign({},i),l))}))}createSpecInfo(t,e){var i,s;e||(e=(e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})),h=l.transformSpec(n,t,s);Fy(s,null!=a?a:r,Object.assign(Object.assign(Object.assign({},i),h),{theme:l.getTheme(n,t)}))});const n={};return this.forEachRegionInSpec(t,e,n),this.forEachSeriesInSpec(t,e,n),null===(i=n.series)||void 0===i||i.forEach(((t,e)=>{var i,s;const r=(null!==(s=null!==(i=WD(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[])[0];r&&(r.seriesIndexes||(r.seriesIndexes=[]),r.seriesIndexes.push(e),t.regionIndexes=r.regionIndexes.slice())})),this.forEachComponentInSpec(t,e,n),Object.values(null!==(s=n.component)&&void 0!==s?s:{}).forEach((t=>t.forEach(((t,e)=>{var i,s,r;if(t){if(!t.regionIndexes){const e=null!==(s=null!==(i=WD(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[];t.regionIndexes=e.map((t=>t.regionIndexes[0]))}if(!t.seriesIndexes){const e=((t,e)=>{var i;const s=t.spec,{seriesId:n,seriesIndex:r}=s;if(M(n)){const t=Ra(n);return null===(i=e.series)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Ra(r).map((t=>{var i;return null===(i=e.series)||void 0===i?void 0:i[t]})).filter(M)})(t,n);if(e)t.seriesIndexes=e.map((({seriesIndexes:t})=>t[0]));else{const e=new Set;(null!==(r=t.regionIndexes)&&void 0!==r?r:[]).forEach((t=>{var i,s;const r=null===(i=n.region)||void 0===i?void 0:i[t];null===(s=null==r?void 0:r.seriesIndexes)||void 0===s||s.forEach((t=>e.add(t)))})),t.seriesIndexes=Array.from(e)}}}})))),n}_isValidSeries(t){return!0}_getDefaultSeriesSpec(t){var e,i,s,n;return{dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:null!==(e=t.animation)&&void 0!==e?e:this._option.animation,animationThreshold:null!==(i=t.animationThreshold)&&void 0!==i?i:null===(n=(s=this._option).getTheme)||void 0===n?void 0:n.call(s).animationThreshold,animationAppear:t.animationAppear,animationDisappear:t.animationDisappear,animationEnter:t.animationEnter,animationUpdate:t.animationUpdate,animationExit:t.animationExit,animationNormal:t.animationNormal,animationState:t.animationState,extensionMark:t.extensionMark,large:t.large,largeThreshold:t.largeThreshold,progressiveStep:t.progressiveStep,progressiveThreshold:t.progressiveThreshold,background:t.seriesBackground,invalidType:t.invalidType,seriesField:t.seriesField,morph:t.morph,interactions:t.interactions}}forEachRegionInSpec(t,e,i){var s;return(null!==(s=t.region)&&void 0!==s?s:[]).map(((t,s)=>e($l.getRegionInType("region"),{spec:t,specPath:["region",s],type:"region",regionIndexes:[s]},i)))}forEachSeriesInSpec(t,e,i){var s;return(null!==(s=t.series)&&void 0!==s?s:[]).map(((t,s)=>e($l.getSeriesInType(t.type),{spec:t,specPath:["series",s],type:t.type,seriesIndexes:[s]},i)))}forEachComponentInSpec(t,e,i){var s,n,a;const o=[],l=$l.getComponents();let h,d,c,u;const p=[];for(let e=0;e0&&(g=!0,s.forEach((t=>{const s=$l.getComponentInKey(t.type);o.push(e(s,t,i))})))}if(d&&!g){const s=d.getSpecInfo(t,i);(null==s?void 0:s.length)>0&&(g=!0,s.forEach((t=>{const s=$l.getComponentInKey(t.type);o.push(e(s,t,i))})))}return c&&!g&&(null===(n=c.getSpecInfo(t,i))||void 0===n||n.forEach((t=>{o.push(e(c,t,i))}))),p.forEach((s=>{var n;null===(n=s.getSpecInfo(t,i))||void 0===n||n.forEach((t=>{o.push(e(s,t,i))}))})),null===(a=null==u?void 0:u.getSpecInfo(t,i))||void 0===a||a.forEach((t=>{o.push(e(u,t,i))})),o}transformSeriesSpec(t){const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}_findBandAxisBySeries(t,e,i){const s="horizontal"===(null==t?void 0:t.direction)?["left","right"]:["top","bottom"];return i.find((i=>{if(!s.includes(i.orient))return!1;if(M(i.seriesId)){if(Ra(i.seriesId).includes(null==t?void 0:t.id))return!0}else if(M(i.seriesIndex)){if(Ra(i.seriesIndex).includes(e))return!0}else if("band"===i.type)return!0;return!0}))}_applyAxisBandSize(t,e,i){const{barMaxWidth:s,barMinWidth:n,barWidth:r,barGapInGroup:a}=i;let o=!1;h(n)?(t.minBandSize=n,o=!0):h(r)?(t.minBandSize=r,o=!0):h(s)&&(t.minBandSize=s,o=!0),o&&(t.bandSizeLevel=Number.MAX_VALUE,t.bandSizeExtend={extend:e,gap:y(a)?a[a.length-1]:a})}}class UD extends GD{needAxes(){return!0}_isValidSeries(t){return!this.seriesType||t===this.seriesType}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{xField:t.xField,yField:t.yField,zField:t.zField,seriesField:t.seriesField,seriesStyle:t.seriesStyle,direction:t.direction,stack:t.stack,percent:t.percent,stackOffsetSilhouette:t.stackOffsetSilhouette,totalLabel:t.totalLabel,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e],this._transformAxisSpec(t)}_setDefaultXAxisSpec(t){return{orient:"bottom"}}_setDefaultYAxisSpec(t){return{orient:"left"}}_setDefaultZAxisSpec(t){return{orient:"z"}}_transformAxisSpec(t){if(this.needAxes()){t.axes||(t.axes=[]);const e={x:!1,y:!1,z:!1};t.axes.forEach((i=>{const{orient:s}=i;let n=null;"top"!==s&&"bottom"!==s||(e.x=!0,n=this._setDefaultXAxisSpec(t)),"left"!==s&&"right"!==s||(e.y=!0,n=this._setDefaultYAxisSpec(t)),"z"===s&&(e.z=!0,n=this._setDefaultZAxisSpec(t)),n&&Object.keys(n).forEach((t=>{P(i[t])&&(i[t]=n[t])})),Gd(i,"trimPadding")&&Tl(i,fy(this.type,t))})),e.x||t.axes.push(this._setDefaultXAxisSpec(t)),e.y||t.axes.push(this._setDefaultYAxisSpec(t)),t.zField&&!e.z&&t.axes.push(this._setDefaultZAxisSpec(t))}}}class $D extends UD{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"line",activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,lineLabel:t.lineLabel})}transformSpec(t){super.transformSpec(t),gy(t)}}class KD{get dataList(){return this._dataArr}constructor(t,e){this._dataArr=[],this._onError=e,this._dataSet=t}parseData(t){this._dataArr=[];const e=Ra(t);for(let t=0;t{e.markRunning()})),this._dataValueForEach(s,((t,e)=>{Bp(e,t,i)})),0))}_dataValueForEach(t,e){t.forEach(((t,i)=>{if(t instanceof R)return;const s=this.getSeriesData(t.id,i);s&&e(t,s,i)}))}getSeriesData(t,e){var i,s;if(!this._dataArr.length)return null;if("string"==typeof t){const e=this._dataArr.filter((e=>e.name===t));return e[0]?e[0]:(null===(i=this._onError)||void 0===i||i.call(this,`no data matches dataId ${t}!`),null)}return"number"==typeof e?this._dataArr[e]?this._dataArr[e]:(null===(s=this._onError)||void 0===s||s.call(this,`no data matches dataIndex ${e}!`),null):this._dataArr[0]}}class XD{constructor(t,e){this._scaleSpecMap=new Map,this._scaleMap=new Map,this._modelScaleSpecMap=new Map,this._markAttributeScaleMap=new Map,this._spec=null,this._chart=null,this.getStatisticalFields=t=>{const e=[];return this._scaleSpecMap.forEach(((i,s)=>{Jo(i.domain)&&i.domain.forEach((s=>{s.dataId===t&&s.fields.forEach((t=>{DT(e,[{key:t,operations:Jh(i.type)?["max","min"]:["values"]}])}))}))})),this._markAttributeScaleMap.forEach(((i,s)=>{const n=this.getScale(s);i.forEach((i=>{this._getSeriesBySeriesId(i.seriesId).getRawData().name===t&&i.field&&DT(e,[{key:i.field,operations:Jh(n.type)?["max","min"]:["values"]}])}))})),e},this._spec=t,this._chart=e,this._setAttrFromSpec()}_createFromSpec(t){if(!t.id)return null;let e=this._scaleMap.get(t.id);return e||(e="ordinal"===t.type&&"color"===t.id?ix("colorOrdinal"):ix(t.type)),e?(y(t.range)&&e.range(t.range),y(t.domain)&&(Jo(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),e):null}_setAttrFromSpec(){var t;if(!(null===(t=this._spec)||void 0===t?void 0:t.length))return;const e=new Map,i=new Map;this._spec.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._modelScaleSpecMap.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._scaleSpecMap=i,this._scaleMap=e}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(Dm(t,this._spec))return e;e.change=!0;for(let i=0;it.id===s.id));if(!r.id)return e.reMake=!0,e;if(r.type!==s.type)return e.reMake=!0,e;if(!Dm(r.specified,s.specified))return e.reMake=!0,e;s.range&&!Dm(s.range,n.range())&&(n.range(s.range),e.reRender=!0),Jo(s.domain)?e.reRender=!0:Dm(s.domain,n.domain())||(n.domain(s.domain),e.reRender=!0),this._scaleSpecMap.set(s.id,s)}return this._spec=t,e}registerModelScale(t){const e=this._createFromSpec(t);e&&(this._modelScaleSpecMap.set(t.id,t),this._scaleSpecMap.set(t.id,t),this._scaleMap.set(t.id,e))}removeModelScale(t){this._modelScaleSpecMap.forEach((e=>{t(e)&&(this._modelScaleSpecMap.delete(e.id),this._scaleSpecMap.delete(e.id),this._scaleMap.delete(e.id))}))}getScale(t){return this._scaleMap.get(t)}getScaleSpec(t){return this._scaleSpecMap.get(t)}_getSeriesByRawDataId(t){const e=this._chart.getAllSeries();for(let i=0;i{const s=this._scaleMap.get(i);if(!s)return;if(!Jo(e.domain))return e.domain&&0!==e.domain.length||s.domain(t),void this._updateMarkScale(i,s,s.domain().slice());let n;n=Jh(e.type)?[null,null]:new Set,e.domain.forEach((t=>{const i=this._getSeriesByRawDataId(t.dataId);if(!i)return;const s=Jh(e.type);t.fields.forEach((t=>{const e=i.getRawDataStatisticsByField(t,s);e&&(s?(P(n[0])?n[0]=e.min:n[0]=Math.min(e.min,n[0]),P(n[1])?n[1]=e.max:n[1]=Math.max(e.max,n[1])):e.values.forEach((t=>{n.add(t)})))}))}));const r=n;Jh(e.type)||(n=Array.from(n)),s.domain(n),this._updateMarkScale(i,s,r)}))}_updateMarkScale(t,e,i){const s=this._markAttributeScaleMap.get(t);s&&0!==s.length&&s.forEach((t=>{if(!t.field||!t.markScale||t.markScale===e)return;if(P(t.changeDomain)||"none"===t.changeDomain||P(t.seriesId))return void(Jh(e.type)?t.markScale.domain(i):e.domain(Array.from(i)));const s=this._getSeriesBySeriesId(t.seriesId),n=Jh(e.type),r=s.getRawDataStatisticsByField(t.field,n);if(!Im(r))return"expand"===t.changeDomain?(n?(i[0]=Math.min(i[0],r.min),i[1]=Math.max(i[1],r.max)):(r.values.forEach((t=>{i.add(t)})),i=Array.from(i)),void t.markScale.domain(i)):void("replace"!==t.changeDomain||(n?t.markScale.domain([r.min,r.max]):t.markScale.domain(r.values)));Jh(e.type)?t.markScale.domain(i):e.domain(Array.from(i))}))}registerMarkAttributeScale(t,e){const i=this._scaleMap.get(t.scale);let s=this._markAttributeScaleMap.get(t.scale);s||(s=[],this._markAttributeScaleMap.set(t.scale,s));let n=i;return(P(t.field)||!P(t.changeDomain)&&"none"!==t.changeDomain&&!P(e))&&(n=i.clone()),s.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:n})),n}}var qD=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{var t;return null!==(t=this._series)&&void 0!==t?t:[]},this.getRegionsInIndex=t=>t&&0!==t.length?this._regions.filter(((e,i)=>t.includes(i))):[this._regions[0]],this.getAllRegions=()=>this._regions,this.getRegionsInIds=t=>t?this._regions.filter((e=>t.includes(e.id))):[],this.getRegionsInQuerier=t=>t?this._regions.filter(((e,i)=>Ra(t).some((t=>M(t.regionId)&&t.regionId===e.userId||t.regionIndex===i)))):this._regions,this.getRegionsInUserId=t=>{if(t)return this._regions.find((e=>e.userId===t))},this.getRegionsInUserIdOrIndex=(t,e)=>this.getAllRegions().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponents=()=>this._components,this.getSeriesInIndex=t=>t&&0!==t.length?this._series.filter(((e,i)=>t.includes(i))):[this._series[0]],this.getSeriesInIds=t=>t?this._series.filter((e=>t.includes(e.id))):[],this.getSeriesInUserId=t=>{if(t)return this._series.find((e=>e.userId===t))},this.getSeriesInUserIdOrIndex=(t,e)=>this.getAllSeries().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponentByIndex=(t,e)=>{const i=this._components.filter((e=>(e.specKey||e.type)===t));if(i&&0!==i.length)return i[e]},this.getComponentsByKey=t=>this._components.filter((e=>(e.specKey||e.type)===t)),this.getComponentByUserId=t=>{const e=this._components.find((e=>e.userId===t));if(e)return e},this.getComponentsByType=t=>this._components.filter((e=>e.type===t)),this._paddingSpec=sl(null!==(i=t.padding)&&void 0!==i?i:e.getTheme().padding),this._event=new Vd(e.eventDispatcher,e.mode),this._dataSet=e.dataSet,this._chartData=new KD(this._dataSet,null===(s=this._option)||void 0===s?void 0:s.onError),this._modelOption=Object.assign(Object.assign({},e),{mode:this._option.mode,map:this._idMap,getChartLayoutRect:()=>this._layoutRect,getChartViewRect:()=>this._viewRect,getChart:()=>this,globalScale:this._globalScale,onError:null===(n=this._option)||void 0===n?void 0:n.onError,disableTriggerEvent:!0===(null===(r=this._option)||void 0===r?void 0:r.disableTriggerEvent),getSeriesData:this._chartData.getSeriesData.bind(this._chartData)}),this._spec=t}created(){this._transformer=new this.transformerConstructor(Object.assign(Object.assign({},this._option),{type:this.type,seriesType:this.seriesType})),this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._createBackground(),this._createLayout(),this._transformer.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),this._transformer.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),this._transformer.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}init(){var t,e;null===(t=this._beforeInit)||void 0===t||t.call(this),this._regions.forEach((t=>t.init({}))),this._series.forEach((t=>t.init({}))),this._components.forEach((t=>t.init({dataSet:this._dataSet}))),this._initEvent(),null===(e=this._initStack)||void 0===e||e.call(this),this.reDataFlow()}reDataFlow(){this._series.forEach((t=>{var e;return null===(e=t.getRawData())||void 0===e?void 0:e.markRunning()})),this._series.forEach((t=>t.fillData())),this.updateGlobalScaleDomain()}onResize(t,e,i=!0){const s={width:t,height:e};this._canvasRect=s,this._updateLayoutRect(this._option.viewBox),this.setLayoutTag(!0,null,i)}updateViewBox(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.setLayoutTag(!0,null,e)}_createBackground(){const t=this._spec.background;if(!t||"object"!=typeof t||M(t.gradient))return;const e=ZE(t,["x","y","width","height","x1","y1","image"]);e.background=t.image,this._backgroundMark=$l.createMark("group","chart-background",{model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._globalScale}),this._backgroundMark.created(),this._backgroundMark.setStyle(Object.assign(Object.assign({},e),{x:()=>this._viewBox.x1,y:()=>this._viewBox.y1,width:()=>this._viewBox.x2-this._viewBox.x1,height:()=>this._viewBox.y2-this._viewBox.y1}))}_createRegion(t,e){if(!t)return;const{spec:i}=e,s=qD(e,["spec"]),n=new t(i,Object.assign(Object.assign({},this._modelOption),s));n&&(n.created(),this._regions.push(n))}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=qD(e,["spec"]);let n;if(M(i.regionId)?n=this.getRegionsInUserId(i.regionId):M(i.regionIndex)&&(n=this.getRegionsInIndex([i.regionIndex])[0]),!n&&!(n=this._regions[0]))return;const r=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),s),{type:i.type,region:n,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));r&&(r.created(),this._series.push(r),n.addSeries(r))}getSeriesById(t){return this._series.find((e=>e.id===t))}_createComponent(t,e){const i=t.createComponent(e,Object.assign(Object.assign({},this._modelOption),{type:t.type,getAllRegions:this.getAllRegions,getRegionsInIndex:this.getRegionsInIndex,getRegionsInIds:this.getRegionsInIds,getRegionsInUserIdOrIndex:this.getRegionsInUserIdOrIndex,getAllSeries:this.getAllSeries,getSeriesInIndex:this.getSeriesInIndex,getSeriesInIds:this.getSeriesInIds,getSeriesInUserIdOrIndex:this.getSeriesInUserIdOrIndex,getAllComponents:this.getComponents,getComponentByIndex:this.getComponentByIndex,getComponentByUserId:this.getComponentByUserId,getComponentsByKey:this.getComponentsByKey,getComponentsByType:this.getComponentsByType}));i&&(i.created(),this._components.push(i))}getAllComponents(){return this._components}getAllModels(){return[].concat(this.getAllSeries(),this.getAllComponents(),this.getAllRegions())}getModelInFilter(t){if(S(t))return this.getAllModels().find((e=>e.userId===t));if(rs(t))return this.getAllModels().find((e=>t(e)));let e=0;return this.getAllModels().find((i=>{var s;if((null!==(s=i.specKey)&&void 0!==s?s:i.type)===t.type){if(e===t.index)return!0;e++}return!1}))}_createLayout(){this._updateLayoutRect(this._option.viewBox),this._initLayoutFunc()}setLayout(t){this._option.layout=t,this._initLayoutFunc()}_initLayoutFunc(){var t,e,i;if(this._layoutFunc=this._option.layout,!this._layoutFunc){let s=!1;(this._spec.zField||this._spec.series&&this._spec.series.some((t=>t.zField)))&&(s=!0);const n=$l.getLayoutInKey(null!==(e=null===(t=this._spec.layout)||void 0===t?void 0:t.type)&&void 0!==e?e:s?"layout3d":"base");if(n){const t=new n(this._spec.layout,{onError:null===(i=this._option)||void 0===i?void 0:i.onError});this._layoutFunc=t.layoutItems.bind(t)}}}layout(t){var e,i,s,n;if(null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeLayoutWithSceneGraph)||void 0===i||i.call(e),this.getLayoutTag()){this._event.emit(jd.layoutStart,{chart:this,vchart:this._option.globalInstance}),this.onLayoutStart(t);const e=this.getLayoutElements();this._layoutFunc(this,e,this._layoutRect,this._viewBox),this._event.emit(jd.afterLayout,{elements:e,chart:this}),this.setLayoutTag(!1),this.onLayoutEnd(t),this._event.emit(jd.layoutEnd,{chart:this,vchart:this._option.globalInstance})}null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterLayoutWithSceneGraph)||void 0===n||n.call(s)}onLayoutStart(t){this.getAllModels().forEach((e=>e.onLayoutStart(this._layoutRect,this._viewRect,t)))}onLayoutEnd(t){this.getAllModels().forEach((e=>{"series"!==e.modelType&&e.onLayoutEnd(t)}))}onEvaluateEnd(t){[...this._components,...this._regions,...this._series].forEach((e=>e.onEvaluateEnd(t)))}getLayoutElements(){return this.getAllModels().map((t=>t.layout)).filter((t=>!!t))}getModelById(t){const e=this._idMap.get(t);if(e&&e instanceof Yy)return e}getModelByUserId(t){const e=this.getSeriesInUserId(t);if(e)return e;const i=this.getRegionsInUserId(t);return i||(this.getComponentByUserId(t)||void 0)}getAllMarks(){return Array.from(this._idMap.values()).filter((t=>t&&t instanceof mx))}getMarkById(t){const e=this._idMap.get(t);if(e&&e instanceof mx)return e}updateData(t,e,i=!0,s){const n=this._dataSet.getDataView(t);n&&(n.markRunning(),n.parseNewData(e,s)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}updateFullData(t,e=!0){Ra(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&e.markRunning()})),Ra(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&Bp(e,t,!0)})),e&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}onRender(t){}setCanvasRect(t,e){this._canvasRect={width:t,height:e}}getCanvasRect(){return this._canvasRect||(this._canvasRect=my(this._spec,this._option,{width:nh,height:rh})),this._canvasRect}getSeriesData(t,e){return this._chartData.getSeriesData(t,e)}_transformSpecScale(){var t;const e=this._spec.scales?[...this._spec.scales]:[];let i=e.find((t=>"color"===t.id));const s=this.getColorScheme();if(!i&&(i={type:"ordinal",id:"color",domain:null,range:null},e.push(i),this._spec.color)){const t=this._spec.color;if(y(t))i.range=t;else{const e=t;Object.prototype.hasOwnProperty.call(e,"type")&&(i.type=e.type),Object.prototype.hasOwnProperty.call(e,"domain")&&(i.domain=e.domain),Object.prototype.hasOwnProperty.call(e,"range")&&(i.range=e.range),Object.prototype.hasOwnProperty.call(e,"specified")&&(i.specified=e.specified)}}return(null===(t=i.range)||void 0===t?void 0:t.length)||(i.range=xl(s),i.rangeTheme=!0),e}_createGlobalScale(){this._globalScale=new XD(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}updateGlobalScaleDomain(){const t=new Set;this._series.forEach((e=>{const i=e.getSeriesKeys();i&&i.forEach((e=>t.add(e)))}));const e=Array.from(t);this._globalScale.updateScaleDomain(e)}updateGlobalScale(t){_y(t,this._globalScale.updateSpec(this._transformSpecScale()))}updateGlobalScaleTheme(){const t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=xl(e),this._globalScale.getScale("color").range(t.range))}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(this.setLayoutTag(!0,null,!1),t.type!==this.type)return e.reMake=!0,e;const i=Object.keys(this._spec).sort(),s=Object.keys(t).sort();if(JSON.stringify(i)!==JSON.stringify(s))return e.reMake=!0,e;for(let s=0;s{_y(t,e.updateSpec(this._spec.region[e.getSpecIndex()]))})):t.reMake=!0)}updateComponentSpec(t){const e={},i={[r.title]:!0,[r.brush]:!0,[r.mapLabel]:!0};this._components.forEach((s=>{var n,a;if(s.type===r.label||s.type===r.totalLabel)return;i[s.type]&&(i[s.type]=!1);const o=s.specKey||s.type,l=null!==(n=this._spec[o])&&void 0!==n?n:{};y(l)?(e[o]=e[o]||{specCount:l.length,componentCount:0},e[o].componentCount++,_y(t,s.updateSpec(null!==(a=l[s.getSpecIndex()])&&void 0!==a?a:{},l))):_y(t,s.updateSpec(l))}));for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=e[i];s.componentCount!==s.specCount&&(t.reMake=!0)}Object.keys(i).forEach((e=>{if(i[e]){const i=this._spec[e];(y(i)?i.some((t=>null==t?void 0:t.visible)):null==i?void 0:i.visible)&&(t.reMake=!0)}}))}updateSeriesSpec(t){this._spec.series.length===this._series.length?this._series.forEach((e=>{const i=this._spec.series[e.getSpecIndex()];_y(t,e.updateSpec(i))})):t.reMake=!0}getCanvas(){var t,e;return null!==(e=null===(t=this.getCompiler())||void 0===t?void 0:t.getCanvas())&&void 0!==e?e:null}_updateLayoutRect(t){let e=this.getCanvasRect();if(t){this._viewBox=t;const{x1:i=0,y1:s=0,x2:n,y2:r}=t;e={width:n-i,height:r-s}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=il(this._paddingSpec,e,e),this._layoutRect.width=e.width-this.padding.left-this.padding.right,this._layoutRect.height=e.height-this.padding.top-this.padding.bottom,this._layoutRect.x=this.padding.left,this._layoutRect.y=this.padding.top,this._event.emit(jd.layoutRectUpdate,{chart:this})}setCurrentTheme(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this.reInit()}reInit(){[...this._regions,...this._series,...this._components].forEach((t=>{const e=t.getSpecInfo();e&&e.spec&&t.reInit(e.spec)}))}clear(){this.getAllModels().forEach((t=>{var e;return null===(e=t.clear)||void 0===e?void 0:e.call(t)}))}compile(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}afterCompile(){this.getAllRegions().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllSeries().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllComponents().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)}))}compileLayout(){const{width:t,height:e}=this.getCanvasRect();this.getCompiler().setSize(t,e)}compileBackground(){var t;this._backgroundMark&&(this._backgroundMark.compile(),null===(t=this._backgroundMark.getProduct())||void 0===t||t.configure({context:{model:this}}).layout((()=>{})))}compileRegions(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeRegionCompile)||void 0===e||e.call(t),this.getAllRegions().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterRegionCompile)||void 0===s||s.call(i)}compileSeries(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeSeriesCompile)||void 0===e||e.call(t),this.getAllSeries().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterSeriesCompile)||void 0===s||s.call(i)}compileComponents(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeComponentCompile)||void 0===e||e.call(t),this.getAllComponents().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterComponentCompile)||void 0===s||s.call(i)}release(){[...this._components,...this._regions,...this._series].forEach((t=>{t.beforeRelease()})),super.release(),this.clear(),[...this._components,...this._regions,...this._series].forEach((t=>{t.release()})),this._components=this._regions=this._series=[],this._spec={},this._dataSet=this._globalScale=this._layoutFunc=null,this._layoutTag=!1,this._idMap.clear()}onLayout(t){const e=t.rootMark;this.layout({group:e,srView:t})}updateState(t,e){const i=this.getAllSeries();for(const s in t){if(Im(t[s]))continue;const n=t[s];let r={stateValue:s};r=rs(n.filter)?Object.assign({filter:n.filter},r):Object.assign(Object.assign({},n.filter),r),n.level&&(r.level=n.level),i.forEach((t=>{t.getMarks().forEach((i=>{i.stateStyle[s]&&(e&&!e(t,i,s)||(i.state.changeStateInfo(r),i.updateMarkState(s)))}))}))}}setSelected(t,e,i){this._setStateInDatum(vy.STATE_SELECTED,!0,t,e,i)}setHovered(t,e,i){this._setStateInDatum(vy.STATE_HOVER,!0,t,e,i)}clearState(t){this.getAllRegions().forEach((e=>{e.interaction.clearEventElement(t,!0),e.interaction.resetInteraction(t,null)}))}clearSelected(){this.clearState(vy.STATE_SELECTED)}clearHovered(){this.clearState(vy.STATE_HOVER)}_initEvent(){[jd.dataZoomChange,jd.scrollBarChange].forEach((t=>{this._event.on(t,(({value:t})=>{this._disableMarkAnimation(["exit","update"]);const e=()=>{this._enableMarkAnimation(["exit","update"]),this._event.off(rc.AFTER_MARK_RENDER_END,e)};this._event.on(rc.AFTER_MARK_RENDER_END,e)}))}))}_enableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.enableAnimationState(t)}))}_disableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.disableAnimationState(t)}))}_setStateInDatum(t,e,i,s,n){const r=(i=i?Ra(i):null)?Object.keys(i[0]):null;this.getRegionsInQuerier(n).forEach((n=>{i?(n.getSeries().forEach((e=>{e.getMarks().forEach((a=>{if(a.getProduct()&&(!s||rs(s)&&s(e,a))){const e=a.getProduct().isCollectionMark(),s=a.getProduct().elements;let o=[];if(e)o=s.filter((t=>{const e=t.getDatum();i.every(((t,i)=>r.every((s=>t[s]==e[i][s]))))}));else if(i.length>1){const t=i.slice();o=s.filter((e=>{if(0===t.length)return!1;const i=e.getDatum(),s=t.findIndex((t=>r.every((e=>t[e]==i[e]))));return s>=0&&(t.splice(s,1),!0)}))}else{const t=s.find((t=>r.every((e=>i[0][e]==t.getDatum()[e]))));t&&(o=[t])}o.forEach((e=>{n.interaction.startInteraction(t,e)}))}}))})),e&&n.interaction.reverseEventElement(t)):n.interaction.clearEventElement(t,!0)}))}setDimensionIndex(t,e){var i,s,n,a;let o=null;Array.from(this._event.getComposedEventMap().values()).forEach((i=>{const{eventType:s,event:n}=i;if(s===Kh.dimensionHover||s===Kh.dimensionClick){const i=n.dispatch(t,e);(null==i?void 0:i.length)&&(o=i)}}));const l=P(t)||!o||o.every((t=>td(t.axis.getScale().type)&&P(t.index)));if(!1!==e.tooltip){const t=this.getComponentsByType(r.tooltip)[0];if(null==t?void 0:t.getVisible())if(l)null===(s=(i=t).hideTooltip)||void 0===s||s.call(i);else{const i={};o.forEach((t=>{const{axis:e,value:s,data:n}=t,r="left"===e.getOrient()||"right"===e.getOrient();n.forEach((t=>{var e,n,a;const o=r?t.series.fieldY[0]:t.series.fieldX[0];i[o]=null!==(a=null===(n=null===(e=t.datum)||void 0===e?void 0:e[0])||void 0===n?void 0:n[o])&&void 0!==a?a:s}))})),t.showTooltip(i,e.showTooltipOption)}}if(!1!==e.crosshair){const t=this.getComponentsByType(r.cartesianCrosshair)[0];t&&t.clearAxisValue&&t.setAxisValue&&(l?(null===(n=t.clearAxisValue)||void 0===n||n.call(t),null===(a=t.hide)||void 0===a||a.call(t)):o.forEach((e=>{const{axis:i,value:s}=e;t.clearAxisValue(),t.setAxisValue(s,i),t.layoutByValue()})))}}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}}const JD=(t,e)=>{const i={nodes:{}},{fields:s}=e;if(!(null==s?void 0:s.length))return i;const n=s.length-1;let r,a,o=i;return t.forEach((t=>{t.latestData&&t.latestData.forEach((t=>{o=i;for(let e=0;e{var e;const i=t.getSeries();if(!i.some((t=>t.getStack())))return;const s=i.some((t=>{var e,i;return null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.totalLabel)||void 0===i?void 0:i.visible})),n=s||i.some((t=>t.getPercent())),r=i.some((t=>t.getStackOffsetSilhouette())),a=IT(t,!0);for(const e in a)for(const i in a[e].nodes)jT(a[e].nodes[i],t.getStackInverse(),n,s);if(r)for(const t in a)for(const e in a[t].nodes)YT(a[t].nodes[e]);s&&t.getSeries().forEach((t=>{const e=t.getStackData(),i=t.getStackValue(),s=t.getStackValueField();e&&s&&FT(a[i],s)})),(null===(e=this._options)||void 0===e?void 0:e.afterStackRegion)&&this._options.afterStackRegion(t,a)},this._chart=t,this._options=e}init(){this._chart.getAllRegions().forEach((t=>{t.event.on(jd.regionSeriesDataFilterOver,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},this.stackRegion)}))}stackAll(){this._chart.getAllRegions().forEach((t=>{this.stackRegion({model:t})}))}}class tO{_beforeInit(){this._dataSet&&Ap(this._dataSet,"stackSplit",JD)}_initStack(){this._stack=new QD(this),this._stack.init()}}class eO extends ZD{constructor(){super(...arguments),this.transformerConstructor=$D,this.type="line",this.seriesType=_l.line}}eO.type="line",eO.seriesType=_l.line,eO.transformerConstructor=$D,XA(eO,tO);class iO extends GL{constructor(){super(...arguments),this.type=iO.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}_getIgnoreAttributes(){return[]}}iO.type="area";const sO=()=>{$l.registerMark(iO.type,iO),yx(),CS(),pc.registerGraphic(Xd.area,vS),OA(),IA(),kL()};class nO extends VT{constructor(){super(...arguments),this._getSeriesStyle=(t,e,i)=>{var s,n,r,a;for(const i of Ra(e)){let e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(!1!==e||"fill"!==i&&"stroke"!==i||(e="fill"===i?null===(r=null===(n=this.series.getSeriesStyle(t))||void 0===n?void 0:n("stroke"))||void 0===r?void 0:r[0]:null===(a=this.series.getSeriesStyle(t))||void 0===a?void 0:a("fill")),M(e))return e}return i}}}const rO=Object.assign(Object.assign(Object.assign({},iC),NL),{area:{name:"area",type:"area"}});class aO extends cE{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){var e,i,s;super._transformLabelSpec(t),this._addMarkLabelSpec(t,"area","areaLabel","initLineLabelMarkStyle",void 0,!0),!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)||this._addMarkLabelSpec(t,"area")}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o;super._transformSpecAfterMergingTheme(t,e,i);const{area:l={},line:h={},seriesMark:d}=t,c=!1!==l.visible&&!1!==(null===(s=l.style)||void 0===s?void 0:s.visible),u=!1!==h.visible&&!1!==(null===(n=h.style)||void 0===n?void 0:n.visible);l.support3d=!(!l.support3d&&!h.support3d),l.zIndex=M(l.zIndex)||M(h.zIndex)?Math.max(null!==(r=l.zIndex)&&void 0!==r?r:0,null!==(a=h.zIndex)&&void 0!==a?a:0):void 0,l.style&&delete l.style.stroke,l.state&&Object.keys(l.state).forEach((t=>{"style"in l.state[t]?delete l.state[t].style.stroke:delete l.state[t].stroke}));let p=l,g=h;("line"===d||u&&!c)&&(p=h,g=l),l.style=Tl({},g.style,p.style),l.state=Tl({},g.state,p.state),c||(l.style.fill=!1),u||(l.style.stroke=!1),!1===l.interactive&&(l.style.fillPickable=!1),!1===h.interactive&&(h.style.strokePickable=!1),l.interactive=!(!l.interactive&&null!==(o=h.interactive)&&void 0!==o&&!o),l.visible=!(!c&&!u),t.area=l,t.line=h}}class oO extends jL{constructor(){super(...arguments),this.type=_l.area,this.transformerConstructor=aO,this._sortDataByAxis=!1}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},s=this._spec.area||{},n=!1!==s.visible&&!1!==(null===(t=s.style)||void 0===t?void 0:t.visible),r=null!==(e=this._spec.seriesMark)&&void 0!==e?e:"area";this._areaMark=this._createMark(oO.mark.area,{groupKey:this._seriesField,defaultMorphElementKey:this.getDimensionField()[0],progressive:i,isSeriesMark:n&&"point"!==r,customShape:s.customShape,stateSort:s.stateSort}),this.initSymbolMark(i,"point"===r)}initMarkStyle(){this.initAreaMarkStyle(),this.initSymbolMarkStyle()}initAreaMarkStyle(){var t,e,i,s,n;const r=null!==(i=null===(e=null===(t=this.getSpec().area)||void 0===t?void 0:t.style)||void 0===e?void 0:e.curveType)&&void 0!==i?i:null===(n=null===(s=this.getSpec().line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.curveType,a=r===HL?"horizontal"===this._direction?"monotoneY":"monotoneX":r,o=this._areaMark;o&&("horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:t=>{var e,i;return sx(this.dataToPositionX1(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},"normal",Ly.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),y1:t=>{var e,i;return sx(this.dataToPositionY1(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Ly.Series),this.setMarkStyle(o,{fill:this.getColorAttribute(),stroke:this.getColorAttribute()},"normal",Ly.Series),"zero"!==this._invalidType&&this.setMarkStyle(o,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Ly.Series),this.setMarkStyle(o,{curveType:a},"normal",Ly.Built_In),Object.keys(o.stateStyle).forEach((t=>{o.stateStyle[t].stroke&&o.setPostProcess("stroke",(t=>[t,!1,!1,!1]),t)})))}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("line"))||void 0===e?void 0:e(n,r),CL("line",this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("area"))||void 0===i?void 0:i(n,r),CL("area",this._spec,this._markAttributeContext))),this._symbolMark){const t=YL(this);this._symbolMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),CL("point",this._spec,this._markAttributeContext),t))}}initTooltip(){this._tooltipHelper=new nO(this);const{dimension:t,group:e,mark:i}=this._tooltipHelper.activeTriggerSet;this._areaMark&&(t.add(this._areaMark),e.add(this._areaMark)),this._lineMark&&(t.add(this._lineMark),e.add(this._lineMark)),this._symbolMark&&(i.add(this._symbolMark),e.add(this._symbolMark))}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t),this.encodeDefined(this._areaMark,"defined")}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){return e=>{var i,s,n,r,a;const o=null!==(i=this._spec.seriesMark)&&void 0!==i?i:"area";let l=null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0;return"fill"!==e||l&&"line"!==o||(e="stroke",l=null!==(a=null===(r=this._seriesMark)||void 0===r?void 0:r.getAttribute(e,t))&&void 0!==a?a:void 0),"stroke"===e&&y(l)?l[0]:l}}}oO.type=_l.area,oO.mark=rO,oO.transformerConstructor=aO,XA(oO,VL);class lO extends UD{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,area:t.area,seriesMark:t.seriesMark,activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,areaLabel:t.areaLabel})}transformSpec(t){super.transformSpec(t),gy(t)}}class hO extends ZD{constructor(){super(...arguments),this.transformerConstructor=lO,this.type="area",this.seriesType=_l.area}}function dO(t,e=!0){return(i,s,n)=>{const r="vertical"===t.direction?t.yField:t.xField,a=null==i?void 0:i[r];return"vertical"===t.direction?{overall:e?t.growFrom():e,orient:a>0?"negative":"positive"}:{overall:!!e&&t.growFrom(),orient:a>0?"positive":"negative"}}}hO.type="area",hO.seriesType=_l.area,hO.transformerConstructor=lO,XA(hO,tO);const cO=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:dO(t,e)}),uO=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:dO(t,e)}),pO={type:"fadeIn"},gO={type:"growCenterIn"};function mO(t,e){if(!1===e)return{};switch(e){case"fadeIn":return pO;case"scaleIn":return gO;default:return cO(t)}}class _O extends mx{constructor(){super(...arguments),this.type=_O.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}_O.type="rect";const fO=()=>{$l.registerMark(_O.type,_O),jA(),SL()},vO=Object.assign(Object.assign({},iC),{bar:{name:"bar",type:"rect"},barBackground:{name:"barBackground",type:"rect"}}),yO=Object.assign(Object.assign({},iC),{bar3d:{name:"bar3d",type:"rect3d"}});function bO(t,e,i){var s,n;if(t.values.length>0){let r;if(t.sortDatums.length){let a=t.sortDatums;e&&(a=t.sortDatums.slice().reverse());for(let t=0;t{var a,o;const l=null===(o=(a=t[i.axisHelper]).getScale)||void 0===o?void 0:o.call(a,0);for(let a=0;athis._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[sC]):this._spec.barMinHeight?this._calculateRectPosition(t,!1):sx(this._dataToPosX(t),e),this._getBarXEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[nC]):sx(this._dataToPosX1(t),e),this._getBarYStart=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[rC]):this._spec.barMinHeight?this._calculateRectPosition(t,!0):sx(this._dataToPosY(t),e),this._getBarYEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[aC]):sx(this._dataToPosY1(t),e),this._getBarBackgroundXStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundXEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundYStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundYEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundPositionXEncoder=()=>{var t;return null===(t=this._barBackgroundPositionXEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionXEncoder=t=>{this._barBackgroundPositionXEncoder=t.bind(this)},this._getBarBackgroundPositionYEncoder=()=>{var t;return null===(t=this._barBackgroundPositionYEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionYEncoder=t=>{this._barBackgroundPositionYEncoder=t.bind(this)}}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._initBarBackgroundMark(i),this._barMark=this._createMark(Object.assign(Object.assign({},MO.mark.bar),{name:this._barMarkName,type:this._barMarkType}),{morph:PL(this._spec,this._barMarkName),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,progressive:i,customShape:null===(t=this._spec.bar)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.bar)||void 0===e?void 0:e.stateSort})}_initBarBackgroundMark(t){this._spec.barBackground&&this._spec.barBackground.visible&&(this._barBackgroundMark=this._createMark(MO.mark.barBackground,{dataView:this._barBackgroundViewData.getDataView(),dataProductId:this._barBackgroundViewData.getProductId(),progressive:t,customShape:this._spec.barBackground.customShape,stateSort:this._spec.barBackground.stateSort}))}initMarkStyle(){this._barMark&&this.setMarkStyle(this._barMark,{fill:this.getColorAttribute()},"normal",Ly.Series)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}initTooltip(){super.initTooltip();const{mark:t,group:e}=this._tooltipHelper.activeTriggerSet;this._barMark&&(t.add(this._barMark),e.add(this._barMark))}_statisticViewData(){var t,e;super._statisticViewData();const i=null!==(t=this._spec.barBackground)&&void 0!==t?t:{};if(!i.visible)return;const s=this._getRelatedComponentSpecInfo("axes").some((t=>t.type===r.cartesianBandAxis));let n;if(Ap(this._option.dataSet,"addVChartProperty",zT),s){const t=([t],{scaleDepth:e})=>{var i,s;let n=[{}];const r=this.getDimensionField(),a=P(e)?r.length:Math.min(r.length,e);for(let e=0;e{const i=[],[s,n]=this.getDimensionContinuousField(),r={};return e.latestData.forEach((t=>{const e=`${t[s]}-${t[n]}`;r[e]||(r[e]={[s]:t[s],[n]:t[n]},i.push(r[e]))})),i};Ap(this._option.dataSet,"dimensionItems",t);const e=this.getViewData();n=new R(this._option.dataSet).parse([e],{type:"dataview"}).transform({type:"dimensionItems"},!1).transform({type:"addVChartProperty",options:{beforeCall:JT.bind(this),call:QT}},!1),null==e||e.target.addListener("change",n.reRunAllTransform)}this._barBackgroundViewData=new KT(this._option,n)}init(t){var e,i;super.init(t),"vertical"===this.direction?"band"===(null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle():"band"===(null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle()}_shouldDoPreCalculate(){const t=this.getRegion();return this.getStack()&&t.getSeries().filter((t=>t.type===this.type&&t.getSpec().barMinHeight)).length}_calculateStackRectPosition(t){const e=this.getRegion();if(e._bar_series_position_calculated)return;let i,s,n,r,a;e._bar_series_position_calculated=!0,t?(i=aC,s=rC,n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(i=nC,s=sC,n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=IT(e,!1,(t=>t.type===this.type));for(const l in o)for(const h in o[l].nodes)bO(o[l].nodes[h],e.getStackInverse(),{isVertical:t,start:i,end:s,startMethod:n,endMethod:r,axisHelper:a})}_calculateRectPosition(t,e){var i,s;let n,r,a;e?(n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=null===(s=(i=this[a]).getScale)||void 0===s?void 0:s.call(i,0),l=this[a].isInverse(),h=this._spec.barMinHeight,d=sx(this[n](t),o),c=sx(this[r](t),o);let u=Math.abs(d-c);uthis._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n),y:t=>this._getPosition(this.direction,t),height:()=>this._getBarWidth(this._yAxisHelper),width:()=>{},y1:()=>{}},"normal",Ly.Series):this.setMarkStyle(this._barMark,{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r),x:t=>this._getPosition(this.direction,t),width:()=>this._getBarWidth(this._xAxisHelper),x1:()=>{},height:()=>{}},"normal",Ly.Series),this._initStackBarMarkStyle(),this._initBandBarBackgroundMarkStyle()}_initStackBarMarkStyle(){var t,e,i,s;if(!this._spec.stackCornerRadius)return;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);this._barMark.setClip((()=>{const t=[];return this._forEachStackGroup((e=>{let i=1/0,s=-1/0,a=!1,o=1/0,l=-1/0;e.values.forEach((t=>{const e=t[bT],n=t[xT],r=t[ST],h=t[MT];i=Math.min(i,e,n),s=Math.max(s,e,n),M(r)&&M(h)&&(a=!0,o=Math.min(o,r,h),l=Math.max(l,r,h))}));const h=Object.assign(Object.assign(Object.assign({},e.values[0]),{[bT]:i,[xT]:s}),a?{[ST]:o,[MT]:l}:void 0);t.push(Uv(Object.assign(Object.assign({},"horizontal"===this.direction?{x:this._getBarXStart(h,n),x1:this._getBarXEnd(h,n),y:this._getPosition(this.direction,h),height:this._getBarWidth(this._yAxisHelper)}:{y:this._getBarYStart(h,r),y1:this._getBarYEnd(h,r),x:this._getPosition(this.direction,h),width:this._getBarWidth(this._xAxisHelper)}),{cornerRadius:this._spec.stackCornerRadius,fill:!0})))})),t}))}initLinearRectMarkStyle(){var t,e,i,s;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);if("horizontal"===this.direction){const t=M(this._fieldY2)?{y:t=>sx(this._dataToPosY(t),r),y1:t=>sx(this._dataToPosY1(t),r)}:{y:t=>sx(this._dataToPosY(t)-this._getBarWidth(this._yAxisHelper)/2,r),height:t=>this._getBarWidth(this._yAxisHelper)};this.setMarkStyle(this._barMark,Object.assign({x:t=>this._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n)},t),"normal",Ly.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign({x:()=>this._getBarBackgroundXStart(n),x1:()=>this._getBarBackgroundXEnd(n)},t),"normal",Ly.Series)}else{const t=M(this._fieldX2)?{x:t=>sx(this._dataToPosX(t),n),x1:t=>sx(this._dataToPosX1(t),n)}:{x:t=>sx(this._dataToPosX(t)-this._getBarWidth(this._xAxisHelper)/2,n),width:t=>this._getBarWidth(this._xAxisHelper)};this.setMarkStyle(this._barMark,Object.assign(Object.assign({},t),{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r)}),"normal",Ly.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign(Object.assign({},t),{y:()=>this._getBarBackgroundYStart(r),y1:()=>this._getBarBackgroundYEnd(r)}),"normal",Ly.Series)}}_initBandBarBackgroundMarkStyle(){var t,e,i,s,n;if(!this._barBackgroundMark)return;const r=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),a=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0),o=null!==(n=this._spec.barBackground)&&void 0!==n?n:{},l=P(o.fieldLevel)?void 0:o.fieldLevel+1;"horizontal"===this.direction?this.setMarkStyle(this._barBackgroundMark,{x:()=>this._getBarBackgroundXStart(r),x1:()=>this._getBarBackgroundXEnd(r),y:t=>this._getPosition(this.direction,t,l,"barBackground"),height:()=>this._getBarWidth(this._yAxisHelper,l),width:()=>{},y1:()=>{}},"normal",Ly.Series):this.setMarkStyle(this._barBackgroundMark,{x:t=>this._getPosition(this.direction,t,l,"barBackground"),y:()=>this._getBarBackgroundYStart(a),y1:()=>this._getBarBackgroundYEnd(a),width:()=>this._getBarWidth(this._xAxisHelper,l),x1:()=>{},height:()=>{}},"normal",Ly.Series)}initAnimation(){var t,e;const i={yField:this._fieldY[0],xField:this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},s=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset,n=YL(this);this._barMark.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("bar"))||void 0===e?void 0:e(i,s),CL(this._barMarkName,this._spec,this._markAttributeContext),n))}_getBarWidth(t,e){var i,s;const n=this._groups?this._groups.fields.length:1,r=P(e)?n:Math.min(n,e),a=null!==(s=null===(i=t.getBandwidth)||void 0===i?void 0:i.call(t,r-1))&&void 0!==s?s:6,o=M(this._spec.barWidth)&&r===n,l=M(this._spec.barMinWidth),h=M(this._spec.barMaxWidth);let d=a;return o&&(d=rl(this._spec.barWidth,a)),l&&(d=Math.max(d,rl(this._spec.barMinWidth,a))),h&&(d=Math.min(d,rl(this._spec.barMaxWidth,a))),d}_getPosition(t,e,i,s){var n,r,a,o,l;let h,d,c;"horizontal"===t?(h=this.getYAxisHelper(),d="height",c="barBackground"===s?this.dataToBarBackgroundPositionY.bind(this):this.dataToPositionY.bind(this)):(h=this.getXAxisHelper(),d="width",c="barBackground"===s?this.dataToBarBackgroundPositionX.bind(this):this.dataToPositionX.bind(this));const u=h.getScale(0),p=this._groups?this._groups.fields.length:1,g=P(i)?p:Math.min(p,i),m=null!==(r=null===(n=h.getBandwidth)||void 0===n?void 0:n.call(h,g-1))&&void 0!==r?r:6,_=g===p?this._barMark.getAttribute(d,e):m;if(g>1&&M(this._spec.barGapInGroup)){const t=this._groups.fields,i=Ra(this._spec.barGapInGroup);let s=0,n=0;for(let r=t.length-1;r>=1;r--){const d=t[r],c=null!==(o=null===(a=h.getScale(r))||void 0===a?void 0:a.domain())&&void 0!==o?o:[],u=c.length,p=rl(null!==(l=i[r-1])&&void 0!==l?l:Ia(i),m),g=c.indexOf(e[d]);r===t.length-1?(s+=u*_+(u-1)*p,n+=g*(_+p)):(n+=g*(s+p),s+=s+(u-1)*p)}return u.scale(e[t[0]])+h.getBandwidth(0)/2-s/2+n}const f=Jh(u.type||"band");return c(e,g)+.5*(m-_)+(f?-m/2:0)}dataToBarBackgroundPositionX(t,e){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,e,this._getBarBackgroundPositionXEncoder,this._setBarBackgroundPositionXEncoder)}dataToBarBackgroundPositionY(t,e){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,e,this._getBarBackgroundPositionYEncoder,this._setBarBackgroundPositionYEncoder)}onLayoutEnd(t){super.onLayoutEnd(t),this.getRegion()._bar_series_position_calculated=!1,this._spec.sampling&&this.compile()}compile(){if(super.compile(),this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._barMark]}compileData(){var t;super.compileData(),null===(t=this._barBackgroundViewData)||void 0===t||t.compile()}fillData(){var t,e;super.fillData(),null===(e=null===(t=this._barBackgroundViewData)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._barBackgroundViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._barBackgroundViewData)||void 0===s||s.updateData()}release(){var t;super.release(),null===(t=this._barBackgroundViewData)||void 0===t||t.release(),this._barBackgroundViewData=null}}MO.type=_l.bar,MO.mark=vO,MO.transformerConstructor=SO;const kO=()=>{hE(),fO(),$l.registerAnimation("bar",((t,e)=>({appear:mO(t,e),enter:cO(t,!1),exit:uO(t,!1),disappear:uO(t)}))),RD(),ND(),$l.registerSeries(MO.type,MO)};class AO extends UD{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barMinHeight:t.barMinHeight,sampling:t.sampling,samplingFactor:t.samplingFactor,barBackground:t.barBackground,stackCornerRadius:t.stackCornerRadius})}transformSpec(t){super.transformSpec(t),gy(t)}_transformAxisSpec(t){var e,i;if(super._transformAxisSpec(t),!t.axes)return;const s=t.series.some((t=>"horizontal"===t.direction)),n=null!==(e=t.axes.find((t=>"band"===t.type)))&&void 0!==e?e:t.axes.find((t=>(s?["left","right"]:["top","bottom"]).includes(t.orient)));if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize&&t.autoBandSize){const e=ns(t.autoBandSize)&&null!==(i=t.autoBandSize.extend)&&void 0!==i?i:0,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o}=t.series.find((t=>"bar"===t.type));this._applyAxisBandSize(n,e,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}class wO extends ZD{constructor(){super(...arguments),this.transformerConstructor=AO,this.type="bar",this.seriesType=_l.bar}}wO.type="bar",wO.seriesType=_l.bar,wO.transformerConstructor=AO,XA(wO,tO);class TO extends mx{constructor(){super(...arguments),this.type=TO.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}}TO.type="rect3d";const CO=()=>{$l.registerMark(TO.type,TO),yx(),RM(),pc.registerGraphic(Xd.rect3d,wM),SL()};class LO extends MO{constructor(){super(...arguments),this.type=_l.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d"}}LO.type=_l.bar3d,LO.mark=yO;const EO=()=>{$l.registerAnimation("bar3d",((t,e)=>({appear:mO(t,e),enter:cO(t,!1),exit:uO(t,!1),disappear:uO(t)}))),CO(),RD(),ND(),$l.registerSeries(LO.type,LO)};class PO extends AO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup})}}class DO{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const s=this.pluginService.stage;if(this.option3d||(this.option3d=s.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=n/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,s.set3dOptions(this.option3d),s.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const OO=()=>{Gx(),$x(),Ug.registerPlugin("ViewTransform3dPlugin",DO)};class RO extends wO{constructor(){super(...arguments),this.transformerConstructor=PO,this.type="bar3d",this.seriesType=_l.bar3d}}RO.type="bar3d",RO.seriesType=_l.bar3d,RO.transformerConstructor=PO;const IO=[10,20],BO=Xh.Linear,FO="circle",YO=Xh.Ordinal,jO=["circle","square","triangle","diamond","star"],HO=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"},zO=Object.assign(Object.assign({},iC),{point:{name:"point",type:"symbol"}});class NO extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"point")}}class VO extends jL{constructor(){super(...arguments),this.type=_l.scatter,this.transformerConstructor=NO,this._invalidType="zero"}setAttrFromSpec(){super.setAttrFromSpec(),this._size=this._spec.size,this._sizeField=this._spec.sizeField,this._shape=this._spec.shape,this._shapeField=this._spec.shapeField}_getSeriesAttribute(t,e,{defaultScaleType:i,defaultRange:s},n){var r,a,o,l;if(rs(e))return e;if(y(e)){if(P(t))return null===(r=this._option)||void 0===r||r.onError(`${n}Field is required.`),e;if("ordinal"!==i&&e.length>2)return null===(a=this._option)||void 0===a||a.onError(`${n} length is invalid, specify up to 2 ${n}s.`),e;const s=`${sh}_series_scatter_${this.id}_scale_${n}`;return this._option.globalScale.registerModelScale({id:s,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:e}),{scale:s,field:t}}if(ns(e)){if(P(t))return null===(o=this._option)||void 0===o||o.onError(`${n}Field is required.`),e;const r=`${sh}_series_scatter_${this.id}_scale_${n}`,a=Object.assign({id:r,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:s},e);return this._option.globalScale.registerModelScale(a),{scale:a.id,field:t}}return null===(l=this._option)||void 0===l||l.onError(`${n} attribute is invalid.`),e}getSizeAttribute(t,e){return P(e)?10:h(e)?e:!S(e)||("string"!=typeof(i=e)||isNaN(Number(i))||isNaN(parseFloat(i)))?this._getSeriesAttribute(t,e,{defaultScaleType:BO,defaultRange:IO},"size"):parseFloat(e);var i}getShapeAttribute(t,e){return P(e)?FO:S(e)?e:this._getSeriesAttribute(t,e,{defaultScaleType:YO,defaultRange:jO},"shape")}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._symbolMark=this._createMark(VO.mark.point,{morph:PL(this._spec,VO.mark.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:i,isSeriesMark:!0,customShape:null===(t=this._spec.point)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.point)||void 0===e?void 0:e.stateSort})}initMarkStyle(){this.initSymbolMarkStyle()}initAnimation(){var t,e,i;const s=YL(this),n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._symbolMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("scatter"))||void 0===i?void 0:i({},n),CL("point",this._spec,this._markAttributeContext),s))}initSymbolMarkStyle(){const t=this._symbolMark;t&&("zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)}),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,fill:this.getColorAttribute(),size:h(this._size)||rs(this._size)?this._size:10,symbolType:S(this._shape)||rs(this._shape)?this._shape:FO},vy.STATE_NORMAL,Ly.Series),(M(this._sizeField)||M(this._size))&&this.setMarkStyle(t,{size:this.getSizeAttribute(this._sizeField,this._size)},vy.STATE_NORMAL,Ly.User_Mark),(M(this._shapeField)||M(this._shape))&&this.setMarkStyle(t,{symbolType:this.getShapeAttribute(this._shapeField,this._shape)},vy.STATE_NORMAL,Ly.User_Mark))}initTooltip(){super.initTooltip(),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t);const e=[this.getDimensionField()[0],this.getStackValueField()].every((t=>{var e,i,s;return t&&(null===(s=null===(i=null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[t])||void 0===s?void 0:s.allValid)}));"zero"===this._invalidType||e?this.setMarkStyle(this._symbolMark,{visible:!0},"normal",Ly.Series):this.setMarkStyle(this._symbolMark,{visible:this._getInvalidDefined.bind(this)},"normal",Ly.Series),this._symbolMark.getProduct()&&this._symbolMark.compileEncode()}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null},vy.STATE_NORMAL,Ly.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},vy.STATE_NORMAL,Ly.Series))}handleZoom(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}handlePan(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._symbolMark]}}VO.type=_l.scatter,VO.mark=zO,VO.transformerConstructor=NO;class WO extends UD{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,size:t.size,sizeField:t.sizeField,shape:t.shape,shapeField:t.shapeField})}}class GO extends ZD{constructor(){super(...arguments),this.transformerConstructor=WO,this.type="scatter",this.seriesType=_l.scatter}}function UO(){var t,e=[];return{point:function(e,i,s){t.push([e,i,s])},lineStart:function(){e.push(t=[])},lineEnd:$c,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var i=e;return e=[],t=null,i}}}function $O(t,e){return Rc(t[0]-e[0])=0;--r)n.point((d=h[r])[0],d[1]);else s(u.x,u.p.x,-1,n);u=u.p}h=(u=u.o).z,p=!p}while(!u.v);n.lineEnd()}}}function qO(t){if(e=t.length){for(var e,i,s=0,n=t[0];++se?1:t>=e?0:NaN}1===(nR=lR).length&&(rR=nR,nR=function(t,e){return lR(rR(t),e)});var hR=Array.prototype;function dR(t){for(var e,i,s,n=t.length,r=-1,a=0;++r=0;)for(e=(s=t[n]).length;--e>=0;)i[--a]=s[e];return i}function cR(t,e,i,s){return function(n){var r,a,o,l=e(n),h=UO(),d=e(h),c=!1,u={point:p,lineStart:m,lineEnd:_,polygonStart:function(){u.point=f,u.lineStart=v,u.lineEnd=y,a=[],r=[]},polygonEnd:function(){u.point=p,u.lineStart=m,u.lineEnd=_,a=dR(a);var t=function(t,e){var i=oR(e),s=e[1],n=zc(s),r=[zc(i),-Fc(i),0],a=0,o=0;aR.reset(),1===n?s=Lc+Tc:-1===n&&(s=-Lc-Tc);for(var l=0,h=t.length;l=0?1:-1,A=k*M,w=A>Cc,T=m*x;if(aR.add(Bc(T*k*zc(A),_*S+T*Fc(A))),a+=w?M+k*Pc:M,w^p>=i^y>=i){var C=tR(JO(u),JO(v));sR(C);var L=tR(r,C);sR(L);var E=(w^M>=0?-1:1)*Uc(L[2]);(s>E||s===E&&(C[0]||C[1]))&&(o+=w^M>=0?1:-1)}}return(a<-Tc||a0){for(c||(n.polygonStart(),c=!0),n.lineStart(),t=0;t1&&2&l&&u.push(u.pop().concat(u.shift())),a.push(u.filter(uR))}return u}}function uR(t){return t.length>1}function pR(t,e){return((t=t.x)[0]<0?t[1]-Lc-Tc:Lc-t[1])-((e=e.x)[0]<0?e[1]-Lc-Tc:Lc-e[1])}hR.slice,hR.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);const gR=cR((function(){return!0}),(function(t){var e,i=NaN,s=NaN,n=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(r,a){var o=r>0?Cc:-Cc,l=Rc(r-i);Rc(l-Cc)0?Lc:-Lc),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),t.point(r,s),e=0):n!==o&&l>=Cc&&(Rc(i-n)Tc?Ic((zc(e)*(r=Fc(s))*zc(i)-zc(s)*(n=Fc(e))*zc(t))/(n*r*a)):(e+s)/2}(i,s,r,a),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),e=0),t.point(i=r,s=a),n=o},lineEnd:function(){t.lineEnd(),i=s=NaN},clean:function(){return 2-e}}}),(function(t,e,i,s){var n;if(null==t)n=i*Lc,s.point(-Cc,n),s.point(0,n),s.point(Cc,n),s.point(Cc,0),s.point(Cc,-n),s.point(0,-n),s.point(-Cc,-n),s.point(-Cc,0),s.point(-Cc,n);else if(Rc(t[0]-e[0])>Tc){var r=t[0]0)do{h.point(0===d||3===d?t:i,d>1?s:e)}while((d=(d+o+4)%4)!==c);else h.point(r[0],r[1])}function a(s,n){return Rc(s[0]-t)0?0:3:Rc(s[0]-i)0?2:1:Rc(s[1]-e)0?1:0:n>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var i=a(t,1),s=a(e,1);return i!==s?i-s:0===i?e[1]-t[1]:1===i?t[0]-e[0]:2===i?t[1]-e[1]:e[0]-t[0]}return function(a){var l,h,d,c,u,p,g,m,_,f,v,y=a,b=UO(),x={point:S,lineStart:function(){x.point=M,h&&h.push(d=[]),f=!0,_=!1,g=m=NaN},lineEnd:function(){l&&(M(c,u),p&&_&&b.rejoin(),l.push(b.result())),x.point=S,_&&y.lineEnd()},polygonStart:function(){y=b,l=[],h=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,i=0,n=h.length;is&&(u-r)*(s-a)>(p-a)*(t-r)&&++e:p<=s&&(u-r)*(s-a)<(p-a)*(t-r)&&--e;return e}(),i=v&&e,n=(l=dR(l)).length;(i||n)&&(a.polygonStart(),i&&(a.lineStart(),r(null,null,1,a),a.lineEnd()),n&&XO(l,o,e,r,a),a.polygonEnd()),y=a,l=h=d=null}};function S(t,e){n(t,e)&&y.point(t,e)}function M(r,a){var o=n(r,a);if(h&&d.push([r,a]),f)c=r,u=a,p=o,f=!1,o&&(y.lineStart(),y.point(r,a));else if(o&&_)y.point(r,a);else{var l=[g=Math.max(fR,Math.min(_R,g)),m=Math.max(fR,Math.min(_R,m))],b=[r=Math.max(fR,Math.min(_R,r)),a=Math.max(fR,Math.min(_R,a))];!function(t,e,i,s,n,r){var a,o=t[0],l=t[1],h=0,d=1,c=e[0]-o,u=e[1]-l;if(a=i-o,c||!(a>0)){if(a/=c,c<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=n-o,c||!(a<0)){if(a/=c,c<0){if(a>d)return;a>h&&(h=a)}else if(c>0){if(a0)){if(a/=u,u<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-l,u||!(a<0)){if(a/=u,u<0){if(a>d)return;a>h&&(h=a)}else if(u>0){if(a0&&(t[0]=o+h*c,t[1]=l+h*u),d<1&&(e[0]=o+d*c,e[1]=l+d*u),!0}}}}}(l,b,t,e,i,s)?o&&(y.lineStart(),y.point(r,a),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(b[0],b[1]),o||y.lineEnd(),v=!1)}g=r,m=a,_=o}return x}}function yR(t,e){function i(i,s){return i=t(i,s),e(i[0],i[1])}return t.invert&&e.invert&&(i.invert=function(i,s){return(i=e.invert(i,s))&&t.invert(i[0],i[1])}),i}function bR(t,e){return[Rc(t)>Cc?t+Math.round(-t/Pc)*Pc:t,e]}function xR(t,e,i){return(t%=Pc)?e||i?yR(MR(t),kR(e,i)):MR(t):e||i?kR(e,i):bR}function SR(t){return function(e,i){return[(e+=t)>Cc?e-Pc:e<-Cc?e+Pc:e,i]}}function MR(t){var e=SR(t);return e.invert=SR(-t),e}function kR(t,e){var i=Fc(t),s=zc(t),n=Fc(e),r=zc(e);function a(t,e){var a=Fc(e),o=Fc(t)*a,l=zc(t)*a,h=zc(e),d=h*i+o*s;return[Bc(l*n-d*r,o*i-h*s),Uc(d*n+l*r)]}return a.invert=function(t,e){var a=Fc(e),o=Fc(t)*a,l=zc(t)*a,h=zc(e),d=h*n-l*r;return[Bc(l*n+h*r,o*i+d*s),Uc(d*i-o*s)]},a}function AR(t){return function(e){var i=new wR;for(var s in t)i[s]=t[s];return i.stream=e,i}}function wR(){}function TR(t,e,i){var s=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=s&&t.clipExtent(null),Sc(i,t.stream(cu)),e(cu.result()),null!=s&&t.clipExtent(s),t}function CR(t,e,i){return TR(t,(function(i){var s=e[1][0]-e[0][0],n=e[1][1]-e[0][1],r=Math.min(s/(i[1][0]-i[0][0]),n/(i[1][1]-i[0][1])),a=+e[0][0]+(s-r*(i[1][0]+i[0][0]))/2,o=+e[0][1]+(n-r*(i[1][1]+i[0][1]))/2;t.scale(150*r).translate([a,o])}),i)}function LR(t,e,i){return CR(t,[[0,0],e],i)}function ER(t,e,i){return TR(t,(function(i){var s=+e,n=s/(i[1][0]-i[0][0]),r=(s-n*(i[1][0]+i[0][0]))/2,a=-n*i[0][1];t.scale(150*n).translate([r,a])}),i)}function PR(t,e,i){return TR(t,(function(i){var s=+e,n=s/(i[1][1]-i[0][1]),r=-n*i[0][0],a=(s-n*(i[1][1]+i[0][1]))/2;t.scale(150*n).translate([r,a])}),i)}bR.invert=bR,wR.prototype={constructor:wR,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var DR=16,OR=Fc(30*Oc);function RR(t,e){return+e?function(t,e){function i(s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f=h-s,v=d-n,y=f*f+v*v;if(y>4*e&&m--){var b=a+u,x=o+p,S=l+g,M=Vc(b*b+x*x+S*S),k=Uc(S/=M),A=Rc(Rc(S)-1)e||Rc((f*L+v*E)/y-.5)>.3||a*u+o*p+l*g0,n=Rc(e)>Tc;function r(t,i){return Fc(t)*Fc(i)>e}function a(t,i,s){var n=[1,0,0],r=tR(JO(t),JO(i)),a=QO(r,r),o=r[0],l=a-o*o;if(!l)return!s&&t;var h=e*a/l,d=-e*o/l,c=tR(n,r),u=iR(n,h);eR(u,iR(r,d));var p=c,g=QO(u,p),m=QO(p,p),_=g*g-m*(QO(u,u)-1);if(!(_<0)){var f=Vc(_),v=iR(p,(-g-f)/m);if(eR(v,u),v=ZO(v),!s)return v;var y,b=t[0],x=i[0],S=t[1],M=i[1];x0^v[1]<(Rc(v[0]-b)Cc^(b<=v[0]&&v[0]<=x)){var w=iR(p,(-g+f)/m);return eR(w,u),[v,ZO(w)]}}}function o(e,i){var n=s?t:Cc-t,r=0;return e<-n?r|=1:e>n&&(r|=2),i<-n?r|=4:i>n&&(r|=8),r}return cR(r,(function(t){var e,i,l,h,d;return{lineStart:function(){h=l=!1,d=1},point:function(c,u){var p,g=[c,u],m=r(c,u),_=s?m?0:o(c,u):m?o(c+(c<0?Cc:-Cc),u):0;if(!e&&(h=l=m)&&t.lineStart(),m!==l&&(!(p=a(e,g))||$O(e,p)||$O(g,p))&&(g[2]=1),m!==l)d=0,m?(t.lineStart(),p=a(g,e),t.point(p[0],p[1])):(p=a(e,g),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(n&&e&&s^m){var f;_&i||!(f=a(g,e,!0))||(d=0,s?(t.lineStart(),t.point(f[0][0],f[0][1]),t.point(f[1][0],f[1][1]),t.lineEnd()):(t.point(f[1][0],f[1][1]),t.lineEnd(),t.lineStart(),t.point(f[0][0],f[0][1],3)))}!m||e&&$O(e,g)||t.point(g[0],g[1]),e=g,l=m,i=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return d|(h&&l)<<1}}}),(function(e,s,n,r){!function(t,e,i,s,n,r){if(i){var a=Fc(e),o=zc(e),l=s*i;null==n?(n=e+s*Pc,r=e-l/2):(n=mR(a,n),r=mR(a,r),(s>0?nr)&&(n+=s*Pc));for(var h,d=n;s>0?d>r:d2?t[2]%360*Oc:0,L()):[_*Dc,f*Dc,v*Dc]},T.angle=function(t){return arguments.length?(y=t%360*Oc,L()):y*Dc},T.reflectX=function(t){return arguments.length?(b=t?-1:1,L()):b<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,L()):x<0},T.precision=function(t){return arguments.length?(a=RR(o,w=t*t),E()):Vc(w)},T.fitExtent=function(t,e){return CR(T,t,e)},T.fitSize=function(t,e){return LR(T,t,e)},T.fitWidth=function(t,e){return ER(T,t,e)},T.fitHeight=function(t,e){return PR(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&C,L()}}function HR(t){var e=0,i=Cc/3,s=jR(t),n=s(e,i);return n.parallels=function(t){return arguments.length?s(e=t[0]*Oc,i=t[1]*Oc):[e*Dc,i*Dc]},n}function zR(t,e){var i=zc(t),s=(i+zc(e))/2;if(Rc(s)2?t[2]*Oc:0),e.invert=function(e){return(e=t.invert(e[0]*Oc,e[1]*Oc))[0]*=Dc,e[1]*=Dc,e},e}(n.rotate()).invert([0,0]));return l(null==h?[[o[0]-r,o[1]-r],[o[0]+r,o[1]+r]]:t===KR?[[Math.max(o[0]-r,h),e],[Math.min(o[0]+r,i),s]]:[[h,Math.max(o[1]-r,e)],[i,Math.min(o[1]+r,s)]])}return n.scale=function(t){return arguments.length?(a(t),d()):a()},n.translate=function(t){return arguments.length?(o(t),d()):o()},n.center=function(t){return arguments.length?(r(t),d()):r()},n.clipExtent=function(t){return arguments.length?(null==t?h=e=i=s=null:(h=+t[0][0],e=+t[0][1],i=+t[1][0],s=+t[1][1]),d()):null==h?null:[[h,e],[i,s]]},d()}function qR(t){return Wc((Lc+t)/2)}function ZR(t,e){var i=Fc(t),s=t===e?zc(t):jc(i/Fc(e))/jc(qR(e)/qR(t)),n=i*Hc(qR(t),s)/s;if(!s)return KR;function r(t,e){n>0?e<-Lc+Tc&&(e=-Lc+Tc):e>Lc-Tc&&(e=Lc-Tc);var i=n/Hc(qR(e),s);return[i*zc(s*t),n-i*Fc(s*t)]}return r.invert=function(t,e){var i=n-e,r=Nc(s)*Vc(t*t+i*i),a=Bc(t,Rc(i))*Nc(i);return i*s<0&&(a-=Cc*Nc(t)*Nc(i)),[a/s,2*Ic(Hc(n/r,1/s))-Lc]},r}function JR(t,e){return[t,e]}function QR(t,e){var i=Fc(t),s=t===e?zc(t):(i-Fc(e))/(e-t),n=i/s+t;if(Rc(s)Tc&&--n>0);return[t/(.8707+(r=s*s)*(r*(r*r*r*(.003971-.001529*r)-.013791)-.131979)),s]},lI.invert=GR(Uc),hI.invert=GR((function(t){return 2*Ic(t)})),dI.invert=function(t,e){return[-e,2*Ic(Yc(t))-Lc]},Xu();const cI={},uI=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function pI(t,e){t&&S(t)||Am("Projection type must be a name string.");const i=t.toLowerCase();return arguments.length>1&&(cI[i]=function(t,e){return function i(){const s=e();return s.type=t,s.path=Xu().projection(s),s.copy=s.copy||function(){const t=i();return uI.forEach((e=>{s[e]&&t[e](s[e]())})),t.path.pointRadius(s.path.pointRadius()),t},s}}(i,e)),cI[i]||null}const gI={albers:VR,albersusa:function(){var t,e,i,s,n,r,a=VR(),o=NR().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=NR().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){r=[t,e]}};function d(t){var e=t[0],a=t[1];return r=null,i.point(e,a),r||(s.point(e,a),r)||(n.point(e,a),r)}function c(){return t=e=null,d}return d.invert=function(t){var e=a.scale(),i=a.translate(),s=(t[0]-i[0])/e,n=(t[1]-i[1])/e;return(n>=.12&&n<.234&&s>=-.425&&s<-.214?o:n>=.166&&n<.234&&s>=-.214&&s<-.115?l:a).invert(t)},d.stream=function(i){return t&&e===i?t:(s=[a.stream(e=i),o.stream(i),l.stream(i)],n=s.length,t={point:function(t,e){for(var i=-1;++i2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)}};Object.keys(gI).forEach((t=>{pI(t,gI[t])}));const mI="Feature",_I="FeatureCollection";const fI=uI.concat(["pointRadius","fit","extent","size"]);function vI(t,e){let i=[];return t?(Object.keys(t).forEach((s=>{fI.includes(s)&&(i=i.concat(Hp(t[s],e)))})),i):i}class yI extends Xp{constructor(t){super(t),this.grammarType="projection"}parse(t){return super.parse(t),this.pointRadius(t.pointRadius),this.size(t.size),this.extent(t.extent),this.fit(t.fit),this.configure(t),this.commit(),this}pointRadius(t){return P(this.spec.pointRadius)||this.detach(Hp(this.spec.pointRadius,this.view)),this.spec.pointRadius=t,this.attach(Hp(t,this.view)),this.commit(),this}size(t){return P(this.spec.size)||this.detach(Hp(this.spec.size,this.view)),this.spec.size=t,this.attach(Hp(t,this.view)),this.commit(),this}extent(t){return P(this.spec.extent)||this.detach(Hp(this.spec.extent,this.view)),this.spec.extent=t,this.attach(Hp(t,this.view)),this.commit(),this}fit(t){return P(this.spec.fit)||this.detach(Hp(this.spec.fit,this.view)),this.spec.fit=t,this.attach(Hp(t,this.view)),this.commit(),this}configure(t){return this.detach(vI(this.spec,this.view)),P(t)?this.spec={type:this.spec.type,fit:this.spec.fit,extent:this.spec.extent,size:this.spec.size,pointRadius:this.spec.pointRadius}:(Object.assign(this.spec,t),this.attach(vI(this.spec,this.view))),this.commit(),this}evaluate(t,e){if(this.projection&&this.projection.type===this.spec.type||(this.projection=function(t){const e=pI((t||"mercator").toLowerCase());return e||Am("Unrecognized projection type: "+t),e()}(this.spec.type),this.projection.type=this.spec.type),uI.forEach((t=>{P(this.spec[t])||function(t,e,i){rs(t[e])&&t[e](i)}(this.projection,t,Np(this.spec[t],e,pI))})),P(this.spec.pointRadius)||this.projection.path.pointRadius(Np(this.spec.pointRadius,e,pI)),!(P(this.spec.fit)||P(this.spec.extent)&&P(this.spec.size))){const t=function(t){const e=Ra(t);return 1===e.length?e[0]:{type:_I,features:e.reduce(((t,e)=>t.concat(function(t){return t.type===_I?t.features:Ra(t).filter((t=>!P(t))).map((t=>t.type===mI?t:{type:mI,geometry:t}))}(e))),[])}}(Np(this.spec.fit,e,pI));this.spec.extent?this.projection.fitExtent(Np(this.spec.extent,e,pI),t):this.spec.size&&this.projection.fitSize(Np(this.spec.size,e,pI),t)}return this.projection}output(){return this.projection}}const bI=(t,e)=>{if(!e.from||!e.from())return t;const i=e.fields,s=e.key,n=e.values,r=e.default,a=e.as||[i],o=e.from().reduce((function(t,e){return e[i]&&t.set(e[i],e),t}),new Map);let l;if(rs(e.set))l=function(t){const i=o.get(t[s]);e.set(t,i)};else if(n){const t=n.length;l=function(e){const i=o.get(e[s]);if(P(i))for(let i=0;i(l(t),t)))};class xI extends BL{constructor(){super(...arguments),this.type=_l.geo,this.coordinate="geo",this._nameProperty="name"}getMapViewData(){var t;return null===(t=this._mapViewData)||void 0===t?void 0:t.getDataView()}get nameField(){return this._nameField}set nameField(t){this._nameField=t}get valueField(){return this._valueField}set valueField(t){this._valueField=t}getNameProperty(){return this._nameProperty}getCentroidProperty(){return this._centroidProperty}getCoordinateHelper(){return this._coordinateHelper}setCoordinateHelper(t){this._coordinateHelper=t}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){var i;let s=null;if(!t)return s;if(e&&!this.isDatumInViewData(t))return s;const{dataToPosition:n,latitudeField:r,longitudeField:a}=this._coordinateHelper;if(s=this.nameToPosition(t),null===s){const e=a?null==t?void 0:t[a]:Number.NaN,o=r?null==t?void 0:t[r]:Number.NaN;s=null!==(i=null==n?void 0:n([e,o]))&&void 0!==i?i:null}return s}nameToPosition(t){const e=this.getDatumName(t);return P(e)?null:this.nameValueToPosition(e)}nameValueToPosition(t){var e,i;const s=null===(i=null===(e=this.getMapViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.filter((e=>this.getDatumName(e)===t))[0];if(P(s))return null;const{dataToPosition:n}=this._coordinateHelper,r=this.getDatumCenter(s),a=null==n?void 0:n(r);return P(a)||isNaN(a.x)||isNaN(a.y)?null:a}dataToLatitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}dataToLongitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}valueToPosition(t,e){return{x:this.dataToLongitude(t),y:this.dataToLatitude(e)}}positionToData(t){}latitudeToData(t){}longitudeToData(t){}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionZ(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}release(){super.release(),this._mapViewData.release(),this._mapViewData=this._mapViewDataStatistics=null}getStackGroupFields(){return[this._nameField]}getStackValueField(){return this._spec.valueField}compileData(){var t;null===(t=this._mapViewData)||void 0===t||t.compile()}initStatisticalData(){if(super.initStatisticalData(),this._mapViewData){const t=`${sh}_series_${this.id}_mapViewDataStatic`;this._mapViewDataStatistics=this.createStatisticalData(t,this._mapViewData.getDataView()),this._mapViewData.getDataView().target.removeListener("change",this._mapViewDataStatistics.reRunAllTransform)}}getSeriesKeys(){var t,e,i,s,n;return this._seriesField?null!==(n=null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:null===(s=null===(i=this._mapViewDataStatistics)||void 0===i?void 0:i.latestData[this._seriesField])||void 0===s?void 0:s.values)&&void 0!==n?n:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}fillData(){var t,e;super.fillData(),null===(t=this._mapViewData.getDataView())||void 0===t||t.reRunAllTransform(),null===(e=this._mapViewDataStatistics)||void 0===e||e.reRunAllTransform()}getActiveMarks(){return[]}}const SI=`${sh}_MAP_LOOK_UP_KEY`,MI=(t,e)=>(t.features&&t.features.forEach(((t,i)=>{var s;t[mT]=i;const n=null===(s=t.properties)||void 0===s?void 0:s[e.nameProperty];e.nameMap&&e.nameMap[n]?t[SI]=e.nameMap[n]:t[SI]=n})),t.features);class kI extends VT{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)}}}class AI extends mx{constructor(){super(...arguments),this.type=AI.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0,path:""})}}AI.type="path";const wI=()=>{$l.registerMark(AI.type,AI),YA()},TI=Object.assign(Object.assign({},iC),{area:{name:"area",type:"path"}});class CI{constructor(t){this.projection=pI(t.type)()}fit(t,e,i){const s={type:"FeatureCollection",features:i};this.projection.fitExtent([t,e],s)}center(t){var e,i;null===(i=null===(e=this.projection)||void 0===e?void 0:e.center)||void 0===i||i.call(e,t)}project(t){var e;return null===(e=this.projection)||void 0===e?void 0:e.call(this,t)}shape(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.path)||void 0===i?void 0:i.call(e,t)}invert(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.invert)||void 0===i?void 0:i.call(e,t)}scale(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.scale();this.projection.scale(t)}}translate(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.translate();this.projection.translate(t)}}evaluate(t,e,i){const s=this.projection.copy();return null==s?void 0:s.fitExtent([t,e],{type:"FeatureCollection",features:i})}}class LI{parserScrollEvent(t){return t?!(t.ctrlKey||0===t.deltaY&&0===t.deltaX)&&(t.scrollX=t.deltaX,t.scrollY=t.deltaY,t):t}parserZoomEvent(t){if(!t)return t;const e=Math.pow(1.0005,-t.deltaY*Math.pow(16,t.deltaMode));return t.zoomDelta=e,t.zoomX=t.canvasX,t.zoomY=t.canvasY,t}clearZoom(){}clearScroll(){}clearDrag(){}parserDragEvent(){return!0}}class EI{constructor(){this._lastScale=0}clearZoom(){this._lastScale=0,this.pointerId=null}parserDragEvent(t){return!0}parserZoomEvent(t){const e=t.scale;if(0===this._lastScale)return this._lastScale=e,t;t.zoomDelta=e/this._lastScale;const i=t.center;return t.zoomX=i.x,t.zoomY=i.y,this._lastScale=e,t}parserScrollEvent(t){return t}clearScroll(){}clearDrag(){}}function PI(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"wheel",zoomEnd:"pointerup",scroll:"wheel",trigger:LI}:cl(t)||ul(t)?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"pinch",zoomEnd:"pinchend",scroll:"pan",scrollEnd:"panend",trigger:EI}:null}const DI={debounce:Uo,throttle:Ud};class OI{constructor(){this._isGestureListener=!1}initZoomable(t,e=n["desktop-browser"]){this._eventObj=t,this._renderMode=e,this._gestureController=this._option.getChart().getVGrammarView().renderer._gestureController,this._isGestureListener=cl(this._renderMode)||ul(this._renderMode),PI(this._renderMode)&&(this._clickEnable=!0,this._zoomableTrigger=new(this._getZoomTriggerEvent("trigger")))}_getZoomTriggerEvent(t){return PI(this._renderMode)[t]}_zoomEventDispatch(t,e,i){if(!this._isGestureListener&&!t.event)return;const s=this._isGestureListener?t:t.event.clone();this._zoomableTrigger.parserZoomEvent(s);const{zoomDelta:n,zoomX:r,zoomY:a}=s;if(P(n))return;if(!ga({x:r,y:a},this._getRegionOrSeriesLayout(e),!1))return;let o={};i&&(o=i({zoomDelta:n,zoomX:r,zoomY:a},s)),this._eventObj.emit("zoom",Object.assign(Object.assign({scale:s.zoomDelta,scaleCenter:{x:s.zoomX,y:s.zoomY}},o),{model:this}))}_getRegionOrSeriesLayout(t){"region"!==t.type&&(t=t.getRegion());const{x:e,y:i,width:s,height:n}=t.layout.getLayout();return{x1:e,y1:i,x2:e+s,y2:i+n}}_bindZoomEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("zoom")]:[this._getZoomTriggerEvent("zoom"),{level:zd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("zoomEnd")]:[this._getZoomTriggerEvent("zoomEnd"),{level:zd.chart,consume:!1}];l.on(...d,DI[a]((t=>{this._zoomableTrigger.clearZoom()}),o)),l.on(...h,DI[a]((t=>{this._zoomEventDispatch(t,e,i)}),o))}initZoomEventOfSeries(t,e,i){this._option.disableTriggerEvent||PI(this._renderMode)&&this._bindZoomEventAsRegion(t.event,t,e,i)}initZoomEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||PI(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindZoomEventAsRegion(t.event,t,i,s)})):this._bindZoomEventAsRegion(this._eventObj,t,i,s)}))}_scrollEventDispatch(t,e,i){let s=!1;if(!this._isGestureListener&&(!t.event||this._option.disableTriggerEvent))return s;const n=this._isGestureListener?t:t.event;this._zoomableTrigger.parserScrollEvent(n);const{scrollX:r,scrollY:a,canvasX:o,canvasY:l}=n;return P(r)&&P(a)?s:ga({x:o,y:l},this._getRegionOrSeriesLayout(e),!1)?(i&&(s=i({scrollX:r,scrollY:a},n)),this._eventObj.emit("scroll",{scrollX:r,scrollY:a,model:this}),s):s}_bindScrollEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("scroll")]:[this._getZoomTriggerEvent("scroll"),{level:zd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("scrollEnd")]:[this._getZoomTriggerEvent("scrollEnd"),{level:zd.chart,consume:!1}];l.on(...d,DI[a]((t=>{this._zoomableTrigger.clearScroll()}),o)),l.on(...h,DI[a]((t=>this._scrollEventDispatch(t,e,i)),o))}initScrollEventOfSeries(t,e,i){PI(this._renderMode)&&this._bindScrollEventAsRegion(t.event,t,e,i)}initScrollEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||PI(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindScrollEventAsRegion(t.event,t,i,s)})):this._bindScrollEventAsRegion(this._eventObj,t,i,s)}))}_bindDragEventAsRegion(t,e,i,s){t.on(this._getZoomTriggerEvent("start"),{level:zd.chart},(t=>{if(!t.event)return;const{event:n}=t;ga({x:n.canvasX,y:n.canvasY},this._getRegionOrSeriesLayout(e),!1)&&this._handleDrag(t,i,s)})),t.on("click",{level:zd.chart},(()=>!this._clickEnable))}initDragEventOfSeries(t,e,i){this._option.disableTriggerEvent||PI(this._renderMode)&&t.event.on(this._getZoomTriggerEvent("start"),{level:zd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,e,i)}))}initDragEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||PI(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&(t.event.on(this._getZoomTriggerEvent("start"),{level:zd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,i)})),t.event.on("click",{level:zd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>!this._clickEnable)))})):this._bindDragEventAsRegion(this._eventObj,t,i,s)}))}_handleDrag(t,e,i){var s,n,r;if(this._option.disableTriggerEvent)return;if(this._clickEnable=!1,!this._zoomableTrigger.parserDragEvent(t.event))return;const a=null!==(s=null==i?void 0:i.delayType)&&void 0!==s?s:"throttle",o=null!==(n=null==i?void 0:i.delayTime)&&void 0!==n?n:0,l=null===(r=null==i?void 0:i.realTime)||void 0===r||r,h=this._getZoomTriggerEvent("move"),d=this._getZoomTriggerEvent("end"),c=t.event;let u=c.canvasX,p=c.canvasY,g=c.canvasX,m=c.canvasY;const _=DI[a]((t=>{this._clickEnable=!0;const i=t.event,s=[i.canvasX-g,i.canvasY-m];g=i.canvasX,m=i.canvasY,!l&&e&&e(s,t.event),this._eventObj.emit("panend",{delta:s,model:this}),this._zoomableTrigger.pointerId=null,this._eventObj.off(h,{level:zd.chart,source:Hd.chart},f),this._eventObj.off(d,{level:zd.chart,source:Hd.window},_),this._eventObj.allow(d)}),o),f=DI[a]((t=>{if(!this._zoomableTrigger.parserDragEvent(t.event))return;this._clickEnable=!1,this._eventObj.prevent(d,_);const i=t.event,s=[i.canvasX-u,i.canvasY-p];u=i.canvasX,p=i.canvasY,l&&e&&e(s,t.event),this._eventObj.emit("panmove",{delta:s,model:this})}),o);this._eventObj.on(h,{level:zd.chart,source:Hd.chart},f),this._eventObj.on(d,{level:zd.chart,source:Hd.chart},_)}}function RI(t,e){return`${sh}_${e}_${t}`}class II extends qE{constructor(){super(...arguments),this.type=r.geoCoordinate,this.name=r.geoCoordinate,this.layoutType="none",this.layoutZIndex=Ty.Mark,this._projectionSpec={name:RI(this.type,this.id),type:"mercator"},this._actualScale=1,this._initialScale=1,this.effect={scaleUpdate:()=>{this.coordinateHelper()}},this._handleChartZoom=(t,e)=>{var i,s,n,r,a,o;let l=t.zoomDelta;const h=this._actualScale;return this._actualScale*=l,this._actualScale<(null===(i=this._spec.zoomLimit)||void 0===i?void 0:i.min)?(this._actualScale=null===(s=this._spec.zoomLimit)||void 0===s?void 0:s.min,l=(null===(n=this._spec.zoomLimit)||void 0===n?void 0:n.min)/h):this._actualScale>(null===(r=this._spec.zoomLimit)||void 0===r?void 0:r.max)&&(this._actualScale=null===(a=this._spec.zoomLimit)||void 0===a?void 0:a.max,l=(null===(o=this._spec.zoomLimit)||void 0===o?void 0:o.max)/h),this.zoom(l,[t.zoomX,t.zoomY]),{scale:l,totalScale:this._actualScale}},this.pan=(t=[0,0])=>{var e,i,s;const n=null!==(i=null===(e=this._projection)||void 0===e?void 0:e.translate())&&void 0!==i?i:[0,0];let r=n[0],a=n[1];r+=t[0],a+=t[1],null===(s=this._projection)||void 0===s||s.translate([r,a])}}get longitudeField(){return this._longitudeField}get latitudeField(){return this._latitudeField}get projectionSpec(){return this._projectionSpec}setProjection(t){this._projectionSpec=Object.assign(Object.assign({},t),{name:this._projectionSpec.name})}getZoom(){return this._actualScale}static getSpecInfo(t){if(P(t))return null;const e=[];return t.region.forEach(((t,i)=>{if("geo"===t.coordinate){const s=Object.assign(Object.assign({},t),{padding:0});e.push({spec:s,regionIndex:i,type:r.geoCoordinate,specInfoPath:["component","geoCoordinate",i]})}})),e}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this._spec.roam&&this.initZoomable(this.event,this._option.mode),this._projectionSpec=Tl(this._projectionSpec,this._spec.projection),this._projectionSpec.zoom>(null===(t=this._spec.zoomLimit)||void 0===t?void 0:t.max)&&(this._projectionSpec.zoom=this._spec.zoomLimit.max),this._projectionSpec.zoom<(null===(e=this._spec.zoomLimit)||void 0===e?void 0:e.min)&&(this._projectionSpec.zoom=this._spec.zoomLimit.min),this._actualScale=null!==(i=this._projectionSpec.zoom)&&void 0!==i?i:1,this._initialScale=this._actualScale,this._longitudeField=this._spec.longitudeField,this._latitudeField=this._spec.latitudeField}created(){super.created(),this._regions=this._option.getRegionsInIndex([this._option.regionIndex]),this.initProjection(),this.coordinateHelper(),this.initEvent(),this._initCenterCache()}dispatchZoom(t,e){const i=e||{x:this.getLayoutStartPoint().x+this.getLayoutRect().width/2,y:this.getLayoutStartPoint().y+this.getLayoutRect().height/2},{scale:s,totalScale:n}=this._handleChartZoom({zoomDelta:t,zoomX:i.x,zoomY:i.y});1!==s&&this.event.emit("zoom",{scale:s,scaleCenter:i,totalScale:n,model:this})}initEvent(){this.event.on(jd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this)),this._spec.roam&&(this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom),this.initDragEventOfRegions(this._regions,(()=>!0),this.pan),this._regions.forEach((t=>{t.getSeries().forEach((t=>{t.event.on("zoom",(e=>(t.handleZoom(e),!0))),t.event.on("panmove",(e=>(t.handlePan(e),!0)))}))})))}initProjection(){var t;this._projection=new CI(this._projectionSpec),null!==this._projection.projection||null===(t=this._option)||void 0===t||t.onError("unsupported projection type!")}coordinateHelper(){const t={longitudeField:this._longitudeField,latitudeField:this._latitudeField,dataToPosition:this.dataToPosition.bind(this),dataToLongitude:this.dataToLongitude.bind(this),dataToLatitude:this.dataToLatitude.bind(this),shape:this.shape.bind(this),getCoordinateId:()=>this.id};this._regions.forEach((e=>{e.getSeries().forEach((e=>{e.type===_l.map?e.setCoordinateHelper(t):(e.setXAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(P(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.x}return this.dataToLongitude(n)},valueToPosition:(t,i)=>{var s;if(P(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.x}return this.dataToLongitude(t)},getFields:()=>[this._longitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})),e.setYAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(P(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.y}return this.dataToLatitude(n)},valueToPosition:(t,i)=>{var s;if(P(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.y}return this.dataToLatitude(t)},getFields:()=>[this._latitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})))}))}))}onLayoutEnd(t){this.setLayoutRect(this._regions[0].getLayoutRect()),this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint());const{width:e,height:i}=this.getLayoutRect(),{translate:s,scale:n,center:r}=this.evaluateProjection([0,0],[e,i]);s&&this._projection.translate(s),n&&this._projection.scale(n),r&&this._projection.center(r),uE(this._regions,(t=>{var e;if(t.type===_l.map){t.areaPath.clear();const i=null===(e=t.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();i&&i.attribute.postMatrix&&i.setAttributes({postMatrix:new Pt})}})),this._actualScale=this._initialScale,super.onLayoutEnd(t)}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}collectFeatures(){const t=[];return this._regions.forEach((e=>{e.getSeries().forEach((e=>{var i,s;e.type===_l.map&&t.push(...null!==(s=null===(i=e.getMapViewData())||void 0===i?void 0:i.latestData)&&void 0!==s?s:[])}))})),t}dataToPosition(t=[]){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t[0],t[1]]);return{x:null==i?void 0:i[0],y:null==i?void 0:i[1]}}dataToLatitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([0,t]);return null==i?void 0:i[1]}dataToLongitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t,0]);return null==i?void 0:i[0]}zoom(t,e=[0,0]){var i,s,n,r,a,o;let l=null!==(s=null===(i=this._projection)||void 0===i?void 0:i.scale())&&void 0!==s?s:0;const h=null!==(r=null===(n=this._projection)||void 0===n?void 0:n.translate())&&void 0!==r?r:[0,0];let d=h[0],c=h[1];l*=t,d-=(e[0]-d)*(t-1),c-=(e[1]-c)*(t-1),null===(a=this._projection)||void 0===a||a.scale(l),null===(o=this._projection)||void 0===o||o.translate([d,c])}shape(t){return this._projection.shape(t)}invert(t){return this._projection.invert(t)}evaluateProjection(t,e){var i;const s=this._projection.evaluate(t,e,this.collectFeatures());let n=s.translate();const r=s.scale()*this._initialScale,a=null!==(i=this._projectionSpec.center)&&void 0!==i?i:s.invert([e[0]/2,e[1]/2]);return a&&(n=[e[0]/2,e[1]/2]),{translate:n,scale:r,center:a}}_initCenterCache(){this._centerCache||(this._centerCache=new Map),this._regions.forEach((t=>{t.getSeries().forEach((t=>{var e,i;"map"===t.type&&(null!==(i=null===(e=t.getMapViewData())||void 0===e?void 0:e.latestData)&&void 0!==i?i:[]).forEach(((e={})=>{const i=e[t.getDimensionField()[0]]||e[SI],s=t.getDatumCenter(e);i&&M(s)&&this._centerCache.set(i,{x:s[0],y:s[1]})}))}))}))}release(){super.release(),this._centerCache&&this._centerCache.clear(),this._centerCache=null}}II.type=r.geoCoordinate,XA(II,OI);const BI=()=>{$l.registerComponent(II.type,II)};class FI extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"area",void 0,void 0,!1)}}class YI extends xI{constructor(){super(...arguments),this.type=_l.map,this.transformerConstructor=FI,this._areaCache=new Map}getNameMap(){return this._nameMap}get areaPath(){return this._areaCache}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.map=this._spec.map,this._nameMap=this._spec.nameMap,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._spec.nameProperty&&(this._nameProperty=this._spec.nameProperty),this._spec.centroidProperty&&(this._centroidProperty=this._spec.centroidProperty),this.map||null===(t=this._option)||void 0===t||t.onError(`map type '${this.map}' is not specified !`),Tp.get(this.map)||null===(e=this._option)||void 0===e||e.onError(`'${this.map}' data is not registered !`)}initData(){var t,e;super.initData(),Ap(this._dataSet,"copyDataView",Op),Ap(this._dataSet,"map",MI),Ap(this._dataSet,"lookup",bI);const i=Tp.get(this.map);i||null===(t=this._option)||void 0===t||t.onError("no valid map data found!");const s=new R(this._dataSet,{name:`map_${this.id}_data`});s.parse([i],{type:"dataview"}).transform({type:"copyDataView",options:{deep:!0},level:Fp.copyDataView}).transform({type:"map",options:{nameMap:this._nameMap,nameProperty:this._nameProperty}}).transform({type:"lookup",options:{from:()=>{var t;return null===(t=this._data)||void 0===t?void 0:t.getLatestData()},key:SI,fields:this._nameField,set:(t,e)=>{e&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}}}),null===(e=this._data)||void 0===e||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new KT(this._option,s)}initMark(){this._pathMark=this._createMark(YI.mark.area,{morph:PL(this._spec,YI.mark.area.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0,dataView:this._mapViewData.getDataView(),dataProductId:this._mapViewData.getProductId()})}initMarkStyle(){const t=this._pathMark;t&&(this.setMarkStyle(t,{fill:t=>{var e,i,s,n;return M(t[null!==(e=this._seriesField)&&void 0!==e?e:fT])?(null!==(i=this._option.globalScale.getScale("color"))&&void 0!==i?i:this._getDefaultColorScale()).scale(t[null!==(s=this._seriesField)&&void 0!==s?s:fT]):null===(n=this._spec)||void 0===n?void 0:n.defaultFillColor},path:this.getPath.bind(this)},"normal",Ly.Series),t.setPostProcess("fill",(t=>M(t)?t:this._spec.defaultFillColor)),this.setMarkStyle(t,{smoothScale:!0},"normal",Ly.Built_In))}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{text:t=>this.getDatumName(t),x:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}}))}initAnimation(){var t;this._pathMark.setAnimationConfig(TL(null===(t=$l.getAnimationInKey("fadeInOut"))||void 0===t?void 0:t(),CL("area",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new kI(this),this._pathMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pathMark)}getPath(t){var e;const i=this._areaCache.get(t[mT]);if(i)return i.shape;const s=null===(e=this._coordinateHelper)||void 0===e?void 0:e.shape(t);return this._areaCache.set(t[mT],{shape:s}),s}onEvaluateEnd(){this._mapViewData.updateData()}getDimensionField(){return[this.nameField]}getMeasureField(){return[this.valueField]}release(){super.release(),this._areaCache.clear(),this._nameMap={},this._mapViewData=null}handleZoom(t){var e,i,s;const{scale:n,scaleCenter:r}=t;if(1===n)return;const a=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new Pt}),a.scale(n,n,r));const o=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();o&&o.evaluate(null,null)}handlePan(t){var e,i,s;const{delta:n}=t;if(0===n[0]&&0===n[1])return;const r=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new Pt}),r.translate(n[0],n[1]));const a=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();a&&a.evaluate(null,null)}getDatumCenter(t){var e,i,s,n;return this._centroidProperty&&(null===(e=t.properties)||void 0===e?void 0:e[this._centroidProperty])?null===(i=t.properties)||void 0===i?void 0:i[this._centroidProperty]:Wo(t.centroidX*t.centroidY)?[t.centroidX,t.centroidY]:(null===(s=t.properties)||void 0===s?void 0:s.center)?t.properties.center:(null===(n=t.properties)||void 0===n?void 0:n.centroid)?t.properties.centroid:[Number.NaN,Number.NaN]}getDatumName(t){var e;if(t[this.nameField])return t[this.nameField];const i=null===(e=t.properties)||void 0===e?void 0:e[this._nameProperty];if(i){if(this._spec.nameMap&&this._spec.nameMap[i])return this._spec.nameMap[i];if(this._spec.showDefaultName||!this._spec.nameMap)return i}return""}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._mapViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._mapViewData)||void 0===s||s.updateData()}_getDataIdKey(){return mT}getActiveMarks(){return[this._pathMark]}}YI.type=_l.map,YI.mark=TI,YI.transformerConstructor=FI;class jI extends GD{_isValidSeries(t){return t===_l.map}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:t.type,nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,map:t.map,nameProperty:t.nameProperty,centroidProperty:t.centroidProperty,nameMap:t.nameMap,area:t.area,defaultFillColor:t.defaultFillColor,showDefaultName:t.showDefaultName})}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"}));const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class HI extends ZD{constructor(){super(...arguments),this.transformerConstructor=jI,this.type="map",this.seriesType=_l.map}}function zI(t){return function(e){let i;return i=y(t)?t.reduce(((t,e)=>null==t?void 0:t[e]),e):null==e?void 0:e[t],i}}HI.type="map",HI.seriesType=_l.map,HI.transformerConstructor=jI;class NI extends BL{constructor(){super(...arguments),this.coordinate="polar",this._outerRadius=_h,this._innerRadius=0,this._angleField=[],this._radiusField=[],this._sortDataByAxis=!1}get outerRadius(){return this._outerRadius}get innerRadius(){return this._innerRadius}getAngleField(){return this._angleField}setAngleField(t){return this._angleField=M(t)?Ra(t):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(t){return this._radiusField=M(t)?Ra(t):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(t){return this._innerRadiusField=Ra(t),this._innerRadiusField}get radiusScale(){return this._radiusScale}setRadiusScale(t){return this._radiusScale=t,t}get angleScale(){return this._angleScale}setAngleScale(t){return this._angleScale=t,t}get angleAxisHelper(){return this._angleAxisHelper}set angleAxisHelper(t){this._angleAxisHelper=t,this.onAngleAxisHelperUpdate()}get radiusAxisHelper(){return this._radiusAxisHelper}set radiusAxisHelper(t){this._radiusAxisHelper=t,this.onRadiusAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getCenter=()=>this.angleAxisHelper.center(),this._markAttributeContext.getLayoutRadius=()=>this._computeLayoutRadius()}valueToPosition(t,e){if(P(t)||P(e)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:Number.NaN,y:Number.NaN};const i=this.angleAxisHelper.dataToPosition(Ra(t)),s=this.radiusAxisHelper.dataToPosition(Ra(e));return this.angleAxisHelper.coordToPoint({angle:i,radius:s})}dataToPosition(t,e){return t&&this.angleAxisHelper&&this.radiusAxisHelper?e&&!this.isDatumInViewData(t)?null:this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getDatumPositionValues(t,this._radiusField)):null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}positionToData(t){}radiusToData(t){}angleToData(t){}getStatisticFields(){var t,e;const i=[];return(null===(t=this.radiusAxisHelper)||void 0===t?void 0:t.getScale)&&this._radiusField.forEach((t=>{const e={key:t,operations:[]};Jh(this.radiusAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),(null===(e=this.angleAxisHelper)||void 0===e?void 0:e.getScale)&&this._angleField.forEach((t=>{const e={key:t,operations:[]};Jh(this.angleAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),i}setAttrFromSpec(){super.setAttrFromSpec(),M(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),M(this._spec.radius)&&(this._outerRadius=this._spec.radius),M(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark()}_computeLayoutRadius(){const t=this._angleAxisHelper||this._radiusAxisHelper;if(t)return t.layoutRadius();const{width:e,height:i}=this._region.getLayoutRect();return Math.min(e/2,i/2)}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(jd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e=this._angleAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&FL(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}getInvalidCheckFields(){const t=[];return this.angleAxisHelper.isContinuous&&this._angleField.forEach((e=>{t.push(e)})),this.radiusAxisHelper.isContinuous&&this._radiusField.forEach((e=>{t.push(e)})),t}}function VI(t){return Zo(t)?Number.parseFloat(t):0}const WI=(t,e)=>{const i=t.map((t=>Object.assign({},t)));if(!i||0===i.length)return i;const{asStartAngle:s,asEndAngle:n,asMiddleAngle:r,asRadian:a,asRatio:o,asQuadrant:l,asK:h,showAllZero:d,supportNegative:c}=e,u=e.angleField(),p=e.startAngle(),g=e.endAngle(),m=e.minAngle(),_=(t,e,i)=>{t[s]=e,t[n]=e+i,t[r]=e+i/2,t[a]=i,t[l]=Et(e+i/2)};let f=0,v=-1/0,y=!0;for(let t=0;tNumber(t[u]))),x=g-p;let S=p,M=x,k=0;const A=function(t,e=2){const i=t.reduce(((t,e)=>t+(isNaN(e)?0:e)),0);if(0===i)return 0;const s=Math.pow(10,e),n=t.map((t=>(isNaN(t)?0:t)/i*s*100)),r=100*s,a=n.map((t=>Math.floor(t)));let o=a.reduce(((t,e)=>t+e),0);const l=n.map(((t,e)=>t-a[e]));for(;ot&&(t=l[i],e=i);++a[e],l[e]=0,++o}return a.map((t=>t/s))}(b);if(i.forEach(((t,e)=>{const i=t[ah],s=f?i/f:0;let n=s*x;n{_(e,p+i*t,t)}))}else{const t=M/k;S=p,i.forEach((e=>{const i=e[a]===m?m:e[ah]*t;_(e,S,i),S+=i}))}if(0!==f&&(i[i.length-1][n]=g),y&&d){const t=x/i.length;i.forEach(((e,i)=>{_(e,p+i*t,t)}))}return i};function GI(t,e,i){return(s,n,r)=>e?"radius"===t.growField?{overall:0}:{overall:t.growFrom(s,n,i)}:{overall:!1}}const UI=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",options:GI(t,!0,Yp.appear)}),$I={type:"fadeIn"},KI=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",easing:"linear",options:GI(t,!0,Yp.enter)}),XI=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",easing:"linear",options:GI(t,!0,Yp.exit)}),qI=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",options:GI(t,!0,Yp.exit)});function ZI(t,e){if(!1===e)return{};switch(e){case"fadeIn":return $I;case"growRadius":return UI(Object.assign(Object.assign({},t),{growField:"radius"}));default:return UI(Object.assign(Object.assign({},t),{growField:"angle"}))}}class JI extends mx{constructor(t,e){super(t,e),this.type=QI.type,this._unCompileChannel={centerOffset:!0,radiusOffset:!0},this.computeOuterRadius=(t,e,i="normal",s,n)=>{var r;return n+(null!==(r=this.getAttribute("radiusOffset",e,i,s))&&void 0!==r?r:0)},this.computeCenter=(t,e,i="normal",s,n)=>Tt({x:0,y:0},this.getAttribute("centerOffset",e,i,s),e[ch])[t]+n,this._computeExChannel.x=this.computeCenter,this._computeExChannel.y=this.computeCenter,this._computeExChannel.outerRadius=this.computeOuterRadius,this._extensionChannel.centerOffset=["x","y"],this._extensionChannel.radiusOffset=["outerRadius"]}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{startAngle:0,endAngle:0,outerRadius:0,innerRadius:0,cornerRadius:0,lineWidth:0,innerPadding:0,outerPadding:0})}}class QI extends JI{constructor(){super(...arguments),this.type=QI.type}}QI.type="arc";const tB=()=>{yx(),zx(),pc.registerGraphic(Xd.arc,Sx),LA("arc",PA),ML(),$l.registerMark(QI.type,QI)},eB=Object.assign(Object.assign({},iC),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}}),iB=Object.assign(Object.assign({},iC),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class sB extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie")}_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const i=this._getDefaultSpecFromChart(e);s=Tl({},this._theme,i,t);const n=(t,e)=>Tl({},"inside"===t||"inside-center"===t?this._theme.innerLabel:this._theme.outerLabel,e);y(s.label)?s.label=s.label.map((t=>n(t.position,t))):s.label=n(s.label.position,s.label)}return{spec:s,theme:i}}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{centerX:s,centerY:n}=t;return M(s)&&(i.centerX=s),M(n)&&(i.centerY=n),Object.keys(i).length>0?i:void 0}}const nB=`${sh}_LABEL_VISIBLE`,rB=(t,e)=>{var i,s,n,a,o,l;const h=null!==(i=t.type)&&void 0!==i?i:"angle"===t.orient?"band":"linear",d=`${r.polarAxis}-${h}`,c=null!==(s=t.startAngle)&&void 0!==s?s:e.startAngle,u=null!==(n=t.endAngle)&&void 0!==n?n:e.endAngle;return{axisType:h,componentName:d,startAngle:null!=c?c:-90,endAngle:null!=u?u:M(c)?c+360:270,center:M(e.center)?e.center:M(null==e?void 0:e.centerX)||M(null==e?void 0:e.centerY)?{x:null==e?void 0:e.centerX,y:null==e?void 0:e.centerY}:void 0,outerRadius:null!==(l=null!==(o=null!==(a=t.radius)&&void 0!==a?a:e.outerRadius)&&void 0!==o?o:e.radius)&&void 0!==l?l:_h,layoutRadius:e.layoutRadius}},aB=(t,e,i,s)=>{const n=t();if(h(n))return n;if(rs(n))return n(e(),i());const r=e();if("auto"===n&&r.width>0&&r.height>0){const{startAngle:t=0,endAngle:e=2*Math.PI}=s();return function(t,e,i,s){const{x:n,y:r}=e,a=function(t,e){const i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const s=Lt(Math.min(t,e)),n=s+i,r=[s,n];let a=Math.floor(s/Math.PI)*Math.PI/2;for(;as&&r.push(a),a+=Math.PI/2;return r}(i,s),{width:o,height:l}=t,h=[];return a.forEach((t=>{const e=Math.sin(t),i=Math.cos(t);1===e?h.push(l-r):-1===e?h.push(r):1===i?h.push(o-n):-1===i?h.push(n):(e>0?h.push(Math.abs((l-r)/i)):h.push(Math.abs(r/i)),i>0?h.push(Math.abs((o-n)/e)):h.push(Math.abs(n/e)))})),Math.min.apply(null,h)}(r,i(),t,e)}return Math.min(r.width/2,r.height/2)};class oB extends NI{constructor(){super(...arguments),this.transformerConstructor=sB,this._pieMarkName="pie",this._pieMarkType="arc",this.getCenter=()=>{var t,e,i,s;const{width:n,height:r}=this._region.getLayoutRect();return{x:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.centerX)&&void 0!==e?e:n/2,y:null!==(s=null===(i=this._spec)||void 0===i?void 0:i.centerY)&&void 0!==s?s:r/2}},this._startAngle=gh,this._endAngle=mh,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this._emptyArcMark=null,this.dataToCentralPosition=t=>{const e=t[ch];if(P(e))return null;const i=this.computeDatumRadius(t),s=this.computeDatumInnerRadius(t);return Tt(this.computeCenter(t),(i+s)/2,e)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.getCenter().x,y:()=>this.getCenter().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}setAttrFromSpec(){var t,e,i,s,n,r;super.setAttrFromSpec(),this._centerOffset=null!==(t=this._spec.centerOffset)&&void 0!==t?t:0,this._cornerRadius=null!==(e=this._spec.cornerRadius)&&void 0!==e?e:0;const a=function(t,e){let i=0,s=2*Math.PI;const n=M(t),r=M(e);for(n||r?r?n?(i=t,s=e):(i=e-2*Math.PI,s=e):(i=t,s=t+2*Math.PI):(i=0,s=2*Math.PI);s<=i;)s+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI,s-=2*Math.PI;for(;s<0;)i+=2*Math.PI,s+=2*Math.PI;return{startAngle:i,endAngle:s}}(M(this._spec.startAngle)?At(this._spec.startAngle):this._startAngle,M(this._spec.endAngle)?At(this._spec.endAngle):this._endAngle);this._startAngle=a.startAngle,this._endAngle=a.endAngle,this._padAngle=M(this._spec.padAngle)?At(this._spec.padAngle):0,this.setAngleField(this._spec.valueField||this._spec.angleField),this._spec.categoryField&&this.setSeriesField(this._spec.categoryField),this._radiusField=[],this._specAngleField=this._angleField.slice(),this._specRadiusField=[],this._showEmptyCircle=null!==(s=null===(i=this._spec.emptyPlaceholder)||void 0===i?void 0:i.showEmptyCircle)&&void 0!==s&&s,this._showAllZero=null!==(n=this._spec.showAllZero)&&void 0!==n&&n,this._supportNegative=null!==(r=this._spec.supportNegative)&&void 0!==r&&r}initData(){super.initData();const t=this.getViewData();if(!t)return;Ap(this._dataSet,"pie",WI),t.transform({type:"pie",options:{angleField:()=>this._angleField[0],startAngle:()=>this._startAngle,endAngle:()=>this._endAngle,minAngle:()=>M(this._spec.minAngle)?At(this._spec.minAngle):0,asStartAngle:lh,asEndAngle:hh,asRatio:oh,asMiddleAngle:ch,asRadian:ph,asQuadrant:uh,asK:dh,showAllZero:this._showAllZero,supportNegative:this._supportNegative}},!1);const e=new R(this._dataSet,{name:`${sh}_series_${this.id}_viewDataLabel`});e.parse([this.getViewData()],{type:"dataview"}),this._viewDataLabel=new KT(this._option,e)}initMark(){var t,e;this._pieMark=this._createMark(Object.assign(Object.assign({},oB.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{morph:PL(this._spec,this._pieMarkName),defaultMorphElementKey:this._seriesField,key:_T,groupKey:this._seriesField,skipBeforeLayouted:!0,isSeriesMark:!0,customShape:null===(t=this._spec.pie)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.pie)||void 0===e?void 0:e.stateSort}),this._emptyArcMark=this._createMark({name:"emptyCircle",type:"arc"},{dataView:!1})}startAngleScale(t){return zI(lh)(t)}endAngleScale(t){return zI(hh)(t)}_computeLayoutRadius(){return aB((()=>this._spec.layoutRadius),this.getLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}initMarkStyle(){const t={x:()=>this.getCenter().x,y:()=>this.getCenter().y,fill:this.getColorAttribute(),outerRadius:nx(this._outerRadius)?this._outerRadius:()=>this._computeLayoutRadius()*this._outerRadius,innerRadius:nx(this._innerRadius)?this._innerRadius:()=>this._computeLayoutRadius()*this._innerRadius,cornerRadius:()=>this._computeLayoutRadius()*this._cornerRadius,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),padAngle:this._padAngle,centerOffset:this._centerOffset},e=this._pieMark;e&&this.setMarkStyle(e,t,"normal",Ly.Series);const i=this._emptyArcMark;i&&this.setMarkStyle(i,Object.assign(Object.assign({},t),{visible:()=>this._showEmptyCircle&&0===this.getViewData().latestData.length}),"normal",Ly.Series)}initInteraction(){this._parseInteractionConfig(this._pieMark?[this._pieMark]:[])}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(t,e,i){if(super.initMarkStyleWithSpec(t,e,i),t.name===this._pieMarkName){const e=this.getSpec()[t.name];if(e)for(const i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,Ly.User_Mark)}"emptyCircle"===t.name&&this.setMarkStyle(t,this.generateRadiusStyle(e.style),"normal",Ly.User_Mark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{visible:zI(nB).bind(this),text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:this.dataToPositionZ.bind(this)})}afterInitMark(){super.afterInitMark()}initEvent(){var t;super.initEvent(),null===(t=this._viewDataLabel.getDataView())||void 0===t||t.target.addListener("change",this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(t){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd(t)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(jd.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),t.cornerRadius&&(e.cornerRadius=()=>this._computeLayoutRadius()*t.cornerRadius),e}computeCenter(t){return{x:this._pieMark.getAttribute("x",t,"normal"),y:this._pieMark.getAttribute("y",t,"normal")}}getRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.outerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.outerRadius;return null!=l?l:this._outerRadius}getInnerRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.innerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.innerRadius;return null!=l?l:this._innerRadius}computeRadius(t,e){return this._computeLayoutRadius()*t*(P(e)?1:e)+this._centerOffset}computeDatumRadius(t,e){return this._computeLayoutRadius()*this.getRadius(e)+this._centerOffset}_compareSpec(t,e,i){i=null!=i?i:{data:!0};const s=["centerX","centerY","centerOffset","radius","innerRadius","cornerRadius","startAngle","endAngle","padAngle"];s.forEach((t=>{i[t]=!0}));const n=super._compareSpec(t,e,i);return t=null!=t?t:{},s.some((i=>t[i]!==e[i]))&&(n.reRender=!0,n.change=!0),n}computeDatumInnerRadius(t,e){return this._computeLayoutRadius()*this.getInnerRadius(e)+this._centerOffset}dataToPosition(t,e){const i=t[ch];if(P(i))return null;if(e&&!this.isDatumInViewData(t))return null;const s=this.computeDatumRadius(t);return Tt(this.computeCenter(t),s,i)}initAnimation(){var t,e,i;const s={growFrom:(t,e,i)=>{var s;if(i===Yp.appear)return this._startAngle;if(i===Yp.disappear)return this._endAngle;const n=[Yp.disappear,Yp.exit],r=e.mark.elements,a=null==t?void 0:t[mT];if(void 0===r.find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[mT]){var e;return(null===(e=t.data[0])||void 0===e?void 0:e[mT])>a})))return this._endAngle;const o=[...r].reverse().find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[mT])t.getAttribute("x",e),to:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[ch]).x},y:{from:e=>t.getAttribute("y",e),to:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[ch]).y}}}},{duration:o,effects:{easing:l,channel:{x:{to:e=>t.getAttribute("x",e),from:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[ch]).x},y:{to:e=>t.getAttribute("y",e),from:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[ch]).y}}}}]}}(this._pieMark,t.normal)),this._pieMark.setAnimationConfig(t)}if(this._emptyArcMark){const t=TL(null===(i=$l.getAnimationInKey("emptyCircle"))||void 0===i?void 0:i(s,null!=n?n:"fadeIn"));this._emptyArcMark.setAnimationConfig(t)}}getDefaultShapeType(){return"circle"}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){return e}getActiveMarks(){return[this._pieMark]}}oB.transformerConstructor=sB,oB.mark=eB;class lB extends oB{constructor(){super(...arguments),this.type=_l.pie}}lB.type=_l.pie;class hB extends GD{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Ra(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return M(r)&&n.forEach((t=>{P(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:t.radius,outerRadius:t.outerRadius,innerRadius:t.innerRadius,startAngle:t.startAngle,endAngle:t.endAngle,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),y(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),M(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class dB extends hB{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.seriesField,valueField:t.valueField||t.angleField,center:t.center,centerOffset:t.centerOffset,cornerRadius:t.cornerRadius,padAngle:t.padAngle,minAngle:t.minAngle,emptyPlaceholder:t.emptyPlaceholder,emptyCircle:null===(e=t.emptyPlaceholder)||void 0===e?void 0:e.emptyCircle,showAllZero:t.showAllZero,supportNegative:t.supportNegative,layoutRadius:t.layoutRadius})}}class cB extends ZD{constructor(){super(...arguments),this.transformerConstructor=dB}}cB.transformerConstructor=dB;class uB extends cB{constructor(){super(...arguments),this.transformerConstructor=dB,this.type="pie",this.seriesType=_l.pie}}uB.type="pie",uB.seriesType=_l.pie,uB.transformerConstructor=dB;class pB extends JI{constructor(){super(...arguments),this.type=pB.type,this._support3d=!0}}pB.type="arc3d";const gB=()=>{ML(),yx(),eS(),pc.registerGraphic(Xd.arc3d,Vx),$l.registerMark(pB.type,pB)};class mB extends sB{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class _B extends oB{constructor(){super(...arguments),this.type=_l.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=mB}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",Ly.Series)}initLabelMarkStyle(t,e={}){if(!t)return;super.initLabelMarkStyle(t);const i={};t.setSupport3d(!0),i.beta=this._angle3d,i.anchor3d=t=>{const{x:e,y:i}=this.getCenter();return[e,i]},i.angle=t=>{const i=t[ch];return"inside"===e.position?wt(i):0},this.setMarkStyle(t,Object.assign(Object.assign({},i),{z:100}),void 0,Ly.Mark)}}_B.type=_l.pie3d,_B.mark=iB,_B.transformerConstructor=mB;class fB extends dB{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class vB extends cB{constructor(){super(...arguments),this.transformerConstructor=fB,this.type="pie3d",this.seriesType=_l.pie3d}}vB.type="pie3d",vB.seriesType=_l.pie3d,vB.transformerConstructor=fB;const yB=t=>{const e="angle"===t.growField?0:t.innerRadius;return"angle"===t.growField?{type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}:{channel:{innerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.innerRadius}},outerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.outerRadius}}}}},bB={type:"fadeIn"},xB=t=>({type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}),SB=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"}),MB=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"});function kB(t,e){if(!1===e)return{};switch(e){case"fadeIn":return bB;case"growAngle":return yB(Object.assign(Object.assign({},t),{growField:"angle"}));default:return yB(Object.assign(Object.assign({},t),{growField:"radius"}))}}class AB extends NI{getStackGroupFields(){return this._angleField}getStackValueField(){return Ra(this._spec.valueField)[0]||Ra(this._spec.radiusField)[0]}getGroupFields(){return this._angleField}setAttrFromSpec(){super.setAttrFromSpec(),this.setAngleField(this._spec.categoryField||this._spec.angleField),this.setRadiusField(this._spec.valueField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice(),this.setInnerRadiusField(this._spec.valueField||this._spec.radiusField),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent()}setValueFieldToStack(){this.setRadiusField(xT),this.setInnerRadiusField(bT)}setValueFieldToPercent(){this.setRadiusField(MT),this.setInnerRadiusField(ST)}getDimensionField(){return this._specAngleField}getMeasureField(){return this._specRadiusField}getDefaultShapeType(){return"square"}}const wB=Object.assign(Object.assign({},iC),{rose:{name:"rose",type:"arc"}});class TB extends IL{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){this._addMarkLabelSpec(t,"rose")}}var CB=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if(!HE(e))return;const{axisType:l,componentName:h,startAngle:d,endAngle:c,center:u,outerRadius:p,layoutRadius:g}=rB(e,t);e.center=u,e.startAngle=d,e.endAngle=c,e.outerRadius=p,e.type=l,e.layoutRadius=g;const m={spec:e,specPath:[this.specKey,o],specInfoPath:["component",this.specKey,o],type:h};i.push(m),"radius"===e.orient?(r.push(m),n=o):(a.push(m),s=o)})),r.forEach((t=>{t.angleAxisIndex=s})),a.forEach((t=>{t.radiusAxisIndex=n})),i}static createComponent(t,e){const{spec:i}=t,s=CB(t,["spec"]),n=$l.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}constructor(t,e){super(t,e),this.type=r.polarAxis,this.name=r.polarAxis,this._defaultBandPosition=0,this._defaultBandInnerPadding=0,this._defaultBandOuterPadding=0,this.layoutType="absolute",this.layoutZIndex=Ty.Axis,this._tick=void 0,this._center=null,this._startAngle=gh,this._endAngle=mh,this._orient="radius",this._groupScales=[],this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),uE(this._regions,(t=>{"radius"===this.getOrient()?t.radiusAxisHelper=this.axisHelper():t.angleAxisHelper=this.axisHelper()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{var e;const i=null===(e=this.getRegions())||void 0===e?void 0:e[0];return i?i.getLayoutStartPoint():t},this.getCenter=()=>{var t,e;const i=this.getRefLayoutRect(),{width:s,height:n}=i;return{x:el(null===(t=this._center)||void 0===t?void 0:t.x,s,i,s/2),y:el(null===(e=this._center)||void 0===e?void 0:e.y,n,i,n/2)}},this.getRefLayoutRect=()=>this.getRegions()[0].getLayoutRect(),this._coordinateType="polar"}setAttrFromSpec(){super.setAttrFromSpec(),this.visible&&(this._axisStyle=this._getAxisAttributes(),this._gridStyle=this._getGridAttributes()),this._tick=this._spec.tick,this._orient="angle"===this._spec.orient?"angle":"radius",this._center=this._spec.center,this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._inverse=this._spec.inverse}onRender(t){}changeRegions(){}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimal:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,startAngle:this.startAngle,labelOffset:FE(this._spec),getRadius:()=>this.getOuterRadius(),inside:this._spec.inside})}afterCompile(){var t;const e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct();e&&e.addEventListener(rc.AFTER_ELEMENT_ENCODE,(()=>{!1===this._isLayout&&this._delegateAxisContainerEvent(e.getGroupGraphicItem())}))}updateScaleRange(){const t=this._scale.range();let e;return e="radius"===this.getOrient()?this._inverse?[this.computeLayoutOuterRadius(),this.computeLayoutInnerRadius()]:[this.computeLayoutInnerRadius(),this.computeLayoutOuterRadius()]:this._inverse?[this._endAngle,this._startAngle]:[this._startAngle,this._endAngle],!(t&&e&&t[0]===e[0]&&t[1]===e[1]||(this._scale.range(e),0))}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:"radius"===this.getOrient()?e.getRadiusField():e.getAngleField(),n}updateSeriesScale(){uE(this._regions,(t=>{"radius"===this.getOrient()?(t.setRadiusScale(this._scale),t.radiusAxisHelper=this.axisHelper()):(t.setAngleScale(this._scale),t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getSeriesStatisticsField(t){const e="radius"===this.getOrient()?t.getRadiusField():t.getAngleField();return Jh(this._scale.type)?e:[e[0]]}initGroupScales(){}axisHelper(){return{isContinuous:Jh(this._scale.type),dataToPosition:this.dataToPosition.bind(this),coordToPoint:this.coordToPoint.bind(this),pointToCoord:this.pointToCoord.bind(this),center:this.getCenter.bind(this),layoutRadius:this._computeLayoutRadius.bind(this),getScale:(t=0)=>this._scales[t],getAxisId:()=>this.id,getSpec:()=>this._spec}}positionToData(t){const e=this.pointToCoord(t);return"radius"===this.getOrient()?this.invert(e.radius):this.invert(e.angle)}coordToPoint(t){return Tt(this.getCenter(),t.radius,t.angle)}pointToCoord(t){const{x:e,y:i}=this.getCenter();let s=t.x-e,n=t.y-i;const r=this._startAngle,a=this._endAngle,o=Math.sqrt(s*s+n*n);s/=o,n/=o;let l=Math.atan2(n,s);if(la)for(;l>=a;)l-=2*Math.PI;return{radius:o,angle:l}}getOuterRadius(){return this.computeLayoutOuterRadius()}getInnerRadius(){return this.computeLayoutInnerRadius()}updateLayoutAttribute(){this._visible&&("radius"===this.getOrient()?this._layoutRadiusAxis():this._layoutAngleAxis()),super.updateLayoutAttribute()}_getNormalizedValue(t,e){return 0===e?0:(this.dataToPosition(t)-this._getStartValue())/e}getLabelItems(t){var e;const i=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();return i&&i.length?[i.map((e=>WE(e.value,this._getNormalizedValue([e.value],t))))]:[]}_getStartValue(){return"radius"===this.getOrient()?this.computeLayoutInnerRadius():this._startAngle}_layoutAngleAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this._endAngle-this._startAngle,o=this.getLabelItems(a),l=Object.assign(Object.assign({},this.getLayoutStartPoint()),{inside:this._spec.inside,center:s,radius:n,innerRadius:r,startAngle:this._startAngle,endAngle:this._endAngle,sides:(null===(i=null===(e=null===(t=this._getRelatedAxis(this._option.radiusAxisIndex))||void 0===t?void 0:t.getSpec())||void 0===e?void 0:e.grid)||void 0===i?void 0:i.smooth)?void 0:this.getScale().domain().length}),h=Object.assign(Object.assign({},l),{title:{text:this._spec.title.text||this._dataFieldText},items:o,orient:"angle"});this._spec.grid.visible&&(h.grid=Object.assign({type:"line",smoothLink:!0,items:o[0]},l)),this._update(h)}_layoutRadiusAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this.coordToPoint({angle:this._startAngle,radius:n}),o=this.coordToPoint({angle:this._startAngle,radius:r}),l=ae.distancePP(o,a),h=this.getLabelItems(l),d=Object.assign(Object.assign({},this.getLayoutStartPoint()),{start:o,end:a,verticalFactor:-1}),c=Object.assign(Object.assign({},d),{title:{text:this._spec.title.text||this._dataFieldText},items:h,orient:"radius"});(null===(t=this._spec.grid)||void 0===t?void 0:t.visible)&&(c.grid=Object.assign({items:h[0],type:(null===(e=this._spec.grid)||void 0===e?void 0:e.smooth)?"circle":"polygon",center:s,closed:!0,sides:null===(i=this._getRelatedAxis(this._option.angleAxisIndex))||void 0===i?void 0:i.getScale().domain().length,startAngle:this._startAngle,endAngle:this._endAngle},d)),this._update(c)}_getRelatedAxis(t){if(M(t))return this._option.getComponentByIndex(this.specKey,t)}_computeLayoutRadius(){return aB((()=>this._spec.layoutRadius),this.getRefLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}computeLayoutOuterRadius(){var t;const e=null!==(t=this._spec.outerRadius)&&void 0!==t?t:this._spec.radius,i=null!=e?e:this.getRefSeriesRadius().outerRadius;return this._computeLayoutRadius()*i}computeLayoutInnerRadius(){var t;const e=null!==(t=this._spec.innerRadius)&&void 0!==t?t:this.getRefSeriesRadius().innerRadius;return this._computeLayoutRadius()*e}getRefSeriesRadius(){let t=_h,e=0;const i=this.getChart().getSpec();return uE(this.getRegions(),(s=>{const n=s;if(r=n.type,[_l.rose,_l.radar,_l.circularProgress].includes(r)){const{outerRadius:s=i.outerRadius,innerRadius:r=i.innerRadius}=n;Wo(s)&&(t=s),Wo(r)&&(e=r)}var r}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),{outerRadius:t,innerRadius:e}}_update(t){const{grid:e}=t,i=CB(t,["grid"]);this._axisMark.getProduct().encode(Tl({},this._axisStyle,i)),this._gridMark&&this._gridMark.getProduct().encode(Tl({},this._gridStyle,e))}invert(t){var e;if("angle"===this.getOrient()&&"band"===this._scale.type){const i=this._scale.range(),s=i[i.length-1]-i[0],n=.5===(null!==(e=this.getSpec().bandPosition)&&void 0!==e?e:this._defaultBandPosition)?0:this._scale.bandwidth()/2;if(i[0]<0){const e=(t+n+Math.abs(i[0]))%s-Math.abs(i[0]);return this._scale.invert(e)}return this._scale.invert((t+n)%s)}return this._scale.invert(t)}}LB.type=r.polarAxis,LB.specKey="axes";const EB=(t,e)=>{const{tickCount:i,forceTickCount:s,tickStep:n,getRadius:r,labelOffset:a,labelGap:o=0,labelStyle:l}=e,h=null==r?void 0:r();if(!h)return xE(t.domain());let d;if(M(n))d=t.stepTicks(n);else if(M(s))d=t.forceTicks(s);else if(M(i)){const e=t.range(),s=Math.abs(e[e.length-1]-e[0]),n=rs(i)?i({axisLength:s,labelStyle:l}):i;d=t.ticks(n)}else if(e.sampling){const i=t.domain(),s=t.range(),n=((t,e,i)=>{var s;const{labelStyle:n,getRadius:r,labelOffset:a,labelFormatter:o,inside:l}=i,h=null==r?void 0:r(),d=null!==(s=n.angle)&&void 0!==s?s:0,c=Xk(n),u=e.map((e=>{var i,s;const r=o?o(e):`${e}`,{width:u,height:p}=c.quickMeasure(r),g=Math.max(u,12),m=Math.max(p,12),_=t.scale(e);let f=0,v=0;const y=null!==(i=n.textAlign)&&void 0!==i?i:"center",b=null!==(s=n.textBaseline)&&void 0!==s?s:"middle",{x,y:S}=function(t,e,i,s,n,r,a){const o=Tt({x:0,y:0},i,t),l=TP(o,CP(s,o,e,n));return AP(l,CP(s||1,l,e,n),r,a)}(_,{x:0,y:0},h,a,l,r,n);return f=x+("right"===y?-g:"center"===y?-g/2:0),v=S+("bottom"===b?-m:"middle"===b?-m/2:0),(new Bt).set(f,v,f+g,v+m).rotate(d,f+g/2,v+m/2)}));return u})(t,i,e),r=Fa(s),l=Ba(s),c=Math.abs(l-r)*(h+a)/i.length,{step:u,delCount:p}=PB(i,n,o,Math.floor(n.reduce(((t,e)=>Math.min(t,e.width(),e.height())),Number.MAX_VALUE)/c));d=t.stepTicks(u),d=d.slice(0,d.length-p)}else d=t.domain();return xE(d)},PB=(t,e,i,s)=>{let n=s;do{let s=!0;n++;let r=0;do{r+n2){let i=t.length-t.length%n;for(i>=t.length&&(i-=n);i>0&&SE(e[0],e[i]);)r++,i-=n}return{step:n,delCount:r}};class DB extends LB{constructor(){super(...arguments),this.type=r.polarBandAxis,this._scale=new Jb}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){const t=super.updateScaleRange();return this.updateGroupScaleRange(),t}axisHelper(){const t=super.axisHelper();return Object.assign(Object.assign({},t),{getBandwidth:e=>t.getScale(e).bandwidth()})}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,EB),t}transformScaleDomain(){}}DB.type=r.polarBandAxis,DB.specKey="axes",XA(DB,hP);const OB=()=>{vD(),wD(),yD(),TD(),rP(),$l.registerComponent(DB.type,DB)};class RB extends LB{constructor(){super(...arguments),this.type=r.polarLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new $b}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){super.initScales(),this.setScaleNice()}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,jD),t}}RB.type=r.polarLinearAxis,RB.specKey="axes",XA(RB,YD);const IB=()=>{vD(),wD(),yD(),TD(),rP(),$l.registerComponent(RB.type,RB)};class BB extends AB{constructor(){super(...arguments),this.type=_l.rose,this.transformerConstructor=TB,this._roseMark=null,this._labelMark=null}initMark(){this.initRoseMark()}initMarkStyle(){this.initRoseMarkStyle()}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}initRoseMark(){var t,e;this._roseMark=this._createMark(BB.mark.rose,{morph:PL(this._spec,BB.mark.rose.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(t=this._spec.rose)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.rose)||void 0===e?void 0:e.stateSort})}getRoseAngle(){var t,e,i;return null!==(i=null===(e=(t=this.angleAxisHelper).getBandwidth)||void 0===e?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))&&void 0!==i?i:.5}startAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}endAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+this.getRoseAngle()-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}initRoseMarkStyle(){const t=this._roseMark;t&&this.setMarkStyle(t,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),fill:this.getColorAttribute(),outerRadius:t=>sx(this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]]),this.radiusAxisHelper.getScale(0)),innerRadius:t=>{var e;if(!this.getStack())return 0;const i=sx(this.radiusAxisHelper.dataToPosition([t[this._innerRadiusField[0]]]),this.radiusAxisHelper.getScale(0));return i<=Number.MIN_VALUE?this._computeLayoutRadius()*(null!==(e=this._spec.innerRadius)&&void 0!==e?e:0):i}})}initTooltip(){super.initTooltip(),this._roseMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._roseMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:0})}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._roseMark){const t={innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)}};this._roseMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("rose"))||void 0===i?void 0:i(t,s),CL("rose",this._spec,this._markAttributeContext)))}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._roseMark]}}BB.type=_l.rose,BB.mark=wB,BB.transformerConstructor=TB;class FB extends hB{needAxes(){return!0}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.angleField,valueField:t.valueField||t.radiusField})}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class YB extends FB{_getDefaultSeriesSpec(t){var e,i,s;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:null!==(e=t.radius)&&void 0!==e?e:_h,outerRadius:null!==(i=t.outerRadius)&&void 0!==i?i:_h,innerRadius:null!==(s=t.innerRadius)&&void 0!==s?s:0,seriesField:t.seriesField,stack:t.stack,percent:t.percent})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&P(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Ra(t.crosshair||{}).map((t=>Tl({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}class jB extends ZD{constructor(){super(...arguments),this.transformerConstructor=YB,this.type="rose",this.seriesType=_l.rose}}jB.type="rose",jB.seriesType=_l.rose,jB.transformerConstructor=YB,XA(jB,tO);class HB extends ps{constructor(t,e,i,s,n){super(t,e,i,s,n);const r=this.params.pointToCoord,a=this.params.coordToPoint;rs(r)&&rs(a)||(this.valid=!1),this._pointToCoord=r,this._coordToPoint=a}getEndProps(){return!1===this.valid?{}:this._coordToPoint({angle:this._toAngle,radius:this._toRadius})}onBind(){const{angle:t,radius:e}=this._pointToCoord(this.from),{angle:i,radius:s}=this._pointToCoord(this.to);Wo(i*s)||(this.valid=!1),this._fromAngle=Wo(t)?t:i,this._fromRadius=Wo(e)?e:s,this._toAngle=i,this._toRadius=s,gd(this._fromAngle,this._toAngle)&&gd(this._fromRadius,this._toRadius)&&(this.valid=!1)}onUpdate(t,e,i){if(!1===this.valid)return i.x=this.to.x,void(i.y=this.to.y);if(t){const{x:t,y:e}=this.getEndProps();i.x=t,i.y=e}else{const{x:t,y:s}=this._coordToPoint({angle:this._fromAngle+(this._toAngle-this._fromAngle)*e,radius:this._fromRadius+(this._toRadius-this._fromRadius)*e});i.x=t,i.y=s}}}class zB extends pA{constructor(t,e,i,s,n){super(t,e,i,s,n);const r=this.params.pointToCoord,a=this.params.coordToPoint;this._pointToCoord=r,this._coordToPoint=a}onUpdate(t,e,i){this.points=this.points.map(((t,i)=>{const s=this.polarPointInterpolation(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return s.context=t.context,s})),i.points=this.points}polarPointInterpolation(t,e,i){const s=this._pointToCoord(t),n=this._pointToCoord({x:t.x1,y:t.y1});let r=Lt(s.angle),a=Lt(n.angle);const o=this._pointToCoord(e),l=this._pointToCoord({x:e.x1,y:e.y1});let h=Lt(o.angle),d=Lt(l.angle);!Wo(r)&&Wo(h)&&(r=h),Wo(r)&&!Wo(h)&&(h=r),!Wo(a)&&Wo(d)&&(a=d),Wo(a)&&!Wo(d)&&(d=a);const c=r+(h-r)*i,u=s.radius+(o.radius-s.radius)*i,p=a+(d-a)*i,g=n.radius+(l.radius-n.radius)*i,{x:m,y:_}=this._coordToPoint({angle:c,radius:u}),{x:f,y:v}=this._coordToPoint({angle:p,radius:g}),y=new re(m,_,f,v);return y.defined=e.defined,y}}const NB=t=>({type:"in"===t?"fadeIn":"fadeOut"});function VB(t,e,i){return"fadeIn"===e?NB(i):((t,e)=>({type:"in"===e?"growPointsIn":"growPointsOut",options:()=>({center:t.center()})}))(t,i)}function WB(t,e,i){return"fadeIn"===e?NB(i):((t,e)=>{const i=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.x},s=(t,e)=>e.getGraphicAttribute("x"),n=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.y},r=(t,e)=>e.getGraphicAttribute("y");return"in"===e?{channel:{x:{from:i,to:s},y:{from:n,to:r}}}:{channel:{x:{from:s,to:i},y:{from:r,to:n}}}})(t,i)}const GB=(t,e)=>({custom:mA,customParameters:(i,s)=>{var n;return{group:s.getGraphicItem(),startAngle:null!==(n=t.startAngle)&&void 0!==n?n:Math.PI/2,orient:"clockwise",center:t.center(),radius:t.radius(),animationType:e}}}),UB=Object.assign(Object.assign(Object.assign({},iC),NL),{area:{name:"area",type:"area"}});class $B extends AB{constructor(){super(...arguments),this.type=_l.radar,this.transformerConstructor=cE,this._sortDataByAxis=!1}initGroups(){}compile(){super.compile(),this.addOverlapCompile()}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},r=!1!==(null===(t=this._spec.area)||void 0===t?void 0:t.visible)&&!1!==(null===(i=null===(e=this._spec.area)||void 0===e?void 0:e.style)||void 0===i?void 0:i.visible),a=null!==(s=this._spec.seriesMark)&&void 0!==s?s:"area";this.initAreaMark(n,r&&"area"===a),this.initLineMark(n,"line"===a||"area"===a&&!r),this.initSymbolMark(n,"point"===a)}initMarkStyle(){this.initAreaMarkStyle(),this.initLineMarkStyle(),this.initSymbolMarkStyle()}initAreaMark(t,e){var i,s;this._areaMark=this._createMark($B.mark.area,{progressive:t,isSeriesMark:e,customShape:null===(i=this._spec.area)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.area)||void 0===s?void 0:s.stateSort})}initAreaMarkStyle(){const t=this._areaMark;t&&(this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),x1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).x:Number.NaN,y1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).y:Number.NaN,fill:this.getColorAttribute(),curveType:zL,closePath:!0},"normal",Ly.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Ly.Series),this.event.on(jd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"defined")})))}initTooltip(){super.initTooltip();const{dimension:t,group:e,mark:i}=this._tooltipHelper.activeTriggerSet;this._lineMark&&(t.add(this._lineMark),e.add(this._lineMark)),this._areaMark&&(t.add(this._areaMark),e.add(this._areaMark)),this._symbolMark&&(i.add(this._symbolMark),e.add(this._symbolMark))}initAnimation(){var t,e,i,s;const n={center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()},radius:()=>{const t=this.getLayoutRect();return Math.min(t.width,t.height)},startAngle:M(this._spec.startAngle)?At(this._spec.startAngle):gh,pointToCoord:t=>{var e;return null===(e=this.angleAxisHelper)||void 0===e?void 0:e.pointToCoord(t)},coordToPoint:t=>this.angleAxisHelper.coordToPoint(t)},r=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===r&&this._rootMark&&this._rootMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("radarGroup"))||void 0===s?void 0:s(n,r),CL("group",this._spec,this._markAttributeContext))),[[this._areaMark,"radar"],[this._lineMark,"radar"],[this._symbolMark,"radarSymbol"]].forEach((([t,e])=>{if(M(t)){const i=$l.getAnimationInKey(e);t.setAnimationConfig(TL(null==i?void 0:i(n,r),CL(t.name,this._spec,this._markAttributeContext)))}}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}getSeriesStyle(t){return e=>{var i,s,n,r;let a=null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0;return"fill"!==e||a||(e="stroke",a=null!==(r=null===(n=this._seriesMark)||void 0===n?void 0:n.getAttribute(e,t))&&void 0!==r?r:void 0),"stroke"===e&&y(a)?a[0]:a}}}$B.type=_l.radar,$B.mark=UB,$B.transformerConstructor=cE,XA($B,VL);class KB extends FB{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,line:t.line,point:t.point,stack:t.stack,percent:t.percent,area:Tl({visible:!1},t.area),seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"area",activePoint:t.activePoint,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Ra(t.crosshair||{}).map((t=>Tl({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}class XB extends ZD{constructor(){super(...arguments),this.transformerConstructor=KB,this.type="radar",this.seriesType=_l.radar}}XB.type="radar",XB.seriesType=_l.radar,XB.transformerConstructor=KB,XA(XB,tO);class qB extends GD{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=ns(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{Gd(e,"trimPadding")&&Tl(e,fy(this.type,t))})),this._transformAxisSpec(t)}}class ZB extends ZD{constructor(){super(...arguments),this.transformerConstructor=qB,this.type="common"}}ZB.type="common",ZB.transformerConstructor=qB,XA(ZB,tO);class JB{static getInstance(){return JB.instance||(JB.instance=new JB),JB.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,i)=>{const s=this.shortWeekdayRe.exec(e.slice(i));return s?(t.w=this.shortWeekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseWeekday=(t,e,i)=>{const s=this.weekdayRe.exec(e.slice(i));return s?(t.w=this.weekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseShortMonth=(t,e,i)=>{const s=this.shortMonthRe.exec(e.slice(i));return s?(t.m=this.shortMonthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseMonth=(t,e,i)=>{const s=this.monthRe.exec(e.slice(i));return s?(t.m=this.monthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseDayOfMonth=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.d=+s[0],i+s[0].length):-1},this.parseHour24=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.H=+s[0],i+s[0].length):-1},this.parseMilliseconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+3));return s?(t.L=+s[0],i+s[0].length):-1},this.parseMonthNumber=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.m=s-1,i+s[0].length):-1},this.parseMinutes=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.M=+s[0],i+s[0].length):-1},this.parsePeriod=(t,e,i)=>{const s=this.periodRe.exec(e.slice(i));return s?(t.p=this.periodLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseSeconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.S=+s[0],i+s[0].length):-1},this.parseFullYear=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+4));return s?(t.y=+s[0],i+s[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,i){return{y:t,m:e,d:i,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}pad(t,e,i){const s=t<0?"-":"",n=(s?-t:t)+"",r=n.length;return s+(r=a)return-1;if(o=e.charCodeAt(n++),37===o){if(o=e.charAt(n++),l=this.parses[o in this.pads?e.charAt(n++):o],!l||(s=l(t,i,s))<0)return-1}else if(o!==i.charCodeAt(s++))return-1}return s}newParse(t,e){const i=this;return function(s){const n=i.newDate(1900,void 0,1);return i.parseSpecifier(n,t,s+="",0)!==s.length?null:"Q"in n?new Date(n.Q):"s"in n?new Date(1e3*n.s+("L"in n?n.L:0)):(e&&!("Z"in n)&&(n.Z=0),"p"in n&&(n.H=n.H%12+12*n.p),void 0===n.m&&(n.m="q"in n?n.q:0),"Z"in n?(n.H+=n.Z/100|0,n.M+=n.Z%100,i.utcDate(n)):i.localDate(n))}}newFormat(t,e){const i=this;return function(s){const n=[];let r=-1,a=0;const o=t.length;let l,h,d;for(s instanceof Date||(s=new Date(+s));++rJB.getInstance().timeFormat("%Y%m%d %H:%M",t.from.split("_")[1])},{hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:"type",value:t=>t.action_type},{hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:"from",value:t=>t.from},{hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:"to",value:t=>t.to}]}:null}}class tF extends mx{constructor(){super(...arguments),this.type=tF.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x1:0,y1:0})}}tF.type="rule";const eF=()=>{$l.registerMark(tF.type,tF),HA()},iF=Object.assign(Object.assign({},iC),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),sF=(t,e)=>{const{infoKey:i,fields:s,linkData:n,dotData:r}=e,{fromField:a,toField:o,xField:l,yField:h}=s(),d=n(),c=r(),u={};return c.forEach((t=>{const e={};for(const s in t)s!==i&&(e[s]=t[s]);const s=t[i];null==s||s.forEach((t=>{u[t.node_name]=Object.assign({},e,t)}))})),d.forEach((t=>{var e,i,s,n;t[a+"_xField"]=null===(e=null==u?void 0:u[t[a]])||void 0===e?void 0:e[l],t[a+"_yField"]=null===(i=null==u?void 0:u[t[a]])||void 0===i?void 0:i[h],t[o+"_xField"]=null===(s=null==u?void 0:u[t[o]])||void 0===s?void 0:s[l],t[o+"_yField"]=null===(n=null==u?void 0:u[t[o]])||void 0===n?void 0:n[h]})),d};class nF extends jL{constructor(){super(...arguments),this.type=_l.link}getFromField(){return this._fromField}setFromField(t){M(t)&&(this._fromField=t)}getToField(){return this._toField}setToField(t){M(t)&&(this._toField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getDotSeriesSpec(){return this._dotSeriesSpec}setDotSeriesSpec(t){M(t)&&(this._dotSeriesSpec=t)}_getDotData(){const t=this._option.getChart().getSeriesInIndex([this._spec.dotSeriesIndex])[0];return t?t.getRawData().latestData:[]}initData(){var t;super.initData(),Ap(this._option.dataSet,"linkDotInfo",sF),null===(t=this.getViewData())||void 0===t||t.transform({type:"linkDotInfo",options:{infoKey:"dots",fields:()=>({fromField:this._fromField,toField:this._toField,xField:this._dotSeriesSpec.xField,yField:this._dotSeriesSpec.yField}),linkData:()=>this._rawData.latestData,dotData:()=>this._getDotData()},level:Fp.linkDotInfo},!1)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFromField(this._spec.fromField),this.setToField(this._spec.toField),this.setDotTypeField(this._spec.dotTypeField),this.setDotSeriesSpec(this._spec.dotSeriesSpec)}initMark(){this._clipMark=this._createMark(nF.mark.group),this._containerMark=this._createMark(nF.mark.group,{parent:this._clipMark}),this._linkMark=this._createMark(nF.mark.link,{skipBeforeLayouted:!1,parent:this._containerMark}),this._arrowMark=this._createMark(nF.mark.arrow,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark})}initMarkStyle(){var t,e,i,s;const n=this._clipMark;n&&(this.setMarkStyle(n,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",Ly.Series),n.setInteractive(!1));const r=this._containerMark;r&&(this.setMarkStyle(r,{x:this._spec.leftAppendPadding,width:this.getLayoutRect().width},"normal",Ly.Series),r.setInteractive(!1));const a=this._linkMark;a&&this.setMarkStyle(a,{stroke:this.getColorAttribute(),strokeOpacity:this.dataToOpacity.bind(this),x:this.dataToPositionXFrom.bind(this),y:this.dataToPositionYFrom.bind(this),x1:this.dataToPositionXTo.bind(this),y1:this.dataToPositionYTo.bind(this)},"normal",Ly.Series);const o=this._arrowMark;if(o){const n=null!==(s=null===(i=null===(e=null===(t=this._theme)||void 0===t?void 0:t.arrow)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)&&void 0!==s?s:10;this.setMarkStyle(o,{x:this.dataToPositionXTo.bind(this),y:t=>this.dataToPositionArrowYTo(t,n),fill:this.getColorAttribute(),fillOpacity:this.dataToOpacity.bind(this),size:n,symbolType:t=>this.isPositionYFromHigher(t)?"triangleDown":"triangleUp"},"normal",Ly.Series)}}afterInitMark(){super.afterInitMark()}dataToPositionXFrom(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYFrom(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_yField"))}dataToPositionXTo(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYTo(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})}dataToPositionArrowYTo(t,e){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:i}=this._yAxisHelper,s=this.isPositionYFromHigher(t)?-e/2:e/2;return i(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})+s}dataToOpacity(t){return this.isPositionXOuterRange(t,this._fromField+"_xField")||this.isPositionXOuterRange(t,this._toField+"_xField")||t[this._fromField]===t[this._toField]?0:1}isPositionYFromHigher(t){return this.dataToPositionYFrom(t)s(0).range()[1]}getDefaultColorDomain(){var t,e;return this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:fT}}initInteraction(){const t=[];this._linkMark&&t.push(this._linkMark),this._arrowMark&&t.push(this._arrowMark),this._parseInteractionConfig(t)}initTooltip(){this._tooltipHelper=new QB(this),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotInfoData(){var t,e;return null===(e=null!==(t=this._linkMark)&&void 0!==t?t:this._arrowMark)||void 0===e?void 0:e.getData()}getActiveMarks(){return[this._linkMark,this._arrowMark]}}nF.type=_l.link,nF.mark=iF;class rF extends VT{getDefaultTooltipPattern(t){return"mark"===t?{visible:!0,activeType:t,title:{key:"event info",value:"event info"},content:[{hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:t=>t.type,value:t=>t.id},{hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:"event_time",value:t=>JB.getInstance().timeFormat("%Y%m%d",t.event_time)},{hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:"action_type",value:t=>t.action_type},{shapeType:"square",hasShape:!0,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,key:"children",value:t=>t.children}],updateContent:(t,e,i)=>{const s=[],n=t.filter((t=>"children"===t.key));return n.length>0&&n[0].value.forEach((t=>{let i=!0;for(const n in t)s.push({shapeType:"circle",hasShape:i,shapeColor:this.shapeColorCallback(e[0].datum[0]),shapeStroke:this.shapeStrokeCallback(e[0].datum[0]),key:n,value:t[n]+""}),i=!1})),t.concat(s)}}:null}}const aF=(t,e)=>{var i;const s=(null===(i=t[0])||void 0===i?void 0:i.latestData)?t[0].latestData:t||[],n=[];return s.forEach((t=>{const i={};for(const s in t)s!==e&&(i[s]=t[s]);const s=t[e];null==s||s.forEach((t=>{n.push(Object.assign({},i,t))}))})),n},oF={fill:"#bbb",fillOpacity:.2};class lF extends mx{getTextType(){return this._textType}constructor(t,e){super(t,e),this.type=lF.type,this._textType="text"}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{angle:0,textAlign:"center",lineWidth:0,textConfig:[]})}initStyleWithSpec(t,e){super.initStyleWithSpec(t,e),t.textType&&(this._textType=t.textType)}compileEncode(){super.compileEncode(),"rich"===this._textType&&this._product.encodeState("group",{textType:this._textType})}}lF.type="text";const hF=()=>{$l.registerMark(lF.type,lF),NA(),yx(),JM(),pc.registerGraphic(Xd.richtext,NM)},dF=Object.assign(Object.assign({},iC),{group:{name:"group",type:"group"},grid:{name:"grid",type:"rule"},gridBackground:{name:"gridBackground",type:"rect"},dot:{name:"dot",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},symbol:{name:"symbol",type:"symbol"}});class cF extends jL{constructor(){super(...arguments),this.type=_l.dot}getSeriesGroupField(){return this._seriesField}setSeriesGroupField(t){M(t)&&(this._seriesGroupField=t)}getTitleField(){return this._titleField}setTitleField(t){M(t)&&(this._titleField=t)}getSubTitleField(){return this._subTitleField}setSubTitleField(t){M(t)&&(this._subTitleField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getHighLightSeriesGroup(){return this._highLightSeriesGroup}setHighLightSeriesGroup(t){M(t)&&(this._highLightSeriesGroup=t)}setGridBackground(t){M(t)&&(this._gridBackground=t)}initData(){var t;super.initData(),this._xDimensionStatisticsDomain=this.getRawData().latestData.map((t=>t[this._fieldY[0]])),Ap(this._option.dataSet,"objFlat",aF),Ap(this._option.dataSet,"copyDataView",Op),wp(this._option.dataSet,"dataview",b),null===(t=this.getViewData())||void 0===t||t.transform({type:"objFlat",options:"dots",level:Fp.dotObjFlat},!1)}setSeriesField(t){M(t)&&(this._seriesField=t,this.getMarksInType(["line","area"]).forEach((t=>{t.setFacet(this._seriesField)})))}getStatisticFields(){return[{key:this._fieldY[0],operations:["values"],customize:this._xDimensionStatisticsDomain}]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setSeriesGroupField(this._spec.seriesGroupField),this.setTitleField(this._spec.titleField),this.setSubTitleField(this._spec.subTitleField),this.setDotTypeField(this._spec.dotTypeField),this.setHighLightSeriesGroup(this._spec.highLightSeriesGroup),this.setGridBackground(Tl(oF,(null===(t=this._spec.grid)||void 0===t?void 0:t.background)||{}))}initMark(){this._clipMark=this._createMark(cF.mark.group),this._containerMark=this._createMark(cF.mark.group,{parent:this._clipMark,dataView:this.getRawData()}),this._gridBackgroundMark=this._createMark(cF.mark.gridBackground,{parent:this._containerMark,dataView:this.getRawData()}),this._gridMark=this._createMark(cF.mark.grid,{parent:this._containerMark,dataView:this.getRawData()}),this._dotMark=this._createMark(cF.mark.dot,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark}),this._titleMark=this._createMark(cF.mark.title,{parent:this._containerMark,dataView:this.getRawData()}),this._subTitleMark=this._createMark(cF.mark.subTitle,{parent:this._containerMark,dataView:this.getRawData()}),this._symbolMark=this._createMark(cF.mark.symbol,{parent:this._containerMark,dataView:this.getRawData()})}initMarkStyle(){const t=this._clipMark;t&&(this.setMarkStyle(t,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",Ly.Series),t.setInteractive(!1));const e=this._containerMark;e&&(this.setMarkStyle(e,{x:this._spec.leftAppendPadding},"normal",Ly.Series),e.setInteractive(!1));const i=this._gridBackgroundMark;i&&this.setMarkStyle(i,{x:this.getRegionRectLeft.bind(this),x1:this.getRegionRectRight.bind(this),y:this.dataToGridBackgroundPositionY.bind(this),y1:this.dataToGridBackgroundPositionY1.bind(this),fill:this._gridBackground.fill,fillOpacity:this.dataToGridBackgroundOpacity.bind(this)},"normal",Ly.Series);const s=this._gridMark;s&&this.setMarkStyle(s,{stroke:this.getColorAttribute(),x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),x1:this.getRegionRectRight.bind(this),y1:this.dataToPositionY.bind(this)},"normal",Ly.Series);const n=this._dotMark;n&&this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),fill:this.getDotColorAttribute(),fillOpacity:this.dataToOpacity.bind(this)},"normal",Ly.Series);const r=this._titleMark;r&&this.setMarkStyle(r,{fill:this.getColorAttribute(),text:t=>t[this.getTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Ly.Series);const a=this._subTitleMark;a&&this.setMarkStyle(a,{fill:this.getColorAttribute(),text:t=>t[this.getSubTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Ly.Series);const o=this._symbolMark;o&&this.setMarkStyle(o,{x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),fill:this.getColorAttribute()},"normal",Ly.Series)}dataToGridBackgroundPositionY(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})-i(0)/2}dataToGridBackgroundPositionY1(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})+i(0)/2}dataToOpacity(t){var e,i,s,n;if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:r,getScale:a}=this._xAxisHelper;return r(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})a(0).range()[1]?0:null!==(n=null===(s=null===(i=null===(e=this._theme)||void 0===e?void 0:e.dot)||void 0===i?void 0:i.style)||void 0===s?void 0:s.fillOpacity)&&void 0!==n?n:1}dataToGridBackgroundOpacity(t){return t[this._seriesGroupField]===this._highLightSeriesGroup?this._gridBackground.fillOpacity:0}onLayoutEnd(t){var e,i;super.onLayoutEnd(t);const s=null!==(i=null===(e=this._spec)||void 0===e?void 0:e.leftAppendPadding)&&void 0!==i?i:0;this.setMarkStyle(this._clipMark,{width:this.getLayoutRect().width+s},"normal",Ly.Series)}getDefaultColorDomain(){var t,e;return this._seriesGroupField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesGroupField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._seriesGroupField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:fT}}getDotColorScale(){var t,e,i;const s=this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesGroupField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesGroupField].values:this._seriesField?null===(i=this.getViewDataStatistics())||void 0===i?void 0:i.latestData[this._seriesField].values:[],n=this._getDataScheme();return(new tx).domain(s).range(n)}getDotColorAttribute(){var t,e,i,s;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this.getDotColorScale(),field:null!==(s=null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesGroupField)&&void 0!==i?i:this._seriesField)&&void 0!==s?s:fT}}initTooltip(){this._tooltipHelper=new rF(this),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark)}onEvaluateEnd(t){super.onEvaluateEnd(t)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotData(){var t;return null===(t=this._dotMark)||void 0===t?void 0:t.getData()}_getDataIdKey(){}getStackValueField(){return null}getActiveMarks(){return[this._dotMark]}}cF.type=_l.dot,cF.mark=dF;class uF extends GD{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Ra(e.data)[0];return t instanceof R?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Ra(t.data).find(((t,i)=>e.dataId?t instanceof R?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof R?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(t){var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;super.transformSpec(t);let _=0;const f=[],v=[],y=[],b=[],x=[],S=(this._option.getCompiler().getVGrammarView().width(),this._option.getCompiler().getVGrammarView().height());let M=0;if(null==t?void 0:t.legends){f.push({modelId:`legendRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${_}`);const o=Ra(t.legends);let l=null!==(e=o[0].height)&&void 0!==e?e:40;if(o[0].padding){const t=sl(o[0].padding);l+=Number(null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0),l+=Number(null!==(s=null==t?void 0:t.top)&&void 0!==s?s:0),o[0].offsetY=Number(null!==(r=null===(n=o[0])||void 0===n?void 0:n.offsetY)&&void 0!==r?r:0)+Number(null!==(a=null==t?void 0:t.top)&&void 0!==a?a:0)}x.push({index:_,size:l}),M+=l,_++}(null==t?void 0:t.dataZoom)&&(f.push({modelId:`dataZoomRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${_}`),M+=60,_++,this.addPaddingRow(x,_,10),M+=10,_++),M+=60,null!==t.axes&&"top"!==(null===(l=null===(o=null==t?void 0:t.axes)||void 0===o?void 0:o[0])||void 0===l?void 0:l.orient)||(this.addOrientAxes(v,f,_,t),_++);const k=t.series.filter((t=>t.type!==_l.link)).length,A=(S-M-20*k)/k,w=(null===(h=null==t?void 0:t.appendPadding)||void 0===h?void 0:h.left)||0,T=(null===(d=null==t?void 0:t.appendPadding)||void 0===d?void 0:d.right)||0;null===(c=null==t?void 0:t.series)||void 0===c||c.forEach((e=>{var i,s;if([_l.bar,_l.line,_l.area,_l.dot].includes(e.type)){if(f.push({modelId:`${e.type}Row${_}`,col:1,row:_}),f.push({modelId:`axesLeftRow${_}`,col:0,row:_}),v.push({id:`${e.type}Row${_}`,clip:!1}),x.push({index:_,size:(null==e?void 0:e.height)||A}),y.push({orient:"left",id:`axesLeftRow${_}`,type:e.type===_l.dot?"band":"linear",visible:e.type!==_l.dot,title:{visible:!0,autoRotate:!1,style:{text:null==e?void 0:e.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(i=null==e?void 0:e.grid)||void 0===i?void 0:i.visible)||(null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.visible),style:(t,i)=>{var s,n,r,a,o;let l=0;if(0===i){const t=null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==e?void 0:e.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:v.length-1}),e.type===_l.dot){f.push({modelId:`scrollBarRightRow${_}`,col:2,row:_});const i=this._getSeriesDataLength(t,e);let s=0;i&&(s=((null==e?void 0:e.height)||A)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===_l.dot&&s<1,id:`scrollBarRightRow${_}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:v.length-1,axisId:`axesLeftRow${_}`},Ra(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=v.length-1,_++,this.addPaddingRow(x,_,(null==e?void 0:e.padding)||20),_++,e.leftAppendPadding=w,e.type===_l.dot&&(e.title.style.dx=-w,e.subTitle.style.dx=-w)}})),this.addPaddingRow(x,_,20),_++,null===(u=null==t?void 0:t.series)||void 0===u||u.forEach((e=>{if(e.type===_l.link){const i=e.dotSeriesIndex+1;f.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=w,e.height=t.series[e.dotSeriesIndex].height,e.clipHeight=t.series[e.dotSeriesIndex].clipHeight}})),(null==t?void 0:t.legends)&&this.addAttrToComponentSpec(t.legends,"regionIndex",[v.length-1]),"bottom"===(null===(g=null===(p=null==t?void 0:t.axes)||void 0===p?void 0:p[0])||void 0===g?void 0:g.orient)&&(this.addOrientAxes(v,f,_,t),_++);const C={type:"grid",col:4,row:_,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:T}],rowHeight:x,elements:f};t.layout=C,t.region=v,null===(m=t.axes)||void 0===m||m.push(...y),t.scrollBar=b}}class pF extends ZD{constructor(){super(...arguments),this.transformerConstructor=uF,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nt.type="linear"))}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{x2Field:null==t?void 0:t.x2Field,y2Field:null==t?void 0:t.y2Field,barMinHeight:null==t?void 0:t.barMinHeight,barBackground:null==t?void 0:t.barBackground})}}class mF extends ZD{constructor(){super(...arguments),this.transformerConstructor=gF}}mF.transformerConstructor=gF,XA(mF,tO);class _F extends gF{transformSpec(t){super.transformSpec(t),gy(t)}}class fF extends mF{constructor(){super(...arguments),this.transformerConstructor=_F,this.type="histogram",this.seriesType=_l.bar}}fF.type="histogram",fF.seriesType=_l.bar,fF.transformerConstructor=_F;class vF extends mF{constructor(){super(...arguments),this.transformerConstructor=_F,this.type="histogram3d",this.seriesType=_l.bar3d}}vF.type="histogram3d",vF.seriesType=_l.bar3d,vF.transformerConstructor=_F;const yF=Object.assign(Object.assign({},iC),{group:{name:"group",type:"group"}});class bF extends NI{constructor(){super(...arguments),this._arcGroupMark=null,this._getAngleValueStart=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?bT:ET],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle);let o;if(M(s)){const t=tb(n,(t=>t.value-s)),e=t>=n.length||s>n[t].value-r/2?Math.min(t,n.length-1):t>0?t-1:void 0;void 0!==e&&(o=this.angleAxisHelper.dataToPosition([n[e].value-r/2]))}return P(o)&&(o=this.angleAxisHelper.dataToPosition([n[0].value-r/2])),o+a}return this._getAngleValueStartWithoutMask(t)},this._getAngleValueEnd=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?xT:this._angleField[0]],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle),o=tb(n,(t=>t.value-s)),l=o>=n.length||s>n[o].value-r/2?Math.min(o,n.length-1):o>0?o-1:void 0;let h;return h=void 0!==l?this.angleAxisHelper.dataToPosition([n[l].value+r/2]):this.angleAxisHelper.dataToPosition([n[0].value-r/2]),h+a}return this._getAngleValueEndWithoutMask(t)}}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec();const s=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getSpec(),n=null!==(e=this._spec.startAngle)&&void 0!==e?e:null==s?void 0:s.startAngle;this._startAngle=M(n)?At(n):gh;const r=null!==(i=this._spec.endAngle)&&void 0!==i?i:null==s?void 0:s.endAngle;this._endAngle=M(r)?At(r):mh,this.setAngleField(this._spec.valueField||this._spec.angleField),this.setRadiusField(this._spec.categoryField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice()}getStackGroupFields(){return this._radiusField}getStackValueField(){var t;return null===(t=this._angleField)||void 0===t?void 0:t[0]}getGroupFields(){return this._angleField}_convertMarkStyle(t){const e=super._convertMarkStyle(t);if(e.fill){const i=t.fill;"conical"!==(null==i?void 0:i.gradient)||M(null==i?void 0:i.startAngle)||M(null==i?void 0:i.endAngle)||(e.fill=Object.assign(Object.assign({},i),{startAngle:this._startAngle,endAngle:this._endAngle}))}return e}_getAngleValueStartWithoutMask(t){if(this.getStack()){const e=sx(this.angleAxisHelper.dataToPosition([t[bT]]),this.angleAxisHelper.getScale(0));if(Wo(e))return e}return this._startAngle}_getAngleValueEndWithoutMask(t){if(this.getStack()){const e=sx(this.angleAxisHelper.dataToPosition([t[xT]]),this.angleAxisHelper.getScale(0));if(Wo(e))return e}return this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])}getDimensionField(){return this._specRadiusField}getMeasureField(){return this._specAngleField}initMark(){this._initArcGroupMark()}initMarkStyle(){this._initArcGroupMarkStyle()}_initArcGroupMark(){return this._arcGroupMark=this._createMark(bF.mark.group,{skipBeforeLayouted:!1}),this._arcGroupMark}_initArcGroupMarkStyle(){const t=this._arcGroupMark;t.setZIndex(this.layoutZIndex),t.created(),this.setMarkStyle(t,{x:0,y:0},"normal",Ly.Series),t.setClip((()=>{const t=this._getAngleAxis();if(this._isTickMaskVisible(t)){const{tickMask:e}=this._spec,{angle:i,offsetAngle:s,style:n={}}=e,r=this._getAngleAxisSubTickData(t),{x:a,y:o}=this.angleAxisHelper.center(),l=this._computeLayoutRadius(),h=n;return r.map((({value:t})=>{const e=this.angleAxisHelper.dataToPosition([t])+At(s),n=At(i)/2;return Sx(Object.assign(Object.assign({},h),{x:a,y:o,startAngle:e-n,endAngle:e+n,innerRadius:l*this._innerRadius,outerRadius:l*this._outerRadius,fill:!0}))}))}const{width:e,height:i}=this.getLayoutRect();return[Uv({width:e,height:i,fill:!0})]})),this._arcGroupMark.setInteractive(!1)}_getAngleAxis(){if(!this.angleAxisHelper)return;const t=this.angleAxisHelper.getAxisId();return this._option.getChart().getAllComponents().find((e=>e.id===t))}_getAngleAxisTickData(t){var e;return null===(e=null==t?void 0:t.getTickData())||void 0===e?void 0:e.getLatestData()}_isTickMaskVisible(t){const e=this._getAngleAxisTickData(t),{tickMask:i}=this._spec;return i&&!1!==i.visible&&(null==e?void 0:e.length)>1}_getAngleAxisSubTickData(t){var e;const i=this._getAngleAxisTickData(t),s=[],{subTick:n={},tick:r={}}=null!==(e=null==t?void 0:t.getSpec())&&void 0!==e?e:{},{tickCount:a=4}=n,{alignWithLabel:o}=r;if((null==i?void 0:i.length)>=2){const t=i[1].value-i[0].value;for(let e=0;e({type:"growAngleIn",options:{overall:t.startAngle}}))(t)}const kF=()=>{$l.registerAnimation("circularProgress",((t,e)=>({appear:MF(t,e),enter:{type:"growAngleIn"},disappear:{type:"growAngleOut"}})))};class AF extends IL{constructor(){super(...arguments),this._supportStack=!0}}class wF extends bF{constructor(){super(...arguments),this.type=_l.circularProgress,this.transformerConstructor=AF,this._progressMark=null,this._trackMark=null,this._getRadiusValueStart=t=>{if(this.getGroupFields().length>1){const e=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()));if(Wo(e))return e}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])},this._getRadiusValueEnd=t=>{var e,i;if(this.getGroupFields().length>1){const s=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+(null===(i=(e=this.radiusAxisHelper).getBandwidth)||void 0===i?void 0:i.call(e,this._groups?this._groups.fields.length-1:0));if(Wo(s))return s}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])+this.radiusAxisHelper.getScale(0).step()}}getStackGroupFields(){return this.getGroupFields()}getGroupFields(){return this._radiusField}initMark(){super.initMark(),this._initTrackMark(),this._initProgressMark()}initMarkStyle(){super.initMarkStyle(),this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e;return this._progressMark=this._createMark(wF.mark.progress,{parent:this._arcGroupMark,isSeriesMark:!0,customShape:null===(t=this._spec.progress)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.progress)||void 0===e?void 0:e.stateSort}),this._progressMark}_initProgressMarkStyle(){var t;const e=this._progressMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart,endAngle:this._getAngleValueEnd,innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0},"normal",Ly.Series)}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initTooltip(){super.initTooltip(),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark)}_initTrackMark(){var t,e;return this._trackMark=this._createMark(wF.mark.track,{parent:this._arcGroupMark,customShape:null===(t=this._spec.track)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.track)||void 0===e?void 0:e.stateSort}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&this.setMarkStyle(t,{visible:t=>{const e=this.angleAxisHelper.getScale(0).range(),i=Math.min(e[0],e[e.length-1]),s=this._getAngleValueStartWithoutMask(t);return Math.abs(s-i)<=1e-14},x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:()=>{const t=this.getStack()?bT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueStart({[t]:e[0]})},endAngle:()=>{const t=this.getStack()?xT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueEnd({[t]:e[e.length-1]})},innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:100},"normal",Ly.Series)}initAnimation(){var t,e,i,s;const n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),CL("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),CL("track",this._spec,this._markAttributeContext)))}getActiveMarks(){return[this._progressMark]}}wF.type=_l.circularProgress,wF.mark=xF,wF.transformerConstructor=AF;class TF extends hB{needAxes(){return!1}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,categoryField:t.categoryField||t.radiusField,valueField:t.valueField||t.angleField,startAngle:t.startAngle,endAngle:t.endAngle,radius:t.radius,innerRadius:t.innerRadius,centerX:t.centerX,centerY:t.centerY})}_transformProgressAxisSpec(t,e,i,s,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),P(l.type)&&(l.type="linear"),P(o.type)&&(o.type="band");const h=YE(l,{min:0,max:1});P(l.min)&&(l.min=h.min),P(l.max)&&(l.max=h.max),s&&Object.assign(l,Tl({},s,l)),n&&Object.assign(o,Tl({},n,o))}}class CF extends TF{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{cornerRadius:null!==(e=t.cornerRadius)&&void 0!==e?e:0,roundCap:null!==(i=t.roundCap)&&void 0!==i&&i,progress:t.progress,track:t.track,tickMask:t.tickMask})}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}class LF extends ZD{constructor(){super(...arguments),this.transformerConstructor=CF,this.type="circularProgress",this.seriesType=_l.circularProgress}}LF.type="circularProgress",LF.seriesType=_l.circularProgress,LF.transformerConstructor=CF,XA(LF,tO);const EF=Object.assign(Object.assign({},yF),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),PF=Object.assign(Object.assign({},iC),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),DF={type:"fadeIn"};class OF extends IL{constructor(){super(...arguments),this._supportStack=!1}}class RF extends bF{constructor(){super(...arguments),this.type=_l.gaugePointer,this.transformerConstructor=OF,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(RF.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},RF.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(RF.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){super.initTooltip(),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return M(this.radiusAxisHelper)&&M(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=Ba(e),s=Fa(e),n=vs(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),d=Math.sin(l);return{x:a*h+o*d,y:-(o*h-a*d)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}initInteraction(){this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),CL("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}RF.type=_l.gaugePointer,RF.mark=PF,RF.transformerConstructor=OF;const IF=()=>{$l.registerSeries(RF.type,RF),wI(),fO(),$l.registerAnimation("gaugePointer",((t,e)=>{const i=function(t,e){return"fadeIn"===e?DF:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}(t,e);return{appear:i,enter:i,disappear:{type:"fadeOut"}}})),OB(),IB()};class BF extends IL{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class FF extends bF{constructor(){super(...arguments),this.type=_l.gauge,this.transformerConstructor=BF,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=At(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData(),Ap(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[PT]=t[this._angleField[0]],t[ET]=e>0?i[e-1][PT]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(FF.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(FF.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Gb(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Gb(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueStartWithoutPadAngle(t){return M(t[ET])?this.angleAxisHelper.dataToPosition([t[ET]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[PT]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),CL("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}FF.type=_l.gauge,FF.mark=EF,FF.transformerConstructor=BF;class YF extends TF{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{radiusField:t.radiusField,pin:t.pin,pinBackground:t.pinBackground,pointer:t.pointer})}_getDefaultCircularProgressSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:_l.circularProgress})}transformSpec(t){var e,i,s,n,r;super.transformSpec(t);let a=null===(e=t.series)||void 0===e?void 0:e.find((t=>t.type===_l.gauge||t.type===_l.circularProgress));P(a)&&(a=null!==(i=t.gauge)&&void 0!==i?i:this._getDefaultCircularProgressSeriesSpec(t),"circularProgress"===a.type&&(P(a.radiusField)&&P(a.categoryField)&&(a.radiusField=null!==(n=null!==(s=t.radiusField)&&void 0!==s?s:t.categoryField)&&void 0!==n?n:t.seriesField),P(a.valueField)&&P(a.angleField)&&(a.valueField=null!==(r=t.valueField)&&void 0!==r?r:t.angleField)),1===t.series.length?t.series.push(a):t.series.forEach((t=>{t.type===a.type&&Object.keys(a).forEach((e=>{e in t||(t[e]=a[e])}))}))),a.type===_l.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:Ty.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=t),"angle"===e&&(i.angle=t)})),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),P(i.angle.type)&&(i.angle.type="linear"),P(i.radius.type)&&(i.radius.type="linear"),P(i.angle.zIndex)&&(i.angle.zIndex=Ty.Region+50)}}class jF extends ZD{constructor(){super(...arguments),this.transformerConstructor=YF,this.type="gauge",this.seriesType=_l.gaugePointer}}jF.type="gauge",jF.seriesType=_l.gaugePointer,jF.transformerConstructor=YF;class HF extends GD{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class zF extends ZD{constructor(){super(...arguments),this.transformerConstructor=HF,this.type="wordCloud",this.seriesType=_l.wordCloud}}zF.transformerConstructor=HF;const NF=[0],VF=[20,40],WF=[200,500],GF={shrink:!1,enlarge:!1,fontSizeLimitMin:0},UF=["triangleForward","triangle","diamond","square","star","cardioid","circle","pentagon","rect"],$F=`${sh}_WORD_CLOUD_TEXT`,KF=Object.assign(Object.assign({},iC),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"},wordMask:{name:"wordMask",type:"rect"}});class XF extends BL{constructor(){super(...arguments),this._fontSizeRange=[20,20],this._isWordCloudShape=!1,this._dataChange=!0,this.handleMaskCanvasUpdate=(t,e)=>{this._maskCanvas=t},this.getWordColor=t=>t.isFillingWord?(this._fillingColorCallback&&!this._dataChange||(this._fillingColorCallback=this._wordCloudShapeConfig.fillingColorHexField?t=>t[this._wordCloudShapeConfig.fillingColorHexField]:this.initColorCallback(this._wordCloudShapeConfig.fillingSeriesField,!0)),this._fillingColorCallback(t)):(this._keyWordColorCallback&&!this._dataChange||(this._keyWordColorCallback=this._spec.colorHexField?t=>t[this._spec.colorHexField]:this.initColorCallback(this._seriesField,!1)),this._keyWordColorCallback(t)),this._calculateFontWeight=t=>{const e=this.getRawDataStatisticsByField(this._valueField,!0);return e.min===e.max?this._fontWeightRange[0]:this._fontWeightRange[0]+(this._fontWeightRange[this._fontWeightRange.length-1]-this._fontWeightRange[0])*(t[this._valueField]-e.min)/(e.max-e.min)}}setValueField(t){M(t)&&(this._valueField=t)}setFontSizeRange(t){M(t)?this._fontSizeRange=t:this._fontSizeRange=VF}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this._padding=this._option.getChart().padding,this._nameField=this._spec.nameField,this._colorMode=null!==(t=this._spec.colorMode)&&void 0!==t?t:"ordinal",this._colorList=this._spec.colorList,this.setValueField(this._spec.valueField),this._fontWeightRange=null!==(e=this._spec.fontWeightRange)&&void 0!==e?e:WF,this._rotateAngles=null!==(i=this._spec.rotateAngles)&&void 0!==i?i:NF,this.setFontSizeRange(this._spec.fontSizeRange),this._maskShape=null!==(s=this._spec.maskShape)&&void 0!==s?s:"circle",this._textField=(null===(n=this._spec.word)||void 0===n?void 0:n.formatMethod)?$F:this._nameField;const r=this._spec.wordCloudConfig;this._wordCloudConfig=Object.assign({drawOutOfBound:"hidden",layoutMode:"default",zoomToFit:GF},this._spec.wordCloudConfig),r&&!P(r.layoutMode)||dl(this._option.mode)||(this._wordCloudConfig.layoutMode="fast"),this._wordCloudShapeConfig=Object.assign({fillingSeriesField:this.getSeriesField(),fillingRotateAngles:NF,layoutMode:"default"},this._spec.wordCloudShapeConfig),this._isWordCloudShape=!UF.includes(this._maskShape)&&!["fast","grid","cloud"].includes(this._wordCloudConfig.layoutMode),this._defaultFontFamily=this._option.getTheme().fontFamily}initData(){var t,e;super.initData(),null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.target)||void 0===e||e.addListener("change",(()=>{this._dataChange=!0,this.compile()}))}initMark(){var t;(null===(t=this._spec.wordMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(XF.mark.wordMask,{dataView:!1})),this._wordMark=this._createMark(XF.mark.word,{key:_T,defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){this.initMarkStyleOfWord(this._wordMark,this._spec.word,this._spec.colorHexField,this._seriesField),this._maskMark&&this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,background:()=>this._maskCanvas},"normal",Ly.Series)}initMarkStyleOfWord(t,e,i,s,n){var r,a,o,l;t&&(this.setMarkStyle(t,{text:(null==e?void 0:e.formatMethod)?t=>e.formatMethod(t):t=>t[this._textField],x:t=>t.x,y:t=>t.y,fontFamily:t=>t.fontFamily,fontSize:t=>t.fontSize,fontStyle:t=>t.fontStyle,fontWeight:t=>t.fontWeight,angle:t=>t.angle,visible:t=>t.visible},"normal",Ly.Series),this.setMarkStyle(t,{fontFamily:null!==(a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.fontFamily)&&void 0!==a?a:this._defaultFontFamily,fill:null!==(l=null===(o=null==e?void 0:e.style)||void 0===o?void 0:o.fill)&&void 0!==l?l:this.getWordColor},"normal",Ly.User_Mark))}initTooltip(){super.initTooltip(),this._wordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark)}initAnimation(){[this._wordMark].forEach((t=>{var e,i;if(t){const s=null===(i=null===(e=this._spec)||void 0===e?void 0:e.animationAppear)||void 0===i?void 0:i.preset,n={animationConfig:()=>{var e,i;return null===(i=null===(e=t.getAnimationConfig())||void 0===e?void 0:e.appear)||void 0===i?void 0:i[0]}};t.setAnimationConfig(TL($l.getAnimationInKey("wordCloud")(n,s),CL("word",this._spec,this._markAttributeContext)))}}))}getWordOrdinalColorScale(t,e){var i,s,n,r,a;const o=e?this._wordCloudShapeConfig.fillingColorList:this._colorList,l=t?null===(i=this.getViewData())||void 0===i?void 0:i.latestData.map((e=>e[t])):[],h=null!==(n=null!=o?o:null===(s=this._option.globalScale.getScale("color"))||void 0===s?void 0:s.range())&&void 0!==n?n:this._getDataScheme();return null===(a=(r=(new tx).domain(l)).range)||void 0===a?void 0:a.call(r,h)}initColorCallback(t,e){var i,s,n,r;if("ordinal"===this._colorMode){const i=this.getWordOrdinalColorScale(t,e);return e=>i.scale(e[null!=t?t:fT])}const a=null!==(i=e?this._colorList:this._wordCloudShapeConfig.fillingColorList)&&void 0!==i?i:this._option.globalScale.getScale("color").range();if(1===a.length)return t=>a[0];if(this._valueField){const t=this.getRawDataStatisticsByField(this._valueField,!0);if(t.min===t.max)return a[0];const e=(new $b).domain([t.min,t.max]).range(a);return t=>e.scale(t[this._valueField])}const o=(new $b).domain([0,null!==(r=null===(n=null===(s=this.getViewData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)&&void 0!==r?r:1]).range(a);return t=>o.scale(t[mT])}compile(){super.compile();const{width:t,height:e}=this._region.getLayoutRect();if(!Wo(t)||!Wo(e)||!(e>0&&t>0))return;const i=[];this._isWordCloudShape?i.push(Object.assign({type:"wordcloudShape"},this._wordCloudShapeTransformOption())):i.push(Object.assign({type:"wordcloud"},this._wordCloudTransformOption())),this._wordMark.getProduct().transform(i)}_getCommonTransformOptions(){var t,e,i,s,n,r,a,o;const{width:l,height:h}=this._region.getLayoutRect(),d=null!==(t=this._spec.word)&&void 0!==t?t:{},c=null!==(e=d.style)&&void 0!==e?e:{};return{size:[l,h],shape:ns(this._maskShape)&&"text"===this._maskShape.type&&P(this._maskShape.fontFamily)?Object.assign({fontFamily:null===(i=this._option.getTheme())||void 0===i?void 0:i.fontFamily},this._maskShape):this._maskShape,onUpdateMaskCanvas:this.handleMaskCanvasUpdate,dataIndexKey:_T,text:d.formatMethod?t=>d.formatMethod(t):{field:this._textField},fontSize:this._valueField?{field:this._valueField}:this._fontSizeRange[0],fontSizeRange:"auto"===this._fontSizeRange?null:this._fontSizeRange,padding:null!==(n=null===(s=this._spec.word)||void 0===s?void 0:s.padding)&&void 0!==n?n:1,fontFamily:null!==(a=null!==(r=this._spec.fontFamilyField)&&void 0!==r?r:c.fontFamily)&&void 0!==a?a:this._defaultFontFamily,fontWeight:this._spec.fontWeightField?{field:this._spec.fontWeightField}:this._valueField?this._calculateFontWeight:null,fontStyle:null!==(o=this._spec.fontStyleField)&&void 0!==o?o:c.fontStyle}}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},this._getCommonTransformOptions()),{layoutType:this._wordCloudConfig.layoutMode,rotate:this._rotateAngles,randomVisible:null===(t=this._spec.random)||void 0===t||t,clip:"clip"===this._wordCloudConfig.drawOutOfBound,shrink:this._wordCloudConfig.zoomToFit.shrink,enlarge:this._wordCloudConfig.zoomToFit.enlarge,minFontSize:this._wordCloudConfig.zoomToFit.fontSizeLimitMin,progressiveTime:this._wordCloudConfig.progressiveTime,progressiveStep:this._wordCloudConfig.progressiveStep,repeatFill:this._wordCloudConfig.zoomToFit.repeat})}_wordCloudShapeTransformOption(){var t,e,i,s,n,r,a,o,l;const h=null!==(e=null===(t=this._spec.word)||void 0===t?void 0:t.style)&&void 0!==e?e:{},d=null!==(i=this._wordCloudShapeConfig)&&void 0!==i?i:{};return Object.assign(Object.assign(Object.assign({},d),this._getCommonTransformOptions()),{rotateList:this._rotateAngles,fillingRotateList:d.fillingRotateAngles,fillingFontFamily:null!==(n=null!==(s=d.fillingFontFamilyField)&&void 0!==s?s:h.fontFamily)&&void 0!==n?n:this._defaultFontFamily,fillingPadding:null!==(a=null===(r=this._spec.fillingWord)||void 0===r?void 0:r.padding)&&void 0!==a?a:1,fillingFontStyle:null!==(o=d.fillingFontStyleField)&&void 0!==o?o:h.fontStyle,fillingFontWeight:null!==(l=d.fillingFontWeightField)&&void 0!==l?l:h.fontWeight})}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}dataToPositionZ(t){return null}valueToPosition(t,e){return null}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}onLayoutEnd(t){super.onLayoutEnd(t),this.compile(),this._dataChange=!1}getActiveMarks(){return[this._wordMark]}reInit(){super.reInit(),this._keyWordColorCallback&&(this._keyWordColorCallback=null),this._fillingColorCallback&&(this._fillingColorCallback=null)}}XF.mark=KF;const qF=t=>({custom:fA,customParameters:(e,i)=>t,easing:"linear",loop:1/0,duration:6e3});function ZF(t,e){return!1===e?{}:"fadeIn"===e?{type:"fadeIn"}:(t=>({channel:{fontSize:{from:0}},duration:200,delay:(e,i,s)=>{const n=t.animationConfig(),r=(null==n?void 0:n.duration)||200,a=(null==n?void 0:n.totalTime)||mL.appear.duration,o=s.VGRAMMAR_ANIMATION_PARAMETERS.elementCount;return s.VGRAMMAR_ANIMATION_PARAMETERS.elementIndex*function(t,e,i){return t*i{$l.registerAnimation("wordCloud",((t,e)=>({appear:ZF(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}})))},QF=()=>{$l.registerAnimation("wordCloud3d",(t=>({appear:qF(t)})))},tY={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:eY,triangle:eY,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function eY(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}function iY(t,e){const i=e[0],s=e[1];let n=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(s/2.7*.4),n=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":n=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(s/1.5),n=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":n=Math.floor(Math.min(i/2,s/2));break;default:n=Math.floor(Math.max(i/2,s/2))}return{maxRadius:n,center:r}}const sY=t=>tY[t]?tY[t]():tY.circle();function nY(t){return parseFloat("0."+Math.sin(t).toString().substring(6))}const rY=(t,e)=>"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(e-t)+t).toFixed()+"%)";function aY(t){return rs(t)?t:function(){return t}}class oY{constructor(t){var e,i;switch(this.options=E({},oY.defaultOptions,t),rs(this.options.shape)?this.shape=this.options.shape:this.shape=sY(this.options.shape),this.getText=null!==(e=aY(this.options.text))&&void 0!==e?e:t=>t,this.getTextFontWeight=aY(this.options.fontWeight),this.getTextFontSize=aY(this.options.fontSize),this.getTextFontStyle=aY(this.options.fontStyle),this.getTextFontFamily=aY(this.options.fontFamily),this.outputCallback=null!==(i=this.options.outputCallback)&&void 0!==i?i:t=>t,this.options.color){case"random-dark":this.getTextColor=()=>rY(10,50);break;case"random-light":this.getTextColor=()=>rY(50,90);break;default:this.getTextColor=aY(this.options.color)}if(P(this.options.rotate))if(this.options.useRandomRotate){const t=Math.abs(this.options.maxRotation-this.options.minRotation),e=Math.abs(Math.floor(this.options.rotationSteps)),i=Math.min(this.options.maxRotation,this.options.minRotation);this.getTextRotate=()=>0===this.options.rotateRatio||Math.random()>this.options.rotateRatio?0:0===t?i:e>0?i+Math.floor(Math.random()*e)*t/(e-1):i+Math.random()*t}else this.getTextRotate=()=>0;else this.getTextRotate=rs(this.options.rotate)?t=>{var e;return At(null!==(e=this.options.rotate(t))&&void 0!==e?e:0)}:(t,e)=>{const i=Ra(this.options.rotate),s=this.options.random?Math.random():nY(e);return At(i[Math.floor(s*i.length)])}}canRepeat(){return!1}exceedTime(){var t;return this.options.progressiveStep>0?this.progressiveIndex>=((null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1)*this.options.progressiveStep:this.options.progressiveTime>0&&(new Date).getTime()-this.escapeTime>this.options.progressiveTime}progressiveRun(){var t;if(this.options.progressiveStep>0?this.currentStepIndex=(null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.data&&this.progressiveIndex=i)&&(t++,e=0,this.failCount=n?0:this.failCount+1),this.progressiveIndex=t,this.exceedTime())break;t===this.data.length&&this.failCountObject.assign(Object.assign({},t),{isFill:!0})))],this.isTryRepeatFill=!0)}return this.progressiveResult}return this.result}initProgressive(){this.failCount=0,this.progressiveIndex=0,this.options.progressiveStep>0?this.currentStepIndex=-1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.progressiveResult=[]}output(){return this.result?this.outputCallback(this.result):null}progressiveOutput(){return this.progressiveResult?this.outputCallback(this.progressiveResult):null}unfinished(){return this.data&&this.data.length&&!P(this.progressiveIndex)&&this.progressiveIndex[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,s=0;return t=>{const n=t<0?-1:1;switch(Math.sqrt(1+4*n*t)-n&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};class hY extends oY{constructor(t){var e;super(E({},hY.defaultOptions,t)),this.cw=64,this.ch=2048,this._size=[256,256],this._isBoardExpandCompleted=!1,this._placeStatus=0,this._tTemp=null,this._dtTemp=null,this._dy=0,this.cacheMap=new Map,this.options.minFontSize<=hY.defaultOptions.minFontSize&&(this.options.minFontSize=hY.defaultOptions.minFontSize),this.spiral=S(this.options.spiral)?null!==(e=lY[this.options.spiral])&&void 0!==e?e:lY.archimedean:this.options.spiral,this.random=this.options.random?Math.random:()=>1,this.getTextPadding=aY(this.options.padding)}zoomRatio(){return this._originSize[0]/this._size[0]}dy(){return this._dy}layoutWord(t){const e=this.data[t];if(""===(""+e.text).trim())return!0;const{maxRadius:i,center:s}=iY(this.options.shape,this._size);if(e.x=s[0],e.y=s[1],function(t,e,i,s,n,r){if(e.sprite)return;const a=t.context,o=t.ratio;a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,(n<<5)/o,r/o);let l=0,h=0,d=0;const c=i.length;let u,p,g,m,_;for(--s;++s>5<<5,g=~~Math.max(Math.abs(n+r),Math.abs(n-r))}else u=u+31>>5<<5;if(g>d&&(d=g),l+u>=n<<5&&(l=0,h+=d,d=0),h+g>=r)break;a.translate((l+(u>>1))/o,(h+(g>>1))/o),e.angle&&a.rotate(e.angle),a.fillText(e.text,0,0),e.padding&&(a.lineWidth=2*e.padding,a.strokeText(e.text,0,0)),a.restore(),e.width=u,e.height=g,e.xoff=l,e.yoff=h,e.x1=u>>1,e.y1=g>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,l+=u}const f=a.getImageData(0,0,(n<<5)/o,r/o).data,v=[];for(;--s>=0;){if(!(e=i[s]).hasText)continue;for(u=e.width,p=u>>5,g=e.y1-e.y0,m=0;m>5),i=f[(h+_)*(n<<5)+(l+m)<<2]?1<<31-m%32:0;v[e]|=i,t|=i}t?r=_:(e.y0++,g--,_--,h++)}e.y1=e.y0+r,e.sprite=v.slice(0,(e.y1-e.y0)*p)}}(this.contextAndRatio,e,this.data,t,this.cw,this.ch),this._placeStatus=0,e.hasText&&this.place(this._board,e,this._bounds,i))return this.result.push(e),this._bounds?function(t,e){const i=t[0],s=t[1];e.x+e.x0s.x&&(s.x=e.x+e.x1),e.y+e.y1>s.y&&(s.y=e.y+e.y1)}(this._bounds,e):this._bounds=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=this._size[0]>>1,e.y-=this._size[1]>>1,this._tTemp=null,this._dtTemp=null,!0;if(this.updateBoardExpandStatus(e.fontSize),e.hasText&&this.shouldShrinkContinue()){if(1===this._placeStatus){const t=e.fontSize*this._originSize[0]/this.options.minFontSize,i=Math.max(e.width,e.height);if(i<=t)this.expandBoard(this._board,this._bounds,i/this._size[0]);else{if(!this.options.clip)return!0;this.expandBoard(this._board,this._bounds,t/this._size[0])}}else this._placeStatus,this.expandBoard(this._board,this._bounds);return this.updateBoardExpandStatus(e.fontSize),!1}return this._tTemp=null,this._dtTemp=null,!0}layout(t,e){this.initProgressive(),this.result=[],this._size=[e.width,e.height],this.clearCache(),this._originSize=[...this._size];const i=this.getContext(jo.createCanvas({width:1,height:1}));this.contextAndRatio=i,this._board=new Array((this._size[0]>>5)*this._size[1]).fill(0),this._bounds=null,t.length,this.result=[];const s=t.map(((t,e)=>({text:this.getText(t),fontFamily:this.getTextFontFamily(t),fontStyle:this.getTextFontStyle(t),fontWeight:this.getTextFontWeight(t),angle:this.getTextRotate(t,e),fontSize:~~this.getTextFontSize(t),padding:this.getTextPadding(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:t,x:0,y:0,width:0,height:0}))).sort((function(t,e){return e.fontSize-t.fontSize}));if(this.originalData=s,this.data=s,this.progressiveRun(),!this.options.clip&&this.options.enlarge&&this._bounds&&this.shrinkBoard(this._bounds),this._bounds&&["cardioid","triangle","triangle-upright"].includes(this.options.shape)){const t=(this._bounds[0].y+this._bounds[1].y)/2;this._dy=-(t-this._size[1]/2)}return this.result}formatTagItem(t){const e=this._size,i=this.zoomRatio(),s=this.dy(),n=e[0]>>1,r=e[1]>>1,a=t.length,o=[];let l,h;for(let e=0;e=this._size[0]||i.y>=this._size[1])return;const s=Math.min(e.x,this._size[0]-i.x),n=Math.min(e.y,this._size[1]-i.y),r=2*Math.min(s/this._size[0],n/this._size[1]);this._size=this._size.map((t=>t*(1-r)))}expandBoard(t,e,i){const s=this._size[0]*(i||1.1)-this._size[0]>>5;let n=2*s>2?s:2;n%2!=0&&n++;let r=Math.ceil(this._size[1]*(n<<5)/this._size[0]);r%2!=0&&r++;const a=this._size[0],o=this._size[1],l=new Array(n).fill(0),h=new Array(r/2*(n+(a>>5))).fill(0);this.insertZerosToArray(t,o*(a>>5),h.length+n/2);for(let e=o-1;e>0;e--)this.insertZerosToArray(t,e*(a>>5),l.length);this.insertZerosToArray(t,0,h.length+n/2),this._size=[a+(n<<5),o+r],e&&(e[0].x+=(n<<5)/2,e[0].y+=r/2,e[1].x+=(n<<5)/2,e[1].y+=r/2)}insertZerosToArray(t,e,i){const s=Math.floor(i/6e4),n=i%6e4;for(let i=0;i>2);t.width=(this.cw<<5)/i,t.height=this.ch/i;const s=t.getContext("2d");return s.fillStyle=s.strokeStyle="red",s.textAlign="center",{context:s,ratio:i,canvas:t}}place(t,e,i,s){let n=!1;if(this.shouldShrinkContinue()&&(e.width>this._size[0]||e.height>this._size[1]))return this._placeStatus=1,!1;const r=this.random()<.5?1:-1;if(!this.shouldShrinkContinue()&&this.isSizeLargerThanMax(e,r))return null;const a=e.x,o=e.y,l=Math.sqrt(this._size[0]*this._size[0]+this._size[1]*this._size[1]),h=this.spiral(this._size);let d,c,u,p,g=-r;for(this._tTemp=null,this._dtTemp=null;d=h(g+=r);){c=d[0],u=d[1];const h=Math.sqrt(c**2+u**2);let f=Math.atan(u/c);c<0?f+=Math.PI:u<0&&(f=2*Math.PI+f);const v=this.shape(f);if(Math.min(Math.abs(c),Math.abs(u))>=l)break;if(h>=s)n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);else{if(e.x=a+~~(h*v*Math.cos(-f)),e.y=o+~~(h*v*Math.sin(-f)),p=e,this.options.clip)if(this.shouldShrinkContinue()){if(uY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}}else{if(cY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}uY(p,this._size)&&(p=pY(p,this._size))}else if(uY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}if(n=!0,!(i&&(m=p,_=i,!(m.x+m.x1>_[0].x&&m.x+m.x0<_[1].x&&m.y+m.y1>_[0].y&&m.y+m.y0<_[1].y))||i&&dY(p,t,this._size))){const i=p.sprite,s=p.width>>5,n=this._size[0]>>5,r=p.x-(s<<4),a=127&r,o=32-a,l=p.y1-p.y0;let h,d=(p.y+p.y0)*n+(r>>5);for(let e=0;e>>a:0);d+=n}return e.sprite=null,p.sprite=null,!0}}}var m,_;return null!==this._tTemp&&(this._placeStatus=3),!this.shouldShrinkContinue()&&this.setCache(p,r),!1}clearCache(){this.cacheMap.clear()}setCache(t,e){const i=`${t.angle}-${e}`,s=t.x1-t.x0,n=t.y1-t.y0;if(!this.cacheMap.has(i))return void this.cacheMap.set(i,{width:s,height:n});const{width:r,height:a}=this.cacheMap.get(i);(s=s&&a>=n}}function dY(t,e,i){const s=i[0]>>5,n=t.sprite,r=t.width>>5,a=t.x-(r<<4),o=127&a,l=32-o,h=t.y1-t.y0;let d,c=(t.y+t.y0)*s+(a>>5);for(let t=0;t>>o:0))&e[c+i])return!0;c+=s}return!1}hY.defaultOptions={enlarge:!1,minFontSize:2,maxSingleWordTryCount:2};const cY=(t,e)=>t.x+t.x0>e[0]||t.y+t.y0>e[0]||t.x+t.x1<0||t.y+t.y1<0,uY=(t,e)=>t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>e[0]||t.y+t.y1>e[1];function pY(t,e){const i=t.sprite,s=t.y1-t.y0,n=t.width>>5;let r=0;const a=[],o=Math.max(-(t.y0+t.y),0),l=Math.min(s+(e[1]-(t.y1+t.y)),s),h=Math.max(-(t.x0+t.x),0)>>5,d=Math.min(n+(e[0]-(t.x1+t.x)>>5)+1,n);for(let t=0;t{if(!t||"#fff"===t)return(t,e,i)=>{const s=t.width;return 0===t.data[e*s*4+4*i+3]||255===t.data[e*s*4+4*i+0]&&255===t.data[e*s*4+4*i+1]&&255===t.data[e*s*4+4*i+2]};const e=jo.createCanvas({width:1,height:1}).getContext("2d",{willReadFrequently:!0});e.fillStyle=t,e.fillRect(0,0,1,1);const i=e.getImageData(0,0,1,1).data;return(t,e,s)=>{const n=t.width;return[0,1,2,3].every((r=>t.data[4*(e*n+s)+r]===i[r]))}},mY=(t,e,i,s)=>{const{backgroundColor:n="#fff"}=t,r=s||jo.createCanvas({width:e,height:i,dpr:1}),a=r.getContext("2d",{willReadFrequently:!0});if(s){const t=s.width,n=s.height;a.clearRect(0,0,t,n),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return a.fillStyle=n,a.fillRect(0,0,r.width,r.height),"text"===t.type?_Y(t,r.width,r.height,a):"geometric"===t.type&&yY(t,r.width,r.height,a),r},_Y=(t,e,i,s)=>{const{fontFamily:n="sans-serif",fontWeight:r="normal",fontStyle:a="normal",fontVariant:o="normal",fill:l,text:h,hollow:d}=t;let c=12;s.font=`${a} ${o} ${r} ${c}px ${n}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=null!=l?l:"black";const u=s.measureText(h),p="normal"!==a?1.1:1,g=M(u.actualBoundingBoxRight)&&M(u.actualBoundingBoxLeft)?Math.ceil(p*(Math.abs(u.actualBoundingBoxRight)+Math.abs(u.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(u.width),g,c);if(d&&(s.globalCompositeOperation="xor"),m>e){const t=Math.min(e/m,i/c);s.fillText(h,e/2,i/2),s.scale(t,t)}else c=Math.floor(c*e/m),c=Math.min(c,i),s.font=`${a} ${o} ${r} ${c}px ${n}`,s.fillText(h,Math.floor(e/2),Math.floor(i/2))},fY=(t,e,i=0,s)=>{const n=2*Math.PI/s;return new Array(s).fill(0).map(((s,r)=>Tt(t,e,i+r*n)))},vY=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},yY=(t,e,i,s)=>{const{fill:n,hollow:r}=t,{center:a,maxRadius:o}=iY(t.shape,[e,i]);s.fillStyle=null!=n?n:"black",r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,s)=>{0===s?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,((t,e,i=0,s)=>{const n=2*Math.PI/s,r=sY("cardioid");return new Array(s).fill(0).map(((s,a)=>{const o=i+a*n,l=e*r(o);return Tt(t,l,o)}))})({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)vY(s,fY({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)vY(s,fY({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)vY(s,fY({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)vY(s,fY({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)vY(s,fY({x:l,y:h},o,0,3));else if("star"===t.shape){const t=fY({x:l,y:h},o,-Math.PI/2,5),e=fY({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let s=0;s<5;s++)i.push(t[s]),i.push(e[s]);vY(s,i)}else s.fillRect(0,0,e,i)};class bY extends oY{constructor(t){super(E({},bY.defaultOptions,t)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,d=this.getTextFontFamily(t),c=document.createElement("canvas"),u=c.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+d;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let m=p+2*g,_=3*g;const f=Math.ceil(m/this.gridSize),v=Math.ceil(_/this.gridSize);m=f*this.gridSize,_=v*this.gridSize;const y=-p/2,b=.4*-g,x=Math.ceil((m*Math.abs(Math.sin(h))+_*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((m*Math.abs(Math.cos(h))+_*Math.abs(Math.sin(h)))/this.gridSize),M=S*this.gridSize,k=x*this.gridSize;c.setAttribute("width",""+M),c.setAttribute("height",""+k),u.scale(1,1),u.translate(M/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+d,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,y,b);const A=u.getImageData(0,0,M,k).data;if(this.exceedTime())return null;const w=[];let T,C=S;const L=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(A[4*((e*this.gridSize+s)*M+(t*this.gridSize+n))+3])return i.push([t,e]),tL[1]&&(L[1]=t),eL[2]&&(L[2]=e))}};for(;C--;)for(T=x;T--;)E(C,T,w);return{datum:t,occupied:w,bounds:L,gw:S,gh:x,fillTextOffsetX:y,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:d,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let e=0;for(let t=0;t=this.ngx||s>=this.ngy||i<0||s<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[i][s])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),ja(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(ns(e)){const i=mY(e,t.width,t.height);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n,r=gY(e.backgroundColor);const a=(t,e)=>{let i=this.gridSize;for(;i--;){let a=this.gridSize;for(;a--;)if(n=4,!r(s,e*this.gridSize+i,t*this.gridSize+a))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let o=this.ngx;for(;o--;){this.grid[o]=[];let t=this.ngy;for(;t--;)a(o,t),!1!==this.grid[o][t]&&(this.grid[o][t]=!0)}s=r=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=iY(this.options.shape,[e.width,e.height]);return this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(s/this.gridSize),this.initGrid(e),this.result=[],this.progressiveRun()}}bY.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class xY extends oY{constructor(t){super(E({},xY.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let s=0,n=this.result.length;si.left+i.width||e.top>i.top+i.height))return!1;var e,i;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=__(i);return i.width=s.width(),i.height=s.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}layoutWord(t){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,d=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();d[0]=Math.floor(d[0]),d[1]=Math.floor(d[1]);const c=t.fontFamily?kY(t.fontFamily):"sans-serif",u=t.fontStyle?kY(t.fontStyle):"normal",p=t.fontWeight?kY(t.fontWeight):"normal",m=t.rotate?kY(t.rotate):0,_=kY(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",v=t.padding?kY(t.padding):1,y=null!==(n=t.shape)&&void 0!==n?n:"square",b=null!==(r=t.shrink)&&void 0!==r&&r,x=null!==(a=t.enlarge)&&void 0!==a&&a,S=null!==(o=t.clip)&&void 0!==o&&o,M=t.minFontSize,k=t.randomVisible,A=t.as?Object.assign(Object.assign({},SY),t.as):SY,w=t.depth_3d,T=t.postProjection;let C=t.fontSize?kY(t.fontSize):14;const L=t.fontSizeRange;if(L&&!h(C)){const t=C,e=wY(TY(t,l),L);C=i=>e(t(i))}let E=hY;"fast"===t.layoutType?E=xY:"grid"===t.layoutType&&(E=bY);const P=new E(Object.assign(Object.assign({},t),{text:_,padding:v,spiral:f,shape:y,rotate:m,fontFamily:c,fontStyle:u,fontWeight:p,fontSize:C,shrink:b,clip:S,enlarge:x,minFontSize:M,random:k,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r0||t.progressiveTime>0?{progressive:P}:P.output()},kY=t=>S(t)||h(t)||rs(t)||y(t)?t:e=>e[t.field],AY=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),wY=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=AY(t[0]),n=AY(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(AY(t)-r)/(a-r)*(e[1]-e[0])+e[0]},TY=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function CY(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l{pc.registerTransform("wordcloud",{transform:MY,markPhase:"beforeJoin"},!0)};var EY;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(EY||(EY={}));const PY=t=>/^[\u4e00-\u9fa5]+$/.test(t),DY=(t,e)=>{if(P(t))return 0;let i=0;for(const e of t)PY(e)?i+=1:i+=.53;return i};class OY extends $b{constructor(){super(sb,nb),this.type=Xh.Sqrt}clone(){return(new OY).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}function RY(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:d,shapeMaxR:c,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=jY(i);let m=g.slice(0);const _=e.fontSizeShrinkFactor;let f=null,v=1,y=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let e=0;ex&&y>r){const e=i.datum[Symbol.for("vGrammar_id")];e!==f&&(f=e,v=y),y*=_,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*_})),m=g.slice(0),b=!0;break}if(!i.skip&&i.datum[Symbol.for("vGrammar_id")]===f){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/y})),i.skip=!0,y=v,f=null,m=g.slice(0),b=!0;break}}}b&&(e=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-d<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||FY(e,t,r)))return BY(e,t,r),!0}return!1}function BY(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,d=s[1];let c,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t>>l:0);u+=a}}function FY(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,d=n[1];let c,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t>>l:0))&e[u+i])return!0;u+=r}return!1}function YY(t,e,i,s){if(i[s].sprite||0===i[s].fontSize)return;const n=2048,r=Math.PI/180,a=i.length;t.width=n,t.height=2048,e.clearRect(0,0,n,2048),e.textAlign="center";let o,l,h=0,d=0,c=0,u=0;const p=s;for(--s;++s>5<<5,l=Math.ceil(l),l>c&&(c=l),h+o>=n&&(h=0,d+=c,c=l),d+l>=2048){if(0===d){t.hasText=!1;continue}break}d+l>=u&&(u=d+l),e.translate(h+(o>>1),d+(l>>1)),0!==t.rotate&&e.rotate(t.rotate*r),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[h,d],t.wordSize=[o,l],t.hasText=!0,h+=o}if(0===u)return;const g=e.getImageData(0,0,n,u).data;let m,_;for(;--s>=p;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[h,d]=e;const a=r[0]>>5,o=new Array(a*r[1]).fill(0);let[l,c,u,p]=[1/0,-1/0,1/0,-1/0];for(_=0;_0){const e=1<<31-m%32;o[a*_+(m>>5)]|=e,mp&&(p=m),t|=e}t&&(_c&&(c=_))}t.bounds={dTop:(r[1]>>1)-l,dBottom:c-(r[1]>>1),dLeft:(r[0]>>1)-u,dRight:p-(r[0]>>1)},t.sprite=o,delete t.LT}}function jY(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t>5)]|=e}if(i[0]>s[0]){const t=(1<>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,S(i.shapeUrl)){i.isEmptyPixel=gY();const t=(a=i.shapeUrl)&&(is(a)||ss(a)||a.startsWith("{var i;const s=PS({image:a}),n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):(s.successCallback=()=>{var i;if(s){const n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):e(new Error("image load failed"+a))}else e(new Error("image load failed"+a))},s.failCallback=()=>{g.getInstance().error("image 加载失败!",a)})})):null;t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=jo.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const d=(t,e)=>{for(let s=0;s{for(let n=e;na&&d(n,o-1);)--o;for(;ll&&c(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=gY(i.shapeUrl.backgroundColor);const t=mY(i.shapeUrl,e.size[0],e.size[1]);i.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}var a}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){this.isImageFinished&&!this.isLayoutFinished&&(this.segmentationInput.maskCanvas&&this.doLayout(),this.isLayoutFinished=!0)}progressiveOutput(){return this.progressiveResult}doLayout(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x;const S=this.segmentationInput,M=function(t){const{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),n=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i=e[1]?e[1]-1:h,d=d<0?0:d>=e[0]?e[0]-1:d,0!==n[h*e[0]+d]||t.isEmptyPixel(s,h,d)||(n[h*e[0]+d]=r,o.push([h,d]))}r++,o=[]}const l={},h={},d={},c={},u={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0};for(let t=0;tc[s][1]&&(c[s][1]=t),ic[s][3]&&(c[s][3]=i),ig.x2&&(g.x2=i),tg.y2&&(g.y2=t)),h[s]=h[s]||0,h[s]++)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),s=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);d[t]=[i,s],m.push(...e);const[n,r,a,o]=c[t];u[t]=~~Math.max(Math.sqrt((i-a)**2+(s-n)**2),Math.sqrt((i-o)**2+(s-r)**2),Math.sqrt((i-a)**2+(s-r)**2),Math.sqrt((i-o)**2+(s-n)**2)),p[t]=(o-a)/(r-n)}const _=Object.keys(d).map((t=>({label:t-1,boundary:l[t],area:h[t],center:d[t],maxPoint:c[t],maxR:u[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const f=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),y=~~Math.max(Math.sqrt((f-g.x1)**2+(v-g.y1)**2),Math.sqrt((f-g.x2)**2+(v-g.y2)**2),Math.sqrt((f-g.x1)**2+(v-g.y2)**2),Math.sqrt((f-g.x2)**2+(v-g.y1)**2)),b=g.width/g.height,x=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:_,labels:n,labelNumber:r-1};return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:y,shapeRatio:b,shapeCenter:[f,v],shapeArea:x});function M(t,i){const s=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+s[r][0],o=i+s[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===n[a*e[0]+o])return!0}return!1}}(S);if(!M.segmentation.regions.length)return;const k=this.options,A=this.data,w=k.colorMode||"ordinal",T={getText:UY(k.text),getFontSize:UY(k.fontSize),fontSizeRange:k.fontSizeRange,colorMode:w,getColor:k.colorField?UY(k.colorField):UY(k.text),getFillingColor:UY(k.fillingColorField),colorList:k.colorList||("ordinal"===w?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:UY(k.colorHexField),getFontFamily:UY(k.fontFamily||"sans-serif"),rotateList:k.rotateList||[0],getPadding:UY(k.padding||1),getFontStyle:UY(k.fontStyle||"normal"),getFontWeight:UY(k.fontWeight||"normal"),getFontOpacity:k.fontOpacity?UY(k.fontOpacity):()=>1};VY(A,T,M);const C={size:k.size,ratio:k.ratio||.8,shapeUrl:k.shape,random:void 0===k.random||k.random,textLayoutTimes:null!==(t=k.textLayoutTimes)&&void 0!==t?t:3,removeWhiteBorder:k.removeWhiteBorder,layoutMode:null!==(e=k.layoutMode)&&void 0!==e?e:"default",fontSizeShrinkFactor:null!==(i=k.fontSizeShrinkFactor)&&void 0!==i?i:.8,stepFactor:null!==(s=k.stepFactor)&&void 0!==s?s:1,importantWordCount:null!==(n=k.importantWordCount)&&void 0!==n?n:10,globalShinkLimit:k.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(r=k.fontSizeEnlargeFactor)&&void 0!==r?r:1.5,fillingRatio:null!==(a=k.fillingRatio)&&void 0!==a?a:.7,fillingTimes:null!==(o=k.fillingTimes)&&void 0!==o?o:4,fillingXStep:k.fillingXRatioStep?Math.max(Math.floor(k.size[0]*k.fillingXRatioStep),1):null!==(l=k.fillingXStep)&&void 0!==l?l:4,fillingYStep:k.fillingYRatioStep?Math.max(Math.floor(k.size[1]*k.fillingYRatioStep),1):null!==(h=k.fillingYStep)&&void 0!==h?h:4,fillingInitialFontSize:k.fillingInitialFontSize,fillingDeltaFontSize:k.fillingDeltaFontSize,fillingInitialOpacity:null!==(d=k.fillingInitialOpacity)&&void 0!==d?d:.8,fillingDeltaOpacity:null!==(c=k.fillingDeltaOpacity)&&void 0!==c?c:.05,getFillingFontFamily:UY(k.fillingFontFamily||"sans-serif"),getFillingFontStyle:UY(k.fillingFontStyle||"normal"),getFillingFontWeight:UY(k.fillingFontWeight||"normal"),getFillingPadding:UY(null!==(u=k.fillingPadding)&&void 0!==u?u:.4),fillingRotateList:null!==(p=k.fillingRotateList)&&void 0!==p?p:[0,90],fillingDeltaFontSizeFactor:null!==(g=k.fillingDeltaFontSizeFactor)&&void 0!==g?g:.2,fillingColorList:k.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(m=k.minInitFontSize)&&void 0!==m?m:10,minFontSize:null!==(_=k.minFontSize)&&void 0!==_?_:4,minFillFontSize:null!==(f=k.minFillFontSize)&&void 0!==f?f:2},L=((t,e)=>{if(1===e.length&&"#537EF5"===e[0])return!0;if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i{const i=DY(n(e));return i>l?t:t+i}),0)/t.length;let d;if(0===h)d=8;else{const t=.2*s.shapeArea;d=Math.sqrt(e*(t/h))}r=~~d,a=d*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(A,T,C,M);const{getText:E,getFontFamily:P,getFontStyle:D,getFontWeight:O,getPadding:R,getColor:I,getFillingColor:B,getColorHex:F,fontSizeScale:Y,colorScale:j,fillingColorScale:H,getFontOpacity:z,rotateList:N}=T,V=A.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:P(t),fontWeight:O(t),fontStyle:D(t),rotate:N[~~(S.randomGenerator()*N.length)],fontSize:Math.max(C.minInitFontSize,~~Y(t)),opacity:z(t),padding:R(t),color:F&&F(t)||j&&j(I(t))||"black",fillingColor:!B||(null===(e=k.colorField)||void 0===e?void 0:e.field)===(null===(i=k.fillingColorField)||void 0===i?void 0:i.field)&&L?void 0:F&&F(t)||H&&H(B(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),W=Ba(V.map((t=>t.fontSize)));V.forEach((t=>t.weight=t.fontSize/W)),V.sort(((t,e)=>e.weight-t.weight));const{fillingWords:G,successedWords:U,failedWords:$}=function(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),at.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?RY(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:d,shapeRatio:c}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=jY(i);let g=p.slice(0);const m=e.fontSizeEnlargeFactor,_=Math.min(r,t.length);let f=0;t.length>_&&(f=t.sort(((t,e)=>e.weight-t.weight))[_-1].weight);let v=0,y=1,b=!1;for(let r=0;r=f&&v++,v>=_&&!b){y*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),g=p.slice(0),M=!0,v=0;break}}else{if(a.weight>=f&&y>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/m})),y/=m,b=!0,g=p.slice(0),M=!0;break}if(a.weight>=f)return RY(t,e,i)}}M&&(r=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;tc?k-c:c,v),A=A>p?A-p:p;return w;function T(e,i){const n=t.map((t=>{const{text:s,color:n,fillingColor:r,hasPlaced:a,datum:d}=t;return{x:0,y:0,weight:0,text:s,fontFamily:h(d),fontStyle:o(d),fontWeight:l(d),fontSize:e,rotate:g[~~(S()*g.length)],padding:m(d),opacity:i,visible:!0,color:n,fillingColor:r,hasPlaced:a,datum:d}}));C(n);let d=0;const{x1:c,y1:u,x2:p,y2:v}=b,[k,A]=[c+~~(S()*r*2),u+~~(S()*a*2)];for(let t=A;t<=v;t+=a)for(let e=k;e<=p;e+=r){YY(x,M,n,d);const i=n[d];i.x=e,i.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=i;if(!o||!a){++d===n.length&&(d=0,_&&C(n));continue}const{dTop:l,dBottom:h,dLeft:c,dRight:u}=a;i.x-c<0||i.x+u>s[0]||i.y-l<0||i.y+h>s[1]||i.hasText&&i.sprite&&!FY(i,f,y)&&(BY(i,f,y),w.push(Object.assign({},i)),++d===n.length&&(d=0,_&&C(n)))}}function C(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;et.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}(V,C,M),K=null!==(y=null===(v=k.text)||void 0===v?void 0:v.field)&&void 0!==y?y:"textKey",X=null!==(b=k.dataIndexKey)&&void 0!==b?b:"defaultDataIndexKey",q=k.as?Object.assign(Object.assign({},HY),k.as):HY;let Z,J;const Q=[];for(let t=0;t{var i,s;const n=Object.assign({},t.datum);n[q.x]=t.x,n[q.y]=t.y,n[q.fontFamily]=t.fontFamily,n[q.fontSize]=t.fontSize,n[q.fontStyle]=t.fontStyle,n[q.fontWeight]=t.fontWeight,n[q.angle]=At(t.rotate),n[q.opacity]=t.opacity,n[q.visible]=t.visible,n[q.isFillingWord]=!0,n[q.color]=B?(null===(i=k.colorField)||void 0===i?void 0:i.field)===(null===(s=k.fillingColorField)||void 0===s?void 0:s.field)&&L?t.color:t.fillingColor:C.fillingColorList[~~(S.randomGenerator()*C.fillingColorList.length)],n[K]=t.text,n[X]=`${t.text}_${e}_fillingWords`,tt.push(n)})),this.view&&this.view.emit){this.view.emit(EY.AFTER_WORDCLOUD_SHAPE_LAYOUT,{successedWords:U,failedWords:$});const t=null===(x=this.view.renderer)||void 0===x?void 0:x.stage();t&&t.hooks.afterRender.tap(EY.AFTER_WORDCLOUD_SHAPE_DRAW,(()=>{this.view.emit(EY.AFTER_WORDCLOUD_SHAPE_DRAW,{successedWords:U,failedWords:$}),t.hooks.afterRender.unTap(EY.AFTER_WORDCLOUD_SHAPE_DRAW)}))}this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const NY=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:d}=e,{sameColorList:c}=i;let u,p,g=e.colorList,m=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new Xb).domain(e).range(g).scale(t),d&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!c)){const e=t.map((t=>d(t)));p=t=>(new Xb).domain(e).range(m).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new $b).domain(GY(h,t)).range(g);if(u=t=>e.scale(t),d&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!c)){1===m.length&&(m=[m[0],m[0]]);const e=(new $b).domain(GY(d,t)).range(m);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},VY=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new OY).domain(GY(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&rs(n)&&!s){const e=.5,[o,l]=GY(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),d=WY(h,i,!0);s=[~~(e*d),~~d];const c=(new OY).domain(GY(n,t)).range(s);a=t=>c.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=WY(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},WY=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=DY(e.text);return s{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},UY=t=>t?"string"==typeof t||"number"==typeof t?()=>t:rs(t)?t:e=>e[t.field]:null,$Y=(t,e,i,s)=>{if(!t.size||P(t.size[0])||P(t.size[1])||t.size[0]<=0||t.size[1]<=0)return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(t.size[0]),Math.ceil(t.size[1])],t.shape||Am("WordcloudShape shape must be specified."),t.text||Am("WordcloudShape text must be specified."),(null==s?void 0:s.emit)&&s.emit(EY.BEFORE_WORDCLOUD_SHAPE_LAYOUT),!e||0===e.length)return[];const n=new zY(t,s);return n.layout(e),n.unfinished()?{progressive:n}:n.output()},KY=()=>{pc.registerTransform("wordcloudShape",{transform:$Y,markPhase:"beforeJoin"},!0)};class XY extends XF{constructor(){super(...arguments),this.type=_l.wordCloud}}XY.type=_l.wordCloud;const qY=()=>{LY(),hF(),JF(),$l.registerSeries(XY.type,XY)};class ZY extends HF{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord,wordMask:t.wordMask}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class JY extends zF{constructor(){super(...arguments),this.transformerConstructor=ZY,this.type="wordCloud",this.seriesType=_l.wordCloud}}JY.type="wordCloud",JY.seriesType=_l.wordCloud,JY.transformerConstructor=ZY;class QY extends XF{constructor(){super(...arguments),this.type=_l.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(XF.mark.word,{groupKey:this._seriesField,support3d:!0,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",Ly.Series)}initAnimation(){var t,e;const i=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("wordCloud3d"))||void 0===e?void 0:e((()=>{var t;const e=this.getCompiler().getVGrammarView(),s=e.width()-i.left||0-i.right||0,n=e.height()-i.top||0-i.bottom||0,r=Math.max(s,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r}})),CL("word",this._spec,this._markAttributeContext)))}}QY.type=_l.wordCloud3d;const tj=()=>{LY(),hF(),QF(),$l.registerSeries(QY.type,QY)};class ej extends HF{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,depth_3d:t.depth_3d,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class ij extends zF{constructor(){super(...arguments),this.transformerConstructor=ej,this.type="wordCloud3d",this.seriesType=_l.wordCloud3d}}ij.type="wordCloud3d",ij.seriesType=_l.wordCloud3d,ij.transformerConstructor=ej;const sj=(t,e)=>{var i,s;const n=t.map((t=>Object.assign({},t)));if(!n||0===n.length)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:d,asLastValueRatio:c,asLastValue:u,asCurrentValue:p,asNextValue:g,heightVisual:m=!1,isCone:_=!0,range:f}=e,v=n.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[r])||-1/0)),-1/0),y=n.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[r])||1/0)),1/0),b=[null!==(i=null==f?void 0:f.min)&&void 0!==i?i:y,null!==(s=null==f?void 0:f.max)&&void 0!==s?s:v];return n.forEach(((t,e)=>{var i,s;const f=Number.parseFloat(t[r]),v=Number.parseFloat(null===(i=n[e-1])||void 0===i?void 0:i[r]),y=Number.parseFloat(null===(s=n[e+1])||void 0===s?void 0:s[r]),x=Wo(y*f)&&0!==f?y/f:0,S=Wo(f*v)&&0!==v?f/v:0;u&&(t[u]=v),g&&(t[g]=y),a&&(t[a]=x),o&&(t[o]=0===e?1:S),l&&(t[l]=!0===m?x:1/n.length),h&&(t[h]=f/b[1]),d&&(t[d]=e===n.length-1?_?0:t[h]:y/b[1]),c&&(t[c]=0===e?1:v/b[1]),p&&(t[p]=f)})),n},nj=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},rj=`${sh}_FUNNEL_TRANSFORM_RATIO`,aj=`${sh}_FUNNEL_REACH_RATIO`,oj=`${sh}_FUNNEL_HEIGHT_RATIO`,lj=`${sh}_FUNNEL_VALUE_RATIO`,hj=`${sh}_FUNNEL_LAST_VALUE_RATIO`,dj=`${sh}_FUNNEL_NEXT_VALUE_RATIO`,cj=`${sh}_FUNNEL_LAST_VALUE`,uj=`${sh}_FUNNEL_CURRENT_VALUE`,pj=`${sh}_FUNNEL_NEXT_VALUE`,gj=`${sh}_FUNNEL_TRANSFORM_LEVEL`,mj=20;class _j extends VT{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"转化率":null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?`${(100*(null==t?void 0:t[aj])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return"转化率";const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return M(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]}}}class fj extends mx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class vj extends fj{constructor(){super(...arguments),this.type=vj.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}vj.type="polygon";const yj=()=>{$l.registerMark(vj.type,vj),yx(),mk(),pc.registerGraphic(Xd.polygon,nS),AL()},bj=Object.assign(Object.assign({},iC),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),xj=Object.assign(Object.assign({},iC),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class Sj extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class Mj extends BL{constructor(){super(...arguments),this.type=_l.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=Sj,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;Ap(this._dataSet,"funnel",sj),Ap(this._dataSet,"funnelTransform",nj);const t=new R(this._dataSet,{name:`${sh}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new KT(this._option,t)}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,n,r,a,o,l;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:uj,asTransformRatio:rj,asReachRatio:aj,asHeightRatio:oj,asValueRatio:lj,asNextValueRatio:dj,asLastValueRatio:hj,asLastValue:cj,asNextValue:pj,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(s=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===s?void 0:s.min,max:null!==(r=null===(n=this._spec.range)||void 0===n?void 0:n.max)&&void 0!==r?r:null===(o=null===(a=this.getViewDataStatistics().latestData)||void 0===a?void 0:a[this.getValueField()])||void 0===o?void 0:o.max}}}),null===(l=this._viewDataTransform.getDataView())||void 0===l||l.transform({type:"funnelTransform",options:{asIsTransformLevel:gj}})}initMark(){var t,e,i,s,n,r,a,o,l,h,d,c;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Mj.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,morph:PL(this._spec,this._funnelMarkName),defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(e=this._spec.funnel)||void 0===e?void 0:e.customShape,stateSort:null===(i=this._spec.funnel)||void 0===i?void 0:i.stateSort,noSeparateStyle:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Mj.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(s=this._theme)||void 0===s?void 0:s.transform,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId(),customShape:null===(n=this._spec.transform)||void 0===n?void 0:n.customShape,stateSort:null===(r=this._spec.transform)||void 0===r?void 0:r.stateSort,noSeparateStyle:!0})),null===(o=null===(a=this._spec)||void 0===a?void 0:a.outerLabel)||void 0===o?void 0:o.visible){const{line:t}=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{},{line:e}=null!==(d=null===(h=this._theme)||void 0===h?void 0:h.outerLabel)&&void 0!==d?d:{};this._funnelOuterLabelMark.label=this._createMark(Mj.mark.outerLabel,{themeSpec:null===(c=this._theme)||void 0===c?void 0:c.outerLabel,markSpec:this._spec.outerLabel,skipBeforeLayouted:!0,noSeparateStyle:!0}),this._funnelOuterLabelMark.line=this._createMark(Mj.mark.outerLabelLine,{themeSpec:e,markSpec:t,depend:[this._funnelOuterLabelMark.label],noSeparateStyle:!0})}}initTooltip(){this._tooltipHelper=new _j(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){const t=this._funnelMark;t&&this.setMarkStyle(t,{points:t=>this.getPoints(t),visible:t=>M(t[this._valueField]),fill:this.getColorAttribute()},"normal",Ly.Series);const e=this._funnelTransformMark;e&&this.setMarkStyle(e,{points:t=>this.getPoints(t)},"normal",Ly.Series);const i=this._funnelOuterLabelMark.label;i&&this.setMarkStyle(i,{text:t=>{const e=`${t[this.getCategoryField()]}`;return rs(this._spec.outerLabel.formatMethod)?this._spec.outerLabel.formatMethod(e,t):e},x:t=>this._computeOuterLabelPosition(t).x,y:t=>this._computeOuterLabelPosition(t).y,textAlign:t=>this._computeOuterLabelPosition(t).align,textBaseline:t=>this._computeOuterLabelPosition(t).textBaseline,maxLineWidth:t=>this._computeOuterLabelLimit(t)},"normal",Ly.Series);const s=this._funnelOuterLabelMark.line;s&&i&&this.setMarkStyle(s,{x:t=>this._computeOuterLabelLinePosition(t).x1,y:t=>this._computeOuterLabelLinePosition(t).y1,x1:t=>this._computeOuterLabelLinePosition(t).x2,y1:t=>this._computeOuterLabelLinePosition(t).y2},"normal",Ly.Series)}initLabelMarkStyle(t){var e,i;if(!t)return;const s=t.getTarget(),n=t.getComponent();s===this._funnelMark?(this._labelMark=t,this.setMarkStyle(t,{text:t=>`${t[this.getCategoryField()]} ${t[this.getValueField()]}`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.label),stroke:this.getColorAttribute()},"normal",Ly.Series),(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(n),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())):this._funnelTransformMark&&s===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*zI(aj).bind(this)(t)).toFixed(1)}%`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.transformLabel)},"normal",Ly.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),CL("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(TL($l.getAnimationInKey("fadeInOut")(),CL(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(TL($l.getAnimationInKey("funnel")({},o),CL(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(TL(null===(a=$l.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),CL("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[hj])/2:this._getSecondaryAxisLength(t[lj])/2,n=this._getSecondaryAxisLength(t[lj])/2):(s=this._getSecondaryAxisLength(t[lj])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[dj])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[gj])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return M(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[_T]===t[_T]));if(!M(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),d=this._getMainAxisLength(!0);return l+=i*(h+d),l+=s?-d/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(h(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const a=this.getPoints(t),o=(Math.abs(a[0].x-a[1].x)+Math.abs(a[2].x-a[3].x))/2,l=this.getCategoryField(),h=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct().getGroupGraphicItem().find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[l])===t[l]}),!0))||void 0===s?void 0:s.AABBBounds,d=h?h.x2-h.x1:0,c=this._funnelOuterLabelMark.line?mj:0;let u=this.getLayoutRect().width-Math.max(o,d);return"center"===this._funnelAlign&&(u/=2),u-c-(null!==(r=null===(n=this._spec.outerLabel)||void 0===n?void 0:n.spaceWidth)&&void 0!==r?r:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,d,c;const u=this.getCategoryField(),p=null===(r=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.elements)||void 0===n?void 0:n.find((e=>{var i;return(null===(i=e.data[0])||void 0===i?void 0:i[u])===t[u]})))||void 0===r?void 0:r.getBounds(),g=null===(l=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getProduct().getGroupGraphicItem().find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[u])===t[u]}),!0))||void 0===l?void 0:l.AABBBounds,m=null!==(h=this._spec.outerLabel)&&void 0!==h?h:{};let _,f,v,y;if(this._isHorizontal()){const e=null!==(d=m.spaceWidth)&&void 0!==d?d:5,i=this.getPoints(t),s=(Math.abs(i[0].y-i[1].y)+Math.abs(i[2].y-i[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(i).y-s/2-e,y=!1!==m.alignLabel?(null==p?void 0:p.y2)+e:v-e,_=this._getPolygonCenter(i).x,v-y{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class Aj extends ZD{constructor(){super(...arguments),this.transformerConstructor=kj,this.type="funnel",this.seriesType=_l.funnel}}Aj.type="funnel",Aj.seriesType=_l.funnel,Aj.transformerConstructor=kj;class wj extends fj{constructor(){super(...arguments),this.type=wj.type}}wj.type="pyramid3d";const Tj=()=>{$l.registerMark(wj.type,wj),yx(),mS(),pc.registerGraphic(Xd.pyramid3d,aS),AL()};class Cj extends Sj{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class Lj extends Mj{constructor(){super(...arguments),this.type=_l.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=Cj}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Lj.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0,support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Lj.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(Lj.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(Lj.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t,depend:[this._funnelOuterLabelMark.label]})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",Ly.Series)}initLabelMarkStyle(t){var e,i;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",Ly.Series),this._labelMark=t,(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(t.getComponent()),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())}}Lj.type=_l.funnel3d,Lj.mark=xj,Lj.transformerConstructor=Cj;class Ej extends ZD{constructor(){super(...arguments),this.transformerConstructor=kj,this.type="funnel3d",this.seriesType=_l.funnel3d}}function Pj(t){return()=>"vertical"===t.direction?{orient:"negative"}:{orient:"positive"}}Ej.type="funnel3d",Ej.seriesType=_l.funnel3d,Ej.transformerConstructor=kj;const Dj=t=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:Pj(t)}),Oj={type:"fadeIn"};function Rj(t,e){return!1===e?{}:"fadeIn"===e?Oj:(t=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:Pj(t)}))(t)}class Ij extends VT{getDefaultTooltipPattern(t,e){const i=super.getDefaultTooltipPattern(t,e);switch(t){case"mark":case"group":return i;case"dimension":return i.visible=!1,i}return null}}const Bj=Object.assign(Object.assign({},iC),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}});class Fj extends jL{constructor(){super(...arguments),this.type=_l.linearProgress,this._progressMark=null,this._trackMark=null,this._defaultProgressCustomShape=(t,e,i)=>{var s,n;const r=null===(s=this._spec)||void 0===s?void 0:s.cornerRadius,a=M(e.width)?e.width:e.x1-e.x,o=M(e.height)?e.height:e.y1-e.y,l=Math.min(0,a),h=Math.max(0,a),d=Math.min(0,o),c=Math.max(0,o);if(r>0){let t=r;if("vertical"===(null===(n=this._spec)||void 0===n?void 0:n.direction)){if(t=Math.min(Math.abs(a/2),r),2*t>Math.abs(o)){const e=Math.acos((t-Math.abs(o)/2)/t);return i.moveTo(l+t,d),i.arc(l+t,d+t,t,1.5*Math.PI,1.5*Math.PI-e,!0),i.arc(l+t,c-t,t,e+Math.PI/2,Math.PI/2,!0),i.lineTo(h-r,c),i.arc(h-t,c-t,t,Math.PI/2,Math.PI/2-e,!0),i.arc(h-t,d+t,t,-Math.PI/2+e,-Math.PI/2,!0),i.lineTo(l+t,d),i.closePath(),i}}else if(t=Math.min(Math.abs(o/2),r),2*t>Math.abs(a)){const e=Math.acos((t-Math.abs(a)/2)/t);return i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,Math.PI+e),i.arc(h-t,d+t,t,-e,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,e),i.arc(l+t,c-t,t,Math.PI-e,Math.PI),i.closePath(),i}i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,1.5*Math.PI),i.lineTo(h-t,d),i.arc(h-t,d+t,t,-Math.PI/2,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,Math.PI/2),i.lineTo(l+t,c),i.arc(l+t,c-t,t,Math.PI/2,Math.PI),i.closePath()}else i.moveTo(l,d),i.lineTo(h,d),i.lineTo(h,c),i.lineTo(l,c),i.closePath();return i}}initMark(){this._initTrackMark(),this._initProgressMark()}initMarkStyle(){this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e,i;return this._progressMark=this._createMark(Fj.mark.progress,{isSeriesMark:!0,customShape:null!==(e=null===(t=this._spec.progress)||void 0===t?void 0:t.customShape)&&void 0!==e?e:this._defaultProgressCustomShape,stateSort:null===(i=this._spec.progress)||void 0===i?void 0:i.stateSort}),this._progressMark}_initProgressMarkStyle(){var t,e,i,s;const n=this._progressMark;if(n)if("vertical"===this._spec.direction){const i=this._spec.progress||{},s=null!==(t=i.leftPadding)&&void 0!==t?t:0,r=null!==(e=i.rightPadding)&&void 0!==e?e:0;this.setMarkStyle(n,{x:t=>{var e,i;return sx(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2+s},y1:t=>{var e,i;return sx(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:()=>{var t;return null===(t=this._yAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},width:this._spec.bandWidth-s-r,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Ly.Series)}else{const t=this._spec.progress||{},e=null!==(i=t.topPadding)&&void 0!==i?i:0,r=null!==(s=t.bottomPadding)&&void 0!==s?s:0;this.setMarkStyle(n,{x1:t=>{var e,i;return sx(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:t=>{var i,s;return sx(this.dataToPositionY(t),null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0))-this._spec.bandWidth/2+e},height:this._spec.bandWidth-e-r,x:()=>{var t;return null===(t=this._xAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Ly.Series)}}_initTrackMark(){var t,e;return this._trackMark=this._createMark(Fj.mark.track,{customShape:null===(t=this._spec.track)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.track)||void 0===e?void 0:e.stateSort}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&("vertical"===this._spec.direction?this.setMarkStyle(t,{x:t=>{var e,i;return sx(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},y:0,width:this._spec.bandWidth,height:()=>this._scaleY.range()[0],cornerRadius:this._spec.cornerRadius},"normal",Ly.Series):this.setMarkStyle(t,{x:0,y:t=>{var e,i;return sx(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},height:this._spec.bandWidth,width:()=>this._scaleX.range()[1],cornerRadius:this._spec.cornerRadius},"normal",Ly.Series))}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("linearProgress"))||void 0===i?void 0:i(n,r),CL("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),CL("track",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new Ij(this),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark),this._trackMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._trackMark)}getActiveMarks(){return[this._progressMark]}}Fj.type=_l.linearProgress,Fj.mark=Bj;class Yj extends UD{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{direction:null!==(e=t.direction)&&void 0!==e?e:"horizontal",cornerRadius:null!==(i=t.cornerRadius)&&void 0!==i?i:0,bandWidth:t.bandWidth,progress:t.progress,track:t.track})}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),P(s.type)&&(s.type="band"),P(i.type)&&(i.type="linear");const n=YE(i,{min:0,max:1});P(i.min)&&(i.min=n.min),P(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),P(s.type)&&(s.type="linear"),P(e.type)&&(e.type="band");const n=YE(s,{min:0,max:1});P(s.min)&&(s.min=n.min),P(s.max)&&(s.max=n.max)}}}class jj extends ZD{constructor(){super(...arguments),this.transformerConstructor=Yj,this.type="linearProgress",this.seriesType=_l.linearProgress}}function Hj(t,e,i,s,n,r,a,o,l){t.setMarkStyle(e,{textAlign:t=>{if("vertical"===l())return"center";const e=n(t),s=r(t);if("middle"===i)return"center";if(e>=s){if("start"===i)return"left";if("end"===i)return"right";if("outside"===i)return"left"}else{if("start"===i)return"right";if("end"===i)return"left";if("outside"===i)return"right"}return"center"},textBaseline:t=>{if("horizontal"===l())return"middle";const e=a(t),s=o(t);if("middle"===i)return"middle";if(s>=e){if("start"===i)return"bottom";if("end"===i)return"top";if("outside"===i)return"bottom"}else{if("start"===i)return"top";if("end"===i)return"bottom";if("outside"===i)return"top"}return"middle"}}),t.setMarkStyle(e,{x:t=>{const e=l(),a=n(t),o=r(t);if("vertical"===e)return(a+o)/2;if("middle"===i)return(a+o)/2;if(a>=o){if("start"===i)return o+s;if("end"===i)return a-s;if("outside"===i)return a+s}else{if("start"===i)return o-s;if("end"===i)return a+s;if("outside"===i)return a-s}return(a+o)/2},y:t=>{const e=l(),n=a(t),r=o(t);if("horizontal"===e)return(n+r)/2;if("middle"===i)return(n+r)/2;if(n>=r){if("start"===i)return r+s;if("end"===i)return n-s;if("outside"===i)return n+s}else{if("start"===i)return r-s;if("end"===i)return n+s;if("outside"===i)return n-s}return(n+r)/2}},"normal",Ly.Series)}jj.type="linearProgress",jj.seriesType=_l.linearProgress,jj.transformerConstructor=Yj,XA(jj,tO);class zj extends VT{getDefaultTooltipPattern(t){return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{key:this.markTooltipKeyCallback,value:t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]],hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]}}}const Nj=t=>({type:"growCenterIn",options:{direction:"horizontal"===t.direction?"x":"y"}}),Vj={type:"fadeIn"},Wj=t=>({type:"growCenterOut",options:{direction:"horizontal"===t.direction?"x":"y"}});function Gj(t,e){return"fadeIn"===e?Vj:Nj(t)}const Uj=Object.assign(Object.assign({},vO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),$j=Object.assign(Object.assign({},yO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class Kj extends SO{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar")}}class Xj extends MO{constructor(){super(...arguments),this.type=_l.rangeColumn,this._barMarkType="rect",this._barName=_l.bar,this.transformerConstructor=Kj}initMark(){var t,e,i,s,n,r,a,o,l,h;this._initBarBackgroundMark();const d=null===(t=this._spec.label)||void 0===t?void 0:t.position;this._barMark=this._createMark(Xj.mark.bar,{morph:PL(this._spec,Xj.mark.bar.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(e=this._spec.bar)||void 0===e?void 0:e.customShape,stateSort:null===(i=this._spec.bar)||void 0===i?void 0:i.stateSort}),!1!==(null===(s=this._spec.label)||void 0===s?void 0:s.visible)&&"bothEnd"===d&&(!1!==(null===(r=null===(n=this._spec.label)||void 0===n?void 0:n.minLabel)||void 0===r?void 0:r.visible)&&(this._minLabelMark=this._createMark(Xj.mark.minLabel,{markSpec:null===(a=this._spec.label)||void 0===a?void 0:a.minLabel})),!1!==(null===(l=null===(o=this._spec.label)||void 0===o?void 0:o.maxLabel)||void 0===l?void 0:l.visible)&&(this._maxLabelMark=this._createMark(Xj.mark.maxLabel,{markSpec:null===(h=this._spec.label)||void 0===h?void 0:h.maxLabel})))}initMarkStyle(){var t,e,i,s,n,r,a,o,l,h;super.initMarkStyle();const d=this._minLabelMark,c=null===(t=this._spec.label)||void 0===t?void 0:t.minLabel;d&&(this.setMarkStyle(d,{fill:null!==(i=null===(e=null==c?void 0:c.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[0]]:t[this._spec.yField[0]];return(null==c?void 0:c.formatMethod)?c.formatMethod(e,t):e}}),Hj(this,d,null!==(s=null==c?void 0:c.position)&&void 0!==s?s:"end",null!==(n=null==c?void 0:c.offset)&&void 0!==n?n:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)));const u=this._maxLabelMark,p=null===(r=this._spec.label)||void 0===r?void 0:r.maxLabel;u&&(this.setMarkStyle(u,{fill:null!==(o=null===(a=null==p?void 0:p.style)||void 0===a?void 0:a.fill)&&void 0!==o?o:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[1]]:t[this._spec.yField[1]];return(null==p?void 0:p.formatMethod)?p.formatMethod(e,t):e}}),Hj(this,u,null!==(l=null==p?void 0:p.position)&&void 0!==l?l:"start",null!==(h=null==p?void 0:p.offset)&&void 0!==h?h:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)))}initLabelMarkStyle(t){t&&(this.setMarkStyle(t,{text:t=>{let e,i;return"horizontal"===this._spec.direction?(e=t[this._spec.xField[0]],i=t[this._spec.xField[1]]):(e=t[this._spec.yField[0]],i=t[this._spec.yField[1]]),e+"-"+i},z:this._fieldZ?this.dataToPositionZ.bind(this):null}),this._labelMark=t)}_dataToPosX(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[0]),{bandPosition:this._bandPosition})}_dataToPosX1(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}_dataToPosY(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[0]),{bandPosition:this._bandPosition})}_dataToPosY1(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}initAnimation(){var t,e,i,s,n;const r=YL(this),a=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._barMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("rangeColumn"))||void 0===i?void 0:i({direction:this.direction},a),CL("bar",this._spec,this._markAttributeContext),r)),this._minLabelMark&&this._minLabelMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),CL("label",this._spec,this._markAttributeContext),r)),this._maxLabelMark&&this._maxLabelMark.setAnimationConfig(TL(null===(n=$l.getAnimationInKey("fadeInOut"))||void 0===n?void 0:n(),CL("label",this._spec,this._markAttributeContext),r))}initTooltip(){this._tooltipHelper=new zj(this),this._barMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._barMark),this._minLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._minLabelMark),this._maxLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._maxLabelMark),this._labelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._labelMark)}}Xj.type=_l.rangeColumn,Xj.mark=Uj,Xj.transformerConstructor=Kj;class qj extends UD{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barBackground:t.barBackground,barMinHeight:t.barMinHeight,stackCornerRadius:t.stackCornerRadius});return s.bar=t.bar,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),gy(t)}}class Zj extends ZD{constructor(){super(...arguments),this.transformerConstructor=qj,this.type="rangeColumn",this.seriesType=_l.rangeColumn}}Zj.type="rangeColumn",Zj.seriesType=_l.rangeColumn,Zj.transformerConstructor=qj;class Jj extends Xj{constructor(){super(...arguments),this.type=_l.rangeColumn3d,this._barMarkType="rect3d",this._barName=_l.bar3d}}Jj.type=_l.rangeColumn3d,Jj.mark=$j;class Qj extends UD{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barGapInGroup:t.barGapInGroup});return s.bar3d=t.bar3d,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class tH extends ZD{constructor(){super(...arguments),this.transformerConstructor=Qj,this.type="rangeColumn3d",this.seriesType=_l.rangeColumn3d}}tH.type="rangeColumn3d",tH.seriesType=_l.rangeColumn3d,tH.transformerConstructor=Qj;const eH=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},iH=t=>{const e=t.mark.elements.filter((t=>t.diffState===Kd.update)),i=Fa(e.map((t=>{var e;return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth})));return e.filter((t=>{var e;return(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth)===i}))},sH=(t,e,i)=>Im(t)?[e,i]:[Fa(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),Ba(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],nH=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iH(i),a=sH(r,s,n);return eH(e.startAngle,a)*(n-s)+s},to:t=>t.startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iH(i),a=sH(r,s,n);return eH(e.endAngle,a)*(n-s)+s},to:t=>t.endAngle},outerRadius:{from:t=>t.innerRadius,to:t=>t.outerRadius},innerRadius:{from:t=>t.innerRadius,to:t=>t.innerRadius}}}),rH=t=>[Fa(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),Ba(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],aH=t=>({channel:{startAngle:{from:(t,e)=>e.getGraphicAttribute("startAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iH(i),a=rH(r);return eH(i.getGraphicAttribute("startAngle",!1),a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getGraphicAttribute("endAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=iH(i),a=rH(r);return eH(i.getGraphicAttribute("endAngle",!1),a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getGraphicAttribute("outerRadius",!1),to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getGraphicAttribute("innerRadius",!1),to:()=>t.animationInfo().innerRadius}}}),oH=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},lH=(t,e=[],i)=>{const s=(null==i?void 0:i.maxDepth)>=0;return t.forEach((t=>{(!s||t.depth<=i.maxDepth)&&(e.push((null==i?void 0:i.callback)?i.callback(t):t),t.children&&(s&&t.depth===i.maxDepth?(t.children=null,t.isLeaf=!0):lH(t.children,e,i)))})),e},hH=(t,e={})=>{if(!t)return[];const i=[];return lH(t,i,e),i};function dH(t,e,i,s,n,r={x0:"x0",x1:"x1",y0:"y0",y1:"y1"}){const a=t.children;let o,l=-1;const h=a.length,d=t.value&&(s-e)/t.value;for(;++lP(t)?e:S(t)?e*parseFloat(t)/100:t;function uH(t){if(Wo(t))return t;const e=+t;return Wo(e)?e:0}const pH=(t,e,i=0,s=-1,n,r,a="value")=>{let o=0,l=null!=s?s:-1,h=i;return t.forEach(((t,s)=>{var d,c;const u={flattenIndex:++l,key:r?r(t):`${null!==(d=null==n?void 0:n.key)&&void 0!==d?d:""}-${s}`,maxDepth:-1,depth:i,index:s,value:t[a],isLeaf:!0,datum:n?n.datum.concat(t):[t],parentKey:null==n?void 0:n.key};if(null===(c=t.children)||void 0===c?void 0:c.length){u.children=[],u.isLeaf=!1;const e=pH(t.children,u.children,i+1,l,u,r,a);u.value=P(t[a])?e.sum:Math.max(e.sum,uH(t[a])),l=e.flattenIndex,h=Math.max(e.maxDepth,h)}else u.isLeaf=!0,u.value=uH(t[a]);o+=Math.abs(u.value),e.push(u)})),{sum:o,maxDepth:h,flattenIndex:l}},gH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;n=e(t,s,i,n),(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=gH(t.children,e,t,n))})),s},mH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=mH(t.children,e,t,n)),n=e(t,s,i,n)})),n},_H={x0:"startAngle",x1:"endAngle",y0:"innerRadius",y1:"outerRadius"};class fH{constructor(t){this._layoutNode=t=>{if(t.maxDepth=this._maxDepth,t.children){const e=this._parsedInnerRadius[t.depth+1],i=this._parsedOutterRadius[t.depth+1];dH(t,t.startAngle,Math.min(e,i),t.endAngle,Math.max(e,i),_H);const s=y(this.options.label)?this.options.label[t.depth+1]:this.options.label;t.children.forEach((t=>{if(t.x=this._parsedCenter[0],t.y=this._parsedCenter[1],s)return this._layoutLabel(t,v(s)?{align:"center",rotate:"radial"}:s)}))}},this.options=t?Object.assign({},fH.defaultOpionts,t):Object.assign({},fH.defaultOpionts);const e=this.options.nodeKey,i=rs(e)?e:e?Tm(e):null;this._getNodeKey=i,this._maxDepth=-1}_parseRadius(t,e){const i=t.x0+cH(this.options.center[0],t.width),s=t.y0+cH(this.options.center[1],t.height),n=Math.min(t.width/2,t.height/2),r=this.options.innerRadius,a=this.options.outerRadius,o=y(r),l=o?r.map((t=>cH(t,n))):cH(r,n),h=y(a),d=this.options.gapRadius,c=h?a.map((t=>cH(t,n))):cH(a,n),u=Zy(0,e+1);if(o)this._parsedInnerRadius=u.map(((t,e)=>{const i=l[e];return P(i)?n:i})),this._parsedOutterRadius=u.map(((t,i)=>{var s,r;return h?null!==(s=c[i])&&void 0!==s?s:n:iP(c[e])?n:c[e])),this._parsedInnerRadius=u.map(((t,e)=>{var i;return 0===e?l:this._parsedOutterRadius[e-1]-(y(d)?null!==(i=d[e])&&void 0!==i?i:0:d)}));else{const t=cH(r,n),i=(c-t)/(e+1);this._parsedInnerRadius=u.map(((e,s)=>t+s*i)),this._parsedOutterRadius=u.map(((t,e)=>{var s;return this._parsedInnerRadius[e]+i-(y(d)?null!==(s=d[e])&&void 0!==s?s:0:d)}))}this._parsedCenter=[i,s],this._maxRadius=n}layout(t,e){const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const s=[],n=pH(t,s,0,-1,null,this._getNodeKey);return this._parseRadius(i,n.maxDepth),this._maxDepth=n.maxDepth,this._layout(s,{flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:n.sum,datum:null,children:s,startAngle:this.options.startAngle,endAngle:this.options.endAngle}),s}_layout(t,e){this._layoutNode(e),t.forEach((t=>{var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t.children,t):this._layoutNode(t)}))}_layoutLabel(t,e){var i;const s=(t.startAngle+t.endAngle)/2,n=("start"===e.align?t.innerRadius:"end"===e.align?t.outerRadius:(t.innerRadius+t.outerRadius)/2)+(null!==(i=e.offset)&&void 0!==i?i:0),r=Tt({x:this._parsedCenter[0],y:this._parsedCenter[1]},n,s);if(t.label={x:r.x,y:r.y,textBaseline:"middle"},"tangential"===e.rotate)t.label.angle=s-Math.PI/2,t.label.textAlign="center",t.label.maxLineWidth=Math.abs(t.endAngle-t.startAngle)*n;else{const i=s%(2*Math.PI),n=i<0?i+2*Math.PI:i;n>Math.PI/2&&n<1.5*Math.PI?(t.label.angle=n+Math.PI,t.label.textAlign="start"===e.align?"end":"end"===e.align?"start":"center"):(t.label.angle=n,t.label.textAlign=e.align),t.label.maxLineWidth=t.isLeaf?void 0:Math.abs(t.outerRadius-t.innerRadius)}}}fH.defaultOpionts={startAngle:Math.PI/2,endAngle:-3*Math.PI/2,center:["50%","50%"],gapRadius:0,innerRadius:0,outerRadius:"70%"};const vH=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new fH(i).layout(t,{width:s,height:n})};class yH extends VT{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const bH=(t,e,i="key",s="children")=>{for(let n=0;n{for(let n=0;n{const r=Object.assign({},t);return Array.isArray(r[n])&&(r[n]=SH(r[n],e,i,s,n)),r})).filter((t=>+t[s]>=e&&+t[s]<=i||t[n]&&t[n].length>0)):t}var MH;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(MH||(MH={}));const kH=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(P(n))return t;if(i.type===MH.DrillDown)return Ra(bH(t,n,s,"children"));if(i.type===MH.DrillUp){const e=xH(t,n,s,"children");if(e)return Ra(e)}return t};class AH{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=PI(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;Ap(t,"drillFilter",kH),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(P(t.datum)||P(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!y(t)||Im(t))return t;const s=t[t.length-1];return this._drillInfo={key:s,path:t,type:MH.DrillDown},e().reRunAllTransform(),i.emit(jd.drill,{value:{path:t,type:MH.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:s}=this._drillParams,n=null!==(e=null===(t=this._drillInfo)||void 0===t?void 0:t.path)&&void 0!==e?e:[];if(!y(n)||Im(n))return n;const r=n.pop();return this._drillInfo={key:r,path:n,type:MH.DrillUp},i().reRunAllTransform(),s.emit(jd.drill,{value:{path:n,type:MH.DrillUp},model:this}),n}}const wH=Object.assign(Object.assign({},iC),{sunburst:{name:"sunburst",type:"arc"}});class TH extends NI{constructor(){super(...arguments),this.type=_l.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qT),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:_T},getRawData:()=>this.getRawData()}),this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),Ap(this._dataSet,"sunburstLayout",vH),Ap(this._dataSet,"flatten",hH),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[M(this._centerX)?this._centerX:this.getLayoutRect().width/2,M(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:XT,operations:["max","min","values"]},{key:qT,operations:["values"]}])}_addDataIndexAndKey(){const t=this.getRawData();P(null==t?void 0:t.dataSet)||(Ap(t.dataSet,"addVChartProperty",zT),t.transform({type:"addVChartProperty",options:{beforeCall:tC.bind(this),call:eC}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){var t,e;if(!1===this._sunburst.visible)return;const i=this._createMark(TH.mark.sunburst,{isSeriesMark:!0,customShape:null===(t=this._spec.sunburst)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.sunburst)||void 0===e?void 0:e.stateSort});this._sunburstMark=i}_initArcMarkStyle(){P(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(M(this._offsetX)?this._offsetX:0),y:t=>t.y+(M(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},vy.STATE_NORMAL,Ly.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(TH.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){P(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return ns(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(M(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(M(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},vy.STATE_NORMAL,Ly.Series)}initTooltip(){this._tooltipHelper=new yH(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Ra(this.__innerRadius))[0],outerRadius:this._computeRadius(Ra(this.__outerRadius))[0],startAngle:Ra(this._startAngle)[0],endAngle:Ra(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),CL(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),CL(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_computeRadius(t){return y(t)?t.map((t=>this._computeLayoutRadius()*t)):this._computeLayoutRadius()*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}TH.type=_l.sunburst,TH.mark=wH,XA(TH,AH);class CH extends GD{_getDefaultSeriesSpec(t){const e=M(t.startAngle)?t.startAngle:-90,i=M(t.endAngle)?t.endAngle:e+wt(2*Math.PI),s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,centerX:t.centerX,centerY:t.centerY,offsetX:t.offsetX,offsetY:t.offsetY,startAngle:e,endAngle:i,innerRadius:t.innerRadius,outerRadius:t.outerRadius,gap:t.gap,labelLayout:t.labelLayout,label:t.label,labelAutoVisible:t.labelAutoVisible,drill:t.drill,drillField:t.drillField}),n=_l.sunburst;return s.type=n,s[n]=t[n],s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class LH extends ZD{constructor(){super(...arguments),this.transformerConstructor=CH,this.type="sunburst",this.seriesType=_l.sunburst}}LH.type="sunburst",LH.seriesType=_l.sunburst,LH.transformerConstructor=CH;const EH=4294967296;function PH(t,e){let i,s;if(RH(e,t))return[e];for(i=0;i0&&i*i>s*s+n*n}function RH(t,e){for(let i=0;i1e-6?(T+Math.sqrt(T*T-4*w*C))/(2*w):C/T);return{x:s+S+M*L,y:n+k+A*L,radius:L}}function YH(t,e,i){const s=t.x-e.x;let n,r;const a=t.y-e.y;let o,l;const h=s*s+a*a;h?(r=e.radius+i.radius,r*=r,l=t.radius+i.radius,l*=l,r>l?(n=(h+l-r)/(2*h),o=Math.sqrt(Math.max(0,l/h-n*n)),i.x=t.x-n*s-o*a,i.y=t.y-n*a+o*s):(n=(h+r-l)/(2*h),o=Math.sqrt(Math.max(0,r/h-n*n)),i.x=e.x+n*s-o*a,i.y=e.y+n*a+o*s)):(i.x=e.x+i.radius,i.y=e.y)}function jH(t,e){const i=t.radius+e.radius-1e-6,s=e.x-t.x,n=e.y-t.y;return i>0&&i*i>s*s+n*n}function HH(t){const e=t._,i=t.next._,s=e.radius+i.radius,n=(e.x*i.radius+i.x*e.radius)/s,r=(e.y*i.radius+i.y*e.radius)/s;return n*n+r*r}function zH(t){return{_:t,next:null,prev:null}}function NH(t,e){const i=(t=Ra(t)).length;if(!i)return 0;let s=t[0];if(s.x=0,s.y=0,1===i)return s.radius;const n=t[1];if(s.x=-n.radius,n.x=s.radius,n.y=0,2===i)return s.radius+n.radius;let r=t[2];YH(n,s,r);let a,o,l,h,d,c,u,p=zH(s),g=zH(n),m=zH(r);p.next=g,m.prev=g,g.next=m,p.prev=m,m.next=p,g.prev=p;for(let e=3;et.padding:y(null==t?void 0:t.padding)?e=>{var i;return null!==(i=t.padding[e.depth+1])&&void 0!==i?i:0}:()=>0,this._maxDepth=-1}layout(t,e){var i;const s="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const n=[],r=pH(t,n,0,-1,null,this._getNodeKey);this._maxDepth=r.maxDepth;const a=function(t=1){let e=t;return()=>(e=(1664525*e+1013904223)%EH)/EH}(),o={flattenIndex:-1,maxDepth:-1,key:"root",depth:-1,index:-1,value:r.sum,datum:null,children:n,x:s.x0+s.width/2,y:s.y0+s.height/2},{nodeSort:l,setRadius:h,padding:d,includeRoot:c}=null!==(i=this.options)&&void 0!==i?i:{};if(!1!==l){const t=rs(l)?this.options.nodeKey:UH.defaultOpionts.nodeSort;gH([o],(e=>{e.children&&e.children.length&&e.children.sort(t)}))}if(h)gH([o],VH(h)),mH([o],WH(this._getPadding,.5,a)),gH([o],GH(1,this._maxDepth));else{const t=Math.min(s.width,s.height);gH([o],VH(UH.defaultOpionts.setRadius)),mH([o],WH(ng,1,a)),d&&mH([o],WH(this._getPadding,o.radius/t,a)),gH([o],GH(t/(2*o.radius),this._maxDepth))}return c?[o]:n}}UH.defaultOpionts={setRadius:t=>Math.sqrt(t.value),padding:0,nodeSort:(t,e)=>e.value-t.value};const $H=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return 0===s||0===n?t:new UH(i).layout(t,{width:s,height:n})};class KH extends VT{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const XH=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},qH=Object.assign(Object.assign({},iC),{circlePacking:{name:"circlePacking",type:"arc"}});class ZH extends jL{constructor(){super(...arguments),this.type=_l.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qT),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:_T},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();P(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),Ap(this._dataSet,"circlePackingLayout",$H),Ap(this._dataSet,"flatten",hH),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();P(null==t?void 0:t.dataSet)||(Ap(t.dataSet,"addVChartProperty",zT),t.transform({type:"addVChartProperty",options:{beforeCall:tC.bind(this),call:eC}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t,e;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const i=this._createMark(ZH.mark.circlePacking,{isSeriesMark:!0,customShape:null===(e=this._spec.circlePacking)||void 0===e?void 0:e.customShape});this._circlePackingMark=i}_initCirclePackingMarkStyle(){P(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},vy.STATE_NORMAL,Ly.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(ZH.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){P(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},vy.STATE_NORMAL,Ly.Series)}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:XT,operations:["max","min","values"]},{key:qT,operations:["values"]}])}initTooltip(){this._tooltipHelper=new KH(this),this._tooltipHelper.updateTooltipSpec(),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),CL(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),CL(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}ZH.type=_l.circlePacking,ZH.mark=qH,XA(ZH,AH);class JH extends GD{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,layoutPadding:t.layoutPadding,label:t.label,circlePacking:t.circlePacking,drill:t.drill,drillField:t.drillField}),i=_l.circlePacking;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class QH extends ZD{constructor(){super(...arguments),this.transformerConstructor=JH,this.type="circlePacking",this.seriesType=_l.circlePacking}}function tz(t,e,i,s,n){const r=t.children;let a,o=-1;const l=r.length,h=t.value&&(n-i)/t.value;for(;++o{if(t>=e-1){const e=r[t];return e.x0=s,e.y0=n,e.x1=a,void(e.y1=o)}const d=l[t],c=i/2+d;let u=t+1,p=e-1;for(;u>>1;l[t]o-n){const r=i?(s*m+a*g)/i:a;h(t,u,g,s,n,r,o),h(u,e,m,r,n,a,o)}else{const r=i?(n*m+o*g)/i:o;h(t,u,g,s,n,a,r),h(u,e,m,s,r,a,o)}};h(0,a,t.value,e,i,s,n)},dice:dH,slice:tz,sliceDice:function(t,e,i,s,n){(t.depth%2==1?tz:dH)(t,e,i,s,n)}};class iz{constructor(t){var e;this._filterByArea=(t,e)=>{var i;const s=this._getMinAreaByDepth(t.depth);if(s>0&&t.value*ethis._filterByArea(t,e)));i.length?i.length!==t.children.length&&(t.children=i):(t.isLeaf=!0,t.children=null)}return!0},this._getMinAreaByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.minVisibleArea)?this.options.minVisibleArea[t]:this.options.minVisibleArea)&&void 0!==e?e:0},this._getGapWidthByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.gapWidth)?this.options.gapWidth[t]:this.options.gapWidth)&&void 0!==e?e:0},this._getPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.padding)?this.options.padding[t]:this.options.padding)&&void 0!==e?e:0},this._getLabelPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.labelPadding)?this.options.labelPadding[t]:this.options.labelPadding)&&void 0!==e?e:0},this._layoutNode=t=>{const e=this._getGapWidthByDepth(t.depth);let i=t.x0,s=t.y0,n=t.x1,r=t.y1;if(t.maxDepth=this._maxDepth,e>0&&(i+=e/2,n-=e/2,s+=e/2,r-=e/2,i>n&&(i=(i+n)/2,n=i),s>r&&(s=(s+r)/2,r=s),t.x0=i,t.x1=n,t.y0=s,t.y1=r),t.children){const e=this._getLabelPaddingByDepth(t.depth),a=this._getPaddingByDepth(t.depth);a>0&&a0&&("top"===this.options.labelPosition&&s+es?(t.labelRect={x0:i,y0:r-e,x1:n,y1:r},r-=e):"left"===this.options.labelPosition&&i+ei&&(t.labelRect={x0:n-e,y0:s,x1:n,y1:r},n-=e));const o=this._getGapWidthByDepth(t.depth+1);o>0&&(i-=o/2,n+=o/2,s-=o/2,r+=o/2),this._splitNode(t,i,s,n,r)}},this.options=Object.assign({},iz.defaultOpionts,t);const i=this.options.nodeKey,s=rs(i)?i:i?Tm(i):null;var n;this._getNodeKey=s,this._splitNode="squarify"===this.options.splitType?(n=this.options.aspectRatio,(t,e,i,s,r)=>{!function(t,e,i,s,n,r){const a=[],o=e.children;let l,h,d=0,c=0;const u=o.length;let p,g,m,_,f,v,y,b,x,S=e.value;for(;df&&(f=h),x=m*m*b,v=Math.max(f/x,x/_),v>y){m-=h;break}y=v}l=Object.assign({},e,{value:m,children:o.slice(d,c)}),a.push(l),p=0&&t.depth>=e)return!1;const i=this.options.minChildrenVisibleArea;if(h(i)&&Math.abs((t.x1-t.x0)*(t.y1-t.y0)){var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t):this._layoutNode(t)}))}}iz.defaultOpionts={aspectRatio:(1+Math.sqrt(5))/2,gapWidth:0,labelPadding:0,labelPosition:"top",splitType:"binary",minVisibleArea:10};const sz=(t,e)=>{const i=new iz(t).layout(e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});if(t.flatten){const e=[];return lH(i,e,{maxDepth:null==t?void 0:t.maxDepth}),e}return i},nz=(t,e)=>{let i={},s=e.fields;if(rs(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=hH(n);return i=GT([{latestData:r}],e),i};class rz extends VT{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const az=Object.assign(Object.assign({},iC),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),oz=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class lz extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}class hz extends jL{constructor(){super(...arguments),this.type=_l.treemap,this.transformerConstructor=lz,this._categoryField="name",this._valueField="value",this._viewBox=new It,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:qT),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Pt),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:_T},getRawData:()=>this.getRawData()}),Wo(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){super.initData(),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}compile(){super.compile(),this._runTreemapTransform()}_runTreemapTransform(t=!1){var e,i,s,n;const r=this._data.getProduct();r&&r.transform([{type:"treemap",nameField:this._categoryField,valueField:this._valueField,x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:(null===(e=this._spec.nonLeafLabel)||void 0===e?void 0:e.visible)?null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(s=this._spec.nonLeafLabel)||void 0===s?void 0:s.position,minVisibleArea:null!==(n=this._spec.minVisibleArea)&&void 0!==n?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize,flatten:!0},{type:"map",callback:t=>(t&&[qT,"name"].forEach((e=>{t[e]=t.datum[t.depth][this._categoryField]})),t)}]),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Ap(this._rawData.dataSet,"addVChartProperty",zT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:tC.bind(this),call:eC}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=nz([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=E(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){Ap(this._dataSet,"hierarchyDimensionStatistics",nz),Ap(this._dataSet,"flatten",hH);const i=new R(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:XT,operations:["max","min","values"]},{key:qT,operations:["values"]}])}initMark(){var t,e,i,s;const n=this._createMark(hz.mark.nonLeaf,{isSeriesMark:!0,customShape:null===(t=this._spec.nonLeaf)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.nonLeaf)||void 0===e?void 0:e.stateSort});n&&(n.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=n);const r=this._createMark(hz.mark.leaf,{isSeriesMark:!0,customShape:null===(i=this._spec.leaf)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.leaf)||void 0===s?void 0:s.stateSort});r&&(r.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=r)}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},vy.STATE_NORMAL,Ly.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},vy.STATE_NORMAL,Ly.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},vy.STATE_NORMAL,Ly.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},vy.STATE_NORMAL,Ly.Series))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},vy.STATE_NORMAL,Ly.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},vy.STATE_NORMAL,Ly.Series))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("treemap"))||void 0===e?void 0:e(),CL(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(t=>{this.handlePan(t)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(t=>{this.handleZoom(t)}))),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new rz(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:d}=this._matrix;this._matrix.multiply(r,a,o,l,h,d),this.disableMarkAnimation(),this.event.on(rc.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.enable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().enableAnimation()})),this.event.off(rc.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.disable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().disableAnimation()}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}hz.type=_l.treemap,hz.mark=az,hz.transformerConstructor=lz,XA(hz,AH),XA(hz,OI);class dz extends GD{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,aspectRatio:t.aspectRatio,splitType:t.splitType,maxDepth:t.maxDepth,gapWidth:t.gapWidth,nodePadding:t.nodePadding,minVisibleArea:t.minVisibleArea,minChildrenVisibleArea:t.minChildrenVisibleArea,minChildrenVisibleSize:t.minChildrenVisibleSize,roam:t.roam,drill:t.drill,drillField:t.drillField,leaf:t.leaf,nonLeaf:t.nonLeaf,nonLeafLabel:t.nonLeafLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class cz extends ZD{constructor(){super(...arguments),this.transformerConstructor=dz,this.type="treemap",this.seriesType=_l.treemap}}cz.type="treemap",cz.seriesType=_l.treemap,cz.transformerConstructor=dz;const uz=`${sh}_waterfall_default_seriesField`,pz=(t,e)=>{if(!t||0===t.length)return t;const{indexField:i,total:s,groupData:n}=e,r=[],{dimensionValues:a,dimensionData:o}=n().latestData,l=Array.from(a[i]);let h={start:0,end:0,positive:0,negative:0,lastIndex:null};return l.forEach(((t,i)=>{const n={start:h.end,end:h.end,lastIndex:h.lastIndex,lastEnd:h.end,index:t,isTotal:!1,positive:h.end,negative:h.end},a=o[t];if(null==a||a.forEach(((t,e)=>{e===a.length-1?t[CT]=!0:delete t[CT]})),a.length>1){const o=t=>{if(s&&"end"!==s.type){if("field"===s.type||"custom"===s.type)return!!t[s.tagField]}else if(i===l.length-1)return!0;return!1};if(a.some((t=>o(t))))return h=function(t,e,i,s,n,r,a,o,l){i.isTotal=!0;const{valueField:h,startAs:d,endAs:c,total:u}=o,p=[],g=[];if(t.forEach((t=>{l(t)?g.push(t):p.push(t)})),g.length===t.length){const l=gz([t[0]],e,i,s,n,r,a,o);return g.forEach((e=>{e[d]=t[0][d],e[c]=t[0][c],e[h]=t[0][h]})),l}const m=g[0];let{start:_,end:f}=mz(m,i,s,n,u);i.start=_,i.end=f;let v=_,y=_,b=f-_;return p.forEach((t=>{const e=+t[h];e>=0?(t[d]=+v,v=Mt(v,e)):(t[d]=+y,y=Mt(y,e)),t[c]=Mt(t[d],e),_=Mt(_,e),b=kt(b,e)})),g.forEach((t=>{t[d]=+_,t[c]=Mt(t[d],b),t[h]=b})),Object.assign(Object.assign({},i),{lastIndex:e})}(a,t,n,r,h,l,i,e,o),void r.push(n)}h=gz(a,t,n,r,h,l,i,e),r.push(n)})),r};function gz(t,e,i,s,n,r,a,o){const{valueField:l,startAs:h,endAs:d,total:c,seriesField:u,seriesFieldName:p}=o;return t.forEach((t=>{let e=!1;if(c&&"end"!==c.type){if(("field"===c.type||"custom"===c.type)&&t[c.tagField]){e=!0;const{start:r,end:a}=mz(t,i,s,n,c);t[h]=r,t[d]=a,t[l]=a-r,i.start=r,i.end=a}}else a===r.length-1&&(i.start=0,t[h]=i.start,t[d]=i.end,e=!0);if(!e){const e=+t[l];e>=0?(t[h]=+i.positive,i.positive=Mt(i.positive,e)):(t[h]=+i.negative,i.negative=Mt(i.negative,e)),t[d]=Mt(t[h],e),i.end=Mt(i.end,e)}i.isTotal=e,(P(u)||u===uz)&&(t[uz]=e?p.total:+t[l]>=0?p.increase:p.decrease)})),Object.assign(Object.assign({},i),{lastIndex:e})}function mz(t,e,i,s,n){return n&&"end"!==n.type?"field"===n.type||"custom"===n.type?"custom"===n.type?function(t,e,i){return i.product(t,e)}(t,s,n):n.collectCountField&&!P(t[n.collectCountField])?function(t,e,i,s){let n=0,r=i.end;const a=e.length-+t[s.collectCountField],o=e.length-1;return a<0?pl("total.collectCountField error"):n=e[a].start,o<0?pl("total.collectCountField error"):r=e[o].end,{start:n,end:r}}(t,i,e,n):function(t,e,i){let s=0,n=e.end;return i.startField&&!P(t[i.startField])&&(s=+t[i.startField]),i.valueField&&!P(t[i.valueField])&&(n=Mt(s,+t[i.valueField])),{start:s,end:n}}(t,e,n):{start:0,end:0}:function(t){return{start:0,end:t.end}}(e)}const _z=(t,e)=>{if(!t)return t;const{indexField:i,valueField:s,total:n,seriesField:r}=e,a={[i]:(null==n?void 0:n.text)||"total",[s]:t.reduce(((t,e)=>Mt(t,+e[s])),0)};return r&&(a[r]="total"),t.push(a),t},fz={type:"fadeIn"},vz={type:"growCenterIn"};function yz(t,e){switch(e){case"fadeIn":return fz;case"scaleIn":return vz;default:return cO(t,!1)}}const bz=Object.assign(Object.assign({},vO),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),xz=(t,e)=>{if(!e.fields)return t;const i={};return{dimensionValues:i,dimensionData:Sz(t.map((t=>t.latestData)).flat(),e.fields,i)}};function Sz(t,e,i){if(0===e.length)return t;const s=e[0],n=e.slice(1);i[s]=new Set;const r=function(t,e,i){const s={};return t.forEach((t=>{const n=t[e];s[n]||(s[n]=[],i.add(n)),s[n].push(t)})),s}(t,s,i[s]);return n.length?(a=r,o=(t,e)=>Sz(t,n,i),Object.keys(a).reduce(((t,e)=>(t[e]=o(a[e]),t)),{})):r;var a,o}class Mz{get fields(){return this._fields}get groupData(){return this._groupData}constructor(t){this._fields=[],this._fields=t}initData(t,e){const i=t.name,s=new R(e instanceof f?e:t.dataSet);s.name=i,s.parse([t],{type:"dataview"}),Ap(e,"dimensionTree",xz),s.transform({type:"dimensionTree",options:{fields:this._fields}},!1),s.target.addListener("change",this.groupDataUpdate.bind(this)),this._groupData=s}groupDataUpdate(){}getGroupValueInField(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.groupData)||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.dimensionValues)||void 0===s?void 0:s[t];return n?Array.from(n):[]}}class kz extends SO{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar"),this._addMarkLabelSpec(t,"bar","stackLabel","initStackLabelMarkStyle")}}const Az={rect:Lz,symbol:Cz,arc:Pz,point:function(t){const{labelSpec:e}=t;let i;return i=!1!==e.overlap&&{avoidBaseMark:!1},{position:"center",overlap:i}},"line-data":function(t){const e=Cz(t);return v(e.overlap)||(e.overlap.avoidBaseMark=!1),e},stackLabel:Dz,line:Oz,area:Oz,rect3d:Lz,arc3d:Pz,treemap:function(t){return{customLayoutFunc:(t,e)=>e,overlap:!1}},venn:function(t){return{customLayoutFunc:(t,e)=>e,smartInvert:!0}}};function wz(t,e,i,s){var n;const{labelMark:r,series:a}=t,o={text:e[a.getMeasureField()[0]],data:e,textType:null!==(n=t.labelSpec.textType)&&void 0!==n?n:"text"},l=Object.keys(r.stateStyle.normal);for(const t of l){const i=r.getAttribute(t,e);o[t]=i}if(a.type!==_l.sankey){const{formatFunc:t,args:n}=IE(i,s,o.text,e);t&&(o.text=t(...n,{series:a}))}return o}function Tz(t){return rs(t)?e=>t(e.data):t}function Cz(t){var e,i,s;const{series:n,labelSpec:r}=t,a="horizontal"===n.direction?"right":"top",o=null!==(e=Tz(r.position))&&void 0!==e?e:a;let l;return l=!1!==r.overlap&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:[{type:"position",position:["top","bottom","right","left","top-right","top-left","bottom-left","bottom-right"]}],avoidBaseMark:"center"!==o},{position:o,overlap:l}}function Lz(t){var e,i,s,n,r,a;const{series:o,labelSpec:l={}}=t,h=null!==(e=Tz(l.position))&&void 0!==e?e:"outside",d=null!==(i=o.direction)&&void 0!==i?i:"vertical",c="horizontal"===o.direction?null===(s=o.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=o.getYAxisHelper())||void 0===n?void 0:n.isInverse();let u,p=h;S(h)&&"outside"===h&&(p=t=>{const{data:e}=t,i=o.getMeasureField()[0],s=(null==e?void 0:e[i])>=0&&c||(null==e?void 0:e[i])<0&&!c?1:0;return{vertical:["top","bottom"],horizontal:["right","left"]}[d][s]}),u=!1!==l.overlap&&{strategy:null!==(a=null===(r=l.overlap)||void 0===r?void 0:r.strategy)&&void 0!==a?a:Ez(o)};let g=!1;return S(h)&&h.includes("inside")&&(g=!0),{position:p,overlap:u,smartInvert:g}}function Ez(t){return[{type:"position",position:e=>{var i,s;const{data:n}=e,r=t.getMeasureField()[0];return("horizontal"===t.direction?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]:"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]}}]}function Pz(t){var e;const{labelSpec:i}=t,s=null!==(e=Tz(i.position))&&void 0!==e?e:"outside",n=s;let r;return r=i.smartInvert?i.smartInvert:S(s)&&s.includes("inside"),{position:n,smartInvert:r}}function Dz(t,e,i){const s=t.series,n=t.labelSpec||{},r=s.getTotalData();return{customLayoutFunc:r=>r.map((r=>{const a=n.position||"withChange",o=n.offset||0,l=e?e(r.data):r.data,h=wz(t,l,n.formatMethod);return h.x=function(t,e,i,s){return"horizontal"===e.direction?"middle"===i?.5*(e.totalPositionX(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionX(t,t.end>=t.start?"end":"start")+s:"min"===i?e.totalPositionX(t,t.end>=t.start?"start":"end")-s:e.totalPositionX(t,"end")+(t.end>=t.start?s:-s):e.totalPositionX(t,"index",.5)}(l,s,a,o),h.y=function(t,e,i,s){return"horizontal"===e.direction?e.totalPositionY(t,"index",.5):"middle"===i?.5*(e.totalPositionY(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionY(t,t.end>=t.start?"end":"start")-s:"min"===i?e.totalPositionY(t,t.end>=t.start?"start":"end")+s:e.totalPositionY(t,"end")+(t.end>=t.start?-s:s)}(l,s,a,o),"horizontal"===s.direction?h.textAlign="middle"===a?"center":"withChange"===a&&l.end-l.start>=0||"max"===a?"left":"right":h.textBaseline="middle"===a?a:"withChange"===a&&l.end-l.start>=0||"max"===a?"bottom":"top",null==i||i(r,l,h),p_(Object.assign(Object.assign({},h),{id:r.id}))})),dataFilter:t=>{const e=[];return r.forEach((i=>{const n=t.find((t=>{var e;return i.index===(null===(e=t.data)||void 0===e?void 0:e[s.getDimensionField()[0]])}));n&&(n.data=i,e.push(n))})),e},overlap:{strategy:[]}}}function Oz(t){var e,i,s,n;const{labelSpec:r,series:a}=t,o=null===(s=null===(i=null===(e=a.getViewDataStatistics)||void 0===e?void 0:e.call(a).latestData)||void 0===i?void 0:i[a.getSeriesField()])||void 0===s?void 0:s.values,l=o?o.map(((t,e)=>({[a.getSeriesField()]:t,index:e}))):[];return{position:null!==(n=r.position)&&void 0!==n?n:"end",data:l}}function Rz(t){return[{type:"position",position:e=>"horizontal"===t.direction?["right","left"]:["bottom","top"]}]}class Iz extends MO{constructor(){super(...arguments),this.type=_l.waterfall,this.transformerConstructor=kz,this._leaderLineMark=null,this._stackLabelMark=null,this._labelMark=null}getTotalData(){var t;return null===(t=this._totalData)||void 0===t?void 0:t.getLatestData()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups=new Mz(t),this._data&&this._groups.initData(this._data.getDataView(),this._dataSet))}setAttrFromSpec(){super.setAttrFromSpec(),this.setValueFieldToStack(),this._fieldX=[this._fieldX[0]],this._fieldY=[this._fieldY[0]],P(this._seriesField)&&(this._seriesField=uz)}getSeriesKeys(){return this._seriesField===uz?[this._theme.seriesFieldName.increase,this._theme.seriesFieldName.decrease,this._theme.seriesFieldName.total]:super.getSeriesKeys()}initData(){var t;super.initData(),Ap(this._dataSet,"waterfallFillTotal",_z),Ap(this._dataSet,"waterfall",pz),(P(this._spec.total)||"end"===this._spec.total.type)&&(null===(t=this._rawData)||void 0===t||t.transform({type:"waterfallFillTotal",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,total:this._spec.total}},!1));const e=Rp(this.getViewData(),this._dataSet,{name:`${sh}_series_${this.id}_totalData`});this.getViewData().target.removeListener("change",e.reRunAllTransform),this._totalData=new KT(this._option,e),e.transform({type:"waterfall",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,startAs:bT,endAs:xT,total:this._spec.total,groupData:()=>this.getGroups().groupData}},!1)}initAnimation(){var t,e,i,s;const n={yField:"horizontal"===this.direction?this._fieldY[0]:this.getStackValueField(),xField:"horizontal"===this.direction?this.getStackValueField():this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,a=YL(this);this._barMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("waterfall"))||void 0===i?void 0:i(n,r),CL("bar",this._spec,this._markAttributeContext),a)),this._leaderLineMark&&this._leaderLineMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),CL("leaderLine",this._spec,this._markAttributeContext)))}viewDataUpdate(t){this._totalData.getDataView().reRunAllTransform(),this._totalData.updateData(),super.viewDataUpdate(t)}addViewDataFilter(t){}reFilterViewData(){}onEvaluateEnd(t){super.onEvaluateEnd(t),this._totalData.updateData()}initMark(){var t,e;super.initMark();const i=this._createMark(Iz.mark.leaderLine,{key:"index",customShape:null===(t=this._spec.leaderLine)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.leaderLine)||void 0===e?void 0:e.stateSort});i&&(this._leaderLineMark=i,i.setDataView(this._totalData.getDataView(),this._totalData.getProductId()))}initLabelMarkStyle(t){var e;if(t)return!this._labelMark&&(null===(e=this._spec.label)||void 0===e?void 0:e.visible)?(super.initLabelMarkStyle(t),void(this._labelMark=t)):void 0}initStackLabelMarkStyle(t){t&&(this._stackLabelMark=t,t.skipEncode=!0,t.setRule("stackLabel"),t.setDataView(this._totalData.getDataView(),this._totalData.getProductId()),this.setMarkStyle(t,{text:t=>{var e;return"absolute"===(null===(e=this._spec.stackLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start)}}))}initTotalLabelMarkStyle(t){this.setMarkStyle(t,{text:t=>{var e;return"end"in t?"absolute"===(null===(e=this._spec.totalLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start):"horizontal"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]]}})}getTotalLabelComponentStyle(t){return Dz(Object.assign(Object.assign({},t),{series:this,labelSpec:this._spec.totalLabel}),(t=>{const e="vertical"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]];return this._totalData.getLatestData().find((t=>t.index===e))}))}totalPositionX(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._xAxisHelper;return"horizontal"===this._direction?sx(s([t[e]],{bandPosition:this._bandPosition})):s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("width",t)*(.5-i)}totalPositionY(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._yAxisHelper;return"horizontal"===this._direction?s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("height",t)*(.5-i):sx(s([t[e]],{bandPosition:this._bandPosition}))}initMarkStyle(){super.initMarkStyle(),this._leaderLineMark&&("horizontal"===this._direction?this.setMarkStyle(this._leaderLineMark,{visible:t=>!P(t.lastIndex),x:t=>this.totalPositionX(t,"lastEnd",0),x1:t=>this.totalPositionX(t,t.isTotal?"end":"start",0),y:t=>t.lastIndex?this.totalPositionY(t,"lastIndex",1):0,y1:t=>this.totalPositionY(t,"index",0)},"normal",Ly.Series):this.setMarkStyle(this._leaderLineMark,{visible:t=>!P(t.lastIndex),x:t=>t.lastIndex?this.totalPositionX(t,"lastIndex",1):0,x1:t=>this.totalPositionX(t,"index",0),y:t=>this.totalPositionY(t,"lastEnd",0),y1:t=>this.totalPositionY(t,t.isTotal?"end":"start",0)},"normal",Ly.Series))}}Iz.type=_l.waterfall,Iz.mark=bz,Iz.transformerConstructor=kz;class Bz extends AO{transformSpec(t){super.transformSpec(t),t.legends&&Ra(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),gy(t)}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{bar:t.bar,stackLabel:t.stackLabel,leaderLine:t.leaderLine,total:t.total})}}class Fz extends wO{constructor(){super(...arguments),this.transformerConstructor=Bz,this.type="waterfall",this.seriesType=_l.waterfall}}Fz.type="waterfall",Fz.seriesType=_l.waterfall,Fz.transformerConstructor=Bz;const Yz=`${sh}_BOX_PLOT_OUTLIER_VALUE`;var jz;!function(t){t.OUTLIER="outlier",t.MAX="max",t.MIN="min",t.MEDIAN="median",t.Q1="q1",t.Q3="q3",t.SERIES_FIELD="seriesField"}(jz||(jz={}));const Hz=(t,e)=>{const i=[],{outliersField:s,dimensionField:n}=e;return(t[0].latestData||[]).forEach((t=>{let e=t[s];y(e)||(e=[e]),i.push(...e.map((e=>{const i={[Yz]:e};return n.forEach((e=>{i[e]=t[e]})),i})))})),i};class zz extends VT{constructor(){super(...arguments),this.getContentKey=t=>e=>{if(this.isOutlierMark(e))return t===jz.OUTLIER?this.series.getOutliersField():t===jz.SERIES_FIELD?this.series.getSeriesField():null;switch(t){case jz.MIN:return this.series.getMinField();case jz.MAX:return this.series.getMaxField();case jz.MEDIAN:return this.series.getMedianField();case jz.Q1:return this.series.getQ1Field();case jz.Q3:return this.series.getQ3Field();case jz.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{if(this.isOutlierMark(e))return t===jz.OUTLIER?e[Yz]:t===jz.SERIES_FIELD?e[this.series.getSeriesField()]:null;switch(t){case jz.MIN:return e[this.series.getMinField()];case jz.MAX:return e[this.series.getMaxField()];case jz.MEDIAN:return e[this.series.getMedianField()];case jz.Q1:return e[this.series.getQ1Field()];case jz.Q3:return e[this.series.getQ3Field()];case jz.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>"line"===this.series.getShaftShape()?this.series.getMarkInName("boxPlot").getAttribute("stroke",t):this.series.getMarkInName("boxPlot").getAttribute("fill",t),this.getOutlierFillColor=t=>{var e;const i=this.series.getOutliersStyle();return null!==(e=null==i?void 0:i.fill)&&void 0!==e?e:this.series.getMarkInName("outlier").getAttribute("fill",t)},this.isOutlierMark=t=>M(t[Yz])}getDefaultTooltipPattern(t){return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{key:this.getContentKey(jz.OUTLIER),value:this.getContentValue(jz.OUTLIER),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.getOutlierFillColor,shapeStroke:this.getOutlierFillColor,shapeHollow:!1},{key:this.getContentKey(jz.MAX),value:this.getContentValue(jz.MAX),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(jz.Q3),value:this.getContentValue(jz.Q3),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(jz.MEDIAN),value:this.getContentValue(jz.MEDIAN),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(jz.Q1),value:this.getContentValue(jz.Q1),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(jz.MIN),value:this.getContentValue(jz.MIN),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(jz.SERIES_FIELD),value:this.getContentValue(jz.SERIES_FIELD),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]}}}function Nz(t){return"horizontal"===t}function Vz(t){return"vertical"===t}class Wz extends Hm{constructor(t){super(t),this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!P(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t],l={};if(!o)return l;if(rs(o))return l.attributes=o(this.getDatum(),this,t,e),l;if(!a&&(null===(r=this.graphicItem.glyphStates)||void 0===r?void 0:r[t]))return this.graphicItem.glyphStates[t];if(o){const e=this.items[0],i=[Object.assign({},e,{nextAttrs:{}})];return Cm(this,i,o,this.mark.parameters()),this.coordinateTransformEncode(i),l.attributes=i[0].nextAttrs,this.graphicItem.glyphStates?this.graphicItem.glyphStates[t]||(this.graphicItem.glyphStates[t]=l):this.graphicItem.glyphStates={[t]:l},l}return l},this.glyphMeta=this.mark.getGlyphMeta()}getGlyphGraphicItems(){return this.glyphGraphicItems}initGraphicItem(t={}){if(this.graphicItem)return;this.graphicItem=this.mark.addGraphicItem(t,this.groupKey),this.graphicItem[lg]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);const e=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach((t=>{const i=e[t.name];this.glyphGraphicItems[t.name]=t,t.onBeforeAttributeUpdate=e=>this.mark?_m(i,e,this,t.name):e})),this.clearGraphicAttributes()}useStates(t,e){if(!this.graphicItem)return!1;this.mark.emit(rc.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();const i=v(e)?e:this.hasStateAnimation();return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,i),this.mark.emit(rc.AFTER_ELEMENT_STATE,{states:t},this),!0}encodeGraphic(){this.coordinateTransformEncode(this.items);const t=this.transformElementItems(this.items,this.mark.markType),e=!this.graphicItem;this.graphicItem||this.initGraphicItem(),this.diffState===Kd.enter||e?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),this.diffState!==Kd.enter&&this.diffState!==Kd.update||!this.states.length||(Object.values(this.glyphGraphicItems).forEach((t=>{t.states={}})),this.useStates(this.states)),this.items.map((t=>{t.nextAttrs={}}))}encodeCustom(t){var e;let i={};const s=this.glyphMeta.getChannelEncoder(),n=this.glyphMeta.getFunctionEncoder();if(n&&(i=n.call(null,Object.assign({},null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),s){let e;Object.keys(s).forEach((n=>{var r;if(!P(t[n])){e||(e=Object.assign({},null===(r=this.graphicItem)||void 0===r?void 0:r.attribute,t));const a=s[n].call(null,n,t[n],e,this.getDatum(),this,this.mark.getGlyphConfig());Object.keys(null!=a?a:{}).forEach((t=>{var e;i[t]=Object.assign(null!==(e=i[t])&&void 0!==e?e:{},a[t])}))}}))}return i}encodeDefault(){const t={};if(this.glyphMeta.getDefaultEncoder()){const e=this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig());Object.assign(t,e)}return t}_onGlyphAttributeUpdate(t=!1){return e=>{if(!this.mark)return e;const i=this.glyphMeta.getMarks(),s=_m(this.mark.getAttributeTransforms(),e,this),n=t?this.encodeDefault():null,r=this.encodeCustom(e);return Object.keys(i).forEach((s=>{const a=i[s],o=this.glyphGraphicItems[s],l=null==r?void 0:r[s],h=Object.assign({},l);if(t){const t=null==n?void 0:n[s];Object.keys(null!=t?t:{}).forEach((e=>{es(this.items[0].nextAttrs,e)||es(h,e)||(h[e]=t[e])}))}const d=Object.assign({},function(t,e){var i;return(null!==(i=mm[t])&&void 0!==i?i:[]).reduce(((t,i)=>(i.channels.forEach((i=>{es(e,i)&&(t[i]=e[i])})),t)),{})}(a,e),h),c=this._generateGlyphItems(a,this.items,d);this.coordinateTransformEncode(c);const u=this.transformElementItems(c,a);this.applyGlyphGraphicAttributes(u,s,o),a===Xd.shape&&(o.datum=c[0].datum)})),s}}_generateGlyphItems(t,e,i){const s=e.map((t=>Object.assign({},t,{nextAttrs:i})));return hg.includes(t)&&this.mark.getSpec().enableSegments&&s.forEach(((t,s)=>{t.nextAttrs=Object.assign({},e[s].nextAttrs,i)})),s}getGraphicAttribute(t,e=!1,i){if(!this.graphicItem)return;const s=this.getPrevGraphicAttributes(i);return e&&es(s,t)?s[t]:(i?this.glyphGraphicItems[i]:this.graphicItem).attribute[t]}setGraphicAttribute(t,e,i=!0,s){if(!this.graphicItem)return;const n=s?this.glyphGraphicItems[s]:this.graphicItem,r=this.getFinalGraphicAttributes(s),a=this.getPrevGraphicAttributes(s);i&&(r[t]=e),es(a,t)||(a[t]=n.attribute[t]),n.setAttribute(t,e)}setGraphicAttributes(t,e=!0,i){if(!this.graphicItem)return;const s=i?this.glyphGraphicItems[i]:this.graphicItem,n=this.getFinalGraphicAttributes(i),r=this.getPrevGraphicAttributes(i);Object.keys(t).forEach((i=>{e&&(n[i]=t[i]),es(r,i)||(r[i]=s.attribute[i])})),s.setAttributes(t)}diffAttributes(t,e){const i={},s=this.getFinalGraphicAttributes(e);for(const e in t)es(s,e)&&Dm(s[e],t[e])||(i[e]=t[e]);return i}applyGlyphGraphicAttributes(t,e,i){var s,n;if(this.mark.needAnimate()){const r=this.diffAttributes(t,e),a=null!==(s=this.getPrevGraphicAttributes(e))&&void 0!==s?s:{},o=null!==(n=this.getFinalGraphicAttributes(e))&&void 0!==n?n:{};Object.keys(r).forEach((t=>{a[t]=i.attribute[t],o[t]=r[t]})),this.setNextGraphicAttributes(r,e),this.setPrevGraphicAttributes(a,e),this.setFinalGraphicAttributes(o,e),i.setAttributes(r)}else i.setAttributes(t)}getFinalGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}setFinalGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}getPrevGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}setPrevGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}getNextGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}setNextGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}clearChangedGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t)}))}clearGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t),this.setFinalGraphicAttributes(null,t)}))}remove(){this.glyphGraphicItems=null,super.remove()}release(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach((t=>{t[lg]=null})),this.glyphGraphicItems=null),super.release()}}class Gz extends zm{constructor(t,e,i){super(t,Xd.glyph,i),this.glyphType=e,this.glyphMeta=pc.getGlyph(e)}configureGlyph(t){return this.spec.glyphConfig=t,this.commit(),this}getGlyphMeta(){return this.glyphMeta}getGlyphConfig(){return this.spec.glyphConfig}addGraphicItem(t,e){const i=function(t,e,i={}){if(!pc.getGraphicType(Xd.glyph))return;const s=pc.createGraphic(Xd.glyph,i),n=e.getMarks(),r=Object.keys(n).map((t=>{if(pc.getGraphicType(n[t])){const e=pc.createGraphic(n[t]);if(e)return e.name=t,e}}));return s.setSubGraphic(r),s}(0,this.glyphMeta,t);return super.addGraphicItem(t,e,i)}createElement(){return new Wz(this)}}Gz.markType=Xd.glyph;const Uz=()=>{pc.registerMark(Xd.glyph,Gz)},$z=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!Wo(l))return{};const h=e.getGraphicAttribute("x",!1),d=e.getGraphicAttribute("y",!1),c=e.getGraphicAttribute("min",!1),u=e.getGraphicAttribute("max",!1),p=e.getGraphicAttribute("q1",!1),g=e.getGraphicAttribute("q3",!1),m=e.getGraphicAttribute("median",!1),_={from:{x:h,y:d},to:{x:h,y:d}};return Wo(c)&&(_.from.min=l,_.to.min=c),Wo(u)&&(_.from.max=l,_.to.max=u),Wo(p)&&(_.from.q1=l,_.to.q1=p),Wo(g)&&(_.from.q3=l,_.to.q3=g),Wo(m)&&(_.from.median=l,_.to.median=m),_},Kz=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!Wo(l))return{};const h=e.getGraphicAttribute("x",!0),d=e.getGraphicAttribute("y",!0),c=e.getGraphicAttribute("min",!0),u=e.getGraphicAttribute("max",!0),p=e.getGraphicAttribute("q1",!0),g=e.getGraphicAttribute("q3",!0),m=e.getGraphicAttribute("median",!0),_={from:{x:h,y:d},to:{x:h,y:d}};return Wo(c)&&(_.to.min=l,_.from.min=c),Wo(u)&&(_.to.max=l,_.from.max=u),Wo(p)&&(_.to.q1=l,_.from.q1=p),Wo(g)&&(_.to.q3=l,_.from.q3=g),Wo(m)&&(_.to.median=l,_.from.median=m),_},Xz=(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;if(i&&Wo(i.center))return i.center;let m,_,f,v,y;if(Nz(e)){m=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x,_=null===(a=null===(r=t.getGraphicAttribute("points",!1,"max"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.x,f=null===(l=null===(o=t.getGraphicAttribute("points",!1,"min"))||void 0===o?void 0:o[0])||void 0===l?void 0:l.x;const e=t.getGraphicAttribute("width",!1,"box"),i=t.getGraphicAttribute("x",!1,"box");v=i,y=i+e}else{m=null===(d=null===(h=t.getGraphicAttribute("points",!1,"median"))||void 0===h?void 0:h[0])||void 0===d?void 0:d.y,_=null===(u=null===(c=t.getGraphicAttribute("points",!1,"max"))||void 0===c?void 0:c[0])||void 0===u?void 0:u.y,f=null===(g=null===(p=t.getGraphicAttribute("points",!1,"min"))||void 0===p?void 0:p[0])||void 0===g?void 0:g.y;const e=t.getGraphicAttribute("height",!1,"box"),i=t.getGraphicAttribute("y",!1,"box");v=i,y=i+e}return Wo(m)?m:Wo(v)&&Wo(y)?(v+y)/2:Wo(_)&&Wo(f)?(_+f)/2:Wo(f)?f:Wo(_)?_:NaN},qz=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={shaft:{},box:{},max:{},min:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.height)&&void 0!==o?o:i.getGraphicAttribute("height",!1),f=null!==(l=t.boxWidth)&&void 0!==l?l:i.getGraphicAttribute("boxWidth",!1),v=null!==(h=t.boxHeight)&&void 0!==h?h:i.getGraphicAttribute("boxHeight",!1),y=null!==(d=t.ruleWidth)&&void 0!==d?d:i.getGraphicAttribute("ruleWidth",!1),b=null!==(c=t.ruleHeight)&&void 0!==c?c:i.getGraphicAttribute("ruleHeight",!1);return s&&Nz(s.direction)?(Wo(v)?(Object.assign(u.box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2})):(Object.assign(u.box,{y:g-_/2,y1:g+_/2}),Object.assign(u.median,{y:g-_/2,y1:g+_/2})),Wo(b)?(Object.assign(u.max,{y:g-b/2,y1:g+b/2}),Object.assign(u.min,{y:g-b/2,y1:g+b/2})):(Object.assign(u.max,{y:g-_/2,y1:g+_/2}),Object.assign(u.min,{y:g-_/2,y1:g+_/2}))):(Wo(f)?(Object.assign(u.box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2})),Wo(y)?(Object.assign(u.max,{x:p-y/2,x1:p+y/2}),Object.assign(u.min,{x:p-y/2,x1:p+y/2})):(Object.assign(u.max,{x:p-m/2,x1:p+m/2}),Object.assign(u.min,{x:p-m/2,x1:p+m/2}))),u},Zz=$z(Xz),Jz=Kz(Xz),Qz=(t,e,i)=>{var s,n,r,a;if(Wo(null==i?void 0:i.center))return i.center;let o,l,h,d,c;if(Nz(e)){o=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x;const e=t.getGraphicAttribute("width",!1,"minMaxBox"),i=t.getGraphicAttribute("x",!1,"minMaxBox");h=i,l=i+e;const r=t.getGraphicAttribute("width",!1,"q1q3Box"),a=t.getGraphicAttribute("x",!1,"q1q3Box");d=a,c=a+r}else{o=null===(a=null===(r=t.getGraphicAttribute("points",!1,"median"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.y;const e=t.getGraphicAttribute("height",!1,"minMaxBox"),i=t.getGraphicAttribute("y",!1,"minMaxBox");h=i,l=i+e;const s=t.getGraphicAttribute("height",!1,"q1q3Box"),n=t.getGraphicAttribute("y",!1,"q1q3Box");d=n,c=n+s}return Wo(o)?o:Wo(d)&&Wo(c)?(d+c)/2:Wo(l)&&Wo(h)?(l+h)/2:Wo(h)?h:Wo(l)?l:NaN},tN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={minMaxBox:{},q1q3Box:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.minMaxWidth)&&void 0!==o?o:i.getGraphicAttribute("minMaxWidth",!1),f=null!==(l=t.q1q3Width)&&void 0!==l?l:i.getGraphicAttribute("q1q3Width",!1),v=null!==(h=t.height)&&void 0!==h?h:i.getGraphicAttribute("height",!1),y=null!==(d=t.minMaxHeight)&&void 0!==d?d:i.getGraphicAttribute("minMaxHeight",!1),b=null!==(c=t.q1q3Height)&&void 0!==c?c:i.getGraphicAttribute("q1q3Height",!1);return s&&Nz(s.direction)?(Wo(y)?Object.assign(u.minMaxBox,{y:g-y/2,y1:g+y/2}):Object.assign(u.minMaxBox,{y:g-v/2,y1:g+v/2}),Wo(b)?(Object.assign(u.q1q3Box,{y:g-b/2,y1:g+b/2}),Object.assign(u.median,{y:g-b/2,y1:g+b/2})):(Object.assign(u.q1q3Box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2}))):(Wo(_)?Object.assign(u.minMaxBox,{x:p-_/2,x1:p+_/2}):Object.assign(u.minMaxBox,{x:p-m/2,x1:p+m/2}),Wo(f)?(Object.assign(u.q1q3Box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.q1q3Box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2}))),u},eN=$z(Qz),iN=Kz(Qz);class sN extends mx{constructor(){super(...arguments),this.type=sN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:2,boxWidth:30,shaftWidth:20,shaftShape:"line"})}_initProduct(t){const e=this.getStyle("shaftShape"),i=this.getVGrammarView(),s=this.getProductId(),n="bar"===e?"barBoxplot":"boxplot",r=this.getStyle("direction");this._product=i.glyph(n,null!=t?t:i.rootMark).id(s).configureGlyph({direction:r}),this._compiledProductId=s}}sN.type="boxPlot";const nN=Object.assign(Object.assign({},iC),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}});class rN extends jL{constructor(){super(...arguments),this.type=_l.boxPlot}getMinField(){return this._minField}getMaxField(){return this._maxField}getQ1Field(){return this._q1Field}getMedianField(){return this._medianField}getQ3Field(){return this._q3Field}getOutliersField(){return this._outliersField}getShaftShape(){return this._shaftShape}getBoxFillColor(){return this._boxFillColor}getStrokeColor(){return this._strokeColor}getOutliersStyle(){return this._outliersStyle}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec();const r=null!==(e=null===(t=this._spec.boxPlot)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._minField=this._spec.minField,this._maxField=this._spec.maxField,this._q1Field=this._spec.q1Field,this._medianField=this._spec.medianField,this._q3Field=this._spec.q3Field,this._outliersField=this._spec.outliersField,this._lineWidth=null!==(i=r.lineWidth)&&void 0!==i?i:2,this._boxWidth=r.boxWidth,this._shaftShape=null!==(s=r.shaftShape)&&void 0!==s?s:"line",this._shaftWidth=r.shaftWidth,this._boxFillColor=r.boxFill,this._strokeColor=r.stroke,this._shaftFillOpacity="bar"===this._shaftShape?null!==(n=r.shaftFillOpacity)&&void 0!==n?n:.5:void 0,this._outliersStyle=this._spec.outliersStyle}initMark(){const t={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._boxPlotMark=this._createMark(rN.mark.boxPlot,{isSeriesMark:!0,progressive:t}),this._outlierMark=this._createMark(rN.mark.outlier,{progressive:t,key:mT,dataView:this._outlierDataView.getDataView(),dataProductId:this._outlierDataView.getProductId()})}initMarkStyle(){var t,e,i,s,n;const r=this._boxPlotMark;if(r){const i={direction:this._direction,lineWidth:this._lineWidth,shaftShape:this._shaftShape,fill:null!==(t=this._boxFillColor)&&void 0!==t?t:"line"===this._shaftShape?"#FFF":this.getColorAttribute(),minMaxFillOpacity:this._shaftFillOpacity,stroke:null!==(e=this._strokeColor)&&void 0!==e?e:"line"===this._shaftShape?this.getColorAttribute():"#000"},s="horizontal"===this._direction?Object.assign(Object.assign({y:this.dataToPositionY.bind(this)},i),{boxHeight:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Height:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}}):Object.assign(Object.assign({x:this.dataToPositionX.bind(this)},i),{boxWidth:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Width:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}});this.setMarkStyle(r,s,vy.STATE_NORMAL,Ly.Series)}const a=this._outlierMark;a&&this.setMarkStyle(a,{fill:null!==(s=null===(i=this._outliersStyle)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),size:h(null===(n=this._outliersStyle)||void 0===n?void 0:n.size)?this._outliersStyle.size:10,symbolType:"circle"},vy.STATE_NORMAL,Ly.Series)}initBoxPlotMarkStyle(){var t,e;const i=this._boxPlotMark,s="horizontal"===this._direction?this._xAxisHelper:this._yAxisHelper;if(i&&s){const{dataToPosition:e}=s,n=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{min:t=>sx(e(this.getDatumPositionValues(t,this._minField),{bandPosition:this._bandPosition}),n),q1:t=>sx(e(this.getDatumPositionValues(t,this._q1Field),{bandPosition:this._bandPosition}),n),median:t=>sx(e(this.getDatumPositionValues(t,this._medianField),{bandPosition:this._bandPosition}),n),q3:t=>sx(e(this.getDatumPositionValues(t,this._q3Field),{bandPosition:this._bandPosition}),n),max:t=>sx(e(this.getDatumPositionValues(t,this._maxField),{bandPosition:this._bandPosition}),n)},vy.STATE_NORMAL,Ly.Series)}const n=this._outlierMark;if(n&&s){const{dataToPosition:t}=s,i=null===(e=null==s?void 0:s.getScale)||void 0===e?void 0:e.call(s,0),r="horizontal"===this._direction?{y:this.dataToPositionY.bind(this),x:e=>sx(t(this.getDatumPositionValues(e,Yz),{bandPosition:this._bandPosition}),i)}:{x:this.dataToPositionX.bind(this),y:e=>sx(t(this.getDatumPositionValues(e,Yz),{bandPosition:this._bandPosition}),i)};this.setMarkStyle(n,r,vy.STATE_NORMAL,Ly.Series)}}initData(){if(super.initData(),!this._data)return;Ap(this._dataSet,"foldOutlierData",Hz),Ap(this._dataSet,"addVChartProperty",zT);const t=new R(this._dataSet,{name:`${this.type}_outlier_${this.id}_data`});t.parse([this.getViewData()],{type:"dataview"}),t.name=`${sh}_series_${this.id}_outlierData`,t.transform({type:"foldOutlierData",options:{dimensionField:"horizontal"===this._direction?this._fieldY:this._fieldX,outliersField:this._outliersField}}),t.transform({type:"addVChartProperty",options:{beforeCall:JT.bind(this),call:QT}},!1),this._outlierDataView=new KT(this._option,t)}init(t){super.init(t),this.initBoxPlotMarkStyle()}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,e="horizontal"===this._direction?this._fieldY:this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(t){super.onLayoutEnd(t),this._autoBoxWidth=null}_initAnimationSpec(t={}){const e=E({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="line"===this._shaftShape?"boxplotScaleIn":"barBoxplotScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="line"===this._shaftShape?"boxplotScaleOut":"barBoxplotScaleOut")})),e}initAnimation(){var t,e,i,s,n,r,a;const o=YL(this);if(this._boxPlotMark){const e=this._initAnimationSpec(null===(t=$l.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),i=this._initAnimationSpec(CL("boxPlot",this._spec,this._markAttributeContext));this._boxPlotMark.setAnimationConfig(TL(e,i,o))}if(this._outlierMark){const t={appear:null===(e=this._spec.animationAppear)||void 0===e?void 0:e.symbol,disappear:null===(i=this._spec.animationDisappear)||void 0===i?void 0:i.symbol,enter:null===(s=this._spec.animationEnter)||void 0===s?void 0:s.symbol,exit:null===(n=this._spec.animationExit)||void 0===n?void 0:n.symbol,update:null===(r=this._spec.animationUpdate)||void 0===r?void 0:r.symbol};this._outlierMark.setAnimationConfig(TL(null===(a=$l.getAnimationInKey("scaleInOut"))||void 0===a?void 0:a(),t,o))}}initTooltip(){this._tooltipHelper=new zz(this),this._boxPlotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark),this._outlierMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark)}getStatisticFields(){const t=super.getStatisticFields(),e=t.find((t=>t.key===this._outliersField));return e&&(e.operations=["array-min","array-max"]),t}onEvaluateEnd(t){super.onEvaluateEnd(t),this._outlierDataView.updateData()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._boxPlotMark]}}rN.type=_l.boxPlot,rN.mark=nN;class aN extends UD{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{boxPlot:t.boxPlot,direction:null!==(e=t.direction)&&void 0!==e?e:"vertical",minField:t.minField,maxField:t.maxField,q1Field:t.q1Field,medianField:t.medianField,q3Field:t.q3Field,outliersField:t.outliersField,outliersStyle:t.outliersStyle});return s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),gy(t)}}class oN extends ZD{constructor(){super(...arguments),this.transformerConstructor=aN,this.type="boxPlot",this.seriesType=_l.boxPlot}}oN.type="boxPlot",oN.seriesType=_l.boxPlot,oN.transformerConstructor=aN;const lN=t=>{let e=0;return t.forEach(((t,i)=>{var s;P(t.value)&&((null===(s=t.children)||void 0===s?void 0:s.length)?t.value=lN(t.children):t.value=0),e+=Math.abs(t.value)})),e};function hN(t){return t.depth}function dN(t,e){return e-1-t.endDepth}const cN=(t,e)=>(null==t?void 0:t.y0)-(null==e?void 0:e.y0),uN=(t,e)=>{if(P(t.value))return null;const i=(e?t.targetLinks:t.sourceLinks).reduce(((t,e)=>(P(e.value)?t.count+=1:t.sum+=e.value,t)),{sum:0,count:0});return i.count>0?(t.value-i.sum)/i.count:null},pN={left:hN,right:dN,justify:function(t,e){return t.sourceLinks.length?t.depth:e-1},center:function(t,e,i){return t.targetLinks.length?t.depth:t.sourceLinks.length?Fa(t.sourceLinks.map((t=>i[t.target].depth)))-1:0},start:hN,end:dN},gN=Gb(0,1);class mN{constructor(t){this._ascendingSourceBreadth=(t,e)=>cN(this._nodeMap[t.source],this._nodeMap[e.source])||t.index-e.index,this._ascendingTargetBreadth=(t,e)=>cN(this._nodeMap[t.target],this._nodeMap[e.target])||t.index-e.index,this.options=Object.assign({},mN.defaultOptions,t);const e=this.options.nodeKey,i=rs(e)?e:e?Tm(e):null;this._getNodeKey=i,this._logger=g.getInstance(),this._alignFunc=rs(this.options.setNodeLayer)?t=>this.options.setNodeLayer(t.datum):pN[this.options.nodeAlign]}layout(t,e){if(!t)return null;const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};Vz(this.options.direction)?this._viewBox={x0:i.y0,x1:i.y1,y0:i.x0,y1:i.x1,width:i.height,height:i.width}:this._viewBox=i;const s=this.computeNodeLinks(t),n=s.nodes;let r=s.links;if(this._nodeMap=s.nodeMap,this.computeNodeValues(n),this.computeNodeDepths(n),["right","end","justify"].includes(this.options.nodeAlign)&&this.computeNodeEndDepths(n),this._maxDepth<=1)return null;const a=this.computeNodeBreadths(n);if(this.computeLinkBreadths(n),n.forEach((t=>{t.sourceLinks=t.sourceLinks.filter((t=>!P(t.source)&&!P(t.target))),t.targetLinks=t.targetLinks.filter((t=>!P(t.source)&&!P(t.target)))})),r=r.filter((t=>!P(t.source)&&!P(t.target))),Vz(this.options.direction))if(this.options.inverse){const t=this._viewBox.x1;n.forEach((e=>{const{y0:i,y1:s,x0:n,x1:r}=e;e.y0=t-r,e.y1=t-n,e.x0=i,e.x1=s})),r.forEach((e=>{e.vertical=!0;const{x0:i,x1:s,y0:n,y1:r}=e;e.x0=n,e.x1=r,e.y0=t-i,e.y1=t-s}))}else n.forEach((t=>{const{y0:e,y1:i}=t;t.y0=t.x0,t.y1=t.x1,t.x0=e,t.x1=i})),r.forEach((t=>{t.vertical=!0;const e=t.x0,i=t.x1;t.x0=t.y0,t.x1=t.y1,t.y0=e,t.y1=i}));else this.options.inverse&&(n.forEach((t=>{const{x0:e,x1:s}=t;t.x0=i.x1-s,t.x1=i.x1-e})),r.forEach((t=>{t.x0=i.x1-t.x0,t.x1=i.x1-t.x1})));return r.forEach((t=>{const e=this._nodeMap[t.source],i=this._nodeMap[t.target];t.sourceRect={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},t.targetRect={x0:i.x0,x1:i.x1,y1:i.y1,y0:i.y0}})),{nodes:n,links:r,columns:a}}computeHierarchicNodeLinks(t){const e=[],i=[],s={},n={},r=[];lN(t);const a=(t,i,n)=>{t.forEach(((t,o)=>{const l=this._getNodeKey?this._getNodeKey(t):n?`${n[n.length-1].key}-${o}`:`${i}-${o}`,h=P(t.value)?0:uH(t.value);if(s[l])s[l].value=void 0;else{const n={depth:i,datum:t,index:o,key:l,value:h,sourceLinks:[],targetLinks:[]};s[l]=n,e.push(n)}n&&r.push({source:n[n.length-1].key,target:l,value:h,parents:n}),t.children&&t.children.length&&a(t.children,i+1,n?n.concat([s[l]]):[s[l]])}))};return a(t,0,null),r.forEach(((t,e)=>{const r=`${t.source}-${t.target}`,a=ZE(t,["parents"]);if(a.parents=t.parents.map((t=>ZE(t,["sourceLinks","targetLinks"]))),n[r])return n[r].value+=uH(t.value),void n[r].datum.push(a);const o={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[a],value:t.value,parents:t.parents.map((t=>t.key))};i.push(o),s[t.source].sourceLinks.push(o),s[t.target].targetLinks.push(o),n[r]=o})),{nodes:e,links:i,nodeMap:s}}computeSourceTargetNodeLinks(t){const e=[],i=[],s={};t.nodes&&t.nodes.forEach(((t,i)=>{const n={depth:-1,datum:t,index:i,key:this._getNodeKey?this._getNodeKey(t):i,value:t.value,sourceLinks:[],targetLinks:[]};s[n.key]=n,e.push(n)}));const n=[];return t.links.forEach(((r,a)=>{const o=!P(r.source),l=!P(r.target);if(t.nodes&&(!s[r.source]||!s[r.target]))return;t.nodes||!o||s[r.source]||(s[r.source]={value:void 0,depth:-1,index:e.length,key:r.source,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.source])),t.nodes||!l||s[r.target]||(s[r.target]={value:void 0,depth:-1,index:e.length,key:r.target,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.target]));const h={index:a,source:r.source,target:r.target,datum:r,value:r.value};this.options.divideNodeValueToLink&&P(r.value)&&n.push(h),i.push(h),o&&s[r.source].sourceLinks.push(h),l&&s[r.target].targetLinks.push(h)})),this.options.divideNodeValueToLink&&n.length&&n.forEach((t=>{const e=[uN(s[t.source]),uN(s[t.target],!0)].filter((t=>!P(t)));e.length&&(t.value=Fa(e))})),{nodeMap:s,nodes:e,links:i}}computeNodeLinks(t){let e;"links"in t?e=this.computeSourceTargetNodeLinks(t):(this._isHierarchic=!0,e=this.computeHierarchicNodeLinks(t.nodes));let i=e.nodes;const s=e.links;if(this.options.linkSortBy)for(let t=0,e=i.length;tt.targetLinks.length||t.sourceLinks.length))),{nodes:i,links:s,nodeMap:e.nodeMap}}computeNodeValues(t){for(let e=0,i=t.length;e{var i;return t+(null!==(i=uH(e.value))&&void 0!==i?i:0)}),0),i.targetLinks.reduce(((t,e)=>{var i;return t+(null!==(i=uH(e.value))&&void 0!==i?i:0)}),0))}}computeNodeDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link"),this._maxDepth=r}computeNodeEndDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link")}computeNodeLayers(t){const e=this.options.nodeWidth,i=this.options.linkWidth,s=this.options.minStepWidth,n=this._viewBox.width;let r=null,a=null,o=!1;if(S(e)){const t=vs(parseFloat(e.replace("%",""))/100,0,1);let i=n/(this._maxDepth-1+t);s>0&&(i=Math.max(s,i)),r=i*t,a=i*(1-t),o=!0}else if(h(e)){if(r=e,h(i))a=i;else if(P(i)){let t=(n-e)/(this._maxDepth-1);s>0&&(t=Math.max(s,t)),a=t-e}o=!0}else rs(e)&&h(i)&&(a=i);const l=[];for(let e=0,i=t.length;e{const i=e.reduce(((t,e)=>t+e.value),0),s=e.reduce(((t,e)=>t+this.options.nodeGap(e)),0);return Math.min(t,(this._viewBox.height-s)/i)}),1/0);else{const e=t.reduce(((t,e)=>Math.max(t,e.length)),0),i=this._viewBox.height/e,s=Math.min(this.options.nodeGap,i);if(a=()=>s,this._gapY=s,(n+s)*e>this._viewBox.height&&(n=i-s),this.options.equalNodeHeight)o=this._viewBox.height/e-s;else{const e=n>0?Math.max(s,n):s;r=t.reduce(((t,i)=>{const s=i.reduce(((t,e)=>t+e.value),0);return Math.min(t,(this._viewBox.height-((i.length-1)*e+n))/s)}),1/0)}}const l="start"===this.options.gapPosition,d=!l&&"end"!==this.options.gapPosition,c=h(this.options.nodeHeight)?t=>this.options.nodeHeight:rs(this.options.nodeHeight)?this.options.nodeHeight:o>0?t=>o:t=>Math.max(t.value*r,0),u=h(this.options.linkHeight)?()=>this.options.linkHeight:rs(this.options.linkHeight)?this.options.linkHeight:(t,e,i)=>Math.max(e.value?i*gN(t.value/e.value):0,s,0);for(let e=0,i=t.length;e0)if("start"===this.options.crossNodeAlign);else if("end"===this.options.crossNodeAlign)for(let t=0,e=i.length;t1&&(p/=i.length-1,r+p>=0)){r+=p,this._gapY=Math.min(r);for(let t=1,e=i.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}P(this.options.nodeSortBy)&&n.sort(cN),this.resolveCollisions(n,i)}}relaxRightToLeft(t,e,i){for(let s=t.length-2;s>=0;--s){const n=t[s];for(let t=0,i=n.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}void 0===this.options.nodeSortBy&&n.sort(cN),this.resolveCollisions(n,i)}}resolveCollisions(t,e){const i=t.length>>1,s=t[i];this.resolveCollisionsBottomToTop(t,s.y0-this._gapY,i-1,e),this.resolveCollisionsTopToBottom(t,s.y1+this._gapY,i+1,e),this.resolveCollisionsBottomToTop(t,this._viewBox.y1,t.length-1,e),this.resolveCollisionsTopToBottom(t,this._viewBox.y0,0,e)}resolveCollisionsTopToBottom(t,e,i,s){for(;i1e-6&&(n.y0+=r,n.y1+=r),e=n.y1+this._gapY}}resolveCollisionsBottomToTop(t,e,i,s){for(;i>=0;--i){const n=t[i],r=(n.y1-e)*s;r>1e-6&&(n.y0-=r,n.y1-=r),e=n.y0-this._gapY}}targetTop(t,e){let i,s,n,r=t.y0-(t.sourceLinks.length-1)*this._gapY/2;for(i=0,s=t.sourceLinks.length;ii.y1||n?(e.y0=i.y1-e.thickness/2,n=!0):s+=e.thickness}let r=i.y0;n=!1;for(let t=0,e=i.targetLinks.length;ti.y1||n?(e.y1=i.y1-e.thickness/2,n=!0):r+=e.thickness}}}computeLinkBreadthsOverlap(t){const e=this.options.linkOverlap;for(let i=0,s=t.length;i{const i=new mN(t).layout(Array.isArray(e)?e[0]:e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});return i?[i]:[]},fN=(t,e,i)=>{e.forEach((e=>{P(e[i])||t.add(e[i]),e.children&&e.children.length>0&&fN(t,e.children,i)}))},vN=t=>{var e;if(!t||!y(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},yN=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];const i=e.view();if(i.x1-i.x0==0||i.y1-i.y0==0||i.x1-i.x0==-1/0||i.x1-i.x0==1/0||i.y1-i.y0==-1/0||i.y1-i.y0==1/0)return[];const s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){const t=[];s.links.forEach((i=>{const s={};for(const t in i)t===e.sourceField?s.source=i[e.sourceField]:t===e.targetField?s.target=i[e.targetField]:t===e.valueField?s.value=i[e.valueField]:s[t]=i[t];t.push(s)})),s.links=t}const n=new mN(e),r=[];return r.push(n.layout(s,i)),r},bN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},xN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class SN extends VT{getDefaultTooltipPattern(t,e){switch(t){case"mark":return{visible:!0,activeType:t,title:{key:void 0,value:t=>{if(t.source){if(h(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},hasShape:!1},content:[{key:this.markTooltipKeyCallback,value:t=>t.value,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"dimension":if(e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},s=[];return e.forEach((({data:t})=>t.forEach((({series:t})=>{s.push({seriesId:t.id,key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1})})))),{visible:!0,activeType:t,title:i,content:s}}}return null}}const MN=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t),kN=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"},AN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d),c=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.y0-n/2),l=c(t.y1-n/2)):"end"===t.align?(o=c(t.y0+t.thickness/2-n),l=c(t.y1+t.thickness/2-n)):(o=c(t.y0-t.thickness/2),l=c(t.y1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${a},${c(l-n/2)}L${c(a+n)},${c((l+p)/2)}L${a},${c(p+n/2)}`:"",_=t.startArrow&&g?`L${r},${c(u+n/2)}L${c(r-n)},${c((o+u)/2)}L${r},${c(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${m}L${a},${p}L${r},${u}${_}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${m}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${_}Z`:`M${r},${o}C${h},${o},${d},${l},${a},${l}\n ${m}L${a},${p}C${d},${p},${h},${u},${r},${u}${_}Z`},wN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(c=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d)),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.x0-n/2),l=c(t.x1-n/2)):"end"===t.align?(o=c(t.x0+t.thickness/2-n),l=c(t.x1+t.thickness/2-n)):(o=c(t.x0-t.thickness/2),l=c(t.x1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${c(l-n/2)},${a}L${c((l+p)/2)},${c(a+n)}L${c(p+n/2)},${a}`:"",_=t.startArrow&&g?`L${c(u+n/2)},${r}L${c((u+o)/2)},${c(r-n)}L${c(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${m}L${p},${a}L${u},${r}${_}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${m}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${_}Z`:`M${o},${r}C${o},${h},${l},${d},${l},${a}\n ${m}L${p},${a}C${p},${d},${u},${h},${u},${r}${_}Z`},TN=(t,e,i,s)=>{var n;const r=null!==(n=t.direction)&&void 0!==n?n:null==s?void 0:s.direction,a=["vertical","TB","BT"].includes(r)?wN:AN,o="number"==typeof t.ratio&&t.ratio>=0&&t.ratio<=1,l=Object.keys(t);return["x0","y0","x1","y1"].every((t=>l.includes(t)))?{back:{path:o?a(t,1):""},front:{path:a(t,o?t.ratio:1)}}:{}},CN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1),thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{P(s[t])&&delete s[t]})),{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}},LN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0),thickness:t.getGraphicAttribute("thickness",!0),round:t.getGraphicAttribute("round",!0),align:t.getGraphicAttribute("align",!0),pathType:t.getGraphicAttribute("pathType",!0),endArrow:t.getGraphicAttribute("endArrow",!0),startArrow:t.getGraphicAttribute("startArrow",!0)};return Object.keys(s).forEach((t=>{P(s[t])&&delete s[t]})),{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}},EN=(t,e,i)=>{const s={thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{P(s[t])&&delete s[t]})),{from:Object.assign(Object.assign({x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0)},s),s),to:Object.assign({x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1)},s)}};class PN extends mx{constructor(){super(...arguments),this.type=PN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId(),s=this.getStyle("direction");this._product=e.glyph("linkPath",null!=t?t:e.rootMark).id(i).configureGlyph({direction:s}),this._compiledProductId=i}}PN.type="linkPath";const DN=Object.assign(Object.assign({},iC),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class ON extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}class RN extends jL{constructor(){super(...arguments),this.type=_l.sankey,this.transformerConstructor=ON,this._nodeLayoutZIndex=Ty.Node,this._labelLayoutZIndex=Ty.Label,this._viewBox=new It,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(M(a))return a;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a,o;const l=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(l)return l;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._nodesSeriesData)||void 0===s?void 0:s.getLatestData())||void 0===n?void 0:n.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,o=null===(a=null===(r=this._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color");return null==o?void 0:o.scale(null==i?void 0:i[this._spec.seriesField])}const d=h(t.source)?this.getNodeList()[t.source]:t.source;return null===(o=this._colorScale)||void 0===o?void 0:o.scale(d)},this._handleEmphasisElement=t=>{var e,i,s,n,r;const a=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},o=t.item;"adjacency"===a.effect?o&&o.mark===(null===(i=this._nodeMark)||void 0===i?void 0:i.getProduct())?this._handleNodeAdjacencyClick(o):o&&o.mark===(null===(s=this._linkMark)||void 0===s?void 0:s.getProduct())?this._handleLinkAdjacencyClick(o):this._handleClearEmpty():"related"===a.effect&&(o&&o.mark===(null===(n=this._nodeMark)||void 0===n?void 0:n.getProduct())?this._handleNodeRelatedClick(o):o&&o.mark===(null===(r=this._linkMark)||void 0===r?void 0:r.getProduct())?this._handleLinkRelatedClick(o):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;const i=null===(t=this._nodeMark)||void 0===t?void 0:t.getProductElements();if(!i||!i.length)return;const s=null===(e=this._linkMark)||void 0===e?void 0:e.getProductElements();if(!s||!s.length)return;const n=[vy.STATE_SANKEY_EMPHASIS,vy.STATE_SANKEY_EMPHASIS_REVERSE];i.forEach((t=>{t.removeState(n)})),s.forEach((t=>{t.removeState(n)})),this._needClear=!1},this._handleNodeAdjacencyClick=t=>{const e=t.getDatum(),i=[e.key];if(this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,s)=>{const n=t.getDatum(),r=(null==n?void 0:n.parents)?"parents":"source";if(Ra(n[r]).includes(e.key)){let s;if(i.includes(n.source)||i.push(n.source),i.includes(n.target)||i.push(n.target),"parents"===r){const t=n.datum;s=(t?t.filter((t=>t.parents.some((t=>t.key===e.key)))).reduce(((t,e)=>t+e.value),0):0)/n.value}t.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(vy.STATE_SANKEY_EMPHASIS),t.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:s})}else n.target===e.key?i.includes(n.source)||i.push(n.source):(t.removeState(vy.STATE_SANKEY_EMPHASIS),t.addState(vy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{const e=t.getDatum(),i=[e.source,e.target];if(this._linkMark){const e=this._linkMark.getProductElements();if(!e||!e.length)return;e.forEach((e=>{e===t?(e.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(vy.STATE_SANKEY_EMPHASIS),e.addState(vy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;const i=t.getDatum(),s=this._nodeMark.getProductElements();if(!s||!s.length)return;const n=this._linkMark.getProductElements();if(n&&n.length){if("source"==((null===(e=n[0].getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[i.key],e=[];if(n.forEach(((n,r)=>{var a,o,l,h;const d=n.getDatum(),c=(null==d?void 0:d.parents)?"parents":"source";if(Ra(d[c]).includes(i.key)){if(e.includes(null!==(a=d.key)&&void 0!==a?a:d.index)||e.push(null!==(o=d.key)&&void 0!==o?o:d.index),t.includes(d.source)||t.push(d.source),!t.includes(d.target)){t.push(d.target);let i=s.find((t=>t.data[0].key===d.target)).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.target))){t.push(i.target);const e=s.find((t=>t.data[0].key===i.target));n.push(e.data[0].targetLinks)}})),void(i=n)}}}else if(d.target===i.key&&(e.includes(null!==(l=d.key)&&void 0!==l?l:d.index)||e.push(null!==(h=d.key)&&void 0!==h?h:d.index),!t.includes(d.source))){t.push(d.source);let i=s.find((t=>t.data[0].key===d.source)).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.source))){t.push(i.source);const e=s.find((t=>t.data[0].key===i.source));n.push(e.data[0].targetLinks)}})),void(i=n)}}})),this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,i)=>{var s;e.includes(null!==(s=t.getDatum().key)&&void 0!==s?s:t.getDatum().index)?(t.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(vy.STATE_SANKEY_EMPHASIS)):(t.removeState(vy.STATE_SANKEY_EMPHASIS),t.addState(vy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}else{const t=[i.key],e=i.targetLinks.reduce(((t,e)=>(Ra(e.datum).forEach((e=>{const s=e.parents,n=s.length;for(let r=0;rt.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);n.forEach(((s,n)=>{const r=s.getDatum(),a=(null==r?void 0:r.parents)?"parents":"source",o=r.datum,l=o?o.filter((t=>t[a].some((t=>t.key===i.key)))):null,h=e.find((t=>t.source===r.source&&t.target===r.target));if(l&&l.length){t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target);const e=l.reduce(((t,e)=>t+e.value),0)/r.value;return s.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(vy.STATE_SANKEY_EMPHASIS),void s.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:e})}if(h)return t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target),s.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(vy.STATE_SANKEY_EMPHASIS),void s.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:h.value/r.value});s.removeState(vy.STATE_SANKEY_EMPHASIS),s.addState(vy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}this._needClear=!0}},this._handleLinkRelatedClick=t=>{var e;const i=this._nodeMark.getProductElements();if(!i||!i.length)return;const s=this._linkMark.getProductElements();if(s&&s.length){if("source"==((null===(e=t.getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[vy.STATE_SANKEY_EMPHASIS,vy.STATE_SANKEY_EMPHASIS_REVERSE];this._linkMark&&s.forEach((e=>{e.removeState(t)})),this._nodeMark&&i.forEach((e=>{e.removeState(t)}))}else{const e=t.getDatum(),n=[e.source,e.target],r=[];Ra(e.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;st.source===i&&t.target===n));r.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=a:r.push({source:i,target:n,value:a})}})),s.forEach((t=>{const i=t.getDatum(),s=i.datum;if(i.source===e.source&&i.target===e.target)return t.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),void t.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:1});const a=s?s.filter((t=>{const i=t.parents.map((t=>t.key));return i.includes(e.source)&&i.includes(e.target)})):null;if(a&&a.length){n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target);const s=a.filter((t=>t.parents.some(((i,s)=>{var n;return i.key===e.source&&(null===(n=t.parents[s+1])||void 0===n?void 0:n.key)===e.target})))).reduce(((t,e)=>t+e.value),0),r=s/i.value;return t.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(vy.STATE_SANKEY_EMPHASIS),void t.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:r})}const o=r.find((t=>t.source===i.source&&t.target===i.target));if(o)return n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target),t.removeState(vy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(vy.STATE_SANKEY_EMPHASIS),void t.addState(vy.STATE_SANKEY_EMPHASIS,{ratio:o.value/i.value});t.removeState(vy.STATE_SANKEY_EMPHASIS),t.addState(vy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._highLightElements(i,n)}this._needClear=!0}}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){var t,e,i,s;super.initData();const n=this.getViewData(),r=this.getRawData();if(r&&n){Ap(this._dataSet,"sankeyLayout",yN),Ap(this._dataSet,"sankeyFormat",vN),r.transform({type:"sankeyFormat"},!1),n.transform({type:"sankeyLayout",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this.direction,nodeAlign:null!==(t=this._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(e=this._spec.nodeGap)&&void 0!==e?e:8,nodeWidth:null!==(i=this._spec.nodeWidth)&&void 0!==i?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(s=this._spec.minNodeHeight)&&void 0!==s?s:4,minLinkHeight:this._spec.minLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer,dropIsolatedNode:this._spec.dropIsolatedNode,nodeHeight:this._spec.nodeHeight,linkHeight:this._spec.linkHeight,equalNodeHeight:this._spec.equalNodeHeight,linkOverlap:this._spec.linkOverlap,inverse:this._spec.inverse},level:Fp.sankeyLayout});const{dataSet:a}=this._option;Ap(a,"sankeyNodes",bN),Ap(a,"flatten",hH);const o=new R(a,{name:`sankey-node-${this.id}-data`});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyNodes"}),o.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),o.transform({type:"addVChartProperty",options:{beforeCall:JT.bind(this),call:QT}},!1),this._nodesSeriesData=new KT(this._option,o),Ap(a,"sankeyLinks",xN);const l=new R(a,{name:`sankey-link-${this.id}-data`});l.parse([this.getViewData()],{type:"dataview"}),l.transform({type:"sankeyLinks"}),l.transform({type:"addVChartProperty",options:{beforeCall:JT.bind(this),call:QT}},!1),this._linksSeriesData=new KT(this._option,l)}}initMark(){var t,e,i,s;const n=this._createMark(RN.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData.getDataView(),dataProductId:this._nodesSeriesData.getProductId(),customShape:null===(t=this._spec.node)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.node)||void 0===e?void 0:e.stateSort});n&&(n.setZIndex(this._nodeLayoutZIndex),this._nodeMark=n);const r=this._createMark(RN.mark.link,{dataView:this._linksSeriesData.getDataView(),dataProductId:this._linksSeriesData.getProductId(),customShape:null===(i=this._spec.link)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.link)||void 0===s?void 0:s.stateSort});r&&(this._linkMark=r)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){const e=this._nodesSeriesData.getLatestData(),i=Ra(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.getLatestData(),i=Ra(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;const i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},vy.STATE_NORMAL,Ly.Mark),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.node.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByNode},"normal",Ly.User_Mark))}_initLinkMarkStyle(){var t,e;const i=this._linkMark;i&&(this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness,direction:this.direction},vy.STATE_NORMAL,Ly.Series),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.link.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByLink},"normal",Ly.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setZIndex(this._labelLayoutZIndex)}_createText(t,e){if(P(t)||P(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=IE(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),CL("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(TL(null===(s=$l.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),CL("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData.getDataView())||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData.getDataView())||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:zd.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodesSeriesData.updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linksSeriesData.updateData()}_highLightElements(t,e){t&&t.length&&t.forEach((t=>{t.removeState([vy.STATE_SANKEY_EMPHASIS_REVERSE,vy.STATE_SANKEY_EMPHASIS]),e.includes(t.getDatum().key)||t.addState(vy.STATE_SANKEY_EMPHASIS_REVERSE)}))}initTooltip(){this._tooltipHelper=new SN(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!P(a[0])||(a=this.getNodeList(),a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new tx;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{i.add(t[e]),t.children&&this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{M(t[i])&&e.add(t[i]),M(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return fN(t,r.nodes,this._seriesField),Array.from(t)}return n}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}getMarkData(t){return t.datum?y(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}RN.type=_l.sankey,RN.transformerConstructor=ON,RN.mark=DN;const IN=()=>{pc.registerTransform("sankey",{transform:_N,markPhase:"beforeJoin"},!0),fO(),pc.registerGlyph("linkPath",{back:"path",front:"path"}).registerFunctionEncoder(TN).registerChannelEncoder("backgroundStyle",((t,e)=>({back:e}))).registerDefaultEncoder((()=>({back:{zIndex:0},front:{zIndex:1}}))),pc.registerAnimationType("linkPathGrowIn",CN),pc.registerAnimationType("linkPathGrowOut",LN),pc.registerAnimationType("linkPathUpdate",EN),Uz(),VA(),YA(),$l.registerMark(PN.type,PN),hF(),$l.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:MN(t,e)},fL))),$l.registerAnimation("sankeyLinkPath",((t,e)=>({appear:kN(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))),yL(),$l.registerSeries(RN.type,RN)};class BN extends GD{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,sourceField:t.sourceField,targetField:t.targetField,direction:t.direction,nodeAlign:t.nodeAlign,nodeGap:t.nodeGap,nodeWidth:t.nodeWidth,linkWidth:t.linkWidth,minStepWidth:t.minStepWidth,minNodeHeight:t.minNodeHeight,minLinkHeight:t.minLinkHeight,dropIsolatedNode:t.dropIsolatedNode,nodeHeight:t.nodeHeight,linkHeight:t.linkHeight,equalNodeHeight:t.equalNodeHeight,linkOverlap:t.linkOverlap,iterations:t.iterations,nodeKey:t.nodeKey,linkSortBy:t.linkSortBy,nodeSortBy:t.nodeSortBy,setNodeLayer:t.setNodeLayer,node:t.node,link:t.link,label:t.label,emphasis:t.emphasis,inverse:t.inverse}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class FN extends ZD{constructor(){super(...arguments),this.transformerConstructor=BN,this.type="sankey",this.seriesType=_l.sankey}_setStateInDatum(t,e,i,s,n){const r=y(i)?i[0]:i,a=r?Object.keys(r):null;this.getRegionsInQuerier(n).forEach((i=>{if(!r)return void i.interaction.clearEventElement(t,!0);let n=!1;i.getSeries().forEach((e=>{var o,l;let h=null;e.getMarksWithoutRoot().forEach((o=>{if("text"===o.type)return;let l=null;const d=o.getProduct();d&&((!s||rs(s)&&s(e,o))&&(l=d.elements.find((t=>a.every((e=>{var i;let s=null===(i=t.getDatum())||void 0===i?void 0:i.datum;return y(s)&&(s=s[0]),r[e]==(null==s?void 0:s[e])}))))),l&&(n=!0,i.interaction.startInteraction(t,l),(d.id().includes("node")||d.id().includes("link"))&&(h=l)))})),h&&(null===(l=(o=e)._handleEmphasisElement)||void 0===l||l.call(o,{item:h}))})),e&&n&&i.interaction.reverseEventElement(t)}))}}FN.type="sankey",FN.seriesType=_l.sankey,FN.transformerConstructor=BN;class YN extends VT{getDefaultTooltipPattern(t,e){switch(t){case"mark":case"group":return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"dimension":if(e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},s=[];return e.forEach((({data:t})=>t.forEach((({series:t})=>{"rangeArea"===t.type&&s.push({seriesId:t.id,key:this.markTooltipKeyCallback,value:t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]],hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1})})))),{visible:!0,activeType:t,title:i,content:s}}}return null}}const jN=Object.assign({},rO);class HN extends oO{constructor(){super(...arguments),this.type=_l.rangeArea}initMark(){var t;const{customShape:e,stateSort:i}=null!==(t=this._spec.area)&&void 0!==t?t:{};this._areaMark=this._createMark(HN.mark.area,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:e,stateSort:i})}initMarkStyle(){this.initAreaMarkStyle()}initAreaMarkStyle(){const t=this._areaMark;t&&(super.initAreaMarkStyle(),"horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x1:t=>{if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}},"normal",Ly.Series):this.setMarkStyle(this._areaMark,{y1:t=>{if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}},"normal",Ly.Series),this.setMarkStyle(t,{stroke:!1},"normal",Ly.Series))}initTooltip(){this._tooltipHelper=new YN(this),this._areaMark&&this._tooltipHelper.activeTriggerSet.dimension.add(this._areaMark)}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.fieldY;return!!(t&&t.latestData&&e.length)&&e.every((e=>t.latestData[e]&&t.latestData[e].allValid))}}HN.type=_l.rangeArea,HN.mark=jN;class zN extends UD{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign({},super._getDefaultSeriesSpec(t));return s.area=t.area,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),gy(t)}}class NN extends ZD{constructor(){super(...arguments),this.transformerConstructor=zN,this.type="rangeArea",this.seriesType=_l.rangeArea}}function VN(t){if(t)return t.type===Xh.Band?t.bandwidth():t.type===Xh.Point?t.step():void 0}NN.type="rangeArea",NN.seriesType=_l.rangeArea,NN.transformerConstructor=zN;class WN extends zm{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});const e=this.spec.encode[t];if(e&&"update"===t){const i=this.parameters(),s=zp(e)?null:Object.keys(e).reduce(((t,s)=>(xm(e[s])&&(t[s]=Vp(e[s].scale,i)),t)),{});this._encoders[t]={callback:(t,i,n)=>{const r=Lm(e,t,i,n);if(P(r.size)){const t=s.x?VN(s.x):void 0,e=s.y?VN(s.y):void 0;P(t)&&P(e)?r.size=10:P(t)?r.size=e:P(e)&&(r.size=t),r.size=[t,e]}return P(r.shape)&&(r.shape="rect"),r}}}else this._encoders[t]=e}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}getAttributeTransforms(){return[{channels:["size","padding"],transform:(t,e,i)=>{if(h(i.padding)&&i.padding>0)t.size=y(i.size)?i.size.map((t=>Math.max(t-i.padding,1))):Math.max(i.size-i.padding,1);else if(y(i.padding)&&2===i.padding.length){const e=y(i.size)?i.size:[i.size,i.size];t.size=[Math.max(e[0]-i.padding[0],1),Math.max(e[1]-i.padding[1],1)]}else t.size=i.size},storedAttrs:"paddingAttrs"}].concat(mm.symbol)}release(){super.release(),this._encoders=null}}WN.markType=Xd.cell;class GN extends KL{constructor(){super(...arguments),this.type=GN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{padding:0})}}GN.type="cell";function UN(t){return!1===t?{}:{type:"fadeIn"}}class $N extends VT{getDefaultTooltipPattern(t,e){const i=super.getDefaultTooltipPattern(t,e);return M(i)&&"dimension"===t&&(i.visible=!1),i}}const KN=Object.assign(Object.assign({},iC),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class XN extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class qN extends jL{constructor(){super(...arguments),this.type=_l.heatmap,this.transformerConstructor=XN}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Ra(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._cellMark=this._createMark(qN.mark.cell,{morph:PL(this._spec,qN.mark.cell.name),defaultMorphElementKey:this.getDimensionField()[0],isSeriesMark:!0,progressive:n,customShape:null===(t=this._spec.cell)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.cell)||void 0===e?void 0:e.stateSort}),this._backgroundMark=this._createMark(qN.mark.cellBackground,{progressive:n,customShape:null===(i=this._spec.cellBackground)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.cellBackground)||void 0===s?void 0:s.stateSort})}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",Ly.Series)}initCellBackgroundMarkStyle(){var t,e,i;const s=dP(null!==(i=null===(e=null===(t=this._spec.cellBackground)||void 0===t?void 0:t.style)||void 0===e?void 0:e.padding)&&void 0!==i?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+s[0]},width:()=>this.getCellSize(this._xAxisHelper)-s[1]-s[3],height:()=>this.getCellSize(this._yAxisHelper)-s[0]-s[2]},"normal",Ly.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}initInteraction(){this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=YL(this);this._cellMark.setAnimationConfig(TL(null===(i=$l.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),CL("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new $N(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}qN.type=_l.heatmap,qN.mark=KN,qN.transformerConstructor=XN;const ZN=()=>{hF(),$l.registerMark(GN.type,GN),yx(),Nv(),IA(),pc.registerGraphic(Xd.cell,wv),pc.registerMark(Xd.cell,WN),$l.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},fL),{appear:UN(e)}))),RD(),ND(),$l.registerSeries(qN.type,qN)};class JN extends UD{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{valueField:t.valueField,cell:t.cell})}}class QN extends ZD{constructor(){super(...arguments),this.transformerConstructor=JN,this.type="heatmap",this.seriesType=_l.heatmap}}QN.type="heatmap",QN.seriesType=_l.heatmap,QN.transformerConstructor=JN;const tV=Object.assign(Object.assign({},iC),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),eV=(t,e)=>{const i=rs(e)?e:t=>t;let s,n;if(t&&t.length){const e=t.length;for(let r=0;r{var i,s,n,r,a,o,l,d,c,u,p,g,m,_,f;if(!t||!(null==e?void 0:e.view)||!y(t))return t;const v=e.view();if(v.x1-v.x0==0||v.y1-v.y0==0||v.x1-v.x0==-1/0||v.x1-v.x0==1/0||v.y1-v.y0==-1/0||v.y1-v.y0==1/0)return t;const b=At(null!==(i=e.startAngle)&&void 0!==i?i:-90),x=At(null!==(s=e.endAngle)&&void 0!==s?s:270),S=Math.max((v.x1-v.x0)/2,(v.y1-v.y0)/2),M=cH(null!==(n=e.innerRadius)&&void 0!==n?n:0,S),k=cH(e.outerRadius,S),A=[h(null===(r=e.center)||void 0===r?void 0:r[0])?e.center[0]:v.x0+cH(null!==(o=null===(a=e.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",v.x1-v.x0),h(null===(l=e.center)||void 0===l?void 0:l[1])?e.center[1]:v.y0+cH(null!==(c=null===(d=e.center)||void 0===d?void 0:d[1])&&void 0!==c?c:"50%",v.y1-v.y0)],w=Tm(e.field),T=t.map(w),[C,L]=eV(T),E=C===L?t=>(M+k)/2:t=>M+(k-M)*(t-C)/(L-C),D=P(e.radiusField)?w:Tm(e.radiusField),O=null!==(p=null===(u=null==e?void 0:e.radiusRange)||void 0===u?void 0:u[1])&&void 0!==p?p:5;let R=t=>O;if(D){const[i,s]=D!==w?eV(t.map(D)):[C,L],n=null!==(m=null===(g=e.radiusRange)||void 0===g?void 0:g[0])&&void 0!==m?m:5,r=null!==(f=null===(_=e.radiusRange)||void 0===_?void 0:_[1])&&void 0!==f?f:5;i!==s&&(R=t=>n+(r-n)*(D(t)-i)/(s-i))}const I=Math.min(b,x),B=Math.max(b,x),F=aV(I,B,t.length),Y=[],j=(B-I)/60;return t.forEach(((t,e)=>{const i=E(T[e]),s=R(t);let n,r,a=F[e];for(let t=0;t<60&&(n=A[0]+i*Math.cos(a),r=A[1]+i*Math.sin(a),oV({x:n,y:r,size:s},Y)||n-sv.x1||r-sv.y1);t++)t<59&&(a+=j,a>B?a=I:a{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const d=[];let c=t;for(;l=2&&(r/=2,n*=2));return d},oV=(t,e)=>!(!e||!e.length)&&e.some((e=>Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2){if(!t||!y(t))return[];const{keyword:i,categoryField:s}=e,n=t[0].latestData[0];return{[s]:i,[mT]:null==n?void 0:n[mT],[fT]:null==n?void 0:n[fT]}};class hV extends mx{constructor(){super(...arguments),this.type=hV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.glyph("ripplePoint",null!=t?t:e.rootMark).id(i),this._compiledProductId=i}}hV.type="ripple";const dV=()=>{$l.registerMark(hV.type,hV),pc.registerGlyph("ripplePoint",{symbol:"symbol",ripple0:"symbol",ripple1:"symbol",ripple2:"symbol"}).registerFunctionEncoder(((t,e,i,s)=>{var n;const r=Math.max(0,Math.min(t.ripple,1)),a=null!==(n=t.size)&&void 0!==n?n:i.getGraphicAttribute("size"),o=.5*a;return{ripple0:{size:a+o*r,fillOpacity:.75-.25*r},ripple1:{size:a+o*(1+r),fillOpacity:.5-.25*r},ripple2:{size:a+o*(2+r),fillOpacity:.25-.25*r}}})).registerDefaultEncoder((()=>({ripple0:{fillOpacity:.75},ripple1:{fillOpacity:.5},ripple2:{fillOpacity:.25}}))),Uz(),VA(),zA()},cV=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class uV extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class pV extends NI{constructor(){super(...arguments),this.type=_l.correlation,this.transformerConstructor=uV,this._viewBox=new It}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){M(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){M(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){var t,e,i;if(super.initData(),!this._data)return;Ap(this._dataSet,"correlation",rV);const s=new f;wp(s,"dataview",b),Ap(s,"correlationCenter",lV);const n=new R(s,{name:`${this.type}_${this.id}_center`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"correlationCenter",options:{keyword:null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new KT(this._option,n)}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){var t,e,i,s;const n=this._createMark(pV.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:mT,customShape:null===(t=this._spec.nodePoint)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.nodePoint)||void 0===e?void 0:e.stateSort});n&&(n.setZIndex(Ty.Node),this._nodePointMark=n);const r=this._createMark(pV.mark.ripplePoint,{key:mT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});r&&(this._ripplePointMark=r);const a=this._createMark(pV.mark.centerPoint,{key:mT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId(),customShape:null===(i=this._spec.centerPoint)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.centerPoint)||void 0===s?void 0:s.stateSort});a&&(a.setZIndex(Ty.Node),this._centerPointMark=a)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;const n=this._nodePointMark;if(!n)return;const r=null!==(e=null===(t=this._spec.nodePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(n,{x:t=>t[iV],y:t=>t[sV],size:t=>t[nV],fill:null!==(i=r.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(s=r.fillOpacity)&&void 0!==s?s:1,lineWidth:0},vy.STATE_NORMAL,Ly.Series)}_initRipplePointMarkStyle(){var t,e,i,s,n;const r=this._ripplePointMark;if(!r)return;const a=null!==(e=null===(t=this._spec.ripplePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(r,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=a.fill)&&void 0!==i?i:this.getColorAttribute(),opacity:null!==(s=a.fillOpacity)&&void 0!==s?s:.2,ripple:null!==(n=a.ripple)&&void 0!==n?n:0},vy.STATE_NORMAL,Ly.Series)}_initCenterPointMarkStyle(){var t,e,i,s,n,r;const a=this._centerPointMark;a&&this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=null===(e=null===(t=this._spec.centerPoint)||void 0===t?void 0:t.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(r=null===(n=null===(s=this._spec.centerPoint)||void 0===s?void 0:s.style)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1},vy.STATE_NORMAL,Ly.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},vy.STATE_NORMAL,Ly.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),CL("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}pV.type=_l.correlation,pV.mark=tV,pV.transformerConstructor=uV;class gV extends GD{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,sizeField:t.sizeField,sizeRange:t.sizeRange,centerX:t.centerX,centerY:t.centerY,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,ripplePoint:t.ripplePoint,centerPoint:t.centerPoint,centerLabel:t.centerLabel,nodePoint:t.nodePoint,label:t.label}),i=_l.correlation;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class mV extends ZD{constructor(){super(...arguments),this.transformerConstructor=gV,this.type="correlation",this.seriesType=_l.correlation}}mV.type="correlation",mV.seriesType=_l.correlation,mV.transformerConstructor=gV;class _V extends zD{constructor(){super(...arguments),this.type=r.cartesianTimeAxis,this._zero=!1,this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),uE(this._regions,(t=>{Md(this.getOrient())?t.setXAxisHelper(this.axisHelper()):t.setYAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._tick=Tl({},this._spec.tick,null===(t=this._spec.layers)||void 0===t?void 0:t[0])}_initData(){var t;if(super._initData(),null===(t=this._spec.layers)||void 0===t?void 0:t[1]){const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_layer_1_ticks`}).parse(this._scale,{type:"scale"}).transform({type:`${this.type}-ticks`,options:Object.assign(Object.assign({},this._tickTransformOption()),{tickCount:this._spec.layers[1].tickCount,forceTickCount:this._spec.layers[1].forceTickCount,tickStep:this._spec.layers[1].tickStep})},!1);this._layerTickData=new dx(this._option,t)}}computeData(t){super.computeData(t),this._layerTickData&&(this._layerTickData.getDataView().reRunAllTransform(),this._layerTickData.updateData())}_getLabelFormatMethod(){var t,e,i,s,n,r,a,o;const l=JB.getInstance(),h=(null===(e=null===(t=this._spec.layers)||void 0===t?void 0:t[1])||void 0===e?void 0:e.timeFormat)||"%Y%m%d",d="local"===((null===(s=null===(i=this._spec.layers)||void 0===i?void 0:i[1])||void 0===s?void 0:s.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat,c=(null===(r=null===(n=this._spec.layers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.timeFormat)||"%Y%m%d",u="local"===((null===(o=null===(a=this._spec.layers)||void 0===a?void 0:a[0])||void 0===o?void 0:o.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat;return(t,e,i,s,n)=>{var r;let a;return a=0===n?u(c,t):d(h,t),(null===(r=this._spec.label)||void 0===r?void 0:r.formatMethod)?this._spec.label.formatMethod(a,e):a}}getLabelItems(t){var e,i;const s=[],n=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();n&&n.length&&s.push(n.map((e=>WE(e.value,this._getNormalizedValue([e.value],t)))));const r=null===(i=this._layerTickData)||void 0===i?void 0:i.getLatestData();return r&&r.length&&s.push(r.map((e=>WE(e.value,this._getNormalizedValue([e.value],t))))),s}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,jD),t}transformScaleDomain(){}}_V.type=r.cartesianTimeAxis,_V.specKey="axes";class fV{nice(t=10,e){var i,s,n,r;const a=this._domain;let o=[],l=null;if(e){const t=Db(a,e);if(o=t.niceMinMax,this._domainValidator=t.domainValidator,l=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else l="all";if(l){const t=((t,e)=>{const i=t.slice();let s=0,n=i.length-1,r=i[s],a=i[n];return aMath.floor(t),ceil:t=>Math.ceil(t)});return"min"===l?t[t.length-1]=null!==(n=o[1])&&void 0!==n?n:t[t.length-1]:"max"===l&&(t[0]=null!==(r=o[0])&&void 0!==r?r:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function vV(t){return e=>-t(-e)}function yV(t=Number.EPSILON){return e=>Math.max(e,t)}class bV extends Ub{constructor(){super(hb(10),lb(10)),this.type=Xh.Log,this._limit=yV(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new bV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=hb(this._base),s=lb(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=vV(i),this._pows=vV(s),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=rb,this.untransformer=ab):(this._logs=i,this._pows=s,this._limit=yV(),this.transformer=this._logs,this.untransformer=s),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return ib}d3Ticks(t=10,e){const i=this.domain(),s=this._limit(i[0]),n=this._limit(i[i.length-1]);return Rb(s,n,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Ib(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Bb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Bb(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}XA(bV,fV);class xV extends zD{constructor(){super(...arguments),this.type=r.cartesianLogAxis,this._zero=!1,this._scale=new bV}initScales(){var t;super.initScales(),this._scale.base(null!==(t=this._spec.base)&&void 0!==t?t:10),this._scale.clamp(!0,null,!1)}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,jD),t}transformScaleDomain(){}}xV.type=r.cartesianLogAxis,xV.specKey="axes",XA(xV,YD);class SV extends $b{constructor(){super(db(1),cb(1)),this.type=Xh.Symlog,this._const=1}clone(){return(new SV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=db(t),this.untransformer=cb(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const i=this.domain(),s=i[0],n=i[i.length-1];return Rb(s,n,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Ib(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Bb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Bb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}XA(SV,fV);class MV extends zD{constructor(){super(...arguments),this.type=r.cartesianSymlogAxis,this._zero=!1,this._scale=new SV}initScales(){var t;super.initScales(),this._scale.constant(null!==(t=this._spec.constant)&&void 0!==t?t:10)}registerTicksTransform(){const t=`${this.type}-ticks`;return Ap(this._option.dataSet,t,jD),t}transformScaleDomain(){}}function kV(t){var e,i;const s=Object.assign({},t);return Im(t.style)||(s.textStyle=OE(t.style)),Im(t.textStyle)||Tl(s.textStyle,OE(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&OE(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&OE(s.background.style),s}MV.type=r.cartesianSymlogAxis,MV.specKey="axes",XA(MV,YD);class AV extends Pk{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute,s=dP(i),n=Gr.group({x:s[3],y:s[0],pickable:t,childrenPickable:t});n.name=lT.innerView,this.add(n),this._innerView=n,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const r=this._innerView.AABBBounds;this.attribute.width=r.width()+s[1]+s[3],this.attribute.height=r.height()+s[0]+s[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:s=0,background:n,minWidth:r,maxWidth:a,shape:o}=t,l={x:0,y:0,text:e,textStyle:i,padding:dP(s),minWidth:r,maxWidth:a};o&&o.visible&&(l.shape=Object.assign({visible:!0},o.style),M(o.space)&&(l.space=o.space)),n&&n.visible&&(l.panel=Object.assign({visible:!0},n.style));const h=new SP(l);h.name=lT.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}function wV(){h_(),Nv(),of()}const TV={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};wV();class CV extends Pk{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},CV.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current{let[s,n]=t;n=i-e?[e,i]:(s=Math.min(Math.max(s,e),i-r),[s,s+r])},OV={debounce:Uo,throttle:Ud};EV();class RV extends Pk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},RV.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:e,viewY:i}=t,{direction:s,width:n,height:r,range:a}=this.attribute,o=this._sliderSize,[l,h]=this._getScrollRange();let d;if("vertical"===s){const t=i-this._viewPosition.y,e=vs(t-o/2,l,h);d=t/r,this._slider.setAttribute("y",e,!0)}else{const t=e-this._viewPosition.x,i=vs(t-o/2,l,h);d=t/n,this._slider.setAttribute("x",i,!0)}this.setScrollRange([d-(a[1]-a[0])/2,d+(a[1]-a[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{const{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();const{direction:i}=this.attribute,{x:s,y:n}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?s:n,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===jo.env?(jo.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),jo.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute,{x:i,y:s}=this.stage.eventPointTransform(t);let n,r,a=0;const{width:o,height:l}=this._getSliderRenderBounds();return"vertical"===e?(r=s,a=r-this._prePos,n=a/l):(r=i,a=r-this._prePos,n=a/o),[r,n]},this._onSliderPointerMove=t=>{const{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();const i=this.getScrollRange(),[s,n]=this._computeScrollValue(t);this.setScrollRange([i[0]+n,i[1]+n],!0),this._prePos=s},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:OV[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:e=!0,range:i,limitRange:s=[0,1]}=this.attribute,n=this.getScrollRange(),[r,a]=this._computeScrollValue(t),o=[n[0]+a,n[1]+a];this._dispatchEvent("scrollUp",{pre:i,value:DV(o,s[0],s[1])}),"browser"===jo.env?(jo.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),jo.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){const{direction:i="horizontal",limitRange:s=[0,1],range:n,realTime:r=!0}=this.attribute,a=DV(t,s[0],s[1]);if(e){const t=this._getSliderPos(a);if(this._slider){const e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=a,r&&this._dispatchEvent("scrollDrag",{pre:n,value:a})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",OV[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:s,limitRange:n=[0,1],railStyle:r,sliderStyle:a,padding:o=2}=this.attribute,l=this.createOrUpdateChild("scrollbar-container",{},"group"),h=l.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},r),"rect");this._rail=h;const d=this._getSliderRenderBounds(),c=this._getSliderPos(DV(s,n[0],n[1])),u=c[1]-c[0];let p;this._sliderSize=u,p="horizontal"===t?{x:c[0],y:d.y1,width:u,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:u};const g=l.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},p),{cornerRadius:this._getDefaultSliderCornerRadius()}),a),{boundsPadding:dP(o),pickMode:"imprecise"}),"rect");this._slider=g,this._container=l;const m=this._container.AABBBounds;this._viewPosition={x:m.x1,y:m.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[s,n,r,a]=dP(i),o={x1:a,y1:s,x2:t-n,y2:e-r,width:Math.max(0,t-(a+n)),height:Math.max(0,e-(s+r))};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:s,x1:n,y1:r}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[s*t[0]+r,s*t[1]+r]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,s]=DV(t,0,1),{width:n,height:r,x1:a,y1:o}=this._getSliderRenderBounds(),l=this._sliderSize;return"horizontal"===e?DV([a+i*n,a+s*n],a,n-l):DV([o+i*r,o+s*r],o,r-l)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}RV.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};var IV=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=t.target;if(e&&e.name&&e.name.startsWith(lT.item)){const i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,s,n;const r=t.target;if(r&&r.name&&r.name.startsWith(lT.item)){const a=r.delegate,{selectMode:o="multiple"}=this.attribute;if(r.name===lT.focus||"focus"===o){const s=a.hasState(aT.focus);a.toggleState(aT.focus),s?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{this._removeLegendItemState(e,[aT.unSelected,aT.unSelectedHover,aT.focus],t),this._setLegendItemState(e,aT.selected,t)})):(this._setLegendItemState(a,aT.selected,t),this._removeLegendItemState(a,[aT.unSelected,aT.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[aT.selected,aT.selectedHover,aT.focus],t),this._setLegendItemState(e,aT.unSelected,t))})))}else{null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((t=>{t.removeState(aT.focus)}));const{allowAllCanceled:e=!0}=this.attribute,i=a.hasState(aT.selected),r=this._getSelectedLegends();if("multiple"===o){if(!1===e&&i&&1===r.length)return void this._dispatchLegendEvent(oT.legendItemClick,a,t);i?(this._removeLegendItemState(a,[aT.selected,aT.selectedHover],t),this._setLegendItemState(a,aT.unSelected,t)):(this._setLegendItemState(a,aT.selected,t),this._removeLegendItemState(a,[aT.unSelected,aT.unSelectedHover],t))}else this._setLegendItemState(a,aT.selected,t),this._removeLegendItemState(a,[aT.unSelected,aT.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[aT.selected,aT.selectedHover],t),this._setLegendItemState(e,aT.unSelected,t))}))}this._dispatchLegendEvent(oT.legendItemClick,a,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((e=>{const i=e.data;t.includes(i.label)?(this._setLegendItemState(e,aT.selected),this._removeLegendItemState(e,[aT.unSelected,aT.unSelectedHover])):(this._removeLegendItemState(e,[aT.selected,aT.selectedHover]),this._setLegendItemState(e,aT.unSelected))}))}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:s,maxHeight:n,defaultSelected:r,lazyload:a,autoPage:o}=this.attribute,{spaceCol:l=sT,spaceRow:h=nT}=t,d=this._itemsContainer,{items:c,isHorizontal:u,startIndex:p,isScrollbar:g}=this._itemContext,m=g?1:u?i:e;let _,{doWrap:f,maxWidthInCol:v,startX:b,startY:x,pages:S}=this._itemContext,k=0;for(let t=p,e=c.length;tthis._itemContext.currentPage*m);t++){a&&(this._itemContext.startIndex=t+1),_=c[t],_.id||(_.id=_.label),_.index=t;let e=!0;y(r)&&(e=r.includes(_.label));const i=this._renderEachItem(_,e,t,c),p=i.attribute.width,m=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,m),v=Math.max(p,v),this._itemMaxWidth=Math.max(p,this._itemMaxWidth),u?(M(s)&&(g&&o?(S=Math.ceil((b+p)/s),f=S>1):b+p>s&&(f=!0,b>0&&(S+=1,b=0,x+=m+h))),0===b&&0===x||i.setAttributes({x:b,y:x}),b+=l+p):(M(n)&&(g&&o?(S=Math.ceil((x+m)/n),f=S>1):n<=m?(S+=1,f=!0,x=0,t>0&&(b+=k+l)):nthis._itemContext.maxPages&&(g=this._renderPagerComponent()),g||(r.setAttribute("y",this._title?this._title.AABBBounds.height()+Gd(this.attribute,"title.space",8):0),this._innerView.add(r))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_autoEllipsis(t,e,i,s){var n,r;const{label:a,value:o}=this.attribute.item,l=s.AABBBounds,h=i.AABBBounds,d=l.width(),c=h.width();let u=!1;"labelFirst"===t?c>e?u=!0:s.setAttribute("maxLineWidth",e-c):"valueFirst"===t?d>e?u=!0:i.setAttribute("maxLineWidth",e-d):d+c>e&&(u=!0),u&&(s.setAttribute("maxLineWidth",Math.max(e*(null!==(n=a.widthRatio)&&void 0!==n?n:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(r=o.widthRatio)&&void 0!==r?r:.5),e-d)))}_renderEachItem(t,e,i,s){var n,r;const{id:a,label:o,value:l,shape:h}=t,{padding:d=0,focus:c,focusIconStyle:u,align:p,autoEllipsisStrategy:g}=this.attribute.item,{shape:m,label:_,value:f,background:v}=this.attribute.item,b=this._handleStyle(m,t,e,i,s),x=this._handleStyle(_,t,e,i,s),S=this._handleStyle(f,t,e,i,s),k=this._handleStyle(v,t,e,i,s),A=dP(d);let w;!1===v.visible?(w=Gr.group({x:0,y:0,cursor:null===(n=k.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(w,lT.item,t,w)):(w=Gr.group(Object.assign({x:0,y:0},k.style)),this._appendDataToShape(w,lT.item,t,w,k.state)),w.id=`${null!=a?a:o}-${i}`,w.addState(e?aT.selected:aT.unSelected);const T=Gr.group({x:0,y:0,pickable:!1});w.add(T);let C,L=0,E=0,D=0;if(m&&!1!==m.visible){const i=Gd(b,"style.size",10);E=y(i)?i[0]||0:i,D=Gd(m,"space",8);const s=Gr.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),b.style));Object.keys(b.state||{}).forEach((t=>{const e=b.state[t].fill||b.state[t].stroke;h.fill&&P(b.state[t].fill)&&e&&(b.state[t].fill=e),h.stroke&&P(b.state[t].stroke)&&e&&(b.state[t].stroke=e)})),this._appendDataToShape(s,lT.itemShape,t,w,b.state),s.addState(e?aT.selected:aT.unSelected),T.add(s)}let O=0;if(c){const e=Gd(u,"size",10);C=Gr.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0},u),{visible:!0,pickMode:"imprecise",boundsPadding:A})),this._appendDataToShape(C,lT.focus,t,w),O=e}const R=_.formatMethod?_.formatMethod(o,t,i):o,I=Qk(Object.assign(Object.assign({x:E/2+D,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(r=x.style)||void 0===r?void 0:r.fontSize},x.style),{text:R,_originText:_.formatMethod?o:void 0}));this._appendDataToShape(I,lT.itemLabel,t,w,x.state),I.addState(e?aT.selected:aT.unSelected),T.add(I);const B=Gd(_,"space",8);if(M(l)){const s=Gd(f,"space",c?8:0),n=f.formatMethod?f.formatMethod(l,t,i):l,r=Qk(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:S.style.fontSize},S.style),{text:n,_originText:f.formatMethod?l:void 0}));if(this._appendDataToShape(r,lT.itemValue,t,w,S.state),r.addState(e?aT.selected:aT.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-A[1]-A[3]-E-D-B-O-s;this._autoEllipsis(g,t,I,r),f.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-E/2-A[1]-A[3]-O-s}):r.setAttribute("x",s+(I.AABBBounds.empty()?0:I.AABBBounds.x2))}else r.setAttribute("x",s+(I.AABBBounds.empty()?0:I.AABBBounds.x2));L=s+(r.AABBBounds.empty()?0:r.AABBBounds.x2),T.add(r)}else this._itemWidthByUser?(I.setAttribute("maxLineWidth",this._itemWidthByUser-A[1]-A[3]-E-D-O),L=B+(I.AABBBounds.empty()?0:I.AABBBounds.x2)):L=B+(I.AABBBounds.empty()?0:I.AABBBounds.x2);C&&(C.setAttribute("x",L),T.add(C));const F=T.AABBBounds,Y=F.width();if("right"===p){const t=F.x2,e=F.x1;T.forEachChildren(((i,s)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===C?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)}))}const j=F.height(),H=M(this.attribute.item.width)?this.attribute.item.width:Y+A[1]+A[3],z=this._itemHeightByUser||j+A[0]+A[2];return w.attribute.width=H,w.attribute.height=z,C&&C.setAttribute("visible",!1),T.translateTo(-F.x1+A[3],-F.y1+A[0]),w}_createPager(t){var e,i;const{disableTriggerEvent:s,maxRow:n}=this.attribute,r=t=>t<=99?99:t<=999?999:9999;return this._itemContext.isHorizontal?new CV(Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:r(this._itemContext.pages)},E({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:s})):new CV(Object.assign({layout:"horizontal",total:r(this._itemContext.pages),disableTriggerEvent:s,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new RV(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12},t),{width:e})):new RV(Object.assign(Object.assign({direction:"vertical",width:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i,s,n){const{maxHeight:r,pager:a}=this.attribute,{totalPage:o,isHorizontal:l}=this._itemContext,h=a&&a.position||"middle";if(this._pagerComponent.setTotal(o),l){let e;e="start"===h?i:"end"===h?i+n-this._pagerComponent.AABBBounds.height()/2:i+n/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:t,y:e})}else{let t;t="start"===h?0:"end"===h?s-this._pagerComponent.AABBBounds.width():(s-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:r-this._pagerComponent.AABBBounds.height()})}}_updatePositionOfScrollbar(t,e,i){const{currentPage:s,totalPage:n,isHorizontal:r}=this._itemContext;this._pagerComponent.setScrollRange([(s-1)/n,s/n]),r?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:s=!0,animationDuration:n=450,animationEasing:r="quadIn"}=i,a=this._itemContext.isScrollbar?t=>{const{value:e}=t.detail;let s=e[0]*this._itemContext.totalPage;return i.scrollByPosition?s+=1:s=Math.floor(s)+1,s}:t=>t.detail.current,o=i=>{const o=a(i);if(o!==this._itemContext.currentPage){if(this._itemContext.currentPage=o,this._itemContext&&this._itemContext.startIndex{const{width:i,height:s}=t.attribute;f0&&t.setAttributes({x:y,y:b}),y+=o+i})),this._itemContext.startX=y,this._itemContext.startY=b,this._itemContext.pages=x;const i=Math.ceil(x/n);this._itemContext.totalPage=i,this._updatePositionOfPager(f,v,t,m,_)}else{if(m=this._itemMaxWidth*s+(s-1)*o,_=i,f=m,g=this._createPager(u),this._pagerComponent=g,this._innerView.add(g),v=i-g.AABBBounds.height()-d-t,v<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;v0&&t.setAttributes({x:y,y:b}),b+=l+i}));const e=Math.ceil(x/s);this._itemContext.totalPage=e,this._updatePositionOfPager(f,v,t,m,_)}c>1&&(p?h.setAttribute("y",-(c-1)*(_+l)):h.setAttribute("x",-(c-1)*(m+o)));const S=Gr.group({x:0,y:t,width:p?f:m,height:p?_:v,clip:!0,pickable:!1});return S.add(h),this._innerView.add(S),this._bindEventsOfPager(p?_+l:m+o,p?"y":"x"),!0}_renderScrollbar(){const t=this._title?this._title.AABBBounds.height()+Gd(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,item:s={},pager:n={}}=this.attribute,{spaceCol:r=sT,spaceRow:a=nT}=s,o=this._itemsContainer,{space:l=rT,defaultCurrent:h=1}=n,d=IV(n,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext;let u,p=0,g=0,m=0,_=0,f=1;if(c)p=e,g=e,m=this._itemHeight,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),this._updatePositionOfScrollbar(g,m,t);else{if(p=i,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),m=i-t,g=this._itemMaxWidth,m<=0)return this._innerView.removeChild(u),!1;o.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;f=Math.floor((_+i)/m)+1,_+=a+i})),this._itemContext.totalPage=f,this._itemContext.pages=f,this._updatePositionOfScrollbar(g,m,t)}h>1&&(c?o.setAttribute("x",-(h-1)*(g+r)):o.setAttribute("y",-(h-1)*(m+a)));const v=Gr.group({x:0,y:t,width:g,height:m,clip:!0,pickable:!1});return v.add(o),this._innerView.add(v),this._bindEventsOfPager(c?g:m,c?"x":"y"),!0}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(aT.selected)?this._setLegendItemState(t,aT.selectedHover,e):this._setLegendItemState(t,aT.unSelectedHover,e);const i=t.getChildren()[0].find((t=>t.name===lT.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(oT.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(aT.unSelectedHover)||t.hasState(aT.selectedHover))&&(i=!0),t.removeState(aT.unSelectedHover),t.removeState(aT.selectedHover),t.getChildren()[0].getChildren().forEach((t=>{i||!t.hasState(aT.unSelectedHover)&&!t.hasState(aT.selectedHover)||(i=!0),t.removeState(aT.unSelectedHover),t.removeState(aT.selectedHover)}));const s=t.getChildren()[0].find((t=>t.name===lT.focus),!1);s&&s.setAttribute("visible",!1),i&&this._dispatchLegendEvent(oT.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(oT.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let s=!1;t.hasState(e)||(s=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach((t=>{t.name!==lT.focus&&(s||t.hasState(e)||(s=!0),t.addState(e,!0))})),s&&this._dispatchLegendEvent(oT.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let s=!1;e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)})),t.getChildren()[0].getChildren().forEach((t=>{t.name!==lT.focus&&e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)}))})),s&&this._dispatchLegendEvent(oT.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((t=>{t.hasState(aT.selected)&&e.push(t.data)})),e}_appendDataToShape(t,e,i,s,n={}){t.name=e,t.data=i,t.delegate=s,t.states=E({},BV,n)}_dispatchLegendEvent(t,e,i){const s=this._getSelectedLegends();s.sort(((t,e)=>t.index-e.index));const n=s.map((t=>t.label));this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(aT.selected),currentSelectedItems:s,currentSelected:n,event:i})}_handleStyle(t,e,i,s,n){const r={};return t.style&&(rs(t.style)?r.style=t.style(e,i,s,n):r.style=t.style),t.state&&(r.state={},Object.keys(t.state).forEach((a=>{t.state[a]&&(rs(t.state[a])?r.state[a]=t.state[a](e,i,s,n):r.state[a]=t.state[a])}))),r}}FV.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:sT,spaceRow:nT,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:rT,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};const YV=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},jV=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l}=e,h=a(),d=l();if(0===h.length&&d.length)return[];if(h.length===d.length)return t;const c={};h.forEach((t=>{c[t]=!0}));const u=null!==(i=o())&&void 0!==i?i:fT;return y(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===c[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===c[t.source]&&!0===c[t.target])))):M(u)&&(t=t.filter((t=>!0===c[r.getSeriesFieldValue(t,u)]))),t};class HV extends qE{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=Ty.Legend,this.layoutLevel=Cy.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{uE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),uE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=Qo(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;M(s)&&(this._seriesUserId=Ra(s)),M(e)&&(this._regionUserId=Ra(e)),M(n)&&(this._seriesIndex=Ra(n)),M(i)&&(this._regionUserIndex=Ra(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(Dm(e,t)||(i.reCompile=!0),i)}changeRegions(t){}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new dx(this._option,t),this._initSelectedData(),uE(this._regions,(t=>{t.event.on(jd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._legendData.getDataView().reRunAllTransform()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;const n=this._selectedData;P(t)||JSON.stringify(n)===JSON.stringify(t)||(uE(this._regions,(e=>{e.legendSelectedFilter&&(t=e.legendSelectedFilter(this,t))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...t],null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(jd.legendSelectedDataChange,{model:this}),null===(s=this._legendComponent)||void 0===s||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;Wo(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)Dm(s,this._cacheAttrs)||this._legendComponent.setAttributes(Tl({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(Tl({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t,this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var t,e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());Dm(t,this._cacheAttrs)||this._legendComponent.setAttributes(Tl({},t,{defaultSelected:this._selectedData}))}null===(e=(t=this.effect).onSelectedDataChange)||void 0===e||e.call(t),null===(i=this.getChart())||void 0===i||i.setLayoutTag(!0,null,!1),this.event.emit(jd.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}HV.specKey="legends";class zV extends HV{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){const e=t[this.specKey];if(!e)return;if(!y(e))return e.type&&"discrete"!==e.type?void 0:[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.discreteLegend}];const i=[];return e.forEach(((t,e)=>{t.type&&"discrete"!==t.type||i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.discreteLegend})})),i}init(t){super.init(t),uE(this._regions,(t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData()},level:Fp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){Ap(this._option.dataSet,"discreteLegendFilter",jV),Ap(this._option.dataSet,"discreteLegendDataMake",YV);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return uE(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(P(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!Jo(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return rs(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&P(t.title.text)&&P(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=RT(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){const{title:i={},item:s={},pager:n={},background:r={},type:a,id:o,visible:l,orient:h,position:d,data:c,filter:u,regionId:p,regionIndex:g,seriesIndex:m,seriesId:_,padding:f}=t,v=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener(oT.legendItemClick,(e=>{const i=Gd(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(jd.legendItemClick,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(oT.legendItemHover,(t=>{const e=Gd(t,"detail");this.event.emit(jd.legendItemHover,{model:this,value:e,event:t})})),this._legendComponent.addEventListener(oT.legendItemUnHover,(t=>{const e=Gd(t,"detail");this.event.emit(jd.legendItemUnHover,{model:this,value:e,event:t})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:Wo(s)?s:1,strokeOpacity:Wo(n)?n:1,opacity:Wo(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return rs(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=IE(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:d}=IE(o,l);l&&!o&&d&&(t.item.value.formatMethod=(t,e)=>d(l,t,e,a))}}zV.specKey="legends",zV.type=r.discreteLegend;const NV=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;Wo(n)&&(t=Math.min(n,t)),Wo(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},VV=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r}=e,a=i(),o=s(),l=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!ns(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(a===n())return t;if(o&&!Im(a)){const[e,i]=a;return l(t)?SH(t,+e,+i,o):t.filter((t=>t[o]>=e&&t[o]<=i))}return t};var WV;function GV(t){return y(t)?t:[t,t]}function UV(t){return t?"ew-resize":"ns-resize"}!function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(WV||(WV={})),LV();class $V extends Pk{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},$V.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=vs(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/e:(t.viewY-this._rail.globalAABBBounds.y1)/e,0,1);i!==this._tooltipState.pos&&(this._tooltipState.pos=i,this._tooltipState.value=this.calculateValueByPos(i*e),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i,"browser"===jo.env?(jo.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),jo.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;const{railWidth:s,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{x:o,y:l}=this.stage.eventPointTransform(t);let h,d,c,u=0;this._isHorizontal?(h=o,u=h-this._prePos,d=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,c=s):(h=l,u=h-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,c=n);const p=vs(d+u,0,c),g=this.calculateValueByPos(p);"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,p,g):this._updateHandler(this._currentHandler,p,g),this._updateTrack(),this._prePos=h,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===jo.env?(jo.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),jo.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i,"browser"===jo.env?(jo.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),jo.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n,inverse:r}=this.attribute;if(n===s)return;const{startHandler:a,endHandler:o}=this._getHandlers();let l,h,d;const{x:c,y:u}=this.stage.eventPointTransform(t);this._isHorizontal?(l=c,h=this._track.attribute.width,d=e):(l=u,h=this._track.attribute.height,d=i);const p=l-this._prePos;if(a){const t=this._isHorizontal?a.attribute.x:a.attribute.y,e=r?vs(t+p,h,d):vs(t+p,0,d-h),i=this.calculateValueByPos(e);this._updateHandler(a,e,i)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,e=r?vs(t+p,0,d-h):vs(t+p,h,d),i=this.calculateValueByPos(e),s=null==a?void 0:a.attribute;this._updateHandler(o,e,i),this._track.setAttributes(this._isHorizontal?{x:Math.min(s.x,o.attribute.x),width:Math.abs(s.x-o.attribute.x)}:{y:Math.min(s.y,o.attribute.y),height:Math.abs(s.y-o.attribute.y)})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===jo.env?(jo.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),jo.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n}=this.attribute;if(n===s)return;const r=this._startHandler,a=this._endHandler;let o,l,h,d;this._isHorizontal?(o=t.viewX-this._rail.globalAABBBounds.x1,l=null==r?void 0:r.attribute.x,h=null==a?void 0:a.attribute.x,d=e):(o=t.viewY-this._rail.globalAABBBounds.y1,l=null==r?void 0:r.attribute.y,h=null==a?void 0:a.attribute.y,d=i);const c=this.calculateValueByPos(o);if(M(h)){const t=Math.abs(o-l)>Math.abs(o-h)?a:r;this._updateHandler(t,o,c)}else this._updateHandler(r,o,c);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:s,railHeight:n,min:r,max:a,inverse:o}=this.attribute;let l=0;return l=r===a?"start"===e?0:"end"===e?1:0:(t-r)/(a-r),(o?1-l:l)*("vertical"===i?n:s)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:s,min:n,max:r,inverse:a}=this.attribute,o="vertical"===e?s:i;return n+(r-n)*(a?1-t/o:t/o)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[s,n]=Ra(t),{startHandler:r,endHandler:a}=this._getHandlers();r&&this._updateHandler(r,this.calculatePosByValue(s),s),a&&this._updateHandler(a,this.calculatePosByValue(n),n),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:s,railHeight:n,startText:r,endText:a,min:o,max:l,showHandler:h=!0,showTooltip:d}=this.attribute;let{value:c}=this.attribute;P(c)&&(c=[o,l]),this._currentValue={startValue:GV(c)[0],endValue:GV(c)[1]};const u="horizontal"===i;this._isHorizontal=u;const p=Gr.group({x:0,y:0});p.name=WV.innerView,this.add(p),this._innerView=p;let g,m=0;if(r&&r.visible){g=Gr.text(Object.assign({x:u?0:s/2,y:u?n/2:0,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:r.text,lineHeight:null===(t=r.style)||void 0===t?void 0:t.fontSize},r.style)),g.name=WV.startText,p.add(g);const e=M(r.space)?r.space:0;m+=(u?g.AABBBounds.width():g.AABBBounds.height())+e}const _=Gr.group({x:u?m:0,y:u?0:m});p.add(_);const f=Gr.group({x:0,y:0});let v;if(f.name=WV.railContainer,this._railContainer=f,_.add(f),this._mainContainer=_,this._renderRail(f),m+=u?s:n,a&&a.visible){const t=M(a.space)?a.space:0;v=Gr.text(Object.assign({x:u?m+t:s/2,y:u?n/2:m+t,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:a.text,lineHeight:null===(e=a.style)||void 0===e?void 0:e.fontSize},a.style)),v.name=WV.endText,p.add(v)}this._renderTrack(f),h&&(this._renderHandlers(_),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:s,slidable:n}=this.attribute;let r="default";!1!==n&&(r="pointer");const a=Gr.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:r},s));return a.name=WV.rail,t.add(a),this._rail=a,a}_renderHandlers(t){const{range:e,min:i,max:s,handlerSize:n=14,handlerStyle:r,handlerText:a,railHeight:o,railWidth:l,slidable:h}=this.attribute;let{value:d}=this.attribute;P(d)&&(d=[i,s]);const c=a&&a.visible,u=this._isHorizontal,[p,g]=GV(d),m=this.calculatePosByValue(p,e?"start":"end"),_=this._renderHandler(Object.assign({x:u?m:l/2,y:u?o/2:m,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":UV(u)},r));if(_.name=WV.startHandler,this._startHandler=_,t.add(_),this._currentValue.startPos=m,c){const i=this._renderHandlerText(p,e?"start":"end");i.name=WV.startHandlerText,t.add(i),this._startHandlerText=i}if(e){const e=this.calculatePosByValue(g,"end"),i=this._renderHandler(Object.assign({x:u?e:l/2,y:u?o/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":UV(u)},r));if(i.name=WV.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,c){const e=this._renderHandlerText(g,"end");e.name=WV.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){const{range:e,min:i,max:s,railHeight:n,railWidth:r,trackStyle:a,railStyle:o,slidable:l,value:h}=this.attribute;let d,c;if(P(h))e?(d=i,c=s):d=c=i;else if(e){const t=DV(h,i,s);d=t[0],c=t[1]}else d=i,c=vs(h,i,s);const u=this._isHorizontal;e||(d=i);const p=Gr.group({x:0,y:0,width:r,height:n,cornerRadius:null==o?void 0:o.cornerRadius,clip:!0,pickable:!1});p.name=WV.trackContainer;const g=ns(e)&&!0===e.draggableTrack;let m;m=!1===l?"default":!1===e||!1===g?"pointer":UV(u);const _=this.calculatePosByValue(d,"start"),f=this.calculatePosByValue(c,e?"end":"start"),v=Gr.rect(Object.assign({x:u?Math.min(_,f):0,y:u?0:Math.min(_,f),width:u?Math.abs(f-_):r,height:u?n:Math.abs(f-_),cursor:m},a));v.name=WV.track,this._track=v,p.add(v),t.add(p)}_renderHandler(t){return Gr.symbol(t)}_renderHandlerText(t,e){var i,s,n;const{align:r,handlerSize:a=14,handlerText:o={},railHeight:l,railWidth:h,slidable:d}=this.attribute,c=this._isHorizontal,u=this.calculatePosByValue(t,e),p=null!==(i=o.space)&&void 0!==i?i:4,g={text:o.formatter?o.formatter(t):t.toFixed(null!==(s=o.precision)&&void 0!==s?s:0),lineHeight:null===(n=o.style)||void 0===n?void 0:n.lineHeight,cursor:!1===d?"default":UV(c)};return c?"top"===r?(g.textBaseline="bottom",g.textAlign="center",g.x=u,g.y=(l-a)/2-p):(g.textBaseline="top",g.textAlign="center",g.x=u,g.y=(l+a)/2+p):"left"===r?(g.textBaseline="middle",g.textAlign="end",g.x=(h-a)/2-p,g.y=u):(g.textBaseline="middle",g.textAlign="start",g.x=(h+a)/2+p,g.y=u),Gr.text(Object.assign(Object.assign({},g),o.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:s,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const r=this._isHorizontal?0:s/2,a=this._isHorizontal?i/2:0;if(e&&e.shape){const t=Gr.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:r,y:a,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}const o=e&&e.text||{},l=null!==(t=o.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=r,h.y="top"===n?a-i/2-l:a+i/2+l,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=a,h.x="left"===n?r-s/2-l:a+s/2+l,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");const d=Gr.text(Object.assign(Object.assign({},h),o.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:s}=this.attribute,n=this._isHorizontal?i:s,r=this._tooltipState.pos*n,a=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[a]:r});const{align:o}=this.attribute;if(this._tooltipText){const i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[a]:r,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==o?`≈ ${this._tooltipState.value.toFixed(null!==(e=i.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=i.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),ns(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,s=this._startHandler,n=this._endHandler;if(this._isHorizontal){const i=null==s?void 0:s.attribute.x;if(n){const t=null==n?void 0:n.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else t?this._track.setAttributes({x:i,width:e-i}):this._track.setAttributes({width:i})}else{const e=null==s?void 0:s.attribute.y;if(n){const t=null==n?void 0:n.attribute.y;this._track.setAttributes({y:Math.min(e,t),height:Math.abs(e-t)})}else t?this._track.setAttributes({y:e,height:i-e}):this._track.setAttributes({height:e})}}_updateHandler(t,e,i){var s;const n=this._isHorizontal;t.setAttribute(n?"x":"y",e);const r=t.name===WV.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t={}}=this.attribute;r.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(s=t.precision)&&void 0!==s?s:0),[n?"x":"y"]:e})}t.name===WV.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var s;const n=this._isHorizontal,{handlerText:r={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:r.formatter?r.formatter(i):i.toFixed(null!==(s=r.precision)&&void 0!==s?s:0)});const a=t.name===WV.startHandlerText?this._startHandler:this._endHandler;a&&a.setAttributes({[n?"x":"y"]:e}),t.name===WV.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(null==e?void 0:e.attribute.x)||t&&i.attribute.x>(null==e?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(null==e?void 0:e.attribute.y)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}$V.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},PV(),LV();class KV extends AV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},KV.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{const e=this._slider.tooltipShape;if(e&&t.detail&&!P(t.detail.value)){const i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:s,min:n,max:r,value:a,railWidth:o,railHeight:l,showHandler:h=!0,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:p,startText:g,endText:m,handlerText:_,showTooltip:f,tooltip:v,inverse:y,disableTriggerEvent:b}=this.attribute,x=[],S=(r-n)/(t.length-1);for(let e=0;e1){const t=this._color.stops,e=Math.min(c,u),i=Math.max(c,u),s=e/g,n=i/g,r=n-s,a=t.filter((t=>t.offset>s&&t.offset{f.push({offset:(t.offset-s)/r,color:t.color})})),f.push({offset:1,color:_}),o.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:f}))}}}function XV(t="bottom"){let e=0;return"top"===t?`\n M${e},-6L${e-3.5},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+2.5},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-2.5},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-3.5},2.5\n v-5\n h7\n v5\n Z\n`}KV.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}},PV(),LV(),MM();class qV extends AV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},qV.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,sizeBackground:v,disableTriggerEvent:y,inverse:b}=this.attribute,x=Gr.group({x:0,y:0});this._innerView.add(x);const S=new $V({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l,handlerSize:h,handlerStyle:Object.assign({symbolType:XV(i)},d),railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,disableTriggerEvent:y,inverse:b});x.add(S);let M,k=0;"horizontal"===e?"top"===i?(M=`M0,0L${a},0L${b?0:a},12Z`,k=o):(M=`M0,12L${a},12L${b?0:a},0Z`,S.setAttribute("y",12)):"left"===i?M=`M${a},0L${a+12},${b?0:o}L${a},${o}Z`:(M=`M0,${b?0:o}L12,${o}L12,0Z`,S.setAttribute("x",12));const A=Gr.path(Object.assign(Object.assign({x:0,y:k,path:M},v),{zIndex:0}));x.add(A);const w=this._title?this._title.AABBBounds.height()+Gd(this.attribute,"title.space",12):0;x.translate(0-x.AABBBounds.x1,w-x.AABBBounds.y1),this._slider=S}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}qV.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};function ZV(t){return"color"===t||"size"===t}const JV={color:KV,size:qV},QV=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],tW=[2,10];class eW extends HV{static getSpecInfo(t){const e=t[this.specKey];if(!e)return;if(!y(e))return ZV(e.type)?[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:"color"===e.type?r.colorLegend:r.sizeLegend}]:void 0;const i=[];return e.forEach(((t,e)=>{ZV(t.type)&&i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:"color"===t.type?r.colorLegend:r.sizeLegend})})),i}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),uE(this._regions,(t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData},level:Fp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){Ap(this._option.dataSet,"continuousLegendFilter",VV),Ap(this._option.dataSet,"continuousLegendDataMake",NV);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>pE(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&P(t.title.text)&&P(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=RT(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!Jo(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=RT(this._option.dataSet.getDataView(a.dataId),a.fields[0])}}_getLegendAttributes(t){var e,i;const s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",n="horizontal"===s?"bottom":this.layoutOrient;let r=[];const a=this._getScaleInGlobal();a&&"linear"===a.type&&(r=a.range()),Im(r)&&(r="color"===this._legendType?QV:tW);let o=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,l=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(o=Math.min(0,this._legendData.getLatestData()[0]),l=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const h=Object.assign({layout:s,align:n,zIndex:this.layoutZIndex,min:o,max:l,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:r},function(t){const e=Tl({},t),{title:i={},handler:s={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:d={},type:c,id:u,visible:p,orient:g,position:m,data:_,defaultSelected:f,field:v,filter:y,regionId:b,regionIndex:x,seriesIndex:S,seriesId:k,padding:A}=e,w=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const i=Gd(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(jd.legendFilter,{model:this,value:i,event:e})}),30))}}}eW.specKey="legends",eW.type=r.continuousLegend;const iW=(t,e)=>M(e)?t.map((t=>e[t])):void 0,sW=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),nW=t=>!P(t)&&(y(t)?t.length>0&&t.every(M):Object.keys(t).length>0),rW=(t,e)=>!(e&&(!1===e.visible||e[t]&&!1===e[t].visible||e.activeType&&!e.activeType.includes(t)));function aW(t){if(!t||!t.length)return null;const e=[];return t.forEach((({content:t})=>{rs(t)?e.push(t):y(t)?t.forEach((t=>{e.push(t)})):t&&e.push(t)})),e.length?Object.assign(Object.assign({},t[0]),{content:e}):t[0]}const oW=t=>{const e=[];return t.forEach((t=>{t.data.forEach((t=>{M(t.series)&&e.push(t.series)}))})),e},lW=(t,e,i,s,n)=>{var r,a;i&&(i.shapeSize=null!==(r=i.shapeSize)&&void 0!==r?r:i.size);const o=s?null!==(a=s[null==t?void 0:t.seriesId])&&void 0!==a?a:s[-1]:null,l={};return[t,e,i,o,n].forEach((t=>{M(t)&&Object.keys(t).forEach((e=>{(t=>t.toLowerCase().includes("shape"))(e)&&P(l[e])&&!P(t[e])&&(l[e]=t[e])}))})),l},hW=(t,e,i)=>{const s=rs(e)?e(t):e;return i?Object.assign(Object.assign({},t),s):Object.assign(Object.assign({},s),t)},dW=(t,e,i)=>M(t)?rs(t)?(...s)=>hW(t(...s),e,i):hW(t,e,i):void 0,cW=(t,e,i)=>M(t)?Ra(t).map((t=>rs(t)?(...s)=>Ra(t(...s)).map((t=>hW(t,e,i))):hW(t,e,i))):void 0,uW=(t,e,i,s)=>{let n;if(n=rs(t)?t(e,i):t,s){const{formatFunc:i,args:r}=IE(void 0,s,t,e);i&&r&&(n=i(...r))}return n},pW=(t,e,i)=>P(t)?t:rs(t)?t(e,i):t;class gW{}gW.dom=`${sh}_TOOLTIP_HANDLER_DOM`,gW.canvas=`${sh}_TOOLTIP_HANDLER_CANVAS`;const mW=20,_W={key:"其他",value:"..."},fW=["group","mark","dimension"],vW=(t,e,i)=>{if(!e&&!i)return"object"!=typeof t?null==t?void 0:t.toString():t;const s=JB.getInstance();return e=e||"%Y%m%d",("local"===(i=i||"local")?s.timeFormat:s.timeUTCFormat)(e,t)},yW=(t,e,i)=>{const s=vW(uW(e.key,t,i,e.keyFormatter),e.keyTimeFormat,e.keyTimeFormatMode),n=vW(uW(e.value,t,i,e.valueFormatter),e.valueTimeFormat,e.valueTimeFormatMode),r=!1!==uW(e.visible,t,i)&&(M(s)||M(n)),a=uW(e.isKeyAdaptive,t,i),o=uW(e.spaceRow,t,i),l=uW(e.shapeType,t,i),h=uW(e.shapeColor,t,i),d=uW(e.shapeFill,t,i),c=uW(e.shapeStroke,t,i),u=uW(e.shapeLineWidth,t,i),p=uW(e.shapeHollow,t,i),g=uW(e.keyStyle,t,i),m=uW(e.valueStyle,t,i);return{key:s,value:n,visible:r,isKeyAdaptive:a,hasShape:e.hasShape,shapeType:l,shapeFill:d,shapeStroke:c,shapeLineWidth:u,shapeHollow:p,shapeColor:h,keyStyle:g,valueStyle:m,spaceRow:o,datum:t}};class bW{constructor(t){this._showTooltipByHandler=(t,e)=>{var i,s,n;if(P(t))return 1;e.changePositionOnly||this.clearCache(),this._updateViewSpec(e);const r=this._cacheViewSpec;if(P(null==r?void 0:r[this.activeType])||!1===r.visible)return 1;e.tooltipSpec=r,this._updateActualTooltip(t,e),e.tooltipActual=this._cacheActualTooltip;const{title:a,content:o}=this._cacheActualTooltip,l=P(null==a?void 0:a.key)&&P(null==a?void 0:a.value)&&!(null==o?void 0:o.length);if(this.component.event.emit(jd.tooltipShow,Object.assign(Object.assign({},e),{isEmptyTooltip:P(null==a?void 0:a.key)&&P(null==a?void 0:a.value)&&!(null==o?void 0:o.length),tooltipData:t,activeType:this.activeType,tooltip:this.component})),l)return 1;let h;return(null===(i=r.handler)||void 0===i?void 0:i.showTooltip)?h=r.handler.showTooltip.bind(r.handler):(null===(s=this.component.tooltipHandler)||void 0===s?void 0:s.showTooltip)&&(h=this.component.tooltipHandler.showTooltip.bind(this.component.tooltipHandler)),h?null!==(n=h(this.activeType,t,e))&&void 0!==n?n:0:1},this.component=t}_preprocessDimensionInfo(t){const e=[];if(null==t||t.forEach((t=>{const i=Object.assign(Object.assign({},t),{data:t.data.filter((({series:t})=>{var e,i;return!1!==(null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.visible)}))});i.data.length>0&&e.push(i)})),e.length>0)return e}_updateViewSpec(t){const{changePositionOnly:e,model:i,dimensionInfo:s}=t;e&&this._cacheViewSpec||(this._cacheViewSpec=((t,e,i,s)=>{var n,r,a,o,l,h;const d=Object.assign(Object.assign({},e),{activeType:t}),{style:c={}}=e;switch(t){case"mark":case"group":if(i){const t=null===(n=i.getSpec())||void 0===n?void 0:n.tooltip;if(d.visible=!0,d.handler=null!==(r=null==t?void 0:t.handler)&&void 0!==r?r:e.handler,null===(a=d.handler)||void 0===a?void 0:a.showTooltip)return d}break;case"dimension":if((null==s?void 0:s.length)&&(oW(s).every((t=>{var e;return!rW("dimension",null===(e=t.tooltipHelper)||void 0===e?void 0:e.spec)}))?d.visible=!1:d.visible=!0,d.handler=null!==(o=e.handler)&&void 0!==o?o:void 0,null===(l=d.handler)||void 0===l?void 0:l.showTooltip))return d}const u=null!==(h=((t,e,i)=>{switch(t){case"mark":case"group":if(e)return e.tooltipHelper.getDefaultTooltipPattern(t);break;case"dimension":if(null==i?void 0:i.length){const e=[];return i.forEach((i=>i.data.forEach((s=>{const{series:n}=s,r=[Object.assign(Object.assign({},i),{data:[s]})],a=n.tooltipHelper.getDefaultTooltipPattern(t,r);a&&e.push(a)})))),aW(e)}}})(t,i,s))&&void 0!==h?h:{},p=((t,e,i,s)=>{const n="dimension"===t&&(null==s?void 0:s.length)?oW(s):"mark"!==t&&"group"!==t||!i?null:[i];if(n&&n.length){const i=[];return n.forEach((s=>{var n;const r=null===(n=s.tooltipHelper)||void 0===n?void 0:n.spec;if(rW(t,r)){let n=r&&r[t]?Object.assign(Object.assign({},e[t]),r[t]):e[t];n&&(n=k(n),n.title&&(n.title=dW(n.title,{seriesId:s.id},!0)),n.content&&(n.content=cW(n.content,{seriesId:s.id},!0)),i.push(n))}})),i&&i.length?aW(i):null}})(t,e,i,s);if(p){const t=u.title,e=lW(void 0,p,c.shape,void 0,t);M(p.title)?p.title=dW(p.title,Object.assign(Object.assign({},t),e)):p.title=dW(t,e,!0);const i=Ra(u.content);if(M(p.content)){const t=(t=>{const e={};return t.forEach((t=>{const i=t.seriesId;M(i)&&!e[i]&&(e[i]=t),e[-1]||(e[-1]=t)})),e})(i);p.content=cW(p.content,(e=>lW(e,p,c.shape,t)))}else p.content=cW(i,(t=>lW(void 0,p,c.shape,void 0,t)),!0)}return d[t]=Object.assign(Object.assign(Object.assign({},u),p),{activeType:t}),d})(this.activeType,this.component.getSpec(),i,s))}_updateActualTooltip(t,e){var i,s,n,r;const a=this._cacheViewSpec[this.activeType],{changePositionOnly:o}=e;if(!o||!this._cacheActualTooltip){const o=((t,e,i)=>{var s,n,r,a;if(!e||"mouseout"===(null===(s=null==i?void 0:i.event)||void 0===s?void 0:s.type))return null;const o={title:{},content:[]},l=pW(t.title,e,i),{visible:h,value:d,valueTimeFormat:c,valueTimeFormatMode:u,valueStyle:p,hasShape:g,valueFormatter:m}=null!=l?l:{},_=!1!==uW(h,e,i);if(l&&_){const t=function(t){var e;const i=(null===(e=t[0])||void 0===e?void 0:e.series)?[{data:t,value:""}]:t;for(const{data:t}of i)for(const{datum:e}of t)for(const t of null!=e?e:[])if(t)return t}(e);o.title={value:vW(uW(d,t,i,m),c,u),valueStyle:uW(p,t,i),hasShape:g}}else o.title={hasShape:!1,visible:!1};const f=((t,e,i)=>{if(P(t))return t;let s=[];return Ra(t).forEach((t=>{rs(t)?s=s.concat(Ra(t(e,i))):s.push(t)})),s})(t.content,e,i),{maxLineCount:v=mW}=t,y=t.othersLine?Object.assign(Object.assign({},_W),t.othersLine):_W,b=t=>{if(null==t?void 0:t.length)for(const e of t)for(const t of null!=f?f:[]){const s=yW(e,t,i);if(!1!==s.visible){if(o.content.length===v-1){o.content.push(Object.assign(Object.assign({},s),y));break}if(!(o.content.lengthP(t.seriesId)||t.seriesId===s.id)))&&void 0!==a?a:[];for(const s of e){for(const e of t){const t=yW(s,e,i);if(!1!==t.visible){if(o.content.length===v-1){o.content.push(Object.assign(Object.assign({},t),y));break}if(!(o.content.length=v)break}if(o.content.length>=v)break}if(o.content.length>=v)break}}return o.title&&(o.content.length>0&&o.content[0].shapeType?(P(o.title.shapeType)&&(o.title.shapeType=o.content[0].shapeType),P(o.title.shapeColor)&&(o.title.shapeColor=o.content[0].shapeColor)):o.title.hasShape=!1),o})(a,t,e),l=!!M(o)&&!1!==pW(a.visible,t,e);this._cacheActualTooltip=Object.assign(Object.assign({},o),{visible:l,activeType:a.activeType,data:t});const{title:h,content:d}=this._cacheActualTooltip;this._cacheActualTooltip.title=null!==(s=null===(i=a.updateTitle)||void 0===i?void 0:i.call(a,h,t,e))&&void 0!==s?s:h,this._cacheActualTooltip.content=null!==(r=null===(n=a.updateContent)||void 0===n?void 0:n.call(a,d,t,e))&&void 0!==r?r:d}}shouldHandleTooltip(t,e){var i,s;const{tooltipInfo:n}=e;return!P(n)&&rW(this.activeType,null===(s=null===(i=t.model)||void 0===i?void 0:i.tooltipHelper)||void 0===s?void 0:s.spec)}clearCache(){this._cacheViewSpec=void 0,this._cacheActualTooltip=void 0}}class xW extends bW{constructor(){super(...arguments),this.activeType="dimension"}showTooltip(t,e,i){const s=Object.assign(Object.assign({},e),{dimensionInfo:this._preprocessDimensionInfo(t),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(t,s)}_getDimensionInfo(t){var e,i;let s;const n=this.component.getChart(),r=n.getCompiler().getStage().getLayer(void 0),a={x:t.event.viewX,y:t.event.viewY};if(r.globalTransMatrix.transformPoint({x:t.event.viewX,y:t.event.viewY},a),s=[...null!==(e=Rd(n,a,!0))&&void 0!==e?e:[],...null!==(i=Sd(n,a))&&void 0!==i?i:[]],0===s.length)s=void 0;else if(s.length>1){const t=s.filter((t=>{var e;const i=t.axis;if(i.getSpec().hasDimensionTooltip)return!0;if(!td(i.getScale().type))return!1;let s;for(const t of null!==(e=null==i?void 0:i.getRegions())&&void 0!==e?e:[]){for(const e of t.getSeries())if("cartesian"===e.coordinate){s=e;break}if(M(s))break}return M(s)&&s.getDimensionField()[0]===s.fieldY[0]?"left"===i.getOrient()||"right"===i.getOrient():"bottom"===i.getOrient()||"top"===i.getOrient()}));if(s=t.length?t:s.slice(0,1),s.length>1){const t=new Set;s.forEach((e=>{e.data=e.data.filter((({key:e})=>!t.has(e)&&(t.add(e),!0)))}))}}return s}getMouseEventData(t){var e;return{tooltipInfo:this._getDimensionInfo(t),ignore:[...null!==(e=this.component.getOption().getAllSeries())&&void 0!==e?e:[]].some((e=>{var i;const s=null===(i=e.tooltipHelper)||void 0===i?void 0:i.ignoreTriggerSet.dimension;return t.model&&(null==s?void 0:s.has(t.model))||t.mark&&(null==s?void 0:s.has(t.mark))}))}}}class SW extends bW{constructor(){super(...arguments),this.activeType="group"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:Ra(s),series:n}],a=Object.assign(Object.assign({},e),{groupDatum:this._getGroupDatum(e),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e,i;let s,n;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,r=e.tooltipHelper,a=null==r?void 0:r.activeTriggerSet.group,o=null==r?void 0:r.ignoreTriggerSet.group;if((null==a?void 0:a.has(t.model))||(null==a?void 0:a.has(t.mark))){const n=this.component.getSpec()[this.activeType];((null==n?void 0:n.triggerMark)?Ra(n.triggerMark):[]).includes(null===(i=t.mark)||void 0===i?void 0:i.name)&&(s={mark:t.mark,datum:t.datum,series:e})}else((null==o?void 0:o.has(t.model))||(null==o?void 0:o.has(t.mark)))&&(n=!0)}return{tooltipInfo:s,ignore:n}}_getGroupDatum(t){const{model:e,mark:i,datum:s}=t,n=e;if(["line","area"].includes(i.type))return Ra(s);const r=n.getViewData().latestData,a=n.getSeriesField();if(!a)return r;const o=Ra(s)[0][a];return r.filter((t=>t[a]===o))}}class MW extends bW{constructor(){super(...arguments),this.activeType="mark"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:[s],series:n}],a=Object.assign(Object.assign({},e),{changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e;let i,s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.mark,a=null==n?void 0:n.ignoreTriggerSet.mark;(null==r?void 0:r.has(t.model))||(null==r?void 0:r.has(t.mark))?i={mark:t.mark,datum:t.datum,series:e}:((null==a?void 0:a.has(t.model))||(null==a?void 0:a.has(t.mark)))&&(s=!0)}return{tooltipInfo:i,ignore:s}}}const kW=t=>M(t)&&!y(t),AW=t=>M(t)&&y(t);class wW extends XE{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){var i;const{spec:s,theme:n}=super._initTheme(t,e);return s.style=Tl({},this._theme,s.style),s.offset=Tl({},n.offset,t.offset),s.transitionDuration=null!==(i=t.transitionDuration)&&void 0!==i?i:n.transitionDuration,{spec:s,theme:n}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h,d;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return M(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:ul(this._option.mode)||!dl(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.triggerOff=null!==(h=t.triggerOff)&&void 0!==h?h:t.trigger,t.confine=null!==(d=t.confine)&&void 0!==d?d:"canvas"===t.renderMode,M(t.mark)&&(t.mark.activeType="mark"),M(t.dimension)&&(t.dimension.activeType="dimension"),M(t.parentElement)?S(t.parentElement)&&(t.parentElement=jo.getElementById(t.parentElement)):dl(this._option.mode)&&(t.parentElement=null==hl?void 0:hl.body)}}class TW extends qE{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=wW,this.specKey="tooltip",this.layoutType="none",this._alwaysShow=!1,this._eventList=[],this._isTooltipShown=!1,this._clickLock=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._handleClickToLock=t=>{this._clickLock?(this._handleChartMouseOut(t),this._clickLock=!1):this._clickLock=!0},this._getMouseOutHandler=t=>e=>{var i,s,n;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const r=dl(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:a,clientY:o}=e.event;r&&this._isPointerOnTooltip(e)||r&&t&&this._isPointerInChart({x:a,y:o})||this._handleChartMouseOut(e)},this._handleChartMouseOut=t=>{this._alwaysShow||"none"!==this._spec.triggerOff&&(this._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:this})),this._cacheInfo=void 0,this._cacheParams=void 0,this._cacheActiveType=void 0)},this._getMouseMoveHandler=t=>e=>{if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),this._alwaysShow)return;if(this._isPointerOnTooltip(e))return;if(this._clickLock)return void(t&&(this._handleChartMouseOut(e),this._clickLock=!1));const i=this._getMouseEventData(e),{tooltipInfo:{dimension:s},ignore:{mark:n,dimension:r}}=i,a={mark:!1,dimension:!1,group:!1};for(let s=0,n=fW.length;s!t))&&!function(t){return P(t.mark)&&P(t.model)&&P(t.datum)}(e)&&(n&&kW(this._cacheInfo)?a.mark=this._showTooltipByMouseEvent("mark",i,e,t,!0):r&&AW(this._cacheInfo)?a.dimension=this._showTooltipByMouseEvent("dimension",i,e,t,!0):M(s)&&(a.dimension=this._showTooltipByMouseEvent("dimension",i,e,t))),a.mark||a.group||a.dimension&&!P(s)||this._handleChartMouseOut(e)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;const a=this.processor[t];if(!a.shouldHandleTooltip(i,{tooltipInfo:e.tooltipInfo[t],ignore:e.ignore[t]}))return!1;let o;if(this._timer&&clearTimeout(this._timer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._timer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&gT.globalConfig.uniqueTooltip&&l&&gT.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return 0;this.event.emit(jd.tooltipHide,Object.assign(Object.assign({},t),{source:Hd.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const n=null!==(s=this._spec.handler)&&void 0!==s?s:this.tooltipHandler;if(n.hideTooltip){const e=n.hideTooltip.call(n,t);return e||(this._isTooltipShown=!1),e}return 1}}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;if(!y(e))return[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.tooltip}];const i=[];return e.forEach(((t,e)=>{i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.tooltip})})),i}isTooltipShown(){return this._isTooltipShown}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}_registerEvent(){}_releaseEvent(){}onLayout(t){}onLayoutEnd(t){}onRender(t){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}release(){var t,e;super.release(),this._timer&&clearTimeout(this._timer),this._eventList.forEach((({eventType:t,handler:e})=>{this.event.off(t,e)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(jd.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(jd.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n;else{const t="canvas"===s?gW.canvas:gW.dom,n=$l.getComponentPluginInType(t);n||gl("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r}}_initProcessor(){const t=this._spec.activeType;this.processor={},t.includes("dimension")&&(this.processor.dimension=new xW(this)),t.includes("group")&&(this.processor.group=new SW(this)),t.includes("mark")&&(this.processor.mark=new MW(this))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Ra(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=this._option.mode;e.includes("hover")&&(this._mountEvent("pointermove",{source:"chart"},this._getMouseMoveHandler(!1)),(cl(i)||ul(i))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerout",{source:"canvas"},this._getMouseOutHandler(!1))),e.includes("click")?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}reInit(t){var e,i;super.reInit(t),this.tooltipHandler?null===(i=(e=this.tooltipHandler).reInit)||void 0===i||i.call(e):this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;const s=function(t,e,i){var s,n,r;const a=Object.assign({regionIndex:0},e),o=i.getOption(),l=o.getRegionsInUserIdOrIndex(M(a.regionId)?[a.regionId]:void 0,M(a.regionIndex)?[a.regionIndex]:void 0)[0];if(!l)return"none";const h=((t,e)=>{const i=e.getSeries(),s=[];return i.forEach((e=>{var i,n,r,a,o,l,h;const d=e.getDimensionField(),c=e.getMeasureField(),u=e.getSeriesField(),p=M(u)?t[u]:void 0,g=M(u)&&null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[u])||void 0===r?void 0:r.values)&&void 0!==a?a:[],m=iW(d,t);let _=iW(c,t);const f=nW(_),v=!f&&M(u)&&P(p)&&g.length>0,y=()=>{var t;const i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(sW(d,m));if(!f&&(_=iW(c,i),!nW(_)))return;const n=e.type===_l.pie?e.dataToCentralPosition(i):e.dataToPosition(i);P(n)||isNaN(n.x)||isNaN(n.y)||s.push({pos:n,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},series:e})};if("cartesian"===e.coordinate){const t=e,i=td(null===(l=null===(o=e.getYAxisHelper())||void 0===o?void 0:o.getScale(0))||void 0===l?void 0:l.type)?"y":"x",n=d.map(((t,e)=>[t,e])).filter((([,t])=>P(null==m?void 0:m[t])));let r=[null!=m?m:[]];n.length>0&&n.forEach((([t,i])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=e.getViewDataStatistics)||void 0===s?void 0:s.call(e))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((e=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[i]=e,h.push(n)}))})),r=h})),r.forEach((n=>{var r,a;if(v){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(sW(d,n));g.forEach((r=>{const o=a.find((t=>t[u]===r));if(_=iW(c,o),!nW(_))return;const l=t.dataToPosition(o);P(l)||isNaN(l.x)||isNaN(l.y)||s.push({pos:l,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:r},series:e,dimType:i})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(sW(d,n));if(!f&&(_=iW(c,r),!nW(_)))return;const o=t.dataToPosition(r);if(P(o)||isNaN(o.x)||isNaN(o.y))return;s.push({pos:o,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},dimType:i,series:e})}}))}else if("polar"===e.coordinate)if(e.type===_l.pie)y();else{const t=e;if(v){const i=(null===(h=t.getViewData())||void 0===h?void 0:h.latestData.filter(sW(d,m))).find((t=>t[u]===p));g.forEach((n=>{if(_=iW(c,i),!nW(_))return;const r=t.dataToPosition(i);P(r)||isNaN(r.x)||isNaN(r.y)||s.push({pos:r,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:n},series:e})}))}else y()}else"geo"===e.coordinate&&y()})),s})(t,l),d=null!==(s=a.activeType)&&void 0!==s?s:h.length>1?"dimension":"mark",c=l.getLayoutStartPoint(),u=l.getLayoutRect(),p=o.globalInstance.getContainer(),g=Object.assign({x:0,y:0},p?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(p):{}),m=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data,l=null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>sW(i,s)(t)&&sW(n,r)(t)&&(P(a)||sW([a],[o])(t))));return l},_=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),u.width),y:Math.min(Math.max(t.y,0),u.height)}))(t),n=null!==(e=a.x)&&void 0!==e?e:c.x+s.x,r=null!==(i=a.y)&&void 0!==i?i:c.y+s.y;return{canvasX:n,canvasY:r,clientX:g.x+n,clientY:g.y+r}};if("dimension"===d){const e=h[0];if(!e)return"none";const s=new Map;h.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const r=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>m(t))))&&void 0!==i?i:[]}}))}];M(e.dimType)&&(r[0].position=e.pos[e.dimType],r[0].dimType=e.dimType);const a={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:r,chart:null!==(n=o.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:Hd.chart,event:_({x:h.reduce(((t,e)=>t+e.pos.x),0)/h.length,y:h.reduce(((t,e)=>t+e.pos.y),0)/h.length}),item:void 0,itemMap:new Map};i.processor.dimension.showTooltip(r,a,!1);const l=o.globalInstance;return gT.globalConfig.uniqueTooltip&&gT.hideTooltip(l.id),d}if("mark"===d){const e=h[0];if(!e)return"none";const s=Object.assign(Object.assign({},m(e)),t),n=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(r=o.globalInstance.getChart())&&void 0!==r?r:void 0,datum:s,model:e.series,source:Hd.chart,event:_(e.pos),item:void 0,itemMap:new Map};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);const l=o.globalInstance;return gT.globalConfig.uniqueTooltip&&gT.hideTooltip(l.id),d}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow)),s}hideTooltip(){const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:Hd.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(P(this._cacheInfo)||P(t))return!1;if(AW(t)){if(kW(this._cacheInfo))return!1;const e=this._cacheInfo;if(e.length!==t.length||!t.every(((t,i)=>ed(t,e[i]))))return!1}else{if(AW(this._cacheInfo))return!1;const e=this._cacheInfo;if((null==t?void 0:t.datum)!==e.datum||(null==t?void 0:t.mark)!==e.mark||(null==t?void 0:t.series)!==e.series)return!1}const s=this._cacheParams;return!P(s)&&!P(e)&&s.mark===e.mark&&s.model===e.model&&s.datum===e.datum}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}_isPointerOnTooltip(t){var e,i;if(this._spec.enterable&&"html"===this._spec.renderMode){const{event:s}=t;let n;if(M(s.nativeEvent)){const t=s.nativeEvent;n=t.relatedTarget,t.composedPath&&t.composedPath().length>0&&(n=t.composedPath()[0])}else n=s.relatedTarget;const r=null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.getTooltipContainer)||void 0===i?void 0:i.call(e);if(M(r)&&M(n)&&jr(n,r))return!0}return!1}getVisible(){return!1!==this._spec.visible}}TW.type=r.tooltip,TW.transformerConstructor=wW,TW.specKey="tooltip";class CW extends Pk{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}h_(),aM();class LW extends CW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},LW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}LW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},h_(),py();class EW extends CW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},EW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},s),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}var PW;EW.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(PW||(PW={}));var DW=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),h(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=Ud((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hide())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(ns(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hide()},this.enable=!0,this.showDefault=!0}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshair(){this.showDefault&&this._showDefaultCrosshairBySpec()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Dm(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,n=e?{level:zd.chart}:{source:Hd.chart};y(t)?t.forEach((t=>{this.event.on(t,n,s)})):this.event.on(t,n,s)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;y(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}updateLayoutAttribute(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:t=n["desktop-browser"]}=this._option,e=function(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:cl(t)||ul(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(t);if(e){const t=Ra(this.trigger||"hover"),i=t=>"click"===t?"none"===this.triggerOff?null:e.clickOut:e.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:e[t],out:i(t)})})),s}return null}_registerTooltipEvent(){this.event.on(jd.tooltipHide,{source:Hd.chart},this._handleTooltipHideOrRelease),this.event.on(jd.tooltipShow,{source:Hd.chart},this._handleTooltipShow),this.event.on(jd.tooltipRelease,{source:Hd.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=Gd(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{OW[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:d,y:c}=this.getLayoutStartPoint();return n.forEach((t=>{a=1/0,o=1/0,l=-1/0,h=-1/0;const e=s.find((e=>e.getSpecIndex()===t));e&&(e.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-d),o=Math.min(o,i-c),l=Math.max(l,e+t.getLayoutRect().width-d),h=Math.max(h,i+t.getLayoutRect().height-c)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:e}))})),r}changeRegions(t){}onLayoutEnd(t){const e=this._regions[0];this.setLayoutRect(e.getLayoutRect()),this.setLayoutStartPosition(e.getLayoutStartPoint()),super.onLayoutEnd(t)}onRender(t){}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||h(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,n;const r={},{line:a={},label:o={},visible:l}=t;if(r.visible=l,r.type=a.type||"line",!1===a.visible)r.style={visible:!1};else{const t=a.style||{},{stroke:o,fill:l,lineWidth:d}=t,c=t,{strokeOpacity:u,fillOpacity:p,opacity:g}=c,m=DW(c,["strokeOpacity","fillOpacity","opacity"]),_="line"===r.type;let f=_?u:p;if(h(g)&&(f=(null!=f?f:1)*g),r.style=Object.assign({opacity:f,pickable:!1,visible:!0},m),_)r.style.stroke=o||l,r.style.lineWidth=Gd(a,"width",d||2);else{r.style.fill=l||o,(null===(n=null===(s=null===(i=this._spec[e])||void 0===i?void 0:i.line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.stroke)&&(r.style.stroke=this._spec[e].line.style.stroke);const t=Gd(a,"width");if("string"==typeof t){const e=parseInt(t.substring(0,t.length-1),10)/100;r.style.sizePercent=e}else"number"!=typeof t&&"function"!=typeof t||(r.style.size=t)}}if(o.visible){const t=o.labelBackground||{},e=o.style||{},i=t.style||{},{fill:s="rgba(47, 59, 82, 0.9)",stroke:n,outerBorder:a}=i,l=DW(i,["fill","stroke","outerBorder"]);r.label={visible:!0,formatMethod:o.formatMethod,formatter:o.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},e),{fill:e.fill||"#fff",stroke:Gd(e,"stroke")}),panel:(v(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:s,stroke:n,outerBorder:Object.assign({stroke:s,distance:0,lineWidth:3},a)},l):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else r.label={visible:!1};return r}_filterAxisByPoint(t,e,i){return t&&t.forEach((s=>{const n=s.axis;if(function(t,e,i){return t.x1>e||t.x2i||t.y2a||o{const d=1&t,c=2&t;i||(i={x:0,y:0});let u=null,p=null,g=0,m=0;if(s.size){const t=Array.from(s.values())[0];g=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().x-i.x,u=t.axis}if(n.size){const t=Array.from(n.values())[0];m=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().y-i.y,p=t.axis}const _=!!s.size&&Number.isFinite(g),f=!!n.size&&Number.isFinite(m),v=o&&!_&&M(l),y=o&&!f&&M(h);let b,x,S;d&&(b=v?l:{height:0,leftPos:0,rightPos:0,topPos:0,x:0,bottom:{visible:!1,text:"",dx:0,dy:0},top:{visible:!1,text:"",dx:0,dy:0},visible:_,axis:u}),c&&(x=y?h:{width:0,leftPos:0,topPos:0,bottomPos:0,y:0,left:{visible:!1,text:"",dx:0,dy:0},right:{visible:!1,text:"",dx:0,dy:0},visible:f,axis:p});let k,A=0,w=0;if(r&&s.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const a=t.getScale();if(td(a.type))S=a.bandwidth(),0===S&&a.step&&(A=a.step());else if(Jh(a.type)){const s=e.fieldX[0],r=e.fieldX2,a=$E(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionX(a);r?(S=Math.abs(t-e.dataToPositionX1(a)),i=`${a[s]} ~ ${a[r]}`):S=1,g=t}n=t.niceLabelFormatter}if(b&&(null===(s=r.label)||void 0===s?void 0:s.visible)&&!v){const e=FE(t.getSpec());"bottom"===t.getOrient()?(b.bottom.visible=!0,b.bottom.defaultFormatter=n,b.bottom.text=i,b.bottom.dx=0,b.bottom.dy=e):"top"===t.getOrient()&&(b.top.visible=!0,b.top.defaultFormatter=n,b.top.text=i,b.top.dx=0,b.top.dy=-e)}})),a&&n.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const r=t.getScale();if(td(r.type))k=r.bandwidth(),0===k&&r.step&&(w=r.step());else if(Jh(r.type)){const s=e.fieldY[0],r=e.fieldY2,a=$E(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionY(a);r?(k=Math.abs(t-e.dataToPositionY1(a)),i=`${a[s]} ~ ${a[r]}`):k=1,m=t}n=t.niceLabelFormatter}if(x&&(null===(s=a.label)||void 0===s?void 0:s.visible)&&!y){const e=FE(t.getSpec());"left"===t.getOrient()?(x.left.visible=!0,x.left.defaultFormatter=n,x.left.text=i,x.left.dx=-e,x.left.dy=0):"right"===t.getOrient()&&(x.right.visible=!0,x.right.defaultFormatter=n,x.right.text=i,x.right.dx=e,x.right.dy=0)}})),b&&!v){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if(FW(t,s),b.leftPos=t.x1,b.rightPos=t.x2,b.topPos=t.y1,b.height=t.y2-t.y1,b.x=g+i.x,r&&r.label){const{top:t,bottom:e}=b;t.visible&&BW(t,"top",r.label),e.visible&&BW(e,"bottom",r.label)}}if(x&&!y){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if(FW(t,n),x.leftPos=t.x1,x.topPos=t.y1,x.bottomPos=t.y2,x.width=t.x2-t.x1,x.y=m+i.y,a&&a.label){const{left:t,right:e}=x;t.visible&&BW(t,"left",a.label),e.visible&&BW(e,"right",a.label)}}return{x:d&&b?b:void 0,y:c&&x?x:void 0,offsetWidth:A,offsetHeight:w,bandWidth:null!=S?S:0,bandHeight:null!=k?k:0}},BW=(t,e,i)=>{const{formatMethod:s,formatter:n}=i,{formatFunc:r,args:a}=IE(s,n,t.text,{label:t.text,position:e});r?t.text=r(...a):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))},FW=(t,e)=>{e.forEach((({axis:e})=>{e.getRegions().forEach((e=>{t.x1=Math.min(t.x1,e.getLayoutStartPoint().x),t.y1=Math.min(t.y1,e.getLayoutStartPoint().y),t.x2=Math.max(t.x2,e.getLayoutStartPoint().x+e.getLayoutRect().width),t.y2=Math.max(t.y2,e.getLayoutStartPoint().y+e.getLayoutRect().height)}))}))},YW=(t,e,i,s)=>{const{x:n,topPos:r,height:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n+i/2,y:r},end:{x:n+i/2,y:r+a}};else if("rect"===o){const o=HW(t,i,e.axis),{leftPos:h,rightPos:d}=e;l={visible:!0,start:{x:Math.max(n-o/2-s/2,h),y:r},end:{x:Math.min(n+i+o/2+s/2,d),y:r+a}}}return l},jW=(t,e,i,s)=>{const{leftPos:n,width:r,y:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n,y:a+i/2},end:{x:n+r,y:a+i/2}};else if("rect"===o){const o=HW(t,i,e.axis),{topPos:h,bottomPos:d}=e;l={visible:!0,start:{x:n,y:Math.max(a-o/2-s/2,h)},end:{x:n+r,y:Math.min(a+i+o/2+s/2,d)}}}return l},HW=(t,e,i)=>{var s,n,r;let a=0;if(null===(s=t.style)||void 0===s?void 0:s.sizePercent)a=(t.style.sizePercent-1)*e;else if("number"==typeof(null===(n=t.style)||void 0===n?void 0:n.size))a=t.style.size-e;else if("function"==typeof(null===(r=t.style)||void 0===r?void 0:r.size)){const s=i.getLayoutRect();a=t.style.size(s,i)-e}return a};class zW extends RW{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!y(e))return e.xField&&!1!==e.xField.visible||e.yField&&!1!==e.yField.visible?[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.cartesianCrosshair}]:void 0;const i=[];return e.forEach(((t,e)=>{(t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible)&&i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.cartesianCrosshair})})),i}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._currValueX=new Map,this._currValueY=new Map}_showDefaultCrosshairBySpec(){const{xField:t,yField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));s&&(1===i?(this._currValueX.clear(),this._currValueX.set(t,{axis:s,value:e})):(this._currValueY.clear(),this._currValueY.set(t,{axis:s,value:e})),this.layoutByValue(i))}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getValueAt(t,e){return t.getScale().invert(e)}clearAxisValue(){this._currValueX.clear(),this._currValueY.clear()}setAxisValue(t,e){Md(e.getOrient())?this._currValueX.set(e.getSpecIndex(),{value:t,axis:e}):this._currValueY.set(e.getSpecIndex(),{value:t,axis:e})}_getAllAxisValues(t,e,i,s){let n=!1;return t.forEach((t=>{td(t.axis.getScale().type)&&(n?this.enable=!1:n=!0)})),!!this.enable&&(t.forEach(((t,n)=>{const r=t.axis;i.set(n,{value:this._getValueAt(r,e-(s?r.getLayoutStartPoint().x-this.getLayoutStartPoint().x:r.getLayoutStartPoint().y-this.getLayoutStartPoint().y)),axis:r})})),!0)}_layoutCrosshair(t,e,i,s){var n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(M(t.dimType)?"y"===t.dimType:kd(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else this._currValueX.clear(),this._currValueY.clear(),o&&o.size&&this._getAllAxisValues(o,r,this._currValueX,!0),l&&l.size&&this._getAllAxisValues(l,a,this._currValueY,!1),this.layoutByValue(3)}hide(){this._xCrosshair&&this._xCrosshair.hideAll(),this._xTopLabel&&this._xTopLabel.hideAll(),this._xBottomLabel&&this._xBottomLabel.hideAll(),this._yCrosshair&&this._yCrosshair.hideAll(),this._yLeftLabel&&this._yLeftLabel.hideAll(),this._yRightLabel&&this._yRightLabel.hideAll()}layoutByValue(t=3){if(!this.enable)return;const e=gE(this._regions,"cartesian");if(!e)return;const{x:i,y:s,offsetWidth:n,offsetHeight:r,bandWidth:a,bandHeight:o}=IW(t,e,this.getLayoutStartPoint(),this._currValueX,this._currValueY,this._xHair,this._yHair,this.enableRemain,this._cacheXCrossHairInfo,this._cacheYCrossHairInfo);this.enableRemain&&(i&&(this._cacheXCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0})),s&&(this._cacheYCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0}))),i&&this._layoutVertical(i,a,n),s&&this._layoutHorizontal(s,o,r)}_layoutVertical(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._xHair)return;const{x:r,topPos:a,height:o,top:l,bottom:h,visible:d}=t;if(d){const d=this._xHair.type,c=YW(this._xHair,t,e,i);if(this._updateCrosshair("x",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a},l),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._xHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"center",textBaseline:"bottom"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xTopLabel,t,(t=>{t.name="crosshair-x-top-label",this._xTopLabel=t}))}else this._xTopLabel&&this._xTopLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a+o},h),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._xHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"center",textBaseline:"top"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xBottomLabel,t,(t=>{t.name="crosshair-x-bottom-label",this._xBottomLabel=t}))}else this._xBottomLabel&&this._xBottomLabel.hideAll()}}_layoutHorizontal(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._yHair)return;const{leftPos:r,width:a,y:o,left:l,right:h,visible:d}=t;if(d){const d=this._yHair.type,c=jW(this._yHair,t,e,i);if(this._updateCrosshair("y",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r,y:o+e/2},l),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._yHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"right",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yLeftLabel,t,(t=>{t.name="crosshair-y-left-label",this._yLeftLabel=t}))}else this._yLeftLabel&&this._yLeftLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+a,y:o+e},h),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._yHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"left",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yRightLabel,t,(t=>{t.name="crosshair-y-right-label",this._yRightLabel=t}))}else this._yRightLabel&&this._yRightLabel.hideAll()}}_parseFieldInfo(){const{xField:t,yField:e}=this._spec;t&&t.visible&&(this._xHair=this._parseField(t,"xField")),e&&e.visible&&(this._yHair=this._parseField(e,"yField"))}_updateCrosshair(t,e,i){const s=this.getContainer();let n;if(n="x"===t?this._xCrosshair:this._yCrosshair,n)n.setAttributes(i);else{const r="x"===t?this._xHair.style:this._yHair.style;"line"===e?n=new LW(Object.assign(Object.assign({},i),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===e&&(n=new EW(Object.assign(Object.assign({},i),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==s||s.add(n),"x"===t?this._xCrosshair=n:this._yCrosshair=n}}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(i(t=new SP(e)),null==s||s.add(t)),UE(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._xCrosshair,this._xTopLabel,this._xBottomLabel,this._yCrosshair,this._yLeftLabel,this._yRightLabel]}}zW.specKey="crosshair",zW.type=r.cartesianCrosshair,h_(),zx();class NW extends CW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},NW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:s=0,sectorStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:r,endAngle:a}),n),"arc")}setLocation(t){const{center:e,startAngle:i=Vk,endAngle:s=Wk}=this.attribute,n=s-i,r=wt(Ct(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}NW.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},h_(),MM();class VW extends CW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},VW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,sides:s=6,lineStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute,o=(a-r)%(2*Math.PI)==0,l=(a-r)/s;let h;for(let t=0;t<=s;t++){const n=Tt(e,i,r+l*t);0===t?h=`M${n.x},${n.y}`:h+=`L${n.x},${n.y}`,t===s&&o&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},n),"path")}setLocation(t){const{center:e}=this.attribute,i=ae.distancePP(t,e);this.setAttribute("radius",i)}}VW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},h_(),zx();class WW extends CW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},WW.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),s),"arc")}setLocation(t){const{center:e}=this.attribute,i=ae.distancePP(t,e);this.setAttribute("radius",i)}}WW.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};var GW=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{(t.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible)&&i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.polarCrosshair})})),i}constructor(t,e){super(t,e),this.type=r.polarCrosshair,this.name=r.polarCrosshair,this._currValueAngle=new Map,this._currValueRadius=new Map}_showDefaultCrosshairBySpec(){const{categoryField:t,valueField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));if(s){if(1===i){this._currValueAngle.clear();const i={angle:s.valueToPosition(e),radius:s.getOuterRadius()},n=s.coordToPoint(i);this._currValueAngle.set(t,this._getValueByAxis(s,n))}else{this._currValueRadius.clear();const i={angle:s.startAngle,radius:s.valueToPosition(e)},n=s.coordToPoint(i);this._currValueRadius.set(t,this._getValueByAxis(s,n))}this.layoutByValue(3)}}hide(){this._radiusCrosshair&&this._radiusCrosshair.hideAll(),this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll(),this._angleCrosshair&&this._angleCrosshair.hideAll(),this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getAllAxisValues(t,e,i){let s=!1;return t.forEach((t=>{td(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!!this.enable&&(t.forEach(((t,s)=>{const n=t.axis;i.set(s,this._getValueByAxis(n,e))})),!0)}_getValueByAxis(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint(),a=t.positionToData({x:e.x-(i-n),y:e.y-(s-r)}),o={x:t.getCenter().x+this.getLayoutStartPoint().x,y:t.getCenter().y+this.getLayoutStartPoint().y};return{value:a,axis:t,center:o,innerRadius:t.getInnerRadius(),radius:t.getOuterRadius(),startAngle:t.startAngle,endAngle:t.endAngle,distance:ae.distancePP(e,t.getCenter()),coord:t.pointToCoord(e),point:e}}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)this._currValueAngle.clear(),this._currValueRadius.clear(),a&&this._getAllAxisValues(a,{x:n,y:r},this._currValueAngle),o&&this._getAllAxisValues(o,{x:n,y:r},this._currValueRadius),this.layoutByValue(3);else{if(this.enableRemain)return;this.hide()}}layoutByValue(t=3){if(!this.enable)return;const e=gE(this._regions,"polar");if(!e)return;const{angle:i,radius:s}=((t,e,i,s,n,r=!1,a,o)=>{let l={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,label:{visible:!1,text:"",offset:0}},h={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,sides:t.angleAxisHelper.getScale(0).domain().length,label:{visible:!1,text:"",offset:0}};if(s){l.visible=!!e.size;const i=t.angleAxisHelper.getBandwidth(0);e.forEach((e=>{var n,{axis:r,value:a,coord:o}=e,h=GW(e,["axis","value","coord"]);a=null!=a?a:"",Tl(l,h);const d=t.angleAxisHelper.dataToPosition([a]);l.angle=d;const c=r.niceLabelFormatter;(null===(n=s.label)||void 0===n?void 0:n.visible)&&(l.label.visible=!0,l.label.defaultFormatter=c,l.label.text=a,l.label.offset=FE(r.getSpec())),l.startAngle=d-i/2,l.endAngle=d+i/2}))}if(n&&(h.visible=!!i.size,i.forEach((t=>{var e,{axis:i,value:s,coord:r}=t,a=GW(t,["axis","value","coord"]);s=null!=s?s:"";const o=i.niceLabelFormatter;(null===(e=n.label)||void 0===e?void 0:e.visible)&&(h.label.visible=!0,h.label.defaultFormatter=o,h.label.text=s,h.label.offset=FE(i.getSpec())),h.angle=r.angle,h.axis=i,Tl(h,a)}))),r&&!l.visible&&M(a))l=a;else if(l.label.visible&&s&&s.label){const{label:t}=l,{formatMethod:e,formatter:i}=s.label,{formatFunc:n,args:r}=IE(e,i,t.text,{label:t.text,orient:"angle"});n?t.text=n(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}if(r&&!h.visible&&M(o))h=o;else if(h.label.visible&&n&&n.label){const{label:t}=h,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=IE(e,i,t.text,{label:t.text,orient:"radius"});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}return{angle:l,radius:h}})(e,this._currValueAngle,this._currValueRadius,this._angleHair,this._radiusHair,this.enableRemain,this._cacheAngleCrossHairInfo,this._cacheRadiusCrossHairInfo);this.enableRemain&&(this._cacheAngleCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0}),this._cacheRadiusCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0})),t&&(this._layoutRadius(s),this._layoutAngle(i))}_layoutAngle(t){var e;if(t._isCache&&this.enableRemain)return;const i=this.getContainer(),{angle:s,radius:n,label:r,center:a,visible:o}=t;if(o){const o="rect"===this._angleHair.type?"sector":"line",l=((t,e)=>{const{angle:i,innerRadius:s,radius:n,startAngle:r,endAngle:a,center:o}=e;let l;return l="sector"==("rect"===t.type?"sector":"line")?{center:o,innerRadius:s,radius:n,startAngle:r,endAngle:a}:{start:Tt(o,s,i),end:Tt(o,n,i)},l})(this._angleHair,t);if(this._angleCrosshair)this._angleCrosshair.setAttributes(l);else{let t;"line"===o?t=new LW(Object.assign(Object.assign({},l),{lineStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===o&&(t=new NW(Object.assign(Object.assign({},l),{sectorStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1}))),this._angleCrosshair=t,i.add(t)}if(r.visible){const t=function(t){let e="center",i="middle";return e=(t=Lt(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(s),i=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(a,n+r.offset,s)),this._angleHair.label),r),{textStyle:Object.assign(Object.assign({},null===(e=this._angleHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._angleLabelCrosshair,i,(t=>{t.name="crosshair-angle-label",this._angleLabelCrosshair=t}))}else this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}}_layoutRadius(t){var e;if(t._isCache&&this.enableRemain)return;const{center:i,startAngle:s,label:n,visible:r}=t,a=this.getContainer();if(r){const r=this._radiusHair.smooth?"circle":"polygon",o=((t,e)=>{const{center:i,startAngle:s,endAngle:n,distance:r,sides:a,axis:o,point:l,radius:h,innerRadius:d}=e;let c=r;if("polygon"==(t.smooth?"circle":"polygon")){const t=o.getCenter(),e=Ct(t,l),i=(n-s)/a,u=Math.floor((e-s)/i),p=u*i+s,g=Math.min((u+1)*i+s,n),m=Tt(t,r,p),_=Tt(t,r,g),f=function(t,e,i,s){if(!ha(t,e,i,s))return!1;const n=[0,0],r=[0,0],a=[0,0];if(la(n,e,t),la(r,s,i),ht((o=n)[0]-(l=r)[0])+ht(o[1]-l[1])<1e-12)return!0;var o,l;la(a,i,t);const h=yt(a,r)/yt(n,r);return h>=0&&h<=1&&[t[0]+n[0]*h,t[1]+n[1]*h]}([_.x,_.y],[m.x,m.y],[t.x,t.y],[l.x,l.y]);f&&(c=vs(ae.distancePN(l,f[0],f[1])+r,d,h))}return{center:i,startAngle:s,endAngle:n,radius:c,sides:a}})(this._radiusHair,t),l=o.radius;if(this._radiusCrosshair)this._radiusCrosshair.setAttributes(o);else{let t;t="polygon"===r?new VW(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex+1})):new WW(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex})),this._radiusCrosshair=t,a.add(t)}if(n.visible){const t=function(t){let e="center",i="middle";return e=(t=Lt(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(s),r=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(i,l,s)),this._radiusHair.label),n),{textStyle:Object.assign(Object.assign({},null===(e=this._radiusHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._radiusLabelCrosshair,r,(t=>{t.name="crosshair-radius-label",this._radiusLabelCrosshair=t}))}else this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll()}}_parseFieldInfo(){var t;const{categoryField:e,valueField:i}=this._spec;e&&e.visible&&(this._angleHair=this._parseField(e,"categoryField")),i&&i.visible&&(this._radiusHair=this._parseField(i,"valueField"),this._radiusHair.smooth=null===(t=null==i?void 0:i.line)||void 0===t?void 0:t.smooth)}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new SP(e),null==s||s.add(t),i(t)),UE(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._radiusCrosshair,this._radiusLabelCrosshair,this._angleCrosshair,this._angleLabelCrosshair]}}UW.specKey="crosshair",UW.type=r.polarCrosshair;const $W=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(P(a)||P(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>t[r]>=a[0]&&t[r]<=a[1]:t=>o[t[r]+""]||o[t[r]],t.filter(l)},KW=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n}=e.input,{stateField:r,valueField:a}=e.output,o={},l=[];return n.forEach(((t,e)=>{var n;if(P(i[e]))return;const r=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];r&&r.lockStatisticsByDomain&&r.domain.forEach((t=>{o[t]=0})),t.latestData.forEach((t=>{Ra(i[e]).forEach((i=>{P(t[i])||(P(o[t[i]])&&(o[t[i]]=0),P(s[e])||(o[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))})),Object.keys(o).forEach(((t,e)=>{const i={[r]:t};a&&(i[a]=o[t]),l.push(i)})),l};class XW extends qE{get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:this.dataToStatePoint(t),a="percent"===n?e:this.dataToStatePoint(e);this._handleChange(r,a,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-tthis._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t){const e=this._relatedAxisComponent.getScale(),i=this._isReverse(),s=i?[1-this._end,1-this._start]:[this._start,this._end];if(i)switch(t){case"startHandler":e.rangeFactorEnd(s[1]);break;case"endHandler":e.rangeFactorStart(s[0]);break;default:e.rangeFactorStart(s[0],!0),e.rangeFactorEnd(s[1])}else switch(t){case"startHandler":e.rangeFactorStart(s[0]);break;case"endHandler":e.rangeFactorEnd(s[1]);break;default:e.rangeFactorEnd(s[1],!0),e.rangeFactorStart(s[0])}const n=e.rangeFactor();n?(this._start=i?1-n[1]:n[0],this._end=i?1-n[0]:n[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._shouldChange=!0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&this._getAxisBandSize(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate()}else uE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),uE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this._handleChartZoom=t=>{var e,i;if(!this._activeRoam)return;const{zoomDelta:s,zoomX:n,zoomY:r}=t,{x:a,y:o}=this._regions[0].getLayoutStartPoint(),{width:l,height:h}=this._regions[0].getLayoutRect(),d=Math.abs(this._start-this._end),c=null!==(i=null===(e=this._spec.roamZoom)||void 0===e?void 0:e.rate)&&void 0!==i?i:1;if(d>=1&&s<1)return;if(d<=.01&&s>1)return;const u=this._isHorizontal?n:r,p=d*(s-1)*c;let g=p/2,m=p/2;if(u){const t=this._isHorizontal?a:o,e=this._isHorizontal?l:h;g=Math.abs(t-u)/Math.abs(e-t)*p,m=Math.abs(e-u)/Math.abs(e-t)*p}const _=vs(this._start+g,0,1),f=vs(this._end-m,0,1);this._handleChange(Math.min(_,f),Math.max(_,f),!0)},this._handleChartScroll=(t,e)=>{var i;if(!this._activeRoam)return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?ht(s/n)>=.5:ht(n/s)>=.5;this._scrollAttr.reverse||(r=-r),a&&this._handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1);const o=0!==this._start&&1!==this._end;return a&&o},this._handleChartDrag=(t,e)=>{var i;if(!this._activeRoam)return;const[s,n]=t;let r=this._isHorizontal?s:n;this._dragAttr.reverse&&(r=-r),this._handleChartMove(r,null!==(i=this._dragAttr.rate)&&void 0!==i?i:1)},this._handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this._end<1){const s=Math.min(1-this._end,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}else if(t<0&&this._start>0){const s=Math.max(-this._start,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}return!1},this._orient=wd(t),this._isHorizontal="horizontal"===Td(this._orient)}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(M(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):M(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),P(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>t._orient===this._orient));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!Jh(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(M(i)&&(M(i.userId)&&(this._seriesUserId=Ra(i.userId)),M(i.specIndex)&&(this._seriesIndex=Ra(i.specIndex))),M(this._spec.seriesId)){const t=Ra(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(M(this._spec.seriesIndex)){const t=Ra(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(M(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Ra(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(M(this._spec.regionId)){const t=Ra(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}}onDataUpdate(){var t;const e=this._computeDomainOfStateScale(Jh(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&(this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[Fa(t),Ba(t)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];if(this._relatedAxisComponent){const s={};uE(this._regions,(n=>{var r,a;const o="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,l="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(!o||!l)return;const h=o.getAxisId()===this._relatedAxisComponent.id?o:l.getAxisId()===this._relatedAxisComponent.id?l:this._isHorizontal?o:l,d=h===o?l:o,c=Jh(d.getScale(0).type);t.push(n.getRawData());const u=n.getSpec(),p=Ra(u.xField),g=Ra(u.yField),m="cartesian"===n.coordinate?p[0]:null!==(r=u.angleField)&&void 0!==r?r:u.categoryField,_="cartesian"===n.coordinate?g[0]:null!==(a=u.radiusField)&&void 0!==a?a:u.valueField;if(s[n.id]="link"===n.type?"from_xField":h===o?m:_,e.push(s[n.id]),this._valueField){const t="link"===n.type?"from_yField":d===o?m:_;i.push(c?t:null)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=s}else uE(this._regions,(s=>{t.push(s.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:s}=this._option;wp(s,"dataview",b),Ap(s,"dataFilterComputeDomain",KW);const n=new R(s,{name:`${this.type}_${this.id}_data`});n.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new dx(this._option,n),n.reRunAllTransform(),s.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=E({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=E({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=E({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}_statePointToData(t){const e=this._stateScale,i=e.domain();if(Jh(e.type))return this._isReverse()?i[0]+(i[1]-i[0])*(1-t):i[0]+(i[1]-i[0])*t;let s=e.range();this._isReverse()&&(s=s.slice().reverse());const n=s[0]+(s[1]-s[0])*t;return e.invert(n)}dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let s=e.range();return!this._isHorizontal&&Jh(e.type)&&(s=s.slice().reverse()),(i-s[0])/(s[1]-s[0])}_modeCheck(t,e){return"start"===t?"percent"===e&&M(this._spec.start)||"value"===e&&M(this._spec.startValue):"percent"===e&&M(this._spec.end)||"value"===e&&M(this._spec.endValue)}_setStateFromSpec(){var t,e;let i,s;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[t,e]=this._spec.rangeMode;this._modeCheck("start",t)&&this._modeCheck("end",e)&&(i="percent"===t?this._spec.start:this.dataToStatePoint(this._spec.startValue),s="percent"===e?this._spec.end:this.dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this.dataToStatePoint(this._spec.startValue):0,s=this._spec.end?this._spec.end:this._spec.endValue?this.dataToStatePoint(this._spec.endValue):1;this._startValue=this._statePointToData(i),this._endValue=this._statePointToData(s),this._start=i,this._end=s,this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,Jh(this._stateScale.type)&&this._stateScale.domain()[0]!==this._stateScale.domain()[1]&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(this._stateScale.domain()[1]-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(this._stateScale.domain()[1]-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=Jh(e.type),s=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const e=s.map((t=>1*t));this._stateScale.domain(s.length?[Fa(e),Ba(e)]:[0,1],!0).range(t)}else this._stateScale.domain(s,!0).range(t)}else this._stateScale=new Jb,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(Ap(this._option.dataSet,"dataFilterWithNewDomain",$W),uE(this._regions,(t=>{t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>Jh(this._stateScale.type)},level:Fp.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Dm(e,t)||(i.reRender=!0,i.reMake=!0),i}reInit(t){super.reInit(t),this._marks.forEach((t=>{t.getMarks().forEach((t=>{this.initMarkStyleWithSpec(t,this._spec[t.name])}))}))}changeRegions(){}update(t){}resize(t){}_parseDomainFromState(t,e){if(Jh(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),s=i.indexOf(t),n=i.indexOf(e);return i.slice(Math.min(s,n),Math.max(s,n)+1)}_initCommonEvent(){var t,e,i,s,n,r,a;const o={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:M(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a};this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,o),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,o),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,o)}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}onLayoutStart(t,e,i){super.onLayoutStart(t,e,i);const s=this._autoUpdate(t),n=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[n]:s?this[`_${n}`]:0},{[n]:Ly.Built_In}),this._dataUpdating=!1}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_getAxisBandSize(t){const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),d=null==l?void 0:l.getScale(),c=this._getAxisBandSize(h);if(!this._dataUpdating&&td(d.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==c?void 0:c.bandSize))return this._cacheVisibility;let u=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?d.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&d.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==c?void 0:c.bandSize,td(d.type)){c&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=d.rangeFactor())&&void 0!==a?a:[];u=!(P(t)&&P(e)||0===t&&1===e)}else{const[t,e]=null!==(o=d.rangeFactor())&&void 0!==o?o:[this._start,this._end];u=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),u?this.show():this.hide(),this._cacheVisibility=u,u}_getNeedClearVRenderComponents(){return[this._component]}}function qW(t,e,i,s,n){let r=s,a=e;const o=t[e].x,l=t[e].y,h=t[i].x-o,d=t[i].y-l,c=h*h+d*d;let u,p,g,m,_;for(let s=e+1,n=i-1;sr&&(r=g,a=s);r>s&&(a-e>2&&qW(t,e,a,s,n),n.push(t[a],t[a+1]),i-a>2&&qW(t,a,i,s,n))}function ZW(t,e){const i=t.length-1,s=[t[0]];return qW(t,0,i,e,s),s.push(t[i]),s}XA(XW,OI);const JW="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",QW={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:JW,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:JW,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},tG={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var eG;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(eG||(eG={}));var iG=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nt,this._onHandlerPointerDown=(t,e)=>{t.stopPropagation(),"start"===e?(this._activeTag=eG.startHandler,this._activeItem=this._startHandlerMask):"end"===e?(this._activeTag=eG.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===e?(this._activeTag=eG.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=eG.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=eG.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t),"browser"===jo.env&&(jo.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),jo.addEventListener("pointerup",this._onHandlerPointerUp)),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._pointerMove=t=>{t.stopPropagation();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute,r=this.eventPosToStagePos(t),{attPos:a,max:o}=this._layoutCache,l=(r[a]-this._activeCache.lastPos[a])/o;let{start:h,end:d}=this.state;this._activeState&&(this._activeTag===eG.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===eG.startHandler?h+l>d?(h=d,d=h+l,this._activeTag=eG.endHandler):h+=l:this._activeTag===eG.endHandler&&(d+l{t.preventDefault();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute;if(this._activeState&&this._activeTag===eG.background){const e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,s&&this.renderDragMask(),e===this.state.start&&i===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),"browser"===jo.env&&(jo.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),jo.removeEventListener("pointerup",this._onHandlerPointerUp)),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.removeEventListener("pointerup",this._onHandlerPointerUp)};const{position:i,showDetail:s}=t;this._activeCache.startPos=i,this._activeCache.lastPos=i,this._showText="auto"!==s&&s,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return void this.setAttribute("childrenPickable",!1);const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:s=!1,minSpan:n=0,maxSpan:r=1}=this.attribute,a=e-t;a!==this._spanCache&&(s||ar)||(this._spanCache=a,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){return this.stage.eventPointTransform(t)}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:s}=this._layoutCache,{position:n}=this.attribute,r=t[i]-n[i],a=e[i]-n[i],o=Math.min(Math.max(Math.min(r,a)/s,0),1),l=Math.min(Math.max(Math.max(r,a)/s,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:vs(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+i),y:e.y,width:this._activeState&&this._activeTag===eG.background&&Math.abs(this.dragMaskSize())||0,height:s},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.x,y:vs(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+s),width:i,height:this._activeState&&this._activeTag===eG.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}isTextOverflow(t,e,i){if(!e)return!1;if(this._isHorizontal){if("start"===i){if(e.x1t.x2)return!0}else if("start"===i){if(e.y1t.y2)return!0;return!1}setTextAttr(t,e){const{startTextStyle:i,endTextStyle:s}=this.attribute,{formatMethod:n}=i,r=iG(i,["formatMethod"]),{formatMethod:a}=s,o=iG(s,["formatMethod"]),{start:l,end:h}=this.state;this._startValue=this._statePointToData(l),this._endValue=this._statePointToData(h);const{position:d,width:c,height:u}=this.getLayoutAttrFromConfig(),p=n?n(this._startValue):this._startValue,g=a?a(this._endValue):this._endValue,m={x1:d.x,y1:d.y,x2:d.x+c,y2:d.y+u};let _,f,v,y;this._isHorizontal?(_={x:d.x+l*c,y:d.y+u/2},f={x:d.x+h*c,y:d.y+u/2},v={textAlign:this.isTextOverflow(m,t,"start")?"left":"right",textBaseline:"middle"},y={textAlign:this.isTextOverflow(m,e,"end")?"right":"left",textBaseline:"middle"}):(_={x:d.x+c/2,y:d.y+l*u},f={x:d.x+c/2,y:d.y+h*u},v={textAlign:"center",textBaseline:this.isTextOverflow(m,t,"start")?"top":"bottom"},y={textAlign:"center",textBaseline:this.isTextOverflow(m,e,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,E({},r,{text:p,x:_.x,y:_.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:v}),`data-zoom-start-text-${d}`),this._endText=this.maybeAddLabel(this._container,E({},o,{text:g,x:f.x,y:f.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:y}),`data-zoom-end-text-${d}`)}renderText(){let t=null,e=null;this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds,this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;const{x1:i,x2:s,y1:n,y2:r}=t,{dx:a=0,dy:o=0}=this.attribute.startTextStyle;if((new It).set(i,n,s,r).intersects(e)){const t="bottom"===this.attribute.orient||"right"===this.attribute.orient?-1:1;this._isHorizontal?this._startText.setAttribute("dy",o+t*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",a+t*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",o):this._startText.setAttribute("dx",a)}getLayoutAttrFromConfig(){var t,e,i,s,n,r;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:a,size:o,orient:l,middleHandlerStyle:h={},startHandlerStyle:d={},endHandlerStyle:c={},backgroundStyle:u={}}=this.attribute,{width:p,height:g}=o,m=null!==(e=null===(t=h.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let _,f,v;h.visible?this._isHorizontal?(_=p,f=g-m,v={x:a.x,y:a.y+m}):(_=p-m,f=g,v={x:a.x+("left"===l?m:0),y:a.y}):(_=p,f=g,v=a);const y=null!==(i=d.size)&&void 0!==i?i:this._isHorizontal?f:_,b=null!==(s=c.size)&&void 0!==s?s:this._isHorizontal?f:_;return d.visible&&(this._isHorizontal?(_-=(y+b)/2,v={x:v.x+y/2,y:v.y}):(f-=(y+b)/2,v={x:v.x,y:v.y+y/2})),f+=null!==(n=u.lineWidth/2)&&void 0!==n?n:1,_+=null!==(r=u.lineWidth/2)&&void 0!==r?r:1,this._layoutAttrFromConfig={position:v,width:_,height:f},this._layoutAttrFromConfig}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x,S,M,k,A,w,T,C,L,E,P,D,O;this._layoutAttrFromConfig=null;const{orient:R,backgroundStyle:I,backgroundChartStyle:B={},selectedBackgroundStyle:F={},selectedBackgroundChartStyle:Y={},middleHandlerStyle:j={},startHandlerStyle:H={},endHandlerStyle:z={},brushSelect:N,zoomLock:V}=this.attribute,{start:W,end:G}=this.state,{position:U,width:$,height:K}=this.getLayoutAttrFromConfig(),X=null!==(t=H.triggerMinSize)&&void 0!==t?t:40,q=null!==(e=z.triggerMinSize)&&void 0!==e?e:40,Z=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=Z,this._background=Z.createOrUpdateChild("background",Object.assign(Object.assign({x:U.x,y:U.y,width:$,height:K,cursor:N?"crosshair":"auto"},I),{pickable:!V&&(null===(i=I.pickable)||void 0===i||i)}),"rect"),(null===(s=B.line)||void 0===s?void 0:s.visible)&&this.setPreviewAttributes("line",Z),(null===(n=B.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",Z),N&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x+W*$,y:U.y,width:(G-W)*$,height:K,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(r=Y.pickable)||void 0===r||r)}),"rect"):this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x,y:U.y+W*K,width:$,height:(G-W)*K,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(a=F.pickable)||void 0===a||a)}),"rect"),(null===(o=Y.line)||void 0===o?void 0:o.visible)&&this.setSelectedPreviewAttributes("line",Z),(null===(l=Y.area)||void 0===l?void 0:l.visible)&&this.setSelectedPreviewAttributes("area",Z),this._isHorizontal){if(j.visible){const t=(null===(h=j.background)||void 0===h?void 0:h.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:U.x+W*$,y:U.y-t,width:(G-W)*$,height:t},null===(d=j.background)||void 0===d?void 0:d.style),{pickable:!V&&(null===(p=null===(u=null===(c=j.background)||void 0===c?void 0:c.style)||void 0===u?void 0:u.pickable)||void 0===p||p)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:U.x+(W+G)/2*$,y:U.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(m=null===(g=j.icon)||void 0===g?void 0:g.symbolType)&&void 0!==m?m:"square"},j.icon),{pickable:!V&&(null===(_=j.icon.pickable)||void 0===_||_)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+W*$,y:U.y+K/2,size:K,symbolType:null!==(f=H.symbolType)&&void 0!==f?f:"square"},tG.horizontal),H),{pickable:!V&&(null===(v=H.pickable)||void 0===v||v)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+G*$,y:U.y+K/2,size:K,symbolType:null!==(y=z.symbolType)&&void 0!==y?y:"square"},tG.horizontal),z),{pickable:!V&&(null===(b=z.pickable)||void 0===b||b)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),X),e=Math.max(this._startHandler.AABBBounds.height(),X),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+W*$-t/2,y:U.y+K/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},tG.horizontal),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+G*$-i/2,y:U.y+K/2-s/2,width:i,height:s,fill:"white",fillOpacity:0,zIndex:999},tG.horizontal),{pickable:!V}),"rect")}else{if(j.visible){const t=(null===(x=j.background)||void 0===x?void 0:x.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===R?U.x-t:U.x+$,y:U.y+W*K,width:t,height:(G-W)*K},null===(S=j.background)||void 0===S?void 0:S.style),{pickable:!V&&(null===(A=null===(k=null===(M=j.background)||void 0===M?void 0:M.style)||void 0===k?void 0:k.pickable)||void 0===A||A)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===R?U.x-t/2:U.x+$+t/2,y:U.y+(W+G)/2*K,angle:Math.PI/180*90,symbolType:null!==(T=null===(w=j.icon)||void 0===w?void 0:w.symbolType)&&void 0!==T?T:"square",strokeBoundsBuffer:0},j.icon),{pickable:!V&&(null===(L=null===(C=j.icon)||void 0===C?void 0:C.pickable)||void 0===L||L)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+W*K,size:$,symbolType:null!==(E=H.symbolType)&&void 0!==E?E:"square"},tG.vertical),H),{pickable:!V&&(null===(P=H.pickable)||void 0===P||P)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+G*K,size:$,symbolType:null!==(D=z.symbolType)&&void 0!==D?D:"square"},tG.vertical),z),{pickable:!V&&(null===(O=z.pickable)||void 0===O||O)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),X),e=Math.max(this._startHandler.AABBBounds.height(),X),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+$/2+t/2,y:U.y+W*K-e/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},tG.vertical),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+$/2+i/2,y:U.y+G*K-s/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},tG.vertical),{pickable:!V}),"rect")}this._showText&&this.renderText()}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();let n,r;return this._isHorizontal?(n=[{x:e.x,y:e.y+s}],r=[{x:e.x+i,y:e.y+s}]):"left"===t?(n=[{x:e.x+i,y:e.y}],r=[{x:e.x+i,y:e.y+s}]):(n=[{x:e.x,y:e.y+s}],r=[{x:e.x,y:e.y}]),{basePointStart:n,basePointEnd:r}}simplifyPoints(t){var e;return t.length>1e4?function(t,e){if(t.length<=10)return t;const i=void 0!==e?e*e:1;return ZW(t=function(t,e){let i,s,n=t[0].x,r=t[0].y;const a=[t[0]];for(let o=1,l=t.length;oe&&(n=t[o].x,r=t[o].y,a.push(t[o]));return t[t.length-1].x===n&&t[t.length-1].y===r||a.push(t[t.length-1]),a}(t,i),i)}(t,null!==(e=this.attribute.tolerance)&&void 0!==e?e:this._previewData.length/1e4):t}getPreviewLinePoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i={}}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i={}}=this.attribute,{start:s,end:n}=this.state,{position:r,width:a,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?r.x+s*a:r.x,y:this._isHorizontal?r.y:r.y+s*o,width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?r.x+s*a:r.x),y:-(this._isHorizontal?r.y:r.y+s*o),width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let s=this.find((t=>t.name===i),!0);return s?s.setAttributes(e):(s=new SP(e),s.name=i),t.add(s),s}setStartAndEnd(t,e){const{start:i,end:s}=this.attribute;M(t)&&M(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&s===this.state.end||(this.setStateAttr(t,e,!0),this._dispatchEvent("change",{start:t,end:e,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,i,s;const{middleHandlerStyle:n={}}=this.attribute,r=null!==(e=null===(t=n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,a=null!==(s=null===(i=n.icon)||void 0===i?void 0:i.size)&&void 0!==s?s:10;return Math.max(r,...Ra(a))}setPreviewPointsX(t){rs(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){rs(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){rs(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){rs(t)&&(this._previewPointsY1=t)}setStatePointToData(t){rs(t)&&(this._statePointToData=t)}}nG.defaultAttributes=QW;class rG extends XE{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=Tl({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=y(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}class aG extends XW{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!y(e))return[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.dataZoom}];const i=[];return e.forEach(((t,e)=>{i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.dataZoom})})),i}constructor(t,e){var i;super(t,e),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=rG,this.specKey="dataZoom",this.layoutZIndex=Ty.DataZoom,this.layoutLevel=Cy.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),P(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),P(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,c=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=c?this._spec.endHandler.style.size:0}onLayoutEnd(t){this._updateScaleRange(),this._isReverse()&&!this._isReverseCache&&(this._isReverseCache=this._isReverse(),this.effect.onZoomChange()),!1!==this._cacheVisibility&&super.onLayoutEnd(t)}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new $b;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale||!this._valueScale)return;let s;const n=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,r=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,n+this._startHandlerSize/2];this._isHorizontal?(s=this._visible?[this._startHandlerSize/2,this._computeWidth()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeHeight()-this._middleHandlerSize,0])):"left"===this.layoutOrient?(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeWidth()-this._middleHandlerSize,0])):(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([0,this._computeWidth()-this._middleHandlerSize])),this._component&&!1!==this._cacheVisibility&&this._component.setAttributes({size:{width:this._computeWidth(),height:this._computeHeight()},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[Fa(e),Ba(e)]:null}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:h(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height-(this._startHandlerSize+this._endHandlerSize)/2}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return!(Jh(t.type)&&e[0]===e[1]||td(t.type)&&1===(i=e,i&&y(i)?Array.from(new Set(Ra(i))):i).length);var i}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this.getLayoutRect().width,height:this.getLayoutRect().height},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:M(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance},this._getComponentAttrs(t))}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e)&&!1!==this._spec.showBackgroundChart,s=this._getAttrs(i);if(this._component)this._component.setAttributes(s);else{const t=this.getContainer();this._component=new nG(s),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>this._statePointToData(t))),this._component.addEventListener("change",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component),this._updateScaleRange()}}}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange){i&&this._component&&this._component.setStartAndEnd(t,e),this._start=t,this._end=e;const n=this._statePointToData(t),r=this._statePointToData(e);(rs(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,n,r):this._handleStateChange(n,r,s))&&this.event.emit(jd.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),null===(t=this._component)||void 0===t||t.setPreviewData(e.latestData),this._valueScale){const t=this._computeDomainOfValueScale();t&&this._valueScale.domain(t)}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,d,c;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:m={},selectedBackgroundChart:_={}}=this._spec;return{backgroundStyle:OE(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:OE(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:OE(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:OE(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:OE(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:OE(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:OE(g.style)},selectedBackgroundStyle:OE(this._spec.selectedBackground.style),dragMaskStyle:OE(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:Tl(OE(null===(l=m.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},OE(null===(h=m.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Tl(OE(null===(d=_.line)||void 0===d?void 0:d.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},OE(null===(c=_.area)||void 0===c?void 0:c.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=IE(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}}aG.type=r.dataZoom,aG.transformerConstructor=rG,aG.specKey="dataZoom";class oG extends XW{static getSpecInfo(t){const e=t[this.specKey];if(P(e))return;if(!y(e))return[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.scrollBar}];const i=[];return e.forEach(((t,e)=>{i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.scrollBar})})),i}constructor(t,e){var i;super(t,e),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=Ty.DataZoom,this.layoutLevel=Cy.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(t){var e,i;this._updateScaleRange(),null===(i=(e=this.effect).onZoomChange)||void 0===i||i.call(e),super.onLayoutEnd(t)}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return h(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:M(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new RV(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_handleChange(t,e,i){super._handleChange(t,e,i);const s=gd(this._start,t)&&gd(this._end,e);if(this._shouldChange&&!s){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;const s=this._statePointToData(t),n=this._statePointToData(e);(rs(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,s,n):this._handleStateChange(this._statePointToData(t),this._statePointToData(e)))&&this.event.emit(jd.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){}_initCommonEvent(){super._initCommonEvent(),this._component&&this._component.on("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])}))}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return P(i)||(s.padding=i),Im(null==t?void 0:t.style)||(s.railStyle=OE(t.style)),Im(null==e?void 0:e.style)||(s.sliderStyle=OE(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}oG.type=r.scrollBar,oG.specKey="scrollBar";const lG=(t,e)=>{const{datum:i,title:s,content:n}=e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Ra(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},hG={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};h_(),of(),JM();class dG extends Pk{constructor(){super(...arguments),this.name="indicator"}_renderText(t,e,i,s,n,r){if(!1!==e.visible){const a=E({},Gd(hG,n),e.style,{visible:e.visible});a.lineHeight=M(a.lineHeight)?a.lineHeight:a.fontSize,e.formatMethod&&(a._originText=a.text,a.text=e.formatMethod(a.text,a));const o=Qk(a);return o.name=r,t.appendChild(o),e.autoFit&&Wo(i)&&this._setLocalAutoFit(i,o,e),e.autoLimit&&Wo(s)&&o.setAttribute("maxLineWidth",i),o}}render(){var t,e;if(this.removeAllChild(!0),!0!==this.attribute.visible)return;const{title:i={},content:s,size:n,limitRatio:r=1/0}=this.attribute,a=Math.min(n.width,n.height)*r,o=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1,pickable:null===(t=this.attribute.pickable)||void 0===t||t},"group");if(M(i)&&(this._title=this._renderText(o,i,a,r,"title.style","indicator-title")),M(s)){const t=Ra(s),e=[];t.forEach(((t,i)=>{!1!==t.visible&&e.push(this._renderText(o,t,a,r,"content.style","indicator-content-"+i))})),this._content=e}this._setGlobalAutoFit(a),this._setYPosition();const l=null!==(e=null==o?void 0:o.AABBBounds.height())&&void 0!==e?e:0;o.setAttribute("y",n.height/2-l/2),o.setAttribute("x",n.width/2)}_setLocalAutoFit(t,e,i){var s,n,r,a,o,l,h,d,c;if("default"!==(null!==(s=i.fitStrategy)&&void 0!==s?s:"default"))return;const u=qk(null!==(r=null===(n=i.style)||void 0===n?void 0:n.text)&&void 0!==r?r:"",null!==(a=i.style)&&void 0!==a?a:{},null===(l=null===(o=this.stage)||void 0===o?void 0:o.getTheme())||void 0===l?void 0:l.text).width;if(u>0){const s=t*(null!==(h=i.fitPercent)&&void 0!==h?h:.5)/u,n=Math.floor((null!==(c=null===(d=i.style)||void 0===d?void 0:d.fontSize)&&void 0!==c?c:20)*s);e.setAttribute("fontSize",n),e.setAttribute("lineHeight",M(i.style.lineHeight)?i.style.lineHeight:n)}}_setGlobalAutoFit(t){var e,i,s,n,r,a,o;const l=t/2,h=[];let d=0;const c=null!==(e=this.attribute.title)&&void 0!==e?e:{};c.autoFit&&"inscribed"===c.fitStrategy?(this._title.setAttribute("fontSize",12),h.push({text:this._title,spec:null!==(i=this.attribute.title)&&void 0!==i?i:{}})):d+=null!==(a=null===(r=null===(n=null===(s=this._title)||void 0===s?void 0:s.AABBBounds)||void 0===n?void 0:n.height)||void 0===r?void 0:r.call(n))&&void 0!==a?a:0;const u=null!==(o=c.space)&&void 0!==o?o:0;if(d+=u,Ra(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i,s,n,r;const a=this._content[e];t.autoFit&&"inscribed"===t.fitStrategy?(a.setAttribute("fontSize",12),h.push({text:a,spec:t})):d+=null!==(n=null===(s=null===(i=null==a?void 0:a.AABBBounds)||void 0===i?void 0:i.height)||void 0===s?void 0:s.call(i))&&void 0!==n?n:0;const o=null!==(r=t.space)&&void 0!==r?r:0;d+=o})),h.length<=0)return;const p=12/h.reduce(((t,e)=>Math.max(t,e.text.AABBBounds.width())),0)*h.length,g=d/2,m=p**2+1,_=2*g*p,f=g**2-l**2,v=2*(p*((-_+Math.sqrt(_**2-4*m*f))/(2*m))+g),y=(v-d)/h.length;Wo(v)&&h.forEach((t=>{var e;const i=null===(e=t.spec.style)||void 0===e?void 0:e.lineHeight;t.text.setAttribute("fontSize",y),t.text.setAttribute("lineHeight",M(i)?i:y)}))}_setYPosition(){var t,e,i,s,n,r;let a=0;const o=null!==(s=null===(i=null===(e=null===(t=this._title)||void 0===t?void 0:t.AABBBounds)||void 0===e?void 0:e.height)||void 0===i?void 0:i.call(e))&&void 0!==s?s:0,l=null!==(r=null===(n=this.attribute.title)||void 0===n?void 0:n.space)&&void 0!==r?r:0;Ra(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i;const s=this._content[e];s.setAttribute("y",o+l+a);const n=null!==(i=t.space)&&void 0!==i?i:0;a+=s.AABBBounds.height()+n}))}}class cG extends qE{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=Ty.Indicator,this.layoutLevel=Cy.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){if(this.type!==cG.type)return null;const e=t[this.specKey];if(!y(e))return!1===e.visible?[]:[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.indicator}];const i=[];return e.forEach(((t,e)=>{t&&!1!==t.visible&&i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.indicator})})),i}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Ra(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Ra(this._spec.regionId),Ra(this._spec.regionIndex))}onRender(t){}changeRegions(t){}initEvent(){var t;if(this._option.disableTriggerEvent)return;if("none"===this._spec.trigger)return;const e=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();e&&("hover"===this._spec.trigger?(e.addEventListener("element-highlight:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-highlight:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))):(e.addEventListener("element-select:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-select:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){Ap(this._option.dataSet,"indicatorFilter",lG);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:()=>this._activeDatum}}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new dx(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:n}=t.getLayoutStartPoint(),r=this._spec,{content:a,offsetX:o,offsetY:l,limitRatio:h,title:d}=r,c=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=Tl({},this._theme.content,t);u.push({visible:!1!==e.visible&&(!e.field||null!==this._activeDatum),space:e.space||this._gap,autoLimit:e.autoLimit,autoFit:e.autoFit,fitPercent:e.fitPercent,fitStrategy:e.fitStrategy,style:Object.assign(Object.assign({},DE(ZE(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:e,height:i},zIndex:this.layoutZIndex,x:s,y:n,dx:o?rl(o,this._computeLayoutRadius()):0,dy:l?rl(l,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==d.visible&&(!M(d.field)||null!==this._activeDatum),space:d.space||this._gap,autoLimit:d.autoLimit,autoFit:d.autoFit,fitPercent:d.fitPercent,fitStrategy:d.fitStrategy,style:Object.assign(Object.assign({},DE(ZE(d.style,["text"]),this._activeDatum)),{text:this._createText(d.field,d.style.text)})},content:u},c)}_createOrUpdateIndicatorComponent(t){if(this._indicatorComponent)Dm(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new dG(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",((t,e)=>this._delegateEvent(this._indicatorComponent,t,e)))}return this._cacheAttrs=t,this._indicatorComponent}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":rs(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>e.id===t))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}cG.type=r.indicator,cG.specKey="indicator";const uG=["sum","average","min","max","variance","standardDeviation","median"];function pG(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=Fa(s),r=Ba(s);return er}function gG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.x)&&pG(e,t.x,i)&&(null===(o=null==l?void 0:(a=l.getXAxisHelper()).setExtendDomain)||void 0===o||o.call(a,"marker_xAxis_extend",t.x)),d=tl(t.x)?vG(t.x,n)+r.x:l.getXAxisHelper().dataToPosition([t.x])+r.x,d}function mG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.y)&&pG(e,t.y,i)&&(null===(o=null===(a=l.getYAxisHelper())||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",t.y)),d=tl(t.y)?vG(t.y,n)+r.y:l.getYAxisHelper().dataToPosition([t.y])+r.y,d}function _G(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.angle)&&pG(e,t.angle,i)&&(null===(r=null===(n=a.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_angleAxis_extend",t.angle)),a.angleAxisHelper.dataToPosition([t.angle])}function fG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.radius)&&pG(e,t.radius,i)&&(null===(r=null===(n=a.radiusAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_radiusAxis_extend",t.radius)),a.radiusAxisHelper.dataToPosition([t.radius])}function vG(t,e){return Number(t.substring(0,t.length-1))*e/100}function yG(t){return uG.includes(t)}function bG(t,e,i,s,n){const r=e.getRegion(),a=r.getLayoutStartPoint(),o=i.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),d=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),c={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},u=[],p=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,g=s.getXAxisHelper().getScale(0).domain(),m=s.getYAxisHelper().getScale(0).domain();return p.forEach((t=>{const e=M(t.x),i=M(t.y);if(e&&i){const e=gG(t,g,n,c,h,a),i=mG(t,m,n,c,d,a);u.push([{x:e,y:i}])}else if(e){const e=gG(t,g,n,c,h,a),i=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),s=Math.min(a.y,l.y);u.push([{x:e,y:i},{x:e,y:s}])}else if(i){const e=Math.min(a.x,l.x),i=mG(t,m,n,c,d,a),s=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);u.push([{x:e,y:i},{x:s,y:i}])}})),u}function xG(t,e,i,s,n){const r={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),d=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return o.forEach((t=>{const e=M(t.angle),i=M(t.radius);if(e&&i){const e=_G(t,l,n,r),i=fG(t,h,n,r);a.push([{angle:e,radius:i}])}else if(e){const e=_G(t,l,n,r);a.push([{angle:e,radius:-d},{angle:e,radius:d}])}else if(i){const e=fG(t,h,n,r);a.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),a}function SG(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{M(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}function MG(t,e,i,s){const n=[],r=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,a=y(s);return r.forEach(((t,r)=>{var o,l,d,c;const u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,p=u.getRegion(),g=p.getLayoutStartPoint(),{width:m,height:_}=p.getLayoutRect();let f=0,v=0;if(s){const t=a?s[r]:s,e=t.x,i=t.y;e&&(f=tl(e)?Number(e.substring(0,e.length-1))*m/100:e),i&&(v=tl(i)?Number(i.substring(0,i.length-1))*_/100:i)}const y=u.getXAxisHelper().getScale(0).domain(),b=u.getYAxisHelper().getScale(0).domain(),x=Ra(t.x),S=Ra(t.y);1===x.length&&h(x[0])&&pG(y,x[0],i)&&(null===(l=null===(o=u.getXAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,"marker_xAxis_extend",x[0])),1===S.length&&h(S[0])&&pG(b,S[0],i)&&(null===(c=null===(d=u.getYAxisHelper())||void 0===d?void 0:d.setExtendDomain)||void 0===c||c.call(d,"marker_yAxis_extend",S[0])),n.push({x:u.getXAxisHelper().dataToPosition(x)+g.x+f,y:u.getYAxisHelper().dataToPosition(S)+g.y+v})})),n}function kG(t,e,i){const s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var n,r,a,o;const l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,d=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),u=Ra(t.angle),p=Ra(t.radius);1===u.length&&h(u[0])&&pG(d,u[0],i)&&(null===(r=null===(n=l.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_xAxis_extend",u[0])),1===p.length&&h(p[0])&&pG(c,p[0],i)&&(null===(o=null===(a=l.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",p[0])),s.push({angle:l.angleAxisHelper.dataToPosition(u),radius:l.radiusAxisHelper.dataToPosition(p)})})),s}function AG(t,e,i){let{x:s,y:n}=t;return tl(s)&&(s=vG(s,e)),tl(n)&&(n=vG(n,i)),{x:s,y:n}}function wG(t,e,i){let s;if(s=rs(t)?Ra(t(e.getData().getLatestData(),e)):Ra(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=AG(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>AG(t,n,r)))}function TG(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.xi&&(i=r.x+a.width),r.yn&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function CG(t,e){const{labelBackground:i={},style:s,shape:n}=t,r=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nn&&(d=n-l),h>r&&(c=r-h),{dx:d,dy:c}}function YG(t,e){const{dx:i,dy:s}=FG(t,e),{dx:n=0,dy:r=0}=t.attribute;i&&t.setAttribute("dx",i+n),s&&t.setAttribute("dy",s+r)}class jG extends Pk{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=PP(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=DP(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=OP(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const s=ns(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:E({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:E({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:E({},this.defaultUpdateAnimation,s,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:s,select:n}=this.attribute;s&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),n&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;let n;if(s){const s=Gr.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));n=Gr.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),s.add(n),this._containerClip=s,this.add(s)}else n=Gr.group({x:0,y:0,pickable:!1}),this.add(n);n.name="marker-container",this._container=n}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:s?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}function HG(t,e,i,s){var n,r,a,o,l;if(!t)return;null===(n=null==t?void 0:t.animates)||void 0===n||n.forEach((t=>t.stop("end")));const h=null!==(a=null===(r=t.attribute)||void 0===r?void 0:r.fillOpacity)&&void 0!==a?a:1,d=null!==(l=null===(o=t.attribute)||void 0===o?void 0:o.strokeOpacity)&&void 0!==l?l:1;t.setAttributes({fillOpacity:0,strokeOpacity:0}),t.animate().wait(e).to({fillOpacity:h,strokeOpacity:d},i,s)}function zG(t,e,i,s){t&&(HG(t.startSymbol,e,i,s),t.lines.forEach((t=>HG(t,e,i,s))),HG(t.line,e,i,s),HG(t.endSymbol,e,i,s))}function NG(t,e,i,s){t&&(HG(t.getTextShape(),e,i,s),HG(t.getBgRect(),e,i,s))}function VG(t,e,i,s){var n,r,a,o;t&&(t.setAttributes({fillOpacity:null!==(r=null===(n=t.attribute)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(o=null===(a=t.attribute)||void 0===a?void 0:a.strokeOpacity)&&void 0!==o?o:1}),t.animate().wait(e).to({fillOpacity:0,strokeOpacity:0},i,s))}function WG(t,e,i,s){t&&(VG(t.startSymbol,e,i,s),t.lines.forEach((t=>VG(t,e,i,s))),VG(t.line,e,i,s),VG(t.endSymbol,e,i,s))}function GG(t,e,i,s){t&&(VG(t.getTextShape(),e,i,s),VG(t.getBgRect(),e,i,s))}function UG(t,e,i,s,n){const r=.1*i,a=.7*i,o=.1*i,l=.1*i;HG(t.startSymbol,s,r,n),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const o=a/t.lines.length;e.animate().wait(s+r+i*o).to({clipRange:1},o,n)})),HG(t.endSymbol,s+r+a,o,n),HG(e.getTextShape(),s+r+a+o,l,n),HG(e.getBgRect(),s+r+a+o,l,n)}function $G(t,e,i,s,n){zG(t,s,i,n),NG(e,s,i,n)}function KG(t,e,i,s,n){HG(t,s,i,n),NG(e,s,i,n)}function XG(t,e,i,s,n){HG(t,s,i,n),NG(e,s,i,n)}function qG(t,e,i,s,n,r){var a;zG(t,n,s,r),HG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?NG(i,n,s,r):HG(i,n,s,r)}function ZG(t,e,i,s,n,r){var a;const o=.1*s,l=.65*s,h=.05*s,d=.1*s,c=.1*s;HG(t.startSymbol,n,o,r),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const s=l/t.lines.length;e.animate().wait(n+o+i*s).to({clipRange:1},s,r)})),HG(e,n+o+l,h,r),HG(t.endSymbol,n+o+l+h,d,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?(HG(i.getTextShape(),n+o+l+h+d,c,r),HG(i.getBgRect(),n+o+l+d,c,r)):HG(i,n+o+l+d,c,r)}function JG(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"clipIn"===i?UG(t,e,s,r,a):"fadeIn"===i&&$G(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"clipIn"===i?UG(t,e,s,n,a):"fadeIn"===i&&$G(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){WG(t,s,i,n),GG(e,s,i,n)}(t,e,i,s,n)}}function QG(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&KG(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&KG(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){VG(t,s,i,n),GG(e,s,i,n)}(t,e,i,s,n)}}function tU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&XG(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&XG(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){VG(t,s,i,n),GG(e,s,i,n)}(t,e,i,s,n)}}function eU(t,e,i,s){const[n,r]=t,{enter:a,update:o,exit:l}=i;if("enter"===s){const{type:t,duration:i,delay:s,easing:o}=a;"fadeIn"===t?qG(n,r,e,i,s,o):"callIn"===t&&ZG(n,r,e,i,s,o)}else if("update"===s){const{type:t,duration:i,delay:s,easing:a}=o;"fadeIn"===t?qG(n,r,e,i,s,a):"callIn"===t&&ZG(n,r,e,i,s,a)}else if("exit"===s){const{duration:t,delay:i,easing:s}=l;!function(t,e,i,s,n,r){var a;WG(t,n,s,r),VG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?GG(i,n,s,r):VG(i,n,s,r)}(n,r,e,t,i,s)}}const iU={type:"clipIn",duration:500,easing:"linear",delay:0},sU={type:"fadeIn",duration:500,easing:"linear",delay:0},nU={type:"callIn",duration:500,easing:"linear",delay:0},rU={type:"fadeOut",duration:500,easing:"linear",delay:0};class aU extends jG{constructor(){super(...arguments),this.name="markCommonLine",this.defaultUpdateAnimation=iU,this.defaultExitAnimation=rU}getLine(){return this._line}getLabel(){return this._label}setLabelPos(){const{label:t={},limitRect:e}=this.attribute,{position:i,confine:s,autoRotate:n}=t,r=this.getPointAttrByPosition(i),a=i.toString().toLocaleLowerCase().includes("start")?this._line.getStartAngle()||0:this._line.getEndAngle()||0;if(this._label.setAttributes(Object.assign(Object.assign({},r.position),{angle:n?this.getRotateByAngle(r.angle):0,textStyle:Object.assign(Object.assign({},this.getTextStyle(i,a,n)),t.textStyle)})),e&&s){const{x:t,y:i,width:s,height:n}=e;YG(this._label,{x1:t,y1:i,x2:t+s,y2:i+n})}}initMarker(t){const{label:e,state:i}=this.attribute,s=this.createSegment();s.name="mark-common-line-line",this._line=s,t.add(s);const n=new SP(Object.assign(Object.assign({},e),{state:{panel:E({},$k,null==i?void 0:i.labelBackground),text:E({},$k,null==i?void 0:i.label)}}));n.name="mark-common-line-label",this._label=n,t.add(n),this.setLabelPos()}updateMarker(){const{label:t,state:e}=this.attribute;this.setLineAttributes(),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},t),{state:{panel:E({},$k,null==e?void 0:e.labelBackground),text:E({},$k,null==e?void 0:e.label)}})),this.setLabelPos())}}var oU,lU,hU,dU;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(oU||(oU={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom"}(lU||(lU={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(hU||(hU={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(dU||(dU={}));const cU=.001,uU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:oU.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},pU={postiveXAxis:{start:{textAlign:"left",textBaseline:"middle"},startTop:{textAlign:"left",textBaseline:"bottom"},startBottom:{textAlign:"left",textBaseline:"top"},insideStart:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"right",textBaseline:"bottom"},insideStartBottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},endTop:{textAlign:"left",textBaseline:"bottom"},endBottom:{textAlign:"left",textBaseline:"top"},insideEnd:{textAlign:"right",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},negativeXAxis:{start:{textAlign:"right",textBaseline:"middle"},startTop:{textAlign:"right",textBaseline:"bottom"},startBottom:{textAlign:"right",textBaseline:"top"},insideStart:{textAlign:"left",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"right",textBaseline:"middle"},endTop:{textAlign:"right",textBaseline:"bottom"},endBottom:{textAlign:"right",textBaseline:"top"},insideEnd:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"left",textBaseline:"bottom"},insideEndBottom:{textAlign:"left",textBaseline:"top"}}},gU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:hU.arcOuterMiddle,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},mU={interactive:!0,label:{position:lU.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},_U={interactive:!0,label:{position:hU.arcOuterMiddle,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},fU={arcInnerStart:{textAlign:"center",textBaseline:"bottom"},arcInnerEnd:{textAlign:"center",textBaseline:"bottom"},arcInnerMiddle:{textAlign:"center",textBaseline:"bottom"},arcOuterStart:{textAlign:"center",textBaseline:"top"},arcOuterEnd:{textAlign:"center",textBaseline:"top"},arcOuterMiddle:{textAlign:"center",textBaseline:"top"},center:{textAlign:"center",textBaseline:"middle"}},vU={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},yU={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};function bU(){xU._animate=JG}BG(),cP();class xU extends aU{markerAnimate(t){xU._animate&&this._animationConfig&&xU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},xU.defaultAttributes,t)),this.name="markLine"}getPointAttrByPosition(t){var e;const{label:i={}}=this.attribute,{refX:s=0,refY:n=0}=i,r=this._line.getMainSegmentPoints(),a=null!==(e=this._line.getEndAngle())&&void 0!==e?e:0,o=(Hk(a),a),l=s*Math.cos(o)+n*Math.cos(o-Math.PI/2),h=s*Math.sin(o)+n*Math.sin(o-Math.PI/2);return t.includes("start")||t.includes("Start")?{position:{x:r[0].x+l,y:r[0].y+h},angle:o}:t.includes("middle")||t.includes("Middle")?{position:{x:(r[0].x+r[r.length-1].x)/2+l,y:(r[0].y+r[r.length-1].y)/2+h},angle:o}:{position:{x:r[r.length-1].x+l,y:r[r.length-1].y+h},angle:o}}getRotateByAngle(t){var e;return(Hk(t)?t:t-Math.PI)+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}getTextStyle(t,e,i){return zk(Math.abs(e),Math.PI/2,cU)||zk(Math.abs(e),3*Math.PI/2,cU)?Nk(i,e,t):Hk(e)?pU.postiveXAxis[t]:pU.negativeXAxis[t]}createSegment(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;return new pP({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,pickable:!1,state:{line:E({},$k,null==a?void 0:a.line),startSymbol:E({},$k,null==a?void 0:a.lineStartSymbol),endSymbol:E({},$k,null==a?void 0:a.lineEndSymbol)}})}setLineAttributes(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:{line:E({},$k,null==a?void 0:a.line),startSymbol:E({},$k,null==a?void 0:a.lineStartSymbol),endSymbol:E({},$k,null==a?void 0:a.lineEndSymbol)}})}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<2)return!1;let e=!0;return t.forEach((t=>{if(t.length)t.forEach((t=>{Wo(t.x)&&Wo(t.y)||(e=!1)}));else if(!Wo(t.x)||!Wo(t.y))return void(e=!1)})),e}}xU.defaultAttributes=uU;function SU(t,e){let i;if(e.coordinates){const t=e,{coordinates:s,coordinateType:n,getSeriesByIdOrIndex:r}=t,a=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=r(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===n){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:o,yFieldIndex:h}=t;let d=i;M(r)&&(d=Ra(i)[r]),n&&Ra(i).includes(n)&&(d=n);let c=s;M(h)&&(c=Ra(s)[h]),o&&Ra(s).includes(o)&&(c=o),l=Object.assign({x:void 0,y:void 0},a),S(t[d])&&yG(t[d])?l.x={field:d,aggrType:t[d]}:l.x=Ra(d).map((e=>t[e])),S(t[c])&&yG(t[c])?l.y={field:c,aggrType:t[c]}:l.y=Ra(c).map((e=>t[e]))}else if("polar"===n){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let o=s;M(r)&&(o=Ra(s)[r]),n&&Ra(s).includes(n)&&(o=n);const h=i;l=Object.assign({angle:void 0,radius:void 0},a),S(t[o])&&yG(t[o])?l.angle={field:o,aggrType:t[o]}:l.angle=Ra(o).map((e=>t[e])),S(t[h])&&yG(t[h])?l.radius={field:h,aggrType:t[h]}:l.radius=Ra(h).map((e=>t[e]))}return l.getRefRelativeSeries=()=>e,l}))}else i=e;const s=[];return i.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(M(e.x)){const s=e.x;y(s)?i.x=s.map((i=>kU(i,t,e))):i.x=kU(s,t,e)}if(M(e.y)){const s=e.y;y(s)?i.y=s.map((i=>kU(i,t,e))):i.y=kU(s,t,e)}if(M(e.angle)){const s=e.angle;y(s)?i.angle=s.map((i=>kU(i,t,e))):i.angle=kU(s,t,e)}if(M(e.radius)){const s=e.radius;y(s)?i.radius=s.map((i=>kU(i,t,e))):i.radius=kU(s,t,e)}if(M(e.areaName)){const s=e.areaName;i.areaName=kU(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)})),s}const MU={min:(t,e)=>md(t[0].latestData,e.field),max:(t,e)=>_d(t[0].latestData,e.field),sum:function(t,e){return fd(t[0].latestData,e.field)},average:function(t,e){return vd(t[0].latestData,e.field)},variance:function(t,e){return yd(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(yd(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return((t,e)=>{let i=t;return!0!==e&&(i=t.sort(ud)),function(t,e,i=pd){const s=t.length;if(!s)return;if(e<=0||s<2)return i(t[0],0,t);if(e>=1)return i(t[s-1],s-1,t);const n=(s-1)*e,r=Math.floor(n),a=i(t[r],r,t);return a+(i(t[r+1],r+1,t)-a)*(n-r)}(i,.5)})(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function kU(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(rs(t))return t(a,o,l,s,n,r);if(w(t)){const{aggrType:i,field:s}=t;return MU[i](e,{field:s})}return t}class AU extends qE{constructor(){super(...arguments),this.layoutType="none",this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}getMarkerData(){return this._markerData}static _getMarkerCoordinateType(t){return"cartesian"}static getSpecInfo(t){const e=t[this.specKey];if(Im(e))return;if(!y(e)&&!1!==e.visible&&this._getMarkerCoordinateType(e)===this.coordinateType)return[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:this.type}];const i=[];return Ra(e).forEach(((t,e)=>{!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType&&i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:this.type})})),i}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getFieldInfoFromSpec(t,e,i){return S(e)&&yG(e)?{field:i.getSpec()[{x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"}[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Ra(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const i=new f;return i.registerParser("array",e),new R(i).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(M(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._markerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._markerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._markerLayout.bind(this)))}onRender(t){}changeRegions(t){}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=gE(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e,i){P(this._spec.offsetX)||(this._layoutOffsetX=el(this._spec.offsetX,e.width,e)),P(this._spec.offsetY)||(this._layoutOffsetY=el(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e,i)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Dm(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}}function wU(t,e){return function(t,e,i){const{predict:s}=function(t,e=t=>t.x,i=t=>t.y){let s=0,n=0,r=0,a=0,o=0;rd(t,e,i,((t,e)=>{++o,s+=(t-s)/o,n+=(e-n)/o,r+=(t*e-r)/o,a+=(t*t-a)/o}));const l=function(t,e,i,s){const n=s-t*t,r=Math.abs(n)<1e-24?0:(i-t*e)/n;return[e-r*t,r]}(s,n,r,a),h=t=>l[0]+l[1]*t;return{coef:l,predict:h,rSquared:ad(t,e,i,n,h)}}(t,(t=>t[e]),(t=>t[i])),n=md(t,e),r=_d(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}function TU(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class CU extends AU{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=Ty.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=OG(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v;const{label:y={},startSymbol:b={},endSymbol:x={}}=this._spec,S={zIndex:this.layoutZIndex,interactive:null===(t=this._spec.interactive)||void 0===t||t,hover:null===(e=this._spec.interactive)||void 0===e||e,select:null===(i=this._spec.interactive)||void 0===i||i,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:EG(OE(null===(s=this._spec.line)||void 0===s?void 0:s.style),this._markerData),clipInRange:null!==(n=this._spec.clip)&&void 0!==n&&n,label:CG(y,this._markerData),state:{line:LG(null!==(a=null===(r=this._spec.line)||void 0===r?void 0:r.state)&&void 0!==a?a:{},this._markerData),lineStartSymbol:LG(null!==(l=null===(o=this._spec.startSymbol)||void 0===o?void 0:o.state)&&void 0!==l?l:{},this._markerData),lineEndSymbol:LG(null!==(d=null===(h=this._spec.endSymbol)||void 0===h?void 0:h.state)&&void 0!==d?d:{},this._markerData),label:LG(null!==(p=null===(u=null===(c=this._spec)||void 0===c?void 0:c.label)||void 0===u?void 0:u.state)&&void 0!==p?p:{},this._markerData),labelBackground:LG(null!==(f=null===(_=null===(m=null===(g=this._spec)||void 0===g?void 0:g.label)||void 0===m?void 0:m.labelBackground)||void 0===_?void 0:_.state)&&void 0!==f?f:{},this._markerData)},animation:null!==(v=this._spec.animation)&&void 0!==v&&v,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return b.visible?S.startSymbol=Object.assign(Object.assign({},b),{visible:!0,style:OE(b.style)}):S.startSymbol={visible:!1},x.visible?S.endSymbol=Object.assign(Object.assign({},x),{visible:!0,style:OE(x.style)}):S.endSymbol={visible:!1},this._newMarkLineComponent(S)}_getUpdateMarkerAttrs(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=l.getViewData().latestData,c=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=TG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}const p=null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{},g=Object.assign(Object.assign({},p.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=p.label)||void 0===s?void 0:s.text});return Object.assign(Object.assign({},h),{label:g,limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c}=OG(t);if(this._markerData=this._getRelativeDataView(),!(i||s||n||r||a||o||l||h||d||c||e))return;Ap(this._option.dataSet,"markerAggregation",SU),Ap(this._option.dataSet,"markerRegression",wU),Ap(this._option.dataSet,"markerFilter",TU);const{options:u,needAggr:p,needRegr:g,processData:m}=this._computeOptions(),_=new R(this._option.dataSet);_.parse([m],{type:"dataview"}),p&&_.transform({type:"markerAggregation",options:u}),g&&_.transform({type:"markerRegression",options:u}),_.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),_.target.on("change",(()=>{this._markerLayout()})),this._markerData=_}}CU.specKey="markLine";class LU extends CU{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new xU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=M(e.coordinates),o=M(e.process),l=o&&M(e.process.x),h=o&&M(e.process.y),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:p,doXYY1Process:g,doYXX1Process:m,doXYProcess:_,doCoordinatesProcess:f}=OG(e);let v=[];if(u||g||p||m||_||a&&l||a&&h){const t=bG(i,s,n,r,c);v=1===t.length?t[0]:t.map((t=>t[0]))}else f?v=MG(i,r,c,e.coordinatesOffset):d&&(v=wG(e.positions,r,e.regionRelative));return{points:v}}_markerLayout(){var t,e,i,s,n,r,a,o;const l=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const o=this._startRelativeSeries,h=this._endRelativeSeries,{multiSegment:d,mainSegmentIndex:c}=this._spec.line||{},{connectDirection:u,expandDistance:p=0}=this._spec;let g;if(tl(p)){const t=o.getRegion(),e=t.getLayoutStartPoint(),i=h.getRegion(),s=i.getLayoutStartPoint();if("bottom"===u||"top"===u){const n=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));g=Number(p.substring(0,p.length-1))*n/100}else{const n=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));g=Number(p.substring(0,p.length-1))*n/100}}else g=p;const{points:m,label:_,limitRect:f}=l,v=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(m[0],m[1],u,g);let y;y=d&&M(c)?{position:"middle",autoRotate:!1,refX:0,refY:0}:Object.assign(Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(m[0],m[1],u,g)),{refX:0,refY:0}),Wo(null===(t=this._spec.label)||void 0===t?void 0:t.refX)&&(y.refX+=this._spec.label.refX),Wo(null===(e=this._spec.label)||void 0===e?void 0:e.refY)&&(y.refY+=this._spec.label.refY),Wo(null===(i=this._spec.label)||void 0===i?void 0:i.dx)&&(y.dx=(y.dx||0)+this._spec.label.dx),Wo(null===(s=this._spec.label)||void 0===s?void 0:s.dy)&&(y.dy=(y.dy||0)+this._spec.label.dy);const b=null!==(r=null===(n=this._markerComponent)||void 0===n?void 0:n.attribute)&&void 0!==r?r:{};null===(a=this._markerComponent)||void 0===a||a.setAttributes({points:d?[[v[0],v[1]],[v[1],v[2]],[v[2],v[3]]]:v,label:Object.assign(Object.assign(Object.assign({},_),y),{textStyle:Object.assign(Object.assign({},b.label.textStyle),{textAlign:"center",textBaseline:"middle"})}),limitRect:f,multiSegment:d,mainSegmentIndex:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(o=this._markerComponent)||void 0===o||o.setAttributes(l)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:d,doCoordinatesProcess:c}=OG(n);if(d)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(c){if(t=this._processSpecCoo(n),i=!1,e=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&"x"in n.process&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&"y"in n.process&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&"xy"in n.process){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}LU.type=r.markLine,LU.coordinateType="cartesian",uP();class EU extends pP{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},pP.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!n)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},d={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,d];const c=this._renderSymbol(t,this._mainSegmentPoints,"start"),u=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=c,this.endSymbol=u;const p=Gr.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),Im(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}BG(),uP();class PU extends aU{markerAnimate(t){PU._animate&&this._animationConfig&&PU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},PU.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcLine"}getPointAttrByPosition(t){const{center:e,radius:i,startAngle:s,endAngle:n,label:r}=this.attribute,{refX:a=0,refY:o=0}=r;let l;switch(t){case hU.arcInnerStart:l=s;case hU.arcOuterStart:l=s;break;case hU.arcInnerEnd:l=n;case hU.arcOuterEnd:l=n;break;case hU.center:case hU.arcInnerMiddle:case hU.arcOuterMiddle:default:l=(s+n)/2}return{position:{x:e.x+(i+o)*Math.cos(l)+a*Math.cos(l-Math.PI/2),y:e.y+(i+o)*Math.sin(l)+a*Math.sin(l-Math.PI/2)},angle:l}}getTextStyle(t){return fU[t]}getRotateByAngle(t){var e;return t-Math.PI/2+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}createSegment(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;return new EU({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},$k,null==o?void 0:o.line),startSymbol:E({},$k,null==o?void 0:o.lineStartSymbol),endSymbol:E({},$k,null==o?void 0:o.lineEndSymbol)}})}setLineAttributes(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;this._line&&this._line.setAttributes({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},$k,null==o?void 0:o.line),startSymbol:E({},$k,null==o?void 0:o.lineStartSymbol),endSymbol:E({},$k,null==o?void 0:o.lineEndSymbol)}})}isValidPoints(){return!0}}PU.defaultAttributes=gU;class DU extends CU{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=OG(this._spec);return e||i?new PU(t):new xU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c,doCoordinatesProcess:u}=OG(e);let p=[],g={};const m={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||d||c){const t=xG(i,s,n,r,a);p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:m}:{points:p.map((t=>Tt(m,t.radius,t.angle)))}}else u&&(p=kG(i,r,a),g={points:p.map((t=>Tt(m,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=OG(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}DU.type=r.polarMarkLine,DU.coordinateType="polar",h_(),of(),JM();class OU extends Pk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},OU.defaultAttributes,t)),this.name="title"}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,b,x,S,k,A,w,T,C,L,E,P,D,O,R,I,B,F,Y,j,H,z,N,V;const{textType:W,text:G,subtextType:U,textStyle:$={},subtext:K,subtextStyle:X={},width:q,height:Z,minWidth:J,maxWidth:Q,minHeight:tt,maxHeight:et,align:it,verticalAlign:st,padding:nt=0}=this.attribute,rt=dP(nt),at=this.createOrUpdateChild("title-container",{x:rt[3],y:rt[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==$.visible)if("rich"===W||M($.character)){const h=Object.assign({x:null!==(t=$.x)&&void 0!==t?t:0,y:null!==(e=$.y)&&void 0!==e?e:0,width:null!==(s=null!==(i=$.width)&&void 0!==i?i:q)&&void 0!==s?s:0,height:null!==(r=null!==(n=$.height)&&void 0!==n?n:Z)&&void 0!==r?r:0,ellipsis:null===(a=$.ellipsis)||void 0===a||a,wordBreak:null!==(o=$.wordBreak)&&void 0!==o?o:"break-word",maxHeight:$.maxHeight,maxWidth:$.maxWidth,textConfig:null!==(l=$.character)&&void 0!==l?l:G},$);this._mainTitle=at.createOrUpdateChild("mainTitle",h,"richtext")}else if("html"===W){const t=Object.assign({html:Object.assign(Object.assign({dom:G},Kk),$),x:null!==(h=$.x)&&void 0!==h?h:0,y:null!==(d=$.y)&&void 0!==d?d:0,width:null!==(u=null!==(c=$.width)&&void 0!==c?c:q)&&void 0!==u?u:0,height:null!==(g=null!==(p=$.height)&&void 0!==p?p:Z)&&void 0!==g?g:0,ellipsis:null===(m=$.ellipsis)||void 0===m||m,wordBreak:null!==(_=$.wordBreak)&&void 0!==_?_:"break-word",maxHeight:$.maxHeight,maxWidth:$.maxWidth,textConfig:[]},$);this._mainTitle=at.createOrUpdateChild("mainTitle",t,"richtext")}else M(G)&&(this._mainTitle=at.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:y(G)?G:[G],wrap:!0},$),{maxLineWidth:null!==(f=$.maxLineWidth)&&void 0!==f?f:q,heightLimit:$.heightLimit,lineClamp:$.lineClamp,ellipsis:null===(v=$.ellipsis)||void 0===v||v,x:0,y:0}),"text"));const ot=this._mainTitle?this._mainTitle.AABBBounds.height():0,lt=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==X.visible)if("rich"===U||M(X.character)){const t=Object.assign({x:null!==(b=X.x)&&void 0!==b?b:0,y:null!==(x=X.y)&&void 0!==x?x:0,width:null!==(k=null!==(S=X.width)&&void 0!==S?S:q)&&void 0!==k?k:0,height:null!==(w=null!==(A=X.height)&&void 0!==A?A:Z)&&void 0!==w?w:0,ellipsis:null===(T=X.ellipsis)||void 0===T||T,wordBreak:null!==(C=X.wordBreak)&&void 0!==C?C:"break-word",maxHeight:X.maxHeight,maxWidth:X.maxWidth,textConfig:null!==(L=X.character)&&void 0!==L?L:K},X);this._subTitle=at.createOrUpdateChild("subTitle",t,"richtext")}else if("html"===U){const t=Object.assign({html:Object.assign(Object.assign({dom:K},Kk),X),x:null!==(E=X.x)&&void 0!==E?E:0,y:null!==(P=X.y)&&void 0!==P?P:0,width:null!==(O=null!==(D=X.width)&&void 0!==D?D:q)&&void 0!==O?O:0,height:null!==(I=null!==(R=X.height)&&void 0!==R?R:Z)&&void 0!==I?I:0,ellipsis:null===(B=X.ellipsis)||void 0===B||B,wordBreak:null!==(F=X.wordBreak)&&void 0!==F?F:"break-word",maxHeight:X.maxHeight,maxWidth:X.maxWidth,textConfig:[]},X);this._subTitle=at.createOrUpdateChild("subTitle",t,"richtext")}else M(K)&&(this._subTitle=at.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:y(K)?K:[K],wrap:!0},X),{maxLineWidth:null!==(Y=X.maxLineWidth)&&void 0!==Y?Y:q,heightLimit:X.heightLimit,lineClamp:X.lineClamp,ellipsis:null===(j=X.ellipsis)||void 0===j||j,x:0,y:ot}),"text"));const ht=this._subTitle?this._subTitle.AABBBounds.height():0,dt=this._subTitle?this._subTitle.AABBBounds.width():0;let ct=Math.max(lt,dt),ut=ot+(null!==(H=X.height)&&void 0!==H?H:ht);if(M(q)&&(ct=q,this._mainTitle&&this._mainTitle.setAttribute("maxLineWidth",q),this._subTitle&&this._subTitle.setAttribute("maxLineWidth",q)),M(Z)&&(ut=Z),M(J)&&ctQ&&(ct=Q)),M(tt)&&utet&&(ut=et)),at.attribute.width=ct,at.attribute.height=ut,at.attribute.boundsPadding=rt,this._mainTitle){if(M(it)||M($.align)){const t=$.align?$.align:it,e=null!==(z=$.width)&&void 0!==z?z:lt;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(M(st)||M($.verticalAlign)){const t=$.verticalAlign?$.verticalAlign:st,e=$.height?$.height:ut;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(M(it)||M(X.align)){const t=X.align?X.align:it,e=null!==(N=X.width)&&void 0!==N?N:dt;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(M(st)||M($.verticalAlign)){const t=X.verticalAlign?X.verticalAlign:st,e=ot,i=null!==(V=X.height)&&void 0!==V?V:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}}OU.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};class RU extends qE{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=Ty.Title,this.layoutLevel=Cy.Title,this._orient="top",this._orient=Qo(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){const e=t[this.specKey];if(!e||!1===e.visible)return null;if(!y(e))return[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.title}];const i=[];return e.forEach(((t,e)=>{!1!==t.visible&&i.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.title})})),i}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}update(t){}resize(t){}afterSetLayoutStartPoint(t){Wo(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),Wo(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:Wo(t.width())?t.width():0,height:this._spec.height?this._spec.height:Wo(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r,a,o,l;const h=Math.max(0,null!==(t=this._spec.width)&&void 0!==t?t:this.getLayoutRect().width);return!1===this._spec.visible?{visible:!1}:Object.assign(Object.assign({},ZE(this._spec,["padding"])),{textType:null!==(e=this._spec.textType)&&void 0!==e?e:"text",text:null!==(i=this._spec.text)&&void 0!==i?i:"",subtextType:null!==(s=this._spec.subtextType)&&void 0!==s?s:"text",subtext:null!==(n=this._spec.subtext)&&void 0!==n?n:"",x:null!==(r=this._spec.x)&&void 0!==r?r:0,y:null!==(a=this._spec.y)&&void 0!==a?a:0,width:h,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:this._spec.maxWidth,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(o=this._spec.align)&&void 0!==o?o:"left",verticalAlign:null!==(l=this._spec.verticalAlign)&&void 0!==l?l:"top",textStyle:Object.assign({width:h},this._spec.textStyle),subtextStyle:Object.assign({width:h},this._spec.subtextStyle)})}_createOrUpdateTitleComponent(t){if(this._titleComponent)Dm(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new OU(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",((t,e)=>this._delegateEvent(i,t,e)))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}}function IU(){BU._animate=QG}RU.type=r.title,RU.specKey=r.title,BG(),mk();class BU extends jG{markerAnimate(t){BU._animate&&this._animationConfig&&BU._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},BU.defaultAttributes,t)),this.name="markArea",this.defaultUpdateAnimation=sU,this.defaultExitAnimation=rU}getPointAttrByPosition(t){const{x1:e,x2:i,y1:s,y2:n}=this._area.AABBBounds;return t.includes("left")||t.includes("Left")?{x:e,y:(s+n)/2}:t.includes("right")||t.includes("Right")?{x:i,y:(s+n)/2}:t.includes("top")||t.includes("Top")?{x:(e+i)/2,y:s}:t.includes("bottom")||t.includes("Bottom")?{x:(e+i)/2,y:n}:{x:(e+i)/2,y:(s+n)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,i=null!==(t=e.position)&&void 0!==t?t:"middle",s=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},s),{textStyle:Object.assign(Object.assign({},vU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;YG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{points:e,label:i,areaStyle:s,state:n}=this.attribute,r=Gr.polygon(Object.assign({points:e},s));r.states=E({},$k,null==n?void 0:n.area),r.name="mark-area-polygon",this._area=r,t.add(r);const a=new SP(Object.assign(Object.assign({},i),{state:{panel:E({},$k,null==n?void 0:n.labelBackground),text:E({},$k,null==n?void 0:n.label)}}));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i,state:s}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({points:t},i)),this._area.states=E({},$k,null==s?void 0:s.area)),this._label&&this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},e),{state:{panel:E({},$k,null==s?void 0:s.labelBackground),text:E({},$k,null==s?void 0:s.label)}})),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<3)return!1;let e=!0;return t.forEach((t=>{Wo(t.x)&&Wo(t.y)||(e=!1)})),e}}BU.defaultAttributes=mU;class FU extends AU{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=Ty.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=RG(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c;const u=null!==(t=this._spec.label)&&void 0!==t?t:{},p={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:EG(OE(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:CG(u,this._markerData),state:{area:LG(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData),label:LG(null===(o=this._spec.label)||void 0===o?void 0:o.state,this._markerData),labelBackground:LG(null===(d=null===(h=null===(l=this._spec)||void 0===l?void 0:l.label)||void 0===h?void 0:h.labelBackground)||void 0===d?void 0:d.state,this._markerData)},animation:null!==(c=this._spec.animation)&&void 0!==c&&c,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(p)}_markerLayout(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=this._getRelativeDataView().latestData,c=r?r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData:d;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=TG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}this._markerComponent&&this._markerComponent.setAttributes(Object.assign(Object.assign({},h),{label:Object.assign(Object.assign({},null===(e=this._markerComponent.attribute)||void 0===e?void 0:e.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=null===(i=this._markerComponent.attribute)||void 0===i?void 0:i.label)||void 0===s?void 0:s.text}),limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=RG(t);if(!(e||i||s||n||r||a||o))return null;const{options:l}=this._computeOptions(),h=this._getRelativeDataView();Ap(this._option.dataSet,"markerAggregation",SU),Ap(this._option.dataSet,"markerFilter",TU);const d=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});d.parse([h],{type:"dataview"}),d.transform({type:"markerAggregation",options:l}),d.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),d.target.on("change",(()=>{this._markerLayout()})),this._markerData=d}}FU.specKey="markArea";class YU extends FU{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new BU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYProcess:l,doCoordinatesProcess:h}=RG(e),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t;let u=[],p=[];if(l){p=bG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(a||o){p=bG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[...t,e[1],e[0]])}else h?u=MG(i,r,c,e.coordinatesOffset):d&&(u=wG(e.positions,r,e.regionRelative));return{points:u}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=RG(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}YU.type=r.markArea,YU.coordinateType="cartesian",BG(),zx();class jU extends jG{markerAnimate(t){jU._animate&&this._animationConfig&&jU._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},jU.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcArea",this.defaultUpdateAnimation=sU,this.defaultExitAnimation=rU}getPointAttrByPosition(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,label:a}=this.attribute,{refX:o=0,refY:l=0}=a;let h,d;switch(t){case hU.center:h=(i+s)/2,d=(n+r)/2;break;case hU.arcInnerStart:h=i,d=n;break;case hU.arcOuterStart:h=s,d=n;break;case hU.arcInnerEnd:h=i,d=r;break;case hU.arcOuterEnd:h=s,d=r;break;case hU.arcInnerMiddle:h=i,d=(n+r)/2;break;case hU.arcOuterMiddle:h=s,d=(n+r)/2;break;default:h=i,d=(n+r)/2}return{position:{x:e.x+(h+l)*Math.cos(d)+o*Math.cos(d-Math.PI/2),y:e.y+(h+l)*Math.sin(d)+o*Math.sin(d-Math.PI/2)},angle:d}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,{position:i="arcInnerMiddle",autoRotate:s}=e,n=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},n.position),{angle:s?n.angle-Math.PI/2+(null!==(t=e.refAngle)&&void 0!==t?t:0):0,textStyle:Object.assign(Object.assign({},fU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;YG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,areaStyle:a,label:o,state:l}=this.attribute,h=Gr.arc(Object.assign({x:e.x,y:e.y,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r},a));h.states=E({},$k,null==l?void 0:l.area),h.name="polar-mark-area-area",this._area=h,t.add(h);const d=new SP(Object.assign(Object.assign({},o),{state:{panel:E({},$k,null==l?void 0:l.labelBackground),text:E({},$k,null==l?void 0:l.label)}}));d.name="mark-area-label",this._label=d,t.add(d),this.setLabelPos()}updateMarker(){const{center:t,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n,areaStyle:r,label:a,state:o}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({x:t.x,y:t.y,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n},r)),this._area.states=E({},$k,null==o?void 0:o.area)),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},a),{state:{panel:E({},$k,null==o?void 0:o.labelBackground),text:E({},$k,null==o?void 0:o.label)}})),this.setLabelPos())}isValidPoints(){return!0}}jU.defaultAttributes=_U;class HU extends FU{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=RG(this._spec);return i||e||s?new jU(t):new BU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=RG(e),d=null!==(t=e.autoRange)&&void 0!==t&&t;let c,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=xG(i,s,n,r,d);l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(c=kG(i,r,d),u={points:c.map((t=>Tt(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=RG(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}HU.type=r.polarMarkArea,HU.coordinateType="polar";class zU extends Av{constructor(t){super(t)}}var NU,VU;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(NU||(NU={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(VU||(VU={}));class WU extends Pk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},WU.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},WU.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},WU.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},WU.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},WU.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,s;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(s=this._forwardAttr.style.symbolType)&&void 0!==s?s:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{P(this._playController)&&(this._playController=new zU(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{P(this._backwardController)&&(this._backwardController=new zU(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{P(this._forwardController)&&(this._forwardController=new zU(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent(NU.OnPlay)},this.pause=()=>{this._dispatchEvent(NU.OnPause)},this.forward=()=>{this._dispatchEvent(NU.OnForward)},this.backward=()=>{this._dispatchEvent(NU.OnBackward)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}WU.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},WU.defaultAttributes={[VU.Start]:{},[VU.Pause]:{},[VU.Backward]:{},[VU.Forward]:{}};const GU={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},UU=[200,10];var $U,KU;(KU=$U||($U={})).Default="default",KU.Reverse="reverse";const XU=t=>"top"===t||"bottom"===t;class qU extends Pk{getMinIndex(){return this._minIndex}getMaxIndex(){return this._maxIndex}getDataIndex(){return this._dataIndex}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},qU.defaultAttributes,t)),this._data=[],this._dataIndex=0,this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e;let i;Wo(this._handlerStyle.size)?i=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(i=ut(this._handlerStyle.size[0],this._handlerStyle.size[1]));const s={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:this._dataIndex,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:Wo(i)?i:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(XU(this._orient)){const e=Math.max(0,this._layoutInfo.slider.size),i=null!==(t=this._railStyle.height)&&void 0!==t?t:UU[1];s.layout="horizontal",s.railHeight=i,s.railWidth=e,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.width)&&void 0!==e?e:UU[1];s.layout="vertical",s.railWidth=i,s.railHeight=t,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}return s},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new $V(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return t.layout=XU(this._orient)?"horizontal":"vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})}),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new WU(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initDataIndex(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initDataIndex(){var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0}_initLayoutInfo(){var t,e,i;const s=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),n=s.filter((t=>"end"!==t.position)),r=s.filter((t=>"end"===t.position)),a=null!==(t=XU(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:UU[1],o=s.reduce(((t,e)=>{const i=e.style.size,s=h(i)?i:ut(i[0],i[1]);return t+e.space+s}),0),l=this._sliderVisible?(XU(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(i=this._size)||void 0===i?void 0:i.height)-o:0,d=l-this.attribute.slider.space,c=n.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:XU(this._orient)?t+s:(this._size.width-r)/2,y:XU(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:d,x:XU(this._orient)?c+this.attribute.slider.space:(this._size.width-a)/2,y:XU(this._orient)?(this._size.height-a)/2:c+this.attribute.slider.space}),r.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:XU(this._orient)?t+s:(this._size.width-r)/2,y:XU(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),c+l)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}var ZU;function JU(){LV(),h_(),Nv()}qU.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},GU),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},GU),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},GU),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},GU),{key:"backward",position:"start"})}},function(t){t.change="change",t.play="play",t.pause="pause",t.backward="backward",t.forward="forward",t.end="end",t.OnChange="change",t.OnPlay="play",t.OnPause="pause",t.OnBackward="backward",t.OnForward="forward",t.OnEnd="end"}(ZU||(ZU={})),JU();class QU extends qU{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var t,e,i;super._initAttributes(),this._alternate=null!==(t=this.attribute.alternate)&&void 0!==t&&t,this._interval=null!==(e=this.attribute.interval)&&void 0!==e?e:1e3,this._direction=null!==(i=this.attribute.direction)&&void 0!==i?i:$U.Default},this._initDataIndex=()=>{var t;this._dataIndex=P(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(NU.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(NU.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(NU.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(NU.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{const e=Math.floor(t.detail.value)+.5;this._dataIndex=t.detail.value>=e?Math.ceil(t.detail.value):Math.floor(t.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(ZU.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,((({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,maxIndex:e,dataIndex:i})=>t===$U.Default&&i===e)({direction:t,maxIndex:e,dataIndex:s})||(({direction:t,minIndex:e,dataIndex:i})=>t===$U.Reverse&&i===e)({direction:t,minIndex:i,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||(({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,minIndex:e,dataIndex:i})=>t===$U.Default&&i===e)({direction:t,minIndex:i,dataIndex:s})||(({direction:t,maxIndex:e,dataIndex:i})=>t===$U.Reverse&&i===e)({direction:t,maxIndex:e,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===$U.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(ZU.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=jo.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=t=>{const e=Date.now();if(this._isReachEnd&&e-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();t&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(ZU.change),this._activeIndex=this._dataIndex):e-this._tickTime>=this._interval&&(this._tickTime=e,this._updateDataIndex(((t,e,i,s)=>"default"===t?Math.min(e+1,s):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(ZU.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=jo.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),jo.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(ZU.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,jo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(ZU.pause))},this.backward=()=>{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex-1{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex+1>this._maxIndex?this._minIndex:this._dataIndex+1:Math.min(this._dataIndex+1,this._maxIndex),this._updateDataIndex(e),this.dispatchCustomEvent(ZU.change),this.dispatchCustomEvent(ZU.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}JU();class t$ extends qU{constructor(t){super(t),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3;const e=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=e?e:1)):(this._totalDuration=this._interval*e,this._interval=this.attribute.interval)},this._initDataIndex=()=>{var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:this._minIndex},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(NU.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(NU.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(NU.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(NU.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=t=>{const e=Math.floor(t);e!==this._activeIndex&&(this._dataIndex=e,this._activeIndex=e,e!==this._maxIndex&&this.dispatchCustomEvent(ZU.change))},this.play=()=>{return t=this,e=void 0,s=function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(ZU.play),this._rafId=jo.getRequestAnimationFrame()(this._play.bind(this)))},new((i=void 0)||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}));var t,e,i,s},this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=jo.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,jo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(ZU.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,jo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(ZU.pause))},this.backward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed-e;i<=0?(this._elapsed=0,this._startTime=t):(this._elapsed=i,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(ZU.backward)},this.forward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed+e;i>=this._totalDuration?(this._startTime=t-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-e,this._elapsed=i),this._updateSlider(),this.dispatchCustomEvent(ZU.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}const e$=t=>OE(Object.assign({},t)),i$=t=>Object.assign(Object.assign({},t),{style:Object.assign({},OE(t.style))}),s$=t=>{var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;const _=e$(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),f=e$(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),v=(k=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},OE(Object.assign({},k))),y=i$(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),b=i$(null!==(d=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==d?d:{}),x=i$(null!==(u=null===(c=null==t?void 0:t.controller)||void 0===c?void 0:c.backward)&&void 0!==u?u:{}),S=i$(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),M=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(m=t.orient)&&void 0!==m?m:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:_,railStyle:f,handlerStyle:v}),controller:Object.assign(Object.assign({},t.controller),{start:y,pause:b,backward:x,forward:S})});var k;return t.visible||(M.controller.visible=!1,M.slider.visible=!1),M},n$=t=>"left"===t||"right"===t,r$=t=>"top"===t||"bottom"===t;class a$ extends qE{constructor(){super(...arguments),this.layoutZIndex=Ty.Player,this.layoutLevel=Cy.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},s$(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},s$(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?Dm(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new QU(t):this._playerComponent=new t$(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Ra(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Ra(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Ra(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Ra(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=n$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=n$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,d=Math.max(...Ra(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Ra(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Ra(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Ra(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=d?h-d:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(jd.rendered,(()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&this._playerComponent.play()})),this._playerComponent.addEventListener(ZU.end,(()=>{var t;this.event.emit(jd.playerEnd,{model:this}),this._alternate&&"discrete"===this._spec.type&&(this._direction="default"===this._direction?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:"reverse"===this._direction?this._specs.length-2:1})),(null===(t=this._spec)||void 0===t?void 0:t.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(ZU.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(ZU.backward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(jd.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(ZU.forward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(jd.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(ZU.play,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(jd.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(ZU.pause,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(jd.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}static getSpecInfo(t){const e=t[this.specKey];return P(e)?null:[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.player}]}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),Wo(t.x)){const e=n$(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(Wo(t.y)){const e=r$(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}changeRegions(t){}onRender(t){}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return h(this._spec.width)?Math.min(t.width,Number(this._spec.width)):n$(this._orient)?this._maxSize():t.width}_computeHeight(t){return h(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):r$(this._orient)?this._maxSize():t.height}_computeDx(t){return n$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return r$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){const e=this._specs[t];Ra(e.data).forEach((t=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.globalInstance)||void 0===i||i.updateData(t.id,t.values)})),this.event.emit(jd.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}}a$.specKey="player",a$.type=r.player;class o$ extends Pk{constructor(t,e){const{dataLabels:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}o$.defaultAttributes={pickable:!1};class l$ extends Jm{constructor(t,e){super(t,qd.label,e),this.spec.componentType=qd.label}parseAddition(t){return super.parseAddition(t),this.labelStyle(t.labelStyle),this.size(t.size),this.target(t.target),this}labelStyle(t){return this.setFunctionSpec(t,"labelStyle")}size(t){return this.setFunctionSpec(t,"size")}target(t){if(this.spec.target){const t=Ra(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t));this.detach(t)}if(this.spec.target=t,t){const e=Ra(t).map((t=>S(t)?this.view.getMarkById(t):t));this.attach(e)}return this.commit(),this}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=Ra(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t)),h=null===(r=null===(n=this.group)||void 0===n?void 0:n.getGroupGraphicItem)||void 0===r?void 0:r.call(n);let d=Np(this.spec.size,i);d||(d=h?{width:null!==(a=h.attribute.width)&&void 0!==a?a:h.AABBBounds.width(),height:null!==(o=h.attribute.height)&&void 0!==o?o:h.AABBBounds.height()}:{width:1/0,height:1/0});const c=this.spec.skipTheme?null:this.view.getCurrentTheme();return((t,e,i,s,n,r={})=>{var a;const o=null===(a=r.components)||void 0===a?void 0:a.dataLabel,l=t.map(((t,e)=>{var a,o,l,h,d;const c=Object.assign(Object.assign({},n),{labelIndex:e}),u=null!==(a=Np(s,c,t))&&void 0!==a?a:{},{components:p={}}=r;let g={};switch(t.markType){case Xd.line:case Xd.area:g="line"===u.type?p.lineLabel:"area"===u.type?p.areaLabel:p.lineDataLabel;break;case Xd.rect:case Xd.rect3d:case Xd.interval:g=p.rectLabel;break;case Xd.symbol:case Xd.circle:case Xd.cell:g=p.symbolLabel;break;case Xd.arc:case Xd.arc3d:g=p.arcLabel;break;case Xd.polygon:case Xd.path:default:g=p.pointLabel}const m=null!==(o=u.data)&&void 0!==o?o:[],_=null!==(h=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l[0])&&void 0!==h?h:{};if(m&&m.length>0)m.forEach(((e,s)=>{if(t.elements[s]){const n=Lm(i,e,t.elements[s],c);E(e,_,n)}}));else{const e=(t,e)=>{const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if("willRelease"!==s.getGraphicItem().releaseStatus)if(t.isCollectionMark())s.getDatum().forEach((t=>{const n=Lm(i,t,s,c);m.push(e(n,_))}));else{const t=Lm(i,s.getDatum(),s,c);m.push(e(t,_))}}))}const f=E({},g,{baseMarkGroupName:null===(d=t.graphicItem)||void 0===d?void 0:d.name,getBaseMarks:()=>t.elements.map((t=>t.getGraphicItem()))},null!=u?u:{});return f.data=null!=m?m:g.data,f})).filter((t=>!P(t))),h=E({},o,{size:e});return h.dataLabels=l,h})(l,d,s,this.spec.labelStyle,i,c)}}),e}),{});this._encoders=e}}l$.componentType=qd.label;const h$=()=>{pc.registerGraphicComponent(qd.label,(t=>new o$(t))),pc.registerComponent(qd.label,l$)};class d$ extends qE{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=Ty.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,Dm(e,t)||(i.reMake=!0),i}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}_delegateLabelEvent(t){0===t.listenerCount("*")&&t.addEventListener("*",((e,i)=>this._delegateEvent(t,e,i)))}}d$.type=r.label;class c$ extends lF{constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}}c$.type="text",c$.constructorType="label";const u$=()=>{$l.registerMark(c$.constructorType,c$),NA()};class p$ extends XE{_initTheme(t,e){return{spec:t,theme:this._theme}}}class g$ extends d${constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=p$,this.layoutZIndex=Ty.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((null==e?void 0:e.region)||[]).forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initTextMarkStyle()}initEvent(){this.event.on(jd.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.disableAnimation()})),this.event.on(rc.AFTER_MARK_RENDER_END,t)}));const t=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.enableAnimation()})),this.event.off(rc.AFTER_MARK_RENDER_END,t)}}afterCompile(){this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct();i&&i.addEventListener(rc.AFTER_ELEMENT_ENCODE,(()=>{!1===this._isLayout&&this._delegateLabelEvent(i.getGroupGraphicItem())}))}))}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),uE(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n{if(e.visible){const n=this._labelInfoMap.get(s),o=this._createMark({type:"label",name:`${r}-label-${i}`},{noSeparateStyle:!0,attributeContext:t.getMarkAttributeContext()});o.setTarget(a),n.push({labelMark:o,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){this._labelInfoMap.forEach(((t,e)=>{if("region"===this._layoutRule){const t=this._createMark({type:"component",name:`${e.getGroupMark().name}-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});t&&(t.setSkipBeforeLayouted(!0),this._marks.addMark(t),this._labelComponentMap.set(t,(()=>this._labelInfoMap.get(e))))}else t.forEach(((t,i)=>{const s=this._createMark({type:"component",name:`${t.labelMark.name}-component`},{componentType:"label",noSeparateStyle:!0,support3d:t.baseMark.getSupport3d()});s&&(s.setSkipBeforeLayouted(!0),this._marks.addMark(s),this._labelComponentMap.set(s,(()=>this._labelInfoMap.get(e)[i])),t.labelMark.setComponent(s))}))}))}_initTextMarkStyle(){this._labelInfoMap.forEach((t=>{t.forEach((t=>{var e,i;const{labelMark:s,labelSpec:n,series:r}=t;if(this.initMarkStyleWithSpec(s,n,void 0),rs(null==n?void 0:n.getStyleHandler)){const t=n.getStyleHandler(r);null==t||t.call(r,s,n)}(null===(i=null===(e=s.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&s.setAttribute("stroke",r.getColorAttribute(),"normal",Ly.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();y(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e.getProduct(),t.map((({baseMark:t})=>t.getProduct())),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e.getProduct(),i.getProduct(),[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.target(e).configure({interactive:!1}).depend(s.map((t=>t.getMarks()[0].getProduct()))).labelStyle(((t,e)=>{var n,r;const a=i[e.labelIndex];if(a){const{labelSpec:t,labelMark:e,series:i}=a,o=e.getRule(),l=this._interactiveConfig(t),h=null!==(r=null===(n=this._spec)||void 0===n?void 0:n.centerOffset)&&void 0!==r?r:0;let d=Tl({textStyle:Object.assign({pickable:!0===t.interactive},t.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},function(t,e){var i;const{labelSpec:s}=e;s.overlap&&!ns(s.overlap)&&(s.overlap={});const n=null!==(i=Az[t])&&void 0!==i?i:Az.point;return e.series.type===_l.sankey?function(t){var e,i,s;const{series:n,labelSpec:r={}}=t,a=null!==(e=Tz(r.position))&&void 0!==e?e:"outside",o=n.direction;let l,h=a;return S(a)&&("vertical"===o?h="inside-start"===a?t=>"inside-left":"inside-middle"===a?t=>"center":"inside-end"===a?t=>"inside-right":t=>"bottom":"inside-start"===a?h=t=>"inside-left":"inside-middle"===a?h=t=>"center":"inside-end"===a?h=t=>"inside-right":"outside"===a&&(h=t=>"right")),l=!1!==r.overlap&&(!S(a)||!a.includes("inside"))&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:Rz(n)},{position:h,overlap:l,smartInvert:!1,offset:0,syncState:!0}}(e):n(e)}(o,a),Object.assign(Object.assign(Object.assign({},ZE(t,["position","style","state","type","stackDataFilterType","getStyleHandler"])),l),{centerOffset:h}),t.stackDataFilterType?{dataFilter:"min"===t.stackDataFilterType?t=>t.filter((t=>t.data[LT])):t=>t.filter((t=>t.data[CT]))}:{});return i&&i.parseLabelStyle&&(d=i.parseLabelStyle(d,t,e)),"line"!==o&&"area"!==o||(d.type=o),d}})).encode(((t,e,s)=>{if(i[s.labelIndex]){const{labelSpec:e,labelMark:n}=i[s.labelIndex];return n.skipEncode?{data:t}:wz(i[s.labelIndex],t,e.formatMethod,e.formatter)}})).size((()=>i[0].series.getRegion().getLayoutRect()))}compileMarks(){this.getMarks().forEach((t=>{var e;const i=this._labelComponentMap.get(t)();let s;s=y(i)?i[0].series.getRegion().getGroupMark().getProduct():i.series.getRegion().getGroupMark().getProduct(),t.compile({group:s}),null===(e=t.getProduct())||void 0===e||e.configure({context:{model:this,labelInfo:i}})}))}getVRenderComponents(){const t=[];return this._labelComponentMap.forEach(((e,i)=>{const s=i.getProduct().getGroupGraphicItem();s&&t.push(s)})),t}}g$.type=r.label,g$.specKey="label",g$.transformerConstructor=p$;class m$ extends d${constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=Ty.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var t;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[wT]},"normal",Ly.Default);const e=this._getSeries();null===(t=e.initTotalLabelMarkStyle)||void 0===t||t.call(e,this._textMark)}_initLabelComponent(){const t=this._getSeries(),e=this._createMark({type:"component",name:`${t.name}-total-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});e&&this._marks.addMark(e)}afterCompile(){this._marks.forEach(((t,e)=>{const i=t.getProduct();i&&i.addEventListener(rc.AFTER_ELEMENT_ENCODE,(()=>{!1===this._isLayout&&this._delegateLabelEvent(i.getGroupGraphicItem())}))}))}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.getProduct().target(this._baseMark.getProduct()).configure({interactive:!1}).labelStyle((()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r}=this._spec,a=this._interactiveConfig(this._spec);return Tl({textStyle:{pickable:!0===this._spec.interactive},position:_$(t,this._baseMark.type),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>t.data[CT]))},a))}})).encode((e=>wz({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod))).size((()=>this._regions[0].getLayoutRect()))}))}compileMarks(){this.getMarks().forEach((t=>{var e;const i=this._regions[0].getGroupMark().getProduct();t.compile({group:i}),null===(e=t.getProduct())||void 0===e||e.configure({context:{model:this}})}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getProduct().getGroupGraphicItem();i&&t.push(i)})),t}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function _$(t,e){var i,s;let n;const{direction:r}=t,a={vertical:["top","bottom"],horizontal:["right","left"]},o=("horizontal"===r?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?1:0;switch(e){case"rect":case"symbol":n=a[r][o];break;default:n="top"}return n}m$.type=r.totalLabel,m$.specKey="totalLabel";const f$=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function v$(){y$._animate=eU}BG(),cP(),uP(),Nv(),US(),aM();class y$ extends jG{markerAnimate(t){y$._animate&&this._animationConfig&&y$._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},y$.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=nU,this.defaultExitAnimation=rU,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,n){return zk(Math.abs(s),Math.PI/2,cU)||zk(Math.abs(s),3*Math.PI/2,cU)?Nk(t,s,n):Hk(s)?yU.postiveXAxis[n]:yU.negativeXAxis[n]}setItemAttributes(t,e,i,s,n){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:d=0,textStyle:c={},richTextStyle:u={},imageStyle:p={},position:g=dU.middle}=e,{state:m}=this.attribute,_=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(_)+h*Math.cos(_-Math.PI/2),v=l*Math.sin(_)+h*Math.sin(_-Math.PI/2);if("text"===n){const n=s.x-i.x,r=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},c),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,n,r,_,null!==(a=e.position)&&void 0!==a?a:"end")),c.textStyle),state:{panel:E({},$k,null==m?void 0:m.textBackground),text:E({},$k,null==m?void 0:m.text)}}))}else"richText"===n?(t.setAttributes({dx:this.getItemDx(t,g,u)+(u.dx||0),dy:this.getItemDy(t,g,u)+(u.dy||0)}),t.states=E({},$k,null==m?void 0:m.richText)):"image"===n&&(t.setAttributes({dx:this.getItemDx(t,g,p)+(p.dx||0),dy:this.getItemDy(t,g,p)+(p.dy||0)}),t.states=E({},$k,null==m?void 0:m.image));const y=Hk(_)?_:_-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(v||0),angle:o&&y+d})}getItemDx(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==n?n:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==n?n:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:s}=this.attribute,{type:n="text",symbolStyle:r,richTextStyle:a,imageStyle:o,renderCustomCallback:l}=t;let h;return"symbol"===n?(h=Gr.symbol(Object.assign(Object.assign({},i),r)),h.states=E({},$k,null==s?void 0:s.symbol)):"text"===n?h=new SP(Object.assign(Object.assign({},i),{state:{panel:E({},$k,null==s?void 0:s.textBackground),text:E({},$k,null==s?void 0:s.text)}})):"richText"===n?(h=Gr.richtext(Object.assign(Object.assign({},i),a)),h.states=E({},$k,null==s?void 0:s.richText)):"image"===n?(h=Gr.image(Object.assign(Object.assign({},i),o)),h.states=E({},$k,null==s?void 0:s.image)):"custom"===n&&l&&(h=l(),h.states=E({},$k,null==s?void 0:s.customMark)),h.name=`mark-point-${n}`,this.setItemAttributes(h,t,e,i,n),h}getItemLineAttr(t,e,i){let s=[],n={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,d=i.x-e.x,c=i.y-e.y;if(this._isStraightLine=zk(d,0,cU)||zk(c,0,cU),this._isArcLine){const{x:t,y:s}=e,{x:l,y:d}=i,c=(t+l)/2,u=c+h*(d>s?-1:1)*c,p=(s===d?0:-(t-l)/(s-d))*(u-c)+(s+d)/2;a=f$(s-p,t-u),o=f$(d-p,l-u),n={x:u,y:p},h>0?o{this._markerLayout()})),this._markerData=r}}x$.specKey="markPoint";class S$ extends x${constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._relativeSeries,n="x"in e&&"y"in e,r="coordinate"in e,a="position"in e,o=null!==(t=null==e?void 0:e.autoRange)&&void 0!==t&&t;let l;return n?l=bG(i,s,s,s,o)[0][0]:r?l=MG(i,s,o,e.coordinatesOffset)[0]:a&&(l=wG(e.position,s,e.regionRelative)[0]),{point:l}}_computeOptions(){const t=this._spec,{doXYProcess:e}=IG(t),i=M(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}S$.type=r.markPoint,S$.coordinateType="cartesian";class M$ extends x${constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=xG(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:Tt({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}M$.type=r.polarMarkPoint,M$.coordinateType="polar";class k$ extends x${constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){return{point:SG(this._markerData,this._relativeSeries)[0][0]}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}k$.type=r.geoMarkPoint,k$.coordinateType="geo";const A$=1e-8;function w$(t,e,i,s,n){for(let r=0,a=n[n.length-1];re&&r>s||rn?o:0}function L$(t,e){return Math.abs(t-e)0&&w$(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}var P$;!function(t){t.drawStart="drawStart",t.drawEnd="drawEnd",t.drawing="drawing",t.moving="moving",t.moveStart="moveStart",t.moveEnd="moveEnd",t.brushClear="brushClear"}(P$||(P$={}));const D$={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},O$=5,R$={debounce:Uo,throttle:Ud};h_(),mk();class I$ extends Pk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},I$.defaultAttributes,t)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||((this._activeDrawState||this._activeMoveState)&&t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushingWithDelay=0===this.attribute.delayTime?this._onBrushing:R$[this.attribute.delayType](this._onBrushing,this.attribute.delayTime),this._onBrushEnd=t=>{var e;if(!this._activeDrawState&&!this._activeMoveState)return;t.preventDefault();const{removeOnClick:i=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&i?((null===(e=this._operatingMask)||void 0===e?void 0:e._AABBBounds.empty())&&this._dispatchEvent(P$.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={}):(this._activeDrawState&&this._dispatchEvent(P$.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._activeMoveState&&this._dispatchEvent(P$.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{trigger:t=D$.trigger,updateTrigger:e=D$.updateTrigger,endTrigger:i=D$.endTrigger,resetTrigger:s=D$.resetTrigger}=this.attribute;this.stage.addEventListener(t,this._onBrushStart),this.stage.addEventListener(e,this._onBrushingWithDelay),this.stage.addEventListener(i,this._onBrushEnd),this.stage.addEventListener(s,this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let t=0;t({x:t.x+n,y:t.y+r}))),e.x,e.y))return this._operatingMask=i[t],!0}return!1}_initDraw(t){const{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints=[i],this._isDrawedBeforeEnd=!1,"single"===e&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(P$.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_initMove(t){var e,i;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!==(e=this._operatingMask.attribute.dx)&&void 0!==e?e:0,this._operatingMaskMoveDy=null!==(i=this._operatingMask.attribute.dy)&&void 0!==i?i:0;const{interactiveRange:s}=this.attribute,{minY:n=-1/0,maxY:r=1/0,minX:a=-1/0,maxX:o=1/0}=s,{x1:l,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,u=a-l,p=o-h,g=n-d,m=r-c;this._operatingMaskMoveRangeX=[u,p],this._operatingMaskMoveRangeY=[g,m],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(P$.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_drawing(t){var e,i;const s=this.eventPosToStagePos(t),{sizeThreshold:n=O$,brushType:r}=this.attribute,a=this._cacheDrawPoints.length;if(a>0){const t=null!==(e=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==e?e:{};if(s.x===t.x&&s.y===t.y)return}"polygon"===r||a<=1?this._cacheDrawPoints.push(s):this._cacheDrawPoints[a-1]=s;const o=this._computeMaskPoints();this._operatingMask.setAttribute("points",o);const{x1:l=0,x2:h=0,y1:d=0,y2:c=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds;this._isDrawedBeforeEnd=!this._operatingMask._AABBBounds.empty()&&!!(Math.abs(h-l)>n||Math.abs(d-c)>n),this._isDrawedBeforeEnd&&(this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(P$.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}))}_moving(t){const e=this._cacheMovePoint,i=this.eventPosToStagePos(t);if(i.x===(null==e?void 0:e.x)&&i.y===(null==e?void 0:e.y))return;const s=i.x-e.x,n=i.y-e.y,r=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],s))+this._operatingMaskMoveDx,a=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:r,dy:a}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(P$.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute;let s=[];const n=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return s="rect"===t?[n,{x:r.x,y:n.y},r,{x:n.x,y:r.y}]:"x"===t?[{x:n.x,y:i[0]},{x:r.x,y:i[0]},{x:r.x,y:i[1]},{x:n.x,y:i[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:n.y}]:k(this._cacheDrawPoints),s}_addBrushMask(){var t;const{brushStyle:e,hasMask:i}=this.attribute,s=Gr.polygon(Object.assign(Object.assign({points:k(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?null!==(t=e.opacity)&&void 0!==t?t:1:0}));s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:n=-1/0,maxX:r=1/0}=e,a=this.eventPosToStagePos(t);return a.x>r||a.xs||a.y{i.getActiveMarks().forEach((s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",Ly.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",Ly.Series))}))}))}static getSpecInfo(t){const e=t[this.specKey];if(!P(e)&&!1!==e.visible)return[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.brush}]}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_extendDataInBrush(t){const e=[];for(const i in t)for(const s in t[i])e.push(Object.assign({},t[i][s].data[0]));return e}_extendDatumOutOfBrush(t){var e;const i=[];for(const s in t)i.push(null===(e=t[s].data)||void 0===e?void 0:e[0]);return i}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a]}}_updateBrushComponent(t,e){const i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild(),this._needInitOutState=!0}_createBrushComponent(t,e){var i,s;const n=this._getBrushInteractiveAttr(t),r=new I$(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:OE(null===(i=this._spec)||void 0===i?void 0:i.style)},n),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));r.id=null!==(s=this._spec.id)&&void 0!==s?s:`brush-${this.id}`,this.getContainer().add(r);const{brushMode:a="single"}=this._spec;this._brushComponents.push(r),this._cacheInteractiveRangeAttrs.push(n),r.addEventListener(P$.drawStart,(e=>{this._emitEvent(jd.brushStart,t)})),r.addEventListener(P$.moveStart,(e=>{this._emitEvent(jd.brushStart,t)})),r.addEventListener(P$.drawing,(i=>{this._needInitOutState&&"single"===a&&this._initMarkBrushState(e,"outOfBrush"),this._needInitOutState=!1,this._needDisablePickable=!0,this._handleBrushChange(jd.brushChange,t,i),this._emitEvent(jd.brushChange,t)})),r.addEventListener(P$.moving,(e=>{this._handleBrushChange(jd.brushChange,t,e),this._emitEvent(jd.brushChange,t)})),r.addEventListener(P$.brushClear,(i=>{this._initMarkBrushState(e,""),this._needInitOutState=!0,this._needDisablePickable=!1,this._handleBrushChange(jd.brushChange,t,i),this._handleBrushChange(jd.brushClear,t,i),this._emitEvent(jd.brushChange,t),this._emitEvent(jd.brushClear,t)})),r.addEventListener(P$.drawEnd,(e=>{this._needInitOutState=!0,this._needDisablePickable=!1;const{operateMask:i}=e.detail;this._handleBrushChange(jd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(jd.brushEnd,t)})),r.addEventListener(P$.moveEnd,(e=>{const{operateMask:i}=e.detail;this._handleBrushChange(jd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(jd.brushEnd,t)}))}_handleBrushChange(t,e,i){const{operateMask:s}=i.detail;this._reconfigItem(s,e),this._reconfigLinkedItem(s,e)}_emitEvent(t,e){this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap,zoomRecord:this._zoomRecord}})}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},OE(t)),e)}_reconfigItem(t,e){this._itemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,n,r;const a=i.getGraphicItem(),o=e.id+"_"+i.key;(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[o])&&this._isBrushContainItem(t,a)?(i.addState("inBrush"),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][o]=i,delete this._outOfBrushElementsMap[o]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[o])&&!this._isBrushContainItem(t,a)&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._outOfBrushElementsMap[o]=i,delete this._inBrushElementsMap[t.name][o]),a.setAttribute("pickable",!this._needDisablePickable)}))}))}_reconfigLinkedItem(t,e){const i=e.getLayoutStartPoint(),s=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{if(!s.includes(e.id)){const s=e.getRegion().getLayoutStartPoint(),n=s.x-i.x,r=s.y-i.y;this._linkedItemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,a,o;const l=i.getGraphicItem(),h=e.id+"_"+i.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[h])&&this._isBrushContainItem(t,l,{dx:n,dy:r})?(i.addState("inBrush"),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][h]=i,delete this._linkedOutOfBrushElementsMap[h]):(null===(o=null===(a=this._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[h])&&!this._isBrushContainItem(t,l,{dx:n,dy:r})&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._linkedOutOfBrushElementsMap[h]=i),l.setAttribute("pickable",!this._needDisablePickable)}))}))}}))}_isBrushContainItem(t,e,i){var s,n,r;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points))return!1;const a=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],{a:o,b:l,c:h,d,e:c,f:u}=t.globalTransMatrix,p=(null==i?void 0:i.dx)||0,g=(null==i?void 0:i.dy)||0,m=a.map((t=>({x:o*t.x+h*t.y+c+p,y:l*t.x+d*t.y+u+g})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+p,t.globalAABBBounds.y1+g,t.globalAABBBounds.x2+p,t.globalAABBBounds.y2+g);const _=e.globalTransMatrix.e,f=e.globalTransMatrix.f;let v=[];if("symbol"===e.type){const{size:t=0}=null==e?void 0:e.attribute,i=Ra(t)[0]/2;return v=[{x:_-i,y:f-i},{x:_+i,y:f-i},{x:_+i,y:f+i},{x:_-i,y:f+i}],E$(m,v)}if("rect"===e.type){const{x1:t,x2:i,y1:s,y2:n}=null==e?void 0:e.AABBBounds,r=Math.abs(t-i),a=Math.abs(s-n);return v=[{x:_,y:f},{x:_+r,y:f},{x:_+r,y:f+a},{x:_,y:f+a}],E$(m,v)}return t.globalAABBBounds.intersects(e.globalAABBBounds)}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:d}=s,c=r?"x":"y",u=r?o:h,p=r?l:d;if(this._axisDataZoomMap[t.id]){const i=this._axisDataZoomMap[t.id],s=i.relatedAxisComponent,n=s.getScale().invert(u-e.getLayoutStartPoint()[c]),r=s.getScale().invert(p-e.getLayoutStartPoint()[c]),o=i.dataToStatePoint(n),l=i.dataToStatePoint(r),h=this._stateClamp(o-a),d=this._stateClamp(l+a);i.setStartAndEnd(Math.min(h,d),Math.max(h,d),["percent","percent"]),this._zoomRecord.push({operateComponent:i,start:h,end:d})}else{const i=t.getScale().range(),s=null!==(n=t.getScale().rangeFactor())&&void 0!==n?n:[0,1],r=i[1]{this._releatedAxes.push(this._option.getComponentByUserId(t))})):M(this._spec.axisIndex)?Ra(this._spec.axisIndex).forEach((t=>{this._releatedAxes.push(this._option.getComponentByIndex("axes",t))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((t=>{null==t||t.getRegions().forEach((e=>{this._regionAxisMap["region_"+e.id]?this._regionAxisMap["region_"+e.id].push(t):this._regionAxisMap["region_"+e.id]=[t]}))}))}_initAxisDataZoomMap(){this._option.getComponentsByKey("dataZoom").forEach((t=>{t.relatedAxisComponent&&(this._axisDataZoomMap[t.relatedAxisComponent.id]=t)}))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Ra(t).includes(n.userId.toString())||e&&Ra(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}_initMarkBrushState(t,e){this._brushComponents.forEach(((e,i)=>{i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._option.getAllSeries().forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{const i=t.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{const s=t.id+"_"+i.key;i.removeState("inBrush"),i.removeState("outOfBrush"),i.addState(e),this._outOfBrushElementsMap[s]=i,this._linkedOutOfBrushElementsMap[s]=i}))}))}))}initEvent(){}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return this._brushComponents}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)}));const i=super._compareSpec(t,e);return Dm(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(t){var e;super.onLayoutEnd(t),this._option.disableTriggerEvent||(null===(e=this._spec.visible)||void 0===e||e)&&(this._brushComponents?this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)})):(this._brushComponents=[],this._relativeRegions.forEach(((t,e)=>{this._createBrushComponent(t,e)}))))}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach((e=>{e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}}B$.type=r.brush,B$.specKey="brush";class F$ extends qE{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=Ty.CustomMark,this.layoutLevel=Cy.CustomMark}static getSpecInfo(t){const e=t[this.specKey];return e?y(e)?e.map(((t,e)=>({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:r.customMark}))):[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.customMark}]:null}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;const t=this._option&&this._option.getAllSeries(),e=!1!==this._option.animation,i=[];t&&t.length&&t.forEach((t=>{const e=t&&t.getMarksWithoutRoot();e&&e.length&&e.forEach((t=>{i.push(t)}))})),this._createExtensionMark(this._spec,null,`${sh}_series_${this.id}_extensionMark`,0,{depend:i,hasAnimation:e})}_createExtensionMark(t,e,i,s=0,n){var r;const a=this._createMark({type:t.type,name:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(n.hasAnimation&&t.animation){const e=TL({},CL(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(n.depend&&n.depend.length&&a.setDepend(...n.depend),P(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}))),M(t.dataId)||Wo(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(e.target.addListener("change",(()=>{a.getData().updateData()})),a.setDataView(e))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return Dm(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}onRender(t){}afterCompile(){this.getMarks().forEach((t=>{const e=t.getProduct();e&&e.addEventListener(rc.AFTER_ELEMENT_ENCODE,(()=>{if(!1===this._isLayout){const t=e.getGroupGraphicItem();0===t.listenerCount("*")&&t.addEventListener("*",((e,i)=>this._delegateEvent(t,e,i)))}}))}))}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new It).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new It;return this.getMarks().forEach((e=>{const i=e.getProduct();i&&t.union(i.getBounds())})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}}let Y$,j$,H$,z$;function N$(t){return Y$=1/0,j$=1/0,H$=-1/0,z$=-1/0,t.forEach((t=>{Y$>t.x&&(Y$=t.x),H$t.y&&(j$=t.y),z$({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function W$(t,e,i,s={}){const n=At(t[0]),r=At(t[1]),a=At(i),o=function(t,e){void 0===e&&(e="kilometers");var i=ep[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,s.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:wt(n+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:wt(l)}}function G$(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function U$(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function $$(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:U$(t.rect),anchorCandidates:J$(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>G$(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;tG$(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function K$(t){return t>180?t-360:t}function X$(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function q$(t,e){for(let i=0;i{const{x:r,y:a}=Z$(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}F$.type=r.customMark,F$.specKey="customMark";class Q$ extends qE{constructor(){super(...arguments),this.type=r.mapLabel,this.name=r.mapLabel,this.specKey="mapLabel",this.layoutType="none",this.layoutZIndex=Ty.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){const e=t[this.specKey];return e&&e.visible&&!M(e.series)?[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:r.mapLabel}]:null}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),0!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const e=t.getViewData();if(e){const t=new R(this._option.dataSet,{name:`${this.name}_data`});t.parse([e],{type:"dataview"}),t.transform({type:"copyDataView",level:Fp.copyDataView},!1),this._data=new dx(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){var t;this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handleZoom(t),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const e=this._spec.trigger;if("none"===e)return;const i=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();i&&("hover"===e?(i.addEventListener("element-highlight:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("element-highlight:reset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(null)}))):"click"===e&&(i.addEventListener("element-select:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("elementSelectReset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(t){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const s=new y$({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s}))),this._markerComponents.forEach(((t,s)=>{t.removeAllChild();const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;let g=0,m=0,_=0,f=0,v=0;const y=this._spec.position||"top",b=this._spec.offset,x=sl(null===(i=this._spec.background)||void 0===i?void 0:i.padding),S=this._spec.space||0;m+=((null==x?void 0:x.left)||0)+((null==x?void 0:x.right)||0),_+=((null==x?void 0:x.top)||0)+((null==x?void 0:x.bottom)||0);const k={},A=this.dataToPosition(t),w=Hn({});if(w.name=`${this.name}_marker_itemContainer_${e}`,k.container=w,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=Uv(OE(Object.assign({},this._spec.background.style)));t.setAttributes(A),k.labelBackground=t,w.appendChild(t)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const t=wv(OE(Object.assign({},this._spec.icon.style)));t.setAttributes(A),t.setAttribute("symbolType",null===(r=this._spec.icon.style)||void 0===r?void 0:r.shape);const e=t.AABBBounds,i=null!==(a=(null==e?void 0:e.y2)-(null==e?void 0:e.y1))&&void 0!==a?a:0,s=null!==(o=(null==e?void 0:e.x2)-(null==e?void 0:e.x1))&&void 0!==o?o:0;k.icon=t,w.appendChild(t),v=i,f+=s,g++}if(null===(l=this._spec.nameLabel)||void 0===l?void 0:l.visible){const e=p_(OE(Object.assign({},this._spec.nameLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.nameField]);const i=e.AABBBounds,s=null!==(h=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==h?h:0,n=null!==(d=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==d?d:0;k.nameLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}if((null===(c=this._spec.valueLabel)||void 0===c?void 0:c.visible)&&M(t[this.valueField])){const e=p_(OE(Object.assign({},this._spec.valueLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.valueField]);const i=e.AABBBounds,s=null!==(u=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==u?u:0,n=null!==(p=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==p?p:0;k.valueLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}const T=Object.values(k).find((t=>!!t&&"group"!==t.type)),C={x:null==T?void 0:T.getComputedAttribute("x"),y:null==T?void 0:T.getComputedAttribute("y")},L={x:C.x,y:C.y,width:0,height:0};L.width=m+f+(g-1)*S,L.height=_+v;const E={rect:L,point:C,index:e};if("outer"!==y){const t=["top","right","left","bottom"].filter((t=>t!==y));E.rect=Z$(L,y,b),E.anchors=t,E.offset=b}else E.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:E,contentMarks:k}}_layoutMarkers(t,e){var i,s,n;for(let r=0;r{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:g}),m+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(m+=p)}})),null==h||h.setAttributes({x:0,y:0,width:c.width,height:c.height}),null==d||d.setAttributes({dx:-c.width/2,dy:-c.height/2});const _=this._data.getLatestData()[r],f=this.dataToPosition(_),v=this.getRegions()[0].getLayoutStartPoint(),y=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(a||o||l));this._markerComponents[r].setAttributes({x:v.x,y:v.y,position:f,visible:this._activeDatum.includes(_),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:c.x+c.width/2-f.x,offsetY:c.y+c.height/2-f.y},itemLine:{visible:y,type:"type-po",lineStyle:OE(Object.assign({},null===(n=this._spec.leader)||void 0===n?void 0:n.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;tt.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=N$(s),l=i([(n+r)/2,(a+o)/2]);return l?$$(t.map((t=>{const s=t.rect,n=q$(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=W$(r,s,i);if(!q$(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],K$(X$(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=K$(X$(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=Z$(t.rect,a,0),t}))):[]}(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):$$(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){return(null==t?void 0:t.id)===this._series.id}onRender(t){}changeRegions(){}_getNeedClearVRenderComponents(){return this._markerComponents}}Q$.type=r.mapLabel,Q$.specKey="mapLabel";class tK{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(Wo(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:rs(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&M(e.modelId)){if(M(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&M(e.modelKey)&&"modelIndex"in e&&M(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;te.layoutLevel-t.layoutLevel));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>eK(t))),a=n.filter((t=>!eK(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>eK(t))),h=o.filter((t=>!eK(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);Wo(h.width)||(h.width=l.width),Wo(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function eK(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}tK.type="grid";class iK extends qy{layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},r=e.filter((t=>"absolute"===t.layoutType)),a=r.filter((t=>"z"===t.layoutOrient));let o={width:0,height:0};a.length&&(o=a[0].getLayoutRect()),this.leftCurrent+=o.width/8,this.rightCurrent-=o.width/8,this.topCurrent+=o.height/8,this.bottomCurrent-=o.height/8;const{regionItems:l,relativeItems:h,relativeOverlapItems:d,allRelatives:c,overlapItems:u}=this._groupItems(e);this.layoutRegionItems(l,h,d,u),this._processAutoIndent(l,h,d,u,c,n);const p=r.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(p);const g=h.filter((t=>"axes"===t.model.specKey&&Md(t.layoutOrient)))[0],m=h.filter((t=>"axes"===t.model.specKey&&kd(t.layoutOrient)))[0];if(g&&a.length){const t=g.getLayoutStartPoint(),e=g.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};a[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const s=g.getLayoutRect(),n=m.getLayoutRect(),r={length:a[0].getLayoutRect().width,width:s.width,height:n.height};g.model.setLayout3dBox&&g.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),a[0].model.setLayout3dBox&&a[0].model.setLayout3dBox(r),this.layoutZAxisItems(a,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}iK.type="layout3d";const sK=new Bt;h_(),of(),Nv(),py();class nK extends Pk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},nK.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,s,n,r,a,o;const{titleStyle:l={},position:h,contentStyle:d={},panel:c={},space:u=4,minWidth:p=0,maxWidth:g=1/0,padding:m=4,maxWidthPercent:_,visible:f,state:b,dx:x=0,dy:S=0}=this.attribute;let{title:k="",content:A=""}=this.attribute;k=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(k):k,A=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(A):A;const w=dP(m),T=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),C=g-w[1]-w[3],L=M(k)&&!1!==f,E=Object.assign(Object.assign({text:y(k)?k:[k],visible:L,wrap:!0},l),{x:w[3],y:w[0],maxLineWidth:C,textAlign:"left",textBaseline:"top"}),P=T.createOrUpdateChild("poptip-title",E,"text");Im(null==b?void 0:b.title)||(P.states=b.title);const D=P.AABBBounds,O=D.height(),R=D.width();let I=O+u;L||(I=0);const B=M(A)&&!1!==f,F=Object.assign(Object.assign({text:y(A)?A:[A],visible:B,wrap:!0},d),{x:w[3],y:w[0]+I,maxLineWidth:C,textAlign:"left",textBaseline:"top"}),Y=T.createOrUpdateChild("poptip-content",F,"text");Im(null==b?void 0:b.content)||(Y.states=b.content);const j=Y.AABBBounds,H=j.height(),z=j.width();B&&(I+=H);let N=ut(R+w[1]+w[3],z+w[1]+w[3]);N>g?N=g:NJ&&(J=n,Z=t)}}}}getAngleAndOffset(t,e,i,s){const n=s[1]/2;switch(t){case"tl":return{angle:rt/2*3,offset:[e/4,i+n],rectOffset:[-e/4,-i-s[1]]};case"top":return{angle:rt/2*3,offset:[e/2,i+n],rectOffset:[0,-i-s[1]]};case"tr":return{angle:rt/2*3,offset:[e/4*3,i+n],rectOffset:[e/4*3,-i-s[1]]};case"rt":return{angle:0,offset:[-n,i/5],rectOffset:[e/4*3,-i-s[1]]};case"right":return{angle:0,offset:[-n,i/2],rectOffset:[e/4*3,-i-s[1]]};case"rb":return{angle:0,offset:[-n,i/5*4],rectOffset:[e/4*3,-i-s[1]]};case"bl":return{angle:rt/2,offset:[e/4,-n],rectOffset:[-e/4,-i-s[1]]};case"bottom":return{angle:rt/2,offset:[e/2,-n],rectOffset:[0,-i-s[1]]};case"br":return{angle:rt/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-i-s[1]]};case"lt":return{angle:rt,offset:[e+n,i/5],rectOffset:[-e/4,-i-s[1]]};case"left":return{angle:rt,offset:[e+n,i/2],rectOffset:[0,-i-s[1]]};case"lb":return{angle:rt,offset:[e+n,i/5*4],rectOffset:[e/4*3,-i-s[1]]}}}}nK.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};let rK=class{render(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g;if(1===t._showPoptip){const{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;const s={};E(s,nK.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(s):this.poptipComponent=new nK(s);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};E(e,o_.poptip,n),n=e,n.content=null!==(p=n.content)&&void 0!==p?p:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const a=h.stage.getLayer("_builtin_interactive");a&&a.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),null===(g=this.poptipComponent.parent)||void 0===g||g.removeChild(this.poptipComponent)))}};rK=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],rK);var aK=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class oK{constructor(){this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.poptip=t=>{const e=t.target;this.needHide(e)?this.unpoptip(t):e!==this.activeGraphic&&(this.needShow(e)&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0))},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}needHide(t){return t.isContainer||!t.attribute}needShow(t){return!!t.attribute.poptip}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let lK=class extends oK{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};lK=aK([V()],lK);let hK=class extends oK{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)}}activate(t){super.activate(t);const{stage:e}=this.pluginService;e.addEventListener("pointerleave",this.pointerlave)}needHide(t){return"text"!==t.type||!t.cliped||t.isContainer||!t.attribute||t.attribute.disableAutoClipedPoptip}needShow(t){return!0}deactivate(t){const{stage:e}=this.pluginService;super.deactivate(t),e.removeEventListener("pointerleave",this.pointerlave)}};hK=aK([V()],hK);const dK=new B(((t,e,i,s)=>{i(rK)||(t(rK).toSelf().inSingletonScope(),t(lo).toService(rK)),i(lK)||(t(lK).toSelf(),t($r).toService(lK)),i(hK)||(t(hK).toSelf(),t($r).toService(hK))})),cK=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:e.height/t.offsetHeight):1,uK=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>eObject.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n},m_||(m_=Gr.CreateGraphic("richtext",{})),m_.setAttributes(a),m_.AABBBounds);var a;return{width:r.width(),height:r.height(),text:s}},pK="vchart-tooltip-container",gK={offsetX:10,offsetY:10,sanitize:function(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/\(/g,"(").replace(/ /g,"  ")}},mK=(t,e)=>{let i;if(M(t))if(h(t))i=t;else if(rs(t)){const s=t(e);h(s)&&(i=s)}return i},_K={left:["left","center"],right:["right","center"],top:["center","top"],lt:["left","top"],tl:["left","top"],rt:["right","top"],tr:["right","top"],bottom:["center","bottom"],bl:["left","bottom"],lb:["left","bottom"],br:["right","bottom"],rb:["right","bottom"],inside:["center","center"],center:["center","center"],centerBottom:["center","centerBottom"],centerTop:["center","centerTop"],centerLeft:["centerLeft","center"],centerRight:["centerRight","center"]},fK=(t,e)=>{var i,s;return null!==(s=null===(i=_K[t])||void 0===i?void 0:i[0])&&void 0!==s?s:e},vK=(t,e)=>{var i,s;return null!==(s=null===(i=_K[t])||void 0===i?void 0:i[1])&&void 0!==s?s:e},yK=(t,e)=>{var i;const s=new Map,n=new Map,{series:r,datum:a}=t,o="horizontal"===r.direction,l=(o?r.getYAxisHelper():r.getXAxisHelper()).getAxisId(),h=r.getChart().getComponentsByKey("axes").find((t=>t.id===l));if(!h)return;(o?n:s).set(h.getSpecIndex(),{value:null===(i=r.getDatumPositionValues(a[0],r.getDimensionField()))||void 0===i?void 0:i[0],axis:h});const d={visible:!!s.size,type:"rect"},c={visible:!!n.size,type:"rect"},{x:u,y:p,offsetWidth:g,offsetHeight:m,bandWidth:_,bandHeight:f}=IW(3,r,e,s,n,d,c);return u?YW(d,u,_,g):p?jW(c,p,f,m):void 0},bK={fontFamily:Oh.fontFamily,spacing:10,wordBreak:"break-word"};function xK(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:bK),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:null==e?void 0:e.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const SK=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return M(a)&&(r.cornerRadius=[a,a,a,a]),r};class MK extends CE{constructor(){super(...arguments),this._visible=!0,this._attributes=null,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this._changeTooltip=(t,e,i)=>this._isReleased?1:t?this._changeTooltipPosition(e,i):(this._clearAllCache(),this._updateTooltip(!1,e),0),this._changeTooltipPosition=(t,e)=>{var i,s,n;if(this._isReleased)return 1;const r=t.event,{tooltipSpec:a,tooltipActual:o,changePositionOnly:l}=t;if(a.enterable){if(!this._isPointerEscaped&&this._isPointerMovingToTooltip(t))return this._isTooltipPaused||(this._isTooltipPaused=!0,this._cachePointerTimer=setTimeout((()=>{this._isPointerEscaped=!0}),300)),0;this._isTooltipPaused=!1,this._isPointerEscaped=!1,clearTimeout(this._cachePointerTimer),this._cachePointerPosition=this._getPointerPositionRelativeToTooltipParent(t)}const h=o.activeType;if(a.handler)return null!==(n=null===(s=(i=a.handler).showTooltip)||void 0===s?void 0:s.call(i,h,e,t))&&void 0!==n?n:0;const d=a[h];if(!d)return 1;const c=this._getActualTooltipPosition(o,t,this._getTooltipBoxSize(o,l));o.position=c,d.updatePosition&&(o.position=d.updatePosition(o.position,e,t));let u=!1!==(null==d?void 0:d.visible);return e&&"pointerout"!==r.type&&o.visible&&(o.title||o.content)||(u=!1),this._updateTooltip(u,Object.assign(Object.assign({},t),{changePositionOnly:l})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,d,c,u;const{tooltipSpec:p}=e,g={x:1/0,y:1/0};if(!p)return this._cacheTooltipPosition=void 0,g;const m=e.event,{activeType:_,data:f}=t,v="dimension"===_?null===(n=null===(s=f[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==f?void 0:f[0];let{offsetX:y,offsetY:b}=this._option;const x=p[_],S=pW(x.position,f,e),k=null!==(r=pW(x.positionMode,f,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:A=0,height:w=0}=null!=i?i:{},T="canvas"===p.renderMode,C=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),L=null!==(o=null==C?void 0:C.width)&&void 0!==o?o:nh,E=null!==(l=null==C?void 0:C.height)&&void 0!==l?l:rh;let P=!1;const D={width:0,height:0};let O={x:0,y:0},R={x:0,y:0},I=1,B=1;if(dl(this._env)&&!p.confine){if(D.width=window.innerWidth,D.height=window.innerHeight,!T){const t=this._getParentElement(p);R=null!==(c=null===(d=null==t?void 0:t.getBoundingClientRect)||void 0===d?void 0:d.call(t))&&void 0!==c?c:g;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer,i=null==e?void 0:e.getBoundingClientRect();O={x:i.x-R.x,y:i.y-R.y},I=cK(e,i),B=cK(t,R)}}else D.width=L,D.height=E;const F=B/I;let Y,j,H,z,N=S,V=S;const W=({orient:t,mode:i,offset:s})=>{var n;let r,a;const o=e.model,l=null==o?void 0:o.getLayoutStartPoint();if(y=null!=s?s:y,"mark"===i){P=!0;const t=e.item,i=null==t?void 0:t.getBounds();i&&l&&(r=i.x1+l.x,a=i.x2+l.x)}else if("crosshair"===i&&"cartesian"===(null===(n=null==v?void 0:v.series)||void 0===n?void 0:n.coordinate)&&v.datum&&v.datum.length){P=!0;const t=yK(v,l);t&&(r=t.start.x,a=t.end.x)}else N=t;if(P)switch(fK(t)){case"left":Y=r-A*F-y;break;case"right":Y=a+y;break;case"center":Y=(r+a)/2-A*F/2;break;case"centerLeft":Y=(r+a)/2-A*F-y;break;case"centerRight":Y=(r+a)/2+y}},G=({orient:t,mode:i,offset:s})=>{var n;let r,a;const o=e.model,l=null==o?void 0:o.getLayoutStartPoint();if(b=null!=s?s:b,"mark"===i){P=!0;const t=e.item,i=null==t?void 0:t.getBounds();i&&l&&(r=i.y1+l.y,a=i.y2+l.y)}else if("crosshair"===i&&"cartesian"===(null===(n=null==v?void 0:v.series)||void 0===n?void 0:n.coordinate)&&v.datum&&v.datum.length){P=!0;const t=yK(v,l);t&&(r=t.start.y,a=t.end.y)}else V=t;if(P)switch(vK(t)){case"top":j=r-w*F-b;break;case"bottom":j=a+b;break;case"center":j=(r+a)/2-w*F/2;break;case"centerTop":j=(r+a)/2-w*F-b;break;case"centerBottom":j=(r+a)/2+b}};if(ns(S)){if(ns(U=S)&&(M(U.left)||M(U.right)||M(U.top)||M(U.bottom))){const{left:t,right:e,top:i,bottom:s}=S;Y=mK(t,m),j=mK(i,m),H=mK(e,m),z=mK(s,m)}else if((t=>ns(t)&&(M(t.x)||M(t.y)))(S)){const{x:t,y:e}=S;h(t)||rs(t)?Y=mK(t,m):W(t),h(e)||rs(e)?j=mK(e,m):G(e)}}else M(S)&&(W({orient:S,mode:k}),G({orient:S,mode:k}));var U;let $,K;const{canvasX:X,canvasY:q}=m;if(Wo(Y))$=Y;else if(Wo(H))$=L-A*F-H;else{const t=X;switch(fK(N,"right")){case"center":$=t-A*F/2;break;case"left":case"centerLeft":$=t-A*F-y;break;case"right":case"centerRight":$=t+y}}if(Wo(j))K=j;else if(Wo(z))K=E-w*F-z;else{const t=q;switch(vK(V,"bottom")){case"center":K=t-w*F/2;break;case"top":case"centerTop":K=t-w*F-b;break;case"bottom":case"centerBottom":K=t+b}}$*=I,K*=I,dl(this._env)&&($+=O.x,K+=O.y),$/=B,K/=B;const{width:Z,height:J}=D,Q=()=>$*B+R.x<0,tt=()=>($+A)*B+R.x>Z,et=()=>K*B+R.y<0,it=()=>(K+w)*B+R.y>J,st=fK(S,"right");"left"===st||st.includes("center")&&Q()?(Q()&&(P?$=-R.x/B:"center"===fK(S,"right")?$+=y+A/2:$+=2*y+A),tt()&&($=(Z-R.x)/B-A)):(tt()&&(P?$=(Z-R.x)/B-A:"center"===fK(S,"right")?$-=y+A/2:$-=2*y+A),Q()&&($=-R.x/B));const nt=vK(S,"bottom");"top"===nt||nt.includes("center")&&et()?(et()&&(P?K=-R.y/B:"center"===vK(S,"bottom")?K+=b+w/2:K+=2*b+w),it()&&(K=(J-R.y)/B-w)):(it()&&(P?K=(J-R.y)/B-w:"center"===vK(S,"bottom")?K-=b+w/2:K-=2*b+w),et()&&(K=0-R.y/B));const rt={x:$,y:K};return this._cacheTooltipPosition=rt,this._cacheTooltipSize={width:A,height:w},rt}}get env(){return this._env}onAdd(t){super.onAdd(t);const e=t.component;this._component=e,this._chartOption=e.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=e.getCompiler(),this._initFromSpec()}hideTooltip(t){return this.changeTooltip(!1,t)}release(){var t,e,i;this._clearAllCache();const s=null!==(t=this._component.getSpec())&&void 0!==t?t:{};s.handler?null===(i=(e=s.handler).release)||void 0===i||i.call(e):(this._removeTooltip(),this._isReleased=!0)}_clearAllCache(){this._isTooltipPaused=!1,this._isPointerEscaped=!1,clearTimeout(this._cachePointerTimer),this._cachePointerTimer=-1,this._cachePointerPosition=void 0,this._cacheTooltipPosition=void 0,this._cacheTooltipSize=void 0}_throttle(t){const e=this._component.getSpec();let i;return i=h(e.throttleInterval)?e.throttleInterval:"html"===e.renderMode&&e.transitionDuration?50:10,Ud(t,i)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return Object.assign(Object.assign({},gK),{offsetX:null!==(t=null==i?void 0:i.x)&&void 0!==t?t:gK.offsetX,offsetY:null!==(e=null==i?void 0:i.y)&&void 0!==e?e:gK.offsetY})}_getTooltipBoxSize(t,e){var i,s,n;if(!e||P(this._attributes)){const e=null!==(s=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme())&&void 0!==s?s:{};this._attributes=((t,e,i)=>{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:d}=e,{panel:c={},titleLabel:u,shape:p,keyLabel:g,valueLabel:m,spaceRow:_,maxContentHeight:f,align:v}=l,y=dP(c.padding),b=sl(c.padding),x=xK(Object.assign({textAlign:"right"===v?"right":"left"},u),i),S=xK(Object.assign({textAlign:"right"===v?"right":"left"},g),i),k=xK(m,i),A={fill:!0,size:null!==(s=null==p?void 0:p.size)&&void 0!==s?s:8,spacing:null!==(n=null==p?void 0:p.spacing)&&void 0!==n?n:6},w={panel:SK(c),padding:y,title:{},content:[],titleStyle:{value:x,spaceRow:_},contentStyle:{shape:A,key:S,value:k,spaceRow:_},hasContentShape:!1,keyWidth:0,valueWidth:0,maxContentHeight:f,enterable:h,transitionDuration:d,align:v},{title:T={},content:C=[]}=t;let L=b.left+b.right,E=b.top+b.bottom,P=b.top+b.bottom,D=0;const O=C.filter((t=>(t.key||t.value)&&!1!==t.visible)),R=!!O.length;let I=0,B=0,F=0,Y=0;if(R){const t=[],e=[],i=[],s=[];let n=0;w.content=O.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:d="",shapeFill:c,shapeStroke:u,shapeLineWidth:p,shapeSize:g,value:m,isKeyAdaptive:f,spaceRow:v,keyStyle:y,valueStyle:b,shapeHollow:x,shapeColor:w}=r,T={height:0,spaceRow:null!=v?v:_};if(M(h)){const i=Tl({},S,xK(y,void 0,{})),{width:s,height:n,text:r}=uK(h,i);T.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),f?e.push(s):t.push(s),o=Math.max(o,n)}if(M(m)){const t=Tl({},k,xK(b,void 0,{})),{width:e,height:s,text:n}=uK(m,t);T.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:d},e=null!=c?c:w;x?t.stroke=e:t.fill=e,t.stroke=null!=u?u:e,t.lineWidth=p,T.shape=t;const i=null!=g?g:A.size;o=Math.max(i,o),s.push(i)}else T.shape={visible:!1};return T.height=o,n+=o,aU.autoWidth&&!1!==U.multiLine;if(N){U=Tl({},x,xK(W,void 0,{})),$()&&(U.multiLine=null===(r=U.multiLine)||void 0===r||r,U.maxWidth=null!==(a=U.maxWidth)&&void 0!==a?a:R?Math.ceil(D):void 0);const{text:t,width:e,height:i}=uK(V,U);w.title.value=Object.assign(Object.assign({width:$()?Math.min(e,null!==(o=U.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},U),{text:t}),j=w.title.value.width,H=w.title.value.height,z=H+(R?w.title.spaceRow:0)}return E+=z,P+=z,w.title.width=j,w.title.height=H,$()?L+=D||j:L+=Math.max(j,D),R&&w.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=L-b.left-b.right-Y-I-S.spacing-k.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),w.valueWidth=Math.max(w.valueWidth,i.width))})),w.panel.width=L,w.panel.height=E,w.panelDomHeight=P,w})(t,this._component.getSpec(),e)}const{panel:r,panelDomHeight:a}=null!==(n=this._attributes)&&void 0!==n?n:{},o="canvas"===this._component.getSpec().renderMode;return{width:(null==r?void 0:r.width)+(o?r.lineWidth:0),height:(null!=a?a:null==r?void 0:r.height)+(o?r.lineWidth:0)}}_getPointerPositionRelativeToTooltipParent(t){var e,i;let{canvasX:s,canvasY:n}=t.event;const{tooltipSpec:r}=t,a={x:1/0,y:1/0},o="canvas"===r.renderMode,l=this._getParentElement(r);let h={x:0,y:0},d={x:0,y:0},c=1,u=1;if(dl(this._env)&&!r.confine&&!o){d=null!==(e=null==l?void 0:l.getBoundingClientRect())&&void 0!==e?e:a;const t=null!==(i=this._compiler.getCanvas())&&void 0!==i?i:this._chartContainer,s=null==t?void 0:t.getBoundingClientRect();h={x:s.x-d.x,y:s.y-d.y},c=cK(t,s),u=cK(l,d)}return s*=c,n*=c,dl(this._env)&&(s+=h.x,n+=h.y),s/=u,n/=u,{x:s,y:n}}_isPointerMovingToTooltip(t){if(!this._cacheTooltipPosition||!this._cacheTooltipSize||!this._cachePointerPosition)return!1;const{width:e,height:i}=this._cacheTooltipSize,{x:s=0,y:n}=this._cacheTooltipPosition,r=this._getPointerPositionRelativeToTooltipParent(t);if(ga(r,{x1:s,y1:n,x2:s+e,y2:n+i},!1))return!0;const a={x:s,y:n},o={x:a.x+e,y:a.y},l={x:a.x,y:a.y+i},h={x:o.x,y:l.y},d=this._cachePointerPosition;return T$([d,a,o],r.x,r.y)||T$([d,l,h],r.x,r.y)||T$([d,a,h],r.x,r.y)||T$([d,o,l],r.x,r.y)}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption(),this.changeTooltip=this._throttle(this._changeTooltip),this.changeTooltipPosition=this._throttle(this._changeTooltipPosition)}reInit(){this._initFromSpec()}}MK.specKey="tooltip";const kK=(t,e)=>M(t)?y(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",AK=t=>{const e=t.split(" ").map((t=>Number.isNaN(t)?Number.parseFloat(t.substring(0,t.length-2)):Number.parseFloat(t)));return 1===e.length?e[0]:e};let wK;const TK=(t=document.body)=>{if(P(wK)){const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",t.appendChild(e);const i=document.createElement("div");e.appendChild(i),wK=e.offsetWidth-i.offsetWidth,e.parentNode.removeChild(e)}return wK};function CK(t,e){if(!t)return;const{fontFamily:i,fontSize:s,fill:n,textAlign:r,lineHeight:a,fontWeight:o,multiLine:l,wordBreak:h,maxWidth:d}=Tl({},e,t),c={};return c.fontFamily=i,c.fontSize=kK(s),c.color=n,c.textAlign=r,c.lineHeight=kK(Qs(a,s)),c.fontWeight=o,c.whiteSpace=l?"initial":"nowrap",c.wordBreak=l?null!=h?h:"break-word":"normal",c.maxWidth=kK(d),c}class LK{static isInstance(t){return!!t&&t.type===LK.type}setOption(t){this._option=t,Object.values(this.children).forEach((e=>e.setOption(t)))}getParentEl(){return LK.isInstance(this.parent)?this.parent.product:this.parent}constructor(t,e,i){this.type=LK.type,this._renderContentCache=null,this.children={},this.parent=t,this._option=e,this.childIndex=null!=i?i:0}init(t,e){}initAll(){this.init(),Object.values(this.children).forEach((t=>t.initAll()))}setStyle(t){this.product&&t&&Object.keys(t).forEach((e=>{this.product.style[e]!==t[e]&&(this.product.style[e]=t[e])}))}setContent(t){}setVisibility(t){if(!this.product)return;const{style:e}=this.product;e.visibility=t?"visible":"hidden",Object.values(this.children).forEach((e=>e.setVisibility(t)))}getVisibility(){var t,e;return!!(null===(e=null===(t=this.product)||void 0===t?void 0:t.style)||void 0===e?void 0:e.visibility)&&"hidden"!==this.product.style.visibility}release(){var t;if(Object.values(this.children).forEach((t=>t.release())),this.children={},this.product){try{null===(t=this.getParentEl())||void 0===t||t.removeChild(this.product)}catch(t){}this.product=null}}createElement(t,e,i,s){const n=null==hl?void 0:hl.createElement(t),r=this.getParentEl();if(!n||!r)return;e&&n.classList.add(...e),i&&Object.keys(i).forEach((t=>{n.style[t]=i[t]})),s&&(n.id=s);let a=this.childIndex;if(LK.isInstance(this.parent)){let t=Number.MAX_VALUE;for(let e=0;et.product===r.children[e]));i.childIndex>this.childIndex&&i.childIndex=r.children.length?r.appendChild(n):r.insertBefore(n,r.children[a]),n}}LK.type="tooltipModel";const EK={fontSize:"13px",marginBottom:"0px",fontWeight:"normal"},PK={boxSizing:"border-box"},DK={display:"inline-block",verticalAlign:"top"},OK={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},RK={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},IK={paddingTop:"0px",paddingBottom:"0px",textAlign:"right",fontWeight:"normal"},BK={lineHeight:"normal",boxSizing:"border-box"};class FK extends LK{init(t,e,i){if(!this.product){const s=this.createElement(null!=i?i:"div",[...null!=t?t:[],"shape"],void 0,e);this.product=s}}setStyle(t,e){super.setStyle(t),this.setSvg(e)}setContent(t){this.setSvg(t)}setSvg(t){const e=function(t,e){var i,s,n,r,a,o;if(!(null==t?void 0:t.hasShape)||!t.symbolType)return"";const{symbolType:l,fill:h,stroke:d,hollow:c=!1}=t,u=t.size?e(t.size):"8px",p=t.lineWidth?e(t.lineWidth)+"px":"0px";let g="currentColor";const m=()=>d?e(d):g,_=AK(u),f=t=>new Av({symbolType:t,size:_,fill:!0});let v=f(l);const y=v.getParsedPath();y.path||(v=f(y.pathStr));const b=v.getParsedPath().path,x=b.toString(),M=b.bounds;let k=`${M.x1} ${M.y1} ${M.width()} ${M.height()}`;if("0px"!==p){const[t,e,i,s]=k.split(" ").map((t=>Number(t))),n=Number(p.slice(0,-2));k=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}if(!h||S(h)||c)return g=c?"none":h?e(h):"currentColor",`\n \n \n \n `;if(ns(h)){g=null!==(i="gradientColor"+t.index)&&void 0!==i?i:"";let l="";const d=(null!==(s=h.stops)&&void 0!==s?s:[]).map((t=>``)).join("");return"radial"===h.gradient?l=`\n ${d}\n `:"linear"===h.gradient&&(l=`\n ${d}\n `),`\n \n ${l}\n \n \n `}return""}(t,this._option.valueToHtml);this.product&&e!==this._svgHtmlCache&&(this._svgHtmlCache=e,this.product.innerHTML=e)}release(){super.release(),this._svgHtmlCache=""}}class YK extends LK{init(t,e,i){this.product||(this.product=this.createElement(null!=i?i:"span",t,void 0,e))}setContent(t,e){if(!this.product)return;let i=this._option.valueToHtml(t);e&&(i=i.replaceAll("\n","
")),i!==this.product.innerHTML&&(this.product.innerHTML=i)}}const jK={overflowWrap:"normal",wordWrap:"normal"};class HK extends LK{constructor(t,e,i,s){super(t,e,s),this.className=i}init(){var t,e;this.product||(this.product=this.createElement("div",[this.className]));const i=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];if("shape-box"!==this.className||i.some((t=>t.hasShape&&t.shapeType))){Object.keys(this.children).forEach((t=>{const e=pd(t);e>=i.length&&(this.children[e].release(),delete this.children[e])}));for(let t=0;t{const e=pd(t);this.children[e].release(),delete this.children[e]}))}setStyle(){var t,e,i,s;const n=this._option.getTooltipStyle();super.setStyle(Tl({},DK,n.content,this._getContentColumnStyle()));const r=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[],a=null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[],o=(t,e)=>{var i,s;const{key:r,isKeyAdaptive:o}=t,{height:l}=a[e],{keyColumn:d}=n,c=Tl({},o?RK:OK,Object.assign(Object.assign(Object.assign({height:kK(l)},jK),d.common),null===(i=d.items)||void 0===i?void 0:i[e]));return S(r)&&""!==(null===(s=null==r?void 0:r.trim)||void 0===s?void 0:s.call(r))||h(r)||c.visibility?c.visibility="visible":c.visibility="hidden",c};r.forEach(((t,e)=>{var i;"key-box"===this.className?this.children[e].setStyle(o(t,e)):"value-box"===this.className?this.children[e].setStyle(((t,e)=>{var i;const{height:s}=a[e],{valueColumn:r}=n;return Tl({},IK,Object.assign(Object.assign(Object.assign({height:kK(s)},jK),r.common),null===(i=r.items)||void 0===i?void 0:i[e]))})(0,e)):"shape-box"===this.className&&(null===(i=this.children[e])||void 0===i||i.setStyle(((t,e)=>{var i,s,r,l;const{height:h}=a[e],{shapeColumn:d}=n,c=o(t,e),u=`calc((${null!==(s=null!==(i=c.lineHeight)&&void 0!==i?i:c.fontSize)&&void 0!==s?s:"18px"} - ${null!==(r=d.width)&&void 0!==r?r:"8px"}) / 2)`;return Tl({},BK,Object.assign(Object.assign({height:kK(h),paddingTop:u},d.common),null===(l=d.items)||void 0===l?void 0:l[e]))})(t,e),this._getShapeSvgOption(t,e)))}))}setContent(){var t,e,i,s;const n=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[],r=null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[];n.forEach(((t,e)=>{var i,s,n,a,o,l,d;let c;if("key-box"===this.className){const a=t.key;c=S(a)&&""!==(null===(i=null==a?void 0:a.trim)||void 0===i?void 0:i.call(a))||h(a)?a:"",null===(s=this.children[e])||void 0===s||s.setContent(c,null===(n=r[e].key)||void 0===n?void 0:n.multiLine)}else if("value-box"===this.className){const i=t.value;c=S(i)&&""!==(null===(a=null==i?void 0:i.trim)||void 0===a?void 0:a.call(i))||h(i)?i:"",null===(o=this.children[e])||void 0===o||o.setContent(c,null===(l=r[e].value)||void 0===l?void 0:l.multiLine)}else"shape-box"===this.className&&(c=this._getShapeSvgOption(t,e),null===(d=this.children[e])||void 0===d||d.setContent(c))}))}_getContentColumnStyle(){var t,e;const i=this._option.getTooltipStyle();switch(this.className){case"shape-box":const s=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];return Object.assign(Object.assign({},i.shapeColumn),"shape-box"!==this.className||s.some((t=>t.hasShape&&t.shapeType))?{}:{display:"none"});case"key-box":return i.keyColumn;case"value-box":return i.valueColumn}}_getShapeSvgOption(t,e){var i,s;const n=this._option.getTooltipStyle(),r=Object.assign(Object.assign({},n.shapeColumn),null===(i=n.shapeColumn.items)||void 0===i?void 0:i[e]);return{hasShape:t.hasShape,symbolType:t.shapeType,size:r.width,fill:null!==(s=t.shapeFill)&&void 0!==s?s:t.shapeColor,stroke:t.shapeStroke,lineWidth:t.shapeLineWidth,hollow:t.shapeHollow,index:e}}}class zK extends LK{init(){this.product||(this.product=this.createElement("div",["container-box"]));const{align:t}=this._option.getTooltipAttributes();"right"===t?(this.valueBox||(this.valueBox=this._initBox("value-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.shapeBox||(this.shapeBox=this._initBox("shape-box",2))):(this.shapeBox||(this.shapeBox=this._initBox("shape-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.valueBox||(this.valueBox=this._initBox("value-box",2)))}_initBox(t,e){const i=new HK(this.product,this._option,t,e);return i.init(),this.children[i.childIndex]=i,i}setStyle(t){super.setStyle(Tl(this._getContentContainerStyle(),t)),Object.values(this.children).forEach((t=>{t.setStyle()}))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}_getContentContainerStyle(){const t={whiteSpace:"nowrap",lineHeight:"0px"},{panelDomHeight:e,panel:i,maxContentHeight:s}=this._option.getTooltipAttributes();if(M(s)&&et+AK(e)),0);return Object.assign(Object.assign({},t),{width:`${a+TK(this._option.getContainer())}px`,maxHeight:kK(s),overflow:"auto"})}return t}release(){super.release(),this.shapeBox=null,this.keyBox=null,this.valueBox=null}}class NK extends LK{init(){const t=this._option.getTooltipActual();this.product||(this.product=this.createElement("h2"));const{align:e}=this._option.getTooltipAttributes();"right"!==e||this.textSpan||this._initTextSpan(0);const{title:i}=t;(null==i?void 0:i.hasShape)&&(null==i?void 0:i.shapeType)?this.shape||this._initShape("right"===e?1:0):this.shape&&this._releaseShape(),"right"===e||this.textSpan||this._initTextSpan(1)}_initShape(t=0){const e=new FK(this.product,this._option,t);e.init(),this.shape=e,this.children[e.childIndex]=e}_releaseShape(){this.shape&&(this.shape.release(),delete this.children[this.shape.childIndex],this.shape=null)}_initTextSpan(t=1){const e=new YK(this.product,this._option,t);e.init(),this.textSpan=e,this.children[e.childIndex]=e}setStyle(t){var e,i,s,n;const r=this._option.getTooltipStyle(),a=this._option.getTooltipActual(),{title:o}=a;super.setStyle(Tl({},EK,r.title,t)),null===(e=this.shape)||void 0===e||e.setStyle({paddingRight:null===(i=r.shapeColumn.common)||void 0===i?void 0:i.marginRight},{hasShape:null==o?void 0:o.hasShape,symbolType:null==o?void 0:o.shapeType,size:null===(s=r.shapeColumn.common)||void 0===s?void 0:s.width,fill:null==o?void 0:o.shapeColor,hollow:null==o?void 0:o.shapeHollow}),null===(n=this.textSpan)||void 0===n||n.setStyle({color:"inherit"})}setContent(){var t,e,i,s,n,r;const a=this._option.getTooltipStyle(),o=this._option.getTooltipActual(),l=this._option.getTooltipAttributes(),{title:h}=o;this.init(),null===(t=this.shape)||void 0===t||t.setStyle(void 0,{hasShape:null==h?void 0:h.hasShape,symbolType:null==h?void 0:h.shapeType,size:null===(e=a.shapeColumn.common)||void 0===e?void 0:e.width,fill:null==h?void 0:h.shapeColor,hollow:null==h?void 0:h.shapeHollow}),null===(i=this.textSpan)||void 0===i||i.setStyle({color:"inherit"}),null===(s=this.textSpan)||void 0===s||s.setContent(null==h?void 0:h.value,null===(r=null===(n=l.title)||void 0===n?void 0:n.value)||void 0===r?void 0:r.multiLine)}release(){super.release(),this.shape=null,this.textSpan=null}}const VK="99999999999999";class WK extends LK{constructor(t,e,i){super(t.getContainer(),t,0),this.title=null,this.content=null,this._classList=e,this._id=i}setVisibility(t){if(super.setVisibility(t),!this.product)return;const{classList:e}=this.product;t?e.add("visible"):e.remove("visible")}init(){var t;const e=this._option.getTooltipActual();this.product||this._initPanel(this._classList,this._id);const{title:i}=e;!1!==(null==i?void 0:i.visible)&&M(null==i?void 0:i.value)?this.title||this._initTitle():this.title&&this._releaseTitle(),(null!==(t=e.content)&&void 0!==t?t:[]).length>0?this.content||this._initContent():this.content&&this._releaseContent()}_initPanel(t,e){const i=this.createElement("div",t,{left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:VK,fontFamily:"sans-serif",fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh"},e);this.product=i}_initTitle(){const t=new NK(this.product,this._option,0);t.init(),this.title=t,this.children[t.childIndex]=t}_releaseTitle(){this.title&&(this.title.release(),delete this.children[this.title.childIndex],this.title=null)}_initContent(){const t=new zK(this.product,this._option,1);t.init(),this.content=t,this.children[t.childIndex]=t}_releaseContent(){this.content&&(this.content.release(),delete this.children[this.content.childIndex],this.content=null)}setStyle(){const t=this._option.getTooltipStyle();super.setStyle(Tl({},PK,t.panel)),Object.values(this.children).forEach((t=>t.setStyle()))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}release(){super.release(),this.title=null,this.content=null}}const GK=t=>{$l.registerComponentPlugin(t.type,t)};class UK extends MK{getVisibility(){var t;return!!(null===(t=this.model)||void 0===t?void 0:t.getVisibility())}setVisibility(t){var e;t!==this.getVisibility()&&(null===(e=this.model)||void 0===e||e.setVisibility(t))}constructor(){super(UK.type),this.type=gW.dom,this._tooltipContainer=null==hl?void 0:hl.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec(),e=t.parentElement;if(hl&&e&&e.children&&e.children.length){for(let t=0;tthis._domStyle,getTooltipActual:()=>this._tooltipActual,getTooltipAttributes:()=>this._attributes,getContainer:()=>this._container},[t.className],this.name)}}_removeTooltip(){var t;null===(t=this.model)||void 0===t||t.release(),this._container=null}_updateTooltip(t,e){var i,s;const{tooltipActual:n,tooltipSpec:r}=e;if(t&&this.model){if(!e.changePositionOnly){this._tooltipActual=n,this._initStyle();const t=!this.model.product;this.model.initAll(),t&&this._initEvent(this.model.product),this.model.setStyle(),this.model.setContent()}this.setVisibility(t);const a=this.model.product;if(a){const{x:t=0,y:o=0}=null!==(i=n.position)&&void 0!==i?i:{};if(r.updateElement){this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:t,y:o}),r.updateElement(a,n,e);const i=this._getActualTooltipPosition(n,e,{width:a.offsetWidth,height:a.offsetHeight});this._updatePosition(i),this._cacheCustomTooltipPosition=i}else this._updatePosition({x:t,y:o})}}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){this._domStyle=function(t){var e,i,s;const{panel:n={},title:r,content:a,titleStyle:o={},contentStyle:l={},padding:h,keyWidth:d,valueWidth:c,enterable:u,transitionDuration:p,panelDomHeight:g=0,align:m="left"}=null!=t?t:{},{fill:_,shadow:f,shadowBlur:v,shadowColor:y,shadowOffsetX:b,shadowOffsetY:x,shadowSpread:S,cornerRadius:M,stroke:k,lineWidth:A=0,width:w=0}=n,{value:T={}}=o,{shape:C={},key:L={},value:E={}}=l,P=function(t){if(!t)return;const{size:e}=Tl({},void 0,t),i={};return i.width=kK(e),i}(C),D=CK(L),O=CK(E),{bottom:R,left:I,right:B,top:F}=sl(h),Y="right"===m?"marginLeft":"marginRight";return{align:m,panel:{width:kK(w+2*A),minHeight:kK(g+2*A),paddingBottom:kK(R),paddingLeft:kK(I),paddingRight:kK(B),paddingTop:kK(F),borderColor:k,borderWidth:kK(A),borderRadius:kK(M),backgroundColor:_?`${_}`:"transparent",boxShadow:f?`${b}px ${x}px ${v}px ${S}px ${y}`:"initial",pointerEvents:u?"auto":"none",transitionDuration:p?`${p}ms`:"initial",transitionProperty:p?"transform":"initial",transitionTimingFunction:p?"ease-out":"initial"},title:Object.assign({marginTop:"0px",marginBottom:(null==a?void 0:a.length)?kK(null==r?void 0:r.spaceRow):"0px"},CK(Tl({},T,null==r?void 0:r.value))),content:{},shapeColumn:{common:P,items:null==a?void 0:a.map((({spaceRow:t},e)=>({marginTop:"0px",marginBottom:eObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:iObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:i{const{renderMode:e,enterable:i}=this._component.getSpec(),s=t.relatedTarget;"html"===e&&i&&(P(s)||s!==this._compiler.getCanvas()&&!jr(s,this.getTooltipContainer()))&&this._component.hideTooltip()}))}}UK.type=gW.dom;const $K=(t,...e)=>{const i=[t.shape,...e.map((t=>null==t?void 0:t.shape))],s=[t.key,...e.map((t=>null==t?void 0:t.key))],n=[t.value,...e.map((t=>null==t?void 0:t.value))];return E(t,...e,{shape:i.every(P)?void 0:E({},...i),key:s.every(P)?void 0:E({},...s),value:n.every(P)?void 0:E({},...n)})},KK=t=>{const{width:e,height:i,wordBreak:s="break-word",textAlign:n,textBaseline:r,text:a}=t;return Array.isArray(a)?{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:Ra(a).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:null==a?void 0:a.text}},XK={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Gk,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Gk,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Gk,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new Bt).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},qK=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];h_(),py(),Nv(),of(),JM();class ZK extends Pk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},ZK.defaultAttributes,t),e),this.name="tooltip"}render(){var t;const{visible:e,content:i,panel:s,keyWidth:n,valueWidth:r,hasContentShape:a,autoCalculatePosition:o,autoMeasure:l,align:h}=this.attribute;if(!e)return void this.hideAll();l&&ZK.measureTooltip(this.attribute),o&&ZK.calculateTooltipPosition(this.attribute);const d=dP(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:d[3],y:d[0]},"group");const c=ZK.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",E({symbolType:"circle"},c.shape,{visible:jk(c)&&jk(c.shape)}),"symbol"),"object"!=typeof c.value.text||null===c.value.text||"rich"!==c.value.text.type&&"html"!==c.value.text.type?c.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:jk(c)&&jk(c.value)},KK(c.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:null!==(t=c.value.text)&&void 0!==t?t:"",visible:jk(c)&&jk(c.value)},c.value),"text"):"rich"===c.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:jk(c)&&jk(c.value)},KK(c.value)),"richtext"):"html"===c.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:c.value.text.text},Kk),c.value),visible:jk(c)&&jk(c.value),width:c.value.width,height:c.value.height,wordBreak:c.value.wordBreak,textAlign:c.value.textAlign,textBaseline:c.value.textBaseline,singleLine:!1,textConfig:[]},c.value),"richtext"));const u=jk(c.shape)?c.shape.size+c.shape.spacing:0,{textAlign:p,textBaseline:g}=c.value,m=s.width-d[3]-d[0]-u;"center"===p?this._tooltipTitle.setAttribute("x",u+m/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",u+m):this._tooltipTitle.setAttribute("x",u),"bottom"===g?this._tooltipTitle.setAttribute("y",c.height):"middle"===g?this._tooltipTitle.setAttribute("y",c.height/2):this._tooltipTitle.setAttribute("y",0);const _=jk(c)?c.height+c.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(!0),i&&i.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+_);let t=0;i.forEach(((e,i)=>{const s=ZK.getContentAttr(this.attribute,i);if(!jk(s))return;const o=`tooltip-content-${i}`,l=this._tooltipContent.createOrUpdateChild(o,{visible:!0,x:0,y:t},"group"),d=s.shape.size+s.shape.spacing;let c="right"===h?(a?d:0)+(jk(s.key)?n+s.key.spacing:0)+(jk(s.value)?r:0):0;this._createShape("right"===h?c-s.shape.size/2:c+s.shape.size/2,s,l,o),a&&("right"===h?c-=d:c+=d);const u=this._createKey(s,l,o);u&&(tA(h,u,s.key.textAlign,c,n),u.setAttribute("y",0),"right"===h?c-=n+s.key.spacing:c+=n+s.key.spacing);const p=this._createValue(s,l,o);if(p){let t="right";M(s.value.textAlign)?t=s.value.textAlign:jk(s.key)||"right"===h||(t="left"),p.setAttribute("textAlign",t),tA(h,p,t,c,r),p.setAttribute("y",0)}t+=s.height+s.spaceRow}))}}_createShape(t,e,i,s){var n;if(jk(e.shape))return i.createOrUpdateChild(`${s}-shape`,Object.assign({visible:!0,x:t,y:e.shape.size/2+((null!==(n=Qs(e.key.lineHeight,e.key.fontSize))&&void 0!==n?n:e.key.fontSize)-e.shape.size)/2},e.shape),"symbol")}_createKey(t,e,i){var s;if(jk(t.key)){let n;return n=t.key.multiLine?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0},KK(t.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.key.text||null===t.key.text||"rich"!==t.key.text.type&&"html"!==t.key.text.type?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.key.text)&&void 0!==s?s:""},t.key),{textBaseline:"top"}),"text"):"rich"===t.key.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},KK(t.key)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign(Object.assign({dom:t.key.text.text},Kk),t.key)},"richtext"),n}}_createValue(t,e,i){var s;if(jk(t.value)){let n;return n=t.value.multiLine?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},KK(t.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.value.text||null===t.value.text||"rich"!==t.value.text.type&&"html"!==t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.value.text)&&void 0!==s?s:""},t.value),{textBaseline:"top"}),"text"):"rich"===t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},KK(t.value)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign({dom:t.value.text.text,container:"",width:30,height:30,style:{}},t.value)},"richtext"),n}}setAttributes(t,e){const i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every((t=>qK.includes(t)))?(this._mergeAttributes(t,i),P(this.attribute.panel.width)&&this.attribute.autoMeasure&&ZK.measureTooltip(this.attribute),ZK.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:n,pointerX:r,pointerY:a,positionX:o,positionY:l,parentBounds:h}=t;let d=r,c=a;return"left"===o?d-=e+s:"center"===o?d-=e/2:d+=s,"top"===l?c-=i+n:"middle"===l?c-=i/2:c+=n,d+e>h.x2&&(d-=e+s),c+i>h.y2&&(c-=i+n),d{const n=ZK.getContentAttr(t,i);(e.key||e.value)&&jk(n)&&s.push([e,n])})),s.length){let n=!1;const o=[],l=[],h=[];s.forEach((([t,e],r)=>{var d;const{key:c,value:u,shape:p,spaceRow:g}=e,m=jk(p),_=null!==(d=null==p?void 0:p.symbolType)&&void 0!==d?d:"",f=Xk(c),v=Xk(u);let y=0;if(jk(c)){const{width:t,height:e}=f.quickMeasure(c.text);l.push(t),y=Math.max(y,e)}if(jk(u)){const{width:t,height:e}=v.quickMeasure(u.text);h.push(t),y=Math.max(y,e)}m&&hv[_]&&(n=!0,o.push(p.size),y=Math.max(p.size,y)),t.height=y,a+=y,r{t.width=r})),t.hasContentShape=n,t.keyWidth=c,t.valueWidth=u}}return t.panel.width=r+s[1]+s[3],t.panel.height=a,t}static getTitleAttr(t){return $K({},ZK.defaultAttributes.titleStyle,ZK.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return $K({},ZK.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}ZK.defaultAttributes=XK;class JK extends MK{constructor(){super(JK.type),this.type=gW.canvas}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new ZK({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{tooltipActual:s}=e,n=s.position;e.changePositionOnly?M(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}function QK(t,e){const i=e?t.toExponential(e-1):t.toExponential(),s=i.indexOf("e");if(s<0)return null;const n=i.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+i.slice(s+1)]}let tX;function eX(t,e){const i=QK(t,e);if(!i)return t+"";const s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}JK.type=gW.canvas;class iX{constructor(t={}){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}toString(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}}const sX=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function nX(t){let e;if(e=sX.exec(t))return new iX({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});g.getInstance().error("invalid format: "+t)}const rX=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class aX{constructor(){var t,e,i;this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:(e=[...this.locale.grouping].map(Number),i=`${this.locale.thousands}`,function(t,s){let n=t.length;const r=[];let a=0,o=e[0],l=0;for(;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),this.currencyPrefix=void 0===this.locale.currency?"":this.locale.currency[0]+"",this.currencySuffix=void 0===this.locale.currency?"":this.locale.currency[1]+"",this.decimal=void 0===this.locale.decimal?".":this.locale.decimal+"",this.numerals=void 0===this.locale.numerals?t=>t:(t=[...this.locale.numerals].map(String),function(e){return e.replace(/[0-9]/g,(e=>t[+e]))}),this.percent=void 0===this.locale.percent?"%":this.locale.percent+"",this.minus=void 0===this.locale.minus?"−":this.locale.minus+"",this.nan=void 0===this.locale.nan?"NaN":this.locale.nan+"",this.formatter=t=>this.newFormat(t),this.format=(t,e)=>this.formatter(t)(e),this.formatPrefix=(t,e)=>this._formatPrefix(t,e)}static getInstance(){return aX.instance||(aX.instance=new aX),aX.instance}newFormat(t){const e=nX(t);let i=e.fill,s=e.align;const n=e.sign,r=e.symbol;let a=e.zero;const o=e.width;let l=e.comma,h=e.precision,d=e.trim,c=e.type;"n"===c?(l=!0,c="g"):oX[c]||(void 0===h&&(h=12),d=!0,c="g"),(a||"0"===i&&"="===s)&&(a=!0,i="0",s="=");const u="$"===r?this.currencyPrefix:"#"===r&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",p="$"===r?this.currencySuffix:/[%p]/.test(c)?this.percent:"",g=oX[c],m=/[defgprstz%]/.test(c);h=void 0===h?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h));const{nan:_,minus:f,decimal:v,group:y,numerals:b}=this;function x(t){let e,r,x,S=u,M=p,k=t;if("c"===c)M=g(k)+M,k="";else{k=+k;let t=k<0||1/k<0;if(k=isNaN(k)?_:g(Math.abs(k),h),d&&(k=function(t){const e=t.length;let i,s=-1;t:for(let n=1;n0&&(s=0)}return s>0?t.slice(0,s)+t.slice(i+1):t}(k)),t&&0==+k&&"+"!==n&&(t=!1),S=(t?"("===n?n:f:"-"===n||"("===n?"":n)+S,M=("s"===c?rX[8+tX/3]:"")+M+(t&&"("===n?")":""),m)for(e=-1,r=k.length;++ex||x>57){M=(46===x?v+k.slice(e+1):k.slice(e))+M,k=k.slice(0,e);break}}l&&!a&&(k=y(k,1/0));let A=S.length+k.length+M.length,w=A>1)+S+k+M+w.slice(A);break;default:k=w+S+k+M}return b(k)}return x.toString=function(){return t+""},x}_formatPrefix(t,e){const i=nX(t);i.type="f";const s=this.newFormat(i.toString()),n=3*Math.max(-8,Math.min(8,Math.floor(function(t){const e=QK(Math.abs(t));return e?e[1]:NaN}(e)/3))),r=Math.pow(10,-n),a=rX[8+n/3];return function(t){return s(r*t)+a}}}const oX={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},f:(t,e)=>t.toFixed(e),e:(t,e)=>t.toExponential(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>eX(100*t,e),r:eX,s:function(t,e){const i=QK(t,e);if(!i)return t+"";const s=i[0],n=i[1],r=n-(tX=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+QK(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16),t:(t,e)=>Number.isInteger(t)?t.toFixed(2):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)+"",z:(t,e)=>t%1==0?t+"":t.toFixed(e)},lX=/\{([^}]+)\}/,hX=/\{([^}]+)\}/g,dX=/:/;class cX extends CE{constructor(){super(cX.type),this.type="formatterPlugin",this._timeModeFormat={utc:JB.getInstance().timeUTCFormat,local:JB.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=aX.getInstance().format,this._numericSpecifier=aX.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[cX.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;rs(r)?this._formatter=r:(this._formatter=this._format.bind(this),rs(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),$l.registerFormatter(this._formatter)}_format(t,e,i){return y(t)?t.map(((t,s)=>{const n=y(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):y(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=lX.test(i),this._isNumericFormatterCache.set(i,s))),s?i.replace(hX,((t,i)=>{if(!dX.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)})):this._formatSingleText(t,i)}_formatSingleText(t,e){if(sX.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):t}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}cX.pluginType="chart",cX.specKey="formatter",cX.type="formatterPlugin";class uX extends mx{constructor(){super(...arguments),this.type=uX.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}uX.type="image";class pX{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),oi.graphicService.hooks.onRemove.unTap(this.key),oi.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let s;return s=e?"string"==typeof e?oi.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:oi.global.createDom(Object.assign({tagName:"div",parent:s},i)),nativeContainer:s}}parseDefaultStyleFromGraphic(t){return function(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[Hr(i)]=t[i])})),["fontSize","lineHeight"].forEach((s=>{const n=Hr(s);P(t[s])||(e[n]=i(t[s]))})),M(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&S(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:Qi(t).text)}getTransformOfText(t){const e=Qi(t).text,{textAlign:i=e.textAlign,textBaseline:s=e.textBaseline}=t.attribute,n=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:r,scaleX:a,scaleY:o}=n,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[s]}) rotate(${r}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${h[i]} ${h[s]}`}}updateStyleOfWrapContainer(t,e,i,s,n){const{pointerEvents:r}=n;let a=this.parseDefaultStyleFromGraphic(t);a.display=!1!==t.attribute.visible?"block":"none",a.pointerEvents=!0===r?"all":r||"none",i.style.position||(i.style.position="absolute",s.style.position="relative");let o=0,l=0;const h=t.globalAABBBounds;let d=n.anchorType;if(P(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||h.empty()){const e=t.globalTransMatrix;o=e.e,l=e.f}else{const t=BA(h,d);o=t.x,l=t.y}const c=oi.global.getElementTopLeft(s,!1),u=e.window.getTopLeft(!1),p=e.viewBox,g=o+u.left-c.left+p.x1,m=l+u.top-c.top+p.y1;if(a.left=`${g}px`,a.top=`${m}px`,"text"===t.type&&"position"===d&&(a=Object.assign(Object.assign({},a),this.getTransformOfText(t))),rs(n.style)){const e=n.style({top:m,left:g,width:h.width(),height:h.height()},t,i);e&&(a=Object.assign(Object.assign({},a),e))}else ns(n.style)?a=Object.assign(Object.assign({},a),n.style):S(n.style)&&n.style&&(a=Object.assign(Object.assign({},a),((t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const i=t.split(":");if(2===i.length){const t=i[0].trim(),s=i[1].trim();t&&s&&(e[t]=s)}}})),e})(n.style)));oi.global.updateDom(i,{width:n.width,height:n.width,style:a})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===oi.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:Ue.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:Ue.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&oi.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const{dom:n,container:r}=i;if(!n)return;const a=P(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&r&&r!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof n?this.htmlMap[a].wrapContainer.innerHTML=n:n!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(n));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,r);t&&("string"==typeof n?t.innerHTML=n:t.appendChild(n),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,s,o,l,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===oi.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class gX extends pX{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:s}=this.htmlMap[t];e?oi.global.getRequestAnimationFrame()((()=>{e.unmount()})):s&&s(),i&&oi.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const n=s.params.ReactDOM,{element:r,container:a}=i;if(!r||!n||!n.createRoot&&!n.render)return;const o=P(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])n.createRoot?this.htmlMap[o].root.render(r):n.render(r,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,a);if(t)if(this.htmlMap||(this.htmlMap={}),n.createRoot){const i=n.createRoot(t);i.render(r),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else n.render(r,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{n.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,s,l,h,i),this.htmlMap[o].renderId=this.renderId}}gT.useRegisters([()=>{hE(),dE(),$L(),qL(),xL(),vL(),RD(),ND(),$l.registerSeries(VD.type,VD),$l.registerChart(eO.type,eO)},()=>{hE(),dE(),$L(),sO(),qL(),$l.registerAnimation("area",bL),xL(),vL(),RD(),ND(),$l.registerSeries(oO.type,oO),$l.registerChart(hO.type,hO)},()=>{kO(),$l.registerChart(wO.type,wO)},()=>{qL(),$l.registerAnimation("scatter",((t,e)=>Object.assign({appear:HO(0,e)},_L))),RD(),ND(),$l.registerSeries(VO.type,VO),$l.registerChart(GO.type,GO)},()=>{tB(),$l.registerAnimation("pie",((t,e)=>({appear:ZI(t,e),enter:KI(t),exit:XI(t),disappear:qI(t)}))),$l.registerAnimation("emptyCircle",((t,e)=>({appear:ZI(t,e)}))),$l.registerSeries(lB.type,lB),$l.registerChart(uB.type,uB)},()=>{$l.registerSeries(BB.type,BB),tB(),$l.registerAnimation("rose",((t,e)=>({appear:kB(t,e),enter:xB(t),exit:SB(t),disappear:MB(t)}))),OB(),IB(),$l.registerChart(jB.type,jB)},()=>{$l.registerSeries($B.type,$B),dE(),sO(),$L(),qL(),$l.registerAnimation("radar",((t,e)=>({appear:"clipIn"===e?void 0:VB(t,e,"in"),enter:VB(t,e,"in"),exit:VB(t,e,"out"),disappear:"clipIn"===e?void 0:VB(t,e,"out"),update:[{options:{excludeChannels:["points","defined"]}},{channel:["points"],custom:zB,customParameters:t,duration:mL.update.duration,easing:mL.update.easing}]}))),$l.registerAnimation("radarSymbol",((t,e)=>({appear:"clipIn"===e?void 0:WB(t,e,"in"),enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:"clipIn"===e?void 0:WB(t,e,"out"),update:[{options:{excludeChannels:["x","y"]}},{channel:["x","y"],custom:HB,customParameters:t,duration:mL.update.duration,easing:mL.update.easing}]}))),$l.registerAnimation("radarGroup",((t,e)=>({appear:GB(t,"in"),disappear:GB(t,"out")}))),zx(),OB(),IB(),$l.registerChart(XB.type,XB)},()=>{kO(),$l.registerChart(fF.type,fF)},()=>{pc.registerGrammar("projection",yI,"projections"),BI(),wI(),$l.registerSeries(YI.type,YI),$l.registerImplement("registerMap",Ep),$l.registerImplement("unregisterMap",Pp),yL(),$l.registerChart(HI.type,HI)},()=>{IF(),$l.registerSeries(FF.type,FF),tB(),kF(),IB(),$l.registerChart(jF.type,jF)},()=>{qY(),$l.registerChart(JY.type,JY)},()=>{KY(),LY(),hF(),JF(),$l.registerSeries(XY.type,XY),qY(),$l.registerChart(JY.type,JY)},()=>{yj(),hF(),eF(),$l.registerSeries(Mj.type,Mj),$l.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},fL))),$l.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:_A,customParameters:(e,i)=>({animationType:"in",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})},disappear:{custom:_A,customParameters:(e,i)=>({animationType:"out",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),yL(),$l.registerChart(Aj.type,Aj)},()=>{eF(),fO(),$l.registerAnimation("waterfall",((t,e)=>({appear:yz(t,e),enter:cO(t,!1),exit:uO(t,!1),disappear:uO(t,!1)}))),yL(),RD(),ND(),$l.registerSeries(Iz.type,Iz),$l.registerChart(Fz.type,Fz)},()=>{$l.registerMark(sN.type,sN),pc.registerGlyph("boxplot",{shaft:"rule",box:"rect",max:"rule",min:"rule",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","boxWidth","boxHeight","ruleWidth","ruleHeight"]).registerFunctionEncoder(qz).registerChannelEncoder("x",((t,e,i,s,n,r)=>r&&Nz(r.direction)?null:{shaft:{x:e,x1:e}})).registerChannelEncoder("y",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{shaft:{y:e,y1:e}}:null)).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{box:{x:e}}:{box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{box:{x1:e}}:{box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{shaft:{x:e},min:{x:e,x1:e,visible:!0}}:{shaft:{y:e},min:{y:e,y1:e,visible:!0}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{shaft:{x1:e},max:{x:e,x1:e,visible:!0}}:{shaft:{y1:e},max:{y:e,y1:e,visible:!0}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=r&&Nz(r.direction)?[(i.min+i.max)/2,i.y]:[i.x,(i.min+i.max)/2],l=null!==(a=i.anchor)&&void 0!==a?a:o;return{shaft:{angle:e,anchor:l},box:{angle:e,anchor:l},max:{angle:e,anchor:l},min:{angle:e,anchor:l},median:{angle:e,anchor:l}}})).registerDefaultEncoder((()=>({max:{visible:!1},min:{visible:!1},median:{visible:!1}}))),pc.registerAnimationType("boxplotScaleIn",Zz),pc.registerAnimationType("boxplotScaleOut",Jz),Uz(),VA(),jA(),HA(),pc.registerGlyph("barBoxplot",{minMaxBox:"rect",q1q3Box:"rect",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","minMaxWidth","q1q3Width","minMaxHeight","q1q3Height"]).registerFunctionEncoder(tN).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{q1q3Box:{x:e}}:{q1q3Box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{q1q3Box:{x1:e}}:{q1q3Box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{minMaxBox:{x:e}}:{minMaxBox:{y:e}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{minMaxBox:{x1:e}}:{minMaxBox:{y1:e}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&Nz(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=null!==(a=i.anchor)&&void 0!==a?a:[i.x,(i.min+i.max)/2];return{minMaxBox:{angle:e,anchor:o},q1q3Box:{angle:e,anchor:o},median:{angle:e,anchor:o}}})).registerChannelEncoder("lineWidth",((t,e,i,s,n,r)=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0}}))).registerChannelEncoder("minMaxFillOpacity",((t,e,i,s,n,r)=>({minMaxBox:{fillOpacity:e}}))).registerChannelEncoder("stroke",((t,e,i,s,n,r)=>({minMaxBox:{stroke:!1},q1q3Box:{stroke:!1}}))).registerDefaultEncoder((()=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0},median:{visible:!1}}))),pc.registerAnimationType("barBoxplotScaleIn",eN),pc.registerAnimationType("barBoxplotScaleOut",iN),Uz(),VA(),jA(),HA(),qL(),vL(),RD(),ND(),$l.registerSeries(rN.type,rN),$l.registerChart(oN.type,oN)},()=>{$l.registerSeries(wF.type,wF),tB(),kF(),yL(),OB(),IB(),$l.registerChart(LF.type,LF)},()=>{fO(),$l.registerAnimation("linearProgress",((t,e)=>({appear:Rj(t,e),enter:{type:"grow"},disappear:Dj(t)}))),yL(),$l.registerSeries(Fj.type,Fj),$l.registerChart(jj.type,jj)},()=>{fO(),hF(),$l.registerAnimation("rangeColumn",((t,e)=>({appear:Gj(t,e),enter:Nj(t),exit:Wj(t),disappear:Wj(t)}))),yL(),RD(),ND(),$l.registerSeries(Xj.type,Xj),$l.registerChart(Zj.type,Zj)},()=>{sO(),RD(),ND(),$l.registerSeries(HN.type,HN),$l.registerChart(NN.type,NN)},()=>{$l.registerSeries(TH.type,TH),tB(),hF(),yL(),$l.registerAnimation("sunburst",((t,e)=>({appear:oH(0,e),enter:nH(t),exit:aH(t),disappear:aH(t)}))),$l.registerChart(LH.type,LH)},()=>{$l.registerSeries(ZH.type,ZH),tB(),hF(),vL(),$l.registerAnimation("circlePacking",((t,e)=>({appear:XH(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),$l.registerChart(QH.type,QH)},()=>{pc.registerTransform("filter",{transform:ZL,markPhase:"beforeJoin"},!0),pc.registerTransform("map",{transform:JL,markPhase:"beforeJoin"},!0),fO(),hF(),$l.registerAnimation("treemap",((t,e)=>({appear:oz(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))),yL(),pc.registerTransform("treemap",{transform:sz,markPhase:"beforeJoin"},!0),$l.registerSeries(hz.type,hz),$l.registerChart(cz.type,cz)},()=>{IN(),$l.registerChart(FN.type,FN)},()=>{ZN(),$l.registerChart(QN.type,QN)},()=>{qL(),eF(),fO(),hF(),$l.registerSeries(cF.type,cF),eF(),qL(),RD(),ND(),$l.registerSeries(nF.type,nF),RD(),ND(),$l.registerChart(pF.type,pF)},()=>{qL(),dV(),$l.registerSeries(pV.type,pV),$l.registerAnimation("correlation",((t,e)=>Object.assign({appear:cV(0,e)},_L))),$l.registerChart(mV.type,mV)},()=>{$l.registerChart(ZB.type,ZB)},()=>{OO(),EO(),$l.registerChart(RO.type,RO)},()=>{OO(),$l.registerAnimation("pie3d",((t,e)=>({appear:ZI(t,e),enter:KI(t),exit:XI(t),disappear:qI(t)}))),gB(),$l.registerSeries(_B.type,_B),$l.registerChart(vB.type,vB)},()=>{OO(),EO(),$l.registerChart(vF.type,vF)},()=>{OO(),Tj(),hF(),eF(),$l.registerSeries(Lj.type,Lj),$l.registerChart(Ej.type,Ej)},()=>{OO(),CO(),RD(),ND(),$l.registerSeries(Jj.type,Jj),$l.registerChart(tH.type,tH)},()=>{OO(),tj(),$l.registerChart(ij.type,ij)},()=>{OO(),KY(),LY(),hF(),QF(),$l.registerSeries(QY.type,QY),OO(),tj(),$l.registerChart(ij.type,ij)},ND,RD,()=>{vD(),wD(),rP(),$l.registerComponent(_V.type,_V)},()=>{vD(),wD(),rP(),$l.registerComponent(xV.type,xV)},()=>{vD(),wD(),rP(),$l.registerComponent(MV.type,MV)},OB,IB,()=>{$l.registerComponent(zV.type,zV)},()=>{$l.registerComponent(eW.type,eW)},()=>{$l.registerComponent(TW.type,TW)},()=>{$l.registerComponent(zW.type,zW)},()=>{$l.registerComponent(UW.type,UW)},()=>{$l.registerComponent(aG.type,aG)},()=>{$l.registerComponent(oG.type,oG)},()=>{$l.registerComponent(cG.type,cG)},BI,()=>{$l.registerComponent(LU.type,LU),bU()},()=>{$l.registerComponent(YU.type,YU),IU()},()=>{$l.registerComponent(S$.type,S$),v$()},()=>{$l.registerComponent(DU.type,DU),PU._animate=JG,bU()},()=>{$l.registerComponent(HU.type,HU),jU._animate=tU,IU()},()=>{$l.registerComponent(M$.type,M$),v$()},()=>{$l.registerComponent(k$.type,k$),v$()},()=>{$l.registerComponent(RU.type,RU)},()=>{$l.registerComponent(a$.type,a$)},()=>{h$(),u$(),QE(),$l.registerComponent(g$.type,g$,!0)},()=>{h$(),u$(),QE(),$l.registerComponent(m$.type,m$,!0)},()=>{$l.registerComponent(B$.type,B$)},()=>{$l.registerComponent(F$.type,F$)},()=>{$l.registerComponent(Q$.type,Q$)},()=>{Di.load(dK)},()=>{$l.registerLayout(tK.type,tK)},()=>{$l.registerLayout(iK.type,iK)},()=>{GA(),$L(),qL(),eF(),hF(),sO(),fO(),wI(),tB(),yj(),$l.registerMark(uX.type,uX),yx(),US(),pc.registerGraphic(Xd.image,PS),dV(),QE(),gB(),CO(),Tj()},()=>{GK(UK)},()=>{GK(JK)},()=>{var t;t=cX,$l.registerChartPlugin(t.type,t)},()=>{pc.registerInteraction(qw.type,qw)},()=>{pc.registerInteraction(hT.type,hT)},()=>{pc.registerInteraction(dT.type,dT)},()=>{pc.registerInteraction(cT.type,cT)},()=>{pc.registerInteraction(iT.type,iT)},()=>{pc.registerInteraction(eT.type,eT)},()=>{XA(e_,ZA),XA(zm,dw),e_.useRegisters([dL,cL,WC,GC,lL,hL,uL,pL,gL])},()=>{Ug.registerPlugin("ReactAttributePlugin",gX)},()=>{Ug.registerPlugin("HtmlAttributePlugin",pX)}]);const mX=gT,_X=t=>Ra(t).join(",");class fX extends VT{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>_X(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>_X(null==t?void 0:t[this.series.getDimensionField()[0]])}}const vX=Object.assign(Object.assign({},iC),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),yX=1e-10;function bX(t,e){const i=function(t){const e=[];for(let i=0;ie[i].radius+yX)return!1;return!0}(e,t)}));let n=0,r=0;const a=[];if(s.length>1){const e=kX(s);for(let t=0;t-1){const s=t[o.parentIndex[e]],n=Math.atan2(o.x-s.x,o.y-s.y),r=Math.atan2(i.x-s.x,i.y-s.y);let a=r-n;a<0&&(a+=2*Math.PI);const d=r-a/2;let c=ae.distancePP(l,{x:s.x+s.radius*Math.sin(d),y:s.y+s.radius*Math.cos(d)});c>2*s.radius&&(c=2*s.radius),(null===h||h.width>c)&&(h={circle:s,width:c,p1:o,p2:i})}null!==h&&(a.push(h),n+=xX(h.circle.radius,h.width),i=o)}}else{let e=t[0];for(let i=1;iMath.abs(e.radius-t[s].radius)){i=!0;break}i?n=r=0:(n=e.radius*e.radius*Math.PI,a.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-yX,y:e.y+e.radius},width:2*e.radius}))}return r/=2,e&&(e.area=n+r,e.arcArea=n,e.polygonArea=r,e.arcs=a,e.innerPoints=s,e.intersectionPoints=i),n+r}function xX(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function SX(t,e,i){if(i>=t+e)return 0;if(i<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(i*i-t*t+e*e)/(2*i);return xX(t,t-(i*i-e*e+t*t)/(2*i))+xX(e,s)}function MX(t,e){const i=ae.distancePP(t,e),s=t.radius,n=e.radius;if(i>=s+n||i<=Math.abs(s-n))return[];const r=(s*s-n*n+i*i)/(2*i),a=Math.sqrt(s*s-r*r),o=t.x+r*(e.x-t.x)/i,l=t.y+r*(e.y-t.y)/i,h=-(e.y-t.y)*(a/i),d=-(e.x-t.x)*(a/i);return[{x:o+h,y:l-d},{x:o-h,y:l+d}]}function kX(t){const e={x:0,y:0};for(let i=0;i{const e={},i=Object.values(t);if(!i.length)return[];bX(i,e);const s=e.arcs.map((({p1:t,p2:e,circle:i,width:s})=>({p1:t,p2:e,radius:i.radius,setId:i.setId,largeArcFlag:s>i.radius}))),n=[];let r=0,a=s[0];for(;rae.distancePP(e.p1,t){if(!(null==t?void 0:t.length))return"";let e=0,i=t[0];const{p1:s}=i;let n=`M${s.x},${s.y}`;for(;i;){const{p2:s,radius:r,largeArcFlag:a}=i;n+=`A${r},${r} 0 ${a?1:0},0 ${s.x},${s.y}`,i=t[++e]}return n+=" Z",n},TX=t=>{var e;return null!==(e=null==t?void 0:t.map((t=>{const{p1:e,p2:i,radius:s,largeArcFlag:n,setId:r}=t,{x:a,y:o}=e,{x:l,y:h}=i,d=((l-a)**2+(h-o)**2)**.5,c=(a+l)/2,u=(o+h)/2,p=(s**2-(d/2)**2)**.5;let g=c+p*(h-o)/d,m=u-p*(l-a)/d;return(yt([l-a,h-o],[g-a,m-o])>0||n)&&(g=c-p*(h-o)/d,m=u+p*(l-a)/d),{x:g,y:m,radius:s,setId:r}})))&&void 0!==e?e:[]};class CX extends ps{onBind(){this.fromCircles={},TX(this.from.arcs).forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},TX(this.to.arcs).forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=AX(s);i.arcs=n,i.path=wX(n)}}const LX=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},EX=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class PX extends IL{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}function DX(t,e){let i=0;for(let s=0;s0)return g.getInstance().error("Initial bisect points must have opposite signs"),NaN;if(0===r)return e;if(0===a)return i;for(let i=0;i=0&&(e=i),Math.abs(o)o+r*n*l||h>=p)u=n;else{if(Math.abs(c)<=-a*l)return n;c*(u-d)>=0&&(u=d),d=n,p=h}return 0}n=n||1,r=r||1e-6,a=a||.1;for(let g=0;g<10;++g){if(FX(s.x,1,i.x,n,e),h=s.fx=t(s.x,s.fxprime),c=bt(s.fxprime,e),h>o+r*n*l||g&&h>=d)return p(u,n,d);if(Math.abs(c)<=-a*l)return n;if(c>=0)return p(n,u,h);d=h,u=n,n*=2}return n}function HX(t,e,i){let s={x:e.slice(),fx:0,fxprime:e.slice()},n={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let a,o=1;const l=(i=i||{}).maxIterations||20*e.length;s.fx=t(s.x,s.fxprime);const h=s.fxprime.slice();BX(h,s.fxprime,-1);for(let e=0;e=g[p-1].fx){let i=!1;if(v.fx>e.fx?(FX(y,1+d,f,-d,e),y.fx=t(y),y.fx=1)break;for(let e=1;e=Math.min(s[a].size,s[o].size)&&(r=0),n[a].push({set:o,size:i.size,weight:r}),n[o].push({set:a,size:i.size,weight:r})}const r=[];for(const t in n)if(n.hasOwnProperty(t)){let e=0;for(let i=0;i=8){const n=function(t,e){const i=(e=e||{}).restarts||10,s=[],n={};let r;for(r=0;r=Math.min(e[r].size,e[a].size)?l=1:t.size<=1e-10&&(l=-1),n[r][a]=n[a][r]=l})),{distances:s,constraints:n}}(t,s,n);let o=a.distances;const l=a.constraints,h=IX(o.map(IX))/o.length;o=o.map((t=>t.map((t=>t/h))));const d=function(t,e){return function(t,e,i,s){let n,r=0;for(n=0;n0&&g<=c||u<0&&g>=c||(r+=2*m*m,e[2*n]+=4*m*(a-h),e[2*n+1]+=4*m*(o-d),e[2*l]+=4*m*(h-a),e[2*l+1]+=4*m*(d-o))}}return r}(t,e,o,l)};let c,u;for(r=0;rnY(e)));u=HX(d,t,e),(!c||u.fx0){const e=t[0].x,i=t[0].y;for(s=0;s1){const i=Math.atan2(t[1].x,t[1].y)-e,n=Math.cos(i),r=Math.sin(i);let a,o;for(s=0;s2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(s=0;s=n&&(s=i[r],n=a)}const r=zX((function(i){return-1*UX({x:i[0],y:i[1]},t,e)}),[s.x,s.y],{maxIterations:500,minErrorDelta:1e-10}).x;let a={x:r[0],y:r[1]},o=!0;for(let e=0;et[e].radius){o=!1;break}for(let t=0;t{const{x0:i,x1:s,y0:n,y1:r,setField:a="sets",valueField:o="size",orientation:l=Math.PI/2,orientationOrder:h=null}=t;let d={},c={};if(e.length>0){const u=e.map((t=>({sets:Ra(t[a]),size:t[o]})));let p=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const i=e.initialLayout||NX,s=e.lossFunction||DX,n=i(t=function(t){t=t.slice();const e=[],i={};for(let s=0;se)}));for(let s=0;s0&&g.getInstance().error("Area "+r+" not represented on screen")}return i}(d,u)}return e.map((t=>{const e=Ra(t[a]),i=e.toString(),s=c[i],n=Object.assign(Object.assign({},t),{datum:t,sets:e,key:i,size:t[o],labelX:null==s?void 0:s.x,labelY:null==s?void 0:s.y}),r=d[i];if(r)return Object.assign(Object.assign({},n),{type:"circle",x:r.x,y:r.y,radius:r.radius});const l=AX(e.map((t=>d[t])));return Object.assign(Object.assign({},n),{type:"overlap",x:0,y:0,path:wX(l),arcs:l})}))},KX=(t,e)=>e.filter((e=>e.type===t.datumType));class XX extends BL{constructor(){super(...arguments),this.type=_l.venn,this.transformerConstructor=PX,this._viewBox=new It}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:_T)}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){const e=this._data.getProduct();e&&e.transform([{type:"venn",x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,setField:this._categoryField,valueField:this._valueField}]),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(XX.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(XX.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},vy.STATE_NORMAL,Ly.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},vy.STATE_NORMAL,Ly.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},vy.STATE_HOVER,Ly.Series))}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>_X(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},vy.STATE_NORMAL,Ly.Series))}initOverlapLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>_X(t.sets)},vy.STATE_NORMAL,Ly.Series))}initTooltip(){this._tooltipHelper=new fX(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:_X(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return _X(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[_X(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Ra(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(_X(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),CL(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(TL(null===(e=$l.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),CL(t.name,this._spec,this._markAttributeContext)))}))}}XX.type=_l.venn,XX.mark=vX,XX.transformerConstructor=PX;class qX extends GD{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,circle:t.circle,overlap:t.overlap,overlapLabel:t.overlapLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class ZX extends ZD{constructor(){super(...arguments),this.transformerConstructor=qX,this.type="venn",this.seriesType=_l.venn}}ZX.type="venn",ZX.seriesType=_l.venn,ZX.transformerConstructor=qX;var JX=i(4353),QX=i(3826),tq=i.n(QX),eq=i(8569),iq=i.n(eq);function sq(t,e){if((i=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var i,s=t.slice(0,i);return[s.length>1?s[0]+s.slice(2):s,+t.slice(i+1)]}i(5662),i(2355),i(8361),i(3309),i(9865),i(5592),i(1289),i(539),i(4405),i(2338),i(1130),i(1532),i(9990),i(5944),i(1092),i(4608),i(2509),i(9294),i(2745),i(5530),i(5993),i(9751),i(4780),i(5681),i(2706),i(2878),i(3672),i(494),i(2187),i(4072),i(9881),i(1995),i(2026),i(7329),i(7690),i(912),i(5571),i(2673),i(2619),i(5826),i(3713),i(1219),i(4719),i(3532),i(2498),i(7317),i(4288),i(4007),i(292),i(9964),i(7674),i(6290),i(3433),i(813),i(9836),i(4061),i(8418),i(3562),i(8660),i(7409),i(2010),i(2830),i(5811),i(8809),i(8298),i(4309),i(7420),i(5513),i(9286),i(3900),i(952),i(7741),i(6481),i(1335),i(6101),i(6364),i(8003),i(6605),i(4457),i(8615),i(3860),i(4485),i(6467),i(623),i(2739),i(5877),i(5376),i(2698),i(6462),i(6400),i(9677),i(9464),i(6803),i(7205),i(880),i(465),i(9423),i(3225),i(2218),i(2369),i(4509),i(4334),i(2796),i(5414),i(3222),i(5285),i(5665),i(6847),i(9998),i(5977),i(7439),i(5616),i(2487),i(9160),i(1340),i(2979),i(7250),i(7406),i(8928),i(5012),i(7081),i(2544),i(8142),i(321),i(4895),i(3187),i(8804),i(5084),i(9911),i(4173),i(1750),i(950),i(4734),i(860),i(5760),i(7933),i(6033),i(122),i(1349),i(6007),i(9252),i(225),i(3473);var nq,rq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function aq(t){if(!(e=rq.exec(t)))throw new Error("invalid format: "+t);var e;return new oq({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function oq(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function lq(t,e){var i=sq(t,e);if(!i)return t+"";var s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}aq.prototype=oq.prototype,oq.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const hq={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>lq(100*t,e),r:lq,s:function(t,e){var i=sq(t,e);if(!i)return t+"";var s=i[0],n=i[1],r=n-(nq=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+sq(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function dq(t){return t}var cq,uq,pq=Array.prototype.map,gq=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function mq(t){var e,i,s=void 0===t.grouping||void 0===t.thousands?dq:(e=pq.call(t.grouping,Number),i=t.thousands+"",function(t,s){for(var n=t.length,r=[],a=0,o=e[0],l=0;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?dq:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(pq.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=aq(t)).fill,i=t.align,c=t.sign,u=t.symbol,p=t.zero,g=t.width,m=t.comma,_=t.precision,f=t.trim,v=t.type;"n"===v?(m=!0,v="g"):hq[v]||(void 0===_&&(_=12),f=!0,v="g"),(p||"0"===e&&"="===i)&&(p=!0,e="0",i="=");var y="$"===u?n:"#"===u&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===u?r:/[%p]/.test(v)?l:"",x=hq[v],S=/[defgprs%]/.test(v);function M(t){var n,r,l,u=y,M=b;if("c"===v)M=x(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?d:x(Math.abs(t),_),f&&(t=function(t){t:for(var e,i=t.length,s=1,n=-1;s0&&(n=0)}return n>0?t.slice(0,n)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==c&&(k=!1),u=(k?"("===c?c:h:"-"===c||"("===c?"":c)+u,M=("s"===v?gq[8+nq/3]:"")+M+(k&&"("===c?")":""),S)for(n=-1,r=t.length;++n(l=t.charCodeAt(n))||l>57){M=(46===l?a+t.slice(n+1):t.slice(n))+M,t=t.slice(0,n);break}}m&&!p&&(t=s(t,1/0));var A=u.length+t.length+M.length,w=A>1)+u+t+M+w.slice(A);break;default:t=w+u+t+M}return o(t)}return _=void 0===_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),M.toString=function(){return t+""},M}return{format:c,formatPrefix:function(t,e){var i,s=c(((t=aq(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor((i=e,((i=sq(Math.abs(i)))?i[1]:NaN)/3)))),r=Math.pow(10,-n),a=gq[8+n/3];return function(t){return s(r*t)+a}}}}cq=mq({thousands:",",grouping:[3],currency:["$",""]}),uq=cq.format,cq.formatPrefix,tB(),wI(),$l.registerAnimation("vennCircle",((t,e)=>({appear:LX(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),$l.registerAnimation("vennOverlap",((t,e)=>({appear:EX(e),update:{custom:CX},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),yL(),pc.registerTransform("venn",{transform:$X,markPhase:"beforeJoin"},!0),pc.registerTransform("vennMark",{transform:KX,markPhase:"beforeJoin"},!0),$l.registerSeries(XX.type,XX),$l.registerChart(ZX.type,ZX),JX.extend(tq()),JX.extend(iq()),HTMLWidgets.widget({name:"vchart",type:"output",factory:function(t,e,i){let s;return{renderValue:function(e){e.hasOwnProperty("map")&&mX.registerMap(e.map.name,e.map.topojson,{type:"topojson",object:"map"}),console.log(e.specs),void 0===s?(s=new mX(e.specs,{dom:t.id}),s.renderAsync()):s.updateSpec(e.specs),e.hasOwnProperty("theme")},resize:function(t,e){}}}})})();var n=window;for(var r in s)n[r]=s[r];s.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file +(()=>{var t={4353:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,i="millisecond",s="second",n="minute",r="hour",a="day",o="week",l="month",h="quarter",d="year",c="date",u="Invalid Date",p=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,g=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,m={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}},_=function(t,e,i){var s=String(t);return!s||s.length>=e?t:""+Array(e+1-s.length).join(i)+t},f={s:_,z:function(t){var e=-t.utcOffset(),i=Math.abs(e),s=Math.floor(i/60),n=i%60;return(e<=0?"+":"-")+_(s,2,"0")+":"+_(n,2,"0")},m:function t(e,i){if(e.date()1)return t(a[0])}else{var o=e.name;y[o]=e,n=o}return!s&&n&&(v=n),n||!s&&v},M=function(t,e){if(x(t))return t.clone();var i="object"==typeof e?e:{};return i.date=t,i.args=arguments,new A(i)},k=f;k.l=S,k.i=x,k.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var A=function(){function m(t){this.$L=S(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[b]=!0}var _=m.prototype;return _.parse=function(t){this.$d=function(t){var e=t.date,i=t.utc;if(null===e)return new Date(NaN);if(k.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var s=e.match(p);if(s){var n=s[2]-1||0,r=(s[7]||"0").substring(0,3);return i?new Date(Date.UTC(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)):new Date(s[1],n,s[3]||1,s[4]||0,s[5]||0,s[6]||0,r)}}return new Date(e)}(t),this.init()},_.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},_.$utils=function(){return k},_.isValid=function(){return!(this.$d.toString()===u)},_.isSame=function(t,e){var i=M(t);return this.startOf(e)<=i&&i<=this.endOf(e)},_.isAfter=function(t,e){return M(t)12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},3309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-iq",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"كانون الثاني_شباط_آذار_نيسان_أيار_حزيران_تموز_آب_أيلول_تشرين الأول_ تشرين الثاني_كانون الأول".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},9865:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-kw",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysShort:"احد_اثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},5592:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ly",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:6,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},meridiem:function(t){return t>12?"م":"ص"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},1289:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-ma",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekStart:6,weekdaysShort:"احد_إثنين_ثلاثاء_اربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_ماي_يونيو_يوليوز_غشت_شتنبر_أكتوبر_نونبر_دجنبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},539:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-sa",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},4405:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ar-tn",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),months:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekStart:1,weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),monthsShort:"جانفي_فيفري_مارس_أفريل_ماي_جوان_جويلية_أوت_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"في %s",past:"منذ %s",s:"ثوان",m:"دقيقة",mm:"%d دقائق",h:"ساعة",hh:"%d ساعات",d:"يوم",dd:"%d أيام",M:"شهر",MM:"%d أشهر",y:"سنة",yy:"%d سنوات"}};return e.default.locale(i,null,!0),i}(i(4353))},2338:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="يناير_فبراير_مارس_أبريل_مايو_يونيو_يوليو_أغسطس_سبتمبر_أكتوبر_نوفمبر_ديسمبر".split("_"),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r={name:"ar",weekdays:"الأحد_الإثنين_الثلاثاء_الأربعاء_الخميس_الجمعة_السبت".split("_"),weekdaysShort:"أحد_إثنين_ثلاثاء_أربعاء_خميس_جمعة_سبت".split("_"),weekdaysMin:"ح_ن_ث_ر_خ_ج_س".split("_"),months:i,monthsShort:i,weekStart:6,meridiem:function(t){return t>12?"م":"ص"},relativeTime:{future:"بعد %s",past:"منذ %s",s:"ثانية واحدة",m:"دقيقة واحدة",mm:"%d دقائق",h:"ساعة واحدة",hh:"%d ساعات",d:"يوم واحد",dd:"%d أيام",M:"شهر واحد",MM:"%d أشهر",y:"عام واحد",yy:"%d أعوام"},preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/‏M/‏YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"}};return e.default.locale(r,null,!0),r}(i(4353))},1130:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"az",weekdays:"Bazar_Bazar ertəsi_Çərşənbə axşamı_Çərşənbə_Cümə axşamı_Cümə_Şənbə".split("_"),weekdaysShort:"Baz_BzE_ÇAx_Çər_CAx_Cüm_Şən".split("_"),weekdaysMin:"Bz_BE_ÇA_Çə_CA_Cü_Şə".split("_"),months:"yanvar_fevral_mart_aprel_may_iyun_iyul_avqust_sentyabr_oktyabr_noyabr_dekabr".split("_"),monthsShort:"yan_fev_mar_apr_may_iyn_iyl_avq_sen_okt_noy_dek".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"%s sonra",past:"%s əvvəl",s:"bir neçə saniyə",m:"bir dəqiqə",mm:"%d dəqiqə",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir il",yy:"%d il"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"be",weekdays:"нядзелю_панядзелак_аўторак_сераду_чацвер_пятніцу_суботу".split("_"),months:"студзеня_лютага_сакавіка_красавіка_траўня_чэрвеня_ліпеня_жніўня_верасня_кастрычніка_лістапада_снежня".split("_"),weekStart:1,weekdaysShort:"нд_пн_ат_ср_чц_пт_сб".split("_"),monthsShort:"студ_лют_сак_крас_трав_чэрв_ліп_жнів_вер_каст_ліст_снеж".split("_"),weekdaysMin:"нд_пн_ат_ср_чц_пт_сб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., HH:mm",LLLL:"dddd, D MMMM YYYY г., HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},9990:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bg",weekdays:"неделя_понеделник_вторник_сряда_четвъртък_петък_събота".split("_"),weekdaysShort:"нед_пон_вто_сря_чет_пет_съб".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:"януари_февруари_март_април_май_юни_юли_август_септември_октомври_ноември_декември".split("_"),monthsShort:"яну_фев_мар_апр_май_юни_юли_авг_сеп_окт_ное_дек".split("_"),weekStart:1,ordinal:function(t){var e=t%100;if(e>10&&e<20)return t+"-ти";var i=t%10;return 1===i?t+"-ви":2===i?t+"-ри":7===i||8===i?t+"-ми":t+"-ти"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"след %s",past:"преди %s",s:"няколко секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеца",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5944:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bi",weekdays:"Sande_Mande_Tusde_Wenesde_Tosde_Fraede_Sarade".split("_"),months:"Januari_Februari_Maj_Eprel_Mei_Jun_Julae_Okis_Septemba_Oktoba_Novemba_Disemba".split("_"),weekStart:1,weekdaysShort:"San_Man_Tus_Wen_Tos_Frae_Sar".split("_"),monthsShort:"Jan_Feb_Maj_Epr_Mai_Jun_Jul_Oki_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"San_Ma_Tu_We_To_Fr_Sar".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"lo %s",past:"%s bifo",s:"sam seken",m:"wan minit",mm:"%d minit",h:"wan haoa",hh:"%d haoa",d:"wan dei",dd:"%d dei",M:"wan manis",MM:"%d manis",y:"wan yia",yy:"%d yia"}};return e.default.locale(i,null,!0),i}(i(4353))},1092:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bm",weekdays:"Kari_Ntɛnɛn_Tarata_Araba_Alamisa_Juma_Sibiri".split("_"),months:"Zanwuyekalo_Fewuruyekalo_Marisikalo_Awirilikalo_Mɛkalo_Zuwɛnkalo_Zuluyekalo_Utikalo_Sɛtanburukalo_ɔkutɔburukalo_Nowanburukalo_Desanburukalo".split("_"),weekStart:1,weekdaysShort:"Kar_Ntɛ_Tar_Ara_Ala_Jum_Sib".split("_"),monthsShort:"Zan_Few_Mar_Awi_Mɛ_Zuw_Zul_Uti_Sɛt_ɔku_Now_Des".split("_"),weekdaysMin:"Ka_Nt_Ta_Ar_Al_Ju_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"MMMM [tile] D [san] YYYY",LLL:"MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm",LLLL:"dddd MMMM [tile] D [san] YYYY [lɛrɛ] HH:mm"},relativeTime:{future:"%s kɔnɔ",past:"a bɛ %s bɔ",s:"sanga dama dama",m:"miniti kelen",mm:"miniti %d",h:"lɛrɛ kelen",hh:"lɛrɛ %d",d:"tile kelen",dd:"tile %d",M:"kalo kelen",MM:"kalo %d",y:"san kelen",yy:"san %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4608:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn-bd",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),weekStart:0,preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){var e=["ই","লা","রা","ঠা","শে"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY খ্রিস্টাব্দ",LL:"D MMMM YYYY খ্রিস্টাব্দ",LLL:"D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়",LLLL:"dddd, D MMMM YYYY খ্রিস্টাব্দ, A h:mm সময়"},meridiem:function(t){return t<4?"রাত":t<6?"ভোর":t<12?"সকাল":t<15?"দুপুর":t<18?"বিকাল":t<20?"সন্ধ্যা":"রাত"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},2509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={1:"১",2:"২",3:"৩",4:"৪",5:"৫",6:"৬",7:"৭",8:"৮",9:"৯",0:"০"},s={"১":"1","২":"2","৩":"3","৪":"4","৫":"5","৬":"6","৭":"7","৮":"8","৯":"9","০":"0"},n={name:"bn",weekdays:"রবিবার_সোমবার_মঙ্গলবার_বুধবার_বৃহস্পতিবার_শুক্রবার_শনিবার".split("_"),months:"জানুয়ারি_ফেব্রুয়ারি_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্টেম্বর_অক্টোবর_নভেম্বর_ডিসেম্বর".split("_"),weekdaysShort:"রবি_সোম_মঙ্গল_বুধ_বৃহস্পতি_শুক্র_শনি".split("_"),monthsShort:"জানু_ফেব্রু_মার্চ_এপ্রিল_মে_জুন_জুলাই_আগস্ট_সেপ্ট_অক্টো_নভে_ডিসে".split("_"),weekdaysMin:"রবি_সোম_মঙ্গ_বুধ_বৃহঃ_শুক্র_শনি".split("_"),preparse:function(t){return t.replace(/[১২৩৪৫৬৭৮৯০]/g,(function(t){return s[t]}))},postformat:function(t){return t.replace(/\d/g,(function(t){return i[t]}))},ordinal:function(t){return t},formats:{LT:"A h:mm সময়",LTS:"A h:mm:ss সময়",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm সময়",LLLL:"dddd, D MMMM YYYY, A h:mm সময়"},relativeTime:{future:"%s পরে",past:"%s আগে",s:"কয়েক সেকেন্ড",m:"এক মিনিট",mm:"%d মিনিট",h:"এক ঘন্টা",hh:"%d ঘন্টা",d:"এক দিন",dd:"%d দিন",M:"এক মাস",MM:"%d মাস",y:"এক বছর",yy:"%d বছর"}};return e.default.locale(n,null,!0),n}(i(4353))},9294:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bo",weekdays:"གཟའ་ཉི་མ་_གཟའ་ཟླ་བ་_གཟའ་མིག་དམར་_གཟའ་ལྷག་པ་_གཟའ་ཕུར་བུ_གཟའ་པ་སངས་_གཟའ་སྤེན་པ་".split("_"),weekdaysShort:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),weekdaysMin:"ཉི་མ་_ཟླ་བ་_མིག་དམར་_ལྷག་པ་_ཕུར་བུ_པ་སངས་_སྤེན་པ་".split("_"),months:"ཟླ་བ་དང་པོ_ཟླ་བ་གཉིས་པ_ཟླ་བ་གསུམ་པ_ཟླ་བ་བཞི་པ_ཟླ་བ་ལྔ་པ_ཟླ་བ་དྲུག་པ_ཟླ་བ་བདུན་པ_ཟླ་བ་བརྒྱད་པ_ཟླ་བ་དགུ་པ_ཟླ་བ་བཅུ་པ_ཟླ་བ་བཅུ་གཅིག་པ_ཟླ་བ་བཅུ་གཉིས་པ".split("_"),monthsShort:"ཟླ་དང་པོ_ཟླ་གཉིས་པ_ཟླ་གསུམ་པ_ཟླ་བཞི་པ_ཟླ་ལྔ་པ_ཟླ་དྲུག་པ_ཟླ་བདུན་པ_ཟླ་བརྒྱད་པ_ཟླ་དགུ་པ_ཟླ་བཅུ་པ_ཟླ་བཅུ་གཅིག་པ_ཟླ་བཅུ་གཉིས་པ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ལ་",past:"%s སྔོན་ལ་",s:"ཏོག་ཙམ་",m:"སྐར་མ་གཅིག་",mm:"སྐར་མ་ %d",h:"ཆུ་ཚོད་གཅིག་",hh:"ཆུ་ཚོད་ %d",d:"ཉིན་གཅིག་",dd:"ཉིན་ %d",M:"ཟླ་བ་གཅིག་",MM:"ཟླ་བ་ %d",y:"ལོ་གཅིག་",yy:"ལོ་ %d"}};return e.default.locale(i,null,!0),i}(i(4353))},2745:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>9?i(t%10):t}function s(t,e,i){return t+" "+function(t,e){return 2===e?function(t){return{m:"v",b:"v",d:"z"}[t.charAt(0)]+t.substring(1)}(t):t}({mm:"munutenn",MM:"miz",dd:"devezh"}[i],t)}var n={name:"br",weekdays:"Sul_Lun_Meurzh_Mercʼher_Yaou_Gwener_Sadorn".split("_"),months:"Genver_Cʼhwevrer_Meurzh_Ebrel_Mae_Mezheven_Gouere_Eost_Gwengolo_Here_Du_Kerzu".split("_"),weekStart:1,weekdaysShort:"Sul_Lun_Meu_Mer_Yao_Gwe_Sad".split("_"),monthsShort:"Gen_Cʼhwe_Meu_Ebr_Mae_Eve_Gou_Eos_Gwe_Her_Du_Ker".split("_"),weekdaysMin:"Su_Lu_Me_Mer_Ya_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h[e]mm A",LTS:"h[e]mm:ss A",L:"DD/MM/YYYY",LL:"D [a viz] MMMM YYYY",LLL:"D [a viz] MMMM YYYY h[e]mm A",LLLL:"dddd, D [a viz] MMMM YYYY h[e]mm A"},relativeTime:{future:"a-benn %s",past:"%s ʼzo",s:"un nebeud segondennoù",m:"ur vunutenn",mm:s,h:"un eur",hh:"%d eur",d:"un devezh",dd:s,M:"ur miz",MM:s,y:"ur bloaz",yy:function(t){switch(i(t)){case 1:case 3:case 4:case 5:case 9:return t+" bloaz";default:return t+" vloaz"}}},meridiem:function(t){return t<12?"a.m.":"g.m."}};return e.default.locale(n,null,!0),n}(i(4353))},5530:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"bs",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_juni_juli_august_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._aug._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5993:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ca",weekdays:"Diumenge_Dilluns_Dimarts_Dimecres_Dijous_Divendres_Dissabte".split("_"),weekdaysShort:"Dg._Dl._Dt._Dc._Dj._Dv._Ds.".split("_"),weekdaysMin:"Dg_Dl_Dt_Dc_Dj_Dv_Ds".split("_"),months:"Gener_Febrer_Març_Abril_Maig_Juny_Juliol_Agost_Setembre_Octubre_Novembre_Desembre".split("_"),monthsShort:"Gen._Febr._Març_Abr._Maig_Juny_Jul._Ag._Set._Oct._Nov._Des.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a les] H:mm",LLLL:"dddd D MMMM [de] YYYY [a les] H:mm",ll:"D MMM YYYY",lll:"D MMM YYYY, H:mm",llll:"ddd D MMM YYYY, H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"uns segons",m:"un minut",mm:"%d minuts",h:"una hora",hh:"%d hores",d:"un dia",dd:"%d dies",M:"un mes",MM:"%d mesos",y:"un any",yy:"%d anys"},ordinal:function(t){return t+(1===t||3===t?"r":2===t?"n":4===t?"t":"è")}};return e.default.locale(i,null,!0),i}(i(4353))},9751:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekund":"pár sekundami";case"m":return e?"minuta":n?"minutu":"minutou";case"mm":return e||n?r+(i(t)?"minuty":"minut"):r+"minutami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodin"):r+"hodinami";case"d":return e||n?"den":"dnem";case"dd":return e||n?r+(i(t)?"dny":"dní"):r+"dny";case"M":return e||n?"měsíc":"měsícem";case"MM":return e||n?r+(i(t)?"měsíce":"měsíců"):r+"měsíci";case"y":return e||n?"rok":"rokem";case"yy":return e||n?r+(i(t)?"roky":"let"):r+"lety"}}var n={name:"cs",weekdays:"neděle_pondělí_úterý_středa_čtvrtek_pátek_sobota".split("_"),weekdaysShort:"ne_po_út_st_čt_pá_so".split("_"),weekdaysMin:"ne_po_út_st_čt_pá_so".split("_"),months:"leden_únor_březen_duben_květen_červen_červenec_srpen_září_říjen_listopad_prosinec".split("_"),monthsShort:"led_úno_bře_dub_kvě_čvn_čvc_srp_zář_říj_lis_pro".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"před %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},4780:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cv",weekdays:"вырсарникун_тунтикун_ытларикун_юнкун_кӗҫнерникун_эрнекун_шӑматкун".split("_"),months:"кӑрлач_нарӑс_пуш_ака_май_ҫӗртме_утӑ_ҫурла_авӑн_юпа_чӳк_раштав".split("_"),weekStart:1,weekdaysShort:"выр_тун_ытл_юн_кӗҫ_эрн_шӑм".split("_"),monthsShort:"кӑр_нар_пуш_ака_май_ҫӗр_утӑ_ҫур_авн_юпа_чӳк_раш".split("_"),weekdaysMin:"вр_тн_ыт_юн_кҫ_эр_шм".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ]",LLL:"YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm",LLLL:"dddd, YYYY [ҫулхи] MMMM [уйӑхӗн] D[-мӗшӗ], HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},5681:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"cy",weekdays:"Dydd Sul_Dydd Llun_Dydd Mawrth_Dydd Mercher_Dydd Iau_Dydd Gwener_Dydd Sadwrn".split("_"),months:"Ionawr_Chwefror_Mawrth_Ebrill_Mai_Mehefin_Gorffennaf_Awst_Medi_Hydref_Tachwedd_Rhagfyr".split("_"),weekStart:1,weekdaysShort:"Sul_Llun_Maw_Mer_Iau_Gwe_Sad".split("_"),monthsShort:"Ion_Chwe_Maw_Ebr_Mai_Meh_Gor_Aws_Med_Hyd_Tach_Rhag".split("_"),weekdaysMin:"Su_Ll_Ma_Me_Ia_Gw_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"mewn %s",past:"%s yn ôl",s:"ychydig eiliadau",m:"munud",mm:"%d munud",h:"awr",hh:"%d awr",d:"diwrnod",dd:"%d diwrnod",M:"mis",MM:"%d mis",y:"blwyddyn",yy:"%d flynedd"}};return e.default.locale(i,null,!0),i}(i(4353))},2706:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"da",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"søn._man._tirs._ons._tors._fre._lør.".split("_"),weekdaysMin:"sø._ma._ti._on._to._fr._lø.".split("_"),months:"januar_februar_marts_april_maj_juni_juli_august_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mar._apr._maj_juni_juli_aug._sept._okt._nov._dec.".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd [d.] D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"få sekunder",m:"et minut",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dage",M:"en måned",MM:"%d måneder",y:"et år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2878:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-at",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Jänner_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jän._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},3672:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de-ch",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sep._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},494:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function s(t,e,s){var n=i[s];return Array.isArray(n)&&(n=n[e?0:1]),n.replace("%d",t)}var n={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},2187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"dv",weekdays:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),months:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekStart:7,weekdaysShort:"އާދިއްތަ_ހޯމަ_އަންގާރަ_ބުދަ_ބުރާސްފަތި_ހުކުރު_ހޮނިހިރު".split("_"),monthsShort:"ޖެނުއަރީ_ފެބްރުއަރީ_މާރިޗު_އޭޕްރީލު_މޭ_ޖޫން_ޖުލައި_އޯގަސްޓު_ސެޕްޓެމްބަރު_އޮކްޓޯބަރު_ނޮވެމްބަރު_ޑިސެމްބަރު".split("_"),weekdaysMin:"އާދި_ހޯމަ_އަން_ބުދަ_ބުރާ_ހުކު_ހޮނި".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"D/M/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ތެރޭގައި %s",past:"ކުރިން %s",s:"ސިކުންތުކޮޅެއް",m:"މިނިޓެއް",mm:"މިނިޓު %d",h:"ގަޑިއިރެއް",hh:"ގަޑިއިރު %d",d:"ދުވަހެއް",dd:"ދުވަސް %d",M:"މަހެއް",MM:"މަސް %d",y:"އަހަރެއް",yy:"އަހަރު %d"}};return e.default.locale(i,null,!0),i}(i(4353))},4072:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"el",weekdays:"Κυριακή_Δευτέρα_Τρίτη_Τετάρτη_Πέμπτη_Παρασκευή_Σάββατο".split("_"),weekdaysShort:"Κυρ_Δευ_Τρι_Τετ_Πεμ_Παρ_Σαβ".split("_"),weekdaysMin:"Κυ_Δε_Τρ_Τε_Πε_Πα_Σα".split("_"),months:"Ιανουάριος_Φεβρουάριος_Μάρτιος_Απρίλιος_Μάιος_Ιούνιος_Ιούλιος_Αύγουστος_Σεπτέμβριος_Οκτώβριος_Νοέμβριος_Δεκέμβριος".split("_"),monthsShort:"Ιαν_Φεβ_Μαρ_Απρ_Μαι_Ιουν_Ιουλ_Αυγ_Σεπτ_Οκτ_Νοε_Δεκ".split("_"),ordinal:function(t){return t},weekStart:1,relativeTime:{future:"σε %s",past:"πριν %s",s:"μερικά δευτερόλεπτα",m:"ένα λεπτό",mm:"%d λεπτά",h:"μία ώρα",hh:"%d ώρες",d:"μία μέρα",dd:"%d μέρες",M:"ένα μήνα",MM:"%d μήνες",y:"ένα χρόνο",yy:"%d χρόνια"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},9881:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-au",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},1995:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ca",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"YYYY-MM-DD",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2026:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-gb",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},7329:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-ie",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},7690:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-il",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},912:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-in",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5571:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-nz",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2673:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-sg",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),weekStart:1,weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"}};return e.default.locale(i,null,!0),i}(i(4353))},2619:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"en-tt",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),weekdaysShort:"Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),weekdaysMin:"Su_Mo_Tu_We_Th_Fr_Sa".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),monthsShort:"Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),weekStart:1,yearStart:4,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}};return e.default.locale(i,null,!0),i}(i(4353))},5826:function(t){t.exports=function(){"use strict";return{name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],i=t%100;return"["+t+(e[(i-20)%10]||e[i]||e[0])+"]"}}}()},3713:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eo",weekdays:"dimanĉo_lundo_mardo_merkredo_ĵaŭdo_vendredo_sabato".split("_"),months:"januaro_februaro_marto_aprilo_majo_junio_julio_aŭgusto_septembro_oktobro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dim_lun_mard_merk_ĵaŭ_ven_sab".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aŭg_sep_okt_nov_dec".split("_"),weekdaysMin:"di_lu_ma_me_ĵa_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D[-a de] MMMM, YYYY",LLL:"D[-a de] MMMM, YYYY HH:mm",LLLL:"dddd, [la] D[-a de] MMMM, YYYY HH:mm"},relativeTime:{future:"post %s",past:"antaŭ %s",s:"sekundoj",m:"minuto",mm:"%d minutoj",h:"horo",hh:"%d horoj",d:"tago",dd:"%d tagoj",M:"monato",MM:"%d monatoj",y:"jaro",yy:"%d jaroj"}};return e.default.locale(i,null,!0),i}(i(4353))},1219:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-do",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekStart:1,relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},4719:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-mx",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},3532:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-pr",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},2498:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es-us",weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"MM/DD/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY h:mm A",LLLL:"dddd, D [de] MMMM [de] YYYY h:mm A"}};return e.default.locale(i,null,!0),i}(i(4353))},7317:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},4288:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:["mõne sekundi","mõni sekund","paar sekundit"],m:["ühe minuti","üks minut"],mm:["%d minuti","%d minutit"],h:["ühe tunni","tund aega","üks tund"],hh:["%d tunni","%d tundi"],d:["ühe päeva","üks päev"],M:["kuu aja","kuu aega","üks kuu"],MM:["%d kuu","%d kuud"],y:["ühe aasta","aasta","üks aasta"],yy:["%d aasta","%d aastat"]};return e?(n[i][2]?n[i][2]:n[i][1]).replace("%d",t):(s?n[i][0]:n[i][1]).replace("%d",t)}var s={name:"et",weekdays:"pühapäev_esmaspäev_teisipäev_kolmapäev_neljapäev_reede_laupäev".split("_"),weekdaysShort:"P_E_T_K_N_R_L".split("_"),weekdaysMin:"P_E_T_K_N_R_L".split("_"),months:"jaanuar_veebruar_märts_aprill_mai_juuni_juuli_august_september_oktoober_november_detsember".split("_"),monthsShort:"jaan_veebr_märts_apr_mai_juuni_juuli_aug_sept_okt_nov_dets".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s pärast",past:"%s tagasi",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:"%d päeva",M:i,MM:i,y:i,yy:i},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},4007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"eu",weekdays:"igandea_astelehena_asteartea_asteazkena_osteguna_ostirala_larunbata".split("_"),months:"urtarrila_otsaila_martxoa_apirila_maiatza_ekaina_uztaila_abuztua_iraila_urria_azaroa_abendua".split("_"),weekStart:1,weekdaysShort:"ig._al._ar._az._og._ol._lr.".split("_"),monthsShort:"urt._ots._mar._api._mai._eka._uzt._abu._ira._urr._aza._abe.".split("_"),weekdaysMin:"ig_al_ar_az_og_ol_lr".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY[ko] MMMM[ren] D[a]",LLL:"YYYY[ko] MMMM[ren] D[a] HH:mm",LLLL:"dddd, YYYY[ko] MMMM[ren] D[a] HH:mm",l:"YYYY-M-D",ll:"YYYY[ko] MMM D[a]",lll:"YYYY[ko] MMM D[a] HH:mm",llll:"ddd, YYYY[ko] MMM D[a] HH:mm"},relativeTime:{future:"%s barru",past:"duela %s",s:"segundo batzuk",m:"minutu bat",mm:"%d minutu",h:"ordu bat",hh:"%d ordu",d:"egun bat",dd:"%d egun",M:"hilabete bat",MM:"%d hilabete",y:"urte bat",yy:"%d urte"}};return e.default.locale(i,null,!0),i}(i(4353))},292:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fa",weekdays:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysShort:"یک‌شنبه_دوشنبه_سه‌شنبه_چهارشنبه_پنج‌شنبه_جمعه_شنبه".split("_"),weekdaysMin:"ی_د_س_چ_پ_ج_ش".split("_"),weekStart:6,months:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),monthsShort:"ژانویه_فوریه_مارس_آوریل_مه_ژوئن_ژوئیه_اوت_سپتامبر_اکتبر_نوامبر_دسامبر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"در %s",past:"%s پیش",s:"چند ثانیه",m:"یک دقیقه",mm:"%d دقیقه",h:"یک ساعت",hh:"%d ساعت",d:"یک روز",dd:"%d روز",M:"یک ماه",MM:"%d ماه",y:"یک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},9964:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t,e,i,s){var n={s:"muutama sekunti",m:"minuutti",mm:"%d minuuttia",h:"tunti",hh:"%d tuntia",d:"päivä",dd:"%d päivää",M:"kuukausi",MM:"%d kuukautta",y:"vuosi",yy:"%d vuotta",numbers:"nolla_yksi_kaksi_kolme_neljä_viisi_kuusi_seitsemän_kahdeksan_yhdeksän".split("_")},r={s:"muutaman sekunnin",m:"minuutin",mm:"%d minuutin",h:"tunnin",hh:"%d tunnin",d:"päivän",dd:"%d päivän",M:"kuukauden",MM:"%d kuukauden",y:"vuoden",yy:"%d vuoden",numbers:"nollan_yhden_kahden_kolmen_neljän_viiden_kuuden_seitsemän_kahdeksan_yhdeksän".split("_")},a=s&&!e?r:n,o=a[i];return t<10?o.replace("%d",a.numbers[t]):o.replace("%d",t)}var s={name:"fi",weekdays:"sunnuntai_maanantai_tiistai_keskiviikko_torstai_perjantai_lauantai".split("_"),weekdaysShort:"su_ma_ti_ke_to_pe_la".split("_"),weekdaysMin:"su_ma_ti_ke_to_pe_la".split("_"),months:"tammikuu_helmikuu_maaliskuu_huhtikuu_toukokuu_kesäkuu_heinäkuu_elokuu_syyskuu_lokakuu_marraskuu_joulukuu".split("_"),monthsShort:"tammi_helmi_maalis_huhti_touko_kesä_heinä_elo_syys_loka_marras_joulu".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"%s päästä",past:"%s sitten",s:i,m:i,mm:i,h:i,hh:i,d:i,dd:i,M:i,MM:i,y:i,yy:i},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM[ta] YYYY",LLL:"D. MMMM[ta] YYYY, [klo] HH.mm",LLLL:"dddd, D. MMMM[ta] YYYY, [klo] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [klo] HH.mm",llll:"ddd, D. MMM YYYY, [klo] HH.mm"}};return e.default.locale(s,null,!0),s}(i(4353))},7674:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fo",weekdays:"sunnudagur_mánadagur_týsdagur_mikudagur_hósdagur_fríggjadagur_leygardagur".split("_"),months:"januar_februar_mars_apríl_mai_juni_juli_august_september_oktober_november_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_týs_mik_hós_frí_ley".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),weekdaysMin:"su_má_tý_mi_hó_fr_le".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D. MMMM, YYYY HH:mm"},relativeTime:{future:"um %s",past:"%s síðani",s:"fá sekund",m:"ein minuttur",mm:"%d minuttir",h:"ein tími",hh:"%d tímar",d:"ein dagur",dd:"%d dagar",M:"ein mánaður",MM:"%d mánaðir",y:"eitt ár",yy:"%d ár"}};return e.default.locale(i,null,!0),i}(i(4353))},6290:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ca",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},3433:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr-ch",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),weekStart:1,weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"}};return e.default.locale(i,null,!0),i}(i(4353))},813:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(t){return t+(1===t?"er":"")}};return e.default.locale(i,null,!0),i}(i(4353))},9836:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"fy",weekdays:"snein_moandei_tiisdei_woansdei_tongersdei_freed_sneon".split("_"),months:"jannewaris_febrewaris_maart_april_maaie_juny_july_augustus_septimber_oktober_novimber_desimber".split("_"),monthsShort:"jan._feb._mrt._apr._mai_jun._jul._aug._sep._okt._nov._des.".split("_"),weekStart:1,weekdaysShort:"si._mo._ti._wo._to._fr._so.".split("_"),weekdaysMin:"Si_Mo_Ti_Wo_To_Fr_So".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"oer %s",past:"%s lyn",s:"in pear sekonden",m:"ien minút",mm:"%d minuten",h:"ien oere",hh:"%d oeren",d:"ien dei",dd:"%d dagen",M:"ien moanne",MM:"%d moannen",y:"ien jier",yy:"%d jierren"}};return e.default.locale(i,null,!0),i}(i(4353))},4061:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ga",weekdays:"Dé Domhnaigh_Dé Luain_Dé Máirt_Dé Céadaoin_Déardaoin_Dé hAoine_Dé Satharn".split("_"),months:"Eanáir_Feabhra_Márta_Aibreán_Bealtaine_Méitheamh_Iúil_Lúnasa_Meán Fómhair_Deaireadh Fómhair_Samhain_Nollaig".split("_"),weekStart:1,weekdaysShort:"Dom_Lua_Mái_Céa_Déa_hAo_Sat".split("_"),monthsShort:"Eaná_Feab_Márt_Aibr_Beal_Méit_Iúil_Lúna_Meán_Deai_Samh_Noll".split("_"),weekdaysMin:"Do_Lu_Má_Ce_Dé_hA_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"i %s",past:"%s ó shin",s:"cúpla soicind",m:"nóiméad",mm:"%d nóiméad",h:"uair an chloig",hh:"%d uair an chloig",d:"lá",dd:"%d lá",M:"mí",MM:"%d mí",y:"bliain",yy:"%d bliain"}};return e.default.locale(i,null,!0),i}(i(4353))},8418:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gd",weekdays:"Didòmhnaich_Diluain_Dimàirt_Diciadain_Diardaoin_Dihaoine_Disathairne".split("_"),months:"Am Faoilleach_An Gearran_Am Màrt_An Giblean_An Cèitean_An t-Ògmhios_An t-Iuchar_An Lùnastal_An t-Sultain_An Dàmhair_An t-Samhain_An Dùbhlachd".split("_"),weekStart:1,weekdaysShort:"Did_Dil_Dim_Dic_Dia_Dih_Dis".split("_"),monthsShort:"Faoi_Gear_Màrt_Gibl_Cèit_Ògmh_Iuch_Lùn_Sult_Dàmh_Samh_Dùbh".split("_"),weekdaysMin:"Dò_Lu_Mà_Ci_Ar_Ha_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"ann an %s",past:"bho chionn %s",s:"beagan diogan",m:"mionaid",mm:"%d mionaidean",h:"uair",hh:"%d uairean",d:"latha",dd:"%d latha",M:"mìos",MM:"%d mìosan",y:"bliadhna",yy:"%d bliadhna"}};return e.default.locale(i,null,!0),i}(i(4353))},3562:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gl",weekdays:"domingo_luns_martes_mércores_xoves_venres_sábado".split("_"),months:"xaneiro_febreiro_marzo_abril_maio_xuño_xullo_agosto_setembro_outubro_novembro_decembro".split("_"),weekStart:1,weekdaysShort:"dom._lun._mar._mér._xov._ven._sáb.".split("_"),monthsShort:"xan._feb._mar._abr._mai._xuñ._xul._ago._set._out._nov._dec.".split("_"),weekdaysMin:"do_lu_ma_mé_xo_ve_sá".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"fai %s",s:"uns segundos",m:"un minuto",mm:"%d minutos",h:"unha hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},8660:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gom-latn",weekdays:"Aitar_Somar_Mongllar_Budvar_Brestar_Sukrar_Son'var".split("_"),months:"Janer_Febrer_Mars_Abril_Mai_Jun_Julai_Agost_Setembr_Otubr_Novembr_Dezembr".split("_"),weekStart:1,weekdaysShort:"Ait._Som._Mon._Bud._Bre._Suk._Son.".split("_"),monthsShort:"Jan._Feb._Mars_Abr._Mai_Jun_Jul._Ago._Set._Otu._Nov._Dez.".split("_"),weekdaysMin:"Ai_Sm_Mo_Bu_Br_Su_Sn".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm [vazta]",LTS:"A h:mm:ss [vazta]",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY A h:mm [vazta]",LLLL:"dddd, MMMM[achea] Do, YYYY, A h:mm [vazta]",llll:"ddd, D MMM YYYY, A h:mm [vazta]"}};return e.default.locale(i,null,!0),i}(i(4353))},7409:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"gu",weekdays:"રવિવાર_સોમવાર_મંગળવાર_બુધ્વાર_ગુરુવાર_શુક્રવાર_શનિવાર".split("_"),months:"જાન્યુઆરી_ફેબ્રુઆરી_માર્ચ_એપ્રિલ_મે_જૂન_જુલાઈ_ઑગસ્ટ_સપ્ટેમ્બર_ઑક્ટ્બર_નવેમ્બર_ડિસેમ્બર".split("_"),weekdaysShort:"રવિ_સોમ_મંગળ_બુધ્_ગુરુ_શુક્ર_શનિ".split("_"),monthsShort:"જાન્યુ._ફેબ્રુ._માર્ચ_એપ્રિ._મે_જૂન_જુલા._ઑગ._સપ્ટે._ઑક્ટ્._નવે._ડિસે.".split("_"),weekdaysMin:"ર_સો_મં_બુ_ગુ_શુ_શ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm વાગ્યે",LTS:"A h:mm:ss વાગ્યે",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm વાગ્યે",LLLL:"dddd, D MMMM YYYY, A h:mm વાગ્યે"},relativeTime:{future:"%s મા",past:"%s પેહલા",s:"અમુક પળો",m:"એક મિનિટ",mm:"%d મિનિટ",h:"એક કલાક",hh:"%d કલાક",d:"એક દિવસ",dd:"%d દિવસ",M:"એક મહિનો",MM:"%d મહિનો",y:"એક વર્ષ",yy:"%d વર્ષ"}};return e.default.locale(i,null,!0),i}(i(4353))},2010:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:"מספר שניות",ss:"%d שניות",m:"דקה",mm:"%d דקות",h:"שעה",hh:"%d שעות",hh2:"שעתיים",d:"יום",dd:"%d ימים",dd2:"יומיים",M:"חודש",MM:"%d חודשים",MM2:"חודשיים",y:"שנה",yy:"%d שנים",yy2:"שנתיים"};function s(t,e,s){return(i[s+(2===t?"2":"")]||i[s]).replace("%d",t)}var n={name:"he",weekdays:"ראשון_שני_שלישי_רביעי_חמישי_שישי_שבת".split("_"),weekdaysShort:"א׳_ב׳_ג׳_ד׳_ה׳_ו׳_ש׳".split("_"),weekdaysMin:"א׳_ב׳_ג׳_ד׳_ה׳_ו_ש׳".split("_"),months:"ינואר_פברואר_מרץ_אפריל_מאי_יוני_יולי_אוגוסט_ספטמבר_אוקטובר_נובמבר_דצמבר".split("_"),monthsShort:"ינו_פבר_מרץ_אפר_מאי_יונ_יול_אוג_ספט_אוק_נוב_דצמ".split("_"),relativeTime:{future:"בעוד %s",past:"לפני %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s},ordinal:function(t){return t},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [ב]MMMM YYYY",LLL:"D [ב]MMMM YYYY HH:mm",LLLL:"dddd, D [ב]MMMM YYYY HH:mm",l:"D/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"}};return e.default.locale(n,null,!0),n}(i(4353))},2830:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hi",weekdays:"रविवार_सोमवार_मंगलवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जनवरी_फ़रवरी_मार्च_अप्रैल_मई_जून_जुलाई_अगस्त_सितम्बर_अक्टूबर_नवम्बर_दिसम्बर".split("_"),weekdaysShort:"रवि_सोम_मंगल_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जन._फ़र._मार्च_अप्रै._मई_जून_जुल._अग._सित._अक्टू._नव._दिस.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm बजे",LTS:"A h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm बजे",LLLL:"dddd, D MMMM YYYY, A h:mm बजे"},relativeTime:{future:"%s में",past:"%s पहले",s:"कुछ ही क्षण",m:"एक मिनट",mm:"%d मिनट",h:"एक घंटा",hh:"%d घंटे",d:"एक दिन",dd:"%d दिन",M:"एक महीने",MM:"%d महीने",y:"एक वर्ष",yy:"%d वर्ष"}};return e.default.locale(i,null,!0),i}(i(4353))},5811:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="siječnja_veljače_ožujka_travnja_svibnja_lipnja_srpnja_kolovoza_rujna_listopada_studenoga_prosinca".split("_"),s="siječanj_veljača_ožujak_travanj_svibanj_lipanj_srpanj_kolovoz_rujan_listopad_studeni_prosinac".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"hr",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:r,monthsShort:"sij._velj._ožu._tra._svi._lip._srp._kol._ruj._lis._stu._pro.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"},relativeTime:{future:"za %s",past:"prije %s",s:"sekunda",m:"minuta",mm:"%d minuta",h:"sat",hh:"%d sati",d:"dan",dd:"%d dana",M:"mjesec",MM:"%d mjeseci",y:"godina",yy:"%d godine"},ordinal:function(t){return t+"."}};return e.default.locale(a,null,!0),a}(i(4353))},8809:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ht",weekdays:"dimanch_lendi_madi_mèkredi_jedi_vandredi_samdi".split("_"),months:"janvye_fevriye_mas_avril_me_jen_jiyè_out_septanm_oktòb_novanm_desanm".split("_"),weekdaysShort:"dim._len._mad._mèk._jed._van._sam.".split("_"),monthsShort:"jan._fev._mas_avr._me_jen_jiyè._out_sept._okt._nov._des.".split("_"),weekdaysMin:"di_le_ma_mè_je_va_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"nan %s",past:"sa gen %s",s:"kèk segond",m:"yon minit",mm:"%d minit",h:"inèdtan",hh:"%d zè",d:"yon jou",dd:"%d jou",M:"yon mwa",MM:"%d mwa",y:"yon ane",yy:"%d ane"}};return e.default.locale(i,null,!0),i}(i(4353))},8298:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hu",weekdays:"vasárnap_hétfő_kedd_szerda_csütörtök_péntek_szombat".split("_"),weekdaysShort:"vas_hét_kedd_sze_csüt_pén_szo".split("_"),weekdaysMin:"v_h_k_sze_cs_p_szo".split("_"),months:"január_február_március_április_május_június_július_augusztus_szeptember_október_november_december".split("_"),monthsShort:"jan_feb_márc_ápr_máj_jún_júl_aug_szept_okt_nov_dec".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"%s múlva",past:"%s",s:function(t,e,i,s){return"néhány másodperc"+(s||e?"":"e")},m:function(t,e,i,s){return"egy perc"+(s||e?"":"e")},mm:function(t,e,i,s){return t+" perc"+(s||e?"":"e")},h:function(t,e,i,s){return"egy "+(s||e?"óra":"órája")},hh:function(t,e,i,s){return t+" "+(s||e?"óra":"órája")},d:function(t,e,i,s){return"egy "+(s||e?"nap":"napja")},dd:function(t,e,i,s){return t+" "+(s||e?"nap":"napja")},M:function(t,e,i,s){return"egy "+(s||e?"hónap":"hónapja")},MM:function(t,e,i,s){return t+" "+(s||e?"hónap":"hónapja")},y:function(t,e,i,s){return"egy "+(s||e?"év":"éve")},yy:function(t,e,i,s){return t+" "+(s||e?"év":"éve")}},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY. MMMM D.",LLL:"YYYY. MMMM D. H:mm",LLLL:"YYYY. MMMM D., dddd H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4309:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"hy-am",weekdays:"կիրակի_երկուշաբթի_երեքշաբթի_չորեքշաբթի_հինգշաբթի_ուրբաթ_շաբաթ".split("_"),months:"հունվարի_փետրվարի_մարտի_ապրիլի_մայիսի_հունիսի_հուլիսի_օգոստոսի_սեպտեմբերի_հոկտեմբերի_նոյեմբերի_դեկտեմբերի".split("_"),weekStart:1,weekdaysShort:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),monthsShort:"հնվ_փտր_մրտ_ապր_մյս_հնս_հլս_օգս_սպտ_հկտ_նմբ_դկտ".split("_"),weekdaysMin:"կրկ_երկ_երք_չրք_հնգ_ուրբ_շբթ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY թ.",LLL:"D MMMM YYYY թ., HH:mm",LLLL:"dddd, D MMMM YYYY թ., HH:mm"},relativeTime:{future:"%s հետո",past:"%s առաջ",s:"մի քանի վայրկյան",m:"րոպե",mm:"%d րոպե",h:"ժամ",hh:"%d ժամ",d:"օր",dd:"%d օր",M:"ամիս",MM:"%d ամիս",y:"տարի",yy:"%d տարի"}};return e.default.locale(i,null,!0),i}(i(4353))},7420:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"id",weekdays:"Minggu_Senin_Selasa_Rabu_Kamis_Jumat_Sabtu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_November_Desember".split("_"),weekdaysShort:"Min_Sen_Sel_Rab_Kam_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Agt_Sep_Okt_Nov_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sb".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lalu",s:"beberapa detik",m:"semenit",mm:"%d menit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},5513:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={s:["nokkrar sekúndur","nokkrar sekúndur","nokkrum sekúndum"],m:["mínúta","mínútu","mínútu"],mm:["mínútur","mínútur","mínútum"],h:["klukkustund","klukkustund","klukkustund"],hh:["klukkustundir","klukkustundir","klukkustundum"],d:["dagur","dag","degi"],dd:["dagar","daga","dögum"],M:["mánuður","mánuð","mánuði"],MM:["mánuðir","mánuði","mánuðum"],y:["ár","ár","ári"],yy:["ár","ár","árum"]};function s(t,e,s,n){var r=function(t,e,s,n){var r=n?0:s?1:2,a=2===t.length&&e%10==1?t[0]:t,o=i[a][r];return 1===t.length?o:"%d "+o}(s,t,n,e);return r.replace("%d",t)}var n={name:"is",weekdays:"sunnudagur_mánudagur_þriðjudagur_miðvikudagur_fimmtudagur_föstudagur_laugardagur".split("_"),months:"janúar_febrúar_mars_apríl_maí_júní_júlí_ágúst_september_október_nóvember_desember".split("_"),weekStart:1,weekdaysShort:"sun_mán_þri_mið_fim_fös_lau".split("_"),monthsShort:"jan_feb_mar_apr_maí_jún_júl_ágú_sep_okt_nóv_des".split("_"),weekdaysMin:"Su_Má_Þr_Mi_Fi_Fö_La".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd, D. MMMM YYYY [kl.] H:mm"},relativeTime:{future:"eftir %s",past:"fyrir %s síðan",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9286:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it-ch",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"alcuni secondi",m:"un minuto",mm:"%d minuti",h:"un'ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"}};return e.default.locale(i,null,!0),i}(i(4353))},3900:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},952:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ja",weekdays:"日曜日_月曜日_火曜日_水曜日_木曜日_金曜日_土曜日".split("_"),weekdaysShort:"日_月_火_水_木_金_土".split("_"),weekdaysMin:"日_月_火_水_木_金_土".split("_"),months:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t){return t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日 dddd HH:mm",l:"YYYY/MM/DD",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日(ddd) HH:mm"},meridiem:function(t){return t<12?"午前":"午後"},relativeTime:{future:"%s後",past:"%s前",s:"数秒",m:"1分",mm:"%d分",h:"1時間",hh:"%d時間",d:"1日",dd:"%d日",M:"1ヶ月",MM:"%dヶ月",y:"1年",yy:"%d年"}};return e.default.locale(i,null,!0),i}(i(4353))},7741:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"jv",weekdays:"Minggu_Senen_Seloso_Rebu_Kemis_Jemuwah_Septu".split("_"),months:"Januari_Februari_Maret_April_Mei_Juni_Juli_Agustus_September_Oktober_Nopember_Desember".split("_"),weekStart:1,weekdaysShort:"Min_Sen_Sel_Reb_Kem_Jem_Sep".split("_"),monthsShort:"Jan_Feb_Mar_Apr_Mei_Jun_Jul_Ags_Sep_Okt_Nop_Des".split("_"),weekdaysMin:"Mg_Sn_Sl_Rb_Km_Jm_Sp".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"wonten ing %s",past:"%s ingkang kepengker",s:"sawetawis detik",m:"setunggal menit",mm:"%d menit",h:"setunggal jam",hh:"%d jam",d:"sedinten",dd:"%d dinten",M:"sewulan",MM:"%d wulan",y:"setaun",yy:"%d taun"}};return e.default.locale(i,null,!0),i}(i(4353))},6481:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ka",weekdays:"კვირა_ორშაბათი_სამშაბათი_ოთხშაბათი_ხუთშაბათი_პარასკევი_შაბათი".split("_"),weekdaysShort:"კვი_ორშ_სამ_ოთხ_ხუთ_პარ_შაბ".split("_"),weekdaysMin:"კვ_ორ_სა_ოთ_ხუ_პა_შა".split("_"),months:"იანვარი_თებერვალი_მარტი_აპრილი_მაისი_ივნისი_ივლისი_აგვისტო_სექტემბერი_ოქტომბერი_ნოემბერი_დეკემბერი".split("_"),monthsShort:"იან_თებ_მარ_აპრ_მაი_ივნ_ივლ_აგვ_სექ_ოქტ_ნოე_დეკ".split("_"),weekStart:1,formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"%s შემდეგ",past:"%s წინ",s:"წამი",m:"წუთი",mm:"%d წუთი",h:"საათი",hh:"%d საათის",d:"დღეს",dd:"%d დღის განმავლობაში",M:"თვის",MM:"%d თვის",y:"წელი",yy:"%d წლის"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},1335:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kk",weekdays:"жексенбі_дүйсенбі_сейсенбі_сәрсенбі_бейсенбі_жұма_сенбі".split("_"),weekdaysShort:"жек_дүй_сей_сәр_бей_жұм_сен".split("_"),weekdaysMin:"жк_дй_сй_ср_бй_жм_сн".split("_"),months:"қаңтар_ақпан_наурыз_сәуір_мамыр_маусым_шілде_тамыз_қыркүйек_қазан_қараша_желтоқсан".split("_"),monthsShort:"қаң_ақп_нау_сәу_мам_мау_шіл_там_қыр_қаз_қар_жел".split("_"),weekStart:1,relativeTime:{future:"%s ішінде",past:"%s бұрын",s:"бірнеше секунд",m:"бір минут",mm:"%d минут",h:"бір сағат",hh:"%d сағат",d:"бір күн",dd:"%d күн",M:"бір ай",MM:"%d ай",y:"бір жыл",yy:"%d жыл"},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},6101:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"km",weekdays:"អាទិត្យ_ច័ន្ទ_អង្គារ_ពុធ_ព្រហស្បតិ៍_សុក្រ_សៅរ៍".split("_"),months:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekStart:1,weekdaysShort:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),monthsShort:"មករា_កុម្ភៈ_មីនា_មេសា_ឧសភា_មិថុនា_កក្កដា_សីហា_កញ្ញា_តុលា_វិច្ឆិកា_ធ្នូ".split("_"),weekdaysMin:"អា_ច_អ_ព_ព្រ_សុ_ស".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%sទៀត",past:"%sមុន",s:"ប៉ុន្មានវិនាទី",m:"មួយនាទី",mm:"%d នាទី",h:"មួយម៉ោង",hh:"%d ម៉ោង",d:"មួយថ្ងៃ",dd:"%d ថ្ងៃ",M:"មួយខែ",MM:"%d ខែ",y:"មួយឆ្នាំ",yy:"%d ឆ្នាំ"}};return e.default.locale(i,null,!0),i}(i(4353))},6364:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"kn",weekdays:"ಭಾನುವಾರ_ಸೋಮವಾರ_ಮಂಗಳವಾರ_ಬುಧವಾರ_ಗುರುವಾರ_ಶುಕ್ರವಾರ_ಶನಿವಾರ".split("_"),months:"ಜನವರಿ_ಫೆಬ್ರವರಿ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂಬರ್_ಅಕ್ಟೋಬರ್_ನವೆಂಬರ್_ಡಿಸೆಂಬರ್".split("_"),weekdaysShort:"ಭಾನು_ಸೋಮ_ಮಂಗಳ_ಬುಧ_ಗುರು_ಶುಕ್ರ_ಶನಿ".split("_"),monthsShort:"ಜನ_ಫೆಬ್ರ_ಮಾರ್ಚ್_ಏಪ್ರಿಲ್_ಮೇ_ಜೂನ್_ಜುಲೈ_ಆಗಸ್ಟ್_ಸೆಪ್ಟೆಂ_ಅಕ್ಟೋ_ನವೆಂ_ಡಿಸೆಂ".split("_"),weekdaysMin:"ಭಾ_ಸೋ_ಮಂ_ಬು_ಗು_ಶು_ಶ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s ನಂತರ",past:"%s ಹಿಂದೆ",s:"ಕೆಲವು ಕ್ಷಣಗಳು",m:"ಒಂದು ನಿಮಿಷ",mm:"%d ನಿಮಿಷ",h:"ಒಂದು ಗಂಟೆ",hh:"%d ಗಂಟೆ",d:"ಒಂದು ದಿನ",dd:"%d ದಿನ",M:"ಒಂದು ತಿಂಗಳು",MM:"%d ತಿಂಗಳು",y:"ಒಂದು ವರ್ಷ",yy:"%d ವರ್ಷ"}};return e.default.locale(i,null,!0),i}(i(4353))},8003:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ko",weekdays:"일요일_월요일_화요일_수요일_목요일_금요일_토요일".split("_"),weekdaysShort:"일_월_화_수_목_금_토".split("_"),weekdaysMin:"일_월_화_수_목_금_토".split("_"),months:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),monthsShort:"1월_2월_3월_4월_5월_6월_7월_8월_9월_10월_11월_12월".split("_"),ordinal:function(t){return t+"일"},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"YYYY.MM.DD.",LL:"YYYY년 MMMM D일",LLL:"YYYY년 MMMM D일 A h:mm",LLLL:"YYYY년 MMMM D일 dddd A h:mm",l:"YYYY.MM.DD.",ll:"YYYY년 MMMM D일",lll:"YYYY년 MMMM D일 A h:mm",llll:"YYYY년 MMMM D일 dddd A h:mm"},meridiem:function(t){return t<12?"오전":"오후"},relativeTime:{future:"%s 후",past:"%s 전",s:"몇 초",m:"1분",mm:"%d분",h:"한 시간",hh:"%d시간",d:"하루",dd:"%d일",M:"한 달",MM:"%d달",y:"일 년",yy:"%d년"}};return e.default.locale(i,null,!0),i}(i(4353))},6605:function(t,e,i){!function(t,e){"use strict";var i=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(e),s={1:"١",2:"٢",3:"٣",4:"٤",5:"٥",6:"٦",7:"٧",8:"٨",9:"٩",0:"٠"},n={"١":"1","٢":"2","٣":"3","٤":"4","٥":"5","٦":"6","٧":"7","٨":"8","٩":"9","٠":"0"},r=["کانوونی دووەم","شوبات","ئادار","نیسان","ئایار","حوزەیران","تەممووز","ئاب","ئەیلوول","تشرینی یەکەم","تشرینی دووەم","کانوونی یەکەم"],a={name:"ku",months:r,monthsShort:r,weekdays:"یەکشەممە_دووشەممە_سێشەممە_چوارشەممە_پێنجشەممە_هەینی_شەممە".split("_"),weekdaysShort:"یەکشەم_دووشەم_سێشەم_چوارشەم_پێنجشەم_هەینی_شەممە".split("_"),weekStart:6,weekdaysMin:"ی_د_س_چ_پ_هـ_ش".split("_"),preparse:function(t){return t.replace(/[١٢٣٤٥٦٧٨٩٠]/g,(function(t){return n[t]})).replace(/،/g,",")},postformat:function(t){return t.replace(/\d/g,(function(t){return s[t]})).replace(/,/g,"،")},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},meridiem:function(t){return t<12?"پ.ن":"د.ن"},relativeTime:{future:"لە %s",past:"لەمەوپێش %s",s:"چەند چرکەیەک",m:"یەک خولەک",mm:"%d خولەک",h:"یەک کاتژمێر",hh:"%d کاتژمێر",d:"یەک ڕۆژ",dd:"%d ڕۆژ",M:"یەک مانگ",MM:"%d مانگ",y:"یەک ساڵ",yy:"%d ساڵ"}};i.default.locale(a,null,!0),t.default=a,t.englishToArabicNumbersMap=s,Object.defineProperty(t,"__esModule",{value:!0})}(e,i(4353))},4457:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ky",weekdays:"Жекшемби_Дүйшөмбү_Шейшемби_Шаршемби_Бейшемби_Жума_Ишемби".split("_"),months:"январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),weekStart:1,weekdaysShort:"Жек_Дүй_Шей_Шар_Бей_Жум_Ише".split("_"),monthsShort:"янв_фев_март_апр_май_июнь_июль_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Жк_Дй_Шй_Шр_Бй_Жм_Иш".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s ичинде",past:"%s мурун",s:"бирнече секунд",m:"бир мүнөт",mm:"%d мүнөт",h:"бир саат",hh:"%d саат",d:"бир күн",dd:"%d күн",M:"бир ай",MM:"%d ай",y:"бир жыл",yy:"%d жыл"}};return e.default.locale(i,null,!0),i}(i(4353))},8615:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lb",weekdays:"Sonndeg_Méindeg_Dënschdeg_Mëttwoch_Donneschdeg_Freideg_Samschdeg".split("_"),months:"Januar_Februar_Mäerz_Abrëll_Mee_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),weekStart:1,weekdaysShort:"So._Mé._Dë._Më._Do._Fr._Sa.".split("_"),monthsShort:"Jan._Febr._Mrz._Abr._Mee_Jun._Jul._Aug._Sept._Okt._Nov._Dez.".split("_"),weekdaysMin:"So_Mé_Dë_Më_Do_Fr_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm [Auer]",LTS:"H:mm:ss [Auer]",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm [Auer]",LLLL:"dddd, D. MMMM YYYY H:mm [Auer]"}};return e.default.locale(i,null,!0),i}(i(4353))},3860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lo",weekdays:"ອາທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),months:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysShort:"ທິດ_ຈັນ_ອັງຄານ_ພຸດ_ພະຫັດ_ສຸກ_ເສົາ".split("_"),monthsShort:"ມັງກອນ_ກຸມພາ_ມີນາ_ເມສາ_ພຶດສະພາ_ມິຖຸນາ_ກໍລະກົດ_ສິງຫາ_ກັນຍາ_ຕຸລາ_ພະຈິກ_ທັນວາ".split("_"),weekdaysMin:"ທ_ຈ_ອຄ_ພ_ພຫ_ສກ_ສ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"ວັນdddd D MMMM YYYY HH:mm"},relativeTime:{future:"ອີກ %s",past:"%sຜ່ານມາ",s:"ບໍ່ເທົ່າໃດວິນາທີ",m:"1 ນາທີ",mm:"%d ນາທີ",h:"1 ຊົ່ວໂມງ",hh:"%d ຊົ່ວໂມງ",d:"1 ມື້",dd:"%d ມື້",M:"1 ເດືອນ",MM:"%d ເດືອນ",y:"1 ປີ",yy:"%d ປີ"}};return e.default.locale(i,null,!0),i}(i(4353))},4485:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="sausio_vasario_kovo_balandžio_gegužės_birželio_liepos_rugpjūčio_rugsėjo_spalio_lapkričio_gruodžio".split("_"),s="sausis_vasaris_kovas_balandis_gegužė_birželis_liepa_rugpjūtis_rugsėjis_spalis_lapkritis_gruodis".split("_"),n=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?|MMMM?(\[[^\[\]]*\]|\s)+D[oD]?/,r=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};r.s=s,r.f=i;var a={name:"lt",weekdays:"sekmadienis_pirmadienis_antradienis_trečiadienis_ketvirtadienis_penktadienis_šeštadienis".split("_"),weekdaysShort:"sek_pir_ant_tre_ket_pen_šeš".split("_"),weekdaysMin:"s_p_a_t_k_pn_š".split("_"),months:r,monthsShort:"sau_vas_kov_bal_geg_bir_lie_rgp_rgs_spa_lap_grd".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"už %s",past:"prieš %s",s:"kelias sekundes",m:"minutę",mm:"%d minutes",h:"valandą",hh:"%d valandas",d:"dieną",dd:"%d dienas",M:"mėnesį",MM:"%d mėnesius",y:"metus",yy:"%d metus"},format:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY [m.] MMMM D [d.]",LLL:"YYYY [m.] MMMM D [d.], HH:mm [val.]",LLLL:"YYYY [m.] MMMM D [d.], dddd, HH:mm [val.]",l:"YYYY-MM-DD",ll:"YYYY [m.] MMMM D [d.]",lll:"YYYY [m.] MMMM D [d.], HH:mm [val.]",llll:"YYYY [m.] MMMM D [d.], ddd, HH:mm [val.]"}};return e.default.locale(a,null,!0),a}(i(4353))},6467:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"lv",weekdays:"svētdiena_pirmdiena_otrdiena_trešdiena_ceturtdiena_piektdiena_sestdiena".split("_"),months:"janvāris_februāris_marts_aprīlis_maijs_jūnijs_jūlijs_augusts_septembris_oktobris_novembris_decembris".split("_"),weekStart:1,weekdaysShort:"Sv_P_O_T_C_Pk_S".split("_"),monthsShort:"jan_feb_mar_apr_mai_jūn_jūl_aug_sep_okt_nov_dec".split("_"),weekdaysMin:"Sv_P_O_T_C_Pk_S".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY.",LL:"YYYY. [gada] D. MMMM",LLL:"YYYY. [gada] D. MMMM, HH:mm",LLLL:"YYYY. [gada] D. MMMM, dddd, HH:mm"},relativeTime:{future:"pēc %s",past:"pirms %s",s:"dažām sekundēm",m:"minūtes",mm:"%d minūtēm",h:"stundas",hh:"%d stundām",d:"dienas",dd:"%d dienām",M:"mēneša",MM:"%d mēnešiem",y:"gada",yy:"%d gadiem"}};return e.default.locale(i,null,!0),i}(i(4353))},623:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"me",weekdays:"nedjelja_ponedjeljak_utorak_srijeda_četvrtak_petak_subota".split("_"),months:"januar_februar_mart_april_maj_jun_jul_avgust_septembar_oktobar_novembar_decembar".split("_"),weekStart:1,weekdaysShort:"ned._pon._uto._sri._čet._pet._sub.".split("_"),monthsShort:"jan._feb._mar._apr._maj_jun_jul_avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},2739:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mi",weekdays:"Rātapu_Mane_Tūrei_Wenerei_Tāite_Paraire_Hātarei".split("_"),months:"Kohi-tāte_Hui-tanguru_Poutū-te-rangi_Paenga-whāwhā_Haratua_Pipiri_Hōngoingoi_Here-turi-kōkā_Mahuru_Whiringa-ā-nuku_Whiringa-ā-rangi_Hakihea".split("_"),weekStart:1,weekdaysShort:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),monthsShort:"Kohi_Hui_Pou_Pae_Hara_Pipi_Hōngoi_Here_Mahu_Whi-nu_Whi-ra_Haki".split("_"),weekdaysMin:"Ta_Ma_Tū_We_Tāi_Pa_Hā".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [i] HH:mm",LLLL:"dddd, D MMMM YYYY [i] HH:mm"},relativeTime:{future:"i roto i %s",past:"%s i mua",s:"te hēkona ruarua",m:"he meneti",mm:"%d meneti",h:"te haora",hh:"%d haora",d:"he ra",dd:"%d ra",M:"he marama",MM:"%d marama",y:"he tau",yy:"%d tau"}};return e.default.locale(i,null,!0),i}(i(4353))},5877:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mk",weekdays:"недела_понеделник_вторник_среда_четврток_петок_сабота".split("_"),months:"јануари_февруари_март_април_мај_јуни_јули_август_септември_октомври_ноември_декември".split("_"),weekStart:1,weekdaysShort:"нед_пон_вто_сре_чет_пет_саб".split("_"),monthsShort:"јан_фев_мар_апр_мај_јун_јул_авг_сеп_окт_ное_дек".split("_"),weekdaysMin:"нe_пo_вт_ср_че_пе_сa".split("_"),ordinal:function(t){return t},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"после %s",past:"пред %s",s:"неколку секунди",m:"минута",mm:"%d минути",h:"час",hh:"%d часа",d:"ден",dd:"%d дена",M:"месец",MM:"%d месеци",y:"година",yy:"%d години"}};return e.default.locale(i,null,!0),i}(i(4353))},5376:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ml",weekdays:"ഞായറാഴ്ച_തിങ്കളാഴ്ച_ചൊവ്വാഴ്ച_ബുധനാഴ്ച_വ്യാഴാഴ്ച_വെള്ളിയാഴ്ച_ശനിയാഴ്ച".split("_"),months:"ജനുവരി_ഫെബ്രുവരി_മാർച്ച്_ഏപ്രിൽ_മേയ്_ജൂൺ_ജൂലൈ_ഓഗസ്റ്റ്_സെപ്റ്റംബർ_ഒക്ടോബർ_നവംബർ_ഡിസംബർ".split("_"),weekdaysShort:"ഞായർ_തിങ്കൾ_ചൊവ്വ_ബുധൻ_വ്യാഴം_വെള്ളി_ശനി".split("_"),monthsShort:"ജനു._ഫെബ്രു._മാർ._ഏപ്രി._മേയ്_ജൂൺ_ജൂലൈ._ഓഗ._സെപ്റ്റ._ഒക്ടോ._നവം._ഡിസം.".split("_"),weekdaysMin:"ഞാ_തി_ചൊ_ബു_വ്യാ_വെ_ശ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm -നു",LTS:"A h:mm:ss -നു",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm -നു",LLLL:"dddd, D MMMM YYYY, A h:mm -നു"},relativeTime:{future:"%s കഴിഞ്ഞ്",past:"%s മുൻപ്",s:"അൽപ നിമിഷങ്ങൾ",m:"ഒരു മിനിറ്റ്",mm:"%d മിനിറ്റ്",h:"ഒരു മണിക്കൂർ",hh:"%d മണിക്കൂർ",d:"ഒരു ദിവസം",dd:"%d ദിവസം",M:"ഒരു മാസം",MM:"%d മാസം",y:"ഒരു വർഷം",yy:"%d വർഷം"}};return e.default.locale(i,null,!0),i}(i(4353))},2698:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mn",weekdays:"Ням_Даваа_Мягмар_Лхагва_Пүрэв_Баасан_Бямба".split("_"),months:"Нэгдүгээр сар_Хоёрдугаар сар_Гуравдугаар сар_Дөрөвдүгээр сар_Тавдугаар сар_Зургадугаар сар_Долдугаар сар_Наймдугаар сар_Есдүгээр сар_Аравдугаар сар_Арван нэгдүгээр сар_Арван хоёрдугаар сар".split("_"),weekdaysShort:"Ням_Дав_Мяг_Лха_Пүр_Баа_Бям".split("_"),monthsShort:"1 сар_2 сар_3 сар_4 сар_5 сар_6 сар_7 сар_8 сар_9 сар_10 сар_11 сар_12 сар".split("_"),weekdaysMin:"Ня_Да_Мя_Лх_Пү_Ба_Бя".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY оны MMMMын D",LLL:"YYYY оны MMMMын D HH:mm",LLLL:"dddd, YYYY оны MMMMын D HH:mm"},relativeTime:{future:"%s",past:"%s",s:"саяхан",m:"м",mm:"%dм",h:"1ц",hh:"%dц",d:"1ө",dd:"%dө",M:"1с",MM:"%dс",y:"1ж",yy:"%dж"}};return e.default.locale(i,null,!0),i}(i(4353))},6462:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mr",weekdays:"रविवार_सोमवार_मंगळवार_बुधवार_गुरूवार_शुक्रवार_शनिवार".split("_"),months:"जानेवारी_फेब्रुवारी_मार्च_एप्रिल_मे_जून_जुलै_ऑगस्ट_सप्टेंबर_ऑक्टोबर_नोव्हेंबर_डिसेंबर".split("_"),weekdaysShort:"रवि_सोम_मंगळ_बुध_गुरू_शुक्र_शनि".split("_"),monthsShort:"जाने._फेब्रु._मार्च._एप्रि._मे._जून._जुलै._ऑग._सप्टें._ऑक्टो._नोव्हें._डिसें.".split("_"),weekdaysMin:"र_सो_मं_बु_गु_शु_श".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm वाजता",LTS:"A h:mm:ss वाजता",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm वाजता",LLLL:"dddd, D MMMM YYYY, A h:mm वाजता"}};return e.default.locale(i,null,!0),i}(i(4353))},6400:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms-my",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),weekStart:1,weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [pukul] HH.mm",LLLL:"dddd, D MMMM YYYY [pukul] HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"}};return e.default.locale(i,null,!0),i}(i(4353))},9677:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ms",weekdays:"Ahad_Isnin_Selasa_Rabu_Khamis_Jumaat_Sabtu".split("_"),weekdaysShort:"Ahd_Isn_Sel_Rab_Kha_Jum_Sab".split("_"),weekdaysMin:"Ah_Is_Sl_Rb_Km_Jm_Sb".split("_"),months:"Januari_Februari_Mac_April_Mei_Jun_Julai_Ogos_September_Oktober_November_Disember".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ogs_Sep_Okt_Nov_Dis".split("_"),weekStart:1,formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH.mm",LLLL:"dddd, D MMMM YYYY HH.mm"},relativeTime:{future:"dalam %s",past:"%s yang lepas",s:"beberapa saat",m:"seminit",mm:"%d minit",h:"sejam",hh:"%d jam",d:"sehari",dd:"%d hari",M:"sebulan",MM:"%d bulan",y:"setahun",yy:"%d tahun"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},9464:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"mt",weekdays:"Il-Ħadd_It-Tnejn_It-Tlieta_L-Erbgħa_Il-Ħamis_Il-Ġimgħa_Is-Sibt".split("_"),months:"Jannar_Frar_Marzu_April_Mejju_Ġunju_Lulju_Awwissu_Settembru_Ottubru_Novembru_Diċembru".split("_"),weekStart:1,weekdaysShort:"Ħad_Tne_Tli_Erb_Ħam_Ġim_Sib".split("_"),monthsShort:"Jan_Fra_Mar_Apr_Mej_Ġun_Lul_Aww_Set_Ott_Nov_Diċ".split("_"),weekdaysMin:"Ħa_Tn_Tl_Er_Ħa_Ġi_Si".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"f’ %s",past:"%s ilu",s:"ftit sekondi",m:"minuta",mm:"%d minuti",h:"siegħa",hh:"%d siegħat",d:"ġurnata",dd:"%d ġranet",M:"xahar",MM:"%d xhur",y:"sena",yy:"%d sni"}};return e.default.locale(i,null,!0),i}(i(4353))},6803:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"my",weekdays:"တနင်္ဂနွေ_တနင်္လာ_အင်္ဂါ_ဗုဒ္ဓဟူး_ကြာသပတေး_သောကြာ_စနေ".split("_"),months:"ဇန်နဝါရီ_ဖေဖော်ဝါရီ_မတ်_ဧပြီ_မေ_ဇွန်_ဇူလိုင်_သြဂုတ်_စက်တင်ဘာ_အောက်တိုဘာ_နိုဝင်ဘာ_ဒီဇင်ဘာ".split("_"),weekStart:1,weekdaysShort:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),monthsShort:"ဇန်_ဖေ_မတ်_ပြီ_မေ_ဇွန်_လိုင်_သြ_စက်_အောက်_နို_ဒီ".split("_"),weekdaysMin:"နွေ_လာ_ဂါ_ဟူး_ကြာ_သော_နေ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"လာမည့် %s မှာ",past:"လွန်ခဲ့သော %s က",s:"စက္ကန်.အနည်းငယ်",m:"တစ်မိနစ်",mm:"%d မိနစ်",h:"တစ်နာရီ",hh:"%d နာရီ",d:"တစ်ရက်",dd:"%d ရက်",M:"တစ်လ",MM:"%d လ",y:"တစ်နှစ်",yy:"%d နှစ်"}};return e.default.locale(i,null,!0),i}(i(4353))},7205:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nb",weekdays:"søndag_mandag_tirsdag_onsdag_torsdag_fredag_lørdag".split("_"),weekdaysShort:"sø._ma._ti._on._to._fr._lø.".split("_"),weekdaysMin:"sø_ma_ti_on_to_fr_lø".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan._feb._mars_april_mai_juni_juli_aug._sep._okt._nov._des.".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] HH:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"},relativeTime:{future:"om %s",past:"%s siden",s:"noen sekunder",m:"ett minutt",mm:"%d minutter",h:"en time",hh:"%d timer",d:"en dag",dd:"%d dager",M:"en måned",MM:"%d måneder",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},880:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ne",weekdays:"आइतबार_सोमबार_मङ्गलबार_बुधबार_बिहिबार_शुक्रबार_शनिबार".split("_"),weekdaysShort:"आइत._सोम._मङ्गल._बुध._बिहि._शुक्र._शनि.".split("_"),weekdaysMin:"आ._सो._मं._बु._बि._शु._श.".split("_"),months:"जनवरी_फेब्रुवरी_मार्च_अप्रिल_मे_जुन_जुलाई_अगष्ट_सेप्टेम्बर_अक्टोबर_नोभेम्बर_डिसेम्बर".split("_"),monthsShort:"जन._फेब्रु._मार्च_अप्रि._मई_जुन_जुलाई._अग._सेप्ट._अक्टो._नोभे._डिसे.".split("_"),relativeTime:{future:"%s पछि",past:"%s अघि",s:"सेकेन्ड",m:"एक मिनेट",mm:"%d मिनेट",h:"घन्टा",hh:"%d घन्टा",d:"एक दिन",dd:"%d दिन",M:"एक महिना",MM:"%d महिना",y:"एक वर्ष",yy:"%d वर्ष"},ordinal:function(t){return(""+t).replace(/\d/g,(function(t){return"०१२३४५६७८९"[t]}))},formats:{LT:"Aको h:mm बजे",LTS:"Aको h:mm:ss बजे",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, Aको h:mm बजे",LLLL:"dddd, D MMMM YYYY, Aको h:mm बजे"}};return e.default.locale(i,null,!0),i}(i(4353))},465:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl-be",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan._feb._mrt._apr._mei_jun._jul._aug._sep._okt._nov._dec.".split("_"),weekStart:1,weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"één minuut",mm:"%d minuten",h:"één uur",hh:"%d uur",d:"één dag",dd:"%d dagen",M:"één maand",MM:"%d maanden",y:"één jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},9423:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nl",weekdays:"zondag_maandag_dinsdag_woensdag_donderdag_vrijdag_zaterdag".split("_"),weekdaysShort:"zo._ma._di._wo._do._vr._za.".split("_"),weekdaysMin:"zo_ma_di_wo_do_vr_za".split("_"),months:"januari_februari_maart_april_mei_juni_juli_augustus_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mrt_apr_mei_jun_jul_aug_sep_okt_nov_dec".split("_"),ordinal:function(t){return"["+t+(1===t||8===t||t>=20?"ste":"de")+"]"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD-MM-YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"over %s",past:"%s geleden",s:"een paar seconden",m:"een minuut",mm:"%d minuten",h:"een uur",hh:"%d uur",d:"een dag",dd:"%d dagen",M:"een maand",MM:"%d maanden",y:"een jaar",yy:"%d jaar"}};return e.default.locale(i,null,!0),i}(i(4353))},3473:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"nn",weekdays:"sundag_måndag_tysdag_onsdag_torsdag_fredag_laurdag".split("_"),weekdaysShort:"sun_mån_tys_ons_tor_fre_lau".split("_"),weekdaysMin:"su_må_ty_on_to_fr_la".split("_"),months:"januar_februar_mars_april_mai_juni_juli_august_september_oktober_november_desember".split("_"),monthsShort:"jan_feb_mar_apr_mai_jun_jul_aug_sep_okt_nov_des".split("_"),ordinal:function(t){return t+"."},weekStart:1,relativeTime:{future:"om %s",past:"for %s sidan",s:"nokre sekund",m:"eitt minutt",mm:"%d minutt",h:"ein time",hh:"%d timar",d:"ein dag",dd:"%d dagar",M:"ein månad",MM:"%d månadar",y:"eitt år",yy:"%d år"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY [kl.] H:mm",LLLL:"dddd D. MMMM YYYY [kl.] HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"oc-lnc",weekdays:"dimenge_diluns_dimars_dimècres_dijòus_divendres_dissabte".split("_"),weekdaysShort:"Dg_Dl_Dm_Dc_Dj_Dv_Ds".split("_"),weekdaysMin:"dg_dl_dm_dc_dj_dv_ds".split("_"),months:"genièr_febrièr_març_abrial_mai_junh_julhet_agost_setembre_octòbre_novembre_decembre".split("_"),monthsShort:"gen_feb_març_abr_mai_junh_julh_ago_set_oct_nov_dec".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [de] YYYY",LLL:"D MMMM [de] YYYY [a] H:mm",LLLL:"dddd D MMMM [de] YYYY [a] H:mm"},relativeTime:{future:"d'aquí %s",past:"fa %s",s:"unas segondas",m:"una minuta",mm:"%d minutas",h:"una ora",hh:"%d oras",d:"un jorn",dd:"%d jorns",M:"un mes",MM:"%d meses",y:"un an",yy:"%d ans"},ordinal:function(t){return t+"º"}};return e.default.locale(i,null,!0),i}(i(4353))},9252:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pa-in",weekdays:"ਐਤਵਾਰ_ਸੋਮਵਾਰ_ਮੰਗਲਵਾਰ_ਬੁਧਵਾਰ_ਵੀਰਵਾਰ_ਸ਼ੁੱਕਰਵਾਰ_ਸ਼ਨੀਚਰਵਾਰ".split("_"),months:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysShort:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),monthsShort:"ਜਨਵਰੀ_ਫ਼ਰਵਰੀ_ਮਾਰਚ_ਅਪ੍ਰੈਲ_ਮਈ_ਜੂਨ_ਜੁਲਾਈ_ਅਗਸਤ_ਸਤੰਬਰ_ਅਕਤੂਬਰ_ਨਵੰਬਰ_ਦਸੰਬਰ".split("_"),weekdaysMin:"ਐਤ_ਸੋਮ_ਮੰਗਲ_ਬੁਧ_ਵੀਰ_ਸ਼ੁਕਰ_ਸ਼ਨੀ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm ਵਜੇ",LTS:"A h:mm:ss ਵਜੇ",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm ਵਜੇ",LLLL:"dddd, D MMMM YYYY, A h:mm ਵਜੇ"},relativeTime:{future:"%s ਵਿੱਚ",past:"%s ਪਿਛਲੇ",s:"ਕੁਝ ਸਕਿੰਟ",m:"ਇਕ ਮਿੰਟ",mm:"%d ਮਿੰਟ",h:"ਇੱਕ ਘੰਟਾ",hh:"%d ਘੰਟੇ",d:"ਇੱਕ ਦਿਨ",dd:"%d ਦਿਨ",M:"ਇੱਕ ਮਹੀਨਾ",MM:"%d ਮਹੀਨੇ",y:"ਇੱਕ ਸਾਲ",yy:"%d ਸਾਲ"}};return e.default.locale(i,null,!0),i}(i(4353))},3225:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%10<5&&t%10>1&&~~(t/10)%10!=1}function s(t,e,s){var n=t+" ";switch(s){case"m":return e?"minuta":"minutę";case"mm":return n+(i(t)?"minuty":"minut");case"h":return e?"godzina":"godzinę";case"hh":return n+(i(t)?"godziny":"godzin");case"MM":return n+(i(t)?"miesiące":"miesięcy");case"yy":return n+(i(t)?"lata":"lat")}}var n="stycznia_lutego_marca_kwietnia_maja_czerwca_lipca_sierpnia_września_października_listopada_grudnia".split("_"),r="styczeń_luty_marzec_kwiecień_maj_czerwiec_lipiec_sierpień_wrzesień_październik_listopad_grudzień".split("_"),a=/D MMMM/,o=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};o.s=r,o.f=n;var l={name:"pl",weekdays:"niedziela_poniedziałek_wtorek_środa_czwartek_piątek_sobota".split("_"),weekdaysShort:"ndz_pon_wt_śr_czw_pt_sob".split("_"),weekdaysMin:"Nd_Pn_Wt_Śr_Cz_Pt_So".split("_"),months:o,monthsShort:"sty_lut_mar_kwi_maj_cze_lip_sie_wrz_paź_lis_gru".split("_"),ordinal:function(t){return t+"."},weekStart:1,yearStart:4,relativeTime:{future:"za %s",past:"%s temu",s:"kilka sekund",m:s,mm:s,h:s,hh:s,d:"1 dzień",dd:"%d dni",M:"miesiąc",MM:s,y:"rok",yy:s},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(l,null,!0),l}(i(4353))},2218:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt-br",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sáb".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sá".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"poucos segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},2369:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(t){return t+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return e.default.locale(i,null,!0),i}(i(4353))},4509:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rn",weekdays:"Ku wa Mungu_Ku wa Mbere_Ku wa Kabiri_Ku wa Gatatu_Ku wa Kane_Ku wa Gatanu_Ku wa Gatandatu".split("_"),weekdaysShort:"Kngu_Kmbr_Kbri_Ktat_Kkan_Ktan_Kdat".split("_"),weekdaysMin:"K7_K1_K2_K3_K4_K5_K6".split("_"),months:"Nzero_Ruhuhuma_Ntwarante_Ndamukiza_Rusama_Ruhenshi_Mukakaro_Myandagaro_Nyakanga_Gitugutu_Munyonyo_Kigarama".split("_"),monthsShort:"Nzer_Ruhuh_Ntwar_Ndam_Rus_Ruhen_Muk_Myand_Nyak_Git_Muny_Kig".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4334:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ro",weekdays:"Duminică_Luni_Marți_Miercuri_Joi_Vineri_Sâmbătă".split("_"),weekdaysShort:"Dum_Lun_Mar_Mie_Joi_Vin_Sâm".split("_"),weekdaysMin:"Du_Lu_Ma_Mi_Jo_Vi_Sâ".split("_"),months:"Ianuarie_Februarie_Martie_Aprilie_Mai_Iunie_Iulie_August_Septembrie_Octombrie_Noiembrie_Decembrie".split("_"),monthsShort:"Ian._Febr._Mart._Apr._Mai_Iun._Iul._Aug._Sept._Oct._Nov._Dec.".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY H:mm",LLLL:"dddd, D MMMM YYYY H:mm"},relativeTime:{future:"peste %s",past:"acum %s",s:"câteva secunde",m:"un minut",mm:"%d minute",h:"o oră",hh:"%d ore",d:"o zi",dd:"%d zile",M:"o lună",MM:"%d luni",y:"un an",yy:"%d ani"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},2796:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="января_февраля_марта_апреля_мая_июня_июля_августа_сентября_октября_ноября_декабря".split("_"),s="январь_февраль_март_апрель_май_июнь_июль_август_сентябрь_октябрь_ноябрь_декабрь".split("_"),n="янв._февр._мар._апр._мая_июня_июля_авг._сент._окт._нояб._дек.".split("_"),r="янв._февр._март_апр._май_июнь_июль_авг._сент._окт._нояб._дек.".split("_"),a=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function o(t,e,i){var s,n;return"m"===i?e?"минута":"минуту":t+" "+(s=+t,n={mm:e?"минута_минуты_минут":"минуту_минуты_минут",hh:"час_часа_часов",dd:"день_дня_дней",MM:"месяц_месяца_месяцев",yy:"год_года_лет"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var l=function(t,e){return a.test(e)?i[t.month()]:s[t.month()]};l.s=s,l.f=i;var h=function(t,e){return a.test(e)?n[t.month()]:r[t.month()]};h.s=r,h.f=n;var d={name:"ru",weekdays:"воскресенье_понедельник_вторник_среда_четверг_пятница_суббота".split("_"),weekdaysShort:"вск_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"вс_пн_вт_ср_чт_пт_сб".split("_"),months:l,monthsShort:h,weekStart:1,yearStart:4,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY г.",LLL:"D MMMM YYYY г., H:mm",LLLL:"dddd, D MMMM YYYY г., H:mm"},relativeTime:{future:"через %s",past:"%s назад",s:"несколько секунд",m:o,mm:o,h:"час",hh:o,d:"день",dd:o,M:"месяц",MM:o,y:"год",yy:o},ordinal:function(t){return t},meridiem:function(t){return t<4?"ночи":t<12?"утра":t<17?"дня":"вечера"}};return e.default.locale(d,null,!0),d}(i(4353))},5414:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"rw",weekdays:"Ku Cyumweru_Kuwa Mbere_Kuwa Kabiri_Kuwa Gatatu_Kuwa Kane_Kuwa Gatanu_Kuwa Gatandatu".split("_"),months:"Mutarama_Gashyantare_Werurwe_Mata_Gicurasi_Kamena_Nyakanga_Kanama_Nzeri_Ukwakira_Ugushyingo_Ukuboza".split("_"),relativeTime:{future:"mu %s",past:"%s",s:"amasegonda",m:"Umunota",mm:"%d iminota",h:"isaha",hh:"%d amasaha",d:"Umunsi",dd:"%d iminsi",M:"ukwezi",MM:"%d amezi",y:"umwaka",yy:"%d imyaka"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},ordinal:function(t){return t}};return e.default.locale(i,null,!0),i}(i(4353))},3222:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sd",weekdays:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),months:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekStart:1,weekdaysShort:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),monthsShort:"جنوري_فيبروري_مارچ_اپريل_مئي_جون_جولاءِ_آگسٽ_سيپٽمبر_آڪٽوبر_نومبر_ڊسمبر".split("_"),weekdaysMin:"آچر_سومر_اڱارو_اربع_خميس_جمع_ڇنڇر".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s پوء",past:"%s اڳ",s:"چند سيڪنڊ",m:"هڪ منٽ",mm:"%d منٽ",h:"هڪ ڪلاڪ",hh:"%d ڪلاڪ",d:"هڪ ڏينهن",dd:"%d ڏينهن",M:"هڪ مهينو",MM:"%d مهينا",y:"هڪ سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},5285:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"se",weekdays:"sotnabeaivi_vuossárga_maŋŋebárga_gaskavahkku_duorastat_bearjadat_lávvardat".split("_"),months:"ođđajagemánnu_guovvamánnu_njukčamánnu_cuoŋománnu_miessemánnu_geassemánnu_suoidnemánnu_borgemánnu_čakčamánnu_golggotmánnu_skábmamánnu_juovlamánnu".split("_"),weekStart:1,weekdaysShort:"sotn_vuos_maŋ_gask_duor_bear_láv".split("_"),monthsShort:"ođđj_guov_njuk_cuo_mies_geas_suoi_borg_čakč_golg_skáb_juov".split("_"),weekdaysMin:"s_v_m_g_d_b_L".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"MMMM D. [b.] YYYY",LLL:"MMMM D. [b.] YYYY [ti.] HH:mm",LLLL:"dddd, MMMM D. [b.] YYYY [ti.] HH:mm"},relativeTime:{future:"%s geažes",past:"maŋit %s",s:"moadde sekunddat",m:"okta minuhta",mm:"%d minuhtat",h:"okta diimmu",hh:"%d diimmut",d:"okta beaivi",dd:"%d beaivvit",M:"okta mánnu",MM:"%d mánut",y:"okta jahki",yy:"%d jagit"}};return e.default.locale(i,null,!0),i}(i(4353))},5665:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"si",weekdays:"ඉරිදා_සඳුදා_අඟහරුවාදා_බදාදා_බ්‍රහස්පතින්දා_සිකුරාදා_සෙනසුරාදා".split("_"),months:"දුරුතු_නවම්_මැදින්_බක්_වෙසක්_පොසොන්_ඇසළ_නිකිණි_බිනර_වප්_ඉල්_උඳුවප්".split("_"),weekdaysShort:"ඉරි_සඳු_අඟ_බදා_බ්‍රහ_සිකු_සෙන".split("_"),monthsShort:"දුරු_නව_මැදි_බක්_වෙස_පොසො_ඇස_නිකි_බින_වප්_ඉල්_උඳු".split("_"),weekdaysMin:"ඉ_ස_අ_බ_බ්‍ර_සි_සෙ".split("_"),ordinal:function(t){return t},formats:{LT:"a h:mm",LTS:"a h:mm:ss",L:"YYYY/MM/DD",LL:"YYYY MMMM D",LLL:"YYYY MMMM D, a h:mm",LLLL:"YYYY MMMM D [වැනි] dddd, a h:mm:ss"},relativeTime:{future:"%sකින්",past:"%sකට පෙර",s:"තත්පර කිහිපය",m:"විනාඩිය",mm:"විනාඩි %d",h:"පැය",hh:"පැය %d",d:"දිනය",dd:"දින %d",M:"මාසය",MM:"මාස %d",y:"වසර",yy:"වසර %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6847:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t>1&&t<5&&1!=~~(t/10)}function s(t,e,s,n){var r=t+" ";switch(s){case"s":return e||n?"pár sekúnd":"pár sekundami";case"m":return e?"minúta":n?"minútu":"minútou";case"mm":return e||n?r+(i(t)?"minúty":"minút"):r+"minútami";case"h":return e?"hodina":n?"hodinu":"hodinou";case"hh":return e||n?r+(i(t)?"hodiny":"hodín"):r+"hodinami";case"d":return e||n?"deň":"dňom";case"dd":return e||n?r+(i(t)?"dni":"dní"):r+"dňami";case"M":return e||n?"mesiac":"mesiacom";case"MM":return e||n?r+(i(t)?"mesiace":"mesiacov"):r+"mesiacmi";case"y":return e||n?"rok":"rokom";case"yy":return e||n?r+(i(t)?"roky":"rokov"):r+"rokmi"}}var n={name:"sk",weekdays:"nedeľa_pondelok_utorok_streda_štvrtok_piatok_sobota".split("_"),weekdaysShort:"ne_po_ut_st_št_pi_so".split("_"),weekdaysMin:"ne_po_ut_st_št_pi_so".split("_"),months:"január_február_marec_apríl_máj_jún_júl_august_september_október_november_december".split("_"),monthsShort:"jan_feb_mar_apr_máj_jún_júl_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"za %s",past:"pred %s",s,m:s,mm:s,h:s,hh:s,d:s,dd:s,M:s,MM:s,y:s,yy:s}};return e.default.locale(n,null,!0),n}(i(4353))},9998:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t);function i(t){return t%100==2}function s(t){return t%100==3||t%100==4}function n(t,e,n,r){var a=t+" ";switch(n){case"s":return e||r?"nekaj sekund":"nekaj sekundami";case"m":return e?"ena minuta":"eno minuto";case"mm":return i(t)?a+(e||r?"minuti":"minutama"):s(t)?a+(e||r?"minute":"minutami"):a+(e||r?"minut":"minutami");case"h":return e?"ena ura":"eno uro";case"hh":return i(t)?a+(e||r?"uri":"urama"):s(t)?a+(e||r?"ure":"urami"):a+(e||r?"ur":"urami");case"d":return e||r?"en dan":"enim dnem";case"dd":return i(t)?a+(e||r?"dneva":"dnevoma"):a+(e||r?"dni":"dnevi");case"M":return e||r?"en mesec":"enim mesecem";case"MM":return i(t)?a+(e||r?"meseca":"mesecema"):s(t)?a+(e||r?"mesece":"meseci"):a+(e||r?"mesecev":"meseci");case"y":return e||r?"eno leto":"enim letom";case"yy":return i(t)?a+(e||r?"leti":"letoma"):s(t)?a+(e||r?"leta":"leti"):a+(e||r?"let":"leti")}}var r={name:"sl",weekdays:"nedelja_ponedeljek_torek_sreda_četrtek_petek_sobota".split("_"),months:"januar_februar_marec_april_maj_junij_julij_avgust_september_oktober_november_december".split("_"),weekStart:1,weekdaysShort:"ned._pon._tor._sre._čet._pet._sob.".split("_"),monthsShort:"jan._feb._mar._apr._maj._jun._jul._avg._sep._okt._nov._dec.".split("_"),weekdaysMin:"ne_po_to_sr_če_pe_so".split("_"),ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY H:mm",LLLL:"dddd, D. MMMM YYYY H:mm",l:"D. M. YYYY"},relativeTime:{future:"čez %s",past:"pred %s",s:n,m:n,mm:n,h:n,hh:n,d:n,dd:n,M:n,MM:n,y:n,yy:n}};return e.default.locale(r,null,!0),r}(i(4353))},5977:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sq",weekdays:"E Diel_E Hënë_E Martë_E Mërkurë_E Enjte_E Premte_E Shtunë".split("_"),months:"Janar_Shkurt_Mars_Prill_Maj_Qershor_Korrik_Gusht_Shtator_Tetor_Nëntor_Dhjetor".split("_"),weekStart:1,weekdaysShort:"Die_Hën_Mar_Mër_Enj_Pre_Sht".split("_"),monthsShort:"Jan_Shk_Mar_Pri_Maj_Qer_Kor_Gus_Sht_Tet_Nën_Dhj".split("_"),weekdaysMin:"D_H_Ma_Më_E_P_Sh".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"në %s",past:"%s më parë",s:"disa sekonda",m:"një minutë",mm:"%d minuta",h:"një orë",hh:"%d orë",d:"një ditë",dd:"%d ditë",M:"një muaj",MM:"%d muaj",y:"një vit",yy:"%d vite"}};return e.default.locale(i,null,!0),i}(i(4353))},7439:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["један минут","једног минута"],mm:["%d минут","%d минута","%d минута"],h:["један сат","једног сата"],hh:["%d сат","%d сата","%d сати"],d:["један дан","једног дана"],dd:["%d дан","%d дана","%d дана"],M:["један месец","једног месеца"],MM:["%d месец","%d месеца","%d месеци"],y:["једну годину","једне године"],yy:["%d годину","%d године","%d година"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"једна година":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d годину"===a?t+" година":a.replace("%d",t)}},s={name:"sr-cyrl",weekdays:"Недеља_Понедељак_Уторак_Среда_Четвртак_Петак_Субота".split("_"),weekdaysShort:"Нед._Пон._Уто._Сре._Чет._Пет._Суб.".split("_"),weekdaysMin:"не_по_ут_ср_че_пе_су".split("_"),months:"Јануар_Фебруар_Март_Април_Мај_Јун_Јул_Август_Септембар_Октобар_Новембар_Децембар".split("_"),monthsShort:"Јан._Феб._Мар._Апр._Мај_Јун_Јул_Авг._Сеп._Окт._Нов._Дец.".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"пре %s",s:"неколико секунди",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},5616:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={words:{m:["jedan minut","jednog minuta"],mm:["%d minut","%d minuta","%d minuta"],h:["jedan sat","jednog sata"],hh:["%d sat","%d sata","%d sati"],d:["jedan dan","jednog dana"],dd:["%d dan","%d dana","%d dana"],M:["jedan mesec","jednog meseca"],MM:["%d mesec","%d meseca","%d meseci"],y:["jednu godinu","jedne godine"],yy:["%d godinu","%d godine","%d godina"]},correctGrammarCase:function(t,e){return t%10>=1&&t%10<=4&&(t%100<10||t%100>=20)?t%10==1?e[0]:e[1]:e[2]},relativeTimeFormatter:function(t,e,s,n){var r=i.words[s];if(1===s.length)return"y"===s&&e?"jedna godina":n||e?r[0]:r[1];var a=i.correctGrammarCase(t,r);return"yy"===s&&e&&"%d godinu"===a?t+" godina":a.replace("%d",t)}},s={name:"sr",weekdays:"Nedelja_Ponedeljak_Utorak_Sreda_Četvrtak_Petak_Subota".split("_"),weekdaysShort:"Ned._Pon._Uto._Sre._Čet._Pet._Sub.".split("_"),weekdaysMin:"ne_po_ut_sr_če_pe_su".split("_"),months:"Januar_Februar_Mart_April_Maj_Jun_Jul_Avgust_Septembar_Oktobar_Novembar_Decembar".split("_"),monthsShort:"Jan._Feb._Mar._Apr._Maj_Jun_Jul_Avg._Sep._Okt._Nov._Dec.".split("_"),weekStart:1,relativeTime:{future:"za %s",past:"pre %s",s:"nekoliko sekundi",m:i.relativeTimeFormatter,mm:i.relativeTimeFormatter,h:i.relativeTimeFormatter,hh:i.relativeTimeFormatter,d:i.relativeTimeFormatter,dd:i.relativeTimeFormatter,M:i.relativeTimeFormatter,MM:i.relativeTimeFormatter,y:i.relativeTimeFormatter,yy:i.relativeTimeFormatter},ordinal:function(t){return t+"."},formats:{LT:"H:mm",LTS:"H:mm:ss",L:"D. M. YYYY.",LL:"D. MMMM YYYY.",LLL:"D. MMMM YYYY. H:mm",LLLL:"dddd, D. MMMM YYYY. H:mm"}};return e.default.locale(s,null,!0),s}(i(4353))},2487:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ss",weekdays:"Lisontfo_Umsombuluko_Lesibili_Lesitsatfu_Lesine_Lesihlanu_Umgcibelo".split("_"),months:"Bhimbidvwane_Indlovana_Indlov'lenkhulu_Mabasa_Inkhwekhweti_Inhlaba_Kholwane_Ingci_Inyoni_Imphala_Lweti_Ingongoni".split("_"),weekStart:1,weekdaysShort:"Lis_Umb_Lsb_Les_Lsi_Lsh_Umg".split("_"),monthsShort:"Bhi_Ina_Inu_Mab_Ink_Inh_Kho_Igc_Iny_Imp_Lwe_Igo".split("_"),weekdaysMin:"Li_Us_Lb_Lt_Ls_Lh_Ug".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"nga %s",past:"wenteka nga %s",s:"emizuzwana lomcane",m:"umzuzu",mm:"%d emizuzu",h:"lihora",hh:"%d emahora",d:"lilanga",dd:"%d emalanga",M:"inyanga",MM:"%d tinyanga",y:"umnyaka",yy:"%d iminyaka"}};return e.default.locale(i,null,!0),i}(i(4353))},9160:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv-fi",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY, [kl.] HH.mm",LLLL:"dddd, D. MMMM YYYY, [kl.] HH.mm",l:"D.M.YYYY",ll:"D. MMM YYYY",lll:"D. MMM YYYY, [kl.] HH.mm",llll:"ddd, D. MMM YYYY, [kl.] HH.mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},1340:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sv",weekdays:"söndag_måndag_tisdag_onsdag_torsdag_fredag_lördag".split("_"),weekdaysShort:"sön_mån_tis_ons_tor_fre_lör".split("_"),weekdaysMin:"sö_må_ti_on_to_fr_lö".split("_"),months:"januari_februari_mars_april_maj_juni_juli_augusti_september_oktober_november_december".split("_"),monthsShort:"jan_feb_mar_apr_maj_jun_jul_aug_sep_okt_nov_dec".split("_"),weekStart:1,yearStart:4,ordinal:function(t){var e=t%10;return"["+t+(1===e||2===e?"a":"e")+"]"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"D MMMM YYYY",LLL:"D MMMM YYYY [kl.] HH:mm",LLLL:"dddd D MMMM YYYY [kl.] HH:mm",lll:"D MMM YYYY HH:mm",llll:"ddd D MMM YYYY HH:mm"},relativeTime:{future:"om %s",past:"för %s sedan",s:"några sekunder",m:"en minut",mm:"%d minuter",h:"en timme",hh:"%d timmar",d:"en dag",dd:"%d dagar",M:"en månad",MM:"%d månader",y:"ett år",yy:"%d år"}};return e.default.locale(i,null,!0),i}(i(4353))},2979:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"sw",weekdays:"Jumapili_Jumatatu_Jumanne_Jumatano_Alhamisi_Ijumaa_Jumamosi".split("_"),weekdaysShort:"Jpl_Jtat_Jnne_Jtan_Alh_Ijm_Jmos".split("_"),weekdaysMin:"J2_J3_J4_J5_Al_Ij_J1".split("_"),months:"Januari_Februari_Machi_Aprili_Mei_Juni_Julai_Agosti_Septemba_Oktoba_Novemba_Desemba".split("_"),monthsShort:"Jan_Feb_Mac_Apr_Mei_Jun_Jul_Ago_Sep_Okt_Nov_Des".split("_"),weekStart:1,ordinal:function(t){return t},relativeTime:{future:"%s baadaye",past:"tokea %s",s:"hivi punde",m:"dakika moja",mm:"dakika %d",h:"saa limoja",hh:"masaa %d",d:"siku moja",dd:"masiku %d",M:"mwezi mmoja",MM:"miezi %d",y:"mwaka mmoja",yy:"miaka %d"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},7250:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ta",weekdays:"ஞாயிற்றுக்கிழமை_திங்கட்கிழமை_செவ்வாய்கிழமை_புதன்கிழமை_வியாழக்கிழமை_வெள்ளிக்கிழமை_சனிக்கிழமை".split("_"),months:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysShort:"ஞாயிறு_திங்கள்_செவ்வாய்_புதன்_வியாழன்_வெள்ளி_சனி".split("_"),monthsShort:"ஜனவரி_பிப்ரவரி_மார்ச்_ஏப்ரல்_மே_ஜூன்_ஜூலை_ஆகஸ்ட்_செப்டெம்பர்_அக்டோபர்_நவம்பர்_டிசம்பர்".split("_"),weekdaysMin:"ஞா_தி_செ_பு_வி_வெ_ச".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, HH:mm",LLLL:"dddd, D MMMM YYYY, HH:mm"},relativeTime:{future:"%s இல்",past:"%s முன்",s:"ஒரு சில விநாடிகள்",m:"ஒரு நிமிடம்",mm:"%d நிமிடங்கள்",h:"ஒரு மணி நேரம்",hh:"%d மணி நேரம்",d:"ஒரு நாள்",dd:"%d நாட்கள்",M:"ஒரு மாதம்",MM:"%d மாதங்கள்",y:"ஒரு வருடம்",yy:"%d ஆண்டுகள்"}};return e.default.locale(i,null,!0),i}(i(4353))},7406:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"te",weekdays:"ఆదివారం_సోమవారం_మంగళవారం_బుధవారం_గురువారం_శుక్రవారం_శనివారం".split("_"),months:"జనవరి_ఫిబ్రవరి_మార్చి_ఏప్రిల్_మే_జూన్_జులై_ఆగస్టు_సెప్టెంబర్_అక్టోబర్_నవంబర్_డిసెంబర్".split("_"),weekdaysShort:"ఆది_సోమ_మంగళ_బుధ_గురు_శుక్ర_శని".split("_"),monthsShort:"జన._ఫిబ్ర._మార్చి_ఏప్రి._మే_జూన్_జులై_ఆగ._సెప్._అక్టో._నవ._డిసె.".split("_"),weekdaysMin:"ఆ_సో_మం_బు_గు_శు_శ".split("_"),ordinal:function(t){return t},formats:{LT:"A h:mm",LTS:"A h:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY, A h:mm",LLLL:"dddd, D MMMM YYYY, A h:mm"},relativeTime:{future:"%s లో",past:"%s క్రితం",s:"కొన్ని క్షణాలు",m:"ఒక నిమిషం",mm:"%d నిమిషాలు",h:"ఒక గంట",hh:"%d గంటలు",d:"ఒక రోజు",dd:"%d రోజులు",M:"ఒక నెల",MM:"%d నెలలు",y:"ఒక సంవత్సరం",yy:"%d సంవత్సరాలు"}};return e.default.locale(i,null,!0),i}(i(4353))},8928:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tet",weekdays:"Domingu_Segunda_Tersa_Kuarta_Kinta_Sesta_Sabadu".split("_"),months:"Janeiru_Fevereiru_Marsu_Abril_Maiu_Juñu_Jullu_Agustu_Setembru_Outubru_Novembru_Dezembru".split("_"),weekStart:1,weekdaysShort:"Dom_Seg_Ters_Kua_Kint_Sest_Sab".split("_"),monthsShort:"Jan_Fev_Mar_Abr_Mai_Jun_Jul_Ago_Set_Out_Nov_Dez".split("_"),weekdaysMin:"Do_Seg_Te_Ku_Ki_Ses_Sa".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"iha %s",past:"%s liuba",s:"minutu balun",m:"minutu ida",mm:"minutu %d",h:"oras ida",hh:"oras %d",d:"loron ida",dd:"loron %d",M:"fulan ida",MM:"fulan %d",y:"tinan ida",yy:"tinan %d"}};return e.default.locale(i,null,!0),i}(i(4353))},5012:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tg",weekdays:"якшанбе_душанбе_сешанбе_чоршанбе_панҷшанбе_ҷумъа_шанбе".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"яшб_дшб_сшб_чшб_пшб_ҷум_шнб".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"яш_дш_сш_чш_пш_ҷм_шб".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"баъди %s",past:"%s пеш",s:"якчанд сония",m:"як дақиқа",mm:"%d дақиқа",h:"як соат",hh:"%d соат",d:"як рӯз",dd:"%d рӯз",M:"як моҳ",MM:"%d моҳ",y:"як сол",yy:"%d сол"}};return e.default.locale(i,null,!0),i}(i(4353))},7081:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"th",weekdays:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัสบดี_ศุกร์_เสาร์".split("_"),weekdaysShort:"อาทิตย์_จันทร์_อังคาร_พุธ_พฤหัส_ศุกร์_เสาร์".split("_"),weekdaysMin:"อา._จ._อ._พ._พฤ._ศ._ส.".split("_"),months:"มกราคม_กุมภาพันธ์_มีนาคม_เมษายน_พฤษภาคม_มิถุนายน_กรกฎาคม_สิงหาคม_กันยายน_ตุลาคม_พฤศจิกายน_ธันวาคม".split("_"),monthsShort:"ม.ค._ก.พ._มี.ค._เม.ย._พ.ค._มิ.ย._ก.ค._ส.ค._ก.ย._ต.ค._พ.ย._ธ.ค.".split("_"),formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY เวลา H:mm",LLLL:"วันddddที่ D MMMM YYYY เวลา H:mm"},relativeTime:{future:"อีก %s",past:"%sที่แล้ว",s:"ไม่กี่วินาที",m:"1 นาที",mm:"%d นาที",h:"1 ชั่วโมง",hh:"%d ชั่วโมง",d:"1 วัน",dd:"%d วัน",M:"1 เดือน",MM:"%d เดือน",y:"1 ปี",yy:"%d ปี"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},2544:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tk",weekdays:"Ýekşenbe_Duşenbe_Sişenbe_Çarşenbe_Penşenbe_Anna_Şenbe".split("_"),weekdaysShort:"Ýek_Duş_Siş_Çar_Pen_Ann_Şen".split("_"),weekdaysMin:"Ýk_Dş_Sş_Çr_Pn_An_Şn".split("_"),months:"Ýanwar_Fewral_Mart_Aprel_Maý_Iýun_Iýul_Awgust_Sentýabr_Oktýabr_Noýabr_Dekabr".split("_"),monthsShort:"Ýan_Few_Mar_Apr_Maý_Iýn_Iýl_Awg_Sen_Okt_Noý_Dek".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s soň",past:"%s öň",s:"birnäçe sekunt",m:"bir minut",mm:"%d minut",h:"bir sagat",hh:"%d sagat",d:"bir gün",dd:"%d gün",M:"bir aý",MM:"%d aý",y:"bir ýyl",yy:"%d ýyl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},8142:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tl-ph",weekdays:"Linggo_Lunes_Martes_Miyerkules_Huwebes_Biyernes_Sabado".split("_"),months:"Enero_Pebrero_Marso_Abril_Mayo_Hunyo_Hulyo_Agosto_Setyembre_Oktubre_Nobyembre_Disyembre".split("_"),weekStart:1,weekdaysShort:"Lin_Lun_Mar_Miy_Huw_Biy_Sab".split("_"),monthsShort:"Ene_Peb_Mar_Abr_May_Hun_Hul_Ago_Set_Okt_Nob_Dis".split("_"),weekdaysMin:"Li_Lu_Ma_Mi_Hu_Bi_Sab".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"MM/D/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY HH:mm",LLLL:"dddd, MMMM DD, YYYY HH:mm"},relativeTime:{future:"sa loob ng %s",past:"%s ang nakalipas",s:"ilang segundo",m:"isang minuto",mm:"%d minuto",h:"isang oras",hh:"%d oras",d:"isang araw",dd:"%d araw",M:"isang buwan",MM:"%d buwan",y:"isang taon",yy:"%d taon"}};return e.default.locale(i,null,!0),i}(i(4353))},321:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tlh",weekdays:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),months:"tera’ jar wa’_tera’ jar cha’_tera’ jar wej_tera’ jar loS_tera’ jar vagh_tera’ jar jav_tera’ jar Soch_tera’ jar chorgh_tera’ jar Hut_tera’ jar wa’maH_tera’ jar wa’maH wa’_tera’ jar wa’maH cha’".split("_"),weekStart:1,weekdaysShort:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),monthsShort:"jar wa’_jar cha’_jar wej_jar loS_jar vagh_jar jav_jar Soch_jar chorgh_jar Hut_jar wa’maH_jar wa’maH wa’_jar wa’maH cha’".split("_"),weekdaysMin:"lojmItjaj_DaSjaj_povjaj_ghItlhjaj_loghjaj_buqjaj_ghInjaj".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"}};return e.default.locale(i,null,!0),i}(i(4353))},4895:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tr",weekdays:"Pazar_Pazartesi_Salı_Çarşamba_Perşembe_Cuma_Cumartesi".split("_"),weekdaysShort:"Paz_Pts_Sal_Çar_Per_Cum_Cts".split("_"),weekdaysMin:"Pz_Pt_Sa_Ça_Pe_Cu_Ct".split("_"),months:"Ocak_Şubat_Mart_Nisan_Mayıs_Haziran_Temmuz_Ağustos_Eylül_Ekim_Kasım_Aralık".split("_"),monthsShort:"Oca_Şub_Mar_Nis_May_Haz_Tem_Ağu_Eyl_Eki_Kas_Ara".split("_"),weekStart:1,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"%s sonra",past:"%s önce",s:"birkaç saniye",m:"bir dakika",mm:"%d dakika",h:"bir saat",hh:"%d saat",d:"bir gün",dd:"%d gün",M:"bir ay",MM:"%d ay",y:"bir yıl",yy:"%d yıl"},ordinal:function(t){return t+"."}};return e.default.locale(i,null,!0),i}(i(4353))},3187:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzl",weekdays:"Súladi_Lúneçi_Maitzi_Márcuri_Xhúadi_Viénerçi_Sáturi".split("_"),months:"Januar_Fevraglh_Març_Avrïu_Mai_Gün_Julia_Guscht_Setemvar_Listopäts_Noemvar_Zecemvar".split("_"),weekStart:1,weekdaysShort:"Súl_Lún_Mai_Már_Xhú_Vié_Sát".split("_"),monthsShort:"Jan_Fev_Mar_Avr_Mai_Gün_Jul_Gus_Set_Lis_Noe_Zec".split("_"),weekdaysMin:"Sú_Lú_Ma_Má_Xh_Vi_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH.mm",LTS:"HH.mm.ss",L:"DD.MM.YYYY",LL:"D. MMMM [dallas] YYYY",LLL:"D. MMMM [dallas] YYYY HH.mm",LLLL:"dddd, [li] D. MMMM [dallas] YYYY HH.mm"}};return e.default.locale(i,null,!0),i}(i(4353))},8804:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm-latn",weekdays:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),months:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekStart:6,weekdaysShort:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),monthsShort:"innayr_brˤayrˤ_marˤsˤ_ibrir_mayyw_ywnyw_ywlywz_ɣwšt_šwtanbir_ktˤwbrˤ_nwwanbir_dwjnbir".split("_"),weekdaysMin:"asamas_aynas_asinas_akras_akwas_asimwas_asiḍyas".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dadkh s yan %s",past:"yan %s",s:"imik",m:"minuḍ",mm:"%d minuḍ",h:"saɛa",hh:"%d tassaɛin",d:"ass",dd:"%d ossan",M:"ayowr",MM:"%d iyyirn",y:"asgas",yy:"%d isgasn"}};return e.default.locale(i,null,!0),i}(i(4353))},5084:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"tzm",weekdays:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),months:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekStart:6,weekdaysShort:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),monthsShort:"ⵉⵏⵏⴰⵢⵔ_ⴱⵕⴰⵢⵕ_ⵎⴰⵕⵚ_ⵉⴱⵔⵉⵔ_ⵎⴰⵢⵢⵓ_ⵢⵓⵏⵢⵓ_ⵢⵓⵍⵢⵓⵣ_ⵖⵓⵛⵜ_ⵛⵓⵜⴰⵏⴱⵉⵔ_ⴽⵟⵓⴱⵕ_ⵏⵓⵡⴰⵏⴱⵉⵔ_ⴷⵓⵊⵏⴱⵉⵔ".split("_"),weekdaysMin:"ⴰⵙⴰⵎⴰⵙ_ⴰⵢⵏⴰⵙ_ⴰⵙⵉⵏⴰⵙ_ⴰⴽⵔⴰⵙ_ⴰⴽⵡⴰⵙ_ⴰⵙⵉⵎⵡⴰⵙ_ⴰⵙⵉⴹⵢⴰⵙ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"ⴷⴰⴷⵅ ⵙ ⵢⴰⵏ %s",past:"ⵢⴰⵏ %s",s:"ⵉⵎⵉⴽ",m:"ⵎⵉⵏⵓⴺ",mm:"%d ⵎⵉⵏⵓⴺ",h:"ⵙⴰⵄⴰ",hh:"%d ⵜⴰⵙⵙⴰⵄⵉⵏ",d:"ⴰⵙⵙ",dd:"%d oⵙⵙⴰⵏ",M:"ⴰⵢoⵓⵔ",MM:"%d ⵉⵢⵢⵉⵔⵏ",y:"ⴰⵙⴳⴰⵙ",yy:"%d ⵉⵙⴳⴰⵙⵏ"}};return e.default.locale(i,null,!0),i}(i(4353))},9911:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ug-cn",weekdays:"يەكشەنبە_دۈشەنبە_سەيشەنبە_چارشەنبە_پەيشەنبە_جۈمە_شەنبە".split("_"),months:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekStart:1,weekdaysShort:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),monthsShort:"يانۋار_فېۋرال_مارت_ئاپرېل_ماي_ئىيۇن_ئىيۇل_ئاۋغۇست_سېنتەبىر_ئۆكتەبىر_نويابىر_دېكابىر".split("_"),weekdaysMin:"يە_دۈ_سە_چا_پە_جۈ_شە".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY-MM-DD",LL:"YYYY-يىلىM-ئاينىڭD-كۈنى",LLL:"YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm",LLLL:"dddd، YYYY-يىلىM-ئاينىڭD-كۈنى، HH:mm"},relativeTime:{future:"%s كېيىن",past:"%s بۇرۇن",s:"نەچچە سېكونت",m:"بىر مىنۇت",mm:"%d مىنۇت",h:"بىر سائەت",hh:"%d سائەت",d:"بىر كۈن",dd:"%d كۈن",M:"بىر ئاي",MM:"%d ئاي",y:"بىر يىل",yy:"%d يىل"}};return e.default.locale(i,null,!0),i}(i(4353))},4173:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i="січня_лютого_березня_квітня_травня_червня_липня_серпня_вересня_жовтня_листопада_грудня".split("_"),s="січень_лютий_березень_квітень_травень_червень_липень_серпень_вересень_жовтень_листопад_грудень".split("_"),n=/D[oD]?(\[[^[\]]*\]|\s)+MMMM?/;function r(t,e,i){var s,n;return"m"===i?e?"хвилина":"хвилину":"h"===i?e?"година":"годину":t+" "+(s=+t,n={ss:e?"секунда_секунди_секунд":"секунду_секунди_секунд",mm:e?"хвилина_хвилини_хвилин":"хвилину_хвилини_хвилин",hh:e?"година_години_годин":"годину_години_годин",dd:"день_дні_днів",MM:"місяць_місяці_місяців",yy:"рік_роки_років"}[i].split("_"),s%10==1&&s%100!=11?n[0]:s%10>=2&&s%10<=4&&(s%100<10||s%100>=20)?n[1]:n[2])}var a=function(t,e){return n.test(e)?i[t.month()]:s[t.month()]};a.s=s,a.f=i;var o={name:"uk",weekdays:"неділя_понеділок_вівторок_середа_четвер_п’ятниця_субота".split("_"),weekdaysShort:"ндл_пнд_втр_срд_чтв_птн_сбт".split("_"),weekdaysMin:"нд_пн_вт_ср_чт_пт_сб".split("_"),months:a,monthsShort:"січ_лют_бер_квіт_трав_черв_лип_серп_вер_жовт_лист_груд".split("_"),weekStart:1,relativeTime:{future:"за %s",past:"%s тому",s:"декілька секунд",m:r,mm:r,h:r,hh:r,d:"день",dd:r,M:"місяць",MM:r,y:"рік",yy:r},ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD.MM.YYYY",LL:"D MMMM YYYY р.",LLL:"D MMMM YYYY р., HH:mm",LLLL:"dddd, D MMMM YYYY р., HH:mm"}};return e.default.locale(o,null,!0),o}(i(4353))},1750:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"ur",weekdays:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),months:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekStart:1,weekdaysShort:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),monthsShort:"جنوری_فروری_مارچ_اپریل_مئی_جون_جولائی_اگست_ستمبر_اکتوبر_نومبر_دسمبر".split("_"),weekdaysMin:"اتوار_پیر_منگل_بدھ_جمعرات_جمعہ_ہفتہ".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd، D MMMM YYYY HH:mm"},relativeTime:{future:"%s بعد",past:"%s قبل",s:"چند سیکنڈ",m:"ایک منٹ",mm:"%d منٹ",h:"ایک گھنٹہ",hh:"%d گھنٹے",d:"ایک دن",dd:"%d دن",M:"ایک ماہ",MM:"%d ماہ",y:"ایک سال",yy:"%d سال"}};return e.default.locale(i,null,!0),i}(i(4353))},950:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz-latn",weekdays:"Yakshanba_Dushanba_Seshanba_Chorshanba_Payshanba_Juma_Shanba".split("_"),months:"Yanvar_Fevral_Mart_Aprel_May_Iyun_Iyul_Avgust_Sentabr_Oktabr_Noyabr_Dekabr".split("_"),weekStart:1,weekdaysShort:"Yak_Dush_Sesh_Chor_Pay_Jum_Shan".split("_"),monthsShort:"Yan_Fev_Mar_Apr_May_Iyun_Iyul_Avg_Sen_Okt_Noy_Dek".split("_"),weekdaysMin:"Ya_Du_Se_Cho_Pa_Ju_Sha".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Yaqin %s ichida",past:"%s oldin",s:"soniya",m:"bir daqiqa",mm:"%d daqiqa",h:"bir soat",hh:"%d soat",d:"bir kun",dd:"%d kun",M:"bir oy",MM:"%d oy",y:"bir yil",yy:"%d yil"}};return e.default.locale(i,null,!0),i}(i(4353))},4734:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"uz",weekdays:"Якшанба_Душанба_Сешанба_Чоршанба_Пайшанба_Жума_Шанба".split("_"),months:"январ_феврал_март_апрел_май_июн_июл_август_сентябр_октябр_ноябр_декабр".split("_"),weekStart:1,weekdaysShort:"Якш_Душ_Сеш_Чор_Пай_Жум_Шан".split("_"),monthsShort:"янв_фев_мар_апр_май_июн_июл_авг_сен_окт_ноя_дек".split("_"),weekdaysMin:"Як_Ду_Се_Чо_Па_Жу_Ша".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"D MMMM YYYY, dddd HH:mm"},relativeTime:{future:"Якин %s ичида",past:"%s олдин",s:"фурсат",m:"бир дакика",mm:"%d дакика",h:"бир соат",hh:"%d соат",d:"бир кун",dd:"%d кун",M:"бир ой",MM:"%d ой",y:"бир йил",yy:"%d йил"}};return e.default.locale(i,null,!0),i}(i(4353))},860:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"vi",weekdays:"chủ nhật_thứ hai_thứ ba_thứ tư_thứ năm_thứ sáu_thứ bảy".split("_"),months:"tháng 1_tháng 2_tháng 3_tháng 4_tháng 5_tháng 6_tháng 7_tháng 8_tháng 9_tháng 10_tháng 11_tháng 12".split("_"),weekStart:1,weekdaysShort:"CN_T2_T3_T4_T5_T6_T7".split("_"),monthsShort:"Th01_Th02_Th03_Th04_Th05_Th06_Th07_Th08_Th09_Th10_Th11_Th12".split("_"),weekdaysMin:"CN_T2_T3_T4_T5_T6_T7".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM [năm] YYYY",LLL:"D MMMM [năm] YYYY HH:mm",LLLL:"dddd, D MMMM [năm] YYYY HH:mm",l:"DD/M/YYYY",ll:"D MMM YYYY",lll:"D MMM YYYY HH:mm",llll:"ddd, D MMM YYYY HH:mm"},relativeTime:{future:"%s tới",past:"%s trước",s:"vài giây",m:"một phút",mm:"%d phút",h:"một giờ",hh:"%d giờ",d:"một ngày",dd:"%d ngày",M:"một tháng",MM:"%d tháng",y:"một năm",yy:"%d năm"}};return e.default.locale(i,null,!0),i}(i(4353))},5760:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"x-pseudo",weekdays:"S~úñdá~ý_Mó~ñdáý~_Túé~sdáý~_Wéd~ñésd~áý_T~húrs~dáý_~Fríd~áý_S~átúr~dáý".split("_"),months:"J~áñúá~rý_F~ébrú~árý_~Márc~h_Áp~ríl_~Máý_~Júñé~_Júl~ý_Áú~gúst~_Sép~témb~ér_Ó~ctób~ér_Ñ~óvém~bér_~Décé~mbér".split("_"),weekStart:1,weekdaysShort:"S~úñ_~Móñ_~Túé_~Wéd_~Thú_~Frí_~Sát".split("_"),monthsShort:"J~áñ_~Féb_~Már_~Ápr_~Máý_~Júñ_~Júl_~Áúg_~Sép_~Óct_~Ñóv_~Déc".split("_"),weekdaysMin:"S~ú_Mó~_Tú_~Wé_T~h_Fr~_Sá".split("_"),ordinal:function(t){return t},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd, D MMMM YYYY HH:mm"},relativeTime:{future:"í~ñ %s",past:"%s á~gó",s:"á ~féw ~sécó~ñds",m:"á ~míñ~úté",mm:"%d m~íñú~tés",h:"á~ñ hó~úr",hh:"%d h~óúrs",d:"á ~dáý",dd:"%d d~áýs",M:"á ~móñ~th",MM:"%d m~óñt~hs",y:"á ~ýéár",yy:"%d ý~éárs"}};return e.default.locale(i,null,!0),i}(i(4353))},7933:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"yo",weekdays:"Àìkú_Ajé_Ìsẹ́gun_Ọjọ́rú_Ọjọ́bọ_Ẹtì_Àbámẹ́ta".split("_"),months:"Sẹ́rẹ́_Èrèlè_Ẹrẹ̀nà_Ìgbé_Èbibi_Òkùdu_Agẹmo_Ògún_Owewe_Ọ̀wàrà_Bélú_Ọ̀pẹ̀̀".split("_"),weekStart:1,weekdaysShort:"Àìk_Ajé_Ìsẹ́_Ọjr_Ọjb_Ẹtì_Àbá".split("_"),monthsShort:"Sẹ́r_Èrl_Ẹrn_Ìgb_Èbi_Òkù_Agẹ_Ògú_Owe_Ọ̀wà_Bél_Ọ̀pẹ̀̀".split("_"),weekdaysMin:"Àì_Aj_Ìs_Ọr_Ọb_Ẹt_Àb".split("_"),ordinal:function(t){return t},formats:{LT:"h:mm A",LTS:"h:mm:ss A",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY h:mm A",LLLL:"dddd, D MMMM YYYY h:mm A"},relativeTime:{future:"ní %s",past:"%s kọjá",s:"ìsẹjú aayá die",m:"ìsẹjú kan",mm:"ìsẹjú %d",h:"wákati kan",hh:"wákati %d",d:"ọjọ́ kan",dd:"ọjọ́ %d",M:"osù kan",MM:"osù %d",y:"ọdún kan",yy:"ọdún %d"}};return e.default.locale(i,null,!0),i}(i(4353))},6033:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-cn",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s内",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},122:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-hk",months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"一分鐘",mm:"%d 分鐘",h:"一小時",hh:"%d 小時",d:"一天",dd:"%d 天",M:"一個月",MM:"%d 個月",y:"一年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},1349:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh-tw",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"週日_週一_週二_週三_週四_週五_週六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"週":t+"日"},formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日 HH:mm",LLLL:"YYYY年M月D日dddd HH:mm",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s內",past:"%s前",s:"幾秒",m:"1 分鐘",mm:"%d 分鐘",h:"1 小時",hh:"%d 小時",d:"1 天",dd:"%d 天",M:"1 個月",MM:"%d 個月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},6007:function(t,e,i){t.exports=function(t){"use strict";var e=function(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}(t),i={name:"zh",weekdays:"星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"),weekdaysShort:"周日_周一_周二_周三_周四_周五_周六".split("_"),weekdaysMin:"日_一_二_三_四_五_六".split("_"),months:"一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"),monthsShort:"1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"),ordinal:function(t,e){return"W"===e?t+"周":t+"日"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"YYYY/MM/DD",LL:"YYYY年M月D日",LLL:"YYYY年M月D日Ah点mm分",LLLL:"YYYY年M月D日ddddAh点mm分",l:"YYYY/M/D",ll:"YYYY年M月D日",lll:"YYYY年M月D日 HH:mm",llll:"YYYY年M月D日dddd HH:mm"},relativeTime:{future:"%s后",past:"%s前",s:"几秒",m:"1 分钟",mm:"%d 分钟",h:"1 小时",hh:"%d 小时",d:"1 天",dd:"%d 天",M:"1 个月",MM:"%d 个月",y:"1 年",yy:"%d 年"},meridiem:function(t,e){var i=100*t+e;return i<600?"凌晨":i<900?"早上":i<1100?"上午":i<1300?"中午":i<1800?"下午":"晚上"}};return e.default.locale(i,null,!0),i}(i(4353))},8569:function(t){t.exports=function(){"use strict";var t={year:0,month:1,day:2,hour:3,minute:4,second:5},e={};return function(i,s,n){var r,a=function(t,i,s){void 0===s&&(s={});var n=new Date(t),r=function(t,i){void 0===i&&(i={});var s=i.timeZoneName||"short",n=t+"|"+s,r=e[n];return r||(r=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:t,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:s}),e[n]=r),r}(i,s);return r.formatToParts(n)},o=function(e,i){for(var s=a(e,i),r=[],o=0;o=0&&(r[c]=parseInt(d,10))}var u=r[3],p=24===u?0:u,g=r[0]+"-"+r[1]+"-"+r[2]+" "+p+":"+r[4]+":"+r[5]+":000",m=+e;return(n.utc(g).valueOf()-(m-=m%1e3))/6e4},l=s.prototype;l.tz=function(t,e){void 0===t&&(t=r);var i,s=this.utcOffset(),a=this.toDate(),o=a.toLocaleString("en-US",{timeZone:t}),l=Math.round((a-new Date(o))/1e3/60),h=15*-Math.round(a.getTimezoneOffset()/15)-l;if(Number(h)){if(i=n(o,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(h,!0),e){var d=i.utcOffset();i=i.add(s-d,"minute")}}else i=this.utcOffset(0,e);return i.$x.$timezone=t,i},l.offsetName=function(t){var e=this.$x.$timezone||n.tz.guess(),i=a(this.valueOf(),e,{timeZoneName:t}).find((function(t){return"timezonename"===t.type.toLowerCase()}));return i&&i.value};var h=l.startOf;l.startOf=function(t,e){if(!this.$x||!this.$x.$timezone)return h.call(this,t,e);var i=n(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return h.call(i,t,e).tz(this.$x.$timezone,!0)},n.tz=function(t,e,i){var s=i&&e,a=i||e||r,l=o(+n(),a);if("string"!=typeof t)return n(t).tz(a);var h=function(t,e,i){var s=t-60*e*1e3,n=o(s,i);if(e===n)return[s,e];var r=o(s-=60*(n-e)*1e3,i);return n===r?[s,n]:[t-60*Math.min(n,r)*1e3,Math.max(n,r)]}(n.utc(t,s).valueOf(),l,a),d=h[0],c=h[1],u=n(d).utcOffset(c);return u.$x.$timezone=a,u},n.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},n.tz.setDefault=function(t){r=t}}}()},3826:function(t){t.exports=function(){"use strict";var t="minute",e=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(s,n,r){var a=n.prototype;r.utc=function(t){return new n({date:t,utc:!0,args:arguments})},a.utc=function(e){var i=r(this.toDate(),{locale:this.$L,utc:!0});return e?i.add(this.utcOffset(),t):i},a.local=function(){return r(this.toDate(),{locale:this.$L,utc:!1})};var o=a.parse;a.parse=function(t){t.utc&&(this.$u=!0),this.$utils().u(t.$offset)||(this.$offset=t.$offset),o.call(this,t)};var l=a.init;a.init=function(){if(this.$u){var t=this.$d;this.$y=t.getUTCFullYear(),this.$M=t.getUTCMonth(),this.$D=t.getUTCDate(),this.$W=t.getUTCDay(),this.$H=t.getUTCHours(),this.$m=t.getUTCMinutes(),this.$s=t.getUTCSeconds(),this.$ms=t.getUTCMilliseconds()}else l.call(this)};var h=a.utcOffset;a.utcOffset=function(s,n){var r=this.$utils().u;if(r(s))return this.$u?0:r(this.$offset)?h.call(this):this.$offset;if("string"==typeof s&&(s=function(t){void 0===t&&(t="");var s=t.match(e);if(!s)return null;var n=(""+s[0]).match(i)||["-",0,0],r=n[0],a=60*+n[1]+ +n[2];return 0===a?0:"+"===r?a:-a}(s),null===s))return this;var a=Math.abs(s)<=16?60*s:s,o=this;if(n)return o.$offset=a,o.$u=0===s,o;if(0!==s){var l=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(o=this.local().add(a+l,t)).$offset=a,o.$x.$localOffset=l}else o=this.utc();return o};var d=a.format;a.format=function(t){var e=t||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return d.call(this,e)},a.valueOf=function(){var t=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*t},a.isUTC=function(){return!!this.$u},a.toISOString=function(){return this.toDate().toISOString()},a.toString=function(){return this.toDate().toUTCString()};var c=a.toDate;a.toDate=function(t){return"s"===t&&this.$offset?r(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():c.call(this)};var u=a.diff;a.diff=function(t,e,i){if(t&&this.$u===t.$u)return u.call(this,t,e,i);var s=this.local(),n=r(t).local();return u.call(s,n,e,i)}}}()},228:t=>{"use strict";var e=Object.prototype.hasOwnProperty,i="~";function s(){}function n(t,e,i){this.fn=t,this.context=e,this.once=i||!1}function r(t,e,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||t,a),l=i?i+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],o]:t._events[l].push(o):(t._events[l]=o,t._eventsCount++),t}function a(t,e){0==--t._eventsCount?t._events=new s:delete t._events[e]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var t,s,n=[];if(0===this._eventsCount)return n;for(s in t=this._events)e.call(t,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},o.prototype.listeners=function(t){var e=i?i+t:t,s=this._events[e];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n{var s=i(833);function n(e,i){var s=e.geometry,n=s.type;if("LineString"===n)s.coordinates=t.exports.simplify(s.coordinates,i);else if("Polygon"===n||"MultiLineString"===n)for(var r=0;r{var s=i(1447),n=function(t,e){for(var i=0,r=0,a=1;a<=t.length-2;a++){var o=new s(t[0],t[t.length-1]).perpendicularDistance(t[a]);o>i&&(r=a,i=o)}if(i>e)var l=n(t.slice(0,r),e),h=n(t.slice(r,t.length),e),d=l.concat(h);else d=t.length>1?[t[0],t[t.length-1]]:[t[0]];return d};t.exports=n},1447:t=>{var e=function(t,e){this.p1=t,this.p2=e};e.prototype.rise=function(){return this.p2[1]-this.p1[1]},e.prototype.run=function(){return this.p2[0]-this.p1[0]},e.prototype.slope=function(){return this.rise()/this.run()},e.prototype.yIntercept=function(){return this.p1[1]-this.p1[0]*this.slope(this.p1,this.p2)},e.prototype.isVertical=function(){return!isFinite(this.slope())},e.prototype.isHorizontal=function(){return this.p1[1]==this.p2[1]},e.prototype._perpendicularDistanceHorizontal=function(t){return Math.abs(this.p1[1]-t[1])},e.prototype._perpendicularDistanceVertical=function(t){return Math.abs(this.p1[0]-t[0])},e.prototype._perpendicularDistanceHasSlope=function(t){var e=this.slope(),i=this.yIntercept();return Math.abs(e*t[0]-t[1]+i)/Math.sqrt(Math.pow(e,2)+1)},e.prototype.perpendicularDistance=function(t){return this.isVertical()?this._perpendicularDistanceVertical(t):this.isHorizontal()?this._perpendicularDistanceHorizontal(t):this._perpendicularDistanceHasSlope(t)},t.exports=e}},e={};function i(s){var n=e[s];if(void 0!==n)return n.exports;var r=e[s]={exports:{}};return t[s].call(r.exports,r,r.exports,i),r.exports}i.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return i.d(e,{a:e}),e},i.d=(t,e)=>{for(var s in e)i.o(e,s)&&!i.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:e[s]})},i.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),i.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var s={};(()=>{"use strict";i.r(s),i.d(s,{d3_format:()=>Aq,d3_format_locale:()=>Lq,dayjs:()=>cq});var t={};i.r(t),i.d(t,{Zr:()=>zb}),window.HTMLWidgets;const e=t=>t;var n,r;!function(t){t["desktop-browser"]="desktop-browser",t["mobile-browser"]="mobile-browser",t.node="node",t.worker="worker",t.miniApp="miniApp",t.wx="wx",t.tt="tt",t.harmony="harmony",t["desktop-miniApp"]="desktop-miniApp",t.lynx="lynx"}(n||(n={})),function(t){t.cartesianAxis="cartesianAxis",t.cartesianBandAxis="cartesianAxis-band",t.cartesianLinearAxis="cartesianAxis-linear",t.cartesianTimeAxis="cartesianAxis-time",t.cartesianLogAxis="cartesianAxis-log",t.cartesianSymlogAxis="cartesianAxis-symlog",t.polarAxis="polarAxis",t.polarBandAxis="polarAxis-band",t.polarLinearAxis="polarAxis-linear",t.crosshair="crosshair",t.cartesianCrosshair="cartesianCrosshair",t.polarCrosshair="polarCrosshair",t.dataZoom="dataZoom",t.geoCoordinate="geoCoordinate",t.indicator="indicator",t.discreteLegend="discreteLegend",t.continuousLegend="continuousLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend",t.mapLabel="mapLabel",t.markLine="markLine",t.markArea="markArea",t.markPoint="markPoint",t.polarMarkLine="polarMarkLine",t.polarMarkArea="polarMarkArea",t.polarMarkPoint="polarMarkPoint",t.geoMarkPoint="geoMarkPoint",t.tooltip="tooltip",t.title="title",t.player="player",t.scrollBar="scrollBar",t.label="label",t.totalLabel="totalLabel",t.brush="brush",t.poptip="poptip",t.customMark="customMark"}(r||(r={}));var a=i(228),o=i.n(a);const l=(t,e)=>Object.prototype.toString.call(t)===`[object ${e}]`,h=(t,e=!1)=>{const i=typeof t;return e?"number"===i:"number"===i||l(t,"Number")},d="undefined"!=typeof console;function c(t,e,i){const s=[e].concat([].slice.call(i));d&&console[t].apply(console,s)}var u,p;(p=u||(u={}))[p.None=0]="None",p[p.Error=1]="Error",p[p.Warn=2]="Warn",p[p.Info=3]="Info",p[p.Debug=4]="Debug";class g{static getInstance(t,e){return g._instance&&h(t)?g._instance.level(t):g._instance||(g._instance=new g(t,e)),g._instance}static setInstance(t){return g._instance=t}static setInstanceLevel(t){g._instance?g._instance.level(t):g._instance=new g(t)}static clearInstance(){g._instance=null}constructor(t=u.None,e){this._onErrorHandler=[],this._level=t,this._method=e}addErrorHandler(t){this._onErrorHandler.find((e=>e===t))||this._onErrorHandler.push(t)}removeErrorHandler(t){const e=this._onErrorHandler.findIndex((e=>e===t));e<0||this._onErrorHandler.splice(e,1)}callErrorHandler(...t){this._onErrorHandler.forEach((e=>e(...t)))}canLogInfo(){return this._level>=u.Info}canLogDebug(){return this._level>=u.Debug}canLogError(){return this._level>=u.Error}canLogWarn(){return this._level>=u.Warn}level(t){return arguments.length?(this._level=+t,this):this._level}error(...t){var e;return this._level>=u.Error&&(this._onErrorHandler.length?this.callErrorHandler(...t):c(null!==(e=this._method)&&void 0!==e?e:"error","ERROR",t)),this}warn(...t){return this._level>=u.Warn&&c(this._method||"warn","WARN",t),this}info(...t){return this._level>=u.Info&&c(this._method||"log","INFO",t),this}debug(...t){return this._level>=u.Debug&&c(this._method||"log","DEBUG",t),this}}g._instance=null;let m=0;function _(t="dataset"){return m>1e8&&(m=0),t+"_"+m++}class f{constructor(t){var e;let i;this.options=t,this.isDataSet=!0,this.transformMap={},this.parserMap={},this.dataViewMap={},this.target=new(o()),i=(null==t?void 0:t.name)?t.name:_("dataset"),this.name=i,this._logger=null!==(e=null==t?void 0:t.logger)&&void 0!==e?e:g.getInstance()}setLogger(t){this._logger=t}getDataView(t){return this.dataViewMap[t]}setDataView(t,e){var i;this.dataViewMap[t]&&(null===(i=this._logger)||void 0===i||i.error(`Error: dataView ${t} 之前已存在,请重新命名`)),this.dataViewMap[t]=e}removeDataView(t){this.dataViewMap[t]=null,delete this.dataViewMap[t]}registerParser(t,e){var i;this.parserMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.parserMap[t]=e}removeParser(t){this.parserMap[t]=null,delete this.parserMap[t]}getParser(t){return this.parserMap[t]||this.parserMap.default}registerTransform(t,e){var i;this.transformMap[t]&&(null===(i=this._logger)||void 0===i||i.warn(`Warn: transform ${t} 之前已注册,执行覆盖逻辑`)),this.transformMap[t]=e}removeTransform(t){this.transformMap[t]=null,delete this.transformMap[t]}getTransform(t){return this.transformMap[t]}multipleDataViewAddListener(t,e,i){this._callMap||(this._callMap=new Map);let s=this._callMap.get(i);s||(s=()=>{t.some((t=>t.isRunning))||i()}),t.forEach((t=>{t.target.addListener(e,s)})),this._callMap.set(i,s)}allDataViewAddListener(t,e){this.multipleDataViewAddListener(Object.values(this.dataViewMap),t,e)}multipleDataViewRemoveListener(t,e,i){if(this._callMap){const s=this._callMap.get(i);s&&t.forEach((t=>{t.target.removeListener(e,s)})),this._callMap.delete(i)}}multipleDataViewUpdateInParse(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.parseNewData(t.data,t.options)}))}multipleDataViewUpdateInRawData(t){t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.markRunning()})),t.forEach((t=>{var e;return null===(e=this.getDataView(t.name))||void 0===e?void 0:e.updateRawData(t.data,t.options)}))}destroy(){this.transformMap=null,this.parserMap=null,this.dataViewMap=null,this._callMap=null,this.target.removeAllListeners()}}const v=(t,e=!1)=>e?"boolean"==typeof t:!0===t||!1===t||l(t,"Boolean"),y=t=>Array.isArray?Array.isArray(t):l(t,"Array"),b=(t,e,i)=>{const s=!v(null==e?void 0:e.dependencyUpdate)||(null==e?void 0:e.dependencyUpdate);if(!t||!y(t))throw new TypeError("Invalid data: must be DataView array!");return y(i.rawData)&&i.rawData.forEach((t=>{t.target&&(t.target.removeListener("change",i.reRunAllTransform),t.target.removeListener("markRunning",i.markRunning))})),s&&t.forEach((t=>{t.target.addListener("change",i.reRunAllTransform),t.target.addListener("markRunning",i.markRunning)})),t},x=t=>l(t,"Date"),S=(t,e=!1)=>{const i=typeof t;return e?"string"===i:"string"===i||l(t,"String")},M=t=>null!=t;function k(t,e,i){let s;if(!M(t)||"object"!=typeof t||e&&e(t))return t;const n=y(t),r=t.length;s=n?new Array(r):"object"==typeof t?{}:v(t)||h(t)||S(t)?t:x(t)?new Date(+t):void 0;const a=n?void 0:Object.keys(Object(t));let o=-1;if(s)for(;++o<(a||t).length;){const n=a?a[o]:o,r=t[n];i&&i.includes(n.toString())?s[n]=r:s[n]=k(r,e,i)}return s}const A=function(t){return null!==t&&"function"!=typeof t&&Number.isFinite(t.length)},w=function(t){if(!(t=>"object"==typeof t&&null!==t)(t)||!l(t,"Object"))return!1;if(null===Object.getPrototypeOf(t))return!0;let e=t;for(;null!==Object.getPrototypeOf(e);)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e};function T(t,e,i=!1,s=!1){if(e){if(t===e)return;if(M(e)&&"object"==typeof e){const n=Object(e),r=[];for(const t in n)r.push(t);let{length:a}=r,o=-1;for(;a--;){const a=r[++o];!M(n[a])||"object"!=typeof n[a]||s&&y(t[a])?C(t,a,n[a]):L(t,e,a,i,s)}}}}function L(t,e,i,s=!1,n=!1){const r=t[i],a=e[i];let o=e[i],l=!0;if(y(a)){if(s)o=[];else if(y(r))o=r;else if(A(r)){o=new Array(r.length);let t=-1;const e=r.length;for(;++tnull==t,P=(t,e)=>{var i,s;if(!(null==e?void 0:e.fields))return t;if(0===t.length)return t;const n=e.fields,r=t[0],a={},o=[];for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e)){const l=n[e];if(!l.type){let s=r;e in r||(s=null!==(i=t.find((t=>e in t)))&&void 0!==i?i:r),l.type="number"==typeof s[e]?"linear":"ordinal"}let h;if("number"==typeof l.sortIndex&&(h={key:e,type:l.type,index:l.sortIndex,sortIndex:{},sortIndexCount:0,sortReverse:!0===l.sortReverse},o.push(h)),(null===(s=l.domain)||void 0===s?void 0:s.length)>0)if("ordinal"===l.type){l._domainCache={},a[e]=l;const t={};l.domain.forEach(((e,i)=>{t[e]=i,l._domainCache[e]=i})),h&&(h.sortIndex=t,h.sortIndexCount=l.domain.length)}else l.domain.length>=2&&(a[e]=l)}return Object.keys(a).length>0&&(t=t.filter((t=>{for(const e in a){const i=a[e];if("ordinal"===i.type){if(!(t[e]in i._domainCache))return!1}else if(i.domain[0]>t[e]||i.domain[1]t.index-e.index)),t.sort(((t,e)=>function(t,e,i){for(let s=0;s(this.isRunning=!0,this.resetTransformData(),this.transformsArr.forEach((e=>{this.executeTransform(e,{pushHistory:t.pushHistory,emitMessage:!1}),this.isLastTransform(e)&&this.diffLastData()})),this.isRunning=!1,!1!==t.emitMessage&&this.target.emit("change",[]),this),this.markRunning=()=>{this.isRunning=!0,this.target.emit("markRunning",[])},i=(null==e?void 0:e.name)?e.name:_("dataview"),this.name=i,(null==e?void 0:e.history)&&(this.history=e.history,this.historyData=[]),this.dataSet.setDataView(i,this),this.setFields(null==e?void 0:e.fields)}parse(t,e,i=!1){var s;this.isRunning=!0,i&&this.target.emit("beforeParse",[]),e&&(this.parseOption=e);const n=this.cloneParseData(t,e);if(null==e?void 0:e.type){const t=(null!==(s=this.dataSet.getParser(e.type))&&void 0!==s?s:this.dataSet.getParser("bytejson"))(n,e.options,this);this.rawData=n,this.parserData=t,this.history&&this.historyData.push(n,t),this.latestData=t}else this.parserData=n,this.rawData=n,this.history&&this.historyData.push(n),this.latestData=n;return this.isRunning=!1,i&&this.target.emit("afterParse",[]),this}transform(t,e=!0){if(this.isRunning=!0,t&&t.type){let i=!0;if("fields"===t.type){this._fields=t.options.fields;const e=this.transformsArr.findIndex((e=>e.type===t.type));e>=0&&(i=!1,this.transformsArr[e].options.fields=this._fields)}if(i&&this.transformsArr.push(t),e){const e=this.isLastTransform(t);this.executeTransform(t),e&&this.diffLastData()}}return this.sortTransform(),this.isRunning=!1,this}isLastTransform(t){return this.transformsArr[this.transformsArr.length-1]===t}sortTransform(){this.transformsArr.length>=2&&this.transformsArr.sort(((t,e)=>{var i,s;return(null!==(i=t.level)&&void 0!==i?i:0)-(null!==(s=e.level)&&void 0!==s?s:0)}))}executeTransform(t,e={pushHistory:!0,emitMessage:!0}){const{pushHistory:i,emitMessage:s}=e,n=this.dataSet.getTransform(t.type)(this.latestData,t.options);this.history&&!1!==i&&this.historyData.push(n),this.latestData=n,!1!==s&&this.target.emit("change",[])}resetTransformData(){this.latestData=this.parserData,this.history&&(this.historyData.length=0,this.historyData.push(this.rawData,this.parserData))}enableDiff(t){this._diffData=!0,this._diffKeys=t,this._diffMap=new Map,this._diffRank=0}disableDiff(){this._diffData=!1,this._diffMap=null,this._diffRank=null}resetDiff(){this._diffMap=new Map,this._diffRank=0}diffLastData(){var t;if(!this._diffData)return;if(!this.latestData.forEach)return;if(!(null===(t=this._diffKeys)||void 0===t?void 0:t.length))return;const e=this._diffRank+1;if(0===this._diffRank)this.latestData.forEach((t=>{t[O]=e,this._diffMap.set(this._diffKeys.reduce(((e,i)=>e+t[i]),""),t)})),this.latestDataAUD={add:Array.from(this.latestData),del:[],update:[]};else{let t;this.latestDataAUD={add:[],del:[],update:[]},this.latestData.forEach((i=>{i[O]=e,t=this._diffKeys.reduce(((t,e)=>t+i[e]),""),this._diffMap.get(t)?this.latestDataAUD.update.push(i):this.latestDataAUD.add.push(i),this._diffMap.set(t,i)})),this._diffMap.forEach(((t,i)=>{t[O]"fields"===t.type));!D(this._fields)&&D(i)?(this.dataSet.registerTransform("fields",P),this.transform({type:"fields",options:{fields:this._fields}},!1)):i&&(i.options.fields=this._fields)}destroy(){this.dataSet.removeDataView(this.name),this._diffMap=null,this._diffRank=null,this.latestData=null,this.rawData=null,this.parserData=null,this.transformsArr=null,this.target=null}}class I{static GenAutoIncrementId(){return I.auto_increment_id++}}I.auto_increment_id=0;class B{constructor(t){this.id=I.GenAutoIncrementId(),this.registry=t}}const F="named",Y="inject",j="multi_inject",H="inversify:tagged",z="inversify:paramtypes",N=function(t){var e;return function(t){Object.prototype.hasOwnProperty;const e="function"==typeof Symbol,i=e&&void 0!==Symbol.toPrimitive?Symbol.toPrimitive:"@@toPrimitive",s=(e&&void 0!==Symbol.iterator&&Symbol.iterator,Object.create,Object.getPrototypeOf(Function)),n=("object"==typeof process&&process.env&&process.env.REFLECT_METADATA_USE_MAP_POLYFILL,Map),r=(Set,new WeakMap);function a(t,e,i){let s=r.get(t);if(d(s)){if(!i)return;s=new n,r.set(t,s)}let a=s.get(e);if(d(a)){if(!i)return;a=new n,s.set(e,a)}return a}function o(t,e,i){if(l(t,e,i))return!0;const s=m(e);return!c(s)&&o(t,s,i)}function l(t,e,i){const s=a(e,i,!1);return!d(s)&&!!s.has(t)}function h(t,e,i){if(l(t,e,i))return function(t,e,i){const s=a(e,i,!1);if(!d(s))return s.get(t)}(t,e,i);const s=m(e);return c(s)?void 0:h(t,s,i)}function d(t){return void 0===t}function c(t){return null===t}function u(t){return"object"==typeof t?null!==t:"function"==typeof t}function p(t){const e=function(t,e){switch(function(t){if(null===t)return 1;switch(typeof t){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return null===t?1:6;default:return 6}}(t)){case 0:case 1:case 2:case 3:case 4:case 5:return t}const s=3===e?"string":5===e?"number":"default",n=function(t,e){const i=t[e];if(null!=i){if(!g(i))throw new TypeError;return i}}(t,i);if(void 0!==n){const e=n.call(t,s);if(u(e))throw new TypeError;return e}return function(t,e){if("string"===e){const e=t.toString;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.valueOf;if(g(i)){const e=i.call(t);if(!u(e))return e}}else{const e=t.valueOf;if(g(e)){const i=e.call(t);if(!u(i))return i}const i=t.toString;if(g(i)){const e=i.call(t);if(!u(e))return e}}throw new TypeError}(t,"default"===s?"number":s)}(t,3);return"symbol"==typeof e?e:function(t){return""+t}(e)}function g(t){return"function"==typeof t}function m(t){const e=Object.getPrototypeOf(t);if("function"!=typeof t||t===s)return e;if(e!==s)return e;const i=t.prototype,n=i&&Object.getPrototypeOf(i);if(null==n||n===Object.prototype)return e;const r=n.constructor;return"function"!=typeof r||r===t?e:r}t("defineMetadata",(function(t,e,i,s){if(!u(i))throw new TypeError;return n=t,r=e,void a(i,s,!0).set(n,r);var n,r})),t("hasMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),o(t,e,i)})),t("hasOwnMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),l(t,e,i)})),t("getMetadata",(function(t,e,i){if(!u(e))throw new TypeError;return d(i)||(i=p(i)),h(t,e,i)}))}((e=t,function(t,i){"function"!=typeof e[t]&&Object.defineProperty(e,t,{configurable:!0,writable:!0,value:i})})),t}({});function V(){return function(t){return N.defineMetadata(z,null,t),t}}class W{constructor(t,e){this.key=t,this.value=e}toString(){return this.key===F?`named: ${String(this.value).toString()} `:`tagged: { key:${this.key.toString()}, value: ${String(this.value)} }`}}function G(t){return(e,i,s)=>{!function(t,e,i,s){!function(t,e,i,s){const n=[s];let r={};N.hasOwnMetadata(t,e)&&(r=N.getMetadata(t,e));let a=r[i];void 0===a&&(a=[]),a.push(...n),r[i]=a,N.defineMetadata(t,r,e)}(H,t,i.toString(),s)}(e,0,s,t)}}function U(t){return e=>(i,s,n)=>G(new W(t,e))(i,s,n)}const $=U(Y);function X(t){return G(new W(F,t))}const K=Symbol("ContributionProvider");class q{constructor(t,e){this.serviceIdentifier=t,this.container=e}getContributions(){return this.caches||(this.caches=[],this.container&&this.container.isBound(this.serviceIdentifier)&&this.caches.push(...this.container.getAll(this.serviceIdentifier))),this.caches}}function Z(t,e){t(K).toDynamicValue((({container:t})=>new q(e,t))).inSingletonScope().whenTargetNamed(e)}class J{constructor(t,e){this._args=t,this.name=e,this.taps=[]}tap(t,e){this._tap("sync",t,e)}unTap(t,e){const i="string"==typeof t?t.trim():t.name;i&&(this.taps=this.taps.filter((t=>!(t.name===i&&(!e||t.fn===e)))))}_parseOptions(t,e,i){let s;if("string"==typeof e)s={name:e.trim()};else if("object"!=typeof e||null===e)throw new Error("Invalid tap options");if("string"!=typeof s.name||""===s.name)throw new Error("Missing name for tap");return s=Object.assign({type:t,fn:i},s),s}_tap(t,e,i){this._insert(this._parseOptions(t,e,i))}_insert(t){let e;"string"==typeof t.before?e=new Set([t.before]):Array.isArray(t.before)&&(e=new Set(t.before));let i=0;"number"==typeof t.stage&&(i=t.stage);let s=this.taps.length;for(;s>0;){s--;const t=this.taps[s];this.taps[s+1]=t;const n=t.stage||0;if(e){if(e.has(t.name)){e.delete(t.name);continue}if(e.size>0)continue}if(!(n>i)){s++;break}}this.taps[s]=t}}class Q extends J{call(...t){this.taps.map((t=>t.fn)).forEach((e=>e(...t)))}}const tt=Symbol.for("EnvContribution"),et=Symbol.for("VGlobal");var it=function(t,e){return function(i,s){e(i,s,t)}};let st=class{get env(){return this._env}get devicePixelRatio(){return this._env||this.setEnv("browser"),this.envContribution.getDevicePixelRatio()}get supportEvent(){return this._env||this.setEnv("browser"),this.envContribution.supportEvent}set supportEvent(t){this._env||this.setEnv("browser"),this.envContribution.supportEvent=t}get supportsTouchEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents}set supportsTouchEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsTouchEvents=t}get supportsPointerEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents}set supportsPointerEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsPointerEvents=t}get supportsMouseEvents(){return this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents}set supportsMouseEvents(t){this._env||this.setEnv("browser"),this.envContribution.supportsMouseEvents=t}get applyStyles(){return this._env||this.setEnv("browser"),this.envContribution.applyStyles}set applyStyles(t){this._env||this.setEnv("browser"),this.envContribution.applyStyles=t}constructor(t){this.contributions=t,this.id=I.GenAutoIncrementId(),this.hooks={onSetEnv:new Q(["lastEnv","env","global"])},this.measureTextMethod="native",this.optimizeVisible=!1}bindContribution(t){const e=[];if(this.contributions.getContributions().forEach((i=>{const s=i.configure(this,t);s&&s.then&&e.push(s)})),e.length)return Promise.all(e)}getDynamicCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getDynamicCanvasCount()}getStaticCanvasCount(){return this._env||this.setEnv("browser"),this.envContribution.getStaticCanvasCount()}setEnv(t,e){if(e&&!0===e.force||this._env!==t)return this.deactiveCurrentEnv(),this.activeEnv(t,e)}deactiveCurrentEnv(){this.envContribution&&this.envContribution.release()}activeEnv(t,e){const i=this._env;this._env=t;const s=this.bindContribution(e);if(s&&s.then)return s.then((()=>{this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}));this.envParams=e,this.hooks.onSetEnv.call(i,t,this)}setActiveEnvContribution(t){this.envContribution=t}createCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createCanvas(t)}createOffscreenCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.createOffscreenCanvas(t)}releaseCanvas(t){return this._env||this.setEnv("browser"),this.envContribution.releaseCanvas(t)}addEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._env||this.setEnv("browser"),this.envContribution.removeEventListener(t,e,i)}dispatchEvent(t){return this._env||this.setEnv("browser"),this.envContribution.dispatchEvent(t)}getRequestAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getRequestAnimationFrame()}getCancelAnimationFrame(){return this._env||this.setEnv("browser"),this.envContribution.getCancelAnimationFrame()}getElementById(t){return this._env||this.setEnv("browser"),this.envContribution.getElementById?this.envContribution.getElementById(t):null}getRootElement(){return this._env||this.setEnv("browser"),this.envContribution.getRootElement?this.envContribution.getRootElement():null}getDocument(){return this._env||this.setEnv("browser"),this.envContribution.getDocument?this.envContribution.getDocument():null}mapToCanvasPoint(t,e){return this._env||this.setEnv("browser"),this.envContribution.mapToCanvasPoint?this.envContribution.mapToCanvasPoint(t,e):null}loadImage(t){return this._env||this.setEnv("browser"),this.envContribution.loadImage(t)}loadSvg(t){return this._env||this.setEnv("browser"),this.envContribution.loadSvg(t)}loadJson(t){return this._env||this.setEnv("browser"),this.envContribution.loadJson(t)}loadArrayBuffer(t){return this._env||this.setEnv("browser"),this.envContribution.loadArrayBuffer(t)}loadBlob(t){return this._env||this.setEnv("browser"),this.envContribution.loadBlob(t)}isChrome(){return null!=this._isChrome||(this._env||this.setEnv("browser"),this._isChrome="browser"===this._env&&navigator.userAgent.indexOf("Chrome")>-1),this._isChrome}isSafari(){return null!=this._isSafari||(this._env||this.setEnv("browser"),this._isSafari="browser"===this._env&&/Safari/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)),this._isSafari}getNativeAABBBounds(t){return this._env||this.setEnv("browser"),this.envContribution.getNativeAABBBounds(t)}removeDom(t){return this._env||this.setEnv("browser"),this.envContribution.removeDom(t)}createDom(t){return this._env||this.setEnv("browser"),this.envContribution.createDom(t)}updateDom(t,e){return this._env||this.setEnv("browser"),this.envContribution.updateDom(t,e)}getElementTop(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTop(t,e)}getElementLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementLeft(t,e)}getElementTopLeft(t,e=!1){return this._env||this.setEnv("browser"),this.envContribution.getElementTopLeft(t,e)}};st=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),it(0,$(K)),it(0,X(tt)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],st);const nt=1e-12,rt=Math.PI,at=rt/2,ot=2*rt,lt=2*Math.PI,ht=Math.abs,dt=Math.atan2,ct=Math.cos,ut=Math.max,pt=Math.min,gt=Math.sin,mt=Math.sqrt,_t=Math.pow;function ft(t){return t>=1?at:t<=-1?-at:Math.asin(t)}function vt(t,e,i,s,n){let r=i,a=s;return"number"==typeof t&&"number"==typeof i&&(r=(1-n)*t+n*i),"number"==typeof e&&"number"==typeof s&&(a=(1-n)*e+n*s),{x:r,y:a}}function yt(t,e){return t[0]*e[1]-t[1]*e[0]}function bt(t,e){let i=0;for(let s=0;s0?i:0}function Mt(t,e){return xt(t+e,10**Math.max(St(t),St(e)))}function kt(t,e){return xt(t-e,10**Math.max(St(t),St(e)))}function At(t){return t*(Math.PI/180)}function wt(t){return 180*t/Math.PI}function Tt(t,e,i){return e?{x:t.x+e*Math.cos(i),y:t.y+e*Math.sin(i)}:{x:t.x,y:t.y}}function Lt(t,e={x:0,y:0},i=0,s=2*Math.PI){const{x:n,y:r}=t,{x:a,y:o}=e;let l=n-a,h=r-o;const d=Math.sqrt(l*l+h*h);if(0===d)return{radius:0,angle:0};l/=d,h/=d;let c=Math.atan2(h,l);if(cs)for(;c>=s;)c-=2*Math.PI;return{radius:d,angle:c}}function Ct(t,e){return Math.atan2(e.y-t.y,e.x-t.x)}function Et(t){for(;t<0;)t+=2*Math.PI;for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function Dt(t){return(t=Et(t))>0&&t<=Math.PI/2?2:t>Math.PI/2&&t<=Math.PI?3:t>Math.PI&&t<=3*Math.PI/2?4:1}class Pt{constructor(t=1,e=0,i=0,s=1,n=0,r=0){this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r}equalToMatrix(t){return!(this.e!==t.e||this.f!==t.f||this.a!==t.a||this.d!==t.d||this.b!==t.b||this.c!==t.c)}equalTo(t,e,i,s,n,r){return!(this.e!==n||this.f!==r||this.a!==t||this.d!==s||this.b!==e||this.c!==i)}setValue(t,e,i,s,n,r){return this.a=t,this.b=e,this.c=i,this.d=s,this.e=n,this.f=r,this}reset(){return this.a=1,this.b=0,this.c=0,this.d=1,this.e=0,this.f=0,this}getInverse(){const t=this.a,e=this.b,i=this.c,s=this.d,n=this.e,r=this.f,a=new Pt,o=t*s-e*i;return a.a=s/o,a.b=-e/o,a.c=-i/o,a.d=t/o,a.e=(i*r-s*n)/o,a.f=-(t*r-e*n)/o,a}rotate(t){const e=Math.cos(t),i=Math.sin(t),s=this.a*e+this.c*i,n=this.b*e+this.d*i,r=this.a*-i+this.c*e,a=this.b*-i+this.d*e;return this.a=s,this.b=n,this.c=r,this.d=a,this}rotateByCenter(t,e,i){const s=Math.cos(t),n=Math.sin(t),r=(1-s)*e+n*i,a=(1-s)*i-n*e,o=s*this.a-n*this.b,l=n*this.a+s*this.b,h=s*this.c-n*this.d,d=n*this.c+s*this.d,c=s*this.e-n*this.f+r,u=n*this.e+s*this.f+a;return this.a=o,this.b=l,this.c=h,this.d=d,this.e=c,this.f=u,this}scale(t,e){return this.a*=t,this.b*=t,this.c*=e,this.d*=e,this}setScale(t,e){return this.b=this.b/this.a*t,this.c=this.c/this.d*e,this.a=t,this.d=e,this}transform(t,e,i,s,n,r){return this.multiply(t,e,i,s,n,r),this}translate(t,e){return this.e+=this.a*t+this.c*e,this.f+=this.b*t+this.d*e,this}transpose(){const{a:t,b:e,c:i,d:s,e:n,f:r}=this;return this.a=e,this.b=t,this.c=s,this.d=i,this.e=r,this.f=n,this}multiply(t,e,i,s,n,r){const a=this.a,o=this.b,l=this.c,h=this.d,d=a*t+l*e,c=o*t+h*e,u=a*i+l*s,p=o*i+h*s,g=a*n+l*r+this.e,m=o*n+h*r+this.f;return this.a=d,this.b=c,this.c=u,this.d=p,this.e=g,this.f=m,this}interpolate(t,e){const i=new Pt;return i.a=this.a+(t.a-this.a)*e,i.b=this.b+(t.b-this.b)*e,i.c=this.c+(t.c-this.c)*e,i.d=this.d+(t.d-this.d)*e,i.e=this.e+(t.e-this.e)*e,i.f=this.f+(t.f-this.f)*e,i}transformPoint(t,e){const{a:i,b:s,c:n,d:r,e:a,f:o}=this,l=i*r-s*n,h=r/l,d=-s/l,c=-n/l,u=i/l,p=(n*o-r*a)/l,g=-(i*o-s*a)/l,{x:m,y:_}=t;e.x=m*h+_*c+p,e.y=m*d+_*u+g}onlyTranslate(t=1){return this.a===t&&0===this.b&&0===this.c&&this.d===t}clone(){return new Pt(this.a,this.b,this.c,this.d,this.e,this.f)}toTransformAttrs(){const t=this.a,e=this.b,i=this.c,s=this.d,n=t*s-e*i,r={x:this.e,y:this.f,rotateDeg:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(0!==t||0!==e){const a=Math.sqrt(t*t+e*e);r.rotateDeg=e>0?Math.acos(t/a):-Math.acos(t/a),r.scaleX=a,r.scaleY=n/a,r.skewX=(t*i+e*s)/n,r.skewY=0}else if(0!==i||0!==s){const a=Math.sqrt(i*i+s*s);r.rotateDeg=Math.PI/2-(s>0?Math.acos(-i/a):-Math.acos(i/a)),r.scaleX=n/a,r.scaleY=a,r.skewX=0,r.skewY=(t*i+e*s)/n}return r.rotateDeg=wt(r.rotateDeg),r}}const Ot=ot-1e-8;class Rt{constructor(t){this.init(t)}init(t){this.bounds=t}arc(t,e,i,s,n,r){if(Math.abs(n-s)>Ot)return this.bounds.add(t-i,e-i),void this.bounds.add(t+i,e+i);let a,o,l,h,d=1/0,c=-1/0,u=1/0,p=-1/0;function g(t){l=i*Math.cos(t),h=i*Math.sin(t),lc&&(c=l),hp&&(p=h)}if(g(s),g(n),n!==s)if((s%=ot)<0&&(s+=ot),(n%=ot)<0&&(n+=ot),nn;++o,a-=at)g(a);else for(a=s-s%at+at,o=0;o<4&&a=l||n<=o||r>=d||a<=h?{x1:0,y1:0,x2:0,y2:0}:{x1:Math.max(s,o),y1:Math.max(r,h),x2:Math.min(n,l),y2:Math.min(a,d)}}var Yt;!function(t){t[t.NONE=0]="NONE",t[t.BBOX1=1]="BBOX1",t[t.BBOX2=2]="BBOX2"}(Yt||(Yt={}));const jt=(t,e,i)=>{let s=t.x1,n=t.x2,r=t.y1,a=t.y2,o=e.x1,l=e.x2,h=e.y1,d=e.y2;return i&&(s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),o>l&&([o,l]=[l,o]),h>d&&([h,d]=[d,h])),{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}};function Ht(t,e,i){if(!t||!e)return Yt.NONE;const{x11:s,x12:n,y11:r,y12:a,x21:o,x22:l,y21:h,y22:d}=jt(t,e,i);return s>o&&nh&&as&&lr&&de.x2||t.x2e.y2||t.y2l||nd||a=e.x1&&t.x<=e.x2&&t.y>=e.y1&&t.y<=e.y2;let s=e.x1,n=e.x2,r=e.y1,a=e.y2;return s>n&&([s,n]=[n,s]),r>a&&([r,a]=[a,r]),t.x>=s&&t.x<=n&&t.y>=r&&t.y<=a}function Vt(t,e){return Math.abs(e[0]*t[0]+e[1]*t[1])}function Wt({x:t,y:e},i,s={x:0,y:0}){return{x:(t-s.x)*Math.cos(i)-(e-s.y)*Math.sin(i)+s.x,y:(t-s.x)*Math.sin(i)+(e-s.y)*Math.cos(i)+s.y}}function Gt(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function Ut(t,e){const i=e?At(t.angle):t.angle,s=Gt(t);return[Wt({x:t.x1,y:t.y1},i,s),Wt({x:t.x2,y:t.y1},i,s),Wt({x:t.x2,y:t.y2},i,s),Wt({x:t.x1,y:t.y2},i,s)]}function $t(t,e,i=!1,s){const n=Ut(t,i),r=Ut(e,i),a=(t,e)=>[e.x-t.x,e.y-t.y];s&&(s.save(),s.fillStyle="red",s.globalAlpha=.6,n.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore(),s.save(),s.fillStyle="green",s.globalAlpha=.6,r.forEach(((t,e)=>{0===e?s.moveTo(t.x,t.y):s.lineTo(t.x,t.y)})),s.fill(),s.restore());const o=Gt(t),l=Gt(e);s&&s.fillRect(o.x,o.y,2,2),s&&s.fillRect(l.x,l.y,2,2);const h=a(o,l),d=a(n[0],n[1]),c=a(n[1],n[2]),u=a(r[0],r[1]),p=a(r[1],r[2]),g=i?At(t.angle):t.angle;let m=i?At(90-t.angle):t.angle+at;const _=i?At(e.angle):e.angle;let f=i?At(90-e.angle):e.angle+at;m>lt&&(m-=lt),f>lt&&(f-=lt);const v=(t,e,i,s)=>{const n=[Math.cos(e),Math.sin(e)];return t+(Vt(n,i)+Vt(n,s))/2>Vt(n,h)};return v((t.x2-t.x1)/2,g,u,p)&&v((t.y2-t.y1)/2,m,u,p)&&v((e.x2-e.x1)/2,_,d,c)&&v((e.y2-e.y1)/2,f,d,c)}function Xt(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=e;return i.onlyTranslate()?(t!==e&&t.setValue(e.x1,e.y1,e.x2,e.y2),t.translate(i.e,i.f),e):(t.clear(),t.add(i.a*s+i.c*n+i.e,i.b*s+i.d*n+i.f),t.add(i.a*r+i.c*n+i.e,i.b*r+i.d*n+i.f),t.add(i.a*r+i.c*a+i.e,i.b*r+i.d*a+i.f),t.add(i.a*s+i.c*a+i.e,i.b*s+i.d*a+i.f),e)}class Kt{constructor(t){t?this.setValue(t.x1,t.y1,t.x2,t.y2):this.clear()}clone(){return new Kt(this)}clear(){return this.x1=+Number.MAX_VALUE,this.y1=+Number.MAX_VALUE,this.x2=-Number.MAX_VALUE,this.y2=-Number.MAX_VALUE,this}empty(){return this.x1===+Number.MAX_VALUE&&this.y1===+Number.MAX_VALUE&&this.x2===-Number.MAX_VALUE&&this.y2===-Number.MAX_VALUE}equals(t){return this.x1===t.x1&&this.y1===t.y1&&this.x2===t.x2&&this.y2===t.y2}setValue(t=0,e=0,i=0,s=0){return this.x1=t,this.y1=e,this.x2=i,this.y2=s,this}set(t=0,e=0,i=0,s=0){return ithis.x2&&(this.x2=t),e>this.y2&&(this.y2=e),this}expand(t=0){return y(t)?(this.y1-=t[0],this.x2+=t[1],this.y2+=t[2],this.x1-=t[3]):(this.x1-=t,this.y1-=t,this.x2+=t,this.y2+=t),this}round(){return this.x1=Math.floor(this.x1),this.y1=Math.floor(this.y1),this.x2=Math.ceil(this.x2),this.y2=Math.ceil(this.y2),this}translate(t=0,e=0){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}rotate(t=0,e=0,i=0){const s=this.rotatedPoints(t,e,i);return this.clear().add(s[0],s[1]).add(s[2],s[3]).add(s[4],s[5]).add(s[6],s[7])}scale(t=0,e=0,i=0,s=0){const n=this.scalePoints(t,e,i,s);return this.clear().add(n[0],n[1]).add(n[2],n[3])}union(t){return t.x1this.x2&&(this.x2=t.x2),t.y2>this.y2&&(this.y2=t.y2),this}intersect(t){return t.x1>this.x1&&(this.x1=t.x1),t.y1>this.y1&&(this.y1=t.y1),t.x2=t.x2&&this.y1<=t.y1&&this.y2>=t.y2}alignsWith(t){return t&&(this.x1===t.x1||this.x2===t.x2||this.y1===t.y1||this.y2===t.y2)}intersects(t){return t&&!(this.x2t.x2||this.y2t.y2)}contains(t=0,e=0){return!(tthis.x2||ethis.y2)}containsPoint(t){return!(t.xthis.x2||t.ythis.y2)}width(){return this.empty()?0:this.x2-this.x1}height(){return this.empty()?0:this.y2-this.y1}scaleX(t=0){return this.x1*=t,this.x2*=t,this}scaleY(t=0){return this.y1*=t,this.y2*=t,this}transformWithMatrix(t){return Xt(this,this,t),this}copy(t){return this.x1=t.x1,this.y1=t.y1,this.x2=t.x2,this.y2=t.y2,this}rotatedPoints(t,e,i){const{x1:s,y1:n,x2:r,y2:a}=this,o=Math.cos(t),l=Math.sin(t),h=e-e*o+i*l,d=i-e*l-i*o;return[o*s-l*n+h,l*s+o*n+d,o*s-l*a+h,l*s+o*a+d,o*r-l*n+h,l*r+o*n+d,o*r-l*a+h,l*r+o*a+d]}scalePoints(t,e,i,s){const{x1:n,y1:r,x2:a,y2:o}=this;return[t*n+(1-t)*i,e*r+(1-e)*s,t*a+(1-t)*i,e*o+(1-e)*s]}}class qt extends Kt{}class Zt{constructor(){this.curves=[],this.bounds=new qt}getCurveLengths(){return this.curves.map((t=>t.getLength()))}getPointAt(t){return{x:0,y:0}}getLength(){return 0}getBounds(){return this.bounds}}const Jt=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:[eE][-+]?\d+)?)/gi,Qt={m:2,l:2,h:1,v:1,c:6,s:4,q:4,t:2,a:7,M:2,L:2,H:1,V:1,C:6,S:4,Q:4,T:2,A:7};let te,ee,ie,se,ne,re;var ae,oe,le,he,de,ce,ue,pe,ge;function me(t){const e=t[0],i=t[1],s=t[2],n=t[3],r=t[4],a=t[5],o=t[6],l=t[7],h=l*r,d=-o*a,c=o*r,u=l*a,p=Math.cos(s),g=Math.sin(s),m=Math.cos(n),_=Math.sin(n),f=.5*(n-s),v=Math.sin(.5*f),y=8/3*v*v/Math.sin(f),b=e+p-y*g,x=i+g+y*p,S=e+m,M=i+_,k=S+y*_,A=M-y*m;return[h*b+d*x,c*b+u*x,h*k+d*A,c*k+u*A,h*S+d*M,c*S+u*M]}function _e(t,e,i,s){const n=function(t,e,i,s,n,r,a,o,l){const h=At(a),d=Math.sin(h),c=Math.cos(h),u=c*(o-t)*.5+d*(l-e)*.5,p=c*(l-e)*.5-d*(o-t)*.5;let g=u*u/((i=Math.abs(i))*i)+p*p/((s=Math.abs(s))*s);g>1&&(g=Math.sqrt(g),i*=g,s*=g);const m=c/i,_=d/i,f=-d/s,v=c/s,y=m*o+_*l,b=f*o+v*l,x=m*t+_*e,S=f*t+v*e;let M=1/((x-y)*(x-y)+(S-b)*(S-b))-.25;M<0&&(M=0);let k=Math.sqrt(M);r===n&&(k=-k);const A=.5*(y+x)-k*(S-b),w=.5*(b+S)+k*(x-y),T=Math.atan2(b-w,y-A);let L=Math.atan2(S-w,x-A)-T;L<0&&1===r?L+=ot:L>0&&0===r&&(L-=ot);const C=Math.ceil(Math.abs(L/(at+.001))),E=[];for(let t=0;te.arc(t[1]*n+i,t[2]*r+s,t[3]*(n+r)/2,t[4],t[5],t[6],a),(t,e,i,s,n,r,a)=>e.arcTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*(n+r)/2,a),(t,e,i,s,n,r,a)=>e.bezierCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,t[5]*n+i,t[6]*r+s,a),(t,e,i,s)=>e.closePath(),(t,e,i,s,n,r)=>e.ellipse(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,t[5],t[6],t[7],t[8]),(t,e,i,s,n,r,a)=>e.lineTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.moveTo(t[1]*n+i,t[2]*r+s,a),(t,e,i,s,n,r,a)=>e.quadraticCurveTo(t[1]*n+i,t[2]*r+s,t[3]*n+i,t[4]*r+s,a),(t,e,i,s,n,r,a)=>e.rect(t[1]*n+i,t[2]*r+s,t[3]*n,t[4]*r,a)];function ve(t,e,i=0,s=0,n=1,r=1,a){for(let o=0;ot+e.getLength()),0)),this.length}}class Ce extends Le{bezierCurveTo(t,e,i,s,n,r,a,o){return super.bezierCurveTo(e,t,s,i,r,n,a,o)}lineTo(t,e,i,s){return super.lineTo(e,t,i,s)}moveTo(t,e,i){return super.moveTo(e,t,i)}clear(){return super.clear()}}function Ee(t,e,i=1){let s=!1;for(let i=0,n=e.length;i<=n;i++)i>=n===s&&((s=!s)?t.lineStart():t.lineEnd()),s&&t.point(e[i])}function De(t,e,i){const s=null!=e?e:ht(i[i.length-1].x-i[0].x)>ht(i[i.length-1].y-i[0].y)?ue.ROW:ue.COLUMN;return"monotoneY"===t?new Ce(t,s):new Le(t,s)}class Pe{constructor(t,e){this.context=t,e&&(this.startPoint=e)}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t)}this._lastDefined=t.defined}tryUpdateLength(){return this.context.tryUpdateLength()}}function Oe(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=De("linear",i,t);return function(t,e){Ee(t,e,1)}(new Pe(n,s),t),n}function Re(t,e,i,s,n){t.context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+i)/6,s,t.lastPoint1)}class Ie{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){2===this._point&&Re(this,6*this._x1-(this._x0+4*this._x1),6*this._y1-(this._y0+4*this._y1),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;break;default:Re(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Be(t){return t<0?-1:1}function Fe(t,e,i){const s=t._x1-t._x0,n=e-t._x1,r=(t._y1-t._y0)/(s||Number(n<0&&-0)),a=(i-t._y1)/(n||Number(s<0&&-0)),o=(r*n+a*s)/(s+n);return(Be(r)+Be(a))*Math.min(Math.abs(r),Math.abs(a),.5*Math.abs(o))||0}function Ye(t,e){const i=t._x1-t._x0;return i?(3*(t._y1-t._y0)/i-e)/2:e}function je(t,e,i,s,n){const r=t._x0,a=t._y0,o=t._x1,l=t._y1,h=(o-r)/3;t.context.bezierCurveTo(r+h,a+h*e,o-h,l-h*i,o,l,s,t.lastPoint1)}class He{constructor(t,e){this.context=t,this.startPoint=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x1,this._y1,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:je(this,this._t0,Ye(this,this._t0),!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1)}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){let e=NaN;const i=t.x,s=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(i,s,!1!==this._lastDefined1&&!1!==this._lastDefined2,t):this.context.moveTo(i,s,t);break;case 1:this._point=2;break;case 2:this._point=3,je(this,Ye(this,e=Fe(this,i,s)),e,!1!==this._lastDefined1&&!1!==this._lastDefined2);break;default:je(this,this._t0,e=Fe(this,i,s),!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._x0=this._x1,this._x1=i,this._y0=this._y1,this._y1=s,this._t0=e,this._lastDefined1=this._lastDefined2,this._lastDefined2=!1!==t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}class ze extends He{constructor(t,e){super(t,e)}point(t){return super.point({y:t.x,x:t.y,defined:t.defined})}}class Ne{constructor(t,e=.5,i){this.context=t,this._t=e,this.startPoint=i}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x=this._y=NaN,this._point=0,this.startPoint&&this.point(this.startPoint)}lineEnd(){0=0&&(this._t=1-this._t,this._line=1-this._line)}point(t){const e=t.x,i=t.y;switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t):this.context.moveTo(e,i,t);break;case 1:this._point=2;default:if(this._t<=0)this.context.lineTo(this._x,i,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(e,i,!1!==this._lastDefined&&!1!==t.defined,t);else{const s=this._x*(1-this._t)+e*this._t;this.context.lineTo(s,this._y,!1!==this._lastDefined&&!1!==t.defined,this.lastPoint),this.context.lineTo(s,i,!1!==this._lastDefined&&!1!==t.defined,t)}}this._lastDefined=t.defined,this._x=e,this._y=i,this.lastPoint=t}tryUpdateLength(){return this.context.tryUpdateLength()}}function Ve(t,e,i={}){const{direction:s,startPoint:n}=i;if(t.length<2-Number(!!n))return null;const r=new Le("step",null!=s?s:ht(t[t.length-1].x-t[0].x)>ht(t[t.length-1].y-t[0].y)?ue.ROW:ue.COLUMN);return function(t,e){Ee(t,e,1)}(new Ne(r,e,n),t),r}class We extends Pe{lineEnd(){this.context.closePath()}}function Ge(t,e,i,s,n){let r=t._x1,a=t._y1,o=t._x2,l=t._y2;if(t._l01_a>nt){const e=2*t._l01_2a+3*t._l01_a*t._l12_a+t._l12_2a,i=3*t._l01_a*(t._l01_a+t._l12_a);r=(r*e-t._x0*t._l12_2a+t._x2*t._l01_2a)/i,a=(a*e-t._y0*t._l12_2a+t._y2*t._l01_2a)/i}if(t._l23_a>nt){const s=2*t._l23_2a+3*t._l23_a*t._l12_a+t._l12_2a,n=3*t._l23_a*(t._l23_a+t._l12_a);o=(o*s+t._x1*t._l23_2a-e*t._l12_2a)/n,l=(l*s+t._y1*t._l23_2a-i*t._l12_2a)/n}t.context.bezierCurveTo(r,a,o,l,t._x2,t._y2,s,t.lastPoint1)}function Ue(t,e){return function(i,s,n={}){const{direction:r,startPoint:a}=n;if(i.length<2-Number(!!a))return null;if(i.length<3-Number(!!a))return Oe(i,n);const o=De(t,r,i);return Ee(new e(o,s,a),i,2),o}}const $e=Ue("catmullRom",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._y0=this._y1=this._y2=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 2:this.context.lineTo(this._x2,this._y2,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1);break;case 3:this.point({x:this._x2,y:this._y2})}(this._line||0!==this._line&&1===this._point)&&this.context.closePath(),this._line=1-this._line}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._line?this.context.lineTo(e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2):this.context.moveTo(e,i);break;case 1:this._point=2;break;case 2:this._point=3;default:Ge(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}}),Xe=Ue("catmullRomClosed",class{constructor(t,e=.5,i){this.context=t,this.startPoint=i,this._alpha=e}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._x0=this._x1=this._x2=this._x3=this._x4=this._x5=this._y0=this._y1=this._y2=this._y3=this._y4=this._y5=NaN,this._l01_a=this._l12_a=this._l23_a=this._l01_2a=this._l12_2a=this._l23_2a=this._point=0}lineEnd(){switch(this._point){case 1:this.context.moveTo(this._x3,this._y3,this.lastPoint1),this.context.closePath();break;case 2:this.context.lineTo(this._x3,this._y3,!1!==this._lastDefined1&&!1!==this._lastDefined2,this.lastPoint1),this.context.closePath();break;case 3:this.point({x:this._x3,y:this._y3}),this.point({x:this._x4,y:this._y4}),this.point({x:this._x5,y:this._y5})}}point(t){const{x:e,y:i}=t;if(this._point){const t=this._x2-e,s=this._y2-i;this._l23_a=Math.sqrt(this._l23_2a=Math.pow(t*t+s*s,this._alpha))}switch(this._point){case 0:this._point=1,this._x3=e,this._y3=i;break;case 1:this._point=2,this.context.moveTo(this._x4=e,this._y4=i,t);break;case 2:this._point=3,this._x5=e,this._y5=i;break;default:Ge(this,e,i,!1!==this._lastDefined1&&!1!==this._lastDefined2)}this._l01_a=this._l12_a,this._l12_a=this._l23_a,this._l01_2a=this._l12_2a,this._l12_2a=this._l23_2a,this._x0=this._x1,this._x1=this._x2,this._x2=e,this._y0=this._y1,this._y1=this._y2,this._y2=i,this._lastDefined1=this._lastDefined2,this._lastDefined2=t.defined,this.lastPoint0=this.lastPoint1,this.lastPoint1=t}tryUpdateLength(){return this.context.tryUpdateLength()}});function Ke(t,e,i){var s,n;switch(e){case"linear":default:return Oe(t,i);case"basis":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Oe(t,e);const n=De("basis",i,t);return function(t,e){Ee(t,e,2)}(new Ie(n,s),t),n}(t,i);case"monotoneX":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Oe(t,e);const n=De("monotoneX",i,t);return function(t,e){Ee(t,e,2)}(new He(n,s),t),n}(t,i);case"monotoneY":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;if(t.length<3-Number(!!s))return Oe(t,e);const n=De("monotoneY",i,t);return function(t,e){Ee(t,e,2)}(new ze(n,s),t),n}(t,i);case"step":return Ve(t,.5,i);case"stepBefore":return Ve(t,0,i);case"stepAfter":return Ve(t,1,i);case"catmullRom":return $e(t,null!==(s=null==i?void 0:i.curveTension)&&void 0!==s?s:.5,i);case"catmullRomClosed":return Xe(t,null!==(n=null==i?void 0:i.curveTension)&&void 0!==n?n:.5,i);case"linearClosed":return function(t,e={}){const{direction:i,startPoint:s}=e;if(t.length<2-Number(!!s))return null;const n=De("linear",i,t);return function(t,e){Ee(t,e,1)}(new We(n,s),t),n}(t,i)}}class qe extends Zt{constructor(t){super(),this.commandList=[],t&&(this._ctx=t),this._boundsContext=new Rt(this.bounds)}setCtx(t){this._ctx=t}moveTo(t,e){return this.commandList.push([6,t,e]),this._ctx&&this._ctx.moveTo(t,e),this}lineTo(t,e){return this.commandList.push([5,t,e]),this._ctx&&this._ctx.lineTo(t,e),this}quadraticCurveTo(t,e,i,s){return this.commandList.push([7,t,e,i,s]),this._ctx&&this._ctx.quadraticCurveTo(t,e,i,s),this}bezierCurveTo(t,e,i,s,n,r){return this.commandList.push([2,t,e,i,s,n,r]),this._ctx&&this._ctx.bezierCurveTo(t,e,i,s,n,r),this}arcTo(t,e,i,s,n){return this.commandList.push([1,t,e,i,s,n]),this._ctx&&this._ctx.arcTo(t,e,i,s,n),this}ellipse(t,e,i,s,n,r,a,o){return this.commandList.push([4,t,e,i,s,n,r,a,o]),this._ctx&&this._ctx.ellipse(t,e,i,s,n,r,a,o),this}rect(t,e,i,s){return this.commandList.push([8,t,e,i,s]),this._ctx&&this._ctx.rect(t,e,i,s),this}arc(t,e,i,s,n,r){return this.commandList.push([0,t,e,i,s,n,r]),this._ctx&&this._ctx.arc(t,e,i,s,n,r),this}closePath(){return this.commandList.push([3]),this._ctx&&this._ctx.closePath(),this}addCurve(t){this.curves.push(t)}clear(){this.transformCbList=null,this.commandList.length=0,this.curves.length=0}beginPath(){this.clear()}toString(){if(!this.toStringCbList){const t=[];t[6]=t=>`M${t[1]} ${t[2]}`,t[5]=t=>`L${t[1]} ${t[2]}`,t[7]=t=>`Q${t[1]} ${t[2]} ${t[3]} ${t[4]}`,t[2]=t=>`C${t[1]} ${t[2]} ${t[3]} ${t[4]} ${t[5]} ${t[6]}`,t[0]=t=>{const e=[];((t,e,i,s,n,r,a)=>{const o=Math.abs(i-e),l=o>.5*Math.PI?Math.ceil(2*o/Math.PI):1,h=(i-e)/l;for(let i=0;i`M${t[1]} ${t[2]} h${t[3]} v${t[4]} H${t[1]}Z`,t[3]=t=>"Z",this.toStringCbList=t}const t=this.toStringCbList;let e="";return this.commandList.forEach((i=>{e+=t[i[0]](i)})),e}fromString(t,e,i,s,n){this.clear();const r=function(t){if(!t)return[];const e=t.match(/[mzlhvcsqta][^mzlhvcsqta]*/gi);if(null===e)return[];let i,s;const n=[];for(let t=0,r=e.length;tre){let t;for(let e=1,s=i.length;e{this.transformCbList[n[0]](n,t,e,i,s)})),this._updateBounds()}moveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}lineToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i}quadraticCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i}bezierCurveToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*s+e,t[6]=t[6]*n+i}arcToTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s+e,t[4]=t[4]*n+i,t[5]=t[5]*(s+n)/2}ellipseTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}rectTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*s,t[4]=t[4]*n}arcTransform(t,e,i,s,n){t[1]=t[1]*s+e,t[2]=t[2]*n+i,t[3]=t[3]*(s+n)/2}closePathTransform(){}_runCommandStrList(t,e=0,i=0,s=1,n=1){let r,a,o,l,h,d=null,c=0,u=0,p=0,g=0;for(let m=0,_=t.length;m<_;++m){switch(r=t[m],1===s&&1===n||(r=Je(r,s,n)),r[0]){case"l":c+=r[1],u+=r[2],this.lineTo(c+e,u+i);break;case"L":c=r[1],u=r[2],this.lineTo(c+e,u+i);break;case"h":c+=r[1],this.lineTo(c+e,u+i);break;case"H":c=r[1],this.lineTo(c+e,u+i);break;case"v":u+=r[1],this.lineTo(c+e,u+i);break;case"V":u=r[1],this.lineTo(c+e,u+i);break;case"m":c+=r[1],u+=r[2],this.moveTo(c+e,u+i);break;case"M":c=r[1],u=r[2],this.moveTo(c+e,u+i);break;case"c":a=c+r[5],o=u+r[6],p=c+r[3],g=u+r[4],this.bezierCurveTo(c+r[1]+e,u+r[2]+i,p+e,g+i,a+e,o+i),c=a,u=o;break;case"C":c=r[5],u=r[6],p=r[3],g=r[4],this.bezierCurveTo(r[1]+e,r[2]+i,p+e,g+i,c+e,u+i);break;case"s":a=c+r[3],o=u+r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,c+r[1]+e,u+r[2]+i,a+e,o+i),p=c+r[1],g=u+r[2],c=a,u=o;break;case"S":a=r[3],o=r[4],p=2*c-p,g=2*u-g,this.bezierCurveTo(p+e,g+i,r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"q":a=c+r[3],o=u+r[4],p=c+r[1],g=u+r[2],this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"Q":a=r[3],o=r[4],this.quadraticCurveTo(r[1]+e,r[2]+i,a+e,o+i),c=a,u=o,p=r[1],g=r[2];break;case"t":a=c+r[1],o=u+r[2],null===d[0].match(/[QqTt]/)?(p=c,g=u):"t"===d[0]?(p=2*c-l,g=2*u-h):"q"===d[0]&&(p=2*c-p,g=2*u-g),l=p,h=g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o,p=c+r[1],g=u+r[2];break;case"T":a=r[1],o=r[2],p=2*c-p,g=2*u-g,this.quadraticCurveTo(p+e,g+i,a+e,o+i),c=a,u=o;break;case"a":_e(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+c+e,r[7]+u+i]),c+=r[6],u+=r[7];break;case"A":_e(this,c+e,u+i,[r[1],r[2],r[3],r[4],r[5],r[6]+e,r[7]+i]),c=r[6],u=r[7];break;case"z":case"Z":this.closePath()}d=r}}_runCommandList(t,e=0,i=0,s=1,n=1){if(0!==e||0!==i||1!==s||1!==n)for(let r=0,a=t.length;rt.slice()))}_updateBounds(){this.bounds.clear(),ve(this.commandList,this._boundsContext)}release(){this.commandList=[],this._boundsContext=null,this._ctx=null}getLength(){if(this.direction===ue.COLUMN){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(t.p0.y-e.p1.y)}if(this.direction===ue.ROW){if(!this.curves.length)return 0;const t=this.curves[0],e=this.curves[this.curves.length-1];return ht(t.p0.x-e.p1.x)}return this.curves.reduce(((t,e)=>t+e.getLength()),0)}getAttrAt(t){if(!this.curves)return{pos:{x:0,y:0},angle:0};let e,i=0;for(let s=0;s=t)break;i+=n}const s=(t-i)/e.getLength(this.direction);return{pos:e.getPointAt(s),angle:e.getAngleAt(s)}}}const Ze=["l",0,0,0,0,0,0,0];function Je(t,e,i){const s=Ze[0]=t[0];if("a"===s||"A"===s)Ze[1]=e*t[1],Ze[2]=i*t[2],Ze[3]=t[3],Ze[4]=t[4],Ze[5]=t[5],Ze[6]=e*t[6],Ze[7]=i*t[7];else if("h"===s||"H"===s)Ze[1]=e*t[1];else if("v"===s||"V"===s)Ze[1]=i*t[1];else for(let s=1,n=t.length;s{g.getInstance().warn("空函数")}}),gi=Object.assign(Object.assign({},ai),{points:[],cornerRadius:0,closePath:!0}),mi=Object.assign(Object.assign({},ai),{width:0,height:0,x1:0,y1:0,strokeBoundsBuffer:0,cornerRadius:0}),_i=(Object.assign(Object.assign({},ai),{width:0,height:0,x1:0,y1:0,cornerRadius:0,length:0}),Object.assign(Object.assign({},ai),{symbolType:"circle",size:10,keepDirIn3d:!0})),fi=Object.assign(Object.assign(Object.assign({},ai),si),{strokeBoundsBuffer:0,keepDirIn3d:!0}),vi=Object.assign(Object.assign(Object.assign({},ai),si),{editable:!1,width:300,height:300,ellipsis:!0,wordBreak:"break-word",verticalDirection:"top",textAlign:"left",textBaseline:"top",layoutDirection:"horizontal",textConfig:[],disableAutoWrapLine:!1,maxHeight:void 0,maxWidth:void 0,singleLine:!1}),yi=Object.assign(Object.assign({repeatX:"no-repeat",repeatY:"no-repeat",image:"",width:0,height:0},ai),{fill:!0,cornerRadius:0}),bi=Object.assign(Object.assign({},yi),{backgroundShowMode:"never",backgroundWidth:0,backgroundHeight:0,textAlign:"left",textBaseline:"middle",direction:"horizontal",margin:0,id:"",width:20,height:20,backgroundFill:"rgba(101, 117, 168, 0.1)",backgroundFillOpacity:1,backgroundStroke:!1,backgroundStrokeOpacity:1,backgroundRadius:4,opacity:1}),xi=new class{},Si={horizontal:{width:"width",height:"height",left:"left",top:"top",x:"x",y:"y",bottom:"bottom"},vertical:{width:"height",height:"width",left:"top",top:"left",x:"y",y:"x",bottom:"right"}},Mi=(String.fromCharCode(160),/\w|\(|\)|-/),ki=/[.?!,;:/,。?!、;:]/,Ai=/\S/,wi=(t,e)=>{let i=e.fontSize||16;switch(e.script){case"super":case"sub":i*=.8}t.setTextStyle({textAlign:"left",textBaseline:e.textBaseline||"alphabetic",fontStyle:e.fontStyle||"",fontWeight:e.fontWeight||"",fontSize:i,fontFamily:e.fontFamily||"sans-serif"})};function Ti(t,e,i,s,n){if(!e||e<=0)return 0;const r=xi.graphicUtil.textMeasure;let a=s,o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(r.measureText(h,i).width);for(;l>e||d<=e;){if(l>e?a--:a++,a>t.length){a=t.length;break}if(a<0){a=0;break}o=t.slice(0,a),l=Math.floor(r.measureText(o,i).width),h=t.slice(0,a+1),d=Math.floor(r.measureText(h,i).width)}return n&&(a=Li(t,a)),a}function Li(t,e){let i=e;for(;Mi.test(t[i-1])&&Mi.test(t[i])||ki.test(t[i]);)if(i--,i<=0)return e;return i}function Ci(t,e){const i=xi.graphicUtil.textMeasure.measureText(t,e),s={ascent:0,height:0,descent:0,width:0};return"number"!=typeof i.actualBoundingBoxAscent||"number"!=typeof i.actualBoundingBoxDescent?(s.width=Math.floor(i.width),s.height=e.fontSize||0,s.ascent=s.height,s.descent=0):(s.width=Math.floor(i.width),s.height=Math.floor(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent),s.ascent=Math.floor(i.actualBoundingBoxAscent),s.descent=s.height-s.ascent),s}let Ei=class{configure(t,e){this.canvas=t.canvas,this.context=t.context,t.bindTextMeasure(this)}measureTextWidth(t,e){return this.context?(this.context.setTextStyleWithoutAlignBaseline(e),this.context.measureText(t).width):this.estimate(t,e).width}estimate(t,{fontSize:e=fi.fontSize}){let i=0,s=0;for(let e=0;e{t.width=0===t.direction?n:this.measureTextWidth(t.text,e)}));const r=[];let a=0,o=0;for(;o1){const n=this._clipText(t[o].text,e,i-a,0,t[o].text.length-1,"end",!1);if(s&&n.str!==t[o].text){let i="",s=0;for(let e=0;ei)return{str:"",width:0};const r=this._clipText(t,e,i,0,t.length-1,"end",!1);if(s&&r.str!==t){const i=Li(t,r.str.length);i!==r.str.length&&(r.str=t.substring(0,i),r.width=this.measureTextWidth(r.str,e))}return r}_clipText(t,e,i,s,n,r,a){let o;if("start"===r)o=this._clipTextStart(t,e,i,s,n),a&&(o.result=a+o.str);else if("middle"===r){const s=this._clipTextMiddle(t,e,i,"","",0,0,1);o={str:"none",width:s.width,result:s.left+a+s.right}}else o=this._clipTextEnd(t,e,i,s,n),a&&(o.result=o.str+a);return o}_clipTextEnd(t,e,i,s,n){const r=Math.floor((s+n)/2),a=t.substring(0,r+1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const n=t.substring(0,r);return l=this.measureTextWidth(n,e),l<=i?{str:n,width:l}:this._clipTextEnd(t,e,i,s,r)}if(o=t.length-1)return{str:t,width:this.measureTextWidth(t,e)};const s=t.substring(0,r+2);return l=this.measureTextWidth(s,e),l>=i?{str:a,width:o}:this._clipTextEnd(t,e,i,r,n)}return{str:a,width:o}}_clipTextStart(t,e,i,s,n){const r=Math.ceil((s+n)/2),a=t.substring(r-1,t.length-1),o=this.measureTextWidth(a,e);let l;if(o>i){if(a.length<=1)return{str:"",width:0};const s=t.substring(r,t.length-1);return l=this.measureTextWidth(s,e),l<=i?{str:s,width:l}:this._clipTextStart(t,e,i,r,t.length-1)}if(o=i?{str:a,width:o}:this._clipTextStart(t,e,i,s,r)}return{str:a,width:o}}_clipTextMiddle(t,e,i,s,n,r,a,o){const l=t.substring(0,o),h=this.measureTextWidth(l,e);if(h+a>i)return{left:s,right:n,width:r+a};const d=t.substring(t.length-o,t.length),c=this.measureTextWidth(d,e);return h+c>i?{left:l,right:n,width:h+a}:this._clipTextMiddle(t,e,i,l,d,h,c,o+1)}clipTextWithSuffixVertical(t,e,i,s,n,r){if(""===s)return this.clipTextVertical(t,e,i,n);if(0===t.length)return{verticalList:t,width:0};const a=this.clipTextVertical(t,e,i,n);if(a.verticalList.length===t.length&&a.verticalList[a.verticalList.length-1].width===t[t.length-1].width)return a;const o=this.measureTextWidth(s,e);if(o>i)return a;let l;if(i-=o,"start"===r){const r=this.revertVerticalList(t);l=this.clipTextVertical(r,e,i,n);const a=this.revertVerticalList(l.verticalList);a.unshift({text:s,direction:1,width:o}),l.verticalList=a}else if("middle"===r){const r=this.clipTextVertical(t,e,i/2,n),a=this.revertVerticalList(t),h=this.clipTextVertical(a,e,i/2,n);r.verticalList.push({text:s,direction:1,width:o}),this.revertVerticalList(h.verticalList).forEach((t=>r.verticalList.push(t))),l={verticalList:r.verticalList,width:r.width+h.width}}else l=this.clipTextVertical(t,e,i,n),l.verticalList.push({text:s,direction:1,width:o});return l.width+=o,l}revertVerticalList(t){return t.reverse().map((t=>{const e=t.text.split("").reverse().join("");return Object.assign(Object.assign({},t),{text:e})}))}clipTextWithSuffix(t,e,i,s,n,r,a=!1){if(""===s)return this.clipText(t,e,i,n);if(0===t.length)return{str:"",width:0};const o=this.measureTextWidth(t,e);if(!a&&o<=i)return{str:t,width:o};const l=this.measureTextWidth(s,e);if(l>i)return{str:"",width:0};if(a&&o+l<=i)return{str:t+s,width:o+l};i-=l;const h=this._clipText(t,e,i,0,t.length-1,r,s);if(n&&h.str!==t){const i=Li(t,h.str.length);i!==h.str.length&&(h.result=t.substring(0,i),h.width=this.measureTextWidth(h.str,e))}else a&&h.str===t&&(h.result=t+s);return h.str=h.result,h.width+=l,h}};Ei=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Ei);const Di=Symbol.for("TextMeasureContribution");let Pi=class extends Ei{};Pi=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Pi);const Oi=t=>{let e=t.charCodeAt(0),i=2===t.length?t.charCodeAt(1):0,s=e;return 55296<=e&&e<=56319&&56320<=i&&i<=57343&&(e&=1023,i&=1023,s=e<<10|i,s+=65536),12288===s||65281<=s&&s<=65376||65504<=s&&s<=65510?"F":8361===s||65377<=s&&s<=65470||65474<=s&&s<=65479||65482<=s&&s<=65487||65490<=s&&s<=65495||65498<=s&&s<=65500||65512<=s&&s<=65518?"H":4352<=s&&s<=4447||4515<=s&&s<=4519||4602<=s&&s<=4607||9001<=s&&s<=9002||11904<=s&&s<=11929||11931<=s&&s<=12019||12032<=s&&s<=12245||12272<=s&&s<=12283||12289<=s&&s<=12350||12353<=s&&s<=12438||12441<=s&&s<=12543||12549<=s&&s<=12589||12593<=s&&s<=12686||12688<=s&&s<=12730||12736<=s&&s<=12771||12784<=s&&s<=12830||12832<=s&&s<=12871||12880<=s&&s<=13054||13056<=s&&s<=19903||19968<=s&&s<=42124||42128<=s&&s<=42182||43360<=s&&s<=43388||44032<=s&&s<=55203||55216<=s&&s<=55238||55243<=s&&s<=55291||63744<=s&&s<=64255||65040<=s&&s<=65049||65072<=s&&s<=65106||65108<=s&&s<=65126||65128<=s&&s<=65131||110592<=s&&s<=110593||127488<=s&&s<=127490||127504<=s&&s<=127546||127552<=s&&s<=127560||127568<=s&&s<=127569||131072<=s&&s<=194367||177984<=s&&s<=196605||196608<=s&&s<=262141?"W":32<=s&&s<=126||162<=s&&s<=163||165<=s&&s<=166||172===s||175===s||10214<=s&&s<=10221||10629<=s&&s<=10630?"Na":161===s||164===s||167<=s&&s<=168||170===s||173<=s&&s<=174||176<=s&&s<=180||182<=s&&s<=186||188<=s&&s<=191||198===s||208===s||215<=s&&s<=216||222<=s&&s<=225||230===s||232<=s&&s<=234||236<=s&&s<=237||240===s||242<=s&&s<=243||247<=s&&s<=250||252===s||254===s||257===s||273===s||275===s||283===s||294<=s&&s<=295||299===s||305<=s&&s<=307||312===s||319<=s&&s<=322||324===s||328<=s&&s<=331||333===s||338<=s&&s<=339||358<=s&&s<=359||363===s||462===s||464===s||466===s||468===s||470===s||472===s||474===s||476===s||593===s||609===s||708===s||711===s||713<=s&&s<=715||717===s||720===s||728<=s&&s<=731||733===s||735===s||768<=s&&s<=879||913<=s&&s<=929||931<=s&&s<=937||945<=s&&s<=961||963<=s&&s<=969||1025===s||1040<=s&&s<=1103||1105===s||8208===s||8211<=s&&s<=8214||8216<=s&&s<=8217||8220<=s&&s<=8221||8224<=s&&s<=8226||8228<=s&&s<=8231||8240===s||8242<=s&&s<=8243||8245===s||8251===s||8254===s||8308===s||8319===s||8321<=s&&s<=8324||8364===s||8451===s||8453===s||8457===s||8467===s||8470===s||8481<=s&&s<=8482||8486===s||8491===s||8531<=s&&s<=8532||8539<=s&&s<=8542||8544<=s&&s<=8555||8560<=s&&s<=8569||8585===s||8592<=s&&s<=8601||8632<=s&&s<=8633||8658===s||8660===s||8679===s||8704===s||8706<=s&&s<=8707||8711<=s&&s<=8712||8715===s||8719===s||8721===s||8725===s||8730===s||8733<=s&&s<=8736||8739===s||8741===s||8743<=s&&s<=8748||8750===s||8756<=s&&s<=8759||8764<=s&&s<=8765||8776===s||8780===s||8786===s||8800<=s&&s<=8801||8804<=s&&s<=8807||8810<=s&&s<=8811||8814<=s&&s<=8815||8834<=s&&s<=8835||8838<=s&&s<=8839||8853===s||8857===s||8869===s||8895===s||8978===s||9312<=s&&s<=9449||9451<=s&&s<=9547||9552<=s&&s<=9587||9600<=s&&s<=9615||9618<=s&&s<=9621||9632<=s&&s<=9633||9635<=s&&s<=9641||9650<=s&&s<=9651||9654<=s&&s<=9655||9660<=s&&s<=9661||9664<=s&&s<=9665||9670<=s&&s<=9672||9675===s||9678<=s&&s<=9681||9698<=s&&s<=9701||9711===s||9733<=s&&s<=9734||9737===s||9742<=s&&s<=9743||9748<=s&&s<=9749||9756===s||9758===s||9792===s||9794===s||9824<=s&&s<=9825||9827<=s&&s<=9829||9831<=s&&s<=9834||9836<=s&&s<=9837||9839===s||9886<=s&&s<=9887||9918<=s&&s<=9919||9924<=s&&s<=9933||9935<=s&&s<=9953||9955===s||9960<=s&&s<=9983||10045===s||10071===s||10102<=s&&s<=10111||11093<=s&&s<=11097||12872<=s&&s<=12879||57344<=s&&s<=63743||65024<=s&&s<=65039||65533===s||127232<=s&&s<=127242||127248<=s&&s<=127277||127280<=s&&s<=127337||127344<=s&&s<=127386||917760<=s&&s<=917999||983040<=s&&s<=1048573||1048576<=s&&s<=1114109?"A":"N"};function Ri(t,e={},i){i||(i=1);const{fontStyle:s=e.fontStyle,fontVariant:n=e.fontVariant,fontWeight:r=e.fontWeight,fontSize:a=e.fontSize,fontFamily:o=e.fontFamily}=t;return(s?s+" ":"")+(n?n+" ":"")+(r?r+" ":"")+a*i+"px "+(o||"sans-serif")}class Ii{constructor(t,e){this._numberCharSize=null,this._fullCharSize=null,this._letterCharSize=null,this._specialCharSizeMap={},this._canvas=null,this._context=null,this._contextSaved=!1,this._notSupportCanvas=!1,this._notSupportVRender=!1,this._userSpec={},this.specialCharSet="-/: .,@%'\"~",this._option=t,this._userSpec=null!=e?e:{},this.textSpec=this._initSpec(),M(t.specialCharSet)&&(this.specialCharSet=t.specialCharSet),this._standardMethod=M(t.getTextBounds)?this.fullMeasure.bind(this):this.measureWithNaiveCanvas.bind(this)}initContext(){if(this._notSupportCanvas)return!1;if(D(this._canvas)&&(M(this._option.getCanvasForMeasure)&&(this._canvas=this._option.getCanvasForMeasure()),D(this._canvas)&&"undefined"!=typeof window&&void 0!==window.document&&globalThis&&M(globalThis.document)&&(this._canvas=globalThis.document.createElement("canvas"))),D(this._context)&&M(this._canvas)){const t=this._canvas.getContext("2d");M(t)&&(t.save(),t.font=Ri(this.textSpec),this._contextSaved=!0,this._context=t)}return!D(this._context)||(this._notSupportCanvas=!0,!1)}_initSpec(){var t,e,i;const{defaultFontParams:s={}}=this._option,{fontStyle:n=s.fontStyle,fontVariant:r=s.fontVariant,fontWeight:a=(null!==(t=s.fontWeight)&&void 0!==t?t:"normal"),fontSize:o=(null!==(e=s.fontSize)&&void 0!==e?e:12),fontFamily:l=(null!==(i=s.fontFamily)&&void 0!==i?i:"sans-serif"),align:h,textAlign:d=(null!=h?h:"center"),baseline:c,textBaseline:u=(null!=c?c:"middle"),ellipsis:p,limit:g}=this._userSpec;let{lineHeight:m=o}=this._userSpec;if(S(m)&&"%"===m[m.length-1]){const t=Number.parseFloat(m.substring(0,m.length-1))/100;m=o*t}return{fontStyle:n,fontVariant:r,fontFamily:l,fontSize:o,fontWeight:a,textAlign:d,textBaseline:u,ellipsis:p,limit:g,lineHeight:m}}measure(t,e){switch(e){case"vrender":case"canopus":return this.fullMeasure(t);case"canvas":return this.measureWithNaiveCanvas(t);case"simple":return this.quickMeasureWithoutCanvas(t);default:return this.quickMeasure(t)}}fullMeasure(t){if(D(t))return{width:0,height:0};if(D(this._option.getTextBounds)||!this._notSupportVRender)return this.measureWithNaiveCanvas(t);const{fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:a,limit:o,lineHeight:l}=this.textSpec;let h;try{const d=this._option.getTextBounds({text:t,fontFamily:e,fontSize:i,fontWeight:s,textAlign:n,textBaseline:r,ellipsis:!!a,maxLineWidth:o||1/0,lineHeight:l});h={width:d.width(),height:d.height()}}catch(e){this._notSupportVRender=!0,h=this.measureWithNaiveCanvas(t)}return h}measureWithNaiveCanvas(t){return this._measureReduce(t,this._measureWithNaiveCanvas.bind(this))}_measureWithNaiveCanvas(t){var e;if(!this.initContext())return this._quickMeasureWithoutCanvas(t);const i=this._context.measureText(t),{fontSize:s,lineHeight:n}=this.textSpec;return{width:i.width,height:null!==(e=n)&&void 0!==e?e:s}}quickMeasure(t){return this._measureReduce(t,this._quickMeasure.bind(this))}_quickMeasure(t){const e={width:0,height:0};for(let i=0;it.toString()));return 0===a.length?r:1===a.length?e(a[0]):{width:a.reduce(((t,i)=>Math.max(t,e(i).width)),0),height:a.length*((null!==(i=n)&&void 0!==i?i:s)+1)+1}}return e(t.toString())}_measureNumberChar(){if(D(this._numberCharSize)){const t=this._standardMethod(Ii.NUMBERS_CHAR_SET);this._numberCharSize={width:t.width/Ii.NUMBERS_CHAR_SET.length,height:t.height}}return this._numberCharSize}_measureFullSizeChar(){return D(this._fullCharSize)&&(this._fullCharSize=this._standardMethod(Ii.FULL_SIZE_CHAR)),this._fullCharSize}_measureLetterChar(){if(D(this._letterCharSize)){const t=this._standardMethod(Ii.ALPHABET_CHAR_SET);this._letterCharSize={width:t.width/Ii.ALPHABET_CHAR_SET.length,height:t.height}}return this._letterCharSize}_measureSpecialChar(t){return M(this._specialCharSizeMap[t])?this._specialCharSizeMap[t]:this.specialCharSet.includes(t)?(this._specialCharSizeMap[t]=this._standardMethod(t),this._specialCharSizeMap[t]):null}release(){M(this._canvas)&&(this._canvas=null),M(this._context)&&(this._contextSaved&&(this._context.restore(),this._contextSaved=!1),this._context=null)}}Ii.ALPHABET_CHAR_SET="abcdefghijklmnopqrstuvwxyz",Ii.NUMBERS_CHAR_SET="0123456789",Ii.FULL_SIZE_CHAR="字";const Bi="Singleton",Fi="Transient",Yi="ConstantValue",ji="Instance";class Hi{constructor(t,e){this.id=I.GenAutoIncrementId(),this.activated=!1,this.serviceIdentifier=t,this.scope=e,this.type="Invalid",this.constraint=t=>!0,this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.dynamicValue=null}clone(){const t=new Hi(this.serviceIdentifier,this.scope);return t.activated=t.scope===Bi&&this.activated,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.provider=this.provider,t.constraint=this.constraint,t.cache=this.cache,t}}class zi{getConstructorMetadata(t){return{compilerGeneratedMetadata:N.getMetadata(z,t),userGeneratedMetadata:N.getMetadata(H,t)||{}}}getPropertiesMetadata(t){throw new Error("暂未实现")}}const Ni=(Vi=F,t=>{const e=e=>{if(null==e)return!1;if(e.key===Vi&&e.value===t)return!0;if(null==e.constructorArgsMetadata)return!1;const i=e.constructorArgsMetadata;for(let e=0;ee.container.get(t)))}}const Ui=new class{constructor(t){const e=t||{};e.defaultScope=e.defaultScope||Fi,this.options=e,this.id=I.GenAutoIncrementId(),this._bindingDictionary=new Map,this._metadataReader=new zi}load(t){const e=this._getContainerModuleHelpersFactory()(t.id);t.registry(e.bindFunction,e.unbindFunction,e.isboundFunction,e.rebindFunction)}get(t){const e=this._getNotAllArgs(t,!1);return this._get(e)}getAll(t){const e=this._getAllArgs(t);return this._get(e)}getTagged(t,e,i){const s=this._getNotAllArgs(t,!1,e,i);return this._get(s)}getNamed(t,e){return this.getTagged(t,F,e)}isBound(t){return this._bindingDictionary.has(t)}bind(t){const e=this.options.defaultScope,i=new Hi(t,e),s=this._bindingDictionary.get(t)||[];return s.push(i),this._bindingDictionary.set(t,s),new Gi(i)}unbind(t){this._bindingDictionary.delete(t)}rebind(t){return this.unbind(t),this.bind(t)}_getContainerModuleHelpersFactory(){const t=(t,e)=>{t._binding.moduleId=e},e=e=>i=>{const s=this.bind(i);return t(s,e),s},i=()=>t=>this.unbind(t),s=()=>t=>this.isBound(t),n=e=>i=>{const s=this.rebind(i);return t(s,e),s};return t=>({bindFunction:e(t),isboundFunction:s(),rebindFunction:n(t),unbindFunction:i(),unbindAsyncFunction:t=>null})}_getNotAllArgs(t,e,i,s){return{avoidConstraints:!1,isMultiInject:e,serviceIdentifier:t,key:i,value:s}}_getAllArgs(t){return{avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t}}_get(t){const e=[];return this._bindingDictionary.get(t.serviceIdentifier).filter((e=>e.constraint(t))).forEach((t=>{e.push(this._resolveFromBinding(t))})),t.isMultiInject||1!==e.length?e:e[0]}_getChildRequest(t){const e=t.implementationType,{userGeneratedMetadata:i}=this._metadataReader.getConstructorMetadata(e),s=Object.keys(i),n=[];for(let t=0;t{s[t.key]=t.value}));const r={inject:s[Y],multiInject:s[j]},a=r.inject||r.multiInject,o={serviceIdentifier:a,constructorArgsMetadata:e},l={injectIdentifier:a,metadata:e,bindings:this._bindingDictionary.get(a).filter((t=>t.constraint(o)))};n.push(l)}return n}_resolveFromBinding(t){const e=this._getResolvedFromBinding(t);return this._saveToScope(t,e),e}_getResolvedFromBinding(t){let e;switch(t.type){case Yi:case"Function":e=t.cache;break;case ji:e=this._resolveInstance(t,t.implementationType);break;default:e=t.dynamicValue({container:this})}return e}_resolveInstance(t,e){if(t.activated)return t.cache;const i=this._getChildRequest(t);return this._createInstance(e,i)}_createInstance(t,e){return e.length?new t(...this._resolveRequests(e)):new t}_resolveRequests(t){return t.map((t=>t.bindings.length>1?t.bindings.map((t=>this._resolveFromBinding(t))):this._resolveFromBinding(t.bindings[0])))}_saveToScope(t,e){t.scope===Bi&&(t.cache=e,t.activated=!0)}},$i=Symbol.for("CanvasFactory"),Xi=Symbol.for("Context2dFactory");function Ki(t){return Ui.getNamed($i,xi.global.env)(t)}Math.sqrt(3);const qi=new class{constructor(){this.pools=[],this.allocatedCanvas=[]}shareCanvas(){return this.allocatedCanvas.length?this.allocatedCanvas[0]:this.getCommonCanvas()}getCommonCanvas(){return this._commonCanvas||(this._commonCanvas=this.allocate({width:100,height:100,dpr:2})),this._commonCanvas}allocate(t){if(!this.pools.length){const e=Ki(Object.assign({nativeCanvas:xi.global.createCanvas(t)},t));return this.allocatedCanvas.push(e),e}const e=this.pools.pop();return e.resize(t.width,t.height),e.dpr=t.dpr,e}allocateByObj(t){if(!this.pools.length){const e={width:t.width/t.dpr,height:t.height/t.dpr,dpr:t.dpr},i=Ki(Object.assign({nativeCanvas:xi.global.createCanvas(e)},e));return this.allocatedCanvas.push(i),i}const e=this.pools.pop();return e.width=t.width,e.height=t.height,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};const Zi=Symbol.for("VWindow"),Ji=Symbol.for("WindowHandlerContribution");let Qi=class{get width(){if(this._handler){const t=this._handler.getWH();return this._width=t.width}return this._width}get height(){if(this._handler){const t=this._handler.getWH();return this._height=t.height}return this._height}get dpr(){return this._handler.getDpr()}constructor(){this.hooks={onChange:new Q(["x","y","width","height"])},this.active=()=>{const t=this.global;t.env&&!this.actived&&(Ui.getNamed(Ji,t.env).configure(this,t),this.actived=!0)},this._uid=I.GenAutoIncrementId(),this.global=xi.global,this.postInit()}postInit(){this.global.hooks.onSetEnv.tap("window",this.active),this.active()}get style(){var t;return null!==(t=this._handler.getStyle())&&void 0!==t?t:{}}set style(t){this._handler.setStyle(t)}create(t){var e,i;this._handler.createWindow(t);const s=this._handler.getWH();this._width=s.width,this._height=s.height,t.viewBox?this.setViewBox(t.viewBox):!1!==t.canvasControled?this.setViewBox({x1:0,y1:0,x2:this._width,y2:this._height}):this.setViewBox({x1:0,y1:0,x2:null!==(e=t.width)&&void 0!==e?e:this._width,y2:null!==(i=t.height)&&void 0!==i?i:this._height}),this.title=this._handler.getTitle(),this.resizable=!0}setWindowHandler(t){this._handler=t}setDpr(t){return this._handler.setDpr(t)}resize(t,e){return this._handler.resizeWindow(t,e)}configure(){throw new Error("暂不支持")}release(){return this.global.hooks.onSetEnv.unTap("window",this.active),this._handler.releaseWindow()}getContext(){return this._handler.getContext()}getNativeHandler(){return this._handler.getNativeHandler()}getImageBuffer(t){return this._handler.getImageBuffer?this._handler.getImageBuffer(t):null}addEventListener(t,e,i){return this._handler.addEventListener(t,e,i)}removeEventListener(t,e,i){return this._handler.removeEventListener(t,e,i)}dispatchEvent(t){return this._handler.dispatchEvent(t)}getBoundingClientRect(){return this._handler.getBoundingClientRect()}getContainer(){return this._handler.container}clearViewBox(t){this._handler.clearViewBox(t)}setViewBox(t){this._handler.setViewBox(t)}setViewBoxTransform(t,e,i,s,n,r){this._handler.setViewBoxTransform(t,e,i,s,n,r)}getViewBox(){return this._handler.getViewBox()}getViewBoxTransform(){return this._handler.getViewBoxTransform()}pointTransform(t,e){const i=this._handler.getViewBox(),s={x:t,y:e};return this._handler.getViewBoxTransform().transformPoint({x:t,y:e},s),s.x-=i.x1,s.y-=i.y1,s}hasSubView(){const t=this._handler.getViewBox();return!(0===t.x1&&0===t.y1&&this.width===t.width()&&this.height===t.height())}isVisible(t){return this._handler.isVisible(t)}onVisibleChange(t){return this._handler.onVisibleChange(t)}getTopLeft(t){return this._handler.getTopLeft(t)}};Qi=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Qi);var ts=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a},es=function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},is=function(t,e){return function(i,s){e(i,s,t)}};let ss=class{get canvas(){return this.tryInitCanvas(),this._canvas}get context(){return this.tryInitCanvas(),this._context}constructor(t){this.contributions=t,this.configured=!1,this.global=xi.global,this.global.hooks.onSetEnv.tap("graphic-util",((t,e,i)=>{this.configured=!1,this.configure(i,e)}))}get textMeasure(){return this._textMeasure||this.configure(this.global,this.global.env),this._textMeasure}configure(t,e){this.configured||(this.contributions.getContributions().forEach((t=>{t.configure(this,e)})),this.configured=!0)}tryInitCanvas(){if(!this._canvas){const t=qi.shareCanvas();this._canvas=t,this._context=t.getContext("2d")}}bindTextMeasure(t){this._textMeasure=t}measureText(t,e,i="native"){var s;this.configure(this.global,this.global.env);const n=this.global.measureTextMethod;this.global.measureTextMethod=i;const r={width:this._textMeasure.measureTextWidth(t,e),height:null!==(s=e.fontSize)&&void 0!==s?s:si.fontSize};return this.global.measureTextMethod=n,r}createTextMeasureInstance(t,e,i){return this.configure(this.global,this.global.env),new Ii(Object.assign({defaultFontParams:{fontFamily:si.fontFamily,fontSize:si.fontSize},getCanvasForMeasure:i||(()=>this.canvas),getTextBounds:void 0,specialCharSet:"-/: .,@%'\"~"+Ii.ALPHABET_CHAR_SET+Ii.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t)}drawGraphicToCanvas(t,e,i){if(!e.defaultLayer)return null;const s=Ui.get(Zi),n=t.AABBBounds,r=n.width(),a=n.height(),o=-n.x1,l=-n.y1;s.create({viewBox:{x1:o,y1:l,x2:n.x2,y2:n.y2},width:r,height:a,canvas:i,dpr:e.window.dpr,canvasControled:!0,offscreen:!0,title:""});const h=e.params.optimize.disableCheckGraphicWidthOutRange;e.params.optimize.disableCheckGraphicWidthOutRange=!0,e.defaultLayer.getNativeHandler().drawTo(s,[t],{transMatrix:s.getViewBoxTransform(),viewBox:s.getViewBox(),stage:e,layer:e.defaultLayer,renderService:e.renderService,background:"transparent",clear:!0,updateBounds:!1}),e.params.optimize.disableCheckGraphicWidthOutRange=h;const d=s.getNativeHandler();return d.nativeCanvas?d.nativeCanvas:null}};var ns;ss=ts([V(),is(0,$(K)),is(0,X(Di)),es("design:paramtypes",[Object])],ss),function(t){t[t.transform=0]="transform",t[t.matrix=1]="matrix"}(ns||(ns={}));const rs=new Pt;let as=class{constructor(){this.matrix=new Pt}init(t){return this.mode=ns.transform,this.originTransform=t,this.matrix.reset(),this}fromMatrix(t,e){return this.mode=ns.matrix,this.outSourceMatrix=t,this.outTargetMatrix=e,this}scaleMatrix(t,e,i){const s=this.outSourceMatrix;if(rs.setValue(s.a,s.b,s.c,s.d,s.e,s.f),this.outTargetMatrix.reset(),i){const{x:s,y:n}=i;this.outTargetMatrix.translate(s,n),this.outTargetMatrix.scale(t,e),this.outTargetMatrix.translate(-s,-n)}else this.outTargetMatrix.scale(t,e);return this.outTargetMatrix.multiply(rs.a,rs.b,rs.c,rs.d,rs.e,rs.f),this}rotateMatrix(t,e){const i=this.outSourceMatrix;if(rs.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),e){const{x:i,y:s}=e;this.outTargetMatrix.translate(i,s),this.outTargetMatrix.rotate(t),this.outTargetMatrix.translate(-i,-s)}else this.outTargetMatrix.rotate(t);return this.outTargetMatrix.multiply(rs.a,rs.b,rs.c,rs.d,rs.e,rs.f),this}scale(t,e,i){return this.mode===ns.matrix?this.scaleMatrix(t,e,i):this}rotate(t,e){return this.mode===ns.matrix?this.rotateMatrix(t,e):this}translateMatrix(t,e){const i=this.outSourceMatrix;return rs.setValue(i.a,i.b,i.c,i.d,i.e,i.f),this.outTargetMatrix.reset(),this.outTargetMatrix.translate(t,e),this.outTargetMatrix.multiply(rs.a,rs.b,rs.c,rs.d,rs.e,rs.f),this}translate(t,e){return this.mode===ns.matrix?this.translateMatrix(t,e):this}simplify(t){return this.mode===ns.matrix?this.simplifyMatrix(t):this}simplifyMatrix(t){return this}};as=ts([V(),es("design:paramtypes",[])],as);const os={arc:oi,area:li,circle:hi,line:ui,path:pi,symbol:_i,text:fi,rect:mi,polygon:gi,richtext:vi,richtextIcon:bi,image:yi,group:di,glyph:ci},ls=Object.keys(os);function hs(t,e){Object.keys(e).forEach((i=>{t[i]=e[i]}))}const ds={arc:Object.assign({},os.arc),area:Object.assign({},os.area),circle:Object.assign({},os.circle),line:Object.assign({},os.line),path:Object.assign({},os.path),symbol:Object.assign({},os.symbol),text:Object.assign({},os.text),rect:Object.assign({},os.rect),polygon:Object.assign({},os.polygon),richtext:Object.assign({},os.richtext),richtextIcon:Object.assign({},os.richtextIcon),image:Object.assign({},os.image),group:Object.assign({},os.group),glyph:Object.assign({},os.glyph)};class cs{constructor(){this.initTheme(),this.dirty=!1}initTheme(){this._defaultTheme={},ls.forEach((t=>{this._defaultTheme[t]=Object.create(ds[t])})),this.combinedTheme=this._defaultTheme}getTheme(t){if(!t)return this.combinedTheme;if(!this.dirty)return this.combinedTheme;let e={};const i=this.getParentWithTheme(t);return i&&(e=i.theme),this.applyTheme(t,e),this.combinedTheme}getParentWithTheme(t){for(;t.parent;)if((t=t.parent).theme)return t;return null}applyTheme(t,e,i=!1){if(this.dirty){const s=this.getParentWithTheme(t);if(s){const t=s.theme;(t.dirty||i)&&t.applyTheme(s,e,!0)}this.userTheme?this.doCombine(s&&s.theme.combinedTheme):(s?this.combinedTheme=s.theme.combinedTheme:(this.combinedTheme=this._defaultTheme,g.getInstance().warn("未知错误,走到不应该走的区域里")),this.dirty=!1)}return this.combinedTheme}doCombine(t){const e=this.userTheme,i=this.combinedTheme;ls.forEach((s=>{const n=Object.create(ds[s]);t&&t[s]&&hs(n,t[s]),i[s]&&hs(n,i[s]),e[s]&&hs(n,e[s]),this.combinedTheme[s]=n})),e.common&&ls.forEach((t=>{hs(this.combinedTheme[t],e.common)})),this.dirty=!1}setTheme(t,e){let i=this.userTheme;i?Object.keys(t).forEach((e=>{i[e]?Object.assign(i[e],t[e]):i[e]=Object.assign({},t[e])})):i=t,this.userTheme=i,this.dirty=!0,this.dirtyChildren(e)}resetTheme(t,e){this.userTheme=t,this.dirty=!0,this.dirtyChildren(e)}dirtyChildren(t){t.forEachChildren((t=>{t.isContainer&&(t.theme&&(t.theme.dirty=!0),this.dirtyChildren(t))}))}}const us=new cs;function ps(t,e){return t.glyphHost?ps(t.glyphHost):e?(t.isContainer,e):function(t){let e;if(e=t.isContainer?t:t.parent,e){for(;e&&!e.theme;)e=e.parent;return e?(e.theme||e.createTheme(),e.theme.getTheme(e)):us.getTheme()}return null}(t)||t.attachedThemeGraphic&&ps(t.attachedThemeGraphic)||us.getTheme()}const gs=Object.prototype.hasOwnProperty,ms=(t,e)=>null!=t&&gs.call(t,e),_s=t=>new RegExp(/^(http(s)?:\/\/)\w+[^\s]+(\.[^\s]+){1,}$/).test(t),fs=t=>new RegExp(/^data:image\/(?:gif|png|jpeg|bmp|webp|svg\+xml)(?:;charset=utf-8)?;base64,(?:[A-Za-z0-9]|[+/])+={0,2}/g).test(t),vs=t=>{const e=typeof t;return null!==t&&"object"===e||"function"===e},ys=t=>"function"==typeof t;class bs extends(o()){get previousSibling(){return this._prev}get nextSibling(){return this._next}get children(){return this.getChildren()}get firstChild(){return this._firstChild}get lastChild(){return this._lastChild}get count(){return this._count}get childrenCount(){return this._idMap?this._idMap.size:0}constructor(){super(),this._uid=I.GenAutoIncrementId(),this._firstChild=null,this._lastChild=null,this.parent=null,this._count=1}forEachChildren(t,e=!1){if(e){let e=this._lastChild,i=0;for(;e;){if(t(e,i++))return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){if(t(e,i++))return;e=e._next}}}forEachChildrenAsync(t,e=!1){return i=this,s=void 0,r=function*(){if(e){let e=this._lastChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._prev}}else{let e=this._firstChild,i=0;for(;e;){let s=t(e,i++);if(s.then&&(s=yield s),s)return;e=e._next}}},new((n=void 0)||(n=Promise))((function(t,e){function a(t){try{l(r.next(t))}catch(t){e(t)}}function o(t){try{l(r.throw(t))}catch(t){e(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof n?i:new n((function(t){t(i)}))).then(a,o)}l((r=r.apply(i,s||[])).next())}));var i,s,n,r}forEach(t){return this.forEachChildren(t)}appendChild(t,e=!0){if(this._uid===t._uid)return null;if(!e&&t.isAncestorsOf(this))throw new Error("【Node::appendChild】不能将父辈元素append为子元素");return t.parent&&t.parent.removeChild(t),t.parent=this,this._lastChild?(this._lastChild._next=t,t._prev=this._lastChild,this._lastChild=t):(this._firstChild=this._lastChild=t,t._prev=t._next=null),this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this.setCount(t.count),this._structEdit=!0,t}appendChildArrHighPerformance(t,e=!1){return console.error("暂不支持该函数"),t}insertBefore(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,t._prev=e._prev,e._prev?e._prev._next=t:this._firstChild=t,e._prev=t,t._next=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertAfter(t,e){if(!e)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertAfter】不能将父辈元素insert为子元素");return e.parent!==this?null:(t.parent&&t.parent.removeChild(t),t.parent=this,e._next?(e._next._prev=t,t._next=e._next):this._lastChild=t,e._next=t,t._prev=e,this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t)}insertInto(t,e){if(!this._ignoreWarn&&this._nodeList&&g.getInstance().warn("insertIntoKeepIdx和insertInto混用可能会存在错误"),e>=this.childrenCount)return this.appendChild(t);if(this._uid===t._uid)return null;if(t.isAncestorsOf(this))throw new Error("【Node::insertBefore】不能将父辈元素insert为子元素");if(t.parent&&t.parent.removeChild(t),t.parent=this,0===e)t._next=this._firstChild,this._firstChild&&(this._firstChild._prev=t),t._prev=null,this._firstChild=t;else{let i=this._firstChild;for(let t=0;t0&&(i=i._next)}if(!i)return null;t._next=i._next,t._prev=i,i._next=t,t._next&&(t._next._prev=t)}return this._idMap||(this._idMap=new Map),this._idMap.set(t._uid,t),this._structEdit=!0,this.setCount(t.count),t}insertIntoKeepIdx(t,e){if(this._nodeList||(this._nodeList=this.children),this._nodeList[e]){const i=this._nodeList[e];return this._nodeList.splice(e,0,t),this.insertBefore(t,i)}let i;this._nodeList[e]=t;for(let t=e-1;t>=0&&(i=this._nodeList[t],!i);t--);if(i)return i._next?this.insertBefore(t,i._next):this.appendChild(t);this._ignoreWarn=!0;const s=this.insertInto(t,0);return this._ignoreWarn=!1,s}removeChild(t){if(!this._idMap)return null;if(!this._idMap.has(t._uid))return null;if(this._idMap.delete(t._uid),this._nodeList){const e=this._nodeList.findIndex((e=>e===t));e>=0&&this._nodeList.splice(e,1)}return t._prev?t._prev._next=t._next:this._firstChild=t._next,t._next?t._next._prev=t._prev:this._lastChild=t._prev,t.parent=null,t._prev=null,t._next=null,this._structEdit=!0,this.setCount(-t.count),t}delete(){this.parent&&this.parent.removeChild(this)}removeAllChild(t){if(!this._idMap)return;this._nodeList&&(this._nodeList.length=0);let e=this._firstChild;for(;e;){const t=e._next;e.parent=null,e._prev=null,e._next=null,e=e._next,e=t}this._firstChild=null,this._lastChild=null,this._idMap.clear(),this._structEdit=!0,this.setCount(1-this._count)}replaceChild(t,e){throw new Error("暂不支持")}find(t,e=!1){let i=null;return this.forEachChildren(((e,s)=>!(e===this||!t(e,s)||(i=e,0)))),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.find(t,!0);if(s)return i=s,!0}return!1})),i}findAll(t,e=!1){let i=[];return this.forEachChildren(((e,s)=>{e!==this&&t(e,s)&&i.push(e)})),e&&this.forEachChildren((e=>{if(e.isContainer){const s=e.findAll(t,!0);s.length&&(i=i.concat(s))}})),i}getElementById(t){return this.find((e=>e.id===t),!0)}findChildById(t){return this.getElementById(t)}findChildByUid(t){return this._idMap&&this._idMap.get(t)||null}getElementsByName(t){return this.findAll((e=>e.name===t),!0)}findChildrenByName(t){return this.getElementsByName(t)}getElementsByType(t){return this.findAll((e=>e.type===t),!0)}getChildByName(t,e=!1){return this.find((e=>e.name===t),e)}getChildAt(t){let e=this._firstChild;if(!e)return null;for(let i=0;i1&&(t=1),function(e){return 0===t?e:t<0?e*(e*-t+1+t):e*((2-e)*t+(1-t))}}static getPowIn(t){return function(e){return Math.pow(e,t)}}static getPowOut(t){return function(e){return 1-Math.pow(1-e,t)}}static getPowInOut(t){return function(e){return(e*=2)<1?.5*Math.pow(e,t):1-.5*Math.abs(Math.pow(2-e,t))}}static getBackIn(t){return function(e){return e*e*((t+1)*e-t)}}static getBackOut(t){return function(e){return--e*e*((t+1)*e+t)+1}}static getBackInOut(t){return t*=1.525,function(e){return(e*=2)<1?e*e*((t+1)*e-t)*.5:.5*((e-=2)*e*((t+1)*e+t)+2)}}static sineIn(t){return 1-Math.cos(t*Math.PI/2)}static sineOut(t){return Math.sin(t*Math.PI/2)}static sineInOut(t){return-(Math.cos(Math.PI*t)-1)/2}static expoIn(t){return 0===t?0:Math.pow(2,10*t-10)}static expoOut(t){return 1===t?1:1-Math.pow(2,-10*t)}static expoInOut(t){return 0===t?0:1===t?1:t<.5?Math.pow(2,20*t-10)/2:(2-Math.pow(2,-20*t+10))/2}static circIn(t){return-(Math.sqrt(1-t*t)-1)}static circOut(t){return Math.sqrt(1- --t*t)}static circInOut(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)}static bounceOut(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}static bounceIn(t){return 1-ks.bounceOut(1-t)}static bounceInOut(t){return t<.5?.5*ks.bounceIn(2*t):.5*ks.bounceOut(2*t-1)+.5}static getElasticIn(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return-t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)}}static getElasticOut(t,e){return function(i){if(0===i||1===i)return i;const s=e/lt*Math.asin(1/t);return t*Math.pow(2,-10*i)*Math.sin((i-s)*lt/e)+1}}static getElasticInOut(t,e){return function(i){const s=e/lt*Math.asin(1/t);return(i*=2)<1?t*Math.pow(2,10*(i-=1))*Math.sin((i-s)*lt/e)*-.5:t*Math.pow(2,-10*(i-=1))*Math.sin((i-s)*lt/e)*.5+1}}}ks.quadIn=ks.getPowIn(2),ks.quadOut=ks.getPowOut(2),ks.quadInOut=ks.getPowInOut(2),ks.cubicIn=ks.getPowIn(3),ks.cubicOut=ks.getPowOut(3),ks.cubicInOut=ks.getPowInOut(3),ks.quartIn=ks.getPowIn(4),ks.quartOut=ks.getPowOut(4),ks.quartInOut=ks.getPowInOut(4),ks.quintIn=ks.getPowIn(5),ks.quintOut=ks.getPowOut(5),ks.quintInOut=ks.getPowInOut(5),ks.backIn=ks.getBackIn(1.7),ks.backOut=ks.getBackOut(1.7),ks.backInOut=ks.getBackInOut(1.7),ks.elasticIn=ks.getElasticIn(1,.3),ks.elasticOut=ks.getElasticOut(1,.3),ks.elasticInOut=ks.getElasticInOut(1,.3*1.5);class As{constructor(){this.id=I.GenAutoIncrementId(),this.animateHead=null,this.animateTail=null,this.animateCount=0,this.paused=!1}addAnimate(t){this.animateTail?(this.animateTail.nextAnimate=t,t.prevAnimate=this.animateTail,this.animateTail=t,t.nextAnimate=null):(this.animateHead=t,this.animateTail=t),this.animateCount++}pause(){this.paused=!0}resume(){this.paused=!1}tick(t){if(this.paused)return;let e=this.animateHead;for(this.animateCount=0;e;)e.status===he.END?this.removeAnimate(e):e.status===he.RUNNING||e.status===he.INITIAL?(this.animateCount++,e.advance(t)):e.status===he.PAUSED&&this.animateCount++,e=e.nextAnimate}clear(){let t=this.animateHead;for(;t;)t.release(),t=t.nextAnimate;this.animateHead=null,this.animateTail=null,this.animateCount=0}removeAnimate(t,e=!0){t._onRemove&&t._onRemove.forEach((t=>t())),t===this.animateHead?(this.animateHead=t.nextAnimate,t===this.animateTail?this.animateTail=null:this.animateHead.prevAnimate=null):t===this.animateTail?(this.animateTail=t.prevAnimate,this.animateTail.nextAnimate=null):(t.prevAnimate.nextAnimate=t.nextAnimate,t.nextAnimate.prevAnimate=t.prevAnimate),e&&t.release()}}const ws=new As;class Ts{constructor(t,e,i,s,n){this.from=t,this.to=e,this.duration=i,this.easing=s,this.params=n,this.updateCount=0}bind(t,e){this.target=t,this.subAnimate=e,this.onBind()}onBind(){}onFirstRun(){}onStart(){}onEnd(){}getEndProps(){return this.to}getFromProps(){return this.from}getMergedEndProps(){var t;const e=this.getEndProps();return e?this._endProps===e?this._mergedEndProps:(this._endProps=e,void(this._mergedEndProps=Object.assign({},null!==(t=this.step.prev.getLastProps())&&void 0!==t?t:{},e))):this.step.prev?this.step.prev.getLastProps():e}update(t,e,i){if(0===this.updateCount){this.onFirstRun();const t=this.step.getLastProps();Object.keys(t).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(i[e]=t[e])}))}this.updateCount+=1,this.onUpdate(t,e,i),t&&this.onEnd()}}class Ls extends Ts{constructor(t){super(null,null,0,"linear"),this.cb=t}onUpdate(t,e,i){}onStart(){this.cb()}}class Cs{constructor(t=I.GenAutoIncrementId(),e=ws,i){this.id=t,this.timeline=e,this.status=he.INITIAL,this.tailAnimate=new Es(this),this.subAnimates=[this.tailAnimate],this.timeScale=1,this.rawPosition=-1,this._startTime=0,this._duringTime=0,this.timeline.addAnimate(this),this.slience=i}setTimeline(t){t!==this.timeline&&(this.timeline.removeAnimate(this,!1),t.addAnimate(this))}getStartTime(){return this._startTime}getDuration(){return this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0)}after(t){const e=t.getDuration();return this._startTime=e,this}afterAll(t){let e=-1/0;return t.forEach((t=>{e=ut(t.getDuration(),e)})),this._startTime=e,this}parallel(t){return this._startTime=t.getStartTime(),this}static AddInterpolate(t,e){Cs.interpolateMap.set(t,e)}play(t){if(this.tailAnimate.play(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return 1===this.subAnimates.length&&this.tailAnimate.totalDuration===t.duration&&this.trySetAttribute(t.getFromProps(),t.mode),this}trySetAttribute(t,e=Cs.mode){t&&e&de.SET_ATTR_IMMEDIATELY&&this.target.setAttributes&&this.target.setAttributes(t,!1,{type:le.ANIMATE_PLAY})}runCb(t){const e=new Ls((()=>{t(this,e.step.prev)}));return this.tailAnimate.play(e),this}customInterpolate(t,e,i,s,n,r){const a=Cs.interpolateMap.get(t)||Cs.interpolateMap.get("");return!!a&&a(t,e,i,s,n,r)}pause(){this.status===he.RUNNING&&(this.status=he.PAUSED)}resume(){this.status===he.PAUSED&&(this.status=he.RUNNING)}to(t,e,i,s){if(this.tailAnimate.to(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}from(t,e,i,s){if(this.tailAnimate.from(t,e,i,s),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}wait(t){if(this.tailAnimate.wait(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}startAt(t){if(this.tailAnimate.startAt(t),this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}loop(t){if(this.tailAnimate.loop=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}reversed(t){if(this.tailAnimate.reversed=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}bounce(t){if(this.tailAnimate.bounce=t,this.target){const t=this.target.stage;t&&t.renderNextFrame()}return this}subAnimate(){const t=new Es(this,this.tailAnimate);return this.tailAnimate=t,this.subAnimates.push(t),t.bind(this.target),this}getStartProps(){return this.subAnimates[0].getStartProps()}getEndProps(){return this.tailAnimate.getEndProps()}depreventAttr(t){this._preventAttrs&&this._preventAttrs.delete(t)}preventAttr(t){this._preventAttrs||(this._preventAttrs=new Set),this._preventAttrs.add(t)}preventAttrs(t){t.forEach((t=>this.preventAttr(t)))}validAttr(t){return!this._preventAttrs||!this._preventAttrs.has(t)}bind(t){return this.target=t,this.target.onAnimateBind&&!this.slience&&this.target.onAnimateBind(this),this.subAnimates.forEach((e=>{e.bind(t)})),this}advance(t){if(this._duringTimet()))),this.setPosition(Math.max(this.rawPosition,0)+t*this.timeScale)&&this.status===he.RUNNING&&(this.status=he.END,this._onEnd&&this._onEnd.forEach((t=>t())))}setPosition(t){let e,i=0;const s=this.rawPosition,n=this.subAnimates.reduce(((t,e)=>t+e.totalDuration),0);t<0&&(t=0);const r=t>=n;if(r&&(t=n),t===s)return r;for(let s=0;s=t));s++)i+=e.totalDuration,e=void 0;return this.rawPosition=t,e.setPosition(t-i),r}onStart(t){this._onStart||(this._onStart=[]),this._onStart.push(t)}onEnd(t){this._onEnd||(this._onEnd=[]),this._onEnd.push(t)}onRemove(t){this._onRemove||(this._onRemove=[]),this._onRemove.push(t)}onFrame(t){this._onFrame||(this._onFrame=[]),this._onFrame.push(t)}release(){this.status=he.END}stop(t){t||this.target.onStop(),"start"===t?this.target.onStop(this.getStartProps()):"end"===t?this.target.onStop(this.getEndProps()):this.target.onStop(t),this.release()}}Cs.mode=de.NORMAL,Cs.interpolateMap=new Map;class Es{get totalDuration(){return this.calcAttr(),this._totalDuration+this._startAt}constructor(t,e){this.rawPosition=-1,this.position=0,this.loop=0,this.duration=0,this.animate=t,this.stepHead=new Ds(0,0,e?Object.assign({},e.stepTail.props):{}),this.stepTail=this.stepHead,this.dirty=!0,this._startAt=0}calcAttr(){this.dirty&&(this._totalDuration=this.duration*(this.loop+1))}bind(t){return this.target=t,this}play(t){let e=t.duration;(null==e||e<0)&&(e=0);const i=t.easing,s="string"==typeof i?ks[i]:i,n=this._addStep(e,null,s);return n.type=ce.customAnimate,this._appendProps(t.getEndProps(),n,!1),this._appendCustomAnimate(t,n),this}to(t,e,i,s){(null==e||e<0)&&(e=0);const n="string"==typeof i?ks[i]:i,r=this._addStep(e,null,n);return r.type=ce.to,this._appendProps(t,r,!!s&&s.tempProps),r.propKeys||(r.propKeys=Object.keys(r.props)),s&&s.noPreventAttrs||this.target.animates.forEach((t=>{t.id!==this.animate.id&&t.preventAttrs(r.propKeys)})),this}from(t,e,i,s){this.to(t,0,i,s);const n={};this.stepTail.propKeys||(this.stepTail.propKeys=Object.keys(this.stepTail.props)),this.stepTail.propKeys.forEach((t=>{n[t]=this.getLastPropByName(t,this.stepTail)})),this.to(n,e,i,s),this.stepTail.type=ce.from}startAt(t){return t<0&&(t=0),this._startAt=t,this}getStartProps(){var t;return null===(t=this.stepHead)||void 0===t?void 0:t.props}getEndProps(){return this.stepTail.props}getLastStep(){return this._lastStep}wait(t){if(t>0){const e=this._addStep(+t,null);e.type=ce.wait,e.prev.customAnimate?e.props=e.prev.customAnimate.getEndProps():e.props=e.prev.props,this.target.onAddStep&&this.target.onAddStep(e)}return this}_addStep(t,e,i){const s=new Ds(this.duration,t,e,i);return this.duration+=t,this.stepTail.append(s),this.stepTail=s,s}_appendProps(t,e,i){e.props=i?t:Object.assign({},t);let s=e.prev;const n=e.props;for(e.propKeys||(e.propKeys=Object.keys(e.props)),e.propKeys.forEach((t=>{void 0===e.props[t]&&(e.props[t]=this.target.getDefaultAttribute(t))}));s.prev;)s.props&&(s.propKeys||(s.propKeys=Object.keys(s.props)),s.propKeys.forEach((t=>{void 0===n[t]&&(n[t]=s.props[t])}))),e.propKeys=Object.keys(e.props),s=s.prev;const r=this.stepHead.props;e.propKeys||(e.propKeys=Object.keys(n)),e.propKeys.forEach((t=>{if(void 0===r[t]){const e=this.animate.getStartProps();r[t]=e[t]=this.target.getComputedAttribute(t)}})),this.target.onAddStep&&this.target.onAddStep(e)}_appendCustomAnimate(t,e){e.customAnimate=t,t.step=e,t.bind(this.target,this)}setPosition(t){var e;const i=this.duration,s=this.loop,n=this.rawPosition;let r,a,o=!1;const l=null!==(e=this._startAt)&&void 0!==e?e:0;if(t<0&&(t=0),t=s*i+i,o&&(a=i,r=s,t=a*r+i),t===n)return o;const h=!this.reversed!=!(this.bounce&&r%2);return h&&(a=i-a),this._deltaPosition=a-this.position,this.position=a,this.rawPosition=t+l,this.updatePosition(o,h),o}updatePosition(t,e){if(!this.stepHead)return;let i=this.stepHead.next;const s=this.position,n=this.duration;if(this.target&&i){let r=i.next;for(;r&&r.position<=s;)i=r,r=i.next;let a=t?0===n?1:s/n:(s-i.position)/i.duration;i.easing&&(a=i.easing(a)),this.tryCallCustomAnimateLifeCycle(i,this._lastStep||(e?this.stepTail:this.stepHead),e),this.updateTarget(i,a,t),this._lastStep=i,this.animate._onFrame&&this.animate._onFrame.forEach((t=>t(i,a)))}}tryCallCustomAnimateLifeCycle(t,e,i){if(t!==e)if(i){let i=e.prev;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=t.prev;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}else{let i=e.next;for(;i&&i!==t;)i.customAnimate&&(i.customAnimate.onStart&&i.customAnimate.onStart(),i.customAnimate.onEnd&&i.customAnimate.onEnd()),i=i.next;e&&e.customAnimate&&e.customAnimate.onEnd&&e.customAnimate.onEnd(),t&&t.customAnimate&&t.customAnimate.onStart&&t.customAnimate.onStart()}}getLastPropByName(t,e){let i=e.prev;for(;i;){if(i.props&&void 0!==i.props[t])return i.props[t];if(i.customAnimate){const e=i.customAnimate.getEndProps()[t];if(void 0!==e)return e}i=i.prev}return g.getInstance().warn("未知错误,step中找不到属性"),e.props[t]}updateTarget(t,e,i){null==t.props&&null==t.customAnimate||this.target.onStep(this,this.animate,t,e,i)}}class Ds{constructor(t,e,i,s){this.duration=e,this.position=t,this.props=i,this.easing=s}append(t){t.prev=this,t.next=this.next,this.next=t}getLastProps(){let t=this.prev;for(;t;){if(t.props)return t.props;if(t.customAnimate)return t.customAnimate.getMergedEndProps();t=t.prev}return null}}const Ps=function(t,e,i){return ti?i:t};function Os(t,e,i){e/=100,i/=100;const s=(1-Math.abs(2*i-1))*e,n=s*(1-Math.abs(t/60%2-1)),r=i-s/2;let a=0,o=0,l=0;return 0<=t&&t<60?(a=s,o=n,l=0):60<=t&&t<120?(a=n,o=s,l=0):120<=t&&t<180?(a=0,o=s,l=n):180<=t&&t<240?(a=0,o=n,l=s):240<=t&&t<300?(a=n,o=0,l=s):300<=t&&t<360&&(a=s,o=0,l=n),a=Math.round(255*(a+r)),o=Math.round(255*(o+r)),l=Math.round(255*(l+r)),{r:a,g:o,b:l}}function Rs(t,e,i){t/=255,e/=255,i/=255;const s=Math.min(t,e,i),n=Math.max(t,e,i),r=n-s;let a=0,o=0,l=0;return a=0===r?0:n===t?(e-i)/r%6:n===e?(i-t)/r+2:(t-e)/r+4,a=Math.round(60*a),a<0&&(a+=360),l=(n+s)/2,o=0===r?0:r/(1-Math.abs(2*l-1)),o=+(100*o).toFixed(1),l=+(100*l).toFixed(1),{h:a,s:o,l}}const Is=/^#([0-9a-f]{3,8})$/,Bs={transparent:4294967040},Fs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};function Ys(t){return((t=Math.max(0,Math.min(255,Math.round(t)||0)))<16?"0":"")+t.toString(16)}function js(t){return h(t)?new Ws(t>>16,t>>8&255,255&t,1):y(t)?new Ws(t[0],t[1],t[2]):new Ws(255,255,255)}function Hs(t){return t<.04045?.0773993808*t:Math.pow(.9478672986*t+.0521327014,2.4)}function zs(t){return t<.0031308?12.92*t:1.055*Math.pow(t,.41666)-.055}const Ns=(t,e)=>{const i=Is.exec(t);if(e||i){const t=parseInt(i[1],16),e=i[1].length;return 3===e?new Ws((t>>8&15)+((t>>8&15)<<4),(t>>4&15)+((t>>4&15)<<4),(15&t)+((15&t)<<4),1):6===e?js(t):8===e?new Ws(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):null}};class Vs{static Brighter(t,e=1){return 1===e?t:new Vs(t).brighter(e).toRGBA()}static SetOpacity(t,e=1){return 1===e?t:new Vs(t).setOpacity(e).toRGBA()}static getColorBrightness(t,e="hsl"){const i=t instanceof Vs?t:new Vs(t);switch(e){case"hsv":default:return i.getHSVBrightness();case"hsl":return i.getHSLBrightness();case"lum":return i.getLuminance();case"lum2":return i.getLuminance2();case"lum3":return i.getLuminance3()}}static parseColorString(t){if(M(Bs[t]))return function(t){return h(t)?new Ws(t>>>24,t>>>16&255,t>>>8&255,255&t):y(t)?new Ws(t[0],t[1],t[2],t[3]):new Ws(255,255,255,1)}(Bs[t]);if(M(Fs[t]))return js(Fs[t]);const e=`${t}`.trim().toLowerCase(),i=Ns(e);if(void 0!==i)return i;if(/^(rgb|RGB|rgba|RGBA)/.test(e)){const t=e.replace(/(?:\(|\)|rgba|RGBA|rgb|RGB)*/g,"").split(",");return new Ws(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10),parseFloat(t[3]))}if(/^(hsl|HSL|hsla|HSLA)/.test(e)){const t=e.replace(/(?:\(|\)|hsla|HSLA|hsl|HSL)*/g,"").split(","),i=Os(parseInt(t[0],10),parseInt(t[1],10),parseInt(t[2],10));return new Ws(i.r,i.g,i.b,parseFloat(t[3]))}}constructor(t){const e=Vs.parseColorString(t);e?this.color=e:(console.warn(`Warn: 传入${t}无法解析为Color`),this.color=new Ws(255,255,255))}toRGBA(){return this.color.formatRgb()}toString(){return this.color.formatRgb()}toHex(){return this.color.formatHex()}toHsl(){return this.color.formatHsl()}brighter(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t))),this}add(t){const{r:e,g:i,b:s}=this.color;return this.color.r+=Math.min(255,e+t.color.r),this.color.g+=Math.min(255,i+t.color.g),this.color.b+=Math.min(255,s+t.color.b),this}sub(t){return this.color.r=Math.max(0,this.color.r-t.color.r),this.color.g=Math.max(0,this.color.g-t.color.g),this.color.b=Math.max(0,this.color.b-t.color.b),this}multiply(t){const{r:e,g:i,b:s}=this.color;return this.color.r=Math.max(0,Math.min(255,Math.floor(e*t.color.r))),this.color.g=Math.max(0,Math.min(255,Math.floor(i*t.color.g))),this.color.b=Math.max(0,Math.min(255,Math.floor(s*t.color.b))),this}getHSVBrightness(){return Math.max(this.color.r,this.color.g,this.color.b)/255}getHSLBrightness(){return.5*(Math.max(this.color.r,this.color.g,this.color.b)/255+Math.min(this.color.r,this.color.g,this.color.b)/255)}setHsl(t,e,i){const s=this.color.opacity,n=Rs(this.color.r,this.color.g,this.color.b),r=Os(D(t)?n.h:Ps(t,0,360),D(e)?n.s:e>=0&&e<=1?100*e:e,D(i)?n.l:i<=1&&i>=0?100*i:i);return this.color=new Ws(r.r,r.g,r.b,s),this}setRGB(t,e,i){return!D(t)&&(this.color.r=t),!D(e)&&(this.color.g=e),!D(i)&&(this.color.b=i),this}setHex(t){const e=`${t}`.trim().toLowerCase(),i=Ns(e,!0);return null!=i?i:this}setColorName(t){const e=Fs[t.toLowerCase()];return void 0!==e?this.setHex(e):console.warn("THREE.Color: Unknown color "+t),this}setScalar(t){return this.color.r=t,this.color.g=t,this.color.b=t,this}setOpacity(t=1){return this.color.opacity=t,this}getLuminance(){return(.2126*this.color.r+.7152*this.color.g+.0722*this.color.b)/255}getLuminance2(){return(.2627*this.color.r+.678*this.color.g+.0593*this.color.b)/255}getLuminance3(){return(.299*this.color.r+.587*this.color.g+.114*this.color.b)/255}clone(){return new Vs(this.color.toString())}copyGammaToLinear(t,e=2){return this.color.r=Math.pow(t.color.r,e),this.color.g=Math.pow(t.color.g,e),this.color.b=Math.pow(t.color.b,e),this}copyLinearToGamma(t,e=2){const i=e>0?1/e:1;return this.color.r=Math.pow(t.color.r,i),this.color.g=Math.pow(t.color.g,i),this.color.b=Math.pow(t.color.b,i),this}convertGammaToLinear(t){return this.copyGammaToLinear(this,t),this}convertLinearToGamma(t){return this.copyLinearToGamma(this,t),this}copySRGBToLinear(t){return this.color.r=Hs(t.color.r),this.color.g=Hs(t.color.g),this.color.b=Hs(t.color.b),this}copyLinearToSRGB(t){return this.color.r=zs(t.color.r),this.color.g=zs(t.color.g),this.color.b=zs(t.color.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}}class Ws{constructor(t,e,i,s){this.r=isNaN(+t)?255:Math.max(0,Math.min(255,+t)),this.g=isNaN(+e)?255:Math.max(0,Math.min(255,+e)),this.b=isNaN(+i)?255:Math.max(0,Math.min(255,+i)),M(s)?this.opacity=isNaN(+s)?1:Math.max(0,Math.min(1,+s)):this.opacity=1}formatHex(){return`#${Ys(this.r)+Ys(this.g)+Ys(this.b)+(1===this.opacity?"":Ys(255*this.opacity))}`}formatRgb(){const t=this.opacity;return`${1===t?"rgb(":"rgba("}${this.r},${this.g},${this.b}${1===t?")":`,${t})`}`}formatHsl(){const t=this.opacity,{h:e,s:i,l:s}=Rs(this.r,this.g,this.b);return`${1===t?"hsl(":"hsla("}${e},${i}%,${s}%${1===t?")":`,${t})`}`}toString(){return this.formatHex()}}var Gs;!function(t){t[t.Color255=0]="Color255",t[t.Color1=1]="Color1"}(Gs||(Gs={}));class Us{static Get(t,e=Gs.Color1,i=[0,0,0,1]){if(e===Gs.Color1){const e=Us.store1[t];if(e)return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i;const s=Vs.parseColorString(t);if(s){const e=[s.r/255,s.g/255,s.b/255,s.opacity];Us.store1[t]=e,Us.store255[t]=[s.r,s.g,s.b,s.opacity],i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3]}return i}const s=Us.store255[t];if(s)return i[0]=s[0],i[1]=s[1],i[2]=s[2],i[3]=s[3],i;const n=Vs.parseColorString(t);return n&&(Us.store1[t]=[n.r/255,n.g/255,n.b/255,n.opacity],Us.store255[t]=[n.r,n.g,n.b,n.opacity],i[0]=n.r,i[1]=n.g,i[2]=n.b,i[3]=n.opacity),i}static Set(t,e,i){if(e===Gs.Color1){if(Us.store1[t])return;Us.store1[t]=i,Us.store255[t]=[Math.floor(255*i[0]),Math.floor(255*i[1]),Math.floor(255*i[2]),Math.floor(255*i[3])]}else{if(Us.store255[t])return;Us.store255[t]=i,Us.store1[t]=[i[0]/255,i[1]/255,i[2]/255,i[3]]}}}function $s(t,e=!1){return Array.isArray(t)&&h(t[0])?e?`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])},${t[3].toFixed(2)})`:`rgb(${Math.round(t[0])},${Math.round(t[1])},${Math.round(t[2])})`:t}function Xs(t,e,i,s,n){return Array.isArray(t)&&!h(t[0])||Array.isArray(e)&&!h(e[0])?new Array(4).fill(0).map(((n,r)=>Ks(y(t)?t[r]:t,y(e)?e[r]:e,i,s))):Ks(t,e,i,s,n)}function Ks(t,e,i,s,n){if(!t||!e)return t&&$s(t)||e&&$s(e)||!1;let r,a,o=!1,l=!1;if(Array.isArray(t)?r=t:"string"==typeof t?r=Us.Get(t,Gs.Color255):o=!0,Array.isArray(e)?a=e:"string"==typeof e?a=Us.Get(e,Gs.Color255):l=!0,o!==l){const r=o?t:e,a=o?e:t,l=Object.assign(Object.assign({},r),{stops:r.stops.map((t=>Object.assign(Object.assign({},t),{color:$s(a)})))});return o?Xs(r,l,i,s,n):Xs(l,r,i,s,n)}if(o){if(t.gradient===e.gradient){const s=t,n=e,r=s.stops,a=n.stops;if(r.length!==a.length)return!1;if("linear"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"linear",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Js(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("radial"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"radial",x0:t.x0+(e.x0-t.x0)*i,x1:t.x1+(e.x1-t.x1)*i,y0:t.y0+(e.y0-t.y0)*i,y1:t.y1+(e.y1-t.y1)*i,r0:t.r0+(e.r0-t.r0)*i,r1:t.r1+(e.r1-t.r1)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Js(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i);if("conical"===s.gradient)return function(t,e,i){const s=t.stops,n=e.stops;return{gradient:"conical",startAngle:t.startAngle+(e.startAngle-t.startAngle)*i,endAngle:t.endAngle+(e.endAngle-t.endAngle)*i,x:t.x+(e.x-t.x)*i,y:t.y+(e.y-t.y)*i,stops:new Array(s.length).fill(0).map(((t,e)=>({color:Js(s[e].color,n[e].color,i),offset:s[e].offset+(n[e].offset-s[e].offset)*i})))}}(s,n,i)}return!1}return n&&n(r,a),$s(function(t,e,i){return[t[0]+(e[0]-t[0])*i,t[1]+(e[1]-t[1])*i,t[2]+(e[2]-t[2])*i,t[3]+(e[3]-t[3])*i]}(r,a,i),s)}Us.store255={},Us.store1={};const qs=[0,0,0,0],Zs=[0,0,0,0];function Js(t,e,i){return Us.Get(t,Gs.Color255,qs),Us.Get(e,Gs.Color255,Zs),`rgba(${Math.round(qs[0]+(Zs[0]-qs[0])*i)},${Math.round(qs[1]+(Zs[1]-qs[1])*i)},${Math.round(qs[2]+(Zs[2]-qs[2])*i)},${qs[3]+(Zs[3]-qs[3])*i})`}class Qs{static GetImage(t,e){var i;const s=Qs.cache.get(t);s?"fail"===s.loadState?xi.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):Qs.loadImage(t,e)}static GetSvg(t,e){var i;let s=Qs.cache.get(t);s?"fail"===s.loadState?xi.global.getRequestAnimationFrame()((()=>{e.imageLoadFail(t)})):"init"===s.loadState||"loading"===s.loadState?null===(i=s.waitingMark)||void 0===i||i.push(e):e&&e.imageLoadSuccess(t,s.data):(s={type:"image",loadState:"init"},Qs.cache.set(t,s),s.dataPromise=xi.global.loadSvg(t),s.dataPromise?(s.waitingMark=[e],s.dataPromise.then((e=>{var i;s.loadState=(null==e?void 0:e.data)?"success":"fail",s.data=null==e?void 0:e.data,null===(i=s.waitingMark)||void 0===i||i.map(((i,n)=>{(null==e?void 0:e.data)?(s.loadState="success",s.data=e.data,i.imageLoadSuccess(t,e.data)):(s.loadState="fail",i.imageLoadFail(t))})),s.waitingMark&&(s.waitingMark=[])}))):(s.loadState="fail",e.imageLoadFail(t)))}static GetFile(t,e){let i=Qs.cache.get(t);return i?"init"===i.loadState||"fail"===i.loadState?Promise.reject():"loading"===i.loadState?i.dataPromise.then((t=>t.data)):Promise.resolve(i.data):(i={type:e,loadState:"init"},Qs.cache.set(t,i),"arrayBuffer"===e?i.dataPromise=xi.global.loadArrayBuffer(t):"blob"===e?i.dataPromise=xi.global.loadBlob(t):"json"===e&&(i.dataPromise=xi.global.loadJson(t)),i.dataPromise.then((t=>t.data)))}static loading(){setTimeout((()=>{if(!Qs.isLoading&&Qs.toLoadAueue.length){Qs.isLoading=!0;const t=Qs.toLoadAueue.splice(0,10),e=[];t.forEach((t=>{const{url:i,marks:s}=t,n={type:"image",loadState:"init"};if(Qs.cache.set(i,n),n.dataPromise=xi.global.loadImage(i),n.dataPromise){n.waitingMark=s;const t=n.dataPromise.then((t=>{var e;n.loadState=(null==t?void 0:t.data)?"success":"fail",n.data=null==t?void 0:t.data,null===(e=n.waitingMark)||void 0===e||e.map(((e,s)=>{(null==t?void 0:t.data)?(n.loadState="success",n.data=t.data,e.imageLoadSuccess(i,t.data)):(n.loadState="fail",e.imageLoadFail(i))})),n.waitingMark&&(n.waitingMark=[])}));e.push(t)}else n.loadState="fail",s.forEach((t=>t.imageLoadFail(i)))})),Promise.all(e).then((()=>{Qs.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Qs.loading()})).catch((t=>{console.error(t),Qs.isLoading=!1,this.onLoadSuccessCb.forEach((t=>t())),Qs.loading()}))}}),0)}static loadImage(t,e){const i=tn(t,Qs.toLoadAueue);if(-1!==i)return Qs.toLoadAueue[i].marks.push(e),void Qs.loading();Qs.toLoadAueue.push({url:t,marks:[e]}),Qs.loading()}static improveImageLoading(t){const e=tn(t,Qs.toLoadAueue);if(-1!==e){const t=Qs.toLoadAueue.splice(e,1);Qs.toLoadAueue.unshift(t[0])}}static onLoadSuccess(t){this.onLoadSuccessCb.push(t)}}function tn(t,e){for(let i=0;it?y(t)?0===t.length?0:1===t.length?t[0]:2===t.length?(nn[0]=t[0],nn[2]=t[0],nn[1]=t[1],nn[3]=t[1],nn):t:t:0,an=[{x:0,y:0},{x:0,y:0},{x:0,y:0},{x:0,y:0}],on=[1,2,3,0,1,2,3,0];function ln(t,e,i,s){for(;t>=lt;)t-=lt;for(;t<0;)t+=lt;for(;t>e;)e+=lt;an[0].x=i,an[1].y=i,an[2].x=-i,an[3].y=-i;const n=Math.ceil(t/at)%4,r=Math.ceil(e/at)%4;if(s.add(ct(t)*i,gt(t)*i),s.add(ct(e)*i,gt(e)*i),n!==r||e-t>rt){let t=!1;for(let e=0;ee.length){s=e.map((t=>{const e=new ye(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{const e=new ye(t.x,t.y,t.x1,t.y1);return e.defined=t.defined,e}));for(let n=0;n{this.appendDuration(Date.now()-this.lastDate),t(0)}),this.timeout,!0)}clear(t){clearTimeout(t)}appendDuration(t){this.durations.push(t),this.durations.length>this.durationsListThreshold&&this.durations.shift(),this.timeout=Math.min(Math.max(this.durations.reduce(((t,e)=>t+e),0)/this.durations.length,1e3/60),1e3/30)}}un.TimeOut=1e3/60;const pn=new un,gn=(t,e)=>S(t)&&"%"===t[t.length-1]?e*(Number.parseFloat(t.substring(0,t.length-1))/100):t,mn=new Pt,_n=new qt,fn=["lineWidth","scaleX","scaleY","angle","anchor","visible"],vn=["x","y"],yn=["scaleX","scaleY"],bn=["angle"],xn=new ye,Sn={strokeSeg:1,boundsPadding:2,pickMode:1,boundsMode:1,customPickShape:1,pickable:1,childrenPickable:1,visible:1,zIndex:1,layout:1,keepDirIn3d:1,globalZIndex:1,outerBorder:1,innerBorder:1,lineDash:1,lineCap:1,lineJoin:1,miterLimit:2,strokeBoundsBuffer:2,scaleCenter:1,anchor:1,anchor3d:1,postMatrix:1,backgroundMode:2,background:1,texture:1,cursor:1,html:1};class Mn extends bs{static mixin(t){const e=Object.keys(t);for(let i=0;i{this.animates.delete(e.id)})),e}onAttributeUpdate(t){t&&t.skipUpdateCallback||(xi.graphicService.onAttributeUpdate(this),this._emitCustomEvent("afterAttributeUpdate",t))}update(t){t?(t.bounds&&this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),t.trans&&this.tryUpdateLocalTransMatrix()):(this.tryUpdateAABBBounds("imprecise"===this.attribute.boundsMode),this.tryUpdateLocalTransMatrix())}hasState(t){return!(!this.currentStates||!this.currentStates.length)&&(!!D(t)||this.currentStates.includes(t))}getState(t){var e;return null===(e=this.states)||void 0===e?void 0:e[t]}applyStateAttrs(t,e,i,s){var n,r,a,o;if(i){const i=Object.keys(t),l=this.getNoWorkAnimateAttr(),h={};let d;i.forEach((e=>{l[e]?(d||(d={}),d[e]=t[e]):h[e]=s&&void 0===t[e]?this.getDefaultAttribute(e):t[e]}));const c=this.animate({slience:!0});c.stateNames=e,c.to(h,null!==(r=null===(n=this.stateAnimateConfig)||void 0===n?void 0:n.duration)&&void 0!==r?r:200,null!==(o=null===(a=this.stateAnimateConfig)||void 0===a?void 0:a.easing)&&void 0!==o?o:"cubicOut"),d&&this.setAttributes(d,!1,{type:le.STATE})}else this.stopStateAnimates(),this.setAttributes(t,!1,{type:le.STATE})}updateNormalAttrs(t){const e={};this.normalAttrs?(Object.keys(t).forEach((t=>{t in this.normalAttrs?(e[t]=this.normalAttrs[t],delete this.normalAttrs[t]):e[t]=this.getNormalAttribute(t)})),Object.keys(this.normalAttrs).forEach((e=>{t[e]=this.normalAttrs[e]}))):Object.keys(t).forEach((t=>{e[t]=this.getNormalAttribute(t)})),this.normalAttrs=e}stopStateAnimates(t="end"){this.animates&&this.animates.forEach((e=>{e.stateNames&&(e.stop(t),this.animates.delete(e.id))}))}getNormalAttribute(t){let e=this.attribute[t];return this.animates&&this.animates.forEach((i=>{if(i.stateNames){const s=i.getEndProps();ms(s,t)&&(e=s[t])}})),e}clearStates(t){this.hasState()&&this.normalAttrs?(this.currentStates=[],this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}removeState(t,e){if((this.currentStates?this.currentStates.indexOf(t):-1)>=0){const i=this.currentStates.filter((e=>e!==t));this.useStates(i,e)}}toggleState(t,e){if(this.hasState(t))this.removeState(t,e);else if((this.currentStates?this.currentStates.indexOf(t):-1)<0){const i=this.currentStates?this.currentStates.slice():[];i.push(t),this.useStates(i,e)}}addState(t,e,i){var s;if(this.currentStates&&this.currentStates.includes(t)&&(e||1===this.currentStates.length))return;const n=e&&(null===(s=this.currentStates)||void 0===s?void 0:s.length)?this.currentStates.concat([t]):[t];this.useStates(n,i)}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;const s={};t.forEach((e=>{var i;const n=this.stateProxy?this.stateProxy(e,t):null===(i=this.states)||void 0===i?void 0:i[e];n&&Object.assign(s,n)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}addUpdateBoundTag(){this._updateTag|=ae.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}addUpdateShapeTag(){this._updateTag|=ae.UPDATE_SHAPE}addUpdateShapeAndBoundsTag(){this._updateTag|=ae.UPDATE_SHAPE_AND_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag(),this.glyphHost&&this.glyphHost.addUpdateBoundTag()}updateShapeAndBoundsTagSetted(){return(this._updateTag&ae.UPDATE_SHAPE_AND_BOUNDS)===ae.UPDATE_SHAPE_AND_BOUNDS}clearUpdateBoundTag(){this._updateTag&=ae.CLEAR_BOUNDS}addUpdatePositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ae.UPDATE_GLOBAL_LOCAL_MATRIX}addUpdateGlobalPositionTag(){this.shadowRoot&&this.shadowRoot.addUpdateGlobalPositionTag(),this._updateTag|=ae.UPDATE_GLOBAL_MATRIX}clearUpdateLocalPositionTag(){this._updateTag&=ae.CLEAR_LOCAL_MATRIX}clearUpdateGlobalPositionTag(){this._updateTag&=ae.CLEAR_GLOBAL_MATRIX}addUpdateLayoutTag(){this._updateTag|=ae.UPDATE_LAYOUT}clearUpdateLayoutTag(){this._updateTag&=ae.CLEAR_LAYOUT}needUpdateLayout(){return!!(this._updateTag&ae.UPDATE_LAYOUT)}getAnchor(t,e){const i=[0,0],s=()=>{if(e.b)return e.b;const{scaleX:t,scaleY:i,angle:s}=this.attribute;return _n.copy(this._AABBBounds),this.setAttributes({scaleX:1,scaleY:1,angle:0}),e.b=this.AABBBounds.clone(),this._AABBBounds.copy(_n),this.setAttributes({scaleX:t,scaleY:i,angle:s}),e.b};if("string"==typeof t[0]){const e=parseFloat(t[0])/100,n=s();i[0]=n.x1+(n.x2-n.x1)*e}else i[0]=t[0];if("string"==typeof t[1]){const e=parseFloat(t[1])/100,n=s();i[1]=n.y1+(n.y2-n.y1)*e}else i[1]=t[1];return i}doUpdateLocalMatrix(){const{x:t=Qe.x,y:e=Qe.y,scaleX:i=Qe.scaleX,scaleY:s=Qe.scaleY,angle:n=Qe.angle,scaleCenter:r,anchor:a,postMatrix:o}=this.attribute;let l=[0,0];const h={};if(a&&(l=this.getAnchor(a,h)),!r||1===i&&1===s)!function(t,e,i,s,n,r,a,o){const l=e.a,h=e.b,d=e.c,c=e.d,u=e.e,p=e.f,g=ct(a),m=gt(a);let _,f;o?(_=o[0],f=o[1]):(_=i,f=s);const v=_-i,y=f-s,b=l*g+d*m,x=h*g+c*m,S=d*g-l*m,M=c*g-h*m;t.a=n*b,t.b=n*x,t.c=r*S,t.d=r*M,t.e=u+l*_+d*f-b*v-S*y,t.f=p+h*_+c*f-x*v-M*y}(this._transMatrix,this._transMatrix.reset(),t,e,i,s,n,a&&l);else{const a=this._transMatrix;a.reset(),a.translate(l[0],l[1]),a.rotate(n),a.translate(-l[0],-l[1]),a.translate(t,e),l=this.getAnchor(r,h),xi.transformUtil.fromMatrix(a,a).scale(i,s,{x:l[0],y:l[1]})}const d=this.getOffsetXY(Qe);if(this._transMatrix.e+=d.x,this._transMatrix.f+=d.y,o){const t=mn.setValue(o.a,o.b,o.c,o.d,o.e,o.f),e=this._transMatrix;t.multiply(e.a,e.b,e.c,e.d,e.e,e.f),e.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}doUpdateGlobalMatrix(){if(this.parent){this._globalTransMatrix.multiply(this.transMatrix.a,this.transMatrix.b,this.transMatrix.c,this.transMatrix.d,this.transMatrix.e,this.transMatrix.f);const{scrollX:t=0,scrollY:e=0}=this.parent.attribute;this._globalTransMatrix.translate(t,e)}}setStage(t,e){if(this.stage!==t){if(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this.animates&&this.animates.size){const e=t.getTimeline();this.animates.forEach((t=>{t.setTimeline(e)}))}this._onSetStage&&this._onSetStage(this,t,e),xi.graphicService.onSetStage(this,t)}}setStageToShadowRoot(t,e){this.shadowRoot&&this.shadowRoot.setStage(t,e)}onAddStep(t){}onStop(t){t&&this.setAttributes(t,!1,{type:le.ANIMATE_END})}onStep(t,e,i,s,n){const r={};if(i.customAnimate)i.customAnimate.update(n,s,r);else{const a=i.props,o=i.parsedProps,l=i.propKeys;this.stepInterpolate(t,e,r,i,s,n,a,void 0,o,l)}this.setAttributes(r,!1,{type:le.ANIMATE_UPDATE,animationState:{ratio:s,end:n,step:i,isFirstFrameOfStep:t.getLastStep()!==i}}),this.stage&&this.stage.renderNextFrame()}stepInterpolate(t,e,i,s,n,r,a,o,l,h){h||(h=Object.keys(a),s.propKeys=h),r?s.propKeys.forEach((t=>{e.validAttr(t)&&(i[t]=a[t])})):h.forEach((r=>{var h;if(!e.validAttr(r))return;const d=a[r],c=null!==(h=o&&o[r])&&void 0!==h?h:t.getLastPropByName(r,s);if(null==d||null==c||d===c)return void(i[r]=d);let u;u=e.interpolateFunc&&e.interpolateFunc(r,n,c,d,i),u||(u=e.customInterpolate(r,n,c,d,this,i),u||this.defaultInterpolate(d,c,r,i,l,n)||this._interpolate(r,n,c,d,i))})),s.parsedProps=l}defaultInterpolate(t,e,i,s,n,r){if(Number.isFinite(t))return s[i]=e+(t-e)*r,!0;if("fill"===i){n||(n={});const a=n.fillColorArray,o=Xs(e,null!=a?a:t,r,!1,((t,e)=>{n.fillColorArray=e}));return o&&(s[i]=o),!0}if("stroke"===i){n||(n={});const a=n.strokeColorArray,o=Xs(e,null!=a?a:t,r,!1,((t,e)=>{n.strokeColorArray=e}));return o&&(s[i]=o),!0}if("shadowColor"===i){n||(n={});const a=n.shadowColorArray,o=Xs(e,null!=a?a:t,r,!0,((t,e)=>{n.shadowColorArray=e}));return o&&(s[i]=o),!0}return!1}_interpolate(t,e,i,s,n){}getDefaultAttribute(t){return this.getGraphicTheme()[t]}getComputedAttribute(t){var e;return null!==(e=this.attribute[t])&&void 0!==e?e:this.getDefaultAttribute(t)}onSetStage(t,e=!1){this._onSetStage=t,e&&this.stage&&t(this,this.stage)}attachShadow(t){return t&&(t.shadowHost=this),this.shadowRoot=null!=t?t:xi.graphicService.creator.shadowRoot(this),this.addUpdateBoundTag(),this.shadowRoot.setStage(this.stage,this.layer),this.shadowRoot}detachShadow(){this.shadowRoot&&(this.addUpdateBoundTag(),this.shadowRoot=null)}toJson(){return{attribute:this.attribute,_uid:this._uid,type:this.type,name:this.name,children:this.children.map((t=>t.toJson()))}}createPathProxy(t){return S(t,!0)?this.pathProxy=(new qe).fromString(t):this.pathProxy=new qe,this.pathProxy}loadImage(t,e=!1){if(!t||e&&function(t){return!(!t.fill&&!t.stroke)}(t))return;const i=t;this.resources||(this.resources=new Map);const s={data:"init",state:null};this.resources.set(i,s),"string"==typeof t?(s.state="loading",t.startsWith("{t.stop()}))}stopAnimates(t=!1){this._stopAnimates(this.animates),this.shadowRoot&&this.shadowRoot.stopAnimates(!0),this.isContainer&&t&&this.forEachChildren((e=>{e.stopAnimates(t)}))}release(){this.releaseStatus="released",xi.graphicService.onRelease(this)}_emitCustomEvent(t,e){var i,s;if(this._events&&t in this._events){const n=new Ss(t,e);n.bubbles=!1,n.manager=null===(s=null===(i=this.stage)||void 0===i?void 0:i.eventSystem)||void 0===s?void 0:s.manager,this.dispatchEvent(n)}}}Mn.mixin(Ms);function kn(t,e,i,s=0){return t.expand(e+(s/2+(i?function(t,e){return t?e:0}(i,e):0))),t}let An=0;function wn(){return An++}var Tn;function Ln(t){const e=[];let i=0,s="";for(let n=0;nCn.set(t,!0)));const En=new Map;function Dn(t){if(Cn.has(t))return!0;if(En.has(t))return!1;let e=!1;return t.codePointAt(0)<256&&(e=!0),e}[""].forEach((t=>En.set(t,!0)));const Pn=wn(),On=wn(),Rn=wn(),In=wn(),Bn=wn(),Fn=wn(),Yn=wn(),jn=wn(),Hn=wn(),zn=wn(),Nn=wn(),Vn=wn(),Wn=wn(),Gn=wn(),Un=wn(),$n=wn(),Xn=Symbol.for("GraphicService"),Kn=Symbol.for("GraphicCreator"),qn=(Object.keys({"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity"}),{"stroke-linecap":"lineCap","stroke-linejoin":"lineJoin","stroke-dasharray":"lineDash","stroke-dashoffset":"lineDashOffset","stroke-width":"lineWidth","fill-opacity":"fillOpacity","stroke-opacity":"strokeOpacity",stroke:"stroke",fill:"fill"}),Zn=Object.keys(qn);var Jn;!function(t){t[t.LESS_GROUP=0]="LESS_GROUP",t[t.MORE_GROUP=1]="MORE_GROUP"}(Jn||(Jn={}));class Qn extends Mn{constructor(t){super(t),this.type="group",this.parent=null,this.isContainer=!0,this.numberType=Fn,this._childUpdateTag=ae.UPDATE_BOUNDS}setMode(t){"3d"===t?this.set3dMode():this.set2dMode()}set3dMode(){this.in3dMode=!0}set2dMode(){this.in3dMode=!1}setTheme(t){return this.theme||(this.theme=new cs),this.theme.setTheme(t,this)}createTheme(){this.theme||(this.theme=new cs)}visibleAll(t){this.setAttribute("visible",t),this.forEachChildren((e=>{e.isContainer&&e.visibleAll?e.visibleAll(t):e.setAttribute("visible",t)}))}hideAll(){this.visibleAll(!1)}showAll(){this.visibleAll(!0)}containsPoint(t,e,i){if(i===oe.GLOBAL){const i=new ye(t,e);return this.parent&&this.parent.globalTransMatrix.transformPoint(i,i),this.AABBBounds.contains(i.x,i.y)}return this.AABBBounds.contains(t,e)}shouldUpdateAABBBounds(){return!!super.shouldUpdateAABBBounds()||!!(this._childUpdateTag&ae.UPDATE_BOUNDS)}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;xi.graphicService.beforeUpdateAABBBounds(this,this.stage,!0,this._AABBBounds);const t=this.shouldSelfChangeUpdateAABBBounds(),e=this.doUpdateAABBBounds();return this.addUpdateLayoutTag(),xi.graphicService.afterUpdateAABBBounds(this,this.stage,this._AABBBounds,this,t),e}doUpdateLocalMatrix(){const{x:t=Qe.x,y:e=Qe.y,dx:i=Qe.dx,dy:s=Qe.dy,scaleX:n=Qe.scaleX,scaleY:r=Qe.scaleY,angle:a=Qe.angle,postMatrix:o}=this.attribute;if(0!==t||0!==e||0!==i||0!==s||1!==n||1!==r||0!==a||o)return super.doUpdateLocalMatrix();this._transMatrix.reset()}getGraphicTheme(){return ps(this).group}updateAABBBounds(t,e,i){const s=i;i=i.clone();const{width:n,height:r,path:a,clip:o=e.clip,display:l}=t;return a&&a.length?a.forEach((t=>{i.union(t.AABBBounds)})):null!=n&&null!=r&&i.set(0,0,Math.max(0,n),Math.max(0,r)),o||this.forEachChildren((t=>{i.union(t.AABBBounds)})),xi.graphicService.updateTempAABBBounds(i),xi.graphicService.transformAABBBounds(t,i,e,!1,this),s.copy(i),s}doUpdateAABBBounds(){const t=super.doUpdateAABBBounds();return this.parent&&this.parent.addChildUpdateBoundTag(),this._emitCustomEvent("AAABBBoundsChange"),t}clearUpdateBoundTag(){this._updateTag&=ae.CLEAR_BOUNDS,this._childUpdateTag&=ae.CLEAR_BOUNDS}addUpdateBoundTag(){this._updateTag|=ae.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag()}addChildUpdateBoundTag(){this._childUpdateTag&ae.UPDATE_BOUNDS||(this._childUpdateTag|=ae.UPDATE_BOUNDS,this.parent&&this.parent.addChildUpdateBoundTag())}getTheme(){return this.theme.getTheme(this)}incrementalAppendChild(t){const e=super.appendChild(t);return this.stage&&e&&(e.stage=this.stage,e.layer=this.layer),this.addUpdateBoundTag(),xi.graphicService.onAddIncremental(t,this,this.stage),e}incrementalClearChild(){super.removeAllChild(),this.addUpdateBoundTag(),xi.graphicService.onClearIncremental(this,this.stage)}_updateChildToStage(t){return this.stage&&t&&t.setStage(this.stage,this.layer),this.addUpdateBoundTag(),t}appendChild(t,e=!0){const i=super.appendChild(t);return e&&this.stage&&i&&i.setStage(this.stage,this.layer),this.addUpdateBoundTag(),i}insertBefore(t,e){return this._updateChildToStage(super.insertBefore(t,e))}insertAfter(t,e){return this._updateChildToStage(super.insertAfter(t,e))}insertInto(t,e){return this._updateChildToStage(super.insertInto(t,e))}removeChild(t){const e=super.removeChild(t);return t.stage=null,xi.graphicService.onRemove(t),this.addUpdateBoundTag(),e}removeAllChild(t=!1){this.forEachChildren((e=>{xi.graphicService.onRemove(e),t&&e.isContainer&&e.removeAllChild(t)})),super.removeAllChild(),this.addUpdateBoundTag()}setStage(t,e){this.stage!==t&&(this.stage=t,this.layer=e,this.setStageToShadowRoot(t,e),this._onSetStage&&this._onSetStage(this,t,e),xi.graphicService.onSetStage(this,t),this.forEachChildren((e=>{e.setStage(t,this.layer)})))}addUpdatePositionTag(){super.addUpdatePositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}addUpdateGlobalPositionTag(){super.addUpdateGlobalPositionTag(),this.forEachChildren((t=>{t.isContainer&&t.addUpdateGlobalPositionTag()}))}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){if(this._globalTransMatrix){if(this.parent){const t=this.parent.globalTransMatrix;this._globalTransMatrix.setValue(t.a,t.b,t.c,t.d,t.e,t.f)}}else this._globalTransMatrix=this.parent?this.parent.globalTransMatrix.clone():this.transMatrix.clone();this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}shouldUpdateGlobalMatrix(){return!!(this._updateTag&ae.UPDATE_GLOBAL_MATRIX)}_getChildByName(t,e){return this.find((e=>e.name===t),e)}createOrUpdateChild(t,e,i){let s=this._getChildByName(t);return s?s.setAttributes(e):(s=xi.graphicService.creator[i](e),s.name=t,this.add(s)),s}clone(){return new Qn(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Qn.NOWORK_ANIMATE_ATTR}}function tr(t){return new Qn(t)}Qn.NOWORK_ANIMATE_ATTR=Sn;class er extends Qn{get offscreen(){return this.layerHandler.offscreen}get layerMode(){return this.layerHandler.type}get width(){return this.stage?this.stage.width:0}get height(){return this.stage?this.stage.height:0}get viewWidth(){return this.stage?this.stage.viewWidth:0}get viewHeight(){return this.stage?this.stage.viewHeight:0}get dirtyBound(){throw new Error("暂不支持")}get dpr(){return this._dpr}constructor(t,e,i,s){var n;super({}),this.stage=t,this.global=e,this.window=i,this.main=s.main,this.layerHandler=s.layerHandler,this.layerHandler.init(this,i,{main:s.main,canvasId:s.canvasId,width:this.viewWidth,height:this.viewHeight,zIndex:null!==(n=s.zIndex)&&void 0!==n?n:0}),this.layer=this,this.subLayers=new Map,this.theme=new cs,this.background="rgba(0, 0, 0, 0)",this.afterDrawCbs=[]}combineSubLayer(t=!0){const e=Array.from(this.subLayers.values()).sort(((t,e)=>t.zIndex-e.zIndex));this.layerHandler.merge(e.map((e=>(e.layer.subLayers.size&&e.layer.combineSubLayer(t),e.layer.getNativeHandler())))),t&&e.forEach((t=>{t.group&&(t.group.incremental=0)})),e.forEach((t=>{xi.layerService.releaseLayer(this.stage,t.layer)})),this.subLayers.clear()}getNativeHandler(){return this.layerHandler}setStage(t,e){super.setStage(t,this)}pick(t,e){throw new Error("暂不支持")}tryRenderSecondaryLayer(t,e){this.layerHandler.secondaryHandlers&&this.layerHandler.secondaryHandlers.length&&this.layerHandler.secondaryHandlers.forEach((i=>{i.layer.renderCount=this.renderCount,i.layer.render(t,e)}))}render(t,e){var i;this.layerHandler.render([this],{renderService:t.renderService,stage:this.stage,layer:this,viewBox:t.viewBox,transMatrix:t.transMatrix,background:null!==(i=t.background)&&void 0!==i?i:this.background,updateBounds:t.updateBounds},e),this.afterDrawCbs.forEach((t=>t(this))),this.tryRenderSecondaryLayer(t,e)}resize(t,e){this.layerHandler.resize(t,e)}resizeView(t,e){this.layerHandler.resizeView(t,e)}setDpr(t){this.layerHandler.setDpr(t)}afterDraw(t){this.afterDrawCbs.push(t)}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}prepare(t,e){}release(){super.release(),this.layerHandler.release(),this.subLayers&&this.subLayers.forEach((t=>{xi.layerService.releaseLayer(this.stage,t.layer)}))}drawTo(t,e){var i;this.layerHandler.drawTo(t,[this],Object.assign({background:null!==(i=e.background)&&void 0!==i?i:this.background,renderService:e.renderService,viewBox:e.viewBox,transMatrix:e.transMatrix,stage:this.stage,layer:this},e)),this.afterDrawCbs.forEach((t=>t(this)))}}const ir=Symbol.for("TransformUtil"),sr=Symbol.for("GraphicUtil"),nr=Symbol.for("LayerService"),rr=Symbol.for("StaticLayerHandlerContribution"),ar=Symbol.for("DynamicLayerHandlerContribution"),or=Symbol.for("VirtualLayerHandlerContribution");var lr;let hr=lr=class{static GenerateLayerId(){return`${lr.idprefix}_${lr.prefix_count++}`}constructor(){this.layerMap=new Map,this.global=xi.global}tryInit(){this.inited||(this.staticLayerCountInEnv=this.global.getStaticCanvasCount(),this.dynamicLayerCountInEnv=this.global.getDynamicCanvasCount(),this.inited=!0)}getStageLayer(t){return this.layerMap.get(t)}getRecommendedLayerType(t){return t||(0!==this.staticLayerCountInEnv?"static":0!==this.dynamicLayerCountInEnv?"dynamic":"virtual")}getLayerHandler(t){let e;return e="static"===t?Ui.get(rr):"dynamic"===t?Ui.get(ar):Ui.get(or),e}createLayer(t,e={main:!1}){var i;this.tryInit();let s=this.getRecommendedLayerType(e.layerMode);s=e.main||e.canvasId?"static":s;const n=this.getLayerHandler(s),r=new er(t,this.global,t.window,Object.assign(Object.assign({main:!1},e),{layerMode:s,canvasId:null!==(i=e.canvasId)&&void 0!==i?i:lr.GenerateLayerId(),layerHandler:n})),a=this.layerMap.get(t)||[];return a.push(r),this.layerMap.set(t,a),this.staticLayerCountInEnv--,r}prepareStageLayer(t){let e;t.forEachChildren((t=>{const i=t.getNativeHandler();"virtual"===i.type?(i.mainHandler=e,e.secondaryHandlers.push(i)):(e=i,e.secondaryHandlers=[])}))}releaseLayer(t,e){e.release();const i=this.layerMap.get(t)||[];this.layerMap.set(t,i.filter((t=>t!==e)))}layerCount(t){return(this.layerMap.get(t)||[]).length}restLayerCount(t){return"browser"===this.global.env?10:0}releaseStage(t){this.layerMap.delete(t)}};hr.idprefix="visactor_layer",hr.prefix_count=0,hr=lr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],hr);const dr=new B((t=>{t(et).to(st).inSingletonScope(),t(Zi).to(Qi),t(sr).to(ss).inSingletonScope(),t(ir).to(as).inSingletonScope(),t(nr).to(hr).inSingletonScope()})),cr=Symbol.for("IncrementalDrawContribution"),ur=Symbol.for("ArcRender"),pr=Symbol.for("Arc3dRender"),gr=Symbol.for("AreaRender"),mr=Symbol.for("CircleRender"),_r=Symbol.for("GraphicRender"),fr=Symbol.for("GroupRender"),vr=Symbol.for("LineRender"),yr=Symbol.for("PathRender"),br=Symbol.for("PolygonRender"),xr=Symbol.for("RectRender"),Sr=Symbol.for("Rect3DRender"),Mr=Symbol.for("SymbolRender"),kr=Symbol.for("TextRender"),Ar=Symbol.for("RichTextRender"),wr=Symbol.for("Pyramid3dRender"),Tr=Symbol.for("GlyphRender"),Lr=Symbol.for("ImageRender"),Cr=(Symbol.for("RenderSelector"),Symbol.for("DrawContribution"));const Er=Symbol.for("RenderService");Symbol.for("BeforeRenderConstribution");let Dr=class{constructor(t){this.drawContribution=t}prepare(t){t&&this.renderTreeRoots.forEach((e=>{this._prepare(e,t)}))}_prepare(t,e){t.forEachChildren((t=>{this._prepare(t,e)})),t.update({bounds:e,trans:!0})}prepareRenderList(){}beforeDraw(t){}draw(t){this.drawContribution.draw(this,Object.assign({},this.drawParams))}afterDraw(t){this.drawContribution.afterDraw&&this.drawContribution.afterDraw(this,Object.assign({},this.drawParams))}render(t,e){this.renderTreeRoots=t,this.drawParams=e;const i=e.updateBounds;this.prepare(i),this.prepareRenderList(),this.beforeDraw(e),this.draw(e),this.afterDraw(e),this.drawParams=null}};var Pr,Or;Dr=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),(Pr=0,Or=$(Cr),function(t,e){Or(t,e,Pr)}),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Dr);const Rr=new B((t=>{t(Er).to(Dr)})),Ir=(Symbol.for("GraphicPicker"),Symbol.for("PickerService")),Br=(Symbol.for("BoundsPicker"),Symbol.for("GlobalPickerService"));function Fr(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t}function Yr(t,e,i){const s=i[0],n=i[1],r=i[2];let a,o,l,h,d,c,u,p,g,m,_,f;return e===t?(t[12]=e[0]*s+e[4]*n+e[8]*r+e[12],t[13]=e[1]*s+e[5]*n+e[9]*r+e[13],t[14]=e[2]*s+e[6]*n+e[10]*r+e[14],t[15]=e[3]*s+e[7]*n+e[11]*r+e[15]):(a=e[0],o=e[1],l=e[2],h=e[3],d=e[4],c=e[5],u=e[6],p=e[7],g=e[8],m=e[9],_=e[10],f=e[11],t[0]=a,t[1]=o,t[2]=l,t[3]=h,t[4]=d,t[5]=c,t[6]=u,t[7]=p,t[8]=g,t[9]=m,t[10]=_,t[11]=f,t[12]=a*s+d*n+g*r+e[12],t[13]=o*s+c*n+m*r+e[13],t[14]=l*s+u*n+_*r+e[14],t[15]=h*s+p*n+f*r+e[15]),t}function jr(t,e){t[0]=e.a,t[1]=e.b,t[2]=0,t[3]=0,t[4]=e.c,t[5]=e.d,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=e.e,t[13]=e.f,t[14]=0,t[15]=1}function Hr(t,e,i){const s=e[0],n=e[1],r=e[2],a=e[3],o=e[4],l=e[5],h=e[6],d=e[7],c=e[8],u=e[9],p=e[10],g=e[11],m=e[12],_=e[13],f=e[14],v=e[15];let y=i[0],b=i[1],x=i[2],S=i[3];return t[0]=y*s+b*o+x*c+S*m,t[1]=y*n+b*l+x*u+S*_,t[2]=y*r+b*h+x*p+S*f,t[3]=y*a+b*d+x*g+S*v,y=i[4],b=i[5],x=i[6],S=i[7],t[4]=y*s+b*o+x*c+S*m,t[5]=y*n+b*l+x*u+S*_,t[6]=y*r+b*h+x*p+S*f,t[7]=y*a+b*d+x*g+S*v,y=i[8],b=i[9],x=i[10],S=i[11],t[8]=y*s+b*o+x*c+S*m,t[9]=y*n+b*l+x*u+S*_,t[10]=y*r+b*h+x*p+S*f,t[11]=y*a+b*d+x*g+S*v,y=i[12],b=i[13],x=i[14],S=i[15],t[12]=y*s+b*o+x*c+S*m,t[13]=y*n+b*l+x*u+S*_,t[14]=y*r+b*h+x*p+S*f,t[15]=y*a+b*d+x*g+S*v,t}function zr(t,e,i){const s=e[0],n=e[1],r=e[2];let a=i[3]*s+i[7]*n+i[11]*r+i[15];return a=a||1,t[0]=(i[0]*s+i[4]*n+i[8]*r+i[12])/a,t[1]=(i[1]*s+i[5]*n+i[9]*r+i[13])/a,t[2]=(i[2]*s+i[6]*n+i[10]*r+i[14])/a,t}Symbol.for("MatrixAllocate"),Symbol.for("Mat4Allocate");class Nr{constructor(){this.pools=[]}static identity(t){return Fr(t)}allocate(){if(!this.pools.length)return[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];const t=this.pools.pop();return Nr.identity(t),t}allocateByObj(t){let e;e=this.pools.length?this.pools.pop():[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1];for(let i=0;i{let n,r=!1,a=!1;if(e.forEachChildren((t=>(r=t.numberType===On,!r))),e.forEachChildren((t=>(a=!!t.findFace,!a))),r){const t=e.getChildren(),o=[...t];o.sort(((t,e)=>{var i,s,n,r;let a=(null!==(s=null!==(i=t.attribute.startAngle)&&void 0!==i?i:0+t.attribute.endAngle)&&void 0!==s?s:0)/2,o=(null!==(r=null!==(n=e.attribute.startAngle)&&void 0!==n?n:0+e.attribute.endAngle)&&void 0!==r?r:0)/2;for(;a<0;)a+=lt;for(;o<0;)o+=lt;return o-a})),o.forEach((t=>{t._next=null,t._prev=null})),e.removeAllChild(),e.update(),o.forEach((t=>{e.appendChild(t)})),s.hack_pieFace="outside",n=i(r,a),n&&n.graphic||(s.hack_pieFace="inside",n=i(r,a)),n&&n.graphic||(s.hack_pieFace="top",n=i(r,a)),e.removeAllChild(),t.forEach((t=>{t._next=null,t._prev=null})),t.forEach((t=>{e.appendChild(t)}))}else if(a){const s=e.getChildren(),o=s.map((e=>({ave_z:e.findFace().vertices.map((i=>{var s;return t.view(i[0],i[1],null!==(s=i[2]+e.attribute.z)&&void 0!==s?s:0)[2]})).reduce(((t,e)=>t+e),0),g:e})));o.sort(((t,e)=>e.ave_z-t.ave_z)),e.removeAllChild(),o.forEach((t=>{t.g._next=null,t.g._prev=null})),e.update(),o.forEach((t=>{e.add(t.g)})),n=i(r,a),e.removeAllChild(),s.forEach((t=>{t._next=null,t._prev=null})),e.update(),s.forEach((t=>{e.add(t)}))}else n=i(r,a);return n};var Ur=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};const $r=Symbol.for("PickItemInterceptor");let Xr=class{constructor(){this.order=1}afterPickItem(t,e,i,s,n){return t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx?this._pickItem(t,e,i,s,n):null}beforePickItem(t,e,i,s,n){return t.attribute.shadowRootIdx<0?this._pickItem(t,e,i,s,n):null}_pickItem(t,e,i,s,n){var r;if(!t.shadowRoot)return null;const{parentMatrix:a}=n||{};if(!a)return null;const o=e.pickContext;o.highPerformanceSave();const l=null===(r=ps(t))||void 0===r?void 0:r[t.type],{shadowPickMode:h=(null==l?void 0:l.shadowPickMode)}=t.attribute,d=t.shadowRoot,c=Vr.allocateByObj(a),u=new ye(c.a*i.x+c.c*i.y+c.e,c.b*i.x+c.d*i.y+c.f),p=e.pickGroup(d,u,c,s);return o.highPerformanceRestore(),!p.graphic&&p.group&&"full"===h&&(p.graphic=p.group),p}};Xr=Ur([V()],Xr);let Kr=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){const r=t.baseGraphic;if(r&&r.parent){const t=new ye(i.x,i.y),n=e.pickContext;n.highPerformanceSave();const a=r.parent.globalTransMatrix;a.transformPoint(t,t);const o=r.isContainer?e.pickGroup(r,t.clone(),a,s):e.pickItem(r,t.clone(),a,s);return n.highPerformanceRestore(),o}return null}};Kr=Ur([V()],Kr);let qr=class{constructor(){this.order=1}beforePickItem(t,e,i,s,n){if(!t.in3dMode||s.in3dInterceptor)return null;const r=e.pickContext,a=t.stage;if(!r||!a)return null;if(s.in3dInterceptor=!0,r.save(),this.initCanvasCtx(r),r.camera=a.camera,t.isContainer){const a=Gr(r,t,(()=>e.pickGroup(t,i,n.parentMatrix,s)),s);return r.camera=null,s.in3dInterceptor=!1,r.restore(),a}return r.restore(),null}initCanvasCtx(t){t.setTransformForCurrent()}};qr=Ur([V()],qr);const Zr=new B(((t,e,i)=>{i(Ir)||(t(Br).toSelf(),t(Ir).toService(Br)),t(qr).toSelf().inSingletonScope(),t($r).toService(qr),t(Xr).toSelf().inSingletonScope(),t($r).toService(Xr),t(Kr).toSelf().inSingletonScope(),t($r).toService(Kr),Z(t,$r)}));function Jr(t,e=0,i=0){if(!t)return{width:e,height:i};let s;try{s=null===window||void 0===window?void 0:window.getComputedStyle}catch(t){s=()=>({})}const n=s(t);if(/^(\d*\.?\d+)(px)$/.exec(n.width)){const s=parseFloat(n.width)-parseFloat(n.paddingLeft)-parseFloat(n.paddingRight)||t.clientWidth-1,r=parseFloat(n.height)-parseFloat(n.paddingTop)-parseFloat(n.paddingBottom)||t.clientHeight-1;return{width:s<=0?e:s,height:r<=0?i:r}}return{width:e,height:i}}function Qr(t,e){let i=t.parentNode;for(;null!==i;){if(i===e)return!0;i=i.parentNode}return!1}const ta=t=>t.replace(/([A-Z])/g,"-$1").toLowerCase();function ea(t,e){return"end"===t||"right"===t?-e:"center"===t?-e/2:0}function ia(t,e,i,s=0){return"middle"===t?-e/2:"top"===t?0:"bottom"===t?s-e:t&&"alphabetic"!==t?0:(i||(i=e),-(e-i)/2-.79*i)}function sa(t,e,i){var s;const{x:n=i.x,y:r=i.y,z:a=i.z,dx:o=i.dx,dy:l=i.dy,dz:h=i.dz,scaleX:d=i.scaleX,scaleY:c=i.scaleY,scaleZ:u=i.scaleZ,alpha:p=i.alpha,beta:g=i.beta,angle:m=i.angle,anchor3d:_=e.attribute.anchor,anchor:f}=e.attribute,v=[0,0,0];if(_){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;v[0]=i.x1+(i.x2-i.x1)*t}else v[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;v[1]=i.x1+(i.x2-i.x1)*t}else v[1]=_[1];v[2]=null!==(s=_[2])&&void 0!==s?s:0}if(Fr(t),Yr(t,t,[n+o,r+l,a+h]),Yr(t,t,[v[0],v[1],v[2]]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[4],a=e[5],o=e[6],l=e[7],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[4]=r*n+h*s,t[5]=a*n+d*s,t[6]=o*n+c*s,t[7]=l*n+u*s,t[8]=h*n-r*s,t[9]=d*n-a*s,t[10]=c*n-o*s,t[11]=u*n-l*s}(t,t,g),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[8],d=e[9],c=e[10],u=e[11];e!==t&&(t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n-h*s,t[1]=a*n-d*s,t[2]=o*n-c*s,t[3]=l*n-u*s,t[8]=r*s+h*n,t[9]=a*s+d*n,t[10]=o*s+c*n,t[11]=l*s+u*n}(t,t,p),Yr(t,t,[-v[0],-v[1],v[2]]),function(t,e,i){const s=i[0],n=i[1],r=i[2];t[0]=e[0]*s,t[1]=e[1]*s,t[2]=e[2]*s,t[3]=e[3]*s,t[4]=e[4]*n,t[5]=e[5]*n,t[6]=e[6]*n,t[7]=e[7]*n,t[8]=e[8]*r,t[9]=e[9]*r,t[10]=e[10]*r,t[11]=e[11]*r,t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]}(t,t,[d,c,u]),m){const i=Wr.allocate(),s=[0,0];if(f){if("string"==typeof _[0]){const t=parseFloat(_[0])/100,i=e.AABBBounds;s[0]=i.x1+(i.x2-i.x1)*t}else s[0]=_[0];if("string"==typeof _[1]){const t=parseFloat(_[1])/100,i=e.AABBBounds;s[1]=i.x1+(i.x2-i.x1)*t}else s[1]=_[1]}Yr(i,i,[s[0],s[1],0]),function(t,e,i){const s=Math.sin(i),n=Math.cos(i),r=e[0],a=e[1],o=e[2],l=e[3],h=e[4],d=e[5],c=e[6],u=e[7];e!==t&&(t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15]),t[0]=r*n+h*s,t[1]=a*n+d*s,t[2]=o*n+c*s,t[3]=l*n+u*s,t[4]=h*n-r*s,t[5]=d*n-a*s,t[6]=c*n-o*s,t[7]=u*n-l*s}(i,i,m),Yr(i,i,[-s[0],-s[1],0]),Hr(t,t,i)}}let na=class{constructor(t){this.creator=t,this.hooks={onAttributeUpdate:new Q(["graphic"]),onSetStage:new Q(["graphic","stage"]),onRemove:new Q(["graphic"]),onRelease:new Q(["graphic"]),onAddIncremental:new Q(["graphic","group","stage"]),onClearIncremental:new Q(["graphic","group","stage"]),beforeUpdateAABBBounds:new Q(["graphic","stage","willUpdate","aabbBounds"]),afterUpdateAABBBounds:new Q(["graphic","stage","aabbBounds","globalAABBBounds","selfChange"])},this.tempAABBBounds1=new qt,this.tempAABBBounds2=new qt}onAttributeUpdate(t){this.hooks.onAttributeUpdate.taps.length&&this.hooks.onAttributeUpdate.call(t)}onSetStage(t,e){this.hooks.onSetStage.taps.length&&this.hooks.onSetStage.call(t,e)}onRemove(t){this.hooks.onRemove.taps.length&&this.hooks.onRemove.call(t)}onRelease(t){this.hooks.onRelease.taps.length&&this.hooks.onRelease.call(t)}onAddIncremental(t,e,i){this.hooks.onAddIncremental.taps.length&&this.hooks.onAddIncremental.call(t,e,i)}onClearIncremental(t,e){this.hooks.onClearIncremental.taps.length&&this.hooks.onClearIncremental.call(t,e)}beforeUpdateAABBBounds(t,e,i,s){this.hooks.beforeUpdateAABBBounds.taps.length&&this.hooks.beforeUpdateAABBBounds.call(t,e,i,s)}afterUpdateAABBBounds(t,e,i,s,n){this.hooks.afterUpdateAABBBounds.taps.length&&this.hooks.afterUpdateAABBBounds.call(t,e,i,s,n)}updatePathProxyAABBBounds(t,e){const i="function"==typeof e.pathProxy?e.pathProxy(e.attribute):e.pathProxy;if(!i)return!1;const s=new Rt(t);return ve(i.commandList,s,0,0),!0}updateHTMLTextAABBBounds(t,e,i,s){const{textAlign:n,textBaseline:r}=t;if(null!=t.forceBoundsHeight){const e=h(t.forceBoundsHeight)?t.forceBoundsHeight:t.forceBoundsHeight(),s=ia(r,e,e);i.set(i.x1,s,i.x2,s+e)}if(null!=t.forceBoundsWidth){const e=h(t.forceBoundsWidth)?t.forceBoundsWidth:t.forceBoundsWidth(),s=ea(n,e);i.set(s,i.y1,s+e,i.y2)}}combindShadowAABBBounds(t,e){if(e&&e.shadowRoot){const i=e.shadowRoot.AABBBounds;t.union(i)}}transformAABBBounds(t,e,i,s,n){if(!e.empty()){const{scaleX:n=i.scaleX,scaleY:r=i.scaleY,stroke:a=i.stroke,shadowBlur:o=i.shadowBlur,lineWidth:l=i.lineWidth,pickStrokeBuffer:h=i.pickStrokeBuffer,strokeBoundsBuffer:d=i.strokeBoundsBuffer}=t,c=this.tempAABBBounds1,u=this.tempAABBBounds2;if(a&&l&&(kn(c,(l+h)/Math.abs(n+r),s,d),e.union(c),c.setValue(u.x1,u.y1,u.x2,u.y2)),o){const{shadowOffsetX:s=i.shadowOffsetX,shadowOffsetY:a=i.shadowOffsetY}=t;kn(c,o/Math.abs(n+r)*2,!1,d+1),c.translate(s,a),e.union(c)}}if(this.combindShadowAABBBounds(e,n),e.empty())return;let r=!0;const a=n.transMatrix;n&&n.isContainer&&(r=!(1===a.a&&0===a.b&&0===a.c&&1===a.d&&0===a.e&&0===a.f)),r&&Xt(e,e,a)}validCheck(t,e,i,s){if(!s)return!0;if(null!=t.forceBoundsHeight||null!=t.forceBoundsWidth)return!0;if(s.shadowRoot)return!0;if(!s.valid)return i.clear(),!1;const{visible:n=e.visible}=t;return!!n||(i.clear(),!1)}updateTempAABBBounds(t){const e=this.tempAABBBounds1,i=this.tempAABBBounds2;return e.setValue(t.x1,t.y1,t.x2,t.y2),i.setValue(t.x1,t.y1,t.x2,t.y2),{tb1:e,tb2:i}}};na=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Kn)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],na);const ra=new class{constructor(){this.store=new Map}RegisterGraphicCreator(t,e){this.store.set(t,e),this[t]=e}CreateGraphic(t,e){const i=this.store.get(t);return i?i(e):null}},aa=new B((t=>{t(Xn).to(na).inSingletonScope(),t(Kn).toConstantValue(ra)})),oa=Symbol.for("AutoEnablePlugins"),la=Symbol.for("PluginService");var ha=function(t,e){return function(i,s){e(i,s,t)}};let da=class{constructor(t){this.autoEnablePlugins=t,this.onStartupFinishedPlugin=[],this.onRegisterPlugin=[],this.actived=!1}active(t,e){this.stage=t,this.actived=!0;const{pluginList:i}=e;i&&Ui.isBound(oa)&&this.autoEnablePlugins.getContributions().forEach((t=>{i.includes(t.name)&&this.register(t)}))}findPluginsByName(t){const e=[];return this.onStartupFinishedPlugin.forEach((i=>{i.name===t&&e.push(i)})),this.onRegisterPlugin.forEach((i=>{i.name===t&&e.push(i)})),e}register(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.push(t):"onRegister"===t.activeEvent&&(this.onRegisterPlugin.push(t),t.activate(this))}unRegister(t){"onStartupFinished"===t.activeEvent?this.onStartupFinishedPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1):"onRegister"===t.activeEvent&&this.onRegisterPlugin.splice(this.onStartupFinishedPlugin.indexOf(t),1),t.deactivate(this)}release(...t){this.onStartupFinishedPlugin.forEach((t=>{t.deactivate(this)})),this.onStartupFinishedPlugin=[],this.onRegisterPlugin.forEach((t=>{t.deactivate(this)})),this.onRegisterPlugin=[]}};da=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),ha(0,$(K)),ha(0,X(oa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],da);const ca=new B((t=>{t(la).to(da),function(t,e){t(K).toDynamicValue((({container:t})=>new q(e,t))).whenTargetNamed(e)}(t,oa)})),ua=new B((t=>{Z(t,tt)})),pa=new B((t=>{t(Di).to(Pi).inSingletonScope(),Z(t,Di)}));let ga=class{constructor(){this.type="static",this.offscreen=!1,this.global=xi.global}setDpr(t){this.canvas.dpr=t}init(t,e,i){if(this.layer=t,this.window=e,i.main)this.main=!0,this.context=e.getContext(),this.canvas=this.context.getCanvas();else{let t;this.main=!1,i.canvasId&&(t=this.global.getElementById(i.canvasId)),t||(t=this.global.createCanvas({width:e.width,height:e.height})),t.style&&(t.style["pointer-events"]="none");const s=e.getContext().getCanvas().nativeCanvas,n=Ki({nativeCanvas:t,width:e.width,height:e.height,dpr:e.dpr,id:i.canvasId,canvasControled:!0,container:e.getContainer(),x:s.offsetLeft,y:s.offsetTop});n.applyPosition(),this.canvas=n,this.context=n.getContext()}}resize(t,e){this.canvas.resize(t,e)}resizeView(t,e){}render(t,e,i){var s;if(!this.main){const t=this.window.getContext().getCanvas().nativeCanvas;!t||this.canvas.x===t.offsetLeft&&this.canvas.y===t.offsetTop||(this.canvas.x=t.offsetLeft,this.canvas.y=t.offsetTop,this.canvas.applyPosition())}e.renderService.render(t,Object.assign(Object.assign({context:this.context,clear:null!==(s=e.background)&&void 0!==s?s:"#ffffff"},e),i))}merge(t){t.forEach((t=>{const e=t.getContext().canvas.nativeCanvas;this.context.drawImage(e,0,0)}))}prepare(t,e){}drawTo(t,e,i){var s;const n=t.getContext();i.renderService.render(e,Object.assign(Object.assign({context:n},i),{clear:i.clear?null!==(s=i.background)&&void 0!==s?s:"#fff":void 0}))}getContext(){return this.context}release(){this.canvas.release()}};ga=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],ga);const ma=new B((t=>{t(ga).toSelf(),t(rr).toService(ga)})),_a=U(j);function fa(t,e,i){const s={},n=[];return t.forEachChildren((t=>{const{zIndex:i=e}=t.attribute;s[i]?s[i].push(t):(s[i]=[t],n.push(i))}),i),n.sort(((t,e)=>i?e-t:t-e)),{childMap:s,zIdxArray:n}}function va(t,e,i,s=!1,n=!1){let r=!1;if(n)r=!0;else{let i;t.forEachChildren(((t,s)=>{const{zIndex:n=e}=t.attribute;if(0===s)i=n;else if(i!==n)return r=!0,!0;return!1}),s)}if(r){const{childMap:r,zIdxArray:a}=fa(t,e,s);let o=!1;for(let t=0;t{var i,n;return(s?-1:1)*((null!==(i=e.attribute.z)&&void 0!==i?i:0)-(null!==(n=t.attribute.z)&&void 0!==n?n:0))}));for(let t=0;t{const{zIndex:s=i}=t.attribute;if(0===e);else if(void 0!==s)return n=!0,!0;return!1}),s);let r=null,a=!1;if(n){const{childMap:n,zIdxArray:o}=fa(t,i,s);let l=!1;for(let t=0;ta?(r=t,!0):(t._uid===e&&(a=!0),!1)),s);return r}const xa=Symbol.for("DrawItemInterceptor"),Sa=new qt,Ma=new qt;class ka{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0||(t.attribute.shadowRootIdx>0||!t.attribute.shadowRootIdx||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0)&&this.drawItem(t,e,i,s,n),!1}beforeDrawItem(t,e,i,s,n){return null==t.attribute.shadowRootIdx&&t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx>0||(t.attribute.shadowRootIdx<0||t.shadowRoot&&t.shadowRoot.attribute.shadowRootIdx<0)&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.shadowRoot)return!1;const{context:r}=i;if(r.highPerformanceSave(),r.transformFromMatrix(t.transMatrix,!0),s.dirtyBounds&&s.backupDirtyBounds){Sa.copy(s.dirtyBounds),Ma.copy(s.backupDirtyBounds);const e=t.globalTransMatrix.getInverse();s.dirtyBounds.copy(s.backupDirtyBounds).transformWithMatrix(e),s.backupDirtyBounds.copy(s.dirtyBounds)}return s.renderGroup(t.shadowRoot,i,Vr.allocate(1,0,0,1,0,0)),r.highPerformanceRestore(),s.dirtyBounds&&s.backupDirtyBounds&&(s.dirtyBounds.copy(Sa),s.backupDirtyBounds.copy(Ma)),!0}}class Aa{constructor(){this.order=1}afterDrawItem(t,e,i,s,n){return t.attribute._debug_bounds&&this.drawItem(t,e,i,s,n),!1}drawItem(t,e,i,s,n){if(!t.attribute._debug_bounds)return!1;const{context:r}=i;r.highPerformanceSave(),t.parent&&r.setTransformFromMatrix(t.parent.globalTransMatrix,!0),t.glyphHost&&t.glyphHost.parent&&r.setTransformFromMatrix(t.glyphHost.parent.globalTransMatrix,!0);const a=t.AABBBounds;return!0!==t.attribute._debug_bounds&&t.attribute._debug_bounds(r,t),r.strokeRect(a.x1,a.y1,a.width(),a.height()),r.highPerformanceRestore(),!0}}let wa=class{constructor(){this.order=1,this.interceptors=[new ka,new La,new Ta,new Aa]}afterDrawItem(t,e,i,s,n){for(let r=0;r=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],wa);class Ta{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){return!this.processing&&(t.baseGraphic?this.beforeDrawInteractive(t,e,i,s,n):this.beforeSetInteractive(t,e,i,s,n))}beforeSetInteractive(t,e,i,s,n){let r=t.interactiveGraphic;if(t.attribute.globalZIndex){r||(r=t.clone(),t.interactiveGraphic=r,r.baseGraphic=t),r.setAttributes({globalZIndex:0,zIndex:t.attribute.globalZIndex},!1,{skipUpdateCallback:!0}),i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).add(r),!0}if(r){i.stage.tryInitInteractiveLayer();const e=i.stage.getLayer("_builtin_interactive");e&&this.getShadowRoot(e).removeChild(r),t.interactiveGraphic=null,r.baseGraphic=null}return!1}beforeDrawInteractive(t,e,i,s,n){const r=t.baseGraphic;if(!r.stage){const e=i.stage.getLayer("_builtin_interactive");return e&&this.getShadowRoot(e).removeChild(t),!0}if(r){this.processing=!0;const{context:t}=i;return t.highPerformanceSave(),t.setTransformFromMatrix(r.parent.globalTransMatrix,!0),r.isContainer?s.renderGroup(r,i,r.parent.globalTransMatrix):s.renderItem(r,i),t.highPerformanceRestore(),this.processing=!1,!0}return!1}getShadowRoot(t){var e;let i=t.getElementById("_interactive_group");return i||(i=ra.CreateGraphic("group",{}),i.id="_interactive_group",t.add(i)),null!==(e=i.shadowRoot)&&void 0!==e?e:i.attachShadow()}}class La{constructor(){this.order=1}beforeDrawItem(t,e,i,s,n){if(!t.in3dMode||i.in3dInterceptor)return!1;i.in3dInterceptor=!0;const{context:r,stage:a}=e.drawParams;r.canvas,r.save(),this.initCanvasCtx(r),r.camera=a.camera;const o=r.currentMatrix;o.a/=r.dpr,o.b/=r.dpr,o.c/=r.dpr,o.d/=r.dpr,o.e/=r.dpr,o.f/=r.dpr;const l=Wr.allocate();jr(l,o);const h=r.modelMatrix;if(h){if(l){const t=Wr.allocate();r.modelMatrix=Hr(t,h,l)}}else r.modelMatrix=l;return r.setTransform(1,0,0,1,0,0,!0),t.isContainer?Gr(r,t,((e,n)=>s.renderGroup(t,i,t.parent.globalTransMatrix,!e&&n)),i):s.renderItem(t,i),r.camera=null,r.restore(),r.modelMatrix!==h&&Wr.free(r.modelMatrix),r.modelMatrix=h,i.in3dInterceptor=!1,!0}initCanvasCtx(t){t.setTransformForCurrent()}}const Ca=function(){const t={linearGradient:/^(linear\-gradient)/i,radialGradient:/^(radial\-gradient)/i,conicGradient:/^(conic\-gradient)/i,sideOrCorner:/^to (left (top|bottom)|right (top|bottom)|top (left|right)|bottom (left|right)|left|right|top|bottom)/i,extentKeywords:/^(closest\-side|closest\-corner|farthest\-side|farthest\-corner|contain|cover)/,positionKeywords:/^(left|center|right|top|bottom)/i,pixelValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))px/,percentageValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))\%/,emValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))em/,angleValue:/^(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,fromAngleValue:/^from\s*(-?(([0-9]*\.[0-9]+)|([0-9]+\.?)))deg/,startCall:/^\(/,endCall:/^\)/,comma:/^,/,hexColor:/(^\#[0-9a-fA-F]+)/,literalColor:/^([a-zA-Z]+)/,rgbColor:/^(rgb\(\d{1,3},\s*\d{1,3},\s*\d{1,3}\))/i,rgbaColor:/^(rgba\(\d{1,3},\s*\d{1,3},\s*\d{1,3},\s*((\d\.\d+)|\d{1,3})\))/i,number:/^(([0-9]*\.[0-9]+)|([0-9]+\.?))/};let e="";function i(t){const i=new Error(e+": "+t);throw i.source=e,i}function s(){return n("linear",t.linearGradient,r)||n("radial",t.radialGradient,o)||n("conic",t.conicGradient,a)}function n(e,s,n){return function(s){if(f(s)){f(t.startCall)||i("Missing (");const s=function(){const s=n();return s&&(f(t.comma)||i("Missing comma before color stops")),{type:e,orientation:s,colorStops:u(p)}}();return f(t.endCall)||i("Missing )"),s}}(s)}function r(){return _("directional",t.sideOrCorner,1)||_("angular",t.angleValue,1)}function a(){return _("angular",t.fromAngleValue,1)}function o(){let i,s,n=l();return n&&(i=[],i.push(n),s=e,f(t.comma)&&(n=l(),n?i.push(n):e=s)),i}function l(){let t=function(){const t=_("shape",/^(circle)/i,0);return t&&(t.style=m()||h()),t}()||function(){const t=_("shape",/^(ellipse)/i,0);return t&&(t.style=g()||h()),t}();if(t)t.at=d();else{const e=h();if(e){t=e;const i=d();i&&(t.at=i)}else{const e=c();e&&(t={type:"default-radial",at:e})}}return t}function h(){return _("extent-keyword",t.extentKeywords,1)}function d(){if(_("position",/^at/,0)){const t=c();return t||i("Missing positioning value"),t}}function c(){const t={x:g(),y:g()};if(t.x||t.y)return{type:"position",value:t}}function u(e){let s=e();const n=[];if(s)for(n.push(s);f(t.comma);)s=e(),s?n.push(s):i("One extra comma");return n}function p(){const e=_("hex",t.hexColor,1)||_("rgba",t.rgbaColor,1)||_("rgb",t.rgbColor,1)||_("literal",t.literalColor,0);return e||i("Expected color definition"),e.length=g(),e}function g(){return _("%",t.percentageValue,1)||_("position-keyword",t.positionKeywords,1)||m()}function m(){return _("px",t.pixelValue,1)||_("em",t.emValue,1)}function _(t,e,i){const s=f(e);if(s)return{type:t,value:s[i]}}function f(t){const i=/^[\n\r\t\s]+/.exec(e);i&&v(i[0].length);const s=t.exec(e);return s&&v(s[0].length),s}function v(t){e=e.substr(t)}return function(t){return e=t.toString(),function(){const t=u(s);return e.length>0&&i("Invalid input not EOF"),t}()}}();class Ea{static IsGradient(t){return!("string"==typeof t&&!t.includes("gradient"))}static IsGradientStr(t){return"string"==typeof t&&t.includes("gradient")}static Parse(t){if(Ea.IsGradientStr(t))try{const e=Ca(t)[0];if(e){if("linear"===e.type)return Ea.ParseLinear(e);if("radial"===e.type)return Ea.ParseRadial(e);if("conic"===e.type)return Ea.ParseConic(e)}}catch(e){return t}return t}static ParseConic(t){const{orientation:e,colorStops:i=[]}=t,s=rt/2,n=parseFloat(e.value)/180*rt-s;return{gradient:"conical",x:.5,y:.5,startAngle:n,endAngle:n+lt,stops:i.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseRadial(t){const{colorStops:e=[]}=t;return{gradient:"radial",x0:.5,y0:.5,x1:.5,y1:.5,r0:0,r1:1,stops:e.map((t=>({color:t.value,offset:parseFloat(t.length.value)/100})))}}static ParseLinear(t){const{orientation:e,colorStops:i=[]}=t,s=rt/2;let n="angular"===e.type?parseFloat(e.value)/180*rt:0;for(;n<0;)n+=lt;for(;n>lt;)n-=lt;let r=0,a=0,o=0,l=0;return n({color:t.value,offset:parseFloat(t.length.value)/100})))}}}function Da(t,e,i){let s=e;const{a:n,b:r,c:a,d:o}=t.currentMatrix,l=Math.sign(n)*Math.sqrt(n*n+r*r),h=Math.sign(o)*Math.sqrt(a*a+o*o);return l+h===0?0:(s=s/Math.abs(l+h)*2*i,s)}function Pa(t,e,i,s=0,n=0){if(!e||!0===e)return"black";let r,a;if(y(e))for(let t=0;t{d.addColorStop(t.offset,t.color)})),d}(t,a,h,d,o,l):"conical"===a.gradient?r=function(t,e,i,s,n,r){var a,o;const l=t.createConicGradient(i+(null!==(a=e.x)&&void 0!==a?a:0)*n,s+(null!==(o=e.y)&&void 0!==o?o:0)*r,e.startAngle,e.endAngle);return e.stops.forEach((t=>{l.addColorStop(t.offset,t.color)})),l.GetPattern(n+i,r+s,void 0)}(t,a,h,d,o,l):"radial"===a.gradient&&(r=function(t,e,i,s,n,r){var a,o,l,h,d,c;const u=t.createRadialGradient(i+(null!==(a=e.x0)&&void 0!==a?a:.5)*n,s+(null!==(o=e.y0)&&void 0!==o?o:.5)*r,Math.max(n,r)*(null!==(l=e.r0)&&void 0!==l?l:0),i+(null!==(h=e.x1)&&void 0!==h?h:.5)*n,s+(null!==(d=e.y1)&&void 0!==d?d:.5)*r,Math.max(n,r)*(null!==(c=e.r1)&&void 0!==c?c:.5));return e.stops.forEach((t=>{u.addColorStop(t.offset,t.color)})),u}(t,a,h,d,o,l))}return r||"orange"}Symbol.for("BoundsAllocate");const Oa=new class{constructor(){this.pools=[];for(let t=0;t<10;t++)this.pools.push(new qt)}allocate(t,e,i,s){if(!this.pools.length)return(new qt).setValue(t,e,i,s);const n=this.pools.pop();return n.x1=t,n.y1=e,n.x2=i,n.y2=s,n}allocateByObj(t){if(!this.pools.length)return new qt(t);const e=this.pools.pop();return e.x1=t.x1,e.y1=t.y1,e.x2=t.x2,e.y2=t.y2,e}free(t){this.pools.push(t)}get length(){return this.pools.length}release(...t){this.pools=[]}};var Ra=function(t,e){return function(i,s){e(i,s,t)}};let Ia=class{constructor(t,e){this.contributions=t,this.drawItemInterceptorContributions=e,this.currentRenderMap=new Map,this.defaultRenderMap=new Map,this.styleRenderMap=new Map,this.dirtyBounds=new Kt,this.backupDirtyBounds=new Kt,this.global=xi.global,this.layerService=xi.layerService,this.init()}init(){this.contributions.forEach((t=>{if(t.style){const e=this.styleRenderMap.get(t.style)||new Map;e.set(t.numberType,t),this.styleRenderMap.set(t.style,e)}else this.defaultRenderMap.set(t.numberType,t)})),this.InterceptorContributions=this.drawItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}prepareForDraw(t,e){e.updateBounds?this.useDirtyBounds=!0:this.useDirtyBounds=!e.stage.params.optimize.disableCheckGraphicWidthOutRange}draw(t,e){this.prepareForDraw(t,e),e.drawContribution=this,this.currentRenderMap=this.styleRenderMap.get(e.renderStyle)||this.defaultRenderMap,this.currentRenderService=t;const{context:i,stage:s,viewBox:n,transMatrix:r}=e;if(!i)return;const a=this.dirtyBounds.setValue(0,0,n.width(),n.height());if(s.dirtyBounds&&!s.dirtyBounds.empty()){const t=Ft(a,s.dirtyBounds,!1);a.x1=Math.floor(t.x1),a.y1=Math.floor(t.y1),a.x2=Math.ceil(t.x2),a.y2=Math.ceil(t.y2)}const o=i.dpr%1;(o||.5!==o)&&(a.x1=Math.floor(a.x1*i.dpr)/i.dpr,a.y1=Math.floor(a.y1*i.dpr)/i.dpr,a.x2=Math.ceil(a.x2*i.dpr)/i.dpr,a.y2=Math.ceil(a.y2*i.dpr)/i.dpr),this.backupDirtyBounds.copy(a),i.inuse=!0,i.setClearMatrix(r.a,r.b,r.c,r.d,r.e,r.f),i.clearMatrix(),i.setTransformForCurrent(!0),i.translate(n.x1,n.y1,!0),i.beginPath(),i.rect(a.x1,a.y1,a.width(),a.height()),i.clip(),s.camera&&(this.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),this.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0)),this.clearScreen(t,i,e),i.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ai.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:ai.zIndex)})).forEach((t=>{t.isContainer?this.renderGroup(t,e,Vr.allocate(1,0,0,1,0,0)):this.renderItem(t,e)})),i.restore(),i.setClearMatrix(1,0,0,1,0,0),i.inuse=!1,i.draw()}doRegister(){throw new Error("暂不支持")}_findNextGraphic(t){let e=t.parent,i=t._uid;for(;e;){const t=ba(e,i,ai.zIndex);if(t)return t;i=e._uid,e=e.parent}return null}renderGroup(t,e,i,s){if(e.break||!1===t.attribute.visibleAll)return;if(t.incremental&&(null==e.startAtId||e.startAtId===t._uid))return e.break=!0,void this._increaseRender(t,e);if(this.useDirtyBounds&&!zt(t.AABBBounds,this.dirtyBounds,!1))return;let n,r=i;if(this.useDirtyBounds){n=Oa.allocateByObj(this.dirtyBounds);const e=t.transMatrix;r=Vr.allocateByObj(i).multiply(e.a,e.b,e.c,e.d,e.e,e.f),this.dirtyBounds.copy(this.backupDirtyBounds).transformWithMatrix(r.getInverse())}this.renderItem(t,e,{drawingCb:()=>{var i;s?t.forEachChildren((t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))})):va(t,ai.zIndex,(t=>{e.break||(t.isContainer?this.renderGroup(t,e,r):this.renderItem(t,e))}),!1,!!(null===(i=e.context)||void 0===i?void 0:i.camera))}}),this.useDirtyBounds&&(this.dirtyBounds.copy(n),Oa.free(n),Vr.free(r))}_increaseRender(t,e){const{layer:i,stage:s}=e,{subLayers:n}=i;let r=n.get(t._uid);r||(r={layer:this.layerService.createLayer(s),zIndex:n.size,group:t},n.set(t._uid,r));const a=r.layer.getNativeHandler().getContext(),o=r.drawContribution||Ui.get(cr);o.dirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.backupDirtyBounds.setValue(-1/0,-1/0,1/0,1/0),o.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:r.layer,context:a,startAtId:t._uid,break:!1})),r.drawContribution=o;const l=this._findNextGraphic(t);if(l)if(l.isContainer&&l.incremental)this._increaseRender(l,e);else{let t=n.get(l._uid);t||(t={layer:this.layerService.createLayer(s),zIndex:n.size},n.set(l._uid,t));const i=t.layer.getNativeHandler().getContext();this.draw(this.currentRenderService,Object.assign(Object.assign({},e),{drawContribution:o,clear:"transparent",layer:t.layer,context:i,startAtId:l._uid,break:!1}))}}getRenderContribution(t){let e;return e||(e=this.selectRenderByNumberType(t.numberType,t)),e||(e=this.selectRenderByType(t.type)),e}renderItem(t,e,i){if(this.InterceptorContributions.length)for(let s=0;s=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Ra(0,_a(_r)),Ra(1,$(K)),Ra(1,X(xa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object])],Ia);const Ya=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;n0)&&(s=r)}return s},ja=(t,e)=>{var i;if(0===t.length)return;let s=t[0];for(let n=1;nt||void 0===t)):!!t,i&&e>0}function $a(t,e,i){return i&&t*e>0}function Xa(t,e,i,s,n){return n&&t*e>0&&0!==i&&0!==s}function Ka(t,e){return t*e>0}function qa(t,e,i,s){return t*e>0&&0!==i&&0!==s}function Za(t,e,i,s,n,r,a){const o=t-i,l=e-s,h=(a?r:-r)/Math.sqrt(o*o+l*l),d=h*l,c=-h*o,u=t+d,p=e+c,g=i+d,m=s+c,_=(u+g)/2,f=(p+m)/2,v=g-u,y=m-p,b=v*v+y*y,x=n-r,S=u*m-g*p,M=(y<0?-1:1)*Math.sqrt(Math.max(0,x*x*b-S*S));let k=(S*y-v*M)/b,A=(-S*v-y*M)/b;const w=(S*y+v*M)/b,T=(-S*v+y*M)/b,L=k-_,C=A-f,E=w-_,D=T-f;return L*L+C*C>E*E+D*D&&(k=w,A=T),{cx:k,cy:A,x01:-d,y01:-c,x11:k*(n/x-1),y11:A*(n/x-1)}}function Ja(t,e,i,s,n){const r=ht(i-e),a=t.getParsedCornerRadius(),o=y(a),{outerDeltaAngle:l,innerDeltaAngle:h,outerStartAngle:d,outerEndAngle:c,innerEndAngle:u,innerStartAngle:p}=t.getParsePadAngle(e,i),g=o?a[0]:a,m=o?a[1]:a,_=o?a[2]:a,f=o?a[3]:a,v=Math.max(m,g),b=Math.max(_,f);let x=v,S=b;const M=n*ct(d),k=n*gt(d),A=s*ct(u),w=s*gt(u);let T,L,C,E;if((b>nt||v>nt)&&(T=n*ct(c),L=n*gt(c),C=s*ct(p),E=s*gt(p),r1?0:D<-1?rt:Math.acos(D))/2),l=mt(t[0]*t[0]+t[1]*t[1]);S=pt(b,(s-l)/(o-1)),x=pt(v,(n-l)/(o+1))}}var D;return{outerDeltaAngle:l,xors:M,yors:k,xirs:C,yirs:E,xore:T,yore:L,xire:A,yire:w,limitedOcr:x,limitedIcr:S,outerCornerRadiusStart:g,outerCornerRadiusEnd:m,maxOuterCornerRadius:v,maxInnerCornerRadius:b,outerStartAngle:d,outerEndAngle:c,innerDeltaAngle:h,innerEndAngle:u,innerStartAngle:p,innerCornerRadiusStart:f,innerCornerRadiusEnd:_}}function Qa(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(n=lt-nt)e.moveTo(i+n*ct(o),s+n*gt(o)),e.arc(i,s,n,o,l,!d),r>nt&&(e.moveTo(i+r*ct(l),s+r*gt(l)),e.arc(i,s,r,l,o,d));else{const{outerDeltaAngle:h,xors:u,yors:p,xirs:g,yirs:m,limitedOcr:_,outerCornerRadiusStart:f,outerCornerRadiusEnd:v,maxOuterCornerRadius:y,xore:b,yore:x,xire:S,yire:M,outerStartAngle:k,outerEndAngle:A,limitedIcr:w,innerDeltaAngle:T,innerEndAngle:L,innerStartAngle:C,innerCornerRadiusStart:E,innerCornerRadiusEnd:D,maxInnerCornerRadius:P}=Ja(t,o,l,r,n);if(h<.001)a&&(a[3]||a[1])&&e.moveTo(i+u,s+p),c=!0;else if(_>nt){const t=pt(f,_),r=pt(v,_),o=Za(g,m,u,p,n,t,Number(d)),l=Za(b,x,S,M,n,r,Number(d));_0&&e.arc(i+o.cx,s+o.cy,t,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,n,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),!d),r>0&&e.arc(i+l.cx,s+l.cy,r,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):r>0?e.moveTo(i+l.cx+r*ct(dt(l.y01,l.x01)),s+l.cy+r*gt(dt(l.y01,l.x01))):e.moveTo(i+b,s+n*gt(A))}else!a||a[0]?(e.moveTo(i+u,s+p),e.arc(i,s,n,k,A,!d)):e.moveTo(i+n*ct(A),s+n*gt(A));if(!(r>nt)||T<.001)!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),c=!0;else if(w>nt){const t=pt(E,w),n=pt(D,w),o=Za(S,M,b,x,r,-n,Number(d)),l=Za(u,p,g,m,r,-t,Number(d));if(!a||a[1]?e.lineTo(i+o.cx+o.x01,s+o.cy+o.y01):e.moveTo(i+o.cx+o.x01,s+o.cy+o.y01),w0&&e.arc(i+o.cx,s+o.cy,n,dt(o.y01,o.x01),dt(o.y11,o.x11),!d),e.arc(i,s,r,dt(o.cy+o.y11,o.cx+o.x11),dt(l.cy+l.y11,l.cx+l.x11),d),t>0&&e.arc(i+l.cx,s+l.cy,t,dt(l.y11,l.x11),dt(l.y01,l.x01),!d)):t>0?e.moveTo(i+l.cx+t*ct(dt(l.y01,l.x01)),s+l.cy+t*gt(dt(l.y01,l.x01))):e.moveTo(i+g,s+m)}else!a||a[1]?e.lineTo(i+S,s+M):e.moveTo(i+S,s+M),!a||a[2]?e.arc(i,s,r,L,C,d):e.moveTo(i+r*ct(C),s+r*gt(C))}return a?a[3]&&e.lineTo(i+n*ct(o),s+n*gt(o)):e.closePath(),c}const to=Symbol.for("ArcRenderContribution"),eo=Symbol.for("AreaRenderContribution"),io=Symbol.for("CircleRenderContribution"),so=Symbol.for("GroupRenderContribution"),no=Symbol.for("ImageRenderContribution"),ro=Symbol.for("PathRenderContribution"),ao=Symbol.for("PolygonRenderContribution"),oo=Symbol.for("RectRenderContribution"),lo=Symbol.for("SymbolRenderContribution"),ho=Symbol.for("TextRenderContribution"),co=(Symbol.for("CommonRenderContribution"),Symbol.for("InteractiveSubRenderContribution"));var uo=function(t,e){return function(i,s){e(i,s,t)}};class po{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;const{background:g,backgroundOpacity:m=(null!==(p=t.attribute.fillOpacity)&&void 0!==p?p:l.backgroundOpacity),opacity:_=l.opacity,backgroundMode:f=l.backgroundMode,backgroundFit:v=l.backgroundFit}=t.attribute;if(g)if(t.backgroundImg&&t.resources){const n=t.resources.get(g);if("success"!==n.state||!n.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ps(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}e.clip();const r=t.AABBBounds;e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*_,this.doDrawImage(e,n.data,r,f,v),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.globalAlpha=m*_,e.fillStyle=g,e.fill(),e.highPerformanceRestore()}doDrawImage(t,e,i,s,n){if("no-repeat"===s)t.drawImage(e,i.x1,i.y1,i.width(),i.height());else{const r=i.width(),a=i.height();let o=r,l=a;if(n&&"repeat"!==s&&(e.width||e.height)){const i=e.width,n=e.height;"repeat-x"===s?(o=i*(a/n),l=a):"repeat-y"===s&&(l=n*(r/i),o=r);const h=t.dpr,d=qi.allocate({width:o,height:l,dpr:h}),c=d.getContext("2d");c&&(c.inuse=!0,c.clearMatrix(),c.setTransformForCurrent(!0),c.clearRect(0,0,o,l),c.drawImage(e,0,0,o,l),e=d.nativeCanvas),qi.free(d)}const h=t.dpr,d=t.createPattern(e,s);d.setTransform&&d.setTransform(new DOMMatrix([1/h,0,0,1/h,0,0])),t.fillStyle=d,t.translate(i.x1,i.y1),t.fillRect(0,0,r,a),t.translate(-i.x1,-i.y1)}}}const go=new po;let mo=class{constructor(t){this.subRenderContribitions=t,this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){this._subRenderContribitions||(this._subRenderContribitions=this.subRenderContribitions.getContributions()),this._subRenderContribitions.forEach((p=>{p.render(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}};mo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),uo(0,$(K)),uo(0,X(co)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],mo);const _o=new class extends po{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{background:u,backgroundMode:p=l.backgroundMode,backgroundFit:g=l.backgroundFit}=t.attribute;if(u)if(t.backgroundImg&&t.resources){const i=t.resources.get(u);if("success"!==i.state||!i.data)return;e.highPerformanceSave(),e.setTransformFromMatrix(t.parent.globalTransMatrix,!0);const s=t.AABBBounds;this.doDrawImage(e,i.data,s,p,g),e.highPerformanceRestore(),e.setTransformForCurrent()}else e.highPerformanceSave(),e.fillStyle=u,e.fill(),e.highPerformanceRestore()}};var fo=function(t,e){return function(i,s){e(i,s,t)}};let vo=class{constructor(t){this.groupRenderContribitions=t,this.numberType=Fn}drawShape(t,e,i,s,n,r,a,o){const l=ps(t,null==r?void 0:r.theme).group,{fill:h=l.fill,background:d,stroke:c=l.stroke,opacity:u=l.opacity,width:p=l.width,height:g=l.height,clip:m=l.clip,fillOpacity:_=l.fillOpacity,strokeOpacity:f=l.strokeOpacity,cornerRadius:v=l.cornerRadius,path:b=l.path,lineWidth:x=l.lineWidth,visible:S=l.visible}=t.attribute,M=Xa(u,_,p,g,h),k=qa(u,f,p,g),A=Ga(h,d),w=Ua(c,x);if(!t.valid||!S)return;if(!m){if(!A&&!w)return;if(!(M||k||a||o||d))return}if(b&&b.length&&n.drawContribution){const t=e.disableFill,i=e.disableStroke,s=e.disableBeginPath;e.disableFill=!0,e.disableStroke=!0,e.disableBeginPath=!0,b.forEach((t=>{n.drawContribution.getRenderContribution(t).draw(t,n.renderService,n,r)})),e.disableFill=t,e.disableStroke=i,e.disableBeginPath=s}else 0===v||y(v)&&v.every((t=>0===t))?(e.beginPath(),e.rect(i,s,p,g)):(e.beginPath(),Wa(e,i,s,p,g,v));this._groupRenderContribitions||(this._groupRenderContribitions=this.groupRenderContribitions.getContributions()||[],this._groupRenderContribitions.push(_o));const T={doFill:A,doStroke:w};this._groupRenderContribitions.forEach((r=>{r.time===ge.beforeFillStroke&&r.drawShape(t,e,i,s,A,w,M,k,l,n,a,o,T)})),m&&e.clip(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),T.doFill&&(a?a(e,t.attribute,l):M&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fill())),T.doStroke&&(o?o(e,t.attribute,l):k&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),this._groupRenderContribitions.forEach((r=>{r.time===ge.afterFillStroke&&r.drawShape(t,e,i,s,A,w,M,k,l,n,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;const{clip:r,baseOpacity:a=1}=t.attribute;r?n.save():n.highPerformanceSave();const o=n.baseGlobalAlpha;n.baseGlobalAlpha*=a;const l=ps(t,null==s?void 0:s.theme).group,h=n.modelMatrix;if(n.camera){const e=Wr.allocate(),i=Wr.allocate();sa(i,t,l),Hr(e,h||e,i),n.modelMatrix=e,Wr.free(i),n.setTransform(1,0,0,1,0,0,!0)}else n.transformFromMatrix(t.transMatrix,!0);n.beginPath(),s.skipDraw?this.drawShape(t,n,0,0,i,s,(()=>!1),(()=>!1)):this.drawShape(t,n,0,0,i);const{scrollX:d=l.scrollX,scrollY:c=l.scrollY}=t.attribute;let u;(d||c)&&n.translate(d,c),s&&s.drawingCb&&(u=s.drawingCb()),n.modelMatrix!==h&&Wr.free(n.modelMatrix),n.modelMatrix=h,n.baseGlobalAlpha=o,u&&u.then?u.then((()=>{r?n.restore():n.highPerformanceRestore()})):r?n.restore():n.highPerformanceRestore()}};vo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),fo(0,$(K)),fo(0,X(so)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],vo);const yo={x:0,y:0,z:0,lastModelMatrix:null};class bo{init(t){t&&(this._renderContribitions=t.getContributions()),this._renderContribitions||(this._renderContribitions=[]),this.builtinContributions&&this.builtinContributions.forEach((t=>this._renderContribitions.push(t))),this._renderContribitions.length&&(this._renderContribitions.sort(((t,e)=>e.order-t.order)),this._beforeRenderContribitions=this._renderContribitions.filter((t=>t.time===ge.beforeFillStroke)),this._afterRenderContribitions=this._renderContribitions.filter((t=>t.time===ge.afterFillStroke)))}beforeRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,u){this._beforeRenderContribitions&&this._beforeRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}afterRenderStep(t,e,i,s,n,r,a,o,l,h,d,c,u){this._afterRenderContribitions&&this._afterRenderContribitions.forEach((p=>{p.supportedAppName&&t.stage&&t.stage.params&&t.stage.params.context&&t.stage.params.context.appName&&!(Array.isArray(p.supportedAppName)?p.supportedAppName:[p.supportedAppName]).includes(t.stage.params.context.appName)||p.drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u)}))}valid(t,e,i,s){const{fill:n=e.fill,background:r,stroke:a=e.stroke,opacity:o=e.opacity,fillOpacity:l=e.fillOpacity,lineWidth:h=e.lineWidth,strokeOpacity:d=e.strokeOpacity,visible:c=e.visible}=t.attribute,u=$a(o,l,n),p=Ka(o,d),g=Ga(n,r),m=Ua(a,h);return!(!t.valid||!c)&&!(!g&&!m)&&!!(u||p||i||s||r)&&{fVisible:u,sVisible:p,doFill:g,doStroke:m}}transform(t,e,i,s=!1){const{x:n=e.x,y:r=e.y,z:a=e.z,scaleX:o=e.scaleX,scaleY:l=e.scaleY,angle:h=e.angle,postMatrix:d}=t.attribute,c=i.modelMatrix,u=i.camera;yo.x=n,yo.y=r,yo.z=a,yo.lastModelMatrix=c;const p=u&&(s||function(t){const{alpha:e,beta:i}=t.attribute;return e||i}(t)),g=p?t.transMatrix.onlyTranslate()&&!d:1===o&&1===l&&0===h&&!d;if(p){const s=Wr.allocate(),n=Wr.allocate();sa(n,t,e),Hr(s,c||s,n),yo.x=0,yo.y=0,yo.z=0,i.modelMatrix=s,i.setTransform(1,0,0,1,0,0,!0),Wr.free(n)}if(g&&!c){const s=t.getOffsetXY(e);yo.x+=s.x,yo.y+=s.y,yo.z=a,i.setTransformForCurrent()}else if(p)yo.x=0,yo.y=0,yo.z=0,i.setTransform(1,0,0,1,0,0,!0);else if(u&&i.project){const s=t.getOffsetXY(e);yo.x+=s.x,yo.y+=s.y,this.transformWithoutTranslate(i,yo.x,yo.y,yo.z,o,l,h)}else i.transformFromMatrix(t.transMatrix,!0),yo.x=0,yo.y=0,yo.z=0;return yo}transformUseContext2d(t,e,i,s){const n=s.camera;if(this.camera=n,n){const e=t.AABBBounds,n=e.x2-e.x1,r=e.y2-e.y1,a=s.project(0,0,i),o=s.project(n,0,i),l=s.project(n,r,i),h={x:0,y:0},d={x:n,y:0},c={x:n,y:r};s.camera=null;const u=1/(h.x*(c.y-d.y)-d.x*c.y+c.x*d.y+(d.x-c.x)*h.y),p=-(h.y*(l.x-o.x)-d.y*l.x+c.y*o.x+(d.y-c.y)*a.x)*u,g=(d.y*l.y+h.y*(o.y-l.y)-c.y*o.y+(c.y-d.y)*a.y)*u,m=(h.x*(l.x-o.x)-d.x*l.x+c.x*o.x+(d.x-c.x)*a.x)*u,_=-(d.x*l.y+h.x*(o.y-l.y)-c.x*o.y+(c.x-d.x)*a.y)*u,f=(h.x*(c.y*o.x-d.y*l.x)+h.y*(d.x*l.x-c.x*o.x)+(c.x*d.y-d.x*c.y)*a.x)*u,v=(h.x*(c.y*o.y-d.y*l.y)+h.y*(d.x*l.y-c.x*o.y)+(c.x*d.y-d.x*c.y)*a.y)*u;s.setTransform(p,g,m,_,f,v,!0)}}restoreTransformUseContext2d(t,e,i,s){this.camera&&(s.camera=this.camera)}transformWithoutTranslate(t,e,i,s,n,r,a){const o=t.project(e,i,s);t.translate(o.x,o.y,!1),t.scale(n,r,!1),t.rotate(a,!1),t.translate(-o.x,-o.y,!1),t.setTransformForCurrent()}_draw(t,e,i,s,n){const{context:r}=s;if(!r)return;const{renderable:a}=t.attribute;if(!1===a)return;r.highPerformanceSave();const o=this.transform(t,e,r,i),{x:l,y:h,z:d,lastModelMatrix:c}=o;this.z=d,function(t,e,i,s,n,r){if(!t.pathProxy)return!1;const a=ps(t,null==r?void 0:r.theme)[t.type.replace("3d","")],{fill:o=a.fill,stroke:l=a.stroke,opacity:h=a.opacity,fillOpacity:d=a.fillOpacity,lineWidth:c=a.lineWidth,strokeOpacity:u=a.strokeOpacity,visible:p=a.visible,x:g=a.x,y:m=a.y}=t.attribute,_=$a(h,d,o),f=Ka(h,u),v=Ga(o),y=Ua(l,c);return!p||!v&&!y||!(_||f)||(e.beginPath(),ve(("function"==typeof t.pathProxy?t.pathProxy(t.attribute):t.pathProxy).commandList,e,i,s),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,a),y&&f&&(e.setStrokeStyle(t,t.attribute,i-g,s-m,a),e.stroke()),v&&_&&(e.setCommonStyle(t,t.attribute,i-g,s-m,a),e.fill()),!0)}(t,r,l,h,0,n)||(this.drawShape(t,r,l,h,s,n),this.z=0,r.modelMatrix!==c&&Wr.free(r.modelMatrix),r.modelMatrix=c),r.highPerformanceRestore()}}function xo(t,e,i,s){if(!e.p1)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};if(1===i)e.p2&&e.p3?t.bezierCurveTo(n+e.p1.x,r+e.p1.y,n+e.p2.x,r+e.p2.y,n+e.p3.x,r+e.p3.y,a):t.lineTo(n+e.p1.x,r+e.p1.y,a);else if(e.p2&&e.p3){const[s]=ke(e,i);t.bezierCurveTo(n+s.p1.x,r+s.p1.y,n+s.p2.x,r+s.p2.y,n+s.p3.x,r+s.p3.y,a)}else{const s=e.getPointAt(i);t.lineTo(n+s.x,r+s.y,a)}}function So(t,e,i,s,n,r,a){var o;let l=e.p0,h=s;if(i&&i.originP1===i.originP2&&(l=i.p0),e.defined)s||(t.lineTo(l.x+n,l.y+r,a),h=!s);else{const{originP1:i,originP2:d}=e;let c;if(i&&!1!==i.defined?c=l:i&&!1!==d.defined&&(c=null!==(o=e.p3)&&void 0!==o?o:e.p1),s){h=!s;const i=c?c.x:e.p0.x,o=c?c.y:e.p0.y;t.moveTo(i+n,o+r,a)}else c&&(h=!s,t.lineTo(c.x+n,c.y+r,a))}return h}function Mo(t,e,i,s,n){const{offsetX:r=0,offsetY:a=0,offsetZ:o=0,mode:l="none",drawConnect:h=!1}=n||{};if(h&&"none"===l)return;if(!e)return;let d=!0;const{curves:c}=e;if(i>=1){if(h){let e,i=!0;c.forEach(((s,n)=>{s.originP1!==s.originP2?(i=So(t,s,e,i,r,a,o),e=s):e=s}))}else c.forEach((e=>{e.defined?(d&&t.moveTo(e.p0.x+r,e.p0.y+a,o),xo(t,e,1,n),d=!1):d=!0}));return}if(i<=0)return;let u;"x"===s?u=ue.ROW:"y"===s?u=ue.COLUMN:"auto"===s&&(u=e.direction);const p=i*e.tryUpdateLength(u);let g=0,m=!0,_=null;for(let e=0,i=c.length;et.defined))&&u.attribute.curveType&&u.attribute.curveType.includes("Closed")&&t.closePath(),t.setShadowBlendStyle&&t.setShadowBlendStyle(u,a,o);const{x:S=0,x:M=0}=a;!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,a,S-d,M-c,o),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,a,S-d,M-c,o),t.stroke()));let{connectedType:k,connectedX:A,connectedY:w,connectedStyle:T}=a;if(y(o)?(k=null!==(_=null!=k?k:o[0].connectedType)&&void 0!==_?_:o[1].connectedType,A=null!==(f=null!=A?A:o[0].connectedX)&&void 0!==f?f:o[1].connectedX,w=null!==(v=null!=w?w:o[0].connectedY)&&void 0!==v?v:o[1].connectedY,T=null!==(b=null!=T?T:o[0].connectedStyle)&&void 0!==b?b:o[1].connectedStyle):(k=null!=k?k:o.connectedType,A=null!=A?A:o.connectedX,w=null!=w?w:o.connectedY,T=null!=T?T:o.connectedStyle),"connect"!==k&&"zero"!==k&&(k="none"),"none"!==k){t.beginPath(),Mo(t.camera?t:t.nativeContext,e,l,h,{offsetX:d,offsetY:c,offsetZ:x,drawConnect:!0,mode:k,zeroX:A,zeroY:w});const m=[];y(o)?o.forEach((t=>m.push(t))):m.push(o),m.push(a),!1!==i&&(p?p(t,a,o):n&&(t.setCommonStyle(u,T,S-d,M-c,m),t.fill())),!1!==s&&(g?g(t,a,o):r&&(t.setStrokeStyle(u,T,S-d,M-c,m),t.stroke()))}return!1}drawLinearLineHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p;e.beginPath();const g=null!==(p=this.z)&&void 0!==p?p:0,{points:m}=t.attribute,_=m[0];e.moveTo(_.x+a,_.y+o,g);for(let t=1;t!1===t.defined))&&"linear"===f)return this.drawLinearLineHighPerformance(t,e,!!h,!!d,c,u,i,s,l,n,r,a,o);if(t.shouldUpdateShape()){const{points:e,segments:i}=t.attribute,s=e;if(i&&i.length){let e,s;if(t.cache=i.map(((t,i)=>{if(t.points.length<=1&&0===i)return t.points[0]&&(s={endX:t.points[0].x,endY:t.points[0].y,curves:[{defined:!1!==t.points[0].defined}]}),null;1===i?e={x:s.endX,y:s.endY,defined:s.curves[s.curves.length-1].defined}:i>1&&(e.x=s.endX,e.y=s.endY,e.defined=s.curves[s.curves.length-1].defined);const n=Ke(t.points,f,{startPoint:e,curveTension:_});return s=n,n})).filter((t=>!!t)),"linearClosed"===f){let e;for(let i=0;it.points.length));if(1===n[0].points.length&&n.shift(),1===v){let r=!1;t.cache.forEach(((p,g)=>{r||(r=this.drawSegmentItem(e,p,!!h,!!d,c,u,n[g],[l,t.attribute],v,y,i,s,t,a,o))}))}else{const r=t.cache.reduce(((t,e)=>t+e.getLength()),0),p=v*r;let g=0,m=!1;t.cache.forEach(((r,_)=>{if(m)return;const f=r.getLength(),v=(p-g)/f;g+=f,v>0&&(m=this.drawSegmentItem(e,r,!!h,!!d,c,u,n[_],[l,t.attribute],pt(v,1),y,i,s,t,a,o))}))}}else this.drawSegmentItem(e,t.cache,!!h,!!d,c,u,t.attribute,l,v,y,i,s,t,a,o)}};ko=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],ko);let Ao=class extends ko{constructor(){super(...arguments),this.numberType=jn}drawShape(t,e,i,s,n,r,a,o){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:e,length:r}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(e>l.length)return;const h=ps(t).line,{fill:d=h.fill,stroke:c=h.stroke,opacity:u=h.opacity,fillOpacity:p=h.fillOpacity,strokeOpacity:g=h.strokeOpacity,lineWidth:m=h.lineWidth,visible:_=h.visible}=t.attribute,f=$a(u,p,d),v=Ka(u,g),y=Ga(d),b=Ua(c,m);if(!t.valid||!_)return;if(!y&&!b)return;if(!(f||v||a||o))return;const{context:x}=n;for(let n=e;n{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}))}(e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setStrokeStyle(t,n,a,o,r),e.stroke())}};function wo(t,e,i,s){if(e.length<2)return;const{offsetX:n=0,offsetY:r=0,offsetZ:a=0,mode:o}=s||{};let l=e[0];t.moveTo(l.p0.x+n,l.p0.y+r,a),l=e[e.length-1];let h=l.p3||l.p1;t.lineTo(h.x+n,h.y+r,a),l=i[i.length-1],t.lineTo(l.p0.x+n,l.p0.y+r,a),l=i[0],h=l.p3||l.p1,t.lineTo(h.x+n,h.y+r,a),t.closePath()}function To(t,e,i,s){const{offsetX:n=0,offsetY:r=0,offsetZ:a=0}=s||{};let o=!0;e.forEach((e=>{e.defined?(o&&t.moveTo(e.p0.x+n,e.p0.y+r,a),xo(t,e,1,s),o=!1):o=!0})),o=!0;for(let e=i.length-1;e>=0;e--){const l=i[e];l.defined?(o&&t.lineTo(l.p0.x+n,l.p0.y+r,a),xo(t,l,1,s),o=!1):o=!0}t.closePath()}Ao=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Ao);class Lo{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=10}createCommonPattern(t,e,i,s,n){const r=(t-2*e)/2,a=s.dpr,o=qi.allocate({width:t,height:t,dpr:a}),l=o.getContext("2d");if(!l)return null;l.inuse=!0,l.clearMatrix(),l.setTransformForCurrent(!0),l.clearRect(0,0,t,t),n(r,l);const h=s.createPattern(o.nativeCanvas,"repeat");return h.setTransform&&h.setTransform(new DOMMatrix([1/a,0,0,1/a,0,0])),qi.free(o),h}createCirclePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,e)=>{e.fillStyle=i,e.arc(t,t,t,0,lt),e.fill()}))}createDiamondPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{const n=t/2,r=n;s.fillStyle=i,s.moveTo(n,r-e),s.lineTo(e+n,r),s.lineTo(n,r+e),s.lineTo(n-e,r),s.closePath(),s.fill()}))}createRectPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,2*t,2*t)}))}createVerticalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(r,0,2*s,t)}))}createHorizontalLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((s,n)=>{const r=e;n.fillStyle=i,n.fillRect(0,r,t,2*s)}))}createBiasLRLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(0,0),s.lineTo(t,t);const n=t/2,r=-n;s.moveTo(n,r),s.lineTo(n+t,r+t),s.moveTo(-n,-r),s.lineTo(-n+t,-r+t),s.stroke()}))}createBiasRLLinePattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((e,s)=>{s.strokeStyle=i,s.lineWidth=e,s.moveTo(t,0),s.lineTo(0,t);const n=t/2,r=n;s.moveTo(t+n,r),s.lineTo(n,r+t),s.moveTo(t-n,-r),s.lineTo(-n,-r+t),s.stroke()}))}createGridPattern(t,e,i,s){return this.createCommonPattern(t,e,i,s,((t,s)=>{const n=e,r=n;s.fillStyle=i,s.fillRect(n,r,t,t),s.fillRect(n+t,r+t,t,t)}))}initTextureMap(t,e){this.textureMap=new Map}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){this.textureMap||this.initTextureMap(e,t.stage);const{texture:p=l.texture,textureColor:g=l.textureColor,textureSize:m=l.textureSize,texturePadding:_=l.texturePadding}=t.attribute;p&&this.drawTexture(p,t,e,i,s,l,g,m,_)}drawTexture(t,e,i,s,n,r,a,o,l){let h=this.textureMap.get(t);if(!h)switch(t){case"circle":h=this.createCirclePattern(o,l,a,i);break;case"diamond":h=this.createDiamondPattern(o,l,a,i);break;case"rect":h=this.createRectPattern(o,l,a,i);break;case"vertical-line":h=this.createVerticalLinePattern(o,l,a,i);break;case"horizontal-line":h=this.createHorizontalLinePattern(o,l,a,i);break;case"bias-lr":h=this.createBiasLRLinePattern(o,l,a,i);break;case"bias-rl":h=this.createBiasRLLinePattern(o,l,a,i);break;case"grid":h=this.createGridPattern(o,l,a,i)}h&&(i.highPerformanceSave(),i.setCommonStyle(e,e.attribute,s,n,r),i.fillStyle=h,i.fill(),i.highPerformanceRestore())}}const Co=new Lo,Eo=new class extends Lo{constructor(){super(...arguments),this.time=ge.afterFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_;this.textureMap||this.initTextureMap(e,t.stage);const{attribute:f=t.attribute}=u||{},{texture:v=(null!==(p=t.attribute.texture)&&void 0!==p?p:cn(l,"texture")),textureColor:y=(null!==(g=t.attribute.textureColor)&&void 0!==g?g:cn(l,"textureColor")),textureSize:b=(null!==(m=t.attribute.textureSize)&&void 0!==m?m:cn(l,"textureSize")),texturePadding:x=(null!==(_=t.attribute.texturePadding)&&void 0!==_?_:cn(l,"texturePadding"))}=f;v&&this.drawTexture(v,t,e,i,s,l,y,b,x)}},Do=go;var Po=function(t,e){return function(i,s){e(i,s,t)}};let Oo=class extends bo{constructor(t){super(),this.areaRenderContribitions=t,this.numberType=Rn,this.builtinContributions=[Eo,Do],this.init(t)}drawLinearAreaHighPerformance(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g,m,_,f;const{points:v}=t.attribute;if(v.length<2)return;e.beginPath();const b=null!==(p=this.z)&&void 0!==p?p:0,x=v[0];e.moveTo(x.x+a,x.y+o,b);for(let t=1;t=0;t--){const i=v[t];e.lineTo((null!==(g=i.x1)&&void 0!==g?g:i.x)+a,(null!==(m=i.y1)&&void 0!==m?m:i.y)+o,b)}e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute});const{x:S=0,x:M=0}=t.attribute;if(!1!==i&&(c?c(e,t.attribute,l):n&&(e.setCommonStyle(t,t.attribute,S-a,M-o,l),e.fill())),this.afterRenderStep(t,e,a,o,!!n,!1,i,!1,l,h,c,null,{attribute:t.attribute}),s){const{stroke:i=l&&l.stroke}=t.attribute;if(y(i)&&(i[0]||i[2])&&!1===i[1])if(e.beginPath(),i[0]){e.moveTo(x.x+a,x.y+o,b);for(let t=1;t=0;t--){const i=v[t];e.lineTo((null!==(_=i.x1)&&void 0!==_?_:i.x)+a,(null!==(f=i.y1)&&void 0!==f?f:i.y)+o,b)}}u?u(e,t.attribute,l):(e.setStrokeStyle(t,t.attribute,S-a,M-o,l),e.stroke())}}drawShape(t,e,i,s,n,r,a,o){var l,h,d,c,u,p;const g=ps(t,null==r?void 0:r.theme).area,{fill:m=g.fill,stroke:_=g.stroke,fillOpacity:f=g.fillOpacity,z:v=g.z,strokeOpacity:y=g.strokeOpacity,curveTension:b=g.curveTension}=t.attribute,x=this.valid(t,g,a,o);if(!x)return;const{doFill:S}=x,M=x.doStroke&&x.sVisible,{clipRange:k=g.clipRange,closePath:A,points:w,segments:T}=t.attribute;let{curveType:L=g.curveType}=t.attribute;if(A&&"linear"===L&&(L="linearClosed"),1===k&&!T&&!w.some((t=>!1===t.defined))&&"linear"===L)return this.drawLinearAreaHighPerformance(t,e,!!m,M,f,y,i,s,g,n,r,a,o);if(t.shouldUpdateShape()){if(T&&T.length){let e,i;const s=T.map(((t,s)=>{if(t.points.length<=1&&0===s)return t.points[0]&&(i={endX:t.points[0].x,endY:t.points[0].y}),null;1===s?e={x:i.endX,y:i.endY}:s>1&&(e.x=i.endX,e.y=i.endY);const n=Ke(t.points,L,{startPoint:e,curveTension:b});return i=n,n})).filter((t=>!!t));let n;const r=[];for(let t=T.length-1;t>=0;t--){const e=T[t].points,i=[];for(let t=e.length-1;t>=0;t--)i.push({x:null!==(l=e[t].x1)&&void 0!==l?l:e[t].x,y:null!==(h=e[t].y1)&&void 0!==h?h:e[t].y});if(0!==t){const e=T[t-1].points,s=e[e.length-1];s&&i.push({x:null!==(d=s.x1)&&void 0!==d?d:s.x,y:null!==(c=s.y1)&&void 0!==c?c:s.y})}i.length>1&&(n=Ke(i,"stepBefore"===L?"stepAfter":"stepAfter"===L?"stepBefore":L,{curveTension:b}),r.unshift(n))}t.cacheArea=r.map(((t,e)=>({top:s[e],bottom:t})))}else{if(!w||!w.length)return t.cacheArea=null,void t.clearUpdateShapeTag();{const e=w,i=[];for(let t=w.length-1;t>=0;t--)i.push({x:null!==(u=w[t].x1)&&void 0!==u?u:w[t].x,y:null!==(p=w[t].y1)&&void 0!==p?p:w[t].y});const s=Ke(e,L,{curveTension:b}),n=Ke(i,"stepBefore"===L?"stepAfter":"stepAfter"===L?"stepBefore":L,{curveTension:b});t.cacheArea={top:s,bottom:n}}}t.clearUpdateShapeTag()}if(Array.isArray(t.cacheArea)){const r=t.attribute.segments.filter((t=>t.points.length));if(1===r[0].points.length&&r.shift(),1===k){let l=!1;t.cacheArea.forEach(((h,d)=>{l||(l=this.drawSegmentItem(e,h,S,f,M,y,r[d],[g,t.attribute],k,i,s,v,t,n,a,o))}))}else{const l=t.cacheArea.reduce(((t,e)=>t+e.top.getLength()),0),h=k*l;let d=0,c=!1;t.cacheArea.forEach(((l,u)=>{if(c)return;const p=l.top.getLength(),m=(h-d)/p;d+=p,m>0&&(c=this.drawSegmentItem(e,l,S,f,M,y,r[u],[g,t.attribute],pt(m,1),i,s,v,t,n,a,o))}))}}else this.drawSegmentItem(e,t.cacheArea,S,f,M,y,t.attribute,g,k,i,s,v,t,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).area;this._draw(t,n,!1,i,s)}drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m){let _=!1;return _=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!1,g,m),_=_||this._drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,!0,g,m),_}_drawSegmentItem(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f,v,b,x;if(!(e&&e.top&&e.bottom&&e.top.curves&&e.top.curves.length&&e.bottom.curves&&e.bottom.curves.length))return;let{connectedType:S,connectedX:M,connectedY:k,connectedStyle:A}=a;const w=[];if(g&&(y(o)?(S=null!==(f=null!=S?S:o[0].connectedType)&&void 0!==f?f:o[1].connectedType,M=null!==(v=null!=M?M:o[0].connectedX)&&void 0!==v?v:o[1].connectedX,k=null!==(b=null!=k?k:o[0].connectedY)&&void 0!==b?b:o[1].connectedY,A=null!==(x=null!=A?A:o[0].connectedStyle)&&void 0!==x?x:o[1].connectedStyle):(S=null!=S?S:o.connectedType,M=null!=M?M:o.connectedX,k=null!=k?k:o.connectedY,A=null!=A?A:o.connectedStyle),"connect"!==S&&"zero"!==S&&(S="none"),y(o)?o.forEach((t=>w.push(t))):w.push(o),w.push(a)),g&&"none"===S)return!1;t.beginPath();const{points:T,segments:L}=u.attribute;let C,E,D=ue.ROW;if(L){const t=L[L.length-1];E=L[0].points[0],C=t.points[t.points.length-1]}else E=T[0],C=T[T.length-1];const P=ht(C.x-E.x),O=ht(C.y-E.y);D=null==C.x1?ue.ROW:null==C.y1?ue.COLUMN:Number.isFinite(P+O)?P>O?ue.ROW:ue.COLUMN:ue.ROW,function(t,e,i,s){var n;const{drawConnect:r=!1,mode:a="none"}=s||{};if(r&&"none"===a)return;const{top:o,bottom:l}=e;if(o.curves.length!==l.curves.length)return;if(i>=1){const e=[],i=[];let n=!0;if(r){let n,r,a=!0;const h=o.curves.length;o.curves.forEach(((o,d)=>{const c=l.curves[h-d-1];let u=o,p=c;if(o.originP1===o.originP2)return n=o,void(r=c);if(n&&n.originP1===n.originP2&&(u=n,p=r),o.defined)a||(e.push(u),i.push(p),wo(t,e,i,s),e.length=0,i.length=0,a=!a);else{const{originP1:n,originP2:r}=o;let l,h;n&&!1!==n.defined?(l=u,h=p):n&&!1!==r.defined&&(l=o,h=c),a?(a=!a,e.push(l||o),i.push(h||c)):l&&(a=!a,e.push(l||o),i.push(h||c),wo(t,e,i,s),e.length=0,i.length=0)}n=o})),wo(t,e,i,s)}else{for(let r=0,a=o.curves.length;rp?ue.ROW:ue.COLUMN,Number.isFinite(u)||(h=ue.COLUMN),Number.isFinite(p)||(h=ue.ROW);const g=i*(h===ue.ROW?u:p);let m=0,_=!0;const f=[],v=[];let y,b,x=!0;for(let e=0,i=o.curves.length;e=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Po(0,$(K)),Po(0,X(eo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Oo);let Ro=class extends Oo{constructor(){super(...arguments),this.numberType=Rn}drawShape(t,e,i,s,n,r,a){if(t.incremental&&n.multiGraphicOptions){const{startAtIdx:r,length:o}=n.multiGraphicOptions,{segments:l=[]}=t.attribute;if(r>l.length)return;const h=ps(t).area,{fill:d=h.fill,fillOpacity:c=h.fillOpacity,opacity:u=h.opacity,visible:p=h.visible}=t.attribute,g=$a(u,c,d),m=Ga(d);if(!t.valid||!p)return;if(!m)return;if(!g&&!a)return;for(let n=r;n{var a,o,l,h;const d=e&&0===s?e.points[e.points.length-1]:i[0];t.moveTo(d.x+n,d.y+r),i.forEach((e=>{!1!==e.defined?t.lineTo(e.x+n,e.y+r):t.moveTo(e.x+n,e.y+r)}));for(let e=i.length-1;e>=0;e--){const s=i[e];t.lineTo(null!==(a=s.x1)&&void 0!==a?a:s.x,null!==(o=s.y1)&&void 0!==o?o:s.y)}t.lineTo(null!==(l=d.x1)&&void 0!==l?l:d.x,null!==(h=d.y1)&&void 0!==h?h:d.y),t.closePath()}))}(e.camera?e:e.nativeContext,i,s,{offsetX:a,offsetY:o}),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,n,r),e.setCommonStyle(t,n,a,o,r),e.fill())}};Ro=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Ro);var Io,Bo=function(t,e){return function(i,s){e(i,s,t)}},Fo=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};!function(t){t[t.NORMAL=0]="NORMAL",t[t.STOP=1]="STOP"}(Io||(Io={}));let Yo=class extends Ia{constructor(t,e,i,s){super(t,s),this.contributions=t,this.lineRender=e,this.areaRender=i,this.drawItemInterceptorContributions=s,this.rendering=!1,this.currFrameStartAt=0,this.currentIdx=0,this.status=Io.NORMAL,this.checkingForDrawPromise=null,this.hooks={completeDraw:new Q([])},this.defaultRenderMap.set(this.lineRender.numberType,this.lineRender),this.defaultRenderMap.set(this.areaRender.numberType,this.areaRender)}draw(t,e){return Fo(this,void 0,void 0,(function*(){if(this.checkingForDrawPromise)return;this.lastRenderService=t,this.lastDrawContext=e,this.checkingForDrawPromise=this.checkForDraw(e);const i=yield this.checkingForDrawPromise;if(this.checkingForDrawPromise=null,i)return;this.currentRenderService=t;const{context:s,viewBox:n}=e;s&&(s.inuse=!0,s.clearMatrix(),s.setTransformForCurrent(!0),s.save(),e.restartIncremental&&this.clearScreen(this.currentRenderService,s,e),s.translate(n.x1,n.y1,!0),s.save(),t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ai.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:ai.zIndex)})).forEach((t=>{this.renderGroup(t,e)})),this.hooks.completeDraw.tap("top-draw",(()=>{s.restore(),s.restore(),s.draw(),s.inuse=!1,this.rendering=!1})))}))}_increaseRender(t,e){return Fo(this,void 0,void 0,(function*(){this.rendering=!0,yield this._renderIncrementalGroup(t,e)}))}_renderIncrementalGroup(t,e){return Fo(this,void 0,void 0,(function*(){this.count=t.count,yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Fo(this,void 0,void 0,(function*(){if(2!==t.count)yield ya(t,ai.zIndex,((i,s)=>{if(this.status===Io.STOP)return!0;if(i.isContainer)return!1;if(s{this.global.getRequestAnimationFrame()((()=>{t(!1)}))}))}))}checkForDraw(t){return Fo(this,void 0,void 0,(function*(){let e=this.rendering;return t.restartIncremental&&(e=!1,yield this.forceStop(),this.resetToInit()),e}))}forceStop(){return Fo(this,void 0,void 0,(function*(){this.rendering&&(this.status=Io.STOP,yield new Promise((t=>{this.hooks.completeDraw.tap("stopCb",(()=>{this.status=Io.NORMAL,this.hooks.completeDraw.taps=this.hooks.completeDraw.taps.filter((t=>"stopCb"!==t.name)),t(!1)}))})))}))}resetToInit(){this.currFrameStartAt=0,this.currentIdx=0}renderGroup(t,e){return Fo(this,void 0,void 0,(function*(){if(!e.break&&!1!==t.attribute.visibleAll)return t.incremental&&e.startAtId===t._uid?(yield this._increaseRender(t,e),void(e.break=!0)):void(yield new Promise((i=>{this.renderItem(t,e,{drawingCb:()=>Fo(this,void 0,void 0,(function*(){yield ya(t,ai.zIndex,(t=>Fo(this,void 0,void 0,(function*(){e.break||t.isContainer&&(yield this.renderGroup(t,e))})))),i(!1)}))})})))}))}};Yo=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Bo(0,_a(_r)),Bo(1,$(Ao)),Bo(2,$(Ro)),Bo(3,$(K)),Bo(3,X(xa)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Array,Object,Object,Object])],Yo);const jo=new B((t=>{t(po).toSelf().inSingletonScope(),t(Lo).toSelf().inSingletonScope(),t(Cr).to(Ia),t(cr).to(Yo),t(fr).to(vo).inSingletonScope(),t(_r).toService(fr),Z(t,so),t(mo).toSelf().inSingletonScope(),Z(t,co),Z(t,_r),t(wa).toSelf().inSingletonScope(),t(xa).toService(wa),Z(t,xa)}));function Ho(){var t;Ho.__loaded||(Ho.__loaded=!0,Ui.load(dr),Ui.load(aa),Ui.load(Rr),Ui.load(Zr),Ui.load(ca),(t=Ui).load(ua),t.load(pa),t.load(ma),function(t){t.load(jo)}(Ui))}Ho.__loaded=!1,Ho();const zo=Ui.get(et);xi.global=zo;const No=Ui.get(sr);xi.graphicUtil=No;const Vo=Ui.get(ir);xi.transformUtil=Vo;const Wo=Ui.get(Xn);xi.graphicService=Wo;const Go=Ui.get(nr);function Uo(t,e={data:t=>t}){if(!t)return t;if(t.constructor===Object){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(e[s]){i[s]=e[s](t[s]);continue}i[s]=Uo(t[s],e)}return i}return y(t)?t.map((t=>Uo(t,e))):t}function $o(t,e){if(!t)return t;if(w(t)){const i={};for(const s in t)if(Object.prototype.hasOwnProperty.call(t,s)){if(S(t[s])&&e.getFunction(t[s])){i[s]=e.getFunction(t[s]);continue}i[s]=$o(t[s],e)}return i}return y(t)?t.map((t=>$o(t,e))):t}xi.layerService=Go;let Xo=0;function Ko(){return Xo>=9999999&&(Xo=0),Xo++}const qo=t=>h(t)&&Number.isFinite(t);function Zo(t){return null!=t&&""!==t&&(!!h(t)||+t==+t)}function Jo(t){return!(!t||0===t.length)&&!D(t[0])&&!D(t[0].dataId)&&y(t[0].fields)}function Qo(t){switch(t){case"left":case"right":case"top":case"bottom":return!0;default:return!1}}function tl(t){return!!S(t)&&!!t.endsWith("%")&&Zo(t.substring(0,t.length-1))}function el(t,e,i,s=0){var n,r;return h(t)?t:tl(t)?Number(t.substring(0,t.length-1))*e/100:ys(t)?t(i):vs(t)?e*(null!==(n=t.percent)&&void 0!==n?n:0)+(null!==(r=t.offset)&&void 0!==r?r:0):s}function il(t,e,i){var s,n,r,a;const o={top:0,bottom:0,left:0,right:0};return Object.values(t).every((t=>h(t)))?(o.top=null!==(s=t.top)&&void 0!==s?s:0,o.right=null!==(n=t.right)&&void 0!==n?n:0,o.bottom=null!==(r=t.bottom)&&void 0!==r?r:0,o.left=null!==(a=t.left)&&void 0!==a?a:0,o):([{orients:["left","right"],size:e.width},{orients:["top","bottom"],size:e.height}].forEach((e=>{e.orients.forEach((s=>{o[s]=el(t[s],e.size,i)}))})),o)}function sl(t){let e={};return y(t)?(D(t[0])||(e.top=e.left=e.bottom=e.right=t[0]),D(t[1])||(e.left=e.right=t[1]),D(t[2])||(e.bottom=t[2]),D(t[3])||(e.left=t[3]),e):h(t)||tl(t)||ys(t)||vs(i=t)&&("percent"in i||"offset"in i)?(e.top=e.left=e.bottom=e.right=t,e):vs(t)?(e=Object.assign({},t),e):e;var i}function nl(t,e,i){return i?{x:t.x+e.x,y:t.y+e.y}:t}const rl=(t,e)=>{const i=Number(t),s=t.toString();return isNaN(i)&&"%"===s[s.length-1]?e*(Number(s.slice(0,s.length-1))/100):i};let al;function ol(){!function(){if(null==al)try{const t=document.createElement("canvas"),e=t.getContext("2d");al=!!(window&&t.getBoundingClientRect&&requestAnimationFrame&&window.devicePixelRatio&&e&&e.isPointInPath&&e.isPointInStroke),al&&(al=!!document.createElement)}catch(t){al=!1}}();const t=xi.global&&xi.global.env;return t?"browser"===t:al}const ll=ol(),hl=ll&&globalThis?globalThis.document:void 0;function dl(t){return("desktop-browser"===t||"mobile-browser"===t)&&ll}function cl(t){return ul(t)||"mobile-browser"===t}function ul(t){return t.includes("miniApp")||"lynx"===t||"wx"===t||"harmony"===t}const pl=(t,e)=>(ys(ml.warnHandler)&&ml.warnHandler.call(null,t,e),e?g.getInstance().warn(`[VChart warn]: ${t}`,e):g.getInstance().warn(`[VChart warn]: ${t}`)),gl=(t,e,i)=>{if(!ml.silent){if(!ys(ml.errorHandler))throw new Error(t);ml.errorHandler.call(null,t,e)}},ml={silent:!1,warnHandler:!1,errorHandler:!1};var _l,fl;function vl(t){var e,i;const{type:s}=t;return s===_l.sankey?null!==(e=t.direction)&&void 0!==e?e:"horizontal":null!==(i=t.direction)&&void 0!==i?i:"vertical"}!function(t){t.area="area",t.line="line",t.bar="bar",t.bar3d="bar3d",t.rangeColumn="rangeColumn",t.rangeColumn3d="rangeColumn3d",t.rangeArea="rangeArea",t.dot="dot",t.geo="geo",t.link="link",t.map="map",t.pie="pie",t.pie3d="pie3d",t.radar="radar",t.rose="rose",t.scatter="scatter",t.circularProgress="circularProgress",t.wordCloud="wordCloud",t.wordCloud3d="wordCloud3d",t.funnel="funnel",t.funnel3d="funnel3d",t.linearProgress="linearProgress",t.boxPlot="boxPlot",t.sankey="sankey",t.gaugePointer="gaugePointer",t.gauge="gauge",t.treemap="treemap",t.sunburst="sunburst",t.circlePacking="circlePacking",t.waterfall="waterfall",t.heatmap="heatmap",t.correlation="correlation",t.liquid="liquid",t.venn="venn",t.mosaic="mosaic"}(_l||(_l={})),function(t){t.label="label",t.point="point",t.line="line",t.area="area",t.bar="bar",t.bar3d="bar3d",t.boxPlot="boxPlot",t.outlier="outlier",t.circlePacking="circlePacking",t.group="group",t.gridBackground="gridBackground",t.grid="grid",t.dot="dot",t.title="title",t.subTitle="subTitle",t.symbol="symbol",t.funnel="funnel",t.funnel3d="funnel3d",t.transform="transform",t.transform3d="transform3d",t.transformLabel="transformLabel",t.outerLabel="outerLabel",t.outerLabelLine="outerLabelLine",t.pin="pin",t.pinBackground="pinBackground",t.pointer="pointer",t.segment="segment",t.track="track",t.cell="cell",t.cellBackground="cellBackground",t.link="link",t.arrow="arrow",t.pie="pie",t.pie3d="pie3d",t.labelLine="labelLine",t.progress="progress",t.minLabel="minLabel",t.maxLabel="maxLabel",t.rose="rose",t.node="node",t.sunburst="sunburst",t.nonLeaf="nonLeaf",t.leaf="leaf",t.nonLeafLabel="nonLeafLabel",t.leaderLine="leaderLine",t.stackLabel="stackLabel",t.word="word",t.fillingWord="fillingWord",t.wordMask="wordMask",t.nodePoint="nodePoint",t.ripplePoint="ripplePoint",t.centerPoint="centerPoint",t.centerLabel="centerLabel",t.barBackground="barBackground",t.lineLabel="lineLabel",t.areaLabel="areaLabel",t.liquidGroup="liquidGroup",t.liquid="liquid",t.liquidBackground="liquidBackground",t.liquidOutline="liquidOutline",t.circle="circle",t.overlap="overlap",t.overlapLabel="overlapLabel"}(fl||(fl={}));const yl={primaryFontColor:"titleFontColor",tertiaryFontColor:"labelFontColor",axisLabelFontColor:"axisFontColor",axisMarkerFontColor:"labelReverseFontColor",dataZoomHandleStrokeColor:"dataZoomHandlerStrokeColor",sliderHandleColor:"dataZoomHandlerFillColor",sliderRailColor:"dataZoomBackgroundColor",sliderTrackColor:"dataZoomSelectedColor",playerControllerColor:"dataZoomSelectedColor",popupBackgroundColor:"tooltipBackgroundColor",hoverBackgroundColor:"axisGridColor"},bl={titleFontColor:"primaryFontColor",labelFontColor:"tertiaryFontColor",axisFontColor:"axisLabelFontColor",labelReverseFontColor:"axisMarkerFontColor",dataZoomHandlerStrokeColor:"dataZoomHandleStrokeColor",dataZoomHandlerFillColor:"sliderHandleColor",dataZoomBackgroundColor:"sliderRailColor",dataZoomSelectedColor:"sliderTrackColor",tooltipBackgroundColor:"popupBackgroundColor"};function xl(t,e){var i;if(!t)return[];const s=wl(t,e);if(!s||y(s))return null!==(i=s)&&void 0!==i?i:[];if(vs(s)){const{dataScheme:i}=s;return i?Al(i)?i.map((i=>Object.assign(Object.assign({},i),{scheme:i.scheme.map((i=>kl(i)?Ml(t,i,e):i)).filter(M)}))):i.map((i=>kl(i)?Ml(t,i,e):i)).filter(M):[]}return[]}function Sl(t,e){var i,s;return Al(t)?null!==(s=null===(i=t.find((t=>M(t.isAvailable)?ys(t.isAvailable)?t.isAvailable(e):!!t.isAvailable:!M(t.maxDomainLength)||(null==e?void 0:e.length)<=t.maxDomainLength)))||void 0===i?void 0:i.scheme)&&void 0!==s?s:t[t.length-1].scheme:t}function Ml(t,e,i){var s;const n=wl(t,i);if(!n)return;let r;const{palette:a}=n;if(vs(a)&&(r=null!==(s=function(t,e){const i=yl[e];if(i&&t[i])return t[i];if(t[e])return t[e];const s=bl[e];return s?t[s]:void 0}(a,e.key))&&void 0!==s?s:e.default),!r)return;if(D(e.a)&&D(e.l)||!S(r))return r;let o=new Vs(r);if(M(e.l)){const{r:t,g:i,b:s}=o.color,{h:n,s:r}=Rs(t,i,s),a=Os(n,r,e.l),l=new Vs(`rgb(${a.r}, ${a.g}, ${a.b})`);l.setOpacity(o.color.opacity),o=l}return M(e.a)&&o.setOpacity(e.a),o.toRGBA()}function kl(t){return t&&"palette"===t.type&&!!t.key}function Al(t){return!(!y(t)||0===t.length)&&t.every((t=>M(t.scheme)))}function wl(t,e){var i,s;const{type:n}=null!=e?e:{};let r;if(!e||D(n))r=null==t?void 0:t.default;else{const a=vl(e);r=null!==(s=null!==(i=null==t?void 0:t[`${n}_${a}`])&&void 0!==i?i:null==t?void 0:t[n])&&void 0!==s?s:null==t?void 0:t.default}return r}function Tl(t,...e){let i=-1;const s=e.length;for(;++i{if(vs(e))e.type===n&&(y(t[n])?t[n].length>=e.index&&(t[n][e.index]=s?Tl({},t[n][e.index],i):i):t[n]=s?Tl({},t[n],i):i);else if(y(t[n])){const r=t[n].findIndex((t=>t.id===e));r>=0&&(t[n][r]=s?Tl({},t[n][r],i):i)}else t.id===e&&(t[n]=s?Tl({},t[n],i):i)}))}var Cl={},El={};function Dl(t){return new Function("d","return {"+t.map((function(t,e){return JSON.stringify(t)+": d["+e+'] || ""'})).join(",")+"}")}function Pl(t){var e=Object.create(null),i=[];return t.forEach((function(t){for(var s in t)s in e||i.push(e[s]=s)})),i}function Ol(t,e){var i=t+"",s=i.length;return s=r?l=!0:10===(s=t.charCodeAt(a++))?h=!0:13===s&&(h=!0,10===t.charCodeAt(a)&&++a),t.slice(n+1,e-1).replace(/""/g,'"')}for(;a9999?"+"+Ol(s,6):Ol(s,4))+"-"+Ol(i.getUTCMonth()+1,2)+"-"+Ol(i.getUTCDate(),2)+(o?"T"+Ol(n,2)+":"+Ol(r,2)+":"+Ol(a,2)+"."+Ol(o,3)+"Z":a?"T"+Ol(n,2)+":"+Ol(r,2)+":"+Ol(a,2)+"Z":r||n?"T"+Ol(n,2)+":"+Ol(r,2)+"Z":"")):e.test(t+="")?'"'+t.replace(/"/g,'""')+'"':t;var i,s,n,r,a,o}return{parse:function(t,e){var i,n,r=s(t,(function(t,s){if(i)return i(t,s-1);n=t,i=e?function(t,e){var i=Dl(t);return function(s,n){return e(i(s),n,t)}}(t,e):Dl(t)}));return r.columns=n||[],r},parseRows:s,format:function(e,i){return null==i&&(i=Pl(e)),[i.map(a).join(t)].concat(n(e,i)).join("\n")},formatBody:function(t,e){return null==e&&(e=Pl(t)),n(t,e).join("\n")},formatRows:function(t){return t.map(r).join("\n")},formatRow:r,formatValue:a}}var Il,Bl=Rl(","),Fl=Bl.parse,Yl=(Bl.parseRows,Bl.format,Bl.formatBody,Bl.formatRows,Bl.formatRow,Bl.formatValue,Rl("\t")),jl=Yl.parse;Yl.parseRows,Yl.format,Yl.formatBody,Yl.formatRows,Yl.formatRow,Yl.formatValue,function(t){t.DSV="dsv",t.TREE="tree",t.GEO="geo",t.BYTE="bytejson",t.HEX="hex",t.GRAPH="graph",t.TABLE="table",t.GEO_GRATICULE="geo-graticule"}(Il||(Il={}));const Hl=function(t,...e){return function(t,...e){t||(t={});let i=-1;const s=e.length;for(;++i{i.type=Il.DSV;const s=Hl(Vl,e),{delimiter:n}=s;if(!S(n))throw new TypeError("Invalid delimiter: must be a string!");return Rl(n).parse(t)},Gl=(t,e={},i)=>(i.type=Il.DSV,Fl(t)),Ul=(t,e={},i)=>(i.type=Il.DSV,jl(t));class $l{static registerChart(t,e){$l._charts[t]=e}static registerSeries(t,e){$l._series[t]=e}static registerComponent(t,e,i){$l._components[t]={cmp:e,alwaysCheck:i}}static registerMark(t,e){$l._marks[t]=e}static registerRegion(t,e){$l._regions[t]=e}static registerTransform(t,e){$l.transforms[t]=e}static registerLayout(t,e){$l._layout[t]=e}static registerAnimation(t,e){$l._animations[t]=e}static registerImplement(t,e){$l._implements[t]=e}static registerChartPlugin(t,e){$l._chartPlugin[t]=e}static registerComponentPlugin(t,e){$l._componentPlugin[t]=e}static createChart(t,e,i){return $l._charts[t]?new(0,$l._charts[t])(e,i):null}static createChartSpecTransformer(t,e){if(!$l._charts[t])return null;const i=$l._charts[t];return new(0,i.transformerConstructor)(Object.assign({seriesType:i.seriesType},e))}static createRegion(t,e,i){return $l._regions[t]?new(0,$l._regions[t])(e,i):null}static createRegionSpecTransformer(t,e){return $l._regions[t]?new(0,$l._regions[t].transformerConstructor)(e):null}static createSeries(t,e,i){return $l._series[t]?new(0,$l._series[t])(e,i):null}static createSeriesSpecTransformer(t,e){return $l._series[t]?new(0,$l._series[t].transformerConstructor)(e):null}static createMark(t,e,i){if(!$l._marks[t])return null;const s=new(0,$l._marks[t])(e,i);return"group"===s.type&&s.setInteractive(!1),s}static getComponents(){return Object.values($l._components)}static getComponentInKey(t){return $l._components[t].cmp}static getLayout(){return Object.values($l._layout)}static getLayoutInKey(t){return $l._layout[t]}static getSeries(){return Object.values($l._series)}static getSeriesInType(t){return $l._series[t]}static getRegionInType(t){return $l._regions[t]}static getAnimationInKey(t){return $l._animations[t]}static getImplementInKey(t){return $l._implements[t]}static getSeriesMarkMap(t){return $l._series[t]?$l._series[t].mark:{}}static getChartPlugins(){return Object.values($l._chartPlugin)}static getComponentPlugins(){return Object.values($l._componentPlugin)}static getComponentPluginInType(t){return $l._componentPlugin[t]}static registerFormatter(t){this._formatter=t}static getFormatter(){return this._formatter}}function Xl(t,...e){return Tl(Kl(t),...e.map(Kl))}function Kl(t){var e;if(!t)return t;const i=function(t){return t&&(t=Object.keys(t).reduce(((e,i)=>{const s=t[i];return e[i]=function(t){return y(t)?{dataScheme:t}:t}(s),e}),{})),t}(t.colorScheme);return Object.assign({},t,{colorScheme:i,token:null!==(e=t.token)&&void 0!==e?e:{},series:Object.assign({},t.series)})}$l._charts={},$l._series={},$l._components={},$l._marks={},$l._regions={},$l._animations={},$l._implements={},$l._chartPlugin={},$l._componentPlugin={},$l.transforms={fields:P,filter:(t,e)=>{const{callback:i}=e;return i&&(t=t.filter(i)),t},fold:(t,e)=>{const{fields:i,key:s,value:n,retains:r}=e,a=[];for(let e=0;e{const l={};if(l[s]=o,l[n]=t[e][o],r)r.forEach((i=>{l[i]=t[e][i]}));else for(const s in t[e])-1===i.indexOf(s)&&(l[s]=t[e][s]);a.push(l)}));return a}},$l.dataParser={csv:Gl,dsv:Wl,tsv:Ul},$l._layout={};const ql=[{maxDomainLength:10,scheme:["#1664FF","#1AC6FF","#FF8A00","#3CC780","#7442D4","#FFC400","#304D77","#B48DEB","#009488","#FF7DDA"]},{scheme:["#1664FF","#B2CFFF","#1AC6FF","#94EFFF","#FF8A00","#FFCE7A","#3CC780","#B9EDCD","#7442D4","#DDC5FA","#FFC400","#FAE878","#304D77","#8B959E","#B48DEB","#EFE3FF","#009488","#59BAA8","#FF7DDA","#FFCFEE"]}],Zl={default:{dataScheme:ql,palette:{backgroundColor:"#ffffff",borderColor:"#e3e5e8",shadowColor:"rgba(33,37,44,0.1)",hoverBackgroundColor:"#f1f2f5",sliderRailColor:"#f1f3f4",sliderHandleColor:"#ffffff",sliderTrackColor:"#0040ff",popupBackgroundColor:"#ffffff",primaryFontColor:"#21252c",secondaryFontColor:"#606773",tertiaryFontColor:"#89909d",axisLabelFontColor:"#89909d",disableFontColor:"#bcc1cb",axisMarkerFontColor:"#ffffff",axisGridColor:"#f1f2f5",axisDomainColor:"#d9dde4",dataZoomHandleStrokeColor:"#aeb5be",dataZoomChartColor:"#c9ced8",playerControllerColor:"#0040ff",scrollBarSliderColor:"rgba(0,0,0,0.3)",axisMarkerBackgroundColor:"#21252c",markLabelBackgroundColor:"#f1f2f5",markLineStrokeColor:"#606773",dangerColor:"#e33232",warningColor:"#ffc528",successColor:"#07a35a",infoColor:"#3073f2",discreteLegendPagerTextColor:"rgb(51, 51, 51)",discreteLegendPagerHandlerColor:"rgb(47, 69, 84)",discreteLegendPagerHandlerDisableColor:"rgb(170, 170, 170)",emptyCircleColor:"#e3e5e8"}}},Jl=t=>{const e={label:{style:{fill:"white",textBaseline:"middle",lineWidth:2}},outerLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"}},line:{style:{stroke:{type:"palette",key:"axisDomainColor"}}}},transformLabel:{style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle"}}};return e[t?"transform3d":"transform"]={style:{fill:{type:"palette",key:"axisGridColor"}}},e},Ql=Jl(),th=Jl(!0),eh="M1 0 C1 0.55228 0.55228 1 0 1 C-0.552285 1 -1 0.55228 -1 0 C-1 -0.552285 -0.552285 -1 0 -1 C0.55228 -1 1 -0.552285 1 0Z",ih={pointer:{type:"path",width:.4,height:.4,style:{path:"M-0.020059 -0.978425 C-0.018029 -0.9888053 -0.013378 -1 0 -1 C0.01342 -1 0.01812 -0.989146 0.0201 -0.978425 C0.02161 -0.9702819 0.0692 -0.459505 0.09486 -0.184807 C0.10298 -0.097849 0.1089 -0.034548 0.11047 -0.018339 C0.11698 0.04908 0.07373 0.11111 0.00002 0.11111 C-0.07369 0.11111 -0.117184 0.04991 -0.110423 -0.018339 C-0.103662 -0.086591 -0.022089 -0.9680447 -0.020059 -0.978425Z"}},pin:{width:.025,height:.025,style:{path:eh,fill:"#888"}},pinBackground:{width:.06,height:.06,style:{path:eh,fill:"#ddd"}}},sh="__VCHART",nh=500,rh=500,ah=`${sh}_ARC_TRANSFORM_VALUE`,oh=`${sh}_ARC_RATIO`,lh=`${sh}_ARC_START_ANGLE`,hh=`${sh}_ARC_END_ANGLE`,dh=`${sh}_ARC_K`,ch=`${sh}_ARC_MIDDLE_ANGLE`,uh=`${sh}_ARC_QUADRANT`,ph=`${sh}_ARC_RADIAN`,gh=-Math.PI/2,mh=3*Math.PI/2,_h=.6,fh={scatter:{point:{style:{size:8,symbolType:"circle",lineWidth:0,fillOpacity:.8}},label:{visible:!1,offset:5,position:"top",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},line:{label:{visible:!1,position:"top",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},area:{label:{visible:!1,offset:5,position:"top",style:{stroke:{type:"palette",key:"backgroundColor"},lineWidth:2}},point:{style:{symbolType:"circle"}},seriesMark:"area"},bar:{label:{visible:!1,position:"outside",offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}}},bar3d:{bar3d:{style:{length:3}},label:{visible:!1,style:{offset:12,position:"outside"}}},pie:{outerRadius:.6,pie:{style:{fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside",style:{fontWeight:"normal",stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1}},innerLabel:{style:{lineWidth:2}},emptyCircle:{style:{fill:{type:"palette",key:"emptyCircleColor"},fillOpacity:1}}},pie3d:{outerRadius:.6,pie3d:{style:{height:10,fillOpacity:1}},label:{visible:!1,interactive:!0,position:"outside"}},map:{defaultFillColor:"#f3f3f3",area:{style:{lineWidth:.5,strokeOpacity:1,stroke:"black",fillOpacity:1}},label:{interactive:!1,style:{fontSize:{type:"token",key:"l6FontSize"},lineHeight:{type:"token",key:"l6LineHeight"},textBaseline:"middle",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},stroke:{type:"palette",key:"backgroundColor"}}}},radar:{label:{visible:!1,offset:5,style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},point:{style:{symbolType:"circle"}}},dot:{dot:{style:{size:10,fillOpacity:1}},symbol:{style:{size:10}},title:{style:{textAlign:"left",textBaseline:"middle",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},subTitle:{style:{textAlign:"left",textBaseline:"top",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},link:{arrow:{style:{size:10}}},wordCloud:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},wordCloud3d:{word:{padding:1,style:{textAlign:"center",textBaseline:"alphabetic"}}},funnel:Ql,funnel3d:th,linearProgress:{bandWidth:30,progress:{style:{fillOpacity:1}},track:{style:{fill:"#E7EBED",fillOpacity:1}}},circularProgress:{outerRadius:.8,innerRadius:.6,progress:{style:{fillOpacity:1}},track:{style:{fillOpacity:.2}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},waterfall:{seriesFieldName:{total:"total",increase:"increase",decrease:"decrease"},leaderLine:{style:{stroke:"black",lineWidth:1,lineDash:[4,4]}},stackLabel:{visible:!0,offset:12,position:"withChange",style:{fill:"black",fontSize:{type:"token",key:"l4FontSize"}}},label:{visible:!1,offset:12,position:"inside",style:{lineWidth:2}}},gauge:{outerRadius:.8,innerRadius:.6,padAngle:1.146,segment:{style:{fillOpacity:1}},tickMask:{visible:!1,angle:3,offsetAngle:0,forceAlign:!0}},gaugePointer:ih,treemap:{gapWidth:1,nodePadding:[5],nonLeaf:{visible:!1,style:{fillOpacity:.5}},label:{style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}},nonLeafLabel:{padding:24,style:{fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},textBaseline:"middle",textAlign:"center"}}},sunburst:{innerRadius:0,outerRadius:1,startAngle:-90,endAngle:270,gap:0,labelLayout:{align:"center",offset:0,rotate:"radial"},sunburst:{style:{stroke:{type:"palette",key:"backgroundColor"},fillOpacity:1,cursor:"pointer"}},label:{visible:!0,style:{cursor:"pointer",fill:{type:"palette",key:"primaryFontColor"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},rangeColumn:{label:{visible:!1,offset:5,position:"inside",style:{lineWidth:2,fill:{type:"palette",key:"axisMarkerFontColor"}},minLabel:{position:"end"},maxLabel:{position:"start"}}},circlePacking:{layoutPadding:5,circlePacking:{visible:!0,style:{cursor:"pointer",stroke:{type:"palette",key:"backgroundColor"}}},label:{visible:!0,style:{cursor:"pointer",fill:"black",stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},heatmap:{cell:{style:{shape:"square",fillOpacity:1}},cellBackground:{visible:!1}},sankey:{link:{style:{fillOpacity:.15,round:!0}}},rose:{rose:{style:{fillOpacity:1}},label:{style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"},textAlign:"center",textBaseline:"middle"}}},boxPlot:{boxPlot:{style:{lineWidth:1}},label:{style:{lineWidth:2}}},correlation:{centerLabel:{visible:!0,position:"center",style:{fill:"#fff",text:""}},label:{visible:!0,position:"bottom",style:{fill:"#000"}}},liquid:{outlinePadding:10,liquidBackground:{style:{lineWidth:0,fillOpacity:.2}},liquidOutline:{style:{lineWidth:2}}},venn:{circle:{style:{opacity:.8},state:{hover:{opacity:1}}},overlap:{style:{opacity:.8},state:{hover:{opacity:1,stroke:"white",lineWidth:2}}},label:{visible:!0,style:{fill:"white",textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"}}},overlapLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"center",fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"}}}},mosaic:{label:{visible:!1,position:"center",style:{lineWidth:2,stroke:{type:"palette",key:"backgroundColor"}}},bar:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}}}},vh={label:{space:8},title:{space:8},maxHeight:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},yh=Object.assign(Object.assign({},vh),{label:{space:0}}),bh=t=>({area:{style:{visible:t,stroke:!1,fill:{type:"palette",key:"dataZoomChartColor"}}},line:{style:{visible:t,stroke:{type:"palette",key:"dataZoomChartColor"},lineWidth:1}}}),xh={padding:[12,0],showDetail:"auto",brushSelect:!1,middleHandler:{visible:!1,background:{size:6,style:{stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},cornerRadius:2}},icon:{style:{size:4,fill:{type:"palette",key:"sliderHandleColor"},stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}}},background:{size:20,style:{fill:{type:"palette",key:"sliderRailColor"},lineWidth:0}},selectedBackground:{style:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.1,outerBorder:{stroke:{type:"palette",key:"sliderTrackColor"},strokeOpacity:.2,distance:-.5,lineWidth:1}}},selectedBackgroundChart:bh(!1),startHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},endHandler:{style:{symbolType:"M-0.5-2.4h0.9c0.4,0,0.7,0.3,0.7,0.7v3.3c0,0.4-0.3,0.7-0.7,0.7h-0.9c-0.4,0-0.7-0.3-0.7-0.7v-3.3\nC-1.2-2-0.9-2.4-0.5-2.4z M-0.4-1.4L-0.4-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC-0.4-1.4-0.4-1.4-0.4-1.4z M0.3-1.4L0.3-1.4c0,0,0,0.1,0,0.1v2.6c0,0.1,0,0.1,0,0.1l0,0c0,0,0-0.1,0-0.1v-2.6\nC0.3-1.4,0.3-1.4,0.3-1.4z;",fill:{type:"palette",key:"sliderHandleColor"},scaleX:1.2,scaleY:1.2,stroke:{type:"palette",key:"dataZoomHandleStrokeColor"},lineWidth:1}},startText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},endText:{padding:8,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}}},backgroundChart:bh(!0)},Sh=(t,e)=>({fontSize:{type:"token",key:t},fill:{type:"palette",key:e},fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}),Mh={title:{visible:!0,autoLimit:!1,autoFit:!1,style:Sh("l1FontSize","primaryFontColor")},content:{visible:!0,style:Sh("l2FontSize","tertiaryFontColor")}},kh={orient:"right",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"primaryFontColor"}},space:12},handler:{visible:!0},startText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},endText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6},handlerText:{style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fontWeight:"normal",fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"}},space:6}},Ah=t=>{const e={width:200,height:8,style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=8):(e.width=8,e.height=200),Object.assign(Object.assign({},kh),{rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:"#ffffff"},shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"}}}})},wh={horizontal:Ah(!0),vertical:Ah(!1)},Th=t=>{const e={style:{fill:{type:"palette",key:"sliderRailColor"}}};return t?(e.width=200,e.height=4):(e.height=200,e.width=4),Object.assign(Object.assign({},kh),{sizeBackground:{fill:{type:"palette",key:"dataZoomChartColor"}},track:{style:{fill:{type:"palette",key:"sliderTrackColor",a:.8}}},rail:e,handler:{style:{symbolType:"circle",lineWidth:0,outerBorder:{lineWidth:2,distance:.8,stroke:{type:"palette",key:"sliderTrackColor"}},fill:{type:"palette",key:"sliderHandleColor"}}}})},Lh={horizontal:Th(!0),vertical:Th(!1)},Ch={area:{style:{fill:{type:"palette",key:"axisDomainColor",a:.25}}},label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Eh=t=>({visible:t,symbolType:"triangle",size:10,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}}),Dh={line:{style:{lineDash:[3,3],stroke:{type:"palette",key:"markLineStrokeColor"}}},startSymbol:Eh(!1),endSymbol:Eh(!0),label:{refY:5,style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fontStyle:"normal",fill:{type:"palette",key:"primaryFontColor"}},labelBackground:{padding:{top:2,bottom:2,right:4,left:4},style:{cornerRadius:3,fill:{type:"palette",key:"markLabelBackgroundColor"}}}}},Ph={itemLine:{decorativeLine:{visible:!1},startSymbol:{size:5,visible:!0,style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},endSymbol:{style:{fill:{type:"palette",key:"markLineStrokeColor"},stroke:null,lineWidth:0}},line:{style:{stroke:{type:"palette",key:"markLineStrokeColor"}}}},itemContent:{offsetY:-50}},Oh={fontFamily:"PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol",fontSize:14,l1FontSize:32,l1LineHeight:"150%",l2FontSize:20,l2LineHeight:"140%",l3FontSize:16,l3LineHeight:"150%",l4FontSize:14,l4LineHeight:"150%",l5FontSize:12,l5LineHeight:"130%",l6FontSize:10,l6LineHeight:"120%"},Rh={name:"light",background:{type:"palette",key:"backgroundColor"},padding:20,fontFamily:{type:"token",key:"fontFamily"},colorScheme:Zl,token:Oh,mark:{text:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1}}},markByName:{label:{style:{fontSize:{type:"token",key:"l4FontSize"},fontWeight:"normal",fillOpacity:1,lineJoin:"bevel"}},area:{style:{fillOpacity:.2}},line:{style:{lineWidth:2,lineCap:"round",lineJoin:"round"}},point:{style:{size:8,stroke:{type:"palette",key:"backgroundColor"},lineWidth:1,fillOpacity:1}},word:{style:{fontWeight:null,fontSize:null}},fillingWord:{style:{fontWeight:null,fontSize:null}},sunburst:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},circlePacking:{style:{lineWidth:1,stroke:{type:"palette",key:"backgroundColor"}}},funnel3d:{style:{stroke:!1}},barBackground:{visible:!1,style:{fill:{type:"palette",key:"primaryFontColor",a:.06},stroke:"transparent"}}},series:fh,component:{discreteLegend:{orient:"bottom",position:"middle",padding:[16,24],title:{visible:!1,padding:0,textStyle:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"primaryFontColor"},fontWeight:"normal"},space:12},pager:{textStyle:{fill:{type:"palette",key:"discreteLegendPagerTextColor"}},handler:{style:{fill:{type:"palette",key:"discreteLegendPagerHandlerColor"}},state:{disable:{fill:{type:"palette",key:"discreteLegendPagerHandlerDisableColor"}}}}},item:{visible:!0,spaceCol:10,spaceRow:6,padding:2,background:{state:{selectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}},unSelectedHover:{fill:{type:"palette",key:"hoverBackgroundColor"}}}},shape:{space:6,style:{lineWidth:0,fillOpacity:1,opacity:1},state:{unSelected:{fillOpacity:.2,opacity:1}}},label:{space:6,style:{fill:{type:"palette",key:"secondaryFontColor",default:"#89909d"},fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},opacity:1},state:{unSelected:{fill:{type:"palette",key:"disableFontColor"},opacity:1}}}},allowAllCanceled:!1},colorLegend:wh,sizeLegend:Lh,axis:{domainLine:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},grid:{visible:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[]}},subGrid:{visible:!1,style:{lineWidth:1,stroke:{type:"palette",key:"axisGridColor"},strokeOpacity:1,lineDash:[4,4]}},tick:{visible:!0,inside:!1,tickSize:4,alignWithLabel:!0,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},subTick:{visible:!1,tickSize:2,style:{lineWidth:1,stroke:{type:"palette",key:"axisDomainColor"},strokeOpacity:1}},label:{visible:!0,inside:!1,space:10,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}},title:{space:10,padding:0,style:{fontSize:{type:"token",key:"l5FontSize"},lineHeight:{type:"token",key:"l5LineHeight"},fill:{type:"palette",key:"secondaryFontColor"},fontWeight:"normal",fillOpacity:1}}},axisBand:{domainLine:{visible:!0},grid:{visible:!1},subGrid:{visible:!1},tick:{visible:!0},subTick:{visible:!1}},axisLinear:{domainLine:{visible:!1},grid:{visible:!0},subGrid:{visible:!1},tick:{visible:!1},subTick:{visible:!1}},axisX:vh,axisY:{label:{space:12,autoLimit:!0},title:{space:12,autoRotate:!0},maxWidth:"30%",unit:{visible:!1,style:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"axisLabelFontColor"},fontWeight:"normal",fillOpacity:1}}},axisZ:yh,axisAngle:{grid:{visible:!0,style:{lineDash:[6,6]}},label:{space:5}},axisRadius:{grid:{smooth:!0,visible:!0},subGrid:{smooth:!0,visible:!1}},markLine:Dh,markArea:Ch,markPoint:Ph,polarMarkLine:Dh,polarMarkArea:Ch,polarMarkPoint:Ph,geoMarkPoint:Ph,tooltip:{offset:{x:10,y:10},panel:{padding:{top:10,left:10,right:10,bottom:10},backgroundColor:{type:"palette",key:"popupBackgroundColor"},border:{color:{type:"palette",key:"popupBackgroundColor"},width:0,radius:3},shadow:{x:0,y:4,blur:12,spread:0,color:{type:"palette",key:"shadowColor"}}},spaceRow:6,titleLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0},shape:{size:8,spacing:6},keyLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"secondaryFontColor"},textBaseline:"middle",spacing:26},valueLabel:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fontColor:{type:"palette",key:"primaryFontColor"},fontWeight:"bold",textBaseline:"middle",spacing:0}},dataZoom:xh,crosshair:{trigger:"hover",bandField:{visible:!1,line:{type:"rect",visible:!0,style:{fill:{type:"palette",key:"axisGridColor"},opacity:.7,lineWidth:0,stroke:{type:"palette",key:"markLineStrokeColor"},lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}},linearField:{visible:!1,line:{type:"line",visible:!0,style:{stroke:{type:"palette",key:"markLineStrokeColor"},fill:"transparent",opacity:.7,lineDash:[2,3]}},label:{visible:!1,style:{fontWeight:"normal",fill:{type:"palette",key:"axisMarkerFontColor"},fontSize:{type:"token",key:"l5FontSize"}},labelBackground:{padding:{bottom:0,top:0,left:2,right:2},style:{fill:{type:"palette",key:"axisMarkerBackgroundColor"},cornerRadius:1}}}}},player:{visible:!0,position:"start",padding:{top:20,bottom:20},slider:{space:10,trackStyle:{fill:{type:"palette",key:"sliderTrackColor"},fillOpacity:.8},railStyle:{fill:{type:"palette",key:"sliderRailColor"}},handlerStyle:{size:15,stroke:{type:"palette",key:"backgroundColor"},lineWidth:2,fill:{type:"palette",key:"playerControllerColor"}}},controller:{start:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},pause:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},backward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}},forward:{order:0,space:10,position:"start",style:{size:12,fill:{type:"palette",key:"playerControllerColor"},fillOpacity:.8}}}},brush:{style:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",lineWidth:2},brushMode:"single",brushType:"rect",brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:0},indicator:Mh,title:{padding:{top:4,bottom:20},textStyle:{fontSize:{type:"token",key:"l3FontSize"},lineHeight:{type:"token",key:"l3LineHeight"},fill:{type:"palette",key:"primaryFontColor"}},subtextStyle:{fontSize:{type:"token",key:"l4FontSize"},lineHeight:{type:"token",key:"l4LineHeight"},fill:{type:"palette",key:"tertiaryFontColor"}}},mapLabel:{visible:!0,offset:12,position:"top",space:10,nameLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},valueLabel:{visible:!0,style:{textBaseline:"middle",textAlign:"left",fill:"black",fontSize:{type:"token",key:"l6FontSize"}}},background:{visible:!0,padding:{top:4,bottom:4,left:6,right:6},style:{cornerRadius:2,lineWidth:1,fill:"white",stroke:"grey"}},leader:{visible:!1,style:{lineWidth:1,stroke:"red"}}},poptip:{visible:!0,position:"auto",padding:8,titleStyle:{fontSize:{type:"token",key:"l5FontSize"},fontWeight:"bold",fill:{type:"palette",key:"primaryFontColor"}},contentStyle:{fontSize:{type:"token",key:"l5FontSize"},fill:{type:"palette",key:"primaryFontColor"}},panel:{visible:!0,fill:{type:"palette",key:"popupBackgroundColor"},cornerRadius:3,lineWidth:0,shadowBlur:12,shadowOffsetX:0,shadowOffsetY:4,shadowColor:{type:"palette",key:"shadowColor"},size:0,space:12}},totalLabel:{visible:!1,offset:5,overlap:{clampForce:!0,strategy:[]},smartInvert:!1,animation:!1,style:{fontSize:{type:"token",key:"l4FontSize"},fill:{type:"palette",key:"primaryFontColor"}}},scrollBar:{horizontal:{height:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}},vertical:{width:10,slider:{style:{fill:{type:"palette",key:"scrollBarSliderColor"}}}}}},animationThreshold:2e3},Ih=["animationThreshold","colorScheme","name","padding"];function Bh(t,e,i,s){if(!t)return t;e||(e=t.colorScheme),i||(i=t.token);const n={};return Object.keys(t).forEach((r=>{const a=t[r];Ih.includes(r)?n[r]=a:w(a)?kl(a)?n[r]=((t,e,i)=>{if(e&&kl(t)){const s=Ml(e,t,i);if(s)return s}return t})(a,e,s):function(t){return t&&"token"===t.type&&!!t.key}(a)?n[r]=function(t,e){return t&&e.key in t?t[e.key]:e.default}(i,a):n[r]=Bh(a,e,i,s):n[r]=a})),n}const Fh={[Rh.name]:Rh},Yh=Rh.name,jh=new Map(Object.keys(Fh).map((t=>[t,Fh[t]]))),Hh=new Map(Object.keys(Fh).map((t=>[t,Bh(Fh[t])]))),zh=new Map(Object.keys(Fh).map((t=>[t,t===Yh]))),Nh=(t,e)=>{if(!t)return;const i=Wh(e);jh.set(t,i),Hh.set(t,Bh(i)),zh.set(t,!0)},Vh=(t=Yh,e=!1)=>(zh.has(t)&&!zh.get(t)&&Nh(t,jh.get(t)),e?Hh.get(t):jh.get(t)),Wh=t=>{var e;const i=null!==(e=t.type)&&void 0!==e?e:Yh;return Xl({},Vh(i),t)};class Gh{static registerInstance(t){Gh.instances.set(t.id,t)}static unregisterInstance(t){Gh.instances.delete(t.id)}static getInstance(t){return Gh.instances.get(t)}static instanceExist(t){return Gh.instances.has(t)}static forEach(t,e=[],i){const s=Ba(e);return Gh.instances.forEach(((e,i,n)=>{s.includes(i)||t(e,i,n)}),i)}}Gh.instances=new Map;class Uh{static registerTheme(t,e){Nh(t,e)}static getTheme(t,e=!1){return Vh(t,e)}static removeTheme(t){return(t=>jh.delete(t)&&Hh.delete(t)&&zh.delete(t))(t)}static themeExist(t){return(t=>!!S(t)&&jh.has(t))(t)}static getDefaultTheme(){return Uh.themes.get(Yh)}static setCurrentTheme(t){Uh.themeExist(t)&&(Uh._currentThemeName=t,Gh.forEach((e=>null==e?void 0:e.setCurrentTheme(t))))}static getCurrentTheme(t=!1){return Uh.getTheme(Uh._currentThemeName,t)}static getCurrentThemeName(){return Uh._currentThemeName}}function $h(t,e){return S(t)?Uh.themeExist(t)?Uh.getTheme(t,e):{}:vs(t)?t:{}}var Xh,Kh,qh;Uh.themes=jh,Uh._currentThemeName=Yh,function(t){t.dimensionHover="dimensionHover",t.dimensionClick="dimensionClick"}(Xh||(Xh={})),(qh=Kh||(Kh={})).Identity="identity",qh.Linear="linear",qh.Log="log",qh.Pow="pow",qh.Sqrt="sqrt",qh.Symlog="symlog",qh.Time="time",qh.Quantile="quantile",qh.Quantize="quantize",qh.Threshold="threshold",qh.Ordinal="ordinal",qh.Point="point",qh.Band="band";const Zh={};function Jh(t){switch(t){case Kh.Linear:case Kh.Log:case Kh.Pow:case Kh.Sqrt:case Kh.Symlog:case Kh.Time:return!0;default:return!1}}function Qh(t){return!!Zh[t]}function td(t){switch(t){case Kh.Ordinal:case Kh.Point:case Kh.Band:return!0;default:return!1}}Object.values(Kh).forEach((t=>{Zh[t]=!0}));const ed=(t,e)=>{var i,s;return t===e||!D(t)&&!D(e)&&t.value===e.value&&(null===(i=t.axis)||void 0===i?void 0:i.id)===(null===(s=e.axis)||void 0===s?void 0:s.id)},id=(t,e,i,s)=>{var n;const r=td(e.getScale().type),a=[],o=e.getOption().getChart().getSeriesInIndex(e.getSpecInfo().seriesIndexes);for(const l of o)if(l.coordinate===i){const i=Ba(s(l)),o=null===(n=l.getViewData())||void 0===n?void 0:n.latestData;if(i&&o)if(r){const e=[],s=[];o.forEach(((n,r)=>{var a;(null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())&&(e.push(n),s.push(r))})),a.push({series:l,datum:e,key:sd(l,s)})}else if(M(i[1])){const e=[],s=[];o.forEach(((n,r)=>{var a;((null===(a=n[i[0]])||void 0===a?void 0:a.toString())===(null==t?void 0:t.toString())||M(n[i[0]])&&M(n[i[1]])&&t>=n[i[0]]&&t{if(M(e[i[0]])){const a=e[i[0]]-t;a>=n[0]&&a<=n[1]&&(r.push(e),h.push(s))}}));else{let e=1/0,s=0;o.forEach(((n,a)=>{if(M(n[i[0]])){const o=Math.abs(n[i[0]]-t),l=Math.sign(n[i[0]]-t);o`${t.id}_${e.join("_")}`,nd=(t,e,i)=>{const s=t.getAllComponents().filter((s=>"axes"===s.specKey&&e(s)&&((t,e,i)=>{const s=t.getRegionsInIds(Ba(e.layout.layoutBindRegionID));return null==s?void 0:s.some((t=>{const e=t.getLayoutRect(),s=t.getLayoutStartPoint();return((t,e,i)=>t.x>=e.x&&t.x<=i.x&&t.y>=e.y&&t.y<=i.y)(i,{x:s.x,y:s.y},{x:e.width+s.x,y:e.height+s.y})}))})(t,s,i)));return s.length?s:null};function rd(t,e,i,s){let n,r,a=-1;t.forEach((t=>{n=e(t),r=i(t),!D(n)&&(n=+n)>=n&&!D(r)&&(r=+r)>=r&&s(n,r,++a)}))}function ad(t,e,i,s,n){let r=0,a=0;return rd(t,e,i,((t,e)=>{const i=e-n(t),o=e-s;r+=i*i,a+=o*o})),1-r/a}const od=1e-10,ld=1e-10;function hd(t,e,i=ld,s=od){const n=s,r=i*Math.max(t,e);return Math.abs(t-e)<=Math.max(n,r)}function dd(t,e,i,s){return t>e&&!hd(t,e,i,s)}function cd(t,e,i,s){return te?1:t>=e?0:NaN}function pd(t){return Number(t)}const gd=hd;function md(t,e){const i=[];return t.forEach((t=>{const s=+t[e];qo(s)&&i.push(s)})),0===i.length?null:ja(i)}function _d(t,e){const i=[];return t.forEach((t=>{const s=+t[e];qo(s)&&i.push(s)})),0===i.length?null:Ya(i)}function fd(t,e){return t.reduce(((t,i)=>{const s=e?+i[e]:+i;return qo(s)&&(t+=s),t}),0)}function vd(t,e){let i=0,s=0;return t.forEach((t=>{const n=e?+t[e]:+t;qo(n)&&(i+=n,s++)})),i/s}function yd(t,e){const i=vd(t,e);return t.length<=1?0:t.reduce(((t,s)=>t+(e?+s[e]:+s-i)**2),0)/(t.length-1)}function bd(t,e){const i=xd(t),s=xd(e),n=Math.asin((t.x*e.y-e.x*t.y)/i/s),r=Math.acos((t.x*e.x+t.y*e.y)/i/s);return n<0?-r:r}function xd(t,e={x:0,y:0}){return be.distancePP(t,e)}function Sd(t){return qo(t.x)&&qo(t.y)}const Md=(t,e)=>{if(!t)return null;const i=nd(t,(t=>"angle"===t.getOrient()),e),s=nd(t,(t=>"radius"===t.getOrient()),e);if(!(i&&i.length||s&&s.length))return null;const n=[],r=t=>t.getDimensionField()[0],{x:a,y:o}=e;return i&&i.forEach((t=>{var e;const i=t.getScale();if(i&&td(i.type)){const l=i.domain(),h=i.range(),d=t.getCenter(),c={x:a-t.getLayoutStartPoint().x-d.x,y:o-t.getLayoutStartPoint().y-d.y};let u=bd({x:1,y:0},c);u=((t,e)=>{const i=2*Math.PI,s=ja(e),n=Ya(e);return tn&&(t-=Math.ceil((t-n)/i)*i),t})(u,h);const p=xd(c),g=null===(e=s[0])||void 0===e?void 0:e.getScale(),m=null==g?void 0:g.range();if((u-(null==h?void 0:h[0]))*(u-(null==h?void 0:h[1]))>0||(p-(null==m?void 0:m[0]))*(p-(null==m?void 0:m[1]))>0)return;const _=t.invert(u);if(D(_))return;let f=l.findIndex((t=>(null==t?void 0:t.toString())===_.toString()));f<0&&(f=void 0);const v=id(_,t,"polar",r);n.push({index:f,value:_,position:i.scale(_),axis:t,data:v})}})),s&&s.forEach((t=>{var e;const s=t.getScale(),l=null==s?void 0:s.range();if(s&&td(s.type)){const h=t.getCenter(),d={x:a-t.getLayoutStartPoint().x-h.x,y:o-t.getLayoutStartPoint().y-h.y};let c=bd({x:1,y:0},d);c<-Math.PI/2&&(c=2*Math.PI+c);const u=xd(d),p=null===(e=i[0])||void 0===e?void 0:e.getScale(),g=null==p?void 0:p.range();if((c-(null==g?void 0:g[0]))*(c-(null==g?void 0:g[1]))>0||(u-(null==l?void 0:l[0]))*(u-(null==l?void 0:l[1]))>0)return;const m=s.invert(u);if(D(m))return;let _=s.domain().findIndex((t=>(null==t?void 0:t.toString())===m.toString()));_<0&&(_=void 0);const f=id(m,t,"polar",r);n.push({index:_,value:m,position:s.scale(m),axis:t,data:f})}})),n.length?n:null};function kd(t){return"bottom"===t||"top"===t}function Ad(t){return"left"===t||"right"===t}function wd(t){return"z"===t}function Td(t,e){return Qo(t.orient)||e&&e.includes(t.orient)?t.orient:"left"}function Ld(t){return"top"===t||"bottom"===t?"horizontal":"vertical"}function Cd(t,e){var i;const s=null!==(i=t.type)&&void 0!==i?i:function(t,e){return e?kd(t)?"linear":"band":kd(t)?"band":"linear"}(t.orient,e);return{axisType:s,componentName:`${r.cartesianAxis}-${s}`}}const Ed=t=>t.fieldX[0],Dd=t=>t.fieldY[0],Pd=t=>{var e;return[t.fieldX[0],null!==(e=t.fieldX2)&&void 0!==e?e:t.fieldX[1]]},Od=t=>{var e;return[t.fieldY[0],null!==(e=t.fieldY2)&&void 0!==e?e:t.fieldY[1]]},Rd=(t,e)=>t?e?Ed:Pd:e?Dd:Od,Id=(t,e,i)=>{var s,n;if(!t)return null;const{x:r,y:a}=e,o=null!==(s=nd(t,(t=>kd(t.getOrient())),e))&&void 0!==s?s:[],l=null!==(n=nd(t,(t=>Ad(t.getOrient())),e))&&void 0!==n?n:[];if(!o.length&&!l.length)return null;const h=new Set,d=new Set,c=new Set;[o,l].forEach((t=>t.forEach((t=>{td(t.getScale().type)?h.add(t):d.add(t),i&&t.getSpec().hasDimensionTooltip&&c.add(t)}))));const u=[],p=t=>{const e="x"===t,i=e?r:a;(e?o:l).forEach((t=>{if(c.size>0){if(c.has(t)){const s=Bd(t,i,Rd(e,td(t.getScale().type)));s&&u.push(s)}}else{const s=h.size>0;if((s?h:d).has(t)){const n=Bd(t,i,Rd(e,s));n&&u.push(n)}}}))};return"horizontal"===t.getSpec().direction?(p("y"),0===u.length&&p("x")):(p("x"),0===u.length&&p("y")),u.length?u:null},Bd=(t,e,i)=>{const s=t.positionToData(e,!0);return D(s)?null:Fd(t,s,i)},Fd=(t,e,i)=>{const s=t.getScale();if(D(e))return null;let n=s.domain().findIndex((t=>(null==t?void 0:t.toString())===e.toString()));n<0&&(n=void 0);const r=id(e,t,"cartesian",null!=i?i:kd(t.getOrient())?Ed:Dd);return{index:n,value:e,position:s.scale(e),axis:t,data:r}};class Yd{constructor(t,e){this._eventDispatcher=t,this._mode=e}get chart(){var t,e;return this._chart||(this._chart=null===(e=(t=this._eventDispatcher.globalInstance).getChart)||void 0===e?void 0:e.call(t)),this._chart}register(t,e){var i,s;(null!==(s=null===(i=this.chart)||void 0===i?void 0:i.getOption().onError)&&void 0!==s?s:gl)("Method not implemented.")}unregister(){var t,e;(null!==(e=null===(t=this.chart)||void 0===t?void 0:t.getOption().onError)&&void 0!==e?e:gl)("Method not implemented.")}getTargetDimensionInfo(t,e){var i,s;const n=null!==(i=Id(this.chart,{x:t,y:e}))&&void 0!==i?i:[],r=null!==(s=Md(this.chart,{x:t,y:e}))&&void 0!==s?s:[],a=[].concat(n,r);return 0===a.length?null:a}dispatch(t,e){var i;const s=null===(i=this.chart)||void 0===i?void 0:i.getAllComponents().filter((t=>"axes"===t.specKey&&(!(null==e?void 0:e.filter)||e.filter(t)))),n=s.filter((t=>td(t.getScale().type))),r=n.length?n:s.filter((t=>{const e=t.getOrient();return kd(e)||"angle"===e})),a=[];return r.forEach((e=>{const i=Fd(e,t);i&&a.push(i)})),this._callback.call(null,{action:"enter",dimensionInfo:a}),a}}const jd=["pointerdown","pointerup","pointerupoutside","pointertap","pointerover","pointermove","pointerenter","pointerleave","pointerout","mousedown","mouseup","mouseupoutside","rightdown","rightup","rightupoutside","click","dblclick","mousemove","mouseover","mouseout","mouseenter","mouseleave","wheel","touchstart","touchend","touchendoutside","touchmove","touchcancel","tap","dragstart","drag","dragenter","dragleave","dragover","dragend","drop","pan","panstart","panend","press","pressup","pressend","pinch","pinchstart","pinchend","swipe"];var Hd,zd,Nd;!function(t){t.initialized="initialized",t.rendered="rendered",t.renderFinished="renderFinished",t.animationFinished="animationFinished",t.regionSeriesDataFilterOver="regionSeriesDataFilterOver",t.afterInitData="afterInitData",t.afterInitEvent="afterInitEvent",t.afterInitMark="afterInitMark",t.rawDataUpdate="rawDataUpdate",t.viewDataFilterOver="viewDataFilterOver",t.viewDataUpdate="viewDataUpdate",t.viewDataStatisticsUpdate="viewDataStatisticsUpdate",t.markDeltaYUpdate="markDeltaYUpdate",t.viewDataLabelUpdate="viewDataLabelUpdate",t.scaleDomainUpdate="scaleDomainUpdate",t.scaleUpdate="scaleUpdate",t.dataZoomChange="dataZoomChange",t.drill="drill",t.layoutStart="layoutStart",t.layoutEnd="layoutEnd",t.layoutRectUpdate="layoutRectUpdate",t.playerPlay="playerPlay",t.playerPause="playerPause",t.playerEnd="playerEnd",t.playerChange="playerChange",t.playerForward="playerForward",t.playerBackward="playerBackward",t.scrollBarChange="scrollBarChange",t.brushStart="brushStart",t.brushChange="brushChange",t.brushEnd="brushEnd",t.brushClear="brushClear",t.legendSelectedDataChange="legendSelectedDataChange",t.legendFilter="legendFilter",t.legendItemClick="legendItemClick",t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.tooltipShow="tooltipShow",t.tooltipHide="tooltipHide",t.tooltipRelease="tooltipRelease",t.afterResize="afterResize",t.afterRender="afterRender",t.afterLayout="afterLayout"}(Hd||(Hd={})),function(t){t.chart="chart",t.window="window",t.canvas="canvas"}(zd||(zd={})),function(t){t.vchart="vchart",t.chart="chart",t.model="model",t.mark="mark"}(Nd||(Nd={}));const Vd={[Xh.dimensionHover]:class extends Yd{constructor(){super(...arguments),this._cacheDimensionInfo=null,this.onMouseMove=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);null===s&&null!==this._cacheDimensionInfo?(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo.slice()})),this._cacheDimensionInfo=s):null===s||null!==this._cacheDimensionInfo&&s.length===this._cacheDimensionInfo.length&&!s.some(((t,e)=>!ed(t,this._cacheDimensionInfo[e])))?null!==s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"move",dimensionInfo:s.slice()})):(this._callback.call(null,Object.assign(Object.assign({},t),{action:"enter",dimensionInfo:s.slice()})),this._cacheDimensionInfo=s)},this.onMouseOut=t=>{t&&(this._callback.call(null,Object.assign(Object.assign({},t),{action:"leave",dimensionInfo:this._cacheDimensionInfo?this._cacheDimensionInfo.slice():[]})),this._cacheDimensionInfo=null)}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointermove",{query:Object.assign(Object.assign({},e.query),{source:zd.chart}),callback:this.onMouseMove}),this._eventDispatcher.register("pointerout",{query:Object.assign(Object.assign({},e.query),{source:zd.canvas}),callback:this.onMouseOut}),cl(this._mode)&&this._eventDispatcher.register("pointerdown",{query:Object.assign(Object.assign({},e.query),{source:zd.chart}),callback:this.onMouseMove})}unregister(){this._eventDispatcher.unregister("pointermove",{query:null,callback:this.onMouseMove}),cl(this._mode)&&this._eventDispatcher.unregister("pointerdown",{query:null,callback:this.onMouseMove})}},[Xh.dimensionClick]:class extends Yd{constructor(){super(...arguments),this.onClick=t=>{if(!t)return;const e=t.event.viewX,i=t.event.viewY,s=this.getTargetDimensionInfo(e,i);s&&this._callback.call(null,Object.assign(Object.assign({},t),{action:"click",dimensionInfo:s.slice()}))}}register(t,e){this._callback=e.callback,this._eventDispatcher.register("pointertap",{query:Object.assign(Object.assign({},e.query),{source:zd.chart}),callback:this.onClick})}unregister(){this._eventDispatcher.unregister("pointertap",{query:null,callback:this.onClick})}}};class Wd{getComposedEventMap(){return this._composedEventMap}constructor(t,e){this._composedEventMap=new Map,this._eventDispatcher=t,this._mode=e}on(t,e,i){const s="function"==typeof e?{query:null,callback:e}:{query:e,callback:i};if(Vd[t]){const e=new Vd[t](this._eventDispatcher,this._mode);e.register(t,s),this._composedEventMap.set(i,{eventType:t,event:e})}else this._eventDispatcher.register(t,s);return this}off(t,e,i){var s,n;const r=null!=i?i:e;if(Vd[t])if(r)null===(s=this._composedEventMap.get(r))||void 0===s||s.event.unregister(),this._composedEventMap.delete(r);else for(const e of this._composedEventMap.entries())e[1].eventType===t&&(null===(n=this._composedEventMap.get(e[0]))||void 0===n||n.event.unregister(),this._composedEventMap.delete(e[0]));else if(r){const i={callback:r,query:null,filter:{nodeName:null,type:t,level:null,source:e.source,markName:null,filter:null,userId:null}};this._eventDispatcher.unregister(t,i)}else this._eventDispatcher.unregister(t);return this}emit(t,e,i){return this._eventDispatcher.dispatch(t,e,i),this}prevent(t,e){return this._eventDispatcher.prevent(t,e),this}allow(t){return this._eventDispatcher.allow(t),this}release(){this._eventDispatcher.clear(),this._composedEventMap.clear()}}class Gd{constructor(){this._map=new Map,this._levelNodes=new Map,this._levelNodes.set(Nd.vchart,[]),this._levelNodes.set(Nd.chart,[]),this._levelNodes.set(Nd.model,[]),this._levelNodes.set(Nd.mark,[])}addHandler(t,e){var i;const s={level:e,handler:t};return null===(i=this._levelNodes.get(e))||void 0===i||i.push(s),this._map.set(t.callback,s),this}removeHandler(t){const e=this._map.get(t.callback);if(!e)return this;this._map.delete(t.callback);const i=this._levelNodes.get(e.level),s=null==i?void 0:i.findIndex((e=>e.handler.callback===t.callback));return void 0!==s&&s>=0&&(null==i||i.splice(s,1)),this}preventHandler(t){return t&&(t.prevented=!0),this}allowHandler(t){return t&&(t.prevented=!1),this}getHandlers(t){var e;return(null===(e=this._levelNodes.get(t))||void 0===e?void 0:e.map((t=>t.handler)))||[]}getAllHandlers(){return Array.from(this._map.values()).map((t=>t.handler))||[]}getCount(){return this._map.size}release(){this._map.clear(),this._levelNodes.clear()}}const Ud=(t,e,i)=>{const s=S(e)?e.split("."):e;for(let e=0;e=e||i<0||c&&t-h>=r}function f(){const t=Date.now();if(_(t))return v(t);o=m(f,function(t){const i=t-h,s=e-(t-l);return c?Math.min(s,r-i):s}(t))}function v(t){return o=void 0,u&&s?g(t):(s=n=void 0,a)}function y(...t){const i=Date.now(),r=_(i);if(s=t,n=this,l=i,r){if(void 0===o)return function(t){return h=t,o=m(f,e),d?g(t):a}(l);if(c)return o=m(f,e),g(l)}return void 0===o&&(o=m(f,e)),a}return e=+e||0,vs(i)&&(d=!!i.leading,c="maxWait"in i,c&&(r=Math.max(qo(i.maxWait)?i.maxWait:0,e)),u="trailing"in i?!!i.trailing:u),y.cancel=function(){void 0!==o&&function(t){if(p)return cancelAnimationFrame(t);clearTimeout(t)}(o),h=0,s=l=n=o=void 0},y.flush=function(){return void 0===o?a:v(Date.now())},y.pending=function(){return void 0!==o},y},Kd=function(t,e,i){let s=!0,n=!0;if("function"!=typeof t)throw new TypeError("Expected a function");return vs(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),Xd(t,e,{leading:s,trailing:n,maxWait:e})};var qd,Zd,Jd,Qd,tc,ec,ic,sc,nc,rc,ac,oc,lc,hc,dc,cc,uc,pc,gc;!function(t){t.enter="enter",t.update="update",t.exit="exit",t.group="group",t.connectNulls="connectNulls"}(qd||(qd={})),function(t){t.enter="enter",t.update="update",t.exit="exit",t.unChange="unChange"}(Zd||(Zd={})),(gc=Jd||(Jd={})).arc="arc",gc.arc3d="arc3d",gc.area="area",gc.image="image",gc.line="line",gc.path="path",gc.rect="rect",gc.rect3d="rect3d",gc.rule="rule",gc.shape="shape",gc.symbol="symbol",gc.text="text",gc.richtext="richtext",gc.polygon="polygon",gc.pyramid3d="pyramid3d",gc.circle="circle",gc.cell="cell",gc.interval="interval",gc.group="group",gc.glyph="glyph",gc.component="component",gc.largeRects="largeRects",gc.largeSymbols="largeSymbols",(pc=Qd||(Qd={})).axis="axis",pc.grid="grid",pc.legend="legend",pc.slider="slider",pc.label="label",pc.datazoom="datazoom",pc.player="player",pc.title="title",pc.scrollbar="scrollbar",function(t){t[t.player=1]="player",t[t.rollUp=2]="rollUp",t[t.drillDown=3]="drillDown",t[t.slider=4]="slider",t[t.datazoom=5]="datazoom",t[t.legend=6]="legend",t[t.scrollbar=7]="scrollbar",t[t.brush=8]="brush",t[t.normal=9]="normal"}(tc||(tc={})),(uc=ec||(ec={})).lineAxis="lineAxis",uc.circleAxis="circleAxis",(cc=ic||(ic={})).lineAxisGrid="lineAxisGrid",cc.circleAxisGrid="circleAxisGrid",function(t){t.discreteLegend="discreteLegend",t.colorLegend="colorLegend",t.sizeLegend="sizeLegend"}(sc||(sc={})),function(t){t.lineCrosshair="lineCrosshair",t.rectCrosshair="rectCrosshair",t.sectorCrosshair="sectorCrosshair",t.circleCrosshair="circleCrosshair",t.polygonCrosshair="polygonCrosshair",t.ringCrosshair="ringCrosshair"}(nc||(nc={})),function(t){t.symbolLabel="symbolLabel",t.rectLabel="rectLabel",t.lineLabel="lineLabel",t.dataLabel="dataLabel"}(rc||(rc={})),function(t){t.continuousPlayer="continuousPlayer",t.discretePlayer="discretePlayer"}(ac||(ac={})),function(t){t.before="before",t.layouting="layouting",t.reevaluate="reevaluate",t.after="after"}(oc||(oc={})),function(t){t.BEFORE_EVALUATE_DATA="beforeEvaluateData",t.AFTER_EVALUATE_DATA="afterEvaluateData",t.BEFORE_EVALUATE_SCALE="beforeEvaluateScale",t.AFTER_EVALUATE_SCALE="afterEvaluateScale",t.BEFORE_PARSE_VIEW="beforeParseView",t.AFTER_PARSE_VIEW="afterParseView",t.BEFORE_TRANSFORM="beforeTransform",t.AFTER_TRANSFORM="afterTransform",t.BEFORE_CREATE_VRENDER_STAGE="beforeCreateVRenderStage",t.AFTER_CREATE_VRENDER_STAGE="afterCreateVRenderStage",t.BEFORE_CREATE_VRENDER_LAYER="beforeCreateVRenderLayer",t.AFTER_CREATE_VRENDER_LAYER="afterCreateVRenderLayer",t.BEFORE_STAGE_RESIZE="beforeStageResize",t.AFTER_STAGE_RESIZE="afterStageResize",t.BEFORE_VRENDER_DRAW="beforeVRenderDraw",t.AFTER_VRENDER_DRAW="afterVRenderDraw",t.BEFORE_MARK_JOIN="beforeMarkJoin",t.AFTER_MARK_JOIN="afterMarkJoin",t.BEFORE_MARK_UPDATE="beforeMarkUpdate",t.AFTER_MARK_UPDATE="afterMarkUpdate",t.BEFORE_MARK_STATE="beforeMarkState",t.AFTER_MARK_STATE="afterMarkState",t.BEFORE_MARK_ENCODE="beforeMarkEncode",t.AFTER_MARK_ENCODE="afterMarkEncode",t.BEFORE_DO_LAYOUT="beforeDoLayout",t.AFTER_DO_LAYOUT="afterDoLayout",t.BEFORE_MARK_LAYOUT_END="beforeMarkLayoutEnd",t.AFTER_MARK_LAYOUT_END="afterMarkLayoutEnd",t.BEFORE_DO_RENDER="beforeDoRender",t.AFTER_DO_RENDER="afterDoRender",t.BEFORE_MARK_RENDER_END="beforeMarkRenderEnd",t.AFTER_MARK_RENDER_END="afterMarkRenderEnd",t.BEFORE_CREATE_VRENDER_MARK="beforeCreateVRenderMark",t.AFTER_CREATE_VRENDER_MARK="afterCreateVRenderMark",t.BEFORE_ADD_VRENDER_MARK="beforeAddVRenderMark",t.AFTER_ADD_VRENDER_MARK="afterAddVRenderMark",t.AFTER_VRENDER_NEXT_RENDER="afterVRenderNextRender",t.BEFORE_ELEMENT_UPDATE_DATA="beforeElementUpdateData",t.AFTER_ELEMENT_UPDATE_DATA="afterElementUpdateData",t.BEFORE_ELEMENT_STATE="beforeElementState",t.AFTER_ELEMENT_STATE="afterElementState",t.BEFORE_ELEMENT_ENCODE="beforeElementEncode",t.AFTER_ELEMENT_ENCODE="afterElementEncode",t.ANIMATION_START="animationStart",t.ANIMATION_END="animationEnd",t.ELEMENT_ANIMATION_START="elementAnimationStart",t.ELEMENT_ANIMATION_END="elementAnimationEnd",t.ALL_ANIMATION_START="allAnimationStart",t.ALL_ANIMATION_END="allAnimationEnd"}(lc||(lc={})),function(t){t.signal="signal",t.data="data",t.scale="scale",t.coordinate="coordinate",t.mark="mark"}(hc||(hc={})),function(t){t.active="active",t.selected="selected",t.highlight="highlight",t.blur="blur"}(dc||(dc={}));class mc{constructor(t,e,i,s){this.channelEncoder={},this.marks=t,e&&this.registerChannelEncoder(e),i&&this.registerDefaultEncoder(i),this.progressiveChannels&&this.registerProgressiveChannels(s)}getMarks(){return this.marks}registerChannelEncoder(t,e){return S(t)?this.channelEncoder[t]=e:Object.assign(this.channelEncoder,t),this}registerFunctionEncoder(t){return this.functionEncoder=t,this}registerDefaultEncoder(t){return this.defaultEncoder=t,this}registerProgressiveChannels(t){return this.progressiveChannels=Ba(t),this}getChannelEncoder(){return this.channelEncoder}getFunctionEncoder(){return this.functionEncoder}getDefaultEncoder(){return this.defaultEncoder}getProgressiveChannels(){return this.progressiveChannels}}class _c{static registerPlotMarks(t,e){_c._plotMarks[t]=e}static createPlotMark(t,e){return _c._plotMarks[t]?new(0,_c._plotMarks[t])(e):null}static registerMark(t,e){_c._marks[t]=e}static createMark(t,e,i){return _c._marks[t]?new(0,_c._marks[t])(e,t,i):null}static hasMark(t){return!!_c._marks[t]}static getMark(t){return _c._marks[t]}static registerComponent(t,e){_c._components[t]=e}static createComponent(t,e,i,s){const n=_c._components[t];return n?new n(e,i,s):null}static hasComponent(t){return!!_c._components[t]}static registerGraphicComponent(t,e){_c._graphicComponents[t]=e}static createGraphicComponent(t,e,i){const s=_c._graphicComponents[t];return s?s(e,i):null}static registerTransform(t,e,i){_c._transforms[t]=Object.assign(e,{type:t,isBuiltIn:!!i})}static getTransform(t){return _c._transforms[t]}static unregisterRuntimeTransforms(){Object.keys(_c._transforms).forEach((t=>{_c._transforms[t]&&!_c._transforms[t].isBuiltIn&&(_c._transforms[t]=null)}))}static registerGrammar(t,e,i){_c._grammars[t]={grammarClass:e,specKey:null!=i?i:t}}static createGrammar(t,e,i){var s;const n=null===(s=_c._grammars[t])||void 0===s?void 0:s.grammarClass;return n?new n(e,i):null}static getGrammars(){return this._grammars}static getGlyph(t){return _c._glyphs[t]}static createInteraction(t,e,i){const s=_c._interactions[t];return s?new s(e,i):null}static hasInteraction(t){return!!_c._interactions[t]}}_c._plotMarks={},_c._marks={},_c._components={},_c._graphicComponents={},_c._transforms={},_c._grammars={},_c._glyphs={},_c._animations={},_c._interactions={},_c._graphics={},_c._stageEventPlugins={},_c.registerGlyph=(t,e,i,s,n)=>(_c._glyphs[t]=new mc(e,i,s,n),_c._glyphs[t]),_c.registerAnimationType=(t,e)=>{_c._animations[t]=e},_c.getAnimationType=t=>_c._animations[t],_c.registerInteraction=(t,e)=>{_c._interactions[t]=e},_c.registerGraphic=(t,e)=>{_c._graphics[t]=e},_c.getGraphicType=t=>_c._graphics[t],_c.createGraphic=(t,e)=>{const i=_c._graphics[t];return i?i(e):null},_c.registerDefaultLayout=t=>{_c.defaultLayout=t},_c.getDefaultLayout=()=>_c.defaultLayout,_c.registerStageEventPlugin=(t,e)=>{_c._stageEventPlugins[t]=e},_c.getStageEventPlugin=t=>_c._stageEventPlugins[t];const fc={cartesianAxis:"axis","cartesianAxis-band":"axis","cartesianAxis-linear":"axis","cartesianAxis-time":"axis",polarAxis:"axis","polarAxis-band":"axis","polarAxis-linear":"axis",discreteLegend:"legend",continuousLegend:"legend",colorLegend:"legend",sizeLegend:"legend"};class vc{constructor(t,e){this._viewBubbles=new Map,this._windowBubbles=new Map,this._canvasBubbles=new Map,this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this._onDelegate=t=>{var e;const i=this.globalInstance.getChart(),s=M(t.modelId)&&(null==i?void 0:i.getModelById(t.modelId))||void 0,n=M(t.markId)&&(null==i?void 0:i.getMarkById(t.markId))||null,r=new Map;let a=null===(e=t.item)||void 0===e?void 0:e.mark;for(a&&M(a.id())&&r.set(a.id(),t.item);null==a?void 0:a.elements;){const t=a.id();M(t)&&!r.has(t)&&r.set(t,a.elements[0]),a=a.group}const o={event:t.event,item:t.item,datum:t.datum,source:t.source,itemMap:r,chart:i,model:s,mark:null!=n?n:void 0,node:Ud(t.event,"target")};this.dispatch(t.type,o)},this._onDelegateInteractionEvent=t=>{const e=this.globalInstance.getChart(),i=t.event;let s=null;i.elements&&(s=i.elements);const n={event:t.event,chart:e,items:s,datums:s&&s.map((t=>t.getDatum()))};this.dispatch(t.type,n)},this.globalInstance=t,this._compiler=e}register(t,e){var i,s,n,r,a;this._parseQuery(e);const o=this.getEventBubble((null===(i=e.filter)||void 0===i?void 0:i.source)||zd.chart),l=this.getEventListeners((null===(s=e.filter)||void 0===s?void 0:s.source)||zd.chart);if(o.get(t)||o.set(t,new Gd),o.get(t).addHandler(e,null===(n=e.filter)||void 0===n?void 0:n.level),this._isValidEvent(t)&&!l.has(t)){const i=this._onDelegate.bind(this);this._compiler.addEventListener(null===(r=e.filter)||void 0===r?void 0:r.source,t,i),l.set(t,i)}else if(this._isInteractionEvent(t)&&!l.has(t)){const i=this._onDelegateInteractionEvent.bind(this);this._compiler.addEventListener(null===(a=e.filter)||void 0===a?void 0:a.source,t,i),l.set(t,i)}return this}unregister(t,e){var i,s,n,r;let a=!1;const o=this.getEventBubble((null===(i=null==e?void 0:e.filter)||void 0===i?void 0:i.source)||zd.chart),l=this.getEventListeners((null===(s=null==e?void 0:e.filter)||void 0===s?void 0:s.source)||zd.chart);if(e){const i=o.get(t);null==i||i.removeHandler(e),0===(null==i?void 0:i.getCount())&&(null==i||i.release(),o.delete(t),a=!0),(null===(n=null==e?void 0:e.wrappedCallback)||void 0===n?void 0:n.cancel)&&e.wrappedCallback.cancel()}else{const e=o.get(t);null==e||e.release(),o.delete(t),a=!0}if(a&&this._isValidEvent(t)){const i=l.get(t);this._compiler.removeEventListener((null===(r=null==e?void 0:e.filter)||void 0===r?void 0:r.source)||zd.chart,t,i),l.delete(t)}return this}dispatch(t,e,i){const s=this.getEventBubble(e.source||zd.chart).get(t);if(!s)return this;let n=!1;if(i){const r=s.getHandlers(i);n=this._invoke(r,t,e)}else{const i=[Nd.mark,Nd.model,Nd.chart,Nd.vchart];let r=0;for(;!n&&r{const s=this.getEventBubble(i).get(t);s&&s.getAllHandlers().forEach((t=>{e&&t.callback===e||s.preventHandler(t)}))})),this}allow(t){return["canvas","chart","window"].forEach((e=>{const i=this.getEventBubble(e).get(t);i&&i.getAllHandlers().forEach((t=>i.allowHandler(t)))})),this}clear(){[zd.chart,zd.window,zd.canvas].forEach((t=>{const e=this.getEventListeners(t);for(const i of e.entries())this._compiler.removeEventListener(t,i[0],i[1]);e.clear()})),[this._viewBubbles,this._windowBubbles,this._canvasBubbles].forEach((t=>{for(const e of t.values())e.release();t.clear()}))}release(){this.clear(),this.globalInstance=null,this._compiler=null}_filter(t,e,i){var s,n,r;if(ys(t.filter)&&!t.filter(i))return!1;if(t.nodeName&&Ud(i,"node.name")!==t.nodeName)return!1;if(t.markName&&(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.name)!==t.markName)return!1;let a=null===(n=i.model)||void 0===n?void 0:n.type;return fc[a]&&(a=fc[a]),!(t.type&&a!==t.type||"mark"===t.level&&!t.type&&!(null==i?void 0:i.mark)||"model"===t.level&&!t.type&&!(null==i?void 0:i.model)||M(t.userId)&&(null===(r=i.model)||void 0===r?void 0:r.userId)!==t.userId)}_prepareParams(t,e){if(t.markName&&e.mark&&e.itemMap){const t=e.mark.getProductId(),i=e.itemMap.get(t),s=null==i?void 0:i.getDatum();return Object.assign(Object.assign({},e),{item:i,datum:s})}return Object.assign({},e)}_invoke(t,e,i){return t.map((t=>{var s,n,r;const a=t.filter;if(!t.prevented&&(!t.query||this._filter(a,e,i))){const e=(t.wrappedCallback||t.callback).call(null,this._prepareParams(a,i)),o=null!=e?e:null===(s=t.query)||void 0===s?void 0:s.consume;return o&&(null===(n=i.event)||void 0===n||n.stopPropagation(),null===(r=i.event)||void 0===r||r.preventDefault()),!!o}})).some((t=>!0===t))}_getQueryLevel(t){return t?t.level?t.level:M(t.id)?Nd.model:Nd.vchart:Nd.vchart}_parseQuery(t){var e;const i=t.query;(null==i?void 0:i.throttle)?t.wrappedCallback=Kd(t.callback,i.throttle):(null==i?void 0:i.debounce)&&(t.wrappedCallback=Xd(t.callback,i.debounce));let s=this._getQueryLevel(i),n=null,r=zd.chart,a=null,o=null,l=null;return(null==i?void 0:i.nodeName)&&(a=i.nodeName),(null==i?void 0:i.markName)&&(o=i.markName),!(null==i?void 0:i.type)||s!==Nd.model&&s!==Nd.mark||(n=i.type),(null==i?void 0:i.source)&&(r=i.source),M(null==i?void 0:i.id)&&(l=null==i?void 0:i.id,s=Nd.model),t.filter={level:s,markName:o,type:n,source:r,nodeName:a,userId:l,filter:null!==(e=null==i?void 0:i.filter)&&void 0!==e?e:null},t}getEventBubble(t){switch(t){case zd.chart:return this._viewBubbles;case zd.window:return this._windowBubbles;case zd.canvas:return this._canvasBubbles;default:return this._viewBubbles}}getEventListeners(t){switch(t){case zd.chart:return this._viewListeners;case zd.window:return this._windowListeners;case zd.canvas:return this._canvasListeners;default:return this._viewListeners}}_isValidEvent(t){return jd.includes(t)||Object.values(lc).includes(t)}_isInteractionEvent(t){let e;return t&&(e=t.split(":")[0],e)&&_c.hasInteraction(e)}}function yc(t){return t}function bc(t,e){t&&Sc.hasOwnProperty(t.type)&&Sc[t.type](t,e)}var xc={Feature:function(t,e){bc(t.geometry,e)},FeatureCollection:function(t,e){for(var i=t.features,s=-1,n=i.length;++s0?1:t<0?-1:0},Uc=Math.sqrt,$c=Math.tan;function Xc(t){return t>1?0:t<-1?Dc:Math.acos(t)}function Kc(t){return t>1?Pc:t<-1?-Pc:Math.asin(t)}function qc(){}var Zc,Jc,Qc,tu,eu=wc(),iu=wc(),su={point:qc,lineStart:qc,lineEnd:qc,polygonStart:function(){su.lineStart=nu,su.lineEnd=ou},polygonEnd:function(){su.lineStart=su.lineEnd=su.point=qc,eu.add(Fc(iu)),iu.reset()},result:function(){var t=eu/2;return eu.reset(),t}};function nu(){su.point=ru}function ru(t,e){su.point=au,Zc=Qc=t,Jc=tu=e}function au(t,e){iu.add(tu*t-Qc*e),Qc=t,tu=e}function ou(){au(Zc,Jc)}const lu=su;var hu=1/0,du=hu,cu=-hu,uu=cu,pu={point:function(t,e){tcu&&(cu=t),euu&&(uu=e)},lineStart:qc,lineEnd:qc,polygonStart:qc,polygonEnd:qc,result:function(){var t=[[hu,du],[cu,uu]];return cu=uu=-(du=hu=1/0),t}};const gu=pu;var mu,_u,fu,vu,yu=0,bu=0,xu=0,Su=0,Mu=0,ku=0,Au=0,wu=0,Tu=0,Lu={point:Cu,lineStart:Eu,lineEnd:Ou,polygonStart:function(){Lu.lineStart=Ru,Lu.lineEnd=Iu},polygonEnd:function(){Lu.point=Cu,Lu.lineStart=Eu,Lu.lineEnd=Ou},result:function(){var t=Tu?[Au/Tu,wu/Tu]:ku?[Su/ku,Mu/ku]:xu?[yu/xu,bu/xu]:[NaN,NaN];return yu=bu=xu=Su=Mu=ku=Au=wu=Tu=0,t}};function Cu(t,e){yu+=t,bu+=e,++xu}function Eu(){Lu.point=Du}function Du(t,e){Lu.point=Pu,Cu(fu=t,vu=e)}function Pu(t,e){var i=t-fu,s=e-vu,n=Uc(i*i+s*s);Su+=n*(fu+t)/2,Mu+=n*(vu+e)/2,ku+=n,Cu(fu=t,vu=e)}function Ou(){Lu.point=Cu}function Ru(){Lu.point=Bu}function Iu(){Fu(mu,_u)}function Bu(t,e){Lu.point=Fu,Cu(mu=fu=t,_u=vu=e)}function Fu(t,e){var i=t-fu,s=e-vu,n=Uc(i*i+s*s);Su+=n*(fu+t)/2,Mu+=n*(vu+e)/2,ku+=n,Au+=(n=vu*t-fu*e)*(fu+t),wu+=n*(vu+e),Tu+=3*n,Cu(fu=t,vu=e)}const Yu=Lu;function ju(t){this._context=t}ju.prototype={_radius:4.5,pointRadius:function(t){return this._radius=t,this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._context.closePath(),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._context.moveTo(t,e),this._point=1;break;case 1:this._context.lineTo(t,e);break;default:this._context.moveTo(t+this._radius,e),this._context.arc(t,e,this._radius,0,Rc)}},result:qc};var Hu,zu,Nu,Vu,Wu,Gu=wc(),Uu={point:qc,lineStart:function(){Uu.point=$u},lineEnd:function(){Hu&&Xu(zu,Nu),Uu.point=qc},polygonStart:function(){Hu=!0},polygonEnd:function(){Hu=null},result:function(){var t=+Gu;return Gu.reset(),t}};function $u(t,e){Uu.point=Xu,zu=Vu=t,Nu=Wu=e}function Xu(t,e){Vu-=t,Wu-=e,Gu.add(Uc(Vu*Vu+Wu*Wu)),Vu=t,Wu=e}const Ku=Uu;function qu(){this._string=[]}function Zu(t){return"m0,"+t+"a"+t+","+t+" 0 1,1 0,"+-2*t+"a"+t+","+t+" 0 1,1 0,"+2*t+"z"}function Ju(t,e){var i,s,n=4.5;function r(t){return t&&("function"==typeof n&&s.pointRadius(+n.apply(this,arguments)),Ac(t,i(s))),s.result()}return r.area=function(t){return Ac(t,i(lu)),lu.result()},r.measure=function(t){return Ac(t,i(Ku)),Ku.result()},r.bounds=function(t){return Ac(t,i(gu)),gu.result()},r.centroid=function(t){return Ac(t,i(Yu)),Yu.result()},r.projection=function(e){return arguments.length?(i=null==e?(t=null,yc):(t=e).stream,r):t},r.context=function(t){return arguments.length?(s=null==t?(e=null,new qu):new ju(e=t),"function"!=typeof n&&s.pointRadius(n),r):e},r.pointRadius=function(t){return arguments.length?(n="function"==typeof t?t:(s.pointRadius(+t),+t),r):n},r.projection(t).context(e)}function Qu(t){var e={type:"Feature"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"properties":case"geometry":return;default:e[i]=t[i]}})),e.properties=tp(t.properties),e.geometry=ep(t.geometry),e}function tp(t){var e={};return t?(Object.keys(t).forEach((function(i){var s=t[i];"object"==typeof s?null===s?e[i]=null:Array.isArray(s)?e[i]=s.map((function(t){return t})):e[i]=tp(s):e[i]=s})),e):e}function ep(t){var e={type:t.type};return t.bbox&&(e.bbox=t.bbox),"GeometryCollection"===t.type?(e.geometries=t.geometries.map((function(t){return ep(t)})),e):(e.coordinates=ip(t.coordinates),e)}function ip(t){var e=t;return"object"!=typeof e[0]?e.slice():e.map((function(t){return ip(t)}))}qu.prototype={_radius:4.5,_circle:Zu(4.5),pointRadius:function(t){return(t=+t)!==this._radius&&(this._radius=t,this._circle=null),this},polygonStart:function(){this._line=0},polygonEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){0===this._line&&this._string.push("Z"),this._point=NaN},point:function(t,e){switch(this._point){case 0:this._string.push("M",t,",",e),this._point=1;break;case 1:this._string.push("L",t,",",e);break;default:null==this._circle&&(this._circle=Zu(this._radius)),this._string.push("M",t,",",e,this._circle)}},result:function(){if(this._string.length){var t=this._string.join("");return this._string=[],t}return null}};var sp=6371008.8,np={centimeters:637100880,centimetres:637100880,degrees:57.22891354143274,feet:20902260.511392,inches:39.37*sp,kilometers:6371.0088,kilometres:6371.0088,meters:sp,metres:sp,miles:3958.761333810546,millimeters:6371008800,millimetres:6371008800,nauticalmiles:sp/1852,radians:1,yards:6967335.223679999};function rp(t,e,i){void 0===i&&(i={});var s={type:"Feature"};return(0===i.id||i.id)&&(s.id=i.id),i.bbox&&(s.bbox=i.bbox),s.properties=e||{},s.geometry=t,s}function ap(t,e){void 0===e&&(e={});var i={type:"FeatureCollection"};return e.id&&(i.id=e.id),e.bbox&&(i.bbox=e.bbox),i.features=t,i}function op(t){if(Array.isArray(t))return t;if("Feature"===t.type){if(null!==t.geometry)return t.geometry.coordinates}else if(t.coordinates)return t.coordinates;throw new Error("coords must be GeoJSON Feature, Geometry Object or an Array")}function lp(t){for(var e,i,s=op(t),n=0,r=1;r0}function hp(t,e){if("Feature"===t.type)e(t,0);else if("FeatureCollection"===t.type)for(var i=0;i is required");if("boolean"!=typeof s)throw new Error(" must be a boolean");if("boolean"!=typeof n)throw new Error(" must be a boolean");!1===n&&(t=function(t){if(!t)throw new Error("geojson is required");switch(t.type){case"Feature":return Qu(t);case"FeatureCollection":return function(t){var e={type:"FeatureCollection"};return Object.keys(t).forEach((function(i){switch(i){case"type":case"features":return;default:e[i]=t[i]}})),e.features=t.features.map((function(t){return Qu(t)})),e}(t);case"Point":case"LineString":case"Polygon":case"MultiPoint":case"MultiLineString":case"MultiPolygon":case"GeometryCollection":return ep(t);default:throw new Error("unknown GeoJSON type")}}(t));var r=[];switch(t.type){case"GeometryCollection":return dp(t,(function(t){cp(t,s)})),t;case"FeatureCollection":return hp(t,(function(t){hp(cp(t,s),(function(t){r.push(t)}))})),ap(r)}return cp(t,s)},mp=function(t){if(!t)throw new Error("geojson is required");var e=[];return function(t,e){dp(t,(function(t,i,s,n,r){var a,o=null===t?null:t.type;switch(o){case null:case"Point":case"LineString":case"Polygon":return!1!==e(rp(t,s,{bbox:n,id:r}),i,0)&&void 0}switch(o){case"MultiPoint":a="Point";break;case"MultiLineString":a="LineString";break;case"MultiPolygon":a="Polygon"}for(var l=0;l{if(t.geometry.type.startsWith("Multi")){const e=mp(t).features[0];return Object.assign(Object.assign({},e),e.properties)}return Object.assign(Object.assign({},t),t.properties)},yp=(t,e={},i)=>{i.type=Il.GEO;const s=Hl(fp,e),{centroid:n,name:r,bbox:a,rewind:o}=s;if(Array.isArray(t))return(t=>{const e=[];return t.forEach((t=>{"FeatureCollection"===t.type?t.features.forEach((t=>{e.push(vp(t))})):e.push(vp(t))})),e})(t);let l=t.features;return o&&(l=gp(t,{reverse:!vs(o)||o.reverse}).features),l.forEach((t=>{if(n){const e=_p.centroid(t);t.centroidX=e[0],t.centroidY=e[1]}if(r&&(t.name=t.properties.name),a){const e=_p.bounds(t);t.bbox=e}})),t.features=l,t};function bp(t){return t}function xp(t,e){var i=e.id,s=e.bbox,n=null==e.properties?{}:e.properties,r=function(t,e){var i=function(t){if(null==t)return bp;var e,i,s=t.scale[0],n=t.scale[1],r=t.translate[0],a=t.translate[1];return function(t,o){o||(e=i=0);var l=2,h=t.length,d=new Array(h);for(d[0]=(e+=t[0])*s+r,d[1]=(i+=t[1])*n+a;l{i.type=Il.GEO;const s=Hl(fp,Sp,e),{object:n}=s;if(!S(n))throw new TypeError("Invalid object: must be a string!");const r=(a=t,"string"==typeof(o=t.objects[n])&&(o=a.objects[o]),"GeometryCollection"===o.type?{type:"FeatureCollection",features:o.geometries.map((function(t){return xp(a,t)}))}:xp(a,o));var a,o;return yp(r,s,i)};var kp=i(4028),Ap=i.n(kp);const wp={tolerance:.01},Tp=(t,e)=>{const i=Hl(wp,e),{tolerance:s}=i;return Ap()(t,s)};function Lp(t,e,i){t.getTransform(e)||t.registerTransform(e,i)}function Cp(t,e,i){t.getParser(e)||t.registerParser(e,i)}const Ep=new Map;let Dp;function Pp(){Dp||(Dp=new f,Cp(Dp,"geojson",yp),Cp(Dp,"topojson",Mp),Lp(Dp,"simplify",Tp))}function Op(t,e,i={type:"geojson",centroid:!0}){Ep.has(t)&&pl(`map type of '${t}' already exists, will be overwritten.`),Pp();const s=new R(Dp),n=E({},{centroid:!0,simplify:!1},i);"topojson"===i.type?s.parse(e,{type:"topojson",options:n}):s.parse(e,{type:"geojson",options:n});const{simplify:r}=i;!0===r?s.transform({type:"simplify"}):vs(r)&&s.transform({type:"simplify",options:r}),Ep.set(t,s)}function Rp(t){Ep.has(t)?Ep.delete(t):pl(`map type of '${t}' does not exists.`)}function Ip(t,e=!1){let i=e;return t.latestData instanceof R&&(i=!1),i?k(t.latestData):t.latestData&&t.latestData.slice()}const Bp=(t,e)=>0===t.length?[]:1===t.length?Ip(t[0],null==e?void 0:e.deep):t.map((t=>Ip(t,null==e?void 0:e.deep)));function Fp(t,e,i){Lp(e=e instanceof f?e:t.dataSet,"copyDataView",Bp);const s=new R(e,i);return s.parse([t],{type:"dataview"}),s.transform({type:"copyDataView",level:Hp.copyDataView}),s}function Yp(t,e,i=[],s={}){var n,r,a;if(t instanceof R)return t;const{id:o,values:l=[],fromDataIndex:h,fromDataId:d,transforms:c=[]}=t,u=t.parser?k(t.parser):{clone:!0},p=k(t.fields);let g;u.clone=!(!1===u.clone);const m=i.find((t=>t.name===o));if(m)g=m;else{const t={name:o};if(p&&(t.fields=p),g=new R(e,t),"string"==typeof d){const t=i.find((t=>t.name===d));if(!t)return(null!==(n=s.onError)&&void 0!==n?n:gl)(`no data matches fromDataId ${d}`),null;g.parse([t],{type:"dataview"}),g.transform({type:"copyDataView"})}else if("number"==typeof h){const t=i[h];if(!t)return(null!==(r=s.onError)&&void 0!==r?r:gl)(`no data matches fromDataIndex ${h}`),null;g.parse([t],{type:"dataview"}),g.transform({type:"copyDataView"})}else Array.isArray(l)?g.parse(l,u):!S(l)||u&&!["csv","dsv","tsv"].includes(u.type)?(g.parse([]),pl("values should be array")):g.parse(l,null!==(a=u)&&void 0!==a?a:{type:"csv"});c&&c.length&&c.forEach((t=>{e.getTransform(t.type)&&g.transform(t)}))}return g}function jp(t,e,i){t&&(e.fields&&t.setFields(e.fields,i),t.parseNewData(e.values,e.parser))}var Hp,zp;function Np(t,e){return Ba(t).reduce(((t,i)=>{const s=S(i)?e.getGrammarById(i):i;return s&&t.push(s),t}),[])}function Vp(t,e){if(D(t))return[];if(!ys(i=t)&&(null==i?void 0:i.signal)){const i=t.signal;if(S(i))return Ba(e.getGrammarById(i));if("signal"===(null==i?void 0:i.grammarType))return[i]}else if(function(t){return!ys(t)&&!!(null==t?void 0:t.callback)}(t))return Np(t.dependency,e);var i;return[]}function Wp(t){return ys(t)||(null==t?void 0:t.signal)||!!(null==t?void 0:t.callback)}function Gp(t,e,i,s){if(D(t))return t;if(ys(t))return s?t.call(null,i,s,e):t.call(null,i,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?s?t.callback.call(null,i,s,e):t.callback.call(null,i,e):t}function Up(t,e){return $p(t)?t.output():e[t]}!function(t){t[t.copyDataView=-10]="copyDataView",t[t.treemapFilter=-8]="treemapFilter",t[t.treemapFlatten=-7]="treemapFlatten",t[t.dotObjFlat=-7]="dotObjFlat",t[t.linkDotInfo=-7]="linkDotInfo",t[t.sankeyLayout=-7]="sankeyLayout",t[t.dataZoomFilter=-6]="dataZoomFilter",t[t.legendFilter=-5]="legendFilter"}(Hp||(Hp={})),function(t){t.appear="appear",t.disappear="disappear",t.enter="enter",t.update="update",t.state="state",t.exit="exit",t.normal="normal",t.none="none"}(zp||(zp={}));const $p=t=>t&&!D(t.grammarType),Xp=t=>ys(t)?t:e=>e[t],Kp=(t,e)=>$p(t)?t.output():t&&vs(t)?ys(t.callback)?i=>t.callback(i,e):ys(t.value)?t.value(e):t:t,qp=(t,e)=>t?vs(t)?Object.keys(t).reduce(((i,s)=>{const n=t[s];return i[s]=Kp(n,e),i}),{}):t.map((t=>Kp(t,e))):t;let Zp=-1;class Jp extends(o()){constructor(t){super(),this.spec={},this.references=new Map,this.targets=[],this.transforms=[],this.view=t,this.uid=++Zp}parse(t){return this.id(t.id),this.name(t.name),this.depend(t.dependency),this}depend(t){var e;if(null===(e=this.spec)||void 0===e?void 0:e.dependency){const t=Ba(this.spec.dependency).map((t=>S(t)?this.view.getGrammarById(t):t));this.detach(t)}this.spec.dependency=t;const i=Ba(t).map((t=>S(t)?this.view.getGrammarById(t):t));return this.attach(i),this.commit(),this}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}emit(t,...e){var i,s;return null===(s=null===(i=this.view)||void 0===i?void 0:i.emit)||void 0===s||s.call(i,t,...e),super.emit(t,...e)}emitGrammarEvent(t,...e){return super.emit(t,...e)}evaluateTransform(t,e,i){if(!t||!t.length)return e;let s=e,n=0;const r=t.length;for(;n!D(t))).forEach((i=>{var s;D(t)||(i.targets.includes(this)||i.targets.push(this),this.references.set(i,(null!==(s=this.references.get(i))&&void 0!==s?s:0)+e))})),this}detach(t,e=1){return Ba(t).filter((t=>!D(t))).forEach((t=>{const i=this.references.get(t)-e;i>0?this.references.set(t,i-1):(this.references.delete(t),t.targets.includes(this)&&(t.targets=t.targets.filter((t=>t!==this))))})),this}detachAll(){this.references.forEach(((t,e)=>{this.detach(e,t)}))}link(t){this.grammarSource=t}run(){var t;const e=null===(t=this.grammarSource)||void 0===t?void 0:t.output(),i=this.parameters();return this.evaluate(e,i)}commit(){this.view.commit(this)}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}getSpec(){return this.spec}reuse(t){return this}clear(){this.spec=null,this.view=null}release(){this.clear()}setFunctionSpec(t,e){return D(this.spec[e])||this.detach(Vp(this.spec[e],this.view)),this.spec[e]=t,this.attach(Vp(t,this.view)),this.commit(),this}}const Qp=(t,e,i)=>{var s,n;if("callback"===t&&ys(e))return{references:[],value:{callback:e,dependency:[]}};if(!D(e.data)){const t=i.getDataById(e.data);return{references:[t],value:t}}if(!D(e.customized)){const t=i.getCustomizedById(e.customized);return{references:[t],value:t}}if(!D(e.scale)){const t=i.getScaleById(e.scale);return{references:[t],value:t}}if((n=e)&&(n.signal||n.callback)){const t=Vp(e,i);return{references:t,value:e.callback?{value:e.callback,dependency:t}:null!==(s=null==t?void 0:t[0])&&void 0!==s?s:e}}return{value:e}},tg=(t,e)=>{if(null==t?void 0:t.length){const i=[];let s=[];return t.forEach((t=>{var n;const r=((t,e)=>{const i=_c.getTransform(t.type);if(!i)return;const s={};let n=[];return Object.keys(t).forEach((i=>{var r;if("type"===i)return;const a=t[i];if("dependency"===i)return void((null==a?void 0:a.length)&&(n=n.concat(Np(a,e))));const o=((t,e,i)=>{if(D(e))return{value:e};if(y(e)){const s=e.map((e=>Qp(t,e,i)));return{references:s.reduce(((t,e)=>(e.references&&t.concat(e.references),t)),[]),value:s.map((t=>t.value))}}return Qp(t,e,i)})(i,a,e);o&&((null===(r=o.references)||void 0===r?void 0:r.length)&&(n=n.concat(o.references)),s[i]=o.value)})),{markPhase:i.markPhase,transform:i.transform,canProgressive:i.canProgressive,type:i.type,options:s,references:n}})(t,e);r&&((null===(n=r.references)||void 0===n?void 0:n.length)&&(s=s.concat(r.references)),i.push(r))})),{transforms:i,refs:s}}return null},eg={csv:Gl,dsv:Wl,tsv:Ul,json:(t,e={},i)=>{if(!S(t))return Ba(t);try{return Ba(JSON.parse(t))}catch(t){return[]}}};class ig extends Jp{constructor(t,e,i){super(t),this.grammarType="data",this.spec={},this._dataIDKey=`VGRAMMAR_DATA_ID_KEY_${this.uid}`,this._loadTasks=[],this._postFilters=[],this.ingest=t=>{const e=function(t,e){if(D(t))return t;if(ys(t))return t.call(null,e);if(t.signal){const i=t.signal;return S(i)?null==e?void 0:e[i]:i.output()}return t.callback?t.callback.call(null,e):t}(t.format,this.parameters());return this._input=((t,e)=>{if(!e||!eg[e.type])return Ba(t);const i="dsv"===e.type?{delimiter:e.delimiter}:{};return eg[e.type](t,i,new R(new f))})(t.values,e),this._input},this.load=t=>{if(t.values)return this.ingest(t)},this.relay=t=>t[0],this._loadTasks=[],D(e)||this.values(e,i)}parse(t){return super.parse(t),this._isLoaded=!1,this.source(t.source,t.format,!1),this.url(t.url,t.format,!1),this.values(t.values,t.format,!1),this.transform(t.transform),this.parseLoad(t),this.commit(),this}parseDataSource(t){const e=[],i=[],s=t.format?Vp(t.format,this.view)[0]:null;if(s&&e.push(s),t.values){const s=Vp(t.values,this.view)[0];s&&e.push(s),i.push({type:"ingest",transform:this.ingest,isRawOptions:!0,options:{values:t.values,format:t.format}})}else if(t.url){const n=Vp(t.url,this.view)[0];n&&e.push(n),i.push({type:"load",transform:this.load,options:{url:null!=n?n:t.url,format:null!=s?s:t.format}})}else if(t.source){const s=[];Ba(t.source).forEach((t=>{const i=$p(t)?t:this.view.getDataById(t);i&&(e.push(i),s.push(i))})),s.length&&(i.push({type:"relay",transform:this.relay,options:s}),this.grammarSource=s[0])}return{transforms:i,refs:e}}evaluate(t,e){this.view.emit(lc.BEFORE_EVALUATE_DATA);const i=this._isLoaded?this.transforms:this._loadTasks.concat(this.transforms);this.grammarSource&&(this._input=t);const s=this.evaluateTransform(i,this._input,e),n=this._evaluateFilter(s,e);return this.setValues(n),this._isLoaded=!0,this.view.emit(lc.AFTER_EVALUATE_DATA),this}output(){return this._values}getDataIDKey(){return this._dataIDKey}values(t,e,i=!0){const s=Object.assign({},this.spec,{values:t,format:e});return D(t)||(s.url=void 0,s.source=void 0),i?this.parseLoad(s):this}url(t,e,i=!0){const s=Object.assign({},this.spec,{url:t,format:e});return D(t)||(s.values=void 0,s.source=void 0),i?this.parseLoad(s):this}source(t,e,i=!0){const s=Object.assign({},this.spec,{source:t,format:e});return D(t)||(s.values=void 0,s.url=void 0),i?this.parseLoad(s):this}parseLoad(t){this.detach(this.parseDataSource(this.spec).refs),this.spec=t;const e=this.parseDataSource(this.spec);return this.attach(e.refs),this._loadTasks=e.transforms,this._isLoaded=!1,this.commit(),this}setValues(t){this._values=Ba(t).map(((t,e)=>{const i=t===Object(t)?t:{data:t};return i[this._dataIDKey]=e,i}))}field(t){return this._values.map((e=>e[t]))}transform(t){const e=tg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]),this.spec.transform=t;const i=tg(this.spec.transform,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.commit(),this}getValue(){return this._values}getInput(){return this._input}addDataFilter(t){return this._postFilters=this._postFilters.concat(Ba(t)),this._postFilters.sort(((t,e)=>{var i,s;return(null!==(i=t.rank)&&void 0!==i?i:0)-(null!==(s=e.rank)&&void 0!==s?s:0)})),this}removeDataFilter(t){const e=Ba(t);return this._postFilters=this._postFilters.filter((t=>!e.includes(t))),this}_evaluateFilter(t,e){return this._postFilters.reduce(((t,i)=>i.filter(t,e)),t)}reuse(t){return t.grammarType!==this.grammarType||(this._isLoaded=!1,this._values=t.output()),this}clear(){super.clear(),this._input=null,this._values=null}}function sg(t,e,i,s){let n,r;const a=t[e];for(;e>i&&(r=Math.floor((e-1)/2),n=t[r],a&&n&&s(a,n)<0);)t[e]=n,e=r;return t[e]=a}function ng(t,e,i,s){const n=e,r=null!=i?i:t.length,a=t[e];let o,l=2*e+1;for(;l=0&&(l=o),t[e]=t[l],l=2*(e=l)+1;return t[e]=a,sg(t,e,n,s)}class rg{constructor(t){this.compare=t,this.nodes=[]}size(){return this.nodes.length}last(){return this.nodes[0]}validate(){for(let t=this.nodes.length-1;t>0;t-=1){const e=Math.floor((t-1)/2);if(this.compare(this.nodes[e],this.nodes[t])>0)return!1}return!0}push(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);return sg(this.nodes,e,0,this.compare),ng(this.nodes,e,null,this.compare)}return this.nodes.push(t),sg(this.nodes,this.nodes.length-1,0,this.compare)}remove(t){if(this.nodes.includes(t)){const e=this.nodes.indexOf(t);this.nodes=this.nodes.slice(0,e).concat(this.nodes.slice(e+1)),sg(this.nodes,e,0,this.compare),ng(this.nodes,e,null,this.compare)}}pop(){const t=this.nodes.pop();let e;return this.nodes.length?(e=this.nodes[0],this.nodes[0]=t,ng(this.nodes,0,null,this.compare)):e=t,e}clear(){this.nodes=[]}}const ag=t=>t,og=t=>0;class lg{constructor(t){this.list=[],this.ids={},this.idFunc=t||ag}add(t){const e=this.idFunc(t);return this.ids[e]||(this.ids[e]=1,this.list.push(t)),this}remove(t){const e=this.idFunc(t);return this.ids[e]&&(this.ids[e]=0,this.list=this.list.filter((e=>e!==t))),this}forEach(t,e){e?this.list.slice().reverse().forEach(t):this.list.forEach(t)}filter(t){return this.list.filter(t)}get length(){return this.list.length}getElementByIndex(t){return this.list[t]}}class hg{constructor(){this.grammars=[],this.logger=g.getInstance(),this._curRank=0,this._committed=new lg((t=>t.uid)),this._heap=new rg(((t,e)=>(null==t?void 0:t.qrank)-(null==e?void 0:e.qrank))),this._beforeRunner=null,this._afterRunner=null,this._updateCounter=0,this._finishFirstRender=!1}add(t){if(t)return this._setRankOfGrammar(t),this.commit(t),!this.grammars.includes(t)&&(this.grammars.push(t),!0)}remove(t){t&&(this._committed.remove(t),this._heap.remove(t),this.grammars=this.grammars.filter((e=>e!==t)))}_setRankOfGrammar(t){t&&(t.rank=++this._curRank)}_reRank(t){const e=[t];for(;e.length;){const i=e.pop();this._setRankOfGrammar(i);const s=i.targets;s&&s.forEach((i=>{e.push(i),i===t&&this.logger.error("Cycle detected in dataflow graph.")}))}}_enqueue(t){t&&(t.qrank=t.rank,this._heap.push(t))}_logGrammarRunInfo(t){if(this.logger.canLogError()){const e=[{key:"id",value:t.id()},{key:"name",value:t.name()}].reduce(((t,e,i)=>D(e.value)?t:`${t}${i?" , ":""}${e.key}: ${e.value}`),"");this.logger.debug("Run Operator: ",t,e)}}hasCommitted(){return!!this._committed.length}commit(t){return this._committed.add(t),this}_beforeEvaluate(){this.grammars.forEach((t=>{t.targets.some((e=>(null==e?void 0:e.rank)<(null==t?void 0:t.rank)))&&this._reRank(t)})),this._committed.forEach((t=>this._enqueue(t))),this._committed=new lg((t=>t.uid))}_enqueueTargets(t){t.targets&&t.targets.length&&this._finishFirstRender&&t.targets.forEach((t=>this._enqueue(t)))}evaluate(){if(this._beforeRunner&&this._beforeRunner(this),!this._committed.length)return this.logger.info("Dataflow invoked, but nothing to do."),!1;this._updateCounter+=1;let t,e,i=0;for(this.logger.canLogInfo()&&(e=Date.now(),this.logger.debug(`-- START PROPAGATION (${this._updateCounter}) -----`)),this._beforeEvaluate();this._heap.size()>0;)t=this._heap.pop(),t&&(t.rank===t.qrank?(t.run(),this._logGrammarRunInfo(t),this._enqueueTargets(t),i+=1):this._enqueue(t));return this.logger.canLogInfo()&&(e=Date.now()-e,this.logger.info(`> ${i} grammars updated; ${e} ms`)),this._afterRunner&&this._afterRunner(this),this._finishFirstRender=!0,!0}runBefore(t){this._beforeRunner=t}runAfter(t){this._afterRunner=t}release(){this._heap&&(this._heap.clear(),this._heap=null),this.logger=null,this._committed=null}}const dg=(t,e,i,s,n)=>{const r=t=>{if(n||!t||s&&!s(t)||i.call(null,t),t.markType===Jd.group){const i=t[e];i&&i.forEach((t=>{r(t)}))}n&&(!t||s&&!s(t)||i.call(null,t))};r(t)},cg=t=>void 0===t;class ug extends xs{constructor(){super(...arguments),this.client={x:0,y:0},this.movement={x:0,y:0},this.offset={x:0,y:0},this.global={x:0,y:0},this.screen={x:0,y:0}}get clientX(){return this.client.x}get clientY(){return this.client.y}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getModifierState(t){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(t)}initMouseEvent(t,e,i,s,n,r,a,o,l,h,d,c,u,p,g){throw new Error("Method not implemented.")}}class pg extends ug{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return"pointermove"===this.type||"mousemove"===this.type||"touchmove"===this.type?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}clone(){var t,e,i;const s=new pg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyPointerData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}class gg extends ug{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}clone(){var t,e,i;const s=new gg(this.manager);s.eventPhase=s.NONE,s.currentTarget=null,s.path=[],s.detailPath=[],s.target=null,s.nativeEvent=this.nativeEvent,s.originalEvent=this.originalEvent,null===(t=this.manager)||void 0===t||t.copyWheelData(this,s),null===(e=this.manager)||void 0===e||e.copyMouseData(this,s),null===(i=this.manager)||void 0===i||i.copyData(this,s),s.target=this.target,s.path=this.composedPath().slice();const n=this.composedDetailPath();return s.detailPath=n&&n.slice(),s.type=this.type,s}}gg.DOM_DELTA_PIXEL=0,gg.DOM_DELTA_LINE=1,gg.DOM_DELTA_PAGE=2;const mg="object"==typeof performance&&performance.now?performance:Date;function _g(t){return"mouse"===t||"pen"===t}class fg{constructor(t,e){this.dispatch=new(o()),this.cursorTarget=null,this.pauseNotify=!1,this.mappingState={trackingData:{}},this.eventPool=new Map,this.onPointerDown=(t,e)=>{if(!(t instanceof pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(i,"pointerdown"),"touch"===i.pointerType)this.dispatchEvent(i,"touchstart");else if(_g(i.pointerType)){const t=2===i.button;this.dispatchEvent(i,t?"rightdown":"mousedown")}this.trackingData(t.pointerId).pressTargetsByButton[t.button]=i.composedPath(),this.freeEvent(i)},this.onPointerMove=(t,e)=>{var i,s;if(!(t instanceof pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.createPointerEvent(t,t.type,e),r=_g(n.pointerType),a=this.trackingData(t.pointerId),o=this.findMountedTarget(a.overTargets);if(a.overTargets&&o&&o!==this.rootTarget&&o!==n.target){const e="mousemove"===t.type?"mouseout":"pointerout",i=this.createPointerEvent(t,e,o||void 0);if(this.dispatchEvent(i,"pointerout"),r&&this.dispatchEvent(i,"mouseout"),!n.composedPath().includes(o)){const e=this.createPointerEvent(t,"pointerleave",o||void 0);for(e.eventPhase=e.AT_TARGET;e.target&&!n.composedPath().includes(e.target);)e.currentTarget=e.target,this.notifyTarget(e),r&&this.notifyTarget(e,"mouseleave"),e.target=e.target.parent;this.freeEvent(e)}this.freeEvent(i)}if(o!==n.target){const e="mousemove"===t.type?"mouseover":"pointerover",i=this.clonePointerEvent(n,e);this.dispatchEvent(i,"pointerover"),r&&this.dispatchEvent(i,"mouseover");let s=null==o?void 0:o.parent;for(;s&&s!==this.rootTarget.parent&&s!==n.target;)s=s.parent;if(!s||s===this.rootTarget.parent){const t=this.clonePointerEvent(n,"pointerenter");t.eventPhase=t.AT_TARGET;let e=t.target;const i=new Set;let s=o;for(;s&&s!==this.rootTarget;)i.add(s),s=s.parent;for(;e&&e!==o&&e!==this.rootTarget.parent;)i.has(e)||(t.currentTarget=e,this.notifyTarget(t),r&&this.notifyTarget(t,"mouseenter")),e=e.parent;this.freeEvent(t)}this.freeEvent(i)}this.dispatchEvent(n,"pointermove"),"touch"===n.pointerType&&this.dispatchEvent(n,"touchmove"),r&&(this.dispatchEvent(n,"mousemove"),this.cursorTarget=n.target,this.cursor=(null===(s=null===(i=n.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor()),a.overTargets=n.composedPath(),this.freeEvent(n)},this.onPointerOver=(t,e)=>{var i,s;if(!(t instanceof pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const n=this.trackingData(t.pointerId),r=this.createPointerEvent(t,t.type,e),a=_g(r.pointerType);this.dispatchEvent(r,"pointerover"),a&&this.dispatchEvent(r,"mouseover"),"mouse"===r.pointerType&&(this.cursorTarget=r.target,this.cursor=(null===(s=null===(i=r.target)||void 0===i?void 0:i.attribute)||void 0===s?void 0:s.cursor)||this.rootTarget.getCursor());const o=this.clonePointerEvent(r,"pointerenter");for(o.eventPhase=o.AT_TARGET;o.target&&o.target!==this.rootTarget.parent;)o.currentTarget=o.target,this.notifyTarget(o),a&&this.notifyTarget(o,"mouseenter"),o.target=o.target.parent;n.overTargets=r.composedPath(),this.freeEvent(r),this.freeEvent(o)},this.onPointerOut=(t,e)=>{if(!(t instanceof pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId);if(i.overTargets){const e=_g(t.pointerType),s=this.findMountedTarget(i.overTargets),n=this.createPointerEvent(t,"pointerout",s||void 0);this.dispatchEvent(n),e&&this.dispatchEvent(n,"mouseout");const r=this.createPointerEvent(t,"pointerleave",s||void 0);for(r.eventPhase=r.AT_TARGET;r.target&&r.target!==this.rootTarget.parent;)r.currentTarget=r.target,this.notifyTarget(r),e&&this.notifyTarget(r,"mouseleave"),r.target=r.target.parent;i.overTargets=[],this.freeEvent(n),this.freeEvent(r)}this.cursorTarget=null,this.cursor=""},this.onPointerUp=(t,e)=>{var i;if(!(t instanceof pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const s=mg.now(),n=this.createPointerEvent(t,t.type,e);if(this.dispatchEvent(n,"pointerup"),"touch"===n.pointerType)this.dispatchEvent(n,"touchend");else if(_g(n.pointerType)){const t=2===n.button;this.dispatchEvent(n,t?"rightup":"mouseup")}const r=this.trackingData(t.pointerId),a=this.findMountedTarget(r.pressTargetsByButton[t.button]);let o=a;if(a&&!n.composedPath().includes(a)){let e=a;for(;e&&!n.composedPath().includes(e);){if(n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType)this.notifyTarget(n,"touchendoutside");else if(_g(n.pointerType)){const t=2===n.button;this.notifyTarget(n,t?"rightupoutside":"mouseupoutside")}e=e.parent}delete r.pressTargetsByButton[t.button],o=e}if(o){const e=this.clonePointerEvent(n,"click");e.target=o,e.path=[],e.detailPath=[],r.clicksByButton[t.button]||(r.clicksByButton[t.button]={clickCount:0,target:e.target,timeStamp:s});const a=r.clicksByButton[t.button];a.target===e.target&&s-a.timeStamp<(null!==(i=this._config.clickInterval)&&void 0!==i?i:200)?++a.clickCount:a.clickCount=1,a.target=e.target,a.timeStamp=s,e.detail=a.clickCount,_g(e.pointerType)?(this.dispatchEvent(e,"click"),2===a.clickCount&&this.dispatchEvent(e,"dblclick")):"touch"===e.pointerType&&(this.dispatchEvent(e,"tap"),2===a.clickCount&&this.dispatchEvent(e,"dbltap")),this.dispatchEvent(e,"pointertap"),this.freeEvent(e)}this.freeEvent(n)},this.onPointerUpOutside=(t,e)=>{if(!(t instanceof pg))return void g.getInstance().warn("EventManager cannot map a non-pointer event as a pointer event");const i=this.trackingData(t.pointerId),s=this.findMountedTarget(i.pressTargetsByButton[t.button]),n=this.createPointerEvent(t,t.type,e);if(s){let e=s;for(;e;)n.currentTarget=e,this.notifyTarget(n,"pointerupoutside"),"touch"===n.pointerType?this.notifyTarget(n,"touchendoutside"):_g(n.pointerType)&&this.notifyTarget(n,2===n.button?"rightupoutside":"mouseupoutside"),e=e.parent;delete i.pressTargetsByButton[t.button]}this.freeEvent(n)},this.onWheel=(t,e)=>{if(!(t instanceof gg))return void g.getInstance().warn("EventManager cannot map a non-wheel event as a wheel event");const i=this.createWheelEvent(t,e);this.dispatchEvent(i),this.freeEvent(i)},this.rootTarget=t,this.mappingTable={},this._config=Object.assign({clickInterval:200},e),this.addEventMapping("pointerdown",this.onPointerDown),this.addEventMapping("pointermove",this.onPointerMove),this.addEventMapping("pointerout",this.onPointerOut),this.addEventMapping("pointerleave",this.onPointerOut),this.addEventMapping("pointerover",this.onPointerOver),this.addEventMapping("pointerup",this.onPointerUp),this.addEventMapping("pointerupoutside",this.onPointerUpOutside),this.addEventMapping("wheel",this.onWheel)}addEventMapping(t,e){this.mappingTable[t]||(this.mappingTable[t]=[]),this.mappingTable[t].push({fn:e,priority:0}),this.mappingTable[t].sort(((t,e)=>t.priority-e.priority))}dispatchEvent(t,e){t.propagationStopped=!1,t.propagationImmediatelyStopped=!1,this.propagate(t,e),this.dispatch.emit(e||t.type,t)}mapEvent(t){var e,i,s,n,r,a,o;if(!this.rootTarget)return;const l=this.mappingTable[t.type];let h;const d=`${t.canvasX}-${t.canvasY}`;if((null===(e=this._prePointTargetCache)||void 0===e?void 0:e[d])&&(null===(s=null===(i=this._prePointTargetCache)||void 0===i?void 0:i[d])||void 0===s?void 0:s.stage)&&(null===(r=null===(n=this._prePointTargetCache)||void 0===n?void 0:n[d])||void 0===r?void 0:r.stage.renderCount)===(null===(a=this._prePointTargetCache)||void 0===a?void 0:a.stageRenderCount)?h=this._prePointTargetCache[d]:(h=this.pickTarget(t.viewX,t.viewY,t),t.pickParams||(this._prePointTargetCache={[d]:h,stageRenderCount:null!==(o=null==h?void 0:h.stage.renderCount)&&void 0!==o?o:-1})),l)for(let e=0,i=l.length;e=0;s--)if(t.currentTarget=i[s],this.notifyTarget(t,e),t.propagationStopped||t.propagationImmediatelyStopped)return}}propagationPath(t){const e=[t];for(let i=0;i<2048&&t!==this.rootTarget&&t.parent;i++){if(!t.parent)throw new Error("Cannot find propagation path to disconnected target");e.push(t.parent),t=t.parent}return e.reverse(),e}notifyTarget(t,e){if(this.pauseNotify)return;e=null!=e?e:t.type;const i=t.eventPhase===t.CAPTURING_PHASE||t.eventPhase===t.AT_TARGET?`${e}capture`:e;this.notifyListeners(t,i),t.eventPhase===t.AT_TARGET&&this.notifyListeners(t,e)}findMountedTarget(t){if(!t)return null;let e=t[0];for(let i=1;i{e[i].x=t[i].x,e[i].y=t[i].y})))}copyData(t,e){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=mg.now(),e.type=t.type,e.detail=t.detail,e.view=t.view,e.which=t.which,e.layer.x=t.layer.x,e.layer.y=t.layer.y,e.page.x=t.page.x,e.page.y=t.page.y,e.pickParams=t.pickParams}trackingData(t){return this.mappingState.trackingData[t]||(this.mappingState.trackingData[t]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[t]}allocateEvent(t){var e;this.eventPool.has(t)||this.eventPool.set(t,[]);const i=(null===(e=this.eventPool.get(t))||void 0===e?void 0:e.pop())||new t(this);return i.eventPhase=i.NONE,i.currentTarget=null,i.path=[],i.detailPath=[],i.target=null,i}freeEvent(t){var e;if(t.manager!==this)throw new Error("It is illegal to free an event not managed by this EventManager!");const i=t.constructor;this.eventPool.has(i)||this.eventPool.set(i,[]),null===(e=this.eventPool.get(i))||void 0===e||e.push(t)}notifyListeners(t,e){const i=t.currentTarget._events[e];if(i)if("fn"in i)i.once&&t.currentTarget.removeEventListener(e,i.fn,{once:!0}),i.fn.call(i.context,t);else for(let s=0,n=i.length;s{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);this.autoPreventDefault&&e[0].isNormalized&&(t.cancelable||!("cancelable"in t))&&t.preventDefault();for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;if(this.isEventOutsideOfTargetElement(t))return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.isEventOutsideOfTargetViewPort(t)?"outside":"",i=this.normalizeToPointerData(t);for(let t=0,s=i.length;t{if(this.supportsTouchEvents&&"touch"===t.pointerType)return;const e=this.normalizeToPointerData(t);for(let t=0,i=e.length;t{const e=this.normalizeWheelEvent(t);this.manager.mapEvent(e)};const{targetElement:e,resolution:i,rootNode:s,global:n,autoPreventDefault:r=!1,clickInterval:a,supportsTouchEvents:o=n.supportsTouchEvents,supportsPointerEvents:l=n.supportsPointerEvents}=t;this.manager=new fg(s,{clickInterval:a}),this.globalObj=n,this.supportsPointerEvents=l,this.supportsTouchEvents=o,this.supportsMouseEvents=n.supportsMouseEvents,this.applyStyles=n.applyStyles,this.autoPreventDefault=r,this.eventsAdded=!1,this.rootPointerEvent=new pg,this.rootWheelEvent=new gg,this.cursorStyles={default:"inherit",pointer:"pointer"},this.resolution=i,this.setTargetElement(e)}release(){this.removeEvents(),this.manager&&this.manager.release(),this.domElement=null,this.manager=null,this.globalObj=null}setCursor(t,e){if(!e&&!this.manager.rootTarget.window._handler.canvas.controled)return;t||(t="default");const{applyStyles:i,domElement:s}=this;if(this.currentCursor===t)return;this.currentCursor=t;const n=this.cursorStyles[t];n?"string"==typeof n&&i?s.style.cursor=n:"function"==typeof n?n(t):"object"==typeof n&&i&&Object.assign(s.style,n):i&&S(t)&&!ms(this.cursorStyles,t)&&(s.style.cursor=t)}setTargetElement(t){this.removeEvents(),this.domElement=t,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().addEventListener("pointermove",this.onPointerMove,!0),t.getDocument().addEventListener("pointerup",this.onPointerUp,!0)):(e.addEventListener("pointermove",this.onPointerMove,!0),e.addEventListener("pointerup",this.onPointerUp,!0)),e.addEventListener("pointerdown",this.onPointerDown,!0),e.addEventListener("pointerleave",this.onPointerOverOut,!0),e.addEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().addEventListener("mousemove",this.onPointerMove,!0),t.getDocument().addEventListener("mouseup",this.onPointerUp,!0)):(e.addEventListener("mousemove",this.onPointerMove,!0),e.addEventListener("mouseup",this.onPointerUp,!0)),e.addEventListener("mousedown",this.onPointerDown,!0),e.addEventListener("mouseout",this.onPointerOverOut,!0),e.addEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.addEventListener("touchstart",this.onPointerDown,!0),e.addEventListener("touchend",this.onPointerUp,!0),e.addEventListener("touchmove",this.onPointerMove,!0)),e.addEventListener("wheel",this.onWheel,{capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;const{globalObj:t,domElement:e}=this;this.supportsPointerEvents?(t.getDocument()?(t.getDocument().removeEventListener("pointermove",this.onPointerMove,!0),t.getDocument().removeEventListener("pointerup",this.onPointerUp,!0)):(e.removeEventListener("pointermove",this.onPointerMove,!0),e.removeEventListener("pointerup",this.onPointerUp,!0)),e.removeEventListener("pointerdown",this.onPointerDown,!0),e.removeEventListener("pointerleave",this.onPointerOverOut,!0),e.removeEventListener("pointerover",this.onPointerOverOut,!0)):(t.getDocument()?(t.getDocument().removeEventListener("mousemove",this.onPointerMove,!0),t.getDocument().removeEventListener("mouseup",this.onPointerUp,!0)):(e.removeEventListener("mousemove",this.onPointerMove,!0),e.removeEventListener("mouseup",this.onPointerUp,!0)),e.removeEventListener("mousedown",this.onPointerDown,!0),e.removeEventListener("mouseout",this.onPointerOverOut,!0),e.removeEventListener("mouseover",this.onPointerOverOut,!0)),this.supportsTouchEvents&&(e.removeEventListener("touchstart",this.onPointerDown,!0),e.removeEventListener("touchend",this.onPointerUp,!0),e.removeEventListener("touchmove",this.onPointerMove,!0)),e.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapToViewportPoint(t){return this.domElement.pointTransform?this.domElement.pointTransform(t.x,t.y):t}mapToCanvasPoint(t){var e,i;const s=null===(e=this.globalObj)||void 0===e?void 0:e.mapToCanvasPoint(t,this.domElement);if(s)return s;let n=0,r=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0}else n=t.clientX||0,r=t.clientY||0;const a=this.domElement.getBoundingClientRect();return{x:n-a.left,y:r-a.top}}normalizeToPointerData(t){const e=[];if(this.supportsTouchEvents&&t.changedTouches&&t.changedTouches.length)for(let i=0,s=t.changedTouches.length;i0&&e.y>0)}return!1}isEventOutsideOfTargetElement(t){let e=t.target;return t.composedPath&&t.composedPath().length>0&&(e=t.composedPath()[0]),e!==(this.domElement.getNativeHandler?this.domElement.getNativeHandler().nativeCanvas:this.domElement)}pauseTriggerEvent(){this.manager.pauseNotify=!0}resumeTriggerEvent(){this.manager.pauseNotify=!1}}class bg{constructor(){this.name="AutoRenderPlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.handleChange=t=>{t.glyphHost&&(t=t.glyphHost),t.stage===this.pluginService.stage&&null!=t.stage&&t.stage.renderNextFrame()}}activate(t){this.pluginService=t,xi.graphicService.hooks.onAttributeUpdate.tap(this.key,this.handleChange),xi.graphicService.hooks.onSetStage.tap(this.key,this.handleChange),xi.graphicService.hooks.onRemove.tap(this.key,this.handleChange)}deactivate(t){const e=t=>t.filter((t=>t.name!==this.key));xi.graphicService.hooks.onAttributeUpdate.taps=e(xi.graphicService.hooks.onAttributeUpdate.taps),xi.graphicService.hooks.onSetStage.taps=e(xi.graphicService.hooks.onSetStage.taps),xi.graphicService.hooks.onRemove.taps=e(xi.graphicService.hooks.onRemove.taps)}}class xg{constructor(){this.name="IncrementalAutoRenderPlugin",this.activeEvent="onRegister",this.nextFrameRenderGroupSet=new Set,this.willNextFrameRender=!1,this.nextUserParams={},this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,xi.graphicService.hooks.onAddIncremental.tap(this.key,((e,i,s)=>{e.glyphHost&&(e=e.glyphHost),e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=i._uid,this.renderNextFrame(i))})),xi.graphicService.hooks.onClearIncremental.tap(this.key,((e,i)=>{e.stage===t.stage&&null!=e.stage&&(this.nextUserParams.startAtId=e._uid,this.nextUserParams.restartIncremental=!0,this.renderNextFrame(e))}))}deactivate(t){xi.graphicService.hooks.onAddIncremental.taps=xi.graphicService.hooks.onAddIncremental.taps.filter((t=>t.name!==this.key)),xi.graphicService.hooks.onClearIncremental.taps=xi.graphicService.hooks.onClearIncremental.taps.filter((t=>t.name!==this.key))}renderNextFrame(t){this.nextFrameRenderGroupSet.add(t),this.willNextFrameRender||(this.willNextFrameRender=!0,xi.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){const t=this.pluginService.stage;this.nextFrameRenderGroupSet.size&&(this.nextFrameRenderGroupSet.forEach((e=>{const i=e.layer;if(!i||!e.layer.subLayers)return;const s=e.layer.subLayers.get(e._uid);s&&s.drawContribution&&s.drawContribution.draw(t.renderService,Object.assign({stage:t,layer:i,viewBox:t.window.getViewBox(),transMatrix:t.window.getViewBoxTransform(),clear:"transparent",renderService:t.renderService,updateBounds:!1,startAtId:e._uid,context:s.layer.getNativeHandler().getContext()},this.nextUserParams))})),this.nextUserParams={},this.nextFrameRenderGroupSet.clear())}}const Sg=new qt;class Mg{constructor(){this.name="DirtyBoundsPlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(t=>{t&&t===this.pluginService.stage&&t.dirtyBounds.clear()})),xi.graphicService.hooks.beforeUpdateAABBBounds.tap(this.key,((t,e,i,s)=>{t.glyphHost&&(t=t.glyphHost),e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!t.shouldSelfChangeUpdateAABBBounds()||i&&(Sg.setValue(s.x1,s.y1,s.x2,s.y2),e.dirty(Sg,t.parent&&t.parent.globalTransMatrix)))})),xi.graphicService.hooks.afterUpdateAABBBounds.tap(this.key,((t,e,i,s,n)=>{e&&e===this.pluginService.stage&&e.renderCount&&(t.isContainer&&!n||e.dirty(s.globalAABBBounds))})),xi.graphicService.hooks.onRemove.tap(this.key,(t=>{const e=t.stage;e&&e===this.pluginService.stage&&e.renderCount&&e&&e.dirty(t.globalAABBBounds)}))}deactivate(t){xi.graphicService.hooks.beforeUpdateAABBBounds.taps=xi.graphicService.hooks.beforeUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),xi.graphicService.hooks.afterUpdateAABBBounds.taps=xi.graphicService.hooks.afterUpdateAABBBounds.taps.filter((t=>t.name!==this.key)),t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),xi.graphicService.hooks.onRemove.taps=xi.graphicService.hooks.onRemove.taps.filter((t=>t.name!==this.key))}}var kg;!function(t){t[t.INITIAL=0]="INITIAL",t[t.RUNNING=1]="RUNNING",t[t.PAUSE=2]="PAUSE"}(kg||(kg={}));class Ag{static Avaliable(){return!!xi.global.getRequestAnimationFrame()}avaliable(){return Ag.Avaliable()}tick(t,e){xi.global.getRequestAnimationFrame()((()=>{this.released||e(this)}))}release(){this.released=!0}getTime(){return Date.now()}}class wg{static Avaliable(){return!0}avaliable(){return wg.Avaliable()}tick(t,e){this.timerId=setTimeout((()=>{e(this)}),t)}release(){this.timerId>0&&(clearTimeout(this.timerId),this.timerId=-1)}getTime(){return Date.now()}}const Tg=new class{set mode(t){this._mode!==t&&(this._mode=t,this.setupTickHandler())}get mode(){return this._mode}constructor(t=[]){this.handleTick=(t,e)=>{const{once:i=!1}=null!=e?e:{};this.ifCanStop()?this.stop():(this._handlerTick(t),i||t.tick(this.interval,this.handleTick))},this._handlerTick=t=>{const e=this.tickerHandler.getTime();let i=0;this.lastFrameTime>=0&&(i=e-this.lastFrameTime),this.lastFrameTime=e,this.status===kg.RUNNING&&(this.tickCounts++,this.timelines.forEach((t=>{t.tick(i)})))},this.init(),this.lastFrameTime=-1,this.tickCounts=0,this.timelines=t,this.autoStop=!0}init(){this.interval=NaN,this.status=kg.INITIAL,xi.global.hooks.onSetEnv.tap("default-ticker",(()=>{this.initHandler()})),xi.global.env&&this.initHandler()}addTimeline(t){this.timelines.push(t)}remTimeline(t){this.timelines=this.timelines.filter((e=>e!==t))}initHandler(){if(this._mode)return null;const t=[{mode:"raf",cons:Ag},{mode:"timeout",cons:wg}];for(let e=0;e{this.handleTick(t,{once:!0})}))}tickTo(t){this.tickerHandler.tickTo&&this.tickerHandler.tickTo(t,(t=>{this.handleTick(t,{once:!0})}))}pause(){return this.status!==kg.INITIAL&&(this.status=kg.PAUSE,!0)}resume(){return this.status!==kg.INITIAL&&(this.status=kg.RUNNING,!0)}ifCanStop(){if(this.autoStop){if(!this.timelines.length)return!0;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!0}return!1}start(t=!1){if(this.status===kg.RUNNING)return!1;if(!this.tickerHandler)return!1;if(!t){if(this.status===kg.PAUSE)return!1;if(!this.timelines.length)return!1;if(0===this.timelines.reduce(((t,e)=>t+e.animateCount),0))return!1}return this.status=kg.RUNNING,this.tickerHandler.tick(0,this.handleTick),!0}stop(){this.status=kg.INITIAL,this.setupTickHandler(),this.lastFrameTime=-1}};Tg.addTimeline(ws),Tg.setFPS(60);class Lg{static registerPlugin(t,e){Lg._pluginClasses[t]=e}static getPlugin(t){return Lg._pluginClasses[t]}}Lg._pluginClasses={};const Cg="white";class Eg extends Qn{set viewBox(t){this.window.setViewBox(t)}get viewBox(){return this.window.getViewBox()}get x(){return this.window.getViewBox().x1}set x(t){const e=this.window.getViewBox();e.translate(t-e.x1,0),this.window.setViewBox(e)}get y(){return this.window.getViewBox().y1}set y(t){const e=this.window.getViewBox();e.translate(0,t-e.y1),this.window.setViewBox(e)}get width(){return this.window.width}set width(t){this.resize(t,this.height)}get viewWidth(){return this.window.getViewBox().width()}set viewWidth(t){this.resizeView(t,this.viewHeight)}get viewHeight(){return this.window.getViewBox().height()}set viewHeight(t){this.resizeView(this.viewWidth,t)}get height(){return this.window.height}set height(t){this.resize(this.width,t)}get dpr(){return this.window.dpr}set dpr(t){this.setDpr(t)}get background(){var t;return null!==(t=this._background)&&void 0!==t?t:Cg}set background(t){this._background=t}get defaultLayer(){return this.at(0)}get eventSystem(){return this._eventSystem}constructor(t={}){var e;super({}),this._onVisibleChange=t=>{if(!(this._skipRender<0))if(t){if(this.dirtyBounds){const t=this.window.getViewBox();this.dirtyBounds.setValue(t.x1,t.y1,t.width(),t.height())}this._skipRender>1&&this.renderNextFrame(),this._skipRender=0}else this._skipRender=1},this.beforeRender=t=>{this._beforeRender&&this._beforeRender(t)},this.afterRender=t=>{this.renderCount++,this._afterRender&&this._afterRender(t),this._afterNextRenderCbs&&this._afterNextRenderCbs.forEach((e=>e(t))),this._afterNextRenderCbs=null},this.params=t,this.theme=new cs,this.hooks={beforeRender:new Q(["stage"]),afterRender:new Q(["stage"])},this.global=xi.global,!this.global.env&&ol()&&this.global.setEnv("browser"),this.window=Ui.get(Zi),this.renderService=Ui.get(Er),this.pluginService=Ui.get(la),this.layerService=Ui.get(nr),this.pluginService.active(this,t),this.window.create({width:t.width,height:t.height,viewBox:t.viewBox,container:t.container,dpr:t.dpr||this.global.devicePixelRatio,canvasControled:!1!==t.canvasControled,title:t.title||"",canvas:t.canvas}),this.state="normal",this.renderCount=0,this.tryInitEventSystem(),this._background=null!==(e=t.background)&&void 0!==e?e:Cg,this.appendChild(this.layerService.createLayer(this,{main:!0})),this.nextFrameRenderLayerSet=new Set,this.willNextFrameRender=!1,this.stage=this,this.renderStyle=t.renderStyle,t.autoRender&&this.enableAutoRender(),!1===t.disableDirtyBounds&&this.enableDirtyBounds(),t.enableHtmlAttribute&&this.enableHtmlAttribute(t.enableHtmlAttribute),t.ReactDOM&&this.enableReactAttribute(t.ReactDOM),t.enableLayout&&this.enableLayout(),this.hooks.beforeRender.tap("constructor",this.beforeRender),this.hooks.afterRender.tap("constructor",this.afterRender),this._beforeRender=t.beforeRender,this._afterRender=t.afterRender,this.ticker=t.ticker||Tg,this.supportInteractiveLayer=!1!==t.interactiveLayer,this.timeline=new As,this.ticker.addTimeline(this.timeline),this.timeline.pause(),t.optimize||(t.optimize={}),this.optmize(t.optimize),t.background&&S(this._background)&&this._background.includes("/")&&this.setAttributes({background:this._background})}pauseRender(t=-1){this._skipRender=t}resumeRender(){this._skipRender=0}tryInitEventSystem(){this.global.supportEvent&&!this._eventSystem&&(this._eventSystem=new yg(Object.assign({targetElement:this.window,resolution:this.window.dpr||this.global.devicePixelRatio,rootNode:this,global:this.global,supportsPointerEvents:this.params.supportsPointerEvents,supportsTouchEvents:this.params.supportsTouchEvents},this.params.event)))}preventRender(t){t?this._skipRender=-1/0:!1!==this.params.optimize.skipRenderWithOutRange?this._skipRender=this.window.isVisible()?0:1:this._skipRender=0}optmize(t){this.optmizeRender(t.skipRenderWithOutRange),this.params.optimize=t}optmizeRender(t=!1){t&&(this._skipRender=this._skipRender<0?this._skipRender:this.window.isVisible()?0:1,this.window.onVisibleChange(this._onVisibleChange))}getTimeline(){return this.timeline}get3dOptions(t){const{center:e={x:this.width/2,y:this.height/2,z:0,dx:0,dy:0,dz:0},light:i={},alpha:s=0,beta:n=0,camera:r,fieldRatio:a=1,fieldDepth:o}=t;return Object.assign(Object.assign({},t),{center:e,light:i,alpha:s,beta:n,camera:r,fieldRatio:a,fieldDepth:o})}set3dOptions(t){var e,i,s,n,r,a;this.option3d=t;const o=this.get3dOptions(t),{light:l,center:h,camera:d,alpha:c,beta:u,fieldRatio:p,fieldDepth:g}=o,{dir:m=[1,1,-1],color:_="white",ambient:f}=l,v=(null!==(e=h.x)&&void 0!==e?e:this.width/2)+(null!==(i=h.dx)&&void 0!==i?i:0),y=(null!==(s=h.y)&&void 0!==s?s:this.height/2)+(null!==(n=h.dy)&&void 0!==n?n:0),b=[v,y,(null!==(r=h.z)&&void 0!==r?r:0)+(null!==(a=h.dz)&&void 0!==a?a:0)];let x=0,S=0,M=0;d||(x=Math.sin(c)+v,S=Math.sin(u)+y,M=Math.cos(c)*Math.cos(u)*1);const k=Lg.getPlugin("DirectionalLight");k&&(this.light=new k(m,_,f));const A={left:0,right:this.width,top:0,bottom:this.height,fieldRatio:p,fieldDepth:g,viewParams:{pos:[x,S,M],center:b,up:[0,1,0]}};if(this.camera)this.camera.params=A;else{const t=Lg.getPlugin("OrthoCamera");t&&(this.camera=new t(A))}t.enableView3dTransform&&this.enableView3dTransform()}setBeforeRender(t){this._beforeRender=t}setAfterRender(t){this._afterRender=t}afterNextRender(t){this._afterNextRenderCbs||(this._afterNextRenderCbs=[]),this._afterNextRenderCbs.push(t)}enableView3dTransform(){if(this.view3dTranform)return;this.view3dTranform=!0;const t=Lg.getPlugin("ViewTransform3dPlugin");t&&this.pluginService.register(new t)}disableView3dTranform(){this.view3dTranform&&(this.view3dTranform=!1,this.pluginService.findPluginsByName("ViewTransform3dPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableAutoRender(){this.autoRender||(this.autoRender=!0,this.pluginService.register(new bg))}disableAutoRender(){this.autoRender&&(this.autoRender=!1,this.pluginService.findPluginsByName("AutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableIncrementalAutoRender(){this.increaseAutoRender||(this.increaseAutoRender=!0,this.pluginService.register(new xg))}disableIncrementalAutoRender(){this.increaseAutoRender&&(this.increaseAutoRender=!1,this.pluginService.findPluginsByName("IncrementalAutoRenderPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableDirtyBounds(){if(this.dirtyBounds)return;this.dirtyBounds=new Kt;let t=this.pluginService.findPluginsByName("DirtyBoundsPlugin")[0];t?t.activate(this.pluginService):(t=new Mg,this.pluginService.register(t))}disableDirtyBounds(){this.dirtyBounds&&(this.dirtyBounds=null,this.pluginService.findPluginsByName("DirtyBoundsPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableLayout(){if(this._enableLayout)return;this._enableLayout=!0;const t=Lg.getPlugin("FlexLayoutPlugin");t&&this.pluginService.register(new t)}disableLayout(){this._enableLayout&&(this._enableLayout=!1,this.pluginService.findPluginsByName("FlexLayoutPlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableHtmlAttribute(t){if(this.htmlAttribute)return;const e=Lg.getPlugin("HtmlAttributePlugin");e&&(this.htmlAttribute=t,this.pluginService.register(new e))}disableHtmlAttribute(){this.htmlAttribute&&(this.htmlAttribute=!1,this.pluginService.findPluginsByName("HtmlAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}enableReactAttribute(t){if(this.reactAttribute)return;const e=Lg.getPlugin("ReactAttributePlugin");e&&(this.reactAttribute=t,this.pluginService.register(new e))}disableReactAttribute(){this.reactAttribute&&(this.reactAttribute=!1,this.pluginService.findPluginsByName("ReactAttributePlugin").forEach((t=>{this.pluginService.unRegister(t)})))}getPluginsByName(t){return this.pluginService.findPluginsByName(t)}tryUpdateAABBBounds(){const t=this.window.getViewBox();return this._AABBBounds.setValue(t.x1,t.y1,t.x2,t.y2),this._AABBBounds}combineLayer(t,e){throw new Error("暂不支持")}createLayer(t,e){if("released"===this.releaseStatus)return;const i=this.layerService.createLayer(this,{main:!1,layerMode:e,canvasId:t});return this.appendChild(i),i}sortLayer(t){const e=this.children;e.sort(t),this.removeAllChild(),e.forEach((t=>{this.appendChild(t)}))}removeLayer(t){return this.removeChild(this.findChildByUid(t))}tryInitInteractiveLayer(){"released"!==this.releaseStatus&&this.supportInteractiveLayer&&!this.interactiveLayer&&(this.interactiveLayer=this.createLayer(),this.interactiveLayer.name="_builtin_interactive",this.interactiveLayer.attribute.pickable=!1,this.nextFrameRenderLayerSet.add(this.interactiveLayer))}clearViewBox(t){this.window.clearViewBox(t)}render(t,e){if("released"===this.releaseStatus)return;this.ticker.start(),this.timeline.resume();const i=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this._skipRender||(this.lastRenderparams=e,this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(this.children),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=i,this._skipRender&&this._skipRender++}combineLayersToWindow(){if("harmony"===this.global.env){const t=this.window.getContext().nativeContext;this.forEachChildren(((e,i)=>{if(i>0){const i=e.getNativeHandler().getContext().canvas.nativeCanvas.nativeCanvas._c.transferToImageBitmap();t.transferFromImageBitmap(i)}}))}}renderNextFrame(t,e){this.nextFrameRenderLayerSet.size!==this.childrenCount&&(t||this).forEach((t=>{this.nextFrameRenderLayerSet.add(t)})),this.willNextFrameRender||(this.willNextFrameRender=!0,this.global.getRequestAnimationFrame()((()=>{this._doRenderInThisFrame(),this.willNextFrameRender=!1})))}_doRenderInThisFrame(){if("released"===this.releaseStatus)return;this.timeline.resume(),this.ticker.start();const t=this.state;this.state="rendering",this.layerService.prepareStageLayer(this),this.nextFrameRenderLayerSet.size&&!this._skipRender&&(this.hooks.beforeRender.call(this),this._skipRender||(this.renderLayerList(Array.from(this.nextFrameRenderLayerSet.values()),this.lastRenderparams||{}),this.combineLayersToWindow(),this.nextFrameRenderLayerSet.clear()),this.hooks.afterRender.call(this)),this.state=t,this._skipRender&&this._skipRender++}renderLayerList(t,e){const i=[];for(let e=0;e{t.renderCount>this.renderCount||(t.renderCount=this.renderCount+1,t===this.interactiveLayer&&this.dirtyBounds&&this.dirtyBounds.clear(),t.render({renderService:this.renderService,background:t===this.defaultLayer?this.background:void 0,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))})),this.interactiveLayer&&!t.includes(this.interactiveLayer)&&(this.dirtyBounds&&this.dirtyBounds.clear(),this.interactiveLayer.render({renderService:this.renderService,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty()),viewBox:this.window.getViewBox(),transMatrix:this.window.getViewBoxTransform()},Object.assign({renderStyle:this.renderStyle},e)))}resizeWindow(t,e,i=!0){this.window.resize(t,e),i&&this.render()}resize(t,e,i=!0){"released"!==this.releaseStatus&&(this.window.hasSubView()||this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.window.resize(t,e),this.forEachChildren((i=>{i.resize(t,e)})),this.camera&&this.option3d&&this.set3dOptions(this.option3d),i&&this.render())}resizeView(t,e,i=!0){"released"!==this.releaseStatus&&(this.viewBox.setValue(this.viewBox.x1,this.viewBox.y1,this.viewBox.x1+t,this.viewBox.y1+e),this.forEachChildren((i=>{i.resizeView(t,e)})),this.camera&&(this.camera.params=Object.assign(Object.assign({},this.camera.params),{right:this.width,bottom:this.height})),i&&this.render())}setViewBox(t,e,i,s,n){let r=!0;"object"==typeof t?(this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2),!1===e&&(r=!1)):(this.viewBox.setValue(t,e,t+i,e+s),!1===n&&(r=!1)),this.forEachChildren((t=>{t.resizeView(this.viewBox.width(),this.viewBox.height())})),r&&this.render()}setDpr(t,e=!0){this.forEachChildren((e=>{e.setDpr(t)})),e&&this.render()}setOrigin(t,e){throw new Error("暂不支持")}export(t){throw new Error("暂不支持")}pick(t,e){if("released"===this.releaseStatus)return;const i=this.getPickerService().pick(this.children,new ye(t,e),{bounds:this.AABBBounds});return!(!(null==i?void 0:i.graphic)&&!(null==i?void 0:i.group))&&i}startAnimate(t){throw new Error("暂不支持")}setToFrame(t){throw new Error("暂不支持")}release(){super.release(),this.hooks.beforeRender.unTap("constructor",this.beforeRender),this.hooks.afterRender.unTap("constructor",this.afterRender),this.eventSystem&&this.eventSystem.release(),this.layerService.releaseStage(this),this.pluginService.release(),this.forEach((t=>{t.release()})),this.interactiveLayer&&(this.interactiveLayer.forEachChildren((t=>{t.setStage&&t.setStage(null,null),this.interactiveLayer.removeChild(t)})),this.interactiveLayer.release()),this.window.release(),this.ticker.remTimeline(this.timeline),this.renderService.renderTreeRoots=[]}setStage(t){}dirty(t,e){"released"!==this.releaseStatus&&(e&&t.transformWithMatrix(e),this.dirtyBounds.empty()&&this.dirtyBounds.setValue(t.x1,t.y1,t.x2,t.y2),this.dirtyBounds.union(t))}getLayer(t){return this.children.filter((e=>e.name===t))[0]}renderTo(t){"released"!==this.releaseStatus&&this.forEachChildren(((e,i)=>{e.drawTo(t,{renderService:this.renderService,viewBox:t.getViewBox(),transMatrix:t.getViewBoxTransform(),background:e===this.defaultLayer?this.background:void 0,clear:0===i,updateBounds:!(!this.dirtyBounds||this.dirtyBounds.empty())})}))}renderToNewWindow(t=!0,e){if("released"===this.releaseStatus)return;const i=Ui.get(Zi),s=e?-e.x1:0,n=e?-e.y1:0,r=e?e.x2:this.viewWidth,a=e?e.y2:this.viewHeight,o=e?e.width():this.viewWidth,l=e?e.height():this.viewHeight;return i.create({viewBox:{x1:s,y1:n,x2:r,y2:a},width:o,height:l,dpr:this.window.dpr,canvasControled:!0,offscreen:!0,title:""}),this.renderTo(i),i}toCanvas(t=!0,e){if("released"===this.releaseStatus)return;const i=this.renderToNewWindow(t,e).getNativeHandler();return i.nativeCanvas?i.nativeCanvas:null}setCursor(t){this._cursor=t,this.eventSystem.setCursor(t,"ignore")}getCursor(){return this._cursor}eventPointTransform(t){const e=this.global.mapToCanvasPoint(t,this.window.getContext().canvas.nativeCanvas);return this.stage.window.pointTransform(e.x,e.y)}pauseTriggerEvent(){this._eventSystem&&this._eventSystem.pauseTriggerEvent()}resumeTriggerEvent(){this._eventSystem&&this._eventSystem.resumeTriggerEvent()}getPickerService(){return this.pickerService||(this.pickerService=Ui.get(Ir)),this.pickerService}}class Dg{constructor(t){this.handleAfterNextRender=()=>{this._stage&&!this._viewOptions.disableDirtyBounds&&this._stage.enableDirtyBounds(),this._view.emit(lc.AFTER_VRENDER_DRAW),this._view.emit(lc.AFTER_VRENDER_NEXT_RENDER)},this._view=t}initialize(t,e,i,s){return this._width=t,this._height=e,this._viewOptions=i,this._eventConfig=s,this.initStage(),this}stage(){var t;return null!==(t=this._stage)&&void 0!==t?t:null}gestureController(){var t;return null!==(t=this._gestureController)&&void 0!==t?t:null}canvas(){return this._stage?this._stage.window.getNativeHandler().nativeCanvas:null}context(){return this._stage?this._stage.window.getContext().nativeContext:null}combineIncrementalLayers(){return this._stage&&function(t){return e=this,i=void 0,n=function*(){const e=[],i=t.getChildren();yield new Promise((t=>{xi.global.getRequestAnimationFrame()((()=>{t(null)}))})),i.forEach((t=>{t.subLayers.size&&t.subLayers.forEach((t=>{t.drawContribution&&t.drawContribution.hooks&&t.drawContribution.rendering&&e.push(new Promise((e=>{t.drawContribution.hooks.completeDraw.tap("outWait",(()=>{t.drawContribution.hooks.completeDraw.taps=t.drawContribution.hooks.completeDraw.taps.filter((t=>"outWait"!==t.name)),e(null)}))})))}))})),yield Promise.all(e)},new((s=void 0)||(s=Promise))((function(t,r){function a(t){try{l(n.next(t))}catch(t){r(t)}}function o(t){try{l(n.throw(t))}catch(t){r(t)}}function l(e){var i;e.done?t(e.value):(i=e.value,i instanceof s?i:new s((function(t){t(i)}))).then(a,o)}l((n=n.apply(e,i||[])).next())}));var e,i,s,n}(this._stage).then((()=>{this._stage&&this._stage.defaultLayer.combineSubLayer()})),this}background(t){if(this._stage)return this._stage.background=t,this}setDpr(t,e){var i,s;return null===(s=null===(i=this._stage)||void 0===i?void 0:i.setDpr)||void 0===s||s.call(i,t),e&&this.renderNextFrame(),this}shouldResize(t,e){return t!==this._width||e!==this._height}resize(t,e){return this._view.emit(lc.BEFORE_STAGE_RESIZE),this.shouldResize(t,e)&&(this._width=t,this._height=e,this._stage&&this._stage.resize(t,e)),this._view.emit(lc.AFTER_STAGE_RESIZE),this}setViewBox(t,e=!0){return this._stage?(!t||this._viewBox&&t.x1===this._viewBox.x1&&t.x2===this._viewBox.x2&&t.y1===this._viewBox.y1&&t.y2===this._viewBox.y2||(this._viewBox=t,this._stage.setViewBox(t.x1,t.y1,t.x2-t.x1,t.y2-t.y1,e)),this):this}render(t=!1){return this._view.emit(lc.BEFORE_VRENDER_DRAW),this.initStage(),this._stage.disableDirtyBounds(),this._stage.afterNextRender(this.handleAfterNextRender),t&&(this._stage.render(),this._view.emit(lc.AFTER_VRENDER_DRAW)),this}renderNextFrame(){return this.initStage(),this._stage.renderNextFrame(),this}toCanvas(){return this._stage?this._stage.toCanvas():null}preventRender(t){this._stage&&this._stage.preventRender(t)}release(){var t;this._view.traverseMarkTree((t=>{t.release()})),this._dragController&&this._dragController.release(),this._gestureController&&this._gestureController.release(),this._stage!==(null===(t=this._viewOptions)||void 0===t?void 0:t.stage)&&this._stage.release(),this._stage=null,this._layer=null,this._dragController=null,this._gestureController=null}createStage(){var t,e,i,s,n;this._view.emit(lc.BEFORE_CREATE_VRENDER_STAGE);const r=this._viewOptions,a=null!==(t=r.stage)&&void 0!==t?t:(o={width:this._width,height:this._height,renderStyle:r.renderStyle,viewBox:r.viewBox,dpr:r.dpr,canvas:r.renderCanvas,canvasControled:r.canvasControled,container:r.container,title:r.rendererTitle,beforeRender:r.beforeRender,afterRender:r.afterRender,disableDirtyBounds:!0,autoRender:!0,pluginList:r.pluginList,enableHtmlAttribute:r.enableHtmlAttribute,optimize:r.optimize,ticker:r.ticker,supportsTouchEvents:r.supportsTouchEvents,supportsPointerEvents:r.supportsPointerEvents,ReactDOM:r.ReactDOM},new Eg(o));var o;(null===(e=r.options3d)||void 0===e?void 0:e.enable)&&a.set3dOptions(r.options3d),a.enableIncrementalAutoRender(),this._viewBox=r.viewBox,this._view.emit(lc.AFTER_CREATE_VRENDER_STAGE),this._view.emit(lc.BEFORE_CREATE_VRENDER_LAYER);const l=null!==(i=r.layer)&&void 0!==i?i:a.defaultLayer;if(this._view.emit(lc.AFTER_CREATE_VRENDER_LAYER),(null===(s=this._eventConfig)||void 0===s?void 0:s.drag)&&_c.getStageEventPlugin("drag")&&(this._dragController=new(_c.getStageEventPlugin("drag"))(a)),(null===(n=this._eventConfig)||void 0===n?void 0:n.gesture)&&_c.getStageEventPlugin("gesture")){const t=vs(this._eventConfig.gesture)?this._eventConfig.gesture:{};this._gestureController=new(_c.getStageEventPlugin("gesture"))(a,t)}return{stage:a,layer:l}}initStage(){if(!this._stage){const{stage:t,layer:e}=this.createStage();this._stage=t,this._layer=e;const i=this._view.background();this.background(i)}}}function Pg(t){return D(t.offsetX)?D(t.x)?t.changedTouches&&t.changedTouches.length?function(t){const e=t.changedTouches[0];return{canvasX:e.x,canvasY:e.y}}(t):{canvasX:0,canvasY:0}:function(t){return{canvasX:t.x,canvasY:t.y}}(t):function(t){return{canvasX:t.offsetX,canvasY:t.offsetY}}(t)}function Og(t,e,i=!0){const s=["canvasX","canvasY"];return i&&(s.push("clientX"),s.push("clientY")),s.forEach((i=>{qo(e[i])&&Object.defineProperty(t,i,{value:e[i],writable:!0})})),[e.canvasX,e.canvasY]}const Rg="window",Ig="view",Bg="width",Fg="height",Yg="viewWidth",jg="viewHeight",Hg="padding",zg="viewBox",Ng="autoFit",Vg="__vgrammar_scene_item__",Wg=[Jd.line,Jd.area],Gg=[Jd.arc3d,Jd.rect3d,Jd.pyramid3d],Ug="key",$g=[{}],Xg=["key"],Kg=!0,qg=!0,Zg=!1,Jg=!0,Qg="VGRAMMAR_IMMEDIATE_ANIMATION",tm=0,em=1e3,im=0,sm=0,nm=!1,rm=!1,am="quintInOut",om={stopWhenStateChange:!1,immediatelyApply:!0},lm="VGRAMMAR_ANIMATION_PARAMETERS",hm="_mo_hide_";function dm(t,e,i,s){var n,r;s===Rg&&function(t){["touches","changedTouches","targetTouches"].forEach((e=>{t[e]&&t[e].length&&Array.from(t[e]).forEach((t=>{Og(t,Pg(t),!1)}))}));const e=Pg(t);Og(t,e)}(e.changedTouches?e.changedTouches[0]:e);let a=null===(n=e.target)||void 0===n?void 0:n[Vg];if(!a&&s===Ig){let i=e.target;const s=null===(r=t.rootMark)||void 0===r?void 0:r.graphicItem;for(;(null==i?void 0:i.parent)&&i.parent!==s;)if(i=i.parent,i[Vg]){a=i[Vg];break}}return e.element=a,e}class cm extends Jp{constructor(){super(...arguments),this.grammarType="signal",this.spec={value:null,update:null}}parse(t){return super.parse(t),this.value(t.value),this.update(t.update),this.commit(),this}evaluate(t,e){return this._signal=this.spec.update?Gp(this.spec.update,e,this._signal):this.spec.value,this.spec.value=this._signal,this}output(){return this._signal}getValue(){return this.output()}set(t){if(y(t)&&y(this.value)&&t.length===this.value.length){for(let e=0;e{var e,i,s,n;return h(t)?{top:t,bottom:t,left:t,right:t}:{top:null!==(e=null==t?void 0:t.top)&&void 0!==e?e:0,bottom:null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0,left:null!==(s=null==t?void 0:t.left)&&void 0!==s?s:0,right:null!==(n=null==t?void 0:t.right)&&void 0!==n?n:0}};function mm(t,e){switch(e){case"line":return t.some((t=>["x","y","defined"].includes(t)));case"area":return t.some((t=>["x","y","x1","y1","defined"].includes(t)));case"largeRects":return t.some((t=>["x","y","width","y1"].includes(t)));case"largeSymbols":return t.some((t=>["x","y"].includes(t)))}return!1}const _m=["fillOpacity"],fm=(t,e,i)=>{var s;return"fillOpacity"===e?(t.fillOpacity=null!==(s=i.fillOpacity)&&void 0!==s?s:1,["fillOpacity"]):[]},vm={rect3d:[{channels:["x","y","z","x1","y1","width","height","length"],transform:(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;qo(e.width)||!qo(e.x1)&&qo(i.width)?(t.x=Math.min(null!==(s=i.x)&&void 0!==s?s:0,null!==(n=i.x1)&&void 0!==n?n:1/0),t.width=i.width):qo(e.x1)||!qo(e.width)&&qo(i.x1)?(t.x=Math.min(i.x,i.x1),t.width=Math.abs(i.x1-i.x)):(t.x=Math.min(null!==(r=i.x)&&void 0!==r?r:0,null!==(a=i.x1)&&void 0!==a?a:1/0),t.width=i.width),qo(e.height)||!qo(e.y1)&&qo(i.height)?(t.y=Math.min(null!==(o=i.y)&&void 0!==o?o:0,null!==(l=i.y1)&&void 0!==l?l:1/0),t.height=i.height):qo(e.y1)||!qo(e.height)&&qo(i.y1)?(t.y=Math.min(i.y,i.y1),t.height=Math.abs(i.y1-i.y)):(t.y=Math.min(null!==(h=i.y)&&void 0!==h?h:0,null!==(d=i.y1)&&void 0!==d?d:1/0),t.height=i.height),qo(e.length)||!qo(e.z1)&&qo(i.length)?(t.z=Math.min(null!==(c=i.z)&&void 0!==c?c:0,null!==(u=i.z1)&&void 0!==u?u:1/0),t.length=i.length):qo(e.z1)||!qo(e.length)&&qo(i.z1)?(t.z=Math.min(i.z,i.z1),t.length=Math.abs(i.z1-i.z)):(t.z=Math.min(null!==(p=i.z)&&void 0!==p?p:0,null!==(g=i.z1)&&void 0!==g?g:1/0),t.length=i.length)},storedAttrs:"sizeAttrs"}],[Jd.text]:[{channels:["text","limit","autoLimit","maxLineWidth","textType"],transform:(t,e,i)=>{var s,n;const r=null!==(s=i.limit)&&void 0!==s?s:1/0,a=null!==(n=i.autoLimit)&&void 0!==n?n:1/0,o=Math.min(r,a),l=w(i.text)&&!D(i.text.text),h=l?i.text.text:i.text;Array.isArray(h),t.maxLineWidth=o===1/0?i.maxLineWidth:o,!l&&!i.textType||"rich"!==i.text.type&&"rich"!==i.textType?t.text=h:t.textConfig=h},storedAttrs:"limitAttrs"}],[Jd.rule]:[{channels:["x","y","x1","y1"],transform:(t,e,i)=>{const s=function(t){const{x:e,y:i,x1:s,y1:n}=t;return qo(e)&&qo(i)&&qo(s)&&qo(n)?[{x:e,y:i},{x:s,y:n}]:[]}(i);t.points=s,t.x=0,t.y=0},storedAttrs:"pointAttrs"}],[Jd.symbol]:[{channels:["shape","symbolType"],transform:(t,e,i)=>{var s;t.symbolType=null!==(s=e.shape)&&void 0!==s?s:e.symbolType}},{channels:["image","fill","background"],transform:(t,e,i)=>{e.image?(t.background=e.image,t.fill=!1):i.image?(t.background=i.image,t.fill=!1):(t.fill=i.fill,t.background=i.background)},storedAttrs:"imageAttrs"}]},ym=(t,e,i,s)=>{const n={},r=e?Object.keys(e):[],a=S(t)?vm[t]:t;if(a&&a.length){const t=[];r.forEach((r=>{let o=!1;a.forEach(((a,l)=>{if(a.channels.includes(r)){if(!t[l])if(a.storedAttrs){const t=function(t,e,i,s,n,r){const a=n.getGraphicAttribute(t,!1,r);if(a)return e.forEach((t=>{t in s&&(a[t]=s[t])})),a;const o={};return e.forEach((t=>{o[t]=s[t]})),i[t]=o,o}(a.storedAttrs,a.channels,n,e,i,s);a.transform(n,e,t)}else a.transform(n,e,null);t[l]=!0,o=!0}})),o||(_m.includes(r)?fm(n,r,e):n[r]=e[r])}))}else r.forEach((t=>{_m.includes(t)?fm(n,t,e):n[t]=e[t]}));return n};function bm(t,e,i={}){var s;const n=_c.getGraphicType(e)?_c.createGraphic(e,i):_c.createGraphicComponent(e,i,{skipDefault:null===(s=null==t?void 0:t.spec)||void 0===s?void 0:s.skipTheme});return n||g.getInstance().error(`create ${e} graphic failed!`),n}const xm=t=>{t&&(t[Vg]=null,t.release(),t.parent&&t.parent.removeChild(t))};function Sm(t,e,i){const s=new Map;if(!t||0===t.length)return{keys:[],data:s};if(!e)return s.set(Ug,i?t.slice().sort(i):t.slice()),{keys:Xg,data:s};const n=Xp(e);if(1===t.length){const e=n(t[0]);return s.set(e,[t[0]]),{keys:[e],data:s}}const r=new Set;return t.forEach((t=>{var e;const i=n(t),a=null!==(e=s.get(i))&&void 0!==e?e:[];a.push(t),s.set(i,a),r.add(i)})),i&&r.forEach((t=>{s.get(t).sort(i)})),{keys:Array.from(r),data:s}}class Mm{constructor(t,e,i){this.prevData=(null==t?void 0:t.length)?Sm(t,null!=e?e:null,i):null}setCurrentData(t){this.currentData=t}getCurrentData(){return this.currentData}doDiff(){if(this.callback)if(this.currentData&&this.prevData){const t=new Map(this.prevData.data);this.currentData.keys.forEach((e=>{this.callback(e,this.currentData.data.get(e),t.get(e)),t.delete(e)})),this.prevData.keys.forEach((e=>{t.has(e)&&this.callback(e,null,t.get(e))}))}else this.currentData?this.currentData.keys.forEach((t=>{this.callback(t,this.currentData.data.get(t),null)})):this.prevData&&this.prevData.keys.forEach((t=>{this.callback(t,null,this.prevData.data.get(t))}))}setCallback(t){this.callback=t}updateToCurrent(){this.prevData=this.currentData,this.currentData=null}reset(){this.prevData=null}}function km(t){return!!(null==t?void 0:t.scale)}function Am(t){return!!(null==t?void 0:t.field)}function wm(t,e){if(!t)return[];let i=[];return t.scale&&(i=$p(t.scale)?[t.scale]:Ba(e.getScaleById(t.scale))),i.concat(Vp(t,e))}const Tm=t=>e=>Ud(e,t),Lm=t=>{g.getInstance().error(t)},Cm=(t,e,i={})=>{if(ys(t))return t;const s=(t=>{const e=[],i=t.length;let s,n,r,a=null,o=0,l="";t+="";const h=()=>{e.push(l+t.substring(s,n)),l="",s=n+1};for(s=0,n=0;ns&&h(),s=n+1,o=s):"]"===r&&(o||Lm("Access path missing open bracket: "+t),o>0&&h(),o=0,s=n+1):n>s?h():s=n+1}return o&&Lm("Access path missing closing bracket: "+t),a&&Lm("Access path missing closing quote: "+t),n>s&&(n+=1,h()),e})(t),n=1===s.length?s[0]:t;return((t,e,i)=>(t.fields=e||[],t.fname=i,t))((i&&i.get||Tm)(s),[n],e||n)},Em=(t,e,i={})=>{if(y(t)){const s=t.map((t=>Cm(t,e,i)));return t=>s.map((e=>e(t)))}return Cm(t,e,i)};function Dm(t,e,i,s,n){i&&(Wp(i)?e.forEach((e=>{const n=Gp(i,s,e.datum,t);Object.assign(e.nextAttrs,n)})):Object.keys(i).forEach((r=>{var a,o;const l=i[r],d=n&&!function(t,e){if(["x","y","dx","dy"].includes(e))return!0;switch(t){case Jd.arc:return["innerRadius","outerRadius","startAngle","endAngle"].includes(e);case Jd.group:case Jd.rect:case Jd.image:return["width","height","y1"].includes(e);case Jd.path:case Jd.shape:return["path","customPath"].includes(e);case Jd.line:return"defined"===e;case Jd.area:return["x1","y1","defined"].includes(e);case Jd.rule:return["x1","y1"].includes(e);case Jd.symbol:return"size"===e;case Jd.polygon:return"points"===e;case Jd.text:return"text"===e}return!1}(t.mark.markType,r)?[e[0]]:e;if(km(l)){const t=Up(l.scale,s),e=null!==(a=null==l?void 0:l.offset)&&void 0!==a?a:0,i=!D(l.band)&&t.bandwidth?t.bandwidth()*l.band:null,n=S(null==l?void 0:l.field),c=n?Em(l.field):null;let u=n?null:D(null==l?void 0:l.value)?0:null===(o=t.scale)||void 0===o?void 0:o.call(t,l.value);d.forEach((s=>{var a;n&&(u=null===(a=t.scale)||void 0===a?void 0:a.call(t,c(s.datum))),s.nextAttrs[r]=h(u)||h(i)?u+e+i:u}))}else if(Am(l)){const t=Em(l.field);d.forEach((e=>{e.nextAttrs[r]=t(e.datum)}))}else d.forEach((e=>{e.nextAttrs[r]=Gp(l,s,e.datum,t)}))})))}function Pm(t,e,i,s){if(!t)return null;if(Wp(t))return Gp(t,s,e,i);const n={};return Object.keys(t).forEach((r=>{var a,o,l;const d=t[r];if(km(d)){const t=Up(d.scale,s),i=null!==(a=null==d?void 0:d.offset)&&void 0!==a?a:0,c=!D(d.band)&&t.bandwidth?t.bandwidth()*d.band:null,u=S(null==d?void 0:d.field),p=u?Em(d.field):null,g=u?null===(o=t.scale)||void 0===o?void 0:o.call(t,p(e)):D(null==d?void 0:d.value)?0:null===(l=t.scale)||void 0===l?void 0:l.call(t,d.value);n[r]=h(g)||h(c)?g+i+c:g}else if(Am(d)){const t=Em(d.field);n[r]=t(e)}else n[r]=Gp(d,s,e,i)})),n}function Om(t){return Object.prototype.toString.call(t)}function Rm(t){return Object.keys(t)}function Im(t,e,i){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(null==t||null==e)return!1;if(Number.isNaN(t)&&Number.isNaN(e))return!0;if(Om(t)!==Om(e))return!1;if(ys(t))return!!(null==i?void 0:i.skipFunction);if("object"!=typeof t)return!1;if(y(t)){if(t.length!==e.length)return!1;for(let s=t.length-1;s>=0;s--)if(!Im(t[s],e[s],i))return!1;return!0}if(!w(t))return!1;const s=Rm(t),n=Rm(e);if(s.length!==n.length)return!1;s.sort(),n.sort();for(let t=s.length-1;t>=0;t--)if(s[t]!=n[t])return!1;for(let n=s.length-1;n>=0;n--){const r=s[n];if(!Im(t[r],e[r],i))return!1}return!0}const Bm=Object.prototype,Fm=Object.prototype.hasOwnProperty,Ym=function(t){if(D(t))return!0;if(A(t))return!t.length;const e=(t=>({}.toString.call(t).replace(/^\[object /,"").replace(/]$/,"")))(t);if("Map"===e||"Set"===e)return!t.size;if(function(t){const e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||Bm)}(t))return!Object.keys(t).length;for(const e in t)if(Fm.call(t,e))return!1;return!0},jm=["stroke","strokeOpacity","lineDash","lineDashOffset","lineCap","lineJoin","lineWidth","miterLimit"],Hm=["fill","fillOpacity","background","texture","texturePadding","textureSize","textureColor"].concat(jm);function zm(t,e,i){var s;if(!t||t.length<=1)return null;const n="area"===(null===(s=null==i?void 0:i.mark)||void 0===s?void 0:s.markType)?Hm:jm,r=[];let a=null;return t.forEach(((t,e)=>{a&&n.every((e=>((t,e,i)=>!(!D(t)||!D(e))||!D(t)&&!D(e)&&("lineDash"===i?((t,e)=>t.length===e.length&&t.join("-")===e.join("-"))(t,e):"stroke"===i||"fill"===i?((t,e)=>{if(t===e)return!0;if(typeof t!=typeof e)return!1;if(S(t))return!1;if(t.gradient!==e.gradient)return!1;const i=Object.keys(t),s=Object.keys(e);return i.length===s.length&&i.every((i=>"stops"===i?((t,e)=>{var i,s;if(t===e)return!0;const n=null!==(i=t&&t.length)&&void 0!==i?i:0;return n===(null!==(s=e&&e.length)&&void 0!==s?s:0)&&0!==n&&t.every(((t,i)=>!t&&!e[i]||t&&e[i]&&t.color===e[i].color&&t.offset===e[i].offset))})(t[i],e[i]):t[i]===e[i]))})(t,e):t===e))(a[e],t[e],e)))||(r.length&&(r[r.length-1].endIndex=e),a=t,r.push({attrs:a,startIndex:e}))})),r.length>=2?r.map((t=>{const i=Nm(t.attrs);return i.points=e.slice(t.startIndex,D(t.endIndex)?e.length:t.endIndex),i})):null}function Nm(t){const e={};if(!t)return e;const i=["x","y","x1","y1","defined","size","width","height","context"];return Object.keys(t).forEach((s=>{i.includes(s)||(e[s]=t[s])})),e}class Vm{constructor(t){this.data=null,this.states=[],this.diffState=Zd.enter,this.isReserved=!1,this.runtimeStatesEncoder=null,this.items=[],this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!D(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t];if(!o)return{};if(ys(o))return o(this.getDatum(),this,t,e);if(!a&&(null===(r=this.graphicItem.states)||void 0===r?void 0:r[t]))return this.graphicItem.states[t];const l=this.items.map((t=>Object.assign({},t,{nextAttrs:{}})));Dm(this,l,o,this.mark.parameters());const h=this.transformElementItems(l,this.mark.markType);return this.graphicItem.states?this.graphicItem.states[t]||(this.graphicItem.states[t]=h):this.graphicItem.states={[t]:h},h},this.mark=t}initGraphicItem(t={}){if(this.graphicItem)return;const e=this.mark.getAttributeTransforms();this.graphicItem=this.mark.addGraphicItem(e?ym(e,t,this):t,this.groupKey),this.graphicItem&&(this.graphicItem[Vg]=this,e&&(this.graphicItem.onBeforeAttributeUpdate=t=>this.mark?ym(e,t,this):t),this.clearGraphicAttributes(),this.mark.needAnimate()&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(Object.assign({},t)),this.setFinalGraphicAttributes(Object.assign({},t))))}updateGraphicItem(){var t;if(!this.graphicItem)return;this.diffState===Zd.exit?this.graphicItem.releaseStatus="willRelease":this.graphicItem.releaseStatus=void 0;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");e&&0!==e.length&&(this.graphicItem.stateAnimateConfig=e[0].originConfig)}getGraphicItem(){return this.graphicItem}removeGraphicItem(){var t,e;this.graphicItem&&(null===(e=null===(t=this.graphicItem.animates)||void 0===t?void 0:t.forEach)||void 0===e||e.call(t,(t=>t.stop()))),this.graphicItem&&(xm(this.graphicItem),this.graphicItem[Vg]=null,this.graphicItem=null)}resetGraphicItem(){this.graphicItem&&(this.graphicItem=null)}getBounds(){var t;return null===(t=this.graphicItem)||void 0===t?void 0:t.AABBBounds}getStates(){return this.states}updateData(t,e,i){var s;this.mark.emit(lc.BEFORE_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.data=e;const n=Xp(i);return this.items=e.map((t=>({datum:t,key:n(t),view:this.mark.view,nextAttrs:{}}))),this.groupKey=t,this.key=this.mark.isCollectionMark()?t:null===(s=this.items)||void 0===s?void 0:s[0].key,this.mark.emit(lc.AFTER_ELEMENT_UPDATE_DATA,{groupKey:t,data:e,key:i},this),this.items}state(t,e){var i;const s=this.mark.isCollectionMark(),n=this.states,r=Ba(Gp(t,e,this.getDatum(),this)),a=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;a&&r.length&&r.sort(a);const o=r.length!==n.length||r.some(((t,e)=>t!==n[e]));this.states=r,!s&&o&&this.diffState===Zd.unChange&&(this.diffState=Zd.update)}encodeGraphic(t){this.coordinateTransformEncode(this.items);const e=this.transformElementItems(this.items,this.mark.markType);t&&Object.assign(e,t),this.graphicItem?(this.graphicItem.clearStates(),this.graphicItem.states={},this.graphicItem.stateProxy=null,hm in this.graphicItem.attribute&&"visible"in e&&delete this.graphicItem.attribute[hm],this.applyGraphicAttributes(e)):this.initGraphicItem(e),this.diffState!==Zd.enter&&this.diffState!==Zd.update||!this.states.length||this.useStates(this.states),this.mark.markType===Jd.shape&&(this.graphicItem.datum=this.items[0].datum),this.items.forEach((t=>{t.nextAttrs={}})),this._setCustomizedShape()}_setCustomizedShape(){var t;if(!this.graphicItem)return;const e=null===(t=this.mark.getSpec())||void 0===t?void 0:t.setCustomizedShape;e&&(this.graphicItem.pathProxy=t=>e(this.data,t,new qe))}encodeItems(t,e,i=!1,s){const n=this.mark.isCollectionMark(),r=e[qd.update],a=e[qd.enter],o=e[qd.exit],l=this.mark.isLargeMode()||n&&!this.mark.getSpec().enableSegments;this.diffState===Zd.enter?(a&&Dm(this,t,a,s,l),r&&Dm(this,t,r,s,l)):this.diffState===Zd.update?((n&&a||i)&&Dm(this,t,a,s,l),r&&Dm(this,t,r,s,l)):this.diffState===Zd.exit&&o&&(i&&Dm(this,t,a,s,l),Dm(this,t,o,s,l))}coordinateTransformEncode(t){if(!this.mark.coord||"arc"===this.mark.markType||!0===this.mark.disableCoordinateTransform)return;const e=this.mark.coord.output();t.forEach((t=>{const i=t.nextAttrs,s=e.convert(i);Object.assign(i,s)}))}hasStateAnimation(){var t;const e=null===(t=this.mark.animate)||void 0===t?void 0:t.getAnimationConfigs("state");return e&&e.length>0}clearStates(t){const e=v(t)?t:this.hasStateAnimation();this.states=[],this.graphicItem&&this.graphicItem.clearStates(e),this.runtimeStatesEncoder&&(this.runtimeStatesEncoder={})}_updateRuntimeStates(t,e){this.runtimeStatesEncoder||(this.runtimeStatesEncoder={}),this.runtimeStatesEncoder[t]=e}hasState(t){return this.states&&t&&this.states.includes(t)}updateStates(t){if(!this.graphicItem)return!1;let e=this.states.slice();const i=this.mark.getSpec().encode;let s=!1,n=!1;return Object.keys(t).forEach((r=>{var a;if(!r)return;const o=t[r];if(vs(o)&&!Im(o,null===(a=this.runtimeStatesEncoder)||void 0===a?void 0:a[r]))e.includes(r)?s=!0:e.push(r),this._updateRuntimeStates(r,o),n=!0;else if(o)!e.includes(r)&&(null==i?void 0:i[r])&&(e.push(r),n=!0);else if(e.length){const t=e.filter((t=>t!==r));t.length!==e.length&&(n=!0,e=t),this.runtimeStatesEncoder&&this.runtimeStatesEncoder[r]&&(this.runtimeStatesEncoder[r]=null)}})),s&&this.graphicItem.clearStates(),!!n&&(this.useStates(e),!0)}addState(t,e){var i;if(!this.graphicItem)return!1;if(e&&S(t)&&!Im(e,null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t])){const i=this.states.slice();return i.includes(t)?this.graphicItem.clearStates():i.push(t),this._updateRuntimeStates(t,e),this.useStates(i),!0}const s=this.mark.getSpec().encode,n=Ba(t).reduce(((t,e)=>(e&&!t.includes(e)&&(null==s?void 0:s[e])&&t.push(e),t)),this.states.slice());return n.length!==this.states.length&&(this.useStates(n),!0)}removeState(t){if(!this.graphicItem)return!1;const e=Ba(t);if(!e.length)return!1;const i=this.states.filter((t=>!e.includes(t)));return i.length!==this.states.length&&(this.runtimeStatesEncoder&&e.forEach((t=>{this.runtimeStatesEncoder[t]=null})),this.useStates(i),!0)}useStates(t,e){var i;if(!this.graphicItem)return!1;this.mark.emit(lc.BEFORE_ELEMENT_STATE,{states:t},this);const s=null===(i=this.mark.getSpec())||void 0===i?void 0:i.stateSort;s&&t.sort(s),this.states=t;const n=v(e)?e:this.hasStateAnimation();return this.graphicItem.stateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,n),this.mark.emit(lc.AFTER_ELEMENT_STATE,{states:t},this),!0}diffAttributes(t){const e={},i=this.getFinalGraphicAttributes();for(const s in t)ms(i,s)&&Im(i[s],t[s])||(e[s]=t[s]);return e}transformElementItems(t,e,i){var s,n,r,a,o;const l=t[0];if(!l.nextAttrs||0===Object.keys(l.nextAttrs).length)return{};let h=l.nextAttrs;if(function(t){return[Jd.line,Jd.area,Jd.largeRects,Jd.largeSymbols].includes(t)}(e)&&t&&t.length&&D(null===(s=l.nextAttrs)||void 0===s?void 0:s.points)&&(!0===i||mm(Object.keys(l.nextAttrs),this.mark.markType))){const i=this.mark.getSpec(),s=this.getGraphicAttribute("points",!1),l=this.getGraphicAttribute("segments",!1),d=i.enableSegments,c=null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[qd.connectNulls],u=t.map((t=>t.nextAttrs)),p=this.mark.isProgressive();if(h=Nm(h),e===Jd.line||e===Jd.area){const i=function(t,e,i,s){return t&&t.length&&(t.length,1)?t.some((t=>mm(Object.keys(t.nextAttrs),"line")))?t.map(((t,e)=>{var n;const r=t.nextAttrs,{x:a,y:o,x1:l,y1:h,defined:d}=null!==(n=null==i?void 0:i[e])&&void 0!==n?n:{};return D(r.x)&&(r.x=a),D(r.y)&&(r.y=o),D(r.defined)&&!1===d&&(r.defined=!1),r.context=t.key,s&&(D(r.x1)&&(r.x1=l),D(r.y1)&&(r.y1=h)),r})):null!=i?i:[]:[]}(t,0,s,e===Jd.area);if(p)h.segments=(null!==(o=null===(a=null===(r=this.graphicItem)||void 0===r?void 0:r.attribute)||void 0===a?void 0:a.segments)&&void 0!==o?o:[]).concat([{points:i}]);else if(c){if(h.segments=function(t,e,i){if(!t||t.length<=1)return null;const s=!!i&&i.mark.getSpec().enableSegments;let n,r,a=[],o=null;if(t.forEach(((t,i)=>{o=e[i],o&&!1!==o.defined?(n||(r={items:[],points:[]},a.push(r)),r.points.push(o),r.items.push(t),!1===n&&(r.isConnect=!0,r={items:[],points:[]},a.push(r)),n=!0):n=!1})),a=a.filter((t=>t.points.length>0)),a.length>=2){const t=[];return a.forEach((e=>{if(e.isConnect)return void t.push({points:e.points,isConnect:!0});if(s){const s=zm(e.items,e.points,i);if(s)return void s.forEach((e=>{t.push(e)}))}const n=Nm(e.items[0]);n.points=e.points,t.push(n)})),t}return s?zm(t,e,i):null}(u,i,this),h.segments&&h.segments.some((t=>t.isConnect))){const t=Pm(c,this.getDatum(),this,this.mark.parameters());t&&h.segments.forEach((e=>{e.isConnect&&Object.assign(e,t)}))}h.points=i}else if(d){const t=i&&0!==i.length?i:function(t){return t?t.reduce(((t,e)=>t.concat(e.points)),[]):null}(l),e=zm(u,t,this);e?(h.segments=e,h.points=null):(h.segments=null,h.points=t),h=function(t,e){var i;if(!t||!t.segments||!t.segments.length)return t;const s="area"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.markType)?["fillOpacity","strokeOpacity"]:["strokeOpacity"],n={};return Object.keys(t).forEach((e=>{s.includes(e)||(n[e]=t[e])})),n}(h,this)}else h.points=i,h.segments=null}else e===Jd.largeRects?h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(4*t.length);return t.forEach(((t,e)=>{var n,r,a,o;const l=t.nextAttrs,h=null!==(n=l.x)&&void 0!==n?n:i[4*e],d=null!==(r=l.y)&&void 0!==r?r:i[4*e+1],c=null!==(a=l.width)&&void 0!==a?a:i[4*e+2],u=null!==(o=l.y1)&&void 0!==o?o:i[4*e+3];s[4*e]=h,s[4*e+1]=d,s[4*e+2]=c,s[4*e+3]=u-d})),s}(t,!0,s):e===Jd.largeSymbols&&(h.points=function(t,e,i=[]){if(!t||!t.length||1===t.length&&!e)return[];const s=new Float32Array(2*t.length);return t.forEach(((t,e)=>{var n,r;const a=t.nextAttrs,o=null!==(n=a.x)&&void 0!==n?n:i[2*e],l=null!==(r=a.y)&&void 0!==r?r:i[2*e+1];s[2*e]=o,s[2*e+1]=l})),s}(t,!0,s))}return h}applyGraphicAttributes(t){var e,i,s;if(!Ym(t))if(this.mark.needAnimate()){const n=this.diffAttributes(t),r=null!==(e=this.getPrevGraphicAttributes())&&void 0!==e?e:{},a=null!==(i=this.getFinalGraphicAttributes())&&void 0!==i?i:{};Object.keys(n).forEach((t=>{r[t]=this.getGraphicAttribute(t),a[t]=n[t]})),this.setNextGraphicAttributes(n),this.setPrevGraphicAttributes(r),this.setFinalGraphicAttributes(a);const o=((null===(s=this.mark.animate)||void 0===s?void 0:s.getElementAnimators(this))||[]).reduce(((t,e)=>Object.assign(t,e.getEndAttributes())),{}),l=Object.assign({},o,a);this.graphicItem.setAttributes(l)}else this.graphicItem.setAttributes(t)}getGraphicAttribute(t,e=!1){var i;if(!this.graphicItem)return;if(e){let e;const i=this.getPrevGraphicAttributes();if(!D(e=Ud(i,t)))return e}const s=this.mark.getAttributeTransforms();let n=[t];if(s&&s.length){const e=s.find((e=>e.storedAttrs&&e.channels.includes(t)));e&&(n=[e.storedAttrs,t])}return Ud(null===(i=this.graphicItem)||void 0===i?void 0:i.attribute,n)}setGraphicAttribute(t,e,i=!0){if(!this.graphicItem)return;const s=this.getFinalGraphicAttributes(),n=this.getPrevGraphicAttributes();i&&s&&(s[t]=e),n&&!ms(n,t)&&(n[t]=this.graphicItem.attribute[t]),this.graphicItem.setAttribute(t,e)}setGraphicAttributes(t,e=!0){if(!this.graphicItem)return;const i=this.getFinalGraphicAttributes(),s=this.getPrevGraphicAttributes();Object.keys(t).forEach((n=>{i&&e&&(i[n]=t[n]),s&&!ms(s,n)&&(s[n]=this.graphicItem.attribute[n])})),this.graphicItem.setAttributes(t)}getFinalGraphicAttributes(){return this.graphicItem.finalAttrs}setFinalGraphicAttributes(t){this.graphicItem.finalAttrs=t}getPrevGraphicAttributes(){return this.graphicItem.prevAttrs}setPrevGraphicAttributes(t){this.graphicItem.prevAttrs=t}getNextGraphicAttributes(){return this.graphicItem.nextAttrs}getFinalAnimationAttribute(t){var e,i;return null!==(i=null===(e=this.getFinalGraphicAttributes())||void 0===e?void 0:e[t])&&void 0!==i?i:this.getGraphicAttribute(t)}getFinalAnimationAttributes(){var t;return null!==(t=this.getFinalGraphicAttributes())&&void 0!==t?t:this.graphicItem.attribute}setNextGraphicAttributes(t){this.graphicItem.nextAttrs=t}clearChangedGraphicAttributes(){this.graphicItem&&(this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null))}clearGraphicAttributes(){this.graphicItem&&(this.graphicItem.prevAttrs&&this.setPrevGraphicAttributes(null),this.graphicItem.nextAttrs&&this.setNextGraphicAttributes(null),this.graphicItem.finalAttrs&&this.setFinalGraphicAttributes(null))}remove(){this.graphicItem&&(xm(this.graphicItem),this.graphicItem=null)}release(){this.removeGraphicItem(),this.mark=null,this.data=null,this.items=null}getItemAttribute(t){var e,i;if(null===(e=this.items)||void 0===e?void 0:e.length)return this.mark.isCollectionMark()?D(t)?this.items.map((t=>t.nextAttrs)):this.items.map((e=>{var i;return null===(i=e.nextAttrs)||void 0===i?void 0:i[t]})):D(t)?this.items[0].nextAttrs:null===(i=this.items[0].nextAttrs)||void 0===i?void 0:i[t]}setItemAttributes(t){var e;(null===(e=this.items)||void 0===e?void 0:e.length)&&(this.mark.isCollectionMark()?y(t)&&this.items.forEach(((e,i)=>{Object.assign(e.nextAttrs,t[i])})):Object.assign(this.items[0].nextAttrs,t))}getItem(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.items)&&void 0!==t?t:[]:null===(e=this.items)||void 0===e?void 0:e[0]}getDatum(){var t,e;return this.mark&&this.mark.isCollectionMark()?null!==(t=this.data)&&void 0!==t?t:[]:null===(e=this.data)||void 0===e?void 0:e[0]}}class Wm extends Jp{constructor(t,e,i){super(t),this.grammarType="mark",this.elements=[],this.elementMap=new Map,this.isUpdated=!0,this._isReentered=!1,this.differ=new Mm([]),this.markType=e,this.spec.type=e,this.spec.encode={update:{}},this.spec.group=i,i&&(this.group=i,this.attach(i),i.appendChild(this))}parse(t){var e,i,s;if(super.parse(t),this.spec.group){const t=S(this.spec.group)?this.view.getMarkById(this.spec.group):this.spec.group;this.detach(t)}const n=S(t.group)?this.view.getMarkById(t.group):t.group;return this.attach(n),this.join(null===(e=t.from)||void 0===e?void 0:e.data,t.key,t.sort,t.groupBy,t.groupSort),this.coordinate(t.coordinate),this.state(t.state,this.spec.stateSort),Object.keys(null!==(i=this.spec.encode)&&void 0!==i?i:{}).forEach((t=>{this.encodeState(t,{},!0)})),Object.keys(null!==(s=t.encode)&&void 0!==s?s:{}).forEach((e=>{this.encodeState(e,t.encode[e])})),this.animation(t.animation),this.animationState(t.animationState),this.morph(t.morph,t.morphKey,t.morphElementKey),this.layout(t.layout),this.configure(t),this.transform(t.transform),this.parseAddition(t),this.spec=t,this.markType=t.type,this.commit(),this}parameters(){var t;return null!==(t=this._finalParameters)&&void 0!==t?t:super.parameters()}parseAddition(t){return this}reuse(t){var e;if(t.grammarType!==this.grammarType)return this;const i=t;return this.markType=i.markType,this.coord=i.coord,this.elementMap=i.elementMap,this.elements=i.elements,this.elementMap.forEach((t=>t.mark=this)),this.differ=i.differ,null===(e=this.reuseAnimate)||void 0===e||e.call(this,i),this._context=i._context,this.graphicItem=i.graphicItem,this.graphicIndex=i.graphicIndex,this.graphicParent=i.graphicParent,this.needClear=i.needClear,this.isUpdated=i.isUpdated,this}needLayout(){return!D(this.spec.layout)}handleLayoutEnd(){}handleRenderEnd(){this.needClear&&(this.cleanExitElements(),this.elementMap.forEach((t=>{t.diffState===Zd.exit?t.clearGraphicAttributes():t.clearChangedGraphicAttributes()})),this.differ.updateToCurrent(),this.needClear=!1)}evaluateMainTasks(t,e){var i;if(this.needSkipBeforeLayout()&&this.view.getLayoutState()===oc.before)return this;const s=null===(i=this.view.renderer)||void 0===i?void 0:i.stage();this.init(s,e);const n=this.evaluateTransform(this._getTransformsBeforeJoin(),null!=t?t:$g,e);let r=(null==n?void 0:n.progressive)?t:n;return this.evaluateGroup(r),this.renderContext=this.parseRenderContext(r,e),this.renderContext.progressive?(this.differ.reset(),this.elementMap.clear(),this.evaluateProgressive()):((null==n?void 0:n.progressive)&&(this.renderContext.parameters=e,this.renderContext.beforeTransformProgressive=n.progressive,r=n.progressive.output()),this.emit(lc.BEFORE_MARK_JOIN),this.evaluateJoin(r),this.emit(lc.AFTER_MARK_JOIN),this.emit(lc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,e),this.emit(lc.AFTER_MARK_STATE),this.emit(lc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),e),this.emit(lc.AFTER_MARK_ENCODE)),this.emit(lc.BEFORE_MARK_UPDATE),this.update(this.spec),this.emit(lc.AFTER_MARK_UPDATE),this}evaluateGroup(t){if(this.markType===Jd.group)return;const e=Sm(null!=t?t:$g,this.spec.groupBy,this.spec.groupSort),i=e.keys;this._groupKeys=i,this._groupEncodeResult=null,this.differ.setCurrentData(e)}_getTransformsAfterEncodeItems(){return this.transforms&&this.transforms.filter((t=>"afterEncodeItems"===t.markPhase))}_getTransformsAfterEncode(){return this.transforms&&this.transforms.filter((t=>D(t.markPhase)||"afterEncode"===t.markPhase))}_getTransformsBeforeJoin(){return this.transforms?this.transforms.filter((t=>"beforeJoin"===t.markPhase)):[]}evaluate(t,e){var i;return this.evaluateMainTasks(t,e),(null===(i=this.renderContext)||void 0===i?void 0:i.progressive)||this.evaluateTransform(this._getTransformsAfterEncode(),this.elements,e),this}output(){return this}join(t,e,i,s,n){return this.grammarSource&&(this.detach(this.grammarSource),this.grammarSource=null),this.spec.from=null,D(t)||(S(t)?this.grammarSource=this.view.getDataById(t):this.grammarSource=t,this.spec.from={data:t},this.attach(this.grammarSource)),this.spec.key=e,this.spec.sort=i,this.spec.groupBy=s,this.spec.groupSort=n,this.commit(),this}coordinate(t){return S(t)?this.coord=this.view.getCoordinateById(t):this.coord=t,this.attach(this.coord),this.commit(),this}state(t,e){return this.spec.stateSort=e,this.setFunctionSpec(t,"state")}encode(t,e,i){return this.encodeState(Zd.update,t,e,i)}encodeState(t,e,i,s){if(t===Zd.enter&&(this._isReentered=!0),this.spec.encode[t]){const n=this.spec.encode[t];if(Wp(n))this.detach(wm(n,this.view));else{const r=S(e);r&&s||!r&&i?(Object.keys(n).forEach((t=>{this.detach(wm(n[t],this.view))})),this.spec.encode[t]={}):r?this.detach(wm(n[e],this.view)):Object.keys(e).forEach((t=>{this.detach(wm(n[t],this.view))}))}}return e&&(this.spec.encode[t]||(this.spec.encode[t]={}),S(e)?(this.spec.encode[t][e]=i,this.attach(wm(i,this.view))):Wp(e)?(this.spec.encode[t]=e,this.attach(wm(e,this.view))):e&&(Object.assign(this.spec.encode[t],e),Object.values(e).forEach((t=>{this.attach(wm(t,this.view))})))),this.commit(),this}_getEncoders(){var t;return null!==(t=this.spec.encode)&&void 0!==t?t:{}}animation(t){return this.spec.animation=t,this}animationState(t){return this.setFunctionSpec(t,"animationState")}layout(t){return this.spec.layout=t,this.commit(),this}morph(t,e,i){return this.spec.morph=t,this.spec.morphKey=e,this.spec.morphElementKey=i,this}transform(t){const e=tg(this.spec.transform,this.view);e&&(this.detach(e.refs),this.transforms=[]);const i=tg(t,this.view);return i&&(this.attach(i.refs),this.transforms=i.transforms),this.spec.transform=t,this.commit(),this}configure(t){const e=["clip","clipPath","zIndex","interactive","context","setCustomizedShape","large","largeThreshold","progressiveStep","progressiveThreshold","support3d","morph","morphKey","morphElementKey","attributeTransforms","skipTheme","enableSegments","stateSort"];return null===t?(e.forEach((t=>{D(this.spec[t])||(this.spec[t]=void 0)})),this):(e.forEach((e=>{D(t[e])||(this.spec[e]=t[e])})),this)}context(t){return this.spec.context=t,this._context=t,this}isCollectionMark(){return Wg.includes(this.markType)}needAnimate(){var t;return!(null===(t=this.renderContext)||void 0===t?void 0:t.progressive)&&!D(this.spec.animation)}getAllElements(){const t=this.elements.slice();return this.elementMap.forEach((e=>{e.diffState!==Zd.exit||t.includes(e)||t.push(e)})),this.spec.sort&&t.sort(((t,e)=>this.spec.sort(t.getDatum(),e.getDatum()))),t}getScales(){const t={};return this.references.forEach(((e,i)=>{i.grammarType===hc.scale&&(t[i.id()]=i.output())})),t}getScalesByChannel(){const t=this.spec.encode;if(!t)return{};const e={},i=this.parameters();return Object.keys(t).forEach((s=>{const n=t[s];n&&!Wp(n)&&Object.keys(n).forEach((t=>{km(n[t])&&(e[t]=Up(n[t].scale,i))}))})),e}getFieldsByChannel(){const t=this.spec.encode;if(!t)return{};const e={};return Object.keys(t).forEach((i=>{const s=t[i];Wp(s)||Object.keys(s).forEach((t=>{Am(s[t])&&(e[t]=s[t].field)}))})),e}init(t,e){var i,s,n,r,a;if(this._delegateEvent||(this._delegateEvent=(t,e)=>{const i=dm(this.view,t,0,Ig),s=t.element;(null==s?void 0:s.mark)===this&&this.emitGrammarEvent(e,i,s)},this.initEvent()),null===(i=this.initAnimate)||void 0===i||i.call(this,this.spec),!this.group){const t=Up(this.spec.group,e);this.group=t,t&&t.appendChild(this)}const o=this.group?this.group.getGroupGraphicItem():t.defaultLayer,l=null!==(r=null===(n=null===(s=this.group)||void 0===s?void 0:s.children)||void 0===n?void 0:n.indexOf(this))&&void 0!==r?r:0;if(this.markType!==Jd.group){if(!this.graphicItem){const t=bm(this,Jd.group,{pickable:!1,zIndex:null!==(a=this.spec.zIndex)&&void 0!==a?a:0});(this.spec.support3d||Gg.includes(this.markType))&&t.setMode("3d"),t.name=`${this.id()||this.markType}`,this.graphicItem=t}this.graphicParent=this.graphicItem,!o||this.graphicIndex===l&&this.graphicItem.parent===o||o.insertIntoKeepIdx(this.graphicItem,l)}else this.graphicParent=o;this.graphicIndex=l}update(t){var e;if(this._context=this.spec.context,this.isUpdated=!0,this.renderContext.progressive||null===(e=this.updateAnimate)||void 0===e||e.call(this,t),this.markType!==Jd.group){if(D(t.zIndex)||this.graphicItem.setAttribute("zIndex",t.zIndex),D(t.clip)||this.graphicItem.setAttribute("clip",t.clip),!D(t.clipPath)){const e=y(t.clipPath)?t.clipPath:t.clipPath(this.elements);e&&e.length?this.graphicItem.setAttribute("path",e):this.graphicItem.setAttributes({path:e,clip:!1})}this.elementMap.forEach((t=>{t.updateGraphicItem()}))}else this.elementMap.forEach((t=>{t.updateGraphicItem()}))}createElement(){return new Vm(this)}evaluateJoin(t){var e,i,s,n;this.needClear=!0;const r=Xp(null!==(s=null!==(e=this.spec.key)&&void 0!==e?e:null===(i=this.grammarSource)||void 0===i?void 0:i.getDataIDKey())&&void 0!==s?s:()=>Ug),a=Xp(null!==(n=this.spec.groupBy)&&void 0!==n?n:()=>Ug),o=this.spec.sort,l=this.isCollectionMark(),h=new Set(this.elements.filter((t=>t.diffState===Zd.enter))),d=[];this.differ.setCallback(((t,e,i)=>{var s;const n=t;let o;if(D(e))o=this.elementMap.get(n),o&&(o.diffState=Zd.exit);else if(D(i)){if(o=this.elementMap.has(n)?this.elementMap.get(n):this.createElement(),o.diffState===Zd.exit){o.diffState=Zd.enter;const t=null===(s=this.animate)||void 0===s?void 0:s.getElementAnimators(o,Zd.exit);t&&t.forEach((t=>t.stop("start")))}o.diffState=Zd.enter;const i=l?t:a(e[0]);o.updateData(i,e,r),this.elementMap.set(n,o),d.push(o)}else if(o=this.elementMap.get(n),o){o.diffState=Zd.update;const i=l?t:a(e[0]);o.updateData(i,e,r),d.push(o)}h.delete(o)}));const c=null!=t?t:$g;l||this.differ.setCurrentData(Sm(c,(t=>`${a(t)}-${r(t)}`),void 0)),this.differ.doDiff(),h.forEach((t=>{this.elementMap.delete(l?t.groupKey:`${t.groupKey}-${t.key}`),t.remove(),t.release()})),this.elements=d,o&&this.elements.length>=2&&this.elements.sort(((t,e)=>o(t.getDatum(),e.getDatum())))}evaluateState(t,e,i){e&&t.forEach((t=>{t.state(e,i)}))}evaluateGroupEncode(t,e,i){if(!this._groupKeys||!e)return;const s={};return this._groupKeys.forEach((n=>{const r=t.find((t=>t.groupKey===n));r&&(s[n]=Pm(e,r.items&&r.items[0]&&r.items[0].datum,r,i))})),this._groupEncodeResult=s,s}getChannelsFromConfig(t){const e=this.spec;return D(e.interactive)?null:{pickable:e.interactive}}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(lc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[qd.group],i);t.forEach((t=>{this.markType===Jd.glyph&&this._groupEncodeResult?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,this._groupEncodeResult[t.groupKey])})):(null==r?void 0:r[t.groupKey])&&!this.isCollectionMark()?t.items.forEach((e=>{e.nextAttrs=Object.assign(e.nextAttrs,n,r[t.groupKey])})):n&&t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n)})),t.encodeItems(t.items,e,this._isReentered,i),this.isCollectionMark()&&(null==r?void 0:r[t.groupKey])&&M(r[t.groupKey].defined)&&(t.items.forEach((e=>{e.nextAttrs.defined=r[t.groupKey].defined})),delete r[t.groupKey].defined)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic(this.isCollectionMark()?null==r?void 0:r[t.groupKey]:null)})),this.emit(lc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){var s;const n=null!=i?i:bm(this,this.markType,t);if(n){if(null===(s=this.renderContext)||void 0===s?void 0:s.progressive){let t;if(this._groupKeys){const i=this._groupKeys.indexOf(e);i>=0&&(t=this.graphicParent.getChildAt(i))}else t=this.graphicParent.at(0);this.isCollectionMark()?(n.incremental=1,t.appendChild(n)):t.incrementalAppendChild(n)}else this.graphicParent.appendChild(n);return n}}parseRenderContext(t,e){const i=this.markType!==Jd.group&&this.spec.progressiveStep>0&&this.spec.progressiveThreshold>0&&this.spec.progressiveStep0&&t.length>=this.spec.largeThreshold;if(i){const i=this.differ.getCurrentData();return i&&i.keys&&i.keys.some((t=>i.data.get(t).length>this.spec.progressiveThreshold))?{large:s,parameters:e,progressive:{data:t,step:this.spec.progressiveStep,currentIndex:0,totalStep:i.keys.reduce(((t,e)=>Math.max(Math.ceil(i.data.get(e).length/this.spec.progressiveStep),t)),1),groupedData:i.data}}:{large:s}}return{large:s}}isProgressive(){return this.renderContext&&(!!this.renderContext.progressive||!!this.renderContext.beforeTransformProgressive)}canAnimateAfterProgressive(){return this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.canAnimate()}isDoingProgressive(){return this.renderContext&&(this.renderContext.progressive&&this.renderContext.progressive.currentIndex{t.incrementalClearChild()})),this.graphicParent.removeAllChild()),this.renderContext&&this.renderContext.beforeTransformProgressive&&this.renderContext.beforeTransformProgressive.release(),this.renderContext=null}restartProgressive(){this.renderContext&&this.renderContext.progressive&&(this.renderContext.progressive.currentIndex=0)}evaluateJoinProgressive(){var t,e,i;const s=this.renderContext.progressive.currentIndex,n=Xp(null!==(i=null!==(t=this.spec.key)&&void 0!==t?t:null===(e=this.grammarSource)||void 0===e?void 0:e.getDataIDKey())&&void 0!==i?i:()=>Ug),r=[];if(this.isCollectionMark())return this._groupKeys.forEach(((t,e)=>{const i=this.renderContext.progressive.groupedData.get(t),a=this.renderContext.progressive.step,o=i.slice(s*a,(s+1)*a);if(0===s){const e=this.createElement();e.diffState=Zd.enter,e.updateData(t,o,n),r.push(e)}else{const i=this.elements[e];i.updateData(t,o,n),r.push(i)}})),r;const a={};return this._groupKeys.forEach((t=>{const e=this.renderContext.progressive.groupedData.get(t),i=this.renderContext.progressive.step,o=e.slice(s*i,(s+1)*i),l=[];o.forEach((e=>{const i=this.createElement();i.diffState=Zd.enter,i.updateData(t,[e],n),l.push(i),r.push(i)})),a[t]=l})),{groupElements:a,elements:r}}evaluateEncodeProgressive(t,e,i){const s=this.renderContext.progressive.currentIndex;if(0===s){if(this.evaluateEncode(t,e,i),0===s&&this._groupEncodeResult&&!this.isCollectionMark()&&this.markType!==Jd.glyph){const e=t[0],i=e.getGraphicItem(),s=null==i?void 0:i.parent;s&&this._groupEncodeResult[e.groupKey]&&s.setTheme({common:this._groupEncodeResult[e.groupKey]})}}else this.evaluateEncode(t,e,i,!0)}evaluateProgressive(){var t,e,i;if(null===(t=this.renderContext)||void 0===t?void 0:t.beforeTransformProgressive){this.renderContext.beforeTransformProgressive.progressiveRun();const t=this.renderContext.beforeTransformProgressive.output();return this.emit(lc.BEFORE_MARK_JOIN),this.evaluateJoin(t),this.emit(lc.AFTER_MARK_JOIN),this.emit(lc.BEFORE_MARK_STATE),this.evaluateState(this.elements,this.spec.state,this.renderContext.parameters),this.emit(lc.AFTER_MARK_STATE),this.emit(lc.BEFORE_MARK_ENCODE),this.evaluateEncode(this.elements,this._getEncoders(),this.renderContext.parameters),void this.emit(lc.AFTER_MARK_ENCODE)}if(!(null===(e=this.renderContext)||void 0===e?void 0:e.progressive))return;const s=this.renderContext.parameters;this.emit(lc.BEFORE_MARK_JOIN);const n=this.evaluateJoinProgressive(),r=Array.isArray(n)?n:n.elements;if(this.emit(lc.AFTER_MARK_JOIN),0===this.renderContext.progressive.currentIndex?(this.graphicParent.removeAllChild(),this._groupKeys.forEach((t=>{const e=bm(this,Jd.group,{pickable:!1,zIndex:this.spec.zIndex});e.incremental=this.renderContext.progressive.step,this.graphicParent.appendChild(e)})),this.elements=r):this.elements=this.elements.concat(r),this.emit(lc.BEFORE_MARK_STATE),this.evaluateState(r,this.spec.state,s),this.emit(lc.AFTER_MARK_STATE),this.emit(lc.BEFORE_MARK_ENCODE),Array.isArray(n))this.evaluateEncodeProgressive(r,this._getEncoders(),s);else{const t=n.groupElements;Object.keys(t).forEach((e=>{this.evaluateEncodeProgressive(t[e],this._getEncoders(),s)}))}this.emit(lc.AFTER_MARK_ENCODE);const a=null===(i=this._getTransformsAfterEncode())||void 0===i?void 0:i.filter((t=>!0===t.canProgressive));(null==a?void 0:a.length)&&this.evaluateTransform(a,this.elements,s),this.renderContext.progressive.currentIndex+=1}isLargeMode(){return this.renderContext&&this.renderContext.large}cleanExitElements(){this.elementMap.forEach(((t,e)=>{t.diffState!==Zd.exit||t.isReserved||(this.elementMap.delete(e),t.remove(),t.release())}))}getGroupGraphicItem(){if(this.elements&&this.elements[0]&&this.elements[0].getGraphicItem)return this.elements[0].getGraphicItem()}getBounds(){var t;return this.graphicItem?this.graphicItem.AABBBounds:null===(t=this.getGroupGraphicItem())||void 0===t?void 0:t.AABBBounds}getMorphConfig(){var t;return{morph:null!==(t=this.spec.morph)&&void 0!==t&&t,morphKey:this.spec.morphKey,morphElementKey:this.spec.morphElementKey}}getAttributeTransforms(){var t;return null!==(t=this.spec.attributeTransforms)&&void 0!==t?t:vm[this.markType]}getContext(){return this._context}needSkipBeforeLayout(){var t,e;if(!0===(null===(t=this.spec.layout)||void 0===t?void 0:t.skipBeforeLayouted))return!0;let i=this.group;for(;i;){if(!0===(null===(e=i.getSpec().layout)||void 0===e?void 0:e.skipBeforeLayouted))return!0;i=i.group}return!1}initEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.on("*",this._delegateEvent)}}releaseEvent(){if(this._delegateEvent){const t=this.view.renderer.stage();t&&t.off("*",this._delegateEvent)}}clear(){var t;this.releaseEvent(),this.transforms=null,this.elementMap=null,this.elements=null,this.graphicItem=null,this.animate=null,null===(t=this.group)||void 0===t||t.removeChild(this),this.group=null,super.clear()}prepareRelease(){var t;null===(t=this.animate)||void 0===t||t.stop(),this.elementMap.forEach((t=>t.diffState=Zd.exit)),this._finalParameters=this.parameters()}release(){this.releaseEvent(),this.elements.forEach((t=>t.release())),this.elementMap.clear(),this._finalParameters=null,this.animate&&this.animate.release(),this.graphicItem&&xm(this.graphicItem),this.detachAll(),super.release()}}class Gm extends Wm{constructor(t,e){super(t,Jd.group,e),this.children=[]}parseRenderContext(){return{large:!1}}appendChild(t){return this.children.push(t),this}removeChild(t){return this.children=this.children.filter((e=>e!==t)),this}includesChild(t,e=!0){return!!this.children.includes(t)||!!e&&this.children.some((e=>e.markType===Jd.group&&e.includesChild(t,!0)))}updateLayoutChildren(){return this.children.length?(this.layoutChildren||(this.layoutChildren=[]),this.layoutChildren=this.children.filter((t=>t.needLayout())),this):this}getAttributeTransforms(){return vm.rect}evaluateJoin(t){if(!this.elements.length){const t=this.createElement();t.updateData(Ug,$g,(()=>"")),this.elements=[t],this.elementMap.set(Ug,t)}}getChannelsFromConfig(t){const e=this.spec,i={};if(D(e.clip)||(i.clip=e.clip),D(e.zIndex)||(i.zIndex=e.zIndex),!D(e.clipPath)){const s=ys(e.clipPath)?e.clipPath([t]):e.clipPath;s&&s.length?i.path=s:(i.path=null,i.clip=!1)}return D(e.interactive)||(i.pickable=e.interactive),i}evaluateGroupEncode(t,e,i){var s;const n=this.elements[0],r={};return Dm(n,[Object.assign({},null===(s=n.items)||void 0===s?void 0:s[0],{nextAttrs:r})],e,i),this._groupEncodeResult=r,r}evaluateEncode(t,e,i,s){const n=this.getChannelsFromConfig();if(e){this.emit(lc.BEFORE_ELEMENT_ENCODE,{encoders:e,parameters:i},this);const r=s?null:this.evaluateGroupEncode(t,e[qd.group],i);t.forEach((t=>{t.items.forEach((t=>{t.nextAttrs=Object.assign(t.nextAttrs,n,r)})),t.encodeItems(t.items,e,this._isReentered,i)})),this._isReentered=!1,this.evaluateTransform(this._getTransformsAfterEncodeItems(),t,i),t.forEach((t=>{t.encodeGraphic()})),this.emit(lc.AFTER_ELEMENT_ENCODE,{encoders:e,parameters:i},this)}else t.forEach((t=>{t.initGraphicItem(n)}))}addGraphicItem(t,e,i){const s=null!=i?i:bm(this,this.markType,t);if(s)return this.emit(lc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),s.name=`${this.id()||this.markType}`,this.graphicParent.insertIntoKeepIdx(s,this.graphicIndex),this.emit(lc.AFTER_ADD_VRENDER_MARK,{graphicItem:s}),s}}class Um{constructor(t,e){this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}},this._size=0,this._mapKey=S(t)?e=>e[t]:t,this._warning=e}record(t){var e,i;const s=t.grammarType,n=this._mapKey(t);return this._grammarMap[s]?(this._grammars[s].push(t),D(n)||(this._grammarMap[s][n]?null===(e=this._warning)||void 0===e||e.call(this,n,t):this._grammarMap[s][n]=t)):(this._grammars.customized.push(t),D(n)||(this._grammarMap.customized[n]?null===(i=this._warning)||void 0===i||i.call(this,n,t):this._grammarMap.customized[n]=t)),this._size+=1,this}unrecord(t){const e=t.grammarType,i=this._mapKey(t);return this._grammarMap[e]?(this._grammars[e]=this._grammars[e].filter((e=>e!==t)),D(i)||this._grammarMap[e][i]!==t||delete this._grammarMap[e][i]):(this._grammars.customized=this._grammars.customized.filter((e=>e!==t)),D(i)||this._grammarMap.customized[i]!==t||delete this._grammarMap.customized[i]),this._size-=1,this}size(){return this._size}getSignal(t){var e;return null!==(e=this._grammarMap.signal[t])&&void 0!==e?e:null}getData(t){var e;return null!==(e=this._grammarMap.data[t])&&void 0!==e?e:null}getScale(t){var e;return null!==(e=this._grammarMap.scale[t])&&void 0!==e?e:null}getCoordinate(t){var e;return null!==(e=this._grammarMap.coordinate[t])&&void 0!==e?e:null}getMark(t){var e;return null!==(e=this._grammarMap.mark[t])&&void 0!==e?e:null}getCustomized(t){var e;return null!==(e=this._grammarMap.customized[t])&&void 0!==e?e:null}getGrammar(t){return this._grammarMap.data[t]?this._grammarMap.data[t]:this._grammarMap.signal[t]?this._grammarMap.signal[t]:this._grammarMap.scale[t]?this._grammarMap.scale[t]:this._grammarMap.coordinate[t]?this._grammarMap.coordinate[t]:this._grammarMap.mark[t]?this._grammarMap.mark[t]:this._grammarMap.customized[t]?this._grammarMap.customized[t]:null}getAllSignals(){return this._grammars.signal}getAllData(){return this._grammars.data}getAllScales(){return this._grammars.scale}getAllCoordinates(){return this._grammars.coordinate}getAllMarks(){return this._grammars.mark}getAllCustomized(){return this._grammars.customized}traverse(t){var e;Object.values(null!==(e=this._grammars)&&void 0!==e?e:{}).forEach((e=>(null!=e?e:[]).forEach((e=>{t.call(null,e)}))))}find(t){let e=null;return this.traverse((i=>!0===t.call(null,i)&&(e=i,!0))),e}filter(t){const e=[];return this.traverse((i=>{!0===t.call(null,i)&&e.push(i)})),e}clear(){this._size=0,this._grammars={signal:[],data:[],scale:[],coordinate:[],mark:[],customized:[]},this._grammarMap={signal:{},data:{},scale:{},coordinate:{},mark:{},customized:{}}}release(){this._size=0,this._grammars=null,this._grammarMap=null}}class $m extends Um{constructor(){super(...arguments),this._markNodes=[]}record(t){if(super.record(t),"mark"===t.grammarType){const e=t,i={mark:e,parent:null,children:[]};this._markNodes.forEach((t=>{const s=t.mark;s.markType===Jd.group&&s.includesChild(e,!1)?(t.children.push(i),i.parent=t):e.markType===Jd.group&&e.includesChild(s,!1)&&(i.children.push(t),t.parent=i)})),this._markNodes.push(i)}return this}unrecord(t){if(super.unrecord(t),"mark"===t.grammarType){const e=t,i=this._markNodes.find((t=>t.mark===e));this._markNodes.forEach((t=>{t.mark.markType===Jd.group&&t.children.includes(i)?(t.children=t.children.filter((t=>t!==i)),i.parent=null):e.markType===Jd.group&&i.children.includes(t)&&(i.children=i.children.filter((e=>e!==t)),t.parent=null)})),this._markNodes=this._markNodes.filter((t=>t!==i))}return this}getAllMarkNodes(){return this._markNodes}clear(){super.clear(),this._markNodes=[]}release(){super.release(),this._markNodes=null}}class Xm extends Wm{addGraphicItem(t,e){const i=t&&t.limitAttrs,s=bm(this,i&&("rich"===i.textType||i.text&&"rich"===i.text.type)?Jd.richtext:Jd.text,t);return super.addGraphicItem(t,e,s)}release(){super.release()}}Xm.markType=Jd.text;const Km={axis:{label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#89909d",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],start:{x:0,y:0},end:{x:100,y:0},x:0,y:0},circleAxis:{title:{space:4,padding:[0,0,0,0],textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1},text:"theta"},label:{visible:!0,inside:!1,space:4,style:{fontSize:12,fill:"#6F6F6F",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#D9DDE4",strokeOpacity:1}},items:[],startAngle:0,endAngle:2*Math.PI,radius:100,innerRadius:0,center:{x:0,y:0},x:0,y:0},grid:{style:{stroke:"#f1f2f5"}},circleGrid:{style:{stroke:"#f1f2f5"}},discreteLegend:{layout:"vertical",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:10,spaceRow:10,shape:{space:4,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",stroke:"#D8D8D8",fillOpacity:.5}}},label:{space:4,style:{fontSize:12,fill:"black",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8",fillOpacity:.5}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"},state:{selectedHover:{fillOpacity:.7,fill:"gray"},unSelectedHover:{fillOpacity:.2,fill:"gray"}}},focus:!1,focusIconStyle:{size:10,fill:"#333",cursor:"pointer"},visible:!0,padding:{top:2,bottom:2,left:2,right:2}},autoPage:!0,pager:{space:12,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!1,items:[{index:0,id:"",label:"",shape:{fill:"#6690F2",stroke:"#6690F2",symbolType:"circle"}}]},colorLegend:{title:{visible:!1,text:""},colors:[],layout:"horizontal",railWidth:200,railHeight:8,railStyle:{cornerRadius:5}},sizeLegend:{title:{visible:!1,text:""},trackStyle:{fill:"#ccc"},layout:"horizontal",align:"bottom",railWidth:200,railHeight:6,min:0,max:1,value:[0,1]},lineCrosshair:{start:{x:0,y:0},end:{x:0,y:0}},rectCrosshair:{start:{x:0,y:0},end:{x:0,y:0},rectStyle:{width:10,height:10}},sectorCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:Math.PI/6},circleCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI},polygonCrosshair:{center:{x:0,y:0},radius:100,startAngle:0,endAngle:2*Math.PI,sides:6},slider:{layout:"horizontal",railWidth:200,railHeight:10,railStyle:{cornerRadius:5},range:{draggableTrack:!0},startText:{visible:!0,text:"",space:8},endText:{visible:!0,text:"",space:8},min:0,max:1,value:[0,1]},dataLabel:{size:{width:400,height:400},dataLabels:[]},pointLabel:{data:[{text:"",fill:"#606773",data:{}}],overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},lineLabel:{type:"line",data:[{text:"",data:{}}],position:"start",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},areaLabel:{type:"area",data:[{text:"",data:{}}],position:"end",overlap:{avoidBaseMark:!1,clampForce:!1,size:{width:1e3,height:1e3}},smartInvert:!1},rectLabel:{type:"rect",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},symbolLabel:{type:"symbol",data:[{text:"",fill:"#606773",data:{}}],position:"top",overlap:{avoidBaseMark:!0,size:{width:1e3,height:1e3},strategy:[{type:"position"}]},smartInvert:!1},arcLabel:{type:"arc",data:[{text:"",fill:"#606773",data:{}}],width:800,height:600,position:"outside",zIndex:302},lineDataLabel:{type:"line-data",data:[{text:""}],position:"top",overlap:{avoidBaseMark:!1,clampForce:!1},smartInvert:!1},datazoom:{orient:"bottom",showDetail:"auto",brushSelect:!0,start:0,end:1,position:{x:0,y:0},size:{width:500,height:40},previewData:[]},continuousPlayer:{},discretePlayer:{},tooltip:{},title:{textStyle:{fill:"#21252c"},subtextStyle:{fill:"#606773"}},scrollbar:{width:12,height:12,padding:[2,2],railStyle:{fill:"rgba(0, 0, 0, .1)"}}},qm={symbol:{shape:"circle",size:8},text:{fontSize:14,fill:"#000000"}},Zm=Object.assign({},Km);Zm.axis=Object.assign({},Zm.axis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Zm.circleAxis=Object.assign({},Zm.circleAxis,{label:{style:{fill:"#bbbdc3"}},line:{style:{stroke:"#4b4f54"}},tick:{style:{stroke:"#4b4f54"}},subTick:{style:{stroke:"#4b4f54"}}}),Zm.grid=Object.assign({},Zm.grid,{style:{stroke:"#404349"}}),Zm.circleGrid=Object.assign({},Zm.circleGrid,{style:{stroke:"#404349"}}),Zm.rectLabel=Object.assign({},Zm.rectLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Zm.lineLabel=Object.assign({},Zm.lineLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Zm.symbolLabel=Object.assign({},Zm.symbolLabel,{data:[{text:"",fill:"#888c93",data:{}}]}),Zm.title=Object.assign({},Zm.title,{textStyle:{fill:"#fdfdfd"},subtextStyle:{fill:"#888c93"}});const Jm={name:"dark",padding:5,background:"#202226",palette:{default:["#5383F4","#7BCF8E","#FF9D2C","#FFDB26","#7568D9","#80D8FB","#1857A3","#CAB0E8","#FF8867","#B9E493","#2CB4A8","#B9E4E3"]},marks:qm,components:Zm},Qm={name:"default",padding:5,palette:{default:["#6690F2","#70D6A3","#B4E6E2","#63B5FC","#FF8F62","#FFDC83","#BCC5FD","#A29BFE","#63C4C7","#F68484"]},marks:qm,components:Km};class t_{static registerTheme(t,e){t&&t_._themes.set(t,e)}static unregisterTheme(t){t_._themes.delete(t)}static getTheme(t){return t_._themes.get(t)}static getDefaultTheme(){return t_.getTheme("default")}}t_._themes=new Map,t_.registerTheme("default",Qm),t_.registerTheme("dark",Jm);class e_ extends Wm{constructor(t,e,i,s){super(t,Jd.component,i),this._componentDatum={[Ug]:0},this.componentType=e,this.spec.type="component",this.spec.componentType=e,this.mode=s,this._updateComponentEncoders()}configureComponent(t){return this.spec.componentConfig=t,this.commit(),this}addGraphicItem(t,e,i){const s=null!=i?i:_c.createGraphicComponent(this.componentType,t,{mode:this.mode,skipDefault:this.spec.skipTheme});return s&&(this.emit(lc.BEFORE_ADD_VRENDER_MARK,{graphicItem:s}),this.graphicParent.appendChild(s),this.emit(lc.AFTER_ADD_VRENDER_MARK,{graphicItem:s})),s}join(t){return super.join(t,Ug)}encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(),this}parseRenderContext(){return{large:!1}}_prepareRejoin(){this._componentDatum[Ug]+=1}evaluateJoin(t){return this.spec.key=Ug,t?(t[Ug]=this._componentDatum[Ug],this._componentDatum=t):this._componentDatum={[Ug]:this._componentDatum[Ug]},super.evaluateJoin([this._componentDatum])}_updateComponentEncoders(){this._encoders=this.spec.encode}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}}const i_=Symbol.for("key");class s_{diffGrammar(t,e){return function(t,e,i){const s={enter:[],exit:[],update:[]},n=new Mm(t,i);return n.setCallback(((t,e,i)=>{D(e)?s.exit.push({prev:i[0]}):D(i)?s.enter.push({next:e[0]}):s.update.push({next:e[0],prev:i[0]})})),n.setCurrentData(Sm(e,i)),n.doDiff(),s}(t,e,(t=>{var e;return null!==(e=t.id())&&void 0!==e?e:Symbol()}))}diffMark(t,e,i){const s={enter:[],exit:[],update:[]};let n=[],r=[];t.forEach((t=>{t.markType!==Jd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?n.push(t):s.exit.push({prev:[t]})})),e.forEach((t=>{t.markType!==Jd.group&&(i.morph&&t.getMorphConfig().morph||i.morphAll||i.reuse)?r.push(t):s.enter.push({next:[t]})}));const a=this.diffUpdateByGroup(n,r,(t=>t.getMorphConfig().morphKey),(t=>t.getMorphConfig().morphKey));n=a.prev,r=a.next,s.update=s.update.concat(a.update);const o=this.diffUpdateByGroup(n,r,(t=>t.id()),(t=>t.id()));n=o.prev,r=o.next,s.update=s.update.concat(o.update);const l=Sm(n,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)})),h=Sm(r,(t=>{var e,i;return null===(i=null===(e=t.group)||void 0===e?void 0:e.id)||void 0===i?void 0:i.call(e)}));return Object.keys(h).forEach((t=>{const e=l.data.get(t),i=h.data.get(t);if(e&&i){for(let t=0;t!e.includes(t))),r=r.filter((t=>!i.includes(t)))}})),n.forEach((t=>s.exit.push({prev:[t]}))),r.forEach((t=>s.enter.push({next:[t]}))),s}diffUpdateByGroup(t,e,i,s){const n=Sm(t,(t=>{var e;return null!==(e=i(t))&&void 0!==e?e:i_})),r=Sm(e,(t=>{var e;return null!==(e=s(t))&&void 0!==e?e:i_}));let a=t,o=e;const l=[];return r.keys.forEach((t=>{if(t!==i_){const e=n.data.get(t),i=r.data.get(t);e&&i&&(l.push({prev:e,next:i}),a=a.filter((t=>!e.includes(t))),o=o.filter((t=>!i.includes(t))))}})),{prev:a,next:o,update:l}}}class n_ extends(o()){static useRegisters(t){t.forEach((t=>{t()}))}constructor(t={},e={}){super(),this._observer=null,this._onResize=Xd(((...t)=>{const e=this._getContainerSize();e&&this.resize(e.width,e.height)}),100),this.delegateEvent=(t,e)=>{const i=dm(this,t,0,Ig);this.emit(e,i,t.element)},this.handleProgressiveFrame=()=>{this._progressiveMarks.length&&this._progressiveMarks.forEach((t=>{t.isDoingProgressive()&&t.evaluateProgressive()})),this.doPreProgressive()},this._config=e,this._options=Object.assign({mode:"browser"},t),this.initialize()}getGrammarById(t){return this.grammars.getGrammar(t)}getSignalById(t){return this.grammars.getSignal(t)}getDataById(t){return this.grammars.getData(t)}getScaleById(t){return this.grammars.getScale(t)}getCoordinateById(t){return this.grammars.getCoordinate(t)}getMarkById(t){return this.grammars.getMark(t)}getCustomizedById(t){return this.grammars.getCustomized(t)}getGrammarsByName(t){return this.grammars.filter((e=>e.name()===t))}getGrammarsByType(t){return this.grammars.filter((e=>e.grammarType===t))}getMarksByType(t){return this.grammars.getAllMarks().filter((e=>e.markType===t))}getMarksByName(t){return this.grammars.getAllMarks().filter((e=>e.name()===t))}getMarksBySelector(t){if(!t)return null;const e=Ba(t),i=[];return e.forEach((t=>{if($p(t))return void i.push(t);if("#"===t[0]){const e=this.getMarkById(t.slice(1));return void(e&&i.push(e))}const e="@"===t[0]?this.getMarksByName(t.slice(1)):Jd[t]?this.getMarksByType(t):null;e&&e.length&&e.forEach((t=>{i.push(t)}))})),i}updateSignal(t,e){S(t)&&(t=this.getSignalById(t)),t.set(e),this.commit(t)}signal(t,e){const i=new cm(this);return arguments.length>=1&&i.value(t),arguments.length>=2&&i.update(e),this.grammars.record(i),this._dataflow.add(i),i}data(t){const e=new ig(this,t);return this.grammars.record(e),this._dataflow.add(e),e}scale(t){const e=_c.createGrammar("scale",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}coordinate(t){const e=_c.createGrammar("coordinate",this,t);return e&&(this.grammars.record(e),this._dataflow.add(e)),e}mark(t,e,i){const s=S(e)?this.getMarkById(e):e;let n;switch(t){case Jd.group:n=new Gm(this,s);break;case Jd.glyph:const e=_c.getMark(Jd.glyph);e&&(n=new e(this,null==i?void 0:i.glyphType,s));break;case Jd.component:n=_c.hasComponent(null==i?void 0:i.componentType)?_c.createComponent(null==i?void 0:i.componentType,this,s,null==i?void 0:i.mode):new e_(this,null==i?void 0:i.componentType,s,null==i?void 0:i.mode);break;case Jd.text:n=new Xm(this,t,s);break;default:n=_c.hasMark(t)?_c.createMark(t,this,s):new Wm(this,t,s)}return this.grammars.record(n),this._dataflow.add(n),n}group(t){return this.mark(Jd.group,t)}glyph(t,e){return this.mark(Jd.glyph,e,{glyphType:t})}component(t,e,i="2d"){return this.mark(Jd.component,e,{componentType:t,mode:i})}axis(t,e="2d"){return this.mark(Jd.component,t,{componentType:Qd.axis,mode:e})}grid(t,e="2d"){return this.mark(Jd.component,t,{componentType:Qd.grid,mode:e})}legend(t){return this.mark(Jd.component,t,{componentType:Qd.legend})}slider(t){return this.mark(Jd.component,t,{componentType:Qd.slider})}label(t){return this.mark(Jd.component,t,{componentType:Qd.label})}datazoom(t){return this.mark(Jd.component,t,{componentType:Qd.datazoom})}player(t){return this.mark(Jd.component,t,{componentType:Qd.player})}title(t){return this.mark(Jd.component,t,{componentType:Qd.title})}scrollbar(t){return this.mark(Jd.component,t,{componentType:Qd.scrollbar})}customized(t,e){const i=_c.createGrammar(t,this,null==e?void 0:e.type);if(i)return i.parse(e),this.grammars.record(i),this._dataflow.add(i),i}addGrammar(t){return this.grammars.find((e=>e.uid===t.uid))||(this.grammars.record(t),this._dataflow.add(t),t.parse(t.getSpec()),this._needBuildLayoutTree=!0),this}removeGrammar(t){const e=S(t)?this.getGrammarById(t):t;return e&&this.grammars.find((t=>t.uid===e.uid))?("mark"===e.grammarType&&e.prepareRelease(),this._cachedGrammars.record(e),this._dataflow.remove(e),this.grammars.unrecord(e),this._needBuildLayoutTree=!0,this):this}removeAllGrammars(){return this.grammars.traverse((t=>{"signal"===t.grammarType&&pm.includes(t.id())||"mark"===t.grammarType&&"root"===t.id()||this.removeGrammar(t)})),this}removeAllGraphicItems(){return this.traverseMarkTree((t=>{t.graphicItem&&(xm(t.graphicItem),t.elementMap.forEach((t=>{t.resetGraphicItem()})),t.graphicItem=null)})),this}parseSpec(t){var e,i,s,n,r,a,o,l;if(this.emit(lc.BEFORE_PARSE_VIEW),this._spec=t,(t=>{var e;const i=(t,e)=>{var s,n;t.group=e;const r=null!==(s=t.id)&&void 0!==s?s:"VGRAMMAR_MARK_"+ ++um;t.id=r,(null!==(n=t.marks)&&void 0!==n?n:[]).forEach((t=>i(t,r)))};(null!==(e=t.marks)&&void 0!==e?e:[]).forEach((t=>i(t,"root")))})(t),t.theme?this.theme(t.theme):this.theme(t_.getDefaultTheme()),t.width&&this.width(t.width),t.height&&this.height(t.height),this.padding(null!==(i=null!==(e=t.padding)&&void 0!==e?e:this._options.padding)&&void 0!==i?i:this._theme.padding),!this.width()||!this.height()){const t=this._getContainerSize();t&&(this.updateSignal(Bg,t.width),this.updateSignal(Fg,t.height))}(null===(s=t.signals)||void 0===s?void 0:s.length)&&t.signals.forEach((t=>{this.signal().parse(t)})),(null===(n=t.data)||void 0===n?void 0:n.length)&&t.data.forEach((t=>{this.data(null).parse(t)})),(null===(r=t.coordinates)||void 0===r?void 0:r.length)&&t.coordinates.forEach((t=>{var e;null===(e=this.coordinate(t.type))||void 0===e||e.parse(t)})),(null===(a=t.scales)||void 0===a?void 0:a.length)&&t.scales.forEach((t=>{var e;null===(e=this.scale(t.type))||void 0===e||e.parse(t)}));const h=_c.getGrammars();return Object.keys(h).forEach((e=>{const{specKey:i}=h[e];t[i]&&t[i].length&&t[i].forEach((t=>{this.customized(e,t)}))})),t.marks&&t.marks.length&&t.marks.forEach((t=>{this.parseMarkSpec(t)})),t.events&&t.events.length&&t.events.forEach((t=>{var e;null===(e=this.event)||void 0===e||e.call(this,t)})),t.interactions&&t.interactions.length&&t.interactions.forEach((t=>{this.interaction(t.type,t)})),!1===t.animation?null===(o=this.animate)||void 0===o||o.disable():null===(l=this.animate)||void 0===l||l.enable(),this.emit(lc.AFTER_PARSE_VIEW),this._needBuildLayoutTree=!0,this._layoutState=oc.before,this}updateSpec(t){return this.removeAllInteractions(),this.removeAllGrammars(),this.parseSpec(t)}parseBuiltIn(){((t,e,i)=>{var s,n,r,a,o;return[{id:Bg,value:null!==(s=t[Bg])&&void 0!==s?s:0},{id:Fg,value:null!==(n=t[Fg])&&void 0!==n?n:0},{id:Hg,value:gm(null!==(a=null!==(r=t[Hg])&&void 0!==r?r:e[Hg])&&void 0!==a?a:null==i?void 0:i.padding)},{id:Yg,update:{callback:(t,e)=>{const i=gm(e[Hg]);return e[Bg]-i.left-i.right},dependency:[Bg,Hg]}},{id:jg,update:{callback:(t,e)=>{const i=gm(e[Hg]);return e[Fg]-i.top-i.bottom},dependency:[Fg,Hg]}},{id:zg,update:{callback:(t,e)=>{const i=gm(e[Hg]);return(t||new Kt).setValue(i.left,i.top,i.left+e[Yg],i.top+e[jg])},dependency:[Yg,jg,Hg]}},{id:Ng,value:null!==(o=t[Ng])&&void 0!==o?o:e[Ng]}]})(this._options,this._config,this.getCurrentTheme()).forEach((t=>{const e=this.signal().parse(t);t.value&&e.set(t.value)})),this.parseMarkSpec({id:"root",type:"group",encode:{enter:{x:0,y:0},update:{width:{signal:"width"},height:{signal:"height"}}}}),this.rootMark=this.getMarkById("root")}parseMarkSpec(t){var e;const i=t.type===Jd.glyph?{glyphType:t.glyphType}:t.type===Jd.component?{componentType:t.componentType,mode:t.mode}:null;this.mark(t.type,t.group,i).parse(t),null===(e=t.marks)||void 0===e||e.forEach((t=>{this.parseMarkSpec(t)}))}theme(t){var e,i,s,n,r,a;S(t)?this._theme=null!==(e=t_.getTheme(t))&&void 0!==e?e:t_.getDefaultTheme():this._theme=t;const{background:o,padding:l}=null!==(i=this._spec)&&void 0!==i?i:{};return this._theme?(this.background(null!==(s=null!=o?o:this._options.background)&&void 0!==s?s:this._theme.background),this.padding(null!==(n=null!=l?l:this._options.padding)&&void 0!==n?n:this._theme.padding),null===(a=null===(r=this.renderer.stage())||void 0===r?void 0:r.setTheme)||void 0===a||a.call(r,Object.assign({},this._theme.marks))):(this.background(null!=o?o:this._options.background),this.padding(null!=l?l:this._options.padding)),this}getCurrentTheme(){return this._theme}setCurrentTheme(t,e=!0){return this.theme(t),this.grammars.getAllMarks().forEach((t=>{t.commit()})),e?(this.evaluate(),this.renderer.render(!0)):this._dataflow.evaluate(),this}background(t){return arguments.length?(this._background=t,this.renderer.background(t),t):this._background}width(t){const e=this.getSignalById(Bg);return arguments.length?(this._options.width=t,this.updateSignal(e,t),t):e.output()}height(t){const e=this.getSignalById(Fg);return arguments.length?(this._options.height=t,this.updateSignal(e,t),t):e.output()}viewWidth(t){const e=this.getSignalById(Yg);if(arguments.length){const e=this.padding();return this.width(t+e.left+e.right),t}return e.output()}viewHeight(t){const e=this.getSignalById(jg);if(arguments.length){const e=this.padding();return this.height(t+e.top+e.bottom),t}return e.output()}padding(t){const e=this.getSignalById(Hg);if(arguments.length){const i=gm(t);return this.updateSignal(e,i),i}return gm(e.output())}autoFit(t){const e=this.getSignalById(Ng);return arguments.length?(this.updateSignal(e,t),t):e.output()}getViewBox(){const t=this.getSignalById(zg);return null==t?void 0:t.output()}updateLayoutTag(){return this._layoutState=oc.before,this}getLayoutState(){return this._layoutState}buildLayoutTree(){const t={},e=[];this.traverseMarkTree((i=>{t[i.id()]=!0,i.group&&t[i.group.id()]||e.push(i),i.markType===Jd.group&&i.updateLayoutChildren()}),(t=>t.needLayout())),this._layoutMarks=e}doLayout(){var t;const e=this._options.doLayout||_c.getDefaultLayout();e&&(null===(t=this._layoutMarks)||void 0===t?void 0:t.length)&&(this.emit(lc.BEFORE_DO_LAYOUT),e(this._layoutMarks,this._options,this),this.emit(lc.AFTER_DO_LAYOUT))}handleLayoutEnd(){this.emit(lc.BEFORE_MARK_LAYOUT_END),this._layoutMarks.forEach((t=>{dg(t,"layoutChildren",(t=>{t.handleLayoutEnd()}),(e=>e!==t))})),this.emit(lc.AFTER_MARK_LAYOUT_END)}handleRenderEnd(){this.emit(lc.BEFORE_MARK_RENDER_END),dg(this.rootMark,"children",(t=>{t.handleRenderEnd()})),this.emit(lc.AFTER_MARK_RENDER_END)}commit(t){return this._dataflow.commit(t),this}run(t){return this.evaluate(t),this}doRender(t){this.emit(lc.BEFORE_DO_RENDER),this.renderer&&(!this._progressiveMarks&&this.animate?this.animate.animate():this.traverseMarkTree((t=>{t.cleanExitElements()}),null,!0),this.renderer.render(t),this.handleRenderEnd()),this.emit(lc.AFTER_DO_RENDER)}evaluate(t){var e,i;const s=(t=>{var e,i,s,n,r;const{reuse:a=Kg,morph:o=qg,morphAll:l=Zg,animation:h={},enableExitAnimation:d=Jg}=null!=t?t:{};return{reuse:a,morph:o,morphAll:l,animation:{easing:null!==(e=h.easing)&&void 0!==e?e:am,delay:null!==(i=h.delay)&&void 0!==i?i:im,duration:null!==(s=h.duration)&&void 0!==s?s:em,oneByOne:null!==(n=h.oneByOne)&&void 0!==n?n:rm,splitPath:null!==(r=h.splitPath)&&void 0!==r?r:null},enableExitAnimation:d}})(t),n=this._cachedGrammars.size()>0;n&&(this.reuseCachedGrammars(s),this.detachCachedGrammar());const r=this._resizeRenderer(),a=this._dataflow.hasCommitted();return n||a||this._layoutState||r?(this.clearProgressive(),this._dataflow.evaluate(),this._needBuildLayoutTree&&(this.buildLayoutTree(),this._needBuildLayoutTree=!1),this._layoutState&&(this._layoutState=oc.layouting,this.doLayout(),this._dataflow.hasCommitted()&&(this._layoutState=oc.reevaluate,this._dataflow.evaluate()),this._layoutState=oc.after,(null===(e=this._layoutMarks)||void 0===e?void 0:e.length)&&this.handleLayoutEnd()),this._layoutState=null,this.findProgressiveMarks(),this._resizeRenderer(),null===(i=this.morph)||void 0===i||i.call(this,s),this.releaseCachedGrammars(s),this.doRender(!0),this.doPreProgressive(),this):this}reuseCachedGrammars(t){if(t.reuse){const t=t=>{t.next.reuse(t.prev),t.prev.detachAll(),t.prev.clear(),this._cachedGrammars.unrecord(t.prev)};this._differ.diffGrammar(this._cachedGrammars.getAllSignals(),this.grammars.getAllSignals().filter((t=>!pm.includes(t.id())))).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllData(),this.grammars.getAllData()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllScales(),this.grammars.getAllScales()).update.forEach(t),this._differ.diffGrammar(this._cachedGrammars.getAllCoordinates(),this.grammars.getAllCoordinates()).update.forEach(t)}this._differ.diffMark(this._cachedGrammars.getAllMarks(),this.grammars.getAllMarks().filter((t=>"root"!==t.id())),t).update.forEach((e=>{var i;const s=1===e.prev.length&&1===e.next.length&&e.prev[0].markType===e.next[0].markType,n=e.prev.every((t=>t.getMorphConfig().morph))&&e.next.every((t=>t.getMorphConfig().morph));this.morph&&(t.morph&&n||t.morphAll)?null===(i=this.addMorphMarks)||void 0===i||i.call(this,{prev:e.prev,next:e.next}):s&&t.reuse&&(e.next[0].reuse(e.prev[0]),e.prev[0].detachAll(),e.prev[0].clear(),this._cachedGrammars.unrecord(e.prev[0]))}))}detachCachedGrammar(){this._cachedGrammars.traverse((t=>{var e,i;if(t.detachAll(),"mark"===t.grammarType){const s=t;null===(i=null===(e=s.group)||void 0===e?void 0:e.removeChild)||void 0===i||i.call(e,s)}}))}releaseCachedGrammars(t){this._cachedGrammars.traverse((t=>{"mark"!==t.grammarType&&t.release()}));const e=this._cachedGrammars.getAllMarkNodes();e.forEach((e=>{var i;null===(i=e.mark.animate)||void 0===i||i.stop(),t.enableExitAnimation&&this.animate&&this.animate.animateAddition(e.mark)}));const i=t=>{if(t.mark.view&&(!t.mark.animate||0===t.mark.animate.getAnimatorCount())&&(!t.children||0===t.children.length)){t.mark.release();const e=t.parent;e&&(t.parent.children=t.parent.children.filter((e=>e!==t)),t.parent=null,i(e))}};e.forEach((t=>{const e=t.mark;e.animate&&0!==e.animate.getAnimatorCount()?e.addEventListener("animationEnd",(()=>{e.animate&&0===e.animate.getAnimatorCount()&&i(t)})):i(t)})),this._cachedGrammars.clear()}runAfter(t){return this._dataflow.runAfter((()=>{t.call(null,this)})),this}runBefore(t){return this._dataflow.runBefore((()=>{t.call(null,this)})),this}getImageBuffer(){var t,e;if("node"!==this._options.mode)return void this.logger.error(new TypeError("getImageBuffer() now only support node environment."));const i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t);return i?(i.render(),i.window.getImageBuffer()):(this.logger.error(new ReferenceError("render is not defined")),null)}traverseMarkTree(t,e,i){return dg(this.rootMark,"children",t,e,i),this}_bindResizeEvent(){var t,e,i,s,n,r;if(this.autoFit()){const a=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(a){const t=window.ResizeObserver;this._observer=new t(this._onResize),null===(r=this._observer)||void 0===r||r.observe(a)}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this.autoFit()&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}_getContainerSize(){var t,e,i,s,n,r,a,o,l,h,d;const c=null===(n=null===(s=null===(i=null===(e=null===(t=this.renderer)||void 0===t?void 0:t.stage)||void 0===e?void 0:e.call(t))||void 0===i?void 0:i.window)||void 0===s?void 0:s.getContainer)||void 0===n?void 0:n.call(s);if(c){const{width:t,height:e}=Jr(c);return{width:null!==(o=null!==(a=null===(r=this._spec)||void 0===r?void 0:r.width)&&void 0!==a?a:this._options.width)&&void 0!==o?o:t,height:null!==(d=null!==(h=null===(l=this._spec)||void 0===l?void 0:l.height)&&void 0!==h?h:this._options.height)&&void 0!==d?d:e}}return null}resize(t,e,i=!0){let s=!1;return t!==this.width()&&(s=!0,this.updateSignal(Bg,t)),e!==this.height()&&(s=!0,this.updateSignal(Fg,e)),s&&(i?this.evaluate({morph:!1}):this._dataflow.evaluate()),this}_resizeRenderer(){const t=this.width(),e=this.height();return!!this.renderer.shouldResize(t,e)&&(this.renderer.resize(t,e),this.emit("resize",{},{width:t,height:e}),!0)}interaction(t,e){const i=_c.createInteraction(t,this,e);return i&&(i.bind(),this._boundInteractions||(this._boundInteractions=[]),this._boundInteractions.push(i)),i}removeInteraction(t,e){if(this._boundInteractions){const i=this._boundInteractions.filter((i=>{var s;return D(e)?S(t)?i.type===t:t?i===t:void 0:(null===(s=i.options)||void 0===s?void 0:s.id)===e}));i.length&&i.forEach((t=>{t.unbind()}))}return this}removeAllInteractions(){return this._boundInteractions&&(this._boundInteractions.forEach((t=>{t.unbind()})),this._boundInteractions=null),this}initializeEventConfig(t){const e=Object.assign({defaults:{}},t),i=(t,e)=>{e.forEach((e=>{y(t[e])&&(t[e]=t[e].reduce(((t,e)=>(t[e]=!0,t)),{}))}))};return i(e.defaults,["prevent","allow"]),i(e,[Ig,Rg]),e}initEvent(){const t=this.renderer.stage();t&&t.on("*",this.delegateEvent)}releaseStageEvent(){const t=this.renderer.stage();t&&t.off("*",this.delegateEvent)}addEventListener(t,e,i){let s=e;return i&&!1===i.trap||(s=e,s.raw=e),i&&i.target&&(s.target=i.target),this.on(t,s),this}removeEventListener(t,e){return e?this.off(t,e):this.off(t),this}initializeRenderer(){const t=this._options.width,e=this._options.height;this.renderer=new Dg(this),this.renderer.initialize(t,e,this._options,this._eventConfig).background(this._background)}initialize(){var t,e,i;this.grammars=new Um((t=>t.id()),((t,e)=>this.logger.warn(`Grammar id '${t}' has been occupied`,e))),this._cachedGrammars=new $m((t=>t.id())),this._options.logger&&g.setInstance(this._options.logger),this.logger=g.getInstance(null!==(t=this._options.logLevel)&&void 0!==t?t:0),this._dataflow=new hg,this.animate=null===(e=this.initAnimate)||void 0===e?void 0:e.call(this,this),this._differ=new s_,this._options.hooks&&(Object.keys(this._options.hooks).forEach((t=>{this.on(t,this._options.hooks[t])})),this.hooks=this._options.hooks),this.container=null,this.renderer=null,this._eventListeners=[],this._eventConfig=this.initializeEventConfig(this._options.eventConfig),this._theme=this._options.disableTheme?null:t_.getDefaultTheme(),this.parseBuiltIn(),(i=this._options).mode&&zo.setEnv(i.mode,i.modeParams||{}),this.initializeRenderer(),this._eventConfig.disable||this.initEvent(),this._bindResizeEvent(),this._needBuildLayoutTree=!0,this._layoutState=oc.before,this.theme(this._theme)}pauseProgressive(){return!1}resumeProgressive(){return!1}restartProgressive(){return!1}findProgressiveMarks(){const t=[];return this.traverseMarkTree((e=>{t.push(e)}),(t=>t.markType!==Jd.group&&t.isProgressive())),t.length?(this._progressiveMarks=t,this.renderer&&this.renderer.combineIncrementalLayers(),t):(this._progressiveMarks=null,null)}doPreProgressive(){if(this._progressiveMarks&&this._progressiveMarks.some((t=>t.isDoingProgressive()))){const t=zo.getRequestAnimationFrame();this._progressiveRafId=t(this.handleProgressiveFrame)}else this._progressiveMarks&&this.animate&&this._progressiveMarks.every((t=>t.canAnimateAfterProgressive()))?this.animate.animate():this._progressiveMarks&&(this._progressiveMarks=null)}clearProgressive(){this._progressiveRafId&&zo.getCancelAnimationFrame()(this._progressiveRafId),this._progressiveMarks&&this._progressiveMarks.length&&(this._progressiveMarks.forEach((t=>{t.clearProgressive()})),this._progressiveMarks=null)}release(){var t,e,i,s;this.removeAllInteractions(),this.releaseStageEvent(),this._unBindResizeEvent(),this.clearProgressive(),_c.unregisterRuntimeTransforms(),g.setInstance(null),null===(t=this.animate)||void 0===t||t.stop(),this.grammars.release(),this._cachedGrammars.release(),this._dataflow.release(),this._dataflow=null,null===(i=null===(e=this.renderer)||void 0===e?void 0:e.release)||void 0===i||i.call(e),this.renderer=null,this._boundInteractions=null,this.removeAllListeners(),null===(s=this._eventListeners)||void 0===s||s.forEach((t=>{t.source.removeEventListener(t.type,t.handler)})),this._eventListeners=null}}var r_;function a_(t){switch(t){case n["desktop-browser"]:case n["mobile-browser"]:return"browser";case n.node:case n.worker:return"node";case n.miniApp:case n["desktop-miniApp"]:return"feishu";case n.lynx:return"lynx";case n.wx:return"wx";case n.tt:return"tt";case n.harmony:return"harmony"}return"browser"}!function(t){t.data="data",t.signal="signal",t.mark="mark"}(r_||(r_={}));class o_{getVGrammarView(){return this._view}getModel(){return this._model}constructor(t,e){this._viewListeners=new Map,this._windowListeners=new Map,this._canvasListeners=new Map,this.isInited=!1,this._released=!1,this._model={[r_.signal]:{},[r_.data]:{},[r_.mark]:{}},this._compileChart=null,this.handleStageRender=()=>{var t,e;null===(e=null===(t=this._compileChart)||void 0===t?void 0:t.getEvent())||void 0===e||e.emit(Hd.afterRender,{chart:this._compileChart})},this._container=t,this._option=e}getRenderer(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer}getCanvas(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.canvas()}getStage(){var t;return null===(t=this._view)||void 0===t?void 0:t.renderer.stage()}initView(){var t,e,i,s;if(this._released)return;if(this.isInited=!0,this._view)return;const n=new g(null!==(t=this._option.logLevel)&&void 0!==t?t:u.Error);(null===(e=this._option)||void 0===e?void 0:e.onError)&&n.addErrorHandler(((...t)=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.onError)||void 0===i||i.call(e,...t)})),this._view=new n_(Object.assign(Object.assign({width:this._width,height:this._height,container:null!==(i=this._container.dom)&&void 0!==i?i:null,renderCanvas:null!==(s=this._container.canvas)&&void 0!==s?s:null,hooks:this._option.performanceHook},this._option),{mode:a_(this._option.mode),autoFit:!1,eventConfig:{gesture:cl(this._option.mode),disable:!1===this._option.interactive},doLayout:()=>{var t;null===(t=this._compileChart)||void 0===t||t.onLayout(this._view)},logger:n,logLevel:n.level()})),this._setCanvasStyle(),this.getStage().hooks.afterRender.tap("chart-event",this.handleStageRender),!1!==this._option.interactive&&this._viewListeners.forEach((t=>{var e;null===(e=this._view)||void 0===e||e.addEventListener(t.type,t.callback)}))}_setCanvasStyle(){if(this._view&&this._container.dom&&!S(this._container.dom)){this._container.dom.style.display="block",this._container.dom.style.position="relative";const t=this.getCanvas();t&&(t.style.display="block")}}compileInteractions(){var t;if(this._view.removeAllInteractions(),null===(t=this._interactions)||void 0===t?void 0:t.length){const t={};this._interactions.forEach((e=>{var i;if(e.regionId){const s=`${e.regionId}-${e.type}-${null!==(i=e.id)&&void 0!==i?i:""}`,n=t[s];t[s]=n?Object.assign(Object.assign(Object.assign({},n),e),{selector:[...n.selector,...e.selector]}):e}else this._view.interaction(e.type,e)})),Object.keys(t).forEach((e=>{const i=this._view.interaction(t[e].type,t[e]);if(this._compileChart){const s=this._compileChart.getRegionsInIds([t[e].regionId])[0];s&&s.interaction.addVgrammarInteraction(i.getStartState(),i)}}))}}compile(t,e){if(this._released)return;const{chart:i}=t;this._compileChart=i,this.initView(),this._view&&(i.compile(),i.afterCompile(),this.updateDepend(),this.compileInteractions())}clearNextRender(){return!!this._nextRafId&&(zo.getCancelAnimationFrame()(this._nextRafId),this._nextRafId=null,!0)}clear(t,e=!1){const{chart:i}=t;this.clearNextRender(),i.clear(),this.releaseGrammar(e)}renderNextTick(t){this._released||this._nextRafId||(this._nextRafId=zo.getRequestAnimationFrame()((()=>{this._nextRafId=null,this.render(t)})))}render(t){var e,i;this._released||(this.initView(),this._view&&(null===(e=this._view)||void 0===e||e.run(t),this.clearNextRender()&&(null===(i=this._view)||void 0===i||i.run(t))))}updateViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}resize(t,e,i=!0){this._view&&(this._width=t,this._height=e,this._view.resize(t,e),i&&this.render({morph:!1}))}setBackground(t){var e;null===(e=this._view)||void 0===e||e.background(t)}setSize(t,e){this._width=t,this._height=e,this._view&&(this._view.width(t),this._view.height(e))}setViewBox(t,e=!0){this._view&&this._view.renderer.setViewBox(t,e)}addEventListener(t,e,i){var s,n;if(!1!==this._option.interactive)if(t===zd.chart){const n=function(s,n){var r,a,o;const l=null!==(a=null===(r=null==n?void 0:n.mark)||void 0===r?void 0:r.getContext())&&void 0!==a?a:{},h=M(l.modelId)?l.modelId:null,d=M(l.markId)?l.markId:null,c=M(l.modelUserId)?l.modelUserId:null,u=M(l.markUserId)?l.markUserId:null,p={event:s,type:e,source:t,item:n,datum:(null===(o=null==n?void 0:n.getDatum)||void 0===o?void 0:o.call(n))||null,markId:d,modelId:h,markUserId:u,modelUserId:c};i.call(null,p)}.bind(this);this._viewListeners.set(i,{type:e,callback:n}),null===(s=this._view)||void 0===s||s.addEventListener(e,n)}else if(t===zd.window){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._windowListeners.set(i,{type:e,callback:s});const n=this._getGlobalThis();null==n||n.addEventListener(e,s)}else if(t===zd.canvas){const s=function(s){const n={event:s,type:e,source:t,item:null,datum:null,markId:null,modelId:null,markUserId:null,modelUserId:null};i.call(null,n)}.bind(this);this._canvasListeners.set(i,{type:e,callback:s});const r=null===(n=this.getStage())||void 0===n?void 0:n.window;null==r||r.addEventListener(e,s)}}removeEventListener(t,e,i){var s,n,r,a,o;if(!1!==this._option.interactive)if(t===zd.chart){const t=null===(s=this._viewListeners.get(i))||void 0===s?void 0:s.callback;t&&(null===(n=this._view)||void 0===n||n.removeEventListener(e,t)),this._viewListeners.delete(i)}else if(t===zd.window){const t=this._getGlobalThis(),s=null===(r=this._windowListeners.get(i))||void 0===r?void 0:r.callback;s&&(null==t||t.removeEventListener(e,s)),this._windowListeners.delete(i)}else if(t===zd.canvas){const t=null===(a=this.getStage())||void 0===a?void 0:a.window,s=null===(o=this._canvasListeners.get(i))||void 0===o?void 0:o.callback;t&&s&&(null==t||t.removeEventListener(e,s)),this._canvasListeners.delete(i)}}releaseEvent(){const t=this.getStage();t&&t.hooks.afterRender.unTap("chart-event",this.handleStageRender),this._viewListeners.clear(),this._windowListeners.clear(),this._canvasListeners.clear()}release(){var t;this.clearNextRender(),this.releaseEvent(),this._option=this._container=null,this._releaseModel(),null===(t=this._view)||void 0===t||t.release(),this._view=null,this.isInited=!1,this._compileChart=null,this._released=!0}releaseGrammar(t=!1){var e,i;this._releaseModel(),t&&(null===(e=this._view)||void 0===e||e.removeAllGraphicItems()),null===(i=this._view)||void 0===i||i.removeAllGrammars()}_releaseModel(){Object.keys(this._model).forEach((t=>{Object.values(this._model[t]).forEach((t=>{Object.values(t).forEach((t=>{t.removeProduct(!0)}))})),this._model[t]={}}))}addGrammarItem(t){const e=t.getProduct();if(D(e))return;const i=e.id(),s=t.grammarType;D(this._model[s][i])&&(this._model[s][i]={}),this._model[s][i][t.id]=t}removeGrammarItem(t,e){var i;const s=t.getProduct();if(D(s))return;const n=s.id(),r=t.grammarType,a=this._model[r][n];M(a)&&(delete a[t.id],0===Object.keys(a).length&&delete this._model[r][n]),e||null===(i=this._view)||void 0===i||i.removeGrammar(s)}addInteraction(t){this._interactions||(this._interactions=[]),this._interactions.push(t)}removeInteraction(t){this._interactions&&(this._interactions=this._interactions.filter((e=>e.seriesId!==t)))}updateDepend(t){return M(t)&&t.length>0?t.every((t=>t.updateDepend())):(Object.values(this._model).forEach((t=>{Object.values(t).forEach((t=>{const e=Object.values(t),i=e[0].getProduct(),s=e.reduce(((t,e)=>e.getDepend().length>0?t.concat(e.getDepend()):t),[]).filter((t=>!!t)).map((t=>t.getProduct()));i.depend(s)}))})),!0)}_getGlobalThis(){var t;return dl(this._option.mode)?globalThis:null===(t=this.getStage())||void 0===t?void 0:t.window}}function l_(t,e){var i,s,n,r,a;return s=this,n=void 0,a=function*(){if(!t)return"";try{if(void 0!==OffscreenCanvas&&t instanceof OffscreenCanvas)return function(t){return new Promise((e=>{t.convertToBlob().then((t=>{const i=new FileReader;i.readAsDataURL(t),i.onload=()=>{e(i.result)}}))}))}(t)}catch(t){(null!==(i=null==e?void 0:e.onError)&&void 0!==i?i:gl)(`getCanvasDataURL error : ${t.toString()}`)}return t.toDataURL()},new((r=void 0)||(r=Promise))((function(t,e){function i(t){try{l(a.next(t))}catch(t){e(t)}}function o(t){try{l(a.throw(t))}catch(t){e(t)}}function l(e){var s;e.done?t(e.value):(s=e.value,s instanceof r?s:new r((function(t){t(s)}))).then(i,o)}l((a=a.apply(s,n||[])).next())}))}const h_={visible:!0,position:"auto",titleStyle:{fontSize:16,fill:"#08979c"},contentStyle:{fontSize:12,fill:"green"},panel:{visible:!0,fill:"#e6fffb",size:12,space:0,stroke:"#87e8de",lineWidth:1,cornerRadius:4}},d_={poptip:E({},h_)};function c_(){c_.__loaded||(c_.__loaded=!0,ra.RegisterGraphicCreator("group",tr))}c_.__loaded=!1;const u_=c_;class p_{constructor(t,e,i){this.fontFamily=t,this.textOptions=e,this.textMeasure=i}LayoutBBox(t,e,i){if("left"===e||"start"===e)t.xOffset=0;else if("center"===e)t.xOffset=t.width/-2;else{if("right"!==e&&"end"!==e)throw new Error("非法的textAlign");t.xOffset=-t.width}return t.yOffset="top"===i?0:"middle"===i?t.height/-2:"alphabetic"===i?-.79*t.height:-t.height,t}GetLayout(t,e,i,s,n,r,a,o,l){const h=[],d=[e,i],c=[0,0];for(;t.length>0;){const{str:i}=this.textMeasure.clipTextWithSuffix(t,this.textOptions,e,a,o,l);h.push({str:i,width:this.textMeasure.measureTextWidth(i,this.textOptions)}),t=t.substring(i.length)}"left"===s||"start"===s||("center"===s?c[0]=d[0]/-2:"right"!==s&&"end"!==s||(c[0]=-d[0])),"top"===n||("middle"===n?c[1]=d[1]/-2:"bottom"===n&&(c[1]=-d[1]));const u={xOffset:c[0],yOffset:c[1],width:d[0],height:d[1]};return this.layoutWithBBox(u,h,s,n,r)}GetLayoutByLines(t,e,i,s,n="",r,a,o="end"){t=t.map((t=>t.toString()));const l=[],h=[0,0];if("number"==typeof a&&a!==1/0){let e;for(let i=0,s=t.length;iMath.max(t,e.width)),0);const d={xOffset:0,yOffset:0,width:h[0],height:h[1]};return this.LayoutBBox(d,e,i),this.layoutWithBBox(d,l,e,i,s)}layoutWithBBox(t,e,i,s,n){const r=[0,0],a=e.length*n;"top"===s||("middle"===s?r[1]=(t.height-a)/2:"bottom"===s&&(r[1]=t.height-a));for(let a=0;a{t+=e.str})),(Array.isArray(r)?r.join(""):r)!==t}return"vertical"===s.direction&&this.cache.verticalList&&this.cache.verticalList[0]?this.cache.verticalList[0].map((t=>t.text)).join("")!==s.text.toString():null!=this.clipedText&&this.clipedText!==s.text.toString()}get multilineLayout(){if(this.isMultiLine)return this.tryUpdateAABBBounds(),this.cache.layoutData}isSimplify(){return!this.isMultiLine&&"vertical"!==this.attribute.direction}get isMultiLine(){return Array.isArray(this.attribute.text)||"normal"===this.attribute.whiteSpace}constructor(t={text:"",fontSize:16}){super(t),this.type="text",this.numberType=$n,this.cache={}}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{text:t}=this.attribute;return y(t)?!t.every((t=>null==t||""===t)):null!=t&&""!==t}getGraphicTheme(){return ps(this).text}updateAABBBounds(t,e,i){const{text:s=e.text}=this.attribute;Array.isArray(s)?this.updateMultilineAABBBounds(s):this.updateSingallineAABBBounds(s);const{tb1:n}=xi.graphicService.updateTempAABBBounds(i),{scaleX:r=e.scaleX,scaleY:a=e.scaleY,shadowBlur:o=e.shadowBlur,strokeBoundsBuffer:l=e.strokeBoundsBuffer}=t;return o&&(kn(n,o/Math.abs(r+a),!0,l),i.union(n)),xi.graphicService.combindShadowAABBBounds(i,this),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||xi.graphicService.updateHTMLTextAABBBounds(t,e,i),Xt(i,i,this.transMatrix),i}updateWrapAABBBounds(t){var e,i,s,n;const r=this.getGraphicTheme(),{fontFamily:a=r.fontFamily,textAlign:o=r.textAlign,textBaseline:l=r.textBaseline,fontSize:h=r.fontSize,ellipsis:d=r.ellipsis,maxLineWidth:c,stroke:u=r.stroke,lineWidth:p=r.lineWidth,wordBreak:g=r.wordBreak,fontWeight:m=r.fontWeight,ignoreBuf:_=r.ignoreBuf,suffixPosition:f=r.suffixPosition,heightLimit:v=0,lineClamp:b}=this.attribute,x=null!==(e=gn(this.attribute.lineHeight,this.attribute.fontSize||r.fontSize))&&void 0!==e?e:this.attribute.fontSize||r.fontSize,S=_?0:2;if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),u&&this._AABBBounds.expand(p/2),this._AABBBounds}const M=xi.graphicUtil.textMeasure,k=new p_(a,{fontSize:h,fontWeight:m,fontFamily:a},M),A=y(t)?t.map((t=>t.toString())):[t.toString()],w=[],T=[0,0];let L=1/0;if(v>0&&(L=Math.max(Math.floor(v/x),1)),b&&(L=Math.min(L,b)),"number"==typeof c&&c!==1/0){if(c>0)for(let t=0;t{t=Math.max(t,e.width)})),T[0]=t}else{let t,e,i=0;for(let s=0,n=A.length;s{const e=t.direction===Tn.HORIZONTAL?u:r.measureTextWidth(t.text,{fontSize:u,fontWeight:p,fontFamily:g});a+=e,t.width=e})),this.cache.verticalList=S,this.cache.clipedWidth=a;this.clearUpdateShapeTag();const M=ea(b,a),k=ia(x,y,u);return this._AABBBounds.set(k,M,k+y,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}updateHorizontalMultilineAABBBounds(t){var e,i;const s=this.getGraphicTheme(),{wrap:n=s.wrap}=this.attribute;if(n)return this.updateWrapAABBBounds(t);const r=this.attribute,{fontFamily:a=s.fontFamily,textAlign:o=s.textAlign,textBaseline:l=s.textBaseline,fontSize:h=s.fontSize,fontWeight:d=s.fontWeight,ellipsis:c=s.ellipsis,maxLineWidth:u,stroke:p=s.stroke,lineWidth:g=s.lineWidth,whiteSpace:m=s.whiteSpace,suffixPosition:_=s.suffixPosition}=r,f=null!==(e=gn(r.lineHeight,r.fontSize||s.fontSize))&&void 0!==e?e:r.fontSize||s.fontSize;if("normal"===m)return this.updateWrapAABBBounds(t);if(!this.shouldUpdateShape()&&(null===(i=this.cache)||void 0===i?void 0:i.layoutData)){const t=this.cache.layoutData.bbox;return this._AABBBounds.set(t.xOffset,t.yOffset,t.xOffset+t.width,t.yOffset+t.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}const v=xi.graphicUtil.textMeasure,y=new p_(a,{fontSize:h,fontWeight:d,fontFamily:a},v).GetLayoutByLines(t,o,l,f,!0===c?s.ellipsis:c||void 0,!1,u,_),{bbox:b}=y;return this.cache.layoutData=y,this.clearUpdateShapeTag(),this._AABBBounds.set(b.xOffset,b.yOffset,b.xOffset+b.width,b.yOffset+b.height),p&&this._AABBBounds.expand(g/2),this._AABBBounds}updateVerticalMultilineAABBBounds(t){var e,i,s;const n=this.getGraphicTheme(),r=xi.graphicUtil.textMeasure;let a;const o=this.attribute,{ignoreBuf:l=n.ignoreBuf}=o,h=l?0:2,{maxLineWidth:d=n.maxLineWidth,ellipsis:c=n.ellipsis,fontFamily:u=n.fontFamily,fontSize:p=n.fontSize,fontWeight:g=n.fontWeight,stroke:m=n.stroke,lineWidth:_=n.lineWidth,verticalMode:f=n.verticalMode,suffixPosition:v=n.suffixPosition}=o,y=null!==(e=gn(o.lineHeight,o.fontSize||n.fontSize))&&void 0!==e?e:(o.fontSize||n.fontSize)+h;let{textAlign:b=n.textAlign,textBaseline:x=n.textBaseline}=o;if(!f){const t=b;b=null!==(i=m_.baselineMapAlign[x])&&void 0!==i?i:"left",x=null!==(s=m_.alignMapBaseline[t])&&void 0!==s?s:"top"}if(a=0,!this.shouldUpdateShape()&&this.cache){this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=ut(e,a)}));const t=ea(b,a),e=this.cache.verticalList.length*y,i=ia(x,e,p);return this._AABBBounds.set(i,t,i+e,t+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}const S=t.map((t=>Ln(t.toString())));S.forEach(((t,e)=>{if(Number.isFinite(d))if(c){const i=!0===c?n.ellipsis:c,s=r.clipTextWithSuffixVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,i,!1,v);S[e]=s.verticalList,a=s.width}else{const i=r.clipTextVertical(t,{fontSize:p,fontWeight:g,fontFamily:u},d,!1);S[e]=i.verticalList,a=i.width}else a=0,t.forEach((t=>{const e=t.direction===Tn.HORIZONTAL?p:r.measureTextWidth(t.text,{fontSize:p,fontWeight:g,fontFamily:u});a+=e,t.width=e}))})),this.cache.verticalList=S,this.clearUpdateShapeTag(),this.cache.verticalList.forEach((t=>{const e=t.reduce(((t,e)=>t+e.width),0);a=ut(e,a)}));const M=ea(b,a),k=this.cache.verticalList.length*y,A=ia(x,k,p);return this._AABBBounds.set(A,M,A+k,M+a),m&&this._AABBBounds.expand(_/2),this._AABBBounds}needUpdateTags(t,e=g_){return super.needUpdateTags(t,e)}needUpdateTag(t,e=g_){return super.needUpdateTag(t,e)}clone(){return new m_(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return m_.NOWORK_ANIMATE_ATTR}}function __(t){return new m_(t)}let f_,v_;function y_(t){return f_||(f_=ra.CreateGraphic("text",{})),f_.initAttributes(t),f_.AABBBounds}m_.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,direction:1,textAlign:1,textBaseline:1,fontFamily:1,fontWeight:1},Sn),m_.baselineMapAlign={top:"left",bottom:"right",middle:"center"},m_.alignMapBaseline={left:"top",right:"bottom",center:"middle"};const b_=new class extends po{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){var u,p,g,m,_,f,v,y,b,x;const{backgroundMode:S=l.backgroundMode,backgroundFit:M=l.backgroundFit}=t.attribute;let k,{background:A}=t.attribute;if(!A)return;const w=()=>{"richtext"===t.type&&(e.restore(),e.save(),k&&e.setTransformFromMatrix(k,!0,1))};let T;"richtext"===t.type&&(k=e.currentMatrix.clone(),e.restore(),e.save(),e.setTransformForCurrent());const L=vs(A)&&A.background,C=t.transMatrix.onlyTranslate();if(L){const e=t.AABBBounds,i=(null!==(u=A.x)&&void 0!==u?u:e.x1)+(null!==(p=A.dx)&&void 0!==p?p:0),s=(null!==(g=A.y)&&void 0!==g?g:e.y1)+(null!==(m=A.dy)&&void 0!==m?m:0),n=null!==(_=A.width)&&void 0!==_?_:e.width(),r=null!==(f=A.height)&&void 0!==f?f:e.height();if(T=Oa.allocate(i,s,i+n,s+r),A=A.background,!C){const t=T.width(),e=T.height();T.set((null!==(v=A.x)&&void 0!==v?v:0)+(null!==(y=A.dx)&&void 0!==y?y:0),(null!==(b=A.y)&&void 0!==b?b:0)+(null!==(x=A.dy)&&void 0!==x?x:0),t,e)}}else T=t.AABBBounds,C||(T=y_(Object.assign(Object.assign({},t.attribute),{angle:0,scaleX:1,scaleY:1,x:0,y:0,dx:0,dy:0})).clone());if(t.backgroundImg&&t.resources){const n=t.resources.get(A);if("success"!==n.state||!n.data)return void w();e.highPerformanceSave(),C&&e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.setCommonStyle(t,t.attribute,i,s,l),this.doDrawImage(e,n.data,T,S,M),e.highPerformanceRestore(),e.setTransformForCurrent()}else{const{backgroundCornerRadius:n}=t.attribute;e.highPerformanceSave(),e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=A,n?(Wa(e,T.x1,T.y1,T.width(),T.height(),n),e.fill()):e.fillRect(T.x1,T.y1,T.width(),T.height()),e.highPerformanceRestore()}L&&Oa.free(T),w()}};var x_=function(t,e){return function(i,s){e(i,s,t)}};let S_=class extends bo{constructor(t){super(),this.textRenderContribitions=t,this.numberType=$n,this.builtinContributions=[b_],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=ps(t,null==r?void 0:r.theme).text,{text:u,underline:p=c.underline,lineThrough:g=c.lineThrough,keepDirIn3d:m=c.keepDirIn3d,direction:_=c.direction,fontSize:f=c.fontSize,verticalMode:v=c.verticalMode,x:y=c.x,y:b=c.y}=t.attribute;let{textAlign:x=c.textAlign,textBaseline:S=c.textBaseline}=t.attribute;if(!v&&"vertical"===_){const e=x;x=null!==(l=t.getBaselineMapAlign()[S])&&void 0!==l?l:"left",S=null!==(h=t.getAlignMapBaseline()[e])&&void 0!==h?h:"top"}const M=null!==(d=gn(t.attribute.lineHeight,f))&&void 0!==d?d:f,k=this.valid(t,c,a,o);if(!k)return;const{fVisible:A,sVisible:w,doFill:T,doStroke:L}=k,C=!m,E=this.z||0;e.beginPath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,T,L,A,w,c,n,a,o),C&&this.transformUseContext2d(t,c,E,e);const D=(n,r,l,h)=>{let d=i+r;const u=s+l;if(h){e.highPerformanceSave(),d+=f;const t=Vr.allocate(1,0,0,1,0,0);t.rotateByCenter(Math.PI/2,d,u),e.transformFromMatrix(t,!0),Vr.free(t)}L&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),e.strokeText(n,d,u,E))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),e.fillText(n,d,u,E),this.drawUnderLine(p,g,t,d,u,E,c,e))),h&&(e.highPerformanceRestore(),e.setTransformForCurrent())};if(t.isMultiLine)if(e.setTextStyleWithoutAlignBaseline(t.attribute,c,E),"horizontal"===_){const{multilineLayout:n}=t;if(!n)return void e.highPerformanceRestore();const{xOffset:r,yOffset:l}=n.bbox;L&&(o?o(e,t.attribute,c):w&&(e.setStrokeStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((t=>{e.strokeText(t.str,(t.leftOffset||0)+r+i,(t.topOffset||0)+l+s,E)})))),T&&(a?a(e,t.attribute,c):A&&(e.setCommonStyle(t,t.attribute,y-i,b-s,c),n.lines.forEach((n=>{var a;e.fillText(n.str,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s,E),this.drawUnderLine(p,g,t,(n.leftOffset||0)+r+i,(n.topOffset||0)+l+s-(a=f,"top"=="bottom"?Math.ceil(.79*a):Math.round(-.21*a))-.05*f,E,c,e,{width:n.width})}))))}else{t.tryUpdateAABBBounds();const i=t.cache,{verticalList:s}=i;e.textAlign="left",e.textBaseline="top";const n=M*s.length;let r=0;s.forEach((t=>{const e=t.reduce(((t,e)=>t+(e.width||0)),0);r=ut(e,r)}));let a=0,o=0;"bottom"===S?o=-n:"middle"===S&&(o=-n/2),"center"===x?a-=r/2:"right"===x&&(a-=r),s.forEach(((t,e)=>{const i=t.reduce(((t,e)=>t+(e.width||0)),0),s=r-i;let l=a;"center"===x?l+=s/2:"right"===x&&(l+=s),t.forEach((t=>{const{text:i,width:s,direction:r}=t;D(i,n-(e+1)*M+o,l,r),l+=s}))}))}else if("horizontal"===_){e.setTextStyle(t.attribute,c,E);const i=t.clipedText;let s=0;M!==f&&("top"===S?s=(M-f)/2:"middle"===S||"bottom"===S&&(s=-(M-f)/2)),D(i,0,s,0)}else{t.tryUpdateAABBBounds();const i=t.cache;if(i){e.setTextStyleWithoutAlignBaseline(t.attribute,c,E);const{verticalList:s}=i;let n=0;const r=s[0].reduce(((t,e)=>t+(e.width||0)),0);let a=0;"bottom"===S?a=-M:"middle"===S&&(a=-M/2),"center"===x?n-=r/2:"right"===x&&(n-=r),e.textAlign="left",e.textBaseline="top",s[0].forEach((t=>{const{text:e,width:i,direction:s}=t;D(e,a,n,s),n+=i}))}}C&&this.restoreTransformUseContext2d(t,c,E,e),this.afterRenderStep(t,e,i,s,T,L,A,w,c,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).text,{keepDirIn3d:r=n.keepDirIn3d}=t.attribute,a=!r;this._draw(t,n,a,i,s)}drawUnderLine(t,e,i,s,n,r,a,o,l){if(e+t<=0)return;const{textAlign:h=a.textAlign,textBaseline:d=a.textBaseline,fontSize:c=a.fontSize,fill:u=a.fill,opacity:p=a.opacity,underlineOffset:g=a.underlineOffset,underlineDash:m=a.underlineDash,fillOpacity:_=a.fillOpacity}=i.attribute,f=!D(l),v=f?l.width:i.clipedWidth,y=f?0:ea(h,v),b=ia(f?"alphabetic":d,c,c),x={lineWidth:0,stroke:u,opacity:p,strokeOpacity:_};let S=f?-3:0;if(t){x.lineWidth=t,o.setStrokeStyle(i,x,s,n,a),m&&o.setLineDash(m),o.beginPath();const e=n+b+c+g+S;o.moveTo(s+y,e,r),o.lineTo(s+y+v,e,r),o.stroke()}if(f&&(S=-1),e){x.lineWidth=e,o.setStrokeStyle(i,x,s,n,a),o.beginPath();const t=n+b+c/2+S;o.moveTo(s+y,t,r),o.lineTo(s+y+v,t,r),o.stroke()}}};S_=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),x_(0,$(K)),x_(0,X(ho)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],S_);let M_=!1;const k_=new B((t=>{M_||(M_=!0,t(kr).to(S_).inSingletonScope(),t(_r).toService(kr),t(ho).toService(mo),Z(t,ho))})),A_=ol(),w_=Symbol.for("MathPickerContribution"),T_=Symbol.for("MathArcPicker"),L_=Symbol.for("MathAreaPicker"),C_=Symbol.for("MathCirclePicker"),E_=Symbol.for("MathImagePicker"),D_=Symbol.for("MathLinePicker"),P_=Symbol.for("MathPathPicker"),O_=Symbol.for("MathRectPicker"),R_=Symbol.for("MathSymbolPicker"),I_=Symbol.for("MathTextPicker"),B_=Symbol.for("MathPolygonPicker"),F_=Symbol.for("MathGlyphPicker"),Y_=Symbol.for("CanvasArcPicker"),j_=Symbol.for("CanvasArc3dPicker"),H_=Symbol.for("CanvasAreaPicker"),z_=Symbol.for("CanvasCirclePicker"),N_=Symbol.for("CanvasImagePicker"),V_=Symbol.for("CanvasLinePicker"),W_=Symbol.for("CanvasPathPicker"),G_=Symbol.for("CanvasRectPicker"),U_=Symbol.for("CanvasRect3dPicker"),$_=Symbol.for("CanvasSymbolPicker"),X_=Symbol.for("CanvasTextPicker"),K_=Symbol.for("CanvasPolygonPicker"),q_=Symbol.for("CanvasPyramid3dPicker"),Z_=Symbol.for("CanvasRichTextPicker"),J_=Symbol.for("CanvasGlyphPicker"),Q_=Symbol.for("CanvasGroupPicker"),tf=Symbol.for("CanvasPickerContribution");class ef extends bo{contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();const r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=e;if(s.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,i,null,((t,e,i)=>!!c||(c=t.isPointInPath(d.x,d.y),c))),this.canvasRenderer.z=0,s.modelMatrix!==h&&Wr.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let sf=class extends ef{constructor(t){super(),this.canvasRenderer=t,this.type="text",this.numberType=$n}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.AABBBounds;if(!s.camera)return!!n.containsPoint(e);s.highPerformanceSave();const r=t.getGraphicTheme(),{keepDirIn3d:a=r.keepDirIn3d}=t.attribute,o=!a,l=this.transform(t,r,s,o),{x:h,y:d,z:c,lastModelMatrix:u}=l;this.canvasRenderer.z=c;let p=e;if(s.camera){p=e.clone();const i=t.parent.globalTransMatrix;p.x=i.a*e.x+i.c*e.y+i.e,p.y=i.b*e.x+i.d*e.y+i.f}let g=!1;return this.canvasRenderer.drawShape(t,s,h,d,{},null,((e,i,s)=>{if(g)return!0;const{fontSize:n=r.fontSize,textBaseline:a=r.textBaseline,textAlign:o=r.textAlign}=t.attribute,l=t.AABBBounds,u=l.height(),m=l.width(),_=ia(a,u,n),f=ea(o,m);return e.rect(f+h,_+d,m,u,c),g=e.isPointInPath(p.x,p.y),g}),((t,e,i)=>g)),this.canvasRenderer.z=0,s.modelMatrix!==u&&Wr.free(s.modelMatrix),s.modelMatrix=u,s.highPerformanceRestore(),g}};sf=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(kr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],sf);let nf=!1;const rf=new B(((t,e,i,s)=>{nf||(nf=!0,t(X_).to(sf).inSingletonScope(),t(tf).toService(X_))}));let af=class{constructor(){this.type="text",this.numberType=$n}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};af=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],af);let of=!1;const lf=new B(((t,e,i,s)=>{of||(of=!0,t(I_).to(af).inSingletonScope(),t(w_).toService(I_))}));function hf(){hf.__loaded||(hf.__loaded=!0,ra.RegisterGraphicCreator("text",__),Ui.load(k_),Ui.load(A_?rf:lf))}hf.__loaded=!1;const df=hf;class cf{bounds(t,e){if(h(t)){const i=t/2;e.x1=-i,e.x2=i,e.y1=-i,e.y2=i}else e.x1=-t[0]/2,e.x2=t[0]/2,e.y1=-t[1]/2,e.y2=t[1]/2}}function uf(t,e,i,s,n){return n?t.arc(i,s,e,0,ot,!1,n):t.arc(i,s,e,0,ot),!1}const pf=new class extends cf{constructor(){super(...arguments),this.type="circle",this.pathStr="M0.5,0A0.5,0.5,0,1,1,-0.5,0A0.5,0.5,0,1,1,0.5,0"}draw(t,e,i,s,n){return uf(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return uf(t,e/2+n,i,s,r)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i} a ${n},${n} 0 1,0 ${2*n},0 a ${n},${n} 0 1,0 -${2*n},0`}},gf=new class extends cf{constructor(){super(...arguments),this.type="cross",this.pathStr="M-0.5,-0.2L-0.5,0.2L-0.2,0.2L-0.2,0.5L0.2,0.5L0.2,0.2L0.5,0.2L0.5,-0.2L0.2,-0.2L0.2,-0.5L-0.2,-0.5L-0.2,-0.2Z"}draw(t,e,i,s,n){return function(t,e,i,s,n){return t.moveTo(-3*e+i,-e+s,n),t.lineTo(-e+i,-e+s,n),t.lineTo(-e+i,-3*e+s,n),t.lineTo(e+i,-3*e+s,n),t.lineTo(e+i,-e+s,n),t.lineTo(3*e+i,-e+s,n),t.lineTo(3*e+i,e+s,n),t.lineTo(e+i,e+s,n),t.lineTo(e+i,3*e+s,n),t.lineTo(-e+i,3*e+s,n),t.lineTo(-e+i,e+s,n),t.lineTo(-3*e+i,e+s,n),t.closePath(),!0}(t,e/6,i,s,n)}drawOffset(t,e,i,s,n,r){return function(t,e,i,s,n,r){return t.moveTo(-3*e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-e+s-n,r),t.lineTo(-e+i-n,-3*e+s-n,r),t.lineTo(e+i+n,-3*e+s-n,r),t.lineTo(e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,-e+s-n,r),t.lineTo(3*e+i+n,e+s+n,r),t.lineTo(e+i+n,e+s+n,r),t.lineTo(e+i+n,3*e+s+n,r),t.lineTo(-e+i-n,3*e+s+n,r),t.lineTo(-e+i-n,e+s+n,r),t.lineTo(-3*e+i-n,e+s+n,r),t.closePath(),!0}(t,e/6,i,s,n,r)}};function mf(t,e,i,s,n){return t.moveTo(i,s-e,n),t.lineTo(e+i,s,n),t.lineTo(i,s+e,n),t.lineTo(i-e,s,n),t.closePath(),!0}const _f=new class extends cf{constructor(){super(...arguments),this.type="diamond",this.pathStr="M-0.5,0L0,-0.5L0.5,0L0,0.5Z"}draw(t,e,i,s,n){return mf(t,e/2,i,s,n)}drawFitDir(t,e,i,s,n){return mf(t,e/2,i,s,n)}drawOffset(t,e,i,s,n,r){return mf(t,e/2+n,i,s,r)}};function ff(t,e,i,s){const n=2*e;return t.rect(i-e,s-e,n,n),!1}const vf=new class extends cf{constructor(){super(...arguments),this.type="square",this.pathStr="M-0.5,-0.5h1v1h-1Z"}draw(t,e,i,s){return ff(t,e/2,i,s)}drawOffset(t,e,i,s,n){return ff(t,e/2+n,i,s)}};function yf(t,e,i,s,n=0){return t.moveTo(i+e+2*n,e+s+n),t.lineTo(i-e-2*n,e+s+n),t.lineTo(i,s-e-2*n),t.closePath(),!0}class bf extends cf{constructor(){super(...arguments),this.type="triangleUp",this.pathStr="M0.5,0.5 L-0.5,0.5 L0,-0.5 Z"}draw(t,e,i,s){return yf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return yf(t,e/2,i,s,n)}}const xf=new bf,Sf=new class extends bf{constructor(){super(...arguments),this.type="triangle"}},Mf=Math.sin(Math.PI/10)/Math.sin(7*Math.PI/10),kf=Math.sin(ot/10)*Mf,Af=-Math.cos(ot/10)*Mf;function wf(t,e,i,s){const n=kf*e,r=Af*e;t.moveTo(i,-e+s),t.lineTo(n+i,r+s);for(let a=1;a<5;++a){const o=ot*a/5,l=Math.cos(o),h=Math.sin(o);t.lineTo(h*e+i,-l*e+s),t.lineTo(l*n-h*r+i,h*n+l*r+s)}return t.closePath(),!0}const Tf=new class extends cf{constructor(){super(...arguments),this.type="star",this.pathStr="M0 -1L0.22451398828979266 -0.3090169943749474L0.9510565162951535 -0.30901699437494745L0.3632712640026804 0.1180339887498948L0.5877852522924732 0.8090169943749473L8.326672684688674e-17 0.3819660112501051L-0.587785252292473 0.8090169943749476L-0.3632712640026804 0.11803398874989487L-0.9510565162951536 -0.30901699437494723L-0.22451398828979274 -0.30901699437494734Z"}draw(t,e,i,s){return wf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return wf(t,e/2+n,i,s)}},Lf=mt(3);function Cf(t,e,i,s){const n=e,r=n/Lf,a=r/5,o=e;return t.moveTo(0+i,-n+s),t.lineTo(r/2+i,s),t.lineTo(a/2+i,s),t.lineTo(a/2+i,o+s),t.lineTo(-a/2+i,o+s),t.lineTo(-a/2+i,s),t.lineTo(-r/2+i,s),t.closePath(),!0}const Ef=new class extends cf{constructor(){super(...arguments),this.type="arrow",this.pathStr="M-0.07142857142857142,0.5L0.07142857142857142,0.5L0.07142857142857142,-0.0625L0.2,-0.0625L0,-0.5L-0.2,-0.0625L-0.07142857142857142,-0.0625Z"}draw(t,e,i,s){return Cf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Cf(t,e/2+n,i,s)}};function Df(t,e,i,s){const n=2*e;return t.moveTo(i,-e+s),t.lineTo(n/3/2+i,e+s),t.lineTo(-n/3/2+i,e+s),t.closePath(),!0}const Pf=new class extends cf{constructor(){super(...arguments),this.type="wedge",this.pathStr="M0,-0.5773502691896257L-0.125,0.28867513459481287L0.125,0.28867513459481287Z"}draw(t,e,i,s){return Df(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Df(t,e/2+n,i,s)}};function Of(t,e,i,s){return t.moveTo(-e+i,s),t.lineTo(i,e+s),!1}const Rf=new class extends cf{constructor(){super(...arguments),this.type="stroke",this.pathStr=""}draw(t,e,i,s){return Of(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Of(t,e/2+n,i,s)}},If=-.5,Bf=mt(3)/2,Ff=1/mt(12);function Yf(t,e,i,s){const n=e/2,r=e*Ff,a=n,o=e*Ff+e,l=-a,h=o;return t.moveTo(n+i,r+s),t.lineTo(a+i,o+s),t.lineTo(l+i,h+s),t.lineTo(If*n-Bf*r+i,Bf*n+If*r+s),t.lineTo(If*a-Bf*o+i,Bf*a+If*o+s),t.lineTo(If*l-Bf*h+i,Bf*l+If*h+s),t.lineTo(If*n+Bf*r+i,If*r-Bf*n+s),t.lineTo(If*a+Bf*o+i,If*o-Bf*a+s),t.lineTo(If*l+Bf*h+i,If*h-Bf*l+s),t.closePath(),!1}const jf=new class extends cf{constructor(){super(...arguments),this.type="wye",this.pathStr="M0.25 0.14433756729740646L0.25 0.6443375672974064L-0.25 0.6443375672974064L-0.25 0.14433756729740643L-0.6830127018922193 -0.10566243270259357L-0.4330127018922193 -0.5386751345948129L0 -0.28867513459481287L0.4330127018922193 -0.5386751345948129L0.6830127018922193 -0.10566243270259357Z"}draw(t,e,i,s){return Yf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Yf(t,e/2+n,i,s)}};function Hf(t,e,i,s,n){return t.moveTo(-e+i-2*n,s),t.lineTo(e+i+n,e+s+2*n),t.lineTo(e+i+n,s-e-2*n),t.closePath(),!0}const zf=new class extends cf{constructor(){super(...arguments),this.type="triangleLeft",this.pathStr="M-0.5,0 L0.5,0.5 L0.5,-0.5 Z"}draw(t,e,i,s){return Hf(t,e/2,i,s,0)}drawOffset(t,e,i,s,n){return Hf(t,e/2,i,s,n)}};function Nf(t,e,i,s,n=0){return t.moveTo(i-e-n,e+s+2*n),t.lineTo(e+i+2*n,s),t.lineTo(i-e-n,s-e-2*n),t.closePath(),!0}const Vf=new class extends cf{constructor(){super(...arguments),this.type="triangleRight",this.pathStr="M-0.5,0.5 L0.5,0 L-0.5,-0.5 Z"}draw(t,e,i,s){return Nf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Nf(t,e/2,i,s,n)}};function Wf(t,e,i,s,n=0){return t.moveTo(i-e-2*n,s-e-n),t.lineTo(i+e+2*n,s-e-n),t.lineTo(i,s+e+2*n),t.closePath(),!0}const Gf=new class extends cf{constructor(){super(...arguments),this.type="triangleDown",this.pathStr="M-0.5,-0.5 L0.5,-0.5 L0,0.5 Z"}draw(t,e,i,s){return Wf(t,e/2,i,s)}drawOffset(t,e,i,s,n){return Wf(t,e/2,i,s,n)}},Uf=mt(3);function $f(t,e,i,s){const n=e*Uf;return t.moveTo(i,s+-n/3*2),t.lineTo(e+i,s+n),t.lineTo(i-e,s+n),t.closePath(),!0}const Xf=new class extends cf{constructor(){super(...arguments),this.type="thinTriangle",this.pathStr="M0,-0.5773502691896257L-0.5,0.28867513459481287L0.5,0.28867513459481287Z"}draw(t,e,i,s){return $f(t,e/2/Uf,i,s)}drawOffset(t,e,i,s,n){return $f(t,e/2/Uf+n,i,s)}};function Kf(t,e,i,s){const n=2*e;return t.moveTo(e+i,s-n),t.lineTo(i-e,s),t.lineTo(e+i,n+s),!0}const qf=new class extends cf{constructor(){super(...arguments),this.type="arrow2Left",this.pathStr="M 0.25 -0.5 L -0.25 0 l 0.25 0.5"}draw(t,e,i,s){return Kf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Kf(t,e/4+n,i,s)}};function Zf(t,e,i,s){const n=2*e;return t.moveTo(i-e,s-n),t.lineTo(i+e,s),t.lineTo(i-e,n+s),!0}const Jf=new class extends cf{constructor(){super(...arguments),this.type="arrow2Right",this.pathStr="M -0.25 -0.5 l 0.25 0 l -0.25 0.5"}draw(t,e,i,s){return Zf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Zf(t,e/4+n,i,s)}};function Qf(t,e,i,s){const n=2*e;return t.moveTo(i-n,s+e),t.lineTo(i,s-e),t.lineTo(i+n,s+e),!0}const tv=new class extends cf{constructor(){super(...arguments),this.type="arrow2Up",this.pathStr="M -0.5 0.25 L 0 -0.25 l 0.5 0.25"}draw(t,e,i,s){return Qf(t,e/4,i,s)}drawOffset(t,e,i,s,n){return Qf(t,e/4+n,i,s)}};function ev(t,e,i,s){const n=2*e;return t.moveTo(i-n,s-e),t.lineTo(i,s+e),t.lineTo(i+n,s-e),!0}const iv=new class extends cf{constructor(){super(...arguments),this.type="arrow2Down",this.pathStr="M -0.5 -0.25 L 0 0.25 l 0.5 -0.25"}draw(t,e,i,s){return ev(t,e/4,i,s)}drawOffset(t,e,i,s,n){return ev(t,e/4+n,i,s)}};function sv(t,e,i,s,n){return t.moveTo(i,s-e),t.lineTo(i,s+e),!0}const nv=new class extends cf{constructor(){super(...arguments),this.type="lineV",this.pathStr="M0,-0.5L0,0.5"}draw(t,e,i,s,n){return sv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return sv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e}, ${i-n} L ${e},${i+n}`}};function rv(t,e,i,s,n){return t.moveTo(i-e,s),t.lineTo(i+e,s),!0}const av=new class extends cf{constructor(){super(...arguments),this.type="lineH",this.pathStr="M-0.5,0L0.5,0"}draw(t,e,i,s,n){return rv(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return rv(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i} L ${e+n},${i}`}};function ov(t,e,i,s,n){return t.moveTo(i-e,s-e),t.lineTo(i+e,s+e),t.moveTo(i+e,s-e),t.lineTo(i-e,s+e),!0}const lv=new class extends cf{constructor(){super(...arguments),this.type="close",this.pathStr="M-0.5,-0.5L0.5,0.5,M0.5,-0.5L-0.5,0.5"}draw(t,e,i,s,n){return ov(t,e/2,i,s)}drawOffset(t,e,i,s,n,r){return ov(t,e/2+n,i,s)}drawToSvgPath(t,e,i,s){const n=t/2;return`M ${e-n}, ${i-n} L ${e+n},${i+n} M ${e+n}, ${i-n} L ${e-n},${i+n}`}};function hv(t,e,i,s){return t.rect(i-e[0]/2,s-e[1]/2,e[0],e[1]),!1}function dv(t,e,i,s){const n=e,r=e/2;return t.rect(i-n/2,s-r/2,n,r),!1}const cv=new class extends cf{constructor(){super(...arguments),this.type="rect",this.pathStr="M -0.5,0.25 L 0.5,0.25 L 0.5,-0.25,L -0.5,-0.25 Z"}draw(t,e,i,s){return h(e)?dv(t,e,i,s):hv(t,e,i,s)}drawOffset(t,e,i,s,n){return h(e)?dv(t,e+2*n,i,s):hv(t,[e[0]+2*n,e[1]+2*n],i,s)}},uv={};[pf,gf,_f,vf,Xf,Sf,Tf,Ef,Pf,Rf,jf,zf,Vf,xf,Gf,qf,Jf,tv,iv,cv,nv,av,lv].forEach((t=>{uv[t.type]=t}));const pv={arrowLeft:"M 0.25 -0.5 L -0.25 0 l 0.5 0.5",arrowRight:"M -0.25 -0.5 l 0.5 0.5 l -0.5 0.5",rectRound:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",roundLine:"M 1.2392 -0.258 L -1.3432 -0.258 C -1.4784 -0.258 -1.588 -0.1436 -1.588 -0.002 c 0 0.1416 0.1096 0.256 0.2448 0.256 l 2.5824 0 c 0.1352 0 0.2448 -0.1144 0.2448 -0.256 C 1.484 -0.1436 1.3744 -0.258 1.2392 -0.258 z"},gv=new qt;class mv{constructor(t,e,i=!1){this.pathStr="",this.type=t,y(e)?this.svgCache=e:this.path=e,this.isSvg=i}drawOffset(t,e,i,s,n,r,a){return this.isSvg?!!this.svgCache&&(this.svgCache.forEach((n=>{t.beginPath(),ve(n.path.commandList,t,i,s,e,e),a&&a(n.path,n.attribute)})),!1):(ve(this.path.commandList,t,i,s,e+n,e+n),!1)}draw(t,e,i,s,n,r){return this.drawOffset(t,e,i,s,0,n,r)}bounds(t,e){if(this.isSvg){if(!this.svgCache)return;return e.clear(),void this.svgCache.forEach((({path:i})=>{gv.x1=i.bounds.x1*t,gv.y1=i.bounds.y1*t,gv.x2=i.bounds.x2*t,gv.y2=i.bounds.y2*t,e.union(gv)}))}this.path.bounds&&(e.x1=this.path.bounds.x1*t,e.y1=this.path.bounds.y1*t,e.x2=this.path.bounds.x2*t,e.y2=this.path.bounds.y2*t)}}class _v{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,e){"__proto__"===t&&(t="#__proto__"),this.child.push({[t]:e})}addChild(t){"__proto__"===t.tagname&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}function fv(t,e,i,s){const n=t.indexOf(e,i);if(-1===n)throw new Error(s);return n+e.length-1}function vv(t,e,i,s=">"){const n=function(t,e,i=">"){let s,n="";for(let r=e;r",r,"Closing Tag is not closed."),a=n.lastIndexOf(".");n=n.substring(0,a),i=this.tagsNodeStack.pop(),i&&i.child&&s&&i.child[i.child.length-1][":@"]&&(i.child[i.child.length-1][":@"].text=s),s="",r=e}else if("?"===t[r+1])r=vv(t,r,!1,"?>").closeIndex+1;else if("!--"===t.substr(r+1,3))r=fv(t,"--\x3e",r+4,"Comment is not closed.");else{const a=vv(t,r,!1);let o=a.tagName,l=a.tagExp;const h=a.attrExpPresent,d=a.closeIndex;if(o!==e.tagname&&(n+=n?"."+o:o),l.length>0&&l.lastIndexOf("/")===l.length-1){"/"===o[o.length-1]?(o=o.substr(0,o.length-1),n=n.substr(0,n.length-1),l=o):l=l.substr(0,l.length-1);const t=new _v(o);o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),n=n.substr(0,n.lastIndexOf("."))}else{const t=new _v(o);this.tagsNodeStack.push(i),o!==l&&h&&(t[":@"]=this.buildAttributesMap(l,n,o)),this.addChild(i,t,n),i=t}s="",r=d}else s+=t[r];return e.child}}function xv(t,e){return Sv(t)}function Sv(t,e){const i={};for(let n=0;n{const e=(new qe).fromString(t.d),i={};Zn.forEach((e=>{t[e]&&(i[qn[e]]=t[e])})),n.push({path:e,attribute:i}),wv.union(e.bounds)}));const r=wv.width(),a=wv.height(),o=1/ut(r,a);return n.forEach((t=>t.path.transform(0,0,o,o))),this._parsedPath=new mv(e,n,!0),Lv.userSymbolMap[e]=this._parsedPath,this._parsedPath}var s;const n=(new qe).fromString(e),r=n.bounds.width(),a=n.bounds.height(),o=1/ut(r,a);return n.transform(0,0,o,o),this._parsedPath=new mv(e,n),Lv.userSymbolMap[e]=this._parsedPath,this._parsedPath}getGraphicTheme(){return ps(this).symbol}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateSymbolAABBBoundsImprecise(t,e,i):this.updateSymbolAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=xi.graphicService.updateTempAABBBounds(i);((t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur,strokeBoundsBuffer:r=e.strokeBoundsBuffer}=t;if(s){const t=e.outerBorder,{distance:a=t.distance,lineWidth:o=t.lineWidth}=s;kn(i,a+(n+o)/2,!0,r)}})(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return xi.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateSymbolAABBBoundsImprecise(t,e,i){const{size:s=e.size}=t;if(y(s))i.set(-s[0]/2,-s[1]/2,s[0]/2,s[1]/2);else{const t=s/2;i.set(-t,-t,t,t)}return i}updateSymbolAABBBoundsAccurate(t,e,i){const{size:s=e.size}=t;return this.getParsedPath().bounds(s,i),i}needUpdateTags(t){return super.needUpdateTags(t,Tv)}needUpdateTag(t){return super.needUpdateTag(t,Tv)}toCustomPath(){const t=this.getParsedPath(),e=this.attribute.size,i=y(e)?e:[e,e];return t.path?(new qe).fromCustomPath2D(t.path,0,0,i[0],i[1]):(new qe).fromString(t.pathStr,0,0,i[0],i[1])}clone(){return new Lv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Lv.NOWORK_ANIMATE_ATTR}}function Cv(t){return new Lv(t)}Lv.userSymbolMap={},Lv.NOWORK_ANIMATE_ATTR=Object.assign({symbolType:1},Sn);const Ev=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const u=t.getParsedPath();if(!u)return;const{outerBorder:p,innerBorder:g}=t.attribute,m=p&&!1!==p.visible,_=g&&!1!==g.visible;if(!m&&!_)return;const{size:f=l.size,opacity:v=l.opacity,x:y=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY}=t.attribute,M=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Da(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),!1===u.drawOffset(e,f,i,s,d*h)&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=v,e.setStrokeStyle(t,n,(y-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};m&&M(p,"outerBorder"),_&&M(g,"innerBorder")}},Dv=Co,Pv=go;var Ov=function(t,e){return function(i,s){e(i,s,t)}};let Rv=class extends bo{constructor(t){super(),this.symbolRenderContribitions=t,this.numberType=Un,this.builtinContributions=[Ev,Pv,Dv],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=ps(t,null==r?void 0:r.theme).symbol,{size:d=h.size,x:c=h.x,y:u=h.y,scaleX:p=h.scaleX,scaleY:g=h.scaleY}=t.attribute,m=this.valid(t,h,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:b}=m,x=t.getParsedPath();if(!x)return;const{keepDirIn3d:S=h.keepDirIn3d}=t.attribute,M=null!==(l=this.z)&&void 0!==l?l:0;e.beginPath();const k=(n,r)=>{var l,d,m;if(t._parsedPath.svgCache){const e=Object.assign({},r);e.fill=null!==(l=r.fill)&&void 0!==l?l:t.attribute.fill,e.opacity=null!==(d=r.opacity)&&void 0!==d?d:t.attribute.opacity,e.fillOpacity=t.attribute.fillOpacity,e.stroke=null!==(m=r.stroke)&&void 0!==m?m:t.attribute.stroke,r=e}r.fill&&(a?a(e,t.attribute,h):(e.setCommonStyle(t,r,c-i,u-s,h),e.fill())),r.stroke&&(o?o(e,t.attribute,h):(e.setStrokeStyle(t,r,(c-i)/p,(u-s)/g,h),e.stroke()))};if(S&&e.camera&&e.project){const t=e.project(i,s,M),n=e.camera;e.camera=null,!1===x.draw(e,y(d)?[d[0]*p,d[1]*g]:d*p,t.x,t.y,void 0,k)&&e.closePath(),e.camera=n}else!1===x.draw(e,d,i,s,M,k)&&e.closePath();e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,v,b,_,f,h,n,a,o),v&&!x.isSvg&&(a?a(e,t.attribute,h):_&&(e.setCommonStyle(t,t.attribute,c-i,u-s,h),e.fill())),b&&!x.isSvg&&(o?o(e,t.attribute,h):f&&(e.setStrokeStyle(t,t.attribute,(c-i)/p,(u-s)/g,h),e.stroke())),this.afterRenderStep(t,e,i,s,v,b,_,f,h,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).symbol;this._draw(t,n,!1,i,s)}};Rv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Ov(0,$(K)),Ov(0,X(lo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Rv);let Iv=!1;const Bv=new B((t=>{Iv||(Iv=!0,t(Rv).toSelf().inSingletonScope(),t(Mr).to(Rv).inSingletonScope(),t(_r).toService(Mr),t(lo).toService(mo),Z(t,lo))}));let Fv=class extends ef{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Un}contains(t,e,i){const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getParsedPath();if(!s.camera){if(!t.AABBBounds.containsPoint(e))return!1;if(n.isSvg||"imprecise"===t.attribute.pickMode)return!0}s.highPerformanceSave();const r=t.getGraphicTheme(),a=this.transform(t,r,s),{x:o,y:l,z:h,lastModelMatrix:d}=a;let c=e;if(s.camera){c=e.clone();const i=t.parent.globalTransMatrix;c.x=i.a*e.x+i.c*e.y+i.e,c.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=h;let u=!1;return this.canvasRenderer.drawShape(t,s,o,l,{},null,((t,e,i)=>!!u||(u=t.isPointInPath(c.x,c.y),u)),((t,e,i)=>{if(u)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=Da(s,n+r,s.dpr),u=t.isPointInStroke(c.x,c.y),u})),this.canvasRenderer.z=0,s.modelMatrix!==d&&Wr.free(s.modelMatrix),s.modelMatrix=d,s.highPerformanceRestore(),u}};Fv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Fv);let Yv=!1;const jv=new B(((t,e,i,s)=>{Yv||(Yv=!0,t($_).to(Fv).inSingletonScope(),t(tf).toService($_))}));class Hv{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme();s.highPerformanceSave();let{x:r=n.x,y:a=n.y}=t.attribute;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);r+=e.x,a+=e.y,s.setTransformForCurrent()}else r=0,a=0,s.transformFromMatrix(t.transMatrix,!0);let o=!1;return this.canvasRenderer.drawShape(t,s,r,a,{},null,((t,i,s)=>!!o||(o=t.isPointInPath(e.x,e.y),o)),((t,i,n)=>{if(o)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return s.lineWidth=Da(s,r+a,s.dpr),o=t.isPointInStroke(e.x,e.y),o})),s.highPerformanceRestore(),o}}let zv=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="symbol",this.numberType=Un}};zv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],zv);let Nv=!1;const Vv=new B(((t,e,i,s)=>{Nv||(Nv=!0,t(R_).to(zv).inSingletonScope(),t(w_).toService(R_))}));function Wv(){Wv.__loaded||(Wv.__loaded=!0,ra.RegisterGraphicCreator("symbol",Cv),Ui.load(Bv),Ui.load(A_?jv:Vv))}Wv.__loaded=!1;const Gv=Wv,Uv=(t,e,i)=>{const{outerBorder:s,shadowBlur:n=e.shadowBlur}=t;if(s){const t=e.outerBorder,{distance:r=t.distance,lineWidth:a=t.lineWidth}=s;i.expand(r+(n+a)/2)}return i},$v=["width","x1","y1","height","cornerRadius",...fn];class Xv extends Mn{constructor(t){super(t),this.type="rect",this.numberType=Vn}isValid(){return super.isValid()&&this._isValid()}_isValid(){return!0}getGraphicTheme(){return ps(this).rect}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){let{width:e,height:s}=t;const{x1:n,y1:r,x:a,y:o}=t;e=null!=e?e:n-a,s=null!=s?s:r-o,(isFinite(e)||isFinite(s)||isFinite(a)||isFinite(o))&&i.set(0,0,e||0,s||0)}const{tb1:s,tb2:n}=xi.graphicService.updateTempAABBBounds(i);return Uv(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),xi.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,$v)}needUpdateTag(t){return super.needUpdateTag(t,$v)}toCustomPath(){const t=this.attribute,{x:e,y:i,width:s,height:n}=(t=>{if(!t)return{x:0,y:0,width:0,height:0};let e=D(t.width)?t.x1-t.x:t.width,i=D(t.height)?t.y1-t.y:t.height,s=0,n=0;return e<0?(s=e,e=-e):Number.isNaN(e)&&(e=0),i<0?(n=i,i=-i):Number.isNaN(i)&&(i=0),{x:s,y:n,width:e,height:i}})(t),r=new qe;return r.moveTo(e,i),r.rect(e,i,s,n),r}clone(){return new Xv(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return Xv.NOWORK_ANIMATE_ATTR}}function Kv(t){return new Xv(t)}Xv.NOWORK_ANIMATE_ATTR=Sn;var qv=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class Zv{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{cornerRadius:_=l.cornerRadius,opacity:f=l.opacity,x:v=l.x,y:b=l.y,scaleX:x=l.scaleX,scaleY:S=l.scaleY,x1:M,y1:k}=t.attribute;let{width:A,height:w}=t.attribute;A=(null!=A?A:M-i)||0,w=(null!=w?w:k-s)||0;const T=(n,r)=>{const a=!(!n||!n.stroke),o="outerBorder"===r?-1:1,{distance:h=l[r].distance}=n,d=Da(e,h,e.dpr),u=i+o*d,p=s+o*d,g=2*d;if(0===_||y(_)&&_.every((t=>0===t))?(e.beginPath(),e.rect(u,p,A-o*g,w-o*g)):(e.beginPath(),Wa(e,u,p,A-o*g,w-o*g,_)),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=f,e.setStrokeStyle(t,n,(v-i)/x,(b-s)/S,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder")}}let Jv=class{constructor(){this.time=ge.beforeFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c,u){const{stroke:p=l.stroke}=t.attribute;Array.isArray(p)&&p.some((t=>!1===t))&&(u.doStroke=!1)}};Jv=qv([V()],Jv);let Qv=class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{x1:u,y1:p,x:g=l.x,y:m=l.y,stroke:_=l.stroke,cornerRadius:f=l.cornerRadius}=t.attribute;let{width:v,height:b}=t.attribute;if(v=(null!=v?v:u-g)||0,b=(null!=b?b:p-m)||0,Array.isArray(_)&&_.some((t=>!1===t))){if(e.setStrokeStyle(t,t.attribute,i,s,l),!(0===f||y(f)&&f.every((t=>0===t)))){let n,r=0;return Wa(e,i,s,v,b,f,new Array(4).fill(0).map(((a,o)=>(a,h,d,c)=>{_[o]&&(r===o-1&&_[o]===n||(e.setStrokeStyle(t,Object.assign(Object.assign({},t.attribute),{stroke:_[o]}),i,s,l),e.beginPath(),e.moveTo(a,h),n=_[o]),r=o,e.lineTo(d,c),e.stroke(),3===o&&e.beginPath())}))),void e.stroke()}if(e.beginPath(),e.moveTo(i,s),_[0]?e.lineTo(i+v,s):e.moveTo(i+v,s),_[1]?e.lineTo(i+v,s+b):e.moveTo(i+v,s+b),_[2]?e.lineTo(i,s+b):e.moveTo(i,s+b),_[3]){const t=_[0]?s-e.lineWidth/2:s;e.lineTo(i,t)}else e.moveTo(i,s);e.stroke()}}};Qv=qv([V()],Qv);const ty=new Zv,ey=Co,iy=go;var sy=function(t,e){return function(i,s){e(i,s,t)}};let ny=class extends bo{constructor(t){super(),this.rectRenderContribitions=t,this.type="rect",this.numberType=Vn,this.builtinContributions=[ty,iy,ey],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l;const h=null!==(l=this.tempTheme)&&void 0!==l?l:ps(t,null==r?void 0:r.theme).rect,{fill:d=h.fill,background:c,stroke:u=h.stroke,cornerRadius:p=h.cornerRadius,opacity:g=h.opacity,fillOpacity:m=h.fillOpacity,lineWidth:_=h.lineWidth,strokeOpacity:f=h.strokeOpacity,visible:v=h.visible,x1:b,y1:x,x:S=h.x,y:M=h.y}=t.attribute;let{width:k,height:A}=t.attribute;k=(null!=k?k:b-S)||0,A=(null!=A?A:x-M)||0;const w=Xa(g,m,k,A,d),T=qa(g,f,k,A),L=Ga(d,c),C=Ua(u,_);if(!t.valid||!v)return;if(!L&&!C)return;if(!(w||T||a||o||c))return;0===p||y(p)&&p.every((t=>0===t))?(e.beginPath(),e.rect(i,s,k,A)):(e.beginPath(),Wa(e,i,s,k,A,p));const E={doFill:L,doStroke:C};e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),this.beforeRenderStep(t,e,i,s,L,C,w,T,h,n,a,o,E),E.doFill&&(a?a(e,t.attribute,h):w&&(e.setCommonStyle(t,t.attribute,S-i,M-s,h),e.fill())),E.doStroke&&(o?o(e,t.attribute,h):T&&(e.setStrokeStyle(t,t.attribute,S-i,M-s,h),e.stroke())),this.afterRenderStep(t,e,i,s,L,C,w,T,h,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).rect;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};ny=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),sy(0,$(K)),sy(0,X(oo)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ny);let ry=!1;const ay=new B((t=>{ry||(ry=!0,t(ny).toSelf().inSingletonScope(),t(xr).to(ny).inSingletonScope(),t(_r).toService(xr),t(Qv).toSelf(),t(Jv).toSelf(),t(oo).toService(Qv),t(oo).toService(Jv),t(oo).toService(mo),Z(t,oo))})),oy=new qt;class ly{constructor(){this.type="rect",this.numberType=Vn}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=t.getGraphicTheme(),{cornerRadius:r=n.cornerRadius}=t.attribute;let{x:a=n.x,y:o=n.y}=t.attribute;s.highPerformanceSave();let l=!0;if(t.transMatrix.onlyTranslate()){const e=t.getOffsetXY(n);a+=e.x,o+=e.y,s.setTransformForCurrent()}else a=0,o=0,l=!1,s.transformFromMatrix(t.transMatrix,!0);let d=!0;if(!l||t.shadowRoot||h(r,!0)&&0!==r||y(r)&&r.some((t=>0!==t)))d=!1,this.canvasRenderer.drawShape(t,s,a,o,{},null,((t,i,s)=>!!d||(d=t.isPointInPath(e.x,e.y),d)),((t,i,n)=>{if(d)return!0;const r=i.lineWidth||n.lineWidth,a=i.pickStrokeBuffer||n.pickStrokeBuffer;return s.lineWidth=Da(s,r+a,s.dpr),d=t.isPointInStroke(e.x,e.y),d}));else{const{fill:i=n.fill,stroke:s=n.stroke,lineWidth:r=n.lineWidth}=t.attribute;if(i)d=!0;else if(s){const i=t.AABBBounds;oy.setValue(i.x1,i.y1,i.x2,i.y2),oy.expand(-r/2),d=!oy.containsPoint(e)}}return s.highPerformanceRestore(),d}}let hy=class extends ly{constructor(t){super(),this.canvasRenderer=t}};hy=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(xr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],hy);let dy=!1;const cy=new B(((t,e,i,s)=>{dy||(dy=!0,t(G_).to(hy).inSingletonScope(),t(tf).toService(G_))}));let uy=class extends ly{constructor(t){super(),this.canvasRenderer=t}};uy=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(xr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],uy);let py=!1;const gy=new B(((t,e,i,s)=>{py||(py=!0,t(O_).to(uy).inSingletonScope(),t(w_).toService(O_))}));function my(){my.__loaded||(my.__loaded=!0,ra.RegisterGraphicCreator("rect",Kv),Ui.load(ay),Ui.load(A_?cy:gy))}my.__loaded=!1;const _y=my;function fy(t){t.crosshair=Ba(t.crosshair||{}).map((e=>Tl({["horizontal"===t.direction?"yField":"xField"]:{visible:!0,line:{visible:!0,type:"rect"}}},e)))}function vy(t,e,i){var s;const{width:n,height:r}=t;if(M(n)&&M(r))return{width:n,height:r};let a=i.width,o=i.height;const l=e.container,h=e.canvas;if(l){const{width:t,height:e}=Jr(l,i.width,i.height);a=t,o=e}else if(h&&dl(e.mode)){let t;t=S(h)?zo.getElementById(h):h;const{width:e,height:s}=Jr(t,i.width,i.height);a=e,o=s}else if(ul(e.mode)&&(null===(s=e.modeParams)||void 0===s?void 0:s.domref)){const t=e.modeParams.domref;a=t.width,o=t.height}return a=null!=n?n:a,o=null!=r?r:o,{width:a,height:o}}function yy(t,...e){const i=i=>e.reduce(((t,e)=>t||(null==e?void 0:e[i])),t[i]);return Object.assign(t,{change:i("change"),reCompile:i("reCompile"),reMake:i("reMake"),reRender:i("reRender"),reSize:i("reSize"),reTransformSpec:i("reTransformSpec"),changeTheme:i("changeTheme"),changeBackground:i("changeBackground")}),t}function by(t,e){return"line"===t||"area"===t||"common"===t&&e.series.every((t=>"area"===t.type||"line"===t.type))?{paddingInner:1,paddingOuter:0}:{paddingOuter:0}}var xy,Sy,My;(My=xy||(xy={})).STATE_NORMAL="normal",My.STATE_HOVER="hover",My.STATE_HOVER_REVERSE="hover_reverse",My.STATE_DIMENSION_HOVER="dimension_hover",My.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",My.STATE_SELECTED="selected",My.STATE_SELECTED_REVERSE="selected_reverse",My.STATE_SANKEY_EMPHASIS="selected",My.STATE_SANKEY_EMPHASIS_REVERSE="blur",function(t){t.STATE_HOVER_REVERSE="hover_reverse",t.STATE_DIMENSION_HOVER_REVERSE="dimension_hover_reverse",t.STATE_SELECTED_REVERSE="selected_reverse"}(Sy||(Sy={}));class ky{constructor(){this._children=[],this._markNameMap={},this._infoMap=new Map}getMarkNameMap(){return this._markNameMap}addMark(t,e){D(t)||(this._children.push(t),this._markNameMap[t.name]=t,this._infoMap.set(t,E({},ky.defaultMarkInfo,e)))}removeMark(t){const e=this._children.findIndex((e=>e.name===t));e>=0&&(this._infoMap.delete(this._children[e]),delete this._markNameMap[t],this._children.splice(e,1))}clear(){this._children=[],this._markNameMap={},this._infoMap.clear()}forEach(t){this._children.forEach(t)}includes(t,e){return this._children.includes(t,e)}get(t){return isNaN(Number(t))?this._markNameMap[t]:this._children[t]}getMarks(){return this._children.slice()}getMarksInType(t){const e=Ba(t);return this._children.filter((t=>e.includes(t.type)))}getMarkInId(t){return this._children.find((e=>e.id===t))}getMarkWithInfo(t){return this._children.find((e=>Object.keys(t).every((i=>t[i]===this._infoMap.get(e)[i]))))}}ky.defaultMarkInfo={};class Ay{get hover(){return this._hover}get select(){return this._select}constructor(t){this._marks=new ky,this._markReverse=new ky,this.onHover=t=>{switch(t.action){case"enter":this.interaction.getEventElement(xy.STATE_DIMENSION_HOVER).forEach((t=>this.interaction.addEventElement(xy.STATE_DIMENSION_HOVER_REVERSE,t))),this.interaction.clearEventElement(xy.STATE_DIMENSION_HOVER,!1),this.getEventElement(t).forEach((t=>this.interaction.addEventElement(xy.STATE_DIMENSION_HOVER,t))),this.interaction.reverseEventElement(xy.STATE_DIMENSION_HOVER);break;case"leave":this.interaction.clearEventElement(xy.STATE_DIMENSION_HOVER,!0),t=null}},this._option=t,this.event=this._option.model.getOption().getChart().getEvent(),this.interaction=t.interaction,this.initConfig(t.mode)}setStateKeys(t){}registerMark(t){Ym(t.stateStyle[xy.STATE_DIMENSION_HOVER])||this._marks.addMark(t),Ym(t.stateStyle[xy.STATE_DIMENSION_HOVER_REVERSE])||this._markReverse.addMark(t)}init(){this.initEvent()}release(){this.releaseEvent()}initEvent(){this.event.on(Xh.dimensionHover,this.onHover)}releaseEvent(){this.event.release()}initConfig(t){}getEventElement(t,e=!1){const i=[];return t.dimensionInfo.forEach((t=>{t.data.forEach((t=>{(e?this._markReverse:this._marks).getMarks().filter((e=>e.model===t.series&&e.getVisible())).forEach((s=>{const n=s.getProduct();if(!n||!n.elements)return;const r=n.elements.filter((i=>{const s=i.getDatum();let n;return n=y(s)?s.every(((e,i)=>e===t.datum[i])):t.datum.some((t=>t===s)),e?!n:n}));i.push(...r)}))}))})),i}}const wy={};Object.values(xy).forEach((t=>{wy[t]=!0}));const Ty={[xy.STATE_HOVER]:xy.STATE_HOVER_REVERSE,[xy.STATE_SELECTED]:xy.STATE_SELECTED_REVERSE,[xy.STATE_DIMENSION_HOVER]:xy.STATE_DIMENSION_HOVER_REVERSE};function Ly(t){return Ty[t]}class Cy{constructor(){this._stateMarks=new Map,this._stateElements=new Map,this._vgrammarInteractions=new Map,this._disableTriggerEvent=!1}addVgrammarInteraction(t,e){t&&(this._vgrammarInteractions.get(t)?this._vgrammarInteractions.get(t).push(e):this._vgrammarInteractions.set(t,[e]))}static markStateEnable(t,e){return!Ym(t.stateStyle[e])}setDisableActiveEffect(t){this._disableTriggerEvent=t}registerMark(t,e){var i;this._stateMarks.has(t)||this._stateMarks.set(t,[]),null===(i=this._stateMarks.get(t))||void 0===i||i.push(e)}getStateMark(t){return this._stateMarks.get(t)}filterEventMark(t,e){var i;return!(!t.mark||!(null===(i=this._stateMarks.get(e))||void 0===i?void 0:i.includes(t.mark)))}getEventElement(t){var e;return null!==(e=this._stateElements.get(t))&&void 0!==e?e:[]}getEventElementData(t){return this.getEventElement(t).map((t=>t.getDatum()))}exchangeEventElement(t,e){var i;if(this._disableTriggerEvent)return;const s=Ly(t);null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t),s&&this.addEventElement(s,e)})),e.getStates().includes(t)||(e.addState(t),s&&e.removeState(s)),this._stateElements.set(t,[e])}removeEventElement(t,e){var i,s;if(this._disableTriggerEvent)return;e.removeState(t);const n=null!==(s=null===(i=this._stateElements.get(t))||void 0===i?void 0:i.filter((t=>t!==e)))&&void 0!==s?s:[];this._stateElements.set(t,n);const r=Ly(t);r&&(0===n.length?this.clearEventElement(r,!1):this.addEventElement(r,e))}addEventElement(t,e){var i;if(this._disableTriggerEvent)return;e.getStates().includes(t)||e.addState(t);const s=null!==(i=this._stateElements.get(t))&&void 0!==i?i:[];s.push(e),this._stateElements.set(t,s)}clearEventElement(t,e){var i;if(!this._disableTriggerEvent&&(null===(i=this._stateElements.get(t))||void 0===i||i.forEach((e=>{e.removeState(t)})),this._stateElements.set(t,[]),e)){const e=Ly(t);e&&this.clearEventElement(e,!1)}}clearAllEventElement(){if(!this._disableTriggerEvent)for(const[t,e]of this._stateElements)e.forEach((t=>{t.clearStates()})),this._stateElements.set(t,[])}reverseEventElement(t){if(this._disableTriggerEvent)return;const e=Ly(t);if(!e)return;const i=this.getStateMark(e);if(!i)return;const s=this.getEventElement(t);s.length&&(this.getEventElement(e).length||(1===s.length?i.forEach((t=>{t.getProduct().elements.filter((t=>t!==s[0])).forEach((t=>{this.addEventElement(e,t)}))})):i.forEach((t=>{t.getProduct().elements.filter((t=>!s.includes(t))).forEach((t=>{this.addEventElement(e,t)}))}))))}startInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.start(e)}))}resetInteraction(t,e){const i=this._vgrammarInteractions.get(t);i&&i.forEach((t=>{t.reset(e)}))}resetAllInteraction(){for(const[t,e]of this._vgrammarInteractions)e&&e.forEach((t=>{t.reset(null)}))}}var Ey,Dy,Py;!function(t){t[t.SeriesGroup=0]="SeriesGroup",t[t.Axis_Grid=50]="Axis_Grid",t[t.CrossHair_Grid=100]="CrossHair_Grid",t[t.Region=450]="Region",t[t.Mark=300]="Mark",t[t.Node=400]="Node",t[t.Axis=100]="Axis",t[t.MarkLine=500]="MarkLine",t[t.MarkArea=100]="MarkArea",t[t.MarkPoint=500]="MarkPoint",t[t.DataZoom=500]="DataZoom",t[t.ScrollBar=500]="ScrollBar",t[t.Player=500]="Player",t[t.Legend=500]="Legend",t[t.CrossHair=500]="CrossHair",t[t.Indicator=500]="Indicator",t[t.Title=500]="Title",t[t.Label=500]="Label",t[t.Brush=500]="Brush",t[t.CustomMark=500]="CustomMark",t[t.Interaction=700]="Interaction"}(Ey||(Ey={})),function(t){t[t.Indicator=10]="Indicator",t[t.Region=20]="Region",t[t.Axis=30]="Axis",t[t.DataZoom=40]="DataZoom",t[t.Player=40]="Player",t[t.ScrollBar=40]="ScrollBar",t[t.Legend=50]="Legend",t[t.Title=70]="Title",t[t.CustomMark=70]="CustomMark"}(Dy||(Dy={})),function(t){t[t.Default=0]="Default",t[t.Theme=1]="Theme",t[t.Chart=2]="Chart",t[t.Base_Series=3]="Base_Series",t[t.Series=4]="Series",t[t.Mark=5]="Mark",t[t.User_Chart=6]="User_Chart",t[t.User_Series=7]="User_Series",t[t.User_Mark=8]="User_Mark",t[t.User_SeriesStyle=9]="User_SeriesStyle",t[t.Built_In=99]="Built_In"}(Py||(Py={}));class Oy{getOption(){return this._option}constructor(t){this._option=t,this.getCompiler=this._option.getCompiler}getVGrammarView(){var t;return null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView()}release(){this._option=null,this.getCompiler=null}}class Ry extends Oy{constructor(){super(...arguments),this.id=Ko(),this._compiledProductId=null,this._depend=[]}getProduct(){if(M(this._product))return this._product;const t=this.getVGrammarView(),e=this.getProductId();return M(e)&&M(t)&&(this._product=this._lookupGrammar(e)),this._product}getProductId(){var t;return null!==(t=this._compiledProductId)&&void 0!==t?t:this.generateProductId()}getDepend(){return this._depend}setDepend(...t){this._depend=t}compile(t){this._compileProduct(t),this._afterCompile(t)}_afterCompile(t){var e;M(this._product)&&(null===(e=this.getCompiler())||void 0===e||e.addGrammarItem(this))}updateDepend(){if(M(this._product)){const t=this.getDepend().map((t=>t.getProduct())).filter(M);return this._product.depend(t),t.length===this.getDepend().length}return!1}release(){this.removeProduct(),super.release(),this._depend=[]}removeProduct(t){this.getCompiler().removeGrammarItem(this,t),this._product=null,this._compiledProductId=null}}class Iy extends Ry{getValue(){return this._value}getUpdateFunc(){return this._updateFunc}constructor(t,e,i,s){super(t),this.grammarType=r_.signal,this.name=e,this._value=i,this._updateFunc=s}updateSignal(t,e){this._value=t,this._updateFunc=e,this.compile()}_compileProduct(){const t=this.getVGrammarView();if(t){if(!this.getProduct()){const e=this.getProductId();this._product=t.signal().id(e),this._compiledProductId=e}M(this._value)&&this._product.value(this._value),M(this._updateFunc)&&this._product.update(this._updateFunc)}}generateProductId(){return this.name}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getSignalById(t)}}class By extends Oy{constructor(){super(...arguments),this._signalMap={}}getSignalMap(){return this._signalMap}getSignal(t){return this._signalMap[t]}updateSignal(t,e,i){this._signalMap[t]?this._signalMap[t].updateSignal(e,i):(this._signalMap[t]=new Iy(this._option,t,e,i),this._signalMap[t].compile())}compile(){Object.values(this._signalMap).forEach((t=>{t.compile()}))}release(){super.release(),Object.values(this._signalMap).forEach((t=>{t.release()})),this._signalMap={}}}class Fy extends By{getStateMap(){return this._stateMap}_getDefaultStateMap(){return{}}constructor(t){super(t),t.stateKeyToSignalName?this.stateKeyToSignalName=t.stateKeyToSignalName:this.stateKeyToSignalName=()=>"state_signal",this.initStateMap()}initStateMap(t){this._stateMap=null!=t?t:this._getDefaultStateMap()}compile(t){const e=null!=t?t:this._stateMap;Object.keys(e).forEach((t=>{const i=this.stateKeyToSignalName(t),s=e[t];this.updateSignal(i,s)}))}updateState(t,e){if(t&&(E(this._stateMap,t),this.compile(t),!e))return this.getCompiler().renderNextTick()}}class Yy extends Fy{constructor(){super(...arguments),this.id=Ko(),this.stateKeyToSignalName=t=>`${sh}_animate_${this.id}_${t}`}getAnimationStateSignalName(){return this.stateKeyToSignalName("animationState")}updateAnimateState(t,e){t===zp.update?this.updateState({animationState:{callback:(t,e)=>e.diffState}},e):t===zp.appear?this.updateState({animationState:{callback:(t,e)=>"exit"===e.diffState?zp.none:zp.appear}},e):this.updateState({animationState:{callback:(e,i)=>t}},e)}_getDefaultStateMap(){return{animationState:{callback:(t,e)=>"exit"===e.diffState?zp.exit:"update"===e.diffState?zp.update:zp.appear}}}}class jy{constructor(t){this._option=t,this.type=t.type}_initTheme(t,e){return this._theme=this.getTheme(t,e),this._mergeThemeToSpec(t,e)}getTheme(t,e){}transformSpec(t,e,i){this._transformSpecBeforeMergingTheme(t,e,i);const s=this._initTheme(t,e);return this._transformSpecAfterMergingTheme(s.spec,e,i),s}_transformSpecBeforeMergingTheme(t,e,i){}_transformSpecAfterMergingTheme(t,e,i){}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>Tl({},i,s,t);return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}_shouldMergeThemeToSpec(){return!0}_getDefaultSpecFromChart(t){}}const Hy=(t,e,i)=>{if(D(e))return t;const s=e[0];return D(s)?t:1===e.length?(t[s]=i,t):(D(t[s])&&("number"==typeof e[1]?t[s]=[]:t[s]={}),Hy(t[s],e.slice(1),i))};class zy extends Oy{getSpec(){return this._spec||{}}getSpecPath(){var t;return null===(t=this._option)||void 0===t?void 0:t.specPath}getSpecInfoPath(){var t,e,i;return null!==(e=null===(t=this._option)||void 0===t?void 0:t.specInfoPath)&&void 0!==e?e:null===(i=this._option)||void 0===i?void 0:i.specPath}getData(){return this._data}get layout(){return this._layout}getOption(){return this._option}getMarks(){var t,e;return null!==(e=null===(t=this._marks)||void 0===t?void 0:t.getMarks())&&void 0!==e?e:[]}getMarkNameMap(){var t;return null===(t=this._marks)||void 0===t?void 0:t.getMarkNameMap()}getMarkSet(){return this._marks}getChart(){return this._option.getChart()}get _theme(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.theme}constructor(t,e){var i;super(e),this.transformerConstructor=jy,this.type="null",this.modelType="null",this.userId=void 0,this._data=null,this._layout=null,this.specKey="",this._marks=new ky,this._lastLayoutRect=null,this.id=Ko(),this.userId=t.id,this._spec=t,this.effect={},this.event=new Wd(e.eventDispatcher,e.mode),null===(i=e.map)||void 0===i||i.set(this.id,this)}_releaseEvent(){this.event.release()}created(){this.setAttrFromSpec()}init(t){}afterInit(){}getVisible(){var t;return!1!==(null===(t=this._spec)||void 0===t?void 0:t.visible)}onLayoutStart(t,e,i){var s;null===(s=this._layout)||void 0===s||s.onLayoutStart(t,e,i)}onLayoutEnd(t){var e;null===(e=this._layout)||void 0===e||e.onLayoutEnd(t),this.getMarks().forEach((t=>t.updateLayoutState(!0,!0)))}onEvaluateEnd(t){}onDataUpdate(){}beforeRelease(){}release(){var t;this._releaseEvent(),this._spec=void 0,this.getMarks().forEach((t=>t.release())),null===(t=this._data)||void 0===t||t.release(),this._data=null,this._marks.clear(),super.release()}updateSpec(t){const e=this._compareSpec(t,this._spec);return this._spec=t,e}_compareSpec(t,e){return{change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1}}reInit(t){t&&(this._spec=t),this.setAttrFromSpec()}updateLayoutAttribute(){}setAttrFromSpec(){var t;null===(t=this._layout)||void 0===t||t.setAttrFromSpec(this._spec,this._option.getChartViewRect())}_convertMarkStyle(t){return Object.assign({},t)}setMarkStyle(t,e,i,s){M(t)&&M(e)&&t.setStyle(this._convertMarkStyle(e),i,s)}initMarkStyleWithSpec(t,e,i){if(!M(t)||!M(e))return;const{style:s,state:n}=e,r=Object.assign({},e);s&&(r.style=this._convertMarkStyle(s)),n&&(r.state={},Object.keys(n).forEach((t=>{r.state[t]=this._convertMarkStyle(n[t])}))),t.initStyleWithSpec(r,i)}stateKeyToSignalName(t,e){let i=`${sh}_${this.modelType}_${this.type}_${this.id}_${t}`;return e&&(i+=`_${e}`),i}compileData(){var t;null===(t=this._data)||void 0===t||t.compile()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t})}))}_createMark(t,e={}){const{type:i,name:s}=t,n=$l.createMark(i,s,Object.assign({model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._option.globalScale},e));return null==n||n.created(),n}_getDataIdKey(){}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}getSpecInfo(){var t,e,i;return((t,e)=>{if(!D(e))return Ud(t,e,void 0)})(null!==(i=null===(e=(t=this._option).getSpecInfo)||void 0===e?void 0:e.call(t))&&void 0!==i?i:{},this.getSpecInfoPath())}getSpecIndex(){const t=this.getSpecPath();if(!(null==t?void 0:t.length))return 0;const e=Number(t[t.length-1]);return isNaN(e)?0:e}}class Ny{getSpec(){return this._spec||{}}getLayoutStartPoint(){return this._layoutStartPoint}get layoutRectLevelMap(){return this._layoutRectLevelMap}get minWidth(){return this._minWidth}set minWidth(t){this._minWidth=t}get maxWidth(){return this._maxWidth}set maxWidth(t){this._maxWidth=t}get minHeight(){return this._minHeight}set minHeight(t){this._minHeight=t}get maxHeight(){return this._maxHeight}set maxHeight(t){this._maxHeight=t}getLastComputeOutBounds(){return this._lastComputeOutBounds}get layoutOrient(){return this._layoutOrient}set layoutOrient(t){this._layoutOrient=t}get model(){return this._model}get type(){return this._model.type}constructor(t,e){var i;this.layoutClip=!1,this.autoIndent=!1,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:0,height:0},this._layoutRectLevelMap={width:0,height:0},this._minWidth=null,this._maxWidth=null,this._minHeight=null,this._maxHeight=null,this._lastComputeRect=null,this._lastComputeOutBounds={x1:0,x2:0,y1:0,y2:0},this.getLayoutRect=()=>this._layoutRect,this.layoutType="normal",this._layoutOrient="left",this.layoutPaddingLeft=0,this.layoutPaddingTop=0,this.layoutPaddingRight=0,this.layoutPaddingBottom=0,this.layoutOffsetX=0,this.layoutOffsetY=0,this.layoutLevel=Dy.Region,this._model=t,this._option=e,this.layoutLevel=e.layoutLevel,this.layoutType=e.layoutType,e.layoutOrient&&(this.layoutOrient=e.layoutOrient),this._spec=null===(i=null==t?void 0:t.getSpec)||void 0===i?void 0:i.call(t)}_setLayoutAttributeFromSpec(t,e){var i,s,n,r;if(this._spec&&!1!==this._spec.visible){const a=il(sl(t.padding),e,e);this.layoutPaddingLeft=a.left,this.layoutPaddingRight=a.right,this.layoutPaddingTop=a.top,this.layoutPaddingBottom=a.bottom,this._minHeight=D(t.minHeight)?null!==(i=this._minHeight)&&void 0!==i?i:null:el(t.minHeight,e.height,e),this._maxHeight=D(t.maxHeight)?null!==(s=this._maxHeight)&&void 0!==s?s:null:el(t.maxHeight,e.height,e),this._minWidth=D(t.minWidth)?null!==(n=this._minWidth)&&void 0!==n?n:null:el(t.minWidth,e.width,e),this._maxWidth=D(t.maxWidth)?null!==(r=this._maxWidth)&&void 0!==r?r:null:el(t.maxWidth,e.width,e),t.width&&this.setLayoutRect({width:el(t.width,e.width,e)},{width:9}),t.height&&this.setLayoutRect({height:el(t.height,e.height,e)},{height:9}),D(t.offsetX)||(this.layoutOffsetX=el(t.offsetX,e.width,e)),D(t.offsetY)||(this.layoutOffsetY=el(t.offsetY,e.height,e)),t.alignSelf&&(this.alignSelf=t.alignSelf)}}setAttrFromSpec(t,e){var i,s,n,r;this._spec=t,this.layoutType=null!==(i=t.layoutType)&&void 0!==i?i:this.layoutType,this.layoutLevel=null!==(s=t.layoutLevel)&&void 0!==s?s:this.layoutLevel,this.layoutOrient=null!==(n=t.orient)&&void 0!==n?n:this.layoutOrient,this._setLayoutAttributeFromSpec(t,e),this.layoutClip=null!==(r=t.clip)&&void 0!==r?r:this.layoutClip}onLayoutStart(t,e,i){this._setLayoutAttributeFromSpec(this._spec,e)}onLayoutEnd(t){}_getAbsoluteSpecValue(t){const e={top:null,bottom:null,left:null,right:null};return["top","bottom","left","right"].forEach((i=>{D(this._spec[i])||(e[i]=el(this._spec[i],"top"===i||"bottom"===i?t.height:t.width,t))})),e}absoluteLayoutInRect(t){const{top:e,bottom:i,left:s,right:n}=this._getAbsoluteSpecValue(t),r={width:t.width-this.layoutPaddingLeft-this.layoutPaddingRight,height:t.height-this.layoutPaddingTop-this.layoutPaddingBottom};D(s)||(r.width-=s),D(n)||(r.width-=n),D(e)||(r.height-=e),D(i)||(r.height-=i),this.setLayoutRect(r);const{width:a,height:o}=this.computeBoundsInRect(this.getLayoutRect());this.setLayoutRect({width:a,height:o});const l={x:t.x,y:t.y};!0===this._spec.center?(l.x=t.x+.5*t.width-.5*a,l.y=t.y+.5*t.height-.5*o):(D(s)?D(n)||(l.x=t.x+t.width-this.layoutPaddingRight-n-a):l.x=t.x+s+this.layoutPaddingLeft,D(e)?D(i)||(l.y=t.y+t.height-this.layoutPaddingBottom-i-o):l.y=t.y+e+this.layoutPaddingTop),this.setLayoutStartPosition(l)}setLayoutStartPosition(t){var e,i;this._option.transformLayoutPosition&&(t=this._option.transformLayoutPosition(t)),qo(t.x)&&(this._layoutStartPoint.x=t.x),qo(t.y)&&(this._layoutStartPoint.y=t.y),null===(i=(e=this._model).afterSetLayoutStartPoint)||void 0===i||i.call(e,this._layoutStartPoint)}setLayoutRect({width:t,height:e},i){var s,n,r,a;qo(t)&&(null!==(s=null==i?void 0:i.width)&&void 0!==s?s:0)>=this._layoutRectLevelMap.width&&(this._layoutRect.width=t,this._layoutRectLevelMap.width=null!==(n=null==i?void 0:i.width)&&void 0!==n?n:0),qo(e)&&(null!==(r=null==i?void 0:i.height)&&void 0!==r?r:0)>=this._layoutRectLevelMap.height&&(this._layoutRect.height=e,this._layoutRectLevelMap.height=null!==(a=null==i?void 0:i.height)&&void 0!==a?a:0),this.setRectInSpec(this._layoutRect)}getLayout(){return{x:this._layoutStartPoint.x,y:this._layoutStartPoint.y,width:this._layoutRect.width,height:this._layoutRect.height}}mergeLayoutRect({width:t,height:e}){const i={width:t,height:e};return this._layoutRectLevelMap.width>0&&(i.width=this._layoutRect.width),this._layoutRectLevelMap.height>0&&(i.height=this._layoutRect.height),i}getOrientPosAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"x":"y"}getOrientSizeAttribute(){return"bottom"===this._layoutOrient||"top"===this._layoutOrient?"width":"height"}changeBoundsBySetting(t){return this._layoutRectLevelMap.width>0&&(t.x2=t.x1+this._layoutRect.width),this._layoutRectLevelMap.height>0&&(t.y2=t.y1+this._layoutRect.height),t.x1-=this._layoutStartPoint.x,t.x2-=this._layoutStartPoint.x,t.y1-=this._layoutStartPoint.y,t.y2-=this._layoutStartPoint.y,t}setRectInSpec(t){const e=Object.assign({},t);return this._layoutRectLevelMap.width<9?(D(this._minWidth)||(e.width=Math.max(e.width,this._minWidth)),D(this._maxWidth)||(e.width=Math.min(e.width,this._maxWidth))):e.width=this._layoutRect.width,this._layoutRectLevelMap.height<9?(D(this._minHeight)||(e.height=Math.max(e.height,this._minHeight)),D(this._maxHeight)||(e.height=Math.min(e.height,this._maxHeight))):e.height=this._layoutRect.height,e}computeBoundsInRect(t){if(this._lastComputeRect=t,!("region-relative"!==this.layoutType&&"region-relative-overlap"!==this.layoutType||(9!==this._layoutRectLevelMap.width||"left"!==this.layoutOrient&&"right"!==this.layoutOrient)&&(9!==this._layoutRectLevelMap.height||"bottom"!==this.layoutOrient&&"top"!==this.layoutOrient)))return this._layoutRect;const e=Object.assign({},this._model.getBoundsInRect(this.setRectInSpec(t),t));this.changeBoundsBySetting(e),this.autoIndent&&e.x2-e.x1>0&&e.y2-e.y1>0&&(this._lastComputeOutBounds.x1=Math.ceil(-e.x1),this._lastComputeOutBounds.x2=Math.ceil(e.x2-t.width),this._lastComputeOutBounds.y1=Math.ceil(-e.y1),this._lastComputeOutBounds.y2=Math.ceil(e.y2-t.height));let i=this.setRectInSpec(function(t,e){return t?{width:Math.ceil(Math.min(t.x2-t.x1,e.width)),height:Math.ceil(Math.min(t.y2-t.y1,e.height))}:{width:0,height:0}}(e,t));return this._option.transformLayoutRect&&(i=this._option.transformLayoutRect(i)),i}getModelId(){return this._model.id}getModelVisible(){return this._model.getVisible()}}class Vy extends zy{constructor(){super(...arguments),this.layoutType="normal",this.layoutLevel=0,this.layoutZIndex=0,this._forceLayoutTag=!1,this._layout=null,this._orient=null,this._layoutRect={width:0,height:0},this._layoutStartPos={x:0,y:0},this._isLayout=!0,this.getGraphicBounds=()=>this._layout?{x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}:{x1:0,x2:0,y1:0,y2:0},this._transformLayoutRect=null,this._transformLayoutPosition=null}get layoutOrient(){return this._orient}set layoutOrient(t){this._orient=t,this._layout&&(this._layout.layoutOrient=t)}initLayout(){"none"!==this.layoutType&&(this._layout=new Ny(this,{layoutType:this.layoutType,layoutLevel:this.layoutLevel,layoutOrient:this._orient,transformLayoutRect:this._transformLayoutRect,transformLayoutPosition:this._transformLayoutPosition}),this._orient&&"radius"!==this._orient&&"angle"!==this._orient&&this._layout&&(this._layout.layoutOrient=this._orient))}onLayoutStart(t,e,i){this._isLayout=!0,super.onLayoutStart(t,e,i)}onLayoutEnd(t){super.onLayoutEnd(t),this.updateLayoutAttribute();const e=this.getLayoutRect();!this._forceLayoutTag&&Im(this._lastLayoutRect,e)||(this._lastLayoutRect=Object.assign({},e)),this._forceLayoutTag=!1,this._isLayout=!1}afterSetLayoutStartPoint(t){}_forceLayout(){var t;this._isLayout||(this._forceLayoutTag=!0,null===(t=this._option.globalInstance.getChart())||void 0===t||t.setLayoutTag(!0))}getLayoutStartPoint(){return this._layout?this._layout.getLayoutStartPoint():this._layoutStartPos}setLayoutStartPosition(t){return this._layout?this._layout.setLayoutStartPosition(t):this._layoutStartPos=E(this._layoutStartPos,t)}getLayoutRect(){return this._layout?this._layout.getLayoutRect():this._layoutRect}setLayoutRect(t,e){return this._layout?this._layout.setLayoutRect(t):this._lastLayoutRect=E(this._layoutRect,t)}getLastComputeOutBounds(){var t;return null===(t=this._layout)||void 0===t?void 0:t.getLastComputeOutBounds()}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this.layoutClip=null!==(t=this._spec.clip)&&void 0!==t?t:this.layoutClip,this.layoutZIndex=null!==(e=this._spec.zIndex)&&void 0!==e?e:this.layoutZIndex,this.layoutType=null!==(i=this._spec.layoutType)&&void 0!==i?i:this.layoutType,this._orient=null!==(s=this._spec.orient)&&void 0!==s?s:this._orient,this.layoutLevel=null!==(n=this._spec.layoutLevel)&&void 0!==n?n:this.layoutLevel}}class Wy extends jy{_initTheme(t,e){return{spec:t,theme:this._theme}}}class Gy extends Vy{getMaxWidth(){return this._layout.maxWidth}setMaxWidth(t){this._layout.maxWidth=t}getMaxHeight(){return this._layout.maxHeight}setMaxHeight(t){this._layout.maxHeight=t}getGroupMark(){return this._groupMark}getInteractionMark(){return this._interactionMark}getStackInverse(){return!0===this._spec.stackInverse}getStackSort(){return!0===this._spec.stackSort}constructor(t,e){var i;super(t,e),this.transformerConstructor=Wy,this.modelType="region",this.specKey="region",this.type=Gy.type,this._series=[],this.layoutType="region",this.layoutZIndex=Ey.Region,this.interaction=new Cy,this.seriesDataFilterOver=()=>{this.event.emit(Hd.regionSeriesDataFilterOver,{model:this,chart:this.getChart()}),this._series.forEach((t=>{t.getViewDataFilter()&&t.reTransformViewData()}))},this.getBoundsInRect=()=>({x1:this._layout.getLayoutStartPoint().x,y1:this._layout.getLayoutStartPoint().y,x2:this._layout.getLayoutStartPoint().x+this._layout.getLayoutRect().width,y2:this._layout.getLayoutStartPoint().y+this._layout.getLayoutRect().height}),this.userId=t.id,this.coordinate=null!==(i=t.coordinate)&&void 0!==i?i:"cartesian",this._option.animation&&(this.animate=new Yy({getCompiler:e.getCompiler})),this.interaction.setDisableActiveEffect(this._option.disableTriggerEvent)}_getClipDefaultValue(){var t,e,i,s;const n=this._option.getChart().getSpec(),r=null===(e=null===(t=n.dataZoom)||void 0===t?void 0:t.some)||void 0===e?void 0:e.call(t,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"filter")})),a=null===(s=null===(i=n.scrollBar)||void 0===i?void 0:i.some)||void 0===s?void 0:s.call(i,(t=>{var e;return"axis"===(null!==(e=t.filterMode)&&void 0!==e?e:"axis")}));return!(!r&&!a)||this._layout.layoutClip}created(){var t,e;this.initLayout(),super.created();const i=null!==(t=this._spec.clip)&&void 0!==t?t:this._getClipDefaultValue();this._groupMark=this._createGroupMark("regionGroup",this.userId,this.layoutZIndex),this._interactionMark=this._createGroupMark("regionInteractionGroup",(null!==(e=this.userId)&&void 0!==e?e:this.type)+"_interaction",Ey.Interaction),Ym(this._spec.style)||(this._backgroundMark=this._createMark({type:"rect",name:"regionBackground"}),i&&(this._foregroundMark=this._createMark({type:"rect",name:"regionForeground"})),[this._backgroundMark,this._foregroundMark].forEach((t=>{t&&(t.created(),this.setMarkStyle(t,{width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height},"normal",Py.Built_In),this._groupMark.addMark(t))})),this._backgroundMark&&this._backgroundMark.setZIndex(Ey.SeriesGroup-1),this._foregroundMark&&this._foregroundMark.setZIndex(Ey.Mark+1)),this.createTrigger()}_createGroupMark(t,e,i){var s,n;const r=this._createMark({type:"group",name:t});r.setUserId(e),r.setZIndex(i);const a=null!==(s=this._spec.clip)&&void 0!==s?s:this._getClipDefaultValue();return this.setMarkStyle(r,{x:()=>this.getLayoutStartPoint().x,y:()=>this.getLayoutStartPoint().y,width:()=>this.getLayoutRect().width,height:()=>this.getLayoutRect().height,clip:a},"normal",Py.Built_In),this.setMarkStyle(r,{cornerRadius:null===(n=this._spec.style)||void 0===n?void 0:n.cornerRadius},"normal",Py.User_Mark),this._marks.addMark(r),r}init(t){super.init(t),this.initMark(),this.initSeriesDataflow(),this.initInteraction(),this.initTrigger()}initMark(){this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}_initBackgroundMarkStyle(){var t,e;this._backgroundMark&&(this.setMarkStyle(this._backgroundMark,Object.assign({fillOpacity:(null===(t=this._spec.style)||void 0===t?void 0:t.fill)?1:0},this._spec.style),"normal",Py.User_Mark),(null!==(e=this._spec.clip)&&void 0!==e?e:this._getClipDefaultValue())&&this.setMarkStyle(this._backgroundMark,{strokeOpacity:0},"normal",Py.Built_In))}_initForegroundMarkStyle(){this._foregroundMark&&this.setMarkStyle(this._foregroundMark,Object.assign(Object.assign({},this._spec.style),{fillOpacity:0}),"normal",Py.User_Mark)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(null==e?void 0:e.style,null==t?void 0:t.style)||(i.reMake=!0),i}reInit(t){super.reInit(t),this._initBackgroundMarkStyle(),this._initForegroundMarkStyle()}addSeries(t){t&&(this._series.includes(t)||this._series.push(t))}removeSeries(t){if(!t)return;const e=this._series.findIndex((e=>e===t));e>=0&&this._series.splice(e,1)}getSeries(t={}){return this._series.filter((e=>{var i,s;return(!t.name||(null==e?void 0:e.name)===t.name)&&(!t.userId||Ba(t.userId).includes(e.userId))&&(!M(t.specIndex)||Ba(t.specIndex).includes(e.getSpecIndex()))&&(!t.id||e.id===t.id)&&(!t.type||e.type===t.type)&&(!t.coordinateType||e.coordinate===t.coordinateType)&&(!t.dataName||(null===(s=null===(i=e.getRawData)||void 0===i?void 0:i.call(e))||void 0===s?void 0:s.name)===t.dataName)}))}getSeriesInName(t){return this.getSeries({name:t})[0]}getSeriesInUserId(t){return this.getSeries({userId:t})[0]}getSeriesInId(t){return this.getSeries({id:t})[0]}getSeriesInType(t){return this.getSeries({type:t})}getSeriesInCoordinateType(t){return this.getSeries({coordinateType:t})}getSeriesInDataName(t){return this.getSeries({dataName:t})}onRender(t){}initSeriesDataflow(){const t=this._series.map((t=>{var e;return null!==(e=t.getViewDataFilter())&&void 0!==e?e:t.getViewData()})).filter((t=>!!t));this._option.dataSet.multipleDataViewAddListener(t,"change",this.seriesDataFilterOver)}release(){super.release(),this._series=[]}createTrigger(){const t=Object.assign(Object.assign({},this._option),{model:this,interaction:this.interaction});this._trigger=new Ay(t)}initTrigger(){this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{this._trigger.registerMark(t)}))})),this._trigger.init()}initInteraction(){this._option.disableTriggerEvent||this._series.forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{for(const e in Sy)Ym(t.stateStyle[Sy[e]])||this.interaction.registerMark(Sy[e],t)}))}))}compileMarks(t){this.getMarks().forEach((e=>{var i;e.compile({group:t,context:{model:this}}),null===(i=e.getProduct())||void 0===i||i.layout(((t,e,i,s)=>{}))}))}compile(){var t;null===(t=this.animate)||void 0===t||t.compile(),this.compileMarks()}onLayoutEnd(t){this._series.forEach((e=>e.onLayoutEnd(t))),super.onLayoutEnd(t)}}function Uy(t){const e=[],i=[],s=[];return t.forEach((t=>{D(t.getSpec().position)||"start"===t.getSpec().position?e.push(t):"middle"===t.getSpec().position?i.push(t):"end"===t.getSpec().position&&s.push(t)})),{startItems:e,endItems:s,middleItems:i}}function $y(t,e,i){e?t.forEach((t=>{const e=Fa(t),s=e.getLayoutStartPoint().y+e.getLayoutRect().height-t[0].getLayoutStartPoint().y,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x,y:t.getLayoutStartPoint().y+n})}))})):t.forEach((t=>{const e=Fa(t),s=e.getLayoutStartPoint().x+e.getLayoutRect().width-t[0].getLayoutStartPoint().x,n=(i-s)/2;t.forEach((t=>{t.setLayoutStartPosition({x:t.getLayoutStartPoint().x+n,y:t.getLayoutStartPoint().y})}))}))}function Xy(t,e,i,s){let n;t.forEach(((t,r)=>{t.length>1&&(n=i[r],t.forEach((t=>{if(!t.alignSelf||"start"===t.alignSelf)return;const i=t.getLayoutStartPoint(),r="middle"===t.alignSelf?.5:1,a=e?n-(t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight):n-(t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom);e?t.setLayoutStartPosition({x:i.x+s*a*r,y:i.y}):t.setLayoutStartPosition({x:i.x,y:i.y+s*a*r})})))}))}function Ky(t,e,i,s,n){if(t.length){let r=0;const a="right"===n,o=a?-1:1;let l=a?e.rightCurrent:e.leftCurrent,h=e.topCurrent;const d=[];let c=[];const u=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=a?-n.width-t.layoutPaddingRight:t.layoutPaddingLeft;t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:h+t.layoutOffsetY+t.layoutPaddingTop}),h+=p,h>i&&c.length?(u.push(r),l+=o*r,r=g,h=e.topCurrent+p,t.setLayoutStartPosition({x:l+t.layoutOffsetX+m,y:e.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),d.push(c),c=[t]):(r=Math.max(r,g),c.push(t))})),u.push(r),d.push(c),Xy(d,!0,u,o),s&&$y(d,!0,i),a?e.rightCurrent=l+o*r:e.leftCurrent=l+o*r}}function qy(t,e,i,s){if(t.length){let i=0;const n="right"===s,r=n?-1:1;let a=n?e.rightCurrent:e.leftCurrent,o=e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),c=t.computeBoundsInRect(s);t.setLayoutRect(c);const u=c.height+t.layoutPaddingTop+t.layoutPaddingBottom,p=c.width+t.layoutPaddingLeft+t.layoutPaddingRight,g=n?-c.width-t.layoutPaddingRight:t.layoutPaddingLeft;o{const s=e.getItemComputeLayoutRect(t),n=t.computeBoundsInRect(s);t.setLayoutRect(n);const p=n.height+t.layoutPaddingTop+t.layoutPaddingBottom,g=n.width+t.layoutPaddingLeft+t.layoutPaddingRight,m=r?t.layoutPaddingTop:-n.height-t.layoutPaddingBottom;t.setLayoutStartPosition({x:l+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),l+=g,l>i&&c.length?(u.push(o),l=e.leftCurrent+g,h+=a*o,o=p,t.setLayoutStartPosition({x:e.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:h+t.layoutOffsetY+m}),d.push(c),c=[t]):(o=Math.max(o,p),c.push(t))})),u.push(o),d.push(c),Xy(d,!1,u,a),s&&$y(d,!1,i),r?e.topCurrent=h+a*o:e.bottomCurrent=h+a*o}}function Jy(t,e,i,s){if(t.length){const i="top"===s,n=i?1:-1;let r=0,a=e.rightCurrent,o=i?e.topCurrent:e.bottomCurrent;const l=[];let h=[];const d=[];t.forEach((t=>{const s=e.getItemComputeLayoutRect(t),d=t.computeBoundsInRect(s);t.setLayoutRect(d);const c=d.height+t.layoutPaddingTop+t.layoutPaddingBottom,u=d.width+t.layoutPaddingLeft+t.layoutPaddingRight,p=i?t.layoutPaddingTop:-d.height-t.layoutPaddingBottom;ae.layoutLevel-t.layoutLevel))}_layoutNormalItems(t){this.layoutNormalInlineItems(t.filter((t=>"normal-inline"===t.layoutType))),this.layoutNormalItems(t.filter((t=>"normal"===t.layoutType)))}_groupItems(t){const e=t.filter((t=>"region"===t.layoutType)),i=t.filter((t=>"region-relative"===t.layoutType)),s=t.filter((t=>"region-relative-overlap"===t.layoutType)),n=i.concat(s),r={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}};return s.forEach((t=>{r[t.layoutOrient].items.push(t)})),{regionItems:e,relativeItems:i,relativeOverlapItems:s,allRelatives:n,overlapItems:r}}layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},{regionItems:r,relativeItems:a,relativeOverlapItems:o,allRelatives:l,overlapItems:h}=this._groupItems(e);this.layoutRegionItems(r,a,o,h),this._processAutoIndent(r,a,o,h,l,n),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType)))}_processAutoIndent(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}},n,r){if(n.some((t=>t.autoIndent))){const{top:a,bottom:o,left:l,right:h}=this._checkAutoIndent(n,r);(a||o||l||h)&&(this.topCurrent=r.top+a,this.bottomCurrent=r.bottom-o,this.leftCurrent=r.left+l,this.rightCurrent=r.right-h,this.layoutRegionItems(t,e,i,s))}}layoutNormalItems(t){t.forEach((t=>{const e=this.getItemComputeLayoutRect(t),i=t.computeBoundsInRect(e);t.setLayoutRect(i),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"top"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"right"===t.layoutOrient?(t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX-i.width-t.layoutPaddingRight,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"bottom"===t.layoutOrient&&(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingRight,y:this.bottomCurrent+t.layoutOffsetY-i.height-t.layoutPaddingBottom}),this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom)}))}layoutNormalInlineItems(t){const e=t.filter((t=>"left"===t.layoutOrient)),i=t.filter((t=>"right"===t.layoutOrient)),s=t.filter((t=>"top"===t.layoutOrient)),n=t.filter((t=>"bottom"===t.layoutOrient)),r=this._chartLayoutRect.width+this._chartLayoutRect.x,a=this._chartLayoutRect.height+this._chartLayoutRect.y;e.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Uy(t);s.length&&Ky(s,e,i,!1,"left"),n.length&&Ky(n,e,i,!0,"left"),r.length&&qy(r,e,0,"left")}(e,this,a),s.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Uy(t);s.length&&Zy(s,e,i,!1,"top"),n.length&&Zy(n,e,i,!0,"top"),r.length&&Jy(r,e,0,"top")}(s,this,r),i.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Uy(t);s.length&&Ky(s,e,i,!1,"right"),n.length&&Ky(n,e,i,!0,"right"),r.length&&qy(r,e,0,"right")}(i,this,a),n.length&&function(t,e,i){const{startItems:s,middleItems:n,endItems:r}=Uy(t);s.length&&Zy(s,e,i,!1,"bottom"),n.length&&Zy(n,e,i,!0,"bottom"),r.length&&Jy(r,e,0,"bottom")}(n,this,r)}_layoutRelativeOverlap(t,e){e.items.forEach((t=>{const i=this.getItemComputeLayoutRect(t),s=t.computeBoundsInRect(i);e.rect.width=Math.max(s.width+t.layoutPaddingLeft+t.layoutPaddingRight,e.rect.width),e.rect.height=Math.max(s.height+t.layoutPaddingTop+t.layoutPaddingBottom,e.rect.height)})),e.items.forEach((i=>{i.setLayoutRect(e.rect),"left"===t?i.setLayoutStartPosition({x:this.leftCurrent+i.layoutOffsetX}):"right"===t?i.setLayoutStartPosition({x:this.rightCurrent-e.rect.width+i.layoutOffsetX}):"top"===t?i.setLayoutStartPosition({x:this.topCurrent+i.layoutOffsetY}):i.setLayoutStartPosition({x:this.bottomCurrent-e.rect.height+i.layoutOffsetY})})),"left"===t?this.leftCurrent+=e.rect.width:"right"===t?this.rightCurrent-=e.rect.width:"top"===t?this.topCurrent+=e.rect.height:this.bottomCurrent-=e.rect.height}_layoutRelativeItem(t,e){const i=t.computeBoundsInRect(e);"left"===t.layoutOrient||"right"===t.layoutOrient?t.setLayoutRect({width:i.width}):t.setLayoutRect({height:i.height}),"left"===t.layoutOrient?(t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft}),this.leftCurrent+=i.width+t.layoutPaddingLeft+t.layoutPaddingRight):"right"===t.layoutOrient?(this.rightCurrent-=i.width+t.layoutPaddingLeft+t.layoutPaddingRight,t.setLayoutStartPosition({x:this.rightCurrent+t.layoutOffsetX+t.layoutPaddingLeft})):"top"===t.layoutOrient?(t.setLayoutStartPosition({y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop}),this.topCurrent+=i.height+t.layoutPaddingTop+t.layoutPaddingBottom):"bottom"===t.layoutOrient&&(this.bottomCurrent-=i.height+t.layoutPaddingTop+t.layoutPaddingBottom,t.setLayoutStartPosition({y:this.bottomCurrent+t.layoutOffsetY+t.layoutPaddingTop}))}_layoutRegionItem(t,e,i){const s=Math.max(Math.min(e,...t.map((t=>{var e;return null!==(e=t.maxWidth)&&void 0!==e?e:Number.MAX_VALUE}))),0),n=Math.max(Math.min(i,...t.map((t=>{var e;return null!==(e=t.maxHeight)&&void 0!==e?e:Number.MAX_VALUE}))),0);return t.forEach((t=>{const e=s-t.layoutPaddingLeft-t.layoutPaddingRight,i=n-t.layoutPaddingTop-t.layoutPaddingBottom;t.setLayoutRect({width:e,height:i}),t.setLayoutStartPosition({x:this.leftCurrent+t.layoutOffsetX+t.layoutPaddingLeft,y:this.topCurrent+t.layoutOffsetY+t.layoutPaddingTop})})),{regionHeight:n,regionWidth:s}}layoutRegionItems(t,e,i,s={left:{items:[],rect:{width:0,height:0}},right:{items:[],rect:{width:0,height:0}},top:{items:[],rect:{width:0,height:0}},bottom:{items:[],rect:{width:0,height:0}},z:{items:[],rect:{width:0,height:0}}}){let n=this.rightCurrent-this.leftCurrent,r=this.bottomCurrent-this.topCurrent;e.filter((t=>"left"===t.layoutOrient||"right"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("left",s.left),this._layoutRelativeOverlap("right",s.right),n=this.rightCurrent-this.leftCurrent,e.filter((t=>"top"===t.layoutOrient||"bottom"===t.layoutOrient)).forEach((t=>{this._layoutRelativeItem(t,this.getItemComputeLayoutRect(t))})),this._layoutRelativeOverlap("top",s.top),this._layoutRelativeOverlap("bottom",s.bottom),r=this.bottomCurrent-this.topCurrent;const{regionWidth:a,regionHeight:o}=this._layoutRegionItem(t,n,r);e.concat(i).forEach((e=>{if(["left","right"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({height:i.getLayoutRect().height}),e.setLayoutStartPosition({y:i.getLayoutStartPoint().y+e.layoutOffsetY+e.layoutPaddingTop}),"right"===e.layoutOrient&&e.setLayoutStartPosition({x:e.getLayoutStartPoint().x+a-n})}else if(["top","bottom"].includes(e.layoutOrient)){const i=this.filterRegionsWithID(t,e.layoutBindRegionID[0]);e.setLayoutRect({width:i.getLayoutRect().width}),e.setLayoutStartPosition({x:i.getLayoutStartPoint().x+e.layoutOffsetX+e.layoutPaddingLeft}),"bottom"===e.layoutOrient&&e.setLayoutStartPosition({y:e.getLayoutStartPoint().y+o-r})}}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}filterRegionsWithID(t,e){var i;const s=t.find((t=>t.getModelId()===e));return s||(null!==(i=this._onError)&&void 0!==i?i:gl)("can not find target region item, invalid id"),s}getItemComputeLayoutRect(t){return{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight,height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom}}_checkAutoIndent(t,e){const i={top:0,left:0,bottom:0,right:0};return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const s="left"===t.layoutOrient||"right"===t.layoutOrient,n=t.getLastComputeOutBounds(),r=this._getOutInLayout(n,t,e);s?(i.top=Math.max(i.top,r.top),i.bottom=Math.max(i.bottom,r.bottom)):(i.left=Math.max(i.left,r.left),i.right=Math.max(i.right,r.right))})),i}_getOutInLayout(t,e,i){const{x:s,y:n}=e.getLayoutStartPoint(),{width:r,height:a}=e.getLayoutRect();return{left:i.left-(s-t.x1),right:s+r+t.x2-i.right,top:i.top-(n-t.y1),bottom:n+a+t.y2-i.bottom}}}function tb(t,e,i){M(e)||(e=t,t=0),M(i)||(i=1);let s=-1;const n=0|Math.max(0,Math.ceil((e-t)/i)),r=new Array(n);for(;++s{let e=null,i=null;return(...s)=>(e&&s.every(((t,i)=>t===e[i]))||(e=s,i=t(...s)),i)};function ib(t,e,i=0,s){for(D(s)&&(s=t.length);i>>1;ud(t[n],e)>0?s=n:i=n+1}return i}const sb=(t,e)=>nb(0,t.length,(i=>e(t[i]))),nb=(t,e,i)=>{let s=t,n=e;for(;s=0?n=t:s=t+1}return s};function rb(t){return t}const ab=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),ob=t=>t<0?-t*t:t*t,lb=t=>-Math.log(-t),hb=t=>-Math.exp(-t),db=t=>isFinite(t)?Math.pow(10,t):t<0?0:t,cb=t=>10===t?db:t===Math.E?Math.exp:e=>Math.pow(t,e),ub=t=>t===Math.E?Math.log:10===t?Math.log10:2===t?Math.log2:(t=Math.log(t),e=>Math.log(e)/t),pb=t=>e=>Math.sign(e)*Math.log1p(Math.abs(e/t)),gb=t=>e=>Math.sign(e)*Math.expm1(Math.abs(e))*t;function mb(t,e){if(t=Number(t),e=Number(e),e-=t)return i=>(i-t)/e;const i=Number.isNaN(e)?NaN:.5;return()=>i}function _b(t,e,i){const s=t[0],n=t[1],r=e[0],a=e[1];let o,l;return nl(o(t))}function fb(t,e,i){let s;return s=1===t?t+2*i:t-e+2*i,t?s>0?s:1:0}function vb(t,e,i,s){return 1===i&&(i=0),fb(t,i,s)*(e/(1-i))}function yb(t,e){const i=(t[1]-t[0])/(e[1]-e[0]),s=t[0]-i*e[0];return[s,i+s]}function bb(t,e,i){const s=Math.min(t.length,e.length)-1,n=new Array(s),r=new Array(s);let a=-1;for(t[s]{const i=Math.floor(Math.log10(t)),s=t/Math.pow(10,i);let n;return n=e?s<1.5?1:s<3?2:s<7?5:10:s<=1?1:s<=2?2:s<=5?5:10,n*Math.pow(10,i)},Sb=Math.sqrt(50),Mb=Math.sqrt(10),kb=Math.sqrt(2),Ab=[1,2,5,10],wb=(t,e,i)=>{let s=1,n=t;const r=Math.floor((e-1)/2),a=Math.abs(t);return t>=0&&t<=Number.MIN_VALUE?n=0:t<0&&t>=-Number.MIN_VALUE?n=-(e-1):!i&&a<1?s=Eb(a).step:(i||a>1)&&(n=Math.floor(t)-r*s),s>0?(t>0?n=Math.max(n,0):t<0&&(n=Math.min(n,-(e-1)*s)),tb(0,e).map((t=>n+t*s))):t>0?Lb(0,-(e-1)/s,s):Lb((e-1)/s,0,s)},Tb=eb(((t,e,i,s)=>{let n,r,a,o,l=-1;if(i=+i,(t=+t)==(e=+e))return[t];if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return[t];if((n=e0){let i=Math.round(t/o),s=Math.round(e/o);for(i*oe&&--s,a=new Array(r=s-i+1);++le&&--s,a=new Array(r=s-i+1);++l{let s,n,r=-1;if(i>0){let a=Math.floor(t/i),o=Math.ceil(e/i);for((a+1)*ie&&--o,n=new Array(s=o-a+1);++re&&--o,n=new Array(s=o-a+1);++r{let n,r,a;if(i=+i,(t=+t)==(e=+e))return wb(t,i,null==s?void 0:s.noDecimals);if(Math.abs(t-e)<=Number.MIN_VALUE&&i>0)return wb(t,i,null==s?void 0:s.noDecimals);(n=e0){let s=1;const{power:n,gap:a}=o,h=10===a?2*10**n:1*10**n;for(;s<=5&&(r=Lb(t,e,l),r.length>i+1)&&i>2;)l+=h,s+=1;i>2&&r.length{let s;const n=t[0],r=t[t.length-1],a=e-t.length;if(r<=0){const e=[];for(s=a;s>=1;s--)e.push(n-s*i);return e.concat(t)}if(n>=0){for(s=1;s<=a;s++)t.push(r+s*i);return t}let o=[];const l=[];for(s=1;s<=a;s++)s%2==0?o=[n-Math.floor(s/2)*i].concat(o):l.push(r+Math.ceil(s/2)*i);return o.concat(t).concat(l)})(r,i,l))}else(null==s?void 0:s.noDecimals)&&l<0&&(l=1),r=Lb(t,e,l);return n&&r.reverse(),r})),Eb=t=>{const e=Math.floor(Math.log(t)/Math.LN10),i=t/10**e;let s=Ab[0];return i>=Sb?s=Ab[3]:i>=Mb?s=Ab[2]:i>=kb&&(s=Ab[1]),e>=0?{step:s*10**e,gap:s,power:e}:{step:-(10**-e)/s,gap:s,power:e}};function Db(t,e,i){const s=(e-t)/Math.max(0,i);return Eb(s)}function Pb(t,e,i){let s;if(i=+i,(t=+t)==(e=+e)&&i>0)return[t];if(i<=0||0===(s=function(t,e,i){return(e-t)/Math.max(1,i-1)}(t,e,i))||!isFinite(s))return[];const n=new Array(i);for(let e=0;e0;){if(s=Db(a,o,e).step,s===i)return t[n]=a,t[r]=o,t;if(s>0)a=Math.floor(a/s)*s,o=Math.ceil(o/s)*s;else{if(!(s<0))break;a=Math.ceil(a*s)/s,o=Math.floor(o*s)/s}i=s}}function Ib(t,e){const i=h(e.forceMin),s=h(e.forceMax);let n=null;const r=[];let a=null;const o=i&&s?t=>t>=e.forceMin&&t<=e.forceMax:i?t=>t>=e.forceMin:s?t=>t<=e.forceMax:null;return i?r[0]=e.forceMin:h(e.min)&&e.min<=Math.min(t[0],t[t.length-1])&&(r[0]=e.min),s?r[1]=e.forceMax:h(e.max)&&e.max>=Math.max(t[0],t[t.length-1])&&(r[1]=e.max),h(r[0])&&h(r[1])?(a=t.slice(),a[0]=r[0],a[a.length-1]=r[1]):n=h(r[0])||h(r[1])?h(r[0])?"max":"min":"all",{niceType:n,niceDomain:a,niceMinMax:r,domainValidator:o}}const Bb=(t,e,i)=>Math.abs(e-t)<1?+i.toFixed(1):Math.round(+i),Fb=eb(((t,e,i,s,n,r,a)=>{let o=t,l=e;const h=l0){for(;u<=p;++u)for(d=1;dl)break;g.push(c)}}else for(;u<=p;++u)for(d=s-1;d>=1;--d)if(c=u>0?d/r(-u):d*r(u),!(cl)break;g.push(c)}2*g.length0!==t)),(null==a?void 0:a.noDecimals)&&(g=Array.from(new Set(g.map((t=>Math.floor(t)))))),h?g.reverse():g})),Yb=eb(((t,e,i,s,n,r)=>{const a=[],o={},l=n(t),h=n(e);let d=[];if(Number.isInteger(s))d=Cb(l,h,i);else{const t=(h-l)/(i-1);for(let e=0;e{const n=r(i),l=Number.isInteger(s)?Bb(t,e,n):Bb(t,e,xb(n)),h=Bb(t,e,((t,e)=>{let i,s;return e[0]1&&(o[h]=1,a.push(h))})),a})),jb=eb(((t,e,i,s,n)=>Pb(s(t),s(e),i).map((t=>xb(n(t))))));eb(((t,e,i,s,n)=>Ob(s(t),s(e),i).map((t=>xb(n(t))))));class Hb{constructor(){this._rangeFactorStart=null,this._rangeFactorEnd=null}_calculateWholeRange(t){return this._wholeRange?this._wholeRange:M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?(this._wholeRange=yb(t,[this._rangeFactorStart,this._rangeFactorEnd]),this._wholeRange):t}rangeFactor(t,e,i){return t?(2===t.length&&t.every((t=>t>=0&&t<=1))&&(this._wholeRange=null,0===t[0]&&1===t[1]?(this._rangeFactorStart=null,this._rangeFactorEnd=null):(this._rangeFactorStart=t[0],this._rangeFactorEnd=t[1])),this):i?(this._wholeRange=null,this._rangeFactorStart=null,this._rangeFactorEnd=null,this):M(this._rangeFactorStart)&&M(this._rangeFactorEnd)?[this._rangeFactorStart,this._rangeFactorEnd]:null}rangeFactorStart(t,e){var i;return D(t)?this._rangeFactorStart:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!D(this._rangeFactorEnd)&&1!==this._rangeFactorEnd?(this._rangeFactorStart=t,this._rangeFactorEnd=null!==(i=this._rangeFactorEnd)&&void 0!==i?i:1):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}rangeFactorEnd(t,e){var i;return D(t)?this._rangeFactorEnd:(t>=0&&t<=1&&(this._wholeRange=null,0!==t||!D(this._rangeFactorStart)&&0!==this._rangeFactorStart?(this._rangeFactorEnd=t,this._rangeFactorStart=null!==(i=this._rangeFactorStart)&&void 0!==i?i:0):(this._rangeFactorStart=null,this._rangeFactorEnd=null)),this)}generateFishEyeTransform(){var t;if(!this._fishEyeOptions)return void(this._fishEyeTransform=null);const{distortion:e=2,radiusRatio:i=.1,radius:s}=this._fishEyeOptions,n=this.range(),r=n[0],a=n[n.length-1],o=Math.min(r,a),l=Math.max(r,a),h=Ps(null!==(t=this._fishEyeOptions.focus)&&void 0!==t?t:0,o,l),d=D(s)?(l-o)*i:s;let c=Math.exp(e);c=c/(c-1)*d;const u=e/d;this._fishEyeTransform=t=>{const e=Math.abs(t-h);if(e>=d)return t;if(e<=1e-6)return h;const i=c*(1-Math.exp(-e*u))/e*.75+.25;return h+(t-h)*i}}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}get(t,e){var i;return null!==(i=null==this?void 0:this[t])&&void 0!==i?i:e}}function zb(t,e){const i=t.r,s=e.r,n=t.g,r=e.g,a=t.b,o=e.b,l=t.opacity,h=e.opacity;return t=>{const e=Math.round(i*(1-t)+s*t),d=Math.round(n*(1-t)+r*t),c=Math.round(a*(1-t)+o*t);return new Ws(e,d,c,l*(1-t)+h*t)}}function Nb(t,e){return i=>t*(1-i)+e*i}function Vb(t,e){return function(i){return Math.round(t*(1-i)+e*i)}}const Wb=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Gb=new RegExp(Wb.source,"g"),{Zr:Ub}=t;function $b(t,e){const i=typeof e;let s;if(D(e)||"boolean"===i)return()=>e;if("number"===i)return Nb(t,e);if("string"===i){if(s=Vs.parseColorString(e)){const e=Ub(Vs.parseColorString(t),s);return t=>e(t).formatRgb()}return Nb(Number(t),Number(e))}return e instanceof Ws?Ub(t,e):e instanceof Vs?Ub(t.color,e.color):e instanceof Date?function(t,e){const i=t.valueOf(),s=e.valueOf(),n=new Date;return t=>(n.setTime(i*(1-t)+s*t),n)}(t,e):Nb(Number(t),Number(e))}function Xb(t,e){let i;return t>e&&(i=t,t=e,e=i),i=>Math.max(t,Math.min(e,i))}class Kb extends Hb{constructor(t=rb,e=rb){super(),this._unknown=void 0,this.transformer=t,this.untransformer=e,this._forceAlign=!0,this._domain=[0,1],this._range=[0,1],this._clamp=rb,this._piecewise=_b,this._interpolate=$b}calculateVisibleDomain(t){var e;return M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:null!==(e=this._niceDomain)&&void 0!==e?e:this._domain}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._clamp(t)));return this._fishEyeTransform?this._fishEyeTransform(i):i}invert(t){var e;return this._input||(this._input=this._piecewise(this._calculateWholeRange(this._range),(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this.transformer),Nb)),this._clamp(this.untransformer(this._input(t)))}domain(t,e){var i;if(!t)return(null!==(i=this._niceDomain)&&void 0!==i?i:this._domain).slice();this._domainValidator=null,this._niceType=null,this._niceDomain=null;const s=Array.from(t,pd);return this._domain=s,this.rescale(e)}range(t,e){if(!t)return this._range.slice();const i=Array.from(t);return this._range=i,this.rescale(e)}rangeRound(t,e){const i=Array.from(t);return this._range=i,this._interpolate=Vb,this.rescale(e)}rescale(t){var e;if(t)return this;const i=null!==(e=this._niceDomain)&&void 0!==e?e:this._domain,s=i.length,n=this._range.length;let r=Math.min(s,n);if(s&&s=2?(e-i[s-2])/t:0;for(let n=1;n<=t;n++)i[s-2+n]=e-a*(t-n);r=n}return this._autoClamp&&(this._clamp=Xb(i[0],i[r-1])),this._piecewise=r>2?bb:_b,this._output=this._input=null,this._wholeRange=null,this.generateFishEyeTransform(),this}clamp(t,e,i){return arguments.length?(e?(this._autoClamp=!1,this._clamp=e):(this._autoClamp=!!t,this._clamp=t?void 0:rb),this.rescale(i)):this._clamp!==rb}interpolate(t,e){return arguments.length?(this._interpolate=t,this.rescale(e)):this._interpolate}ticks(t=10){return[]}tickData(t=10){const e=this.ticks(t);return(null!=e?e:[]).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0])/(this._range[1]-this._range[0])})))}rangeFactor(t,e){return t?(super.rangeFactor(t),this._output=this._input=null,this):super.rangeFactor()}rangeFactorStart(t,e){return D(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this._output=this._input=null,this)}rangeFactorEnd(t,e){return D(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this._output=this._input=null,this)}forceAlignDomainRange(t){return arguments.length?(this._forceAlign=t,this):this._forceAlign}}class qb extends Kb{constructor(){super(...arguments),this.type=Kh.Linear}clone(){return(new qb).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}tickFormat(){return()=>{}}d3Ticks(t=10,e){const i=this.calculateVisibleDomain(this._range);return Tb(i[0],i[i.length-1],t,e)}ticks(t=10,e){var i;if(ys(null==e?void 0:e.customTicks))return e.customTicks(this,t);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&(this._rangeFactorStart>0||this._rangeFactorEnd<1)&&2===this._range.length||!this._niceType)return this.d3Ticks(t,e);const s=null!==(i=this._niceDomain)&&void 0!==i?i:this._domain,n=this._domain,r=s[0],a=s[s.length-1];let o=Cb(n[0],n[n.length-1],t,e);if(!o.length)return o;if(this._domainValidator)o=o.filter(this._domainValidator);else if((o[0]!==r||o[o.length-1]!==a)&&this._niceType){const t=s.slice();if("all"===this._niceType?(t[0]=o[0],t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()):"min"===this._niceType&&o[0]!==r?(t[0]=o[0],this._niceDomain=t,this.rescale()):"max"===this._niceType&&o[o.length-1]!==a&&(t[t.length-1]=o[o.length-1],this._niceDomain=t,this.rescale()),"all"!==this._niceType){const e=Math.min(t[0],t[t.length-1]),i=Math.max(t[0],t[t.length-1]);o=o.filter((t=>t>=e&&t<=i))}}return o}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return Pb(e[0],e[e.length-1],t)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return Ob(e[0],e[e.length-1],t)}nice(t=10,e){var i,s;const n=this._domain;let r=[];if(e){const t=Ib(n,e);if(r=t.niceMinMax,this._domainValidator=t.domainValidator,this._niceType=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else this._niceType="all";if(this._niceType){const e=Rb(n.slice(),t);"min"===this._niceType?e[e.length-1]=null!==(i=r[1])&&void 0!==i?i:e[e.length-1]:"max"===this._niceType&&(e[0]=null!==(s=r[0])&&void 0!==s?s:e[0]),this._niceDomain=e,this.rescale()}return this}niceMin(t=10){this._niceType="min";const e=this._domain[this._domain.length-1],i=Rb(this.domain(),t);return i&&(i[i.length-1]=e,this._niceDomain=i,this.rescale()),this}niceMax(t=10){this._niceType="max";const e=this._domain[0],i=Rb(this._domain.slice(),t);return i&&(i[0]=e,this._niceDomain=i,this.rescale()),this}}const Zb=Symbol("implicit");class Jb extends Hb{specified(t){var e;return t?(this._specified=Object.assign(null!==(e=this._specified)&&void 0!==e?e:{},t),this):Object.assign({},this._specified)}_getSpecifiedValue(t){if(this._specified)return this._specified[t]}constructor(){super(),this.type=Kh.Ordinal,this._index=new Map,this._domain=[],this._ordinalRange=[],this._unknown=Zb}clone(){const t=(new Jb).domain(this._domain).range(this._ordinalRange).unknown(this._unknown);return this._specified&&t.specified(this._specified),t}calculateVisibleDomain(t){return M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&2===t.length?[this.invert(t[0]),this.invert(t[1])]:this._domain}scale(t){const e=`${t}`,i=this._getSpecifiedValue(e);if(void 0!==i)return i;let s=this._index.get(e);if(!s){if(this._unknown!==Zb)return this._unknown;s=this._domain.push(t),this._index.set(e,s)}const n=this._ordinalRange[(s-1)%this._ordinalRange.length];return this._fishEyeTransform?this._fishEyeTransform(n):n}invert(t){let e=0;for(;ei&&a>1;)a-=1,r=Math.floor((e-t)/a);return Qb(t,e,r,n)}class ex extends Jb{constructor(t){super(),this.type=Kh.Band,this._range=[0,1],this._step=void 0,this._bandwidth=void 0,this._isFixed=!1,this._round=!1,this._paddingInner=0,this._paddingOuter=0,this._align=.5,this._unknown=void 0,delete this.unknown,this.rescale(t)}rescale(t,e){if(t)return this;this._wholeRange=null;const i=this._calculateWholeRange(this._range,e),s=super.domain().length,n=i[1]this._maxBandwidth?(this._bandwidth=this._maxBandwidth,this._isFixed=!0):(this._bandwidth=i,this._isFixed=!1)}if(this.isBandwidthFixed()){const i=vb(super.domain().length,this._bandwidth,this._paddingInner,this._paddingOuter)*Math.sign(t[1]-t[0]),s=Math.min((t[1]-t[0])/i,1);if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)){if(i>0){const e=t[0]-i*this._rangeFactorStart,s=e+i;this._wholeRange=[e,s]}else{const e=t[1]+i*(1-this._rangeFactorEnd),s=e-i;this._wholeRange=[s,e]}const n=this._rangeFactorStart+s<=1,r=this._rangeFactorEnd-s>=0;"rangeFactorStart"===e&&n?this._rangeFactorEnd=this._rangeFactorStart+s:"rangeFactorEnd"===e&&r?this._rangeFactorStart=this._rangeFactorEnd-s:t[0]<=t[1]?n?this._rangeFactorEnd=this._rangeFactorStart+s:r?this._rangeFactorStart=this._rangeFactorEnd-s:(this._rangeFactorStart=0,this._rangeFactorEnd=s):r?this._rangeFactorStart=this._rangeFactorEnd-s:n?this._rangeFactorEnd=this._rangeFactorStart+s:(this._rangeFactorStart=1-s,this._rangeFactorEnd=1)}else this._rangeFactorStart=0,this._rangeFactorEnd=s,this._wholeRange=[t[0],t[0]+i];return this._wholeRange}return super._calculateWholeRange(t)}calculateWholeRangeSize(){const t=this._calculateWholeRange(this._range);return Math.abs(t[1]-t[0])}calculateVisibleDomain(t){const e=this._domain;if(M(this._rangeFactorStart)&&M(this._rangeFactorEnd)&&e.length){const i=this._getInvertIndex(t[0]),s=this._getInvertIndex(t[1]);return e.slice(Math.min(i,s),Math.max(i,s)+1)}return e}domain(t,e){return t?(super.domain(t),this.rescale(e)):super.domain()}range(t,e){return t?(this._range=[pd(t[0]),pd(t[1])],this.rescale(e)):this._range}rangeRound(t,e){return this._range=[pd(t[0]),pd(t[1])],this._round=!0,this.rescale(e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return-1===t?e:tx(0,e.length-1,t,!1).map((t=>e[t]))}tickData(t=10){return this.ticks(t).map(((t,e)=>({index:e,tick:t,value:(this.scale(t)-this._range[0]+this._bandwidth/2)/(this._range[1]-this._range[0])})))}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return tx(0,e.length-1,t,!0).filter((t=>te[t]))}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return function(t,e,i){let s;if(i=Xb(1,(e=Math.floor(+e))-(t=Math.floor(+t))+1)(Math.floor(+i)),s=ee[t]))}_getInvertIndex(t){let e=0;const i=this.step()/2,s=this.bandwidth()/2,n=this._domain.length,r=this.range(),a=r[0]>r[r.length-1];for(e=0;e=0&&e<=n-1?e:n-1}invert(t){return this._domain[this._getInvertIndex(t)]}padding(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(Array.isArray(t)?Math.min.apply(null,t):t)),this._paddingInner=this._paddingOuter,this.rescale(e)):this._paddingInner}paddingInner(t,e){return void 0!==t?(this._paddingInner=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingInner}paddingOuter(t,e){return void 0!==t?(this._paddingOuter=Math.max(0,Math.min(1,t)),this.rescale(e)):this._paddingOuter}step(){return this._step}round(t,e){return void 0!==t?(this._round=t,this.rescale(e)):this._round}align(t,e){return void 0!==t?(this._align=Math.max(0,Math.min(1,t)),this.rescale(e)):this._align}rangeFactor(t,e){return t?(super.rangeFactor(t),this.rescale(e)):super.rangeFactor()}rangeFactorStart(t,e){return D(t)?super.rangeFactorStart():(super.rangeFactorStart(t),this.rescale(e,"rangeFactorStart"))}rangeFactorEnd(t,e){return D(t)?super.rangeFactorEnd():(super.rangeFactorEnd(t),this.rescale(e,"rangeFactorEnd"))}bandwidth(t,e){return t?("auto"===t?(this._bandwidth=void 0,this._isFixed=!1):(this._bandwidth=t,this._isFixed=!0),this._userBandwidth=t,this.rescale(e)):this._bandwidth}maxBandwidth(t,e){return t?(this._maxBandwidth="auto"===t?void 0:t,this.rescale(e)):this._maxBandwidth}minBandwidth(t,e){return t?(this._minBandwidth="auto"===t?void 0:t,this.rescale(e)):this._minBandwidth}fishEye(t,e,i){return t||i?(this._fishEyeOptions=t,this._fishEyeTransform=null,this.rescale(e)):this._fishEyeOptions}isBandwidthFixed(){return this._isFixed&&!!this._bandwidth}_isBandwidthFixedByUser(){return this._isFixed&&this._userBandwidth&&h(this._userBandwidth)}clone(){var t,e,i;return new ex(!0).domain(this._domain,!0).range(this._range,!0).round(this._round,!0).paddingInner(this._paddingInner,!0).paddingOuter(this._paddingOuter,!0).align(this._align,!0).bandwidth(null!==(t=this._userBandwidth)&&void 0!==t?t:"auto",!0).maxBandwidth(null!==(e=this._maxBandwidth)&&void 0!==e?e:"auto",!0).minBandwidth(null!==(i=this._maxBandwidth)&&void 0!==i?i:"auto")}}class ix{constructor(){this.type=Kh.Threshold,this._range=[0,1],this._domain=[.5],this.n=1}unknown(t){return arguments.length?(this._unknown=t,this):this._unknown}scale(t){return!D(t)&&qo(+t)?this._range[ib(this._domain,t,0,this.n)]:this._unknown}invertExtent(t){const e=this._range.indexOf(t);return[this._domain[e-1],this._domain[e]]}domain(t){return t?(this._domain=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._domain.slice()}range(t){return t?(this._range=Array.from(t),this.n=Math.min(this._domain.length,this._range.length-1),this):this._range.slice()}clone(){return(new ix).domain(this._domain).range(this._range).unknown(this._unknown)}}class sx extends Jb{range(t){return t?(this._range=t,this._resetRange(),this):super.range()}domain(t){return t?(super.domain(t),this._resetRange(),this):super.domain()}_resetRange(){if(!Al(this._range))return void super.range(this._range);const t=Sl(this._range,this._domain);super.range(t)}}const nx={linear:qb,band:ex,point:class extends ex{constructor(t){super(!1),this.type=Kh.Point,this._padding=0,this.paddingInner(1,t),this.padding=this.paddingOuter,this.paddingInner=void 0,this.paddingOuter=void 0}},ordinal:Jb,threshold:ix,colorOrdinal:sx};function rx(t){const e=nx[t];return e?new e:null}function ax(t,e){if(!e)return t;const i=e.range(),s=Math.min(i[0],i[i.length-1]),n=Math.max(i[0],i[i.length-1]);return Math.min(Math.max(s,t),n)}function ox(t){return M(null==t?void 0:t.field)&&M(null==t?void 0:t.scale)}const lx=["linear","radial","conical"],hx={linear:{x0:0,y0:0,x1:1,y1:1},radial:{x0:0,y0:0,x1:1,y1:1,r0:0,r1:1},conical:{x:.5,y:.5,startAngle:0,endAngle:2*Math.PI}},dx=["line","area","trail"];function cx(t){return dx.includes(t)}class ux extends Fy{getStateInfoList(){return this._stateInfoList}constructor(t,e){super(t),this._stateInfoList=[],this._mark=e}_getDefaultStateMap(){return{markUpdateRank:1}}getStateInfo(t){return this._stateInfoList.find((e=>e.stateValue===t))}addStateInfo(t){if(this.getStateInfo(t.stateValue))return;t.level=t.level||0;let e=!0;for(let i=0;it.level){this._stateInfoList.splice(i,0,t),e=!1;break}}e&&this._stateInfoList.push(t)}_clearStateBeforeSet(t){t.datums=null,t.items=null,t.fields=null,t.filter=null}changeStateInfo(t){const e=this.getStateInfo(t.stateValue);if(e){if(void 0!==t.datums&&(this._clearStateBeforeSet(e),e.datums=t.datums,e.datumKeys=t.datumKeys),void 0!==t.items&&(this._clearStateBeforeSet(e),e.items=t.items),void 0!==t.fields)if(this._clearStateBeforeSet(e),null===t.fields)e.fields=t.fields;else{e.fields=e.fields||{};for(const i in t.fields){const s=t.fields[i];e.fields[i]=e.fields[i]||{};const n=e.fields[i];M(s.domain)&&(n.domain=s.domain),M(s.type)&&(n.type=s.type)}}t.filter&&(this._clearStateBeforeSet(e),e.filter=t.filter)}else this.addStateInfo(t)}clearStateInfo(t){t.forEach((t=>{this.getStateInfo(t)&&this.changeStateInfo({stateValue:t,datumKeys:null,datums:null,fields:null,items:null,filter:null,cache:{}})}))}checkOneState(t,e,i,s){var n;s=v(cx)?s:!t.mark||cx(t.mark.markType);let r=!1,a=!1;if(M(i.datums)&&i.datums.length>0)r=this.checkDatumState(i,e,s),a=!0;else if(i.items)r=null!==(n=this.checkItemsState(i,t))&&void 0!==n&&n,a=!0;else if(i.fields)r=this.checkFieldsState(i,e,t,s),a=!0;else if(!r&&i.filter){const s={mark:this._mark,renderNode:t,type:t.mark.markType};r=i.filter(e,s),a=!0}return a?r?"in":"out":"skip"}checkState(t,e){const i=t.getStates().filter((t=>!!wy[t])).map((t=>[t,10])),s=!t.mark||cx(t.mark.markType);for(let n=0;nt[0]))}checkDatumState(t,e,i){let s=!1;const n=i?e[0]:e;if(y(t.datums)){const e=t.datumKeys||Object.keys(t.datums[0]).filter((t=>!t.startsWith(sh)));s=t.datums.some((t=>i&&y(null==t?void 0:t.items)?e.every((e=>{var i,s;return(null===(s=null===(i=null==t?void 0:t.items)||void 0===i?void 0:i[0])||void 0===s?void 0:s[e])===(null==n?void 0:n[e])})):e.every((e=>(null==t?void 0:t[e])===(null==n?void 0:n[e])))))}else s=vs(t.datums)?(t.datumKeys||Object.keys(t.datums).filter((t=>!t.startsWith(sh)))).every((e=>{var s,r;return i?(null===(s=t.datums.items)||void 0===s?void 0:s[0][e])===n[e]:(null===(r=t.datums)||void 0===r?void 0:r[e])===n[e]})):e===t.datums;return s}checkItemsState(t,e){var i;return null===(i=t.items)||void 0===i?void 0:i.includes(e)}checkFieldsState(t,e,i,s){var n;let r=!0;for(const a in t.fields){const o=t.fields[a],l=o.type,h=o.domain,d=s?null===(n=e[0])||void 0===n?void 0:n[a]:e[a];if(Jh(l)&&h.length>1){if(this.checkLinearFieldState(h,a,e,i,s)){r=!1;break}r=!0}else{if(!h.some((t=>t===d))){r=!1;break}r=!0}}return r}checkLinearFieldState(t,e,i,s,n){var r;const a=n?null===(r=i[0])||void 0===r?void 0:r[e]:i[e];return at[t.length-1]}updateLayoutState(t){return this._stateMap.markUpdateRank++,this.updateState({markUpdateRank:this._stateMap.markUpdateRank},t)}compileState(t,e){t.state({callback:(t,e)=>this.checkState(e,t)},e)}}class px extends Ry{getDataView(){return this._data}setDataView(t){this._data=t}getLatestData(){var t;return null===(t=this._data)||void 0===t?void 0:t.latestData}constructor(t,e){super(t),this.grammarType=r_.data,this._data=null,this._data=e}release(){super.release(),this._data=null}updateData(t){const e=this.getProduct(),i=this.getLatestData();if(e&&i&&(e.values(i),!t))return this.getCompiler().renderNextTick()}_compileProduct(){const t=this.getLatestData();D(t)||(D(this.getProduct())?this._initProduct(t):this._product.values(t))}_initProduct(t){var e,i;const s=this.getVGrammarView();if(!s||!t)return;const n=this.getProductId();this._product=null===(i=null===(e=null==s?void 0:s.data)||void 0===e?void 0:e.call(s,t))||void 0===i?void 0:i.id(n),this._compiledProductId=n}generateProductId(){var t;return`${null===(t=this.getDataView())||void 0===t?void 0:t.name}`}_lookupGrammar(t){var e,i;return null===(i=null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getDataById)||void 0===i?void 0:i.call(e,t)}}class gx extends px{constructor(t){super(t),this._mark=t.mark}setCompiledProductId(t){this._compiledProductId=t}generateProductId(){const t=super.generateProductId();return M(t)?t:`${sh}_markData_${this._mark.id}`}_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;D(e)||M(this.getProduct())||this._initProduct(e)}}var mx=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{this._unCompileChannel[t]||(this._option.noSeparateStyle||function(t,e,i){var s;const n=null===(s=e[t])||void 0===s?void 0:s.style;return!!function(t,e){return("fill"===t||"stroke"===t)&&(null==e?void 0:e.gradient)&&(null==e?void 0:e.stops)}(t,n)||!!ys(n)||!(!(null==n?void 0:n.scale)||n.field===i)}(t,i,this.getGroupKey())?n[t]={callback:this.compileCommonAttributeCallback(t,"normal"),dependency:[this.stateKeyToSignalName("markUpdateRank")]}:s[t]=this.compileCommonAttributeCallback(t,"normal"))})),{enterStyles:s,updateStyles:n}}compileEncode(){const t=this.stateStyle,e=xy.STATE_NORMAL,i=(t[e],mx(t,["symbol"==typeof e?e:e+""])),{enterStyles:s,updateStyles:n}=this._separateStyle();this._product.encode(n,!0),this._product.encodeState("group",s,!0),Object.keys(i).forEach((t=>{const e={};Object.keys(i[t]).forEach((i=>{this._unCompileChannel[i]||(e[i]={callback:this.compileCommonAttributeCallback(i,t),dependency:[this.stateKeyToSignalName("markUpdateRank")]})})),this._product.encodeState(t,e,!0)})),this._skipBeforeLayouted&&this._product.layout({skipBeforeLayouted:this._skipBeforeLayouted})}compileState(){this.state.compileState(this._product,this._stateSort)}compileAnimation(){var t,e,i,s;if(this._animationConfig){let n;if("component"===this.type)n=null===(t=this.model.animate)||void 0===t?void 0:t.getAnimationStateSignalName();else{const t=null===(i=(e=this.model).getRegion)||void 0===i?void 0:i.call(e);n=null===(s=null==t?void 0:t.animate)||void 0===s?void 0:s.getAnimationStateSignalName()}this._product.animation(this._animationConfig),this._product.animationState({callback:(t,e,i)=>{var s;return null===(s=i[n])||void 0===s?void 0:s.callback(t,e)},dependency:n}),this._animationConfig.normal&&(this._animationConfig.appear?this._event.on(lc.ANIMATION_END,(({event:t})=>{t.mark===this.getProduct()&&t.animationState===zp.appear&&this.runAnimationByState(zp.normal)})):this._event.on(lc.AFTER_DO_RENDER,(()=>{this.runAnimationByState(zp.normal)})))}}compileContext(t){const e={interactive:this.getInteractive(),zIndex:this.getZIndex(),context:Object.assign({markId:this.id,modelId:this.model.id,markUserId:this._userId,modelUserId:this.model.userId},t),skipTheme:this.getSkipTheme(),support3d:this.getSupport3d(),enableSegments:!!this._enableSegments,clip:!!this._clip||!1!==this._clip&&void 0,clipPath:this._clip||void 0};this._progressiveConfig&&(e.progressiveStep=this._progressiveConfig.progressiveStep,e.progressiveThreshold=this._progressiveConfig.progressiveThreshold,e.large=this._progressiveConfig.large,e.largeThreshold=this._progressiveConfig.largeThreshold),e.morph=this._morph,e.morphKey=this._morphKey,e.morphElementKey=this._morphElementKey,this._setCustomizedShape&&(e.setCustomizedShape=this._setCustomizedShape),this._product.configure(e)}compileSignal(){this.state.compile()}_computeAttribute(t,e){return(t,e)=>{}}compileCommonAttributeCallback(t,e){const i=this._computeAttribute(t,e),s={mark:null,parent:null,element:null};return(t,e)=>(s.mark=e.mark,s.parent=e.mark.group,s.element=e,i(t,s))}compileTransform(){var t;(null===(t=this._transform)||void 0===t?void 0:t.length)&&this.getProduct().transform(this._transform)}_lookupGrammar(t){var e;return null===(e=this.getCompiler().getVGrammarView())||void 0===e?void 0:e.getMarkById(t)}updateState(t,e){return this.state.updateState(t,e)}updateLayoutState(t,e){return e&&this.getMarks().length>0&&this.getMarks().forEach((t=>t.state.updateLayoutState(!0))),this.state.updateLayoutState(t)}updateMarkState(t){if(!this._product)return;const e=this.state.getStateInfo(t);this._product.elements.forEach((i=>{"in"===this.state.checkOneState(i,i.getDatum(),e)?i.addState(t):i.removeState(t)}))}getMarks(){return[]}runAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.runAnimationByState(t)}stopAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.stopAnimationByState(t)}pauseAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.pauseAnimationByState(t)}resumeAnimationByState(t){var e,i;return null===(i=null===(e=this.getProduct())||void 0===e?void 0:e.animate)||void 0===i?void 0:i.resumeAnimationByState(t)}getProductElements(){const t=this.getProduct();if(t)return t.elements}release(){super.release(),this.state.release()}}var fx=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);ne(t(...i)):e(t)}convertAngleToRadian(t){return this._transformStyleValue(t,At)}isUserLevel(t){return[Py.User_Mark,Py.User_Series,Py.User_Chart,Py.User_SeriesStyle].includes(t)}setStyle(t,e="normal",i=0,s=this.stateStyle){if(D(t))return;void 0===s[e]&&(s[e]={});const n=this.isUserLevel(i);Object.keys(t).forEach((r=>{let a=t[r];D(a)||(a=this._filterAttribute(r,a,e,i,n,s),this.setAttribute(r,a,e,i,s))}))}getStyle(t,e="normal"){var i;return null===(i=this.stateStyle[e][t])||void 0===i?void 0:i.style}_filterAttribute(t,e,i,s,n,r=this.stateStyle){let a=this._styleConvert(e);if(n)switch(t){case"angle":a=this.convertAngleToRadian(a);break;case"innerPadding":case"outerPadding":a=this._transformStyleValue(a,(t=>-t));break;case"curveType":a=this._transformStyleValue(a,(t=>{return e=t,i=this._option.model.direction,"monotone"===e?"horizontal"===i?"monotoneY":"monotoneX":e;var e,i}))}return a}setReferer(t,e,i,s=this.stateStyle){var n;if(t)if(e&&i){const r=null!==(n=s[i])&&void 0!==n?n:{[e]:{}};s[i][e]=Object.assign(Object.assign({},r[e]),{referer:t})}else Object.entries(s).forEach((([e,i])=>{Object.entries(i).forEach((([i,n])=>{s[e][i].referer=t}))}))}setPostProcess(t,e,i="normal"){var s;(null===(s=this.stateStyle[i])||void 0===s?void 0:s[t])&&(this.stateStyle[i][t].postProcess=e)}getAttribute(t,e,i="normal",s){return this._computeAttribute(t,i)(e,s)}setAttribute(t,e,i="normal",s=0,n=this.stateStyle){var r;void 0===n[i]&&(n[i]={}),void 0===n[i][t]&&(n[i][t]={level:s,style:e,referer:void 0});const a=null===(r=n[i][t])||void 0===r?void 0:r.level;M(a)&&a<=s&&Tl(n[i][t],{style:e,level:s}),"normal"!==i&&t in this._extensionChannel&&this._extensionChannel[t].forEach((t=>{void 0===n[i][t]&&(n[i][t]=n.normal[t])}))}_getDefaultStyle(){return{visible:!0,x:0,y:0}}_styleConvert(t){if(!t)return t;if(Qh(t.type)||t.scale){const e=function(t,e){if("scale"in t&&t.scale)return S(t.scale)&&(null==e?void 0:e.globalScale)?e.globalScale.registerMarkAttributeScale(t,e.seriesId):t.scale;const i=rx(t.type);return i&&function(t,e){t&&e&&(e.domain&&t.domain(e.domain),e.range&&t.range(e.range),e.specified&&t.specified&&t.specified(e.specified))}(i,t),i}(t,{globalScale:this._option.globalScale,seriesId:this._option.seriesId});if(e)return{scale:e,field:t.field,changeDomain:t.changeDomain}}return t}_computeAttribute(t,e){var i;let s=null===(i=this.stateStyle[e])||void 0===i?void 0:i[t];s||(s=this.stateStyle.normal[t]);const n=this._computeStateAttribute(s,t,e),r=ys(null==s?void 0:s.postProcess),a=t in this._computeExChannel;if(r&&a){const i=this._computeExChannel[t];return(r,a)=>{let o=n(r,a);return o=s.postProcess(o,r,this._attributeContext,a,this.getDataView()),i(t,r,e,a,o)}}if(r)return(t,e)=>s.postProcess(n(t,e),t,this._attributeContext,e,this.getDataView());if(a){const i=this._computeExChannel[t];return(s,r)=>i(t,s,e,r,n(s,r))}return n}_computeStateAttribute(t,e,i){var s;return t?t.referer?t.referer._computeAttribute(e,i):t.style?"function"==typeof t.style?(e,i)=>t.style(e,this._attributeContext,i,this.getDataView()):lx.includes(t.style.gradient)?this._computeGradientAttr(t.style):["outerBorder","innerBorder"].includes(e)?this._computeBorderAttr(t.style):Qh(null===(s=t.style.scale)||void 0===s?void 0:s.type)?(e,i)=>{let s=e;return"series"===this.model.modelType&&this.model.getMarkData&&(s=this.model.getMarkData(e)),t.style.scale.scale(s[t.style.field])}:(e,i)=>t.style:(e,i)=>t.style:(t,e)=>{}}_initStyle(){const t=this._getDefaultStyle();this.setStyle(t,"normal",0)}_initSpecStyle(t,e,i){t.style&&this.setStyle(t.style,"normal",Py.User_Mark,e);const s=t.state;s&&Object.keys(s).forEach((t=>{const i=s[t];if("style"in i){const s=i.style;let n={stateValue:t};"level"in i&&(n.level=i.level),"filter"in i&&(n=ys(i.filter)?Object.assign({filter:i.filter},n):Object.assign(Object.assign({},i.filter),n)),this.state.addStateInfo(n),this.setStyle(s,t,Py.User_Mark,e)}else this.setStyle(i,t,Py.User_Mark,e)}))}_computeGradientAttr(t){var e,i;const{gradient:s,scale:n,field:r}=t,a=fx(t,["gradient","scale","field"]);let o=n,l=r;if(!(n&&r||"series"!==this.model.modelType)){const{scale:t,field:e}=this.model.getColorAttribute();n||(o=t),l||(l=e)}const h=Sl(xl(this.model.getColorScheme(),"series"===this.model.modelType?null===(i=(e=this.model).getSpec)||void 0===i?void 0:i.call(e):void 0),this.model.getDefaultColorDomain()),d=Object.assign(Object.assign({},hx[s]),a);return(t,e)=>{const i={},n=this.getDataView();return Object.keys(d).forEach((s=>{const r=d[s];"stops"===s?i.stops=r.map((i=>{const{opacity:s,color:r,offset:a}=i;let d=null!=r?r:null==o?void 0:o.scale(t[l]);return ys(r)&&(d=r(t,this._attributeContext,e,n)),M(s)&&(d=Vs.SetOpacity(d,s)),{offset:ys(a)?a(t,this._attributeContext,e,n):a,color:d||h[0]}})):ys(r)?i[s]=r(t,this._attributeContext,e,n):i[s]=r})),i.gradient=s,i}}_computeBorderAttr(t){const{scale:e,field:i}=t,s=fx(t,["scale","field"]);return(t,n)=>{var r,a,o;const l={};if(Object.keys(s).forEach((e=>{const i=s[e];ys(i)?l[e]=i(t,this._attributeContext,n,this.getDataView()):l[e]=i})),"stroke"in l)lx.includes(null===(o=s.stroke)||void 0===o?void 0:o.gradient)&&(l.stroke=this._computeGradientAttr(s.stroke)(t,n));else{const s=Sl(xl(this.model.getColorScheme(),"series"===this.model.modelType?null===(a=(r=this.model).getSpec)||void 0===a?void 0:a.call(r):void 0),this.model.getDefaultColorDomain());let n=e,o=i;if(!(e&&i||"series"!==this.model.modelType)){const{scale:i,field:r}=this.model.getColorAttribute();e||(n=i),o||(o=r),l.stroke=(null==n?void 0:n.scale(t[o]))||s[0]}}return l}}}class yx extends Qn{constructor(t){super({x:0,y:0}),this.type="shadowroot",this.shadowHost=t}clearUpdateBoundTag(){super.clearUpdateBoundTag(),this.shadowHost&&this.shadowHost.clearUpdateBoundTag()}addUpdateBoundTag(){super.addUpdateBoundTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}addUpdateShapeAndBoundsTag(){super.addUpdateShapeAndBoundsTag(),this.shadowHost&&this.shadowHost.addUpdateBoundTag()}tryUpdateGlobalTransMatrix(t=!0){if(this.shouldUpdateGlobalMatrix()){const e=this.transMatrix;this._globalTransMatrix?this._globalTransMatrix.setValue(e.a,e.b,e.c,e.d,e.e,e.f):this._globalTransMatrix=e.clone(),this.doUpdateGlobalMatrix(),t&&this.clearUpdateGlobalPositionTag()}return this._globalTransMatrix}doUpdateGlobalMatrix(){if(this.shadowHost){const t=this.shadowHost.globalTransMatrix;this._globalTransMatrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f)}}tryUpdateGlobalAABBBounds(){return this._globalAABBBounds?this._globalAABBBounds.setValue(this._AABBBounds.x1,this._AABBBounds.y1,this._AABBBounds.x2,this._AABBBounds.y2):this._globalAABBBounds=this._AABBBounds.clone(),this.shadowHost&&this._globalAABBBounds.transformWithMatrix(this.shadowHost.globalTransMatrix),this._globalAABBBounds}}function bx(t){return new yx(t)}function xx(){xx.__loaded||(xx.__loaded=!0,ra.RegisterGraphicCreator("shadowRoot",bx))}xx.__loaded=!1;const Sx=xx,Mx=["innerRadius","outerRadius","startAngle","endAngle","cornerRadius","padAngle","padRadius","cap",...fn];class kx extends Mn{constructor(t){super(t),this.type="arc",this.numberType=Pn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,outerRadius:i,innerRadius:s}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)&&this._validNumber(s)}getParsedCornerRadius(){const t=this.getGraphicTheme(),{cornerRadius:e=t.cornerRadius,innerPadding:i=t.innerPadding,outerPadding:s=t.outerPadding}=this.attribute;let{outerRadius:n=t.outerRadius,innerRadius:r=t.innerRadius}=this.attribute;if(n+=s,r-=i,0===e||"0%"===e)return 0;const a=Math.abs(n-r),o=t=>Math.min(h(t,!0)?t:a*parseFloat(t)/100,a/2);if(y(e)){const t=e.map((t=>o(t)||0));return 0===t.length?[t[0],t[0],t[0],t[0]]:2===t.length?[t[0],t[1],t[0],t[1]]:(3===t.length&&t.push(0),t)}return o(e)}getParsedAngle(){const t=this.getGraphicTheme();let{startAngle:e=t.startAngle,endAngle:i=t.endAngle}=this.attribute;const{cap:s=t.cap}=this.attribute,n=i-e>=0?1:-1,r=i-e;if(e=((t=0)=>{if(t<0)for(;t<-ot;)t+=ot;else if(t>0)for(;t>ot;)t-=ot;return t})(e),i=e+r,s&&ht(r)nt&&o>nt)return{startAngle:e-n*u*r,endAngle:i+n*u*a,sc:n*u*r,ec:n*u*a}}return{startAngle:e,endAngle:i}}getParsePadAngle(t,e){const i=this.getGraphicTheme(),{innerPadding:s=i.innerPadding,outerPadding:n=i.outerPadding,padAngle:r=i.padAngle}=this.attribute;let{outerRadius:a=i.outerRadius,innerRadius:o=i.innerRadius}=this.attribute;a+=n,o-=s;const{padRadius:l=mt(a*a+o*o)}=this.attribute,h=ht(e-t);let d=t,c=e,u=t,p=e;const g=r/2;let m=h,_=h;if(g>nt&&l>nt){const i=e>t?1:-1;let s=ft(Number(l)/o*gt(g)),n=ft(Number(l)/a*gt(g));return(m-=2*s)>nt?(s*=i,u+=s,p-=s):(m=0,u=p=(t+e)/2),(_-=2*n)>nt?(n*=i,d+=n,c-=n):(_=0,d=c=(t+e)/2),{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}return{outerStartAngle:d,outerEndAngle:c,innerStartAngle:u,innerEndAngle:p,innerDeltaAngle:m,outerDeltaAngle:_}}getGraphicTheme(){return ps(this).arc}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateArcAABBBoundsImprecise(t,e,i):this.updateArcAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=xi.graphicService.updateTempAABBBounds(i);Uv(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2);const{lineJoin:a=e.lineJoin}=t;return xi.graphicService.transformAABBBounds(t,i,e,"miter"===a,this),i}updateArcAABBBoundsImprecise(t,e,i){let{outerRadius:s=e.outerRadius,innerRadius:n=e.innerRadius}=t;const{outerPadding:r=e.outerPadding,innerPadding:a=e.innerPadding}=t;return s+=r,n-=a,so){const t=l;l=o,o=t}return s<=nt?i.set(0,0,0,0):Math.abs(o-l)>lt-nt?i.set(-s,-s,s,s):(ln(l,o,s,i),ln(l,o,n,i)),i}needUpdateTags(t){return super.needUpdateTags(t,Mx)}needUpdateTag(t){return super.needUpdateTag(t,Mx)}toCustomPath(){const t=this.attribute,{startAngle:e,endAngle:i}=this.getParsedAngle();let s=t.innerRadius-(t.innerPadding||0),n=t.outerRadius-(t.outerPadding||0);const r=ht(i-e),a=i>e;if(n=lt-nt)o.moveTo(0+n*ct(e),0+n*gt(e)),o.arc(0,0,n,e,i,!a),s>nt&&(o.moveTo(0+s*ct(i),0+s*gt(i)),o.arc(0,0,s,i,e,a));else{const t=n*ct(e),r=n*gt(e),l=s*ct(i),h=s*gt(i);o.moveTo(0+t,0+r),o.arc(0,0,n,e,i,!a),o.lineTo(0+l,0+h),o.arc(0,0,s,i,e,a),o.closePath()}return o}clone(){return new kx(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return kx.NOWORK_ANIMATE_ATTR}}function Ax(t){return new kx(t)}kx.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Sn);class wx{constructor(){this.CLEAN_THRESHOLD=1e3,this.L_TIME=1e3,this.R_COUNT=1,this.R_TIMESTAMP_MAX_SIZE=20}clearCache(t,e){const{CLEAN_THRESHOLD:i=this.CLEAN_THRESHOLD,L_TIME:s=this.L_TIME,R_COUNT:n=this.R_COUNT}=e;if(t.size{r++,t.delete(e)},o=Date.now();return t.forEach(((t,e)=>{if(t.timestamp.length=n)););if(is;)t.timestamp.shift()})),r}addLimitedTimestamp(t,e,i){const{R_TIMESTAMP_MAX_SIZE:s=this.R_TIMESTAMP_MAX_SIZE}=i;t.timestamp.length>s&&t.timestamp.shift(),t.timestamp.push(e)}clearTimeStamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();t.forEach((t=>{for(;s-t.timestamp[0]>i;)t.timestamp.shift()}))}clearItemTimestamp(t,e){const{L_TIME:i=this.L_TIME}=e,s=Date.now();for(;s-t.timestamp[0]>i;)t.timestamp.shift()}}class Tx{static GetCanvas(){try{return Tx.canvas||(Tx.canvas=xi.global.createCanvas({})),Tx.canvas}catch(t){return null}}static GetCtx(){if(!Tx.ctx){const t=Tx.GetCanvas();Tx.ctx=t.getContext("2d")}return Tx.ctx}}class Lx extends wx{static getInstance(){return Lx._instance||(Lx._instance=new Lx),Lx._instance}constructor(t=[],e=100){super(),this.cacheParams={CLEAN_THRESHOLD:100,L_TIME:1e3},this.dataMap=new Map;const i=Tx.GetCanvas(),s=Tx.GetCtx();if(i.width=e,i.height=1,!s)return;if(s.translate(0,0),!s)throw new Error("获取ctx发生错误");const n=s.createLinearGradient(0,0,e,0);t.forEach((t=>{n.addColorStop(t[0],t[1])})),s.fillStyle=n,s.fillRect(0,0,e,1),this.rgbaSet=s.getImageData(0,0,e,1).data}getColor(t){const e=this.rgbaSet.slice(4*t,4*t+4);return`rgba(${e[0]}, ${e[1]}, ${e[2]}, ${e[3]/255})`}GetOrCreate(t,e,i,s,n=[],r=100){let a=`${t}${e}${i}${s}`;n.forEach((t=>a+=t.join())),a+=r;let o=this.dataMap.get(a);return o||(o={data:new Lx(n,r),timestamp:[]},this.addLimitedTimestamp(o,Date.now(),{}),this.dataMap.set(a,o)),this.clearCache(this.dataMap,this.cacheParams),o.data}}class Cx{static GetSize(t){for(let e=0;e=t)return Cx.ImageSize[e];return t}static Get(t,e,i,s,n,r,a){const o=Cx.GenKey(t,e,i,s,n),l=Cx.cache[o];if(!l||0===l.length)return null;for(let t=0;t=r&&l[t].height>=a)return l[t].pattern;return null}static Set(t,e,i,s,n,r,a,o){const l=Cx.GenKey(t,e,i,s,n);Cx.cache[l]?Cx.cache[l].push({width:a,height:o,pattern:r}):Cx.cache[l]=[{width:a,height:o,pattern:r}]}static GenKey(t,e,i,s,n){return`${e},${i},${s},${n},${t.join()}`}}Cx.cache={},Cx.ImageSize=[20,40,80,160,320,640,1280,2560];const Ex=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{innerPadding:_=l.innerPadding,outerPadding:f=l.outerPadding,startAngle:v=l.startAngle,endAngle:y=l.endAngle,opacity:b=l.opacity,x=l.x,y:S=l.y,scaleX:M=l.scaleX,scaleY:k=l.scaleY}=t.attribute;let{innerRadius:A=l.innerRadius,outerRadius:w=l.outerRadius}=t.attribute;w+=f,A-=_;const T=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Da(e,o,e.dpr),d=o/w,u="outerBorder"===r?1:-1;if(t.setAttributes({outerRadius:w+u*h,innerRadius:A-u*h,startAngle:v-u*d,endAngle:y+u*d}),e.beginPath(),Qa(t,e,i,s,w+u*h,A-u*h),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=b,e.setStrokeStyle(t,n,(x-i)/M,(S-s)/k,l[r]),l[r].opacity=a,e.stroke()}};g&&T(u,"outerBorder"),m&&T(p,"innerBorder"),t.setAttributes({outerRadius:w,innerRadius:A,startAngle:v,endAngle:y})}},Dx=Co,Px=go;var Ox=function(t,e){return function(i,s){e(i,s,t)}};let Rx=class extends bo{constructor(t){super(),this.arcRenderContribitions=t,this.numberType=Pn,this.builtinContributions=[Ex,Px,Dx],this.init(t)}drawArcTailCapPath(t,e,i,s,n,r,a,o){const l=o-a,h=t.getParsedAngle(),d=h.startAngle;let c=h.endAngle;c=o,ht(c-d);const u=c>d;let p=!1;if(nnt){const t=pt(b,y),r=pt(x,y),a=Za(f,v,m,_,n,t,Number(u)),o=Za(M,k,A,w,n,r,Number(u));if(y0&&e.arc(i+o.cx,s+o.cy,r,dt(o.y11,o.x11),dt(o.y01,o.x01),!u)}}else e.moveTo(i+m,s+_);if(!(r>nt)||L<.001)e.lineTo(i+A,s+w),p=!0;else if(T>nt){const t=pt(E,T),n=pt(D,T),a=Za(A,w,M,k,r,-n,Number(u)),o=Za(m,_,f,v,r,-t,Number(u));if(e.lineTo(i+a.cx+a.x01,s+a.cy+a.y01),T0&&e.arc(i+a.cx,s+a.cy,n,dt(a.y01,a.x01),dt(a.y11,a.x11),!u);const t=dt(a.cy+a.y11,a.cx+a.x11),o=c-l-.03;e.arc(i,s,r,t,o,u)}}else e.lineTo(i+r*ct(C),s+r*gt(C));return p}drawShape(t,e,i,s,n,r,a,o){const l=ps(t,null==r?void 0:r.theme).arc,{fill:h=l.fill,stroke:d=l.stroke,x:c=l.x,y:u=l.y}=t.attribute,p=this.valid(t,l,a,o);if(!p)return;const{fVisible:g,sVisible:m,doFill:_,doStroke:f}=p,{outerPadding:y=l.outerPadding,innerPadding:b=l.innerPadding,cap:x=l.cap,forceShowCap:S=l.forceShowCap}=t.attribute;let{outerRadius:M=l.outerRadius,innerRadius:k=l.innerRadius}=t.attribute;M+=y,k-=b;let A=0;const w=(v(x)&&x||x[0])&&"conical"===h.gradient;if(w){const{sc:e,startAngle:i,endAngle:s}=t.getParsedAngle();ht(s-i){var e;let i=!0;if(v(t,!0)){for(let s=0;s<4;s++)sn[s]=t,i&&(i=!(null!==(e=sn[s])&&void 0!==e&&!e));i=t}else if(Array.isArray(t))for(let e=0;e<4;e++)sn[e]=!!t[e],i&&(i=!!sn[e]);else sn[0]=!1,sn[1]=!1,sn[2]=!1,sn[3]=!1;return{isFullStroke:i,stroke:sn}})(d);if((_||L)&&(e.beginPath(),Qa(t,e,i,s,M,k),T=!0,e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),_&&(a?a(e,t.attribute,l):g&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill())),f&&L&&(o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke()))),!L&&f&&(e.beginPath(),Qa(t,e,i,s,M,k,C),T||this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),o?o(e,t.attribute,l):m&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke())),(v(x)&&x||x[1])&&S){const{startAngle:r,endAngle:h}=t.getParsedAngle();if(ht(h-r)>=lt-nt){e.beginPath();const r=Math.abs(M-k)/2/M,{endAngle:h=l.endAngle,fill:d=l.fill}=t.attribute,c=h;if(this.drawArcTailCapPath(t,e,i,s,M,k,c,c+r),T||this.beforeRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),_){const n=d;if("conical"===n.gradient){const r=function(t,e,i,s){const{stops:n,startAngle:r,endAngle:a}=s;for(;i<0;)i+=lt;for(;i>lt;)i-=lt;if(ia)return n[0].color;let o,l,h=(i-r)/(a-r);for(let t=0;t=h){o=n[t-1],l=n[t];break}return h=(h-o.offset)/(l.offset-o.offset),Xs(o.color,l.color,h,!1)}(0,0,h,n);a||$a&&(e.setCommonStyle(t,t.attribute,i,s,l),e.fillStyle=r,e.fill())}}f&&(o||m&&(e.setStrokeStyle(t,t.attribute,i,s,l),e.stroke()))}}this.afterRenderStep(t,e,i,s,_,f,g,m,l,n,a,o),w&&(h.startAngle+=A,h.endAngle+=A)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Rx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Ox(0,$(K)),Ox(0,X(to)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Rx);let Ix=!1;const Bx=new B((t=>{Ix||(Ix=!0,t(Rx).toSelf().inSingletonScope(),t(ur).to(Rx).inSingletonScope(),t(_r).toService(ur),t(to).toService(mo),Z(t,to))}));let Fx=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Pn}};Fx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(ur)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Fx);let Yx=!1;const jx=new B(((t,e,i,s)=>{Yx||(Yx=!0,t(Y_).to(Fx).inSingletonScope(),t(tf).toService(Y_))}));let Hx=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="arc",this.numberType=Pn}};Hx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(ur)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Hx);let zx=!1;const Nx=new B(((t,e,i,s)=>{zx||(zx=!0,t(T_).to(Hx).inSingletonScope(),t(w_).toService(T_))}));function Vx(){Vx.__loaded||(Vx.__loaded=!0,ra.RegisterGraphicCreator("arc",Ax),Ui.load(Bx),Ui.load(A_?jx:Nx))}Vx.__loaded=!1;const Wx=Vx;class Gx extends kx{constructor(t){super(t),this.type="arc3d",this.numberType=On}updateAABBBounds(t,e,i){const s=this.stage;if(!s||!s.camera)return i;const{outerRadius:n=e.outerRadius,height:r=0}=t,a=n+r;return i.setValue(-a,-a,a,a),xi.graphicService.updateTempAABBBounds(i),xi.graphicService.transformAABBBounds(t,i,e,!1,this),i}getNoWorkAnimateAttr(){return Gx.NOWORK_ANIMATE_ATTR}}function Ux(t){return new Gx(t)}Gx.NOWORK_ANIMATE_ATTR=Object.assign({cap:1},Sn);class $x{constructor(t,e,i=.8){this.dir=t,this.color=e,this.colorRgb=Us.Get(e,Gs.Color1),this.ambient=i;const s=mt(t[0]*t[0]+t[1]*t[1]+t[2]*t[2]);this.formatedDir=[t[0]/s,t[1]/s,t[2]/s]}computeColor(t,e){const i=this.formatedDir,s=pt(ut((t[0]*i[0]+t[1]*i[1]+t[2]*i[2])*(1-this.ambient/2),0)+this.ambient,1);let n;n=S(e)?Us.Get(e,Gs.Color1):e;const r=this.colorRgb;return`rgb(${r[0]*n[0]*s}, ${r[1]*n[1]*s}, ${r[2]*n[2]*s})`}}const Xx=()=>{Lg.registerPlugin("DirectionalLight",$x)};class Kx{set params(t){this._params=Object.assign({},t),this._projectionMatrixCached=this.forceGetProjectionMatrix(),this._viewMatrixCached=this.forceGetViewMatrix()}get params(){return Object.assign({},this._params)}constructor(t){this.params=t}getViewMatrix(){return this._viewMatrixCached||(this._viewMatrixCached=Wr.allocate()),this._viewMatrixCached}forceGetViewMatrix(){this._viewMatrixCached||(this._viewMatrixCached=Wr.allocate());const{pos:t,center:e,up:i}=this.params.viewParams;return function(t,e,i,s){let n,r,a,o,l,h,d,c,u,p;const g=e[0],m=e[1],_=e[2],f=s[0],v=s[1],y=s[2],b=i[0],x=i[1],S=i[2];Math.abs(g-b){Lg.registerPlugin("OrthoCamera",Kx)};let Zx=class extends bo{constructor(){super(...arguments),this.numberType=On}drawShape(t,e,i,s,n,r,a,o){var l;const h=ps(t,null==r?void 0:r.theme).arc,{fill:d=h.fill}=t.attribute,c=this.valid(t,h,a,o);if(!c)return;const{fVisible:u,sVisible:p,doFill:g,doStroke:m}=c,_=null!==(l=this.z)&&void 0!==l?l:0,{outerPadding:f=h.outerPadding,innerPadding:v=h.innerPadding,height:y=10}=t.attribute;let{outerRadius:b=h.outerRadius,innerRadius:x=h.innerRadius}=t.attribute;b+=f,x-=v;const S=Us.Get(d,Gs.Color255),{light:M}=n.stage||{},k=n.hack_pieFace,A={top:_,bottom:_+y},w={top:[0,1,0],bottom:[0,-1,0],outside:[1,0,-1],inside:[1,0,-1]};"bottom"===k||"top"===k?(e.beginPath(),function(t,e,i,s,n,r,a){const{startAngle:o,endAngle:l}=t.getParsedAngle(),h=ht(l-o),d=l>o;let c=!1;if(r=lt-nt)e.moveTo(i+r*ct(o),s+r*gt(o),n),e.arc(i,s,r,o,l,!d,n),a>nt&&(e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,o,d,n));else{const{outerDeltaAngle:h,innerDeltaAngle:u,outerStartAngle:p,outerEndAngle:g,innerEndAngle:m,innerStartAngle:_}=t.getParsePadAngle(o,l),f=r*ct(p),v=r*gt(p),y=a*ct(m),b=a*gt(m);h<.001?c=!0:(e.moveTo(i+f,s+v,n),e.arc(i,s,r,p,g,!d,n)),!(a>nt)||u<.001?(e.lineTo(i+y,s+b,n),c=!0):(e.lineTo(i+y,s+b,n),e.arc(i,s,a,m,_,d,n))}e.closePath()}(t,e,i,s,A[k],b,x),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke()))):"outside"!==k&&"inside"!==k||("inside"===k&&(e.save(),e.beginPath(),e.arc(i,s,x,0,lt,!0,A.top),e.clip()),e.beginPath(),function(t,e,i,s,n,r,a,o){const{startAngle:l,endAngle:h}=t.getParsedAngle(),d=ht(h-l),c=h>l;let u=!1;if(a<=nt)e.moveTo(i,s,n);else if(d>=lt-nt)e.moveTo(i+a*ct(l),s+a*gt(l),n),e.arc(i,s,a,l,h,!c,n),e.lineTo(i+a*ct(h),s+a*gt(h),r),e.arc(i,s,a,h,l,c,r);else{const{innerouterDeltaAngle:t,innerouterStartAngle:d,innerouterEndAngle:p}=o(l,h),g=a*ct(d),m=a*gt(d),_=a*ct(p),f=a*gt(p);t<.001?u=!0:(e.moveTo(i+g,s+m,n),e.arc(i,s,a,d,p,!c,n),e.lineTo(i+_,s+f,r),e.arc(i,s,a,p,d,c,r))}e.closePath()}(t,e,i,s,A.top,A.bottom,"outside"===k?b:x,((e,i)=>{const{outerDeltaAngle:s,innerDeltaAngle:n,outerStartAngle:r,outerEndAngle:a,innerEndAngle:o,innerStartAngle:l}=t.getParsePadAngle(e,i);return"outside"===k?{innerouterDeltaAngle:s,innerouterEndAngle:a,innerouterStartAngle:r}:{innerouterDeltaAngle:n,innerouterEndAngle:o,innerouterStartAngle:l}})),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,h),g&&(a?a(e,t.attribute,h):u&&(e.setCommonStyle(t,t.attribute,i,s,h),e.fillStyle=M?M.computeColor(w[k],S):d,e.fill())),m&&(o?o(e,t.attribute,h):p&&(e.setStrokeStyle(t,t.attribute,i,s,h),e.stroke())),"inside"===k&&e.restore())}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).arc;this._draw(t,n,!1,i,s)}};Zx=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Zx);let Jx=!1;const Qx=new B((t=>{Jx||(Jx=!0,t(pr).to(Zx).inSingletonScope(),t(_r).toService(pr))}));let tS=class extends ef{constructor(t){super(),this.canvasRenderer=t,this.type="arc3d",this.numberType=On,this.themeType="arc"}};tS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(pr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],tS);let eS=!1;const iS=new B(((t,e,i,s)=>{eS||(eS=!0,t(j_).to(tS).inSingletonScope(),t(tf).toService(j_))}));function sS(){sS.__loaded||(sS.__loaded=!0,ra.RegisterGraphicCreator("arc3d",Ux),Xx(),qx(),Ui.load(Qx),Ui.load(iS))}sS.__loaded=!1;const nS=sS,rS=["points","cornerRadius",...fn];class aS extends Mn{constructor(t){super(t),this.type="polygon",this.numberType=zn}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{points:t}=this.attribute;return t&&t.length>=2}getGraphicTheme(){return ps(this).polygon}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||this.updatePolygonAABBBoundsImprecise(t,e,i),xi.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return xi.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updatePolygonAABBBoundsImprecise(t,e,i){const{points:s=e.points}=t;return s.forEach((t=>{i.add(t.x,t.y)})),i}_interpolate(t,e,i,s,n){"points"===t&&(n.points=dn(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,rS)}needUpdateTag(t){return super.needUpdateTag(t,rS)}toCustomPath(){const t=this.attribute.points,e=new qe;return t.forEach(((t,i)=>{0===i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y)})),e.closePath(),e}clone(){return new aS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return aS.NOWORK_ANIMATE_ATTR}}function oS(t){return new aS(t)}aS.NOWORK_ANIMATE_ATTR=Sn;class lS extends aS{constructor(t){super(t),this.type="pyramid3d",this.numberType=Nn}updateAABBBounds(t,e,i){const s=this.stage;return s&&s.camera?(this.findFace().vertices.forEach((t=>{const e=t[0],s=t[1];i.add(e,s)})),xi.graphicService.updateTempAABBBounds(i),xi.graphicService.transformAABBBounds(t,i,e,!1,this),i):i}findFace(){const{points:t}=this.attribute,e=t.map(((e,i)=>{const s=3===i?t[0]:t[i+1],n=e.x-s.x;return 0===n?0:(e.y-s.y)/n})),i=t.map((t=>({p:t,d:0})));let s=!1,n=0;for(let t=0;t=0;e--){const s=t[e];i.unshift({p:s,d:0})}for(let e=0;e{r.vertices.push([t.p.x,t.p.y,t.d])})),r.polygons.push({polygon:[0,4,5,1],normal:[0,-1,0]}),r.polygons.push({polygon:[7,6,2,3],normal:[0,1,0]}),r.polygons.push({polygon:[0,4,7,3],normal:[-1,0,0]}),r.polygons.push({polygon:[1,5,6,2],normal:[1,0,0]}),r.polygons.push({polygon:[0,1,2,3],normal:[0,0,-1]}),r.polygons.push({polygon:[4,5,6,7],normal:[0,0,1]}),r.edges=[[0,1],[1,2],[2,3],[3,0],[4,5],[5,6],[6,7],[7,4],[0,4],[3,7],[1,5],[2,6]],r}_isValid(){return super._isValid()&&4===this.attribute.points.length}getNoWorkAnimateAttr(){return lS.NOWORK_ANIMATE_ATTR}}function hS(t){return new lS(t)}lS.NOWORK_ANIMATE_ATTR=Sn;class dS extends bo{stroke(t,e,i,s,n){const r=s.vertices;s.edges.forEach((s=>{const a=r[s[0]],o={x:t+a[0],y:e+a[1],z:i+a[2]},l=r[s[1]],h={x:t+l[0],y:e+l[1],z:i+l[2]};n.beginPath(),n.moveTo(o.x,o.y,o.z),n.lineTo(h.x,h.y,h.z),n.stroke()}))}fill(t,e,i,s,n,r,a,o,l,h,d){const c=Us.Get(r,Gs.Color255),u=s.vertices,p=u.map((t=>a.view(t[0],t[1],t[2])[2])),g=[];s.polygons.forEach(((t,e)=>{if(n&&!n[e])return;g.push({faceIdx:e,polygon:t});const{polygon:i}=t,s=p[i[0]],r=p[i[1]],a=p[i[2]],o=p[i[3]];t.ave_z=s+r+a+o})),g.sort(((t,e)=>e.polygon.ave_z-t.polygon.ave_z)),g.forEach((s=>{const{polygon:n,normal:p}=s.polygon,g=u[n[0]],m=u[n[1]],_=u[n[2]],f=u[n[3]],v={x:t+g[0],y:e+g[1],z:i+g[2]},y={x:t+m[0],y:e+m[1],z:i+m[2]},b={x:t+_[0],y:e+_[1],z:i+_[2]},x={x:t+f[0],y:e+f[1],z:i+f[2]};a.beginPath(),a.moveTo(v.x,v.y,v.z),a.lineTo(y.x,y.y,y.z),a.lineTo(b.x,b.y,b.z),a.lineTo(x.x,x.y,x.z),a.closePath(),d?d(a,l&&l.attribute,h):(a.fillStyle=o?o.computeColor(p,c):r,a.fill())}))}}let cS=class extends dS{constructor(){super(...arguments),this.type="pyramid3d",this.numberType=Nn}drawShape(t,e,i,s,n,r,a,o){var l;const h=ps(t,null==r?void 0:r.theme).polygon,{fill:d=h.fill,stroke:c=h.stroke,face:u=[!0,!0,!0,!0,!0,!0]}=t.attribute,p=null!==(l=this.z)&&void 0!==l?l:0;if(!this.valid(t,h,a,o))return;const{light:g}=n.stage||{},m=t.findFace();if(!1!==d){e.setCommonStyle(t,t.attribute,i,s,h);let n=d;"string"!=typeof n&&(n="black"),this.fill(i,s,p,m,u,n,e,g,t,h,a)}!1!==c&&(e.setStrokeStyle(t,t.attribute,i,s,h),this.stroke(i,s,p,m,e))}draw(t,e,i){const s=ps(t).polygon;this._draw(t,s,!1,i)}};cS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],cS);let uS=!1;const pS=new B((t=>{uS||(uS=!0,t(wr).to(cS).inSingletonScope(),t(_r).toService(wr))}));let gS=class extends ef{constructor(t){super(),this.canvasRenderer=t,this.type="pyramid3d",this.numberType=Nn,this.themeType="polygon"}};gS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(wr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gS);let mS=!1;const _S=new B(((t,e,i,s)=>{mS||(mS=!0,t(q_).to(gS).inSingletonScope(),t(tf).toService(q_))}));function fS(){fS.__loaded||(fS.__loaded=!0,ra.RegisterGraphicCreator("pyramid3d",hS),Xx(),qx(),Ui.load(pS),Ui.load(_S))}fS.__loaded=!1;const vS=fS,yS=["segments","points","curveType","curveTension",...fn];class bS extends Mn{constructor(t){super(t),this.type="area",this.numberType=Rn}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!!t&&0!==t.length}getGraphicTheme(){return ps(this).area}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateAreaAABBBoundsBySegments(t,e,i):this.updateAreaAABBBoundsByPoints(t,e,i)),xi.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return xi.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateAreaAABBBoundsByPoints(t,e,i,s){const{points:n=e.points}=t,r=i;return n.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)})),r}updateAreaAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments}=t,r=i;return n.forEach((t=>{t.points.forEach((t=>{var e,i;r.add(t.x,t.y),r.add(null!==(e=t.x1)&&void 0!==e?e:t.x,null!==(i=t.y1)&&void 0!==i?i:t.y)}))})),r}_interpolate(t,e,i,s,n){"points"===t&&(n.points=dn(i,s,e))}needUpdateTags(t){return super.needUpdateTags(t,yS)}needUpdateTag(t){return super.needUpdateTag(t,yS)}toCustomPath(){const t=new qe,e=this.attribute,i=e.segments,s=e=>{if(e&&e.length){let i=!0;const s=[];if(e.forEach((e=>{var n,r;!1!==e.defined&&(i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y),s.push({x:null!==(n=e.x1)&&void 0!==n?n:e.x,y:null!==(r=e.y1)&&void 0!==r?r:e.y}),i=!1)})),s.length){for(let e=s.length-1;e>=0;e--)t.lineTo(s[e].x,s[e].y);t.closePath()}}};return e.points?s(e.points):i&&i.length&&i.forEach((t=>{s(t.points)})),t}clone(){return new bS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return bS.NOWORK_ANIMATE_ATTR}}function xS(t){return new bS(t)}bS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Sn);let SS=!1;const MS=new B((t=>{SS||(SS=!0,t(Oo).toSelf().inSingletonScope(),t(gr).to(Oo).inSingletonScope(),t(_r).toService(gr),t(eo).toService(mo),Z(t,eo),t(Ro).toSelf().inSingletonScope())}));let kS=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=Rn}};kS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(gr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],kS);let AS=!1;const wS=new B(((t,e,i,s)=>{AS||(AS=!0,t(H_).to(kS).inSingletonScope(),t(tf).toService(H_))}));let TS=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="area",this.numberType=Rn}};TS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(gr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],TS);let LS=!1;const CS=new B(((t,e,i,s)=>{LS||(LS=!0,t(L_).to(TS).inSingletonScope(),t(w_).toService(L_))}));function ES(){ES.__loaded||(ES.__loaded=!0,ra.RegisterGraphicCreator("area",xS),Ui.load(MS),Ui.load(A_?wS:CS))}ES.__loaded=!1;const DS=ES,PS=["width","height","image",...fn];class OS extends Mn{constructor(t){super(t),this.type="image",this.numberType=Yn,this.loadImage(this.attribute.image)}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:0}set width(t){this.attribute.width===t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:0}set height(t){this.attribute.height===t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get repeatX(){var t;return null!==(t=this.attribute.repeatX)&&void 0!==t?t:"no-repeat"}set repeatX(t){this.attribute.repeatX===t&&(this.attribute.repeatX=t)}get repeatY(){var t;return null!==(t=this.attribute.repeatY)&&void 0!==t?t:"no-repeat"}set repeatY(t){this.attribute.repeatY===t&&(this.attribute.repeatY=t)}get image(){return this.attribute.image}set image(t){t!==this.attribute.image&&(this.attribute.image=t,this.loadImage(this.attribute.image))}imageLoadSuccess(t,e,i){super.imageLoadSuccess(t,e,(()=>{this.successCallback&&this.successCallback()}))}imageLoadFail(t,e){super.imageLoadFail(t,(()=>{this.failCallback&&this.failCallback()}))}setAttributes(t,e,i){return t.image&&this.loadImage(t.image),super.setAttributes(t,e,i)}setAttribute(t,e,i,s){return"image"===t&&this.loadImage(e),super.setAttribute(t,e,i,s)}getGraphicTheme(){return ps(this).image}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const{width:s=e.width,height:n=e.height}=t;i.set(0,0,s,n)}const{tb1:s,tb2:n}=xi.graphicService.updateTempAABBBounds(i);return Uv(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2),xi.graphicService.transformAABBBounds(t,i,e,!1,this),i}getDefaultAttribute(t){return yi[t]}needUpdateTags(t){return super.needUpdateTags(t,PS)}needUpdateTag(t){return super.needUpdateTag(t,PS)}clone(){return new OS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return OS.NOWORK_ANIMATE_ATTR}}function RS(t){return new OS(t)}OS.NOWORK_ANIMATE_ATTR=Object.assign({image:1,repeatX:1,repeatY:1},Sn);const IS=new class extends Zv{constructor(){super(...arguments),this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){return super.drawShape(t,e,i,s,n,r,a,o,l,h,d,c)}},BS=new class extends po{constructor(){super(...arguments),this.time=ge.beforeFillStroke}drawShape(t,e,i,s,n,r,a,o,l,d,c,u){const{background:p,backgroundMode:g=l.backgroundMode,backgroundFit:m=l.backgroundFit}=t.attribute;if(p)if(t.backgroundImg){const i=t.resources.get(p);if("success"!==i.state||!i.data)return;if(e.save(),t.parent&&!t.transMatrix.onlyTranslate()){const i=ps(t.parent).group,{scrollX:s=i.scrollX,scrollY:n=i.scrollY}=t.parent.attribute;e.setTransformFromMatrix(t.parent.globalTransMatrix,!0),e.translate(s,n)}const s=t.AABBBounds;this.doDrawImage(e,i.data,s,g,m),e.restore(),t.transMatrix.onlyTranslate()||e.setTransformForCurrent()}else if(vs(p)){const{stroke:i,fill:s,lineWidth:n=1,cornerRadius:r=0,expandX:a=0,expandY:o=0}=p;if(!i&&!s)return;e.beginPath();const{x:l,y:d,width:c,height:u}=function(t){const e=rn(t.attribute.boundsPadding),i=t.AABBBounds;let s=i.x1,n=i.y1,r=i.width(),a=i.height();return h(e)?(s+=e,n+=e,r-=2*e,a-=2*e):(s+=e[3],n+=e[0],r-=e[1]+e[3],a-=e[0]+e[2]),{x:s,y:n,width:r,height:a}}(t);r?Wa(e,l-a,d-o,c+2*a,u+2*o,r):e.rect(l-a,d-o,c+2*a,u+2*o),e.globalAlpha=1,s&&(e.fillStyle=s,e.fill()),i&&n>0&&(e.lineWidth=n,e.strokeStyle=i,e.stroke())}else{e.beginPath();const n=t.AABBBounds;e.rect(i,s,n.width(),n.height()),e.fillStyle=p,e.globalAlpha=1,e.fill()}}};var FS=function(t,e){return function(i,s){e(i,s,t)}};const YS=["","repeat-x","repeat-y","repeat"];let jS=class extends bo{constructor(t){super(),this.imageRenderContribitions=t,this.numberType=Yn,this.builtinContributions=[IS,BS],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=ps(t).image,{width:h=l.width,height:d=l.height,repeatX:c=l.repeatX,repeatY:u=l.repeatY,x:p=l.x,y:g=l.y,cornerRadius:m=l.cornerRadius,image:_}=t.attribute,f=this.valid(t,l,a);if(!f)return;const{fVisible:v,sVisible:b,doFill:x,doStroke:S}=f;if(e.setShadowBlendStyle&&e.setShadowBlendStyle(t,l),this.beforeRenderStep(t,e,i,s,x,!1,v,!1,l,n,a),x)if(a)a(e,t.attribute,l);else if(v){if(!_||!t.resources)return;const n=t.resources.get(_);if("success"!==n.state)return;let r=!1;0===m||y(m)&&m.every((t=>0===t))||(e.beginPath(),Wa(e,i,s,h,d,m),e.save(),e.clip(),r=!0),e.setCommonStyle(t,t.attribute,i,s,l);let a=0;if("repeat"===c&&(a|=1),"repeat"===u&&(a|=2),a){const t=e.createPattern(n.data,YS[a]);e.fillStyle=t,e.translate(i,s,!0),e.fillRect(0,0,h,d),e.translate(-i,-s,!0)}else e.drawImage(n.data,i,s,h,d);r&&e.restore()}S&&(o?o(e,t.attribute,l):b&&(e.setStrokeStyle(t,t.attribute,p-i,g-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,x,!1,v,!1,l,n,a)}draw(t,e,i){const{image:s}=t.attribute;if(!s||!t.resources)return;const n=t.resources.get(s);if("loading"===n.state&&S(s))return void Qs.improveImageLoading(s);if("success"!==n.state)return;const{context:r}=e.drawParams;if(!r)return;const a=ps(t).image;this._draw(t,a,!1,i)}};jS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),FS(0,$(K)),FS(0,X(no)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],jS);let HS=!1;const zS=new B((t=>{HS||(HS=!0,t(Lr).to(jS).inSingletonScope(),t(_r).toService(Lr),t(no).toService(mo),Z(t,no))}));let NS=class{constructor(){this.type="image",this.numberType=Yn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};NS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],NS);let VS=!1;const WS=new B(((t,e,i,s)=>{VS||(VS=!0,t(N_).to(NS).inSingletonScope(),t(tf).toService(N_))}));let GS=class{constructor(){this.type="image",this.numberType=Yn}contains(t,e,i){const{pickContext:s}=null!=i?i:{};return!!s&&!!t.AABBBounds.containsPoint(e)}};GS=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],GS);let US=!1;const $S=new B(((t,e,i,s)=>{US||(US=!0,t(E_).to(GS).inSingletonScope(),t(GS).toService(E_))}));function XS(){XS.__loaded||(XS.__loaded=!0,ra.RegisterGraphicCreator("image",RS),Ui.load(zS),Ui.load(A_?WS:$S))}XS.__loaded=!1;const KS=XS,qS=["segments","points","curveType","curveTension",...fn];class ZS extends Mn{constructor(t={}){super(t),this.type="line",this.numberType=jn}isValid(){return super.isValid()&&this._isValid()}_isValid(){if(this.pathProxy)return!0;const{points:t,segments:e}=this.attribute;return e?0!==e.length:!(!t||t.length<=1)}_interpolate(t,e,i,s,n){"points"===t&&(n.points=dn(i,s,e))}getGraphicTheme(){return ps(this).line}updateAABBBounds(t,e,i){this.updatePathProxyAABBBounds(i)||(t.segments?this.updateLineAABBBoundsBySegments(t,e,i):this.updateLineAABBBoundsByPoints(t,e,i)),xi.graphicService.updateTempAABBBounds(i);const{lineJoin:s=e.lineJoin}=t;return xi.graphicService.transformAABBBounds(t,i,e,"miter"===s,this),i}updateLineAABBBoundsByPoints(t,e,i,s){const{points:n=e.points,connectedType:r}=t,a=i;return n.forEach((t=>{!1===t.defined&&"zero"!==r||a.add(t.x,t.y)})),a}updateLineAABBBoundsBySegments(t,e,i,s){const{segments:n=e.segments,connectedType:r}=t,a=i;return n.forEach((t=>{t.points.forEach((t=>{!1===t.defined&&"zero"!==r||a.add(t.x,t.y)}))})),a}needUpdateTags(t){return super.needUpdateTags(t,qS)}needUpdateTag(t){return super.needUpdateTag(t,qS)}toCustomPath(){const t=this.attribute,e=new qe,i=t.segments,s=t=>{if(t&&t.length){let i=!0;t.forEach((t=>{!1!==t.defined&&(i?e.moveTo(t.x,t.y):e.lineTo(t.x,t.y),i=!1)}))}};return i&&i.length?i.forEach((t=>{s(t.points)})):t.points&&s(t.points),e}clone(){return new ZS(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return ZS.NOWORK_ANIMATE_ATTR}}function JS(t){return new ZS(t)}ZS.NOWORK_ANIMATE_ATTR=Object.assign({segments:1,curveType:1},Sn);let QS=!1;const tM=new B((t=>{QS||(QS=!0,t(ko).toSelf().inSingletonScope(),t(Ao).toSelf().inSingletonScope(),t(vr).to(ko).inSingletonScope(),t(_r).toService(vr))}));class eM extends bo{contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;s.highPerformanceSave();const n=t.getGraphicTheme(),r=this.transform(t,n,s),{x:a,y:o,z:l,lastModelMatrix:h}=r;let d=e;if(s.camera){d=e.clone();const i=t.parent.globalTransMatrix;d.x=i.a*e.x+i.c*e.y+i.e,d.y=i.b*e.x+i.d*e.y+i.f}this.canvasRenderer.z=l;let c=!1;return this.canvasRenderer.drawShape(t,s,a,o,{},null,(t=>!!c||(c=t.isPointInPath(d.x,d.y),c)),((t,e,i)=>{if(c)return!0;const n=e.lineWidth||i.lineWidth,r=e.pickStrokeBuffer||i.pickStrokeBuffer;return s.lineWidth=Da(s,n+r,s.dpr),c=t.isPointInStroke(d.x,d.y),c})),this.canvasRenderer.z=0,s.modelMatrix!==h&&Wr.free(s.modelMatrix),s.modelMatrix=h,s.highPerformanceRestore(),c}}let iM=class extends eM{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=jn}};iM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(vr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],iM);let sM=!1;const nM=new B(((t,e,i,s)=>{sM||(sM=!0,t(V_).to(iM).inSingletonScope(),t(tf).toService(V_))}));let rM=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="line",this.numberType=jn}};rM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(vr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],rM);let aM=!1;const oM=new B(((t,e,i,s)=>{aM||(aM=!0,t(D_).to(rM).inSingletonScope(),t(w_).toService(D_))}));function lM(){lM.__loaded||(lM.__loaded=!0,ra.RegisterGraphicCreator("line",JS),Ui.load(tM),Ui.load(A_?nM:oM))}lM.__loaded=!1;const hM=lM,dM=["path","customPath",...fn];class cM extends Mn{constructor(t){super(t),this.type="path",this.numberType=Hn}get pathShape(){return this.tryUpdateAABBBounds(),this.getParsedPathShape()}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{path:t}=this.attribute;return null!=t&&""!==t}getParsedPathShape(){const t=this.getGraphicTheme();if(!this.valid)return t.path;const e=this.attribute;return e.path instanceof qe?e.path:(D(this.cache)&&this.doUpdatePathShape(),this.cache instanceof qe?this.cache:t.path)}getGraphicTheme(){return ps(this).path}updateAABBBounds(t,e,i){if(!this.updatePathProxyAABBBounds(i)){const t=this.getParsedPathShape();i.union(t.getBounds())}const{tb1:s,tb2:n}=xi.graphicService.updateTempAABBBounds(i);Uv(t,e,s),i.union(s),s.setValue(n.x1,n.y1,n.x2,n.y2);const{lineJoin:r=e.lineJoin}=t;return xi.graphicService.transformAABBBounds(t,i,e,"miter"===r,this),i}doUpdateAABBBounds(t){return this.doUpdatePathShape(),super.doUpdateAABBBounds(t)}doUpdatePathShape(){const t=this.attribute;S(t.path,!0)?this.cache=(new qe).fromString(t.path):t.customPath&&(this.cache=new qe,t.customPath(this.cache,this))}needUpdateTags(t){return super.needUpdateTags(t,dM)}needUpdateTag(t){return super.needUpdateTag(t,dM)}toCustomPath(){return(new qe).fromCustomPath2D(this.getParsedPathShape(),0,0)}clone(){return new cM(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return cM.NOWORK_ANIMATE_ATTR}}function uM(t){return new cM(t)}cM.NOWORK_ANIMATE_ATTR=Object.assign({path:1,customPath:1},Sn);const pM=Co,gM=go;var mM=function(t,e){return function(i,s){e(i,s,t)}};let _M=class extends bo{constructor(t){super(),this.pathRenderContribitions=t,this.numberType=Hn,this.builtinContributions=[gM,pM],this.init(t)}drawShape(t,e,i,s,n,r,a,o){var l,h,d;const c=null!==(l=this.tempTheme)&&void 0!==l?l:ps(t,null==r?void 0:r.theme).path,{x:u=c.x,y:p=c.y}=t.attribute,g=null!==(h=this.z)&&void 0!==h?h:0,m=this.valid(t,c,a,o);if(!m)return;const{fVisible:_,sVisible:f,doFill:v,doStroke:y}=m;e.beginPath(),t.pathShape?ve(t.pathShape.commandList,e,i,s,1,1,g):ve((null!==(d=t.attribute.path)&&void 0!==d?d:c.path).commandList,e,i,s,1,1,g),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,c),this.beforeRenderStep(t,e,i,s,v,y,_,f,c,n,a,o),y&&(o?o(e,t.attribute,c):f&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,c),e.stroke())),v&&(a?a(e,t.attribute,c):_&&(e.setCommonStyle(t,t.attribute,u-i,p-s,c),e.fill())),this.afterRenderStep(t,e,i,s,v,y,_,f,c,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).path;this.tempTheme=n,this._draw(t,n,!1,i,s),this.tempTheme=null}};_M=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),mM(0,$(K)),mM(0,X(ro)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],_M);let fM=!1;const vM=new B((t=>{fM||(fM=!0,t(_M).toSelf().inSingletonScope(),t(yr).to(_M).inSingletonScope(),t(_r).toService(yr),t(ro).toService(mo),Z(t,ro))}));let yM=class extends eM{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Hn}};yM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(yr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],yM);let bM=!1;const xM=new B(((t,e,i,s)=>{bM||(bM=!0,t(W_).to(yM).inSingletonScope(),t(tf).toService(W_))}));let SM=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="path",this.numberType=Hn}};SM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(yr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],SM);let MM=!1;const kM=new B(((t,e,i,s)=>{MM||(MM=!0,t(P_).to(SM).inSingletonScope(),t(w_).toService(P_))}));function AM(){AM.__loaded||(AM.__loaded=!0,ra.RegisterGraphicCreator("path",uM),Ui.load(vM),Ui.load(A_?xM:kM))}AM.__loaded=!1;const wM=AM,TM=[[0,0,0],[1,0,0],[1,1,0],[0,1,0],[0,0,1],[1,0,1],[1,1,1],[0,1,1]];class LM extends Xv{constructor(t){super(t),this.type="rect3d",this.numberType=Wn}findFace(){const t={polygons:[],vertices:[],edges:[]},e=this.getGraphicTheme(),{x1:i,y1:s,x:n,y:r,length:a=pt(e.width,e.height)}=this.attribute;let{width:o,height:l}=this.attribute;o=null!=o?o:i-n,l=null!=l?l:s-r;for(let e=0;e=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],EM);let DM=!1;const PM=new B((t=>{DM||(DM=!0,t(Sr).to(EM).inSingletonScope(),t(_r).toService(Sr))}));let OM=class extends ef{constructor(t){super(),this.canvasRenderer=t,this.type="rect3d",this.numberType=Wn,this.themeType="rect"}};OM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Sr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],OM);let RM=!1;const IM=new B(((t,e,i,s)=>{RM||(RM=!0,t(U_).to(OM).inSingletonScope(),t(tf).toService(U_))}));function BM(){BM.__loaded||(BM.__loaded=!0,ra.RegisterGraphicCreator("rect3d",CM),Ui.load(PM),Ui.load(IM))}BM.__loaded=!1;const FM=BM;class YM{constructor(t,e,i,s,n,r,a,o,l,h,d,c,u,p){this.left=t,this.top=e,this.width=i,this.height=s,this.actualHeight=0,this.bottom=e+s,this.right=t+i,this.ellipsis=n,this.wordBreak=r,this.verticalDirection=a,this.lines=[],this.globalAlign=o,this.globalBaseline=l,this.layoutDirection=h,this.directionKey=Si[this.layoutDirection],this.isWidthMax=d,this.isHeightMax=c,this.singleLine=u,p?(p.clear(),this.icons=p):this.icons=new Map}draw(t,e){const{width:i,height:s}=this.getActualSize(),n=this.isWidthMax?Math.min(this.width,i):this.width||i||0;let r=this.isHeightMax?Math.min(this.height,s):this.height||s||0;r=Math.min(r,s);let a=0;switch(this.globalBaseline){case"top":a=0;break;case"middle":a=-r/2;break;case"bottom":a=-r}let o=0;"right"===this.globalAlign||"end"===this.globalAlign?o=-n:"center"===this.globalAlign&&(o=-n/2);let l=this[this.directionKey.height];this.singleLine&&(l=this.lines[0].height+1);let h=!1;if("middle"===this.verticalDirection)if(this.actualHeight>=l&&0!==l)for(let i=0;ithis[this.directionKey.top]+l)return h;let r=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(r=!0,h=!0),this.lines[i].draw(t,r,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}else{const i=Math.floor((l-this.actualHeight)/2);"vertical"===this.layoutDirection?o+=i:a+=i;for(let i=0;ithis[this.directionKey.top]+l||rthis[this.directionKey.top]+l)return h;{let s=!1;this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+l&&(s=!0,h=!0),this.lines[i].draw(t,s,this.lines[i][this.directionKey.left]+o,this.lines[i][this.directionKey.top]+a,this.ellipsis,e)}}}}return h}getActualSize(){return this.ellipsis?this.getActualSizeWidthEllipsis():this.getRawActualSize()}getRawActualSize(){let t=0,e=0;for(let i=0;it&&(t=s.actualWidth),e+=s.height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}getActualSizeWidthEllipsis(){let t=0,e=0;const{width:i,height:s}=this.getRawActualSize();this.width;let n=this.height||s||0;n=Math.min(n,s);let r=this[this.directionKey.height];if(this.singleLine&&(r=this.lines[0].height+1),"middle"===this.verticalDirection)if(this.actualHeight>=r&&0!==r)for(let i=0;ithis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else{Math.floor((r-this.actualHeight)/2);for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else if("bottom"===this.verticalDirection)for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(a+n>this[this.directionKey.top]+r||at&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}else for(let i=0;it&&(t=this.lines[i].actualWidth),e+=this.lines[i].height;else if(s+nthis[this.directionKey.top]+r);else if(this.ellipsis&&this.lines[i+1]&&this.lines[i+1].top+this.lines[i+1].height>this[this.directionKey.top]+r){const s=!0===this.ellipsis?"...":this.ellipsis||"",n=this.lines[i].getWidthWithEllips(s);n>t&&(t=n),e+=this.lines[i].height}else this.lines[i].actualWidth>t&&(t=this.lines[i].actualWidth),e+=this.lines[i].height}return{width:"vertical"===this.layoutDirection?e:t,height:"vertical"===this.layoutDirection?t:e}}}class jM{constructor(t,e,i){this.fontSize=i.fontSize||16,this.textBaseline=i.textBaseline||"alphabetic";const s=gn(i.lineHeight,this.fontSize);this.lineHeight="number"==typeof s?s>this.fontSize?s:this.fontSize:Math.floor(1.2*this.fontSize),this.height=this.lineHeight;const{ascent:n,height:r,descent:a,width:o}=Ci(t,i);let l=0,h=0,d=0;this.height>r&&(l=(this.height-r)/2,h=Math.ceil(l),d=Math.floor(l)),"top"===this.textBaseline?(this.ascent=l,this.descent=r-l):"bottom"===this.textBaseline?(this.ascent=r-l,this.descent=l):"middle"===this.textBaseline?(this.ascent=this.height/2,this.descent=this.height/2):(this.ascent=n+h,this.descent=a+d),this.length=t.length,this.width=o||0,this.text=t||"",this.newLine=e||!1,this.character=i,this.left=0,this.top=0,this.ellipsis="normal",this.ellipsisWidth=0,this.ellipsisOtherParagraphWidth=0,"vertical"===i.direction&&(this.direction=i.direction,this.widthOrigin=this.width,this.heightOrigin=this.height,this.width=this.heightOrigin,this.height=this.widthOrigin,this.lineHeight=this.height),this.ellipsisStr="..."}updateWidth(){const{width:t}=Ci(this.text,this.character);this.width=t,"vertical"===this.direction&&(this.widthOrigin=this.width,this.width=this.heightOrigin,this.height=this.widthOrigin)}draw(t,e,i,s,n){let r=this.text,a=this.left+i;e+=this.top;let o=this.direction;if(this.verticalEllipsis)r=this.ellipsisStr,o="vertical",e-=this.ellipsisWidth/2;else{if("hide"===this.ellipsis)return;if("add"===this.ellipsis)r+=this.ellipsisStr,"right"!==n&&"end"!==n||(a-=this.ellipsisWidth);else if("replace"===this.ellipsis){const t=Ti(r,("vertical"===o?this.height:this.width)-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,r.length-1);if(r=r.slice(0,t),r+=this.ellipsisStr,"right"===n||"end"===n){const{width:e}=Ci(this.text.slice(t),this.character);"vertical"===o||(a-=this.ellipsisWidth-e)}}}switch(this.character.script){case"super":e-=this.ascent*(1/3);break;case"sub":e+=this.descent/2}"vertical"===o&&(t.save(),t.rotateAbout(Math.PI/2,a,e),t.translate(-this.heightOrigin||-this.lineHeight/2,-this.descent/2),t.translate(a,e),a=0,e=0),this.character.stroke&&(function(t,e){const i=e&&e.stroke||false;if(!i)return void(t.globalAlpha=0);const{strokeOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.lineWidth=e&&"number"==typeof e.lineWidth?e.lineWidth:1,t.strokeStyle=i,wi(t,e)}(t,this.character),t.strokeText(r,a,e)),function(t,e){const i=e&&e.fill||true;if(!i)return void(t.globalAlpha=0);const{fillOpacity:s=1,opacity:n=1}=e;t.globalAlpha=s*n,t.fillStyle=i,wi(t,e)}(t,this.character),this.character.fill&&t.fillText(r,a,e),this.character.fill&&("boolean"==typeof this.character.lineThrough||"boolean"==typeof this.character.underline?(this.character.underline&&t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1),this.character.lineThrough&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)):"underline"===this.character.textDecoration?t.fillRect(a,1+e,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1):"line-through"===this.character.textDecoration&&t.fillRect(a,1+e-this.ascent/2,this.widthOrigin||this.width,this.character.fontSize?Math.max(1,Math.floor(this.character.fontSize/10)):1)),"vertical"===o&&t.restore()}getWidthWithEllips(t){let e=this.text;const i="vertical"===t?this.height:this.width;if("hide"===this.ellipsis)return i;if("add"===this.ellipsis)return i+this.ellipsisWidth;if("replace"===this.ellipsis){const t=Ti(e,i-this.ellipsisWidth+this.ellipsisOtherParagraphWidth,this.character,e.length-1);e=e.slice(0,t),e+=this.ellipsisStr;const{width:s}=Ci(this.text.slice(t),this.character);return i+this.ellipsisWidth-s}return i}}class HM extends OS{constructor(t){if(super(t),this._x=0,this._y=0,this._hovered=!1,this._marginArray=[0,0,0,0],"always"===t.backgroundShowMode&&(this._hovered=!0),t.margin){const e=rn(t.margin);this._marginArray="number"==typeof e?[e,e,e,e]:e}this.onBeforeAttributeUpdate=(t,e,i)=>{if(y(i)&&-1!==i.indexOf("margin")||"margin"===i)if(e.margin){const t=rn(e.margin);this._marginArray="number"==typeof t?[t,t,t,t]:t}else this._marginArray=[0,0,0,0]}}get width(){var t;return(null!==(t=this.attribute.width)&&void 0!==t?t:0)+this._marginArray[1]+this._marginArray[3]}get height(){var t;return(null!==(t=this.attribute.height)&&void 0!==t?t:0)+this._marginArray[0]+this._marginArray[2]}tryUpdateAABBBounds(){if(!this.shouldUpdateAABBBounds())return this._AABBBounds;this.doUpdateAABBBounds();const{width:t=yi.width,height:e=yi.height}=this.attribute,{backgroundWidth:i=t,backgroundHeight:s=e}=this.attribute,n=(i-t)/2,r=(s-e)/2;return this._AABBBounds.expand([0,2*n,2*r,0]),this._AABBBounds}setHoverState(t){"hover"===this.attribute.backgroundShowMode&&this._hovered!==t&&(this._hovered=t)}}class zM{constructor(t,e,i,s,n,r,a,o){this.left=t,this.width=e,this.baseline=i,this.ascent=s,this.descent=n,this.top=i-s,this.paragraphs=r.map((t=>t)),this.textAlign=(this.paragraphs[0]instanceof HM?this.paragraphs[0].attribute.textAlign:this.paragraphs[0].character.textAlign)||"left",this.direction=a,this.directionKey=Si[this.direction],this.actualWidth=0;let l=0;this.paragraphs.forEach(((t,e)=>{if(0===e&&t instanceof jM){const e=Ai.exec(t.text);0!==(null==e?void 0:e.index)&&(t.text=t.text.slice(null==e?void 0:e.index),t.updateWidth())}this.actualWidth+=t[this.directionKey.width],l=Math.max(t[this.directionKey.height],l)})),this.height=l,this.blankWidth=o?0:this.width-this.actualWidth,this.calcOffset(e,o)}calcOffset(t,e){const i=this.directionKey,s=this.height;let n=this.left,r=0;this.actualWidtht.overflow)))){let t=!0,i=!1;for(let e=this.paragraphs.length-1;e>=0;e--){const s=this.paragraphs[e];if(s.overflow)t=t&&""===s.text;else if(t){i=!0;break}}let s=0;if(!i)for(let t=this.paragraphs.length-1;t>=0;t--){const i=this.paragraphs[t];if(i.overflow){if(""===i.text)break;continue}if(i instanceof HM)break;if("vertical"===this.direction&&"vertical"!==i.direction){i.verticalEllipsis=!0;break}const r=!0===n?"...":n||"";i.ellipsisStr=r;const{width:a}=Ci(r,i.character),o=a||0;if(o<=this.blankWidth+s){e&&(i.ellipsis="add");break}if(o<=this.blankWidth+s+i.width){i.ellipsis="replace",i.ellipsisWidth=o,i.ellipsisOtherParagraphWidth=this.blankWidth+s;break}i.ellipsis="hide",s+=i.width}}this.paragraphs.map(((e,n)=>{if(e instanceof HM)return e.setAttributes({x:i+e._x,y:s+e._y}),void r(e,t,i+e._x,s+e._y,this.ascent);e.draw(t,s+this.ascent,i,0===n,this.textAlign)}))}getWidthWithEllips(t){let e=0;for(let i=this.paragraphs.length-1;i>=0;i--){const s=this.paragraphs[i];if(s instanceof HM)break;const{width:n}=Ci(t,s.character),r=n||0;if(r<=this.blankWidth+e){s.ellipsis="add",s.ellipsisWidth=r;break}if(r<=this.blankWidth+e+s.width){s.ellipsis="replace",s.ellipsisWidth=r,s.ellipsisOtherParagraphWidth=this.blankWidth+e;break}s.ellipsis="hide",e+=s.width}let i=0;return this.paragraphs.map(((t,e)=>{i+=t instanceof HM?t.width:t.getWidthWithEllips(this.direction)})),i}}class NM{constructor(t){this.frame=t,this.width=this.frame.width,this.height=this.frame.height,this.lineWidth=0,this.y=this.frame.top,this.maxAscent=0,this.maxDescent=0,this.maxAscentForBlank=0,this.maxDescentForBlank=0,this.lineBuffer=[],this.direction=t.layoutDirection,this.directionKey=Si[this.direction]}store(t){if(t instanceof HM){this.frame.icons.set(t.richtextId,t),this.lineBuffer.push(t),this.lineWidth+=t[this.directionKey.width];let e=0,i=0;"top"===t.attribute.textBaseline?(e=0,i=t.height):"bottom"===t.attribute.textBaseline?(e=t.height,i=0):(e=t.height/2,i=t.height/2),this.maxAscent=Math.max(this.maxAscent,e),this.maxDescent=Math.max(this.maxDescent,i)}else this.lineBuffer.push(t),0!==t.text.length?(this.lineWidth+=t[this.directionKey.width],this.maxAscent=Math.max(this.maxAscent,t.ascent),this.maxDescent=Math.max(this.maxDescent,t.descent)):(this.maxAscentForBlank=Math.max(this.maxAscentForBlank,t.ascent),this.maxDescentForBlank=Math.max(this.maxDescentForBlank,t.descent))}send(){if(0===this.lineBuffer.length)return;const t=0===this.maxAscent?this.maxAscentForBlank:this.maxAscent,e=0===this.maxDescent?this.maxDescentForBlank:this.maxDescent,i=new zM(this.frame.left,this[this.directionKey.width],this.y+t,t,e,this.lineBuffer,this.direction,"horizontal"===this.direction?this.frame.isWidthMax:this.frame.isHeightMax);this.frame.lines.push(i),this.frame.actualHeight+=i.height,this.y+=i.height,this.lineBuffer.length=0,this.lineWidth=this.maxAscent=this.maxDescent=this.maxAscentForBlank=this.maxDescentForBlank=0}deal(t,e=!1){t instanceof HM?"horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):0===this.lineBuffer.length?(this.store(t),this.send()):(this.send(),this.deal(t)):"number"!=typeof this.width||this.width<0||(t.newLine&&this.send(),0!==t.text.length&&("horizontal"===this.direction&&0===this.width||"vertical"===this.direction&&0===this.height||this.lineWidth+t[this.directionKey.width]<=this[this.directionKey.width]?this.store(t):this.lineWidth===this[this.directionKey.width]?(this.send(),this.deal(t)):this.cut(t,e)))}cut(t,e){const i=this[this.directionKey.width]-this.lineWidth||0,s=Math.ceil(i/t[this.directionKey.width]*t.length)||0,n=Ti(t.text,i,t.character,s,"break-word"===this.frame.wordBreak);if(0!==n){const[i,s]=function(t,e){const i=t.text.slice(0,e),s=t.text.slice(e);return[new jM(i,t.newLine,t.character),new jM(s,!0,t.character)]}(t,n);this.store(i),e?this.send():this.deal(s)}else 0!==this.lineBuffer.length&&(this.send(),this.deal(t))}}const VM=["width","height","ellipsis","wordBreak","verticalDirection","maxHeight","maxWidth","textAlign","textBaseline","textConfig","layoutDirection","fill","stroke","fontSize",...fn];class WM extends Mn{constructor(t){super(t),this.type="richtext",this._currentHoverIcon=null,this.numberType=Gn,this.onBeforeAttributeUpdate=(t,e,i)=>{for(const i in t)if("hoverIconId"===i){if(t[i]===e[i])continue;const s=this._frameCache.icons.get(t[i]);this.updateHoverIconState(s)}}}get width(){var t;return null!==(t=this.attribute.width)&&void 0!==t?t:vi.width}set width(t){this.attribute.width!==t&&(this.attribute.width=t,this.addUpdateShapeAndBoundsTag())}get height(){var t;return null!==(t=this.attribute.height)&&void 0!==t?t:vi.height}set height(t){this.attribute.height!==t&&(this.attribute.height=t,this.addUpdateShapeAndBoundsTag())}get maxWidth(){return this.attribute.maxWidth}set maxWidth(t){this.attribute.maxWidth!==t&&(this.attribute.maxWidth=t,this.addUpdateShapeAndBoundsTag())}get maxHeight(){return this.attribute.maxHeight}set maxHeight(t){this.attribute.maxHeight!==t&&(this.attribute.maxHeight=t,this.addUpdateShapeAndBoundsTag())}get ellipsis(){var t;return null!==(t=this.attribute.ellipsis)&&void 0!==t?t:vi.ellipsis}set ellipsis(t){this.attribute.ellipsis!==t&&(this.attribute.ellipsis=t,this.addUpdateShapeAndBoundsTag())}get wordBreak(){var t;return null!==(t=this.attribute.wordBreak)&&void 0!==t?t:vi.wordBreak}set wordBreak(t){this.attribute.wordBreak!==t&&(this.attribute.wordBreak=t,this.addUpdateShapeAndBoundsTag())}get verticalDirection(){var t;return null!==(t=this.attribute.verticalDirection)&&void 0!==t?t:vi.verticalDirection}set verticalDirection(t){this.attribute.verticalDirection!==t&&(this.attribute.verticalDirection=t,this.addUpdateShapeAndBoundsTag())}get textAlign(){var t;return null!==(t=this.attribute.textAlign)&&void 0!==t?t:vi.textAlign}set textAlign(t){this.attribute.textAlign!==t&&(this.attribute.textAlign=t,this.addUpdateShapeAndBoundsTag())}get textBaseline(){var t;return null!==(t=this.attribute.textBaseline)&&void 0!==t?t:vi.textBaseline}set textBaseline(t){this.attribute.textBaseline!==t&&(this.attribute.textBaseline=t,this.addUpdateShapeAndBoundsTag())}get textConfig(){var t;return null!==(t=this.attribute.textConfig)&&void 0!==t?t:vi.textConfig}set textConfig(t){this.attribute.textConfig=t,this.addUpdateShapeAndBoundsTag()}getGraphicTheme(){return ps(this).richtext}updateAABBBounds(t,e,i){const{width:s=e.width,height:n=e.height,maxWidth:r=e.maxWidth,maxHeight:a=e.maxHeight,textAlign:o=e.textAlign,textBaseline:l=e.textBaseline}=t;if(s>0&&n>0)i.set(0,0,s,n);else{const t=this.getFrameCache(),{width:e,height:o}=t.getActualSize();let l=s||e||0,h=n||o||0;h="number"==typeof a&&h>a?a:h||0,l="number"==typeof r&&l>r?r:l||0,i.set(0,0,l,h)}let h=0;switch(l){case"top":h=0;break;case"middle":h=-i.height()/2;break;case"bottom":h=-i.height()}let d=0;switch(o){case"left":d=0;break;case"center":d=-i.width()/2;break;case"right":d=-i.width()}return i.translate(d,h),xi.graphicService.updateTempAABBBounds(i),null==t.forceBoundsHeight&&null==t.forceBoundsWidth||xi.graphicService.updateHTMLTextAABBBounds(t,e,i),xi.graphicService.transformAABBBounds(t,i,e,!1,this),i}needUpdateTags(t){return super.needUpdateTags(t,VM)}needUpdateTag(t){return super.needUpdateTag(t,VM)}getFrameCache(){return this.shouldUpdateShape()&&(this.doUpdateFrameCache(),this.clearUpdateShapeTag()),this._frameCache}get cliped(){const t=this.getFrameCache();if(t.actualHeight>t.height)return!0;const{disableAutoWrapLine:e}=this.attribute;if(e)for(let e=0;e{var t;this.addUpdateBoundTag(),null===(t=this.stage)||void 0===t||t.renderNextFrame()},t.richtextId=e.id,_.push(t)}}else{const e=this.combinedStyleToCharacter(f[t]);if(h(e.text)&&(e.text=`${e.text}`),e.text&&e.text.includes("\n")){const t=e.text.split("\n");for(let i=0;i0,y="number"==typeof n&&Number.isFinite(n)&&n>0,b="number"==typeof r&&Number.isFinite(r)&&r>0&&(!v||r<=s),x="number"==typeof a&&Number.isFinite(a)&&a>0&&(!y||a<=n),S=new YM(0,0,(b?r:v?s:0)||0,(x?a:y?n:0)||0,o,l,d,c,u,p||"horizontal",!b&&v,!x&&y,g||!1,null===(e=this._frameCache)||void 0===e?void 0:e.icons),M=new NM(S);if(m){let t=0,e=!1;for(let i=0;i<_.length;i++){const s=_[i];e?(s.overflow=!0,s.left=1/0,s.top=1/0,!s.newLine&&S.lines[S.lines.length-1].paragraphs.push(s)):M.deal(s,!0),S.lines.length!==t&&(t=S.lines.length,M.lineBuffer.length=0,s.overflow=!0,s.left=1e3,s.top=1e3,S.lines[S.lines.length-1].paragraphs.push(s),e=!0),s.newLine&&(e=!1,M.lineWidth=0),M.send()}}else for(let t=0;t<_.length;t++)M.deal(_[t]);if(M.send(),!("horizontal"===S.layoutDirection?b:x)){const t=S.getActualSizeWidthEllipsis();let e="horizontal"===S.layoutDirection?t.width:t.height;("horizontal"===S.layoutDirection?v:y)&&(e=Math.min(e,"horizontal"===S.layoutDirection?s:n)),S.lines.forEach((function(t){t.calcOffset(e,!1)}))}this._frameCache=S}clone(){return new WM(Object.assign({},this.attribute))}setStage(t,e){super.setStage(t,e),this.getFrameCache().icons.forEach((i=>{i.setStage(t,e)}))}bindIconEvent(){this.addEventListener("pointermove",(t=>{const e=this.pickIcon(t.global);e&&e===this._currentHoverIcon||(e?this.setAttribute("hoverIconId",e.richtextId):!e&&this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0))})),this.addEventListener("pointerleave",(t=>{this._currentHoverIcon&&this.setAttribute("hoverIconId",void 0)}))}updateHoverIconState(t){var e,i,s,n,r;t?(null===(e=this._currentHoverIcon)||void 0===e||e.setHoverState(!1),this._currentHoverIcon=t,this._currentHoverIcon.setHoverState(!0),null===(i=this.stage)||void 0===i||i.setCursor(t.attribute.cursor),null===(s=this.stage)||void 0===s||s.renderNextFrame()):(this._currentHoverIcon.setHoverState(!1),this._currentHoverIcon=null,null===(n=this.stage)||void 0===n||n.setCursor(),null===(r=this.stage)||void 0===r||r.renderNextFrame())}pickIcon(t){const e=this.getFrameCache(),{e:i,f:s}=this.globalTransMatrix;let n;return e.icons.forEach(((e,r)=>{var a,o;const l=e.AABBBounds.clone();l.translate(e._marginArray[3],e._marginArray[0]),l.containsPoint({x:t.x-i,y:t.y-s})&&(n=e,n.globalX=(null!==(a=n.attribute.x)&&void 0!==a?a:0)+i+e._marginArray[3],n.globalY=(null!==(o=n.attribute.y)&&void 0!==o?o:0)+s+e._marginArray[0])})),n}getNoWorkAnimateAttr(){return WM.NOWORK_ANIMATE_ATTR}}function GM(t){return new WM(t)}WM.NOWORK_ANIMATE_ATTR=Object.assign({ellipsis:1,wordBreak:1,verticalDirection:1,textAlign:1,textBaseline:1,textConfig:1,layoutDirection:1},Sn);let UM=class extends bo{constructor(){super(),this.numberType=Gn,this.builtinContributions=[b_],this.init()}drawShape(t,e,i,s,n){const r=ps(t).richtext,{strokeOpacity:a=r.strokeOpacity,opacity:o=r.opacity,fillOpacity:l=r.fillOpacity,visible:h=r.visible}=t.attribute;if(!t.valid||!h)return;const d=$a(o,l,!0),c=$a(o,a,!0);d&&(e.translate(i,s),this.beforeRenderStep(t,e,i,s,d,c,d,c,r,n),t.getFrameCache().draw(e,this.drawIcon),this.afterRenderStep(t,e,i,s,d,c,d,c,r,n))}drawIcon(t,e,i,s,n){var r;const a=ps(t).richtextIcon,{width:o=a.width,height:l=a.height,opacity:h=a.opacity,image:d,backgroundFill:c=a.backgroundFill,backgroundFillOpacity:u=a.backgroundFillOpacity,backgroundStroke:p=a.backgroundStroke,backgroundStrokeOpacity:g=a.backgroundStrokeOpacity,backgroundRadius:m=a.backgroundRadius,margin:_}=t.attribute,{backgroundWidth:f=o,backgroundHeight:v=l}=t.attribute;if(_&&(i+=t._marginArray[3],s+=t._marginArray[0]),t._hovered){const t=(f-o)/2,n=(v-l)/2;0===m?(e.beginPath(),e.rect(i-t,s-n,f,v)):(e.beginPath(),Wa(e,i-t,s-n,f,v,m)),c&&(e.globalAlpha=u,e.fillStyle=c,e.fill()),p&&(e.globalAlpha=g,e.strokeStyle=p,e.stroke())}const y=d&&(null===(r=null==t?void 0:t.resources)||void 0===r?void 0:r.get(d));y&&"success"===y.state&&(e.globalAlpha=h,e.drawImage(y.data,i,s,o,l))}draw(t,e,i){const s=ps(t).richtext;this._draw(t,s,!1,i)}};UM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],UM);let $M=!1;const XM=new B((t=>{$M||($M=!0,t(Ar).to(UM).inSingletonScope(),t(_r).toService(Ar))}));let KM=class{constructor(t){this.canvasRenderer=t,this.type="richtext",this.numberType=Gn}contains(t,e,i){return!!t.AABBBounds.containsPoint(e)}};KM=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Ar)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],KM);let qM=!1;const ZM=new B(((t,e,i,s)=>{qM||(qM=!0,t(Z_).to(KM).inSingletonScope(),t(tf).toService(Z_))}));let JM=!1;const QM=new B(((t,e,i,s)=>{JM||(JM=!0,t(E_).to(GS).inSingletonScope(),t(GS).toService(E_))}));function tk(){tk.__loaded||(tk.__loaded=!0,ra.RegisterGraphicCreator("richtext",GM),Ui.load(XM),Ui.load(A_?ZM:QM))}tk.__loaded=!1;const ek=tk;function ik(t,e,i,s){t.moveTo(e[0].x+i,e[0].y+s);for(let n=1;n0===t))?ik(e.camera?e:e.nativeContext,h,i,s):function(t,e,i,s,n,r=!0){var a;if(e.length<3)return void ik(t,e,i,s);let o=0,l=e.length-1;r||(o+=1,l-=1,t.moveTo(e[0].x+i,e[0].y+s));for(let r=o;r<=l;r++){const o=e[0===r?l:(r-1)%e.length],h=e[r%e.length],d=e[(r+1)%e.length],c=h.x-o.x,u=h.y-o.y,p=h.x-d.x,g=h.y-d.y,m=(Math.atan2(u,c)-Math.atan2(g,p))/2,_=Math.abs(Math.tan(m));let f=Array.isArray(n)?null!==(a=n[r%e.length])&&void 0!==a?a:0:n,v=f/_;const y=sk(c,u),b=sk(p,g),x=Math.min(y,b);v>x&&(v=x,f=x*_);const S=nk(h,v,y,c,u),M=nk(h,v,b,p,g),k=2*h.x-S.x-M.x,A=2*h.y-S.y-M.y,w=sk(k,A),T=nk(h,sk(v,f),w,k,A);let L=Math.atan2(S.y-T.y,S.x-T.x);const C=Math.atan2(M.y-T.y,M.x-T.x);let E=C-L;E<0&&(L=C,E=-E),E>Math.PI&&(E-=Math.PI),0===r?t.moveTo(S.x+i,S.y+s):t.lineTo(S.x+i,S.y+s),E&&t.arcTo(h.x+i,h.y+s,M.x+i,M.y+s,f),t.lineTo(M.x+i,M.y+s)}r||t.lineTo(e[l+1].x+i,e[l+1].y+s)}(e.camera?e:e.nativeContext,h,i,s,d,p),p&&e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,v,m,_,l,n,a,o),f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,c-i,u-s,l),e.fill())),v&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,c-i,u-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,f,v,m,_,l,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).polygon;this._draw(t,n,!1,i,s)}};lk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),ok(0,$(K)),ok(0,X(ao)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],lk);let hk=!1;const dk=new B((t=>{hk||(hk=!0,t(br).to(lk).inSingletonScope(),t(_r).toService(br),t(ao).toService(mo),Z(t,ao))}));let ck=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=zn}};ck=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(br)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],ck);let uk=!1;const pk=new B(((t,e,i,s)=>{uk||(uk=!0,t(K_).to(ck).inSingletonScope(),t(tf).toService(K_))}));let gk=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="polygon",this.numberType=zn}};gk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(br)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],gk);let mk=!1;const _k=new B(((t,e,i,s)=>{mk||(mk=!0,t(B_).to(gk).inSingletonScope(),t(w_).toService(B_))}));function fk(){fk.__loaded||(fk.__loaded=!0,ra.RegisterGraphicCreator("polygon",oS),Ui.load(dk),Ui.load(A_?pk:_k))}fk.__loaded=!1;const vk=fk;class yk extends Mn{constructor(t){super(t),this.type="glyph",this.numberType=Bn,this.subGraphic=[],this._onInit&&this._onInit(this),this.valid=this.isValid()}setSubGraphic(t){this.detachSubGraphic(),this.subGraphic=t,t.forEach((t=>{t.glyphHost=this,Object.setPrototypeOf(t.attribute,this.attribute)})),this.valid=this.isValid(),this.addUpdateBoundTag()}detachSubGraphic(){this.subGraphic.forEach((t=>{t.glyphHost=null,Object.setPrototypeOf(t.attribute,{})}))}getSubGraphic(){return this.subGraphic}onInit(t){this._onInit=t}onUpdate(t){this._onUpdate=t}isValid(){return!0}setAttribute(t,e,i,s){super.setAttribute(t,e,i,s),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}setAttributes(t,e=!1,i){super.setAttributes(t,e,i),this.subGraphic.forEach((t=>{t.addUpdateShapeAndBoundsTag(),t.addUpdatePositionTag()}))}translate(t,e){return super.translate(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}translateTo(t,e){return super.translateTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scale(t,e,i){return super.scale(t,e,i),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}scaleTo(t,e){return super.scaleTo(t,e),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotate(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}rotateTo(t){return super.rotate(t),this.subGraphic.forEach((t=>{t.addUpdatePositionTag(),t.addUpdateBoundTag()})),this}getGraphicTheme(){return ps(this).glyph}updateAABBBounds(t,e,i){return this.getSubGraphic().forEach((t=>{i.union(t.AABBBounds)})),i}doUpdateAABBBounds(){this._AABBBounds.clear();const t=this.updateAABBBounds(this.attribute,this.getGraphicTheme(),this._AABBBounds);return this.clearUpdateBoundTag(),t}needUpdateTags(t){return!1}needUpdateTag(t){return!1}useStates(t,e){var i;if(!t.length)return void this.clearStates(e);if((null===(i=this.currentStates)||void 0===i?void 0:i.length)===t.length&&!t.some(((t,e)=>this.currentStates[e]!==t)))return;this.stopStateAnimates();const s={},n=this.subGraphic.map((()=>({})));t.forEach((e=>{var i;const r=this.glyphStateProxy?this.glyphStateProxy(e,t):this.glyphStates[e];r&&(Object.assign(s,r.attributes),(null===(i=r.subAttributes)||void 0===i?void 0:i.length)&&n.forEach(((t,e)=>{Object.assign(t,r.subAttributes[e])})))})),this.subGraphic.forEach(((i,s)=>{i.updateNormalAttrs(n[s]),i.applyStateAttrs(n[s],t,e)})),this.updateNormalAttrs(s),this.currentStates=t,this.applyStateAttrs(s,t,e)}clearStates(t){this.stopStateAnimates(),this.hasState()&&this.normalAttrs?(this.currentStates=[],this.subGraphic.forEach((e=>{e.applyStateAttrs(e.normalAttrs,this.currentStates,t,!0),e.normalAttrs=null})),this.applyStateAttrs(this.normalAttrs,this.currentStates,t,!0)):this.currentStates=[],this.normalAttrs=null}clone(){const t=new yk(Object.assign({},this.attribute));return t.setSubGraphic(this.subGraphic.map((t=>t.clone()))),t}getNoWorkAnimateAttr(){return yk.NOWORK_ANIMATE_ATTR}}function bk(t){return new yk(t)}yk.NOWORK_ANIMATE_ATTR=Sn;let xk=class{constructor(){this.numberType=Bn}drawShape(t,e,i,s,n,r,a,o){n.drawContribution&&t.getSubGraphic().forEach((t=>{const l=n.drawContribution.getRenderContribution(t);l&&l.drawShape&&l.drawShape(t,e,i,s,n,r,a,o)}))}draw(t,e,i,s){const{context:n}=i;if(!n)return;if(n.highPerformanceSave(),!i.drawContribution)return;const r=ps(t),a=t.getSubGraphic();a.length&&a.forEach((t=>{i.drawContribution.renderItem(t,i,{theme:r})})),n.highPerformanceRestore()}};xk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],xk);let Sk=!1;const Mk=new B((t=>{Sk||(Sk=!0,t(Tr).to(xk).inSingletonScope(),t(_r).toService(Tr))}));class kk{constructor(){this.type="glyph",this.numberType=Bn}contains(t,e,i){if(!t.AABBBounds.containsPoint(e))return!1;if("imprecise"===t.attribute.pickMode)return!0;const{pickContext:s}=null!=i?i:{};if(!s)return!1;const n=null==i?void 0:i.pickerService;if(n){let s=!1;return t.getSubGraphic().forEach((t=>{if(s)return;const r=n.pickItem(t,e,null,i);s=!(!r||!r.graphic)})),s}return!1}}let Ak=class extends kk{constructor(t){super(),this.canvasRenderer=t}};Ak=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ak);let wk=!1;const Tk=new B(((t,e,i,s)=>{wk||(wk=!0,t(J_).to(Ak).inSingletonScope(),t(tf).toService(J_))}));let Lk=class extends kk{constructor(t){super(),this.canvasRenderer=t}};Lk=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(Tr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Lk);let Ck=!1;const Ek=new B(((t,e,i,s)=>{Ck||(Ck=!0,t(F_).to(Lk).inSingletonScope(),t(Lk).toService(F_))}));function Dk(){Dk.__loaded||(Dk.__loaded=!0,ra.RegisterGraphicCreator("glyph",bk),Ui.load(Mk),Ui.load(A_?Tk:Ek))}Dk.__loaded=!1;const Pk=Dk,Ok=["x","y","dx","dy","scaleX","scaleY","angle","anchor","postMatrix","visible","clip","pickable","childrenPickable","zIndex","cursor"];class Rk extends Qn{constructor(t,e){super(t),(null==e?void 0:e.mode)&&(this.mode=e.mode,this.setMode(e.mode)),(null==e?void 0:e.skipDefault)&&(this.skipDefault=!0),this.setTheme({common:{strokeBoundsBuffer:0}}),this.attribute=t,this.onSetStage((()=>{this.render(),this.bindEvents()}))}setAttribute(t,e,i){w(this.attribute[t])&&w(e)&&!ys(this.attribute[t])&&!ys(e)?E(this.attribute[t],e):this.attribute[t]=e,Ok.includes(t)||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!i&&!this.needUpdateTag(t)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}setAttributes(t,e){const i=Object.keys(t);this._mergeAttributes(t,i),i.every((t=>Ok.includes(t)))||this.render(),this.valid=this.isValid(),this.updateShapeAndBoundsTagSetted()||!e&&!this.needUpdateTags(i)?this.addUpdateBoundTag():this.addUpdateShapeAndBoundsTag(),this.addUpdatePositionTag(),this.onAttributeUpdate()}_mergeAttributes(t,e){D(e)&&(e=Object.keys(t));for(let i=0;i=.5:i<.5}return s?Yk(t,e)>s:"largeText"===i?Yk(t,e)>3:Yk(t,e)>4.5}function Yk(t,e){const i=jk(t),s=jk(e);return((i>s?i:s)+.05)/((i>s?s:i)+.05)}function jk(t){const e=function(t){let e="",i="",s="";const n="#"===t[0]?1:0;for(let r=n;r{const i=e(t);t.isContainer&&!i&&zk(t,e)}))}const Nk=t=>!D(t)&&!1!==t.visible;function Vk(t){return t>=0&&t3*Math.PI/2&&t<=2*Math.PI}function Wk(t,e,i){return Math.abs(t-e)Math.PI&&i.toLocaleLowerCase().includes("bottom")?"left":eMath.PI&&i.toLocaleLowerCase().includes("top")?"right":"center",textBaseline:eMath.PI&&!i.includes("inside")?"bottom":"top"}}const Uk=-.5*Math.PI,$k=1.5*Math.PI,Xk="PingFang SC,Helvetica Neue,Microsoft Yahei,system-ui,-apple-system,segoe ui,Roboto,Helvetica,Arial,sans-serif,apple color emoji,segoe ui emoji,segoe ui symbol";var Kk;!function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(Kk||(Kk={}));const qk={[Kk.selectedReverse]:{},[Kk.selected]:{},[Kk.hover]:{},[Kk.hoverReverse]:{}},Zk={container:"",width:30,height:30,style:{}},Jk=(t,e,i,s)=>new Ii(Object.assign({defaultFontParams:Object.assign({fontFamily:Xk,fontSize:14},s),getTextBounds:i?void 0:y_,specialCharSet:"-/: .,@%'\"~"+Ii.ALPHABET_CHAR_SET+Ii.ALPHABET_CHAR_SET.toUpperCase()},null!=e?e:{}),t);function Qk(t,e,i={}){if(!t)return{width:0,height:0};const s=y_({text:t,fontFamily:e.fontFamily||i.fontFamily||Xk,fontSize:e.fontSize||i.fontSize||12,fontWeight:e.fontWeight||i.fontWeight,textAlign:e.textAlign||"center",textBaseline:e.textBaseline,ellipsis:!!e.ellipsis,maxLineWidth:e.maxLineWidth||1/0,lineHeight:e.fontSize||i.fontSize||12});return{width:s.width(),height:s.height()}}function tA(t,e="type"){var i,s;return vs(t.text)&&"type"in t.text?null!==(i=t.text.type)&&void 0!==i?i:"text":e in t&&null!==(s=t[e])&&void 0!==s?s:"text"}function eA(t){var e,i;return M(t.maxLineWidth)&&(t.maxWidth=t.maxLineWidth,delete t.maxLineWidth),t.width=null!==(e=t.width)&&void 0!==e?e:0,t.height=null!==(i=t.height)&&void 0!==i?i:0,t.textConfig=t.text.text||t.text,t}function iA(t,e="type"){const i=tA(t,e);return"rich"===i?ra.richtext(eA(t)):("html"===i?t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.html=s,t.text=i,t.renderable=!1,t}(t):"react"===i&&(t=function(t){const{text:e,_originText:i}=t,{text:s}=e;return t.react=s,t.text=i,t.renderable=!1,t}(t)),ra.text(t))}function sA(t,e,i,s,n){"right"===t?"center"===i?e.setAttribute("x",s-n/2):"right"===i||"end"===i?e.setAttribute("x",s):e.setAttribute("x",s-n):"center"===i?e.setAttribute("x",s+n/2):"right"===i||"end"===i?e.setAttribute("x",s+n):e.setAttribute("x",s)}const nA=new Uint32Array(33),rA=new Uint32Array(33);rA[0]=0,nA[0]=~rA[0];for(let t=1;t<=32;++t)rA[t]=rA[t-1]<<1|1,nA[t]=~rA[t];function aA(t,e,i={top:0,left:0,right:0,bottom:0}){const{top:s=0,left:n=0,right:r=0,bottom:a=0}=i,o=Math.max(1,Math.sqrt(t*e/1e6)),l=~~((t+n+r+o)/o),h=~~((e+s+a+o)/o),d=t=>~~(t/o);return d.bitmap=()=>function(t,e){const i=new Uint32Array(~~((t*e+32)/32));function s(t,e){i[t]|=e}function n(t,e){i[t]&=e}return{array:i,get:(e,s)=>{const n=s*t+e;return i[n>>>5]&1<<(31&n)},set:(e,i)=>{const n=i*t+e;s(n>>>5,1<<(31&n))},clear:(e,i)=>{const s=i*t+e;n(s>>>5,~(1<<(31&s)))},getRange:({x1:s,y1:n,x2:r,y2:a})=>{if(r<0||a<0||s>t||n>e)return!0;let o,l,h,d,c=a;for(;c>=n;--c)if(o=c*t+s,l=c*t+r,h=o>>>5,d=l>>>5,h===d){if(i[h]&nA[31&o]&rA[1+(31&l)])return!0}else{if(i[h]&nA[31&o])return!0;if(i[d]&rA[1+(31&l)])return!0;for(let t=h+1;t{if(r<0||a<0||i>t||n>e)return;let o,l,h,d,c;for(;n<=a;++n)if(o=n*t+i,l=n*t+r,h=o>>>5,d=l>>>5,h===d)s(h,nA[31&o]&rA[1+(31&l)]);else for(s(h,nA[31&o]),s(d,rA[1+(31&l)]),c=h+1;c{let a,o,l,h,d;for(;i<=r;++i)if(a=i*t+e,o=i*t+s,l=a>>>5,h=o>>>5,l===h)n(l,rA[31&a]|nA[1+(31&o)]);else for(n(l,rA[31&a]),n(h,nA[1+(31&o)]),d=l+1;di<0||s<0||r>=e||n>=t,toImageData:s=>{const n=s.createImageData(t,e),r=n.data;for(let s=0;s>>5]&1<<(31&n);r[a+0]=255*o,r[a+1]=255*o,r[a+2]=255*o,r[a+3]=31}return n}}}(l,h),d.x=t=>~~((t+n)/o),d.y=t=>~~((t+s)/o),d.ratio=o,d.padding=i,d.width=t,d.height=e,d}function oA(t,e,i=!1){if(i){const{x1:i,x2:s,y1:n,y2:r}=e,a=Ps(i,0,t.width),o=Ps(s,0,t.width),l=Ps(n,0,t.height),h=Ps(r,0,t.height);return{x1:t.x(a),x2:t.x(o),y1:t.y(l),y2:t.y(h)}}return{x1:t.x(e.x1),x2:t.x(e.x2),y1:t.y(e.y1),y2:t.y(e.y2)}}function lA(t,e,i,s=!0,n=0){let r=i;return n>0&&(r={x1:i.x1-n,x2:i.x2+n,y1:i.y1-n,y2:i.y2+n}),r=oA(t,r),!(s&&e.outOfBounds(r)||e.getRange(r))}function hA(t,e,i,s=[],n=!0,r=0){const a=s.filter((t=>M(t)));for(let s=0;sa(n.AABBBounds,r,t,s.offset)));return hA(t,e,n,o,h,d)}return!1}var c;if("moveY"===i.type){const s=(i.offset?ys(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x,y:n.attribute.y+t})));return hA(t,e,n,s,h,d)}if("moveX"===i.type){const s=(i.offset?ys(i.offset)?i.offset(n.attribute):i.offset:[]).map((t=>({x:n.attribute.x+t,y:n.attribute.y})));return hA(t,e,n,s,h,d)}return!1}const cA=["top","bottom","right","left","top-right","bottom-right","top-left","bottom-left"],uA=["top","inside-top","inside"];function pA(t,e,i){const{x1:s,x2:n,y1:r,y2:a}=t.AABBBounds,o=Math.min(s,n),l=Math.max(s,n),h=Math.min(r,a),d=Math.max(r,a);let c=0,u=0;return o<0&&l-o<=e?c=-o:l>e&&o-(l-e)>=0&&(c=e-l),h<0&&d-h<=i?u=-h:d>i&&h-(d-i)>=0&&(u=i-d),{dx:c,dy:u}}class gA extends Ts{constructor(t,e,i,s,n){super(t,e,i,s,n)}getEndProps(){return!1===this.valid?{}:{text:this.to}}onBind(){var t,e,i,s,n,r,a,o;this.fromNumber=h(null===(t=this.from)||void 0===t?void 0:t.text)?null===(e=this.from)||void 0===e?void 0:e.text:Number.parseFloat(null===(i=this.from)||void 0===i?void 0:i.text),this.toNumber=h(null===(s=this.to)||void 0===s?void 0:s.text)?null===(n=this.to)||void 0===n?void 0:n.text:Number.parseFloat(null===(r=this.to)||void 0===r?void 0:r.text),Number.isFinite(this.toNumber)||(this.fromNumber=0),Number.isFinite(this.toNumber)||(this.valid=!1),!1!==this.valid&&(this.decimalLength=null!==(o=null===(a=this.params)||void 0===a?void 0:a.fixed)&&void 0!==o?o:Math.max(St(this.fromNumber),St(this.toNumber)))}onEnd(){}onUpdate(t,e,i){!1!==this.valid&&(i.text=t?this.toNumber:(this.fromNumber+(this.toNumber-this.fromNumber)*e).toFixed(this.decimalLength))}}var mA;!function(t){t[t.LEFT_TO_RIGHT=0]="LEFT_TO_RIGHT",t[t.RIGHT_TO_LEFT=1]="RIGHT_TO_LEFT",t[t.TOP_TO_BOTTOM=2]="TOP_TO_BOTTOM",t[t.BOTTOM_TO_TOP=3]="BOTTOM_TO_TOP",t[t.STROKE=4]="STROKE"}(mA||(mA={}));class _A extends Ts{constructor(t,e,i,s,n){var r,a;super(t,e,i,s,n),this.newPointAnimateType=null!==(r=null==n?void 0:n.newPointAnimateType)&&void 0!==r?r:"grow",this.clipRangeByDimension=null!==(a=null==n?void 0:n.clipRangeByDimension)&&void 0!==a?a:"x"}getPoints(t,e=!1){if(t.points)return t.points;if(t.segments){const i=[];return this.segmentsCache||(this.segmentsCache=[]),t.segments.map((t=>{var s,n;t.points&&i.push(...t.points),e&&this.segmentsCache.push(null!==(n=null===(s=t.points)||void 0===s?void 0:s.length)&&void 0!==n?n:0)})),i}return[]}onBind(){const t=this.getPoints(this.from),e=this.getPoints(this.to,!0);this.fromPoints=t?Array.isArray(t)?t:[t]:[],this.toPoints=e?Array.isArray(e)?e:[e]:[];const i=new Map;this.fromPoints.forEach((t=>{t.context&&i.set(t.context,t)}));let s,n,r=1/0,a=-1/0;for(let t=0;t=0;t-=1)if(i.has(this.toPoints[t].context)){a=t,n=i.get(this.toPoints[t].context);break}"clip"===this.newPointAnimateType&&0!==this.toPoints.length&&(Number.isFinite(a)?(this.clipRange=this.toPoints[a][this.clipRangeByDimension]/this.toPoints[this.toPoints.length-1][this.clipRangeByDimension],qo(this.clipRange)?this.clipRange=Ps(this.clipRange,0,1):this.clipRange=0):this.clipRange=0);let o=this.toPoints[0];this.interpolatePoints=this.toPoints.map(((t,e)=>{const l=i.get(t.context);return l?(o=l,[l,t]):"appear"===this.newPointAnimateType||"clip"===this.newPointAnimateType?[t,t]:ea&&n?[n,t]:[o,t]})),this.points=this.interpolatePoints.map((t=>{const e=t[0],i=t[1],s=new ye(e.x,e.y,e.x1,e.y1);return s.defined=i.defined,s.context=i.context,s}))}onUpdate(t,e,i){if(this.points=this.points.map(((t,i)=>{const s=hn(this.interpolatePoints[i][0],this.interpolatePoints[i][1],e);return s.context=t.context,s})),this.clipRange&&(i.clipRange=this.clipRange+(1-this.clipRange)*e),this.segmentsCache&&this.to.segments){let t=0;i.segments=this.to.segments.map(((e,i)=>{const s=this.points.slice(t,this.segmentsCache[t]);return t+=this.segmentsCache[t],Object.assign(Object.assign({},e),{points:s})}))}else i.points=this.points}}class fA extends Ts{constructor(t,e,i,s,n){super(null,null,i,s,n),this.clipFromAttribute=t,this.clipToAttribute=e,this._group=null==n?void 0:n.group,this._clipGraphic=null==n?void 0:n.clipGraphic}onBind(){this._group&&this._clipGraphic&&(this._lastClip=this._group.attribute.clip,this._lastPath=this._group.attribute.path,this._group.setAttributes({clip:!0,path:[this._clipGraphic]},!1,{type:le.ANIMATE_BIND}))}onEnd(){this._group&&this._group.setAttributes({clip:this._lastClip,path:this._lastPath},!1,{type:le.ANIMATE_END})}onUpdate(t,e,i){if(!this._clipGraphic)return;const s={};Object.keys(this.clipFromAttribute).forEach((t=>{s[t]=this.clipFromAttribute[t]+(this.clipToAttribute[t]-this.clipFromAttribute[t])*e})),this._clipGraphic.setAttributes(s,!1,{type:le.ANIMATE_UPDATE,animationState:{ratio:e,end:t}})}}class vA extends fA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p,g,m,_;const f=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},v=null!==(o=f.width)&&void 0!==o?o:0,y=null!==(l=f.height)&&void 0!==l?l:0,b=null!==(h=null==n?void 0:n.animationType)&&void 0!==h?h:"in",x=null!==(d=null==n?void 0:n.startAngle)&&void 0!==d?d:0,S=null!==(c=null==n?void 0:n.orient)&&void 0!==c?c:"clockwise";let M=0,k=0;"anticlockwise"===S?(k="in"===b?x+2*Math.PI:x,k=x+2*Math.PI):(M=x,k="out"===b?x+2*Math.PI:x);const A=xi.graphicService.creator.arc({x:null!==(p=null===(u=null==n?void 0:n.center)||void 0===u?void 0:u.x)&&void 0!==p?p:v/2,y:null!==(m=null===(g=null==n?void 0:n.center)||void 0===g?void 0:g.y)&&void 0!==m?m:y/2,outerRadius:null!==(_=null==n?void 0:n.radius)&&void 0!==_?_:(v+y)/2,innerRadius:0,startAngle:M,endAngle:k,fill:!0});let w,T;"anticlockwise"===S?(w={startAngle:x+2*Math.PI},T={startAngle:x}):(w={endAngle:x},T={endAngle:x+2*Math.PI}),super("in"===b?w:T,"in"===b?T:w,i,s,{group:null==n?void 0:n.group,clipGraphic:A})}}class yA extends fA{constructor(t,e,i,s,n){var r,a,o,l,h,d,c,u,p;const g=null!==(a=null===(r=null==n?void 0:n.group)||void 0===r?void 0:r.attribute)&&void 0!==a?a:{},m=null!==(l=null!==(o=null==n?void 0:n.width)&&void 0!==o?o:g.width)&&void 0!==l?l:0,_=null!==(d=null!==(h=null==n?void 0:n.height)&&void 0!==h?h:g.height)&&void 0!==d?d:0,f=null!==(c=null==n?void 0:n.animationType)&&void 0!==c?c:"in",v=null!==(u=null==n?void 0:n.direction)&&void 0!==u?u:"x",y=null!==(p=null==n?void 0:n.orient)&&void 0!==p?p:"positive",b=xi.graphicService.creator.rect({x:0,y:0,width:"in"===f&&"x"===v?0:m,height:"in"===f&&"y"===v?0:_,fill:!0});let x={},S={};"y"===v?"negative"===y?(x={y:_,height:0},S={y:0,height:_}):(x={height:0},S={height:_}):"negative"===y?(x={x:m,width:0},S={x:0,width:m}):(x={width:0},S={width:m}),super("in"===f?x:S,"in"===f?S:x,i,s,{group:null==n?void 0:n.group,clipGraphic:b})}}class bA extends Ts{onStart(){const{center:t,r:e}="function"==typeof this.params?this.params():this.params,i=this.target.getComputedAttribute("x"),s=this.target.getComputedAttribute("y"),n=this.target.getComputedAttribute("z"),r=Math.acos((s-t.y)/e);let a=Math.acos((i-t.x)/e/Math.sin(r));n-t.z<0&&(a=lt-a),this.theta=a,this.phi=r}onBind(){}onEnd(){}onUpdate(t,e,i){if(null==this.phi||null==this.theta)return;const{center:s,r:n,cb:r}="function"==typeof this.params?this.params():this.params,a=2*Math.PI*e,o=this.theta+a,l=this.phi,h=n*Math.sin(l)*Math.cos(o)+s.x,d=n*Math.cos(l)+s.y,c=n*Math.sin(l)*Math.sin(o)+s.z;for(i.x=h,i.y=d,i.z=c,i.alpha=o+rt/2;i.alpha>lt;)i.alpha-=lt;i.alpha=lt-i.alpha,i.zIndex=-1e4*i.z,r&&r(i)}}class xA extends Ts{constructor(t,e){super(null,null,t,"linear"),this.customAnimates=e}initAnimates(){this.customAnimates.forEach((t=>{t.step=this.step,t.subAnimate=this.subAnimate,t.target=this.target}))}getEndProps(){const t={};return this.customAnimates.forEach((e=>{Object.assign(t,e.getEndProps())})),t}onBind(){this.initAnimates(),this.customAnimates.forEach((t=>{t.onBind()}))}onEnd(){this.customAnimates.forEach((t=>{t.onEnd()}))}onStart(){this.customAnimates.forEach((t=>{t.onStart()}))}onUpdate(t,e,i){this.updating||(this.updating=!0,this.customAnimates.forEach((s=>{const n=s.easing,r="string"==typeof n?ks[n]:n;e=r(e),s.onUpdate(t,e,i)})),this.updating=!1)}}const SA={fadeIn:(t={})=>{var e,i,s;return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1}}},fadeOut:(t={})=>{var e,i,s;return{from:{opacity:null!==(e=t.opacity)&&void 0!==e?e:1,fillOpacity:null!==(i=t.fillOpacity)&&void 0!==i?i:1,strokeOpacity:null!==(s=t.strokeOpacity)&&void 0!==s?s:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}}};function MA(t,e){var i,s;return null!==(s=null===(i=SA[e])||void 0===i?void 0:i.call(SA,t))&&void 0!==s?s:{from:{},to:{}}}function kA(t,e,i,s){t.attribute.text!==e.attribute.text&&qo(Number(t.attribute.text)*Number(e.attribute.text))&&t.animate().play(new gA({text:t.attribute.text},{text:e.attribute.text},i,s))}const AA={mode:"same-time",duration:300,easing:"linear"};function wA(t){return 3===t||4===t}function TA(t,e){const{x1:i,y1:s,x2:n,y2:r}=t,{x1:a,y1:o,x2:l,y2:h}=e;return!(i<=a&&n<=a||i>=l&&n>=l||s<=o&&r<=o||s>=h&&r>=h)}const LA=t=>{if(!t||!t.attribute)return[];const{points:e,segments:i}=t.attribute;if(i&&i.length){const t=[];return i.forEach((e=>{e.points.forEach((e=>{t.push(e)}))})),t}return e};function CA(t,e,i,s,n,r){return Math.abs(e/t)0?n:-n),y:s+e*n/Math.abs(t)}:{x:i+t*r/Math.abs(e),y:s+(e>0?r:-r)}}u_(),df(),ek(),hM();class EA extends Rk{setBitmap(t){this._bitmap=t}setBitmapTool(t){this._bmpTool=t}constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=t.target;e===this._lastHover||Ym(e.states)||(e.addState(Kk.hover,!0),zk(this,(t=>{t===e||Ym(t.states)||t.addState(Kk.hoverReverse,!0)})),this._lastHover=e)},this._onUnHover=t=>{this._lastHover&&(zk(this,(t=>{Ym(t.states)||(t.removeState(Kk.hoverReverse),t.removeState(Kk.hover))})),this._lastHover=null)},this._onClick=t=>{const e=t.target;if(this._lastSelect===e&&e.hasState("selected"))return this._lastSelect=null,void zk(this,(t=>{Ym(t.states)||(t.removeState(Kk.selectedReverse),t.removeState(Kk.selected))}));Ym(e.states)||(e.addState(Kk.selected,!0),zk(this,(t=>{t===e||Ym(t.states)||t.addState(Kk.selectedReverse,!0)})),this._lastSelect=e)},this._handleRelatedGraphicSetState=t=>{var e,i,s,n,r;if((null===(e=t.detail)||void 0===e?void 0:e.type)===le.STATE||(null===(i=t.detail)||void 0===i?void 0:i.type)===le.ANIMATE_UPDATE&&(null===(s=t.detail.animationState)||void 0===s?void 0:s.isFirstFrameOfStep)){const e=null!==(r=null===(n=t.target)||void 0===n?void 0:n.currentStates)&&void 0!==r?r:[],i=this._isCollectionBase?[...this._graphicToText.values()]:[this._graphicToText.get(t.target)];this.updateStatesOfLabels(i,e)}}}labeling(t,e,i,s){}_getLabelLinePoints(t,e){return function(t,e){if(!t||!e)return;if(zt(t,e,!0))return;const i=Math.min(t.x1,t.x2),s=Math.min(t.y1,t.y2),n=Math.min(e.x1,e.x2),r=Math.min(e.y1,e.y2),a=Math.abs(t.x2-i)/2,o=Math.abs(t.y2-s)/2,l=Math.abs(e.x2-n)/2,h=Math.abs(e.y2-r)/2,d=i+a,c=s+o,u=n+l,p=r+h,g=u-d,m=p-c;return[CA(g,m,d,c,a,o),CA(-g,-m,u,p,l,h)]}(t.AABBBounds,null==e?void 0:e.AABBBounds)}_createLabelLine(t,e){const i=this._getLabelLinePoints(t,e);if(i){const s=ra.line({points:i}),{line:n={}}=t.attribute;if(n.customShape){const i=n.customShape;s.pathProxy=s=>i({text:t,baseMark:e},s,new qe)}return e&&e.attribute.fill&&s.setAttribute("stroke",e.attribute.fill),this.attribute.line&&!Ym(this.attribute.line.style)&&s.setAttributes(this.attribute.line.style),this._setStatesOfLabelLine(s),s}}render(){if(this._prepare(),D(this._idToGraphic)||this._isCollectionBase&&D(this._idToPoint))return;const{overlap:t,smartInvert:e,dataFilter:i,customLayoutFunc:s,customOverlapFunc:n}=this.attribute;let r=this.attribute.data;ys(i)&&(r=i(r));let a=this._initText(r);a=ys(s)?s(r,a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):this._layout(a),ys(n)?a=n(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null):!1!==t&&(a=this._overlapping(a)),ys(this.attribute.onAfterOverlapping)&&this.attribute.onAfterOverlapping(a,this.getRelatedGraphic.bind(this),this._isCollectionBase?t=>this._idToPoint.get(t.id):null),a&&a.length&&a.forEach((t=>{this._bindEvent(t),this._setStatesOfText(t)})),!1!==e&&this._smartInvert(a),this._renderLabels(a)}_bindEvent(t){if(this.attribute.disableTriggerEvent)return;if(!t)return;const{hover:e,select:i}=this.attribute;e&&(t.addEventListener("pointermove",this._onHover),t.addEventListener("pointerout",this._onUnHover)),i&&t.addEventListener("pointerdown",this._onClick)}_setStatesOfText(t){if(!t)return;const e=this.attribute.state;e&&!Ym(e)&&(t.states=e)}_setStatesOfLabelLine(t){if(!t)return;const e=this.attribute.labelLineState;e&&!Ym(e)&&(t.states=e)}_createLabelText(t){var e,i;return iA(Object.assign(Object.assign({},null===(i=null===(e=this.stage)||void 0===e?void 0:e.getTheme())||void 0===i?void 0:i.text),t),"textType")}_prepare(){var t,e;const i=[];let s;if(s=ys(this.attribute.getBaseMarks)?this.attribute.getBaseMarks():function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.getChildren():[]}(this.getRootNode(),this.attribute.baseMarkGroupName),s.forEach((t=>{"willRelease"!==t.releaseStatus&&i.push(t)})),null===(t=this._idToGraphic)||void 0===t||t.clear(),null===(e=this._idToPoint)||void 0===e||e.clear(),this._baseMarks=i,this._isCollectionBase="line-data"===this.attribute.type,!i||0===i.length)return;const{data:n}=this.attribute;if(n&&0!==n.length){if(this._idToGraphic||(this._idToGraphic=new Map),this._isCollectionBase){this._idToPoint||(this._idToPoint=new Map);let t=0;for(let e=0;e!!t&&!0!==t)):r.attribute.stroke:r.attribute.fill},e),n),o=this._createLabelText(a);i.push(o)}return i}_layout(t){const{position:e,offset:i}=this.attribute;for(let s=0;s"bound"===t.type));h&&(null===(n=this._baseMarks)||void 0===n||n.forEach((t=>{t.AABBBounds&&_.setRange(oA(m,t.AABBBounds,!0))}))),p.length>0&&p.forEach((t=>{S(t)?function(t,e){if(!e)return[];const i=t.find((t=>t.name===e),!0);return i?i.findAll((t=>"group"!==t.type),!0):[]}(this.getRootNode(),t).forEach((t=>{t.AABBBounds&&_.setRange(oA(m,t.AABBBounds,!0))})):t.AABBBounds&&_.setRange(oA(m,t.AABBBounds,!0))}));for(let e=0;ee.name===t),!0)}getGraphicBounds(t,e={}){if(t){if(!1!==t.attribute.visible)return t.AABBBounds;const{x:e,y:i}=t.attribute;return{x1:e,x2:e,y1:i,y2:i}}const{x:i,y:s}=e;return{x1:i,x2:i,y1:s,y2:s}}_renderLabels(t){var e;const{syncState:i}=this.attribute,s=new Map,n=this._graphicToText||new Map,r=[],a=[],{visible:o}=null!==(e=this.attribute.line)&&void 0!==e?e:{};t&&t.forEach(((t,e)=>{var l;const h=this.getRelatedGraphic(t.attribute),d=this._isCollectionBase?t.attribute.id:h,c=(null==n?void 0:n.get(d))?"update":"enter";let u;if(o&&(u=this._createLabelLine(t,h)),i&&this.updateStatesOfLabels([u?{text:t,labelLine:u}:{text:t}],null!==(l=h.currentStates)&&void 0!==l?l:[]),"enter"===c)r.push(t),s.set(d,u?{text:t,labelLine:u}:{text:t}),this._addLabel({text:t,labelLine:u},r,a,e);else if("update"===c){const e=n.get(d);n.delete(d),s.set(d,e),this._updateLabel(e,{text:t,labelLine:u})}})),this._removeLabel(n),this._graphicToText=s}_addLabel(t,e,i,s){const{text:n,labelLine:r}=t,a=this.getRelatedGraphic(n.attribute);if(this._syncStateWithRelatedGraphic(a),!1!==this._enableAnimation&&!1!==this._animationConfig.enter){if(a){const{from:t,to:o}=MA(n.attribute,"fadeIn");n&&this.add(n),r&&(i.push(r),this.add(r)),this._animationConfig.enter.duration>0&&a.once("animate-bind",(l=>{n.setAttributes(t),r&&r.setAttributes(t);const h=this._afterRelatedGraphicAttributeUpdate(n,e,r,i,s,a,o,this._animationConfig.enter);a.on("afterAttributeUpdate",h)}))}}else n&&this.add(n),r&&this.add(r)}_updateLabel(t,e){const{text:i,labelLine:s}=t,{text:n,labelLine:r}=e;if(!1!==this._enableAnimation&&!1!==this._animationConfig.update){const{duration:e,easing:a}=this._animationConfig.update;(function(t,e,i){if(!y(i)){const{duration:s,easing:n,increaseEffect:r=!0}=i;return t.animate().to(e.attribute,s,n),void(r&&"text"===t.type&&"text"===e.type&&kA(t,e,s,n))}i.forEach((i=>{const{duration:s,easing:n,increaseEffect:r=!0,channel:a}=i,{to:o}=((t,e,i,s)=>{const n=Object.assign({},t.attribute),r=Object.assign({},e.attribute);return Ba(null==s?void 0:s.excludeChannels).forEach((t=>{delete r[t]})),Object.keys(r).forEach((t=>{i&&!i.includes(t)&&delete r[t]})),{from:n,to:r}})(t,e,a,i.options);Ym(o)||t.animate().to(o,s,n),r&&"text"===t.type&&"text"===e.type&&kA(t,e,s,n)}))})(i,n,this._animationConfig.update),s&&r&&t.labelLine.animate().to(r.attribute,e,a)}else t.text.setAttributes(n.attribute),s&&r&&t.labelLine.setAttributes(r.attribute)}_removeLabel(t){const e=t=>{this.removeChild(t.text),t.labelLine&&this.removeChild(t.labelLine)};if(!1!==this._enableAnimation&&!1!==this._animationConfig.exit){const{duration:i,easing:s}=this._animationConfig.exit;t.forEach((t=>{var n;null===(n=t.text)||void 0===n||n.animate().to(MA(t.text.attribute,"fadeOut").to,i,s).onEnd((()=>{e(t)}))}))}else t.forEach((t=>{e(t)}))}updateStatesOfLabels(t,e){t.forEach((t=>{t&&(t.text&&t.text.useStates(e),t.labelLine&&t.labelLine.useStates(e))}))}_syncStateWithRelatedGraphic(t){this.attribute.syncState&&t&&t.on("afterAttributeUpdate",this._handleRelatedGraphicSetState)}_afterRelatedGraphicAttributeUpdate(t,e,i,s,n,r,a,{mode:o,duration:l,easing:h,delay:d}){const c=u=>{var p,g,m;const{detail:_}=u;if(!_)return{};const f=null===(p=_.animationState)||void 0===p?void 0:p.step;if(_.type!==le.ANIMATE_UPDATE||!f||"wait"===f.type&&null==(null===(g=f.prev)||void 0===g?void 0:g.type))return{};if(_.type===le.ANIMATE_END)return t.setAttributes(a),void(i&&i.setAttributes(a));const v=()=>{r&&(r.onAnimateBind=void 0,r.removeEventListener("afterAttributeUpdate",c))};switch(o){case"after":_.animationState.end&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h));break;case"after-all":n===e.length-1&&_.animationState.end&&(e.forEach((t=>{t.animate({onStart:v}).wait(d).to(a,l,h)})),s.forEach((t=>{t.animate().wait(d).to(a,l,h)})));break;default:if(this._isCollectionBase){const e=this._idToPoint.get(t.attribute.id);!e||t.animates&&t.animates.has("label-animate")||!r.containsPoint(e.x,e.y,oe.LOCAL,null===(m=this.stage)||void 0===m?void 0:m.getPickerService())||(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}else _.animationState.isFirstFrameOfStep&&(t.animate({onStart:v}).wait(d).to(a,l,h),i&&i.animate().wait(d).to(a,l,h))}};return c}_smartInvert(t){var e,i,s,n,r;const a=vs(this.attribute.smartInvert)?this.attribute.smartInvert:{},{textType:o,contrastRatiosThreshold:l,alternativeColors:h,mode:d}=a,c=null!==(e=a.fillStrategy)&&void 0!==e?e:"invertBase",u=null!==(i=a.strokeStrategy)&&void 0!==i?i:"base",p=null!==(s=a.brightColor)&&void 0!==s?s:"#ffffff",g=null!==(n=a.darkColor)&&void 0!==n?n:"#000000",m=null!==(r=a.outsideEnable)&&void 0!==r&&r;if("null"!==c||"null"!==u)for(let e=0;e{DA[t]=e};class OA{constructor(t,e,i,s,n,r,a,o,l){this.refDatum=t,this.center=e,this.outerCenter=i,this.quadrant=s,this.radian=n,this.middleAngle=r,this.innerRadius=a,this.outerRadius=o,this.circleCenter=l,this.labelVisible=!0}getLabelBounds(){return this.labelPosition&&this.labelSize?{x1:this.labelPosition.x-this.labelSize.width/2,y1:this.labelPosition.y-this.labelSize.height/2,x2:this.labelPosition.x+this.labelSize.width/2,y2:this.labelPosition.y+this.labelSize.height/2}:{x1:0,x2:0,y1:0,y2:0}}}class RA extends EA{constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nthis.getGraphicBounds(t))),a=Object.assign(Object.assign({},this.attribute.textStyle),{text:"…"});let o=1/0;if(!1!==a.ellipsis){const t=this._createLabelText(a),e=this.getGraphicBounds(t);o=e.x2-e.x1}const l=n.map((t=>t.attribute)),h=Array.from(this._idToGraphic.values());this._line2MinLength=ys(this.attribute.line.line2MinLength)?this.attribute.line.line2MinLength(t,h,this.attribute):this.attribute.line.line2MinLength,this._alignOffset=null!==(e=ys(this.attribute.layout.alignOffset)?this.attribute.layout.alignOffset(t,h,this.attribute):this.attribute.layout.alignOffset)&&void 0!==e?e:0;const d=this.layoutArcLabels(this.attribute.position,this.attribute,h,l,r,o);for(let t=0;t{var i;return(null===(i=t.refDatum)||void 0===i?void 0:i.id)===e.id}));if(r){const e={visible:r.labelVisible,x:r.labelPosition.x,y:r.labelPosition.y,angle:r.angle,points:r.pointA&&r.pointB&&r.pointC?[r.pointA,r.pointB,r.pointC]:void 0,line:r.labelLine};"richtext"===n[t].type?e.width=null!==(i=r.labelLimit)&&void 0!==i?i:n[t].attribute.width:e.maxLineWidth=null!==(s=r.labelLimit)&&void 0!==s?s:n[t].attribute.maxLineWidth,n[t].setAttributes(e)}}return n}layoutArcLabels(t,e,i,s,n,r){this._arcLeft.clear(),this._arcRight.clear(),this._ellipsisWidth=r;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)})),s.forEach(((t,i)=>{var r,o;const l=this._idToGraphic.get(t.id).attribute,h={x:null!==(r=null==l?void 0:l.x)&&void 0!==r?r:0,y:null!==(o=null==l?void 0:l.y)&&void 0!==o?o:0};if(!D(s[i])&&!D(n[i])){const t=s[i]?s[i]:null,r=n[i]?n[i]:{x1:0,x2:0,y1:0,y2:0},o=(l.startAngle+l.endAngle)/2,c=l.endAngle-l.startAngle,u=Dt(l.endAngle-c/2),p=Tt(h,l.outerRadius,o),g=Tt(h,a+e.line.line1MinLength,o),m=new OA(t,p,g,u,c,o,l.innerRadius,l.outerRadius,h);m.pointA=Tt(h,this.computeDatumRadius(2*h.x,2*h.y,l.outerRadius),m.middleAngle),m.labelSize={width:r.x2-r.x1,height:r.y2-r.y1},1===(d=m.quadrant)||2===d?this._arcRight.set(m.refDatum,m):wA(m.quadrant)&&this._arcLeft.set(m.refDatum,m)}var d}));const o=Array.from(this._arcLeft.values()),l=Array.from(this._arcRight.values()),h=[];switch(t){case"inside":case"inside-inner":case"inside-outer":case"inside-center":h.push(...this._layoutInsideLabels(l,e,i)),h.push(...this._layoutInsideLabels(o,e,i));break;default:h.push(...this._layoutOutsideLabels(l,e,i)),h.push(...this._layoutOutsideLabels(o,e,i))}return h}_layoutInsideLabels(t,e,i){var s,n;const r=e,a=r.spaceWidth,o=null!==(s=r.position)&&void 0!==s?s:"inside",l=null!==(n=r.offsetRadius)&&void 0!==n?n:-a;return t.forEach((t=>{var i,s,n;const{labelSize:h,radian:d}=t,c=t.innerRadius,u=t.outerRadius;let p;if(d<(g=u,(m=h.height)>2*g?NaN:2*Math.asin(m/2/g)))p=0;else{let t;t=d>=Math.PI?c:Math.max(c,h.height/2/Math.tan(d/2)),p=u-t-a}var g,m;!0!==r.rotate&&(p=u-a);const _=this._getFormatLabelText(t.refDatum,p);t.labelText=_;const f=Math.min(p,t.labelSize.width),v=this._computeAlign(t,e);let y,b=0;if("inside"===o&&(b="left"===v?f:"right"===v?0:f/2),y="inside-inner"===o?c-l+b:"inside-center"===o?c+(u-c)/2:u+l-b,t.labelPosition=Tt(t.circleCenter,y,t.middleAngle),t.labelLimit=f,dd(f,0)||(t.labelVisible=!1),!1!==r.rotate){t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:t.middleAngle;let a=null!==(n=r.offsetAngle)&&void 0!==n?n:0;["inside-inner","inside-outer"].includes(o)&&(a+=Math.PI/2),t.angle+=a}})),t}_layoutOutsideLabels(t,e,i){var s,n,r;const a=null!==(s=i[0].attribute.x)&&void 0!==s?s:0,o=2*(null!==(n=i[0].attribute.y)&&void 0!==n?n:0),l=e.layout,h=e.spaceWidth;if(t.forEach((t=>{const e=wA(t.quadrant)?-1:1;t.labelPosition={x:t.outerCenter.x+e*(t.labelSize.width/2+this._line2MinLength+h),y:t.outerCenter.y}})),t.sort(((t,e)=>t.labelPosition.y-e.labelPosition.y)),!1!==e.coverEnable||"none"===l.strategy){for(const s of t){const{labelPosition:t,labelSize:n}=s;s.labelLimit=n.width,s.pointB=wA(s.quadrant)?{x:t.x+n.width/2+this._line2MinLength+h,y:t.y}:{x:t.x-n.width/2-this._line2MinLength-h,y:t.y},this._computeX(s,e,i)}!1===e.coverEnable&&"none"===l.strategy&&this._coverLabels(t)}else{const s=o/((null===(r=e.textStyle)||void 0===r?void 0:r.fontSize)||16);this._adjustY(t,s,e,i);const{minY:n,maxY:a}=t.reduce(((t,e)=>{const{y1:i,y2:s}=e.getLabelBounds();return t.minY=Math.max(0,Math.min(i,t.minY)),t.maxY=Math.min(o,Math.max(s,t.maxY)),t}),{minY:1/0,maxY:-1/0}),l=Math.max(Math.abs(o/2-n),Math.abs(a-o/2)),h=this._computeLayoutRadius(l,e,i);for(const s of t)this._computePointB(s,h,e,i),this._computeX(s,e,i)}const d=2*a;return t.forEach((t=>{var i,s;t.labelVisible&&(cd(t.pointB.x,this._line2MinLength+h)||dd(t.pointB.x,d-this._line2MinLength-h))&&(t.labelVisible=!1),t.angle=null!==(s=null===(i=e.textStyle)||void 0===i?void 0:i.angle)&&void 0!==s?s:0,e.offsetAngle&&(t.angle+=e.offsetAngle),t.labelLine=Object.assign(Object.assign({},e.line),{visible:t.labelVisible})})),t}_computeX(t,e,i){var s;const n=t.circleCenter,r=this.attribute.width;this.attribute.height;let a=0;i.forEach((t=>{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=e.line.line1MinLength,h=null===(s=e.layout)||void 0===s?void 0:s.align,d=e.spaceWidth,{labelPosition:c,quadrant:u,pointB:p}=t;qo(p.x*p.y)||(t.pointC={x:NaN,y:NaN},c.x=NaN,t.labelLimit=0);const g=this.computeRadius(o,e.width,e.height),m=wA(u)?-1:1;let _=0,f=(m>0?r-p.x:p.x-0)-this._line2MinLength-d;"labelLine"===h&&(_=(g+l+this._line2MinLength)*m+n.x,f=(m>0?r-_:_-0)-d);const v=this._getFormatLabelText(t.refDatum,f);t.labelText=v;let y=Math.min(f,t.labelSize.width);switch(h){case"labelLine":break;case"edge":_=m>0?r-y-d:0+y+d;break;default:_=p.x+m*this._line2MinLength}y=Math.max(this._ellipsisWidth,y);const b=y0?r:0)-m*x+m*this._alignOffset,t.pointC.x+=m*this._alignOffset):c.x=_+m*(this._alignOffset+d+x)}_computeAlign(t,e){var i,s,n,r,a,o;const l=e,h=null!==(s=null===(i=l.textStyle)||void 0===i?void 0:i.textAlign)&&void 0!==s?s:null===(n=l.textStyle)||void 0===n?void 0:n.align,d=null!==(a=null===(r=l.layout)||void 0===r?void 0:r.textAlign)&&void 0!==a?a:null===(o=l.layout)||void 0===o?void 0:o.align;return"inside"!==l.position?D(h)||"auto"===h?"edge"===d?wA(t.quadrant)?"left":"right":wA(t.quadrant)?"right":"left":h:D(h)||"auto"===h?"center":h}_getFormatLabelText(t,e){var i;return null!==(i=null==t?void 0:t.text)&&void 0!==i?i:""}_adjustY(t,e,i,s){var n;s[0].attribute.x;const r=2*(null!==(n=s[0].attribute.y)&&void 0!==n?n:0),a=i.layout;if("vertical"===a.strategy){let e,i=0;const s=t.length;if(s<=0)return;for(let n=0;n=0&&t[e].getLabelBounds().y2>r;e--)t[e].labelVisible=!1}else if("none"!==a.strategy){const n=t.map(((t,e)=>({arc:t,originIndex:e,priorityIndex:0})));n.sort(((t,e)=>e.arc.radian-t.arc.radian)),n.forEach(((t,e)=>{t.priorityIndex=e,t.arc.labelVisible=!1}));let o=1/0,l=-1/0;for(let h=0;hi?e.labelPosition.y=i-g.labelSize.height/2-e.labelSize.height/2:this._twoWayShift(t,e,g,u)}else if(-1!==c&&-1===u){const i=p.labelPosition.y;ds?(e.labelPosition.y=s-g.labelSize.height/2-e.labelSize.height/2,this._twoWayShift(t,p,e,n[h].originIndex)):d=0&&e0&&so)return r}r=e}return i}_findNextVisibleIndex(t,e,i,s){const n=(i-e)*s;for(let i=1;i<=n;i++){const n=e+i*s;if(t[n].labelVisible)return n}return-1}_computePointB(t,e,i,s){const n=i;let r=0;s.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,i.width,i.height),o=n.line.line1MinLength;if("none"===n.layout.strategy)t.pointB={x:t.outerCenter.x,y:t.outerCenter.y};else{const s=t.circleCenter,n=this.computeRadius(a,i.width,i.height),{labelPosition:r,quadrant:l}=t,h=e-Math.max(n+o,t.outerRadius),d=Math.sqrt(e**2-Math.abs(s.y-r.y)**2)-h;qo(d)?t.pointB={x:s.x+d*(wA(l)?-1:1),y:r.y}:t.pointB={x:NaN,y:NaN}}}_storeY(t){for(const e of t)e.labelVisible&&(e.lastLabelY=e.labelPosition.y)}_computeYRange(t,e,i){const s=t.circleCenter,n={width:2*s.x,height:2*s.y};let r=0;i.forEach((t=>{t.attribute.outerRadius>r&&(r=t.attribute.outerRadius)}));const a=this.computeLayoutOuterRadius(r,e.width,e.height),o=e.line.line1MinLength,{width:l,height:h}=n,d=this.computeRadius(a,e.width,e.height),c=this._computeLayoutRadius(h/2,e,i),u=Math.abs(t.center.x-l/2),p=t.center.y-h/2;let g,m,_;if(hd(l/2,u))g=0,m=1,_=-p;else if(hd(h/2,p))g=1,m=0,_=-u;else{const t=-1/(p/u);g=t,m=-1,_=p-t*u}const f=function(t,e,i,s,n,r){if(0===t&&0===e||r<=0)return[];if(0===t){const t=-i/e,n=r**2-(t-0)**2;return n<0?[]:0===n?[{x:s,y:t}]:[{x:Math.sqrt(n)+s,y:t},{x:-Math.sqrt(n)+s,y:t}]}if(0===e){const e=-i/t,n=r**2-(e-s)**2;return n<0?[]:0===n?[{x:e,y:0}]:[{x:e,y:Math.sqrt(n)+0},{x:e,y:0-Math.sqrt(n)}]}const a=(e/t)**2+1,o=2*((i/t+s)*(e/t)-0),l=o**2-4*a*((i/t+s)**2+0-r**2);if(l<0)return[];const h=(-o+Math.sqrt(l))/(2*a),d=(-o-Math.sqrt(l))/(2*a),c=-(e*h+i)/t;return 0===l?[{x:c,y:h}]:[{x:c,y:h},{x:-(e*d+i)/t,y:d}]}(g,m,_,o+d-c,0,c);if(f.length<2)return;let v,y;f[0].x>f[1].x&&f.reverse(),f[0].x<0?hd(f[0].y,f[1].y)?dd(t.middleAngle,-Math.PI)&&cd(t.middleAngle,0)||dd(t.middleAngle,Math.PI)&&cd(t.middleAngle,2*Math.PI)?(v=0,y=f[1].y+h/2):(v=f[1].y+h/2,y=h):f[0].y{t.attribute.outerRadius>a&&(a=t.attribute.outerRadius)}));const o=this.computeLayoutOuterRadius(a,e.width,e.height),l=this.computeRadius(o,e.width,e.height)+r,h=l-n;return Math.max((h**2+t**2)/(2*h),l)}_findNeighborIndex(t,e){const i=e.originIndex;let s=-1,n=-1;for(let e=i-1;e>=0;e--)if(t[e].labelVisible){s=e;break}for(let e=i+1;e{var i;return t.concat(null!==(i=e.points)&&void 0!==i?i:[])}),[])),s&&0!==s.length||(s=[e]);const r="start"===i?0:s.length-1;return s[r]?{x1:s[r].x,x2:s[r].x,y1:s[r].y,y2:s[r].y}:void 0}labeling(t,e,i="end",s=0){return function(t,e,i="end",s=0){if(!t||!e)return{x:1/0,y:1/0};const{x1:n,x2:r}=t,a=Math.abs(r-n),o=e.x1;let l=o;return"end"===i?l=o+a/2+s:"start"===i&&(l=o-a/2-s),{x:l,y:e.y1}}(t,e,i,s)}}IA.defaultAttributes={textStyle:{fill:"#000"},position:"end",offset:6};const BA=()=>{PA("line",IA),PA("area",IA)};class FA extends EA{constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if(!t)return;const{x1:n,y1:r,x2:a,y2:o}=t,l=Math.abs(a-n),h=Math.abs(o-r),d=(e.x1+e.x2)/2,c=(e.y1+e.y2)/2;let u=0,p=0,g=0,m=0;e&&(g=Math.abs(e.x1-e.x2)/2,m=Math.abs(e.y1-e.y2)/2);const _={"top-right":-235,"top-left":235,"bottom-right":45,"bottom-left":-45};switch(i){case"top":p=-1;break;case"bottom":p=1;break;case"left":u=-1;break;case"right":u=1;break;case"bottom-left":case"bottom-right":case"top-left":case"top-right":u=Math.sin(_[i]*(Math.PI/180)),p=Math.cos(_[i]*(Math.PI/180));break;case"center":u=0,p=0}return{x:d+u*(s+g)+Math.sign(u)*(l/2),y:c+p*(s+m)+Math.sign(p)*(h/2)}})(t,e,i,s)}}FA.defaultAttributes={textStyle:{fill:"#000"},position:"top",offset:5};const YA=()=>{PA("symbol",FA),PA("line-data",FA)},jA=(t,e)=>{const{x1:i,x2:s,y1:n,y2:r}=t,a=Math.abs(s-i),o=Math.abs(r-n);let l=(i+s)/2,h=(n+r)/2,d=0,c=0;switch(e){case"top":case"inside-top":c=-.5;break;case"bottom":case"inside-bottom":c=.5;break;case"left":case"inside-left":d=-.5;break;case"right":case"inside-right":d=.5;break;case"top-right":d=.5,c=-.5;break;case"top-left":d=-.5,c=-.5;break;case"bottom-right":d=.5,c=.5;break;case"bottom-left":d=-.5,c=.5}return l+=d*a,h+=c*o,{x:l,y:h}};class HA extends EA{constructor(t,e){const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{Sx(),wM(),_c.registerGraphic(Jd.path,uM)},NA=()=>{Sx(),_y(),PA("rect",HA),_c.registerGraphic(Jd.rect,Kv)},VA=()=>{Sx(),hM(),_c.registerGraphic(Jd.rule,JS)},WA=()=>{Sx(),Gv(),YA(),_c.registerGraphic(Jd.symbol,Cv)},GA=()=>{Sx(),df(),ek(),_c.registerGraphic(Jd.text,__)},UA=()=>{Sx(),Pk(),_c.registerGraphic(Jd.glyph,bk)};class $A extends vx{constructor(){super(...arguments),this.type=$A.type,this._marks=[]}getMarks(){return this._marks}_getDefaultStyle(){return Object.assign({},super._getDefaultStyle())}isMarkExist(t){return void 0!==this._marks.find((e=>e.id===t.id||e.name===t.name))}addMark(t){return this.isMarkExist(t)?(pl("Mark already exists, add mark failed."),!1):(this._marks.push(t),!0)}removeMark(t){const e=this._marks.findIndex((e=>e.id===t.id||e.name===t.name));return-1===e?(pl("Mark does not exists, removeMark failed."),!1):(this._marks.splice(e,1),!0)}getMarkInType(t){return this._marks.filter((e=>e.type===t))}getMarkInId(t){return this._marks.find((e=>e.id===t))}getMarkInName(t){return this._marks.find((e=>e.name===t))}_compileProduct(t){super._compileProduct(t),this._product.configure({zIndex:this.getZIndex()}),(null==t?void 0:t.ignoreChildren)||this.getMarks().forEach((t=>{t.getProduct()&&t.removeProduct(),t.compile({group:this._product})}))}}$A.type="group";const XA=()=>{Sx(),u_(),_c.registerGraphic(Jd.group,tr),$l.registerMark($A.type,$A)},KA=(t,e)=>{const i=e.x-t.x,s=e.y-t.y;return Math.abs(i)>Math.abs(s)?i>0?"right":"left":s>0?"down":"up"},qA=(t,e)=>{const i=Math.abs(e.x-t.x),s=Math.abs(e.y-t.y);return Math.sqrt(i*i+s*s)};class ZA extends(o()){constructor(t,e={}){var i,s,n,r,a,o,l,h,d,c;super(),this.cachedEvents=[],this.startPoints=[],this.processEvent={},this.throttleTimer=0,this.emitThrottles=[],this.lastTapTarget=null,this.onStart=t=>{this.reset(),this.startTime=mg.now();const{cachedEvents:e,startPoints:i}=this;t&&e.push(t.clone()),i.length=e.length;for(let t=0;t{const e=t.length;if(1===e)return{x:Math.round(t[0].x),y:Math.round(t[0].y)};let i=0,s=0,n=0;for(;n{t.direction="none",t.deltaX=0,t.deltaY=0,t.points=i,this.triggerStartEvent("press",t),this.triggerEvent("press",t),this.eventType="press",this.direction="none"}),this.config.press.time)}},this.onMove=t=>{this.clearPressTimeout();const{startPoints:e,cachedEvents:i}=this;if(!e.length)return;const s=t.clone(),{x:n,y:r,pointerId:a}=s;for(let t=0,e=i.length;t({x:t.x,y:t.y}))),h=mg.now();if(this.prevMoveTime=this.lastMoveTime,this.prevMovePoint=this.lastMovePoint,this.lastMoveTime=h,this.lastMovePoint=o,1===e.length){const t=e[0],i=n-t.x,a=r-t.y,h=this.direction||KA(t,o);this.direction=h;const d=this.getEventType(o);return s.direction=h,s.deltaX=i,s.deltaY=a,s.points=l,this.triggerStartEvent(d,s),void this.triggerEvent(d,s)}const{startDistance:d}=this,c=qA(l[0],l[1]);s.scale=c/d,s.center=this.center,s.points=l,this.triggerStartEvent("pinch",s),this.triggerEvent("pinch",s)},this.onEnd=t=>{const e=t.clone(),{cachedEvents:i,startPoints:s}=this,n=i.map((t=>({x:t.x,y:t.y})));if(e.points=n,this.triggerEndEvent(e),1===i.length){const i=mg.now(),n=this.lastMoveTime;if(i-n<100){const t=n-(this.prevMoveTime||this.startTime);if(t>0){const i=this.prevMovePoint||s[0],n=this.lastMovePoint||s[0],r=qA(i,n),a=r/t;a>this.config.swipe.velocity&&r>this.config.swipe.threshold&&(e.velocity=a,e.direction=KA(i,n),this.triggerEvent("swipe",e))}}i-this.lastTapTime0&&this.onStart()},this.element=t,this.tapCount=0,this.lastTapTime=0,this.config={press:{time:null!==(s=null===(i=null==e?void 0:e.press)||void 0===i?void 0:i.time)&&void 0!==s?s:251,threshold:null!==(r=null===(n=null==e?void 0:e.press)||void 0===n?void 0:n.threshold)&&void 0!==r?r:9},swipe:{threshold:null!==(o=null===(a=null==e?void 0:e.swipe)||void 0===a?void 0:a.threshold)&&void 0!==o?o:10,velocity:null!==(h=null===(l=null==e?void 0:e.swipe)||void 0===l?void 0:l.velocity)&&void 0!==h?h:.3},tap:{interval:null!==(c=null===(d=null==e?void 0:e.tap)||void 0===d?void 0:d.interval)&&void 0!==c?c:300}},this.initEvents()}initEvents(){const{element:t}=this;t&&(t.addEventListener("pointerdown",this.onStart),t.addEventListener("pointermove",this.onMove),t.addEventListener("pointerup",this.onEnd),t.addEventListener("pointerupoutside",this.onEnd))}removeEvents(){const{element:t}=this;t&&(t.removeEventListener("pointerdown",this.onStart),t.removeEventListener("pointermove",this.onMove),t.removeEventListener("pointerup",this.onEnd),t.removeEventListener("pointerupoutside",this.onEnd))}release(){this.removeEvents(),this.element=null}getEventType(t){const{eventType:e,startTime:i,startPoints:s}=this;if(e)return e;let n;return n=mg.now()-i>this.config.press.time&&qA(s[0],t){for(let t=0,e=s.length;t{this.triggerEvent(`${i}end`,t),"press"===i&&this.triggerEvent(`${i}up`,t),delete e[i]}))}emitEvent(t,e){const i=this.element._events["*"];if(i)if("fn"in i)i.fn.call(i.context,e,t);else for(let s=0,n=i.length;s{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(lc.ALL_ANIMATION_START,{}),this._animations=this._animations.concat({config:t.animationConfig,mark:t.mark})},this._onAnimationEnd=t=>{this._additionalAnimateMarks=this._additionalAnimateMarks.filter((t=>{var e;return null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating()})),this._animations=this._animations.filter((e=>e.config!==t.animationConfig||e.mark!==t.mark)),0===this._animations.length&&0===this._additionalAnimateMarks.length&&this._view.emit(lc.ALL_ANIMATION_END,{})},this._view=t,this._view.addEventListener(lc.ANIMATION_START,this._onAnimationStart),this._view.addEventListener(lc.ANIMATION_END,this._onAnimationEnd)}stop(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}pause(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).pause)||void 0===i||i.call(e))})),this}resume(){return this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).resume)||void 0===i||i.call(e))})),this}enable(){return this.isEnabled=!0,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).enable)||void 0===i||i.call(e))})),this}disable(){return this.isEnabled=!1,this._view.traverseMarkTree((t=>{var e,i;t.animate&&(null===(i=(e=t.animate).disable)||void 0===i||i.call(e))})),this._additionalAnimateMarks.forEach((t=>{var e,i;t.view&&t.animate&&(null===(i=(e=t.animate).stop)||void 0===i||i.call(e))})),this._additionalAnimateMarks=[],this}enableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).enableAnimationState)||void 0===s||s.call(i,t))})),this}disableAnimationState(t){return this._view.traverseMarkTree((e=>{var i,s;e.animate&&(null===(s=(i=e.animate).disableAnimationState)||void 0===s||s.call(i,t))})),this}isAnimating(){return 0!==this._animations.length||this._additionalAnimateMarks.some((t=>{var e;return(null===(e=null==t?void 0:t.animate)||void 0===e?void 0:e.isAnimating())||!1}))}animate(){return this.isEnabled?(this._view.traverseMarkTree((t=>{t.isUpdated&&t.animate&&t.animate.animate(),t.cleanExitElements(),t.isUpdated=!1}),null,!0),this):this}animateAddition(t){var e;const i=null===(e=t.animate)||void 0===e?void 0:e.animate();return i&&i.isAnimating()&&this._additionalAnimateMarks.push(t),this}release(){this._additionalAnimateMarks=[],this._animations=[],this._view.removeEventListener(lc.ALL_ANIMATION_START,this._onAnimationStart),this._view.removeEventListener(lc.ALL_ANIMATION_END,this._onAnimationEnd),this._view=null}}class tw{initAnimate(t){return this.animate=new QA(t),this.animate}}const ew=(t,e)=>{if(!t)return null;if(t.from){const i=t.from,s=Object.keys(i);s.forEach((t=>{D(i[t])&&delete i[t]}));const n=mm(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.from=e.transformElementItems(s,e.mark.markType,n)}}if(t.to){const i=t.to,s=Object.keys(i);s.forEach((t=>{D(i[t])&&delete i[t]}));const n=mm(s,e.mark.markType)&&!M(i.segments);if(n){const s=e.items.map((t=>Object.assign({},t,{nextAttrs:Object.assign({},i)})));t.to=e.transformElementItems(s,e.mark.markType,n)}}return t},iw=(t,e,i,s,n)=>ys(i)?i(t.getDatum(),t,n):i;class sw extends Ts{constructor(t,e,i,s,n){super(t,e,i,s,n),this._interpolator=null==n?void 0:n.interpolator,this._element=null==n?void 0:n.element}onBind(){var t,e;this.from=null!==(t=this.from)&&void 0!==t?t:{},this.to=null!==(e=this.to)&&void 0!==e?e:{}}getEndProps(){return this.to}onUpdate(t,e,i){this._interpolator&&this._element&&this._interpolator.call(this,e,this.from,this.to,i,this._element.getDatum(),this._element,this.params.parameters)}}class nw extends Ts{getEndProps(){return this.to}onBind(){var t;const e=null!==(t=this.target.constructor.NOWORK_ANIMATE_ATTR)&&void 0!==t?t:Sn,i=Object.keys(e).filter((t=>0!==e[t]));this.subAnimate.animate.preventAttrs(i);const s=Object.assign({},this.from),n=Object.assign({},this.to),r=[];Object.keys(n).forEach((t=>{i.includes(t)?(s[t]=n[t],this.from[t]=n[t]):D(s[t])?s[t]=this.target.getComputedAttribute(t):r.push(t)})),this.target.animates.forEach((t=>{t!==this.subAnimate.animate&&t.preventAttrs(r)})),this._fromAttribute=s,this._toAttribute=n}onStart(){if(this._fromAttribute){const t={};Object.keys(this._fromAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._fromAttribute[e])})),this.target.setAttributes(t,!1,{type:le.ANIMATE_UPDATE,animationState:{ratio:0,end:!1}})}}onEnd(){if(this._toAttribute){const t={};Object.keys(this._toAttribute).forEach((e=>{this.subAnimate.animate.validAttr(e)&&(t[e]=this._toAttribute[e])})),this.target.setAttributes(t,!1,{type:le.ANIMATE_END})}}update(t,e,i){0===this.updateCount&&this.onFirstRun(),this.updateCount+=1;const s=this.step.getLastProps();Object.keys(s).forEach((t=>{this.subAnimate.animate.validAttr(t)&&(i[t]=s[t])})),this.onUpdate(t,e,i),t&&this.onEnd()}onUpdate(t,e,i){this.target.stepInterpolate(this.subAnimate,this.subAnimate.animate,i,this.step,e,t,this._toAttribute,this._fromAttribute)}}Cs.mode|=de.SET_ATTR_IMMEDIATELY;let rw=0;const aw=t=>{var e;if(D(t)||D(t.prototype))return!1;const i=null!==(e=t.prototype)&&void 0!==e?e:{};return i instanceof Ts||"onBind"in i&&"onStart"in i&&"onEnd"in i&&"onUpdate"in i};class ow{constructor(t,e,i){this.id=rw++,this.isAnimating=!1,this.runnings=[],this.element=t,this.animationOptions=i,this.unit=e}callback(t){return this.callbackFunction=t,this}animate(t,e){return this.isAnimating=!0,this.animateElement(t,e),0===this.runnings.length&&this.animationEnd(),this}stop(t="end",e=!0){return this.runnings.forEach((e=>e.stop(t))),this.animationEnd(e),this}pause(){return this.runnings.forEach((t=>t.pause())),this}resume(){return this.runnings.forEach((t=>t.resume())),this}startAt(t){return this.runnings.forEach((e=>{const i=this.unit.initialDelay;e.startAt(i+t)})),this}getTotalAnimationTime(){var t;const e=this.unit.initialDelay+this.unit.loopDuration*this.unit.loopCount;return null!==(t=this.unit.totalTime)&&void 0!==t?t:e}getEndAttributes(){return this.runnings.reduce(((t,e)=>Object.assign(t,e.getEndProps())),{})}animationEnd(t=!0){var e;this.isAnimating=!1,this.runnings=null,t&&(null===(e=this.callbackFunction)||void 0===e||e.call(null))}animateElement(t,e){const i=this.element.getGraphicItem();if(!i)return;const s=i.animate();this.runnings.push(s),s.startAt(this.unit.initialDelay),s.wait(this.unit.loopDelay),this.unit.timeSlices.forEach((i=>{this.animateTimeSlice(s,i,t,e)})),s.wait(this.unit.loopDelayAfter),s.loop(this.unit.loopCount-1),qo(this.unit.totalTime)&&setTimeout((()=>{s&&s.stop("end")}),this.unit.totalTime),s.onEnd((()=>{this.runnings=this.runnings.filter((t=>t!==s)),0===this.runnings.length&&this.animationEnd()}))}animateTimeSlice(t,e,i,s){const n=e.delay,r=e.delayAfter,a=e.duration,o=e.effects;if(n>0&&t.wait(n),o.length<0)t.wait(a);else{const e=o.map(((t,e)=>{var n;const r=null!==(n=t.type?function(t,e,i,s){const n=ys(e.options)?e.options.call(null,t.getDatum(),t,s):e.options;if(!e.type||!_c.getAnimationType(e.type))return null;const r=_c.getAnimationType(e.type)(t,n,i);return ew(r,t)}(this.element,t,i,s):t.channel?function(t,e,i,s){const n=e.channel;let r=null;return y(n)?r=n.reduce(((e,i)=>(e.from[i]=t.getGraphicAttribute(i,!0),e.to[i]=t.getGraphicAttribute(i,!1),e)),{from:{},to:{}}):vs(n)&&(r=Object.keys(n).reduce(((e,i)=>{var r,a;const o=!D(null===(r=n[i])||void 0===r?void 0:r.from),l=!D(null===(a=n[i])||void 0===a?void 0:a.to);return(o||l)&&(e.from[i]=o?iw(t,0,n[i].from,0,s):void 0,e.to[i]=l?iw(t,0,n[i].to,0,s):t.getGraphicAttribute(i,!1)),e}),{from:{},to:{}})),ew(r,t)}(this.element,t,0,s):void 0)&&void 0!==n?n:{},o=r.custom||(null==t?void 0:t.custom),l=(null==r?void 0:r.customParameters)||(null==t?void 0:t.customParameters);r.from&&Object.keys(r.from).length&&this.unit&&this.animationOptions.timeline.controlOptions.immediatelyApply&&"component"!==this.element.mark.markType&&this.element.getGraphicItem().setAttributes(r.from);const h=aw(o);return D(o)||aw(o)?h?new o(r.from,r.to,a,t.easing,l):r.to?new nw(r.from,r.to,a,t.easing):void 0:new sw(r.from,r.to,a,t.easing,{interpolator:o,element:this.element,parameters:l})})).filter((t=>!D(t)));1===e.length?t.play(e[0]):e.length>1&&t.play(new xA(a,e))}r>0&&t.wait(r)}}function lw(t){let e=[];return Object.keys(t).forEach((i=>{e=e.concat(hw(i,t[i]))})),e}function hw(t,e,i=0){const s=[];let n=i;return Ba(e).forEach((e=>{var i;const r=function(t){var e,i,s,n,r,a,o,l,h,d,c,u;if(D(t.timeSlices)){const h=t;return{startTime:null!==(e=h.startTime)&&void 0!==e?e:tm,totalTime:h.totalTime,oneByOne:null!==(i=h.oneByOne)&&void 0!==i?i:rm,loop:null!==(s=h.loop)&&void 0!==s?s:nm,controlOptions:E({},om,null!==(n=h.controlOptions)&&void 0!==n?n:{}),timeSlices:[{duration:null!==(r=h.duration)&&void 0!==r?r:em,delay:null!==(a=h.delay)&&void 0!==a?a:im,delayAfter:null!==(o=h.delayAfter)&&void 0!==o?o:sm,effects:[{type:h.type,channel:h.channel,custom:h.custom,easing:null!==(l=h.easing)&&void 0!==l?l:am,customParameters:h.customParameters,options:h.options}]}]}}const p=Ba(t.timeSlices).filter((t=>t.effects&&Ba(t.effects).filter((t=>t.channel||t.type)).length));if(p.length)return{startTime:null!==(h=t.startTime)&&void 0!==h?h:tm,totalTime:t.totalTime,oneByOne:null!==(d=t.oneByOne)&&void 0!==d?d:rm,loop:null!==(c=t.loop)&&void 0!==c?c:nm,controlOptions:E({},om,null!==(u=t.controlOptions)&&void 0!==u?u:{}),timeSlices:p.map((t=>{var e,i;return{duration:t.duration,delay:null!==(e=t.delay)&&void 0!==e?e:im,delayAfter:null!==(i=t.delayAfter)&&void 0!==i?i:sm,effects:Ba(t.effects).filter((t=>t.channel||t.type)).map((t=>{var e;return{type:t.type,channel:t.channel,custom:t.custom,easing:null!==(e=t.easing)&&void 0!==e?e:am,customParameters:t.customParameters,options:t.options}}))}})),partitioner:t.partitioner,sort:t.sort}}(e);r&&(s.push({state:t,id:null!==(i=r.id)&&void 0!==i?i:`${t}-${n}`,timeline:r,originConfig:e}),n+=1)})),s}function dw(t,e,i){return ys(t)?t.call(null,e.getDatum(),e,i):t}class cw{constructor(t){this.parallelArrangers=[this],this.totalTime=0,this.startTime=0,this.endTime=0,this.animators=t.filter((t=>!D(t))),this.totalTime=this.animators.reduce(((t,e)=>Math.max(t,e.getTotalAnimationTime())),0)}parallel(t){const e=Array.from(new Set(this.parallelArrangers.concat(t.parallelArrangers)));return e.forEach((t=>{t.parallelArrangers=e})),this.arrangeTime(),this}after(t){return this.afterArranger=t,this.arrangeTime(),this}arrangeTime(){const t=this.parallelArrangers.reduce(((t,e)=>Math.max(t,e.totalTime)),this.totalTime),e=this.parallelArrangers.reduce(((t,e)=>{var i,s;return Math.max(t,null!==(s=null===(i=e.afterArranger)||void 0===i?void 0:i.endTime)&&void 0!==s?s:0)}),0);this.parallelArrangers.forEach((i=>{i.startTime=e,i.endTime=e+t,i.animators.forEach((t=>{t.startAt(e)}))}))}}class uw{constructor(t,e){this.state=null,this.immediateConfigs=[],this.isEnabled=!0,this.disabledStates=[],this.animators=new Map,this.elementRecorder=new WeakMap,this.timelineCount={},this.mark=t,this.configs=lw(null!=e?e:{})}getAnimationConfigs(t){var e;return this.isEnabled?(null!==(e=this.configs)&&void 0!==e?e:[]).filter((e=>e.state===t)):[]}updateConfig(t){this.configs=lw(null!=t?t:{})}updateState(t){this.state=t}animate(){if(!this.isEnabled||!this.configs||!this.configs.length)return;const t=this.mark.getAllElements(),e=this.mark.parameters();return t.forEach((t=>{var e;t.isReserved&&t.diffState!==Zd.exit&&(t.isReserved=!1);const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.prevState;this.configs.some((e=>i!==t.diffState&&e.state===i&&e.timeline.controlOptions.stopWhenStateChange))&&this.clearElementAnimation(t,!1)})),this.configs.forEach((i=>{this.animateByTimeline(i,t,e)})),this.mark.cleanExitElements(),this}runAnimationByState(t){if(!this.isEnabled)return;const e=this.configs.filter((e=>e.state===t)),i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new cw(n)}stopAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.stop())),this}pauseAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.pause())),this}resumeAnimationByState(t){const e=this.animators.get(t);return e&&e.forEach((t=>t.resume())),this}run(t){if(!this.isEnabled)return;const e=hw(Qg,t,this.immediateConfigs.length);this.immediateConfigs=this.immediateConfigs.concat(e);const i=this.mark.getAllElements(),s=this.mark.parameters(),n=e.reduce(((t,e)=>t.concat(this.animateByTimeline(e,i,s,!0))),[]);return new cw(n)}stop(){return this.animators.forEach((t=>{t.forEach((t=>t.stop()))})),this}pause(){return this.animators.forEach((t=>t.forEach((t=>t.pause())))),this}resume(){return this.animators.forEach((t=>t.forEach((t=>t.resume())))),this}reverse(){return this}restart(){return this}record(){return this}recordEnd(){return this}isAnimating(){let t=!1;return this.animators.forEach((e=>{t=t||e.some((t=>t.isAnimating))})),t}isElementAnimating(t){var e;const i=null===(e=this.elementRecorder.get(t))||void 0===e?void 0:e.count;return D(i)||Object.values(i).every((t=>0===t))}getAnimatorCount(){let t=0;return this.animators.forEach((e=>t+=e.length)),t}getAllAnimators(){const t=[];return this.animators.forEach((e=>{t.push(...e)})),t}getElementAnimators(t,e){var i;const s=Ba(t);let n=[];return e?n=null!==(i=this.animators.get(e))&&void 0!==i?i:[]:this.animators.forEach((t=>{n=n.concat(t)})),n.filter((t=>s.includes(t.element)))}enable(){return this.isEnabled=!0,this}disable(){return this.isEnabled=!1,this.stop(),this.animators.clear(),this}enableAnimationState(t){const e=Ba(t);return this.disabledStates=this.disabledStates.filter((t=>!e.includes(t))),this}disableAnimationState(t){const e=Ba(t);return this.disabledStates=this.disabledStates.concat(e),this}release(){this.stop(),this.animators.clear(),this.configs=null,this.animators=null,this.elementRecorder=null,this.timelineCount=null}animateByTimeline(t,e,i,s=!1){var n;const r=[],a=e.filter((e=>{const n=!(e.isReserved&&e.diffState===Zd.exit),r=this.getAnimationState(e),a=!this.disabledStates.includes(r),o=s||r===t.state,l=!t.timeline.partitioner||t.timeline.partitioner(e.getDatum(),e,i);return n&&a&&o&&l}));if(a.length){D(this.timelineCount[t.id])&&(this.timelineCount[t.id]=0),t.timeline.sort&&a.sort(((e,s)=>t.timeline.sort(e.getDatum(),s.getDatum(),e,s,i)));const e={width:this.mark.view.width(),height:this.mark.view.height(),group:null!==(n=this.mark.group)&&void 0!==n?n:null,mark:this.mark,view:this.mark.view,elementCount:a.length,elementIndex:0};a.forEach(((s,n)=>{e.elementIndex=n;const o=Object.assign({[lm]:e},i),l=this.getAnimationUnit(t.timeline,s,n,a.length,o);r.push(this.animateElement(t,l,s,e,o))}))}return r}animateElement(t,e,i,s,n){var r,a;const o=new ow(i,e,t);if(o.animate(s,n),!o.isAnimating)return;i.diffState===Zd.exit&&(i.isReserved=!0);const l=0===this.timelineCount[t.id];this.timelineCount[t.id]+=1;const h=null!==(r=this.elementRecorder.get(i))&&void 0!==r?r:{prevState:t.state,count:{}};h.prevState=t.state,h.count[t.state]=(null!==(a=h.count[t.state])&&void 0!==a?a:0)+1,this.elementRecorder.set(i,h);const d=this.animators.get(t.state);d?d.push(o):this.animators.set(t.state,[o]),o.callback((()=>{this.handleAnimatorEnd(o)}));const c={mark:this.mark,animationState:t.state,animationConfig:t.originConfig};return l&&this.mark.emit(lc.ANIMATION_START,c),this.mark.emit(lc.ELEMENT_ANIMATION_START,c,i),o}getAnimationState(t){const e=Gp(this.state,this.mark.parameters(),t.getDatum(),t);return null!=e?e:t.diffState}getAnimationUnit(t,e,i,s,n){const r=[],a=dw(t.startTime,e,n),o=dw(t.totalTime,e,n),l=dw(t.oneByOne,e,n),d=dw(t.loop,e,n);let c=0;t.timeSlices.forEach((t=>{var i;const a=dw(t.delay,e,n),l=dw(t.delayAfter,e,n),h=null!==(i=dw(t.duration,e,n))&&void 0!==i?i:o/s,d=Ba(t.effects).map((t=>Object.assign({},t,{customParameters:dw(t.customParameters,e,n)})));r.push({effects:d,duration:h,delay:a,delayAfter:l}),c+=a+h+l}));const u=h(l)?l:!0===l?c:0;return{initialDelay:a,loopCount:h(d)?d:!0===d?1/0:1,loopDelay:u*i,loopDelayAfter:u*(s-i-1),loopAnimateDuration:c,loopDuration:c+u*(s-1),totalTime:o,timeSlices:r}}clearElementAnimation(t,e=!0){this.animators.forEach((i=>{i.forEach((i=>{i.element===t&&(i.animationOptions.state===Zd.exit?i.stop("start",!1):i.stop("end",!1),this.handleAnimatorEnd(i,e))}))})),this.elementRecorder.delete(t)}clearAllElements(){const t=this.mark.getAllElements();t&&t.forEach(((e,i)=>{this.clearElement(e,i===t.length-1)}))}clearElement(t,e=!0){this.clearElementAnimation(t),t.getGraphicItem()&&(t.clearGraphicAttributes(),t.diffState===Zd.exit&&(t.isReserved=!1),e&&this.mark.cleanExitElements())}handleAnimatorEnd(t,e=!0){const i=t.element,s=t.animationOptions,n=s.state,r=n===Qg,a=this.elementRecorder.get(i).count;a[n]-=1,this.animators.set(n,this.animators.get(n).filter((e=>e!==t))),0===this.animators.get(n).length&&this.animators.delete(n),this.timelineCount[s.id]-=1;const o=0===this.timelineCount[s.id],l=r?this.immediateConfigs.find((t=>t.id===s.id)).originConfig:this.configs.find((t=>t.id===s.id)).originConfig;o&&(delete this.timelineCount[s.id],r&&(this.immediateConfigs=this.immediateConfigs.filter((t=>t.id!==s.id)))),e&&(0===Object.keys(this.timelineCount).length?this.clearAllElements():n===Zd.exit&&0===a[Zd.exit]&&this.clearElement(i));const h={mark:this.mark,animationState:n,animationConfig:l};o&&this.mark.emit(lc.ANIMATION_END,h),this.mark.emit(lc.ELEMENT_ANIMATION_END,h,i)}}class pw{constructor(){this.animate=new uw(this,{})}initAnimate(t){this.animate||(this.animate=new uw(this,t.animation),this.needAnimate()&&this.animate.updateState(t.animationState))}reuseAnimate(t){this.animate=t.animate,this.animate.mark=this}updateAnimate(t){t.animation&&this.animate.updateConfig(t.animation),this.animate.updateState(t.animationState)}}const gw={measureText:(t,e,i,s)=>((t,e,i)=>Jk(t,e,i,{fontFamily:Oh.fontFamily,fontSize:Oh.fontSize}))(e,i,s).measure(t)};class mw{static instance(){return mw.instance_||(mw.instance_=new mw),mw.instance_}constructor(){this.functions={}}registerFunction(t,e){t&&e&&(this.functions[t]=e)}unregisterFunction(t){t&&delete this.functions[t]}getFunction(t){return this.functions[t]||null}getFunctionNameList(){return Object.keys(this.functions)}}const _w={WIDTH:500,HEIGHT:500,DPR:1};class fw{get displayWidth(){return this._pixelWidth/this._dpr}get displayHeight(){return this._pixelHeight/this._dpr}get id(){return this._id}get x(){return this._x}set x(t){this._x=t}get y(){return this._y}set y(t){this._y=t}get nativeCanvas(){return this._nativeCanvas}get width(){return this._pixelWidth}set width(t){this._pixelWidth=t,this._displayWidth=t/(this._dpr||1)}get height(){return this._pixelHeight}set height(t){this._pixelHeight=t,this._displayHeight=t/(this._dpr||1)}getContext(t){return this._context}get visiable(){return this._visiable}set visiable(t){this._visiable=t,t?this.show():this.hide()}get dpr(){return this._dpr}set dpr(t){this._dpr=t,this.resize(this._displayWidth,this._displayHeight)}constructor(t){var e;const{nativeCanvas:i,width:s=_w.WIDTH,height:n=_w.HEIGHT,dpr:r=_w.DPR,x:a,y:o,id:l,canvasControled:h=!0}=t;this._x=null!=a?a:0,this._y=null!=o?o:0,this._pixelWidth=s*r,this._pixelHeight=n*r,this._visiable=!1!==t.visiable,this.controled=h,this._displayWidth=s,this._displayHeight=n,this._dpr=r,this._nativeCanvas=i,this._id=null!==(e=i.id)&&void 0!==e?e:l,l&&(i.id=l),this.init(t)}getNativeCanvas(){return this._nativeCanvas}hide(){}show(){}applyPosition(){}resetStyle(t){}resize(t,e){}toDataURL(t,e){return""}readPixels(t,e,i,s){return this._context.getImageData(t,e,i,s)}convertToBlob(t){throw new Error("暂未实现")}transferToImageBitmap(){throw new Error("暂未实现")}release(...t){this.controled&&this._nativeCanvas.parentElement&&this._nativeCanvas.parentElement.removeChild(this._nativeCanvas)}}fw.env="browser";const vw=[0,0,0];let yw=class{set fillStyle(t){this.nativeContext.fillStyle=t}get fillStyle(){return this.nativeContext.fillStyle}set font(t){this.nativeContext.font=t}get font(){return this.nativeContext.font}set globalAlpha(t){this.nativeContext.globalAlpha=t*this.baseGlobalAlpha}get globalAlpha(){return this.nativeContext.globalAlpha}set lineCap(t){this.nativeContext.lineCap=t}get lineCap(){return this.nativeContext.lineCap}set lineDashOffset(t){this.nativeContext.lineDashOffset=t}get lineDashOffset(){return this.nativeContext.lineDashOffset}set lineJoin(t){this.nativeContext.lineJoin=t}get lineJoin(){return this.nativeContext.lineJoin}set lineWidth(t){this.nativeContext.lineWidth=t}get lineWidth(){return this.nativeContext.lineWidth}set miterLimit(t){this.nativeContext.miterLimit=t}get miterLimit(){return this.nativeContext.miterLimit}set shadowBlur(t){this.nativeContext.shadowBlur=t}get shadowBlur(){return this.nativeContext.shadowBlur}set shadowColor(t){this.nativeContext.shadowColor=t}get shadowColor(){return this.nativeContext.shadowColor}set shadowOffsetX(t){this.nativeContext.shadowOffsetX=t}get shadowOffsetX(){return this.nativeContext.shadowOffsetX}set shadowOffsetY(t){this.nativeContext.shadowOffsetY=t}get shadowOffsetY(){return this.nativeContext.shadowOffsetY}set strokeStyle(t){this.nativeContext.strokeStyle=t}get strokeStyle(){return this.nativeContext.strokeStyle}set textAlign(t){this.nativeContext.textAlign=t}get textAlign(){return this.nativeContext.textAlign}set textBaseline(t){this.nativeContext.textBaseline=t}get textBaseline(){return this.nativeContext.textBaseline}get inuse(){return!!this._inuse}set inuse(t){t!==!!this._inuse&&(this._inuse=t,t?(this.nativeContext.save(),this.reset()):this.nativeContext.restore())}constructor(t,e){this.fillAttributes=Object.assign(Object.assign({},ti),{opacity:1}),this.strokeAttributes=Object.assign(Object.assign({},ii),{opacity:1}),this.textAttributes=Object.assign(Object.assign({},si),{opacity:1}),this._clearShadowStyle=!1,this._clearFilterStyle=!1,this._clearGlobalCompositeOperationStyle=!1;const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Pt(1,0,0,1,0,0),this.stack=[],this.dpr=e,this.applyedMatrix=new Pt(1,0,0,1,0,0),this._clearMatrix=new Pt(1,0,0,1,0,0),this.baseGlobalAlpha=1}reset(){this.stack.length&&g.getInstance().warn("可能存在bug,matrix没有清空"),this.matrix.setValue(1,0,0,1,0,0),this.applyedMatrix=new Pt(1,0,0,1,0,0),this.stack.length=0,this.nativeContext.setTransform(1,0,0,1,0,0)}getCanvas(){return this.canvas}getContext(){return this.nativeContext}setTransformForCurrent(t=!1){!t&&this.applyedMatrix.equalToMatrix(this.matrix)||(this.applyedMatrix.setValue(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f),this.nativeContext.setTransform(this.matrix.a,this.matrix.b,this.matrix.c,this.matrix.d,this.matrix.e,this.matrix.f))}get currentMatrix(){return this.matrix}cloneMatrix(t){return Vr.allocateByObj(t)}clear(){this.save(),this.resetTransform(),this.nativeContext.clearRect(0,0,this.canvas.width,this.canvas.height),this.restore()}restore(){this.nativeContext.restore(),this.stack.length>0&&(Vr.free(this.matrix),this.matrix=this.stack.pop(),this.setTransformForCurrent(!0))}highPerformanceRestore(){this.stack.length>0&&(Vr.free(this.matrix),this.matrix=this.stack.pop())}rotate(t,e=!0){this.matrix.rotate(t),e&&this.setTransformForCurrent()}save(){const t=this.cloneMatrix(this.matrix);this.stack.push(t),this.nativeContext.save()}highPerformanceSave(){const t=this.cloneMatrix(this.matrix);this.stack.push(t)}scale(t,e,i=!0){this.matrix.scale(t,e),i&&this.setTransformForCurrent()}setScale(t,e,i=!0){this.matrix.setScale(t,e),i&&this.setTransformForCurrent()}scalePoint(t,e,i,s,n=!0){this.translate(i,s,!1),this.scale(t,e,!1),this.translate(-i,-s,!1),n&&this.setTransformForCurrent()}setTransform(t,e,i,s,n,r,a=!0,o=this.dpr){this.matrix.setValue(o*t,o*e,o*i,o*s,o*n,o*r),a&&this.setTransformForCurrent()}setTransformFromMatrix(t,e=!0,i=this.dpr){this.matrix.setValue(t.a*i,t.b*i,t.c*i,t.d*i,t.e*i,t.f*i),e&&this.setTransformForCurrent()}resetTransform(t=!0,e=this.dpr){this.setTransform(e,0,0,e,0,0),t&&this.setTransformForCurrent()}transform(t,e,i,s,n,r,a=!0){this.matrix.multiply(t,e,i,s,n,r),a&&this.setTransformForCurrent()}transformFromMatrix(t,e){this.matrix.multiply(t.a,t.b,t.c,t.d,t.e,t.f),e&&this.setTransformForCurrent()}translate(t,e,i=!0){this.matrix.translate(t,e),i&&this.setTransformForCurrent()}rotateDegrees(t,e=!0){const i=t*Math.PI/180;this.rotate(i,e)}rotateAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotate(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}rotateDegreesAbout(t,e,i,s=!0){this.translate(e,i,!1),this.rotateDegrees(t,!1),this.translate(-e,-i,!1),s&&this.setTransformForCurrent()}beginPath(){this.disableBeginPath||this.nativeContext.beginPath()}clip(t,e){t?"string"==typeof t?this.nativeContext.clip(t):this.nativeContext.clip(t,e):this.nativeContext.clip()}arc(t,e,i,s,n,r,a){if(a=a||0,this.camera){const o=[];((t,e,i,s,n,r,a,o)=>{if(o)for(;i>e;)i-=lt;else for(;ie?1:-1);let h=e,d=h;for(;d!==i;){d=l>0?Math.min(d+l,i):Math.max(d+l,i);const e=Math.abs(d-h),o=4*Math.tan(e/4)/3,c=da);t++){const e=v.getColor(t);c.beginPath(),c.rotate(f),c.moveTo(0,0),c.lineTo(m,-2*y),c.lineTo(m,0),c.fillStyle=e,c.closePath(),c.fill()}const b=c.getImageData(0,0,u,p);return d.width=b.width,d.height=b.height,c.putImageData(b,0,0),g=t.createPattern(d,"no-repeat"),g&&Cx.Set(e,i,s,r,a,g,u,p),g}(a,this.stops,t,e,h,i,s,o,l),r=!1),n}}}fill(t,e){this.disableFill||(t?this.nativeContext.fill(t):this.nativeContext.fill())}fillRect(t,e,i,s){this.nativeContext.fillRect(t,e,i,s)}clearRect(t,e,i,s){this.nativeContext.clearRect(t,e,i,s)}project(t,e,i){if(i=i||0,this.camera){this.modelMatrix&&(zr(vw,[t,e,i],this.modelMatrix),t=vw[0],e=vw[1],i=vw[2]);const s=this.camera.vp(t,e,i);t=s.x,e=s.y}return{x:t,y:e}}view(t,e,i){return i=i||0,this.camera?(this.modelMatrix&&(zr(vw,[t,e,i],this.modelMatrix),t=vw[0],e=vw[1],i=vw[2]),this.camera.view(t,e,i)):[t,e,i]}fillText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(zr(vw,[e,i,s],this.modelMatrix),e=vw[0],i=vw[1],s=vw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.fillText(t,e,i)}getImageData(t,e,i,s){return this.nativeContext.getImageData(t,e,i,s)}getLineDash(){return this.nativeContext.getLineDash()}isPointInPath(t,e){return this.nativeContext.isPointInPath(t,e)}isPointInStroke(t,e){return this.nativeContext.isPointInStroke(t,e)}measureText(t,e=xi.global.measureTextMethod){var i,s;if(!e||"native"===e)return this.nativeContext.measureText(t);this.mathTextMeasure||(this.mathTextMeasure=xi.graphicUtil.createTextMeasureInstance({},{},(()=>this.canvas.nativeCanvas)));const n=null!==(i=this.fontFamily)&&void 0!==i?i:si.fontFamily,r=null!==(s=this.fontSize)&&void 0!==s?s:si.fontSize;return this.mathTextMeasure.textSpec.fontFamily===n&&this.mathTextMeasure.textSpec.fontSize===r||(this.mathTextMeasure.textSpec.fontFamily=n,this.mathTextMeasure.textSpec.fontSize=r,this.mathTextMeasure._numberCharSize=null,this.mathTextMeasure._fullCharSize=null,this.mathTextMeasure._letterCharSize=null,this.mathTextMeasure._specialCharSizeMap={}),this.mathTextMeasure.measure(t,e)}putImageData(t,e,i){this.nativeContext.putImageData(t,e,i)}setLineDash(t){const e=arguments,i=this.nativeContext;this.nativeContext.setLineDash?e[0]&&i.setLineDash(e[0]):"mozDash"in i?i.mozDash=e[0]:"webkitLineDash"in i&&(i.webkitLineDash=e[0])}stroke(t){this.disableStroke||(t?this.nativeContext.stroke(t):this.nativeContext.stroke())}strokeRect(t,e,i,s){this.nativeContext.strokeRect(t,e,i,s)}strokeText(t,e,i,s){if(s=s||0,this.camera){this.modelMatrix&&(zr(vw,[e,i,s],this.modelMatrix),e=vw[0],i=vw[1],s=vw[2]);const t=this.camera.vp(e,i,s);e=t.x,i=t.y}this.nativeContext.strokeText(t,e,i)}drawImage(){const t=this.nativeContext,e=arguments;3===e.length?t.drawImage(e[0],e[1],e[2]):5===e.length?t.drawImage(e[0],e[1],e[2],e[3],e[4]):9===e.length&&t.drawImage(e[0],e[1],e[2],e[3],e[4],e[5],e[6],e[7],e[8])}setCommonStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setCommonStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setCommonStyle(t,e,i,s,r)}return this._setCommonStyle(t,e,i,s,n)}_setCommonStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.fillAttributes);const{fillOpacity:a=n.fillOpacity,opacity:o=n.opacity,fill:l=n.fill}=e;r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12&&(r.fillStyle=Pa(this,l,t,i,s))}setShadowBlendStyle(t,e,i){if(Array.isArray(i)){if(i.length<=1)return this._setShadowBlendStyle(t,i[0]);const s=Object.create(i[0]);return i.forEach(((t,e)=>{0!==e&&Object.assign(s,t)})),this._setShadowBlendStyle(t,e,s)}return this._setShadowBlendStyle(t,e,i)}_setShadowBlendStyle(t,e,i){const s=this.nativeContext;i||(i=this.fillAttributes);const{opacity:n=i.opacity,shadowBlur:r=i.shadowBlur,shadowColor:a=i.shadowColor,shadowOffsetX:o=i.shadowOffsetX,shadowOffsetY:l=i.shadowOffsetY,blur:h=i.blur,globalCompositeOperation:d=i.globalCompositeOperation}=e;n<=1e-12||(r||o||l?(s.shadowBlur=r*this.dpr,s.shadowColor=a,s.shadowOffsetX=o*this.dpr,s.shadowOffsetY=l*this.dpr,this._clearShadowStyle=!0):this._clearShadowStyle&&(s.shadowBlur=0,s.shadowOffsetX=0,s.shadowOffsetY=0),h?(s.filter=`blur(${h}px)`,this._clearFilterStyle=!0):this._clearFilterStyle&&(s.filter="blur(0px)",this._clearFilterStyle=!1),d?(s.globalCompositeOperation=d,this._clearGlobalCompositeOperationStyle=!0):this._clearGlobalCompositeOperationStyle&&(s.globalCompositeOperation="source-over",this._clearGlobalCompositeOperationStyle=!1))}setStrokeStyle(t,e,i,s,n){if(Array.isArray(n)){if(n.length<=1)return this._setStrokeStyle(t,e,i,s,n[0]);const r=Object.create(n[0]);return n.forEach(((t,e)=>{0!==e&&Object.assign(r,t)})),this._setStrokeStyle(t,e,i,s,r)}return this._setStrokeStyle(t,e,i,s,n)}_setStrokeStyle(t,e,i,s,n){const r=this.nativeContext;n||(n=this.strokeAttributes);const{strokeOpacity:a=n.strokeOpacity,opacity:o=n.opacity}=e;if(r.globalAlpha=a*o*this.baseGlobalAlpha,a>1e-12&&o>1e-12){const{lineWidth:a=n.lineWidth,stroke:o=n.stroke,lineJoin:l=n.lineJoin,lineDash:h=n.lineDash,lineCap:d=n.lineCap,miterLimit:c=n.miterLimit}=e;r.lineWidth=Da(this,a,this.dpr),r.strokeStyle=Pa(this,o,t,i,s),r.lineJoin=l,h&&r.setLineDash(h),r.lineCap=d,r.miterLimit=c}}setTextStyleWithoutAlignBaseline(t,e,i){const s=this.nativeContext;e||(e=this.textAttributes);const{scaleIn3d:n=e.scaleIn3d}=t;t.font?s.font=t.font:s.font=Ri(t,e,n&&this.camera&&this.camera.getProjectionScale(i));const{fontFamily:r=e.fontFamily,fontSize:a=e.fontSize}=t;this.fontFamily=r,this.fontSize=a,s.textAlign="left",s.textBaseline="alphabetic"}setTextStyle(t,e,i){var s,n;const r=this.nativeContext;e||(e=this.textAttributes),t.font?r.font=t.font:r.font=Ri(t,e,this.camera&&this.camera.getProjectionScale(i));const{fontFamily:a=e.fontFamily,fontSize:o=e.fontSize}=t;this.fontFamily=a,this.fontSize=o,r.textAlign=null!==(s=t.textAlign)&&void 0!==s?s:e.textAlign,r.textBaseline=null!==(n=t.textBaseline)&&void 0!==n?n:e.textBaseline}draw(){}clearMatrix(t=!0,e=this.dpr){this.setTransformFromMatrix(this._clearMatrix,t,e)}setClearMatrix(t,e,i,s,n,r){this._clearMatrix.setValue(t,e,i,s,n,r)}onlyTranslate(t=this.dpr){return this.matrix.a===t&&0===this.matrix.b&&0===this.matrix.c&&this.matrix.d===t}release(...t){this.stack.forEach((t=>Vr.free(t))),this.stack.length=0}};yw.env="browser",yw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],yw);let bw=class extends fw{constructor(t){super(t)}init(t){const{container:e}=t;if("string"==typeof e){const t=xi.global.getElementById(e);t&&(this._container=t)}else this._container=e;this._context=new yw(this,this._dpr),this.initStyle()}initStyle(){if(!this.controled)return;const{nativeCanvas:t}=this;t.width=this._pixelWidth,t.height=this._pixelHeight,!t.style||this.setCanvasStyle(t,this._x,this._y,this._displayWidth,this._displayHeight),this._container&&this._container.appendChild(t),this.visiable||this.hide()}hide(){this._nativeCanvas&&(this._nativeCanvas.style.display="none")}show(){this._nativeCanvas&&(this._nativeCanvas.style.display="block")}applyPosition(){const t=this._nativeCanvas;t.style.position="absolute",t.style.top=`${this._y}px`,t.style.left=`${this._x}px`}resetStyle(t){if(!this.controled)return;const{width:e=this._displayWidth,height:i=this._displayHeight,dpr:s=this._dpr,x:n=this._x,y:r=this._y}=t,{nativeCanvas:a}=this;a.width=e*s,a.height=i*s,!a.style||this.setCanvasStyle(a,n,r,e,i),t.id&&(a.id=t.id),this.visiable||this.hide()}setCanvasStyle(t,e,i,s,n){this.controled&&(t.style.width=`${s}px`,t.style.height=`${n}px`)}toDataURL(t,e){return"image/jpeg"===t?this._nativeCanvas.toDataURL(t,e):"image/png"===t?this._nativeCanvas.toDataURL(t):this._nativeCanvas.toDataURL(t,e)}resize(t,e){this.controled&&(this._pixelWidth=t*this._dpr,this._pixelHeight=e*this._dpr,this._displayWidth=t,this._displayHeight=e,this._nativeCanvas.style&&(this._nativeCanvas.style.width=`${t}px`,this._nativeCanvas.style.height=`${e}px`),this._nativeCanvas.width=this._pixelWidth,this._nativeCanvas.height=this._pixelHeight,this._context.dpr=this._dpr)}};function xw(t,e){return new B((i=>{i($i).toDynamicValue((()=>e=>new t(e))).whenTargetNamed(t.env),i(Xi).toDynamicValue((()=>(t,i)=>new e(t,i))).whenTargetNamed(e.env)}))}bw.env="browser",bw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],bw);const Sw=xw(bw,yw);var Mw=function(t,e){return function(i,s){e(i,s,t)}};let kw=class{constructor(t){this.pickItemInterceptorContributions=t,this.type="default",this.global=xi.global}_init(){this.InterceptorContributions=this.pickItemInterceptorContributions.getContributions().sort(((t,e)=>t.order-e.order))}pick(t,e,i){let s={graphic:null,group:null};i.pickerService=this;const n=i.bounds.width(),r=i.bounds.height();if(!(new qt).setValue(0,0,n,r).containsPoint(e))return s;this.pickContext&&(this.pickContext.inuse=!0),i.pickContext=this.pickContext,this.pickContext&&this.pickContext.clearMatrix(!0,1);const a=new Pt(1,0,0,1,0,0);let o;for(let n=t.length-1;n>=0&&(s=t[n].isContainer?this.pickGroup(t[n],e,a,i):this.pickItem(t[n],e,a,i),!s.graphic);n--)o||(o=s.group);if(s.graphic||(s.group=o),this.pickContext&&(this.pickContext.inuse=!1),s.graphic){let t=s.graphic;for(;t.parent;)t=t.parent;t.shadowHost&&(s.params={shadowTarget:s.graphic},s.graphic=t.shadowHost)}return s}containsPoint(t,e,i){var s;return!!(null===(s=this.pickItem(t,e,null,null!=i?i:{pickContext:this.pickContext,pickerService:this}))||void 0===s?void 0:s.graphic)}pickGroup(t,e,i,s){let n={group:null,graphic:null};if(!1===t.attribute.visibleAll)return n;const r=s.pickContext,a=r.modelMatrix;if(r.camera){const e=t.transMatrix,i=Wr.allocate();if(jr(i,e),a){if(i){const t=Wr.allocate();r.modelMatrix=Hr(t,a,i),Wr.free(i)}}else jr(i,t.globalTransMatrix),r.modelMatrix=i}if(this.InterceptorContributions.length)for(let n=0;n{if(r.isContainer){const i=new ye(e.x,e.y),a=ps(t).group,{scrollX:o=a.scrollX,scrollY:h=a.scrollY}=t.attribute;i.x-=o,i.y-=h,n=this.pickGroup(r,i,l,s)}else{const a=new ye(e.x,e.y);l.transformPoint(a,a);const o=ps(t).group,{scrollX:h=o.scrollX,scrollY:d=o.scrollY}=t.attribute;a.x-=h,a.y-=d;const c=this.pickItem(r,a,i,s);c&&c.graphic&&(n.graphic=c.graphic,n.params=c.params)}return!!n.graphic||!!n.group}),!0,!!r.camera),r.modelMatrix!==a&&Wr.free(r.modelMatrix),r.modelMatrix=a,n.graphic||n.group||!u||t.stage.camera||(n.group=t),Vr.free(l),n}selectPicker(t){return this.pickerMap.get(t.numberType)||null}};kw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Mw(0,$(K)),Mw(0,X($r)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],kw);var Aw=function(t,e){return function(i,s){e(i,s,t)}};let ww=class extends kw{constructor(t,e,i){super(i),this.contributions=t,this.drawContribution=e,this.pickItemInterceptorContributions=i,this.global.hooks.onSetEnv.tap("canvas-picker-service",((t,e,i)=>{this.configure(i,e)})),this.configure(this.global,this.global.env),this.pickerMap=new Map,this.init()}init(){this.contributions.getContributions().forEach((t=>{this.pickerMap.set(t.numberType,t)})),super._init()}configure(t,e){this.pickCanvas=qi.shareCanvas(),this.pickContext=this.pickCanvas.getContext("2d")}pickItem(t,e,i,s){if(!1===t.attribute.pickable)return null;if(this.InterceptorContributions.length)for(let n=0;n=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),Aw(0,$(K)),Aw(0,X(tf)),Aw(1,$(Cr)),Aw(2,$(K)),Aw(2,X($r)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Object,Object])],ww);let Tw=class{constructor(){this.type="group",this.numberType=Fn}contains(t,e,i){return!1}};Tw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Tw);const Lw=new B(((t,e,i,s)=>{Lw.__vloaded||(Lw.__vloaded=!0,t(Q_).to(Tw).inSingletonScope(),t(tf).toService(Q_),Z(t,tf))}));Lw.__vloaded=!1;const Cw=Lw,Ew=new B(((t,e,i,s)=>{i(ww)||t(ww).toSelf().inSingletonScope(),i(Ir)?s(Ir).toService(ww):t(Ir).toService(ww)}));let Dw=class{constructor(){this._uid=I.GenAutoIncrementId(),this.viewBox=new qt,this.modelMatrix=new Pt(1,0,0,1,0,0)}onChange(t){this._onChangeCb=t}configure(t,e){e.env===this.type&&t.setWindowHandler(this)}release(...t){this.releaseWindow()}isVisible(t){return!0}onVisibleChange(t){}getTopLeft(t){return{top:0,left:0}}setViewBox(t){this.viewBox.setValue(t.x1,t.y1,t.x2,t.y2)}getViewBox(){return this.viewBox}setViewBoxTransform(t,e,i,s,n,r){this.modelMatrix.setValue(t,e,i,s,n,r)}getViewBoxTransform(){return this.modelMatrix}};Dw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Dw);var Pw;let Ow=Pw=class extends Dw{get container(){return this.canvas.nativeCanvas.parentElement}static GenerateCanvasId(){return`${Pw.idprefix}_${Pw.prefix_count++}`}constructor(){super(),this.type="browser",this._canvasIsIntersecting=!0,this.global=xi.global,this.viewBox=new qt,this.modelMatrix=new Pt(1,0,0,1,0,0)}getTitle(){return this.canvas.id&&this.canvas.id.toString()}getWH(){return{width:this.canvas.width/(this.canvas.dpr||1),height:this.canvas.height/(this.canvas.dpr||1)}}getXY(){return this.canvas.nativeCanvas.getBoundingClientRect()}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t),this.postInit()}postInit(){if(this.global.optimizeVisible)try{this.observerCanvas()}catch(t){console.error("发生错误,该环境不存在IntersectionObserver")}}isElementVisible(t){const e=t.getBoundingClientRect(),i=window.innerWidth||document.documentElement.clientWidth,s=window.innerHeight||document.documentElement.clientHeight;return!(e.right<0||e.bottom<0||e.left>i||e.top>s)}observerCanvas(){this._canvasIsIntersecting=this.isElementVisible(this.canvas.nativeCanvas);const t=new IntersectionObserver(((t,e)=>{t.forEach((t=>{this._canvasIsIntersecting!==t.isIntersecting?(this._canvasIsIntersecting=t.isIntersecting,this._onVisibleChangeCb&&this._onVisibleChangeCb(t.isIntersecting)):this._canvasIsIntersecting=t.isIntersecting}))}));t&&t.observe(this.canvas.nativeCanvas)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height});let i;if(i="string"==typeof t.container?this.global.getElementById(t.container):t.container?t.container:this.global.getRootElement(),!i)throw new Error("发生错误,containerId可能传入有误");t.offscreen?i=null:i.appendChild(e);const s={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,container:i,id:Pw.GenerateCanvasId(),canvasControled:!0};this.canvas=new bw(s)}createWindowByCanvas(t){var e;let i;if("string"==typeof t.canvas){if(i=this.global.getElementById(t.canvas),!i)throw new Error("canvasId 参数不正确,请确认canvas存在并插入dom")}else i=t.canvas;if(!i)throw new Error("发生错误,传入的canvas不正确");let s=t.width,n=t.height;if(null==s||null==n||!t.canvasControled){const t=i.getBoundingClientRect();s=t.width,n=t.height}let r=t.dpr;null==r&&(r=null!==(e=i.getContext("2d").pixelRatio)&&void 0!==e?e:i.width/s),this.canvas=new bw({width:s,height:n,dpr:r,nativeCanvas:i,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}addEventListener(t,e,i){return this.canvas.nativeCanvas.addEventListener(t,e,i)}removeEventListener(t,e,i){return this.canvas.nativeCanvas.removeEventListener(t,e,i)}dispatchEvent(t){return this.canvas.nativeCanvas.dispatchEvent(t)}getStyle(){var t;return null!==(t=this.canvas.nativeCanvas.style)&&void 0!==t?t:{}}setStyle(t){this.canvas.nativeCanvas.style=t}getBoundingClientRect(){const t=this.canvas.nativeCanvas,e=this.getWH();return t.parentElement?this.canvas.nativeCanvas.getBoundingClientRect():{x:0,y:0,width:e.width,height:e.height,left:0,top:0,right:0,bottom:0}}clearViewBox(t){const e=this.viewBox,i=this.getContext(),s=this.getDpr();i.nativeContext.save(),i.nativeContext.setTransform(s,0,0,s,0,0),i.clearRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1),t&&(i.fillStyle=t,i.fillRect(e.x1,e.y1,e.x2-e.x1,e.y2-e.y1)),i.nativeContext.restore()}isVisible(t){return this._canvasIsIntersecting}onVisibleChange(t){this._onVisibleChangeCb=t}getTopLeft(t){return this.global.getElementTopLeft(this.canvas.nativeCanvas,t)}};Ow.env="browser",Ow.idprefix="visactor_window",Ow.prefix_count=0,Ow=Pw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Ow);const Rw=new B((t=>{t(Ow).toSelf(),t(Ji).toDynamicValue((t=>t.container.get(Ow))).whenTargetNamed(Ow.env)}));let Iw=class{configure(t,...e){t.env===this.type&&t.setActiveEnvContribution(this)}getNativeAABBBounds(t){return new qt}removeDom(t){return!1}createDom(t){return null}updateDom(t,e){return!1}getDynamicCanvasCount(){return 999}getStaticCanvasCount(){return 999}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadBlob(t){return fetch(t).then((t=>t.blob())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}getElementTop(t,e){return 0}getElementLeft(t,e){return 0}getElementTopLeft(t,e){return{top:0,left:0}}};Iw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Iw);class Bw{get x1(){return this.dom.getBoundingClientRect().left}get x2(){return this.dom.getBoundingClientRect().right}get y1(){return this.dom.getBoundingClientRect().top}get y2(){return this.dom.getBoundingClientRect().bottom}get width(){return this.dom.getBoundingClientRect().width}get height(){return this.dom.getBoundingClientRect().height}constructor(t){this.dom=t}}function Fw(t,e=!1){const i=document.createElement("img");if(i.crossOrigin="anonymous",e){const e=new Blob([t],{type:"image/svg+xml"});t=window.URL.createObjectURL(e)}return i.src=t,i.complete?Promise.resolve(i):new Promise(((t,e)=>{i.onload=()=>{t(i)},i.onerror=()=>{e(new Error("加载失败"))}}))}let Yw=class extends Iw{constructor(){super(),this.type="browser",this.supportEvent=!0;try{this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.supportsMouseEvents=!!globalThis.MouseEvent}catch(t){this.supportsTouchEvents=!1,this.supportsPointerEvents=!1,this.supportsPointerEvents=!1}this.applyStyles=!0}mapToCanvasPoint(t,e){var i,s;let n=0,r=0,a=0,o=0;if(t.changedTouches){const e=null!==(i=t.changedTouches[0])&&void 0!==i?i:{};n=e.clientX||0,r=e.clientY||0,a=n,o=r}else n=t.clientX||0,r=t.clientY||0,a=t.offsetX||0,o=t.offsetY||0;if(e){const t=n,i=r,a=e.getBoundingClientRect(),o=null===(s=e.getNativeHandler)||void 0===s?void 0:s.call(e).nativeCanvas;let l,h;return o&&(l=a.width/o.offsetWidth,h=a.height/o.offsetHeight),{x:(t-a.left)/(qo(l)?l:1),y:(i-a.top)/(qo(h)?h:1)}}return{x:a,y:o}}getNativeAABBBounds(t){let e=t;if("string"==typeof t&&(e=(new DOMParser).parseFromString(t,"text/html").firstChild,e.lastChild&&(e=e.lastChild.firstChild)),e.getBoundingClientRect){const t=e.getBoundingClientRect();return new Bw(t)}return new qt}removeDom(t){return t.parentElement.removeChild(t),!0}updateDom(t,e){const{width:i,height:s,style:n}=e;return n&&(S(n)?t.setAttribute("style",n):Object.keys(n).forEach((e=>{t.style[e]=n[e]}))),null!=i&&(t.style.width=`${i}px`),null!=s&&(t.style.height=`${s}px`),!0}createDom(t){const{tagName:e="div",parent:i}=t,s=document.createElement(e);if(this.updateDom(s,t),i){const t=S(i)?this.getElementById(i):i;t&&t.appendChild&&t.appendChild(s)}return s}loadImage(t){return Fw(t,!1).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadSvg(t){return Fw(t,!0).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}createCanvas(t){var e,i;const s=document.createElement("canvas");t.id&&(s.id=null!==(e=t.id)&&void 0!==e?e:I.GenAutoIncrementId().toString());const n=null!==(i=t.dpr)&&void 0!==i?i:window.devicePixelRatio;return t.width&&t.height&&(s.style.width=`${t.width}px`,s.style.height=`${t.height}px`,s.width=t.width*n,s.height=t.height*n),s}createOffscreenCanvas(t){var e;const i=null!==(e=t.dpr)&&void 0!==e?e:window.devicePixelRatio;return new OffscreenCanvas(t.width*i,t.height*i)}releaseCanvas(t){let e;e="string"==typeof t?document.getElementById(t):t,e&&e.parentElement&&e.parentElement.removeChild(e)}getDevicePixelRatio(){return window.devicePixelRatio}getRequestAnimationFrame(){return window.requestAnimationFrame}getCancelAnimationFrame(){return window.cancelAnimationFrame}addEventListener(t,e,i){return document.addEventListener(t,e,i)}removeEventListener(t,e,i){return document.removeEventListener(t,e,i)}dispatchEvent(t){return document.dispatchEvent(t)}getElementById(t){return document.getElementById(t)}getRootElement(){return document.body}getDocument(){return document}release(...t){}getElementTop(t,e){let i=t.offsetTop,s=t.offsetParent;for(;null!==s;)i+=s.offsetTop,s=s.offsetParent;return i}getElementLeft(t,e){let i=t.offsetLeft,s=t.offsetParent;for(;null!==s;)i+=s.offsetLeft,s=s.offsetParent;return i}getElementTopLeft(t,e){let i=t.offsetTop,s=t.offsetLeft,n=t.offsetParent;for(;null!==n;)i+=n.offsetTop,s+=n.offsetLeft,n=n.offsetParent;return{top:i,left:s}}};Yw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[])],Yw);const jw=new B((t=>{jw.isBrowserBound||(jw.isBrowserBound=!0,t(Yw).toSelf().inSingletonScope(),t(tt).toService(Yw))}));function Hw(t,e=!0){Hw.__loaded||(Hw.__loaded=!0,t.load(jw),t.load(Sw),t.load(Rw),e&&function(t){t.load(Cw),t.load(Ew)}(t))}jw.isBrowserBound=!1,Hw.__loaded=!1;let zw=class extends yw{constructor(t,e){super(t,e);const i=t.nativeCanvas.getContext("2d");if(!i)throw new Error("发生错误,获取2d上下文失败");this.nativeContext=i,this.canvas=t,this.matrix=new Pt(1,0,0,1,0,0),this.stack=[],this.dpr=null!=e?e:1}release(...t){}};zw.env="node",zw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object,Number])],zw);let Nw=class extends fw{constructor(t){super(t)}init(){this._context=new zw(this,this._dpr),this.nativeCanvas.width=this._pixelWidth,this.nativeCanvas.height=this._pixelHeight}release(...t){this._nativeCanvas.release&&ys(this._nativeCanvas.release)&&this._nativeCanvas.release()}};Nw.env="node",Nw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Nw);const Vw=xw(Nw,zw);let Ww=class extends Dw{get container(){return null}constructor(t){super(),this.global=t,this.type="node"}getTitle(){return""}getWH(){return{width:this.canvas.displayWidth,height:this.canvas.displayHeight}}getXY(){return{x:0,y:0}}createWindow(t){t.canvas?this.createWindowByCanvas(t):this.createWindowByConfig(t)}createWindowByConfig(t){const e=this.global.createCanvas({width:t.width,height:t.height}),i={width:t.width,height:t.height,dpr:t.dpr,nativeCanvas:e,id:I.GenAutoIncrementId().toString(),canvasControled:!0};this.canvas=new Nw(i)}createWindowByCanvas(t){const e=t.canvas;let i=t.width,s=t.height;null!=i&&null!=s&&t.canvasControled||(i=e.width,s=e.height),this.canvas=new Nw({width:i,height:s,dpr:1,nativeCanvas:e,canvasControled:t.canvasControled})}releaseWindow(){this.canvas.release()}resizeWindow(t,e){this.canvas.resize(t,e)}setDpr(t){this.canvas.dpr=t}getContext(){return this.canvas.getContext()}getNativeHandler(){return this.canvas}getDpr(){return this.canvas.dpr}getImageBuffer(t="image/png"){return this.canvas.nativeCanvas.toBuffer(t)}addEventListener(t,e,i){}dispatchEvent(t){return!0}removeEventListener(t,e,i){}getStyle(){}setStyle(t){}getBoundingClientRect(){return null}clearViewBox(t){}};Ww.env="node",Ww=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(et)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],Ww);const Gw=new B((t=>{t(Ww).toSelf(),t(Ji).toDynamicValue((t=>t.container.get(Ww))).whenTargetNamed(Ww.env)}));let Uw=class extends Iw{constructor(){super(...arguments),this.type="node",this._lastTime=0,this.supportEvent=!1}configure(t,e){t.env===this.type&&(t.setActiveEnvContribution(this),this.pkg=e)}getDynamicCanvasCount(){return 0}getStaticCanvasCount(){return 999}loadJson(t){const e=fetch(t).then((t=>t.json()));return e.then((t=>({data:t,state:"success"}))).catch((()=>({data:null,state:"fail"}))),e}loadArrayBuffer(t){return fetch(t).then((t=>t.arrayBuffer())).then((t=>({data:t,loadState:"success"}))).catch((()=>({data:null,loadState:"fail"})))}loadImage(t){const{loadImage:e}=this.pkg;return e?e(t).then((t=>({loadState:t?"success":"fail",data:t}))).catch((()=>({loadState:"fail",data:null}))):Promise.reject(new Error("node-canvas loadImage could not be found!"))}loadSvg(t){const e=this.pkg.Resvg;if(!e)return Promise.reject(new Error("@resvg/resvg-js svgParser could not be found!"));const i=new e(t).render().asPng();return this.loadImage(i)}createCanvas(t){return this.pkg.createCanvas(t.width,t.height)}releaseCanvas(t){}getDevicePixelRatio(){return 1}getRequestAnimationFrame(){return function(t){return pn.call(t)}}getCancelAnimationFrame(){return t=>{pn.clear(t)}}addEventListener(t,e,i){}removeEventListener(t,e,i){}getElementById(t){return null}getRootElement(){return null}dispatchEvent(t){}release(...t){}createOffscreenCanvas(t){}};Uw=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],Uw);const $w=new B((t=>{$w.isNodeBound||($w.isNodeBound=!0,t(Uw).toSelf().inSingletonScope(),t(tt).toService(Uw))}));function Xw(t,e=!0){Xw.__loaded||(Xw.__loaded=!0,t.load($w),t.load(Vw),t.load(Gw))}$w.isNodeBound=!1,Xw.__loaded=!1;const Kw={name:"dark",colorScheme:{default:{dataScheme:ql,palette:{backgroundColor:"#202226",borderColor:"#404349",shadowColor:"rgba(0,0,0,0.1)",hoverBackgroundColor:"#404349",sliderRailColor:"#404349",sliderHandleColor:"#202226",sliderTrackColor:"#4284FF",popupBackgroundColor:"#404349",primaryFontColor:"#fdfdfd",secondaryFontColor:"#bbbdc3",tertiaryFontColor:"#888c93",axisLabelFontColor:"#888c93",disableFontColor:"#55595f",axisMarkerFontColor:"#202226",axisGridColor:"#404349",axisDomainColor:"#4b4f54",dataZoomHandleStrokeColor:"#bbbdc3",dataZoomChartColor:"#55595F",playerControllerColor:"#4284FF",scrollBarSliderColor:"rgba(255,255,255,0.3)",axisMarkerBackgroundColor:"#fdfdfd",markLabelBackgroundColor:"#404349",markLineStrokeColor:"#bbbdc3",dangerColor:"#eb4b4b",warningColor:"#f0bd30",successColor:"#14b267",infoColor:"#4284ff",discreteLegendPagerTextColor:"#BBBDC3",discreteLegendPagerHandlerColor:"#BBBDC3",discreteLegendPagerHandlerDisableColor:"#55595F",emptyCircleColor:"#bbbdc3"}}},component:{dataZoom:{selectedBackground:{style:{fillOpacity:.4,outerBorder:{strokeOpacity:.4}}}}}};class qw{constructor(){this.id=Ko(),this._plugins=[]}add(t){if(!t||0===t.length)return null;const e=[];return t.forEach((t=>{this._plugins.find((e=>e.id===t.id))?pl("不要重复添加相同的plugin"):(this._plugins.push(t),e.push(t),t.onAdd&&t.onAdd(this))})),e}load(t){const e=this.add(t);e&&e.length&&this.activate(t)}activate(t){t.length&&t.forEach((t=>{t.init&&t.init()}))}get(t){return this._plugins.find((e=>e.id===t))}getAll(){return this._plugins.slice()}release(t){const e=this.get(t);e&&(e.release(this),this._plugins=this._plugins.filter((t=>t!==e)))}releaseAll(){this._plugins.forEach((t=>{t.release(this)})),this._plugins=[]}clear(t){const e=this.get(t);e&&e.clear(this)}clearAll(){this._plugins.forEach((t=>{var e;null===(e=t.clear)||void 0===e||e.call(t,this)}))}}class Zw extends qw{constructor(t){super(),this.globalInstance=t}onInit(t){this._plugins.forEach((e=>{e.onInit&&e.onInit(this,t)}))}onBeforeResize(t,e){this._plugins.forEach((i=>{i.onBeforeResize&&i.onBeforeResize(this,t,e)}))}onAfterChartSpecTransform(t,e){this._plugins.forEach((i=>{i.onAfterChartSpecTransform&&i.onAfterChartSpecTransform(this,t,e)}))}onBeforeInitChart(t,e){this._plugins.forEach((i=>{i.onBeforeInitChart&&i.onBeforeInitChart(this,t,e)}))}releaseAll(){super.releaseAll(),this.globalInstance=null}}class Jw{constructor(t,e){this.references=new Map,this.view=t,this.depend(null==e?void 0:e.dependency)}getStartState(){return null}depend(t){this.references.clear(),Ba(t).map((t=>S(t)?this.view.getGrammarById(t):t)).filter((t=>!D(t))).forEach((t=>{var e;this.references.set(t,(null!==(e=this.references.get(t))&&void 0!==e?e:0)+1)}))}parameters(){const t={};return this.references.forEach(((e,i)=>{M(i.id())&&(t[i.id()]=i.output())})),t}bind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.addEventListener(e,t.handler)})):"none"!==t.type&&this.view.addEventListener(t.type,t.handler))}))}unbind(){const t=this.getEvents();(null!=t?t:[]).forEach((t=>{t.type&&t.handler&&(y(t.type)?t.type.forEach((e=>{e&&"none"!==e&&this.view.removeEventListener(e,t.handler)})):"none"!==t.type&&this.view.removeEventListener(t.type,t.handler))}))}start(t){}reset(t){}dispatchEvent(t,e){this.view.emit(`${this.type}:${t}`,e),"start"===t&&this.options.onStart?this.options.onStart(e):"reset"===t&&this.options.onReset?this.options.onReset(e):"update"===t&&this.options.onUpdate?this.options.onUpdate(e):"end"===t&&this.options.onEnd&&this.options.onEnd(e)}}class Qw extends Jw{constructor(t,e){super(t,e),this.type=Qw.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},Qw.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){t&&this._marks&&this._marks.includes(t.mark)&&t.addState(this.options.state)}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&t.removeState(this.options.state)}}Qw.type="element-active",Qw.defaultOptions={state:dc.active,trigger:"pointerover",triggerOff:"pointerout"};const tT=t=>t.filterField?e=>{var i;return null===(i=e.getDatum())||void 0===i?void 0:i[t.filterField]}:e=>e[t.filterType],eT=(t,e)=>{if(!e||!t)return null;const i={};return t.forEach((t=>{const s=t&&t.getSpec(),n=s&&s.encode;n&&e.forEach((e=>{e&&n[e]&&(i[e]||(i[e]=[]),i[e].push(t))}))})),i};class iT extends Jw{constructor(t,e){super(t,e),this.type=iT.type,this._resetType=[],this.clearPrevElements=()=>{const{state:t,reverseState:e}=this.options;this._statedElements&&this._statedElements.length&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:this._statedElements,options:this.options}),this._statedElements=[])},this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},iT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=eT(this._marks,[this.options.state,this.options.reverseState])}getStartState(){return this.options.state}getEvents(){const t=this.options.triggerOff,e=this.options.trigger,i=[{type:e,handler:this.handleStart}],{eventNames:s,resetType:n}=(t=>{const e=Ba(t),i=[],s=[];return e.forEach((t=>{"empty"===t?i.push("view"):S(t)&&"none"!==t?t.includes("view:")?(s.push(t.replace("view:","")),i.push("view")):(s.push(t),i.push("self")):h(t)&&i.push("timeout")})),{eventNames:s,resetType:i}})(t);return s.forEach((t=>{t&&(y(e)?!e.includes(t):t!==e)&&i.push({type:t,handler:this.handleReset})})),this._resetType=n,i}start(t){const{state:e,reverseState:i,isMultiple:s}=this.options;if(t&&this._marks&&this._marks.includes(t.mark))if(t.hasState(e)){if(this._resetType.includes("self")){const s=this._statedElements&&this._statedElements.filter((e=>e!==t));s&&s.length?this._statedElements=this.updateStates(s,this._statedElements,e,i):this.clearPrevElements()}}else this._timer&&clearTimeout(this._timer),t.addState(e),this._statedElements=this.updateStates(s&&this._statedElements?[...this._statedElements,t]:[t],this._statedElements,e,i),this.dispatchEvent("start",{elements:this._statedElements,options:this.options}),this._resetType.includes("timeout")&&(this._timer=setTimeout((()=>{this.clearPrevElements()}),this.options.triggerOff));else this._resetType.includes("view")&&this._statedElements&&this._statedElements.length&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);(this._resetType.includes("view")&&!e||this._resetType.includes("self")&&e)&&this.clearPrevElements()}}iT.type="element-select",iT.defaultOptions={state:dc.selected,trigger:"click"};class sT extends Jw{constructor(t,e){super(t,e),this.type=sT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},sT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector),this._stateMarks=eT(this._marks,[this.options.highlightState,this.options.blurState])}getStartState(){return this.options.highlightState}getEvents(){const t=this.options.triggerOff,e=[{type:this.options.trigger,handler:this.handleStart}];let i=t;return S(t)&&t.includes("view:")?(i=t.replace("view:",""),this._resetType="view"):this._resetType="self",e.push({type:i,handler:this.handleReset}),e}clearPrevElements(){const{highlightState:t,blurState:e}=this.options;this._lastElement&&(this.clearAllStates(t,e),this.dispatchEvent("reset",{elements:[this._lastElement],options:this.options}),this._lastElement=null,this._statedElements=null)}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const{highlightState:e,blurState:i}=this.options;if(this._lastElement===t)return;this._statedElements=this.updateStates([t],this._statedElements,e,i),this._lastElement=t,this.dispatchEvent("start",{elements:[t],options:this.options})}else this._lastElement&&"view"===this._resetType&&this.clearPrevElements()}reset(t){if(!this._statedElements||!this._statedElements.length)return;const e=t&&this._marks&&this._marks.includes(t.mark);"view"!==this._resetType||e?"self"===this._resetType&&e&&this.clearPrevElements():this.clearPrevElements()}}sT.type="element-highlight",sT.defaultOptions={highlightState:dc.highlight,blurState:dc.blur,trigger:"pointerover",triggerOff:"pointerout"};class nT extends Jw{constructor(t,e){super(t,e),this.type=nT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{t.element&&this._marks&&this._marks.includes(t.element.mark)&&this.clearPrevElements()},this.options=Object.assign({},nT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.key;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.key===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}}nT.type="element-highlight-by-key",nT.defaultOptions={highlightState:dc.highlight,blurState:dc.blur,trigger:"pointerover",triggerOff:"pointerout"};class rT extends Jw{constructor(t,e){super(t,e),this.type=rT.type,this.handleStart=t=>{this.start(t.element)},this.handleReset=t=>{this.reset(t.element)},this.options=Object.assign({},rT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}clearPrevElements(){const t=[this.options.highlightState,this.options.blurState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}start(t){if(t&&this._marks&&this._marks.includes(t.mark)){const e=t.groupKey;if(D(e))return;this._marks.forEach((t=>{t.elements.forEach((t=>{t.groupKey===e?t.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):t.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}}reset(t){t&&this._marks&&this._marks.includes(t.mark)&&this.clearPrevElements()}}rT.type="element-highlight-by-group",rT.defaultOptions={highlightState:dc.highlight,blurState:dc.blur,trigger:"pointerover",triggerOff:"pointerout"};const aT=16,oT=8,lT=12;var hT,dT,cT;!function(t){t.selected="selected",t.unSelected="unSelected",t.selectedHover="selectedHover",t.unSelectedHover="unSelectedHover",t.focus="focus"}(hT||(hT={})),function(t){t.legendItemHover="legendItemHover",t.legendItemUnHover="legendItemUnHover",t.legendItemClick="legendItemClick",t.legendItemAttributeUpdate="legendItemAttributeUpdate"}(dT||(dT={})),function(t){t.innerView="innerView",t.title="legendTitle",t.item="legendItem",t.itemShape="legendItemShape",t.itemLabel="legendItemLabel",t.itemValue="legendItemValue",t.focus="legendItemFocus"}(cT||(cT={}));class uT extends Jw{constructor(t,e){super(t,e),this.type=uT.type,this.handleStart=t=>{var e,i;this.start(null===(i=null===(e=t.detail)||void 0===e?void 0:e.data)||void 0===i?void 0:i.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},uT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getEvents(){return[{type:dT.legendItemHover,handler:this.handleStart},{type:dT.legendItemUnHover,handler:this.handleReset}]}getStartState(){return this.options.state}start(t){const e=t;if(D(e))return;const i=tT(this.options);this._marks.forEach((t=>{t.elements.forEach((t=>{i(t)===e?t.addState(this.options.state):t.removeState(this.options.state)}))}))}reset(){this._marks.forEach((t=>{t.elements.forEach((t=>{t.removeState(this.options.state)}))}))}}uT.type="element-active-by-legend",uT.defaultOptions={state:dc.active,filterType:"groupKey"};class pT extends Jw{constructor(t,e){super(t,e),this.type=pT.type,this.handleStart=(t,e)=>{var i,s;this.start(null===(s=null===(i=t.detail)||void 0===i?void 0:i.data)||void 0===s?void 0:s.id)},this.handleReset=t=>{this.reset()},this.options=Object.assign({},pT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:dT.legendItemHover,handler:this.handleStart},{type:dT.legendItemUnHover,handler:this.handleReset}]}start(t){if(D(t))return;const e=tT(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}pT.type="element-highlight-by-legend",pT.defaultOptions={highlightState:dc.highlight,blurState:dc.blur,filterType:"groupKey"};class gT extends Jw{constructor(t,e){super(t,e),this.type=gT.type,this.handleStart=(t,e)=>{if(this.options.shouldStart?this.options.shouldStart(t):this._filterByName(t)){const i=this._parseTargetKey(t,e);this.start(i)}},this.handleReset=t=>{(this.options.shouldReset?this.options.shouldReset(t):this._filterByName(t))&&this.reset()},this.options=Object.assign({},gT.defaultOptions,e),this._marks=t.getMarksBySelector(this.options.selector)}getStartState(){return this.options.highlightState}getEvents(){return[{type:this.options.trigger,handler:this.handleStart},{type:this.options.triggerOff,handler:this.handleReset}]}_filterByName(t){var e;const i=Ba(this.options.graphicName);return(null===(e=null==t?void 0:t.target)||void 0===e?void 0:e.name)&&i.includes(t.target.name)}_parseTargetKey(t,e){return this.options.parseData?this.options.parseData(t):"text"===t.target.type?t.target.attribute.text:null}start(t){if(D(t))return;const e=tT(this.options);this._marks.forEach((i=>{i.elements.forEach((i=>{e(i)===t?i.updateStates({[this.options.blurState]:!1,[this.options.highlightState]:!0}):i.updateStates({[this.options.blurState]:!0,[this.options.highlightState]:!1})}))}))}reset(){const t=[this.options.blurState,this.options.highlightState];this._marks.forEach((e=>{e.elements.forEach((e=>{e.removeState(t)}))}))}}gT.type="element-highlight-by-name",gT.defaultOptions={trigger:"pointerover",triggerOff:"pointerout",highlightState:dc.highlight,blurState:dc.blur,filterType:"groupKey"};class mT{updateStates(t,e,i,s){return t&&t.length?(i&&s?e&&e.length?(this.toggleReverseStateOfElements(t,e,s),this.toggleStateOfElements(t,e,i)):this.addBothStateOfElements(t,i,s):i&&(e&&e.length?this.toggleStateOfElements(t,e,i):this.addStateOfElements(t,i)),t):null}toggleReverseStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)}))}toggleStateOfElements(t,e,i){e.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.removeState(i)})),t.forEach((t=>{i&&this._stateMarks[i]&&this._stateMarks[i].includes(t.mark)&&t.addState(i)}))}addBothStateOfElements(t,e,i){this._marks.forEach((s=>{const n=i&&this._stateMarks[i]&&this._stateMarks[i].includes(s),r=e&&this._stateMarks[e]&&this._stateMarks[e].includes(s);(n||r)&&s.elements.forEach((s=>{t&&t.includes(s)?r&&s.addState(e):n&&s.addState(i)}))}))}addStateOfElements(t,e){this._marks.forEach((i=>{const s=e&&this._stateMarks[e]&&this._stateMarks[e].includes(i);s&&i.elements.forEach((i=>{t&&t.includes(i)&&s&&i.addState(e)}))}))}clearAllStates(t,e){this._statedElements&&this._statedElements.length&&this._marks.forEach((i=>{e&&this._stateMarks[e]&&this._stateMarks[e].includes(i)&&i.elements.forEach((t=>{t.removeState(e)})),t&&this._stateMarks[t]&&this._stateMarks[t].includes(i)&&i.elements.forEach((e=>{this._statedElements.includes(e)&&e.removeState(t)}))}))}}var _T=function(t,e,i,s){return new(i||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}))};class fT{static useRegisters(t){t.forEach((t=>{"function"==typeof t?t():console.error("Invalid function:",t)}))}static useChart(t){t.forEach((t=>$l.registerChart(t.type,t)))}static useSeries(t){t.forEach((t=>$l.registerSeries(t.type,t)))}static useComponent(t){t.forEach((t=>$l.registerComponent(t.type,t)))}static useMark(t){t.forEach((t=>{var e;return $l.registerMark(null!==(e=t.constructorType)&&void 0!==e?e:t.type,t)}))}static useLayout(t){t.forEach((t=>$l.registerLayout(t.type,t)))}static registerDataSetTransform(t,e){$l.registerTransform(t,e)}static registerFunction(t,e){t&&e&&mw.instance().registerFunction(t,e)}static unregisterFunction(t){t&&mw.instance().unregisterFunction(t)}static getFunction(t){return t?mw.instance().getFunction(t):null}static getFunctionList(){return mw.instance().getFunctionNameList()}static registerMap(t,e,i){const s=$l.getImplementInKey("registerMap");s&&s(t,e,i)}static unregisterMap(t){const e=$l.getImplementInKey("unregisterMap");e&&e(t)}static getMap(t){return e=t,Ep.get(e);var e}static hideTooltip(t=[]){Gh.forEach((t=>{var e;return null===(e=null==t?void 0:t.hideTooltip)||void 0===e?void 0:e.call(t)}),t)}static getLogger(){return g.getInstance()}getSpec(){return this._spec}getSpecInfo(){return this._specInfo}getDataSet(){return this._dataSet}constructor(t,e){var i,s,r,a,o,l,h,d;this.id=Ko(),this._userEvents=[],this._autoSize=!0,this._option={mode:n["desktop-browser"],onError:t=>{throw new Error(t)},optimize:{disableCheckGraphicWidthOutRange:!0}},this._observer=null,this._context={},this._doResize=()=>{const{width:t,height:e}=this.getCurrentSize();this._currentSize.width===t&&this._currentSize.height===e||(this._currentSize={width:t,height:e},this.resizeSync(t,e))},this._renderSync=(t={})=>{var e;return this._beforeRender(t)?(null===(e=this._compiler)||void 0===e||e.render(t.morphConfig),this._afterRender(),this):this},this._updateSpec=(t,e=!1,i)=>{var s,n;const r=this._spec,a={changeBackground:!1,reTransformSpec:!1,change:!1,reMake:!1,reCompile:!1,reSize:!1,changeTheme:!1};if(!this._setNewSpec(t,e))return;Im(r.theme,this._spec.theme)?Im(this._spec.background,r.background)||(a.reMake=!0,a.changeBackground=!0):a.changeTheme=!0;const o=this._shouldChartResize(r);if(a.reSize=o,null===(n=null===(s=this._compiler)||void 0===s?void 0:s.getVGrammarView())||void 0===n||n.updateLayoutTag(),this._spec.type!==r.type)return a.reMake=!0,a.reTransformSpec=!0,a.change=!0,a.changeTheme=!0,a;this._initChartSpec(this._spec,"render");const l=yy(this._chart.updateSpec(this._spec),a);return i?Object.assign(Object.assign({},l),i):l},this._option=E(this._option,{animation:!1!==t.animation},e),this._onError=null===(i=this._option)||void 0===i?void 0:i.onError;const c=this._option,{dom:u,renderCanvas:p,mode:g,stage:m,poptip:_}=c,f=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{this._event.emit(Hd.animationFinished,{chart:this._chart,vchart:this})})),this._compiler.getVGrammarView().addEventListener(lc.AFTER_VRENDER_NEXT_RENDER,(()=>{this._event.emit(Hd.renderFinished,{chart:this._chart,vchart:this})})))}_bindResizeEvent(){var t,e;if(this._autoSize){if(this._onResize=Kd(this._doResize,null!==(t=this._option.resizeDelay)&&void 0!==t?t:100),this._container){const t=window.ResizeObserver;t&&(this._observer=new t(this._onResize),null===(e=this._observer)||void 0===e||e.observe(this._container))}window.addEventListener("resize",this._onResize)}}_unBindResizeEvent(){this._autoSize&&(window.removeEventListener("resize",this._onResize),this._observer&&(this._observer.disconnect(),this._observer=null))}getCurrentSize(){var t,e,i,s;return vy(this._spec,{container:this._container,canvas:this._canvas,mode:this._getMode(),modeParams:this._option.modeParams},{width:null!==(e=null===(t=this._currentSize)||void 0===t?void 0:t.width)&&void 0!==e?e:nh,height:null!==(s=null===(i=this._currentSize)||void 0===i?void 0:i.height)&&void 0!==s?s:rh})}_initDataSet(t){this._dataSet=t instanceof f?t:new f,Cp(this._dataSet,"dataview",b),Cp(this._dataSet,"array",e),Lp(this._dataSet,"copyDataView",Bp);for(const t in $l.transforms)Lp(this._dataSet,t,$l.transforms[t]);for(const t in $l.dataParser)Cp(this._dataSet,t,$l.dataParser[t])}updateCustomConfigAndRerender(t,e,i={}){if(!this._isReleased&&t)return ys(t)&&(t=t()),t.reAnimate&&(this.stopAnimation(),this._updateAnimateState(!0)),this._reCompile(t),e?this._renderSync(i):this._renderAsync(i)}_updateCustomConfigAndRecompile(t,e={}){return!!t&&(this._reCompile(t),this._beforeRender(e))}_reCompile(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;if(t.reMake)this._releaseData(),this._initDataSet(),this._chartSpecTransformer=null,null===(i=this._chart)||void 0===i||i.release(),this._chart=null,t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(s=this._currentTheme)||void 0===s?void 0:s.fontFamily)):t.changeBackground&&(null===(n=this._compiler)||void 0===n||n.setBackground(this._getBackground())),null===(r=this._compiler)||void 0===r||r.releaseGrammar(!1===(null===(a=this._option)||void 0===a?void 0:a.animation)||!1===(null===(o=this._spec)||void 0===o?void 0:o.animation)),this._userEvents.forEach((t=>{var e;return null===(e=this._event)||void 0===e?void 0:e.on(t.eType,t.query,t.handler)})),t.reSize&&this._doResize();else if(t.changeTheme?(this._setCurrentTheme(),this._setFontFamilyTheme(null===(l=this._currentTheme)||void 0===l?void 0:l.fontFamily)):t.changeBackground&&(null===(h=this._compiler)||void 0===h||h.setBackground(this._getBackground())),t.reCompile&&(null===(d=this._compiler)||void 0===d||d.clear({chart:this._chart,vChart:this},!1===(null===(c=this._option)||void 0===c?void 0:c.animation)||!1===(null===(u=this._spec)||void 0===u?void 0:u.animation)),null===(p=this._compiler)||void 0===p||p.compile({chart:this._chart,vChart:this},{})),t.reSize){const{width:t,height:e}=this.getCurrentSize();this._chart.onResize(t,e,!1),this._compiler.resize(t,e,!1)}}_beforeRender(t={}){var e,i,s,n,r,a,o,l;if(this._isReleased)return!1;if(this._chart)return!0;const{transformSpec:h,actionSource:d}=t;return h&&this._initChartSpec(this._spec,"render"),this._chartPluginApply("onBeforeInitChart",this._spec,d),null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeInitializeChart)||void 0===i||i.call(e,this),this._initChart(this._spec),null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterInitializeChart)||void 0===n||n.call(s,this),!(!this._chart||!this._compiler||(null===(a=null===(r=this._option.performanceHook)||void 0===r?void 0:r.beforeCompileToVGrammar)||void 0===a||a.call(r),this._compiler.compile({chart:this._chart,vChart:this},{performanceHook:this._option.performanceHook}),null===(l=null===(o=this._option.performanceHook)||void 0===o?void 0:o.afterCompileToVGrammar)||void 0===l||l.call(o),0))}_afterRender(){return!this._isReleased&&(this._updateAnimateState(),this._event.emit(Hd.rendered,{chart:this._chart,vchart:this}),!0)}renderSync(t){return this._renderSync({morphConfig:t,transformSpec:!0,actionSource:"render"})}renderAsync(t){return _T(this,void 0,void 0,(function*(){return this._renderAsync({morphConfig:t,transformSpec:!0,actionSource:"render"})}))}_renderAsync(t={}){return _T(this,void 0,void 0,(function*(){return this._renderSync(t)}))}_updateAnimateState(t){var e,i;if(this._option.animation){const s=t?zp.appear:zp.update;null===(e=this._chart)||void 0===e||e.getAllRegions().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)})),null===(i=this._chart)||void 0===i||i.getAllComponents().forEach((t=>{var e;null===(e=t.animate)||void 0===e||e.updateAnimateState(s,!0)}))}}release(){var t,e,i,s;(null===(t=this._onResize)||void 0===t?void 0:t.cancel)&&this._onResize.cancel(),this._chartPluginApply("releaseAll"),this._chartPlugin=null,this._chartSpecTransformer=null,null===(e=this._chart)||void 0===e||e.release(),null===(i=this._eventDispatcher)||void 0===i||i.release(),null===(s=this._compiler)||void 0===s||s.release(),this._unBindResizeEvent(),this._releaseData(),this._onError=null,this._onResize=null,this._container=null,this._currentTheme=null,this._option=null,this._chart=null,this._compiler=null,this._spec=null,this._specInfo=null,this._originalSpec=null,this._userEvents=null,this._event=null,this._eventDispatcher=null,this._isReleased=!0,Gh.unregisterInstance(this)}updateData(t,e,i,s){return _T(this,void 0,void 0,(function*(){return this.updateDataSync(t,e,i,s)}))}_updateDataById(t,e,i){const s=this._spec.data.find((e=>e.name===t||e.id===t));s?s.id===t?s.values=e:s.name===t&&s.parse(e,i):y(e)?this._spec.data.push({id:t,values:e}):this._spec.data.push(e)}updateDataInBatches(t){return _T(this,void 0,void 0,(function*(){return this._chart?(this._chart.updateFullData(t.map((({id:t,data:e,options:i})=>({id:t,values:e,parser:i})))),this._chart.updateGlobalScaleDomain(),this._compiler.render(),this):(this._spec.data=Ba(this._spec.data),t.forEach((({id:t,data:e,options:i})=>{this._updateDataById(t,e,i)})),this)}))}updateDataSync(t,e,i,s){return D(this._dataSet)?this:this._chart?((null==s?void 0:s.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateData(t,e,!0,i),this._compiler.render(),this):(this._spec.data=Ba(this._spec.data),this._updateDataById(t,e,i),this)}updateFullDataSync(t,e=!0,i){if(this._chart)return(null==i?void 0:i.reAnimate)&&(this.stopAnimation(),this._updateAnimateState(!0)),this._chart.updateFullData(t),e&&this._compiler.render(),this;const s=Ba(this._spec.data);return Ba(t).forEach((t=>{var e;const{id:i,values:n,parser:r,fields:a}=t,o=s.find((t=>t.name===i));if(o)o instanceof R?(o.setFields(k(a)),o.parse(n,k(r))):(o.values=n,M(r)&&(o.parser=r),M(a)&&(o.fields=a));else{const i=Yp(t,this._dataSet,s,{onError:null===(e=this._option)||void 0===e?void 0:e.onError});y(this._spec.data)&&this._spec.data.push(i)}})),this}updateFullData(t,e=!0){return _T(this,void 0,void 0,(function*(){return this.updateFullDataSync(t,e)}))}updateSpec(t,e=!1,i,s){return _T(this,void 0,void 0,(function*(){const n=this._updateSpec(t,e,s);return n?(yield this.updateCustomConfigAndRerender(n,!1,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}))}updateSpecSync(t,e=!1,i,s){const n=this._updateSpec(t,e,s);return n?(this.updateCustomConfigAndRerender(n,!0,{morphConfig:i,transformSpec:n.reTransformSpec,actionSource:"updateSpec"}),this):this}updateSpecAndRecompile(t,e=!1,i={}){const s=this._updateSpec(t,e);return this._updateCustomConfigAndRecompile(s,Object.assign({actionSource:"updateSpecAndRecompile"},i))}updateModelSpec(t,e,i=!1,s){return _T(this,void 0,void 0,(function*(){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),ys(t)||Ll(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!1,i,s)}return this}))}updateModelSpecSync(t,e,i=!1,s){if(!e||!this._spec)return this;if(S(e)&&(e=JSON.parse(e)),ys(t)||Ll(this._spec,t,e,i),this._chart){const n=this._chart.getModelInFilter(t);if(n)return this._updateModelSpec(n,e,!0,i,s)}return this}_updateModelSpec(t,e,i=!1,s=!1,n){s&&(e=Tl({},t.getSpec(),e));const r=t.updateSpec(e);return t.reInit(e),(r.change||r.reCompile||r.reMake||r.reSize||r.reRender)&&this._chart.reDataFlow(),this.updateCustomConfigAndRerender(r,i,{morphConfig:n,transformSpec:!1,actionSource:"updateModelSpec"})}resize(t,e){return _T(this,void 0,void 0,(function*(){return this.resizeSync(t,e)}))}resizeSync(t,e){var i,s;return this._beforeResize(t,e)?(null===(s=(i=this._compiler).resize)||void 0===s||s.call(i,t,e),this._afterResize()):this}_beforeResize(t,e){var i,s,n,r;if(!this._chart||!this._compiler)return!1;const a=this._chart.getCanvasRect();return!(a&&a.width===t&&a.height===e||(this._chartPluginApply("onBeforeResize",t,e),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.beforeResizeWithUpdate)||void 0===s||s.call(i),this._chart.onResize(t,e,!1),null===(r=null===(n=this._option.performanceHook)||void 0===n?void 0:n.afterResizeWithUpdate)||void 0===r||r.call(n),0))}_afterResize(){return this._isReleased||this._event.emit(Hd.afterResize,{chart:this._chart}),this}updateViewBox(t,e=!0,i=!0){return this._chart&&this._compiler?(this._viewBox=t,this._chart.updateViewBox(t,i),i&&(this._compiler.render(),this._chart.onEvaluateEnd()),this._compiler.updateViewBox(t,e),this):this}on(t,e,i){var s;this._userEvents&&(this._userEvents.push({eType:t,query:"function"==typeof e?null:e,handler:"function"==typeof e?e:i}),null===(s=this._event)||void 0===s||s.on(t,e,i))}off(t,e){var i;if(this._userEvents&&0!==this._userEvents.length)if(e){const s=this._userEvents.findIndex((i=>i.eType===t&&i.handler===e));s>=0&&(this._userEvents.splice(s,1),null===(i=this._event)||void 0===i||i.off(t,e))}else this._userEvents.forEach((e=>{var i;e.eType===t&&(null===(i=this._event)||void 0===i||i.off(t,e.handler))})),this._userEvents=this._userEvents.filter((e=>e.eType!==t))}updateState(t,e){this._chart&&this._chart.updateState(t,e)}setSelected(t,e,i){this._chart&&this._chart.setSelected(t,e,i)}setHovered(t,e,i){this._chart&&this._chart.setHovered(t,e,i)}clearState(t){this._chart&&this._chart.clearState(t)}clearAllStates(){this._chart&&this._chart.clearAllStates()}clearSelected(){this._chart&&this._chart.clearSelected()}clearHovered(){this._chart&&this._chart.clearHovered()}_updateCurrentTheme(t){var e,i,s,n,r,a;const o=this._option.theme,l=null===(e=this._spec)||void 0===e?void 0:e.theme,h=null===(i=this._spec)||void 0===i?void 0:i.type;let d;if(t&&(this._currentThemeName=t),Ym(o)&&Ym(l))d=$h(this._currentThemeName,!0),this._currentTheme=Xl({},d,null===(r=d.chart)||void 0===r?void 0:r[h]);else if(S(o)&&(!l||S(l))||S(l)&&(!o||S(o))){d=$h(this._currentThemeName,!0);const t=Xl({},d,null===(s=d.chart)||void 0===s?void 0:s[h],$h(o,!0),$h(l,!0));this._currentTheme=t}else{d=$h(this._currentThemeName);const t=Xl({},d,null===(n=d.chart)||void 0===n?void 0:n[h],$h(o),$h(l));this._currentTheme=Bh(t)}var c;c=Ud(this._currentTheme,"component.poptip"),E(d_.poptip,h_,c),null===(a=this._compiler)||void 0===a||a.setBackground(this._getBackground())}_shouldChartResize(t){var e,i;let s=!1;D(this._spec.width)?!D(t.width)&&(this._spec.width=t.width):this._spec.width!==t.width&&(s=!0),D(this._spec.height)?!D(t.height)&&(this._spec.height=t.height):this._spec.height!==t.height&&(s=!0);const n=this._autoSize;return this._autoSize=!!dl(this._option.mode)&&(null===(i=null!==(e=this._spec.autoFit)&&void 0!==e?e:this._option.autoFit)||void 0===i||i),this._autoSize!==n&&(s=!0),s}_getBackground(){return("string"==typeof this._spec.background||vs(this._spec.background)&&this._spec.background.gradient?this._spec.background:null)||this._currentTheme.background||this._option.background}getCurrentTheme(){return $h(this._currentThemeName)}getCurrentThemeName(){return this._currentThemeName}setCurrentTheme(t){var e;return _T(this,void 0,void 0,(function*(){if(!Uh.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),yield this.updateCustomConfigAndRerender(i,!1,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}))}setCurrentThemeSync(t){var e;if(!Uh.themeExist(t))return this;const i=this._setCurrentTheme(t);return this._setFontFamilyTheme(null===(e=this._currentTheme)||void 0===e?void 0:e.fontFamily),this.updateCustomConfigAndRerender(i,!0,{transformSpec:!1,actionSource:"setCurrentTheme"}),this}_setCurrentTheme(t){var e;return this._updateCurrentTheme(t),this._initChartSpec(this._getSpecFromOriginalSpec(),"setCurrentTheme"),null===(e=this._chart)||void 0===e||e.setCurrentTheme(),{change:!0,reMake:!1}}_setFontFamilyTheme(t){var e;t&&(null===(e=this.getStage())||void 0===e||e.setTheme({text:{fontFamily:t}}))}_getTooltipComponent(){var t;return null===(t=this._chart)||void 0===t?void 0:t.getComponentsByType(r.tooltip)[0]}setTooltipHandler(t){var e,i;this._context.tooltipHandler=t;const s=this._getTooltipComponent();s&&(null===(i=null===(e=s.tooltipHandler)||void 0===e?void 0:e.release)||void 0===i||i.call(e),s.tooltipHandler=t)}getTooltipHandlerByUser(){var t;return null===(t=this._context)||void 0===t?void 0:t.tooltipHandler}getTooltipHandler(){const t=this._getTooltipComponent();return t?t.tooltipHandler:this._context.tooltipHandler}showTooltip(t,e){var i;const s=this._getTooltipComponent();return null!==(i=M(t)&&"none"!==(null==s?void 0:s.showTooltip(t,e)))&&void 0!==i&&i}hideTooltip(){var t;const e=this._getTooltipComponent();return null!==(t=null==e?void 0:e.hideTooltip())&&void 0!==t&&t}getLegendDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getLegendData():[]}getLegendDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getLegendData():[]}getLegendSelectedDataById(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentByUserId(t);return i?i.getSelectedData():[]}getLegendSelectedDataByIndex(t=0){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getComponentsByType(r.discreteLegend);return i&&i[t]?i[t].getSelectedData():[]}setLegendSelectedDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.setSelectedData(e)}setLegendSelectedDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.discreteLegend);s&&s[t]&&s[t].setSelectedData(e)}getDataURL(){var t;return _T(this,void 0,void 0,(function*(){const e=this.getStage();if(this._chart&&e){e.render();const t=this._chart.getCanvas();return yield l_(t,{onError:this._onError})}return null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined")),null}))}exportImg(t){var e,i;return _T(this,void 0,void 0,(function*(){if(!dl(this._option.mode))return void(null===(e=this._option)||void 0===e||e.onError(new TypeError("non-browser environment can not export img")));const s=yield this.getDataURL();s?function(t="vchart",e){const i=document.createElement("a");i.setAttribute("href",e),i.setAttribute("target","_blank"),i.setAttribute("download",`${t}.png`),i.dispatchEvent(new MouseEvent("click"))}(t,s):null===(i=this._option)||void 0===i||i.onError(new ReferenceError("render is not defined"))}))}exportCanvas(){var t;const e=this.getStage();if(this._chart&&e)return e.toCanvas();null===(t=this._option)||void 0===t||t.onError(new ReferenceError("render is not defined"))}getImageBuffer(){var t,e;if("node"!==this._option.mode)return void(null===(t=this._option)||void 0===t||t.onError(new TypeError("getImageBuffer() now only support node environment.")));const i=this.getStage();return i?(i.render(),i.window.getImageBuffer()):(null===(e=this._option)||void 0===e||e.onError(new ReferenceError("render is not defined")),null)}setLayout(t){var e;this._option.layout=t,null===(e=this._chart)||void 0===e||e.setLayout(t)}reLayout(){var t;null===(t=this._chart)||void 0===t||t.setLayoutTag(!0)}getCompiler(){return this._compiler}getChart(){return this._chart}getStage(){return this._compiler.getStage()}getCanvas(){var t;return null===(t=this._compiler)||void 0===t?void 0:t.getCanvas()}getContainer(){var t;if(M(this._container))return this._container;let e;return e=S(this._canvas)?zo.getElementById(this._canvas):this._canvas,M(e)?e.parentElement:null===(t=this.getCanvas())||void 0===t?void 0:t.parentElement}getComponents(){return this._chart.getAllComponents()}getScale(t){var e;const i=null===(e=this._chart)||void 0===e?void 0:e.getGlobalScale();return null==i?void 0:i.getScale(t)}setDimensionIndex(t,e={}){var i;return null===(i=this._chart)||void 0===i?void 0:i.setDimensionIndex(t,e)}stopAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.stop()}pauseAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.pause()}resumeAnimation(){var t,e,i;null===(i=null===(e=null===(t=this._compiler)||void 0===t?void 0:t.getVGrammarView())||void 0===e?void 0:e.animate)||void 0===i||i.resume()}convertDatumToPosition(t,e={},i=!1,s){var n;if(!this._chart)return null;if(Ym(t))return null;const{seriesId:r,seriesIndex:a=0}=e;let o;if(M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o){const e=Object.keys(t),n=o.getViewData().latestData.find((i=>e.every((e=>i[e]==t[e])))),r=o.getRegion().getLayoutStartPoint();let a;return a=n?o.dataToPosition(n,s):o.dataToPosition(t,s),a?nl(a,r,i):null}return null}convertValueToPosition(t,e,i=!1){var s,n;if(!this._chart||D(t)||Ym(e))return null;if(!y(t)){const{axisId:n,axisIndex:r}=e;let a;if(M(n)?a=this._chart.getComponentsByKey("axes").find((t=>t.userId===n)):M(r)&&(a=null===(s=this._chart.getComponentsByKey("axes"))||void 0===s?void 0:s[r]),!a)return pl("Please check whether the `axisId` or `axisIndex` is set!"),null;const o=null==a?void 0:a.valueToPosition(t);if(i){const t=a.getLayoutStartPoint(),e=a.getOrient();return o+("bottom"===e||"top"===e?t.x:t.y)}return o}const{seriesId:r,seriesIndex:a}=e;let o;return M(r)?o=this._chart.getSeriesInUserId(r):M(a)&&(o=null===(n=this._chart.getSeriesInIndex([a]))||void 0===n?void 0:n[0]),o?nl(o.valueToPosition(t[0],t[1]),o.getRegion().getLayoutStartPoint(),i):(pl("Please check whether the `seriesId` or `seriesIndex` is set!"),null)}getFunction(t){return mw.instance().getFunction(t)}registerFunction(t,e){t&&e&&mw.instance().registerFunction(t,e)}unregisterFunction(t){t&&mw.instance().unregisterFunction(t)}getFunctionList(){return mw.instance().getFunctionNameList()}setRuntimeSpec(t){this._spec=t,this._updateSpecInfo()}updateIndicatorDataById(t,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentByUserId(t);s&&s.updateDatum(e)}updateIndicatorDataByIndex(t=0,e){var i;const s=null===(i=this._chart)||void 0===i?void 0:i.getComponentsByType(r.indicator);s&&s[t]&&s[t].updateDatum(e)}geoZoomByIndex(t=0,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionIndex:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}geoZoomById(t,e,i){var s,n;const a=null===(s=this._chart)||void 0===s?void 0:s.getRegionsInQuerier({regionId:t})[0],o=null===(n=this._chart)||void 0===n?void 0:n.getComponentsByType(r.geoCoordinate),l=null==o?void 0:o.find((t=>{var e;return null===(e=t.getRegions())||void 0===e?void 0:e.includes(a)}));l&&l.dispatchZoom(e,i)}_initChartPlugin(){const t=$l.getChartPlugins();t.length>0&&(this._chartPlugin=new Zw(this),this._chartPlugin.load(t.map((t=>new t))),this._chartPluginApply("onInit",this._spec))}_chartPluginApply(t,...e){this._chartPlugin&&this._chartPlugin[t]&&this._chartPlugin[t].apply(this._chartPlugin,e)}_getMode(){return this._option.mode||n["desktop-browser"]}_getChartOption(t){return{type:t,globalInstance:this,eventDispatcher:this._eventDispatcher,dataSet:this._dataSet,container:this._container,canvas:this._canvas,map:new Map,mode:this._getMode(),modeParams:this._option.modeParams,getCompiler:()=>this._compiler,performanceHook:this._option.performanceHook,viewBox:this._viewBox,animation:this._option.animation,getTheme:()=>{var t;return null!==(t=this._currentTheme)&&void 0!==t?t:{}},getSpecInfo:()=>{var t;return null!==(t=this._specInfo)&&void 0!==t?t:{}},layout:this._option.layout,onError:this._onError,disableTriggerEvent:!0===this._option.disableTriggerEvent}}}fT.InstanceManager=Gh,fT.ThemeManager=Uh,fT.globalConfig={uniqueTooltip:!0},fT.Utils=gw,fT.vglobal=zo,$l.registerRegion("region",Gy),$l.registerLayout("base",Qy),XA(),n_.useRegisters([()=>{_c.registerStageEventPlugin("gesture",ZA)}]),JA(sT,mT),_c.registerInteraction(sT.type,sT),JA(iT,mT),_c.registerInteraction(iT.type,iT),Nh(Kw.name,Kw),g.getInstance(u.Error);const vT=`${sh}_DEFAULT_DATA_INDEX`,yT=`${sh}_DEFAULT_DATA_KEY`,bT=`${sh}_DEFAULT_DATA_SERIES_FIELD`,xT=`${sh}_DEFAULT_SERIES_STYLE_NAME`,ST=`${sh}_STACK_KEY`,MT=`${sh}_STACK_START`,kT=`${sh}_STACK_END`,AT=`${sh}_STACK_START_PERCENT`,wT=`${sh}_STACK_END_PERCENT`,TT=`${sh}_STACK_START_OffsetSilhouette`,LT=`${sh}_STACK_END_OffsetSilhouette`,CT=`${sh}_STACK_TOTAL`,ET=`${sh}_STACK_TOTAL_PERCENT`,DT=`${sh}_STACK_TOTAL_TOP`,PT=`${sh}_STACK_TOTAL_BOTTOM`,OT=`${sh}_SEGMENT_START`,RT=`${sh}_SEGMENT_END`;function IT(t,e){for(let i=0;it.key===e))}function FT(t,e){var i;if(!t)return null!=e?e:null;const s=t.getFields();return s&&s[e]?null!==(i=s[e].alias)&&void 0!==i?i:e:null!=e?e:null}function YT(t,e,i){const s=t.getStackSort(),n={};let r=null;return s&&(r={},t.getSeries().forEach((t=>{const e=t.getSeriesField();if(e){const i=t.getRawDataStatisticsByField(e);i.values&&(r[e]||(r[e]={lastIndex:0,sort:{}}),i.values.forEach(((t,i)=>{t in r[e].sort||(r[e].sort[t]=r[e].lastIndex,r[e].lastIndex++)})))}}))),t.getSeries().forEach((t=>{var s;const a=t.getStackData(),o=t.getStackValue(),l=t.getStackValueField(),h=!i||i(t);a&&l&&h&&(n[o]=null!==(s=n[o])&&void 0!==s?s:{groupField:a.groupField,nodes:{}},VT(t,a,n[o],l,e,r))})),s?jT(n,r):n}function jT(t,e){var i;for(const s in t)(null===(i=t[s].sortDatums)||void 0===i?void 0:i.length)?(t[s].sortDatums.sort(((t,e)=>t.index-e.index)),t[s].values=t[s].sortDatums.map((t=>t.datum))):jT(t[s].nodes,e);return t}function HT(t,e){if("values"in t&&t.values.length){const i=fd(t.values,e),s=_d(t.values,wT);t.values.forEach((t=>{t[CT]=i,t[ET]=s}))}else for(const i in t.nodes)HT(t.nodes[i],e)}function zT(t){if(!t.values.length)return;const e=t.values[t.values.length-1][kT]/2;for(let i=0;i0){let s=0,o=0,l=1,h=0,d=null,c=null;const u=t.values.length;for(let i=0;i=0?(l[n.start]=s,s+=l[n.end],l[n.end]=s):(l[n.start]=o,o+=l[n.end],l[n.end]=o),l[n.key]=t.key,a&&(delete l[n.max],(!c||l[n.end]>c[n.end])&&(c=l)),r&&(delete l[n.min],(!d||l[n.start]=0?s:o;l=h>=0?1:-1,r[n.startPercent]=0===a?0:Math.min(1,r[n.start]/a)*l,r[n.endPercent]=0===a?0:Math.min(1,r[n.end]/a)*l}}for(const r in t.nodes)NT(t.nodes[r],e,i,s,n)}function VT(t,e,i,s,n,r,a){var o;if("values"in e)if(n&&e.values.forEach((t=>t[kT]=function(t){if(qo(t))return t;const e=+t;return qo(e)?e:0}(t[s]))),i.series.push({s:t,values:e.values}),r){const s=t.getSeriesField();e.values.forEach((e=>{i.sortDatums.push({series:t,datum:e,index:s?r[s].sort[e[s]]:0})}))}else i.values.push(...e.values);else for(const l in e.nodes){const h=a?`${a}_${l}`:l;i.nodes[l]||(i.nodes[l]={values:[],series:[],nodes:{},sortDatums:[],key:h},M(null===(o=e.nodes[l])||void 0===o?void 0:o.groupField)&&(i.nodes[l].groupField=e.nodes[l].groupField)),VT(t,e.nodes[l],i.nodes[l],s,n,r,h)}}const WT=(t,e)=>{const i=e.beforeCall();return t&&t.forEach(((t,s)=>e.call(t,s,i))),i.keyMap&&(i.keyMap.clear(),i.keyMap=null),t};class GT{constructor(){this.activeTriggerSet={mark:new Set,group:new Set},this.ignoreTriggerSet={mark:new Set}}}class UT extends GT{constructor(t){super(),this._getSeriesCacheInfo=()=>{var t,e,i;const{series:s}=this,n=s.getSeriesField();return{seriesFields:M(n)?Ba(n):null!==(t=s.getSeriesKeys())&&void 0!==t?t:[],dimensionFields:null!==(e=s.getDimensionField())&&void 0!==e?e:[],measureFields:null!==(i=s.getMeasureField())&&void 0!==i?i:[],type:s.type}},this._getDimensionData=t=>{const{dimensionFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getMeasureData=t=>{const{measureFields:e}=this._seriesCacheInfo;return e[0]&&(null==t?void 0:t[e[0]])},this._getSeriesFieldData=t=>{const{dimensionFields:e,seriesFields:i}=this._seriesCacheInfo;if(M(i[0])&&(null==t?void 0:t[i[0]]))return null==t?void 0:t[i[0]];const s=e[e.length-1];return e.length>1&&(0===i.length||this.series.getSeriesKeys().length),null==t?void 0:t[s]},this._getSeriesStyle=(t,e,i)=>{var s;for(const i of Ba(e)){const e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(M(e))return e}return i},this.markTooltipKeyCallback=(t,e)=>this._getSeriesFieldData(t),this.markTooltipValueCallback=(t,e)=>this._getMeasureData(t),this.shapeTypeCallback=(t,e)=>{var i;return null!==(i=this._getSeriesStyle(t,"shape",null))&&void 0!==i?i:this._getSeriesStyle(t,"symbolType",this.series.getDefaultShapeType())},this.shapeColorCallback=(t,e)=>this._getSeriesStyle(t,["fill","stroke"]),this.shapeStrokeCallback=(t,e)=>this._getSeriesStyle(t,["stroke","fill"]),this.dimensionTooltipTitleCallback=(t,e)=>this._getDimensionData(t),this.groupTooltipTitleCallback=(t,e)=>this._getSeriesFieldData(t),this.groupTooltipKeyCallback=(t,e)=>{const{seriesFields:i}=this._seriesCacheInfo;let s=this._seriesCacheInfo.dimensionFields;return i[0]&&(s=s.filter((t=>t!==i[0]))),s.map((e=>null==t?void 0:t[e])).join("-")},this.series=t,this.updateTooltipSpec()}updateTooltipSpec(){var t;const e=null===(t=this.series.getSpec())||void 0===t?void 0:t.tooltip;this.spec=e,this._seriesCacheInfo=this._getSeriesCacheInfo()}getDefaultTooltipPattern(t,e){switch(t){case"mark":return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{seriesId:this.series.id,key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"group":return{visible:!0,activeType:t,title:{key:void 0,value:this.groupTooltipTitleCallback,hasShape:!1},content:[{seriesId:this.series.id,key:this.groupTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"dimension":if(e){const i={key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},s=[];return e.forEach((({data:t})=>t.forEach((({series:t})=>{s.push({seriesId:t.id,key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1})})))),{visible:!0,activeType:t,title:i,content:s}}}return null}}const $T={min:t=>t.length?ja(t.map((t=>1*t))):0,max:t=>t.length?Ya(t.map((t=>1*t))):0,"array-min":t=>t.length?ja(t.map((t=>1*t))):0,"array-max":t=>t.length?Ya(t.map((t=>1*t))):0,values:t=>{const e={},i=[];for(const s of t)e[s]||(i.push(s),e[s]=1);return i}},XT=(t,e)=>{var i,s;let n=e.fields;if(ys(n)&&(n=n()),!(null==n?void 0:n.length)||!(null==t?void 0:t.length))return{};n=IT([],n);const r="parser"===e.target?"parserData":"latestData",a=t[0][r]?t[0][r]:t||[],o=null===(s=(i=t[0]).getFields)||void 0===s?void 0:s.call(i);return KT(a,n,o)},KT=(t,e,i)=>{const s={};let n=[],r=[];return e.forEach((e=>{const a=e.key;s[a]={};const o=null==i?void 0:i[a],l=e.operations,h=l.some((t=>"min"===t||"max"===t||"allValid"===t));let d=!0;n.length=0,t&&t.forEach((t=>{t&&n.push(t[a])}));const c=n.length;if(h){r.length=0,n.forEach(((t,e)=>{Zo(t)&&r.push(t)}));const t=n;n=r,r=t,d=n.length===c}else n=l.some((t=>"array-min"===t||"array-max"===t))?n.reduce(((t,e)=>(e&&e.forEach((e=>{Zo(e)&&t.push(e)})),t)),[]):n.filter((t=>void 0!==t));e.filter&&(n=n.filter(e.filter)),l.forEach((t=>{if(e.customize)s[a][t]=e.customize;else{if(o&&o.lockStatisticsByDomain&&!D(o.domain)){if("values"===t)return void(s[a][t]=o.domain.slice())}else if("allValid"===t)return;s[a][t]=$T[t](n),"array-max"===t&&(s[a].max=s[a][t]),"array-min"===t&&(s[a].min=s[a][t])}})),h&&(s[a].allValid=d)})),s},qT=(t,e)=>{const{config:i}=e;if(!i)return t;const{invalidType:s,checkField:n}=i();return"zero"!==s||n&&n.length&&t.forEach((t=>{n.forEach((e=>{Zo(t[e])||(t[e]=0)}))})),t};class ZT extends px{_compileProduct(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.latestData;D(e)||M(this.getProduct())||this._initProduct([])}generateProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.name}}const JT=`${sh}_HIERARCHY_DEPTH`,QT=`${sh}_HIERARCHY_ROOT`,tL=`${sh}_HIERARCHY_ROOT_INDEX`;function eL(){return{keyMap:new Map,needDefaultSeriesField:!this._seriesField,defaultSeriesField:this._seriesField?null:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey)}}function iL(t,e,i){t&&(i.needDefaultSeriesField&&(t[bT]=i.defaultSeriesField),t[vT]=e,t[yT]=i.getKey(t,e,i))}function sL(){return{keyMap:new Map,needDefaultSeriesField:!0,defaultSeriesField:this.getSeriesKeys()[0],getKey:this.generateDefaultDataKey(this._spec.dataKey),categoryField:this.getCategoryField()}}function nL(t,e,i,s=0,n,r){void 0===r&&(r=e),iL(t,e,i),t[JT]=s,t[QT]=n||t[i.categoryField],t[tL]=r,t.children&&t.children.length&&t.children.forEach(((e,s)=>nL(e,s,i,t[JT]+1,t[QT],r)))}const rL={label:{name:"label",type:"text"}},aL=`${sh}_rect_x`,oL=`${sh}_rect_x1`,lL=`${sh}_rect_y`,hL=`${sh}_rect_y1`,dL={data:!0},cL={invalidType:!0,animation:!0,animationAppear:!0,animationEnter:!0,animationUpdate:!0,animationExit:!0,animationNormal:!0},uL={type:"fadeIn"};function pL(t,e){switch(e){case"grow":return(t=>({type:"horizontal"===t.direction?"growPointsXIn":"growPointsYIn",options:{orient:"horizontal"===t.direction?"positive":"negative"}}))(t);case"fadeIn":return uL;default:return(t=>({type:"clipIn",options:{clipDimension:"horizontal"===t.direction?"y":"x"}}))(t)}}const gL=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!1),r=null!==(s=t.getGraphicAttribute("clipRange",!1))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:0,clipRangeByDimension:e.clipDimension},to:{clipRange:r,clipRangeByDimension:n}}:{from:{clipRange:0},to:{clipRange:r}}},mL=(t,e,i)=>{var s;const n=t.getGraphicAttribute("clipRangeByDimension",!0),r=null!==(s=t.getGraphicAttribute("clipRange",!0))&&void 0!==s?s:1;return e&&e.clipDimension?{from:{clipRange:r,clipRangeByDimension:e.clipDimension},to:{clipRange:0,clipRangeByDimension:n}}:{from:{clipRange:r},to:{clipRange:0}}},_L=(t,e,i)=>{var s,n,r,a;const o=null!==(s=t.getFinalAnimationAttributes())&&void 0!==s?s:{};return{from:{opacity:0,fillOpacity:0,strokeOpacity:0},to:{opacity:null!==(n=o.opacity)&&void 0!==n?n:1,fillOpacity:null!==(r=o.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(a=o.strokeOpacity)&&void 0!==a?a:1}}},fL=(t,e,i)=>{var s,n,r;return{from:{opacity:null!==(s=t.getGraphicAttribute("opacity",!0))&&void 0!==s?s:1,fillOpacity:null!==(n=t.getGraphicAttribute("fillOpacity",!0))&&void 0!==n?n:1,strokeOpacity:null!==(r=t.getGraphicAttribute("strokeOpacity",!0))&&void 0!==r?r:1},to:{opacity:0,fillOpacity:0,strokeOpacity:0}}},vL=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{from:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0},to:{x:e,x1:i,width:s}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{from:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0},to:{y:e,y1:i,height:s}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width"),n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height"),o={};return M(s)?(o.x=e+s/2,o.width=0,o.x1=void 0):(o.x=(e+i)/2,o.x1=(e+i)/2,o.width=void 0),M(a)?(o.y=n+a/2,o.height=0,o.y1=void 0):(o.y=(n+r)/2,o.y1=(n+r)/2,o.height=void 0),{from:o,to:{x:e,y:n,x1:i,y1:r,width:s,height:a}}}}},yL=(t,e,i)=>{switch(null==e?void 0:e.direction){case"x":{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("x1"),s=t.getFinalAnimationAttribute("width");return{to:M(s)?{x:e+s/2,x1:void 0,width:0}:{x:(e+i)/2,x1:(e+i)/2,width:void 0}}}case"y":{const e=t.getFinalAnimationAttribute("y"),i=t.getFinalAnimationAttribute("y1"),s=t.getFinalAnimationAttribute("height");return{to:M(s)?{y:e+s/2,y1:void 0,height:0}:{y:(e+i)/2,y1:(e+i)/2,height:void 0}}}default:{const e=t.getFinalAnimationAttribute("x"),i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("width"),a=t.getFinalAnimationAttribute("height"),o={};return M(r)?(o.x=e+r/2,o.width=0,o.x1=void 0):(o.x=(e+s)/2,o.x1=(e+s)/2,o.width=void 0),M(a)?(o.y=i+a/2,o.height=0,o.y1=void 0):(o.y=(i+n)/2,o.y1=(i+n)/2,o.height=void 0),{to:o}}}},bL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x"),r=t.getFinalAnimationAttribute("x1"),a=t.getFinalAnimationAttribute("width");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=o):o=i.width:o=h(null==e?void 0:e.overall)?null==e?void 0:e.overall:0,{from:{x:o,x1:D(r)?void 0:o,width:D(a)?void 0:0},to:{x:n,x1:r,width:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{x:t,x1:D(s)?void 0:t,width:D(n)?void 0:0},to:{x:i,x1:s,width:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{x:r,x1:D(s)?void 0:r,width:D(n)?void 0:0},to:{x:i,x1:s,width:n}}}(t,e)},xL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("x1"),r=t.getFinalAnimationAttribute("width");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=a):a=i.width:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{x:a,x1:D(n)?void 0:a,width:D(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("x"),s=t.getFinalAnimationAttribute("x1"),n=t.getFinalAnimationAttribute("width");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{x:t,x1:D(s)?void 0:t,width:D(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{x:r,x1:D(s)?void 0:r,width:D(n)?void 0:0}}}(t,e)},SL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y"),r=t.getFinalAnimationAttribute("y1"),a=t.getFinalAnimationAttribute("height");let o;return e&&"negative"===e.orient?h(e.overall)?o=e.overall:i.group?(o=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=o):o=i.height:o=h(null==e?void 0:e.overall)?e.overall:0,{from:{y:o,y1:D(r)?void 0:o,height:D(a)?void 0:0},to:{y:n,y1:r,height:a}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{from:{y:t,y1:D(s)?void 0:t,height:D(n)?void 0:0},to:{y:i,y1:s,height:n}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{from:{y:r,y1:D(s)?void 0:r,height:D(n)?void 0:0},to:{y:i,y1:s,height:n}}}(t,e)},ML=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?function(t,e,i){var s;const n=t.getFinalAnimationAttribute("y1"),r=t.getFinalAnimationAttribute("height");let a;return e&&"negative"===e.orient?h(e.overall)?a=e.overall:i.group?(a=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=a):a=i.height:a=h(null==e?void 0:e.overall)?e.overall:0,{to:{y:a,y1:D(n)?void 0:a,height:D(r)?void 0:0}}}(t,e,i):function(t,e){const i=t.getFinalAnimationAttribute("y"),s=t.getFinalAnimationAttribute("y1"),n=t.getFinalAnimationAttribute("height");if(e&&"negative"===e.orient){const t=M(n)?Math.max(i,i+n):Math.max(i,s);return{to:{y:t,y1:D(s)?void 0:t,height:D(n)?void 0:0}}}const r=M(n)?Math.min(i,i+n):Math.min(i,s);return{to:{y:r,y1:D(s)?void 0:r,height:D(n)?void 0:0}}}(t,e)},kL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes();if(e&&"anticlockwise"===e.orient){const t=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t,endAngle:t},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}}const s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:s,endAngle:s},to:{startAngle:null==i?void 0:i.startAngle,endAngle:null==i?void 0:i.endAngle}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:null==i?void 0:i.endAngle},to:{startAngle:null==i?void 0:i.startAngle}}:{from:{endAngle:null==i?void 0:i.startAngle},to:{endAngle:null==i?void 0:i.endAngle}}})(t,e)},AL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{if(e&&"anticlockwise"===e.orient){const i=h(e.overall)?e.overall:2*Math.PI;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}}const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{startAngle:t.getGraphicAttribute("startAngle",!0),endAngle:t.getGraphicAttribute("endAngle",!0)},to:{startAngle:i,endAngle:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"anticlockwise"===e.orient?{from:{startAngle:t.getGraphicAttribute("startAngle",!0)},to:{startAngle:null==i?void 0:i.endAngle}}:{from:{endAngle:t.getGraphicAttribute("endAngle",!0)},to:{endAngle:null==i?void 0:i.startAngle}}})(t,e)},wL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=t.getFinalAnimationAttributes(),s=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:s,outerRadius:s},to:{innerRadius:null==i?void 0:i.innerRadius,outerRadius:null==i?void 0:i.outerRadius}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:null==i?void 0:i.outerRadius},to:{innerRadius:null==i?void 0:i.innerRadius}}:{from:{outerRadius:null==i?void 0:i.innerRadius},to:{outerRadius:null==i?void 0:i.outerRadius}}})(t,e)},TL=(t,e,i)=>{var s;return!1!==(null!==(s=null==e?void 0:e.overall)&&void 0!==s&&s)?((t,e)=>{const i=h(null==e?void 0:e.overall)?e.overall:0;return{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0),outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{innerRadius:i,outerRadius:i}}})(t,e):((t,e)=>{const i=t.getFinalAnimationAttributes();return e&&"inside"===e.orient?{from:{innerRadius:t.getGraphicAttribute("innerRadius",!0)},to:{innerRadius:null==i?void 0:i.outerRadius}}:{from:{outerRadius:t.getGraphicAttribute("outerRadius",!0)},to:{outerRadius:null==i?void 0:i.innerRadius}}})(t,e)},LL=(t,e,i)=>{const s=t.getGraphicAttribute("points",!1),n={x:0,y:0};return s.forEach((t=>{n.x+=t.x,n.y+=t.y})),n.x/=s.length,n.y/=s.length,e&&e.center&&(qo(e.center.x)&&(n.x=e.center.x),qo(e.center.y)&&(n.y=e.center.y)),"area"===t.mark.markType&&(n.x1=n.x,n.y1=n.y),s.map((t=>Object.assign({},t,n)))},CL=(t,e,i)=>({from:{points:LL(t,e)},to:{points:t.getGraphicAttribute("points",!1)}}),EL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:LL(t,e)}}),DL=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.width;return i.group&&(e=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),i.groupWidth=e),Object.assign(Object.assign({},t),{x:e,y:t.y,x1:e,y1:t.y1,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:0,y:t.y,x1:0,y1:t.y1,defined:!1!==t.defined})})),PL=(t,e,i)=>({from:{points:DL(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),OL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:DL(t,e,i)}}),RL=(t,e,i)=>t.getGraphicAttribute("points",!1).map((t=>{var s;if(e&&"negative"===e.orient){let e=i.height;return i.group&&(e=null!==(s=i.groupHeight)&&void 0!==s?s:i.group.getBounds().height(),i.groupHeight=e),Object.assign(Object.assign({},t),{x:t.x,y:e,x1:t.x1,y1:e,defined:!1!==t.defined})}return Object.assign(Object.assign({},t),{x:t.x,y:0,x1:t.x1,y1:0,defined:!1!==t.defined})})),IL=(t,e,i)=>({from:{points:RL(t,e,i)},to:{points:t.getGraphicAttribute("points",!1)}}),BL=(t,e,i)=>({from:{points:t.getGraphicAttribute("points",!0)},to:{points:RL(t,e,i)}}),FL=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l,excludeChannels:h=[]}=null!=e?e:{};let d=0,c=0;"negative"===a&&(i.group?(d=null!==(s=i.groupWidth)&&void 0!==s?s:i.group.getBounds().width(),c=null!==(n=i.groupHeight)&&void 0!==n?n:i.group.getBounds().height(),i.groupWidth=d,i.groupHeight=c):(d=i.width,c=i.height)),d+=r,c+=r;const u=ys(l)?l.call(null,t.getDatum(),t,i):l,p=u&&qo(u.x)?u.x:d,g=u&&qo(u.y)?u.y:c,m=h.includes("x")?t.getGraphicAttribute("x"):t.getFinalAnimationAttribute("x"),_=h.includes("y")?t.getGraphicAttribute("y"):t.getFinalAnimationAttribute("y");switch(o){case"x":return{from:{x:p},to:{x:m}};case"y":return{from:{y:g},to:{y:_}};default:return{from:{x:p,y:g},to:{x:m,y:_}}}},YL=(t,e,i)=>{var s,n;const{offset:r=0,orient:a,direction:o,point:l}=null!=e?e:{},h=i.group?i.group.getBounds():null,d=null!==(s=null==h?void 0:h.width())&&void 0!==s?s:i.width,c=null!==(n=null==h?void 0:h.height())&&void 0!==n?n:i.height,u=("negative"===a?d:0)+r,p=("negative"===a?c:0)+r,g=ys(l)?l.call(null,t.getDatum(),t,i):l,m=g&&qo(g.x)?g.x:u,_=g&&qo(g.y)?g.y:p;switch(o){case"x":return{from:{x:t.getGraphicAttribute("x",!0)},to:{x:m}};case"y":return{from:{y:t.getGraphicAttribute("y",!0)},to:{y:_}};default:return{from:{x:t.getGraphicAttribute("x",!0),y:t.getGraphicAttribute("y",!0)},to:{x:m,y:_}}}},jL=(t,e,i)=>{var s,n,r,a;const o=t.getFinalAnimationAttributes();switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:0},to:{scaleX:null!==(s=null==o?void 0:o.scaleX)&&void 0!==s?s:1}};case"y":return{from:{scaleY:0},to:{scaleY:null!==(n=null==o?void 0:o.scaleY)&&void 0!==n?n:1}};default:return{from:{scaleX:0,scaleY:0},to:{scaleX:null!==(r=null==o?void 0:o.scaleX)&&void 0!==r?r:1,scaleY:null!==(a=null==o?void 0:o.scaleY)&&void 0!==a?a:1}}}},HL=(t,e,i)=>{var s,n,r,a;switch(null==e?void 0:e.direction){case"x":return{from:{scaleX:null!==(s=t.getGraphicAttribute("scaleX",!0))&&void 0!==s?s:1},to:{scaleX:0}};case"y":return{from:{scaleY:null!==(n=t.getGraphicAttribute("scaleY",!0))&&void 0!==n?n:1},to:{scaleY:0}};default:return{from:{scaleX:null!==(r=t.getGraphicAttribute("scaleX",!0))&&void 0!==r?r:1,scaleY:null!==(a=t.getGraphicAttribute("scaleY",!0))&&void 0!==a?a:1},to:{scaleX:0,scaleY:0}}}},zL={symbol:["_mo_hide_","visible"]},NL=(t,e,i)=>{const s=Object.assign({},t.getPrevGraphicAttributes()),n=Object.assign({},t.getNextGraphicAttributes());let r;e&&Ba(e.excludeChannels).forEach((t=>{delete s[t],delete n[t]})),t.mark&&t.mark.markType&&(r=zL[t.mark.markType])&&r.forEach((t=>{delete s[t],delete n[t]})),Object.keys(n).forEach((t=>{Im(s[t],n[t])&&(delete s[t],delete n[t])}));const a=t.getFinalGraphicAttributes();return Object.keys(s).forEach((t=>{D(n[t])&&(D(a[t])||Im(s[t],a[t])?delete s[t]:n[t]=a[t])})),{from:s,to:n}},VL=(t,e,i)=>{var s;const n=null!==(s=t.getFinalAnimationAttribute("angle"))&&void 0!==s?s:0;let r=0;return r=hd(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:qo(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:r},to:{angle:n}}},WL=(t,e,i)=>{var s;const n=null!==(s=t.getGraphicAttribute("angle",!0))&&void 0!==s?s:0;let r=0;return r=hd(n/(2*Math.PI),0)?Math.round(n/(2*Math.PI))*Math.PI*2:qo(null==e?void 0:e.angle)?e.angle:"anticlockwise"===(null==e?void 0:e.orient)?Math.ceil(n/(2*Math.PI))*Math.PI*2:Math.floor(n/(2*Math.PI))*Math.PI*2,{from:{angle:n},to:{angle:r}}},GL=()=>{_c.registerAnimationType("clipIn",gL)},UL=()=>{_c.registerAnimationType("clipOut",mL)},$L=()=>{_c.registerAnimationType("fadeIn",_L)},XL=()=>{_c.registerAnimationType("fadeOut",fL)},KL=()=>{_c.registerAnimationType("growCenterIn",vL)},qL=()=>{_c.registerAnimationType("growCenterOut",yL)},ZL=()=>{_c.registerAnimationType("growHeightIn",SL)},JL=()=>{_c.registerAnimationType("growHeightOut",ML)},QL=()=>{_c.registerAnimationType("growWidthIn",bL)},tC=()=>{_c.registerAnimationType("growWidthOut",xL)},eC=()=>{_c.registerAnimationType("growPointsIn",CL)},iC=()=>{_c.registerAnimationType("growPointsOut",EL)},sC=()=>{_c.registerAnimationType("growPointsXIn",PL)},nC=()=>{_c.registerAnimationType("growPointsXOut",OL)},rC=()=>{_c.registerAnimationType("growPointsYIn",IL)},aC=()=>{_c.registerAnimationType("growPointsYOut",BL)},oC=()=>{_c.registerAnimationType("growAngleIn",kL)},lC=()=>{_c.registerAnimationType("growAngleOut",AL)},hC=()=>{_c.registerAnimationType("growRadiusIn",wL)},dC=()=>{_c.registerAnimationType("growRadiusOut",TL)},cC=()=>{_c.registerAnimationType("moveIn",FL)},uC=()=>{_c.registerAnimationType("moveOut",YL)},pC=()=>{_c.registerAnimationType("scaleIn",jL)},gC=()=>{_c.registerAnimationType("scaleOut",HL)},mC=()=>{_c.registerAnimationType("rotateIn",VL)},_C=()=>{_c.registerAnimationType("rotateOut",WL)},fC=()=>{_c.registerAnimationType("update",NL)},vC={appear:{duration:1e3,easing:"cubicOut"},update:{type:"update",duration:300,easing:"linear"},enter:{duration:300,easing:"linear"},exit:{duration:300,easing:"linear"},disappear:{duration:500,easing:"cubicIn"},state:{duration:300,easing:"linear"}},yC={appear:{type:"scaleIn"},enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:{type:"scaleOut"}},bC={appear:{type:"fadeIn"},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}},xC=()=>{$l.registerAnimation("scaleInOut",(()=>yC))},SC=()=>{$l.registerAnimation("fadeInOut",(()=>bC))},MC=(t,e)=>({appear:pL(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},update:[{type:"update",options:{excludeChannels:["points","defined","segments"]}},{channel:["points","segments"],custom:_A,duration:vC.update.duration,easing:vC.update.easing,customParameters:{clipRangeByDimension:"horizontal"===t.direction?"y":"x"}}],disappear:{type:"clipOut"}}),kC=()=>{$l.registerAnimation("line",MC)},AC=()=>{n_.useRegisters([ZL,JL,QL,tC,KL,qL])},wC=()=>{n_.useRegisters([hC,dC,oC,lC])},TC=()=>{n_.useRegisters([eC,iC,sC,nC,rC,aC,GL,UL])},LC=()=>{n_.useRegisters([eC,iC])},CC=[...Object.keys(vC),"normal"];function EC(t={},e,i){const s={};for(let n=0;n{t.controlOptions={stopWhenStateChange:!0}})),a?(l=y(a)?a.map(((t,e)=>{var s;let n=t;return IC(n)&&delete n.type,n.oneByOne&&(n=PC(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:OC,null==i?void 0:i.dataCount)),n})):o.map(((t,e)=>{var s;let n=Tl({},o[e],a);return IC(n)&&delete n.type,n.oneByOne&&(n=PC(n,null!==(s=null==i?void 0:i.dataIndex)&&void 0!==s?s:OC,null==i?void 0:i.dataCount)),n})),s[r]=l):s[r]=o}return s}function DC(t,e,i){var s,n,r,a,o,l;const h={};return M(e.animationAppear)&&(h.appear=null!==(s=e.animationAppear[t])&&void 0!==s?s:e.animationAppear),M(e.animationDisappear)&&(h.disappear=null!==(n=e.animationDisappear[t])&&void 0!==n?n:e.animationDisappear),M(e.animationEnter)&&(h.enter=null!==(r=e.animationEnter[t])&&void 0!==r?r:e.animationEnter),M(e.animationExit)&&(h.exit=null!==(a=e.animationExit[t])&&void 0!==a?a:e.animationExit),M(e.animationUpdate)&&(h.update=null!==(o=e.animationUpdate[t])&&void 0!==o?o:e.animationUpdate),M(e.animationState)&&(h.state=null!==(l=e.animationState[t])&&void 0!==l?l:e.animationState),e.animationNormal&&e.animationNormal[t]&&(h.normal=e.animationNormal[t]),function(t,e){return t?(BC(t=k(t),(t=>{var i;return ys(t)&&(null===(i=t.prototype)||void 0===i?void 0:i.constructor)!==t?(...i)=>t(...i,e):t})),t):t}(h,i)}function PC(t,e,i){const{oneByOne:s,duration:n,delay:r,delayAfter:a}=t;return t.delay=(t,i,a)=>{const o=e(t,a),l=ys(n)?n(t,i,a):qo(n)?n:0,h=ys(r)?r(t,i,a):qo(r)?r:0;let d=ys(s)?s(t,i,a):s;return!1===d?h:(d=!0===d?0:d,h+o*(l+d))},t.delayAfter=(t,r,o)=>{const l=e(t,o),h=ys(n)?n(t,r,o):qo(n)?n:0,d=ys(a)?a(t,r,o):qo(a)?a:0;let c=ys(s)?s(t,r,o):s;return!1===c?d:(c=!0===c?0:c,d+((i?i():r.mark.elements.length)-l)*(h+c))},delete t.oneByOne,t}function OC(t,e){var i,s;return null!==(i=null==t?void 0:t[vT])&&void 0!==i?i:null===(s=null==e?void 0:e.VGRAMMAR_ANIMATION_PARAMETERS)||void 0===s?void 0:s.elementIndex}function RC(t,e){var i,s,n,r,a;if(!1===t.animation)return!1;if(!1===(null===(i=t.morph)||void 0===i?void 0:i.enable))return!1;const o=!1!==(null!==(n=null===(s=t.animationAppear)||void 0===s?void 0:s[e])&&void 0!==n?n:t.animationAppear),l=!1!==(null!==(a=null===(r=t.animationUpdate)||void 0===r?void 0:r[e])&&void 0!==a?a:t.animationUpdate);return!(!o||!l)}function IC(t){return!function(t){return M(t.timeSlices)}(t)&&M(t.channel)}function BC(t,e){if(y(t))t.forEach(((i,s)=>{t[s]=e(t[s],s),BC(t[s],e)}));else if(vs(t))for(const i in t)t[i]=e(t[i],i),BC(t[i],e)}function FC(t){var e,i,s,n;const r=t.getSpec();if(!1===r.animation)return!1;if(!M(t.getRegion().animate))return!1;let a=null!==(e=r.animationThreshold)&&void 0!==e?e:Number.MAX_SAFE_INTEGER;return null===(i=t.getMarks())||void 0===i||i.forEach((t=>{const e=t.getProgressiveConfig();e&&(e.large&&e.largeThreshold&&(a=Math.min(a,e.largeThreshold)),e.progressiveThreshold&&(a=Math.min(a,e.progressiveThreshold)))})),!((null===(n=null===(s=t.getRawData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)>=a)}class YC extends jy{constructor(){super(...arguments),this.markLabelSpec={}}getLabelSpec(t){return this.markLabelSpec[t]}setLabelSpec(t,e){this.markLabelSpec[t]=Ba(e)}addLabelSpec(t,e,i=!1){this.markLabelSpec[t]||(this.markLabelSpec[t]=[]),i?this.markLabelSpec[t].unshift(e):this.markLabelSpec[t].push(e)}getTheme(t,e){var i,s,n;const r=vl(t),a=null===(i=this._option)||void 0===i?void 0:i.getTheme(),{markByName:o,mark:l}=a,h=this._option.type,d=$l.getSeriesMarkMap(h)?function(t,e,i,s){const n=$l.getSeriesMarkMap(e);if(!n)return t;const r={};return Object.values(n).forEach((({type:e,name:n})=>{r[n]=Tl({},null==i?void 0:i[Ba(e)[0]],null==s?void 0:s[n],null==t?void 0:t[n])})),Object.assign(Object.assign({},t),r)}(Ud(a,`series.${h}`),h,l,o):{},c=Ud(a,`series.${h}_${r}`);return Tl({},d,c,(null!==(n=null!==(s=this.stack)&&void 0!==s?s:null==c?void 0:c.stack)&&void 0!==n?n:null==d?void 0:d.stack)?Ud(a,`series.${h}_stack`):void 0)}transformSpec(t,e,i){this._transformStack(t);const s=super.transformSpec(t,e,i);return this._transformLabelSpec(s.spec),Object.assign(Object.assign({},s),{markLabelSpec:this.markLabelSpec,stack:this.stack})}_transformLabelSpec(t){}_transformStack(t){v(t.stack)&&(this.stack=t.stack),v(t.percent)&&(this.stack=t.percent||this.stack),D(this.stack)&&this._supportStack&&t.seriesField&&(this.stack=!0)}_addMarkLabelSpec(t,e,i="label",s="initLabelMarkStyle",n=!0,r){t&&Ba(t[i]).forEach((i=>{var a,o,l;if(i&&i.visible){const{animation:h=!0,animationUpdate:d=!0,animationEnter:c=!0,animationExit:u=!0}=i,{animationUpdate:p=!0,animationEnter:g=!0,animationExit:m=!0}=t,_=!!(null!==(l=null!==(o=null===(a=this._option)||void 0===a?void 0:a.animation)&&void 0!==o?o:t.animation)&&void 0!==l?l:i.animation)&&!!n;this.addLabelSpec(e,Object.assign(Object.assign({},i),{animation:!!_&&h,animationUpdate:!!(_&&p&&d)&&p,animationEnter:!!(_&&g&&c)&&g,animationExit:!!(_&&g&&u)&&m,getStyleHandler:t=>{var e;return null===(e=t[s])||void 0===e?void 0:e.bind(t)}}),r)}}))}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{outerRadius:s,innerRadius:n,direction:r}=t;return M(s)&&(i.outerRadius=s),M(n)&&(i.innerRadius=n),M(r)&&(i.direction=r),Object.keys(i).length>0?i:void 0}_mergeThemeToSpec(t,e){const i=this._theme;if(this._shouldMergeThemeToSpec()){const s=this._getDefaultSpecFromChart(e),n=t=>{const e=Tl({},i,s,t),n=i.label;return n&&vs(n)&&y(e.label)&&(e.label=e.label.map((t=>Tl({},n,t)))),e};return y(t)?{spec:t.map((t=>n(t))),theme:i}:{spec:n(t),theme:i}}return{spec:t,theme:i}}}class jC extends zy{getRegion(){return this._region}getLayoutStartPoint(){return this._region.getLayoutStartPoint()}getRootMark(){return this._rootMark}getSeriesMark(){return this._seriesMark}getRawData(){return this._rawData}getViewDataFilter(){return this._viewDataFilter}getViewData(){var t;return null===(t=this._data)||void 0===t?void 0:t.getDataView()}getViewDataProductId(){var t;return null===(t=this._data)||void 0===t?void 0:t.getProductId()}getViewDataStatistics(){return this._viewDataStatistics}getViewStackData(){return this._viewStackData}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getGroups(){return this._groups}getStack(){var t;return null===(t=this.getSpecInfo())||void 0===t?void 0:t.stack}getStackValue(){var t;return null!==(t=this._spec.stackValue)&&void 0!==t?t:`${sh}_series_${this.type}`}getPercent(){return this._spec.percent}getStackOffsetSilhouette(){return this._spec.stackOffsetSilhouette}get tooltipHelper(){return this._tooltipHelper||this.initTooltip(),this._tooltipHelper}getInvalidType(){return this._invalidType}setInvalidType(t){var e;this._invalidType=t,null===(e=this.getViewData())||void 0===e||e.reRunAllTransform()}getMarkAttributeContext(){return this._markAttributeContext}constructor(t,e){var i;super(t,e),this.specKey="series",this.type="series",this.layoutType="absolute",this.modelType="series",this.name=void 0,this.transformerConstructor=YC,this.coordinate="none",this._region=null,this._layoutStartPoint={x:0,y:0},this._layoutRect={width:null,height:null},this.getLayoutRect=()=>{var t,e;return{width:null!==(t=this._layoutRect.width)&&void 0!==t?t:this._region.getLayoutRect().width,height:null!==(e=this._layoutRect.height)&&void 0!==e?e:this._region.getLayoutRect().height}},this._rootMark=null,this._seriesMark=null,this._viewDataMap=new Map,this._viewDataFilter=null,this._data=null,this.layoutZIndex=Ey.SeriesGroup,this._invalidType="break",this._region=e.region,this._dataSet=e.dataSet,(null===(i=this._spec)||void 0===i?void 0:i.name)&&(this.name=this._spec.name)}created(){super.created(),this._buildMarkAttributeContext(),this.initData(),this.initGroups(),this.initStatisticalData(),this.event.emit(Hd.afterInitData,{model:this}),this.initRootMark(),this.initMark();const t=FC(this);this._initExtensionMark({hasAnimation:t}),this.initMarkStyle(),this.initMarkState(),t&&this.initAnimation(),this._option.disableTriggerEvent||this.initInteraction(),this.afterInitMark(),this.initEvent(),this.event.emit(Hd.afterInitEvent,{model:this})}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},seriesColor:t=>{var e;return D(t)&&(t=this.getSeriesKeys()[0]),null===(e=this._option.globalScale.getScale("color"))||void 0===e?void 0:e.scale(t)},getRegion:()=>this._region}}setAttrFromSpec(){super.setAttrFromSpec(),this.setSeriesField(this._spec.seriesField),M(this._spec.invalidType)&&(this._invalidType=this._spec.invalidType)}getInvalidCheckFields(){return[this.getStackValueField()]}initInvalidDataTransform(){var t,e;"zero"===this._invalidType&&(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Lp(this._rawData.dataSet,"invalidTravel",qT),null===(e=this._rawData)||void 0===e||e.transform({type:"invalidTravel",options:{config:()=>({invalidType:this._invalidType,checkField:this.getInvalidCheckFields()})}},!1))}initData(){var t,e,i,s;const n=null!==(t=this._spec.data)&&void 0!==t?t:this._option.getSeriesData(this._spec.dataId,this._spec.dataIndex);if(n&&(this._rawData=Yp(n,this._dataSet,this._option.sourceDataList,{onError:null===(e=this._option)||void 0===e?void 0:e.onError})),null===(s=null===(i=this._rawData)||void 0===i?void 0:i.target)||void 0===s||s.addListener("change",this.rawDataUpdate.bind(this)),this._addDataIndexAndKey(),this._rawData){this.getStack()&&(this._viewDataFilter=Fp(this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewDataFilter`}));const t=Fp(this.getStack()?this._viewDataFilter:this._rawData,this._dataSet,{name:`${this.type}_${this.id}_viewData`});this._data=new ZT(this._option,t),this.getStack()&&this._viewDataFilter.target.removeListener("change",t.reRunAllTransform)}this.initInvalidDataTransform()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups={fields:t})}initStatisticalData(){this._data&&this._statisticViewData()}getRawDataStatisticsByField(t,e){var i,s,n;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]||e&&(D(this._rawStatisticsCache[t].min)||D(this._rawStatisticsCache[t].max))||!e&&D(this._rawStatisticsCache[t].values))if(this._viewDataStatistics&&(!this._viewDataFilter||this._viewDataFilter.transformsArr.length<=1)&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t]))this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t];else if(this._rawData){const i=null===(s=this._rawData.getFields())||void 0===s?void 0:s[t];if(i&&i.lockStatisticsByDomain&&i.domain)this._rawStatisticsCache[t]={},e?(this._rawStatisticsCache[t].min=ja(i.domain),this._rawStatisticsCache[t].max=Ya(i.domain)):this._rawStatisticsCache[t].values=i.domain;else{const i=KT(this._rawData.latestData,[{key:t,operations:e?["min","max"]:["values"]}])[t];this._rawStatisticsCache[t]=E(null!==(n=this._rawStatisticsCache[t])&&void 0!==n?n:{},i)}}return this._rawStatisticsCache[t]}_statisticViewData(){Lp(this._dataSet,"dimensionStatistics",XT);const t=`${this.type}_${this.id}_viewDataStatic`;this._viewDataStatistics=new R(this._dataSet,{name:t}),this._viewDataStatistics.parse([this._data.getDataView()],{type:"dataview"}),this._viewDataStatistics.transform({type:"dimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&IT(t,[{key:this._seriesField,operations:["values"]}]),t},target:"latest"}},!1),this._data.getDataView().target.removeListener("change",this._viewDataStatistics.reRunAllTransform),this.getStack()&&this.createdStackData()}createStatisticalData(t,e,i){Lp(this._dataSet,"dimensionStatistics",XT);const s=new R(this._dataSet,{name:t});return s.parse([e],{type:"dataview"}),s.transform({type:"dimensionStatistics",options:{operations:["max","min","values"],fields:()=>{var t;const s=IT(this.getStatisticFields(),null!==(t=null==i?void 0:i(e.name))&&void 0!==t?t:[]);return this._seriesField&&IT(s,[{key:this._seriesField,operations:["values"]}]),s},target:"latest"}},!1),s}createdStackData(){const t=`${this.type}_${this.id}_viewStackData`;this._viewStackData=new R(this._dataSet,{name:t}),this._viewStackData.parse([this._viewDataFilter],{type:"dataview"}),this._viewStackData.transform({type:"stackSplit",options:{fields:this.getStackGroupFields()}},!1)}_noAnimationDataKey(t,e){return e}generateDefaultDataKey(t){var e;return D(t)?(t,e,i)=>{if(!1===this._spec.animation){const i=this._noAnimationDataKey(t,e);if(void 0!==i)return i}const{keyMap:s}=i,n=this._getSeriesDataKey(t);return void 0===s.get(n)?(s.set(n,0),n):(s.set(n,s.get(n)+1),`${n}_${s.get(n)}`)}:S(t)?e=>e[t]:y(t)&&t.every((t=>S(t)))?e=>t.map((t=>e[t])).join("-"):ys(t)?(e,i)=>t(e,i):(null===(e=this._option)||void 0===e||e.onError(`invalid dataKey: ${t}`),(t,e)=>{})}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Lp(this._rawData.dataSet,"addVChartProperty",WT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:eL.bind(this),call:iL}},!1))}updateRawData(t){this._rawData&&this._rawData.updateRawData(t)}rawDataUpdate(t){var e;null===(e=this._rawDataStatistics)||void 0===e||e.reRunAllTransform(),this._rawStatisticsCache=null,this.event.emit(Hd.rawDataUpdate,{model:this})}viewDataFilterOver(t){this.event.emit(Hd.viewDataFilterOver,{model:this})}viewDataUpdate(t){var e;this.event.emit(Hd.viewDataUpdate,{model:this}),null===(e=this._data)||void 0===e||e.updateData(),this._viewDataStatistics&&this._viewDataStatistics.reRunAllTransform()}viewDataStatisticsUpdate(t){this.event.emit(Hd.viewDataStatisticsUpdate,{model:this})}getDatumPositionValue(t,e){return!t||D(e)?null:t[e]}getDatumPositionValues(t,e){return!t||D(e)?[]:S(e)?[t[e]]:e.map((e=>t[e]))}setValueFieldToStack(){}setValueFieldToPercent(){}setValueFieldToStackOffsetSilhouette(){}initRootMark(){var t,e;this._rootMark=this._createMark({type:"group",name:`seriesGroup_${this.type}_${this.id}`},{parent:null===(e=(t=this._region).getGroupMark)||void 0===e?void 0:e.call(t),dataView:!1}),this._rootMark.setZIndex(this.layoutZIndex)}_getExtensionMarkNamePrefix(){return`${this.type}_${this.id}_extensionMark`}_initExtensionMark(t){var e;if(!this._spec.extensionMark)return;const i=this.getMarksWithoutRoot();t.depend=i,null===(e=this._spec.extensionMark)||void 0===e||e.forEach(((e,i)=>{this._createExtensionMark(e,null,this._getExtensionMarkNamePrefix(),i,t)}))}_createExtensionMark(t,e,i,s,n){var r;const a=this._createMark({type:t.type,name:M(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,markSpec:t,parent:e,dataView:!1,customShape:null==t?void 0:t.customShape,componentType:t.componentType,depend:n.depend,key:t.dataKey});if(a){if(M(t.id)&&a.setUserId(t.id),n.hasAnimation){const e=EC({},DC(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if("group"===t.type)i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}));else if(!(e||D(t.dataId)&&D(t.dataIndex))){const e=this._option.getSeriesData(t.dataId,t.dataIndex);e===this._rawData?a.setDataView(this.getViewData(),this.getViewDataProductId()):(a.setDataView(e),e.target.addListener("change",(()=>{a.getData().updateData()})))}}}_updateExtensionMarkSpec(){var t;null===(t=this._spec.extensionMark)||void 0===t||t.forEach(((t,e)=>{const i=this._marks.getMarkWithInfo({name:`${this._getExtensionMarkNamePrefix()}_${e}`});i&&(this.initMarkStyleWithSpec(i,t),i.updateStaticEncode(),i.updateLayoutState())}))}getStackData(){var t;return null===(t=this._viewStackData)||void 0===t?void 0:t.latestData}_parseSelectorOfInteraction(t,e){if(!e||!e.length)return[];const i=[];return t.markIds?e.filter((e=>{t.markIds.includes(e.getProductId())&&i.push(`#${e.getProductId()}`)})):t.markNames?e.forEach((e=>{t.markNames.includes(e.name)&&i.push(`#${e.getProductId()}`)})):e.forEach((t=>{i.push(`#${t.getProductId()}`)})),i}_parseDefaultInteractionConfig(t){if(!(null==t?void 0:t.length))return[];const e=(i=this._option.mode)===n["desktop-browser"]||i===n["desktop-miniApp"]?{hover:{enable:!0,trigger:"pointermove",triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"pointertap"}}:cl(i)||ul(i)?{hover:{enable:!0,trigger:["pointerdown","pointermove"],triggerOff:"view:pointerleave"},select:{enable:!0,trigger:"tap"}}:null;var i;let s=Object.assign({},null==e?void 0:e.hover),r=Object.assign({},null==e?void 0:e.select);const a=this._spec.hover;v(a)?s.enable=a:vs(a)&&(s.enable=!0,s=Tl(s,a));const o=this._spec.select;v(o)?r.enable=o:vs(o)&&(r.enable=!0,r=Tl(r,o));const l=[];if(s.enable){const e=this._parseSelectorOfInteraction(s,t);e.length&&l.push({seriesId:this.id,regionId:this._region.id,selector:e,type:"element-highlight",trigger:s.trigger,triggerOff:s.triggerOff,blurState:xy.STATE_HOVER_REVERSE,highlightState:xy.STATE_HOVER})}if(r.enable){const e=this._parseSelectorOfInteraction(r,t),i="multiple"===r.mode,s=M(r.triggerOff)?r.triggerOff:i?["empty"]:["empty",r.trigger];e.length&&l.push({type:"element-select",seriesId:this.id,regionId:this._region.id,selector:e,trigger:r.trigger,triggerOff:s,reverseState:xy.STATE_SELECTED_REVERSE,state:xy.STATE_SELECTED,isMultiple:i})}return l}_parseInteractionConfig(t){const e=this.getCompiler();if(!e)return;const{interactions:i}=this._spec,s=this._parseDefaultInteractionConfig(t);s&&s.length&&s.forEach((t=>{e.addInteraction(t)})),i&&i.length&&i.forEach((t=>{const i=this._parseSelectorOfInteraction(t,this.getMarks());i.length&&e.addInteraction(Object.assign(Object.assign({},t),{selector:i,seriesId:this.id,regionId:this._region.id}))}))}initInteraction(){const t=this.getMarksWithoutRoot();this._parseInteractionConfig(t)}initAnimation(){}initMarkState(){this.initSeriesStyleState()}initSeriesStyleState(){var t;const e=this._spec.seriesStyle;if(!e||!e.length)return;const i=null!==(t=this._seriesField)&&void 0!==t?t:bT;this.getMarksWithoutRoot().forEach((t=>{const s={},n={},r={};e.forEach((e=>{var i;const a=null===(i=e[t.name])||void 0===i?void 0:i.style;a&&(s[e.name]=!0,r[e.name]=r[e.name]||{},Object.keys(a).forEach((t=>{n[t]=!0,r[e.name][t]=a[t]})))})),t.state.addStateInfo({stateValue:xT,level:-1,filter:t=>Array.isArray(t)?0!==t.length&&!0===s[t[0][i]]:!0===s[t[i]]});const a={};Object.keys(n).forEach((e=>{a[e]=s=>{var n,a;let o;if(Array.isArray(s)){if(0===s.length)return;o=null===(n=r[s[0][i]])||void 0===n?void 0:n[e]}return o=null===(a=r[s[i]])||void 0===a?void 0:a[e],M(o)?o:t.getAttribute(e,s)}})),this.setMarkStyle(t,a,xT,Py.User_SeriesStyle)}))}afterInitMark(){this.event.emit(Hd.afterInitMark,{model:this}),this.setSeriesField(this._spec.seriesField),this.getMarks().forEach((t=>{var e,i;(null===(i=null===(e=t.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&t.setAttribute("stroke",this.getColorAttribute(),"normal",Py.Base_Series)}))}getMarksWithoutRoot(){return this.getMarks().filter((t=>!t.name.includes("seriesGroup")))}getMarksInType(t){return this._marks.getMarksInType(t)}getMarkInName(t){return this._marks.get(t)}getMarkInId(t){return this.getMarks().find((e=>e.id===t))}initEvent(){var t,e,i;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.target.addListener("change",this.viewDataUpdate.bind(this)),null===(i=this._viewDataStatistics)||void 0===i||i.target.addListener("change",this.viewDataStatisticsUpdate.bind(this))}_releaseEvent(){super._releaseEvent(),this.getCompiler().removeInteraction(this.id)}initTooltip(){this._tooltipHelper=new UT(this)}_compareExtensionMarksSpec(t,e,i){t.length!==e.length||e.some(((e,i)=>e.type!==t[i].type||e.id!==t[i].id))?i.reMake=!0:e.some(((e,i)=>e.visible!==t[i].visible))&&(i.reCompile=!0)}_compareLabelSpec(t,e,i){t.length!==e.length||e.some(((e,i)=>e.labelLayout!==t[i].labelLayout))?i.reMake=!0:!i.reCompile&&e.some(((e,i)=>!Im(e,t[i])))&&(i.reCompile=!0)}_compareSpec(t,e,i){const s=super._compareSpec(t,e),n=Object.keys(e||{}).sort();if(!Im(n,Object.keys(t||{}).sort()))return s.reMake=!0,s;const r=Object.assign(Object.assign(Object.assign(Object.assign({},dL),cL),i),{extensionMark:!0,label:!0,totalLabel:!0});return this._compareExtensionMarksSpec(Ba(t.extensionMark),Ba(e.extensionMark),s),!s.reMake&&this._compareLabelSpec(Ba(t.label),Ba(e.label),s),!s.reMake&&this._compareLabelSpec(Ba(t.totalLabel),Ba(e.totalLabel),s),s.reMake?s:(!s.reCompile&&this._marks.getMarks().some((i=>{var s,n;return r[i.name]=!0,(null===(s=e[i.name])||void 0===s?void 0:s.visible)!==(null===(n=t[i.name])||void 0===n?void 0:n.visible)}))&&(s.reCompile=!0),!s.reCompile&&n.some((i=>cL[i]&&!Im(t[i],e[i])))&&(s.reCompile=!0),n.some((i=>!r[i]&&!Im(t[i],e[i])))?(s.reMake=!0,s):s)}_updateSpecData(){!this._rawData||!this._spec.data||this._spec.data instanceof R||jp(this._rawData,this._spec.data,!0)}reInit(t){super.reInit(t);const e=this.getMarksWithoutRoot();e.forEach((t=>{this._spec[t.name]&&this.initMarkStyleWithSpec(t,this._spec[t.name])})),this.initMarkStyle(),e.forEach((t=>{t.updateStaticEncode(),t.updateLayoutState(!0)})),this._updateExtensionMarkSpec(),this._updateSpecData(),this._tooltipHelper&&this._tooltipHelper.updateTooltipSpec(),FC(this)&&this.initAnimation()}onEvaluateEnd(t){this._data.updateData()}onRender(t){}release(){var t,e,i;super.release(),this._viewDataMap.clear();const s=null===(e=null===(t=this._rawData)||void 0===t?void 0:t.transformsArr)||void 0===e?void 0:e.findIndex((t=>"addVChartProperty"===t.type));s>=0&&this._rawData.transformsArr.splice(s,1),null===(i=this._data)||void 0===i||i.release(),this._dataSet=this._data=this._rawData=this._rawDataStatistics=this._spec=this._region=this._viewDataStatistics=this._viewStackData=null}setLayoutStartPosition(t){qo(t.x)&&(this._layoutStartPoint.x=t.x),qo(t.y)&&(this._layoutStartPoint.y=t.y)}setLayoutRect({width:t,height:e},i){qo(t)&&(this._layoutRect.width=t),qo(e)&&(this._layoutRect.height=e)}getSeriesKeys(){var t,e;return this._seriesField?null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}getSeriesStyle(t){return e=>{var i,s;return null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0}}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:e,originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesInfoInField(t){var e,i;return this._getSeriesInfo(t,null!==(i=null===(e=this.getRawDataStatisticsByField(t))||void 0===e?void 0:e.values)&&void 0!==i?i:[])}getSeriesInfoList(){var t;return this._getSeriesInfo(null!==(t=this._seriesField)&&void 0!==t?t:bT,this.getSeriesKeys())}_getDefaultColorScale(){var t,e;const i=this.getDefaultColorDomain(),s=this._getDataScheme();return null===(e=(t=(new sx).domain(i)).range)||void 0===e?void 0:e.call(t,s)}_getDataScheme(){return xl(this.getColorScheme(),this.type)}getDefaultColorDomain(){var t,e;return this._seriesField?null===(e=null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesField])||void 0===e?void 0:e.values:[]}getColorAttribute(){var t,e;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(e=this._seriesField)&&void 0!==e?e:bT}}getDimensionField(){return[]}getMeasureField(){return[]}onMarkPositionUpdate(){this.onMarkTreePositionUpdate(this.getMarksWithoutRoot())}onMarkTreePositionUpdate(t){}_createMark(t,e={}){var i,s,n,r;const{key:a,groupKey:o,skipBeforeLayouted:l,themeSpec:h={},markSpec:d,dataView:c,dataProductId:u,parent:p,isSeriesMark:g,depend:m,progressive:_,support3d:f=this._spec.support3d||!!this._spec.zField,morph:y=!1,clip:b,customShape:x,stateSort:S,noSeparateStyle:k=!1}=e,A=super._createMark(t,{key:null!=a?a:this._getDataIdKey(),support3d:f,seriesId:this.id,attributeContext:this._markAttributeContext,componentType:e.componentType,noSeparateStyle:k});if(M(A)){this._marks.addMark(A,{name:t.name}),g&&(this._seriesMark=A),D(p)?null===(i=this._rootMark)||void 0===i||i.addMark(A):!1!==p&&p.addMark(A),D(c)?(A.setDataView(this.getViewData(),this.getViewDataProductId()),A.setSkipBeforeLayouted(!0)):!1!==c&&A.setDataView(c,u),v(l)&&A.setSkipBeforeLayouted(l),M(m)&&A.setDepend(...Ba(m));const a=this.getSpec()||{};A.setMorph(y),A.setMorphKey((null===(s=a.morph)||void 0===s?void 0:s.morphKey)||`${this.getSpecIndex()}_${this.getMarks().length}`),A.setMorphElementKey(null!==(r=null===(n=a.morph)||void 0===n?void 0:n.morphElementKey)&&void 0!==r?r:e.defaultMorphElementKey),D(_)||A.setProgressiveConfig(_),D(o)||A.setGroupKey(o),x&&A.setCustomizedShapeCallback(x),S&&A.setStateSortCallback(S),b&&A.setClip(b),this.initMarkStyleWithSpec(A,Tl({},h,d||a[A.name]))}return A}_getDataIdKey(){var t;return null!==(t=super._getDataIdKey())&&void 0!==t?t:yT}_getSeriesDataKey(t){let e="";if(!t)return e;const i=this.getDimensionField();e=i.map((e=>t[e])).join("_");const s=this.getSeriesField();return s&&!i.includes(s)&&(e+=`_${t[s]}`),e}addViewDataFilter(t){var e,i;null===(i=null!==(e=this._viewDataFilter)&&void 0!==e?e:this.getViewData())||void 0===i||i.transform(t,!1)}reFilterViewData(){var t,e;null===(e=null!==(t=this._viewDataFilter)&&void 0!==t?t:this.getViewData())||void 0===e||e.reRunAllTransform()}reTransformViewData(){var t,e;null===(e=null===(t=this._data)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}fillData(){var t;null===(t=this.getRawData())||void 0===t||t.reRunAllTransform()}compile(){this.compileData()}getDefaultShapeType(){return"circle"}getFieldAlias(t){var e;return t!==kT&&t!==wT&&t!==MT&&t!==AT||(t=this.getStackValueField()),null!==(e=FT(this.getRawData(),t))&&void 0!==e?e:t}_getInvalidConnectType(){return"zero"===this._invalidType?"zero":"link"===this._invalidType?"connect":"none"}_getInvalidDefined(t){const e=this.getInvalidCheckFields();return!e.length||e.every((e=>Zo(t[e])))}_getRelatedComponentSpecInfo(t){var e;const i=this.getSpecIndex(),s=null===(e=this._option.getSpecInfo().component[t])||void 0===e?void 0:e.filter((t=>t.seriesIndexes.includes(i)));return null!=s?s:[]}_forEachStackGroup(t,e){var i,s;(e=null!=e?e:null===(i=this._viewStackData)||void 0===i?void 0:i.latestData)&&((null===(s=e.values)||void 0===s?void 0:s.length)?t(e):e.nodes&&Object.values(e.nodes).forEach((e=>{this._forEachStackGroup(t,e)})))}isDatumInViewData(t){if(!t)return!1;const e=this.getViewData().latestData;return!!e&&(!!e.includes(t)||e.some((e=>Object.keys(t).every((i=>t[i]===e[i])))))}getSeriesFieldValue(t,e){var i;return t[null!==(i=null!=e?e:this.getSeriesField())&&void 0!==i?i:bT]}}function HC(t,e,i){const s=t.getScale(0),n="isInverse"in t&&t.isInverse();Jh(s.type)?i.sort(((t,i)=>(t[e]-i[e])*(n?-1:1))):i.sort(((t,i)=>(s.index(t[e])-s.index(i[e]))*(n?-1:1)))}function zC(t){return{dataIndex:e=>{var i,s;const n="horizontal"===t.direction?t.fieldY[0]:t.fieldX[0],r=null==e?void 0:e[n],a="horizontal"===t.direction?t.scaleY:t.scaleX;return(null!==(s=null===(i=null==a?void 0:a.domain)||void 0===i?void 0:i.call(a))&&void 0!==s?s:[]).indexOf(r)||0},dataCount:()=>{var e,i,s;const n="horizontal"===t.direction?t.scaleY:t.scaleX;return null!==(s=(null!==(i=null===(e=null==n?void 0:n.domain)||void 0===e?void 0:e.call(n))&&void 0!==i?i:[]).length)&&void 0!==s?s:0}}}jC.mark=rL,jC.transformerConstructor=YC;class NC extends jC{constructor(){super(...arguments),this.coordinate="cartesian",this._bandPosition=.5,this._scaleConfig={bandPosition:this._bandPosition},this._direction="vertical",this._sortDataByAxis=!1,this._getPositionXEncoder=()=>{var t;return null===(t=this._positionXEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionXEncoder=t=>{this._positionXEncoder=t.bind(this)},this._getPositionYEncoder=()=>{var t;return null===(t=this._positionYEncoder)||void 0===t?void 0:t.bind(this)},this._setPositionYEncoder=t=>{this._positionYEncoder=t.bind(this)}}_buildScaleConfig(){this._scaleConfig={bandPosition:this._bandPosition}}get fieldX(){return this._fieldX}setFieldX(t){this._fieldX=Ba(t)}get fieldY(){return this._fieldY}setFieldY(t){this._fieldY=Ba(t)}get fieldZ(){return this._fieldZ}setFieldZ(t){this._fieldZ=t&&Ba(t)}get fieldX2(){return this._fieldX2}setFieldX2(t){this._fieldX2=t}get fieldY2(){return this._fieldY2}setFieldY2(t){this._fieldY2=t}get direction(){return this._direction}get scaleX(){return this._scaleX}setScaleX(t){this._scaleX=t}get scaleY(){return this._scaleY}setScaleY(t){this._scaleY=t}get scaleZ(){return this._scaleZ}setScaleZ(t){this._scaleZ=t}getXAxisHelper(){return this._xAxisHelper}setXAxisHelper(t){this._xAxisHelper=t,this.onXAxisHelperUpdate()}getYAxisHelper(){return this._yAxisHelper}setYAxisHelper(t){this._yAxisHelper=t,this.onYAxisHelperUpdate()}getZAxisHelper(){return this._zAxisHelper}setZAxisHelper(t){this._zAxisHelper=t,this.onYAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}getStatisticFields(){const t=[];return[{axisHelper:this.getXAxisHelper(),fields:this._fieldX2?[...this._fieldX,this._fieldX2]:this._fieldX},{axisHelper:this.getYAxisHelper(),fields:this._fieldY2?[...this._fieldY,this._fieldY2]:this._fieldY},{axisHelper:this.getZAxisHelper(),fields:this._fieldZ}].forEach((e=>{e.axisHelper&&e.axisHelper.getScale&&e.fields&&e.fields.forEach((i=>{const s={key:i,operations:[]},n=e.axisHelper.getScale(0);Jh(n.type)?(s.operations=["max","min"],"log"===n.type&&(s.filter=t=>t>0)):s.operations=["values"],t.push(s)}))})),this.getStack()&&t.push({key:this.getStackValueField(),operations:["allValid"]}),t}getGroupFields(){return"vertical"===this.direction?this._fieldX:this._fieldY}getStackGroupFields(){return this.getGroupFields()}getStackValue(){var t,e;const i=null===(t="horizontal"===this.direction?this.getXAxisHelper():this.getYAxisHelper())||void 0===t?void 0:t.getAxisId();return null!==(e=this._spec.stackValue)&&void 0!==e?e:`${sh}_series_${this.type}_${i}`}getStackValueField(){return"horizontal"===this.direction?Ba(this._spec.xField)[0]:Ba(this._spec.yField)[0]}setValueFieldToStack(){"horizontal"===this.direction?(this.setFieldX(kT),this.setFieldX2(MT)):(this.setFieldY(kT),this.setFieldY2(MT))}setValueFieldToPercent(){"horizontal"===this.direction?(this.setFieldX(wT),this.setFieldX2(AT)):(this.setFieldY(wT),this.setFieldY2(AT))}setValueFieldToStackOffsetSilhouette(){"horizontal"===this.direction?(this.setFieldX(LT),this.setFieldX2(TT)):(this.setFieldY(LT),this.setFieldY2(TT))}onXAxisHelperUpdate(){this.onMarkPositionUpdate()}onYAxisHelperUpdate(){this.onMarkPositionUpdate()}onZAxisHelperUpdate(){this.onMarkPositionUpdate()}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setFieldX(this._spec.xField),this.setFieldY(this._spec.yField),this.setFieldZ(this._spec.zField),this._specXField=Ba(this._spec.xField),this._specYField=Ba(this._spec.yField),M(this._spec.direction)&&(this._direction=this._spec.direction),this.setFieldX2(null===(t=this._spec)||void 0===t?void 0:t.x2Field),this.setFieldY2(null===(e=this._spec)||void 0===e?void 0:e.y2Field),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent(),this.getStackOffsetSilhouette()&&this.setValueFieldToStackOffsetSilhouette(),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}dataToPosition(t,e){return t?e&&!this.isDatumInViewData(t)?null:{x:this.dataToPositionX(t),y:this.dataToPositionY(t)}:null}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToX=this.valueToPositionX.bind(this),this._markAttributeContext.valueToY=this.valueToPositionY.bind(this),this._markAttributeContext.xBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getXAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.yBandwidth=(t=0)=>{var e,i,s;return null!==(s=null===(i=(e=this.getYAxisHelper()).getBandwidth)||void 0===i?void 0:i.call(e,t))&&void 0!==s?s:0},this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this)}valueToPosition(t,e){return{x:this.valueToPositionX(t),y:this.valueToPositionY(e)}}_axisPosition(t,e,i){return this._scaleConfig.datum=i,t.isContinuous?t.valueToPosition(e,this._scaleConfig):t.dataToPosition(Ba(e),this._scaleConfig)}valueToPositionX(t,e){return this._axisPosition(this._xAxisHelper,t,e)}valueToPositionY(t,e){return this._axisPosition(this._yAxisHelper,t,e)}_dataToPosition(t,e,i,s,n,r){const a=n();if(a)return a(t);if(!e)return r((t=>Number.NaN)),Number.NaN;const o=(e.getFields?e.getFields():i).slice(0,s);return o&&0!==o.length?(e.isContinuous?r((t=>(this._scaleConfig.datum=t,e.valueToPosition(this.getDatumPositionValue(t,o[0]),this._scaleConfig)))):r((t=>(this._scaleConfig.datum=t,e.dataToPosition(Ba(this.getDatumPositionValues(t,o)),this._scaleConfig)))),n()(t)):(r((t=>null)),null)}dataToPositionX(t){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,void 0,this._getPositionXEncoder,this._setPositionXEncoder)}dataToPositionY(t){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,void 0,this._getPositionYEncoder,this._setPositionYEncoder)}dataToPositionZ(t){if(!this._zAxisHelper)return Number.NaN;const{dataToPosition:e}=this._zAxisHelper;return e(this.getDatumPositionValues(t,this._fieldZ),{bandPosition:this._bandPosition})}dataToPositionX1(t){return this._xAxisHelper?this._fieldX2&&this._fieldX2 in t?this.valueToPositionX(this.getDatumPositionValues(t,this._fieldX2)):this.valueToPositionX(0):Number.NaN}dataToPositionY1(t){return this._yAxisHelper?this._fieldY2&&this._fieldY2 in t?this.valueToPositionY(this.getDatumPositionValues(t,this._fieldY2)):this.valueToPositionY(0):Number.NaN}positionToData(t){return t?{x:this.positionToDataX(t.x),y:this.positionToDataY(t.y)}:null}positionToDataX(t){return this._scaleX?this._scaleX.invert(t):null}positionToDataY(t){return this._scaleY?this._scaleY.invert(t):null}getRegionRectLeft(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[0]}getRegionRectRight(){if(!this._xAxisHelper)return Number.NaN;const{getScale:t}=this._xAxisHelper;return t(0).range()[1]}afterInitMark(){super.afterInitMark(),this.setFieldX(this._fieldX),this.setFieldY(this._fieldY),this._buildScaleConfig()}getDimensionField(){return"horizontal"===this._direction?this._specYField:this._specXField}getDimensionContinuousField(){return"horizontal"===this._direction?[this.fieldY[0],this.fieldY2]:[this.fieldX[0],this.fieldX2]}getMeasureField(){return"horizontal"===this._direction?this._specXField:this._specYField}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(Hd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e,i;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&(HC("horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,"horizontal"===this._direction?this._fieldY[0]:this._fieldX[0],this.getViewData().latestData),null===(i=this._data)||void 0===i||i.updateData(!0))}getInvalidCheckFields(){const t=[];return this._xAxisHelper&&this._xAxisHelper.isContinuous&&this._xAxisHelper.getAxisType()!==r.geoCoordinate&&(this._xAxisHelper.getFields?this._xAxisHelper.getFields():this._specXField).forEach((e=>{t.push(e)})),this._yAxisHelper&&this._yAxisHelper.isContinuous&&this._yAxisHelper.getAxisType()!==r.geoCoordinate&&(this._yAxisHelper.getFields?this._yAxisHelper.getFields():this._specYField).forEach((e=>{t.push(e)})),t}reInit(t){this._positionXEncoder&&(this._positionXEncoder=null),this._positionYEncoder&&(this._positionYEncoder=null),super.reInit(t)}}const VC="monotone",WC="linear",GC={point:{name:"point",type:"symbol"},line:{name:"line",type:"line"}};class UC{addSamplingCompile(){if(this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}addOverlapCompile(){var t;if(this._spec.markOverlap){const e=[];e.push({type:"markoverlap",direction:"horizontal"===this._direction&&"cartesian"===this.coordinate?2:1,delta:this._spec.pointDis,deltaMul:this._spec.pointDisMul,groupBy:this._seriesField}),null===(t=this._symbolMark)||void 0===t||t.getProduct().transform(e)}}reCompileSampling(){this._spec.sampling&&this.compile()}initLineMark(t,e){var i,s;return this._lineMark=this._createMark(GC.line,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:null==e||e,progressive:t,customShape:null===(i=this._spec.line)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.line)||void 0===s?void 0:s.stateSort}),this._lineMark}initLineMarkStyle(t,e){var i,s;const n=this._lineMark;if(n){if(this.setMarkStyle(n,{stroke:this.getColorAttribute()},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(n,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Py.Series),this.event.on(Hd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(n,"defined")})),"polar"===this.coordinate)this.setMarkStyle(n,{lineJoin:"bevel",curveType:WC,closePath:!0},"normal",Py.Series);else{const r=null!=e?e:null===(s=null===(i=this.getSpec().line)||void 0===i?void 0:i.style)||void 0===s?void 0:s.curveType,a=r===VC?"horizontal"===t?"monotoneY":"monotoneX":r;this.setMarkStyle(n,{curveType:a},"normal",Py.Built_In)}this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Py.Series)}return n}_getEventElement(t,e=!1){let i=[];return t.dimensionInfo.some((t=>(t.data.some((t=>t.series===this&&(i=t.datum,!0))),!i.length))),i}_dimensionTrigger(t){const e=this._getEventElement(t);switch(t.action){case"enter":this._symbolActiveMark.getDataView().parse(e),this._symbolActiveMark.getData().updateData(!1);break;case"leave":this._symbolActiveMark.getDataView().parse([]),this._symbolActiveMark.getData().updateData(!1)}}initSymbolMark(t,e){const i=this._spec.point||{};if(!1!==i.visible&&(this._symbolMark=this._createMark(GC.point,{morph:RC(this._spec,GC.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:t,isSeriesMark:!!e,customShape:i.customShape,stateSort:i.stateSort})),!0===this._spec.activePoint){const t=new R(this._option.dataSet,{name:`${sh}_series_${this.id}_active_point`});t.parse([]),this._symbolActiveMark=this._createMark({name:`active_point_${this.id}`,type:"symbol"},{morph:!1,groupKey:this._seriesField,isSeriesMark:!1,dataView:t,parent:this._region.getInteractionMark(),customShape:i.customShape,stateSort:i.stateSort}),this._symbolActiveMark.setVisible(!1)}return this._symbolMark}initSymbolMarkStyle(){const t=this._symbolMark;if(!t)return this._initSymbolActiveMarkAlone(),t;if(this._initSymbolMark(t),this._symbolActiveMark&&this._symbolMark.stateStyle.dimension_hover){this._symbolActiveMark.setVisible(!0),this.event.on(Xh.dimensionHover,this._dimensionTrigger.bind(this));for(const e in this._symbolMark.stateStyle){this._symbolActiveMark.stateStyle[e]={};for(const i in this._symbolMark.stateStyle[e])this._symbolActiveMark.stateStyle[e][i]={style:null,level:Py.Series,referer:t}}this._symbolActiveMark.state.changeStateInfo({stateValue:xy.STATE_DIMENSION_HOVER,filter:()=>!0})}return t}_initSymbolMark(t){t&&(this.setMarkStyle(t,{fill:this.getColorAttribute()},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Py.Series),this.event.on(Hd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Py.Series))}_initSymbolActiveMarkAlone(){var t,e;const i=this._symbolActiveMark;i&&(this._initSymbolMark(i),i&&(null===(e=null===(t=this._spec[GC.point.name])||void 0===t?void 0:t.state)||void 0===e?void 0:e.dimension_hover)&&(i.setVisible(!0),this.event.on(Xh.dimensionHover,this._dimensionTrigger.bind(this)),this.initMarkStyleWithSpec(i,Tl({},this._spec[GC.point.name],{visible:!0})),this._symbolActiveMark.state.changeStateInfo({stateValue:xy.STATE_DIMENSION_HOVER,filter:()=>!0})))}initLabelMarkStyle(t){var e;t&&("symbol"!==(null===(e=t.getTarget())||void 0===e?void 0:e.type)&&t.setRule("line-data"),this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null}),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},"normal",Py.Series),this.event.on(Hd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"visible")})))}initLineLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getSeriesField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}encodeDefined(t,e){var i,s,n,r;if(!t)return;const a=this._isFieldAllValid();if("zero"===this._invalidType||a){if(!0===(null===(s=null===(i=t.stateStyle.normal)||void 0===i?void 0:i[e])||void 0===s?void 0:s.style))return;this.setMarkStyle(t,{[e]:!0},"normal",Py.Series)}else{if(!0!==(null===(r=null===(n=t.stateStyle.normal)||void 0===n?void 0:n[e])||void 0===r?void 0:r.style))return;this.setMarkStyle(t,{[e]:this._getInvalidDefined.bind(this)},"normal",Py.Series)}t.getProduct()&&t.compileEncode()}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.getStackValueField();return!!(t&&t.latestData&&e)&&t.latestData[e]&&t.latestData[e].allValid}}const $C=Object.assign(Object.assign({},rL),GC);class XC extends vx{setStyle(t,e="normal",i=0,s=this.stateStyle){if(D(t))return;void 0===s[e]&&(s[e]={});const n=this._getIgnoreAttributes(),r=["strokeWidth","lineWidth","lineDash","strokeDash","lineJoin","stroke","strokeOpacity","opacity","fill","fillOpacity","texture","texturePadding","textureSize","textureColor"],a=this.isUserLevel(i);let o=!1;Object.keys(t).forEach((l=>{const h=t[l];if(D(h)||n.includes(l))return;a&&r.includes(l)&&(Qh(null==h?void 0:h.type)||(null==h?void 0:h.scale)||ys(h))&&(o=!0);const d=this._filterAttribute(l,h,e,i,a,s);this.setAttribute(l,d,e,i,s)})),o&&this.setEnableSegments(o)}}class KC extends XC{constructor(){super(...arguments),this.type=KC.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:1})}_getIgnoreAttributes(){var t,e;return(null===(t=this.model)||void 0===t?void 0:t.type)===_l.radar&&"polar"===(null===(e=this.model)||void 0===e?void 0:e.coordinate)?[]:["fill","fillOpacity"]}}KC.type="line";const qC=()=>{$l.registerMark(KC.type,KC),Sx(),hM(),BA(),YA(),_c.registerGraphic(Jd.line,JS),TC()};class ZC extends vx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{size:1,symbolType:"circle",fill:void 0,lineWidth:0})}}class JC extends ZC{constructor(){super(...arguments),this.type=JC.type}}JC.type="symbol";const QC=()=>{$l.registerMark(JC.type,JC),WA()},tE=(t,e,i)=>e.filter((e=>t.callback(e,i))),eE=(t,e,i)=>{const s=t.callback,n=t.as;if(!t.all)return e.forEach((t=>{const e=s(t,i);if(!D(n)){if(D(t))return;t[n]=e}return e})),e;const r=s(e,i);return D(n)||D(e)?r:(e[n]=r,e)};function iE(t){return t.reduce(((t,e)=>t+e),0)}const sE={min:ja,max:Ya,average:function(t){return 0===t.length?0:iE(t)/t.length},sum:iE};function nE(t,e,i,s){const n=Math.floor(e.length/t),r=[],a=e.length;let o,l,h,d=0,c=0;r[c++]=d;for(let t=1;to&&(o=l,h=t))}r[c++]=h,d=h}return r[c-1]!==a-1&&(r[c++]=a-1),r.map((t=>i?e[t].i:t))}function rE(t,e,i,s,n){let r=Math.floor(e.length/t);const a=[],o=e.length;let l=0,h=[];a.push(l),e[l][n]=e[l][n];for(let t=1;to-t&&(r=o-t,h.length=r),h=[];for(let i=0;ii?e[t].i:t))}function aE(t,e,i,s){return rE(t,e,i,"min",s)}function oE(t,e,i,s){return rE(t,e,i,"max",s)}function lE(t,e,i,s){return rE(t,e,i,"average",s)}function hE(t,e,i,s){return rE(t,e,i,"sum",s)}const dE=(t,e)=>{let i=t.size;const s=t.factor||1;if(Array.isArray(i)&&(i=Math.floor(i[1]-i[0])),i*=s,i<=0)return[];if(e.length<=i)return e;if(t.skipfirst)return e.slice(0,1);const{mode:n,yfield:r,groupBy:a}=t,o=null!=r?r:"y";let l=nE;if("min"===n?l=aE:"max"===n?l=oE:"average"===n?l=lE:"sum"===n&&(l=hE),e.length){const t={};if(a){for(let i=0,s=e.length;i{const r=t[n];if(r.length<=i){const t=r.map((t=>t.i));s=s.concat(t)}else{const t=l(i,r,!0,o);s=s.concat(t),r.forEach((t=>e[t.i][o]=t[o]))}})),s.sort(((t,e)=>t-e)),s.map((t=>e[t]))}return l(i,e,!1,o).map((t=>e[t]))}return[]},cE=(t,e)=>{if(!e||0===e.length)return;let{radius:i}=t;D(i)&&"symbol"===e[0].mark.markType&&(i=!0);const{direction:s,delta:n,deltaMul:r=1,groupBy:a}=t,o=e=>{!function(t){t.forEach((t=>{t.getGraphicAttribute(hm)&&(t.setGraphicAttribute("visible",!0),t.setGraphicAttribute(hm,!1))}))}(e);const a=t.sort?e.slice().sort(((t,e)=>t.getGraphicAttribute("x")-e.getGraphicAttribute("x"))):e;0===s?function(t,e,i,s){if(s){const s=-1/0;let n=-1/0,r=0,a=0;const o=D(e);let l=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,h=t.getGraphicAttribute("x"),d=t.getGraphicAttribute("y");o&&(l=(e+r)*i),a=(s-h)**2+(n-d)**2,a<(l+r+e)**2?t.getGraphicAttribute("forceShow")||(t.setGraphicAttribute(hm,!0),t.setGraphicAttribute("visible",!1)):n=d,r=e}))}}(a,n,r,i):1===s?function(t,e,i,s){if(s){let s=-1/0,n=0;const r=D(e);let a=e;t.forEach((t=>{if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("x");r&&(a=(e+n)*i),Math.abs(o-s){if(!1===t.getGraphicAttribute("visible"))return;const e=t.getGraphicAttribute("size")/2,o=t.getGraphicAttribute("y");r&&(a=(e+n)*i),Math.abs(o-s){const i=e.getDatum()[a];return t[i]?t[i].push(e):t[i]=[e],t}),{});Object.keys(t).forEach((e=>{o(t[e])}))}else o(e);return e},uE=()=>{_c.registerTransform("sampling",{transform:dE,markPhase:"afterEncode"},!0)},pE=()=>{_c.registerTransform("markoverlap",{transform:cE,markPhase:"afterEncode"},!0)};class gE extends YC{_transformLabelSpec(t){var e,i,s;!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)?this._addMarkLabelSpec(t,"point"):this._addMarkLabelSpec(t,"line"),this._addMarkLabelSpec(t,"line","lineLabel","initLineLabelMarkStyle",void 0,!0)}}function mE(t,e,i){let s=!1;if(e&&ys(e))for(const n of t)for(const t of n.getSeries(i))if(s=!!e.call(null,t),s)return s;return s}function _E(t,e){const i=[];for(const s of t)for(const t of s.getSeries(e))i.push(t);return i}const fE=(t,e)=>{for(let i=0;i=t[0]}function yE(t,e){const i=Fa(e)-e[0],s=Fa(e)*e[0]<0;let n=e[0]<=0?0-e[0]:0,r=Fa(e)>0?Fa(e)-0:0;0===i?e[0]<0?(n=1,r=0):e[0]>0&&(n=0,r=1):(n/=i,r/=i);const a=t.getDomainSpec();return{total:i,negative:n,positive:r,includeZero:s,domain:e,extendable_min:!qo(a.min),extendable_max:!qo(a.max)}}function bE(t,e){const{positive:i,negative:s,extendable_min:n,extendable_max:r,domain:a}=t,{positive:o,negative:l,extendable_min:h,extendable_max:d,domain:c}=e;if(o>0){if(!h)return!1;let t=s/i;r&&(t=s/Math.max(i,o),a[1]=-a[0]/t),c[0]=-c[1]*t}else if(l>0){if(!d)return!1;let t=i/s;n&&(t=i/Math.max(s,s),a[0]=-a[1]/t),c[1]=-c[0]*t}return!0}function xE(t,e){const{extendable_min:i,extendable_max:s,domain:n}=t,{positive:r,negative:a,domain:o}=e;return!(0===r&&0===a||r>0&&!s||a>0&&!i||(n[0]=o[0],n[1]=o[1],0))}function SE(t,e){const{positive:i,negative:s,extendable_max:n,domain:r}=t,{positive:a,negative:o,extendable_min:l,domain:h}=e;if(n&&l){const t=Math.max(s,o)/Math.max(i,a);r[1]=-r[0]/t,h[0]=-h[1]*t}else if(l){const t=s/i;h[0]=-h[1]*t}else{if(!n)return!1;{const t=o/a;r[1]=-r[0]/t}}return!0}function ME(t,e){const{extendable_min:i,domain:s}=t,{extendable_max:n,domain:r}=e;return!(!i||!n||(s[0]=-s[1],r[1]=-r[0],0))}const kE=t=>t.map(((t,e)=>({index:e,value:t}))),AE=(t,e,i=0)=>{const s=new qt(t).expand(i/2),n=new qt(e).expand(i/2);return s.intersects(n)};function wE(t,e,i){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function TE(t,e){for(let i,s=1,n=t.length,r=t[0];sit?Math.min(t-e/2,i-e):i{var s;const{labelStyle:n,axisOrientType:r,labelFlush:a,labelFormatter:o,startAngle:l=0}=i;let h=null!==(s=n.angle)&&void 0!==s?s:0;"vertical"===n.direction&&(h+=At(90));const d=["bottom","top"].includes(r),c=["left","right"].includes(r);let u=1,p=0;d||(c?(u=0,p=1):l&&(u=Math.cos(l),p=-Math.sin(l)));const g=Jk(n),m=t.range(),_=e.map(((i,s)=>{var r,l;const _=o?o(i):`${i}`,{width:f,height:v}=g.quickMeasure(_),y=Math.max(f,12),b=Math.max(v,12),x=t.scale(i),S=u*x,M=p*x;let k,A,w=S,T=M;a&&d&&0===s?w=LE(S,y,m[0],m[m.length-1]):a&&d&&s===e.length-1?w=LE(S,y,m[m.length-1],m[0]):k=null!==(r=n.textAlign)&&void 0!==r?r:"center","right"===k?w-=y:"center"===k&&(w-=y/2),a&&c&&0===s?T=LE(M,b,m[0],m[m.length-1]):a&&c&&s===e.length-1?T=LE(M,b,m[m.length-1],m[0]):A=null!==(l=n.textBaseline)&&void 0!==l?l:"middle","bottom"===A?T-=b:"middle"===A&&(T-=b/2);const L=(new qt).set(w,T,w+y,T+b);return h&&L.rotate(h,S,M),L}));return _},EE=(t,e)=>{var i,s,n,r,a;if(!t)return t;const o=null===(i=null==e?void 0:e.targetAxis)||void 0===i?void 0:i.call(e);if(!o)return t;const l=null===(s=null==e?void 0:e.currentAxis)||void 0===s?void 0:s.call(e);if(!l)return t;const h=null===(n=l.getTickData())||void 0===n?void 0:n.getDataView();if(!h)return t;if(!h.transformsArr.find((t=>t.type.includes("ticks"))))return t;const d=l.getScale();if(!d)return t;const c=null===(a=null===(r=o.getTickData())||void 0===r?void 0:r.getDataView())||void 0===a?void 0:a.latestData;if(!(null==c?void 0:c.length))return t;const u=o.getScale();if(!u)return t;const p=u.domain(),g=Fa(p)-p[0];if(0===g)return t;const m=d.domain(),_=Fa(m)-m[0];if(0===g)return t;const f=c.map((t=>{const e=(t.value-p[0])/g;return _*e+m[0]}));return kE(f)};class DE{constructor(t){this.id=Ko(),this.name=`${t}_${this.id}`}onAdd(t){this.service=t}release(){this.service=null}}class PE extends DE{constructor(){super(PE.type),this.type="AxisSyncPlugin"}_checkEnableSync(t){if(!Jh(t.getScale().type))return!1;const e=t.getSpec().sync;return!!(null==e?void 0:e.axisId)&&e}_getTargetAxis(t,e){const i=t.getOption().getChart().getComponentByUserId(e.axisId);return(null==i?void 0:i.type.startsWith("cartesianAxis"))?i:null}onInit(t,e){const i=this._checkEnableSync(e);if(!i)return;if(!i.zeroAlign)return;const s=this._getTargetAxis(e,i);s&&e.event.on(Hd.scaleDomainUpdate,{filter:({model:t})=>t.id===e.id||t.id===s.id},(()=>{((t,e)=>{var i,s,n,r,a,o;const l=t.getScale(),h=e.getScale();if(!l||!h)return;const d=null!==(n=null===(s=(i=t).getDomainAfterSpec)||void 0===s?void 0:s.call(i))&&void 0!==n?n:[0,1],c=null!==(o=null===(a=(r=e).getDomainAfterSpec)||void 0===a?void 0:a.call(r))&&void 0!==o?o:[0,1];if(!(d&&c&&vE(d)&&vE(c)))return;const u=yE(t,d),p=yE(e,c),{positive:g,negative:m,extendable_min:_,extendable_max:f,includeZero:v}=u,{positive:y,negative:b,extendable_min:x,extendable_max:S,includeZero:M}=p;if(0===g&&0===m){if(!xE(u,p))return}else if(0===y&&0===b){if(!xE(p,u))return}else if(v||M)if(v&&!M){if(!bE(u,p))return}else if(M&&!v){if(!bE(p,u))return}else{if(m===b)return;if(m>b){if(!SE(u,p))return}else if(!SE(p,u))return}else{if(0===m&&0===y){if(!ME(u,p))return}else if(0===b&&0===g&&!ME(p,u))return;if(0===m&&0===b)if(0===d[0]&&c[0]>0){if(!x)return;c[0]=0}else{if(!(0===c[0]&&d[0]>0))return;if(!_)return;d[0]=0}if(0===g&&0===y)if(0===d[1]&&c[1]>0){if(!S)return;c[1]=0}else{if(!(0===c[1]&&d[1]>0))return;if(!f)return;d[1]=0}}l.domain(d),h.domain(c)})(s,e)}))}onDidCompile(t,e){const i=this._checkEnableSync(e);if(!i)return;const s=this._getTargetAxis(e,i);if(s&&i.tickAlign){Lp(e.getOption().dataSet,"tickAlign",EE);const t={targetAxis:()=>s,currentAxis:()=>e};e.addTransformToTickData({type:"tickAlign",options:t,level:Number.MAX_SAFE_INTEGER},!1)}}}function OE(t={}){const e=Object.assign({},t);if(ys(t.style)?e.style=(e,i,s,n)=>BE(t.style(e,i,s,n)):Ym(t.style)||(e.style=BE(t.style)),!Ym(t.state)){const i={};Object.keys(t.state).forEach((e=>{ys(t.state[e])?i[e]=(i,s,n,r)=>BE(t.state[e](i,s,n,r)):Ym(t.state[e])||(i[e]=BE(t.state[e]))})),e.state=i}return e}function RE(t){if(Ym(t))return null;const e={};return Object.keys(t).forEach((i=>{ys(t[i])?e[i]=(e,s,n,r)=>BE(t[i](e,s,n,r)):Ym(t[i])||(e[i]=BE(t[i]))})),e}function IE(t,e){if(Ym(t))return null;const i={};return Object.keys(t).forEach((s=>{ys(t[s])?i[s]=t[s](e):i[s]=t[s]})),BE(i)}function BE(t){return(null==t?void 0:t.angle)&&(t.angle=At(t.angle)),t}function FE(t,e){return Ud(e,`component.${t}`)}function YE(t,e,i,s){if(t)return{formatFunc:t,args:[i,s]};const n=$l.getFormatter();return e&&n?{formatFunc:n,args:[i,s,e]}:{}}PE.pluginType="component",PE.type="AxisSyncPlugin";const jE=(t,e,i,s)=>{if(D(t[e]))return;const n=y(t[e]),r=n?t[e]:[t[e]],a=[];return r.forEach(((t,r)=>{!t||s&&!s(t)||a.push({spec:t,specPath:n?[e,r]:[e],specInfoPath:["component",e,r],type:i})})),a},HE={left:{textAlign:"center",textBaseline:"bottom"},right:{textAlign:"center",textBaseline:"bottom"},radius:{},angle:{}};function zE(t){let e=0;return Ud(t,"tick.visible")&&(e+=Ud(t,"tick.tickSize")),Ud(t,"label.visible")&&(e+=Ud(t,"label.space")),e}function NE(t,e){var i,s,n,r,a,o;return{min:null!==(n=null!==(i=t.min)&&void 0!==i?i:null===(s=t.range)||void 0===s?void 0:s.min)&&void 0!==n?n:null==e?void 0:e.min,max:null!==(o=null!==(r=t.max)&&void 0!==r?r:null===(a=t.range)||void 0===a?void 0:a.max)&&void 0!==o?o:null==e?void 0:e.max}}function VE(t){const e=null==t?void 0:t.orient;return"top"===e||"bottom"===e||"left"===e||"right"===e||"z"===e}const WE=(t,e,i)=>{var s;const n=null!==(s="band"===e?FE("axisBand",i):["linear","log","symlog"].includes(e)?FE("axisLinear",i):{})&&void 0!==s?s:{},r=kd(t)?FE("axisX",i):Ad(t)?FE("axisY",i):FE("axisZ",i);return Tl({},FE("axis",i),n,r)},GE=(t,e,i)=>{var s;const n=null!==(s="band"===e?FE("axisBand",i):"linear"===e?FE("axisLinear",i):{})&&void 0!==s?s:{},r=FE("angle"===t?"axisAngle":"axisRadius",i);return Tl({},FE("axis",i),n,r)},UE=t=>"band"===t||"ordinal"===t||"point"===t;function $E(t,e){return{id:t,label:t,value:e,rawValue:t}}function XE(t,e,i){return i||!t||t.getAxisId()===e.getAxisId()}class KE extends qw{constructor(t){super(),this.component=t}releaseAll(){super.releaseAll(),this.component=null}}function qE(t,e){const{x1:i,y1:s,x2:n,y2:r}=e,{x1:a,y1:o,x2:l,y2:h}=t.AABBBounds,{dx:d=0,dy:c=0}=t.attribute;let u=0,p=0;an&&(u=n-l),h>r&&(p=r-h),u&&t.setAttribute("dx",u+d),p&&t.setAttribute("dy",p+c)}function ZE(t,e,i,s){for(let n=0,r=t.length;n=e)return r}}return null}const JE=(t,e)=>{var i;const s=Tl({},e,e[Ld(null!==(i=t.orient)&&void 0!==i?i:e.orient)]);return delete s.horizontal,delete s.vertical,s};class QE extends jy{getTheme(t,e){return function(t,e,i,s){switch(t){case r.cartesianBandAxis:return WE(Td(i,["z"]),"band",e);case r.cartesianLinearAxis:return WE(Td(i,["z"]),"linear",e);case r.cartesianLogAxis:return WE(Td(i,["z"]),"log",e);case r.cartesianSymlogAxis:return WE(Td(i,["z"]),"symlog",e);case r.cartesianAxis:case r.cartesianTimeAxis:return WE(Td(i),void 0,e);case r.polarBandAxis:return GE(i.orient,"band",e);case r.polarLinearAxis:return GE(i.orient,"linear",e);case r.polarAxis:return GE(i.orient,void 0,e);case r.cartesianCrosshair:return((t,e)=>{var i,s;const n=Ba(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,xField:l,yField:h}=null!==(s=FE(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>kd(t.orient)));let c;c=M(d)?Tl({},UE(d.type)?a:o,l):l;const u=n.find((t=>Ad(t.orient)));let p;return p=M(u)?Tl({},td(u.type)?a:o,h):h,{xField:c,yField:p}})(e,s);case r.polarCrosshair:return((t,e)=>{var i,s;const n=Ba(null!==(i=e.axes)&&void 0!==i?i:[]),{bandField:a,linearField:o,categoryField:l,valueField:h}=null!==(s=FE(r.crosshair,t))&&void 0!==s?s:{},d=n.find((t=>"angle"===t.orient));let c;c=M(d)?Tl({},UE(d.type)?a:o,l):l;const u=n.find((t=>"radius"===t.orient));let p;return p=M(u)?Tl({},td(u.type)?a:o,h):h,{categoryField:c,valueField:p}})(e,s);case r.colorLegend:case r.sizeLegend:case r.discreteLegend:case r.dataZoom:case r.scrollBar:return JE(i,FE(t,e));default:return FE(t,e)}}(this.type,this._option.getTheme(),t,e)}_mergeThemeToSpec(t,e){const{spec:i,theme:s}=super._mergeThemeToSpec(t,e);return this._adjustPadding(i),{spec:i,theme:s}}_adjustPadding(t){const{padding:e,noOuterPadding:i=!0,orient:s}=t;i&&e&&s&&(t.padding=Object.assign(Object.assign({},sl(e)),{[s]:0}))}}class tD extends Vy{static createComponent(t,e){const{spec:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{var r,a;e instanceof Ss||this.event.emit(i,{model:this,node:t,event:e,item:s,datum:n,source:zd.chart,chart:null===(a=null===(r=this._option)||void 0===r?void 0:r.globalInstance)||void 0===a?void 0:a.getChart()},"model")},this._option.animation&&(this.animate=new Yy({getCompiler:e.getCompiler}))}initLayout(){var t;super.initLayout(),this._regions=null!==(t=this._regions)&&void 0!==t?t:this._option.getRegionsInIndex(),this._layout&&(this._layout.layoutBindRegionID=this._regions.map((t=>null==t?void 0:t.id)))}changeRegions(t){throw new Error("Method not implemented.")}_getNeedClearVRenderComponents(){throw new Error("Method not implemented.")}onRender(t){throw new Error("Method not implemented.")}getVRenderComponents(){return this._getNeedClearVRenderComponents()}callPlugin(t){this.pluginService&&this.pluginService.getAll().forEach((e=>t(e)))}getContainer(){var t;return this._container||(this._container=null===(t=this._option)||void 0===t?void 0:t.globalInstance.getStage().find((t=>"root"===t.name),!0)),this._container}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||(i.reMake=["seriesId","seriesIndex","regionId","regionIndex"].some((i=>!Im(null==e?void 0:e[i],t[i])))),(null==e?void 0:e.visible)!==t.visible&&(i.reCompile=!0),i}release(){var t;super.release(),this.clear(),null===(t=this.pluginService)||void 0===t||t.releaseAll(),this.pluginService=null}clear(){var t;const e=this._getNeedClearVRenderComponents();e&&e.length&&e.forEach((t=>{var e;t&&(null===(e=this.getContainer())||void 0===e||e.removeChild(t),t=null)})),this._container=null,null===(t=this.pluginService)||void 0===t||t.clearAll()}compile(){this.compileMarks(),this.reAppendComponents()}compileMarks(t){this.getMarks().forEach((e=>{e.compile({group:t,context:{model:this}})}))}reAppendComponents(){const t=this._getNeedClearVRenderComponents();t&&t.length&&t.forEach((t=>{var e;t&&!t.stage&&(null===(e=this.getContainer())||void 0===e||e.appendChild(t))}))}getBoundsInRect(t,e){return{x1:0,x2:0,y1:0,y2:0}}}function eD(t,e){if(!t||!w(t))return t;const i={};return Object.keys(t).forEach((s=>{const n=t[s];let r=!1;e.forEach((t=>{(S(t)&&t===s||t instanceof RegExp&&s.match(t))&&(r=!0)})),r||(i[s]=n)})),i}tD.transformerConstructor=QE;class iD extends vx{constructor(t,e){super(t,e),this.type="component",this._componentType=e.componentType,this._mode=e.mode}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.mark(Jd.component,null!=t?t:e.rootMark,{componentType:this._componentType,mode:this._mode}).id(i),this._compiledProductId=i}}iD.type="component";const sD=()=>{$l.registerMark(iD.type,iD)};class nD extends Ts{constructor(){super(...arguments),this.mode=de.NORMAL}onBind(){const t=this.target.getInnerView(),e=this.target.getPrevInnerView();e&&(this._newElementAttrMap={},zk(t,(t=>{var i,s,n,r,a,o;if("group"!==t.type&&t.id){const l=e[t.id];if(l){if(!Im(t.attribute,l.attribute)){const e=k(t.attribute);this._newElementAttrMap[t.id]={state:"update",node:t,attrs:Object.assign(Object.assign({},e),{opacity:null!==(i=e.opacity)&&void 0!==i?i:1,fillOpacity:null!==(s=e.fillOpacity)&&void 0!==s?s:1,strokeOpacity:null!==(n=e.strokeOpacity)&&void 0!==n?n:1})},t.setAttributes(l.attribute)}}else{const e={opacity:null!==(r=t.attribute.opacity)&&void 0!==r?r:1,fillOpacity:null!==(a=t.attribute.fillOpacity)&&void 0!==a?a:1,strokeOpacity:null!==(o=t.attribute.strokeOpacity)&&void 0!==o?o:1};this._newElementAttrMap[t.id]={state:"enter",node:t,attrs:e},t.setAttributes({opacity:0,fillOpacity:0,strokeOpacity:0})}}})))}onStart(){let t=this.duration,e=this.easing;this._newElementAttrMap&&Object.keys(this._newElementAttrMap).forEach((i=>{var s;const{node:n,attrs:r,state:a}=this._newElementAttrMap[i];if("enter"===a){const{enter:i={}}=null!==(s=this.params)&&void 0!==s?s:{};t=qo(i.duration)?i.duration:t,e=i.easing?i.easing:e}"path"===n.type?n.animate({interpolate:(t,e,i,s,n)=>"path"===t&&(n.path=function(t,e){let i,s,n,r=Wb.lastIndex=Gb.lastIndex=0,a=-1;const o=[],l=[];for(t+="",e+="";(i=Wb.exec(t))&&(s=Gb.exec(e));)(n=s.index)>r&&(n=e.slice(r,n),o[a]?o[a]+=n:o[++a]=n),(i=i[0])===(s=s[0])?o[a]?o[a]+=s:o[++a]=s:(o[++a]=null,l.push({i:a,x:Nb(i,s)})),r=Gb.lastIndex;return rt;class lD extends tD{getOrient(){return this._orient}getScale(){return this._scale}getScales(){return this._scales}getTickData(t=0){return this._tickData[t]}get visible(){return this._visible}getInverse(){return this._inverse}getCoordinateType(){return this._coordinateType}constructor(t,e){var i;super(t,e),this.specKey="axes",this._scales=[],this._tickData=[],this._visible=!0,this._tick=void 0,this._visible=null===(i=t.visible)||void 0===i||i,this._coordinateType="none"}_getNeedClearVRenderComponents(){return[]}getVRenderComponents(){var t,e,i,s;return[null===(e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct())||void 0===e?void 0:e.getGroupGraphicItem(),null===(s=null===(i=this._gridMark)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.getGroupGraphicItem()].filter(M)}created(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_;if(super.created(),this.setSeriesAndRegionsFromSpec(),this.initEvent(),this.initScales(),this.updateSeriesScale(),this._shouldComputeTickData()&&this._initData(),this._visible){const f=this._createMark({type:"component",name:`axis-${this.getOrient()}`},{componentType:"angle"===this.getOrient()?"circleAxis":"axis",mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});if(this._axisMark=f,f.setZIndex(this.layoutZIndex),M(this._spec.id)&&f.setUserId(this._spec.id),this._marks.addMark(f),null===(t=this._spec.grid)||void 0===t?void 0:t.visible){const t=this._createMark({type:"component",name:`axis-${this.getOrient()}-grid`},{componentType:"angle"===this.getOrient()?ic.circleAxisGrid:ic.lineAxisGrid,mode:this._spec.mode,noSeparateStyle:!0,skipTheme:!0});t.setZIndex(null!==(r=null!==(s=null===(i=null===(e=this._spec.grid)||void 0===e?void 0:e.style)||void 0===i?void 0:i.zIndex)&&void 0!==s?s:null===(n=this._spec.grid)||void 0===n?void 0:n.zIndex)&&void 0!==r?r:Ey.Axis_Grid),t.setInteractive(!1),this._marks.addMark(t),this._gridMark=t}if(v(this._spec.interactive)&&this._marks.forEach((t=>t.setInteractive(this._spec.interactive))),!1!==this._option.animation&&!1!==Ud(this._option.getChart().getSpec(),"animation")&&!0===this._spec.animation){const t=EC(null===(a=$l.getAnimationInKey("axis"))||void 0===a?void 0:a(),{appear:null!==(l=null!==(o=this._spec.animationAppear)&&void 0!==o?o:Ud(this._option.getChart().getSpec(),"animationAppear.axis"))&&void 0!==l?l:Ud(this._option.getChart().getSpec(),"animationAppear"),disappear:null!==(d=null!==(h=this._spec.animationDisappear)&&void 0!==h?h:Ud(this._option.getChart().getSpec(),"animationDisappear.axis"))&&void 0!==d?d:Ud(this._option.getChart().getSpec(),"animationDisappear"),enter:null!==(u=null!==(c=this._spec.animationEnter)&&void 0!==c?c:Ud(this._option.getChart().getSpec(),"animationEnter.axis"))&&void 0!==u?u:Ud(this._option.getChart().getSpec(),"animationEnter"),exit:null!==(g=null!==(p=this._spec.animationExit)&&void 0!==p?p:Ud(this._option.getChart().getSpec(),"animationExit.axis"))&&void 0!==g?g:Ud(this._option.getChart().getSpec(),"animationExit"),update:null!==(_=null!==(m=this._spec.animationUpdate)&&void 0!==m?m:Ud(this._option.getChart().getSpec(),"animationUpdate.axis"))&&void 0!==_?_:Ud(this._option.getChart().getSpec(),"animationUpdate")});t.enter&&(t.update[0].customParameters={enter:t.enter[0]}),this._marks.forEach((e=>e.setAnimationConfig(t)))}}}_shouldComputeTickData(){return this.getVisible()||this._spec.forceInitTick}_initData(){const t=this._initTickDataSet(this._tickTransformOption());t.target.addListener("change",this._forceLayout.bind(this)),this._tickData=[new px(this._option,t)]}collectData(t,e){const i=[];return mE(this._regions,(s=>{var n;let a=this.collectSeriesField(t,s);if(a=y(a)?Jh(this._scale.type)?a:[a[0]]:[a],t||(this._dataFieldText=s.getFieldAlias(a[0])),a){const t=s.getViewData();if(e)a.forEach((t=>{i.push(s.getRawDataStatisticsByField(t,!1))}));else if(t&&t.latestData&&t.latestData.length){const e=null===(n=s.getViewDataStatistics)||void 0===n?void 0:n.call(s),o=this.type===r.cartesianLinearAxis&&this._spec.breaks&&this._spec.breaks.length;a.forEach((s=>{var n;(null===(n=null==e?void 0:e.latestData)||void 0===n?void 0:n[s])&&(o?i.push(Object.assign(Object.assign({},e.latestData[s]),{values:t.latestData.map((t=>t[s]))})):i.push(e.latestData[s]))}))}}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),i}isSeriesDataEnable(){let t=!0;return mE(this._regions,(e=>{var i;y(null===(i=e.getViewDataStatistics())||void 0===i?void 0:i.latestData)&&(t=!1)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}setSeriesAndRegionsFromSpec(){const{seriesId:t,seriesIndex:e,regionId:i,regionIndex:s}=this._spec;M(t)&&(this._seriesUserId=Ba(t)),M(i)&&(this._regionUserId=Ba(i)),M(e)&&(this._seriesIndex=Ba(e)),M(s)&&(this._regionIndex=Ba(s)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionIndex),this.layout.layoutBindRegionID=this._regions.map((t=>t.id))}getBindSeriesFilter(){return{userId:this._seriesUserId,specIndex:this._seriesIndex}}initEvent(){this.event.on(Hd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this));const t=_E(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}).map((t=>t.getViewDataStatistics())).filter((t=>!!t));t.length>1?this._option.dataSet.multipleDataViewAddListener(t,"change",(()=>{this.updateScaleDomain()})):1===t.length&&t[0].target.addListener("change",(()=>{this.updateScaleDomain()})),mE(this._regions,(t=>{t.event.on(Hd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._clearRawDomain()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}updateScaleDomain(){}_clearRawDomain(){}onLayoutEnd(t){this.updateScaleRange(),this.event.emit(Hd.scaleUpdate,{model:this,value:"range"}),super.onLayoutEnd(t)}computeData(t){!this._tickData||!this._tickData.length||"force"!==t&&Im(this._scale.range(),[0,1])||this._tickData.forEach((t=>{t.getDataView().reRunAllTransform(),t.updateData()}))}initScales(){this._scales=[this._scale];const t=[];if(mE(this._regions,(e=>{const i=e.getGroups();i&&t.push(i)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),0!==t.length){const e=Ya(t.map((t=>t.fields.length)));for(let t=1;t{var s,n;return(null===(s=null==e?void 0:e[i])||void 0===s?void 0:s.visible)!==(null===(n=null==t?void 0:t[i])||void 0===n?void 0:n.visible)})),i))}_getAxisAttributes(){const t=this._spec,e={orient:this.getOrient(),select:!0!==this._option.disableTriggerEvent&&t.select,hover:!0!==this._option.disableTriggerEvent&&t.hover};if(t.domainLine&&t.domainLine.visible?e.line=((i=OE(i=t.domainLine)).startSymbol=OE(i.startSymbol),i.endSymbol=OE(i.endSymbol),i):e.line={visible:!1},t.label&&t.label.visible){const i=eD(t.label,["style","formatMethod","state"]);e.label=i,t.label.style&&(e.label.style=ys(t.label.style)?(e,i,s,n)=>{var r;const a=t.label.style(e.rawValue,i,e,s,n);return BE(Tl({},null===(r=this._theme.label)||void 0===r?void 0:r.style,a))}:BE(t.label.style)),(t.label.formatMethod||t.label.formatter)&&(e.label.formatMethod=this._getLabelFormatMethod()),t.label.state&&(e.label.state=function(t){if(Ym(t))return null;const e={};return Object.keys(t).forEach((i=>{ys(t[i])?e[i]=(e,s,n,r)=>BE(t[i](e.rawValue,s,e,n,r)):Ym(t[i])||(e[i]=BE(t[i]))})),e}(t.label.state))}else e.label={visible:!1};var i;if(t.tick&&t.tick.visible?(e.tick={visible:t.tick.visible,length:t.tick.tickSize,inside:t.tick.inside,alignWithLabel:t.tick.alignWithLabel,dataFilter:t.tick.dataFilter},t.tick.style&&(e.tick.style=ys(t.tick.style)?(e,i,s,n)=>{var r;const a=t.tick.style(e,i,s,n);return BE(Tl({},null===(r=this._theme.tick)||void 0===r?void 0:r.style,a))}:BE(t.tick.style)),t.tick.state&&(e.tick.state=RE(t.tick.state))):e.tick={visible:!1},t.subTick&&t.subTick.visible?(e.subTick={visible:t.subTick.visible,length:t.subTick.tickSize,inside:t.subTick.inside,count:t.subTick.tickCount},t.subTick.style&&(e.subTick.style=ys(t.subTick.style)?(e,i,s,n)=>{var r;const a=t.subTick.style(e,i,s,n);return BE(Tl({},null===(r=this._theme.subTick)||void 0===r?void 0:r.style,a))}:BE(t.subTick.style)),t.subTick.state&&(e.subTick.state=RE(t.subTick.state))):e.subTick={visible:!1},t.title&&t.title.visible){const i=t.title,{autoRotate:s,angle:n,style:r={},background:a,state:o,shape:l}=i,h=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n(e,i)=>{var s,n;const r=t.grid.style(null===(s=e.datum)||void 0===s?void 0:s.rawValue,i,e.datum);return BE(Tl({},null===(n=this._theme.grid)||void 0===n?void 0:n.style,r))}:BE(t.grid.style),subGrid:!1===t.subGrid.visible?{visible:!1}:{type:"line",visible:t.subGrid.visible,alternateColor:t.subGrid.alternateColor,style:BE(t.subGrid.style)}}}_getLabelFormatMethod(){const{formatMethod:t,formatter:e}=this._spec.label,{formatFunc:i}=YE(t,e);return i?(t,s,n)=>i(s.rawValue,s,e):null}_initTickDataSet(t,e=0){Cp(this._option.dataSet,"scale",oD);const i=this.registerTicksTransform();return new R(this._option.dataSet,{name:`${this.type}_${this.id}_ticks_${e}`}).parse(this._scales[e],{type:"scale"}).transform({type:i,options:t},!1)}_tickTransformOption(){const t=this._tick||{},e=this._spec.label||{},{tickCount:i,forceTickCount:s,tickStep:n,tickMode:r}=t,{style:a,formatMethod:o,minGap:l}=e;return{sampling:!1!==this._spec.sampling,tickCount:i,forceTickCount:s,tickStep:n,tickMode:r,axisOrientType:this._orient,coordinateType:this._coordinateType,labelStyle:a,labelFormatter:o,labelGap:l}}addTransformToTickData(t,e){this._tickData.forEach((i=>{var s;null===(s=null==i?void 0:i.getDataView())||void 0===s||s.transform(t,e)}))}dataToPosition(t){return this._scale.scale(t)}}lD.specKey="axes";const hD=()=>{sD(),$l.registerAnimation("axis",(()=>({appear:{custom:rD},update:{custom:nD},exit:{custom:aD}})))};var dD=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{this.computeData(null==t?void 0:t.value),mE(this._regions,(t=>{const e=this.getOrient();kd(e)?XE(t.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):Ad(e)?XE(t.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper()):wd(e)&&XE(t.getZAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setZAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{let{x:e,y:i}=t;return qo(e)&&(e+=Number("left"===this._orient)*this.getLayoutRect().width),qo(i)&&(i+=Number("top"===this._orient)*this.getLayoutRect().height),{x:e,y:i}},this._transformLayoutRect=t=>{if(!this._visible)return t;const e=this._latestBounds.clone().translate(-this.getLayoutStartPoint().x,-this.getLayoutStartPoint().y);switch(this._layout.layoutOrient){case"left":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x1<0?-e.x1:0);break;case"right":0===this._layout.layoutRectLevelMap.width&&(t.width=e.x2>0?e.x2:0);break;case"top":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y1<0?-e.y1:0);break;case"bottom":0===this._layout.layoutRectLevelMap.height&&(t.height=e.y2>0?e.y2:0)}return t.width=Math.ceil(t.width),t.height=Math.ceil(t.height),this._layout.setRectInSpec(this._layoutCacheProcessing(t))},this._updateAxisLayout=()=>{const t=this.getLayoutStartPoint(),e=this._getUpdateAttribute(!1),{grid:i}=e,s=dD(e,["grid"]),n=this._axisMark.getProduct(),r=Tl({x:t.x,y:t.y},this._axisStyle,s);n.encode(r),this._gridMark&&this._gridMark.getProduct().encode(Tl({x:t.x,y:t.y},this._getGridAttributes(),i))},this._fixAxisOnZero=()=>{const{onZero:t,visible:e}=this._spec.domainLine;if(this.visible&&t&&!1!==e){const{onZeroAxisId:t,onZeroAxisIndex:e}=this._spec.domainLine,i=this._option.getComponentsByKey("axes"),s=kd(this.getOrient()),n=t=>{var e;return(s?!kd(t.getOrient()):kd(t.getOrient()))&&Jh(t.getScale().type)&&(t.getTickData()?null===(e=t.getTickData().getLatestData())||void 0===e?void 0:e.find((t=>0===t.value)):t.getScale().domain()[0]<=0&&Fa(t.getScale().domain())>=0)},r=i.filter((t=>n(t)));if(r.length){let a;if(M(t))a=r.find((e=>e.id===t));else if(M(e)){const t=i[e];n(t)&&(a=t)}else a=r[0];if(a){const t=this._axisMark.getProduct(),e=a.valueToPosition(0);s?t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dy:"bottom"===this._orient?-(a.getScale().range()[0]-e):e})}):t.encode({line:Object.assign(Object.assign({},this._axisStyle.line),{dx:"left"===this._orient?e:-(a.getScale().range()[1]-e)})})}}}},this._orient=Td(t,["z"]),wd(this._orient)&&(this.layoutType="absolute"),this._dataSet=e.dataSet,this._coordinateType="cartesian"}static getSpecInfo(t){const e=t[this.specKey];if(!e)return null;const i="horizontal"===t.direction;if(!y(e)){if(!VE(e))return null;const{axisType:t,componentName:s}=Cd(e,i);return e.type=t,[{spec:e,specPath:[this.specKey],specInfoPath:["component",this.specKey,0],type:s}]}let s=!0;if(e.filter((t=>"z"===t.orient))[0]){const t=e.filter((t=>"bottom"===t.orient))[0],i=e.filter((t=>Ad(t.orient)))[0];s=3===e.length&&t&&i}let n=e.map(((t,e)=>({spec:t,index:e})));s||(n=n.filter((({spec:t})=>"z"!==t.orient)));const r=[];return n.forEach((({spec:t,index:e})=>{if(!VE(t))return;const{axisType:s,componentName:n}=Cd(t,i);t.type=s,r.push({spec:t,specPath:[this.specKey,e],specInfoPath:["component",this.specKey,e],type:n})})),r}static createComponent(t,e){const{spec:i}=t,s=dD(t,["spec"]),n=$l.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}initLayout(){super.initLayout(),this._layout.autoIndent=!1!==this._spec.autoIndent,this._layout.layoutOrient=this._orient}setLayout3dBox(t){this.layout3dBox=t}getNewScaleRange(){const{width:t,height:e}=this.getLayoutRect(),{left:i,right:s,top:n,bottom:r}=this._innerOffset;let a=[];return kd(this.getOrient())?qo(t)&&(a=this._inverse?[t-s,i]:[i,t-s]):wd(this.getOrient())?qo(t)&&(a=this._inverse?[t-s,i]:[i,t-s],this._scale.range(a)):qo(e)&&(a=this._inverse?[n,e-r]:[e-r,n]),a}updateScaleRange(){let t=!1;const e=this.getNewScaleRange(),i=this._scale.range();return e.length===i.length&&e.every(((t,e)=>t===i[e]))?t=!1:(t=!0,this._scale.range(e)),t}init(t){var e;super.init(t),null===(e=this.pluginService)||void 0===e||e.load(cD.map((t=>new t))),this.callPlugin((t=>{this.pluginService&&t.onInit&&t.onInit(this.pluginService,this)}))}setAttrFromSpec(){var t;if(super.setAttrFromSpec(),this.visible){kd(this.getOrient())?cg(this._spec.maxHeight)&&(this._spec.maxHeight="30%"):cg(this._spec.maxWidth)&&(this._spec.maxWidth="30%");const t=this._getAxisAttributes();t.label.formatMethod=this._getLabelFormatMethod(),t.verticalFactor="top"===this.getOrient()||"right"===this.getOrient()?-1:1,this._axisStyle=t}this._tick=this._spec.tick;const e=null===(t=this._option.getChart())||void 0===t?void 0:t.getSpec();this._inverse=function(t,e){let i=t.inverse;return e&&!kd(t.orient)&&(i=!M(t.inverse)||!t.inverse),i}(this._spec,"horizontal"===(null==e?void 0:e.direction))}onLayoutStart(t,e,i){if(super.onLayoutStart(t,e,i),!wd(this.getOrient())&&this._spec.innerOffset){const t=this._spec;Ad(this.getOrient())?["top","bottom"].forEach((i=>{this._innerOffset[i]=el(t.innerOffset[i],e.height,e)})):["left","right"].forEach((i=>{this._innerOffset[i]=el(t.innerOffset[i],e.width,e)}))}}getSeriesStatisticsField(t){let e;return e=kd(this.getOrient())?t.fieldX:wd(this.getOrient())?t.fieldZ:t.fieldY,Jh(this._scale.type)?e:[e[0]]}_tickTransformOption(){var t,e,i;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimals:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,labelLastVisible:null===(e=this._spec.label)||void 0===e?void 0:e.lastVisible,labelFlush:null===(i=this._spec.label)||void 0===i?void 0:i.flush})}axisHelper(){return{isContinuous:Jh(this._scale.type),dataToPosition:this.dataToPosition.bind(this),getScale:(t=0)=>this._scales[t],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!0===this._inverse,getSpec:()=>this._spec}}afterCompile(){var t;const e=null===(t=this._axisMark)||void 0===t?void 0:t.getProduct();e&&e.addEventListener(lc.AFTER_ELEMENT_ENCODE,(()=>{if(!1===this._isLayout&&(kd(this.getOrient())?this.callPlugin((t=>{this.pluginService&&t.onDidLayoutHorizontal&&t.onDidLayoutHorizontal(this.pluginService,this)})):this.callPlugin((t=>{this.pluginService&&t.onDidLayoutVertical&&t.onDidLayoutVertical(this.pluginService,this)})),this._unitText)){const{x:t,y:e}=this.getLayoutStartPoint(),i=kd(this._orient)?{x:Ya(this._scale.range())+t,y:e}:{x:t,y:ja(this._scale.range())+e};this._unitText.setAttributes(i)}})),this.callPlugin((t=>{this.pluginService&&t.onDidCompile&&t.onDidCompile(this.pluginService,this)}))}onRender(t){}changeRegions(t){}update(t){}resize(t){}collectScale(){const t=[];return mE(this._regions,(e=>{t.push("left"===this.getOrient()||"right"===this.getOrient()?e.scaleY:e.scaleX)}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),t}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:kd(this.getOrient())?e.getSpec().x2Field?[...e.fieldX,e.fieldX2]:e.fieldX:wd(this.getOrient())?e.fieldZ:e.getSpec().y2Field?[...e.fieldY,e.fieldY2]:e.fieldY,n}updateSeriesScale(){const t=this.getOrient();mE(this._regions,(e=>{kd(t)?XE(e.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleX(this._scale),e.setXAxisHelper(this.axisHelper())):Ad(t)?XE(e.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleY(this._scale),e.setYAxisHelper(this.axisHelper())):wd(t)&&XE(e.getZAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(e.setScaleZ(this._scale),e.setZAxisHelper(this.axisHelper()))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getBoundsInRect(t){var e;let i={x1:0,y1:0,x2:0,y2:0};if(!this._visible)return i;this._verticalLimitSize=kd(this.getOrient())?t.height:t.width,this.setLayoutRect(t),!this.updateScaleRange()&&y(null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData())||this.computeData("range");const s={skipLayout:!1},n=kd(this.getOrient());this.pluginService&&(n?this.callPlugin((t=>{t.onWillLayoutHorizontal&&t.onWillLayoutHorizontal(this.pluginService,s,this)})):this.callPlugin((t=>{t.onWillLayoutVertical&&t.onWillLayoutVertical(this.pluginService,s,this)})));const r=this._axisMark.getProduct();let a=!1;if(!s.skipLayout){const t=this._getUpdateAttribute(!0),e=r.getGroupGraphicItem(),s=Tl(Object.assign({},this.getLayoutStartPoint()),this._axisStyle,t,{line:{visible:!1}}),o=e.getBoundsWithoutRender(s);a=!0,this._latestBounds=o,isFinite(o.width())&&(i=this._appendAxisUnit(o,n))}return a||(this._latestBounds=r.getBounds()),i}positionToData(t,e){const i=kd(this.getOrient());e&&(t-=i?this.getLayoutStartPoint().x:this.getLayoutStartPoint().y),this._innerOffset&&(t=i?Ps(t,this._innerOffset.left,this.getLayoutRect().width-this._innerOffset.right):Ps(t,this._innerOffset.top,this.getLayoutRect().height-this._innerOffset.bottom));const s=this._scale.range();return(t-s[0])*(t-Fa(s))>0?null:this._scale.invert(t)}_getTitleLimit(t){var e,i,s,n,r;if(this._spec.title.visible&&D(null===(e=this._spec.title.style)||void 0===e?void 0:e.maxLineWidth)){const e=null!==(r=null!==(s=null===(i=this._axisStyle.title)||void 0===i?void 0:i.angle)&&void 0!==s?s:null===(n=this._spec.title.style)||void 0===n?void 0:n.angle)&&void 0!==r?r:0;if(t){const t=this.getLayoutRect().width,i=Math.abs(Math.cos(e));return i<1e-6?1/0:t/i}const a=this.getLayoutRect().height,o=Math.abs(Math.sin(e));return o<1e-6?1/0:a/o}return null}_getUpdateAttribute(t){var e;let i=0,s=0;if(!t){const t=this.getRegions();let{x:e,y:n}=t[0].getLayoutStartPoint(),r=e+t[0].getLayoutRect().width,a=n+t[0].getLayoutRect().height;for(let i=1;i{const i=this._getNormalizedValue([e.value],t);return $E(e.value,i)})).filter((t=>{const{value:e,rawValue:i}=t,s=this._scale.domain();return"log"===this.getSpec().type?e>=0&&e<=1:Jh(this._scale.type)?i>=s[0]&&i<=Fa(s):s.includes(i)}))]:[]}initEvent(){super.initEvent(),this.visible&&(this.event.on(Hd.layoutEnd,this._updateAxisLayout),this.event.on(Hd.layoutEnd,this._fixAxisOnZero),this.event.on(Hd.layoutRectUpdate,(()=>{this._clearLayoutCache()})))}_getNormalizedValue(t,e){return 0===e?0:this.dataToPosition(t)/e}_layoutCacheProcessing(t){return["width","height"].forEach((e=>{t[e]{this.layout.getLastComputeOutBounds()[t]=this._layoutCache._lastComputeOutBounds[t]})):(this._hasAutoIndent=!0,["x1","x2","y1","y2"].forEach((t=>{this.layout.getLastComputeOutBounds()[t]t.x2?h.x2-t.x2:0,t.y2+=h.y2>t.y2?h.y2-t.y2:0):(t.x1+=h.x1{const i=t.getOrient();return("left"===i||"right"===i)&&t.getRegions().some((t=>e.includes(t)))}));let s=0,n=0;const r=this.getLayoutStartPoint().x,a=r+this.getLayoutRect().width;return i.forEach((t=>{const e=t.getLayoutStartPoint().x;if("left"===t.getOrient()&&e===r){const e=t.getLayoutRect().width;s=Math.max(s,e)}else if(e===a){const e=t.getLayoutRect().width;n=Math.max(n,e)}})),{left:s,right:n}}}}uD.type=r.cartesianAxis,uD.specKey="axes";class pD{constructor(){this._rawDomainIndex=[]}_initData(){var t;if(this._spec.showAllGroupLayers&&this._scales.length>1)for(let e=0;e{i>0&&(e.range([0,t.bandwidth()]),t=e)}))}getPosition(t){let e=0,i=this._scale;if(1===this._scales.length||1===t.length)e=this.valueToPosition(t[0]);else{const s=Math.min(t.length,this._scales.length);for(let i=0;ithis._rawDomainIndex[t][e]-this._rawDomainIndex[t][i])))}this.transformScaleDomain(),this.event.emit(Hd.scaleDomainUpdate,{model:this}),this.event.emit(Hd.scaleUpdate,{model:this,value:"domain"})}getLabelItems(t){const e=[];let i=[];return this._scales.forEach(((s,n)=>{var r;const a=this._tickDataMap[n],o=null===(r=null==a?void 0:a.getLatestData())||void 0===r?void 0:r.length,l=o?a.getLatestData().map((t=>t.value)):s.domain();if(l&&l.length)if(i&&i.length){const s=[],n=[];i.forEach((e=>{l.forEach((i=>{const r=Ba(e).concat(i);if(n.push(r),o){const e=$E(i,this._getNormalizedValue(r,t));s.push(e)}}))})),o&&e.push(s.filter((t=>t.value>=0&&t.value<=1))),i=n}else l.forEach((t=>{i.push(t)})),o&&e.push(a.getLatestData().map((e=>$E(e.value,this._getNormalizedValue([e.value],t)))).filter((t=>t.value>=0&&t.value<=1)))})),e.reverse()}_updateRawDomain(){this._rawDomainIndex=[];const t=this._spec.domain;for(let e=0;ethis._rawDomainIndex[e][t]=i))}}_clearRawDomain(){this._rawDomainIndex=[]}}function gD(t){if(qo(t))return[t,t,t,t];if(y(t)){const e=t.length;if(1===e){const e=t[0];return[e,e,e,e]}if(2===e){const[e,i]=t;return[e,i,e,i]}if(3===e){const[e,i,s]=t;return[e,i,s,i]}if(4===e)return t}if(vs(t)){const{top:e=0,right:i=0,bottom:s=0,left:n=0}=t;return[e,i,s,n]}return[0,0,0,0]}function mD(){u_(),hM(),vk(),Gv()}function _D(){u_(),hM(),Wx(),Gv()}mD();class fD extends Rk{getStartAngle(){return Et(this._startAngle)}getEndAngle(){return Et(this._endAngle)}getMainSegmentPoints(){return this._mainSegmentPoints}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},fD.defaultAttributes,t)),this.name="segment",this.key="segment",this.lines=[]}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,multiSegment:r,mainSegmentIndex:a}=this.attribute;if(!n)return;this._computeLineAngle();const o=this._getMainSegmentPoints(),l=this._renderSymbol(t,o,"start"),h=this._renderSymbol(e,o,"end");if(this.startSymbol=l,this.endSymbol=h,r){const t=[...this.attribute.points];if(qo(a))t[a]=this._clipPoints(t[a]);else{const e=this._clipPoints(Na(t));t[0][0]=e[0],t[t.length-1][t[t.length-1].length-1]=e[e.length-1]}t.forEach(((t,e)=>{var n,r;const a=ra.line(Object.assign(Object.assign({points:t},y(i)?null!==(n=i[e])&&void 0!==n?n:i[i.length-1]:i),{fill:!1}));a.name=`${this.name}-line`,a.id=this._getNodeId("line"+e),Ym(null==s?void 0:s.line)||(a.states=y(s.line)?null!==(r=s.line[e])&&void 0!==r?r:s.line[s.line.length-1]:s.line),this.add(a),this.lines.push(a)}))}else{let t=ra.line;Ba(i)[0].cornerRadius&&(t=ra.polygon);const e=t(Object.assign(Object.assign({points:this._clipPoints(this.attribute.points)},Ba(i)[0]),{fill:!1,closePath:!1}));e.name=`${this.name}-line`,e.id=this._getNodeId("line"),Ym(null==s?void 0:s.line)||(e.states=[].concat(s.line)[0]),this.add(e),this.lines.push(e)}}_computeStartRotate(t){return t+Math.PI/2}_computeEndRotate(t){return t+Math.PI/2}_renderSymbol(t,e,i){if(!e.length)return;const{autoRotate:s=!0}=t;let n;if(t&&t.visible){const r=this.getStartAngle(),a=this.getEndAngle(),{state:o}=this.attribute,l=e[0],h=e[e.length-1],{refX:d=0,refY:c=0,refAngle:u=0,style:p,symbolType:g,size:m=12}=t;let _,f;"start"===i?(_={x:l.x+(qo(r)?d*Math.cos(r)+c*Math.cos(r-Math.PI/2):0),y:l.y+(qo(r)?d*Math.sin(r)+c*Math.sin(r-Math.PI/2):0)},f=this._computeStartRotate(this._startAngle)):(_={x:h.x+(qo(a)?d*Math.cos(a)+c*Math.cos(a-Math.PI/2):0),y:h.y+(qo(a)?d*Math.sin(a)+c*Math.sin(a-Math.PI/2):0)},f=this._computeEndRotate(this._endAngle)),n=ra.symbol(Object.assign(Object.assign(Object.assign({},_),{symbolType:g,size:m,angle:s?f+u:0,strokeBoundsBuffer:0}),p)),n.name=`${this.name}-${i}-symbol`,n.id=this._getNodeId(`${i}-symbol`),Ym(null==o?void 0:o.symbol)||(n.states=o.symbol),"start"===i?Ym(null==o?void 0:o.startSymbol)||(n.states=o.startSymbol):Ym(null==o?void 0:o.endSymbol)||(n.states=o.endSymbol),this.add(n)}return n}_getMainSegmentPoints(){if(this._mainSegmentPoints)return this._mainSegmentPoints;const{points:t,multiSegment:e,mainSegmentIndex:i}=this.attribute;let s;return s=e?qo(i)?t[i]:Na(t):t,this._mainSegmentPoints=s,s}_clipPoints(t){const{startSymbol:e={},endSymbol:i={}}=this.attribute;let s=t;if(e.visible){const i=e.clip?e.size||10:0;s=[{x:t[0].x-i/2*(Math.cos(this._startAngle)||0),y:t[0].y-i/2*(Math.sin(this._startAngle)||0)},...s.slice(1)]}if(i.visible){const e=i.clip?i.size||10:0,n={x:t[t.length-1].x-e/2*(Math.cos(this._endAngle)||0),y:t[t.length-1].y-e/2*(Math.sin(this._endAngle)||0)};s=[...s.slice(0,s.length-1),n]}return s}_computeLineAngle(){const t=this._getMainSegmentPoints();if(t.length<=1)return;const e=t[0],i=t[1],s=t[t.length-2],n=t[t.length-1],r=[e.x-i.x,e.y-i.y],a=Math.atan2(r[1],r[0]),o=[n.x-s.x,n.y-s.y],l=Math.atan2(o[1],o[0]);this._startAngle=a,this._endAngle=l}_reset(){this.startSymbol=null,this.endSymbol=null,this._startAngle=null,this._endAngle=null,this._mainSegmentPoints=null}}function vD(t,e){return[t[0]*e,t[1]*e]}function yD(t){const[e,i]=t;return Math.sqrt(e*e+i*i)}var bD,xD;fD.defaultAttributes={visible:!0,lineStyle:{lineWidth:1,stroke:"#000"},startSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}},endSymbol:{visible:!1,autoRotate:!0,symbolType:"triangle",size:12,refX:0,refY:0,refAngle:0,style:{fill:"#000",zIndex:1}}},function(t){t.innerView="inner-view",t.axisContainer="axis-container",t.labelContainer="axis-label-container",t.tickContainer="axis-tick-container",t.tick="axis-tick",t.subTick="axis-sub-tick",t.label="axis-label",t.title="axis-title",t.gridContainer="axis-grid-container",t.grid="axis-grid",t.gridRegion="axis-grid-region",t.line="axis-line",t.background="axis-background",t.axisLabelBackground="axis-label-background",t.axisBreak="axis-break",t.axisBreakSymbol="axis-break-symbol"}(bD||(bD={})),function(t){t.selected="selected",t.selectedReverse="selected_reverse",t.hover="hover",t.hoverReverse="hover_reverse"}(xD||(xD={}));const SD={[xD.selectedReverse]:{},[xD.selected]:{},[xD.hover]:{},[xD.hoverReverse]:{}},MD={title:{space:4,padding:0,textStyle:{fontSize:12,fill:"#333333",fontWeight:"normal",fillOpacity:1}},label:{visible:!0,inside:!1,space:4,padding:0,style:{fontSize:12,fill:"#333",fontWeight:"normal",fillOpacity:1}},tick:{visible:!0,inside:!1,alignWithLabel:!0,length:4,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}},subTick:{visible:!1,inside:!1,count:4,length:2,style:{lineWidth:1,stroke:"#999",strokeOpacity:1}},line:{visible:!0,style:{lineWidth:1,stroke:"#000",strokeOpacity:1}}},kD={size:8,stroke:"#000",lineWidth:1,zIndex:1};function AD(){u_(),_y(),Gv(),ek(),df()}var wD=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nd&&(k=d,E.setAttribute("maxLineWidth",d-f[1]-f[2]))),x=0,S=0;let O=0;"left"===C||"start"===C?O=1:"right"===C||"end"===C?O=-1:"center"===C&&(O=0),O?O<0?(x-=k,b&&b.setAttribute("x",(b.attribute.x||0)-c),y.setAttribute("x",-f[1]-T)):O>0&&y.setAttribute("x",f[3]):(x-=k/2,b&&b.setAttribute("x",(b.attribute.x||0)-c/2),y.setAttribute("x",-T/2));const R="right"===_||"end"===_,I="left"===_||"start"===_;if((_?"center"===_:m)&&O){const t=k-f[1]-f[3],e=c+T,i=1===O?(t-e)/2+T+c/2:f[0]+T-(k/2+e/2-T)+c/2;if(E.setAttributes({x:i,textAlign:"center"}),b){const t=i-c/2-T+L/2;b.setAttributes({x:t})}}if(I&&1!==O){const t=k-f[1]-f[3],e=0===O?-t/2+T/2:-k+f[3]+f[1]+T,i=e+T;if(E.setAttributes({x:i,textAlign:"left"}),b){const t=e+L/2;b.setAttributes({x:t})}}if(R&&-1!==O){const t=k-f[1]-f[3],e=0===O?t/2+T/2:t;if(E.setAttributes({x:e,textAlign:"right"}),b){const t=e-c-T+L/2;b.setAttributes({x:t})}}"middle"===P?(S-=A/2,b&&b.setAttribute("y",0)):"bottom"===P?(S-=A,b&&b.setAttribute("y",-g/2),y.setAttribute("y",-f[2])):"top"===P&&(y.setAttribute("y",f[0]),b&&b.setAttribute("y",g/2))}const{visible:P}=a,O=wD(a,["visible"]);if(u&&v(P)){const t=this.createOrUpdateChild("tag-panel",Object.assign(Object.assign({},O),{visible:P&&!!s,width:k,height:A,x,y:S}),"rect");if(Ym(null==p?void 0:p.panel)||(t.states=p.panel),O.customShape){const e=O.customShape;t.pathProxy=t=>e(this,t,new qe)}this._bgRect=t}this._textShape=E,this._symbol=b,this.resetStates()}initAttributes(t,e){t=(null==e?void 0:e.skipDefault)?t:E({},TD.defaultAttributes,t),super.initAttributes(t),this.render()}addState(t,e,i){super.addState(t,e,i),this._textShape&&this._textShape.addState(t,e,i),this._bgRect&&this._bgRect.addState(t,e,i),this._symbol&&this._symbol.addState(t,e,i)}removeState(t,e){super.removeState(t,e),this._textShape&&this._textShape.removeState(t,e),this._bgRect&&this._bgRect.removeState(t,e),this._symbol&&this._symbol.removeState(t,e)}cacheStates(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p;this._tagStates=null!==(e=null===(t=this.currentStates)||void 0===t?void 0:t.slice())&&void 0!==e?e:[],this._rectStates=null!==(n=null===(s=null===(i=this._bgRect)||void 0===i?void 0:i.currentStates)||void 0===s?void 0:s.slice())&&void 0!==n?n:[],this._symbolStates=null!==(o=null===(a=null===(r=this._symbol)||void 0===r?void 0:r.currentStates)||void 0===a?void 0:a.slice())&&void 0!==o?o:[],this._textStates=null!==(d=null===(h=null===(l=this._textShape)||void 0===l?void 0:l.currentStates)||void 0===h?void 0:h.slice())&&void 0!==d?d:[],this.clearStates(),null===(c=this._bgRect)||void 0===c||c.clearStates(),null===(u=this._symbol)||void 0===u||u.clearStates(),null===(p=this._textShape)||void 0===p||p.clearStates()}resetStates(){var t,e,i;this._tagStates.length&&this.useStates(this._tagStates),this._rectStates.length&&(null===(t=this._bgRect)||void 0===t||t.useStates(this._rectStates)),this._symbolStates.length&&(null===(e=this._symbol)||void 0===e||e.useStates(this._symbolStates)),this._textStates.length&&(null===(i=this._textShape)||void 0===i||i.useStates(this._textStates))}}function LD(t){const e={};return zk(t,(t=>{"group"!==t.type&&t.id&&(e[t.id]=t)})),e}function CD(t,e){return{x:t.x+e[0],y:t.y+e[1]}}function ED(t,e,i,s=!1,n=!1){const r=[e.x-i.x,e.y-i.y];return vD(r,(s?-1:1)*(n?-1:1)*t/yD(r))}function DD(t,e,i,s,n){const r=[],a=n-s;for(let n=0;n{0===e?i=`M${t.x},${t.y}`:i+=`L${t.x},${t.y}`})),e&&(i+="Z")),i}TD.defaultAttributes={visible:!0,textStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},space:4,padding:4,shape:{fill:"#000"}};const OD=(t,e,i)=>{const s=t.target;return s!==i&&s.name&&!Ym(s.states)?(s.addState(Kk.hover,!0),zk(e,(t=>{t!==s&&t.name&&!Ym(t.states)&&t.addState(Kk.hoverReverse,!0)})),s):i},RD=(t,e,i)=>i?(zk(e,(t=>{t.name&&!Ym(t.states)&&(t.removeState(Kk.hoverReverse),t.removeState(Kk.hover))})),null):i,ID=(t,e,i)=>{const s=t.target;return i===s&&s.hasState(Kk.selected)?(zk(e,(t=>{t.name&&!Ym(t.states)&&(t.removeState(Kk.selectedReverse),t.removeState(Kk.selected))})),null):s.name&&!Ym(s.states)?(s.addState(Kk.selected,!0),zk(e,(t=>{t!==s&&t.name&&!Ym(t.states)&&t.addState(Kk.selectedReverse,!0)})),s):i};class BD extends Rk{constructor(){super(...arguments),this.name="axis",this.data=[],this.tickLineItems=[],this.subTickLineItems=[],this.axisLabelLayerSize={},this.axisLabelsContainer=null,this._onHover=t=>{this._lastHover=OD(t,this.axisContainer,this._lastHover)},this._onUnHover=t=>{this._lastHover=RD(0,this.axisContainer,this._lastHover)},this._onClick=t=>{this._lastSelect=ID(t,this.axisContainer,this._lastSelect)}}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}getBoundsWithoutRender(t){const e=k(this.attribute);E(this.attribute,t);const i=ra.group({x:this.attribute.x,y:this.attribute.y});return this.add(i),this._renderInner(i),this.removeChild(i),this.attribute=e,i.AABBBounds}render(){this._prevInnerView=this._innerView&&LD(this._innerView),this.removeAllChild(!0),this._innerView=ra.group({x:0,y:0,pickable:!1}),this.add(this._innerView),this._renderInner(this._innerView),this._bindEvent()}_bindEvent(){if(this.attribute.disableTriggerEvent)return;const{hover:t,select:e}=this.attribute;t&&(this._innerView.addEventListener("pointermove",this._onHover),this._innerView.addEventListener("pointerout",this._onUnHover)),e&&this._innerView.addEventListener("pointerdown",this._onClick)}_renderInner(t){const{title:e,label:i,tick:s,line:n,items:r}=this.attribute,a=ra.group({x:0,y:0,zIndex:1,pickable:!1});if(a.name=bD.axisContainer,a.id=this._getNodeId("container"),a.setMode(this.mode),this.axisContainer=a,t.add(a),n&&n.visible&&this.renderLine(a),r&&r.length&&(this.data=this._transformItems(r[0]),s&&s.visible&&this.renderTicks(a),i&&i.visible)){const t=ra.group({x:0,y:0,pickable:!1});t.name=bD.labelContainer,t.id=this._getNodeId("label-container"),this.axisLabelsContainer=t,a.add(t),r.forEach(((e,i)=>{const s=this.renderLabels(t,e,i),n=s.getChildren();this.beforeLabelsOverlap(n,e,s,i,r.length),this.handleLabelsOverlap(n,e,s,i,r.length),this.afterLabelsOverlap(n,e,s,i,r.length);let a=0,o=0,l="center",h="middle",d=0;n.forEach(((t,e)=>{var i;const s=t.attribute,n=null!==(i=s.angle)&&void 0!==i?i:0,r=t.AABBBounds;let c=r.width(),u=r.height();n&&(c=Math.abs(c*Math.cos(n)),u=Math.abs(u*Math.sin(n))),a=Math.max(a,c),o=Math.max(o,u),l=s.textAlign,h=s.textBaseline,0===e&&(d=s.x)})),this.axisLabelLayerSize[i]={width:a,height:o,labelPos:d,textAlign:l,textBaseline:h}}))}e&&e.visible&&this.renderTitle(a)}renderTicks(t){const e=this.getTickLineItems(),i=ra.group({x:0,y:0,pickable:!1});i.name=bD.tickContainer,i.id=this._getNodeId("tick-container"),t.add(i),e.forEach(((t,s)=>{var n;const r=ra.line(Object.assign({},this._getTickLineAttribute("tick",t,s,e)));if(r.name=bD.tick,r.id=this._getNodeId(t.id),Ym(null===(n=this.attribute.tick)||void 0===n?void 0:n.state))r.states=qk;else{const t=this.data[s],e=E({},qk,this.attribute.tick.state);Object.keys(e).forEach((i=>{ys(e[i])&&(e[i]=e[i](t.rawValue,s,t,this.data))})),r.states=e}i.add(r)})),this.tickLineItems=e;const{subTick:s}=this.attribute;if(s&&s.visible){const t=this.getSubTickLineItems();t.length&&t.forEach(((t,n)=>{const r=ra.line(Object.assign({},this._getTickLineAttribute("subTick",t,n,e)));if(r.name=bD.subTick,r.id=this._getNodeId(`${n}`),Ym(s.state))r.states=qk;else{const i=E({},qk,s.state);Object.keys(i).forEach((s=>{ys(i[s])&&(i[s]=i[s](t.value,n,t,e))})),r.states=i}i.add(r)})),this.subTickLineItems=t}}renderLabels(t,e,i){const{dataFilter:s}=this.attribute.label;s&&ys(s)&&(e=s(e,i));const n=this._transformItems(e),r=ra.group({x:0,y:0,pickable:!1});return r.name=`${bD.labelContainer}-layer-${i}`,r.id=this._getNodeId(`label-container-layer-${i}`),t.add(r),n.forEach(((t,e)=>{var s;const a=iA(this._getLabelAttribute(t,e,n,i));if(a.name=bD.label,a.id=this._getNodeId(`layer${i}-label-${t.id}`),Ym(null===(s=this.attribute.label)||void 0===s?void 0:s.state))a.states=qk;else{const s=E({},qk,this.attribute.label.state);Object.keys(s).forEach((r=>{ys(s[r])&&(s[r]=s[r](t,e,n,i))})),a.states=s}r.add(a)})),r}renderTitle(t){const e=this.getTitleAttribute(),i=new TD(Object.assign({},e));i.name=bD.title,i.id=this._getNodeId("title"),t.add(i)}getVerticalCoord(t,e,i){return CD(t,this.getVerticalVector(e,i,t))}getTickLineItems(){const{tick:t}=this.attribute,e=this.data,i=[],{alignWithLabel:s,inside:n=!1,length:r,dataFilter:a}=t;let o=1;return e.length>=2&&(o=e[1].value-e[0].value),(a&&ys(a)?a(e):e).forEach((t=>{let e=t.point,a=t.value;if(!s){const i=t.value-o/2;if(this.isInValidValue(i))return;e=this.getTickCoord(i),a=i}const l=this.getVerticalCoord(e,r,n);if("3d"===this.mode){const s=this.getVerticalVector(r,n,e);let o=0,h=0;ht(s[0])>ht(s[1])?o=rt/2*(l.x>e.x?1:-1):h=rt/2*(l.y>e.y?-1:1),i.push({start:e,end:l,value:a,id:`tick-${t.id}`,anchor:[e.x,e.y],alpha:o,beta:h})}else i.push({start:e,end:l,value:a,id:`tick-${t.id}`})})),i}getSubTickLineItems(){const{subTick:t}=this.attribute,e=[],{count:i=4,inside:s=!1,length:n=2}=t,r=this.tickLineItems,a=r.length;if(a>=2)for(let t=0;t0&&(0===p[1]?c+=(this.axisLabelLayerSize[s-1].height+Ud(this.attribute,"label.space",4))*s:c+=(this.axisLabelLayerSize[s-1].width+Ud(this.attribute,"label.space",4))*s);const g=this.getVerticalCoord(t.point,c,o),m=this.getVerticalVector(c||1,o,g),_=l?l(`${t.label}`,t,e,i,s):t.label;let{style:f}=this.attribute.label;return f=ys(f)?E({},MD.label.style,f(t,e,i,s)):f,f=E(this.getLabelAlign(m,o,f.angle),f),ys(f.text)&&(f.text=f.text({label:t.label,value:t.rawValue,index:t.index,layer:s})),Object.assign(Object.assign(Object.assign({},this.getLabelPosition(g,m,_,f)),{text:null!=d?d:_,_originText:t.label,lineHeight:null==f?void 0:f.fontSize,type:h}),f)}getLabelPosition(t,e,i,s){return t}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}release(){super.release(),this._prevInnerView=null,this._innerView=null}}function FD(t){t.forEach((t=>{if(t.rotatedBounds||!t.attribute.angle)return;const e=function(t){const e=t.AABBBounds;return{x1:e.x1,x2:e.x2,y1:e.y1,y2:e.y2,centerX:t.attribute.x,centerY:t.attribute.y,angle:t.attribute.angle}}(t),i=(r=e.centerX,a=e.centerY,o=e.angle,l=t.attribute.x,h=t.attribute.y,{x:(r-l)*Math.cos(o)+(a-h)*Math.sin(o)+l,y:(r-l)*Math.sin(o)+(h-a)*Math.cos(o)+h}),s=i.x-e.centerX,n=i.y-e.centerY;var r,a,o,l,h;e.x1+=s,e.x2+=s,e.y1+=n,e.y2+=n,e.centerX+=s,e.centerY+=n,t.rotatedBounds=e}))}const YD=Math.sin(Math.PI/10);function jD(t){const e=!D(t)&&0!==t,i=e?Math.cos(t):1;return e&&Math.abs(i)<=YD}function HD(t){const e=!D(t)&&0!==t,i=e?Math.sin(t):0;return!e||Math.abs(i)<=YD}const zD={parity:function(t){return t.filter(((t,e)=>e%2?t.setAttribute("opacity",0):1))},greedy:function(t,e){let i;return t.filter(((t,s)=>s&&ND(i,t,e)?t.setAttribute("opacity",0):(i=t,1)))}};function ND(t,e,i){const s=t.AABBBounds,n=e.AABBBounds;return i>Math.max(n.x1-s.x2,s.x1-n.x2,n.y1-s.y2,s.y1-n.y2)&&(!t.rotatedBounds||!e.rotatedBounds||i>Math.max(e.rotatedBounds.x1-t.rotatedBounds.x2,t.rotatedBounds.x1-e.rotatedBounds.x2,e.rotatedBounds.y1-t.rotatedBounds.y2,t.rotatedBounds.y1-e.rotatedBounds.y2))}function VD(t,e){for(let i,s=1,n=t.length,r=t[0];s1&&e.height()>1}function GD(t,e){if(Ym(t))return;const i=t.filter(WD);if(Ym(i))return;let s;s=function(t){return t.forEach((t=>t.setAttribute("opacity",1))),t}(i),FD(s);const{method:n="parity",separation:r=0}=e,a=ys(n)?n:zD[n]||zD.parity;if(s.length>=3&&VD(s,r)){do{s=a(s,r)}while(s.length>=3&&VD(s,r));if(s.length<3||e.lastVisible){const t=Fa(i);if(!t.attribute.opacity){const e=s.length;if(e>1){t.setAttribute("opacity",1);for(let i=e-1;i>=0&&ND(s[i],t,r);i--)s[i].setAttribute("opacity",0)}}}}i.forEach((t=>{t.setAttribute("visible",!!t.attribute.opacity)}))}function UD(t){for(let s=1;s{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},KD(t,e.attribute.angle)),{angle:XD(e.attribute.angle)}))}))}(t,e),"left"!==t&&"right"!==t||function(t,e){e.forEach(((e,i)=>{e.attribute.angle&&e.setAttributes(Object.assign(Object.assign({},qD(t,e.attribute.angle)),{angle:XD(e.attribute.angle)}))}))}(t,e),FD(e)}function XD(t=0){if(t<0)for(;t<0;)t+=2*Math.PI;if(t>0)for(;t>=2*Math.PI;)t-=2*Math.PI;return t}function KD(t,e=0){let i=["center","left","left","left","center","right","right","right","left"],s=["top","top","middle","bottom","bottom","bottom","middle","top","top"];"top"===t&&(i=["center","right","right","right","center","left","left","left","right"],s=["bottom","bottom","middle","top","top","top","middle","bottom","bottom"]);const n=(e=XD(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}function qD(t,e=0){let i=["right","right","center","left","left","left","center","right","right"],s=["middle","middle","top","top","middle","middle","bottom","bottom","middle"];"right"===t&&(i=["left","left","center","right","right","right","center","left","left"],s=["middle","middle","bottom","bottom","middle","middle","top","middle","middle"]);const n=(e=XD(e))/(.5*Math.PI);let r;return r=n===Math.floor(n)?2*Math.floor(n):2*Math.floor(n)+1,{textAlign:i[r],textBaseline:s[r]}}class ZD{isInValidValue(t){return t<0||t>1}getTickCoord(t){const{start:e}=this.attribute,i=this.getRelativeVector();return{x:e.x+i[0]*t,y:e.y+i[1]*t}}getRelativeVector(t){const{start:e,end:i}=this.attribute;return[i.x-e.x,i.y-e.y]}getVerticalVector(t,e=!1,i){const{verticalFactor:s=1}=this.attribute,n=function(t){let e=yD(t);return e>0&&(e=1/e),[t[0]*e,t[1]*e]}(this.getRelativeVector());return vD([n[1],-1*n[0]],t*(e?1:-1)*s)}}const JD=["radius","startAngle","endAngle",...fn];class QD extends Mn{constructor(t={radius:1}){super(t),this.type="circle",this.numberType=In}isValid(){return super.isValid()&&this._isValid()}_isValid(){const{startAngle:t,endAngle:e,radius:i}=this.attribute;return this._validNumber(t)&&this._validNumber(e)&&this._validNumber(i)}getGraphicTheme(){return ps(this).circle}updateAABBBounds(t,e,i,s){this.updatePathProxyAABBBounds(i)||(s?this.updateCircleAABBBoundsImprecise(t,e,i):this.updateCircleAABBBoundsAccurate(t,e,i));const{tb1:n,tb2:r}=xi.graphicService.updateTempAABBBounds(i);return Uv(t,e,n),i.union(n),n.setValue(r.x1,r.y1,r.x2,r.y2),xi.graphicService.transformAABBBounds(t,i,e,!1,this),i}updateCircleAABBBoundsImprecise(t,e,i){const{radius:s=e.radius}=t;return i.set(-s,-s,s,s),i}updateCircleAABBBoundsAccurate(t,e,i){const{startAngle:s=e.startAngle,endAngle:n=e.endAngle,radius:r=e.radius}=t;return n-s>lt-nt?i.set(-r,-r,r,r):ln(s,n,r,i),i}needUpdateTags(t){return super.needUpdateTags(t,JD)}needUpdateTag(t){return super.needUpdateTag(t,JD)}toCustomPath(){var t,e,i;const s=this.attribute,n=null!==(t=s.radius)&&void 0!==t?t:this.getDefaultAttribute("radius"),r=null!==(e=s.startAngle)&&void 0!==e?e:this.getDefaultAttribute("startAngle"),a=null!==(i=s.endAngle)&&void 0!==i?i:this.getDefaultAttribute("endAngle"),o=new qe;return o.arc(0,0,n,r,a),o}clone(){return new QD(Object.assign({},this.attribute))}getNoWorkAnimateAttr(){return QD.NOWORK_ANIMATE_ATTR}}function tP(t){return new QD(t)}QD.NOWORK_ANIMATE_ATTR=Sn;const eP=new class{constructor(){this.time=ge.afterFillStroke,this.useStyle=!0,this.order=0}drawShape(t,e,i,s,n,r,a,o,l,h,d,c){const{outerBorder:u,innerBorder:p}=t.attribute,g=u&&!1!==u.visible,m=p&&!1!==p.visible;if(!g&&!m)return;const{radius:_=l.radius,startAngle:f=l.startAngle,endAngle:v=l.endAngle,opacity:y=l.opacity,x:b=l.x,y:x=l.y,scaleX:S=l.scaleX,scaleY:M=l.scaleY}=t.attribute,k=(n,r)=>{const a=!(!n||!n.stroke),{distance:o=l[r].distance}=n,h=Da(e,o,e.dpr),d="outerBorder"===r?1:-1;if(e.beginPath(),e.arc(i,s,_+d*h,f,v),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),c)c(e,n,l[r]);else if(a){const a=l[r].opacity;l[r].opacity=y,e.setStrokeStyle(t,n,(b-i)/S,(x-s)/M,l[r]),l[r].opacity=a,e.stroke()}};g&&k(u,"outerBorder"),m&&k(p,"innerBorder")}},iP=Co,sP=go;var nP=function(t,e){return function(i,s){e(i,s,t)}};let rP=class extends bo{constructor(t){super(),this.circleRenderContribitions=t,this.numberType=In,this.builtinContributions=[eP,sP,iP],this.init(t)}drawShape(t,e,i,s,n,r,a,o){const l=ps(t,null==r?void 0:r.theme).circle,{radius:h=l.radius,startAngle:d=l.startAngle,endAngle:c=l.endAngle,x:u=l.x,y:p=l.y}=t.attribute,g=this.valid(t,l,a,o);if(!g)return;const{fVisible:m,sVisible:_,doFill:f,doStroke:v}=g;e.beginPath(),e.arc(i,s,h,d,c),e.closePath(),e.setShadowBlendStyle&&e.setShadowBlendStyle(t,t.attribute,l),this.beforeRenderStep(t,e,i,s,f,v,m,_,l,n,a,o),f&&(a?a(e,t.attribute,l):m&&(e.setCommonStyle(t,t.attribute,u-i,p-s,l),e.fill())),v&&(o?o(e,t.attribute,l):_&&(e.setStrokeStyle(t,t.attribute,u-i,p-s,l),e.stroke())),this.afterRenderStep(t,e,i,s,f,v,m,_,l,n,a,o)}draw(t,e,i,s){const n=ps(t,null==s?void 0:s.theme).circle;this._draw(t,n,!1,i,s)}};rP=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),nP(0,$(K)),nP(0,X(io)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],rP);let aP=!1;const oP=new B((t=>{aP||(aP=!0,t(rP).toSelf().inSingletonScope(),t(mr).to(rP).inSingletonScope(),t(_r).toService(mr),t(io).toService(mo),Z(t,io))}));let lP=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=In}};lP=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],lP);let hP=!1;const dP=new B(((t,e,i,s)=>{hP||(hP=!0,t(z_).to(lP).inSingletonScope(),t(tf).toService(z_))}));let cP=class extends Hv{constructor(t){super(),this.canvasRenderer=t,this.type="circle",this.numberType=In}};cP=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V(),function(t,e){return function(i,s){e(i,s,t)}}(0,$(mr)),function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)}("design:paramtypes",[Object])],cP);let uP=!1;const pP=new B(((t,e,i,s)=>{uP||(uP=!0,t(C_).to(cP).inSingletonScope(),t(w_).toService(C_))}));function gP(){gP.__loaded||(gP.__loaded=!0,ra.RegisterGraphicCreator("circle",tP),Ui.load(oP),Ui.load(A_?dP:pP))}gP.__loaded=!1;const mP=gP;function _P(){u_(),hM(),ek(),df()}var fP=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const{startPoint:s,endPoint:n,breakSymbol:r,rawRange:a}=e;if(!1!==(null==r?void 0:r.visible)){const e=ra.group({zIndex:999});e.name=bD.axisBreak,e.id=this._getNodeId(`${bD.axisBreak}-${i}`),e.data=a;const o=function(t={}){var e,i;const{style:s={},angle:n=.5*Math.PI}=t,r=E({},kD,s),a=null!==(e=r.size)&&void 0!==e?e:kD.size;return Object.assign(Object.assign({},r),{symbolType:null!==(i=r.symbolType)&&void 0!==i?i:`M ${-a/2} ${a*Math.sin(n)} L ${a/2} ${-a*Math.sin(n)}`,symbolSize:a})}(r),l=ra.symbol(Object.assign({x:s.x,y:s.y},o));l.name=bD.axisBreakSymbol;const h=ra.symbol(Object.assign({x:n.x,y:n.y},o));h.name=bD.axisBreakSymbol,e.add(l),e.add(h),t.add(e)}}));const{panel:i}=this.attribute;if(i&&i.visible){const t=this.axisContainer,s=t.AABBBounds,n=ra.rect(Object.assign({x:s.x1,y:s.y1,width:s.width(),height:s.height()},i.style));n.name=bD.background,n.id=this._getNodeId("background"),n.states=E({},SD,null!==(e=i.state)&&void 0!==e?e:{}),t.insertBefore(n,t.firstChild)}}renderLine(t){const{start:e,end:i,line:s}=this.attribute,n=s,{startSymbol:r,endSymbol:a,style:o,state:l}=n,h=fP(n,["startSymbol","endSymbol","style","state"]),d=Object.assign({startSymbol:r,endSymbol:a,lineStyle:o},h);if(this._breaks&&this._breaks.length){const t=[];let s=e;this._breaks.forEach((e=>{const{startPoint:i,endPoint:n}=e;t.push([s,i]),s=n})),t.push([s,i]),d.points=t,d.multiSegment=!0}else d.points=[e,i];Ym(l)||(d.state={line:E({},SD,l),symbol:E({},SD,l)});const c=new fD(d);c.name=bD.line,c.id=this._getNodeId("line"),t.add(c)}getTextAlign(t){let e="center";return hd(t[0],0)?hd(t[1],0)?Object.is(t[1],-0)?e="start":Object.is(t[0],-0)&&(e="end"):e="center":t[0]>0?e="start":t[0]<0&&(e="end"),e}getTitleAttribute(){var t,e,i;const s=this.attribute.title,{position:n="middle",space:r=4,textStyle:a={},autoRotate:o=!0,shape:l,background:h,state:d={},maxWidth:c}=s,u=fP(s,["position","space","textStyle","autoRotate","shape","background","state","maxWidth"]);let p=.5;"start"===n?p=0:"end"===n&&(p=1);const{verticalFactor:g=1}=this.attribute,m=-1*g,_=this.getTickCoord(p),f=this.getRelativeVector();let v=0;if((null===(t=this.attribute.label)||void 0===t?void 0:t.visible)&&!1===this.attribute.label.inside){const t=+Ud(this.attribute,"label.space",4);v+=t;const e=Object.keys(this.axisLabelLayerSize).length;if(0===f[1]){const i=this.axisLabelsContainer?this.axisLabelsContainer.AABBBounds.height():0;isFinite(i)?v+=i+(e-1)*t:v=0}else if(0===f[0])if(this.axisLabelsContainer&&this.axisLabelsContainer.AABBBounds&&!this.axisLabelsContainer.AABBBounds.empty()){const i=this.axisLabelLayerSize[0].labelPos,s=this.axisLabelsContainer.AABBBounds;v+=(1===m?s.x2>i?Math.min(s.x2-i,s.width()):0:s.x1{v+=this.axisLabelLayerSize[e].width+(i>0?t:0)}))}let y=0;(null===(e=this.attribute.tick)||void 0===e?void 0:e.visible)&&!1===this.attribute.tick.inside&&(y=this.attribute.tick.length||4),(null===(i=this.attribute.subTick)||void 0===i?void 0:i.visible)&&!1===this.attribute.subTick.inside&&(y=Math.max(y,this.attribute.subTick.length||2));const b=y+v+r,x=this.getVerticalCoord(_,b,!1),S=this.getVerticalVector(b,!1,{x:0,y:0});let M,k,{angle:A}=u;if(M="start"===n?"start":"end"===n?"end":"center",D(A)&&o){A=function(t,e,i){const s=function(t,e){const[i,s]=t,[n,r]=e,a=Math.sqrt((i*i+s*s)*(n*n+r*r)),o=a&&(i*n+s*r)/a;return Math.acos(Math.min(Math.max(o,-1),1))}(t,e),n=yt(t,e)>=0;return i?n?2*Math.PI-s:s:n?s:2*Math.PI-s}(f,[1,0],!0);const{verticalFactor:t=1}=this.attribute;k=1==-1*t?"bottom":"top"}else M=this.getTextAlign(S),k=this.getTextBaseline(S,!1);let w=c;if(D(w)){const{verticalLimitSize:t,verticalMinSize:e,orient:i}=this.attribute,s=Math.min(t||1/0,e||1/0);if(qo(s))if("bottom"===i||"top"===i)if(A!==Math.PI/2){const t=Math.abs(Math.cos(null!=A?A:0));w=t<1e-6?1/0:this.attribute.end.x/t}else w=s-b;else if(A&&0!==A){const t=Math.abs(Math.sin(A));w=t<1e-6?1/0:this.attribute.end.y/t}else w=s-b}const T=Object.assign(Object.assign(Object.assign({},x),u),{maxWidth:w,textStyle:Object.assign({textAlign:M,textBaseline:k},a),state:{text:E({},SD,d.text),shape:E({},SD,d.shape),panel:E({},SD,d.background)}});return T.angle=A,l&&l.visible&&(T.shape=Object.assign({visible:!0},l.style),l.space&&(T.space=l.space)),h&&h.visible&&(T.panel=Object.assign({visible:!0},h.style)),T}getTextBaseline(t,e){let i="middle";const{verticalFactor:s=1}=this.attribute,n=(e?1:-1)*s;return hd(t[1],0)?i=!hd(t[0],0)||Object.is(t[0],-0)||Object.is(t[1],-0)?"middle":1===n?"bottom":"top":t[1]>0?i="top":t[1]<0&&(i="bottom"),i}getLabelAlign(t,e,i){const s=this.attribute.orient;if(["top","bottom","right","left"].includes(s)||0===t[0]&&0===t[1]){if("top"===s||"bottom"===s)return KD(e?"bottom"===s?"top":"bottom":s,i);if("left"===s||"right"===s)return qD(e?"left"===s?"right":"left":s,i)}return{textAlign:this.getTextAlign(t),textBaseline:this.getTextBaseline(t,e)}}beforeLabelsOverlap(t,e,i,s,n){var r,a,o,l;const{flush:h=!1}=this.attribute.label||{};if(h&&t.length){const{orient:e,start:i,end:s}=this.attribute,n="bottom"===e||"top"===e,h=t[0],d=Fa(t),c=n?h.attribute.x>d.attribute.x:h.attribute.yo&&(e.attribute.angle?e.setAttributes({dx:(null!==(a=e.attribute.dx)&&void 0!==a?a:0)+o-u}):e.setAttributes({x:o,textAlign:"right"}))}else{const t=c?d:h,e=c?h:d,n=t.AABBBounds.y2,r=e.AABBBounds.y1,a=i.y,u=s.y;ru&&(t.attribute.angle?t.setAttributes({dy:(null!==(l=t.attribute.dy)&&void 0!==l?l:0)+u-n}):t.setAttributes({y:u,textBaseline:"bottom"}))}}}handleLabelsOverlap(t,e,i,s,n){if(Ym(t))return;const{verticalLimitSize:r,label:a,orient:o}=this.attribute,l=this._getAxisLabelLimitLength(r,n),{layoutFunc:h,autoRotate:d,autoRotateAngle:c,autoLimit:u,limitEllipsis:p,autoHide:g,autoHideMethod:m,autoHideSeparation:_,lastVisible:f,autoWrap:v,overflowLimitLength:y}=a;if(ys(h))h(t,e,s,this);else{if(d?function(t,e){if(Ym(t))return;const{orient:i,labelRotateAngle:s=[0,45,90]}=e;if(0===s.length||t.some((t=>!!t.attribute.angle)))return;let n=0,r=0;for(s&&s.length>0&&(r=s.length);n{t.attribute.angle=At(e)})),$D(i,t),!UD(t))break}}(t,{labelRotateAngle:c,orient:o}):v&&function(t,e){const{limitLength:i,axisLength:s,ellipsis:n="...",orient:r}=e;if(Ym(t)||!qo(i))return;const a=s/t.length;t.forEach((t=>{var e;const s=t.attribute.angle,o=HD(s),l=jD(s),h="top"===r||"bottom"===r;if(h){if(l&&Math.floor(t.AABBBounds.height())<=i)return;if(o&&Math.floor(t.AABBBounds.width())<=a)return}else{if(l&&Math.floor(t.AABBBounds.height())<=a)return;if(o&&Math.floor(t.AABBBounds.width())<=i)return}let d=null,c=null;h?l?(d=i,c=a):(d=a,c=i):l?(d=a,c=i):(d=i,c=a),t.setAttributes({maxLineWidth:d,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n,whiteSpace:"normal",heightLimit:c})}))}(t,{orient:o,limitLength:l,axisLength:"left"===o||"right"===o?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x),ellipsis:p}),!v&&u&&qo(l)&&l>0){const e="left"===o||"right"===o,i=e?Math.abs(this.attribute.start.y-this.attribute.end.y):Math.abs(this.attribute.start.x-this.attribute.end.x);!function(t,e){const{limitLength:i,verticalLimitLength:s,ellipsis:n="...",orient:r,axisLength:a}=e;if(Ym(t)||!qo(i))return;Math.sin(Math.PI/10);const o=function(t){return qo(t)?{left:t,right:t}:vs(t)?{left:t.left||0,right:t.right||0}:{left:0,right:0}}(e.overflowLimitLength);t.forEach((t=>{var e;const l=t.attribute.angle,h=!D(l),d=h?Math.cos(l):1,c=h?Math.sin(l):0,u=HD(l),p=jD(l),g="top"===r||"bottom"===r;if(g){if(p&&Math.floor(t.AABBBounds.height())<=i)return;if(u&&Math.floor(t.AABBBounds.width())<=s)return}const m=t.attribute.direction;if(!g){if("vertical"===m&&Math.floor(t.AABBBounds.height())<=s)return;if("vertical"!==m){if(u&&Math.floor(t.AABBBounds.width())<=i)return;if(p&&Math.floor(t.AABBBounds.height())<=s)return}}let _=null;if(u||p)_=g?u?s:i:"vertical"===m||p?s:i;else if(g){const{x1:e,x2:s}=t.AABBBounds,n=c/d,r=Math.abs(i/c);if(n>0&&e<=a&&i/n+e>a){const t=(a-e)/Math.abs(d)+o.right;_=Math.min(t,r)}else if(n<0&&s>=0&&i/n+s<0){const t=s/Math.abs(d)+o.left;_=Math.min(t,r)}else _=r}else _=Math.abs(i/d);qo(t.attribute.maxLineWidth)&&(_=qo(_)?Math.min(t.attribute.maxLineWidth,_):t.attribute.maxLineWidth),t.setAttributes({maxLineWidth:_,ellipsis:null!==(e=t.attribute.ellipsis)&&void 0!==e?e:n})}))}(t,{limitLength:l,verticalLimitLength:e?i/t.length:g||d?1/0:i/t.length,ellipsis:p,orient:o,axisLength:i,overflowLimitLength:y})}g&&GD(t,{orient:o,method:m,separation:_,lastVisible:f})}}afterLabelsOverlap(t,e,i,s,n){const{verticalLimitSize:r,orient:a}=this.attribute,o="bottom"===a||"top"===a,l=i.AABBBounds;let h=o?l.height():l.width();const{verticalMinSize:d}=this.attribute;if(qo(d)&&(!qo(r)||d<=r)){const t=this._getAxisLabelLimitLength(d,n);let e,s;h=Math.max(h,t),"left"===a?(e=l.x2-h,s=l.y1):"right"===a?(e=l.x1,s=l.y1):"top"===a?(e=l.x1,s=l.y2-h):"bottom"===a&&(e=l.x1,s=l.y1);const r=ra.rect({x:e,y:s,width:o?l.width():h,height:o?h:l.height(),pickable:!1});r.name=bD.axisLabelBackground,r.id=this._getNodeId("axis-label-background"),i.insertBefore(r,i.firstChild)}if(M(this.attribute.label.containerAlign)){let e;"left"===a?e=l.x2-h:"right"===a?e=l.x1:"top"===a?e=l.y2-h:"bottom"===a&&(e=l.y1),function(t,e,i,s,n){"left"===s||"right"===s?"left"===n?t.forEach((t=>{var i;t.setAttributes({dx:(null!==(i=t.attribute.dx)&&void 0!==i?i:0)+e-t.AABBBounds.x1})})):"right"===n?t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i-t.AABBBounds.x2})})):"center"===n&&t.forEach((t=>{var s;t.setAttributes({dx:(null!==(s=t.attribute.dx)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.x1+t.AABBBounds.x2)/2})})):"bottom"!==s&&"top"!==s||("top"===n?t.forEach((t=>{var i;t.setAttributes({dy:(null!==(i=t.attribute.dy)&&void 0!==i?i:0)+e-t.AABBBounds.y1})})):"bottom"===n?t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i-t.AABBBounds.y2})})):"middle"===n&&t.forEach((t=>{var s;t.setAttributes({dy:(null!==(s=t.attribute.dy)&&void 0!==s?s:0)+e+i/2-(t.AABBBounds.y1+t.AABBBounds.y2)/2})})))}(t,e,h,a,this.attribute.label.containerAlign)}}_getAxisLabelLimitLength(t,e){var i,s,n,r,a;const{label:o,title:l,line:h,tick:d}=this.attribute,c=null!==(i=o.space)&&void 0!==i?i:4;let u=t,p=0,g=0;const m=h&&h.visible?null!==(s=h.style.lineWidth)&&void 0!==s?s:1:0,_=d&&d.visible?null!==(n=d.length)&&void 0!==n?n:4:0;if(l&&l.visible&&"string"==typeof l.text){p=Qk(l.text,l.textStyle,null===(a=null===(r=this.stage)||void 0===r?void 0:r.getTheme())||void 0===a?void 0:a.text).height;const t=gD(l.padding);g=l.space+t[0]+t[2]}return u&&(u=(u-c-g-p-m-_)/e),u}release(){super.release(),this._breaks=null}}vP.defaultAttributes=MD,JA(vP,ZD);class yP{isInValidValue(t){const{startAngle:e=Uk,endAngle:i=$k}=this.attribute;return Math.abs(i-e)%(2*Math.PI)==0?t>1:t<0||t>1}getTickCoord(t){const{startAngle:e=Uk,endAngle:i=$k,center:s,radius:n,inside:r=!1,innerRadius:a=0}=this.attribute;return Tt(s,r&&a>0?a:n,e+(i-e)*t)}getVerticalVector(t,e=!1,i){return ED(t,i,this.attribute.center,e,this.attribute.inside)}getRelativeVector(t){const{center:e}=this.attribute;return[t.y-e.y,-1*(t.x-e.x)]}}function bP(t,e){const i=t.length;return{prevLabel:e>=1?t[e-1]:t[i-1],nextLabel:e=3){const{prevLabel:i,nextLabel:n}=bP(t,e);s.push(i,n)}else 2===t.length&&s.push(t[0===e?1:0]);const n=t[e];let r=Math.min(Math.abs(n.attribute.y-i.y1),Math.abs(n.attribute.y-i.y2));s.forEach((t=>{r=Math.min(r,Math.abs(t.attribute.y-n.attribute.y))})),r>0&&n.setAttributes({whiteSpace:"normal",heightLimit:r})}_P(),mP();class MP extends BD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},MP.defaultAttributes,t))}renderLine(t){const{startAngle:e=Uk,endAngle:i=$k,radius:s,center:n,innerRadius:r=0,line:a={},inside:o=!1,sides:l}=this.attribute;let h,d=s,c=r;if(o&&r>0&&(d=r,c=0),qo(l)&&l>=3){const t=DD(n,l,d,e,i);h=ra.path(Object.assign(Object.assign({},a.style),{path:PD(t,!0)}))}else{const t=Object.assign(Object.assign(Object.assign({},n),{startAngle:e,endAngle:i,radius:d,innerRadius:c}),a.style);h=ra.circle(t)}h.name=bD.line,h.id=this._getNodeId("line"),Ym(a.state)||(h.states=E({},SD,a.state)),t.add(h)}getTitleAttribute(){var t,e,i;const{center:s,radius:n,innerRadius:r=0}=this.attribute,a=this.attribute.title,{space:o=4,textStyle:l={},shape:h,background:d,state:c={}}=a,u=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n=2){const i=this.data[1].value-this.data[0].value,h=null===(e=null===(t=this.attribute)||void 0===t?void 0:t.tick)||void 0===e?void 0:e.alignWithLabel;for(let t=0;t{const{x:o,y:l}=e.attribute,h=e.AABBBounds;if(hd(o,a.x)){if(l>n.y2||l=3){const{prevLabel:n,nextLabel:a}=bP(t,s);let l=n.attribute.x,h=a.attribute.x;l>h&&(l=a.attribute.x,h=n.attribute.x);const d=l===h?r:o>=l&&o<=h?h-l:Math.min(Math.abs(l-o),Math.abs(h-o));e.AABBBounds.width()>d&&xP(e,d,i)}else e.AABBBounds.width()>r&&xP(e,r,i)}else o>a.x&&h.x2>n.x2?(xP(e,n.x2-o,i),r&&SP(t,s,n)):o0?"top":"middle"}getLabelAlign(t,e,i){return hd(t[0],0)?{textAlign:"center",textBaseline:t[1]>0?"top":"bottom"}:t[0]<0?{textAlign:"right",textBaseline:this.getTextBaseline(t)}:t[0]>0?{textAlign:"left",textBaseline:this.getTextBaseline(t)}:{textAlign:"center",textBaseline:"middle"}}getLabelPosition(t,e,i,s){return t}}MP.defaultAttributes=MD,JA(MP,yP);class kP extends e_{parseAddition(t){return super.parseAddition(t),this.scale(t.scale),this}scale(t){if(this.spec.scale){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this.detach(t),this.spec.scale=void 0}const e=S(t)?this.view.getScaleById(t):t;return this.spec.scale=e,this.attach(e),this._updateComponentEncoders(),this.commit(),this}getScale(){return S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale}}const AP=(t,e,i,s,n,r)=>{var a;const o=t.getCoordinateAxisPosition();n&&"auto"===n.position&&(n.position=i?"content":o);const l=t.getCoordinateAxisPoints(s);if(l){const s={start:l[0],end:l[1],verticalFactor:("top"===o||"left"===o?-1:1)*(i?-1:1)*((null===(a=t.getSpec().range)||void 0===a?void 0:a.reversed)?-1:1)};if(r&&"polar"===e.type){const t=e.angle();s.center=e.origin(),s.startAngle=t[0],s.endAngle=t[1]}return s}const h=e.radius(),d=e.angle();return{center:e.origin(),radius:h[1],innerRadius:h[0],inside:i,startAngle:d[0],endAngle:d[1]}};class wP extends kP{constructor(t,e,i){super(t,Qd.axis,e),this.spec.componentType=Qd.axis,this.mode=i}parseAddition(t){return super.parseAddition(t),this.axisType(t.axisType),this.tickCount(t.tickCount),this.inside(t.inside),this.baseValue(t.baseValue),this}scale(t){return super.scale(t),this._axisComponentType=null,this}axisType(t){return this.spec.axisType=t,this._axisComponentType=null,this._prepareRejoin(),this.commit(),this}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=_c.createGraphicComponent(this._getAxisComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}getAxisComponentType(){return this._axisComponentType}_updateComponentEncoders(){const t=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale,e=Object.assign({update:{}},this.spec.encode),i=Object.keys(e).reduce(((i,s)=>{const n=e[s];return n&&(i[s]={callback:(e,i,s)=>{var r,a;const o=this.spec.skipTheme?null:this.view.getCurrentTheme();let l=Pm(n,e,i,s);const h=Gp(this.spec.inside,s,e,i),d=Gp(this.spec.baseValue,s,e,i),c=null===(r=null==t?void 0:t.getCoordinate)||void 0===r?void 0:r.call(t);c&&(l=Object.assign(AP(t,c,h,d,this.spec.layout),l));const u=null===(a=null==t?void 0:t.getScale)||void 0===a?void 0:a.call(t),p=Gp(this.spec.tickCount,s,e,i);switch(this._getAxisComponentType()){case ec.lineAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.axis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p);case ec.circleAxis:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleAxis)&&void 0!==r?r:{};return t?E({},l,{items:[(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))]},null!=i?i:{}):E({},l,null!=i?i:{})})(u,o,l,p)}return l}}),i}),{});this._encoders=i}_getAxisComponentType(){var t;if(this._axisComponentType)return this._axisComponentType;let e=this.spec.axisType;if(D(e)){const i=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;e=(null===(t=null==i?void 0:i.getCoordinate)||void 0===t?void 0:t.call(i))?i.getCoordinateAxisPoints()?"line":"circle":"line"}return this._axisComponentType="circle"===e?ec.circleAxis:ec.lineAxis,this._axisComponentType}}wP.componentType=Qd.axis;const TP=()=>{_c.registerGraphicComponent(ec.lineAxis,((t,e)=>new vP(t,e))),_c.registerComponent(Qd.axis,wP)},LP=()=>{_c.registerGraphicComponent(ec.circleAxis,(t=>new MP(t))),_c.registerComponent(Qd.axis,wP)};function CP(t,e,i,s){let n="";if(!t||0===e.length)return n;const r=e[0],a=be.distancePP(t,r),o=i?0:1;return s?n+=`M${t.x},${t.y-a}A${a},${a},0,0,${o},${t.x},${t.y+a}A${a},${a},0,0,${o},${t.x},${t.y-a}Z`:e.forEach(((t,e)=>{0===e?n=`M${t.x},${t.y}`:n+=`A${a},${a},0,0,${o},${t.x},${t.y}`})),n}function EP(t,e,i){const{type:s,closed:n}=i,r=e.slice(0).reverse();let a="",o="";if("line"===s&&i.smoothLink&&i.center){const e=t[0],s=r[0],l=i.center;a=PD(t,!!n),o=PD(r,!!n);const h=be.distancePP(s,l),d=be.distancePP(e,l);a+=`A${h},${h},0,0,1,${s.x},${s.y}L${s.x},${s.y}`,o+=`A${d},${d},0,0,0,${e.x},${e.y}`}else if("circle"===s){const{center:e}=i;a=CP(e,t,!1,!!n),o=CP(e,r,!0,!!n)}else"line"!==s&&"polygon"!==s||(a=PD(t,!!n),o=PD(r,!!n));return n?a+=o:(o="L"+o.substring(1),a+=o,a+="Z"),a}class DP extends Rk{constructor(){super(...arguments),this.name="axis-grid",this.data=[]}getInnerView(){return this._innerView}getPrevInnerView(){return this._prevInnerView}render(){this._prevInnerView=this._innerView&&LD(this._innerView),this.removeAllChild(!0),this._innerView=ra.group({x:0,y:0,pickable:!1}),this.add(this._innerView);const{items:t,visible:e}=this.attribute;t&&t.length&&!1!==e&&(this.data=this._transformItems(t),this._renderGrid(this._innerView))}getVerticalCoord(t,e,i){return CD(t,this.getVerticalVector(e,i,t))}_transformItems(t){const e=[];return t.forEach((t=>{var i;e.push(Object.assign(Object.assign({},t),{point:this.getTickCoord(t.value),id:null!==(i=t.id)&&void 0!==i?i:t.label}))})),e}_renderGrid(t){const{visible:e}=this.attribute.subGrid||{};e&&this._renderGridByType(!0,t),this._renderGridByType(!1,t)}_renderGridByType(t,e){const i=E({},this.attribute,this.getGridAttribute(t)),{type:s,items:n,style:r,closed:a,alternateColor:o,depth:l=0}=i,h=t?`${bD.grid}-sub`:`${bD.grid}`;if(n.forEach(((t,i)=>{const{id:n,points:o}=t;let d="";if("line"===s||"polygon"===s)d=PD(o,!!a);else if("circle"===s){const{center:t}=this.attribute;d=CP(t,o,!1,!!a)}const c=ra.path(Object.assign({path:d,z:l},ys(r)?E({},this.skipDefault?null:DP.defaultAttributes.style,r(t,i)):r));c.name=`${h}-line`,c.id=this._getNodeId(`${h}-path-${n}`),e.add(c)})),l&&"line"===s&&n.forEach(((t,i)=>{const{id:s,points:n}=t,o=[];o.push(n[0]);const d=n[1].x-n[0].x,c=n[1].y-n[0].y,u=Math.sqrt(d*d+c*c),p=l/u;o.push({x:n[0].x+d*p,y:n[0].y+c*p});const g=PD(o,!!a),m=ht(o[0].x-o[1].x),_=ht(o[0].y-o[1].y),f=ra.path(Object.assign({path:g,z:0,alpha:m>_?(n[1].x-n[0].x>0?-1:1)*rt/2:0,beta:m<_?-rt/2:0,anchor3d:m>_?[o[0].x,0]:[0,o[0].y]},ys(r)?E({},this.skipDefault?null:DP.defaultAttributes.style,r(t,i)):r));f.name=`${h}-line`,f.id=this._getNodeId(`${h}-path-${s}`),e.add(f)})),n.length>1&&o){const t=y(o)?o:[o,"transparent"],s=e=>t[e%t.length];for(let t=0;t=2&&(t=this.data[1].value-this.data[0].value),t}_getPointsOfSubGrid(t,e){const i=this.data.length,s=[];return i>=2&&this.data.forEach((i=>{let n=i.value;if(!e){const e=i.value-t/2;if(this.isInValidValue(e))return;n=e}s.push({value:n})})),s}release(){super.release(),this._prevInnerView=null,this._innerView=null}}DP.defaultAttributes={style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]},subGrid:{visible:!1,style:{lineWidth:1,stroke:"#999",strokeOpacity:1,lineDash:[4,4]}}},u_(),wM();class PP extends DP{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},DP.defaultAttributes,t),e)}_getGridPoint(t,e){let i;if("line"===t){const{length:t}=this.attribute;i=[e,this.getVerticalCoord(e,t,!0)]}else if("circle"===t||"polygon"===t){const{center:t,sides:s=6,startAngle:n=Uk,endAngle:r=$k}=this.attribute;i=DD(t,s,be.distancePP(t,e),n,r)}return i}getGridAttribute(t){const{type:e,alignWithLabel:i=!0}=this.attribute,s=this._parseTickSegment();let n,r=[];if(t){n=E({},this.attribute,this.attribute.subGrid);const t=[],{count:a=4}=this.attribute.subGrid||{};if(this.data.length>=2){const n=this._getPointsOfSubGrid(s,i);for(let i=0;i{let{point:r}=n;if(!i){const t=n.value-s/2;if(this.isInValidValue(t))return;r=this.getTickCoord(t)}t.push({id:n.label,datum:n,points:this._getGridPoint(e,r)})})),r=t}return Object.assign(Object.assign({},n),{items:r})}}JA(PP,ZD);u_(),wM();class OP extends DP{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},DP.defaultAttributes,t),e)}getGridAttribute(t){let e,i=[];const s=this.attribute,{radius:n,innerRadius:r=0,startAngle:a=Uk,endAngle:o=$k,center:l,subGrid:h}=s,d=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n=2){const e=this._getPointsOfSubGrid(p,c);for(let i=0;i{let{point:i}=e;if(!c){const t=e.value-p/2;if(this.isInValidValue(t))return;i=this.getTickCoord(t)}const s=this.getVerticalCoord(i,u,!0);t.push({id:e.id,points:[i,s],datum:e})})),i=t}return Object.assign(Object.assign({},e),{items:i,center:l,type:"line"})}}JA(OP,yP);class RP extends kP{constructor(t,e,i){super(t,Qd.grid,e),this.spec.componentType=Qd.grid,this.mode=i}parseAddition(t){return super.parseAddition(t),this.target(t.target),this.gridType(t.gridType),this.gridShape(t.gridShape),this}scale(t){return super.scale(t),this._gridComponentType=null,this}gridType(t){return this.spec.gridType=t,this._gridComponentType=null,this._prepareRejoin(),this.commit(),this}gridShape(t){return this.spec.gridShape=t,this.commit(),this}target(t){if(this.spec.target){const t=S(this.spec.target)?this.view.getMarkById(this.spec.target):this.spec.target;this.detach(t)}this.spec.target=t;const e=S(t)?this.view.getMarkById(t):t;return this.attach(e),this._targetAxis=e,this._gridComponentType=null,this._updateComponentEncoders(),this.commit(),this}tickCount(t){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;return e&&e.tickCount(t),this.setFunctionSpec(t,"tickCount")}inside(t){return this.setFunctionSpec(t,"inside")}baseValue(t){return this.setFunctionSpec(t,"baseValue")}addGraphicItem(t,e){const i=E({x:0,y:0,start:{x:0,y:0},end:{x:0,y:0}},t),s=_c.createGraphicComponent(this._getGridComponentType(),i,{mode:this.mode,skipDefault:this.spec.skipTheme});return super.addGraphicItem(i,e,s)}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=this.spec.skipTheme?null:this.view.getCurrentTheme();let h,d=Pm(s,t,e,i);const c=Gp(this.spec.baseValue,i,t,e);if(this._targetAxis){const t=null===(n=this._targetAxis.getSpec())||void 0===n?void 0:n.scale;h=S(t)?this.view.getScaleById(t):t;const e=this._targetAxis.elements[0];if(e)switch(this._getGridComponentType()){case ic.lineAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),start:e.getGraphicAttribute("start"),end:e.getGraphicAttribute("end"),verticalFactor:null!==(r=e.getGraphicAttribute("verticalFactor"))&&void 0!==r?r:1},d);break;case ic.circleAxisGrid:d=Object.assign({x:e.getGraphicAttribute("x"),y:e.getGraphicAttribute("y"),center:e.getGraphicAttribute("center"),radius:e.getGraphicAttribute("radius"),innerRadius:e.getGraphicAttribute("innerRadius"),inside:e.getGraphicAttribute("inside"),startAngle:e.getGraphicAttribute("startAngle"),endAngle:e.getGraphicAttribute("endAngle")},d)}}else{h=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;const s=Gp(this.spec.inside,i,t,e),n=null===(a=null==h?void 0:h.getCoordinate)||void 0===a?void 0:a.call(h);n&&(d=Object.assign(AP(h,n,s,c,this.spec.layout,!0),d))}this._getGridComponentType()===ic.lineAxisGrid&&(d="line"!==this.spec.gridShape&&this.spec.gridShape?Object.assign({center:d.start,closed:!0},d,{type:this.spec.gridShape}):Object.assign({},d,{type:"line"}));const u=null===(o=null==h?void 0:h.getScale)||void 0===o?void 0:o.call(h),p=Gp(this.spec.tickCount,i,t,e);switch(this._getGridComponentType()){case ic.lineAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.grid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p);case ic.circleAxisGrid:return((t,e,i,s)=>{var n,r,a,o;const l=null!==(r=null===(n=null==e?void 0:e.components)||void 0===n?void 0:n.circleGrid)&&void 0!==r?r:{};return t?E({},l,{items:(null!==(o=null===(a=t.tickData)||void 0===a?void 0:a.call(t,s))&&void 0!==o?o:[]).map((t=>({id:t.index,label:t.tick,value:t.value,rawValue:t.tick})))},null!=i?i:{}):E({},l,null!=i?i:{})})(u,l,d,p)}return d}}),e}),{});this._encoders=e}_getGridComponentType(){var t;if(this._gridComponentType)return this._gridComponentType;if(this.spec.gridType)"circle"===this.spec.gridType?this._gridComponentType=ic.circleAxisGrid:this._gridComponentType=ic.lineAxisGrid;else if(this._targetAxis)switch(this._targetAxis.getAxisComponentType()){case ec.circleAxis:this._gridComponentType=ic.circleAxisGrid;break;case ec.lineAxis:default:this._gridComponentType=ic.lineAxisGrid}else if(this.spec.scale){const e=S(this.spec.scale)?this.view.getScaleById(this.spec.scale):this.spec.scale;this._gridComponentType=(null===(t=null==e?void 0:e.getCoordinate)||void 0===t?void 0:t.call(e))?e.getCoordinateAxisPoints()?ic.lineAxisGrid:ic.circleAxisGrid:ic.lineAxisGrid}else this._gridComponentType=ic.lineAxisGrid;return this._gridComponentType}}RP.componentType=Qd.grid;const IP=()=>{_c.registerGraphicComponent(ic.lineAxisGrid,((t,e)=>new PP(t,e))),_c.registerComponent(Qd.grid,RP)},BP=()=>{_c.registerGraphicComponent(ic.circleAxisGrid,((t,e)=>new OP(t,e))),_c.registerComponent(Qd.grid,RP)},FP=(t,e,i,s)=>CE(t,e,i).map((t=>s?[t.x1,t.x2,t.width()]:[t.y1,t.y2,t.height()])),YP=(t,e,i=0)=>Math.max(t[0],e[0])-i/2<=Math.min(t[1],e[1])+i/2,jP=(t,e)=>t[1]{var i;const s=t.domain();if(!s.length)return[];const{tickCount:n,forceTickCount:r,tickStep:a,labelGap:o=4,axisOrientType:l,labelStyle:h}=e,d=(t=>["bottom","top","z"].includes(t))(l),c=t.range(),u=t.calculateWholeRangeSize();if(u<2)return e.labelLastVisible?kE([s[s.length-1]]):kE([s[0]]);let p;if(M(a))p=t.stepTicks(a);else if(M(r))p=t.forceTicks(r);else if(M(n)){const e=ys(n)?n({axisLength:u,labelStyle:h}):n;p=t.ticks(e)}else if(e.sampling){const n=(null!==(i=e.labelStyle.fontSize)&&void 0!==i?i:12)+2,r=ja(c),a=Ya(c);if(s.length<=u/n){const i=(a-r)/s.length,n=FP(t,s,e,d),l=Math.min(...n.map((t=>t[2]))),h=zP(s,n,o,e.labelLastVisible,Math.floor(l/i),!1);p=t.stepTicks(h.step),e.labelLastVisible&&(h.delCount&&(p=p.slice(0,p.length-h.delCount)),p.push(s[s.length-1]))}else{const i=[s[0],s[Math.floor(s.length/2)],s[s.length-1]],n=FP(t,i,e,d);let l=null;n.forEach((t=>{l?l[2]0?Math.ceil(s.length*(o+l[2])/(a-r-o)):s.length-1;p=t.stepTicks(h),!e.labelLastVisible||p.length&&p[p.length-1]===s[s.length-1]||(p.length&&Math.abs(t.scale(p[p.length-1])-t.scale(s[s.length-1])){let a=0,o=0,l=-1,h=Number.MAX_VALUE;const d=s=>{let n=!0,r=0;do{r+sd(t)?1:-1));let u=c;do{if(u>c&&!r&&!d(u))u++;else{if(!s){o=u;break}{const s=t.length-1;let n,r=0;n=t.length%u>0?t.length-t.length%u+u:t.length;do{if(n-=u,n!==s&&!YP(e[n],e[s],i))break;r++}while(n>0);if(n===s){o=u,a=r;break}{const i=Math.floor(t.length/u)-r+1;if(i=0?jP(e[n-u],e[n]):t,c=Math.abs(t-d);if(cthis._scales[t];return{isContinuous:!1,dataToPosition:this.dataToPosition.bind(this),getScale:t,getBandwidth:(e=0)=>t(e).bandwidth(),getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>this._inverse,getSpec:()=>this._spec}}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,HP),t}transformScaleDomain(){this.updateFixedWholeLength()}updateFixedWholeLength(){if(this._scale){const{bandSize:t,maxBandSize:e,minBandSize:i}=this._getOuterBandSizeFromSpec();if(t&&this._scale.bandwidth(t),e&&this._scale.maxBandwidth(e),i&&this._scale.minBandwidth(i),this._scale.isBandwidthFixed()&&this._spec.autoRegionSize&&(t||e)){const i=vb(this._scale.domain().length,null!=t?t:e,this._scale.paddingInner(),this._scale.paddingOuter());["bottom","top"].includes(this._orient)?this._regions.forEach((t=>t.setMaxWidth(i))):["left","right"].includes(this._orient)&&this._regions.forEach((t=>t.setMaxHeight(i)))}}}_getOuterBandSizeFromSpec(){var t;let{bandSize:e,maxBandSize:i,minBandSize:s,bandSizeLevel:n=0}=this._spec;const{gap:r,extend:a=0}=null!==(t=this._spec.bandSizeExtend)&&void 0!==t?t:{};n=Math.min(n,this._scales.length-1);for(let t=n;t>0;t--){const o=this._scales[t],l=o.domain(),h=o.paddingInner(),d=o.paddingOuter(),c=e=>{const i=t===n?a:0;return D(r)||t{TP(),IP(),hD(),$l.registerComponent(NP.type,NP)};function WP(t){const e=[];for(let i=0;it>i&&ti.reduce(((t,s,n)=>(t.push([s,i.length===n+1?e:i[n+1]]),t)),[[t,i[0]]]))(i,s,n)}const UP=(t,e)=>t-e;function $P(t,e){const i=((t,e)=>{const i=[0];let s=0,n=0;for(;s{const n=t[i-1]?t[i-1][1]:0,r=(100*n+100*+(e/s).toFixed(2))/100;return t.push([n,r>1||r>.95?1:r]),t}),[]).filter((t=>!(0===t[0]&&0===t[1]||1===t[0]&&1===t[1])))}const XP=Math.sqrt(50),KP=Math.sqrt(10),qP=Math.sqrt(2);class ZP{constructor(){this._extend={},this.niceLabelFormatter=null}setExtraAttrFromSpec(){M(this._spec.nice)&&(this._nice=this._spec.nice),M(this._spec.zero)&&(this._zero=this._spec.zero),this._expand=this._spec.expand,this._domain=NE(this._spec)}transformScaleDomain(){this.setScaleNice()}setLinearScaleNice(){var t;if(!this._nice)return!1;let e=5;const i=this._spec.tick||{};if(qo(i.forceTickCount))e=i.forceTickCount;else if(ys(i.tickCount)){const t=this._scale.range();let s=Math.abs(Fa(t)-t[0]);1===s&&this._option&&(s=kd(this._orient)?this._option.getChartViewRect().width:this._option.getChartViewRect().height),e=i.tickCount({axisLength:s,labelStyle:this._spec.label&&this._spec.label.style})}else e=qo(i.tickCount)?i.tickCount:5;"accurateFirst"===this._spec.niceType&&(e=Math.max(5,e));const{min:s,max:n}=null!==(t=this._domain)&&void 0!==t?t:{};return D(s)&&D(n)&&D(this._softMaxValue)&&D(this._softMinValue)?this._scale.nice(e):(M(s)||M(this._softMinValue))&&D(n)&&D(this._softMaxValue)?this._scale.niceMax(e):!(!D(s)||!D(this._softMinValue)||!M(n)&&!M(this._softMaxValue))&&this._scale.niceMin(e)}setLogScaleNice(){var t;if(!this._nice)return!1;const{min:e,max:i}=null!==(t=this._domain)&&void 0!==t?t:{};return D(e)&&D(i)&&D(this._softMaxValue)&&D(this._softMinValue)?this._scale.nice():(M(e)||M(this._softMinValue))&&D(i)&&D(this._softMaxValue)?this._scale.niceMax():!(!D(e)||!D(this._softMinValue)||!M(i)&&!M(this._softMaxValue))&&this._scale.niceMin()}setScaleNice(){return"log"===this._spec.type?this.setLogScaleNice():this.setLinearScaleNice()}dataToPosition(t,e){return this.valueToPosition(t[0])}valueToPosition(t){return this._scale.scale(t)}computeLinearDomain(t){let e=[];if(t.length){const i=this._spec.breaks&&this._spec.breaks.length;let s,n,r=[];if(t.forEach((t=>{const{min:e,max:a}=t;s=void 0===s?e:Math.min(s,e),n=void 0===n?a:Math.max(n,a),i&&(r=r.concat(t.values))})),i){const t=[],i=[];for(let e=0;et[0]-e[0])),t.length){const{domain:s,scope:n}=function(t,e){return t.sort(UP),e.sort(UP),{domain:GP(t,e),scope:$P(t,e)}}(r,WP(t));e=WP(s),this._break={domain:s,scope:n,breakDomains:t,breaks:i}}else e=[s,n]}else e=[s,n]}else e[0]=0,e[1]=0;return this.setSoftDomainMinMax(e),this.expandDomain(e),this.includeZero(e),this.setDomainMinMax(e),e}expandDomain(t){if(!this._expand)return;let e=t[0],i=Fa(t);e===i&&(0===i?i=1:i>0?e=0:i<0&&(i=0)),M(this._expand.min)&&(t[0]=e-(i-e)*this._expand.min),M(this._expand.max)&&(t[t.length-1]=i+(i-e)*this._expand.max)}niceDomain(t){const{min:e,max:i}=NE(this._spec);if(M(e)||M(i)||"linear"!==this._spec.type)return t;if(Math.abs(ja(t)-Ya(t))<=1e-12){let e=t[0];const i=e>=0?1:-1;if(e=Math.abs(e),e<1)t[0]=0,t[t.length-1]=1;else{let i=e/5;const s=Math.floor(Math.log(i)/Math.LN10),n=i/Math.pow(10,s);i=(n>=XP?10:n>=KP?5:n>=qP?2:1)*Math.pow(10,s),t[0]=0,t[t.length-1]=10*i}i<0&&(t.reverse(),t[0]*=-1,t[t.length-1]*=-1)}return t}includeZero(t){this._zero&&(t[0]=Math.min(t[0],0),t[t.length-1]=Math.max(Fa(t),0))}setExtendDomain(t,e){if(void 0===e)return void delete this._extend[t];this._extend[t]=e;const i=this._scale.domain();this.extendDomain(i),this.includeZero(i),this.setDomainMinMax(i),this.niceDomain(i),this._scale.domain(i,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this.event.emit(Hd.scaleUpdate,{model:this,value:"domain"})}extendDomain(t){let e;const i=t.length-1,s=t[0]-t[i]>0,n=s?i:0,r=s?0:i;for(const i in this._extend)e=this._extend[i],e>t[r]&&(t[r]=e),e=Fa(t)&&(t[t.length-1]=e),this._softMaxValue=e}}setZero(t){this._zero!==t&&(this._zero=t,this.updateScaleDomain())}updateScaleDomain(){if(!this.isSeriesDataEnable())return;const t=this.collectData(),e=this.computeLinearDomain(t);this.updateScaleDomainByModel(e)}updateScaleDomainByModel(t){t=null!=t?t:this._scale.domain(),this.extendDomain(t),this.includeZero(t),this.setDomainMinMax(t),this.niceDomain(t),this._scale.domain(t,this._nice),this._nice&&!this.setScaleNice()&&this._scale.rescale(),this._updateNiceLabelFormatter(t),this._domainAfterSpec=this._scale.domain(),this.event.emit(Hd.scaleDomainUpdate,{model:this}),this.event.emit(Hd.scaleUpdate,{model:this,value:"domain"})}getDomainAfterSpec(){return this._domainAfterSpec}_updateNiceLabelFormatter(t){const e=Math.abs(Fa(t)-t[0]),i=Math.max(-Math.floor(Math.log10(e)),0)+2,s=Math.pow(10,i);this.niceLabelFormatter=t=>qo(+t)?Math.round(+t*s)/s:t}}function JP(t,e,i,s){let n;const{breakData:r}=t;if(r&&r()){const{breakDomains:t}=r(),a=e.domain();n=[];for(let e=0;e{t.some((t=>e>=t[0]&&e<=t[1]))||n.push(e)}));e.domain(a)}else n=s(i);return n}const QP=(t,e)=>{var i,s;if(!Jh(t.type))return kE(t.domain());const n=t.range(),r=Math.abs(n[n.length-1]-n[0]);if(r<2)return kE([t.domain()[0]]);const{tickCount:a,forceTickCount:o,tickStep:l,noDecimals:h=!1,labelStyle:d,breakData:c}=e;let u;if(M(l))u=t.stepTicks(l);else if(M(o))u=JP(e,t,o,((e,i)=>i&&i.length?t.domain(i,!0).forceTicks(e):t.forceTicks(e)));else if("d3"===e.tickMode){const s=null!==(i=ys(a)?a({axisLength:r,labelStyle:d}):a)&&void 0!==i?i:5;u=JP(e,t,s,((e,i)=>i&&i.length?t.domain(i,!0).d3Ticks(e,{noDecimals:h}):t.d3Ticks(e,{noDecimals:h})))}else{const i=null!==(s=ys(a)?a({axisLength:r,labelStyle:d}):a)&&void 0!==s?s:5,n=ys(e.tickMode)?e.tickMode:void 0;u=JP(e,t,i,((e,i)=>i&&i.length?t.domain(i,!0).ticks(e,{noDecimals:h,customTicks:n}):t.ticks(e,{noDecimals:h,customTicks:n})))}if(e.sampling&&("cartesian"===e.coordinateType||"polar"===e.coordinateType&&"radius"===e.axisOrientType)){const{labelGap:i=4,labelFlush:s}=e;let n=CE(t,u,e).map(((t,e)=>({AABBBounds:t,value:u[e]})));const r=c&&c()?tO.greedy:tO.parity;for(;n.length>=3&&TE(n,i);)n=r(n,i);const a=n.map((t=>t.value));a.length<3&&s&&(a.length>1&&a.pop(),Fa(a)!==Fa(u)&&a.push(Fa(u))),u=a}return kE(u)},tO={parity:function(t){return t.filter(((t,e)=>e%2==0))},greedy:function(t,e){let i;return t.filter(((t,s)=>!(s&&wE(i.AABBBounds,t.AABBBounds,e)||(i=t,0))))}};class eO extends uD{constructor(){super(...arguments),this.type=r.cartesianLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new qb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){var t,e;super.initScales();const i=[0,1];M(null===(t=this._domain)||void 0===t?void 0:t.min)&&(i[0]=this._domain.min),M(null===(e=this._domain)||void 0===e?void 0:e.max)&&(i[1]=this._domain.max),this._scale.domain(i)}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{breakData:(null===(t=this._spec.breaks)||void 0===t?void 0:t.length)?()=>this._break:null})}_getUpdateAttribute(t){var e,i;const s=super._getUpdateAttribute(t);if(!wd(this._orient)&&(null===(i=null===(e=this._break)||void 0===e?void 0:e.breaks)||void 0===i?void 0:i.length)){const{width:t,height:e}=this.getLayoutRect(),i=kd(this._orient),n=i?t:e;s.breaks=this._break.breaks.map((t=>{const{range:e,breakSymbol:s,gap:r=6}=t,a=this.valueToPosition((e[0]+e[1])/2)/n;let o;o=tl(r)?Number(r.substring(0,r.length-1))/100:r/n;const l=qo(null==s?void 0:s.angle)?s.angle:i?60:15;return{range:[a-o/2,a+o/2],breakSymbol:Object.assign(Object.assign({visible:!0},s),{angle:l*Math.PI/180}),rawRange:e}}))}return s}getNewScaleRange(){var t,e;let i=super.getNewScaleRange();return(null===(t=this._spec.breaks)||void 0===t?void 0:t.length)&&(null===(e=this._break)||void 0===e?void 0:e.scope)&&(i=WP(this._break.scope).map((t=>i[0]+(Fa(i)-i[0])*t))),i}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t.valueToPosition=this.valueToPosition.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,QP),t}}eO.type=r.cartesianLinearAxis,eO.specKey="axes",JA(eO,ZP);const iO=()=>{TP(),IP(),hD(),$l.registerComponent(eO.type,eO)};class sO extends NC{constructor(){super(...arguments),this.type=_l.line,this.transformerConstructor=gE,this._sortDataByAxis=!1}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}initMark(){var t;const e={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},i=null!==(t=this._spec.seriesMark)&&void 0!==t?t:"line";this.initLineMark(e,"line"===i),this.initSymbolMark(e,"point"===i)}initTooltip(){super.initTooltip();const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._lineMark&&t.add(this._lineMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}initMarkStyle(){this.initLineMarkStyle(this._direction),this.initSymbolMarkStyle()}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._lineMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("line"))||void 0===i?void 0:i(n,r),DC("line",this._spec,this._markAttributeContext))),this._symbolMark){const t=zC(this);this._symbolMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),DC("point",this._spec,this._markAttributeContext),t))}}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){var e;const i="point"!==(null===(e=this._spec)||void 0===e?void 0:e.seriesMark);return e=>{var s,n;return i&&"fill"===e&&(e="stroke"),null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._lineMark,this._symbolMark]}}sO.type=_l.line,sO.mark=$C,sO.transformerConstructor=gE,JA(sO,UC);const nO=(t,e)=>{var i;const s=t.spec,{regionId:n,regionIndex:r}=s;if(M(n)){const t=Ba(n);return null===(i=e.region)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Ba(r).map((t=>{var i;return null===(i=e.region)||void 0===i?void 0:i[t]})).filter(M)};class rO{constructor(t){this._option=t,this.type=t.type,this.seriesType=t.seriesType}initChartSpec(t){return this.transformSpec(t),this.transformModelSpec(t)}transformSpec(t){t.region&&0!==t.region.length||(t.region=[{}]),void 0===t.tooltip&&(t.tooltip={}),M(t.stackInverse)&&t.region.forEach((e=>{!M(e.stackInverse)&&(e.stackInverse=t.stackInverse)})),M(t.stackSort)&&t.region.forEach((e=>{!M(e.stackSort)&&(e.stackSort=t.stackSort)}))}transformModelSpec(t){return this.createSpecInfo(t,((e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})).transformSpec(n,t,s);Hy(t,r,l.spec),Hy(s,null!=a?a:r,Object.assign(Object.assign({},i),l))}))}createSpecInfo(t,e){var i,s;e||(e=(e,i,s)=>{const{spec:n,specPath:r,specInfoPath:a,type:o}=i,l=new e.transformerConstructor(Object.assign(Object.assign({},this._option),{type:o})),h=l.transformSpec(n,t,s);Hy(s,null!=a?a:r,Object.assign(Object.assign(Object.assign({},i),h),{theme:l.getTheme(n,t)}))});const n={};return this.forEachRegionInSpec(t,e,n),this.forEachSeriesInSpec(t,e,n),null===(i=n.series)||void 0===i||i.forEach(((t,e)=>{var i,s;const r=(null!==(s=null!==(i=nO(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[])[0];r&&(r.seriesIndexes||(r.seriesIndexes=[]),r.seriesIndexes.push(e),t.regionIndexes=r.regionIndexes.slice())})),this.forEachComponentInSpec(t,e,n),Object.values(null!==(s=n.component)&&void 0!==s?s:{}).forEach((t=>t.forEach(((t,e)=>{var i,s,r;if(t){if(!t.regionIndexes){const e=null!==(s=null!==(i=nO(t,n))&&void 0!==i?i:n.region)&&void 0!==s?s:[];t.regionIndexes=e.map((t=>t.regionIndexes[0]))}if(!t.seriesIndexes){const e=((t,e)=>{var i;const s=t.spec,{seriesId:n,seriesIndex:r}=s;if(M(n)){const t=Ba(n);return null===(i=e.series)||void 0===i?void 0:i.filter((({spec:e})=>t.includes(e.id)))}if(M(r))return Ba(r).map((t=>{var i;return null===(i=e.series)||void 0===i?void 0:i[t]})).filter(M)})(t,n);if(e)t.seriesIndexes=e.map((({seriesIndexes:t})=>t[0]));else{const e=new Set;(null!==(r=t.regionIndexes)&&void 0!==r?r:[]).forEach((t=>{var i,s;const r=null===(i=n.region)||void 0===i?void 0:i[t];null===(s=null==r?void 0:r.seriesIndexes)||void 0===s||s.forEach((t=>e.add(t)))})),t.seriesIndexes=Array.from(e)}}}})))),n}_isValidSeries(t){return!0}_getDefaultSeriesSpec(t){var e,i,s,n;return{dataKey:t.dataKey,hover:t.hover,select:t.select,label:t.label,seriesStyle:t.seriesStyle,animation:null!==(e=t.animation)&&void 0!==e?e:this._option.animation,animationThreshold:null!==(i=t.animationThreshold)&&void 0!==i?i:null===(n=(s=this._option).getTheme)||void 0===n?void 0:n.call(s).animationThreshold,animationAppear:t.animationAppear,animationDisappear:t.animationDisappear,animationEnter:t.animationEnter,animationUpdate:t.animationUpdate,animationExit:t.animationExit,animationNormal:t.animationNormal,animationState:t.animationState,extensionMark:t.extensionMark,large:t.large,largeThreshold:t.largeThreshold,progressiveStep:t.progressiveStep,progressiveThreshold:t.progressiveThreshold,background:t.seriesBackground,invalidType:t.invalidType,seriesField:t.seriesField,morph:t.morph,interactions:t.interactions}}forEachRegionInSpec(t,e,i){var s;return(null!==(s=t.region)&&void 0!==s?s:[]).map(((t,s)=>e($l.getRegionInType("region"),{spec:t,specPath:["region",s],type:"region",regionIndexes:[s]},i)))}forEachSeriesInSpec(t,e,i){var s;return(null!==(s=t.series)&&void 0!==s?s:[]).map(((t,s)=>e($l.getSeriesInType(t.type),{spec:t,specPath:["series",s],type:t.type,seriesIndexes:[s]},i)))}forEachComponentInSpec(t,e,i){var s,n,a;const o=[],l=$l.getComponents();let h,d,c,u;const p=[];for(let e=0;e0&&(g=!0,s.forEach((t=>{const s=$l.getComponentInKey(t.type);o.push(e(s,t,i))})))}if(d&&!g){const s=d.getSpecInfo(t,i);(null==s?void 0:s.length)>0&&(g=!0,s.forEach((t=>{const s=$l.getComponentInKey(t.type);o.push(e(s,t,i))})))}return c&&!g&&(null===(n=c.getSpecInfo(t,i))||void 0===n||n.forEach((t=>{o.push(e(c,t,i))}))),p.forEach((s=>{var n;null===(n=s.getSpecInfo?s.getSpecInfo(t,i):jE(t,s.specKey,s.type))||void 0===n||n.forEach((t=>{o.push(e(s,t,i))}))})),u&&(null===(a=jE(t,u.specKey,u.type))||void 0===a||a.forEach((t=>{o.push(e(u,t,i))}))),o}transformSeriesSpec(t){const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}_findBandAxisBySeries(t,e,i){const s="horizontal"===(null==t?void 0:t.direction)?["left","right"]:["top","bottom"];return i.find((i=>{if(!s.includes(i.orient))return!1;if(M(i.seriesId)){if(Ba(i.seriesId).includes(null==t?void 0:t.id))return!0}else if(M(i.seriesIndex)){if(Ba(i.seriesIndex).includes(e))return!0}else if("band"===i.type)return!0;return!0}))}_applyAxisBandSize(t,e,i){const{barMaxWidth:s,barMinWidth:n,barWidth:r,barGapInGroup:a}=i;let o=!1;h(n)?(t.minBandSize=n,o=!0):h(r)?(t.minBandSize=r,o=!0):h(s)&&(t.minBandSize=s,o=!0),o&&(t.bandSizeLevel=Number.MAX_VALUE,t.bandSizeExtend={extend:e,gap:y(a)?a[a.length-1]:a})}}class aO extends rO{needAxes(){return!0}_isValidSeries(t){return!this.seriesType||t===this.seriesType}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{xField:t.xField,yField:t.yField,zField:t.zField,seriesField:t.seriesField,seriesStyle:t.seriesStyle,direction:t.direction,stack:t.stack,percent:t.percent,stackOffsetSilhouette:t.stackOffsetSilhouette,totalLabel:t.totalLabel,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t);const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e],this._transformAxisSpec(t)}_setDefaultXAxisSpec(t){return{orient:"bottom"}}_setDefaultYAxisSpec(t){return{orient:"left"}}_setDefaultZAxisSpec(t){return{orient:"z"}}_transformAxisSpec(t){if(this.needAxes()){t.axes||(t.axes=[]);const e={x:!1,y:!1,z:!1};t.axes.forEach((i=>{const{orient:s}=i;let n=null;"top"!==s&&"bottom"!==s||(e.x=!0,n=this._setDefaultXAxisSpec(t)),"left"!==s&&"right"!==s||(e.y=!0,n=this._setDefaultYAxisSpec(t)),"z"===s&&(e.z=!0,n=this._setDefaultZAxisSpec(t)),n&&Object.keys(n).forEach((t=>{D(i[t])&&(i[t]=n[t])})),Ud(i,"trimPadding")&&Tl(i,by(this.type,t))})),e.x||t.axes.push(this._setDefaultXAxisSpec(t)),e.y||t.axes.push(this._setDefaultYAxisSpec(t)),t.zField&&!e.z&&t.axes.push(this._setDefaultZAxisSpec(t))}}}class oO extends aO{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"line",activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,lineLabel:t.lineLabel})}transformSpec(t){super.transformSpec(t),fy(t)}}class lO{get dataList(){return this._dataArr}constructor(t,e){this._dataArr=[],this._onError=e,this._dataSet=t}parseData(t){this._dataArr=[];const e=Ba(t);for(let t=0;t{e.markRunning()})),this._dataValueForEach(s,((t,e)=>{jp(e,t,i)})),0))}_dataValueForEach(t,e){t.forEach(((t,i)=>{if(t instanceof R)return;const s=this.getSeriesData(t.id,i);s&&e(t,s,i)}))}getSeriesData(t,e){var i,s;if(!this._dataArr.length)return null;if("string"==typeof t){const e=this._dataArr.filter((e=>e.name===t));return e[0]?e[0]:(null===(i=this._onError)||void 0===i||i.call(this,`no data matches dataId ${t}!`),null)}return"number"==typeof e?this._dataArr[e]?this._dataArr[e]:(null===(s=this._onError)||void 0===s||s.call(this,`no data matches dataIndex ${e}!`),null):this._dataArr[0]}}class hO{constructor(t,e){this._scaleSpecMap=new Map,this._scaleMap=new Map,this._modelScaleSpecMap=new Map,this._markAttributeScaleMap=new Map,this._spec=null,this._chart=null,this.getStatisticalFields=t=>{const e=[];return this._scaleSpecMap.forEach(((i,s)=>{Jo(i.domain)&&i.domain.forEach((s=>{s.dataId===t&&s.fields.forEach((t=>{IT(e,[{key:t,operations:Jh(i.type)?["max","min"]:["values"]}])}))}))})),this._markAttributeScaleMap.forEach(((i,s)=>{const n=this.getScale(s);i.forEach((i=>{this._getSeriesBySeriesId(i.seriesId).getRawData().name===t&&i.field&&IT(e,[{key:i.field,operations:Jh(n.type)?["max","min"]:["values"]}])}))})),e},this._spec=t,this._chart=e,this._setAttrFromSpec()}_createFromSpec(t){if(!t.id)return null;let e=this._scaleMap.get(t.id);return e||(e="ordinal"===t.type&&"color"===t.id?rx("colorOrdinal"):rx(t.type)),e?(y(t.range)&&e.range(t.range),y(t.domain)&&(Jo(t.domain)||e.domain(t.domain)),t.specified&&e.specified&&e.specified(t.specified),e):null}_setAttrFromSpec(){var t;if(!(null===(t=this._spec)||void 0===t?void 0:t.length))return;const e=new Map,i=new Map;this._spec.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._modelScaleSpecMap.forEach((t=>{const s=this._createFromSpec(t);s&&(e.set(t.id,s),i.set(t.id,t))})),this._scaleSpecMap=i,this._scaleMap=e}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(Im(t,this._spec))return e;e.change=!0;for(let i=0;it.id===s.id));if(!r.id)return e.reMake=!0,e;if(r.type!==s.type)return e.reMake=!0,e;if(!Im(r.specified,s.specified))return e.reMake=!0,e;s.range&&!Im(s.range,n.range())&&(n.range(s.range),e.reRender=!0),Jo(s.domain)?e.reRender=!0:Im(s.domain,n.domain())||(n.domain(s.domain),e.reRender=!0),this._scaleSpecMap.set(s.id,s)}return this._spec=t,e}registerModelScale(t){const e=this._createFromSpec(t);e&&(this._modelScaleSpecMap.set(t.id,t),this._scaleSpecMap.set(t.id,t),this._scaleMap.set(t.id,e))}removeModelScale(t){this._modelScaleSpecMap.forEach((e=>{t(e)&&(this._modelScaleSpecMap.delete(e.id),this._scaleSpecMap.delete(e.id),this._scaleMap.delete(e.id))}))}getScale(t){return this._scaleMap.get(t)}getScaleSpec(t){return this._scaleSpecMap.get(t)}_getSeriesByRawDataId(t){const e=this._chart.getAllSeries();for(let i=0;i{const s=this._scaleMap.get(i);if(!s)return;if(!Jo(e.domain))return e.domain&&0!==e.domain.length||s.domain(t),void this._updateMarkScale(i,s,s.domain().slice());let n;n=Jh(e.type)?[null,null]:new Set,e.domain.forEach((t=>{const i=this._getSeriesByRawDataId(t.dataId);if(!i)return;const s=Jh(e.type);t.fields.forEach((t=>{const e=i.getRawDataStatisticsByField(t,s);e&&(s?(D(n[0])?n[0]=e.min:n[0]=Math.min(e.min,n[0]),D(n[1])?n[1]=e.max:n[1]=Math.max(e.max,n[1])):e.values.forEach((t=>{n.add(t)})))}))}));const r=n;Jh(e.type)||(n=Array.from(n)),s.domain(n),this._updateMarkScale(i,s,r)}))}_updateMarkScale(t,e,i){const s=this._markAttributeScaleMap.get(t);s&&0!==s.length&&s.forEach((t=>{if(!t.field||!t.markScale||t.markScale===e)return;if(D(t.changeDomain)||"none"===t.changeDomain||D(t.seriesId))return void(Jh(e.type)?t.markScale.domain(i):e.domain(Array.from(i)));const s=this._getSeriesBySeriesId(t.seriesId),n=Jh(e.type),r=s.getRawDataStatisticsByField(t.field,n);if(!Ym(r))return"expand"===t.changeDomain?(n?(i[0]=Math.min(i[0],r.min),i[1]=Math.max(i[1],r.max)):(r.values.forEach((t=>{i.add(t)})),i=Array.from(i)),void t.markScale.domain(i)):void("replace"!==t.changeDomain||(n?t.markScale.domain([r.min,r.max]):t.markScale.domain(r.values)));Jh(e.type)?t.markScale.domain(i):e.domain(Array.from(i))}))}registerMarkAttributeScale(t,e){const i=this._scaleMap.get(t.scale);let s=this._markAttributeScaleMap.get(t.scale);s||(s=[],this._markAttributeScaleMap.set(t.scale,s));let n=i;return(D(t.field)||!D(t.changeDomain)&&"none"!==t.changeDomain&&!D(e))&&(n=i.clone()),s.push(Object.assign(Object.assign({},t),{seriesId:e,markScale:n})),n}}var dO=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{var t;return null!==(t=this._series)&&void 0!==t?t:[]},this.getRegionsInIndex=t=>t&&0!==t.length?this._regions.filter(((e,i)=>t.includes(i))):[this._regions[0]],this.getAllRegions=()=>this._regions,this.getRegionsInIds=t=>t?this._regions.filter((e=>t.includes(e.id))):[],this.getRegionsInQuerier=t=>t?this._regions.filter(((e,i)=>Ba(t).some((t=>M(t.regionId)&&t.regionId===e.userId||t.regionIndex===i)))):this._regions,this.getRegionsInUserId=t=>{if(t)return this._regions.find((e=>e.userId===t))},this.getRegionsInUserIdOrIndex=(t,e)=>this.getAllRegions().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponents=()=>this._components,this.getSeriesInIndex=t=>t&&0!==t.length?this._series.filter(((e,i)=>t.includes(i))):[this._series[0]],this.getSeriesInIds=t=>t?this._series.filter((e=>t.includes(e.id))):[],this.getSeriesInUserId=t=>{if(t)return this._series.find((e=>e.userId===t))},this.getSeriesInUserIdOrIndex=(t,e)=>this.getAllSeries().filter((i=>(null==t?void 0:t.length)?i.userId&&t.includes(i.userId):!(null==e?void 0:e.length)||e.includes(i.getSpecIndex()))),this.getComponentByIndex=(t,e)=>{const i=this._components.filter((e=>(e.specKey||e.type)===t));if(i&&0!==i.length)return i[e]},this.getComponentsByKey=t=>this._components.filter((e=>(e.specKey||e.type)===t)),this.getComponentByUserId=t=>{const e=this._components.find((e=>e.userId===t));if(e)return e},this.getComponentsByType=t=>this._components.filter((e=>e.type===t)),this._paddingSpec=sl(null!==(i=t.padding)&&void 0!==i?i:e.getTheme().padding),this._event=new Wd(e.eventDispatcher,e.mode),this._dataSet=e.dataSet,this._chartData=new lO(this._dataSet,null===(s=this._option)||void 0===s?void 0:s.onError),this._modelOption=Object.assign(Object.assign({},e),{mode:this._option.mode,map:this._idMap,getChartLayoutRect:()=>this._layoutRect,getChartViewRect:()=>this._viewRect,getChart:()=>this,globalScale:this._globalScale,onError:null===(n=this._option)||void 0===n?void 0:n.onError,disableTriggerEvent:!0===(null===(r=this._option)||void 0===r?void 0:r.disableTriggerEvent),getSeriesData:this._chartData.getSeriesData.bind(this._chartData)}),this._spec=t}created(){this._transformer=new this.transformerConstructor(Object.assign(Object.assign({},this._option),{type:this.type,seriesType:this.seriesType})),this._chartData.parseData(this._spec.data),this._createGlobalScale(),this._createBackground(),this._createLayout(),this._transformer.forEachRegionInSpec(this._spec,this._createRegion.bind(this)),this._transformer.forEachSeriesInSpec(this._spec,this._createSeries.bind(this)),this._transformer.forEachComponentInSpec(this._spec,this._createComponent.bind(this),this._option.getSpecInfo())}init(){var t,e;null===(t=this._beforeInit)||void 0===t||t.call(this),this._regions.forEach((t=>t.init({}))),this._series.forEach((t=>t.init({}))),this._components.forEach((t=>t.init({dataSet:this._dataSet}))),this._initEvent(),null===(e=this._initStack)||void 0===e||e.call(this),this.reDataFlow()}reDataFlow(){this._series.forEach((t=>{var e;return null===(e=t.getRawData())||void 0===e?void 0:e.markRunning()})),this._series.forEach((t=>t.fillData())),this.updateGlobalScaleDomain()}onResize(t,e,i=!0){const s={width:t,height:e};this._canvasRect=s,this._updateLayoutRect(this._option.viewBox),this.setLayoutTag(!0,null,i)}updateViewBox(t,e){this._option.viewBox=t,this._updateLayoutRect(t),this.setLayoutTag(!0,null,e)}_createBackground(){const t=this._spec.background;if(!t||"object"!=typeof t||M(t.gradient))return;const e=eD(t,["x","y","width","height","x1","y1","image"]);e.background=t.image,this._backgroundMark=$l.createMark("group","chart-background",{model:this,map:this._option.map,getCompiler:this.getCompiler,globalScale:this._globalScale}),this._backgroundMark.created(),this._backgroundMark.setStyle(Object.assign(Object.assign({},e),{x:()=>this._viewBox.x1,y:()=>this._viewBox.y1,width:()=>this._viewBox.x2-this._viewBox.x1,height:()=>this._viewBox.y2-this._viewBox.y1}))}_createRegion(t,e){if(!t)return;const{spec:i}=e,s=dO(e,["spec"]),n=new t(i,Object.assign(Object.assign({},this._modelOption),s));n&&(n.created(),this._regions.push(n))}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=dO(e,["spec"]);let n;if(M(i.regionId)?n=this.getRegionsInUserId(i.regionId):M(i.regionIndex)&&(n=this.getRegionsInIndex([i.regionIndex])[0]),!n&&!(n=this._regions[0]))return;const r=new t(i,Object.assign(Object.assign(Object.assign({},this._modelOption),s),{type:i.type,region:n,globalScale:this._globalScale,sourceDataList:this._chartData.dataList}));r&&(r.created(),this._series.push(r),n.addSeries(r))}getSeriesById(t){return this._series.find((e=>e.id===t))}_createComponent(t,e){const i=t.createComponent(e,Object.assign(Object.assign({},this._modelOption),{type:t.type,getAllRegions:this.getAllRegions,getRegionsInIndex:this.getRegionsInIndex,getRegionsInIds:this.getRegionsInIds,getRegionsInUserIdOrIndex:this.getRegionsInUserIdOrIndex,getAllSeries:this.getAllSeries,getSeriesInIndex:this.getSeriesInIndex,getSeriesInIds:this.getSeriesInIds,getSeriesInUserIdOrIndex:this.getSeriesInUserIdOrIndex,getAllComponents:this.getComponents,getComponentByIndex:this.getComponentByIndex,getComponentByUserId:this.getComponentByUserId,getComponentsByKey:this.getComponentsByKey,getComponentsByType:this.getComponentsByType}));i&&(i.created(),this._components.push(i))}getAllComponents(){return this._components}getAllModels(){return[].concat(this.getAllSeries(),this.getAllComponents(),this.getAllRegions())}getModelInFilter(t){if(S(t))return this.getAllModels().find((e=>e.userId===t));if(ys(t))return this.getAllModels().find((e=>t(e)));let e=0;return this.getAllModels().find((i=>{var s;if((null!==(s=i.specKey)&&void 0!==s?s:i.type)===t.type){if(e===t.index)return!0;e++}return!1}))}_createLayout(){this._updateLayoutRect(this._option.viewBox),this._initLayoutFunc()}setLayout(t){this._option.layout=t,this._initLayoutFunc()}_initLayoutFunc(){var t,e,i;if(this._layoutFunc=this._option.layout,!this._layoutFunc){let s=!1;(this._spec.zField||this._spec.series&&this._spec.series.some((t=>t.zField)))&&(s=!0);const n=$l.getLayoutInKey(null!==(e=null===(t=this._spec.layout)||void 0===t?void 0:t.type)&&void 0!==e?e:s?"layout3d":"base");if(n){const t=new n(this._spec.layout,{onError:null===(i=this._option)||void 0===i?void 0:i.onError});this._layoutFunc=t.layoutItems.bind(t)}}}layout(t){var e,i,s,n;if(null===(i=null===(e=this._option.performanceHook)||void 0===e?void 0:e.beforeLayoutWithSceneGraph)||void 0===i||i.call(e),this.getLayoutTag()){this._event.emit(Hd.layoutStart,{chart:this,vchart:this._option.globalInstance}),this.onLayoutStart(t);const e=this.getLayoutElements();this._layoutFunc(this,e,this._layoutRect,this._viewBox),this._event.emit(Hd.afterLayout,{elements:e,chart:this}),this.setLayoutTag(!1),this.onLayoutEnd(t),this._event.emit(Hd.layoutEnd,{chart:this,vchart:this._option.globalInstance})}null===(n=null===(s=this._option.performanceHook)||void 0===s?void 0:s.afterLayoutWithSceneGraph)||void 0===n||n.call(s)}onLayoutStart(t){this.getAllModels().forEach((e=>e.onLayoutStart(this._layoutRect,this._viewRect,t)))}onLayoutEnd(t){this.getAllModels().forEach((e=>{"series"!==e.modelType&&e.onLayoutEnd(t)}))}onEvaluateEnd(t){[...this._components,...this._regions,...this._series].forEach((e=>e.onEvaluateEnd(t)))}getLayoutElements(){return this.getAllModels().map((t=>t.layout)).filter((t=>!!t))}getModelById(t){const e=this._idMap.get(t);if(e&&e instanceof zy)return e}getModelByUserId(t){const e=this.getSeriesInUserId(t);if(e)return e;const i=this.getRegionsInUserId(t);return i||(this.getComponentByUserId(t)||void 0)}getAllMarks(){return Array.from(this._idMap.values()).filter((t=>t&&t instanceof vx))}getMarkById(t){const e=this._idMap.get(t);if(e&&e instanceof vx)return e}updateData(t,e,i=!0,s){const n=this._dataSet.getDataView(t);n&&(n.markRunning(),n.parseNewData(e,s)),i&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}updateFullData(t,e=!0){Ba(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&e.markRunning()})),Ba(t).forEach((t=>{const e=this._dataSet.getDataView(t.id);e&&jp(e,t,!0)})),e&&this.updateGlobalScaleDomain(),this.getAllModels().forEach((t=>t.onDataUpdate()))}onRender(t){}setCanvasRect(t,e){this._canvasRect={width:t,height:e}}getCanvasRect(){return this._canvasRect||(this._canvasRect=vy(this._spec,this._option,{width:nh,height:rh})),this._canvasRect}getSeriesData(t,e){return this._chartData.getSeriesData(t,e)}_transformSpecScale(){var t;const e=this._spec.scales?[...this._spec.scales]:[];let i=e.find((t=>"color"===t.id));const s=this.getColorScheme();if(!i&&(i={type:"ordinal",id:"color",domain:null,range:null},e.push(i),this._spec.color)){const t=this._spec.color;if(y(t))i.range=t;else{const e=t;Object.prototype.hasOwnProperty.call(e,"type")&&(i.type=e.type),Object.prototype.hasOwnProperty.call(e,"domain")&&(i.domain=e.domain),Object.prototype.hasOwnProperty.call(e,"range")&&(i.range=e.range),Object.prototype.hasOwnProperty.call(e,"specified")&&(i.specified=e.specified)}}return(null===(t=i.range)||void 0===t?void 0:t.length)||(i.range=xl(s),i.rangeTheme=!0),e}_createGlobalScale(){this._globalScale=new hO(this._transformSpecScale(),this),this._modelOption.globalScale=this._globalScale}updateGlobalScaleDomain(){const t=new Set;this._series.forEach((e=>{const i=e.getSeriesKeys();i&&i.forEach((e=>t.add(e)))}));const e=Array.from(t);this._globalScale.updateScaleDomain(e)}updateGlobalScale(t){yy(t,this._globalScale.updateSpec(this._transformSpecScale()))}updateGlobalScaleTheme(){const t=this._globalScale.getScaleSpec("color"),e=this.getColorScheme();t.rangeTheme&&(t.range=xl(e),this._globalScale.getScale("color").range(t.range))}updateSpec(t){const e={change:!1,reMake:!1,reRender:!1,reSize:!1,reCompile:!1};if(this.setLayoutTag(!0,null,!1),t.type!==this.type)return e.reMake=!0,e;const i=Object.keys(this._spec).sort(),s=Object.keys(t).sort();if(JSON.stringify(i)!==JSON.stringify(s))return e.reMake=!0,e;for(let s=0;s{yy(t,e.updateSpec(this._spec.region[e.getSpecIndex()]))})):t.reMake=!0)}updateComponentSpec(t){const e={},i={[r.title]:!0,[r.brush]:!0,[r.mapLabel]:!0};this._components.forEach((s=>{var n,a;if(s.type===r.label||s.type===r.totalLabel)return;i[s.type]&&(i[s.type]=!1);const o=s.specKey||s.type,l=null!==(n=this._spec[o])&&void 0!==n?n:{};y(l)?(e[o]=e[o]||{specCount:l.length,componentCount:0},e[o].componentCount++,yy(t,s.updateSpec(null!==(a=l[s.getSpecIndex()])&&void 0!==a?a:{},l))):yy(t,s.updateSpec(l))}));for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)){const s=e[i];s.componentCount!==s.specCount&&(t.reMake=!0)}Object.keys(i).forEach((e=>{if(i[e]){const i=this._spec[e];(y(i)?i.some((t=>null==t?void 0:t.visible)):null==i?void 0:i.visible)&&(t.reMake=!0)}}))}updateSeriesSpec(t){this._spec.series.length===this._series.length?this._series.forEach((e=>{const i=this._spec.series[e.getSpecIndex()];yy(t,e.updateSpec(i))})):t.reMake=!0}getCanvas(){var t,e;return null!==(e=null===(t=this.getCompiler())||void 0===t?void 0:t.getCanvas())&&void 0!==e?e:null}_updateLayoutRect(t){let e=this.getCanvasRect();if(t){this._viewBox=t;const{x1:i=0,y1:s=0,x2:n,y2:r}=t;e={width:n-i,height:r-s}}else this._viewBox={x1:0,y1:0,x2:e.width,y2:e.height};this._viewRect=e,this.padding=il(this._paddingSpec,e,e),this._layoutRect.width=e.width-this.padding.left-this.padding.right,this._layoutRect.height=e.height-this.padding.top-this.padding.bottom,this._layoutRect.x=this.padding.left,this._layoutRect.y=this.padding.top,this._event.emit(Hd.layoutRectUpdate,{chart:this})}setCurrentTheme(){this.updateChartConfig({change:!0,reMake:!1},this._spec),this.setLayoutTag(!0,null,!1),this.updateGlobalScaleTheme(),this.reInit()}reInit(){[...this._regions,...this._series,...this._components].forEach((t=>{const e=t.getSpecInfo();e&&e.spec&&t.reInit(e.spec)}))}clear(){this.getAllModels().forEach((t=>{var e;return null===(e=t.clear)||void 0===e?void 0:e.call(t)}))}compile(){this.compileBackground(),this.compileLayout(),this.compileRegions(),this.compileSeries(),this.compileComponents()}afterCompile(){this.getAllRegions().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllSeries().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)})),this.getAllComponents().forEach((t=>{var e;null===(e=t.afterCompile)||void 0===e||e.call(t)}))}compileLayout(){const{width:t,height:e}=this.getCanvasRect();this.getCompiler().setSize(t,e)}compileBackground(){var t;this._backgroundMark&&(this._backgroundMark.compile({context:{model:this}}),null===(t=this._backgroundMark.getProduct())||void 0===t||t.layout((()=>{})))}compileRegions(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeRegionCompile)||void 0===e||e.call(t),this.getAllRegions().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterRegionCompile)||void 0===s||s.call(i)}compileSeries(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeSeriesCompile)||void 0===e||e.call(t),this.getAllSeries().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterSeriesCompile)||void 0===s||s.call(i)}compileComponents(){var t,e,i,s;null===(e=null===(t=this._option.performanceHook)||void 0===t?void 0:t.beforeComponentCompile)||void 0===e||e.call(t),this.getAllComponents().forEach((t=>{t.compile()})),null===(s=null===(i=this._option.performanceHook)||void 0===i?void 0:i.afterComponentCompile)||void 0===s||s.call(i)}release(){[...this._components,...this._regions,...this._series].forEach((t=>{t.beforeRelease()})),super.release(),this.clear(),[...this._components,...this._regions,...this._series].forEach((t=>{t.release()})),this._components=this._regions=this._series=[],this._spec={},this._dataSet=this._globalScale=this._layoutFunc=null,this._layoutTag=!1,this._idMap.clear()}onLayout(t){const e=t.rootMark;this.layout({group:e,srView:t})}updateState(t,e){const i=this.getAllSeries();for(const s in t){if(Ym(t[s]))continue;const n=t[s];let r={stateValue:s};r=ys(n.filter)?Object.assign({filter:n.filter},r):Object.assign(Object.assign({},n.filter),r),n.level&&(r.level=n.level),i.forEach((t=>{t.getMarks().forEach((i=>{i.stateStyle[s]&&(e&&!e(t,i,s)||(i.state.changeStateInfo(r),i.updateMarkState(s)))}))}))}}setSelected(t,e,i){this._setStateInDatum(xy.STATE_SELECTED,!0,t,e,i)}setHovered(t,e,i){this._setStateInDatum(xy.STATE_HOVER,!0,t,e,i)}clearState(t){this.getAllRegions().forEach((e=>{e.interaction.clearEventElement(t,!0),e.interaction.resetInteraction(t,null)}))}clearAllStates(){this.getAllRegions().forEach((t=>{t.interaction.clearAllEventElement(),t.interaction.resetAllInteraction()}))}clearSelected(){this.clearState(xy.STATE_SELECTED)}clearHovered(){this.clearState(xy.STATE_HOVER)}_initEvent(){[Hd.dataZoomChange,Hd.scrollBarChange].forEach((t=>{this._event.on(t,(({value:t})=>{this._disableMarkAnimation(["exit","update"]);const e=()=>{this._enableMarkAnimation(["exit","update"]),this._event.off(lc.AFTER_MARK_RENDER_END,e)};this._event.on(lc.AFTER_MARK_RENDER_END,e)}))}))}_enableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.enableAnimationState(t)}))}_disableMarkAnimation(t){this.getAllMarks().forEach((e=>{const i=e.getProduct();i&&i.animate&&i.animate.disableAnimationState(t)}))}_setStateInDatum(t,e,i,s,n){const r=(i=i?Ba(i):null)?Object.keys(i[0]):null;this.getRegionsInQuerier(n).forEach((n=>{i?(n.getSeries().forEach((e=>{e.getMarks().forEach((a=>{if(a.getProduct()&&(!s||ys(s)&&s(e,a))){const e=a.getProduct().isCollectionMark(),s=a.getProduct().elements;let o=[];if(e)o=s.filter((t=>{const e=t.getDatum();i.every(((t,i)=>r.every((s=>t[s]==e[i][s]))))}));else if(i.length>1){const t=i.slice();o=s.filter((e=>{if(0===t.length)return!1;const i=e.getDatum(),s=t.findIndex((t=>r.every((e=>t[e]==i[e]))));return s>=0&&(t.splice(s,1),!0)}))}else{const t=s.find((t=>r.every((e=>i[0][e]==t.getDatum()[e]))));t&&(o=[t])}o.forEach((e=>{n.interaction.startInteraction(t,e)}))}}))})),e&&n.interaction.reverseEventElement(t)):n.interaction.clearEventElement(t,!0)}))}setDimensionIndex(t,e){var i,s,n,a;let o=null;Array.from(this._event.getComposedEventMap().values()).forEach((i=>{const{eventType:s,event:n}=i;if(s===Xh.dimensionHover||s===Xh.dimensionClick){const i=n.dispatch(t,e);(null==i?void 0:i.length)&&(o=i)}}));const l=D(t)||!o||o.every((t=>td(t.axis.getScale().type)&&D(t.index)));if(!1!==e.tooltip){const t=this.getComponentsByType(r.tooltip)[0];if(null==t?void 0:t.getVisible())if(l)null===(s=(i=t).hideTooltip)||void 0===s||s.call(i);else{const i={};o.forEach((t=>{const{axis:e,value:s,data:n}=t,r="left"===e.getOrient()||"right"===e.getOrient();n.forEach((t=>{var e,n,a;const o=r?t.series.fieldY[0]:t.series.fieldX[0];i[o]=null!==(a=null===(n=null===(e=t.datum)||void 0===e?void 0:e[0])||void 0===n?void 0:n[o])&&void 0!==a?a:s}))})),t.showTooltip(i,e.showTooltipOption)}}if(!1!==e.crosshair){const t=this.getComponentsByType(r.cartesianCrosshair)[0];t&&t.clearAxisValue&&t.setAxisValue&&(l?(null===(n=t.clearAxisValue)||void 0===n||n.call(t),null===(a=t.hide)||void 0===a||a.call(t)):o.forEach((e=>{const{axis:i,value:s}=e;t.clearAxisValue(),t.setAxisValue(s,i),t.layoutByValue()})))}}getColorScheme(){var t,e;return null===(e=(t=this._option).getTheme)||void 0===e?void 0:e.call(t).colorScheme}}const uO=(t,e)=>{const i={nodes:{}},{fields:s}=e;if(!(null==s?void 0:s.length))return i;const n=s.length-1;let r,a,o=i;return t.forEach((t=>{t.latestData&&t.latestData.forEach((t=>{o=i;for(let e=0;e{var e;const i=t.getSeries();if(!i.some((t=>t.getStack())))return;const s=i.some((t=>{var e,i;return null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.totalLabel)||void 0===i?void 0:i.visible})),n=s||i.some((t=>t.getPercent())),r=i.some((t=>t.getStackOffsetSilhouette())),a=YT(t,!0);for(const e in a)for(const i in a[e].nodes)NT(a[e].nodes[i],t.getStackInverse(),n,s);if(r)for(const t in a)for(const e in a[t].nodes)zT(a[t].nodes[e]);s&&t.getSeries().forEach((t=>{const e=t.getStackData(),i=t.getStackValue(),s=t.getStackValueField();e&&s&&HT(a[i],s)})),(null===(e=this._options)||void 0===e?void 0:e.afterStackRegion)&&this._options.afterStackRegion(t,a)},this._chart=t,this._options=e}init(){this._chart.getAllRegions().forEach((t=>{t.event.on(Hd.regionSeriesDataFilterOver,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},this.stackRegion)}))}stackAll(){this._chart.getAllRegions().forEach((t=>{this.stackRegion({model:t})}))}}class gO{_beforeInit(){this._dataSet&&Lp(this._dataSet,"stackSplit",uO)}_initStack(){this._stack=new pO(this),this._stack.init()}}class mO extends cO{constructor(){super(...arguments),this.transformerConstructor=oO,this.type="line",this.seriesType=_l.line}}mO.type="line",mO.seriesType=_l.line,mO.transformerConstructor=oO,JA(mO,gO);class _O extends XC{constructor(){super(...arguments),this.type=_O.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}_getIgnoreAttributes(){return[]}}_O.type="area";const fO=()=>{$l.registerMark(_O.type,_O),Sx(),DS(),_c.registerGraphic(Jd.area,xS),BA(),YA(),TC()};class vO extends UT{constructor(){super(...arguments),this._getSeriesStyle=(t,e,i)=>{var s,n,r,a;for(const i of Ba(e)){let e=null===(s=this.series.getSeriesStyle(t))||void 0===s?void 0:s(i);if(!1!==e||"fill"!==i&&"stroke"!==i||(e="fill"===i?null===(r=null===(n=this.series.getSeriesStyle(t))||void 0===n?void 0:n("stroke"))||void 0===r?void 0:r[0]:null===(a=this.series.getSeriesStyle(t))||void 0===a?void 0:a("fill")),M(e))return e}return i}}}const yO=Object.assign(Object.assign(Object.assign({},rL),GC),{area:{name:"area",type:"area"}});class bO extends gE{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){var e,i,s;super._transformLabelSpec(t),this._addMarkLabelSpec(t,"area","areaLabel","initLineLabelMarkStyle",void 0,!0),!1!==(null===(e=t.point)||void 0===e?void 0:e.visible)&&!1!==(null===(s=null===(i=t.point)||void 0===i?void 0:i.style)||void 0===s?void 0:s.visible)||this._addMarkLabelSpec(t,"area")}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o;super._transformSpecAfterMergingTheme(t,e,i);const{area:l={},line:h={},seriesMark:d}=t,c=!1!==l.visible&&!1!==(null===(s=l.style)||void 0===s?void 0:s.visible),u=!1!==h.visible&&!1!==(null===(n=h.style)||void 0===n?void 0:n.visible);l.support3d=!(!l.support3d&&!h.support3d),l.zIndex=M(l.zIndex)||M(h.zIndex)?Math.max(null!==(r=l.zIndex)&&void 0!==r?r:0,null!==(a=h.zIndex)&&void 0!==a?a:0):void 0,l.style&&delete l.style.stroke,l.state&&Object.keys(l.state).forEach((t=>{"style"in l.state[t]?delete l.state[t].style.stroke:delete l.state[t].stroke}));let p=l,g=h;("line"===d||u&&!c)&&(p=h,g=l),l.style=Tl({},g.style,p.style),l.state=Tl({},g.state,p.state),c||(l.style.fill=!1),u||(l.style.stroke=!1),!1===l.interactive&&(l.style.fillPickable=!1),!1===h.interactive&&(h.style.strokePickable=!1),l.interactive=!(!l.interactive&&null!==(o=h.interactive)&&void 0!==o&&!o),l.visible=!(!c&&!u),t.area=l,t.line=h}}class xO extends NC{constructor(){super(...arguments),this.type=_l.area,this.transformerConstructor=bO,this._sortDataByAxis=!1}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},s=this._spec.area||{},n=!1!==s.visible&&!1!==(null===(t=s.style)||void 0===t?void 0:t.visible),r=null!==(e=this._spec.seriesMark)&&void 0!==e?e:"area";this._areaMark=this._createMark(xO.mark.area,{groupKey:this._seriesField,defaultMorphElementKey:this.getDimensionField()[0],progressive:i,isSeriesMark:n&&"point"!==r,customShape:s.customShape,stateSort:s.stateSort}),this.initSymbolMark(i,"point"===r)}initMarkStyle(){this.initAreaMarkStyle(),this.initSymbolMarkStyle()}initAreaMarkStyle(){var t,e,i,s,n;const r=null!==(i=null===(e=null===(t=this.getSpec().area)||void 0===t?void 0:t.style)||void 0===e?void 0:e.curveType)&&void 0!==i?i:null===(n=null===(s=this.getSpec().line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.curveType,a=r===VC?"horizontal"===this._direction?"monotoneY":"monotoneX":r,o=this._areaMark;o&&("horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),x1:t=>{var e,i;return ax(this.dataToPositionX1(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,orient:this._direction},"normal",Py.Series):this.setMarkStyle(this._areaMark,{x:this.dataToPositionX.bind(this),y1:t=>{var e,i;return ax(this.dataToPositionY1(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null},"normal",Py.Series),this.setMarkStyle(o,{fill:this.getColorAttribute(),stroke:this.getColorAttribute()},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(o,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Py.Series),this.setMarkStyle(o,{curveType:a},"normal",Py.Built_In),Object.keys(o.stateStyle).forEach((t=>{o.stateStyle[t].stroke&&o.setPostProcess("stroke",(t=>[t,!1,!1,!1]),t)})))}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;if(this._lineMark&&this._lineMark.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("line"))||void 0===e?void 0:e(n,r),DC("line",this._spec,this._markAttributeContext))),this._areaMark&&this._areaMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("area"))||void 0===i?void 0:i(n,r),DC("area",this._spec,this._markAttributeContext))),this._symbolMark){const t=zC(this);this._symbolMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("scaleInOut"))||void 0===s?void 0:s(),DC("point",this._spec,this._markAttributeContext),t))}}initTooltip(){this._tooltipHelper=new vO(this);const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._areaMark&&t.add(this._areaMark),this._lineMark&&t.add(this._lineMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t),this.encodeDefined(this._areaMark,"defined")}compile(){super.compile(),this.addSamplingCompile(),this.addOverlapCompile()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}onLayoutEnd(t){super.onLayoutEnd(t),this.reCompileSampling()}getSeriesStyle(t){return e=>{var i,s,n,r,a;const o=null!==(i=this._spec.seriesMark)&&void 0!==i?i:"area";let l=null!==(n=null===(s=this._seriesMark)||void 0===s?void 0:s.getAttribute(e,t))&&void 0!==n?n:void 0;return"fill"!==e||l&&"line"!==o||(e="stroke",l=null!==(a=null===(r=this._seriesMark)||void 0===r?void 0:r.getAttribute(e,t))&&void 0!==a?a:void 0),"stroke"===e&&y(l)?l[0]:l}}}xO.type=_l.area,xO.mark=yO,xO.transformerConstructor=bO,JA(xO,UC);class SO extends aO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,line:t.line,area:t.area,seriesMark:t.seriesMark,activePoint:t.activePoint,sampling:t.sampling,samplingFactor:t.samplingFactor,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap,areaLabel:t.areaLabel})}transformSpec(t){super.transformSpec(t),fy(t)}}class MO extends cO{constructor(){super(...arguments),this.transformerConstructor=SO,this.type="area",this.seriesType=_l.area}}function kO(t,e=!0){return(i,s,n)=>{const r="vertical"===t.direction?t.yField:t.xField,a=null==i?void 0:i[r];return"vertical"===t.direction?{overall:e?t.growFrom():e,orient:a>0?"negative":"positive"}:{overall:!!e&&t.growFrom(),orient:a>0?"positive":"negative"}}}MO.type="area",MO.seriesType=_l.area,MO.transformerConstructor=SO,JA(MO,gO);const AO=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:kO(t,e)}),wO=(t,e=!0)=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:kO(t,e)}),TO={type:"fadeIn"},LO={type:"growCenterIn"};function CO(t,e){if(!1===e)return{};switch(e){case"fadeIn":return TO;case"scaleIn":return LO;default:return AO(t)}}class EO extends vx{constructor(){super(...arguments),this.type=EO.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}EO.type="rect";const DO=()=>{$l.registerMark(EO.type,EO),NA(),AC()},PO=Object.assign(Object.assign({},rL),{bar:{name:"bar",type:"rect"},barBackground:{name:"barBackground",type:"rect"}}),OO=Object.assign(Object.assign({},rL),{bar3d:{name:"bar3d",type:"rect3d"}});function RO(t,e,i){var s,n;if(t.values.length>0){let r;if(t.sortDatums.length){let a=t.sortDatums;e&&(a=t.sortDatums.slice().reverse());for(let t=0;t{var a,o;const l=null===(o=(a=t[i.axisHelper]).getScale)||void 0===o?void 0:o.call(a,0);for(let a=0;athis._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[aL]):this._spec.barMinHeight?this._calculateRectPosition(t,!1):ax(this._dataToPosX(t),e),this._getBarXEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!1),t[oL]):ax(this._dataToPosX1(t),e),this._getBarYStart=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[lL]):this._spec.barMinHeight?this._calculateRectPosition(t,!0):ax(this._dataToPosY(t),e),this._getBarYEnd=(t,e)=>this._shouldDoPreCalculate()?(this._calculateStackRectPosition(!0),t[hL]):ax(this._dataToPosY1(t),e),this._getBarBackgroundXStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundXEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundYStart=t=>{const e=t.range();return Math.min(e[0],e[e.length-1])},this._getBarBackgroundYEnd=t=>{const e=t.range();return Math.max(e[0],e[e.length-1])},this._getBarBackgroundPositionXEncoder=()=>{var t;return null===(t=this._barBackgroundPositionXEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionXEncoder=t=>{this._barBackgroundPositionXEncoder=t.bind(this)},this._getBarBackgroundPositionYEncoder=()=>{var t;return null===(t=this._barBackgroundPositionYEncoder)||void 0===t?void 0:t.bind(this)},this._setBarBackgroundPositionYEncoder=t=>{this._barBackgroundPositionYEncoder=t.bind(this)}}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._initBarBackgroundMark(i),this._barMark=this._createMark(Object.assign(Object.assign({},FO.mark.bar),{name:this._barMarkName,type:this._barMarkType}),{morph:RC(this._spec,this._barMarkName),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,progressive:i,customShape:null===(t=this._spec.bar)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.bar)||void 0===e?void 0:e.stateSort})}_initBarBackgroundMark(t){this._spec.barBackground&&this._spec.barBackground.visible&&(this._barBackgroundMark=this._createMark(FO.mark.barBackground,{dataView:this._barBackgroundViewData.getDataView(),dataProductId:this._barBackgroundViewData.getProductId(),progressive:t,customShape:this._spec.barBackground.customShape,stateSort:this._spec.barBackground.stateSort}))}initMarkStyle(){this._barMark&&this.setMarkStyle(this._barMark,{fill:this.getColorAttribute()},"normal",Py.Series)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null})}initTooltip(){super.initTooltip();const{mark:t,group:e}=this._tooltipHelper.activeTriggerSet;this._barMark&&(t.add(this._barMark),e.add(this._barMark))}_statisticViewData(){var t,e;super._statisticViewData();const i=null!==(t=this._spec.barBackground)&&void 0!==t?t:{};if(!i.visible)return;const s=this._getRelatedComponentSpecInfo("axes").some((t=>t.type===r.cartesianBandAxis));let n;if(Lp(this._option.dataSet,"addVChartProperty",WT),s){const t=([t],{scaleDepth:e})=>{var i,s;let n=[{}];const r=this.getDimensionField(),a=D(e)?r.length:Math.min(r.length,e);for(let e=0;e{const i=[],[s,n]=this.getDimensionContinuousField(),r={};return e.latestData.forEach((t=>{const e=`${t[s]}-${t[n]}`;r[e]||(r[e]={[s]:t[s],[n]:t[n]},i.push(r[e]))})),i};Lp(this._option.dataSet,"dimensionItems",t);const e=this.getViewData();n=new R(this._option.dataSet).parse([e],{type:"dataview"}).transform({type:"dimensionItems"},!1).transform({type:"addVChartProperty",options:{beforeCall:eL.bind(this),call:iL}},!1),null==e||e.target.addListener("change",n.reRunAllTransform)}this._barBackgroundViewData=new ZT(this._option,n)}init(t){var e,i;super.init(t),"vertical"===this.direction?"band"===(null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle():"band"===(null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale(0).type)?this.initBandRectMarkStyle():this.initLinearRectMarkStyle()}_shouldDoPreCalculate(){const t=this.getRegion();return this.getStack()&&t.getSeries().filter((t=>t.type===this.type&&t.getSpec().barMinHeight)).length}_calculateStackRectPosition(t){const e=this.getRegion();if(e._bar_series_position_calculated)return;let i,s,n,r,a;e._bar_series_position_calculated=!0,t?(i=hL,s=lL,n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(i=oL,s=aL,n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=YT(e,!1,(t=>t.type===this.type));for(const l in o)for(const h in o[l].nodes)RO(o[l].nodes[h],e.getStackInverse(),{isVertical:t,start:i,end:s,startMethod:n,endMethod:r,axisHelper:a})}_calculateRectPosition(t,e){var i,s;let n,r,a;e?(n="_dataToPosY1",r="_dataToPosY",a="_yAxisHelper"):(n="_dataToPosX1",r="_dataToPosX",a="_xAxisHelper");const o=null===(s=(i=this[a]).getScale)||void 0===s?void 0:s.call(i,0),l=this[a].isInverse(),h=this._spec.barMinHeight,d=ax(this[n](t),o),c=ax(this[r](t),o);let u=Math.abs(d-c);uthis._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n),y:t=>this._getPosition(this.direction,t),height:()=>this._getBarWidth(this._yAxisHelper),width:()=>{},y1:()=>{}},"normal",Py.Series):this.setMarkStyle(this._barMark,{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r),x:t=>this._getPosition(this.direction,t),width:()=>this._getBarWidth(this._xAxisHelper),x1:()=>{},height:()=>{}},"normal",Py.Series),this._initStackBarMarkStyle(),this._initBandBarBackgroundMarkStyle()}_initStackBarMarkStyle(){var t,e,i,s;if(!this._spec.stackCornerRadius)return;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);this._barMark.setClip((()=>{const t=[];return this._forEachStackGroup((e=>{let i=1/0,s=-1/0,a=!1,o=1/0,l=-1/0;e.values.forEach((t=>{const e=t[MT],n=t[kT],r=t[AT],h=t[wT];i=Math.min(i,e,n),s=Math.max(s,e,n),M(r)&&M(h)&&(a=!0,o=Math.min(o,r,h),l=Math.max(l,r,h))}));const h=Object.assign(Object.assign(Object.assign({},e.values[0]),{[MT]:i,[kT]:s}),a?{[AT]:o,[wT]:l}:void 0),d="horizontal"===this.direction?{x:this._getBarXStart(h,n),x1:this._getBarXEnd(h,n),y:this._getPosition(this.direction,h),height:this._getBarWidth(this._yAxisHelper)}:{y:this._getBarYStart(h,r),y1:this._getBarYEnd(h,r),x:this._getPosition(this.direction,h),width:this._getBarWidth(this._xAxisHelper)};t.push(Kv(Object.assign(Object.assign({},d),{cornerRadius:ys(this._spec.stackCornerRadius)?this._spec.stackCornerRadius(d,h,this._markAttributeContext):this._spec.stackCornerRadius,fill:!0})))})),t}))}initLinearRectMarkStyle(){var t,e,i,s;const n=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),r=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0);if("horizontal"===this.direction){const t=M(this._fieldY2)?{y:t=>ax(this._dataToPosY(t),r),y1:t=>ax(this._dataToPosY1(t),r)}:{y:t=>ax(this._dataToPosY(t)-this._getBarWidth(this._yAxisHelper)/2,r),height:t=>this._getBarWidth(this._yAxisHelper)};this.setMarkStyle(this._barMark,Object.assign({x:t=>this._getBarXStart(t,n),x1:t=>this._getBarXEnd(t,n)},t),"normal",Py.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign({x:()=>this._getBarBackgroundXStart(n),x1:()=>this._getBarBackgroundXEnd(n)},t),"normal",Py.Series)}else{const t=M(this._fieldX2)?{x:t=>ax(this._dataToPosX(t),n),x1:t=>ax(this._dataToPosX1(t),n)}:{x:t=>ax(this._dataToPosX(t)-this._getBarWidth(this._xAxisHelper)/2,n),width:t=>this._getBarWidth(this._xAxisHelper)};this.setMarkStyle(this._barMark,Object.assign(Object.assign({},t),{y:t=>this._getBarYStart(t,r),y1:t=>this._getBarYEnd(t,r)}),"normal",Py.Series),this.setMarkStyle(this._barBackgroundMark,Object.assign(Object.assign({},t),{y:()=>this._getBarBackgroundYStart(r),y1:()=>this._getBarBackgroundYEnd(r)}),"normal",Py.Series)}}_initBandBarBackgroundMarkStyle(){var t,e,i,s,n;if(!this._barBackgroundMark)return;const r=null===(e=null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale)||void 0===e?void 0:e.call(t,0),a=null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0),o=null!==(n=this._spec.barBackground)&&void 0!==n?n:{},l=D(o.fieldLevel)?void 0:o.fieldLevel+1;"horizontal"===this.direction?this.setMarkStyle(this._barBackgroundMark,{x:()=>this._getBarBackgroundXStart(r),x1:()=>this._getBarBackgroundXEnd(r),y:t=>this._getPosition(this.direction,t,l,"barBackground"),height:()=>this._getBarWidth(this._yAxisHelper,l),width:()=>{},y1:()=>{}},"normal",Py.Series):this.setMarkStyle(this._barBackgroundMark,{x:t=>this._getPosition(this.direction,t,l,"barBackground"),y:()=>this._getBarBackgroundYStart(a),y1:()=>this._getBarBackgroundYEnd(a),width:()=>this._getBarWidth(this._xAxisHelper,l),x1:()=>{},height:()=>{}},"normal",Py.Series)}initAnimation(){var t,e;const i={yField:this._fieldY[0],xField:this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},s=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset,n=zC(this);this._barMark.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("bar"))||void 0===e?void 0:e(i,s),DC(this._barMarkName,this._spec,this._markAttributeContext),n))}_getBarWidth(t,e){var i,s;const n=this._groups?this._groups.fields.length:1,r=D(e)?n:Math.min(n,e),a=null!==(s=null===(i=t.getBandwidth)||void 0===i?void 0:i.call(t,r-1))&&void 0!==s?s:6,o=M(this._spec.barWidth)&&r===n,l=M(this._spec.barMinWidth),h=M(this._spec.barMaxWidth);let d=a;return o&&(d=rl(this._spec.barWidth,a)),l&&(d=Math.max(d,rl(this._spec.barMinWidth,a))),h&&(d=Math.min(d,rl(this._spec.barMaxWidth,a))),d}_getPosition(t,e,i,s){var n,r,a,o,l;let h,d,c;"horizontal"===t?(h=this.getYAxisHelper(),d="height",c="barBackground"===s?this.dataToBarBackgroundPositionY.bind(this):this.dataToPositionY.bind(this)):(h=this.getXAxisHelper(),d="width",c="barBackground"===s?this.dataToBarBackgroundPositionX.bind(this):this.dataToPositionX.bind(this));const u=h.getScale(0),p=this._groups?this._groups.fields.length:1,g=D(i)?p:Math.min(p,i),m=null!==(r=null===(n=h.getBandwidth)||void 0===n?void 0:n.call(h,g-1))&&void 0!==r?r:6,_=g===p?this._barMark.getAttribute(d,e):m;if(g>1&&M(this._spec.barGapInGroup)){const t=this._groups.fields,i=Ba(this._spec.barGapInGroup);let s=0,n=0;for(let r=t.length-1;r>=1;r--){const d=t[r],c=null!==(o=null===(a=h.getScale(r))||void 0===a?void 0:a.domain())&&void 0!==o?o:[],u=c.length,p=rl(null!==(l=i[r-1])&&void 0!==l?l:Fa(i),m),g=c.indexOf(e[d]);r===t.length-1?(s+=u*_+(u-1)*p,n+=g*(_+p)):(n+=g*(s+p),s+=s+(u-1)*p)}return u.scale(e[t[0]])+h.getBandwidth(0)/2-s/2+n}const f=Jh(u.type||"band");return c(e,g)+.5*(m-_)+(f?-m/2:0)}dataToBarBackgroundPositionX(t,e){return this._dataToPosition(t,this._xAxisHelper,this.fieldX,e,this._getBarBackgroundPositionXEncoder,this._setBarBackgroundPositionXEncoder)}dataToBarBackgroundPositionY(t,e){return this._dataToPosition(t,this._yAxisHelper,this.fieldY,e,this._getBarBackgroundPositionYEncoder,this._setBarBackgroundPositionYEncoder)}onLayoutEnd(t){super.onLayoutEnd(t),this.getRegion()._bar_series_position_calculated=!1,this._spec.sampling&&this.compile()}compile(){if(super.compile(),this._spec.sampling){const{width:t,height:e}=this._region.getLayoutRect(),i=[],s=this._fieldY,n=this._fieldX;i.push({type:"sampling",size:"horizontal"===this._direction?e:t,factor:this._spec.samplingFactor,yfield:"horizontal"===this._direction?n[0]:s[0],groupBy:this._seriesField,mode:this._spec.sampling}),this._data.getProduct().transform(i)}}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._barMark]}compileData(){var t;super.compileData(),null===(t=this._barBackgroundViewData)||void 0===t||t.compile()}fillData(){var t,e;super.fillData(),null===(e=null===(t=this._barBackgroundViewData)||void 0===t?void 0:t.getDataView())||void 0===e||e.reRunAllTransform()}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._barBackgroundViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._barBackgroundViewData)||void 0===s||s.updateData()}release(){var t;super.release(),null===(t=this._barBackgroundViewData)||void 0===t||t.release(),this._barBackgroundViewData=null}}FO.type=_l.bar,FO.mark=PO,FO.transformerConstructor=BO;const YO=()=>{uE(),DO(),$l.registerAnimation("bar",((t,e)=>({appear:CO(t,e),enter:AO(t,!1),exit:wO(t,!1),disappear:wO(t)}))),VP(),iO(),$l.registerSeries(FO.type,FO)};class jO extends aO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barMinHeight:t.barMinHeight,sampling:t.sampling,samplingFactor:t.samplingFactor,barBackground:t.barBackground,stackCornerRadius:t.stackCornerRadius})}transformSpec(t){super.transformSpec(t),fy(t)}_transformAxisSpec(t){var e,i;if(super._transformAxisSpec(t),!t.axes)return;const s=t.series.some((t=>"horizontal"===t.direction)),n=null!==(e=t.axes.find((t=>"band"===t.type)))&&void 0!==e?e:t.axes.find((t=>(s?["left","right"]:["top","bottom"]).includes(t.orient)));if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize&&t.autoBandSize){const e=vs(t.autoBandSize)&&null!==(i=t.autoBandSize.extend)&&void 0!==i?i:0,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o}=t.series.find((t=>"bar"===t.type));this._applyAxisBandSize(n,e,{barMaxWidth:s,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}class HO extends cO{constructor(){super(...arguments),this.transformerConstructor=jO,this.type="bar",this.seriesType=_l.bar}}HO.type="bar",HO.seriesType=_l.bar,HO.transformerConstructor=jO,JA(HO,gO);class zO extends vx{constructor(){super(...arguments),this.type=zO.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,length:3})}}zO.type="rect3d";const NO=()=>{$l.registerMark(zO.type,zO),Sx(),FM(),_c.registerGraphic(Jd.rect3d,CM),AC()};class VO extends FO{constructor(){super(...arguments),this.type=_l.bar3d,this._barMarkName="bar3d",this._barMarkType="rect3d"}}VO.type=_l.bar3d,VO.mark=OO;const WO=()=>{$l.registerAnimation("bar3d",((t,e)=>({appear:CO(t,e),enter:AO(t,!1),exit:wO(t,!1),disappear:wO(t)}))),NO(),VP(),iO(),$l.registerSeries(VO.type,VO)};class GO extends jO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup})}}class UO{constructor(){this.name="ViewTransform3dPlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.onMouseDown=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!0,this.pageX=t.page.x,this.pageY=t.page.y)},this.onMouseUp=t=>{this.option3d||(this.option3d=this.pluginService.stage.option3d),this.option3d&&(this.mousedown=!1)},this.onMouseMove=t=>{var e,i;const s=this.pluginService.stage;if(this.option3d||(this.option3d=s.option3d),this.option3d&&this.mousedown)if(this.pageX&&this.pageY){const n=t.page.x-this.pageX,r=t.page.y-this.pageY;this.pageX=t.page.x,this.pageY=t.page.y;const a=n/100,o=r/100;this.option3d.alpha=(null!==(e=this.option3d.alpha)&&void 0!==e?e:0)+a,this.option3d.beta=(null!==(i=this.option3d.beta)&&void 0!==i?i:0)+o,s.set3dOptions(this.option3d),s.renderNextFrame()}else this.pageX=t.page.x,this.pageY=t.page.y}}activate(t){this.pluginService=t;const e=t.stage;this.option3d=e.option3d,e.addEventListener("mousedown",this.onMouseDown),e.addEventListener("mouseup",this.onMouseUp),e.addEventListener("mousemove",this.onMouseMove)}deactivate(t){const e=t.stage;e.removeEventListener("mousedown",this.onMouseDown),e.removeEventListener("mouseup",this.onMouseUp),e.removeEventListener("mousemove",this.onMouseMove)}}const $O=()=>{Xx(),qx(),Lg.registerPlugin("ViewTransform3dPlugin",UO)};class XO extends HO{constructor(){super(...arguments),this.transformerConstructor=GO,this.type="bar3d",this.seriesType=_l.bar3d}}XO.type="bar3d",XO.seriesType=_l.bar3d,XO.transformerConstructor=GO;const KO=[10,20],qO=Kh.Linear,ZO="circle",JO=Kh.Ordinal,QO=["circle","square","triangle","diamond","star"],tR=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"},eR=Object.assign(Object.assign({},rL),{point:{name:"point",type:"symbol"}});class iR extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"point")}}class sR extends NC{constructor(){super(...arguments),this.type=_l.scatter,this.transformerConstructor=iR,this._invalidType="zero"}setAttrFromSpec(){super.setAttrFromSpec(),this._size=this._spec.size,this._sizeField=this._spec.sizeField,this._shape=this._spec.shape,this._shapeField=this._spec.shapeField}_getSeriesAttribute(t,e,{defaultScaleType:i,defaultRange:s},n){var r,a,o,l;if(ys(e))return e;if(y(e)){if(D(t))return null===(r=this._option)||void 0===r||r.onError(`${n}Field is required.`),e;if("ordinal"!==i&&e.length>2)return null===(a=this._option)||void 0===a||a.onError(`${n} length is invalid, specify up to 2 ${n}s.`),e;const s=`${sh}_series_scatter_${this.id}_scale_${n}`;return this._option.globalScale.registerModelScale({id:s,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:e}),{scale:s,field:t}}if(vs(e)){if(D(t))return null===(o=this._option)||void 0===o||o.onError(`${n}Field is required.`),e;const r=`${sh}_series_scatter_${this.id}_scale_${n}`,a=Object.assign({id:r,type:i,domain:[{dataId:this._rawData.name,fields:[t]}],range:s},e);return this._option.globalScale.registerModelScale(a),{scale:a.id,field:t}}return null===(l=this._option)||void 0===l||l.onError(`${n} attribute is invalid.`),e}getSizeAttribute(t,e){return D(e)?10:h(e)?e:!S(e)||("string"!=typeof(i=e)||isNaN(Number(i))||isNaN(parseFloat(i)))?this._getSeriesAttribute(t,e,{defaultScaleType:qO,defaultRange:KO},"size"):parseFloat(e);var i}getShapeAttribute(t,e){return D(e)?ZO:S(e)?e:this._getSeriesAttribute(t,e,{defaultScaleType:JO,defaultRange:QO},"shape")}initMark(){var t,e;const i={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._symbolMark=this._createMark(sR.mark.point,{morph:RC(this._spec,sR.mark.point.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,progressive:i,isSeriesMark:!0,customShape:null===(t=this._spec.point)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.point)||void 0===e?void 0:e.stateSort})}initMarkStyle(){this.initSymbolMarkStyle()}initAnimation(){var t,e,i;const s=zC(this),n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._symbolMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("scatter"))||void 0===i?void 0:i({},n),DC("point",this._spec,this._markAttributeContext),s))}initSymbolMarkStyle(){const t=this._symbolMark;t&&("zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)}),this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),z:this._fieldZ?this.dataToPositionZ.bind(this):null,fill:this.getColorAttribute(),size:h(this._size)||ys(this._size)?this._size:10,symbolType:S(this._shape)||ys(this._shape)?this._shape:ZO},xy.STATE_NORMAL,Py.Series),(M(this._sizeField)||M(this._size))&&this.setMarkStyle(t,{size:this.getSizeAttribute(this._sizeField,this._size)},xy.STATE_NORMAL,Py.User_Mark),(M(this._shapeField)||M(this._shape))&&this.setMarkStyle(t,{symbolType:this.getShapeAttribute(this._shapeField,this._shape)},xy.STATE_NORMAL,Py.User_Mark))}initTooltip(){super.initTooltip(),this._symbolMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._symbolMark)}viewDataStatisticsUpdate(t){super.viewDataStatisticsUpdate(t);const e=[this.getDimensionField()[0],this.getStackValueField()].every((t=>{var e,i,s;return t&&(null===(s=null===(i=null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[t])||void 0===s?void 0:s.allValid)}));"zero"===this._invalidType||e?this.setMarkStyle(this._symbolMark,{visible:!0},"normal",Py.Series):this.setMarkStyle(this._symbolMark,{visible:this._getInvalidDefined.bind(this)},"normal",Py.Series),this._symbolMark.getProduct()&&this._symbolMark.compileEncode()}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getStackValueField()],z:this._fieldZ?this.dataToPositionZ.bind(this):null},xy.STATE_NORMAL,Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{visible:this._getInvalidDefined.bind(this)},xy.STATE_NORMAL,Py.Series))}handleZoom(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}handlePan(t){var e,i;this.getMarksWithoutRoot().forEach((t=>{const e=t.getProduct();e&&e.elements&&e.elements.length&&e.elements.forEach(((t,e)=>{const i=t.getGraphicItem(),s=t.getDatum(),n=this.dataToPosition(s);n&&i&&i.translateTo(n.x,n.y)}))}));const s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct();s&&s.evaluate(null,null)}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._symbolMark]}}sR.type=_l.scatter,sR.mark=eR,sR.transformerConstructor=iR;class nR extends aO{_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{point:t.point,size:t.size,sizeField:t.sizeField,shape:t.shape,shapeField:t.shapeField})}}class rR extends cO{constructor(){super(...arguments),this.transformerConstructor=nR,this.type="scatter",this.seriesType=_l.scatter}}function aR(){var t,e=[];return{point:function(e,i,s){t.push([e,i,s])},lineStart:function(){e.push(t=[])},lineEnd:qc,rejoin:function(){e.length>1&&e.push(e.pop().concat(e.shift()))},result:function(){var i=e;return e=[],t=null,i}}}function oR(t,e){return Fc(t[0]-e[0])=0;--r)n.point((d=h[r])[0],d[1]);else s(u.x,u.p.x,-1,n);u=u.p}h=(u=u.o).z,p=!p}while(!u.v);n.lineEnd()}}}function dR(t){if(e=t.length){for(var e,i,s=0,n=t[0];++se?1:t>=e?0:NaN}1===(vR=SR).length&&(yR=vR,vR=function(t,e){return SR(yR(t),e)});var MR=Array.prototype;function kR(t){for(var e,i,s,n=t.length,r=-1,a=0;++r=0;)for(e=(s=t[n]).length;--e>=0;)i[--a]=s[e];return i}function AR(t,e,i,s){return function(n){var r,a,o,l=e(n),h=aR(),d=e(h),c=!1,u={point:p,lineStart:m,lineEnd:_,polygonStart:function(){u.point=f,u.lineStart=v,u.lineEnd=y,a=[],r=[]},polygonEnd:function(){u.point=p,u.lineStart=m,u.lineEnd=_,a=kR(a);var t=function(t,e){var i=xR(e),s=e[1],n=Wc(s),r=[Wc(i),-Hc(i),0],a=0,o=0;bR.reset(),1===n?s=Pc+Ec:-1===n&&(s=-Pc-Ec);for(var l=0,h=t.length;l=0?1:-1,A=k*M,w=A>Dc,T=m*x;if(bR.add(jc(T*k*Wc(A),_*S+T*Hc(A))),a+=w?M+k*Rc:M,w^p>=i^y>=i){var L=gR(uR(u),uR(v));fR(L);var C=gR(r,L);fR(C);var E=(w^M>=0?-1:1)*Kc(C[2]);(s>E||s===E&&(L[0]||L[1]))&&(o+=w^M>=0?1:-1)}}return(a<-Ec||a0){for(c||(n.polygonStart(),c=!0),n.lineStart(),t=0;t1&&2&l&&u.push(u.pop().concat(u.shift())),a.push(u.filter(wR))}return u}}function wR(t){return t.length>1}function TR(t,e){return((t=t.x)[0]<0?t[1]-Pc-Ec:Pc-t[1])-((e=e.x)[0]<0?e[1]-Pc-Ec:Pc-e[1])}MR.slice,MR.map,Math.sqrt(50),Math.sqrt(10),Math.sqrt(2);const LR=AR((function(){return!0}),(function(t){var e,i=NaN,s=NaN,n=NaN;return{lineStart:function(){t.lineStart(),e=1},point:function(r,a){var o=r>0?Dc:-Dc,l=Fc(r-i);Fc(l-Dc)0?Pc:-Pc),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),t.point(r,s),e=0):n!==o&&l>=Dc&&(Fc(i-n)Ec?Yc((Wc(e)*(r=Hc(s))*Wc(i)-Wc(s)*(n=Hc(e))*Wc(t))/(n*r*a)):(e+s)/2}(i,s,r,a),t.point(n,s),t.lineEnd(),t.lineStart(),t.point(o,s),e=0),t.point(i=r,s=a),n=o},lineEnd:function(){t.lineEnd(),i=s=NaN},clean:function(){return 2-e}}}),(function(t,e,i,s){var n;if(null==t)n=i*Pc,s.point(-Dc,n),s.point(0,n),s.point(Dc,n),s.point(Dc,0),s.point(Dc,-n),s.point(0,-n),s.point(-Dc,-n),s.point(-Dc,0),s.point(-Dc,n);else if(Fc(t[0]-e[0])>Ec){var r=t[0]0)do{h.point(0===d||3===d?t:i,d>1?s:e)}while((d=(d+o+4)%4)!==c);else h.point(r[0],r[1])}function a(s,n){return Fc(s[0]-t)0?0:3:Fc(s[0]-i)0?2:1:Fc(s[1]-e)0?1:0:n>0?3:2}function o(t,e){return l(t.x,e.x)}function l(t,e){var i=a(t,1),s=a(e,1);return i!==s?i-s:0===i?e[1]-t[1]:1===i?t[0]-e[0]:2===i?t[1]-e[1]:e[0]-t[0]}return function(a){var l,h,d,c,u,p,g,m,_,f,v,y=a,b=aR(),x={point:S,lineStart:function(){x.point=M,h&&h.push(d=[]),f=!0,_=!1,g=m=NaN},lineEnd:function(){l&&(M(c,u),p&&_&&b.rejoin(),l.push(b.result())),x.point=S,_&&y.lineEnd()},polygonStart:function(){y=b,l=[],h=[],v=!0},polygonEnd:function(){var e=function(){for(var e=0,i=0,n=h.length;is&&(u-r)*(s-a)>(p-a)*(t-r)&&++e:p<=s&&(u-r)*(s-a)<(p-a)*(t-r)&&--e;return e}(),i=v&&e,n=(l=kR(l)).length;(i||n)&&(a.polygonStart(),i&&(a.lineStart(),r(null,null,1,a),a.lineEnd()),n&&hR(l,o,e,r,a),a.polygonEnd()),y=a,l=h=d=null}};function S(t,e){n(t,e)&&y.point(t,e)}function M(r,a){var o=n(r,a);if(h&&d.push([r,a]),f)c=r,u=a,p=o,f=!1,o&&(y.lineStart(),y.point(r,a));else if(o&&_)y.point(r,a);else{var l=[g=Math.max(DR,Math.min(ER,g)),m=Math.max(DR,Math.min(ER,m))],b=[r=Math.max(DR,Math.min(ER,r)),a=Math.max(DR,Math.min(ER,a))];!function(t,e,i,s,n,r){var a,o=t[0],l=t[1],h=0,d=1,c=e[0]-o,u=e[1]-l;if(a=i-o,c||!(a>0)){if(a/=c,c<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=n-o,c||!(a<0)){if(a/=c,c<0){if(a>d)return;a>h&&(h=a)}else if(c>0){if(a0)){if(a/=u,u<0){if(a0){if(a>d)return;a>h&&(h=a)}if(a=r-l,u||!(a<0)){if(a/=u,u<0){if(a>d)return;a>h&&(h=a)}else if(u>0){if(a0&&(t[0]=o+h*c,t[1]=l+h*u),d<1&&(e[0]=o+d*c,e[1]=l+d*u),!0}}}}}(l,b,t,e,i,s)?o&&(y.lineStart(),y.point(r,a),v=!1):(_||(y.lineStart(),y.point(l[0],l[1])),y.point(b[0],b[1]),o||y.lineEnd(),v=!1)}g=r,m=a,_=o}return x}}function OR(t,e){function i(i,s){return i=t(i,s),e(i[0],i[1])}return t.invert&&e.invert&&(i.invert=function(i,s){return(i=e.invert(i,s))&&t.invert(i[0],i[1])}),i}function RR(t,e){return[Fc(t)>Dc?t+Math.round(-t/Rc)*Rc:t,e]}function IR(t,e,i){return(t%=Rc)?e||i?OR(FR(t),YR(e,i)):FR(t):e||i?YR(e,i):RR}function BR(t){return function(e,i){return[(e+=t)>Dc?e-Rc:e<-Dc?e+Rc:e,i]}}function FR(t){var e=BR(t);return e.invert=BR(-t),e}function YR(t,e){var i=Hc(t),s=Wc(t),n=Hc(e),r=Wc(e);function a(t,e){var a=Hc(e),o=Hc(t)*a,l=Wc(t)*a,h=Wc(e),d=h*i+o*s;return[jc(l*n-d*r,o*i-h*s),Kc(d*n+l*r)]}return a.invert=function(t,e){var a=Hc(e),o=Hc(t)*a,l=Wc(t)*a,h=Wc(e),d=h*n-l*r;return[jc(l*n+h*r,o*i+d*s),Kc(d*i-o*s)]},a}function jR(t){return function(e){var i=new HR;for(var s in t)i[s]=t[s];return i.stream=e,i}}function HR(){}function zR(t,e,i){var s=t.clipExtent&&t.clipExtent();return t.scale(150).translate([0,0]),null!=s&&t.clipExtent(null),Ac(i,t.stream(gu)),e(gu.result()),null!=s&&t.clipExtent(s),t}function NR(t,e,i){return zR(t,(function(i){var s=e[1][0]-e[0][0],n=e[1][1]-e[0][1],r=Math.min(s/(i[1][0]-i[0][0]),n/(i[1][1]-i[0][1])),a=+e[0][0]+(s-r*(i[1][0]+i[0][0]))/2,o=+e[0][1]+(n-r*(i[1][1]+i[0][1]))/2;t.scale(150*r).translate([a,o])}),i)}function VR(t,e,i){return NR(t,[[0,0],e],i)}function WR(t,e,i){return zR(t,(function(i){var s=+e,n=s/(i[1][0]-i[0][0]),r=(s-n*(i[1][0]+i[0][0]))/2,a=-n*i[0][1];t.scale(150*n).translate([r,a])}),i)}function GR(t,e,i){return zR(t,(function(i){var s=+e,n=s/(i[1][1]-i[0][1]),r=-n*i[0][0],a=(s-n*(i[1][1]+i[0][1]))/2;t.scale(150*n).translate([r,a])}),i)}RR.invert=RR,HR.prototype={constructor:HR,point:function(t,e){this.stream.point(t,e)},sphere:function(){this.stream.sphere()},lineStart:function(){this.stream.lineStart()},lineEnd:function(){this.stream.lineEnd()},polygonStart:function(){this.stream.polygonStart()},polygonEnd:function(){this.stream.polygonEnd()}};var UR=16,$R=Hc(30*Bc);function XR(t,e){return+e?function(t,e){function i(s,n,r,a,o,l,h,d,c,u,p,g,m,_){var f=h-s,v=d-n,y=f*f+v*v;if(y>4*e&&m--){var b=a+u,x=o+p,S=l+g,M=Uc(b*b+x*x+S*S),k=Kc(S/=M),A=Fc(Fc(S)-1)e||Fc((f*C+v*E)/y-.5)>.3||a*u+o*p+l*g<$R)&&(i(s,n,r,a,o,l,T,L,A,b/=M,x/=M,S,m,_),_.point(T,L),i(T,L,A,b,x,S,h,d,c,u,p,g,m,_))}}return function(e){var s,n,r,a,o,l,h,d,c,u,p,g,m={point:_,lineStart:f,lineEnd:y,polygonStart:function(){e.polygonStart(),m.lineStart=b},polygonEnd:function(){e.polygonEnd(),m.lineStart=f}};function _(i,s){i=t(i,s),e.point(i[0],i[1])}function f(){d=NaN,m.point=v,e.lineStart()}function v(s,n){var r=uR([s,n]),a=t(s,n);i(d,c,h,u,p,g,d=a[0],c=a[1],h=s,u=r[0],p=r[1],g=r[2],UR,e),e.point(d,c)}function y(){m.point=_,e.lineEnd()}function b(){f(),m.point=x,m.lineEnd=S}function x(t,e){v(s=t,e),n=d,r=c,a=u,o=p,l=g,m.point=v}function S(){i(d,c,h,u,p,g,n,r,s,a,o,l,UR,e),m.lineEnd=y,y()}return m}}(t,e):function(t){return jR({point:function(e,i){e=t(e,i),this.stream.point(e[0],e[1])}})}(t)}var KR=jR({point:function(t,e){this.stream.point(t*Bc,e*Bc)}});function qR(t,e,i,s,n){function r(r,a){return[e+t*(r*=s),i-t*(a*=n)]}return r.invert=function(r,a){return[(r-e)/t*s,(i-a)/t*n]},r}function ZR(t,e,i,s,n,r){var a=Hc(r),o=Wc(r),l=a*t,h=o*t,d=a/t,c=o/t,u=(o*i-a*e)/t,p=(o*e+a*i)/t;function g(t,r){return[l*(t*=s)-h*(r*=n)+e,i-h*t-l*r]}return g.invert=function(t,e){return[s*(d*t-c*e+u),n*(p-c*t-d*e)]},g}function JR(t){return QR((function(){return t}))()}function QR(t){var e,i,s,n,r,a,o,l,h,d,c=150,u=480,p=250,g=0,m=0,_=0,f=0,v=0,y=0,b=1,x=1,S=null,M=LR,k=null,A=yc,w=.5;function T(t){return l(t[0]*Bc,t[1]*Bc)}function L(t){return(t=l.invert(t[0],t[1]))&&[t[0]*Ic,t[1]*Ic]}function C(){var t=ZR(c,0,0,b,x,y).apply(null,e(g,m)),s=(y?ZR:qR)(c,u-t[0],p-t[1],b,x,y);return i=IR(_,f,v),o=OR(e,s),l=OR(i,o),a=XR(o,w),E()}function E(){return h=d=null,T}return T.stream=function(t){return h&&d===t?h:h=KR(function(t){return jR({point:function(e,i){var s=t(e,i);return this.stream.point(s[0],s[1])}})}(i)(M(a(A(d=t)))))},T.preclip=function(t){return arguments.length?(M=t,S=void 0,E()):M},T.postclip=function(t){return arguments.length?(A=t,k=s=n=r=null,E()):A},T.clipAngle=function(t){return arguments.length?(M=+t?function(t){var e=Hc(t),i=6*Bc,s=e>0,n=Fc(e)>Ec;function r(t,i){return Hc(t)*Hc(i)>e}function a(t,i,s){var n=[1,0,0],r=gR(uR(t),uR(i)),a=pR(r,r),o=r[0],l=a-o*o;if(!l)return!s&&t;var h=e*a/l,d=-e*o/l,c=gR(n,r),u=_R(n,h);mR(u,_R(r,d));var p=c,g=pR(u,p),m=pR(p,p),_=g*g-m*(pR(u,u)-1);if(!(_<0)){var f=Uc(_),v=_R(p,(-g-f)/m);if(mR(v,u),v=cR(v),!s)return v;var y,b=t[0],x=i[0],S=t[1],M=i[1];x0^v[1]<(Fc(v[0]-b)Dc^(b<=v[0]&&v[0]<=x)){var w=_R(p,(-g+f)/m);return mR(w,u),[v,cR(w)]}}}function o(e,i){var n=s?t:Dc-t,r=0;return e<-n?r|=1:e>n&&(r|=2),i<-n?r|=4:i>n&&(r|=8),r}return AR(r,(function(t){var e,i,l,h,d;return{lineStart:function(){h=l=!1,d=1},point:function(c,u){var p,g=[c,u],m=r(c,u),_=s?m?0:o(c,u):m?o(c+(c<0?Dc:-Dc),u):0;if(!e&&(h=l=m)&&t.lineStart(),m!==l&&(!(p=a(e,g))||oR(e,p)||oR(g,p))&&(g[2]=1),m!==l)d=0,m?(t.lineStart(),p=a(g,e),t.point(p[0],p[1])):(p=a(e,g),t.point(p[0],p[1],2),t.lineEnd()),e=p;else if(n&&e&&s^m){var f;_&i||!(f=a(g,e,!0))||(d=0,s?(t.lineStart(),t.point(f[0][0],f[0][1]),t.point(f[1][0],f[1][1]),t.lineEnd()):(t.point(f[1][0],f[1][1]),t.lineEnd(),t.lineStart(),t.point(f[0][0],f[0][1],3)))}!m||e&&oR(e,g)||t.point(g[0],g[1]),e=g,l=m,i=_},lineEnd:function(){l&&t.lineEnd(),e=null},clean:function(){return d|(h&&l)<<1}}}),(function(e,s,n,r){!function(t,e,i,s,n,r){if(i){var a=Hc(e),o=Wc(e),l=s*i;null==n?(n=e+s*Rc,r=e-l/2):(n=CR(a,n),r=CR(a,r),(s>0?nr)&&(n+=s*Rc));for(var h,d=n;s>0?d>r:d2?t[2]%360*Bc:0,C()):[_*Ic,f*Ic,v*Ic]},T.angle=function(t){return arguments.length?(y=t%360*Bc,C()):y*Ic},T.reflectX=function(t){return arguments.length?(b=t?-1:1,C()):b<0},T.reflectY=function(t){return arguments.length?(x=t?-1:1,C()):x<0},T.precision=function(t){return arguments.length?(a=XR(o,w=t*t),E()):Uc(w)},T.fitExtent=function(t,e){return NR(T,t,e)},T.fitSize=function(t,e){return VR(T,t,e)},T.fitWidth=function(t,e){return WR(T,t,e)},T.fitHeight=function(t,e){return GR(T,t,e)},function(){return e=t.apply(this,arguments),T.invert=e.invert&&L,C()}}function tI(t){var e=0,i=Dc/3,s=QR(t),n=s(e,i);return n.parallels=function(t){return arguments.length?s(e=t[0]*Bc,i=t[1]*Bc):[e*Ic,i*Ic]},n}function eI(t,e){var i=Wc(t),s=(i+Wc(e))/2;if(Fc(s)2?t[2]*Bc:0),e.invert=function(e){return(e=t.invert(e[0]*Bc,e[1]*Bc))[0]*=Ic,e[1]*=Ic,e},e}(n.rotate()).invert([0,0]));return l(null==h?[[o[0]-r,o[1]-r],[o[0]+r,o[1]+r]]:t===lI?[[Math.max(o[0]-r,h),e],[Math.min(o[0]+r,i),s]]:[[h,Math.max(o[1]-r,e)],[i,Math.min(o[1]+r,s)]])}return n.scale=function(t){return arguments.length?(a(t),d()):a()},n.translate=function(t){return arguments.length?(o(t),d()):o()},n.center=function(t){return arguments.length?(r(t),d()):r()},n.clipExtent=function(t){return arguments.length?(null==t?h=e=i=s=null:(h=+t[0][0],e=+t[0][1],i=+t[1][0],s=+t[1][1]),d()):null==h?null:[[h,e],[i,s]]},d()}function dI(t){return $c((Pc+t)/2)}function cI(t,e){var i=Hc(t),s=t===e?Wc(t):Nc(i/Hc(e))/Nc(dI(e)/dI(t)),n=i*Vc(dI(t),s)/s;if(!s)return lI;function r(t,e){n>0?e<-Pc+Ec&&(e=-Pc+Ec):e>Pc-Ec&&(e=Pc-Ec);var i=n/Vc(dI(e),s);return[i*Wc(s*t),n-i*Hc(s*t)]}return r.invert=function(t,e){var i=n-e,r=Gc(s)*Uc(t*t+i*i),a=jc(t,Fc(i))*Gc(i);return i*s<0&&(a-=Dc*Gc(t)*Gc(i)),[a/s,2*Yc(Vc(n/r,1/s))-Pc]},r}function uI(t,e){return[t,e]}function pI(t,e){var i=Hc(t),s=t===e?Wc(t):(i-Hc(e))/(e-t),n=i/s+t;if(Fc(s)Ec&&--n>0);return[t/(.8707+(r=s*s)*(r*(r*r*r*(.003971-.001529*r)-.013791)-.131979)),s]},SI.invert=rI(Kc),MI.invert=rI((function(t){return 2*Yc(t)})),kI.invert=function(t,e){return[-e,2*Yc(zc(t))-Pc]},Ju();const AI={},wI=["clipAngle","clipExtent","scale","translate","center","rotate","precision","reflectX","reflectY","parallels","coefficient","distance","fraction","lobes","parallel","radius","ratio","spacing","tilt"];function TI(t,e){t&&S(t)||Lm("Projection type must be a name string.");const i=t.toLowerCase();return arguments.length>1&&(AI[i]=function(t,e){return function i(){const s=e();return s.type=t,s.path=Ju().projection(s),s.copy=s.copy||function(){const t=i();return wI.forEach((e=>{s[e]&&t[e](s[e]())})),t.path.pointRadius(s.path.pointRadius()),t},s}}(i,e)),AI[i]||null}const LI={albers:sI,albersusa:function(){var t,e,i,s,n,r,a=sI(),o=iI().rotate([154,0]).center([-2,58.5]).parallels([55,65]),l=iI().rotate([157,0]).center([-3,19.9]).parallels([8,18]),h={point:function(t,e){r=[t,e]}};function d(t){var e=t[0],a=t[1];return r=null,i.point(e,a),r||(s.point(e,a),r)||(n.point(e,a),r)}function c(){return t=e=null,d}return d.invert=function(t){var e=a.scale(),i=a.translate(),s=(t[0]-i[0])/e,n=(t[1]-i[1])/e;return(n>=.12&&n<.234&&s>=-.425&&s<-.214?o:n>=.166&&n<.234&&s>=-.214&&s<-.115?l:a).invert(t)},d.stream=function(i){return t&&e===i?t:(s=[a.stream(e=i),o.stream(i),l.stream(i)],n=s.length,t={point:function(t,e){for(var i=-1;++i2?t[2]+90:90]):[(t=i())[0],t[1],t[2]-90]},i([0,0,90]).scale(159.155)}};Object.keys(LI).forEach((t=>{TI(t,LI[t])}));const CI="Feature",EI="FeatureCollection";const DI=wI.concat(["pointRadius","fit","extent","size"]);function PI(t,e){let i=[];return t?(Object.keys(t).forEach((s=>{DI.includes(s)&&(i=i.concat(Vp(t[s],e)))})),i):i}class OI extends Jp{constructor(t){super(t),this.grammarType="projection"}parse(t){return super.parse(t),this.pointRadius(t.pointRadius),this.size(t.size),this.extent(t.extent),this.fit(t.fit),this.configure(t),this.commit(),this}pointRadius(t){return D(this.spec.pointRadius)||this.detach(Vp(this.spec.pointRadius,this.view)),this.spec.pointRadius=t,this.attach(Vp(t,this.view)),this.commit(),this}size(t){return D(this.spec.size)||this.detach(Vp(this.spec.size,this.view)),this.spec.size=t,this.attach(Vp(t,this.view)),this.commit(),this}extent(t){return D(this.spec.extent)||this.detach(Vp(this.spec.extent,this.view)),this.spec.extent=t,this.attach(Vp(t,this.view)),this.commit(),this}fit(t){return D(this.spec.fit)||this.detach(Vp(this.spec.fit,this.view)),this.spec.fit=t,this.attach(Vp(t,this.view)),this.commit(),this}configure(t){return this.detach(PI(this.spec,this.view)),D(t)?this.spec={type:this.spec.type,fit:this.spec.fit,extent:this.spec.extent,size:this.spec.size,pointRadius:this.spec.pointRadius}:(Object.assign(this.spec,t),this.attach(PI(this.spec,this.view))),this.commit(),this}evaluate(t,e){if(this.projection&&this.projection.type===this.spec.type||(this.projection=function(t){const e=TI((t||"mercator").toLowerCase());return e||Lm("Unrecognized projection type: "+t),e()}(this.spec.type),this.projection.type=this.spec.type),wI.forEach((t=>{D(this.spec[t])||function(t,e,i){ys(t[e])&&t[e](i)}(this.projection,t,Gp(this.spec[t],e,TI))})),D(this.spec.pointRadius)||this.projection.path.pointRadius(Gp(this.spec.pointRadius,e,TI)),!(D(this.spec.fit)||D(this.spec.extent)&&D(this.spec.size))){const t=function(t){const e=Ba(t);return 1===e.length?e[0]:{type:EI,features:e.reduce(((t,e)=>t.concat(function(t){return t.type===EI?t.features:Ba(t).filter((t=>!D(t))).map((t=>t.type===CI?t:{type:CI,geometry:t}))}(e))),[])}}(Gp(this.spec.fit,e,TI));this.spec.extent?this.projection.fitExtent(Gp(this.spec.extent,e,TI),t):this.spec.size&&this.projection.fitSize(Gp(this.spec.size,e,TI),t)}return this.projection}output(){return this.projection}}const RI=(t,e)=>{if(!e.from||!e.from())return t;const i=e.fields,s=e.key,n=e.values,r=e.default,a=e.as||[i],o=e.from().reduce((function(t,e){return e[i]&&t.set(e[i],e),t}),new Map);let l;if(ys(e.set))l=function(t){const i=o.get(t[s]);e.set(t,i)};else if(n){const t=n.length;l=function(e){const i=o.get(e[s]);if(D(i))for(let i=0;i(l(t),t)))};class II extends jC{constructor(){super(...arguments),this.type=_l.geo,this.coordinate="geo",this._nameProperty="name"}getMapViewData(){var t;return null===(t=this._mapViewData)||void 0===t?void 0:t.getDataView()}get nameField(){return this._nameField}set nameField(t){this._nameField=t}get valueField(){return this._valueField}set valueField(t){this._valueField=t}getNameProperty(){return this._nameProperty}getCentroidProperty(){return this._centroidProperty}getCoordinateHelper(){return this._coordinateHelper}setCoordinateHelper(t){this._coordinateHelper=t}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){var i;let s=null;if(!t)return s;if(e&&!this.isDatumInViewData(t))return s;const{dataToPosition:n,latitudeField:r,longitudeField:a}=this._coordinateHelper;if(s=this.nameToPosition(t),null===s){const e=a?null==t?void 0:t[a]:Number.NaN,o=r?null==t?void 0:t[r]:Number.NaN;s=null!==(i=null==n?void 0:n([e,o]))&&void 0!==i?i:null}return s}nameToPosition(t){const e=this.getDatumName(t);return D(e)?null:this.nameValueToPosition(e)}nameValueToPosition(t){var e,i;const s=null===(i=null===(e=this.getMapViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.filter((e=>this.getDatumName(e)===t))[0];if(D(s))return null;const{dataToPosition:n}=this._coordinateHelper,r=this.getDatumCenter(s),a=null==n?void 0:n(r);return D(a)||isNaN(a.x)||isNaN(a.y)?null:a}dataToLatitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}dataToLongitude(t){if(!this._coordinateHelper)return Number.NaN;const{dataToLatitude:e}=this._coordinateHelper;return e(t)}valueToPosition(t,e){return{x:this.dataToLongitude(t),y:this.dataToLatitude(e)}}positionToData(t){}latitudeToData(t){}longitudeToData(t){}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionZ(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}release(){super.release(),this._mapViewData.release(),this._mapViewData=this._mapViewDataStatistics=null}getStackGroupFields(){return[this._nameField]}getStackValueField(){return this._spec.valueField}compileData(){var t;null===(t=this._mapViewData)||void 0===t||t.compile()}initStatisticalData(){if(super.initStatisticalData(),this._mapViewData){const t=`${sh}_series_${this.id}_mapViewDataStatic`;this._mapViewDataStatistics=this.createStatisticalData(t,this._mapViewData.getDataView()),this._mapViewData.getDataView().target.removeListener("change",this._mapViewDataStatistics.reRunAllTransform)}}getSeriesKeys(){var t,e,i,s,n;return this._seriesField?null!==(n=null!==(e=null===(t=this.getRawDataStatisticsByField(this._seriesField))||void 0===t?void 0:t.values)&&void 0!==e?e:null===(s=null===(i=this._mapViewDataStatistics)||void 0===i?void 0:i.latestData[this._seriesField])||void 0===s?void 0:s.values)&&void 0!==n?n:[]:this.name?[this.name]:this.userId?[`${this.userId}`]:[`${this.type}_${this.id}`]}fillData(){var t,e;super.fillData(),null===(t=this._mapViewData.getDataView())||void 0===t||t.reRunAllTransform(),null===(e=this._mapViewDataStatistics)||void 0===e||e.reRunAllTransform()}getActiveMarks(){return[]}}const BI=`${sh}_MAP_LOOK_UP_KEY`,FI=(t,e)=>(t.features&&t.features.forEach(((t,i)=>{var s;t[vT]=i;const n=null===(s=t.properties)||void 0===s?void 0:s[e.nameProperty];e.nameMap&&e.nameMap[n]?t[BI]=e.nameMap[n]:t[BI]=n})),t.features);class YI extends UT{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>{var e;const i=this.series;return null!==(e=this._getDimensionData(t))&&void 0!==e?e:i.getDatumName(t)}}}class jI extends vx{constructor(){super(...arguments),this.type=jI.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0,path:""})}}jI.type="path";const HI=()=>{$l.registerMark(jI.type,jI),zA()},zI=Object.assign(Object.assign({},rL),{area:{name:"area",type:"path"}});class NI{constructor(t){this.projection=TI(t.type)()}fit(t,e,i){const s={type:"FeatureCollection",features:i};this.projection.fitExtent([t,e],s)}center(t){var e,i;null===(i=null===(e=this.projection)||void 0===e?void 0:e.center)||void 0===i||i.call(e,t)}project(t){var e;return null===(e=this.projection)||void 0===e?void 0:e.call(this,t)}shape(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.path)||void 0===i?void 0:i.call(e,t)}invert(t){var e,i;return null===(i=null===(e=this.projection)||void 0===e?void 0:e.invert)||void 0===i?void 0:i.call(e,t)}scale(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.scale();this.projection.scale(t)}}translate(t){var e;if(null===(e=this.projection)||void 0===e?void 0:e.scale){if(void 0===t)return this.projection.translate();this.projection.translate(t)}}evaluate(t,e,i){const s=this.projection.copy();return null==s?void 0:s.fitExtent([t,e],{type:"FeatureCollection",features:i})}}class VI{parserScrollEvent(t){return t?!(t.ctrlKey||0===t.deltaY&&0===t.deltaX)&&(t.scrollX=t.deltaX,t.scrollY=t.deltaY,t):t}parserZoomEvent(t){if(!t)return t;const e=Math.pow(1.0005,-t.deltaY*Math.pow(16,t.deltaMode));return t.zoomDelta=e,t.zoomX=t.canvasX,t.zoomY=t.canvasY,t}clearZoom(){}clearScroll(){}clearDrag(){}parserDragEvent(){return!0}}class WI{constructor(){this._lastScale=0}clearZoom(){this._lastScale=0,this.pointerId=null}parserDragEvent(t){return!0}parserZoomEvent(t){const e=t.scale;if(0===this._lastScale)return this._lastScale=e,t;t.zoomDelta=e/this._lastScale;const i=t.center;return t.zoomX=i.x,t.zoomY=i.y,this._lastScale=e,t}parserScrollEvent(t){return t}clearScroll(){}clearDrag(){}}function GI(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"wheel",zoomEnd:"pointerup",scroll:"wheel",trigger:VI}:cl(t)||ul(t)?{start:"pointerdown",move:"pointermove",end:"pointerup",zoom:"pinch",zoomEnd:"pinchend",scroll:"pan",scrollEnd:"panend",trigger:WI}:null}const UI={debounce:Xd,throttle:Kd};class $I{constructor(){this._isGestureListener=!1}initZoomable(t,e=n["desktop-browser"]){this._eventObj=t,this._renderMode=e,this._gestureController=this._option.getChart().getVGrammarView().renderer._gestureController,this._isGestureListener=cl(this._renderMode)||ul(this._renderMode),GI(this._renderMode)&&(this._clickEnable=!0,this._zoomableTrigger=new(this._getZoomTriggerEvent("trigger")))}_getZoomTriggerEvent(t){return GI(this._renderMode)[t]}_zoomEventDispatch(t,e,i){if(!this._isGestureListener&&!t.event)return;const s=this._isGestureListener?t:t.event.clone();this._zoomableTrigger.parserZoomEvent(s);const{zoomDelta:n,zoomX:r,zoomY:a}=s;if(D(n))return;if(!Nt({x:r,y:a},this._getRegionOrSeriesLayout(e),!1))return;let o={};i&&(o=i({zoomDelta:n,zoomX:r,zoomY:a},s)),this._eventObj.emit("zoom",Object.assign(Object.assign({scale:s.zoomDelta,scaleCenter:{x:s.zoomX,y:s.zoomY}},o),{model:this}))}_getRegionOrSeriesLayout(t){"region"!==t.type&&(t=t.getRegion());const{x:e,y:i,width:s,height:n}=t.layout.getLayout();return{x1:e,y1:i,x2:e+s,y2:i+n}}_bindZoomEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("zoom")]:[this._getZoomTriggerEvent("zoom"),{level:Nd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("zoomEnd")]:[this._getZoomTriggerEvent("zoomEnd"),{level:Nd.chart,consume:!1}];l.on(...d,UI[a]((t=>{this._zoomableTrigger.clearZoom()}),o)),l.on(...h,UI[a]((t=>{this._zoomEventDispatch(t,e,i)}),o))}initZoomEventOfSeries(t,e,i){this._option.disableTriggerEvent||GI(this._renderMode)&&this._bindZoomEventAsRegion(t.event,t,e,i)}initZoomEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||GI(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindZoomEventAsRegion(t.event,t,i,s)})):this._bindZoomEventAsRegion(this._eventObj,t,i,s)}))}_scrollEventDispatch(t,e,i){let s=!1;if(!this._isGestureListener&&(!t.event||this._option.disableTriggerEvent))return s;const n=this._isGestureListener?t:t.event;this._zoomableTrigger.parserScrollEvent(n);const{scrollX:r,scrollY:a,canvasX:o,canvasY:l}=n;return D(r)&&D(a)?s:Nt({x:o,y:l},this._getRegionOrSeriesLayout(e),!1)?(i&&(s=i({scrollX:r,scrollY:a},n)),this._eventObj.emit("scroll",{scrollX:r,scrollY:a,model:this}),s):s}_bindScrollEventAsRegion(t,e,i,s){var n,r;const a=null!==(n=null==s?void 0:s.delayType)&&void 0!==n?n:"throttle",o=null!==(r=null==s?void 0:s.delayTime)&&void 0!==r?r:0,l=this._isGestureListener?this._gestureController:t,h=this._isGestureListener?[this._getZoomTriggerEvent("scroll")]:[this._getZoomTriggerEvent("scroll"),{level:Nd.chart,consume:!0}],d=this._isGestureListener?[this._getZoomTriggerEvent("scrollEnd")]:[this._getZoomTriggerEvent("scrollEnd"),{level:Nd.chart,consume:!1}];l.on(...d,UI[a]((t=>{this._zoomableTrigger.clearScroll()}),o)),l.on(...h,UI[a]((t=>this._scrollEventDispatch(t,e,i)),o))}initScrollEventOfSeries(t,e,i){GI(this._renderMode)&&this._bindScrollEventAsRegion(t.event,t,e,i)}initScrollEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||GI(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&this._bindScrollEventAsRegion(t.event,t,i,s)})):this._bindScrollEventAsRegion(this._eventObj,t,i,s)}))}_bindDragEventAsRegion(t,e,i,s){t.on(this._getZoomTriggerEvent("start"),{level:Nd.chart},(t=>{if(!t.event)return;const{event:n}=t;Nt({x:n.canvasX,y:n.canvasY},this._getRegionOrSeriesLayout(e),!1)&&this._handleDrag(t,i,s)})),t.on("click",{level:Nd.chart},(()=>!this._clickEnable))}initDragEventOfSeries(t,e,i){this._option.disableTriggerEvent||GI(this._renderMode)&&t.event.on(this._getZoomTriggerEvent("start"),{level:Nd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,e,i)}))}initDragEventOfRegions(t,e,i,s){this._option.disableTriggerEvent||GI(this._renderMode)&&t.forEach((t=>{e?t.getSeries().forEach((t=>{e(t)&&(t.event.on(this._getZoomTriggerEvent("start"),{level:Nd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(t=>{this._handleDrag(t,i)})),t.event.on("click",{level:Nd.model,filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>!this._clickEnable)))})):this._bindDragEventAsRegion(this._eventObj,t,i,s)}))}_handleDrag(t,e,i){var s,n,r;if(this._option.disableTriggerEvent)return;if(this._clickEnable=!1,!this._zoomableTrigger.parserDragEvent(t.event))return;const a=null!==(s=null==i?void 0:i.delayType)&&void 0!==s?s:"throttle",o=null!==(n=null==i?void 0:i.delayTime)&&void 0!==n?n:0,l=null===(r=null==i?void 0:i.realTime)||void 0===r||r,h=this._getZoomTriggerEvent("move"),d=this._getZoomTriggerEvent("end"),c=t.event;let u=c.canvasX,p=c.canvasY,g=c.canvasX,m=c.canvasY;const _=UI[a]((t=>{this._clickEnable=!0;const i=t.event,s=[i.canvasX-g,i.canvasY-m];g=i.canvasX,m=i.canvasY,!l&&e&&e(s,t.event),this._eventObj.emit("panend",{delta:s,model:this}),this._zoomableTrigger.pointerId=null,this._eventObj.off(h,{level:Nd.chart,source:zd.chart},f),this._eventObj.off(d,{level:Nd.chart,source:zd.window},_),this._eventObj.allow(d)}),o),f=UI[a]((t=>{if(!this._zoomableTrigger.parserDragEvent(t.event))return;this._clickEnable=!1,this._eventObj.prevent(d,_);const i=t.event,s=[i.canvasX-u,i.canvasY-p];u=i.canvasX,p=i.canvasY,l&&e&&e(s,t.event),this._eventObj.emit("panmove",{delta:s,model:this})}),o);this._eventObj.on(h,{level:Nd.chart,source:zd.chart},f),this._eventObj.on(d,{level:Nd.chart,source:zd.chart},_)}}function XI(t,e){return`${sh}_${e}_${t}`}class KI extends tD{constructor(){super(...arguments),this.type=r.geoCoordinate,this.name=r.geoCoordinate,this.layoutType="none",this.layoutZIndex=Ey.Mark,this._projectionSpec={name:XI(this.type,this.id),type:"mercator"},this._actualScale=1,this._initialScale=1,this.effect={scaleUpdate:()=>{this.coordinateHelper()}},this._handleChartZoom=(t,e)=>{var i,s,n,r,a,o;let l=t.zoomDelta;const h=this._actualScale;return this._actualScale*=l,this._actualScale<(null===(i=this._spec.zoomLimit)||void 0===i?void 0:i.min)?(this._actualScale=null===(s=this._spec.zoomLimit)||void 0===s?void 0:s.min,l=(null===(n=this._spec.zoomLimit)||void 0===n?void 0:n.min)/h):this._actualScale>(null===(r=this._spec.zoomLimit)||void 0===r?void 0:r.max)&&(this._actualScale=null===(a=this._spec.zoomLimit)||void 0===a?void 0:a.max,l=(null===(o=this._spec.zoomLimit)||void 0===o?void 0:o.max)/h),this.zoom(l,[t.zoomX,t.zoomY]),{scale:l,totalScale:this._actualScale}},this.pan=(t=[0,0])=>{var e,i,s;const n=null!==(i=null===(e=this._projection)||void 0===e?void 0:e.translate())&&void 0!==i?i:[0,0];let r=n[0],a=n[1];r+=t[0],a+=t[1],null===(s=this._projection)||void 0===s||s.translate([r,a])}}get longitudeField(){return this._longitudeField}get latitudeField(){return this._latitudeField}get projectionSpec(){return this._projectionSpec}setProjection(t){this._projectionSpec=Object.assign(Object.assign({},t),{name:this._projectionSpec.name})}getZoom(){return this._actualScale}static getSpecInfo(t){if(D(t))return null;const e=[];return t.region.forEach(((t,i)=>{if("geo"===t.coordinate){const s=Object.assign(Object.assign({},t),{padding:0});e.push({spec:s,regionIndex:i,type:r.geoCoordinate,specInfoPath:["component","geoCoordinate",i]})}})),e}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this._spec.roam&&this.initZoomable(this.event,this._option.mode),this._projectionSpec=Tl(this._projectionSpec,this._spec.projection),this._projectionSpec.zoom>(null===(t=this._spec.zoomLimit)||void 0===t?void 0:t.max)&&(this._projectionSpec.zoom=this._spec.zoomLimit.max),this._projectionSpec.zoom<(null===(e=this._spec.zoomLimit)||void 0===e?void 0:e.min)&&(this._projectionSpec.zoom=this._spec.zoomLimit.min),this._actualScale=null!==(i=this._projectionSpec.zoom)&&void 0!==i?i:1,this._initialScale=this._actualScale,this._longitudeField=this._spec.longitudeField,this._latitudeField=this._spec.latitudeField}created(){super.created(),this._regions=this._option.getRegionsInIndex([this._option.regionIndex]),this.initProjection(),this.coordinateHelper(),this.initEvent(),this._initCenterCache()}dispatchZoom(t,e){const i=e||{x:this.getLayoutStartPoint().x+this.getLayoutRect().width/2,y:this.getLayoutStartPoint().y+this.getLayoutRect().height/2},{scale:s,totalScale:n}=this._handleChartZoom({zoomDelta:t,zoomX:i.x,zoomY:i.y});1!==s&&this.event.emit("zoom",{scale:s,scaleCenter:i,totalScale:n,model:this})}initEvent(){this.event.on(Hd.scaleUpdate,{filter:({model:t})=>(null==t?void 0:t.id)===this.id},this.effect.scaleUpdate.bind(this)),this._spec.roam&&(this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom),this.initDragEventOfRegions(this._regions,(()=>!0),this.pan),this._regions.forEach((t=>{t.getSeries().forEach((t=>{t.event.on("zoom",(e=>(t.handleZoom(e),!0))),t.event.on("panmove",(e=>(t.handlePan(e),!0)))}))})))}initProjection(){var t;this._projection=new NI(this._projectionSpec),null!==this._projection.projection||null===(t=this._option)||void 0===t||t.onError("unsupported projection type!")}coordinateHelper(){const t={longitudeField:this._longitudeField,latitudeField:this._latitudeField,dataToPosition:this.dataToPosition.bind(this),dataToLongitude:this.dataToLongitude.bind(this),dataToLatitude:this.dataToLatitude.bind(this),shape:this.shape.bind(this),getCoordinateId:()=>this.id};this._regions.forEach((e=>{e.getSeries().forEach((e=>{e.type===_l.map?e.setCoordinateHelper(t):(e.setXAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(D(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.x}return this.dataToLongitude(n)},valueToPosition:(t,i)=>{var s;if(D(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.x}return this.dataToLongitude(t)},getFields:()=>[this._longitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})),e.setYAxisHelper(Object.assign(Object.assign({},t),{isContinuous:!0,dataToPosition:(t,i)=>{var s;let n=t[0];if(D(n)&&(null==i?void 0:i.datum)){const t=i.datum[e.getDimensionField()[0]];n=null===(s=this._centerCache.get(t))||void 0===s?void 0:s.y}return this.dataToLatitude(n)},valueToPosition:(t,i)=>{var s;if(D(t)&&(null==i?void 0:i.datum)){const n=i.datum[e.getDimensionField()[0]];t=null===(s=this._centerCache.get(n))||void 0===s?void 0:s.y}return this.dataToLatitude(t)},getFields:()=>[this._latitudeField],getAxisType:()=>this.type,getAxisId:()=>this.id,isInverse:()=>!1})))}))}))}onLayoutEnd(t){this.setLayoutRect(this._regions[0].getLayoutRect()),this.setLayoutStartPosition(this._regions[0].getLayoutStartPoint());const{width:e,height:i}=this.getLayoutRect(),{translate:s,scale:n,center:r}=this.evaluateProjection([0,0],[e,i]);s&&this._projection.translate(s),n&&this._projection.scale(n),r&&this._projection.center(r),mE(this._regions,(t=>{var e;if(t.type===_l.map){t.areaPath.clear();const i=null===(e=t.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();i&&i.attribute.postMatrix&&i.setAttributes({postMatrix:new Pt})}})),this._actualScale=this._initialScale,super.onLayoutEnd(t)}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}collectFeatures(){const t=[];return this._regions.forEach((e=>{e.getSeries().forEach((e=>{var i,s;e.type===_l.map&&t.push(...null!==(s=null===(i=e.getMapViewData())||void 0===i?void 0:i.latestData)&&void 0!==s?s:[])}))})),t}dataToPosition(t=[]){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t[0],t[1]]);return{x:null==i?void 0:i[0],y:null==i?void 0:i[1]}}dataToLatitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([0,t]);return null==i?void 0:i[1]}dataToLongitude(t){var e;const i=null===(e=this._projection)||void 0===e?void 0:e.project([t,0]);return null==i?void 0:i[0]}zoom(t,e=[0,0]){var i,s,n,r,a,o;let l=null!==(s=null===(i=this._projection)||void 0===i?void 0:i.scale())&&void 0!==s?s:0;const h=null!==(r=null===(n=this._projection)||void 0===n?void 0:n.translate())&&void 0!==r?r:[0,0];let d=h[0],c=h[1];l*=t,d-=(e[0]-d)*(t-1),c-=(e[1]-c)*(t-1),null===(a=this._projection)||void 0===a||a.scale(l),null===(o=this._projection)||void 0===o||o.translate([d,c])}shape(t){return this._projection.shape(t)}invert(t){return this._projection.invert(t)}evaluateProjection(t,e){var i;const s=this._projection.evaluate(t,e,this.collectFeatures());let n=s.translate();const r=s.scale()*this._initialScale,a=null!==(i=this._projectionSpec.center)&&void 0!==i?i:s.invert([e[0]/2,e[1]/2]);return a&&(n=[e[0]/2,e[1]/2]),{translate:n,scale:r,center:a}}_initCenterCache(){this._centerCache||(this._centerCache=new Map),this._regions.forEach((t=>{t.getSeries().forEach((t=>{var e,i;"map"===t.type&&(null!==(i=null===(e=t.getMapViewData())||void 0===e?void 0:e.latestData)&&void 0!==i?i:[]).forEach(((e={})=>{const i=e[t.getDimensionField()[0]]||e[BI],s=t.getDatumCenter(e);i&&M(s)&&this._centerCache.set(i,{x:s[0],y:s[1]})}))}))}))}release(){super.release(),this._centerCache&&this._centerCache.clear(),this._centerCache=null}}KI.type=r.geoCoordinate,JA(KI,$I);const qI=()=>{$l.registerComponent(KI.type,KI)};class ZI extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"area",void 0,void 0,!1)}}class JI extends II{constructor(){super(...arguments),this.type=_l.map,this.transformerConstructor=ZI,this._areaCache=new Map}getNameMap(){return this._nameMap}get areaPath(){return this._areaCache}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.map=this._spec.map,this._nameMap=this._spec.nameMap,this._nameField=this._spec.nameField,this._valueField=this._spec.valueField,this._spec.nameProperty&&(this._nameProperty=this._spec.nameProperty),this._spec.centroidProperty&&(this._centroidProperty=this._spec.centroidProperty),this.map||null===(t=this._option)||void 0===t||t.onError(`map type '${this.map}' is not specified !`),Ep.get(this.map)||null===(e=this._option)||void 0===e||e.onError(`'${this.map}' data is not registered !`)}initData(){var t,e;super.initData(),Lp(this._dataSet,"copyDataView",Bp),Lp(this._dataSet,"map",FI),Lp(this._dataSet,"lookup",RI);const i=Ep.get(this.map);i||null===(t=this._option)||void 0===t||t.onError("no valid map data found!");const s=new R(this._dataSet,{name:`map_${this.id}_data`});s.parse([i],{type:"dataview"}).transform({type:"copyDataView",options:{deep:!0},level:Hp.copyDataView}).transform({type:"map",options:{nameMap:this._nameMap,nameProperty:this._nameProperty}}).transform({type:"lookup",options:{from:()=>{var t;return null===(t=this._data)||void 0===t?void 0:t.getLatestData()},key:BI,fields:this._nameField,set:(t,e)=>{e&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}}}),null===(e=this._data)||void 0===e||e.getDataView().target.addListener("change",s.reRunAllTransform),this._mapViewData=new ZT(this._option,s)}initMark(){this._pathMark=this._createMark(JI.mark.area,{morph:RC(this._spec,JI.mark.area.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this.getDimensionField()[0],isSeriesMark:!0,skipBeforeLayouted:!0,dataView:this._mapViewData.getDataView(),dataProductId:this._mapViewData.getProductId()})}initMarkStyle(){const t=this._pathMark;t&&(this.setMarkStyle(t,{fill:t=>{var e,i,s,n;return M(t[null!==(e=this._seriesField)&&void 0!==e?e:bT])?(null!==(i=this._option.globalScale.getScale("color"))&&void 0!==i?i:this._getDefaultColorScale()).scale(t[null!==(s=this._seriesField)&&void 0!==s?s:bT]):null===(n=this._spec)||void 0===n?void 0:n.defaultFillColor},path:this.getPath.bind(this)},"normal",Py.Series),t.setPostProcess("fill",(t=>M(t)?t:this._spec.defaultFillColor)),this.setMarkStyle(t,{smoothScale:!0},"normal",Py.Built_In))}initLabelMarkStyle(t){t&&(this._labelMark=t,this.setMarkStyle(t,{text:t=>this.getDatumName(t),x:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x},y:t=>{var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}}))}initAnimation(){var t;this._pathMark.setAnimationConfig(EC(null===(t=$l.getAnimationInKey("fadeInOut"))||void 0===t?void 0:t(),DC("area",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new YI(this),this._pathMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pathMark)}getPath(t){var e;const i=this._areaCache.get(t[vT]);if(i)return i.shape;const s=null===(e=this._coordinateHelper)||void 0===e?void 0:e.shape(t);return this._areaCache.set(t[vT],{shape:s}),s}onEvaluateEnd(){this._mapViewData.updateData()}getDimensionField(){return[this.nameField]}getMeasureField(){return[this.valueField]}release(){super.release(),this._areaCache.clear(),this._nameMap={},this._mapViewData=null}handleZoom(t){var e,i,s;const{scale:n,scaleCenter:r}=t;if(1===n)return;const a=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();a&&(a.attribute.postMatrix||a.setAttributes({postMatrix:new Pt}),a.scale(n,n,r));const o=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();o&&o.evaluate(null,null)}handlePan(t){var e,i,s;const{delta:n}=t;if(0===n[0]&&0===n[1])return;const r=null===(e=this.getRootMark().getProduct())||void 0===e?void 0:e.getGroupGraphicItem();r&&(r.attribute.postMatrix||r.setAttributes({postMatrix:new Pt}),r.translate(n[0],n[1]));const a=null===(s=null===(i=this._labelMark)||void 0===i?void 0:i.getComponent())||void 0===s?void 0:s.getProduct();a&&a.evaluate(null,null)}getDatumCenter(t){var e,i,s,n;return this._centroidProperty&&(null===(e=t.properties)||void 0===e?void 0:e[this._centroidProperty])?null===(i=t.properties)||void 0===i?void 0:i[this._centroidProperty]:qo(t.centroidX*t.centroidY)?[t.centroidX,t.centroidY]:(null===(s=t.properties)||void 0===s?void 0:s.center)?t.properties.center:(null===(n=t.properties)||void 0===n?void 0:n.centroid)?t.properties.centroid:[Number.NaN,Number.NaN]}getDatumName(t){var e;if(t[this.nameField])return t[this.nameField];const i=null===(e=t.properties)||void 0===e?void 0:e[this._nameProperty];if(i){if(this._spec.nameMap&&this._spec.nameMap[i])return this._spec.nameMap[i];if(this._spec.showDefaultName||!this._spec.nameMap)return i}return""}dataToPositionX(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}dataToPositionY(t){var e;return null===(e=this._option)||void 0===e||e.onError("Method not implemented."),0}viewDataUpdate(t){var e,i,s;super.viewDataUpdate(t),null===(i=null===(e=this._mapViewData)||void 0===e?void 0:e.getDataView())||void 0===i||i.reRunAllTransform(),null===(s=this._mapViewData)||void 0===s||s.updateData()}_getDataIdKey(){return vT}getActiveMarks(){return[this._pathMark]}}JI.type=_l.map,JI.mark=zI,JI.transformerConstructor=ZI;class QI extends rO{_isValidSeries(t){return t===_l.map}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:t.type,nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,map:t.map,nameProperty:t.nameProperty,centroidProperty:t.centroidProperty,nameMap:t.nameMap,area:t.area,defaultFillColor:t.defaultFillColor,showDefaultName:t.showDefaultName})}transformSpec(t){super.transformSpec(t),t.region.forEach((t=>{t.coordinate="geo"}));const e=this._getDefaultSeriesSpec(t);t.series&&0!==t.series.length?t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class tB extends cO{constructor(){super(...arguments),this.transformerConstructor=QI,this.type="map",this.seriesType=_l.map}}function eB(t){return function(e){let i;return i=y(t)?t.reduce(((t,e)=>null==t?void 0:t[e]),e):null==e?void 0:e[t],i}}tB.type="map",tB.seriesType=_l.map,tB.transformerConstructor=QI;class iB extends jC{constructor(){super(...arguments),this.coordinate="polar",this._outerRadius=_h,this._innerRadius=0,this._angleField=[],this._radiusField=[],this._sortDataByAxis=!1}get outerRadius(){return this._outerRadius}get innerRadius(){return this._innerRadius}getAngleField(){return this._angleField}setAngleField(t){return this._angleField=M(t)?Ba(t):[],this._angleField}getRadiusField(){return this._radiusField}setRadiusField(t){return this._radiusField=M(t)?Ba(t):[],this._radiusField}get innerRadiusField(){return this._innerRadiusField}setInnerRadiusField(t){return this._innerRadiusField=Ba(t),this._innerRadiusField}get radiusScale(){return this._radiusScale}setRadiusScale(t){return this._radiusScale=t,t}get angleScale(){return this._angleScale}setAngleScale(t){return this._angleScale=t,t}get angleAxisHelper(){return this._angleAxisHelper}set angleAxisHelper(t){this._angleAxisHelper=t,this.onAngleAxisHelperUpdate()}get radiusAxisHelper(){return this._radiusAxisHelper}set radiusAxisHelper(t){this._radiusAxisHelper=t,this.onRadiusAxisHelperUpdate()}get sortDataByAxis(){return this._sortDataByAxis}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getCenter=()=>this.angleAxisHelper.center(),this._markAttributeContext.getLayoutRadius=()=>this._computeLayoutRadius()}valueToPosition(t,e){if(D(t)||D(e)||!this.angleAxisHelper||!this.radiusAxisHelper)return{x:Number.NaN,y:Number.NaN};const i=this.radiusAxisHelper.dataToPosition(Ba(e));if(i<0){if("break"===this._invalidType||"link"===this._invalidType)return{x:Number.NaN,y:Number.NaN};if("zero"===this._invalidType)return this.angleAxisHelper.center()}const s=this.angleAxisHelper.dataToPosition(Ba(t));return this.angleAxisHelper.coordToPoint({angle:s,radius:i})}dataToPosition(t,e){return t&&this.angleAxisHelper&&this.radiusAxisHelper?e&&!this.isDatumInViewData(t)?null:this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getDatumPositionValues(t,this._radiusField)):null}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}positionToData(t){}radiusToData(t){}angleToData(t){}getStatisticFields(){var t,e;const i=[];return(null===(t=this.radiusAxisHelper)||void 0===t?void 0:t.getScale)&&this._radiusField.forEach((t=>{const e={key:t,operations:[]};Jh(this.radiusAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),(null===(e=this.angleAxisHelper)||void 0===e?void 0:e.getScale)&&this._angleField.forEach((t=>{const e={key:t,operations:[]};Jh(this.angleAxisHelper.getScale(0).type)?e.operations=["max","min"]:e.operations=["values"],i.push(e)})),i}setAttrFromSpec(){super.setAttrFromSpec(),M(this._spec.outerRadius)&&(this._outerRadius=this._spec.outerRadius),M(this._spec.radius)&&(this._outerRadius=this._spec.radius),M(this._spec.innerRadius)&&(this._innerRadius=this._spec.innerRadius),M(this._spec.sortDataByAxis)&&(this._sortDataByAxis=!0===this._spec.sortDataByAxis)}onRadiusAxisHelperUpdate(){this.onMarkPositionUpdate()}onAngleAxisHelperUpdate(){this.onMarkPositionUpdate()}afterInitMark(){super.afterInitMark()}_computeLayoutRadius(){const t=this._angleAxisHelper||this._radiusAxisHelper;if(t)return t.layoutRadius();const{width:e,height:i}=this._region.getLayoutRect();return Math.min(e/2,i/2)}initEvent(){super.initEvent(),this.sortDataByAxis&&this.event.on(Hd.scaleDomainUpdate,{filter:t=>{var e;return t.model.id===(null===(e=this._angleAxisHelper)||void 0===e?void 0:e.getAxisId())}},(()=>{this._sortDataInAxisDomain()}))}_sortDataInAxisDomain(){var t,e;(null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.latestData)||void 0===e?void 0:e.length)&&HC(this.angleAxisHelper,this._angleField[0],this.getViewData().latestData)}getInvalidCheckFields(){const t=[];return this.angleAxisHelper.isContinuous&&this._angleField.forEach((e=>{t.push(e)})),this.radiusAxisHelper.isContinuous&&this._radiusField.forEach((e=>{t.push(e)})),t}}function sB(t){return Zo(t)?Number.parseFloat(t):0}const nB=(t,e)=>{const i=t.map((t=>Object.assign({},t)));if(!i||0===i.length)return i;const{asStartAngle:s,asEndAngle:n,asMiddleAngle:r,asRadian:a,asRatio:o,asQuadrant:l,asK:h,showAllZero:d,supportNegative:c}=e,u=e.angleField(),p=e.startAngle(),g=e.endAngle(),m=e.minAngle(),_=(t,e,i)=>{t[s]=e,t[n]=e+i,t[r]=e+i/2,t[a]=i,t[l]=Dt(e+i/2)};let f=0,v=-1/0,y=!0;for(let t=0;tNumber(t[u]))),x=g-p;let S=p,M=x,k=0;const A=function(t,e=2){const i=t.reduce(((t,e)=>t+(isNaN(e)?0:e)),0);if(0===i)return 0;const s=Math.pow(10,e),n=t.map((t=>(isNaN(t)?0:t)/i*s*100)),r=100*s,a=n.map((t=>Math.floor(t)));let o=a.reduce(((t,e)=>t+e),0);const l=n.map(((t,e)=>t-a[e]));for(;ot&&(t=l[i],e=i);++a[e],l[e]=0,++o}return a.map((t=>t/s))}(b);if(i.forEach(((t,e)=>{const i=t[ah],s=f?i/f:0;let n=s*x;n{_(e,p+i*t,t)}))}else{const t=M/k;S=p,i.forEach((e=>{const i=e[a]===m?m:e[ah]*t;_(e,S,i),S+=i}))}if(0!==f&&(i[i.length-1][n]=g),y&&d){const t=x/i.length;i.forEach(((e,i)=>{_(e,p+i*t,t)}))}return i};function rB(t,e,i){return(s,n,r)=>e?"radius"===t.growField?{overall:0}:{overall:t.growFrom(s,n,i)}:{overall:!1}}const aB=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",options:rB(t,!0,zp.appear)}),oB={type:"fadeIn"},lB=t=>({type:"radius"===t.growField?"growRadiusIn":"growAngleIn",easing:"linear",options:rB(t,!0,zp.enter)}),hB=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",easing:"linear",options:rB(t,!0,zp.exit)}),dB=t=>({type:"radius"===t.growField?"growRadiusOut":"growAngleOut",options:rB(t,!0,zp.exit)});function cB(t,e){if(!1===e)return{};switch(e){case"fadeIn":return oB;case"growRadius":return aB(Object.assign(Object.assign({},t),{growField:"radius"}));default:return aB(Object.assign(Object.assign({},t),{growField:"angle"}))}}class uB extends vx{constructor(t,e){super(t,e),this.type=pB.type,this._unCompileChannel={centerOffset:!0,radiusOffset:!0},this.computeOuterRadius=(t,e,i="normal",s,n)=>{var r;return n+(null!==(r=this.getAttribute("radiusOffset",e,i,s))&&void 0!==r?r:0)},this.computeCenter=(t,e,i="normal",s,n)=>Tt({x:0,y:0},this.getAttribute("centerOffset",e,i,s),e[ch])[t]+n,this._computeExChannel.x=this.computeCenter,this._computeExChannel.y=this.computeCenter,this._computeExChannel.outerRadius=this.computeOuterRadius,this._extensionChannel.centerOffset=["x","y"],this._extensionChannel.radiusOffset=["outerRadius"]}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{startAngle:0,endAngle:0,outerRadius:0,innerRadius:0,cornerRadius:0,lineWidth:0,innerPadding:0,outerPadding:0})}}class pB extends uB{constructor(){super(...arguments),this.type=pB.type}}pB.type="arc";const gB=()=>{Sx(),Wx(),_c.registerGraphic(Jd.arc,Ax),PA("arc",RA),wC(),$l.registerMark(pB.type,pB)},mB=Object.assign(Object.assign({},rL),{pie:{name:"pie",type:"arc"},labelLine:{name:"labelLine",type:"path"}}),_B=Object.assign(Object.assign({},rL),{pie3d:{name:"pie3d",type:"arc3d"},labelLine:{name:"labelLine",type:"path"}});class fB extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie")}_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const i=this._getDefaultSpecFromChart(e);s=Tl({},this._theme,i,t);const n=(t,e)=>Tl({},"inside"===t||"inside-center"===t?this._theme.innerLabel:this._theme.outerLabel,e);y(s.label)?s.label=s.label.map((t=>n(t.position,t))):s.label=n(s.label.position,s.label)}return{spec:s,theme:i}}_getDefaultSpecFromChart(t){var e;const i=null!==(e=super._getDefaultSpecFromChart(t))&&void 0!==e?e:{},{centerX:s,centerY:n}=t;return M(s)&&(i.centerX=s),M(n)&&(i.centerY=n),Object.keys(i).length>0?i:void 0}}const vB=`${sh}_LABEL_VISIBLE`,yB=(t,e,i,s)=>{const n=t();if(h(n))return n;if(ys(n))return n(e(),i());const r=e();if("auto"===n&&r.width>0&&r.height>0){const{startAngle:t=0,endAngle:e=2*Math.PI}=s();return function(t,e,i,s){const{x:n,y:r}=e,a=function(t,e){const i=Math.abs(e-t);if(i>=2*Math.PI||2*Math.PI-i<1e-6)return[0,Math.PI/2,Math.PI,1.5*Math.PI];const s=Et(Math.min(t,e)),n=s+i,r=[s,n];let a=Math.floor(s/Math.PI)*Math.PI/2;for(;as&&r.push(a),a+=Math.PI/2;return r}(i,s),{width:o,height:l}=t,h=[];return a.forEach((t=>{const e=Math.sin(t),i=Math.cos(t);1===e?h.push(l-r):-1===e?h.push(r):1===i?h.push(o-n):-1===i?h.push(n):(e>0?h.push(Math.abs((l-r)/i)):h.push(Math.abs(r/i)),i>0?h.push(Math.abs((o-n)/e)):h.push(Math.abs(n/e)))})),Math.min.apply(null,h)}(r,i(),t,e)}return Math.min(r.width/2,r.height/2)};class bB extends iB{constructor(){super(...arguments),this.transformerConstructor=fB,this._pieMarkName="pie",this._pieMarkType="arc",this.getCenter=()=>{var t,e,i,s;const{width:n,height:r}=this._region.getLayoutRect();return{x:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.centerX)&&void 0!==e?e:n/2,y:null!==(s=null===(i=this._spec)||void 0===i?void 0:i.centerY)&&void 0!==s?s:r/2}},this._startAngle=gh,this._endAngle=mh,this._pieMark=null,this._labelMark=null,this._labelLineMark=null,this._emptyArcMark=null,this.dataToCentralPosition=t=>{const e=t[ch];if(D(e))return null;const i=this.computeDatumRadius(t),s=this.computeDatumInnerRadius(t);return Tt(this.computeCenter(t),(i+s)/2,e)}}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.getCenter().x,y:()=>this.getCenter().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}setAttrFromSpec(){var t,e,i,s,n,r;super.setAttrFromSpec(),this._centerOffset=null!==(t=this._spec.centerOffset)&&void 0!==t?t:0,this._cornerRadius=null!==(e=this._spec.cornerRadius)&&void 0!==e?e:0;const a=function(t,e){let i=0,s=2*Math.PI;const n=M(t),r=M(e);for(n||r?r?n?(i=t,s=e):(i=e-2*Math.PI,s=e):(i=t,s=t+2*Math.PI):(i=0,s=2*Math.PI);s<=i;)s+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI,s-=2*Math.PI;for(;s<0;)i+=2*Math.PI,s+=2*Math.PI;return{startAngle:i,endAngle:s}}(M(this._spec.startAngle)?At(this._spec.startAngle):this._startAngle,M(this._spec.endAngle)?At(this._spec.endAngle):this._endAngle);this._startAngle=a.startAngle,this._endAngle=a.endAngle,this._padAngle=M(this._spec.padAngle)?At(this._spec.padAngle):0,this.setAngleField(this._spec.valueField||this._spec.angleField),this._spec.categoryField&&this.setSeriesField(this._spec.categoryField),this._radiusField=[],this._specAngleField=this._angleField.slice(),this._specRadiusField=[],this._showEmptyCircle=null!==(s=null===(i=this._spec.emptyPlaceholder)||void 0===i?void 0:i.showEmptyCircle)&&void 0!==s&&s,this._showAllZero=null!==(n=this._spec.showAllZero)&&void 0!==n&&n,this._supportNegative=null!==(r=this._spec.supportNegative)&&void 0!==r&&r}initData(){super.initData();const t=this.getViewData();if(!t)return;Lp(this._dataSet,"pie",nB),t.transform({type:"pie",options:{angleField:()=>this._angleField[0],startAngle:()=>this._startAngle,endAngle:()=>this._endAngle,minAngle:()=>M(this._spec.minAngle)?At(this._spec.minAngle):0,asStartAngle:lh,asEndAngle:hh,asRatio:oh,asMiddleAngle:ch,asRadian:ph,asQuadrant:uh,asK:dh,showAllZero:this._showAllZero,supportNegative:this._supportNegative}},!1);const e=new R(this._dataSet,{name:`${sh}_series_${this.id}_viewDataLabel`});e.parse([this.getViewData()],{type:"dataview"}),this._viewDataLabel=new ZT(this._option,e)}initMark(){var t,e;this._pieMark=this._createMark(Object.assign(Object.assign({},bB.mark.pie),{name:this._pieMarkName,type:this._pieMarkType}),{morph:RC(this._spec,this._pieMarkName),defaultMorphElementKey:this._seriesField,key:yT,groupKey:this._seriesField,skipBeforeLayouted:!0,isSeriesMark:!0,customShape:null===(t=this._spec.pie)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.pie)||void 0===e?void 0:e.stateSort}),this._showEmptyCircle&&(this._emptyArcMark=this._createMark({name:"emptyCircle",type:"arc"},{dataView:!1}))}startAngleScale(t){return eB(lh)(t)}endAngleScale(t){return eB(hh)(t)}_computeLayoutRadius(){return yB((()=>this._spec.layoutRadius),this.getLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}initMarkStyle(){const t={x:()=>this.getCenter().x,y:()=>this.getCenter().y,fill:this.getColorAttribute(),outerRadius:ox(this._outerRadius)?this._outerRadius:()=>this._computeLayoutRadius()*this._outerRadius,innerRadius:ox(this._innerRadius)?this._innerRadius:()=>this._computeLayoutRadius()*this._innerRadius,cornerRadius:()=>this._computeLayoutRadius()*this._cornerRadius,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),padAngle:this._padAngle,centerOffset:this._centerOffset},e=this._pieMark;e&&this.setMarkStyle(e,t,"normal",Py.Series);const i=this._emptyArcMark;i&&this.setMarkStyle(i,Object.assign(Object.assign({},t),{visible:()=>0===this.getViewData().latestData.length}),"normal",Py.Series)}initInteraction(){this._parseInteractionConfig(this._pieMark?[this._pieMark]:[])}initTooltip(){super.initTooltip(),this._pieMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pieMark)}initMarkStyleWithSpec(t,e,i){if(super.initMarkStyleWithSpec(t,e,i),t.name===this._pieMarkName){const e=this.getSpec()[t.name];if(e)for(const i in e.state||{})this.setMarkStyle(t,this.generateRadiusStyle(e.state[i]),i,Py.User_Mark)}"emptyCircle"===t.name&&this.setMarkStyle(t,this.generateRadiusStyle(e.style),"normal",Py.User_Mark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{visible:eB(vB).bind(this),text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:this.dataToPositionZ.bind(this)})}afterInitMark(){super.afterInitMark()}initEvent(){var t;super.initEvent(),null===(t=this._viewDataLabel.getDataView())||void 0===t||t.target.addListener("change",this.viewDataLabelUpdate.bind(this))}initGroups(){}onLayoutEnd(t){this._viewDataLabel.getDataView().reRunAllTransform(),this.onMarkPositionUpdate(),super.onLayoutEnd(t)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return this._specAngleField}viewDataLabelUpdate(){this.event.emit(Hd.viewDataLabelUpdate,{model:this}),this._viewDataLabel.updateData()}generateRadiusStyle(t){if(!t)return;const e={};return t.outerRadius&&(e.outerRadius=()=>this._computeLayoutRadius()*t.outerRadius),t.innerRadius&&(e.innerRadius=()=>this._computeLayoutRadius()*t.innerRadius),t.cornerRadius&&(e.cornerRadius=()=>this._computeLayoutRadius()*t.cornerRadius),e}computeCenter(t){return{x:this._pieMark.getAttribute("x",t,"normal"),y:this._pieMark.getAttribute("y",t,"normal")}}getRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.outerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.outerRadius;return null!=l?l:this._outerRadius}getInnerRadius(t="normal"){var e,i,s,n,r,a,o;const l="normal"===t?null===(s=null===(i=this.getSpec()[(null===(e=this._pieMark)||void 0===e?void 0:e.name)||"pie"])||void 0===i?void 0:i.style)||void 0===s?void 0:s.innerRadius:null===(o=null===(a=null===(r=this.getSpec()[(null===(n=this._pieMark)||void 0===n?void 0:n.name)||"pie"])||void 0===r?void 0:r.state)||void 0===a?void 0:a[t])||void 0===o?void 0:o.innerRadius;return null!=l?l:this._innerRadius}computeRadius(t,e){return this._computeLayoutRadius()*t*(D(e)?1:e)+this._centerOffset}computeDatumRadius(t,e){return this._computeLayoutRadius()*this.getRadius(e)+this._centerOffset}_compareSpec(t,e,i){i=null!=i?i:{data:!0};const s=["centerX","centerY","centerOffset","radius","innerRadius","cornerRadius","startAngle","endAngle","padAngle"];s.forEach((t=>{i[t]=!0}));const n=super._compareSpec(t,e,i);return t=null!=t?t:{},s.some((i=>t[i]!==e[i]))&&(n.reRender=!0,n.change=!0),n}computeDatumInnerRadius(t,e){return this._computeLayoutRadius()*this.getInnerRadius(e)+this._centerOffset}dataToPosition(t,e){const i=t[ch];if(D(i))return null;if(e&&!this.isDatumInViewData(t))return null;const s=this.computeDatumRadius(t);return Tt(this.computeCenter(t),s,i)}initAnimation(){var t,e,i;const s={growFrom:(t,e,i)=>{var s;if(i===zp.appear)return this._startAngle;if(i===zp.disappear)return this._endAngle;const n=[zp.disappear,zp.exit],r=e.mark.elements,a=null==t?void 0:t[vT];if(void 0===r.find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[vT]){var e;return(null===(e=t.data[0])||void 0===e?void 0:e[vT])>a})))return this._endAngle;const o=[...r].reverse().find((t=>{var e;return(null===(e=t.data[0])||void 0===e?void 0:e[vT])t.getAttribute("x",e),to:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[ch]).x},y:{from:e=>t.getAttribute("y",e),to:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[ch]).y}}}},{duration:o,effects:{easing:l,channel:{x:{to:e=>t.getAttribute("x",e),from:e=>t.getAttribute("x",e)+Tt({x:0,y:0},a,e[ch]).x},y:{to:e=>t.getAttribute("y",e),from:e=>t.getAttribute("y",e)+Tt({x:0,y:0},a,e[ch]).y}}}}]}}(this._pieMark,t.normal)),this._pieMark.setAnimationConfig(t)}if(this._emptyArcMark){const t=EC(null===(i=$l.getAnimationInKey("emptyCircle"))||void 0===i?void 0:i(s,null!=n?n:"fadeIn"));this._emptyArcMark.setAnimationConfig(t)}}getDefaultShapeType(){return"circle"}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){return e}getActiveMarks(){return[this._pieMark]}}bB.transformerConstructor=fB,bB.mark=mB;class xB extends bB{constructor(){super(...arguments),this.type=_l.pie}}xB.type=_l.pie;class SB extends rO{_isValidSeries(t){return!this.seriesType||t===this.seriesType}getIndicatorSpec(t){var e,i,s;const n=Ba(t.indicator),r=null!==(e=t.innerRadius)&&void 0!==e?e:null===(s=null===(i=t.series)||void 0===i?void 0:i[0])||void 0===s?void 0:s.innerRadius;return M(r)&&n.forEach((t=>{D(t.limitRatio)&&(t.limitRatio=r)})),n}_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:t.radius,outerRadius:t.outerRadius,innerRadius:t.innerRadius,startAngle:t.startAngle,endAngle:t.endAngle,sortDataByAxis:t.sortDataByAxis}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),y(t.dataZoom)&&t.dataZoom.length>0&&t.dataZoom.forEach((t=>{"axis"===t.filterMode&&(t.filterMode="filter")})),this.transformSeriesSpec(t),M(t.indicator)&&(t.indicator=this.getIndicatorSpec(t))}}class MB extends SB{needAxes(){return!1}_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.seriesField,valueField:t.valueField||t.angleField,center:t.center,centerOffset:t.centerOffset,cornerRadius:t.cornerRadius,padAngle:t.padAngle,minAngle:t.minAngle,emptyPlaceholder:t.emptyPlaceholder,emptyCircle:null===(e=t.emptyPlaceholder)||void 0===e?void 0:e.emptyCircle,showAllZero:t.showAllZero,supportNegative:t.supportNegative,layoutRadius:t.layoutRadius})}}class kB extends cO{constructor(){super(...arguments),this.transformerConstructor=MB}}kB.transformerConstructor=MB;class AB extends kB{constructor(){super(...arguments),this.transformerConstructor=MB,this.type="pie",this.seriesType=_l.pie}}AB.type="pie",AB.seriesType=_l.pie,AB.transformerConstructor=MB;class wB extends uB{constructor(){super(...arguments),this.type=wB.type,this._support3d=!0}}wB.type="arc3d";const TB=()=>{wC(),Sx(),nS(),_c.registerGraphic(Jd.arc3d,Ux),$l.registerMark(wB.type,wB)};class LB extends fB{_transformLabelSpec(t){this._addMarkLabelSpec(t,"pie3d")}}class CB extends bB{constructor(){super(...arguments),this.type=_l.pie3d,this._pieMarkName="pie3d",this._pieMarkType="arc3d",this.transformerConstructor=LB}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this._angle3d=null!==(e=null===(t=this._spec)||void 0===t?void 0:t.angle3d)&&void 0!==e?e:-Math.PI/3}initMarkStyle(){super.initMarkStyle();const t=this._pieMark;t&&this.setMarkStyle(t,{beta:()=>this._angle3d},"normal",Py.Series)}initLabelMarkStyle(t,e={}){if(!t)return;super.initLabelMarkStyle(t);const i={};t.setSupport3d(!0),i.beta=this._angle3d,i.anchor3d=t=>{const{x:e,y:i}=this.getCenter();return[e,i]},i.angle=t=>{const i=t[ch];return"inside"===e.position?wt(i):0},this.setMarkStyle(t,Object.assign(Object.assign({},i),{z:100}),void 0,Py.Mark)}}CB.type=_l.pie3d,CB.mark=_B,CB.transformerConstructor=LB;class EB extends MB{transformSpec(t){super.transformSpec(t),t.series.forEach((e=>{"pie3d"===e.type&&(e.angle3d=t.angle3d)}))}}class DB extends kB{constructor(){super(...arguments),this.transformerConstructor=EB,this.type="pie3d",this.seriesType=_l.pie3d}}DB.type="pie3d",DB.seriesType=_l.pie3d,DB.transformerConstructor=EB;const PB=t=>{const e="angle"===t.growField?0:t.innerRadius;return"angle"===t.growField?{type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}:{channel:{innerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.innerRadius}},outerRadius:{from:e,to:(t,e)=>{var i;return null===(i=e.getFinalGraphicAttributes())||void 0===i?void 0:i.outerRadius}}}}},OB={type:"fadeIn"},RB=t=>({type:"angle"===t.growField?"growAngleIn":"growRadiusIn"}),IB=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"}),BB=t=>({type:"angle"===t.growField?"growAngleOut":"growRadiusOut"});function FB(t,e){if(!1===e)return{};switch(e){case"fadeIn":return OB;case"growAngle":return PB(Object.assign(Object.assign({},t),{growField:"angle"}));default:return PB(Object.assign(Object.assign({},t),{growField:"radius"}))}}class YB extends iB{getStackGroupFields(){return this._angleField}getStackValueField(){return Ba(this._spec.valueField)[0]||Ba(this._spec.radiusField)[0]}getGroupFields(){return this._angleField}setAttrFromSpec(){super.setAttrFromSpec(),this.setAngleField(this._spec.categoryField||this._spec.angleField),this.setRadiusField(this._spec.valueField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice(),this.setInnerRadiusField(this._spec.valueField||this._spec.radiusField),this.getStack()&&this.setValueFieldToStack(),this.getPercent()&&this.setValueFieldToPercent()}setValueFieldToStack(){this.setRadiusField(kT),this.setInnerRadiusField(MT)}setValueFieldToPercent(){this.setRadiusField(wT),this.setInnerRadiusField(AT)}getDimensionField(){return this._specAngleField}getMeasureField(){return this._specRadiusField}getDefaultShapeType(){return"square"}}const jB=Object.assign(Object.assign({},rL),{rose:{name:"rose",type:"arc"}});class HB extends YC{constructor(){super(...arguments),this._supportStack=!0}_transformLabelSpec(t){this._addMarkLabelSpec(t,"rose")}}var zB=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if(!function(t){const e=null==t?void 0:t.orient;return"angle"===e||"radius"===e}(i))return;const{axisType:d,componentName:c,startAngle:u,endAngle:p,center:g,outerRadius:m,layoutRadius:_}=((t,e)=>{var i,s,n,a,o,l;const h=null!==(i=t.type)&&void 0!==i?i:"angle"===t.orient?"band":"linear",d=`${r.polarAxis}-${h}`,c=null!==(s=t.startAngle)&&void 0!==s?s:e.startAngle,u=null!==(n=t.endAngle)&&void 0!==n?n:e.endAngle;return{axisType:h,componentName:d,startAngle:null!=c?c:-90,endAngle:null!=u?u:M(c)?c+360:270,center:M(e.center)?e.center:M(null==e?void 0:e.centerX)||M(null==e?void 0:e.centerY)?{x:null==e?void 0:e.centerX,y:null==e?void 0:e.centerY}:void 0,outerRadius:null!==(l=null!==(o=null!==(a=t.outerRadius)&&void 0!==a?a:t.radius)&&void 0!==o?o:e.outerRadius)&&void 0!==l?l:e.radius,layoutRadius:e.layoutRadius}})(i,t);i.center=g,i.startAngle=u,i.endAngle=p,i.outerRadius=m,i.type=d,i.layoutRadius=_;const f={spec:i,specPath:e?[this.specKey,h]:[this.specKey],specInfoPath:["component",this.specKey,h],type:c};s.push(f),"radius"===i.orient?(o.push(f),a=h):(l.push(f),n=h)})),o.forEach((t=>{t.angleAxisIndex=n})),l.forEach((t=>{t.radiusAxisIndex=a})),s}static createComponent(t,e){const{spec:i}=t,s=zB(t,["spec"]),n=$l.getComponentInKey(s.type);return n?new n(i,Object.assign(Object.assign({},e),s)):(e.onError(`Component ${s.type} not found`),null)}constructor(t,e){super(t,e),this.type=r.polarAxis,this.name=r.polarAxis,this._defaultBandPosition=0,this._defaultBandInnerPadding=0,this._defaultBandOuterPadding=0,this.layoutType="absolute",this.layoutZIndex=Ey.Axis,this._tick=void 0,this._center=null,this._startAngle=gh,this._endAngle=mh,this._orient="radius",this._groupScales=[],this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),mE(this._regions,(t=>{"radius"===this.getOrient()?XE(t.radiusAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.radiusAxisHelper=this.axisHelper()):XE(t.angleAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._transformLayoutPosition=t=>{var e;const i=null===(e=this.getRegions())||void 0===e?void 0:e[0];return i?i.getLayoutStartPoint():t},this.getCenter=()=>{var t,e;const i=this.getRefLayoutRect(),{width:s,height:n}=i;return{x:el(null===(t=this._center)||void 0===t?void 0:t.x,s,i,s/2),y:el(null===(e=this._center)||void 0===e?void 0:e.y,n,i,n/2)}},this.getRefLayoutRect=()=>this.getRegions()[0].getLayoutRect(),this._coordinateType="polar"}setAttrFromSpec(){super.setAttrFromSpec(),this.visible&&(this._axisStyle=this._getAxisAttributes(),this._gridStyle=this._getGridAttributes()),this._tick=this._spec.tick,this._orient="angle"===this._spec.orient?"angle":"radius",this._center=this._spec.center,this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._inverse=this._spec.inverse}onRender(t){}changeRegions(){}_tickTransformOption(){var t;return Object.assign(Object.assign({},super._tickTransformOption()),{noDecimal:null===(t=this._tick)||void 0===t?void 0:t.noDecimals,startAngle:this.startAngle,labelOffset:zE(this._spec),getRadius:()=>this.getOuterRadius(),inside:this._spec.inside})}updateScaleRange(){const t=this._scale.range();let e;return e="radius"===this.getOrient()?this._inverse?[this.computeLayoutOuterRadius(),this.computeLayoutInnerRadius()]:[this.computeLayoutInnerRadius(),this.computeLayoutOuterRadius()]:this._inverse?[this._endAngle,this._startAngle]:[this._startAngle,this._endAngle],!(t&&e&&t[0]===e[0]&&t[1]===e[1]||(this._scale.range(e),0))}collectSeriesField(t,e){var i,s;let n;return n=t>0?null===(s=null===(i=e.getGroups())||void 0===i?void 0:i.fields)||void 0===s?void 0:s[t]:"radius"===this.getOrient()?e.getRadiusField():e.getAngleField(),n}updateSeriesScale(){mE(this._regions,(t=>{"radius"===this.getOrient()?XE(t.radiusAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.setRadiusScale(this._scale),t.radiusAxisHelper=this.axisHelper()):XE(t.angleAxisHelper,this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&(t.setAngleScale(this._scale),t.angleAxisHelper=this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}getSeriesStatisticsField(t){const e="radius"===this.getOrient()?t.getRadiusField():t.getAngleField();return Jh(this._scale.type)?e:[e[0]]}initGroupScales(){}axisHelper(){return{isContinuous:Jh(this._scale.type),dataToPosition:this.dataToPosition.bind(this),coordToPoint:this.coordToPoint.bind(this),pointToCoord:this.pointToCoord.bind(this),center:this.getCenter.bind(this),layoutRadius:this._computeLayoutRadius.bind(this),getScale:(t=0)=>this._scales[t],getAxisId:()=>this.id,getSpec:()=>this._spec}}positionToData(t){const e=this.pointToCoord(t);return"radius"===this.getOrient()?this.invert(e.radius):this.invert(e.angle)}coordToPoint(t){return Tt(this.getCenter(),t.radius,t.angle)}pointToCoord(t){return Lt(t,this.getCenter(),this._startAngle,this._endAngle)}getOuterRadius(){return this.computeLayoutOuterRadius()}getInnerRadius(){return this.computeLayoutInnerRadius()}updateLayoutAttribute(){this._visible&&("radius"===this.getOrient()?this._layoutRadiusAxis():this._layoutAngleAxis()),super.updateLayoutAttribute()}_getNormalizedValue(t,e){return 0===e?0:(this.dataToPosition(t)-this._getStartValue())/e}getLabelItems(t){var e;const i=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();return i&&i.length?[i.map((e=>$E(e.value,this._getNormalizedValue([e.value],t))))]:[]}_getStartValue(){return"radius"===this.getOrient()?this.computeLayoutInnerRadius():this._startAngle}_layoutAngleAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this._endAngle-this._startAngle,o=this.getLabelItems(a),l=Object.assign(Object.assign({},this.getLayoutStartPoint()),{inside:this._spec.inside,center:s,radius:n,innerRadius:r,startAngle:this._startAngle,endAngle:this._endAngle,sides:(null===(i=null===(e=null===(t=this._getRelatedAxis(this._option.radiusAxisIndex))||void 0===t?void 0:t.getSpec())||void 0===e?void 0:e.grid)||void 0===i?void 0:i.smooth)?void 0:this.getScale().domain().length}),h=Object.assign(Object.assign(Object.assign({},l),this.getRefLayoutRect()),{title:{text:this._spec.title.text||this._dataFieldText},items:o,orient:"angle"});this._spec.grid.visible&&(h.grid=Object.assign({type:"line",smoothLink:!0,items:o[0]},l)),this._update(h)}_layoutRadiusAxis(){var t,e,i;const s=this.getCenter(),n=this.computeLayoutOuterRadius(),r=this.computeLayoutInnerRadius(),a=this.coordToPoint({angle:this._startAngle,radius:n}),o=this.coordToPoint({angle:this._startAngle,radius:r}),l=be.distancePP(o,a),h=this.getLabelItems(l),d=Object.assign(Object.assign({},this.getLayoutStartPoint()),{start:o,end:a,verticalFactor:-1}),c=Object.assign(Object.assign({},d),{title:{text:this._spec.title.text||this._dataFieldText},items:h,orient:"radius"});(null===(t=this._spec.grid)||void 0===t?void 0:t.visible)&&(c.grid=Object.assign({items:h[0],type:(null===(e=this._spec.grid)||void 0===e?void 0:e.smooth)?"circle":"polygon",center:s,closed:!0,sides:null===(i=this._getRelatedAxis(this._option.angleAxisIndex))||void 0===i?void 0:i.getScale().domain().length,startAngle:this._startAngle,endAngle:this._endAngle},d)),this._update(c)}_getRelatedAxis(t){if(M(t))return this._option.getComponentByIndex(this.specKey,t)}_computeLayoutRadius(){return yB((()=>this._spec.layoutRadius),this.getRefLayoutRect,this.getCenter,(()=>({startAngle:this._startAngle,endAngle:this._endAngle})))}computeLayoutOuterRadius(){var t;const e=null!==(t=this._spec.outerRadius)&&void 0!==t?t:this._spec.radius,i=null!=e?e:this.getRefSeriesRadius().outerRadius;return this._computeLayoutRadius()*i}computeLayoutInnerRadius(){var t;const e=null!==(t=this._spec.innerRadius)&&void 0!==t?t:this.getRefSeriesRadius().innerRadius;return this._computeLayoutRadius()*e}getRefSeriesRadius(){let t=_h,e=0;const i=this.getChart().getSpec();return mE(this.getRegions(),(s=>{const n=s;if(r=n.type,[_l.rose,_l.radar,_l.circularProgress].includes(r)){const{outerRadius:s=i.outerRadius,innerRadius:r=i.innerRadius}=n;qo(s)&&(t=s),qo(r)&&(e=r)}var r}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),{outerRadius:t,innerRadius:e}}_update(t){const{grid:e}=t,i=zB(t,["grid"]);this._axisMark.getProduct().encode(Tl({},this._axisStyle,i)),this._gridMark&&this._gridMark.getProduct().encode(Tl({},this._gridStyle,e))}invert(t){var e;if("angle"===this.getOrient()&&"band"===this._scale.type){const i=this._scale.range(),s=i[i.length-1]-i[0],n=.5===(null!==(e=this.getSpec().bandPosition)&&void 0!==e?e:this._defaultBandPosition)?0:this._scale.bandwidth()/2;if(i[0]<0){const e=(t+n+Math.abs(i[0]))%s-Math.abs(i[0]);return this._scale.invert(e)}return this._scale.invert((t+n)%s)}return this._scale.invert(t)}}NB.type=r.polarAxis,NB.specKey="axes";const VB=(t,e)=>{const{tickCount:i,forceTickCount:s,tickStep:n,getRadius:r,labelOffset:a,labelGap:o=0,labelStyle:l}=e,h=null==r?void 0:r();if(!h)return kE(t.domain());let d;if(M(n))d=t.stepTicks(n);else if(M(s))d=t.forceTicks(s);else if(M(i)){const e=t.range(),s=Math.abs(e[e.length-1]-e[0]),n=ys(i)?i({axisLength:s,labelStyle:l}):i;d=t.ticks(n)}else if(e.sampling){const i=t.domain(),s=t.range(),n=((t,e,i)=>{var s;const{labelStyle:n,getRadius:r,labelOffset:a,labelFormatter:o,inside:l}=i,h=null==r?void 0:r(),d=null!==(s=n.angle)&&void 0!==s?s:0,c=Jk(n);return e.map((e=>{const i=o?o(e):`${e}`,{width:s,height:r}=c.quickMeasure(i),u=Math.max(s,12),p=Math.max(r,12),g=t.scale(e),m={x:0,y:0};let _=0,f=0;const v={align:n.textAlign,baseline:n.textBaseline},{x:y,y:b}=function(t,e,i,s,n){const r=Tt({x:0,y:0},i,t),a=CD(r,ED(s,r,e,n));return o=a,l=ED(s||1,a,e,n),{x:o.x+l[0],y:o.y+l[1]};var o,l}(g,m,h,a,l);return v.align||(hd(y,m.x)?v.baseline||(v.baseline=b>m.y?"top":"bottom"):y>m.x?v.align="left":yMath.min(t,e.width(),e.height())),Number.MAX_VALUE)/c));d=t.stepTicks(u),d=d.slice(0,d.length-p)}else d=t.domain();return kE(d)},WB=(t,e,i,s)=>{let n=s;do{let s=!0;n++;let r=0;do{r+n2){let i=t.length-t.length%n;for(i>=t.length&&(i-=n);i>0&&AE(e[0],e[i]);)r++,i-=n}return{step:n,delCount:r}};class GB extends NB{constructor(){super(...arguments),this.type=r.polarBandAxis,this._scale=new ex}computeDomain(t){return this.computeBandDomain(t)}updateScaleRange(){const t=super.updateScaleRange();return this.updateGroupScaleRange(),t}axisHelper(){const t=super.axisHelper();return Object.assign(Object.assign({},t),{getBandwidth:e=>t.getScale(e).bandwidth()})}initScales(){super.initScales(),this.calcScales(this._defaultBandInnerPadding,this._defaultBandOuterPadding)}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,VB),t}transformScaleDomain(){}}GB.type=r.polarBandAxis,GB.specKey="axes",JA(GB,pD);const UB=()=>{TP(),IP(),LP(),BP(),hD(),$l.registerComponent(GB.type,GB)};class $B extends NB{constructor(){super(...arguments),this.type=r.polarLinearAxis,this._zero=!0,this._nice=!0,this._extend={},this._scale=new qb}setAttrFromSpec(){super.setAttrFromSpec(),this.setExtraAttrFromSpec()}initScales(){super.initScales(),this.setScaleNice()}computeDomain(t){return this.computeLinearDomain(t)}axisHelper(){const t=super.axisHelper();return t.setExtendDomain=this.setExtendDomain.bind(this),t}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,QP),t}}$B.type=r.polarLinearAxis,$B.specKey="axes",JA($B,ZP);const XB=()=>{TP(),IP(),LP(),BP(),hD(),$l.registerComponent($B.type,$B)};class KB extends YB{constructor(){super(...arguments),this.type=_l.rose,this.transformerConstructor=HB,this._roseMark=null,this._labelMark=null}initMark(){this.initRoseMark()}initMarkStyle(){this.initRoseMarkStyle()}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.getCenter=()=>({x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y}),this._markAttributeContext.startAngleScale=t=>this.startAngleScale(t),this._markAttributeContext.endAngleScale=t=>this.endAngleScale(t)}initRoseMark(){var t,e;this._roseMark=this._createMark(KB.mark.rose,{morph:RC(this._spec,KB.mark.rose.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(t=this._spec.rose)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.rose)||void 0===e?void 0:e.stateSort})}getRoseAngle(){var t,e,i;return null!==(i=null===(e=(t=this.angleAxisHelper).getBandwidth)||void 0===e?void 0:e.call(t,this._groups?this._groups.fields.length-1:0))&&void 0!==i?i:.5}startAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}endAngleScale(t){return this.angleAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+this.getRoseAngle()-.5*this.angleAxisHelper.getBandwidth(this.getGroupFields().length-1)}initRoseMarkStyle(){const t=this._roseMark;t&&this.setMarkStyle(t,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:t=>this.startAngleScale(t),endAngle:t=>this.endAngleScale(t),fill:this.getColorAttribute(),outerRadius:t=>ax(this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]]),this.radiusAxisHelper.getScale(0)),innerRadius:t=>{var e;if(!this.getStack())return 0;const i=ax(this.radiusAxisHelper.dataToPosition([t[this._innerRadiusField[0]]]),this.radiusAxisHelper.getScale(0));return i<=Number.MIN_VALUE?this._computeLayoutRadius()*(null!==(e=this._spec.innerRadius)&&void 0!==e?e:0):i}})}initTooltip(){super.initTooltip(),this._roseMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._roseMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{text:t=>t[this.getDimensionField()[0]],fill:this.getColorAttribute(),z:0})}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;if(this._roseMark){const t={innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)}};this._roseMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("rose"))||void 0===i?void 0:i(t,s),DC("rose",this._spec,this._markAttributeContext)))}}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._roseMark]}}KB.type=_l.rose,KB.mark=jB,KB.transformerConstructor=HB;class qB extends SB{needAxes(){return!0}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField||t.angleField,valueField:t.valueField||t.radiusField})}transformSpec(t){var e;if(super.transformSpec(t),this.needAxes()){t.axes||(t.axes=[]);const i={radius:!1,angle:!1};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=!0),"angle"===e&&(i.angle=!0)})),i.angle||t.axes.push({orient:"angle"}),i.radius||t.axes.push({orient:"radius"})}}}class ZB extends qB{_getDefaultSeriesSpec(t){var e,i,s;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{radius:null!==(e=t.radius)&&void 0!==e?e:_h,outerRadius:null!==(i=t.outerRadius)&&void 0!==i?i:_h,innerRadius:null!==(s=t.innerRadius)&&void 0!==s?s:0,seriesField:t.seriesField,stack:t.stack,percent:t.percent})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{["domainLine","grid","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),"angle"===t.orient&&D(t.bandPosition)&&(t.bandPosition=.5)})),t.crosshair=Ba(t.crosshair||{}).map((t=>Tl({categoryField:{visible:!0,line:{visible:!0,type:"rect"}}},t)))}}class JB extends cO{constructor(){super(...arguments),this.transformerConstructor=ZB,this.type="rose",this.seriesType=_l.rose}}JB.type="rose",JB.seriesType=_l.rose,JB.transformerConstructor=ZB,JA(JB,gO);class QB extends Ts{constructor(t,e,i,s,n){super(t,e,i,s,n),this._center=e.center,this._prevCenter=t.center,this._center&&this._prevCenter||(this.valid=!1)}getEndProps(){return!1===this.valid?{}:Tt(this._center,this._toRadius,this._toAngle)}onBind(){const{angle:t,radius:e}=Lt(this.from,this._prevCenter),{angle:i,radius:s}=Lt(this.to,this._center);qo(i*s)||(this.valid=!1),this._fromAngle=qo(t)?t:i,this._fromRadius=qo(e)?e:s,this._toAngle=i,this._toRadius=s,gd(this._fromAngle,this._toAngle)&&gd(this._fromRadius,this._toRadius)&&(this.valid=!1)}onUpdate(t,e,i){if(!1===this.valid)return i.x=this.to.x,void(i.y=this.to.y);if(t){const{x:t,y:e}=this.getEndProps();i.x=t,i.y=e,i.center=this._center}else{const{x:t,y:s}=Tt({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*e,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*e},this._fromRadius+(this._toRadius-this._fromRadius)*e,this._fromAngle+(this._toAngle-this._fromAngle)*e);i.x=t,i.y=s}}}class tF extends _A{constructor(t,e,i,s,n){super(t,e,i,s,n),this._center=e.center,this._prevCenter=t.center}onUpdate(t,e,i){this.points=this.points.map(((s,n)=>{const r=this.polarPointInterpolation(this.interpolatePoints[n][0],this.interpolatePoints[n][1],e);return t&&(i.center=this._center),r.context=s.context,r})),i.points=this.points}_interpolationSinglePoint(t,e,i){if(!Sd(t)&&!Sd(e))return e;const s=Lt(t,this._prevCenter),n=Lt(e,this._center);let r=Et(s.angle),a=Et(n.angle);!qo(r)&&qo(a)&&(r=a),qo(r)&&!qo(a)&&(a=r);const o=r+(a-r)*i,l=s.radius+(n.radius-s.radius)*i;return Tt({x:this._prevCenter.x+(this._center.x-this._prevCenter.x)*i,y:this._prevCenter.y+(this._center.y-this._prevCenter.y)*i},l,o)}polarPointInterpolation(t,e,i){const{x:s,y:n}=this._interpolationSinglePoint(t,e,i),{x:r,y:a}=this._interpolationSinglePoint({x:t.x1,y:t.y1},{x:e.x1,y:e.y1},i),o=new ye(s,n,r,a);return o.defined=e.defined,o}}const eF=t=>({type:"in"===t?"fadeIn":"fadeOut"});function iF(t,e,i){return"fadeIn"===e?eF(i):((t,e)=>({type:"in"===e?"growPointsIn":"growPointsOut",options:()=>({center:t.center()})}))(t,i)}function sF(t,e,i){return"fadeIn"===e?eF(i):((t,e)=>{const i=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.x},s=(t,e)=>e.getGraphicAttribute("x"),n=()=>{var e;return null===(e=t.center())||void 0===e?void 0:e.y},r=(t,e)=>e.getGraphicAttribute("y");return"in"===e?{channel:{x:{from:i,to:s},y:{from:n,to:r}}}:{channel:{x:{from:s,to:i},y:{from:r,to:n}}}})(t,i)}const nF=(t,e)=>({custom:vA,customParameters:(i,s)=>{var n;return{group:s.getGraphicItem(),startAngle:null!==(n=t.startAngle)&&void 0!==n?n:Math.PI/2,orient:"clockwise",center:t.center(),radius:t.radius(),animationType:e}}}),rF=Object.assign(Object.assign(Object.assign({},rL),GC),{area:{name:"area",type:"area"}});class aF extends YB{constructor(){super(...arguments),this.type=_l.radar,this.transformerConstructor=gE,this._sortDataByAxis=!1}initGroups(){}compile(){super.compile(),this.addOverlapCompile()}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold},r=!1!==(null===(t=this._spec.area)||void 0===t?void 0:t.visible)&&!1!==(null===(i=null===(e=this._spec.area)||void 0===e?void 0:e.style)||void 0===i?void 0:i.visible),a=null!==(s=this._spec.seriesMark)&&void 0!==s?s:"area";this.initAreaMark(n,r&&"area"===a),this.initLineMark(n,"line"===a||"area"===a&&!r),this.initSymbolMark(n,"point"===a)}initMarkStyle(){this.initAreaMarkStyle(),this.initLineMarkStyle(),this.initSymbolMarkStyle(),[this._lineMark,this._symbolMark,this._areaMark].forEach((t=>{t&&this.setMarkStyle(t,{center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()}})}))}initAreaMark(t,e){var i,s;this._areaMark=this._createMark(aF.mark.area,{groupKey:this._seriesField,progressive:t,isSeriesMark:e,customShape:null===(i=this._spec.area)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.area)||void 0===s?void 0:s.stateSort})}initAreaMarkStyle(){const t=this._areaMark;t&&(this.setMarkStyle(t,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),x1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).x:Number.NaN,y1:t=>t&&this.angleAxisHelper&&this.radiusAxisHelper?this.valueToPosition(this.getDatumPositionValues(t,this._angleField),this.getStack()?this.getDatumPositionValues(t,this._innerRadiusField):this.radiusScale.domain()[0]).y:Number.NaN,fill:this.getColorAttribute(),curveType:WC,closePath:!0},"normal",Py.Series),"zero"!==this._invalidType&&this.setMarkStyle(t,{defined:this._getInvalidDefined.bind(this),connectedType:this._getInvalidConnectType()},"normal",Py.Series),this.event.on(Hd.viewDataStatisticsUpdate,{filter:t=>t.model===this},(()=>{this.encodeDefined(t,"defined")})))}initTooltip(){super.initTooltip();const{group:t,mark:e}=this._tooltipHelper.activeTriggerSet;this._lineMark&&t.add(this._lineMark),this._areaMark&&t.add(this._areaMark),this._symbolMark&&(e.add(this._symbolMark),t.add(this._symbolMark))}initAnimation(){var t,e,i,s;const n={center:()=>{var t;return null===(t=this.angleAxisHelper)||void 0===t?void 0:t.center()},radius:()=>{const t=this.getLayoutRect();return Math.min(t.width,t.height)},startAngle:M(this._spec.startAngle)?At(this._spec.startAngle):gh},r=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===r&&this._rootMark&&this._rootMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("radarGroup"))||void 0===s?void 0:s(n,r),DC("group",this._spec,this._markAttributeContext))),[[this._areaMark,"radar"],[this._lineMark,"radar"],[this._symbolMark,"radarSymbol"]].forEach((([t,e])=>{if(M(t)){const i=$l.getAnimationInKey(e);t.setAnimationConfig(EC(null==i?void 0:i(n,r),DC(t.name,this._spec,this._markAttributeContext)))}}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._areaMark,this._symbolMark,this._lineMark]}getSeriesStyle(t){return e=>{var i,s,n,r;let a=null!==(s=null===(i=this._seriesMark)||void 0===i?void 0:i.getAttribute(e,t))&&void 0!==s?s:void 0;return"fill"!==e||a||(e="stroke",a=null!==(r=null===(n=this._seriesMark)||void 0===n?void 0:n.getAttribute(e,t))&&void 0!==r?r:void 0),"stroke"===e&&y(a)?a[0]:a}}}aF.type=_l.radar,aF.mark=rF,aF.transformerConstructor=gE,JA(aF,UC);class oF extends qB{_getDefaultSeriesSpec(t){var e;return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,line:t.line,point:t.point,stack:t.stack,percent:t.percent,area:Tl({visible:!1},t.area),seriesMark:null!==(e=t.seriesMark)&&void 0!==e?e:"area",activePoint:t.activePoint,pointDis:t.pointDis,pointDisMul:t.pointDisMul,markOverlap:t.markOverlap})}transformSpec(t){var e;super.transformSpec(t),(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{"radius"===t.orient&&(["domainLine","label","tick"].forEach((e=>{t[e]||(t[e]={visible:!1})})),t.grid||(t.grid={visible:!0}))})),t.crosshair=Ba(t.crosshair||{}).map((t=>Tl({categoryField:{visible:!0,line:{visible:!0,type:"line"}}},t)))}}class lF extends cO{constructor(){super(...arguments),this.transformerConstructor=oF,this.type="radar",this.seriesType=_l.radar}}lF.type="radar",lF.seriesType=_l.radar,lF.transformerConstructor=oF,JA(lF,gO);class hF extends rO{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return delete e.data,e}_transformAxisSpec(t){t.axes&&t.autoBandSize&&t.series.forEach(((e,i)=>{var s;if("bar"===e.type){const n=this._findBandAxisBySeries(e,i,t.axes);if(n&&!n.bandSize&&!n.maxBandSize&&!n.minBandSize){const t=vs(e.autoBandSize)&&null!==(s=e.autoBandSize.extend)&&void 0!==s?s:0,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o}=e;this._applyAxisBandSize(n,t,{barMaxWidth:i,barMinWidth:r,barWidth:a,barGapInGroup:o})}}}))}transformSpec(t){if(super.transformSpec(t),t.series&&t.series.length){const e=this._getDefaultSeriesSpec(t);t.series.forEach((t=>{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))}))}t.axes&&t.axes.length&&t.axes.forEach((e=>{Ud(e,"trimPadding")&&Tl(e,by(this.type,t))})),this._transformAxisSpec(t)}}class dF extends cO{constructor(){super(...arguments),this.transformerConstructor=hF,this.type="common"}}dF.type="common",dF.transformerConstructor=hF,JA(dF,gO);class cF{static getInstance(){return cF.instance||(cF.instance=new cF),cF.instance}constructor(){this.locale_shortWeekdays=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],this.locale_periods=["AM","PM"],this.locale_weekdays=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.locale_shortMonths=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.numberRe=/^\s*\d+/,this.pads={"-":"",_:" ",0:"0"},this.requoteRe=/[\\^$*+?|[\]().{}]/g,this.locale_months=["January","February","March","April","May","June","July","August","September","October","November","December"],this.formatShortWeekday=t=>this.locale_shortWeekdays[t.getDay()],this.formatWeekday=t=>this.locale_weekdays[t.getDay()],this.formatShortMonth=t=>this.locale_shortMonths[t.getMonth()],this.formatMonth=t=>this.locale_months[t.getMonth()],this.formatDayOfMonth=(t,e)=>this.pad(t.getDate(),e,2),this.formatHour24=(t,e)=>this.pad(t.getHours(),e,2),this.formatHour12=(t,e)=>this.pad(t.getHours()%12||12,e,2),this.formatMilliseconds=(t,e)=>this.pad(t.getMilliseconds(),e,3),this.formatMonthNumber=(t,e)=>this.pad(t.getMonth()+1,e,2),this.formatMinutes=(t,e)=>this.pad(t.getMinutes(),e,2),this.formatPeriod=t=>this.locale_periods[+(t.getHours()>=12)],this.formatSeconds=(t,e)=>this.pad(t.getSeconds(),e,2),this.formatFullYear=(t,e)=>this.pad(t.getFullYear()%1e4,e,4),this.formatUTCShortWeekday=t=>this.locale_shortWeekdays[t.getUTCDay()],this.formatUTCWeekday=t=>this.locale_weekdays[t.getUTCDay()],this.formatUTCShortMonth=t=>this.locale_shortMonths[t.getUTCMonth()],this.formatUTCMonth=t=>this.locale_months[t.getUTCMonth()],this.formatUTCDayOfMonth=(t,e)=>this.pad(t.getUTCDate(),e,2),this.formatUTCHour24=(t,e)=>this.pad(t.getUTCHours(),e,2),this.formatUTCHour12=(t,e)=>this.pad(t.getUTCHours()%12||12,e,2),this.formatUTCMilliseconds=(t,e)=>this.pad(t.getUTCMilliseconds(),e,3),this.formatUTCMonthNumber=(t,e)=>this.pad(t.getUTCMonth()+1,e,2),this.formatUTCMinutes=(t,e)=>this.pad(t.getUTCMinutes(),e,2),this.formatUTCPeriod=t=>this.locale_periods[+(t.getUTCHours()>=12)],this.formatUTCSeconds=(t,e)=>this.pad(t.getUTCSeconds(),e,2),this.formatUTCFullYear=(t,e)=>this.pad(t.getUTCFullYear()%1e4,e,4),this.formats={a:this.formatShortWeekday,A:this.formatWeekday,b:this.formatShortMonth,B:this.formatMonth,d:this.formatDayOfMonth,e:this.formatDayOfMonth,H:this.formatHour24,I:this.formatHour12,L:this.formatMilliseconds,m:this.formatMonthNumber,M:this.formatMinutes,p:this.formatPeriod,S:this.formatSeconds,Y:this.formatFullYear},this.utcFormats={a:this.formatUTCShortWeekday,A:this.formatUTCWeekday,b:this.formatUTCShortMonth,B:this.formatUTCMonth,d:this.formatUTCDayOfMonth,e:this.formatUTCDayOfMonth,H:this.formatUTCHour24,I:this.formatUTCHour12,L:this.formatUTCMilliseconds,m:this.formatUTCMonthNumber,M:this.formatUTCMinutes,p:this.formatUTCPeriod,S:this.formatUTCSeconds,Y:this.formatUTCFullYear},this.parseShortWeekday=(t,e,i)=>{const s=this.shortWeekdayRe.exec(e.slice(i));return s?(t.w=this.shortWeekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseWeekday=(t,e,i)=>{const s=this.weekdayRe.exec(e.slice(i));return s?(t.w=this.weekdayLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseShortMonth=(t,e,i)=>{const s=this.shortMonthRe.exec(e.slice(i));return s?(t.m=this.shortMonthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseMonth=(t,e,i)=>{const s=this.monthRe.exec(e.slice(i));return s?(t.m=this.monthLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseDayOfMonth=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.d=+s[0],i+s[0].length):-1},this.parseHour24=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.H=+s[0],i+s[0].length):-1},this.parseMilliseconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+3));return s?(t.L=+s[0],i+s[0].length):-1},this.parseMonthNumber=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.m=s-1,i+s[0].length):-1},this.parseMinutes=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.M=+s[0],i+s[0].length):-1},this.parsePeriod=(t,e,i)=>{const s=this.periodRe.exec(e.slice(i));return s?(t.p=this.periodLookup.get(s[0].toLowerCase()),i+s[0].length):-1},this.parseSeconds=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+2));return s?(t.S=+s[0],i+s[0].length):-1},this.parseFullYear=(t,e,i)=>{const s=this.numberRe.exec(e.slice(i,i+4));return s?(t.y=+s[0],i+s[0].length):-1},this.parses={a:this.parseShortWeekday,A:this.parseWeekday,b:this.parseShortMonth,B:this.parseMonth,d:this.parseDayOfMonth,e:this.parseDayOfMonth,H:this.parseHour24,I:this.parseHour24,L:this.parseMilliseconds,m:this.parseMonthNumber,M:this.parseMinutes,p:this.parsePeriod,S:this.parseSeconds,Y:this.parseFullYear},this.timeFormat=(t,e)=>this.newFormat(t,this.formats)(new Date(this.getFullTimeStamp(e))),this.timeUTCFormat=(t,e)=>this.newFormat(t,this.utcFormats)(new Date(this.getFullTimeStamp(e))),this.timeParse=(t,e)=>this.newParse(t,!1)(e+""),this.requoteF=this.requote.bind(this),this.periodRe=this.formatRe(this.locale_periods),this.periodLookup=this.formatLookup(this.locale_periods),this.weekdayRe=this.formatRe(this.locale_weekdays),this.weekdayLookup=this.formatLookup(this.locale_weekdays),this.shortWeekdayRe=this.formatRe(this.locale_shortWeekdays),this.shortWeekdayLookup=this.formatLookup(this.locale_shortWeekdays),this.monthRe=this.formatRe(this.locale_months),this.monthLookup=this.formatLookup(this.locale_months),this.shortMonthRe=this.formatRe(this.locale_shortMonths),this.shortMonthLookup=this.formatLookup(this.locale_shortMonths)}requote(t){return t.replace(this.requoteRe,"\\$&")}localDate(t){if(0<=t.y&&t.y<100){const e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}utcDate(t){if(0<=t.y&&t.y<100){const e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}newDate(t,e,i){return{y:t,m:e,d:i,H:0,M:0,S:0,L:0}}formatRe(t){return new RegExp("^(?:"+t.map(this.requoteF).join("|")+")","i")}formatLookup(t){return new Map(t.map(((t,e)=>[t.toLowerCase(),e])))}pad(t,e,i){const s=t<0?"-":"",n=(s?-t:t)+"",r=n.length;return s+(r=a)return-1;if(o=e.charCodeAt(n++),37===o){if(o=e.charAt(n++),l=this.parses[o in this.pads?e.charAt(n++):o],!l||(s=l(t,i,s))<0)return-1}else if(o!==i.charCodeAt(s++))return-1}return s}newParse(t,e){const i=this;return function(s){const n=i.newDate(1900,void 0,1);return i.parseSpecifier(n,t,s+="",0)!==s.length?null:"Q"in n?new Date(n.Q):"s"in n?new Date(1e3*n.s+("L"in n?n.L:0)):(e&&!("Z"in n)&&(n.Z=0),"p"in n&&(n.H=n.H%12+12*n.p),void 0===n.m&&(n.m="q"in n?n.q:0),"Z"in n?(n.H+=n.Z/100|0,n.M+=n.Z%100,i.utcDate(n)):i.localDate(n))}}newFormat(t,e){const i=this;return function(s){const n=[];let r=-1,a=0;const o=t.length;let l,h,d;for(s instanceof Date||(s=new Date(+s));++rcF.getInstance().timeFormat("%Y%m%d %H:%M",t.from.split("_")[1])},{key:"type",value:t=>t.action_type},{key:"from",value:t=>t.from},{key:"to",value:t=>t.to}].map((t=>Object.assign({hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback},t)))}:null}}class pF extends vx{constructor(){super(...arguments),this.type=pF.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x1:0,y1:0})}}pF.type="rule";const gF=()=>{$l.registerMark(pF.type,pF),VA()},mF=Object.assign(Object.assign({},rL),{group:{name:"group",type:"group"},link:{name:"link",type:"rule"},arrow:{name:"arrow",type:"symbol"}}),_F=(t,e)=>{const{infoKey:i,fields:s,linkData:n,dotData:r}=e,{fromField:a,toField:o,xField:l,yField:h}=s(),d=n(),c=r(),u={};return c.forEach((t=>{const e={};for(const s in t)s!==i&&(e[s]=t[s]);const s=t[i];null==s||s.forEach((t=>{u[t.node_name]=Object.assign({},e,t)}))})),d.forEach((t=>{var e,i,s,n;t[a+"_xField"]=null===(e=null==u?void 0:u[t[a]])||void 0===e?void 0:e[l],t[a+"_yField"]=null===(i=null==u?void 0:u[t[a]])||void 0===i?void 0:i[h],t[o+"_xField"]=null===(s=null==u?void 0:u[t[o]])||void 0===s?void 0:s[l],t[o+"_yField"]=null===(n=null==u?void 0:u[t[o]])||void 0===n?void 0:n[h]})),d};class fF extends NC{constructor(){super(...arguments),this.type=_l.link}getFromField(){return this._fromField}setFromField(t){M(t)&&(this._fromField=t)}getToField(){return this._toField}setToField(t){M(t)&&(this._toField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getDotSeriesSpec(){return this._dotSeriesSpec}setDotSeriesSpec(t){M(t)&&(this._dotSeriesSpec=t)}_getDotData(){const t=this._option.getChart().getSeriesInIndex([this._spec.dotSeriesIndex])[0];return t?t.getRawData().latestData:[]}initData(){var t;super.initData(),Lp(this._option.dataSet,"linkDotInfo",_F),null===(t=this.getViewData())||void 0===t||t.transform({type:"linkDotInfo",options:{infoKey:"dots",fields:()=>({fromField:this._fromField,toField:this._toField,xField:this._dotSeriesSpec.xField,yField:this._dotSeriesSpec.yField}),linkData:()=>this._rawData.latestData,dotData:()=>this._getDotData()},level:Hp.linkDotInfo},!1)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFromField(this._spec.fromField),this.setToField(this._spec.toField),this.setDotTypeField(this._spec.dotTypeField),this.setDotSeriesSpec(this._spec.dotSeriesSpec)}initMark(){this._clipMark=this._createMark(fF.mark.group),this._containerMark=this._createMark(fF.mark.group,{parent:this._clipMark}),this._linkMark=this._createMark(fF.mark.link,{skipBeforeLayouted:!1,parent:this._containerMark}),this._arrowMark=this._createMark(fF.mark.arrow,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark})}initMarkStyle(){var t,e,i,s;const n=this._clipMark;n&&(this.setMarkStyle(n,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",Py.Series),n.setInteractive(!1));const r=this._containerMark;r&&(this.setMarkStyle(r,{x:this._spec.leftAppendPadding,width:this.getLayoutRect().width},"normal",Py.Series),r.setInteractive(!1));const a=this._linkMark;a&&this.setMarkStyle(a,{stroke:this.getColorAttribute(),strokeOpacity:this.dataToOpacity.bind(this),x:this.dataToPositionXFrom.bind(this),y:this.dataToPositionYFrom.bind(this),x1:this.dataToPositionXTo.bind(this),y1:this.dataToPositionYTo.bind(this)},"normal",Py.Series);const o=this._arrowMark;if(o){const n=null!==(s=null===(i=null===(e=null===(t=this._theme)||void 0===t?void 0:t.arrow)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size)&&void 0!==s?s:10;this.setMarkStyle(o,{x:this.dataToPositionXTo.bind(this),y:t=>this.dataToPositionArrowYTo(t,n),fill:this.getColorAttribute(),fillOpacity:this.dataToOpacity.bind(this),size:n,symbolType:t=>this.isPositionYFromHigher(t)?"triangleDown":"triangleUp"},"normal",Py.Series)}}afterInitMark(){super.afterInitMark()}dataToPositionXFrom(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYFrom(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fromField+"_yField"))}dataToPositionXTo(t){if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_xField"),{bandPosition:this._bandPosition})}dataToPositionYTo(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})}dataToPositionArrowYTo(t,e){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:i}=this._yAxisHelper,s=this.isPositionYFromHigher(t)?-e/2:e/2;return i(this.getDatumPositionValues(t,this._toField+"_yField"),{bandPosition:this._bandPosition})+s}dataToOpacity(t){return this.isPositionXOuterRange(t,this._fromField+"_xField")||this.isPositionXOuterRange(t,this._toField+"_xField")||t[this._fromField]===t[this._toField]?0:1}isPositionYFromHigher(t){return this.dataToPositionYFrom(t)s(0).range()[1]}getDefaultColorDomain(){var t,e;return this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:bT}}initInteraction(){const t=[];this._linkMark&&t.push(this._linkMark),this._arrowMark&&t.push(this._arrowMark),this._parseInteractionConfig(t)}initTooltip(){this._tooltipHelper=new uF(this),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark),this._arrowMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._arrowMark)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotInfoData(){var t,e;return null===(e=null!==(t=this._linkMark)&&void 0!==t?t:this._arrowMark)||void 0===e?void 0:e.getData()}getActiveMarks(){return[this._linkMark,this._arrowMark]}}fF.type=_l.link,fF.mark=mF;class vF extends UT{getDefaultTooltipPattern(t){return"mark"===t?{visible:!0,activeType:t,title:{key:"event info",value:"event info"},content:[{key:t=>t.type,value:t=>t.id},{key:"event_time",value:t=>cF.getInstance().timeFormat("%Y%m%d",t.event_time)},{key:"action_type",value:t=>t.action_type},{key:"children",value:t=>t.children}].map((t=>Object.assign({hasShape:!0,shapeType:"square",shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback},t))),updateContent:(t,e,i)=>{const s=[],n=t.filter((t=>"children"===t.key));return n.length>0&&n[0].value.forEach((t=>{let i=!0;for(const n in t)s.push({shapeType:"circle",hasShape:i,shapeColor:this.shapeColorCallback(e[0].datum[0]),shapeStroke:this.shapeStrokeCallback(e[0].datum[0]),key:n,value:t[n]+""}),i=!1})),t.concat(s)}}:null}}const yF=(t,e)=>{var i;const s=(null===(i=t[0])||void 0===i?void 0:i.latestData)?t[0].latestData:t||[],n=[];return s.forEach((t=>{const i={};for(const s in t)s!==e&&(i[s]=t[s]);const s=t[e];null==s||s.forEach((t=>{n.push(Object.assign({},i,t))}))})),n},bF={fill:"#bbb",fillOpacity:.2};class xF extends vx{getTextType(){return this._textType}constructor(t,e){super(t,e),this.type=xF.type,this._textType="text"}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{angle:0,textAlign:"center",lineWidth:0,textConfig:[]})}initStyleWithSpec(t,e){super.initStyleWithSpec(t,e),t.textType&&(this._textType=t.textType)}compileEncode(){super.compileEncode(),"rich"===this._textType&&this._product.encodeState("group",{textType:this._textType})}}xF.type="text";const SF=()=>{$l.registerMark(xF.type,xF),GA(),Sx(),ek(),_c.registerGraphic(Jd.richtext,GM)},MF=Object.assign(Object.assign({},rL),{group:{name:"group",type:"group"},grid:{name:"grid",type:"rule"},gridBackground:{name:"gridBackground",type:"rect"},dot:{name:"dot",type:"symbol"},title:{name:"title",type:"text"},subTitle:{name:"subTitle",type:"text"},symbol:{name:"symbol",type:"symbol"}});class kF extends NC{constructor(){super(...arguments),this.type=_l.dot}getSeriesGroupField(){return this._seriesField}setSeriesGroupField(t){M(t)&&(this._seriesGroupField=t)}getTitleField(){return this._titleField}setTitleField(t){M(t)&&(this._titleField=t)}getSubTitleField(){return this._subTitleField}setSubTitleField(t){M(t)&&(this._subTitleField=t)}getDotTypeField(){return this._dotTypeField}setDotTypeField(t){M(t)&&(this._dotTypeField=t)}getHighLightSeriesGroup(){return this._highLightSeriesGroup}setHighLightSeriesGroup(t){M(t)&&(this._highLightSeriesGroup=t)}setGridBackground(t){M(t)&&(this._gridBackground=t)}initData(){var t;super.initData(),this._xDimensionStatisticsDomain=this.getRawData().latestData.map((t=>t[this._fieldY[0]])),Lp(this._option.dataSet,"objFlat",yF),Lp(this._option.dataSet,"copyDataView",Bp),Cp(this._option.dataSet,"dataview",b),null===(t=this.getViewData())||void 0===t||t.transform({type:"objFlat",options:"dots",level:Hp.dotObjFlat},!1)}getStatisticFields(){return[{key:this._fieldY[0],operations:["values"],customize:this._xDimensionStatisticsDomain}]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setSeriesGroupField(this._spec.seriesGroupField),this.setTitleField(this._spec.titleField),this.setSubTitleField(this._spec.subTitleField),this.setDotTypeField(this._spec.dotTypeField),this.setHighLightSeriesGroup(this._spec.highLightSeriesGroup),this.setGridBackground(Tl(bF,(null===(t=this._spec.grid)||void 0===t?void 0:t.background)||{}))}initMark(){this._clipMark=this._createMark(kF.mark.group),this._containerMark=this._createMark(kF.mark.group,{parent:this._clipMark,dataView:this.getRawData()}),this._gridBackgroundMark=this._createMark(kF.mark.gridBackground,{parent:this._containerMark,dataView:this.getRawData()}),this._gridMark=this._createMark(kF.mark.grid,{parent:this._containerMark,dataView:this.getRawData()}),this._dotMark=this._createMark(kF.mark.dot,{skipBeforeLayouted:!1,isSeriesMark:!0,parent:this._containerMark}),this._titleMark=this._createMark(kF.mark.title,{parent:this._containerMark,dataView:this.getRawData()}),this._subTitleMark=this._createMark(kF.mark.subTitle,{parent:this._containerMark,dataView:this.getRawData()}),this._symbolMark=this._createMark(kF.mark.symbol,{parent:this._containerMark,dataView:this.getRawData()})}initMarkStyle(){const t=this._clipMark;t&&(this.setMarkStyle(t,{x:-this._spec.leftAppendPadding,y:0,width:1e4,height:this._spec.clipHeight,clip:!0},"normal",Py.Series),t.setInteractive(!1));const e=this._containerMark;e&&(this.setMarkStyle(e,{x:this._spec.leftAppendPadding},"normal",Py.Series),e.setInteractive(!1));const i=this._gridBackgroundMark;i&&this.setMarkStyle(i,{x:this.getRegionRectLeft.bind(this),x1:this.getRegionRectRight.bind(this),y:this.dataToGridBackgroundPositionY.bind(this),y1:this.dataToGridBackgroundPositionY1.bind(this),fill:this._gridBackground.fill,fillOpacity:this.dataToGridBackgroundOpacity.bind(this)},"normal",Py.Series);const s=this._gridMark;s&&this.setMarkStyle(s,{stroke:this.getColorAttribute(),x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),x1:this.getRegionRectRight.bind(this),y1:this.dataToPositionY.bind(this)},"normal",Py.Series);const n=this._dotMark;n&&this.setMarkStyle(n,{x:this.dataToPositionX.bind(this),y:this.dataToPositionY.bind(this),fill:this.getDotColorAttribute(),fillOpacity:this.dataToOpacity.bind(this)},"normal",Py.Series);const r=this._titleMark;r&&this.setMarkStyle(r,{fill:this.getColorAttribute(),text:t=>t[this.getTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Py.Series);const a=this._subTitleMark;a&&this.setMarkStyle(a,{fill:this.getColorAttribute(),text:t=>t[this.getSubTitleField()],x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this)},"normal",Py.Series);const o=this._symbolMark;o&&this.setMarkStyle(o,{x:this.getRegionRectLeft.bind(this),y:this.dataToPositionY.bind(this),fill:this.getColorAttribute()},"normal",Py.Series)}dataToGridBackgroundPositionY(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})-i(0)/2}dataToGridBackgroundPositionY1(t){if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e,getBandwidth:i}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._fieldY),{bandPosition:this._bandPosition})+i(0)/2}dataToOpacity(t){var e,i,s,n;if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:r,getScale:a}=this._xAxisHelper;return r(this.getDatumPositionValues(t,this._fieldX),{bandPosition:this._bandPosition})a(0).range()[1]?0:null!==(n=null===(s=null===(i=null===(e=this._theme)||void 0===e?void 0:e.dot)||void 0===i?void 0:i.style)||void 0===s?void 0:s.fillOpacity)&&void 0!==n?n:1}dataToGridBackgroundOpacity(t){return t[this._seriesGroupField]===this._highLightSeriesGroup?this._gridBackground.fillOpacity:0}onLayoutEnd(t){var e,i;super.onLayoutEnd(t);const s=null!==(i=null===(e=this._spec)||void 0===e?void 0:e.leftAppendPadding)&&void 0!==i?i:0;this.setMarkStyle(this._clipMark,{width:this.getLayoutRect().width+s},"normal",Py.Series)}getDefaultColorDomain(){var t,e;return this._seriesGroupField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._seriesGroupField].values:this._seriesField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesField].values:[]}getColorAttribute(){var t,e,i;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:null!==(i=null!==(e=this._seriesGroupField)&&void 0!==e?e:this._seriesField)&&void 0!==i?i:bT}}getDotColorScale(){var t,e,i;const s=this._dotTypeField?null===(t=this.getViewDataStatistics())||void 0===t?void 0:t.latestData[this._dotTypeField].values:this._seriesGroupField?null===(e=this.getViewDataStatistics())||void 0===e?void 0:e.latestData[this._seriesGroupField].values:this._seriesField?null===(i=this.getViewDataStatistics())||void 0===i?void 0:i.latestData[this._seriesField].values:[],n=this._getDataScheme();return(new sx).domain(s).range(n)}getDotColorAttribute(){var t,e,i,s;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this.getDotColorScale(),field:null!==(s=null!==(i=null!==(e=this._dotTypeField)&&void 0!==e?e:this._seriesGroupField)&&void 0!==i?i:this._seriesField)&&void 0!==s?s:bT}}initTooltip(){this._tooltipHelper=new vF(this),this._dotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._dotMark)}onEvaluateEnd(t){super.onEvaluateEnd(t)}onMarkTreePositionUpdate(t){t.forEach((t=>{"group"===t.type?this.onMarkTreePositionUpdate(t.getMarks()):t.updateLayoutState()}))}getDotData(){var t;return null===(t=this._dotMark)||void 0===t?void 0:t.getData()}_getDataIdKey(){}getStackValueField(){return null}getActiveMarks(){return[this._dotMark]}}kF.type=_l.dot,kF.mark=MF;class AF extends rO{_getSeriesDataLength(t,e){var i,s;if(e.data){const t=Ba(e.data)[0];return t instanceof R?null===(i=t.latestData)||void 0===i?void 0:i.length:null===(s=t.values)||void 0===s?void 0:s.length}const n=Ba(t.data).find(((t,i)=>e.dataId?t instanceof R?t.name===e.dataId:t.id===e.dataId:e.dataIndex===i));return n?n instanceof R?n.latestData.length:n.values.length:0}addAttrToComponentSpec(t,e,i){return Array.isArray(t)?t[0][e]=i:t[e]=i,t}addPaddingRow(t,e,i){t.push({index:e,size:i})}addOrientAxes(t,e,i,s){t.push({id:`regionAxesRow${i}`}),e.push({modelId:`axesRow${i}`,col:1,row:i}),s.axes[0].id=`axesRow${i}`,s.axes[0].regionIndex=Array.from(Array(s.series.length),((t,e)=>"top"===s.axes[0].orient?e+1:e))}transformSpec(t){var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;super.transformSpec(t);let _=0;const f=[],v=[],y=[],b=[],x=[],S=(this._option.getCompiler().getVGrammarView().width(),this._option.getCompiler().getVGrammarView().height());let M=0;if(null==t?void 0:t.legends){f.push({modelId:`legendRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.legends,"id",`legendRow${_}`);const o=Ba(t.legends);let l=null!==(e=o[0].height)&&void 0!==e?e:40;if(o[0].padding){const t=sl(o[0].padding);l+=Number(null!==(i=null==t?void 0:t.bottom)&&void 0!==i?i:0),l+=Number(null!==(s=null==t?void 0:t.top)&&void 0!==s?s:0),o[0].offsetY=Number(null!==(r=null===(n=o[0])||void 0===n?void 0:n.offsetY)&&void 0!==r?r:0)+Number(null!==(a=null==t?void 0:t.top)&&void 0!==a?a:0)}x.push({index:_,size:l}),M+=l,_++}(null==t?void 0:t.dataZoom)&&(f.push({modelId:`dataZoomRow${_}`,col:1,row:_}),this.addAttrToComponentSpec(t.dataZoom,"id",`dataZoomRow${_}`),M+=60,_++,this.addPaddingRow(x,_,10),M+=10,_++),M+=60,null!==t.axes&&"top"!==(null===(l=null===(o=null==t?void 0:t.axes)||void 0===o?void 0:o[0])||void 0===l?void 0:l.orient)||(this.addOrientAxes(v,f,_,t),_++);const k=t.series.filter((t=>t.type!==_l.link)).length,A=(S-M-20*k)/k,w=(null===(h=null==t?void 0:t.appendPadding)||void 0===h?void 0:h.left)||0,T=(null===(d=null==t?void 0:t.appendPadding)||void 0===d?void 0:d.right)||0;null===(c=null==t?void 0:t.series)||void 0===c||c.forEach((e=>{var i,s;if([_l.bar,_l.line,_l.area,_l.dot].includes(e.type)){if(f.push({modelId:`${e.type}Row${_}`,col:1,row:_}),f.push({modelId:`axesLeftRow${_}`,col:0,row:_}),v.push({id:`${e.type}Row${_}`,clip:!1}),x.push({index:_,size:(null==e?void 0:e.height)||A}),y.push({orient:"left",id:`axesLeftRow${_}`,type:e.type===_l.dot?"band":"linear",visible:e.type!==_l.dot,title:{visible:!0,autoRotate:!1,style:{text:null==e?void 0:e.barTitle,dx:-20,textBaseline:"middle",textAlign:"end"}},grid:{visible:"boolean"!=typeof(null===(i=null==e?void 0:e.grid)||void 0===i?void 0:i.visible)||(null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.visible),style:(t,i)=>{var s,n,r,a,o;let l=0;if(0===i){const t=null===(s=null==e?void 0:e.grid)||void 0===s?void 0:s.style;l=null!==(r=null!==(n=null==t?void 0:t.lineWidth)&&void 0!==n?n:null==t?void 0:t.strokeWidth)&&void 0!==r?r:1}return{lineWidth:l,stroke:(null===(o=null===(a=null==e?void 0:e.grid)||void 0===a?void 0:a.style)||void 0===o?void 0:o.stroke)||"#dfdfdf",lineDash:[0,0]}}},domainLine:{visible:!1},tick:{visible:!1},label:{visible:!1},regionIndex:v.length-1}),e.type===_l.dot){f.push({modelId:`scrollBarRightRow${_}`,col:2,row:_});const i=this._getSeriesDataLength(t,e);let s=0;i&&(s=((null==e?void 0:e.height)||A)/(30*i)),b.push(Object.assign({orient:"right",visible:e.type===_l.dot&&s<1,id:`scrollBarRightRow${_}`,start:0,end:Math.min(s,1),filterMode:"axis",regionIndex:v.length-1,axisId:`axesLeftRow${_}`},Ba(null==t?void 0:t.scrollBar)[0]))}e.regionIndex=v.length-1,_++,this.addPaddingRow(x,_,(null==e?void 0:e.padding)||20),_++,e.leftAppendPadding=w,e.type===_l.dot&&(e.title.style.dx=-w,e.subTitle.style.dx=-w)}})),this.addPaddingRow(x,_,20),_++,null===(u=null==t?void 0:t.series)||void 0===u||u.forEach((e=>{if(e.type===_l.link){const i=e.dotSeriesIndex+1;f.push({modelId:`${e.type}Row${i}`,col:1,row:i-1}),e.regionIndex=t.series[e.dotSeriesIndex].regionIndex,e.leftAppendPadding=w,e.height=t.series[e.dotSeriesIndex].height,e.clipHeight=t.series[e.dotSeriesIndex].clipHeight}})),(null==t?void 0:t.legends)&&this.addAttrToComponentSpec(t.legends,"regionIndex",[v.length-1]),"bottom"===(null===(g=null===(p=null==t?void 0:t.axes)||void 0===p?void 0:p[0])||void 0===g?void 0:g.orient)&&(this.addOrientAxes(v,f,_,t),_++);const L={type:"grid",col:4,row:_,colWidth:[{index:0,size:w},{index:2,size:12},{index:3,size:T}],rowHeight:x,elements:f};t.layout=L,t.region=v,null===(m=t.axes)||void 0===m||m.push(...y),t.scrollBar=b}}class wF extends cO{constructor(){super(...arguments),this.transformerConstructor=AF,this.type="sequence"}_createSeries(t,e){if(!t)return;const{spec:i}=e,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nt.type="linear"))}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{x2Field:null==t?void 0:t.x2Field,y2Field:null==t?void 0:t.y2Field,barMinHeight:null==t?void 0:t.barMinHeight,barBackground:null==t?void 0:t.barBackground})}}class LF extends cO{constructor(){super(...arguments),this.transformerConstructor=TF}}LF.transformerConstructor=TF,JA(LF,gO);class CF extends TF{transformSpec(t){super.transformSpec(t),fy(t)}}class EF extends LF{constructor(){super(...arguments),this.transformerConstructor=CF,this.type="histogram",this.seriesType=_l.bar}}EF.type="histogram",EF.seriesType=_l.bar,EF.transformerConstructor=CF;class DF extends LF{constructor(){super(...arguments),this.transformerConstructor=CF,this.type="histogram3d",this.seriesType=_l.bar3d}}DF.type="histogram3d",DF.seriesType=_l.bar3d,DF.transformerConstructor=CF;const PF=Object.assign(Object.assign({},rL),{group:{name:"group",type:"group"}});class OF extends iB{constructor(){super(...arguments),this._arcGroupMark=null,this._getAngleValueStart=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?MT:OT],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle);let o;if(M(s)){const t=sb(n,(t=>t.value-s)),e=t>=n.length||s>n[t].value-r/2?Math.min(t,n.length-1):t>0?t-1:void 0;void 0!==e&&(o=this.angleAxisHelper.dataToPosition([n[e].value-r/2]))}return D(o)&&(o=this.angleAxisHelper.dataToPosition([n[0].value-r/2])),o+a}return this._getAngleValueStartWithoutMask(t)},this._getAngleValueEnd=t=>{const e=this._getAngleAxis(),{tickMask:i}=this._spec;if((null==i?void 0:i.forceAlign)&&this._isTickMaskVisible(e)){const s=t[this.getStack()?kT:this._angleField[0]],n=this._getAngleAxisSubTickData(e),r=n[1].value-n[0].value,a=At(i.offsetAngle),o=sb(n,(t=>t.value-s)),l=o>=n.length||s>n[o].value-r/2?Math.min(o,n.length-1):o>0?o-1:void 0;let h;return h=void 0!==l?this.angleAxisHelper.dataToPosition([n[l].value+r/2]):this.angleAxisHelper.dataToPosition([n[0].value-r/2]),h+a}return this._getAngleValueEndWithoutMask(t)}}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec();const s=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getSpec(),n=null!==(e=this._spec.startAngle)&&void 0!==e?e:null==s?void 0:s.startAngle;this._startAngle=M(n)?At(n):gh;const r=null!==(i=this._spec.endAngle)&&void 0!==i?i:null==s?void 0:s.endAngle;this._endAngle=M(r)?At(r):mh,this.setAngleField(this._spec.valueField||this._spec.angleField),this.setRadiusField(this._spec.categoryField||this._spec.radiusField),this._specAngleField=this._angleField.slice(),this._specRadiusField=this._radiusField.slice()}getStackGroupFields(){return this._radiusField}getStackValueField(){var t;return null===(t=this._angleField)||void 0===t?void 0:t[0]}getGroupFields(){return this._angleField}_convertMarkStyle(t){const e=super._convertMarkStyle(t);if(e.fill){const i=t.fill;"conical"!==(null==i?void 0:i.gradient)||M(null==i?void 0:i.startAngle)||M(null==i?void 0:i.endAngle)||(e.fill=Object.assign(Object.assign({},i),{startAngle:this._startAngle,endAngle:this._endAngle}))}return e}_getAngleValueStartWithoutMask(t){if(this.getStack()){const e=ax(this.angleAxisHelper.dataToPosition([t[MT]]),this.angleAxisHelper.getScale(0));if(qo(e))return e}return this._startAngle}_getAngleValueEndWithoutMask(t){if(this.getStack()){const e=ax(this.angleAxisHelper.dataToPosition([t[kT]]),this.angleAxisHelper.getScale(0));if(qo(e))return e}return this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])}getDimensionField(){return this._specRadiusField}getMeasureField(){return this._specAngleField}initMark(){this._initArcGroupMark()}initMarkStyle(){this._initArcGroupMarkStyle()}_initArcGroupMark(){return this._arcGroupMark=this._createMark(OF.mark.group,{skipBeforeLayouted:!1}),this._arcGroupMark}_initArcGroupMarkStyle(){const t=this._arcGroupMark;t.setZIndex(this.layoutZIndex),t.created(),this.setMarkStyle(t,{x:0,y:0},"normal",Py.Series),t.setClip((()=>{const t=this._getAngleAxis();if(this._isTickMaskVisible(t)){const{tickMask:e}=this._spec,{angle:i,offsetAngle:s,style:n={}}=e,r=this._getAngleAxisSubTickData(t),{x:a,y:o}=this.angleAxisHelper.center(),l=this._computeLayoutRadius(),h=n;return r.map((({value:t})=>{const e=this.angleAxisHelper.dataToPosition([t])+At(s),n=At(i)/2;return Ax(Object.assign(Object.assign({},h),{x:a,y:o,startAngle:e-n,endAngle:e+n,innerRadius:l*this._innerRadius,outerRadius:l*this._outerRadius,fill:!0}))}))}const{width:e,height:i}=this.getLayoutRect();return[Kv({width:e,height:i,fill:!0})]})),this._arcGroupMark.setInteractive(!1)}_getAngleAxis(){if(!this.angleAxisHelper)return;const t=this.angleAxisHelper.getAxisId();return this._option.getChart().getAllComponents().find((e=>e.id===t))}_getAngleAxisTickData(t){var e;return null===(e=null==t?void 0:t.getTickData())||void 0===e?void 0:e.getLatestData()}_isTickMaskVisible(t){const e=this._getAngleAxisTickData(t),{tickMask:i}=this._spec;return i&&!1!==i.visible&&(null==e?void 0:e.length)>1}_getAngleAxisSubTickData(t){var e;const i=this._getAngleAxisTickData(t),s=[],{subTick:n={},tick:r={}}=null!==(e=null==t?void 0:t.getSpec())&&void 0!==e?e:{},{tickCount:a=4}=n,{alignWithLabel:o}=r;if((null==i?void 0:i.length)>=2){const t=i[1].value-i[0].value;for(let e=0;e({type:"growAngleIn",options:{overall:t.startAngle}}))(t)}const FF=()=>{$l.registerAnimation("circularProgress",((t,e)=>({appear:BF(t,e),enter:{type:"growAngleIn"},disappear:{type:"growAngleOut"}})))};class YF extends YC{constructor(){super(...arguments),this._supportStack=!0}}class jF extends OF{constructor(){super(...arguments),this.type=_l.circularProgress,this.transformerConstructor=YF,this._progressMark=null,this._trackMark=null,this._getRadiusValueStart=t=>{if(this.getGroupFields().length>1){const e=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()));if(qo(e))return e}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])},this._getRadiusValueEnd=t=>{var e,i;if(this.getGroupFields().length>1){const s=this.radiusAxisHelper.dataToPosition(this.getDatumPositionValues(t,this.getGroupFields()))+(null===(i=(e=this.radiusAxisHelper).getBandwidth)||void 0===i?void 0:i.call(e,this._groups?this._groups.fields.length-1:0));if(qo(s))return s}return this.radiusAxisHelper.dataToPosition([t[this._radiusField[0]]])+this.radiusAxisHelper.getScale(0).step()}}getStackGroupFields(){return this.getGroupFields()}getGroupFields(){return this._radiusField}initMark(){super.initMark(),this._initTrackMark(),this._initProgressMark()}initMarkStyle(){super.initMarkStyle(),this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e;return this._progressMark=this._createMark(jF.mark.progress,{parent:this._arcGroupMark,isSeriesMark:!0,customShape:null===(t=this._spec.progress)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.progress)||void 0===e?void 0:e.stateSort}),this._progressMark}_initProgressMarkStyle(){var t;const e=this._progressMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart,endAngle:this._getAngleValueEnd,innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0},"normal",Py.Series)}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initTooltip(){super.initTooltip(),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark)}_initTrackMark(){var t,e;return this._trackMark=this._createMark(jF.mark.track,{parent:this._arcGroupMark,customShape:null===(t=this._spec.track)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.track)||void 0===e?void 0:e.stateSort}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&this.setMarkStyle(t,{visible:t=>{const e=this.angleAxisHelper.getScale(0).range(),i=Math.min(e[0],e[e.length-1]),s=this._getAngleValueStartWithoutMask(t);return Math.abs(s-i)<=1e-14},x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:()=>{const t=this.getStack()?MT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueStart({[t]:e[0]})},endAngle:()=>{const t=this.getStack()?kT:this._angleField[0],e=this.angleAxisHelper.getScale(0).domain();return this._getAngleValueEnd({[t]:e[e.length-1]})},innerRadius:this._getRadiusValueStart,outerRadius:this._getRadiusValueEnd,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:100},"normal",Py.Series)}initAnimation(){var t,e,i,s;const n=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},n),DC("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),DC("track",this._spec,this._markAttributeContext)))}getActiveMarks(){return[this._progressMark]}}jF.type=_l.circularProgress,jF.mark=RF,jF.transformerConstructor=YF;class HF extends SB{needAxes(){return!1}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{seriesField:t.seriesField,categoryField:t.categoryField||t.radiusField,valueField:t.valueField||t.angleField,startAngle:t.startAngle,endAngle:t.endAngle,radius:t.radius,innerRadius:t.innerRadius,centerX:t.centerX,centerY:t.centerY})}_transformProgressAxisSpec(t,e,i,s,n){var r,a;t.axes||(t.axes=[]);let o=(null!==(r=t.axes)&&void 0!==r?r:[]).find((t=>"radius"===t.orient)),l=(null!==(a=t.axes)&&void 0!==a?a:[]).find((t=>"angle"===t.orient));l||(l=e,t.axes.push(l)),o||(o=i,t.axes.push(o)),D(l.type)&&(l.type="linear"),D(o.type)&&(o.type="band");const h=NE(l,{min:0,max:1});D(l.min)&&(l.min=h.min),D(l.max)&&(l.max=h.max),s&&Object.assign(l,Tl({},s,l)),n&&Object.assign(o,Tl({},n,o))}}class zF extends HF{_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{cornerRadius:null!==(e=t.cornerRadius)&&void 0!==e?e:0,roundCap:null!==(i=t.roundCap)&&void 0!==i&&i,progress:t.progress,track:t.track,tickMask:t.tickMask})}transformSpec(t){super.transformSpec(t),this._transformProgressAxisSpec(t,{orient:"angle",visible:!1},{orient:"radius",visible:!1},{forceInitTick:t.tickMask&&!1!==t.tickMask.visible})}}class NF extends cO{constructor(){super(...arguments),this.transformerConstructor=zF,this.type="circularProgress",this.seriesType=_l.circularProgress}}NF.type="circularProgress",NF.seriesType=_l.circularProgress,NF.transformerConstructor=zF,JA(NF,gO);const VF=Object.assign(Object.assign({},PF),{segment:{name:"segment",type:"arc"},track:{name:"track",type:"arc"}}),WF=Object.assign(Object.assign({},rL),{pin:{name:"pin",type:"path"},pinBackground:{name:"pinBackground",type:"path"},pointer:{name:"pointer",type:["path","rect"]}}),GF={type:"fadeIn"};class UF extends YC{constructor(){super(...arguments),this._supportStack=!1}}class $F extends UT{updateTooltipSpec(){var t;super.updateTooltipSpec(),D(null===(t=this.spec)||void 0===t?void 0:t.dimension)&&(this.spec=Object.assign(Object.assign({},this.spec),{dimension:{visible:!1}}))}}class XF extends OF{constructor(){super(...arguments),this.type=_l.gaugePointer,this.transformerConstructor=UF,this._pinMark=null,this._pointerMark=null,this._pinBackgroundMark=null}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setRadiusField(this._spec.radiusField),this._pointerType="rect"===(null===(t=this._spec.pointer)||void 0===t?void 0:t.type)?"rect":"path"}initMark(){this._pinBackgroundMark=this._createMark(XF.mark.pinBackground),this._pointerMark=this._createMark(Object.assign(Object.assign({},XF.mark.pointer),{type:this._pointerType}),{isSeriesMark:!0}),this._pinMark=this._createMark(XF.mark.pin)}initMarkStyle(){this.initPinBackgroundMarkStyle(),this.initPointerMarkStyle(),this.initPinMarkStyle()}initGroups(){}initPointerMarkStyle(){const t=this._pointerMark,e=this._spec.pointer;t&&(this.setMarkStyle(t,{x:t=>{var i,s;const{x:n}=this._getPointerAnchor(t,e);return n-this._getPointerWidth()*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[0])&&void 0!==s?s:0)},y:t=>{var i,s;const{y:n}=this._getPointerAnchor(t,e);return n-this._getPointerHeight(t)*(null!==(s=null===(i=null==e?void 0:e.center)||void 0===i?void 0:i[1])&&void 0!==s?s:0)},anchor:t=>{const{x:i,y:s}=this._getPointerAnchor(t,e);return[i,s]},fill:this.getColorAttribute(),zIndex:200}),"path"===this._pointerType?this.setMarkStyle(t,{scaleX:this._getPointerWidth.bind(this),scaleY:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)+Math.PI/2}):this.setMarkStyle(t,{width:this._getPointerWidth.bind(this),height:this._getPointerHeight.bind(this),angle:t=>this._getPointerAngle(t)-Math.PI/2}))}initTooltip(){this._tooltipHelper=new $F(this),this._pointerMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._pointerMark)}_getPointerAnchor(t,e){var i;return null===(i=e.isOnCenter)||void 0===i||i?this.angleAxisHelper.center():this.radiusAxisHelper.coordToPoint({radius:this._innerRadius*this._computeLayoutRadius(),angle:this.angleAxisHelper.dataToPosition([t[this._angleField[0]]])})}_getPointerWidth(){return this._spec.pointer.width*this._computeLayoutRadius()}_getPointerHeight(t){var e,i;const s=this._spec.pointer,n=this._radiusField[0];return M(this.radiusAxisHelper)&&M(n)?this.radiusAxisHelper.dataToPosition([t[n]])-(null!==(e=null==s?void 0:s.innerPadding)&&void 0!==e?e:0)-(null!==(i=null==s?void 0:s.outerPadding)&&void 0!==i?i:10):s.height*this._computeLayoutRadius()}_getPointerAngle(t){const e=this.angleAxisHelper.getScale().domain(),i=Ya(e),s=ja(e),n=Ps(t[this._angleField[0]],s,i);return this.angleAxisHelper.dataToPosition([n])}_getRotatedPointerCenterOffset(t){var e,i,s,n;const r=this._spec.pointer,a=this._getPointerWidth()*(null!==(i=null===(e=null==r?void 0:r.center)||void 0===e?void 0:e[0])&&void 0!==i?i:0),o=-this._getPointerHeight(t)*(null!==(n=null===(s=null==r?void 0:r.center)||void 0===s?void 0:s[1])&&void 0!==n?n:0),l=this._getPointerAngle(t)-Math.PI/2,h=Math.cos(l),d=Math.sin(l);return{x:a*h+o*d,y:-(o*h-a*d)}}initPinBackgroundMarkStyle(){const t=this._pinBackgroundMark,e=this._spec.pinBackground;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:100})}initPinMarkStyle(){const t=this._pinMark,e=this._spec.pin;t&&this.setMarkStyle(t,{x:t=>this._getPointerAnchor(t,e).x,y:t=>this._getPointerAnchor(t,e).y,scaleX:()=>e.width*this._computeLayoutRadius(),scaleY:()=>e.height*this._computeLayoutRadius(),fill:this.getColorAttribute(),zIndex:300})}initInteraction(){this._parseInteractionConfig(this._pointerMark?[this._pointerMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._pointerMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("gaugePointer"))||void 0===i?void 0:i({startAngle:this._startAngle},s),DC("pointer",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}XF.type=_l.gaugePointer,XF.mark=WF,XF.transformerConstructor=UF;const KF=()=>{$l.registerSeries(XF.type,XF),HI(),DO(),$l.registerAnimation("gaugePointer",((t,e)=>{const i=function(t,e){return"fadeIn"===e?GF:(t=>({channel:{angle:{from:t.startAngle+Math.PI/2}}}))(t)}(t,e);return{appear:i,enter:i,disappear:{type:"fadeOut"}}})),UB(),XB()};class qF extends YC{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"segment")}}class ZF extends OF{constructor(){super(...arguments),this.type=_l.gauge,this.transformerConstructor=qF,this._segmentMark=null,this._trackMark=null,this._padAngle=0}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._padAngle=At(null!==(t=this._spec.padAngle)&&void 0!==t?t:0)}initData(){var t;super.initData(),Lp(this._option.dataSet,"spiltSegment",((t,e)=>{const i=t.slice();return i.sort(((t,e)=>t[this._angleField[0]]-e[this._angleField[0]])),i.forEach(((t,e)=>{t[RT]=t[this._angleField[0]],t[OT]=e>0?i[e-1][RT]:void 0})),i})),null===(t=this.getViewData())||void 0===t||t.transform({type:"spiltSegment"},!1)}initMark(){super.initMark(),this._trackMark=this._createMark(ZF.mark.track,{parent:this._arcGroupMark,dataView:!1}),this._segmentMark=this._createMark(ZF.mark.segment,{parent:this._arcGroupMark,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle(),this.initTrackMarkStyle(),this.initSegmentMarkStyle()}initSegmentMarkStyle(){var t;const e=this._segmentMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._getAngleValueStart.bind(this),endAngle:this._getAngleValueEnd.bind(this),innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute(),zIndex:200,forceShowCap:!0})}initTooltip(){super.initTooltip(),this._segmentMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._segmentMark)}initTrackMarkStyle(){var t;const e=this._trackMark;e&&this.setMarkStyle(e,{x:()=>this.angleAxisHelper.center().x,y:()=>this.angleAxisHelper.center().y,startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:()=>{var t;return this._computeLayoutRadius()*(null!==(t=this._spec.innerRadius)&&void 0!==t?t:0)},outerRadius:()=>{var t,e;return this._computeLayoutRadius()*(null!==(e=null!==(t=this._spec.radius)&&void 0!==t?t:this._spec.outerRadius)&&void 0!==e?e:1)},cap:null!==(t=this._spec.roundCap)&&void 0!==t&&t,boundsMode:"imprecise",cornerRadius:this._spec.cornerRadius,zIndex:100})}_getAngleValueStartWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Xb(e,(e+i)/2)(e+(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueEndWithoutMask(t){const e=this._getAngleValueStartWithoutPadAngle(t),i=this._getAngleValueEndWithoutPadAngle(t);return Xb(i,(e+i)/2)(i-(i>e?1:-1)*Math.abs(this._padAngle/2))}_getAngleValueStartWithoutPadAngle(t){return M(t[OT])?this.angleAxisHelper.dataToPosition([t[OT]]):this._startAngle}_getAngleValueEndWithoutPadAngle(t){return this.angleAxisHelper.dataToPosition([t[RT]])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._segmentMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("circularProgress"))||void 0===i?void 0:i({startAngle:this._startAngle},s),DC("segment",this._spec,this._markAttributeContext)))}getDefaultShapeType(){return"circle"}getActiveMarks(){return[]}}ZF.type=_l.gauge,ZF.mark=VF,ZF.transformerConstructor=qF;class JF extends HF{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{radiusField:t.radiusField,pin:t.pin,pinBackground:t.pinBackground,pointer:t.pointer})}_getDefaultCircularProgressSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{type:_l.circularProgress})}transformSpec(t){var e,i,s,n,r;super.transformSpec(t);let a=null===(e=t.series)||void 0===e?void 0:e.find((t=>t.type===_l.gauge||t.type===_l.circularProgress));D(a)&&(a=null!==(i=t.gauge)&&void 0!==i?i:this._getDefaultCircularProgressSeriesSpec(t),"circularProgress"===a.type&&(D(a.radiusField)&&D(a.categoryField)&&(a.radiusField=null!==(n=null!==(s=t.radiusField)&&void 0!==s?s:t.categoryField)&&void 0!==n?n:t.seriesField),D(a.valueField)&&D(a.angleField)&&(a.valueField=null!==(r=t.valueField)&&void 0!==r?r:t.angleField)),1===t.series.length?t.series.push(a):t.series.forEach((t=>{t.type===a.type&&Object.keys(a).forEach((e=>{e in t||(t[e]=a[e])}))}))),a.type===_l.circularProgress?this._transformProgressAxisSpec(t,{orient:"angle",visible:!0,domainLine:{visible:!1},grid:{visible:!1}},{orient:"radius",visible:!1},{zIndex:Ey.Region+50}):this._transformGaugeAxisSpec(t)}_transformGaugeAxisSpec(t){var e;t.axes||(t.axes=[]);const i={radius:null,angle:null};(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"radius"===e&&(i.radius=t),"angle"===e&&(i.angle=t)})),i.angle||(i.angle={orient:"angle",visible:!0},t.axes.push(i.angle)),i.radius||(i.radius={orient:"radius",visible:!1},t.axes.push(i.radius)),D(i.angle.type)&&(i.angle.type="linear"),D(i.radius.type)&&(i.radius.type="linear"),D(i.angle.zIndex)&&(i.angle.zIndex=Ey.Region+50)}}class QF extends cO{constructor(){super(...arguments),this.transformerConstructor=JF,this.type="gauge",this.seriesType=_l.gaugePointer}}QF.type="gauge",QF.seriesType=_l.gaugePointer,QF.transformerConstructor=JF;class tY extends rO{transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class eY extends cO{constructor(){super(...arguments),this.transformerConstructor=tY,this.type="wordCloud",this.seriesType=_l.wordCloud}}eY.transformerConstructor=tY;const iY=[0],sY=[20,40],nY=[200,500],rY={shrink:!1,enlarge:!1,fontSizeLimitMin:0},aY=["triangleForward","triangle","diamond","square","star","cardioid","circle","pentagon","rect"],oY=`${sh}_WORD_CLOUD_TEXT`,lY=Object.assign(Object.assign({},rL),{word:{name:"word",type:"text"},fillingWord:{name:"fillingWord",type:"text"},wordMask:{name:"wordMask",type:"rect"}});class hY extends jC{constructor(){super(...arguments),this._fontSizeRange=[20,20],this._isWordCloudShape=!1,this._dataChange=!0,this.handleMaskCanvasUpdate=(t,e)=>{this._maskCanvas=t},this.getWordColor=t=>t.isFillingWord?(this._fillingColorCallback&&!this._dataChange||(this._fillingColorCallback=this._wordCloudShapeConfig.fillingColorHexField?t=>t[this._wordCloudShapeConfig.fillingColorHexField]:this.initColorCallback(this._wordCloudShapeConfig.fillingSeriesField,!0)),this._fillingColorCallback(t)):(this._keyWordColorCallback&&!this._dataChange||(this._keyWordColorCallback=this._spec.colorHexField?t=>t[this._spec.colorHexField]:this.initColorCallback(this._seriesField,!1)),this._keyWordColorCallback(t)),this._calculateFontWeight=t=>{const e=this.getRawDataStatisticsByField(this._valueField,!0);return e.min===e.max?this._fontWeightRange[0]:this._fontWeightRange[0]+(this._fontWeightRange[this._fontWeightRange.length-1]-this._fontWeightRange[0])*(t[this._valueField]-e.min)/(e.max-e.min)}}setValueField(t){M(t)&&(this._valueField=t)}setFontSizeRange(t){M(t)?this._fontSizeRange=t:this._fontSizeRange=sY}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec(),this._padding=this._option.getChart().padding,this._nameField=this._spec.nameField,this._colorMode=null!==(t=this._spec.colorMode)&&void 0!==t?t:"ordinal",this._colorList=this._spec.colorList,this.setValueField(this._spec.valueField),this._fontWeightRange=null!==(e=this._spec.fontWeightRange)&&void 0!==e?e:nY,this._rotateAngles=null!==(i=this._spec.rotateAngles)&&void 0!==i?i:iY,this.setFontSizeRange(this._spec.fontSizeRange),this._maskShape=null!==(s=this._spec.maskShape)&&void 0!==s?s:"circle",this._textField=(null===(n=this._spec.word)||void 0===n?void 0:n.formatMethod)?oY:this._nameField;const r=this._spec.wordCloudConfig;this._wordCloudConfig=Object.assign({drawOutOfBound:"hidden",layoutMode:"default",zoomToFit:rY},this._spec.wordCloudConfig),r&&!D(r.layoutMode)||dl(this._option.mode)||(this._wordCloudConfig.layoutMode="fast"),this._wordCloudShapeConfig=Object.assign({fillingSeriesField:this.getSeriesField(),fillingRotateAngles:iY,layoutMode:"default"},this._spec.wordCloudShapeConfig),this._isWordCloudShape=!aY.includes(this._maskShape)&&!["fast","grid","cloud"].includes(this._wordCloudConfig.layoutMode),this._defaultFontFamily=this._option.getTheme().fontFamily}initData(){var t,e;super.initData(),null===(e=null===(t=this.getViewData())||void 0===t?void 0:t.target)||void 0===e||e.addListener("change",(()=>{this._dataChange=!0,this.compile()}))}initMark(){var t;(null===(t=this._spec.wordMask)||void 0===t?void 0:t.visible)&&(this._maskMark=this._createMark(hY.mark.wordMask,{dataView:!1})),this._wordMark=this._createMark(hY.mark.word,{key:yT,defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0})}initMarkStyle(){this.initMarkStyleOfWord(this._wordMark,this._spec.word,this._spec.colorHexField,this._seriesField),this._maskMark&&this.setMarkStyle(this._maskMark,{width:()=>this._region.getLayoutRect().width,height:()=>this._region.getLayoutRect().height,background:()=>this._maskCanvas},"normal",Py.Series)}initMarkStyleOfWord(t,e,i,s,n){var r,a;t&&(this.setMarkStyle(t,{text:(null==e?void 0:e.formatMethod)?t=>e.formatMethod(t):t=>t[this._textField],x:t=>t.x,y:t=>t.y,fontSize:t=>t.fontSize,fontStyle:t=>t.fontStyle,angle:t=>t.angle,visible:t=>t.visible},"normal",Py.Series),this.setMarkStyle(t,{fill:null!==(a=null===(r=null==e?void 0:e.style)||void 0===r?void 0:r.fill)&&void 0!==a?a:this.getWordColor,fontWeight:t=>t.fontWeight,fontFamily:t=>t.fontFamily},"normal",Py.User_Mark))}initTooltip(){super.initTooltip(),this._wordMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._wordMark)}initAnimation(){[this._wordMark].forEach((t=>{var e,i;if(t){const s=null===(i=null===(e=this._spec)||void 0===e?void 0:e.animationAppear)||void 0===i?void 0:i.preset,n={animationConfig:()=>{var e,i;return null===(i=null===(e=t.getAnimationConfig())||void 0===e?void 0:e.appear)||void 0===i?void 0:i[0]}};t.setAnimationConfig(EC($l.getAnimationInKey("wordCloud")(n,s),DC("word",this._spec,this._markAttributeContext)))}}))}getWordOrdinalColorScale(t,e){var i,s,n,r,a;const o=e?this._wordCloudShapeConfig.fillingColorList:this._colorList,l=t?null===(i=this.getViewData())||void 0===i?void 0:i.latestData.map((e=>e[t])):[],h=null!==(n=null!=o?o:null===(s=this._option.globalScale.getScale("color"))||void 0===s?void 0:s.range())&&void 0!==n?n:this._getDataScheme();return null===(a=(r=(new sx).domain(l)).range)||void 0===a?void 0:a.call(r,h)}initColorCallback(t,e){var i,s,n,r;if("ordinal"===this._colorMode){const i=this.getWordOrdinalColorScale(t,e);return e=>i.scale(e[null!=t?t:bT])}const a=null!==(i=e?this._colorList:this._wordCloudShapeConfig.fillingColorList)&&void 0!==i?i:this._option.globalScale.getScale("color").range();if(1===a.length)return t=>a[0];if(this._valueField){const t=this.getRawDataStatisticsByField(this._valueField,!0);if(t.min===t.max)return a[0];const e=(new qb).domain([t.min,t.max]).range(a);return t=>e.scale(t[this._valueField])}const o=(new qb).domain([0,null!==(r=null===(n=null===(s=this.getViewData())||void 0===s?void 0:s.latestData)||void 0===n?void 0:n.length)&&void 0!==r?r:1]).range(a);return t=>o.scale(t[vT])}compile(){super.compile();const{width:t,height:e}=this._region.getLayoutRect();if(!qo(t)||!qo(e)||!(e>0&&t>0))return;const i=[];this._isWordCloudShape?i.push(Object.assign({type:"wordcloudShape"},this._wordCloudShapeTransformOption())):i.push(Object.assign({type:"wordcloud"},this._wordCloudTransformOption())),this._wordMark.getProduct().transform(i)}_getCommonTransformOptions(){var t,e,i,s,n,r;const{width:a,height:o}=this._region.getLayoutRect(),l=null!==(t=this._spec.word)&&void 0!==t?t:{},h=null!==(e=l.style)&&void 0!==e?e:{};return{size:[a,o],shape:vs(this._maskShape)&&"text"===this._maskShape.type&&D(this._maskShape.fontFamily)?Object.assign({fontFamily:null===(i=this._option.getTheme())||void 0===i?void 0:i.fontFamily},this._maskShape):this._maskShape,onUpdateMaskCanvas:this.handleMaskCanvasUpdate,dataIndexKey:yT,text:l.formatMethod?t=>l.formatMethod(t):{field:this._textField},fontSize:this._valueField?{field:this._valueField}:this._fontSizeRange[0],fontSizeRange:"auto"===this._fontSizeRange?null:this._fontSizeRange,padding:null!==(n=null===(s=this._spec.word)||void 0===s?void 0:s.padding)&&void 0!==n?n:1,fontFamily:M(this._spec.fontFamilyField)?{field:this._spec.fontFamilyField}:null!==(r=h.fontFamily)&&void 0!==r?r:this._defaultFontFamily,fontWeight:M(this._spec.fontWeightField)?{field:this._spec.fontWeightField}:M(h.fontWeight)?h.fontWeight:M(this._valueField)?this._calculateFontWeight:"normal",fontStyle:M(this._spec.fontStyleField)?{field:this._spec.fontStyleField}:h.fontStyle}}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},this._getCommonTransformOptions()),{layoutType:this._wordCloudConfig.layoutMode,rotate:this._rotateAngles,randomVisible:null===(t=this._spec.random)||void 0===t||t,clip:"clip"===this._wordCloudConfig.drawOutOfBound,shrink:this._wordCloudConfig.zoomToFit.shrink,enlarge:this._wordCloudConfig.zoomToFit.enlarge,minFontSize:this._wordCloudConfig.zoomToFit.fontSizeLimitMin,progressiveTime:this._wordCloudConfig.progressiveTime,progressiveStep:this._wordCloudConfig.progressiveStep,repeatFill:this._wordCloudConfig.zoomToFit.repeat})}_wordCloudShapeTransformOption(){var t,e,i,s,n,r;const a=null!==(e=null===(t=this._spec.fillingWord)||void 0===t?void 0:t.style)&&void 0!==e?e:{},o=null!==(i=this._wordCloudShapeConfig)&&void 0!==i?i:{};return Object.assign(Object.assign(Object.assign({},o),this._getCommonTransformOptions()),{rotateList:this._rotateAngles,fillingRotateList:o.fillingRotateAngles,fillingFontFamily:M(o.fillingFontFamilyField)?{field:o.fillingFontFamilyField}:null!==(s=a.fontFamily)&&void 0!==s?s:this._defaultFontFamily,fillingPadding:null!==(r=null===(n=this._spec.fillingWord)||void 0===n?void 0:n.padding)&&void 0!==r?r:1,fillingFontStyle:M(o.fillingFontStyleField)?{field:o.fillingFontStyleField}:a.fontStyle,fillingFontWeight:M(o.fillingFontWeightField)?{field:o.fillingFontWeightField}:a.fontWeight})}getStatisticFields(){const t=[];return t.push({key:this._nameField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}dataToPosition(t){return null}dataToPositionX(t){return null}dataToPositionY(t){return null}dataToPositionZ(t){return null}valueToPosition(t,e){return null}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}onLayoutEnd(t){super.onLayoutEnd(t),this.compile(),this._dataChange=!1}getActiveMarks(){return[this._wordMark]}reInit(){super.reInit(),this._keyWordColorCallback&&(this._keyWordColorCallback=null),this._fillingColorCallback&&(this._fillingColorCallback=null)}}hY.mark=lY;const dY=t=>({custom:bA,customParameters:(e,i)=>t,easing:"linear",loop:1/0,duration:6e3});function cY(t,e){return!1===e?{}:"fadeIn"===e?{type:"fadeIn"}:(t=>({channel:{fontSize:{from:0}},duration:200,delay:(e,i,s)=>{const n=t.animationConfig(),r=(null==n?void 0:n.duration)||200,a=(null==n?void 0:n.totalTime)||vC.appear.duration,o=s.VGRAMMAR_ANIMATION_PARAMETERS.elementCount;return s.VGRAMMAR_ANIMATION_PARAMETERS.elementIndex*function(t,e,i){return t*i{$l.registerAnimation("wordCloud",((t,e)=>({appear:cY(t,e),enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}})))},pY=()=>{$l.registerAnimation("wordCloud3d",(t=>({appear:dY(t)})))},gY={triangleForward:function(){return function(t){const e=t%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}},triangleUpright:mY,triangle:mY,diamond:function(){return function(t){const e=t%(2*Math.PI/4);return 1/(Math.cos(e)+Math.sin(e))}},square:function(){return function(t){return Math.min(1/Math.abs(Math.cos(t)),1/Math.abs(Math.sin(t)))}},star:function(){return function(t){const e=(t+.955)%(2*Math.PI/10);return(t+.955)%(2*Math.PI/5)-2*Math.PI/10>=0?1/(Math.cos(2*Math.PI/10-e)+3.07768*Math.sin(2*Math.PI/10-e)):1/(Math.cos(e)+3.07768*Math.sin(e))}},cardioid:function(){return function(t){return 1+Math.sin(t)}},circle:function(){return function(){return 1}},pentagon:function(){return function(t){const e=(t+.955)%(2*Math.PI/5);return 1/(Math.cos(e)+.726543*Math.sin(e))}}};function mY(){return function(t){const e=(t+3*Math.PI/2)%(2*Math.PI/3);return 1/(Math.cos(e)+Math.sqrt(3)*Math.sin(e))}}function _Y(t,e){const i=e[0],s=e[1];let n=1;const r=[e[0]>>1,e[1]>>1];switch(t){case"cardioid":r[1]=~~(s/2.7*.4),n=Math.floor(Math.min(i/2.3,s/2.6));break;case"triangleForward":n=s/Math.sqrt(.75)>i?Math.floor(i/2):Math.floor(s/(2*Math.sqrt(.75)));break;case"triangle":case"triangleUpright":r[1]=~~(s/1.5),n=Math.floor(Math.min(s/1.5,i/2));break;case"circle":case"diamond":case"square":case"star":case"pentagon":n=Math.floor(Math.min(i/2,s/2));break;default:n=Math.floor(Math.max(i/2,s/2))}return{maxRadius:n,center:r}}const fY=t=>gY[t]?gY[t]():gY.circle();function vY(t){return parseFloat("0."+Math.sin(t).toString().substring(6))}const yY=(t,e)=>"hsl("+(360*Math.random()).toFixed()+","+(30*Math.random()+70).toFixed()+"%,"+(Math.random()*(e-t)+t).toFixed()+"%)";function bY(t){return ys(t)?t:function(){return t}}class xY{constructor(t){var e,i;switch(this.options=E({},xY.defaultOptions,t),ys(this.options.shape)?this.shape=this.options.shape:this.shape=fY(this.options.shape),this.getText=null!==(e=bY(this.options.text))&&void 0!==e?e:t=>t,this.getTextFontWeight=bY(this.options.fontWeight),this.getTextFontSize=bY(this.options.fontSize),this.getTextFontStyle=bY(this.options.fontStyle),this.getTextFontFamily=bY(this.options.fontFamily),this.outputCallback=null!==(i=this.options.outputCallback)&&void 0!==i?i:t=>t,this.options.color){case"random-dark":this.getTextColor=()=>yY(10,50);break;case"random-light":this.getTextColor=()=>yY(50,90);break;default:this.getTextColor=bY(this.options.color)}if(D(this.options.rotate))if(this.options.useRandomRotate){const t=Math.abs(this.options.maxRotation-this.options.minRotation),e=Math.abs(Math.floor(this.options.rotationSteps)),i=Math.min(this.options.maxRotation,this.options.minRotation);this.getTextRotate=()=>0===this.options.rotateRatio||Math.random()>this.options.rotateRatio?0:0===t?i:e>0?i+Math.floor(Math.random()*e)*t/(e-1):i+Math.random()*t}else this.getTextRotate=()=>0;else this.getTextRotate=ys(this.options.rotate)?t=>{var e;return At(null!==(e=this.options.rotate(t))&&void 0!==e?e:0)}:(t,e)=>{const i=Ba(this.options.rotate),s=this.options.random?Math.random():vY(e);return At(i[Math.floor(s*i.length)])}}canRepeat(){return!1}exceedTime(){var t;return this.options.progressiveStep>0?this.progressiveIndex>=((null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1)*this.options.progressiveStep:this.options.progressiveTime>0&&(new Date).getTime()-this.escapeTime>this.options.progressiveTime}progressiveRun(){var t;if(this.options.progressiveStep>0?this.currentStepIndex=(null!==(t=this.currentStepIndex)&&void 0!==t?t:-1)+1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.data&&this.progressiveIndexi)&&(t++,e=0,this.failCount=n?0:this.failCount+1),this.progressiveIndex=t,this.exceedTime())break;t===this.data.length&&this.failCountObject.assign(Object.assign({},t),{isFill:!0})))],this.isTryRepeatFill=!0)}return this.progressiveResult}return this.result}initProgressive(){this.failCount=0,this.progressiveIndex=0,this.options.progressiveStep>0?this.currentStepIndex=-1:this.options.progressiveTime>0&&(this.escapeTime=Date.now()),this.progressiveResult=[]}output(){return this.result?this.outputCallback(this.result):null}progressiveOutput(){return this.progressiveResult?this.outputCallback(this.progressiveResult):null}unfinished(){return this.data&&this.data.length&&!D(this.progressiveIndex)&&this.progressiveIndex[e*(t*=.1)*Math.cos(t),t*Math.sin(t)]},rectangular:function(t){const e=4*t[0]/t[1];let i=0,s=0;return t=>{const n=t<0?-1:1;switch(Math.sqrt(1+4*n*t)-n&3){case 0:i+=e;break;case 1:s+=4;break;case 2:i-=e;break;default:s-=4}return[i,s]}}};class MY extends xY{constructor(t){var e;super(E({},MY.defaultOptions,t)),this.cw=64,this.ch=2048,this._size=[256,256],this._isBoardExpandCompleted=!1,this._placeStatus=0,this._tTemp=null,this._dtTemp=null,this._dy=0,this.cacheMap=new Map,this.options.minFontSize<=MY.defaultOptions.minFontSize&&(this.options.minFontSize=MY.defaultOptions.minFontSize),this.spiral=S(this.options.spiral)?null!==(e=SY[this.options.spiral])&&void 0!==e?e:SY.archimedean:this.options.spiral,this.random=this.options.random?Math.random:()=>1,this.getTextPadding=bY(this.options.padding)}zoomRatio(){return this._originSize[0]/this._size[0]}dy(){return this._dy}layoutWord(t){const e=this.data[t];if(""===(""+e.text).trim())return!0;const{maxRadius:i,center:s}=_Y(this.options.shape,this._size);if(e.x=s[0],e.y=s[1],function(t,e,i,s,n,r){if(e.sprite)return;const a=t.context,o=t.ratio;a.setTransform(o,0,0,o,0,0),a.clearRect(0,0,(n<<5)/o,r/o);let l=0,h=0,d=0;const c=i.length;let u,p,g,m,_;for(--s;++s>5<<5,g=~~Math.max(Math.abs(n+r),Math.abs(n-r))}else u=u+31>>5<<5;if(g>d&&(d=g),l+u>=n<<5&&(l=0,h+=d,d=0),h+g>=r)break;a.translate((l+(u>>1))/o,(h+(g>>1))/o),e.angle&&a.rotate(e.angle),a.fillText(e.text,0,0),e.padding&&(a.lineWidth=2*e.padding,a.strokeText(e.text,0,0)),a.restore(),e.width=u,e.height=g,e.xoff=l,e.yoff=h,e.x1=u>>1,e.y1=g>>1,e.x0=-e.x1,e.y0=-e.y1,e.hasText=!0,l+=u}const f=a.getImageData(0,0,(n<<5)/o,r/o).data,v=[];for(;--s>=0;){if(!(e=i[s]).hasText)continue;for(u=e.width,p=u>>5,g=e.y1-e.y0,m=0;m>5),i=f[(h+_)*(n<<5)+(l+m)<<2]?1<<31-m%32:0;v[e]|=i,t|=i}t?r=_:(e.y0++,g--,_--,h++)}e.y1=e.y0+r,e.sprite=v.slice(0,(e.y1-e.y0)*p)}}(this.contextAndRatio,e,this.data,t,this.cw,this.ch),this._placeStatus=0,e.hasText&&this.place(this._board,e,this._bounds,i))return this.result.push(e),this._bounds?function(t,e){const i=t[0],s=t[1];e.x+e.x0s.x&&(s.x=e.x+e.x1),e.y+e.y1>s.y&&(s.y=e.y+e.y1)}(this._bounds,e):this._bounds=[{x:e.x+e.x0,y:e.y+e.y0},{x:e.x+e.x1,y:e.y+e.y1}],e.x-=this._size[0]>>1,e.y-=this._size[1]>>1,this._tTemp=null,this._dtTemp=null,!0;if(this.updateBoardExpandStatus(e.fontSize),e.hasText&&this.shouldShrinkContinue()){if(1===this._placeStatus){const t=e.fontSize*this._originSize[0]/this.options.minFontSize,i=Math.max(e.width,e.height);if(i<=t)this.expandBoard(this._board,this._bounds,i/this._size[0]);else{if(!this.options.clip)return!0;this.expandBoard(this._board,this._bounds,t/this._size[0])}}else this._placeStatus,this.expandBoard(this._board,this._bounds);return this.updateBoardExpandStatus(e.fontSize),!1}return this._tTemp=null,this._dtTemp=null,!0}layout(t,e){this.initProgressive(),this.result=[],this._size=[e.width,e.height],this.clearCache(),this._originSize=[...this._size];const i=this.getContext(zo.createCanvas({width:1,height:1}));this.contextAndRatio=i,this._board=new Array((this._size[0]>>5)*this._size[1]).fill(0),this._bounds=null,t.length,this.result=[];const s=t.map(((t,e)=>({text:this.getText(t),fontFamily:this.getTextFontFamily(t),fontStyle:this.getTextFontStyle(t),fontWeight:this.getTextFontWeight(t),angle:this.getTextRotate(t,e),fontSize:~~this.getTextFontSize(t),padding:this.getTextPadding(t),xoff:0,yoff:0,x1:0,y1:0,x0:0,y0:0,hasText:!1,sprite:null,datum:t,x:0,y:0,width:0,height:0}))).sort((function(t,e){return e.fontSize-t.fontSize}));if(this.originalData=s,this.data=s,this.progressiveRun(),!this.options.clip&&this.options.enlarge&&this._bounds&&this.shrinkBoard(this._bounds),this._bounds&&["cardioid","triangle","triangle-upright"].includes(this.options.shape)){const t=(this._bounds[0].y+this._bounds[1].y)/2;this._dy=-(t-this._size[1]/2)}return this.result}formatTagItem(t){const e=this._size,i=this.zoomRatio(),s=this.dy(),n=e[0]>>1,r=e[1]>>1,a=t.length,o=[];let l,h;for(let e=0;e=this._size[0]||i.y>=this._size[1])return;const s=Math.min(e.x,this._size[0]-i.x),n=Math.min(e.y,this._size[1]-i.y),r=2*Math.min(s/this._size[0],n/this._size[1]);this._size=this._size.map((t=>t*(1-r)))}expandBoard(t,e,i){const s=this._size[0]*(i||1.1)-this._size[0]>>5;let n=2*s>2?s:2;n%2!=0&&n++;let r=Math.ceil(this._size[1]*(n<<5)/this._size[0]);r%2!=0&&r++;const a=this._size[0],o=this._size[1],l=new Array(n).fill(0),h=new Array(r/2*(n+(a>>5))).fill(0);this.insertZerosToArray(t,o*(a>>5),h.length+n/2);for(let e=o-1;e>0;e--)this.insertZerosToArray(t,e*(a>>5),l.length);this.insertZerosToArray(t,0,h.length+n/2),this._size=[a+(n<<5),o+r],e&&(e[0].x+=(n<<5)/2,e[0].y+=r/2,e[1].x+=(n<<5)/2,e[1].y+=r/2)}insertZerosToArray(t,e,i){const s=Math.floor(i/6e4),n=i%6e4;for(let i=0;i>2);t.width=(this.cw<<5)/i,t.height=this.ch/i;const s=t.getContext("2d");return s.fillStyle=s.strokeStyle="red",s.textAlign="center",{context:s,ratio:i,canvas:t}}place(t,e,i,s){let n=!1;if(this.shouldShrinkContinue()&&(e.width>this._size[0]||e.height>this._size[1]))return this._placeStatus=1,!1;const r=this.random()<.5?1:-1;if(!this.shouldShrinkContinue()&&this.isSizeLargerThanMax(e,r))return null;const a=e.x,o=e.y,l=Math.sqrt(this._size[0]*this._size[0]+this._size[1]*this._size[1]),h=this.spiral(this._size);let d,c,u,p,g=-r;for(this._tTemp=null,this._dtTemp=null;d=h(g+=r);){c=d[0],u=d[1];const h=Math.sqrt(c**2+u**2);let f=Math.atan(u/c);c<0?f+=Math.PI:u<0&&(f=2*Math.PI+f);const v=this.shape(f);if(Math.min(Math.abs(c),Math.abs(u))>=l)break;if(h>=s)n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);else{if(e.x=a+~~(h*v*Math.cos(-f)),e.y=o+~~(h*v*Math.sin(-f)),p=e,this.options.clip)if(this.shouldShrinkContinue()){if(wY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}}else{if(AY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}wY(p,this._size)&&(p=TY(p,this._size))}else if(wY(p,this._size)){n&&null===this._tTemp&&(this._tTemp=g,this._dtTemp=r);continue}if(n=!0,!(i&&(m=p,_=i,!(m.x+m.x1>_[0].x&&m.x+m.x0<_[1].x&&m.y+m.y1>_[0].y&&m.y+m.y0<_[1].y))||i&&kY(p,t,this._size))){const i=p.sprite,s=p.width>>5,n=this._size[0]>>5,r=p.x-(s<<4),a=127&r,o=32-a,l=p.y1-p.y0;let h,d=(p.y+p.y0)*n+(r>>5);for(let e=0;e>>a:0);d+=n}return e.sprite=null,p.sprite=null,!0}}}var m,_;return null!==this._tTemp&&(this._placeStatus=3),!this.shouldShrinkContinue()&&this.setCache(p,r),!1}clearCache(){this.cacheMap.clear()}setCache(t,e){const i=`${t.angle}-${e}`,s=t.x1-t.x0,n=t.y1-t.y0;if(!this.cacheMap.has(i))return void this.cacheMap.set(i,{width:s,height:n});const{width:r,height:a}=this.cacheMap.get(i);(s=s&&a>=n}}function kY(t,e,i){const s=i[0]>>5,n=t.sprite,r=t.width>>5,a=t.x-(r<<4),o=127&a,l=32-o,h=t.y1-t.y0;let d,c=(t.y+t.y0)*s+(a>>5);for(let t=0;t>>o:0))&e[c+i])return!0;c+=s}return!1}MY.defaultOptions={enlarge:!1,minFontSize:2,maxSingleWordTryCount:2};const AY=(t,e)=>t.x+t.x0>e[0]||t.y+t.y0>e[0]||t.x+t.x1<0||t.y+t.y1<0,wY=(t,e)=>t.x+t.x0<0||t.y+t.y0<0||t.x+t.x1>e[0]||t.y+t.y1>e[1];function TY(t,e){const i=t.sprite,s=t.y1-t.y0,n=t.width>>5;let r=0;const a=[],o=Math.max(-(t.y0+t.y),0),l=Math.min(s+(e[1]-(t.y1+t.y)),s),h=Math.max(-(t.x0+t.x),0)>>5,d=Math.min(n+(e[0]-(t.x1+t.x)>>5)+1,n);for(let t=0;t{if(!t||"#fff"===t)return(t,e,i)=>{const s=t.width;return 0===t.data[e*s*4+4*i+3]||255===t.data[e*s*4+4*i+0]&&255===t.data[e*s*4+4*i+1]&&255===t.data[e*s*4+4*i+2]};const e=zo.createCanvas({width:1,height:1}).getContext("2d",{willReadFrequently:!0});e.fillStyle=t,e.fillRect(0,0,1,1);const i=e.getImageData(0,0,1,1).data;return(t,e,s)=>{const n=t.width;return[0,1,2,3].every((r=>t.data[4*(e*n+s)+r]===i[r]))}},CY=(t,e,i,s)=>{const{backgroundColor:n="#fff"}=t,r=s||zo.createCanvas({width:e,height:i,dpr:1}),a=r.getContext("2d",{willReadFrequently:!0});if(s){const t=s.width,n=s.height;a.clearRect(0,0,t,n),s.style.width=`${e}px`,s.style.height=`${i}px`,s.width=e,s.height=i}return a.fillStyle=n,a.fillRect(0,0,r.width,r.height),"text"===t.type?EY(t,r.width,r.height,a):"geometric"===t.type&&OY(t,r.width,r.height,a),r},EY=(t,e,i,s)=>{const{fontFamily:n="sans-serif",fontWeight:r="normal",fontStyle:a="normal",fontVariant:o="normal",fill:l,text:h,hollow:d}=t;let c=12;s.font=`${a} ${o} ${r} ${c}px ${n}`,s.textAlign="center",s.textBaseline="middle",s.fillStyle=null!=l?l:"black";const u=s.measureText(h),p="normal"!==a?1.1:1,g=M(u.actualBoundingBoxRight)&&M(u.actualBoundingBoxLeft)?Math.ceil(p*(Math.abs(u.actualBoundingBoxRight)+Math.abs(u.actualBoundingBoxLeft))):0,m=Math.max(Math.ceil(u.width),g,c);if(d&&(s.globalCompositeOperation="xor"),m>e){const t=Math.min(e/m,i/c);s.fillText(h,e/2,i/2),s.scale(t,t)}else c=Math.floor(c*e/m),c=Math.min(c,i),s.font=`${a} ${o} ${r} ${c}px ${n}`,s.fillText(h,Math.floor(e/2),Math.floor(i/2))},DY=(t,e,i=0,s)=>{const n=2*Math.PI/s;return new Array(s).fill(0).map(((s,r)=>Tt(t,e,i+r*n)))},PY=(t,e)=>{t.beginPath(),e.forEach(((e,i)=>{0===i?t.moveTo(e.x,e.y):t.lineTo(e.x,e.y)})),t.closePath(),t.fill()},OY=(t,e,i,s)=>{const{fill:n,hollow:r}=t,{center:a,maxRadius:o}=_Y(t.shape,[e,i]);s.fillStyle=null!=n?n:"black",r&&(s.globalCompositeOperation="xor");const l=a[0],h=a[1];if("cardioid"===t.shape)((t,e)=>{let i;t.beginPath(),e.forEach(((e,s)=>{0===s?t.moveTo(e.x,e.y):t.bezierCurveTo(e.x,e.y,i.x,i.y,e.x,e.y),i=e})),t.closePath(),t.fill()})(s,((t,e,i=0,s)=>{const n=2*Math.PI/s,r=fY("cardioid");return new Array(s).fill(0).map(((s,a)=>{const o=i+a*n,l=e*r(o);return Tt(t,l,o)}))})({x:l,y:h},o,0,100));else if("circle"===t.shape)s.beginPath(),s.arc(l,h,o,0,2*Math.PI,!0),s.fill();else if("diamond"===t.shape)PY(s,DY({x:l,y:h},o,-Math.PI/2,4));else if("square"===t.shape)PY(s,DY({x:l,y:h},o,-Math.PI/4,4));else if("pentagon"===t.shape)PY(s,DY({x:l,y:h},o,Math.PI/2,5));else if("triangle"===t.shape||"triangleUpright"===t.shape)PY(s,DY({x:l,y:h},o,-Math.PI/2,3));else if("triangleForward"===t.shape)PY(s,DY({x:l,y:h},o,0,3));else if("star"===t.shape){const t=DY({x:l,y:h},o,-Math.PI/2,5),e=DY({x:l,y:h},o/(2*Math.cos(Math.PI/5)),-Math.PI/2+Math.PI/5,5),i=[];for(let s=0;s<5;s++)i.push(t[s]),i.push(e[s]);PY(s,i)}else s.fillRect(0,0,e,i)};class RY extends xY{constructor(t){super(E({},RY.defaultOptions,t)),this.fillGridAt=(t,e)=>{t>=this.ngx||e>=this.ngy||t<0||e<0||(this.grid[t][e]=!1)},this.updateGrid=(t,e,i,s,n)=>{const r=n.occupied;let a=r.length;for(;a--;){const i=t+r[a][0],s=e+r[a][1];i>=this.ngx||s>=this.ngy||i<0||s<0||this.fillGridAt(i,s)}},this.gridSize=Math.max(Math.floor(this.options.gridSize),4)}getPointsAtRadius(t){if(this.pointsAtRadius[t])return this.pointsAtRadius[t];const e=8*t;let i=e;const s=[];for(0===t&&s.push([this.center[0],this.center[1],0]);i--;){const n=this.shape(i/e*2*Math.PI);s.push([this.center[0]+t*n*Math.cos(-i/e*2*Math.PI),this.center[1]+t*n*Math.sin(-i/e*2*Math.PI)*this.options.ellipticity,i/e*2*Math.PI])}return this.pointsAtRadius[t]=s,s}getTextInfo(t,e=1,i){var s;const n=this.options.clip?1:e,r=Math.max(Math.floor((this.isTryRepeatFill?this.options.fillTextFontSize:this.getTextFontSize(t))*n),this.options.minFontSize);let a=this.getText(t)+"";if(this.options.clip&&(a=a.slice(0,Math.ceil(a.length*e))),!a)return null;const o=this.getTextFontWeight(t),l=this.getTextFontStyle(t),h=this.getTextRotate&&null!==(s=this.getTextRotate(t,i))&&void 0!==s?s:0,d=this.getTextFontFamily(t),c=document.createElement("canvas"),u=c.getContext("2d",{willReadFrequently:!0});u.font=l+" "+o+" "+r.toString(10)+"px "+d;const p=u.measureText(a).width,g=Math.max(r,u.measureText("m").width,u.measureText("W").width);let m=p+2*g,_=3*g;const f=Math.ceil(m/this.gridSize),v=Math.ceil(_/this.gridSize);m=f*this.gridSize,_=v*this.gridSize;const y=-p/2,b=.4*-g,x=Math.ceil((m*Math.abs(Math.sin(h))+_*Math.abs(Math.cos(h)))/this.gridSize),S=Math.ceil((m*Math.abs(Math.cos(h))+_*Math.abs(Math.sin(h)))/this.gridSize),M=S*this.gridSize,k=x*this.gridSize;c.setAttribute("width",""+M),c.setAttribute("height",""+k),u.scale(1,1),u.translate(M/2,k/2),u.rotate(-h),u.font=l+" "+o+" "+r.toString(10)+"px "+d,u.fillStyle="#000",u.textBaseline="middle",u.fillText(a,y,b);const A=u.getImageData(0,0,M,k).data;if(this.exceedTime())return null;const w=[];let T,L=S;const C=[x/2,S/2,x/2,S/2],E=(t,e,i)=>{let s=this.gridSize;for(;s--;){let n=this.gridSize;for(;n--;)if(A[4*((e*this.gridSize+s)*M+(t*this.gridSize+n))+3])return i.push([t,e]),tC[1]&&(C[1]=t),eC[2]&&(C[2]=e))}};for(;L--;)for(T=x;T--;)E(L,T,w);return{datum:t,occupied:w,bounds:C,gw:S,gh:x,fillTextOffsetX:y,fillTextOffsetY:b,fillTextWidth:p,fillTextHeight:g,fontSize:r,fontStyle:l,fontWeight:o,fontFamily:d,angle:h,text:a}}calculateEmptyRate(){const t=this.ngx*this.ngy;let e=0;for(let t=0;t=this.ngx||s>=this.ngy||i<0||s<0){if(!this.options.drawOutOfBound)return!1}else if(!this.grid[i][s])return!1}return!0}layoutWord(t,e=1){const i=this.data[t],s=this.getTextInfo(i,e,t);if(!s)return!1;if(this.exceedTime())return!1;if(!this.options.drawOutOfBound&&(!this.options.shrink||s.fontSize<=this.options.minFontSize)&&!this.options.clip){const t=s.bounds;if(t[1]-t[3]+1>this.ngx||t[2]-t[0]+1>this.ngy)return!1}let n=this.maxRadius+1;const r=t=>{const e=Math.floor(t[0]-s.gw/2),i=Math.floor(t[1]-s.gh/2),r=s.gw,a=s.gh;return!!this.canFitText(e,i,r,a,s.occupied)&&(s.distance=this.maxRadius-n,s.theta=t[2],this.outputText(e,i,s),this.updateGrid(e,i,r,a,s),!0)};for(;n--;){let t=this.getPointsAtRadius(this.maxRadius-n);if(this.options.random&&(t=[].concat(t),za(t)),t.some(r))return!0}return(this.options.clip||!!(this.options.shrink&&s.fontSize>this.options.minFontSize))&&this.layoutWord(t,.75*e)}outputText(t,e,i){const s=this.getTextColor(i),n={text:i.text,datum:i.datum,color:s,fontStyle:i.fontStyle,fontWeight:i.fontWeight,fontFamily:i.fontFamily,angle:i.angle,width:i.fillTextWidth,height:i.fillTextHeight,x:(t+i.gw/2)*this.gridSize,y:(e+i.gh/2)*this.gridSize+i.fillTextOffsetY+.5*i.fontSize,fontSize:i.fontSize};this.result.push(n),this.progressiveResult&&this.progressiveResult.push(n)}initGrid(t){this.grid=[];const e=this.options.shape;if(vs(e)){const i=CY(e,t.width,t.height);let s=i.getContext("2d").getImageData(0,0,this.ngx*this.gridSize,this.ngy*this.gridSize);this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i);let n,r=LY(e.backgroundColor);const a=(t,e)=>{let i=this.gridSize;for(;i--;){let a=this.gridSize;for(;a--;)if(n=4,!r(s,e*this.gridSize+i,t*this.gridSize+a))return void(this.grid[t][e]=!0)}this.grid[t][e]=!1};let o=this.ngx;for(;o--;){this.grid[o]=[];let t=this.ngy;for(;t--;)a(o,t),!1!==this.grid[o][t]&&(this.grid[o][t]=!0)}s=r=void 0}else{let t=this.ngx;for(;t--;){this.grid[t]=[];let e=this.ngy;for(;e--;)this.grid[t][e]=!0}}}canRepeat(){return this.calculateEmptyRate()>.001}layout(t,e){this.initProgressive(),this.drawnCount=0,this.isTryRepeatFill=!1,this.originalData=t,this.data=t,this.pointsAtRadius=[],this.ngx=Math.floor(e.width/this.gridSize),this.ngy=Math.floor(e.height/this.gridSize);const{center:i,maxRadius:s}=_Y(this.options.shape,[e.width,e.height]);return this.center=e.origin?[e.origin[0]/this.gridSize,e.origin[1]/this.gridSize]:[i[0]/this.gridSize,i[1]/this.gridSize],this.maxRadius=Math.floor(s/this.gridSize),this.initGrid(e),this.result=[],this.progressiveRun()}}RY.defaultOptions={gridSize:8,ellipticity:1,maxSingleWordTryCount:1};class IY extends xY{constructor(t){super(E({},IY.defaultOptions,t)),this.random=this.options.random?Math.random:()=>0,this.aspectRatio=1}fit(t){for(let s=0,n=this.result.length;si.left+i.width||e.top>i.top+i.height))return!1;var e,i;return!0}getTextInfo(t,e){const i={datum:t,fontSize:this.getTextFontSize(t),fontWeight:this.getTextFontWeight(t),fontStyle:this.getTextFontStyle(t),fontFamily:this.getTextFontFamily(t),angle:this.getTextRotate(t,e),text:this.getText(t)+"",x:this.center[0],y:this.center[1]},s=y_(i);return i.width=s.width(),i.height=s.height(),i.top=this.center[1]-i.height+.21*i.height,i.left=this.center[0]-i.width/2,i}layoutWord(t){const e=this.getTextInfo(this.data[t],t);let i=2*Math.PI,s=0,n=e.left,r=e.top;const a=e.width,o=e.height;let l=1,h=this.fit(e);for(;!h&&s.5?1:-1:t%2==0?1:-1),n=this.center[0]-a/2+s*l*Math.cos(i)*this.aspectRatio,r=this.center[1]-o/2+s*l*Math.sin(i),e.left=n,e.top=r,e.x=n+a/2,e.y=r+o/2,h=this.fit(e);return!!h&&!!(this.options.clip||e.left>=0&&e.left+e.width<=this.width&&e.top>=0&&e.top+e.height<=this.height)&&(this.result.push(e),!0)}layout(t,e){if(!(null==t?void 0:t.length))return[];this.initProgressive(),this.result=[],this.maxRadius=Math.sqrt(e.width*e.width+e.height*e.height)/2,this.center=[e.width/2,e.height/2],this.width=e.width,this.height=e.height,this.data=t.sort(((t,e)=>this.getTextFontSize(e)-this.getTextFontSize(t)));let i=0;for(;i{var i,s,n,r,a,o;if(t.size&&(t.size[0]<=0||t.size[1]<=0))return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];const l=e,d=(null!==(i=t.size)&&void 0!==i?i:[500,500]).slice();d[0]=Math.floor(d[0]),d[1]=Math.floor(d[1]);const c=t.fontFamily?YY(t.fontFamily):"sans-serif",u=t.fontStyle?YY(t.fontStyle):"normal",p=t.fontWeight?YY(t.fontWeight):"normal",m=t.rotate?YY(t.rotate):0,_=YY(t.text),f=null!==(s=t.spiral)&&void 0!==s?s:"archimedean",v=t.padding?YY(t.padding):1,y=null!==(n=t.shape)&&void 0!==n?n:"square",b=null!==(r=t.shrink)&&void 0!==r&&r,x=null!==(a=t.enlarge)&&void 0!==a&&a,S=null!==(o=t.clip)&&void 0!==o&&o,M=t.minFontSize,k=t.randomVisible,A=t.as?Object.assign(Object.assign({},BY),t.as):BY,w=t.depth_3d,T=t.postProjection;let L=t.fontSize?YY(t.fontSize):14;const C=t.fontSizeRange;if(C&&!h(L)){const t=L,e=HY(zY(t,l),C);L=i=>e(t(i))}let E=MY;"fast"===t.layoutType?E=IY:"grid"===t.layoutType&&(E=RY);const D=new E(Object.assign(Object.assign({},t),{text:_,padding:v,spiral:f,shape:y,rotate:m,fontFamily:c,fontStyle:u,fontWeight:p,fontSize:L,shrink:b,clip:S,enlarge:x,minFontSize:M,random:k,outputCallback:e=>{const i=[];let s,n;for(let r=0,a=e.length;r0||t.progressiveTime>0?{progressive:D}:D.output()},YY=t=>S(t)||h(t)||ys(t)||y(t)?t:e=>e[t.field],jY=t=>t<0?-Math.sqrt(-t):Math.sqrt(t),HY=(t,e,i)=>{if(t[0]===t[1])return t=>e[0];const s=jY(t[0]),n=jY(t[1]),r=Math.min(s,n),a=Math.max(s,n);return t=>(jY(t)-r)/(a-r)*(e[1]-e[0])+e[0]},zY=(t,e)=>{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]};function NY(t,e,i,s,n){const r=Math.max(t[0],t[1])/2,a=function(t,e,i,s,n){const{x:r,y:a}=n,o=r/t*Math.PI*2;let l=Math.PI-a/e*Math.PI;return l+=(l{_c.registerTransform("wordcloud",{transform:FY,markPhase:"beforeJoin"},!0)};var WY;!function(t){t.BEFORE_WORDCLOUD_SHAPE_LAYOUT="beforeWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_LAYOUT="afterWordcloudShapeLayout",t.AFTER_WORDCLOUD_SHAPE_DRAW="afterWordcloudShapeDraw"}(WY||(WY={}));const GY=t=>/^[\u4e00-\u9fa5]+$/.test(t),UY=(t,e)=>{if(D(t))return 0;let i=0;for(const e of t)GY(e)?i+=1:i+=.53;return i};class $Y extends qb{constructor(){super(ab,ob),this.type=Kh.Sqrt}clone(){return(new $Y).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate)}}function XY(t,e,i){const{stepFactor:s,importantWordCount:n,globalShinkLimit:r}=e,{size:a,segmentation:{regions:o},tempCanvas:l,boardSize:h,shapeCenter:d,shapeMaxR:c,shapeRatio:u}=i,p=l.getContext("2d",{willReadFrequently:!0}),g=QY(i);let m=g.slice(0);const _=e.fontSizeShrinkFactor;let f=null,v=1,y=1;const b=n;let x=0;t.length>b&&(x=t.sort(((t,e)=>e.weight-t.weight))[b].weight);for(let e=0;ex&&y>r){const e=i.datum[Symbol.for("vGrammar_id")];e!==f&&(f=e,v=y),y*=_,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*_})),m=g.slice(0),b=!0;break}if(!i.skip&&i.datum[Symbol.for("vGrammar_id")]===f){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/y})),i.skip=!0,y=v,f=null,m=g.slice(0),b=!0;break}}}b&&(e=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t=i)break;if(e.x=~~(o+u),e.y=~~(l+p),!(e.x-d<0||e.x+g>n[0]||e.y-a<0||e.y+h>n[1]||ZY(e,t,r)))return qY(e,t,r),!0}return!1}function qY(t,e,i){const{wordSize:s}=t,n=t.sprite,r=s[0]>>5,a=i[0]>>5,o=t.x-(r<<4),l=o%32,h=32-l,d=s[1];let c,u=(t.y-(s[1]>>1))*a+(o>>5);if(0===l)for(let t=0;t>>l:0);u+=a}}function ZY(t,e,i){const{sprite:s,wordSize:n}=t,r=i[0]>>5,a=n[0]>>5,o=t.x-(a<<4),l=o%32,h=32-l,d=n[1];let c,u=(t.y-(n[1]>>1))*r+(o>>5);if(0===l)for(let t=0;t>>l:0))&e[u+i])return!0;u+=r}return!1}function JY(t,e,i,s){if(i[s].sprite||0===i[s].fontSize)return;const n=2048,r=Math.PI/180,a=i.length;t.width=n,t.height=2048,e.clearRect(0,0,n,2048),e.textAlign="center";let o,l,h=0,d=0,c=0,u=0;const p=s;for(--s;++s>5<<5,l=Math.ceil(l),l>c&&(c=l),h+o>=n&&(h=0,d+=c,c=l),d+l>=2048){if(0===d){t.hasText=!1;continue}break}d+l>=u&&(u=d+l),e.translate(h+(o>>1),d+(l>>1)),0!==t.rotate&&e.rotate(t.rotate*r),e.fillText(t.text,0,0),t.padding&&(e.lineWidth=2*t.padding,e.strokeText(t.text,0,0)),e.restore(),t.LT=[h,d],t.wordSize=[o,l],t.hasText=!0,h+=o}if(0===u)return;const g=e.getImageData(0,0,n,u).data;let m,_;for(;--s>=p;){const t=i[s];if(!t.hasText){t.bounds={dTop:1/0,dBottom:-1/0,dLeft:1/0,dRight:-1/0};break}const{LT:e=[0,0],wordSize:r}=t;[h,d]=e;const a=r[0]>>5,o=new Array(a*r[1]).fill(0);let[l,c,u,p]=[1/0,-1/0,1/0,-1/0];for(_=0;_0){const e=1<<31-m%32;o[a*_+(m>>5)]|=e,mp&&(p=m),t|=e}t&&(_c&&(c=_))}t.bounds={dTop:(r[1]>>1)-l,dBottom:c-(r[1]>>1),dLeft:(r[0]>>1)-u,dRight:p-(r[0]>>1)},t.sprite=o,delete t.LT}}function QY(t){const{segmentation:{labels:e},boardSize:i,size:s}=t,n=i[0]>>5,r=new Array(n*s[1]).fill(0);for(let t=0;t>5)]|=e}if(i[0]>s[0]){const t=(1<>5<<5;if(i.boardSize=[r,e.size[1]],i.random?i.randomGenerator=Math.random:i.randomGenerator=(()=>{let t=-1;const e=[0,.1,.2,.3,.4,.5,.6,.7,.8,.9];return()=>(t=(t+1)%e.length,e[t])})(),this.segmentationInput=i,S(i.shapeUrl)){i.isEmptyPixel=LY();const t=(a=i.shapeUrl)&&(_s(a)||fs(a)||a.startsWith("{var i;const s=RS({image:a}),n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):(s.successCallback=()=>{var i;if(s){const n=null===(i=s.resources)||void 0===i?void 0:i.get(a);n&&"success"===n.state&&n.data?t(n.data):e(new Error("image load failed"+a))}else e(new Error("image load failed"+a))},s.failCallback=()=>{g.getInstance().error("image 加载失败!",a)})})):null;t?(this.isImageFinished=!1,this.isLayoutFinished=!1,t.then((t=>{this.isImageFinished=!0;const s=zo.createCanvas({width:e.size[0],height:e.size[1],dpr:1});i.maskCanvas=s;const n=s.getContext("2d");e.removeWhiteBorder&&function(t,e,i){e.width=t.width,e.height=t.height;const s=e.getContext("2d",{willReadFrequently:!0});s.clearRect(0,0,e.width,e.height),s.drawImage(t,0,0);const n=e.width,r=s.getImageData(0,0,e.width,e.height);let a=0,o=r.height,l=0,h=r.width;const d=(t,e)=>{for(let s=0;s{for(let n=e;na&&d(n,o-1);)--o;for(;ll&&c(h-1,a,o);)--h;const u=s.getImageData(l,a,h-l,o-a);e.width=u.width,e.height=u.height,s.clearRect(0,0,e.width,e.height),s.putImageData(u,0,0)}(t,s,i.isEmptyPixel);const r=function(t,e){const i=t.width,s=t.height;let n=e[0]/i;s*n>e[1]&&(n=e[1]/s);const r=Math.floor(n*i),a=Math.floor(n*s);return{x:(e[0]-r)/2,y:(e[1]-a)/2,width:r,height:a,scale:n}}(t,e.size);n.clearRect(0,0,e.size[0],e.size[1]),n.drawImage(t,r.x,r.y,r.width,r.height),this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(i.maskCanvas)})).catch((t=>{this.isImageFinished=!0}))):(this.isImageFinished=!0,this.isLayoutFinished=!0)}else if(i.shapeUrl&&("text"===i.shapeUrl.type||"geometric"===i.shapeUrl.type)){i.isEmptyPixel=LY(i.shapeUrl.backgroundColor);const t=CY(i.shapeUrl,e.size[0],e.size[1]);i.maskCanvas=t,this.options.onUpdateMaskCanvas&&this.options.onUpdateMaskCanvas(t),this.doLayout(),this.isImageFinished=!0,this.isLayoutFinished=!0}var a}canAnimate(){return!0}unfinished(){return!this.isLayoutFinished}output(){return this.progressiveResult}progressiveRun(){this.isImageFinished&&!this.isLayoutFinished&&(this.segmentationInput.maskCanvas&&this.doLayout(),this.isLayoutFinished=!0)}progressiveOutput(){return this.progressiveResult}doLayout(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x;const S=this.segmentationInput,M=function(t){const{size:e,maskCanvas:i}=t,s=i.getContext("2d",{willReadFrequently:!0}).getImageData(0,0,i.width,i.height),n=new Array(e[0]*e[1]).fill(0);let r=1;const a=[[0,1],[1,0],[-1,0],[0,-1]];let o=[];for(let i=0;i=e[1]?e[1]-1:h,d=d<0?0:d>=e[0]?e[0]-1:d,0!==n[h*e[0]+d]||t.isEmptyPixel(s,h,d)||(n[h*e[0]+d]=r,o.push([h,d]))}r++,o=[]}const l={},h={},d={},c={},u={},p={},g={x1:1/0,x2:-1/0,y1:1/0,y2:-1/0,width:0,height:0};for(let t=0;tc[s][1]&&(c[s][1]=t),ic[s][3]&&(c[s][3]=i),ig.x2&&(g.x2=i),tg.y2&&(g.y2=t)),h[s]=h[s]||0,h[s]++)}const m=[];for(const t in l){const e=l[t],i=~~(e.reduce(((t,e)=>t+e[0]),0)/e.length),s=~~(e.reduce(((t,e)=>t+e[1]),0)/e.length);d[t]=[i,s],m.push(...e);const[n,r,a,o]=c[t];u[t]=~~Math.max(Math.sqrt((i-a)**2+(s-n)**2),Math.sqrt((i-o)**2+(s-r)**2),Math.sqrt((i-a)**2+(s-r)**2),Math.sqrt((i-o)**2+(s-n)**2)),p[t]=(o-a)/(r-n)}const _=Object.keys(d).map((t=>({label:t-1,boundary:l[t],area:h[t],center:d[t],maxPoint:c[t],maxR:u[t],ratio:p[t]})));g.width=g.x2-g.x1+1,g.height=g.y2-g.y1+1;const f=~~(m.reduce(((t,e)=>t+e[0]),0)/m.length),v=~~(m.reduce(((t,e)=>t+e[1]),0)/m.length),y=~~Math.max(Math.sqrt((f-g.x1)**2+(v-g.y1)**2),Math.sqrt((f-g.x2)**2+(v-g.y2)**2),Math.sqrt((f-g.x1)**2+(v-g.y2)**2),Math.sqrt((f-g.x2)**2+(v-g.y1)**2)),b=g.width/g.height,x=Object.keys(h).reduce(((t,e)=>t+h[e]),0),S={regions:_,labels:n,labelNumber:r-1};return Object.assign(t,{segmentation:S,shapeBounds:g,shapeMaxR:y,shapeRatio:b,shapeCenter:[f,v],shapeArea:x});function M(t,i){const s=[[0,1],[1,0],[-1,0],[0,-1]];if(0===t||0===i||t===e[1]-1||i===e[0]-1)return!0;for(let r=0;r<4;r++){let a=t+s[r][0],o=i+s[r][1];if(a=a<0?0:a>=e[1]?e[1]-1:a,o=o<0?0:o>=e[0]?e[0]-1:o,0===n[a*e[0]+o])return!0}return!1}}(S);if(!M.segmentation.regions.length)return;const k=this.options,A=this.data,w=k.colorMode||"ordinal",T={getText:aj(k.text),getFontSize:aj(k.fontSize),fontSizeRange:k.fontSizeRange,colorMode:w,getColor:k.colorField?aj(k.colorField):aj(k.text),getFillingColor:aj(k.fillingColorField),colorList:k.colorList||("ordinal"===w?["#2E62F1"]:["#537EF5","#2E62F1","#2358D8","#184FBF","#0C45A6","#013B8E"]),getColorHex:aj(k.colorHexField),getFontFamily:aj(k.fontFamily||"sans-serif"),rotateList:k.rotateList||[0],getPadding:aj(k.padding||1),getFontStyle:aj(k.fontStyle||"normal"),getFontWeight:aj(k.fontWeight||"normal"),getFontOpacity:k.fontOpacity?aj(k.fontOpacity):()=>1};sj(A,T,M);const L={size:k.size,ratio:k.ratio||.8,shapeUrl:k.shape,random:void 0===k.random||k.random,textLayoutTimes:null!==(t=k.textLayoutTimes)&&void 0!==t?t:3,removeWhiteBorder:k.removeWhiteBorder,layoutMode:null!==(e=k.layoutMode)&&void 0!==e?e:"default",fontSizeShrinkFactor:null!==(i=k.fontSizeShrinkFactor)&&void 0!==i?i:.8,stepFactor:null!==(s=k.stepFactor)&&void 0!==s?s:1,importantWordCount:null!==(n=k.importantWordCount)&&void 0!==n?n:10,globalShinkLimit:k.globalShinkLimit||.2,fontSizeEnlargeFactor:null!==(r=k.fontSizeEnlargeFactor)&&void 0!==r?r:1.5,fillingRatio:null!==(a=k.fillingRatio)&&void 0!==a?a:.7,fillingTimes:null!==(o=k.fillingTimes)&&void 0!==o?o:4,fillingXStep:k.fillingXRatioStep?Math.max(Math.floor(k.size[0]*k.fillingXRatioStep),1):null!==(l=k.fillingXStep)&&void 0!==l?l:4,fillingYStep:k.fillingYRatioStep?Math.max(Math.floor(k.size[1]*k.fillingYRatioStep),1):null!==(h=k.fillingYStep)&&void 0!==h?h:4,fillingInitialFontSize:k.fillingInitialFontSize,fillingDeltaFontSize:k.fillingDeltaFontSize,fillingInitialOpacity:null!==(d=k.fillingInitialOpacity)&&void 0!==d?d:.8,fillingDeltaOpacity:null!==(c=k.fillingDeltaOpacity)&&void 0!==c?c:.05,getFillingFontFamily:aj(k.fillingFontFamily||"sans-serif"),getFillingFontStyle:aj(k.fillingFontStyle||"normal"),getFillingFontWeight:aj(k.fillingFontWeight||"normal"),getFillingPadding:aj(null!==(u=k.fillingPadding)&&void 0!==u?u:.4),fillingRotateList:null!==(p=k.fillingRotateList)&&void 0!==p?p:[0,90],fillingDeltaFontSizeFactor:null!==(g=k.fillingDeltaFontSizeFactor)&&void 0!==g?g:.2,fillingColorList:k.fillingColorList||["#537EF5"],sameColorList:!1,minInitFontSize:null!==(m=k.minInitFontSize)&&void 0!==m?m:10,minFontSize:null!==(_=k.minFontSize)&&void 0!==_?_:4,minFillFontSize:null!==(f=k.minFillFontSize)&&void 0!==f?f:2},C=((t,e)=>{if(1===e.length&&"#537EF5"===e[0])return!0;if(!Array.isArray(t)||!Array.isArray(e)||t.length!==e.length)return!1;for(let i=0;i{const i=UY(n(e));return i>l?t:t+i}),0)/t.length;let d;if(0===h)d=8;else{const t=.2*s.shapeArea;d=Math.sqrt(e*(t/h))}r=~~d,a=d*i.fillingDeltaFontSizeFactor,Object.assign(i,{fillingInitialFontSize:r,fillingDeltaFontSize:a})}}(A,T,L,M);const{getText:E,getFontFamily:D,getFontStyle:P,getFontWeight:O,getPadding:R,getColor:I,getFillingColor:B,getColorHex:F,fontSizeScale:Y,colorScale:j,fillingColorScale:H,getFontOpacity:z,rotateList:N}=T,V=A.map((t=>{var e,i;return{x:0,y:0,weight:0,text:E(t),fontFamily:D(t),fontWeight:O(t),fontStyle:P(t),rotate:N[~~(S.randomGenerator()*N.length)],fontSize:Math.max(L.minInitFontSize,~~Y(t)),opacity:z(t),padding:R(t),color:F&&F(t)||j&&j(I(t))||"black",fillingColor:!B||(null===(e=k.colorField)||void 0===e?void 0:e.field)===(null===(i=k.fillingColorField)||void 0===i?void 0:i.field)&&C?void 0:F&&F(t)||H&&H(B(t))||"black",datum:t,visible:!0,hasPlaced:!1}})),W=Ya(V.map((t=>t.fontSize)));V.forEach((t=>t.weight=t.fontSize/W)),V.sort(((t,e)=>e.weight-t.weight));const{fillingWords:G,successedWords:U,failedWords:$}=function(t,e,i){(function(t,e){const{segmentation:{regions:i}}=e;let s=-1/0,n=0,r=0;i.forEach(((t,e)=>{const i=t.area;i>s&&(s=i,r=e),n+=i}));let a=0;i.forEach((e=>{const i=e.area,r=Math.ceil(i/n*t.length),o=i/s;e.words=[],e.regionNum=r,e.regionWeight=o,a+=r})),at.regionNum));t.forEach((t=>{let e=0,s=0;t.regionIndex=-1;do{if(l[o]>0&&t.weight<=i[o].regionWeight){t.regionIndex=o,i[o].words.push(t),l[o]--,o=(o+1)%i.length;break}o=(o+1)%i.length,e++,s++,s>i.length+1&&(i.forEach((t=>{t.regionWeight+=.15})),s=0)}while(-1===t.regionIndex&&e<3*i.length);-1===t.regionIndex&&(t.regionIndex=r,i[r].words.push(t),l[r]--)})),i.forEach((t=>{t.words.sort(((t,e)=>e.weight-t.weight))}))})(t,i),"ensureMapping"===e.layoutMode?XY(t,e,i):"ensureMappingEnlarge"===e.layoutMode?function(t,e,i){const{size:s,stepFactor:n,importantWordCount:r}=e,{segmentation:{regions:a},tempCanvas:o,boardSize:l,shapeCenter:h,shapeMaxR:d,shapeRatio:c}=i,u=o.getContext("2d",{willReadFrequently:!0}),p=QY(i);let g=p.slice(0);const m=e.fontSizeEnlargeFactor,_=Math.min(r,t.length);let f=0;t.length>_&&(f=t.sort(((t,e)=>e.weight-t.weight))[_-1].weight);let v=0,y=1,b=!1;for(let r=0;r=f&&v++,v>=_&&!b){y*=m,t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize*m})),g=p.slice(0),M=!0,v=0;break}}else{if(a.weight>=f&&y>1){t.forEach((t=>{t.hasText=!1,t.sprite=null,t.fontSize=t.fontSize/m})),y/=m,b=!0,g=p.slice(0),M=!0;break}if(a.weight>=f)return XY(t,e,i)}}M&&(r=-1)}for(let i=0;i(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;t(t.hasPlaced||(t.hasText=!1,t.sprite=null,t.fontSize=Math.max(~~(t.fontSize*e.fontSizeShrinkFactor),e.minFontSize)),!t.hasPlaced)));if(0===i.length)break;for(let t=0;tc?k-c:c,v),A=A>p?A-p:p;return w;function T(e,i){const n=t.map((t=>{const{text:s,color:n,fillingColor:r,hasPlaced:a,datum:d}=t;return{x:0,y:0,weight:0,text:s,fontFamily:h(d),fontStyle:o(d),fontWeight:l(d),fontSize:e,rotate:g[~~(S()*g.length)],padding:m(d),opacity:i,visible:!0,color:n,fillingColor:r,hasPlaced:a,datum:d}}));L(n);let d=0;const{x1:c,y1:u,x2:p,y2:v}=b,[k,A]=[c+~~(S()*r*2),u+~~(S()*a*2)];for(let t=A;t<=v;t+=a)for(let e=k;e<=p;e+=r){JY(x,M,n,d);const i=n[d];i.x=e,i.y=t;const{wordSize:r,bounds:a,hasPlaced:o}=i;if(!o||!a){++d===n.length&&(d=0,_&&L(n));continue}const{dTop:l,dBottom:h,dLeft:c,dRight:u}=a;i.x-c<0||i.x+u>s[0]||i.y-l<0||i.y+h>s[1]||i.hasText&&i.sprite&&!ZY(i,f,y)&&(qY(i,f,y),w.push(Object.assign({},i)),++d===n.length&&(d=0,_&&L(n)))}}function L(t){return t.sort((()=>S()-.5))}}(t,e,i),n=[],r=[];for(let e=0;et.visible=!1)),{fillingWords:s,successedWords:r,failedWords:n}}(V,L,M),X=null!==(y=null===(v=k.text)||void 0===v?void 0:v.field)&&void 0!==y?y:"textKey",K=null!==(b=k.dataIndexKey)&&void 0!==b?b:"defaultDataIndexKey",q=k.as?Object.assign(Object.assign({},tj),k.as):tj;let Z,J;const Q=[];for(let t=0;t{var i,s;const n=Object.assign({},t.datum);n[q.x]=t.x,n[q.y]=t.y,n[q.fontFamily]=t.fontFamily,n[q.fontSize]=t.fontSize,n[q.fontStyle]=t.fontStyle,n[q.fontWeight]=t.fontWeight,n[q.angle]=At(t.rotate),n[q.opacity]=t.opacity,n[q.visible]=t.visible,n[q.isFillingWord]=!0,n[q.color]=B?(null===(i=k.colorField)||void 0===i?void 0:i.field)===(null===(s=k.fillingColorField)||void 0===s?void 0:s.field)&&C?t.color:t.fillingColor:L.fillingColorList[~~(S.randomGenerator()*L.fillingColorList.length)],n[X]=t.text,n[K]=`${t.text}_${e}_fillingWords`,tt.push(n)})),this.view&&this.view.emit){this.view.emit(WY.AFTER_WORDCLOUD_SHAPE_LAYOUT,{successedWords:U,failedWords:$});const t=null===(x=this.view.renderer)||void 0===x?void 0:x.stage();t&&t.hooks.afterRender.tap(WY.AFTER_WORDCLOUD_SHAPE_DRAW,(()=>{this.view.emit(WY.AFTER_WORDCLOUD_SHAPE_DRAW,{successedWords:U,failedWords:$}),t.hooks.afterRender.unTap(WY.AFTER_WORDCLOUD_SHAPE_DRAW)}))}this.progressiveResult=Q.concat(tt)}release(){this.segmentationInput=null,this.data=null,this.progressiveResult=null,this.options=null}}const ij=(t,e,i,s)=>{var n,r,a,o;const{colorMode:l,getColor:h,getFillingColor:d}=e,{sameColorList:c}=i;let u,p,g=e.colorList,m=i.fillingColorList;if("ordinal"===l){const e=t.map((t=>h(t)));if(u=t=>(new Jb).domain(e).range(g).scale(t),d&&((null===(n=s.colorField)||void 0===n?void 0:n.field)!==(null===(r=s.fillingColorField)||void 0===r?void 0:r.field)||!c)){const e=t.map((t=>d(t)));p=t=>(new Jb).domain(e).range(m).scale(t)}}else{1===g.length&&(g=[g[0],g[0]]);const e=(new qb).domain(rj(h,t)).range(g);if(u=t=>e.scale(t),d&&((null===(a=s.colorField)||void 0===a?void 0:a.field)!==(null===(o=s.fillingColorField)||void 0===o?void 0:o.field)||!c)){1===m.length&&(m=[m[0],m[0]]);const e=(new qb).domain(rj(d,t)).range(m);p=t=>e.scale(t)}}Object.assign(e,{colorScale:u,fillingColorScale:p})},sj=(t,e,i)=>{let{fontSizeRange:s}=e;const{getFontSize:n,getText:r}=e;let a;if(n){if(n&&s){const e=(new $Y).domain(rj(n,t)).range(s);a=t=>e.scale(n(t))}else if(n&&ys(n)&&!s){const e=.5,[o,l]=rj(n,t),h=t.map((t=>({text:r(t),value:n(t),weight:l===o?1:(n(t)-o)/(l-o)}))),d=nj(h,i,!0);s=[~~(e*d),~~d];const c=(new $Y).domain(rj(n,t)).range(s);a=t=>c.scale(n(t))}}else{const e=t.map((t=>({text:r(t)}))),s=nj(e,i,!1);a="function"==typeof(o=s)?o:function(){return o}}var o;Object.assign(e,{getFontSize:n,fontSizeRange:s,fontSizeScale:a})},nj=(t,e,i)=>{const s=e.shapeArea,n=e.ratio,r=e.segmentation.regions,a=Math.ceil(Math.sqrt(s)/12),o=t.reduce(((t,e)=>{const s=UY(e.text);return s{let i=1/0,s=-1/0;const n=e.length;let r;for(let a=0;as&&(s=r);return 1===e.length&&i===s&&(i-=1e4),[i,s]},aj=t=>t?"string"==typeof t||"number"==typeof t?()=>t:ys(t)?t:e=>e[t.field]:null,oj=(t,e,i,s)=>{if(!t.size||D(t.size[0])||D(t.size[1])||t.size[0]<=0||t.size[1]<=0)return g.getInstance().info("Wordcloud size dimensions must be greater than 0"),[];if(t.size=[Math.ceil(t.size[0]),Math.ceil(t.size[1])],t.shape||Lm("WordcloudShape shape must be specified."),t.text||Lm("WordcloudShape text must be specified."),(null==s?void 0:s.emit)&&s.emit(WY.BEFORE_WORDCLOUD_SHAPE_LAYOUT),!e||0===e.length)return[];const n=new ej(t,s);return n.layout(e),n.unfinished()?{progressive:n}:n.output()},lj=()=>{_c.registerTransform("wordcloudShape",{transform:oj,markPhase:"beforeJoin"},!0)};class hj extends hY{constructor(){super(...arguments),this.type=_l.wordCloud}}hj.type=_l.wordCloud;const dj=()=>{VY(),SF(),uY(),$l.registerSeries(hj.type,hj)};class cj extends tY{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord,wordMask:t.wordMask}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class uj extends eY{constructor(){super(...arguments),this.transformerConstructor=cj,this.type="wordCloud",this.seriesType=_l.wordCloud}}uj.type="wordCloud",uj.seriesType=_l.wordCloud,uj.transformerConstructor=cj;class pj extends hY{constructor(){super(...arguments),this.type=_l.wordCloud3d}_wordCloudTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}_wordCloudShapeTransformOption(){var t;return Object.assign(Object.assign({},super._wordCloudShapeTransformOption()),{postProjection:null!==(t=this._spec.postProjection)&&void 0!==t?t:"StereographicProjection",depth_3d:this._spec.depth_3d})}initMark(){this._wordMark=this._createMark(hY.mark.word,{groupKey:this._seriesField,support3d:!0,isSeriesMark:!0})}initMarkStyle(){super.initMarkStyle();const t=this._wordMark;t&&this.setMarkStyle(t,{z:t=>{var e;return null!==(e=t.z)&&void 0!==e?e:0}},"normal",Py.Series)}initAnimation(){var t,e;const i=null!==(t=this._padding)&&void 0!==t?t:{};this._wordMark&&this._wordMark.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("wordCloud3d"))||void 0===e?void 0:e((()=>{var t;const e=this.getCompiler().getVGrammarView(),s=e.width()-i.left||0-i.right||0,n=e.height()-i.top||0-i.bottom||0,r=Math.max(s,n)/2;return{center:{x:r,y:r,z:null!==(t=this._spec.depth_3d)&&void 0!==t?t:r},r}})),DC("word",this._spec,this._markAttributeContext)))}}pj.type=_l.wordCloud3d;const gj=()=>{VY(),SF(),pY(),$l.registerSeries(pj.type,pj)};class mj extends tY{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{nameField:t.nameField,valueField:t.valueField,seriesField:t.seriesField,fontFamilyField:t.fontFamilyField,fontWeightField:t.fontWeightField,fontStyleField:t.fontStyleField,colorHexField:t.colorHexField,colorMode:t.colorMode,colorList:t.colorList,rotateAngles:t.rotateAngles,fontWeightRange:t.fontWeightRange,fontSizeRange:t.fontSizeRange,depth_3d:t.depth_3d,maskShape:t.maskShape,keepAspect:t.keepAspect,random:t.random,wordCloudConfig:t.wordCloudConfig,wordCloudShapeConfig:t.wordCloudShapeConfig,word:t.word,fillingWord:t.fillingWord}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}}class _j extends eY{constructor(){super(...arguments),this.transformerConstructor=mj,this.type="wordCloud3d",this.seriesType=_l.wordCloud3d}}_j.type="wordCloud3d",_j.seriesType=_l.wordCloud3d,_j.transformerConstructor=mj;const fj=(t,e)=>{var i,s;const n=t.map((t=>Object.assign({},t)));if(!n||0===n.length)return n;const{valueField:r,asTransformRatio:a,asReachRatio:o,asHeightRatio:l,asValueRatio:h,asNextValueRatio:d,asLastValueRatio:c,asLastValue:u,asCurrentValue:p,asNextValue:g,heightVisual:m=!1,isCone:_=!0,range:f}=e,v=n.reduce(((t,e)=>Math.max(t,Number.parseFloat(e[r])||-1/0)),-1/0),y=n.reduce(((t,e)=>Math.min(t,Number.parseFloat(e[r])||1/0)),1/0),b=[null!==(i=null==f?void 0:f.min)&&void 0!==i?i:y,null!==(s=null==f?void 0:f.max)&&void 0!==s?s:v];return n.forEach(((t,e)=>{var i,s;const f=Number.parseFloat(t[r]),v=Number.parseFloat(null===(i=n[e-1])||void 0===i?void 0:i[r]),y=Number.parseFloat(null===(s=n[e+1])||void 0===s?void 0:s[r]),x=qo(y*f)&&0!==f?y/f:0,S=qo(f*v)&&0!==v?f/v:0;u&&(t[u]=v),g&&(t[g]=y),a&&(t[a]=x),o&&(t[o]=0===e?1:S),l&&(t[l]=!0===m?x:1/n.length),h&&(t[h]=f/b[1]),d&&(t[d]=e===n.length-1?_?0:t[h]:y/b[1]),c&&(t[c]=0===e?1:v/b[1]),p&&(t[p]=f)})),n},vj=(t,e)=>{var i,s;const n=null===(s=null===(i=t[0])||void 0===i?void 0:i.latestData)||void 0===s?void 0:s.map((t=>Object.assign({},t)));return n&&0!==n.length?(n.shift(),n.forEach((t=>{t[e.asIsTransformLevel]=!0})),n):n},yj=`${sh}_FUNNEL_TRANSFORM_RATIO`,bj=`${sh}_FUNNEL_REACH_RATIO`,xj=`${sh}_FUNNEL_HEIGHT_RATIO`,Sj=`${sh}_FUNNEL_VALUE_RATIO`,Mj=`${sh}_FUNNEL_LAST_VALUE_RATIO`,kj=`${sh}_FUNNEL_NEXT_VALUE_RATIO`,Aj=`${sh}_FUNNEL_LAST_VALUE`,wj=`${sh}_FUNNEL_CURRENT_VALUE`,Tj=`${sh}_FUNNEL_NEXT_VALUE`,Lj=`${sh}_FUNNEL_TRANSFORM_LEVEL`,Cj=20;class Ej extends UT{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=(t,e)=>{var i,s,n;const r=this.series;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?"转化率":null!==(s=this._getDimensionData(t))&&void 0!==s?s:null===(n=t.properties)||void 0===n?void 0:n[`${r.getCategoryField()}`]},this.markTooltipValueCallback=(t,e)=>{var i;return"transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name)?`${(100*(null==t?void 0:t[bj])).toFixed(1)}%`:this._getMeasureData(t)},this.markTooltipKeyCallback=(t,e)=>{var i;if("transform"===(null===(i=null==e?void 0:e.mark)||void 0===i?void 0:i.name))return"转化率";const{dimensionFields:s,seriesFields:n}=this._seriesCacheInfo,r=s[s.length-1];return M(n[0])?null==t?void 0:t[n[0]]:null==t?void 0:t[r]}}}class Dj extends vx{_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{points:[]})}}class Pj extends Dj{constructor(){super(...arguments),this.type=Pj.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:0})}}Pj.type="polygon";const Oj=()=>{$l.registerMark(Pj.type,Pj),Sx(),vk(),_c.registerGraphic(Jd.polygon,oS),LC()},Rj=Object.assign(Object.assign({},rL),{funnel:{name:"funnel",type:"polygon"},transform:{name:"transform",type:"polygon"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}}),Ij=Object.assign(Object.assign({},rL),{funnel3d:{name:"funnel3d",type:"pyramid3d"},transform3d:{name:"transform3d",type:"pyramid3d"},transformLabel:{name:"transformLabel",type:"text"},outerLabel:{name:"outerLabel",type:"text"},outerLabelLine:{name:"outerLabelLine",type:"rule"}});class Bj extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel"),t.isTransform&&this._addMarkLabelSpec(t,"transform","transformLabel")}}class Fj extends jC{constructor(){super(...arguments),this.type=_l.funnel,this._funnelMarkName="funnel",this._funnelMarkType="polygon",this._transformMarkName="transform",this._transformMarkType="polygon",this.transformerConstructor=Bj,this._funnelMark=null,this._funnelTransformMark=null,this._labelMark=null,this._transformLabelMark=null,this._funnelOuterLabelMark={}}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this._funnelOrient=null!==(t=this._spec.funnelOrient)&&void 0!==t?t:"top",this._shape=null!==(e=this._spec.shape)&&void 0!==e?e:"trapezoid",this._isHorizontal()?this._funnelAlign=["top","bottom"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center":this._funnelAlign=["left","right"].includes(this._spec.funnelAlign)?this._spec.funnelAlign:"center",!this._seriesField&&this._spec.categoryField&&this.setSeriesField(this._spec.categoryField)}initData(){if(super.initData(),!this._data)return;Lp(this._dataSet,"funnel",fj),Lp(this._dataSet,"funnelTransform",vj);const t=new R(this._dataSet,{name:`${sh}_series_${this.id}_viewDataTransform`});t.parse([this.getViewData()],{type:"dataview"}),this._viewDataTransform=new ZT(this._option,t)}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}_statisticViewData(){var t,e,i,s,n,r,a,o,l;super._statisticViewData(),this._data.getDataView().transform({type:"funnel",options:{valueField:this.getValueField(),isCone:this._spec.isCone,asCurrentValue:wj,asTransformRatio:yj,asReachRatio:bj,asHeightRatio:xj,asValueRatio:Sj,asNextValueRatio:kj,asLastValueRatio:Mj,asLastValue:Aj,asNextValue:Tj,range:{min:null!==(e=null===(t=this._spec.range)||void 0===t?void 0:t.min)&&void 0!==e?e:null===(s=null===(i=this.getViewDataStatistics().latestData)||void 0===i?void 0:i[this.getValueField()])||void 0===s?void 0:s.min,max:null!==(r=null===(n=this._spec.range)||void 0===n?void 0:n.max)&&void 0!==r?r:null===(o=null===(a=this.getViewDataStatistics().latestData)||void 0===a?void 0:a[this.getValueField()])||void 0===o?void 0:o.max}}}),null===(l=this._viewDataTransform.getDataView())||void 0===l||l.transform({type:"funnelTransform",options:{asIsTransformLevel:Lj}})}initMark(){var t,e,i,s,n,r,a,o,l,h,d,c;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Fj.mark.funnel),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel,morph:RC(this._spec,this._funnelMarkName),defaultMorphElementKey:this._seriesField,groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(e=this._spec.funnel)||void 0===e?void 0:e.customShape,stateSort:null===(i=this._spec.funnel)||void 0===i?void 0:i.stateSort,noSeparateStyle:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Fj.mark.transform),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(s=this._theme)||void 0===s?void 0:s.transform,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId(),customShape:null===(n=this._spec.transform)||void 0===n?void 0:n.customShape,stateSort:null===(r=this._spec.transform)||void 0===r?void 0:r.stateSort,noSeparateStyle:!0})),null===(o=null===(a=this._spec)||void 0===a?void 0:a.outerLabel)||void 0===o?void 0:o.visible){const{line:t}=null!==(l=this._spec.outerLabel)&&void 0!==l?l:{},{line:e}=null!==(d=null===(h=this._theme)||void 0===h?void 0:h.outerLabel)&&void 0!==d?d:{};this._funnelOuterLabelMark.label=this._createMark(Fj.mark.outerLabel,{themeSpec:null===(c=this._theme)||void 0===c?void 0:c.outerLabel,markSpec:this._spec.outerLabel,skipBeforeLayouted:!0,noSeparateStyle:!0}),this._funnelOuterLabelMark.line=this._createMark(Fj.mark.outerLabelLine,{themeSpec:e,markSpec:t,depend:[this._funnelOuterLabelMark.label],noSeparateStyle:!0})}}initTooltip(){this._tooltipHelper=new Ej(this),this._funnelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelMark),this._funnelTransformMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._funnelTransformMark)}getDimensionField(){return this._seriesField?[this._seriesField]:[]}getMeasureField(){return[this._valueField]}getGroupFields(){return null}initMarkStyle(){const t=this._funnelMark;t&&this.setMarkStyle(t,{points:t=>this.getPoints(t),visible:t=>M(t[this._valueField]),fill:this.getColorAttribute()},"normal",Py.Series);const e=this._funnelTransformMark;e&&this.setMarkStyle(e,{points:t=>this.getPoints(t)},"normal",Py.Series);const i=this._funnelOuterLabelMark.label;i&&this.setMarkStyle(i,{text:t=>{const e=`${t[this.getCategoryField()]}`;return ys(this._spec.outerLabel.formatMethod)?this._spec.outerLabel.formatMethod(e,t):e},x:t=>this._computeOuterLabelPosition(t).x,y:t=>this._computeOuterLabelPosition(t).y,textAlign:t=>this._computeOuterLabelPosition(t).align,textBaseline:t=>this._computeOuterLabelPosition(t).textBaseline,maxLineWidth:t=>this._computeOuterLabelLimit(t)},"normal",Py.Series);const s=this._funnelOuterLabelMark.line;s&&i&&this.setMarkStyle(s,{x:t=>this._computeOuterLabelLinePosition(t).x1,y:t=>this._computeOuterLabelLinePosition(t).y1,x1:t=>this._computeOuterLabelLinePosition(t).x2,y1:t=>this._computeOuterLabelLinePosition(t).y2},"normal",Py.Series)}initLabelMarkStyle(t){var e,i;if(!t)return;const s=t.getTarget(),n=t.getComponent();s===this._funnelMark?(this._labelMark=t,this.setMarkStyle(t,{text:t=>`${t[this.getCategoryField()]} ${t[this.getValueField()]}`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.label),stroke:this.getColorAttribute()},"normal",Py.Series),(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(n),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())):this._funnelTransformMark&&s===this._funnelTransformMark&&(this._transformLabelMark=t,this.setMarkStyle(t,{text:t=>`${(100*eB(bj).bind(this)(t)).toFixed(1)}%`,x:t=>this._computeLabelPosition(t).x,y:t=>this._computeLabelPosition(t).y,maxLineWidth:t=>this._computeLabelLimit(t,this._spec.transformLabel)},"normal",Py.Series))}initAnimation(){var t,e,i,s,n,r,a;const o=null!==(i=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset)&&void 0!==i?i:"clipIn";"clipIn"===o&&this._rootMark&&this._rootMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("cartesianGroupClip"))||void 0===s?void 0:s({direction:()=>this._isHorizontal()?"x":"y",width:()=>{const t=this.getRootMark().getProduct();if(t){const{x1:e,x2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().width},height:()=>{const t=this.getRootMark().getProduct();if(t){const{y1:e,y2:i}=t.getBounds();return Math.max(e,i)}return this.getLayoutRect().height},orient:()=>this._isReverse()?"negative":"positive"},o),DC("group",this._spec,this._markAttributeContext))),[null===(n=this._funnelOuterLabelMark)||void 0===n?void 0:n.label].forEach((t=>{t&&t.setAnimationConfig(EC($l.getAnimationInKey("fadeInOut")(),DC(t.name,this._spec,this._markAttributeContext)))})),[this._funnelMark,this._funnelTransformMark].forEach((t=>{t&&t.setAnimationConfig(EC($l.getAnimationInKey("funnel")({},o),DC(t.name,this._spec,this._markAttributeContext)))})),(null===(r=this._funnelOuterLabelMark)||void 0===r?void 0:r.line)&&this._funnelOuterLabelMark.line.setAnimationConfig(EC(null===(a=$l.getAnimationInKey("fadeInOut"))||void 0===a?void 0:a(),DC("outerLabelLine",this._spec,this._markAttributeContext)))}initGroups(){}getStackGroupFields(){return[]}getStackValueField(){return null}initEvent(){var t;super.initEvent(),null===(t=this._viewDataTransform.getDataView())||void 0===t||t.target.addListener("change",(t=>{this._viewDataTransform.updateData()}))}getPoints(t){const e=this.isTransformLevel(t),i=this._getMainAxisLength(e)/2;let s,n;e?(s="rect"===this._shape?this._getSecondaryAxisLength(t[Mj])/2:this._getSecondaryAxisLength(t[Sj])/2,n=this._getSecondaryAxisLength(t[Sj])/2):(s=this._getSecondaryAxisLength(t[Sj])/2,n="rect"===this._shape?s:this._getSecondaryAxisLength(t[kj])/2);const{x:r,y:a}=this._getPositionByData(t),o=this._getPolygonPoints([r,a],s,n,s,n,i);return"center"!==this._funnelAlign&&this._adjustPoints(o),o}isTransformLevel(t){return!!(null==t?void 0:t[Lj])}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToPosition=this.valueToPosition.bind(this),this._markAttributeContext.getPoints=this.getPoints.bind(this),this._markAttributeContext.isTransformLevel=this.isTransformLevel.bind(this)}valueToPosition(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.getViewData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.find)||void 0===s?void 0:s.call(i,(e=>e[this._categoryField]===t));return M(n)?this._getPolygonCenter(this.getPoints(n)):null}dataToPosition(t,e){return e&&!this.isDatumInViewData(t)?null:this.valueToPosition(t[this._categoryField])}dataToPositionX(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.x}dataToPositionY(t){var e;return null===(e=this.dataToPosition(t))||void 0===e?void 0:e.y}dataToPositionZ(t){return 0}_getMainAxisLength(t=!1){var e;const i=this.getViewData().latestData.length,s=this._isHorizontal()?this.getLayoutRect().width:this.getLayoutRect().height,n=!!this._spec.isTransform,r=n?0:null!==(e=this._spec.gap)&&void 0!==e?e:0,a=n?Math.max(0,i-1):0,o=this._spec.heightRatio||.5,l=(s-r*Math.max(0,i-1))/(i+o*a);return t?n?l*o:0:l}_getSecondaryAxisLength(t){const e=Number.isNaN(t)||!Number.isFinite(t)?0:t,i=this._computeMaxSize(),s=this._computeMinSize();return s+(i-s)*e}_getPositionByData(t){var e;const i=null===(e=this.getViewData().latestData)||void 0===e?void 0:e.findIndex((e=>e[this._categoryField]===t[this._categoryField]&&e[yT]===t[yT]));if(!M(i)||i<0)return{};const s=this.isTransformLevel(t),n=this._isHorizontal(),r=n?this.getLayoutRect().height:this.getLayoutRect().width,a=n?this.getLayoutRect().width:this.getLayoutRect().height,o=r/2;let l=0;const h=this._getMainAxisLength(),d=this._getMainAxisLength(!0);return l+=i*(h+d),l+=s?-d/2:h/2,!this._spec.isTransform&&this._spec.gap&&(l+=this._spec.gap*i),this._isReverse()&&(l=a-l),this._isHorizontal()?{x:l,y:o}:{x:o,y:l}}_getPolygonPoints(t,e,i,s,n,r){const a=t[0],o=t[1];switch(this._funnelOrient){case"left":return[{x:a-r,y:o+e},{x:a-r,y:o-s},{x:a+r,y:o-n},{x:a+r,y:o+i}];case"right":return[{x:a+r,y:o-s},{x:a+r,y:o+s},{x:a-r,y:o+i},{x:a-r,y:o-i}];case"bottom":return[{x:a+e,y:o+r},{x:a-s,y:o+r},{x:a-n,y:o-r},{x:a+i,y:o-r}];default:return[{x:a-e,y:o-r},{x:a+s,y:o-r},{x:a+n,y:o+r},{x:a-i,y:o+r}]}}_getPolygonCenter(t){if(this._isHorizontal()){const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}const e=(t[0].x+t[3].x)/2,i=(t[0].y+t[3].y)/2;return{x:(e+(t[1].x+t[2].x)/2)/2,y:(i+(t[1].y+t[2].y)/2)/2}}_adjustPoints(t){let e,i,s;return this._isHorizontal()?(s="y","left"===this._funnelOrient?(e="bottom"===this._funnelAlign?-t[1].y:t[1].y,i="bottom"===this._funnelAlign?-t[2].y:t[2].y):(e="bottom"===this._funnelAlign?-t[0].y:t[0].y,i="bottom"===this._funnelAlign?-t[3].y:t[3].y)):(s="x","top"===this._funnelOrient?(e="left"===this._funnelAlign?t[0].x:-t[0].x,i="left"===this._funnelAlign?t[3].x:-t[3].x):(e="left"===this._funnelAlign?t[1].x:-t[1].x,i="left"===this._funnelAlign?t[2].x:-t[2].x)),t[0][s]-=e,t[1][s]-=e,t[2][s]-=i,t[3][s]-=i,t}_computeLabelPosition(t){const e=this.getPoints(t);return this._getPolygonCenter(e)}_computeLabelLimit(t,e){const i=null==e?void 0:e.limit;if(h(i))return i;const s=this.getPoints(t);return"shapeSize"===i?this._isHorizontal()?Math.abs(s[3].x-s[0].x):(Math.abs(s[0].x-s[1].x)+Math.abs(s[2].x-s[3].x))/2:this._isHorizontal()?Math.abs(s[3].x-s[0].x):void 0}_computeOuterLabelPosition(t){var e,i;let s,n,r=null===(e=this._spec.outerLabel)||void 0===e?void 0:e.position,a="center",o="middle";if(r=this._isHorizontal()?["top","bottom"].includes(r)?r:"bottom"===this._funnelAlign?"top":"bottom":["left","right"].includes(r)?r:"left"===this._funnelAlign?"right":"left",!1!==(null===(i=this._spec.outerLabel)||void 0===i?void 0:i.alignLabel))({x:s,y:n}=this._getPositionByData(t)),"left"===r?(s=0,a="left"):"right"===r?(s=this.getLayoutRect().width,a="right"):"top"===r?(n=0,o="top"):"bottom"===r&&(n=this.getLayoutRect().height,o="bottom");else{const{x2:e,y2:i}=this._computeOuterLabelLinePosition(t);s=e,n=i,"left"===r?(s-=5,a="right"):"right"===r?(s+=5,a="left"):"top"===r?(n-=5,o="bottom"):"bottom"===r&&(n+=5,o="top")}return{x:s,y:n,align:a,textBaseline:o}}_computeOuterLabelLimit(t){var e,i,s,n,r;if(this._isHorizontal())return this._getMainAxisLength(this.isTransformLevel(t));const a=this.getPoints(t),o=(Math.abs(a[0].x-a[1].x)+Math.abs(a[2].x-a[3].x))/2,l=this.getCategoryField(),h=null===(s=null===(i=null===(e=this._labelMark)||void 0===e?void 0:e.getComponent())||void 0===i?void 0:i.getProduct().getGroupGraphicItem().find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[l])===t[l]}),!0))||void 0===s?void 0:s.AABBBounds,d=h?h.x2-h.x1:0,c=this._funnelOuterLabelMark.line?Cj:0;let u=this.getLayoutRect().width-Math.max(o,d);return"center"===this._funnelAlign&&(u/=2),u-c-(null!==(r=null===(n=this._spec.outerLabel)||void 0===n?void 0:n.spaceWidth)&&void 0!==r?r:5)}_computeOuterLabelLinePosition(t){var e,i,s,n,r,a,o,l,h,d,c;const u=this.getCategoryField(),p=null===(r=null===(n=null===(s=null===(i=null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)||void 0===i?void 0:i.getProduct())||void 0===s?void 0:s.elements)||void 0===n?void 0:n.find((e=>{var i;return(null===(i=e.data[0])||void 0===i?void 0:i[u])===t[u]})))||void 0===r?void 0:r.getBounds(),g=null===(l=null===(o=null===(a=this._labelMark)||void 0===a?void 0:a.getComponent())||void 0===o?void 0:o.getProduct().getGroupGraphicItem().find((({attribute:e,type:i})=>{var s;return"text"===i&&(null===(s=e.data)||void 0===s?void 0:s[u])===t[u]}),!0))||void 0===l?void 0:l.AABBBounds,m=null!==(h=this._spec.outerLabel)&&void 0!==h?h:{};let _,f,v,y;if(this._isHorizontal()){const e=null!==(d=m.spaceWidth)&&void 0!==d?d:5,i=this.getPoints(t),s=(Math.abs(i[0].y-i[1].y)+Math.abs(i[2].y-i[3].y))/2;return"top"===this._spec.outerLabel.position||"bottom"===this._funnelAlign?(v=this._getPolygonCenter(i).y-s/2-e,y=!1!==m.alignLabel?(null==p?void 0:p.y2)+e:v-e,_=this._getPolygonCenter(i).x,v-y{this._isValidSeries(t.type)&&Object.keys(e).forEach((i=>{i in t||(t[i]=e[i])}))})):t.series=[e]}}class jj extends cO{constructor(){super(...arguments),this.transformerConstructor=Yj,this.type="funnel",this.seriesType=_l.funnel}}jj.type="funnel",jj.seriesType=_l.funnel,jj.transformerConstructor=Yj;class Hj extends Dj{constructor(){super(...arguments),this.type=Hj.type}}Hj.type="pyramid3d";const zj=()=>{$l.registerMark(Hj.type,Hj),Sx(),vS(),_c.registerGraphic(Jd.pyramid3d,hS),LC()};class Nj extends Bj{_transformLabelSpec(t){this._addMarkLabelSpec(t,"funnel3d"),t.isTransform&&this._addMarkLabelSpec(t,"transform3d","transformLabel")}}class Vj extends Fj{constructor(){super(...arguments),this.type=_l.funnel3d,this._funnelMarkName="funnel3d",this._funnelMarkType="pyramid3d",this._transformMarkName="transform3d",this._transformMarkType="pyramid3d",this.transformerConstructor=Nj}initMark(){var t,e,i,s,n,r,a,o;if(this._funnelMark=this._createMark(Object.assign(Object.assign({},Vj.mark.funnel3d),{name:this._funnelMarkName,type:this._funnelMarkType}),{themeSpec:null===(t=this._theme)||void 0===t?void 0:t.funnel3d,key:this._seriesField,isSeriesMark:!0,support3d:!0}),this._spec.isTransform&&(this._funnelTransformMark=this._createMark(Object.assign(Object.assign({},Vj.mark.transform3d),{name:this._transformMarkName,type:this._transformMarkType}),{themeSpec:null===(e=this._theme)||void 0===e?void 0:e.transform3d,key:this._seriesField,skipBeforeLayouted:!1,dataView:this._viewDataTransform.getDataView(),dataProductId:this._viewDataTransform.getProductId()})),null===(s=null===(i=this._spec)||void 0===i?void 0:i.outerLabel)||void 0===s?void 0:s.visible){const{line:t}=null!==(n=this._spec.outerLabel)&&void 0!==n?n:{},{line:e}=null!==(a=null===(r=this._theme)||void 0===r?void 0:r.outerLabel)&&void 0!==a?a:{};this._funnelOuterLabelMark.label=this._createMark(Vj.mark.outerLabel,{themeSpec:null===(o=this._theme)||void 0===o?void 0:o.outerLabel,key:this._seriesField,markSpec:this._spec.outerLabel}),this._funnelOuterLabelMark.line=this._createMark(Vj.mark.outerLabelLine,{themeSpec:e,key:this._seriesField,markSpec:t,depend:[this._funnelOuterLabelMark.label]})}}initMarkStyle(){super.initMarkStyle();const t=this._funnelMark;t&&this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",Py.Series)}initLabelMarkStyle(t){var e,i;super.initLabelMarkStyle(t),this.setMarkStyle(t,{z:t=>{if(this._isHorizontal())return 0;const e=this.getPoints(t),i=Math.max(Math.abs(e[0].x-e[1].x),Math.abs(e[2].x-e[3].x));return(this._computeMaxSize()-i)/2}},"normal",Py.Series),this._labelMark=t,(null===(e=this._funnelOuterLabelMark)||void 0===e?void 0:e.label)&&this._funnelOuterLabelMark.label.setDepend(t.getComponent()),(null===(i=this._funnelOuterLabelMark)||void 0===i?void 0:i.line)&&this._funnelOuterLabelMark.line.setDepend(...this._funnelOuterLabelMark.line.getDepend())}}Vj.type=_l.funnel3d,Vj.mark=Ij,Vj.transformerConstructor=Nj;class Wj extends cO{constructor(){super(...arguments),this.transformerConstructor=Yj,this.type="funnel3d",this.seriesType=_l.funnel3d}}function Gj(t){return()=>"vertical"===t.direction?{orient:"negative"}:{orient:"positive"}}Wj.type="funnel3d",Wj.seriesType=_l.funnel3d,Wj.transformerConstructor=Yj;const Uj=t=>({type:"horizontal"===t.direction?"growWidthOut":"growHeightOut",options:Gj(t)}),$j={type:"fadeIn"};function Xj(t,e){return!1===e?{}:"fadeIn"===e?$j:(t=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:Gj(t)}))(t)}class Kj extends UT{getDefaultTooltipPattern(t,e){const i=super.getDefaultTooltipPattern(t,e);switch(t){case"mark":case"group":return i;case"dimension":return i.visible=!1,i}return null}}const qj=Object.assign(Object.assign({},rL),{track:{name:"track",type:"rect"},progress:{name:"progress",type:"rect"},group:{name:"group",type:"group"}});class Zj extends NC{constructor(){super(...arguments),this.type=_l.linearProgress,this._progressMark=null,this._trackMark=null,this._defaultProgressCustomShape=(t,e,i)=>{var s,n;const r=null===(s=this._spec)||void 0===s?void 0:s.cornerRadius,a=M(e.width)?e.width:e.x1-e.x,o=M(e.height)?e.height:e.y1-e.y,l=Math.min(0,a),h=Math.max(0,a),d=Math.min(0,o),c=Math.max(0,o);if(r>0){let t=r;if("vertical"===(null===(n=this._spec)||void 0===n?void 0:n.direction)){if(t=Math.min(Math.abs(a/2),r),2*t>Math.abs(o)){const e=Math.acos((t-Math.abs(o)/2)/t);return i.moveTo(l+t,d),i.arc(l+t,d+t,t,1.5*Math.PI,1.5*Math.PI-e,!0),i.arc(l+t,c-t,t,e+Math.PI/2,Math.PI/2,!0),i.lineTo(h-r,c),i.arc(h-t,c-t,t,Math.PI/2,Math.PI/2-e,!0),i.arc(h-t,d+t,t,-Math.PI/2+e,-Math.PI/2,!0),i.lineTo(l+t,d),i.closePath(),i}}else if(t=Math.min(Math.abs(o/2),r),2*t>Math.abs(a)){const e=Math.acos((t-Math.abs(a)/2)/t);return i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,Math.PI+e),i.arc(h-t,d+t,t,-e,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,e),i.arc(l+t,c-t,t,Math.PI-e,Math.PI),i.closePath(),i}i.moveTo(l,d+t),i.arc(l+t,d+t,t,Math.PI,1.5*Math.PI),i.lineTo(h-t,d),i.arc(h-t,d+t,t,-Math.PI/2,0),i.lineTo(h,c-t),i.arc(h-t,c-t,t,0,Math.PI/2),i.lineTo(l+t,c),i.arc(l+t,c-t,t,Math.PI/2,Math.PI),i.closePath()}else i.moveTo(l,d),i.lineTo(h,d),i.lineTo(h,c),i.lineTo(l,c),i.closePath();return i}}initMark(){this._initTrackMark(),this._initProgressMark()}initMarkStyle(){this._initTrackMarkStyle(),this._initProgressMarkStyle()}_initProgressMark(){var t,e,i;return this._progressMark=this._createMark(Zj.mark.progress,{isSeriesMark:!0,customShape:null!==(e=null===(t=this._spec.progress)||void 0===t?void 0:t.customShape)&&void 0!==e?e:this._defaultProgressCustomShape,stateSort:null===(i=this._spec.progress)||void 0===i?void 0:i.stateSort}),this._progressMark}_initProgressMarkStyle(){var t,e,i,s;const n=this._progressMark;if(n)if("vertical"===this._spec.direction){const i=this._spec.progress||{},s=null!==(t=i.leftPadding)&&void 0!==t?t:0,r=null!==(e=i.rightPadding)&&void 0!==e?e:0;this.setMarkStyle(n,{x:t=>{var e,i;return ax(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2+s},y1:t=>{var e,i;return ax(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:()=>{var t;return null===(t=this._yAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},width:this._spec.bandWidth-s-r,cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Py.Series)}else{const t=this._spec.progress||{},e=null!==(i=t.topPadding)&&void 0!==i?i:0,r=null!==(s=t.bottomPadding)&&void 0!==s?s:0;this.setMarkStyle(n,{x1:t=>{var e,i;return ax(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))},y:t=>{var i,s;return ax(this.dataToPositionY(t),null===(s=null===(i=this._yAxisHelper)||void 0===i?void 0:i.getScale)||void 0===s?void 0:s.call(i,0))-this._spec.bandWidth/2+e},height:this._spec.bandWidth-e-r,x:()=>{var t;return null===(t=this._xAxisHelper)||void 0===t?void 0:t.dataToPosition([0],{bandPosition:this._bandPosition})},cornerRadius:this._spec.cornerRadius,fill:this.getColorAttribute()},"normal",Py.Series)}}_initTrackMark(){var t,e;return this._trackMark=this._createMark(Zj.mark.track,{customShape:null===(t=this._spec.track)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.track)||void 0===e?void 0:e.stateSort}),this._trackMark}_initTrackMarkStyle(){const t=this._trackMark;t&&("vertical"===this._spec.direction?this.setMarkStyle(t,{x:t=>{var e,i;return ax(this.dataToPositionX(t),null===(i=null===(e=this._xAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},y:0,width:this._spec.bandWidth,height:()=>this._scaleY.range()[0],cornerRadius:this._spec.cornerRadius},"normal",Py.Series):this.setMarkStyle(t,{x:0,y:t=>{var e,i;return ax(this.dataToPositionY(t),null===(i=null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale)||void 0===i?void 0:i.call(e,0))-this._spec.bandWidth/2},height:this._spec.bandWidth,width:()=>this._scaleX.range()[1],cornerRadius:this._spec.cornerRadius},"normal",Py.Series))}initInteraction(){const t=[];this._trackMark&&t.push(this._trackMark),this._progressMark&&t.push(this._progressMark),this._parseInteractionConfig(t)}initAnimation(){var t,e,i,s;const n={direction:this.direction},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._progressMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("linearProgress"))||void 0===i?void 0:i(n,r),DC("progress",this._spec,this._markAttributeContext))),this._trackMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),DC("track",this._spec,this._markAttributeContext)))}initTooltip(){this._tooltipHelper=new Kj(this),this._progressMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._progressMark),this._trackMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._trackMark)}getActiveMarks(){return[this._progressMark]}}Zj.type=_l.linearProgress,Zj.mark=qj;class Jj extends aO{needAxes(){return!1}_getDefaultSeriesSpec(t){var e,i;const s=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},s),{direction:null!==(e=t.direction)&&void 0!==e?e:"horizontal",cornerRadius:null!==(i=t.cornerRadius)&&void 0!==i?i:0,bandWidth:t.bandWidth,progress:t.progress,track:t.track})}transformSpec(t){var e,i;if(super.transformSpec(t),t.axes||(t.axes=[]),"vertical"===t.direction){let i=null,s=null;(null!==(e=t.axes)&&void 0!==e?e:[]).forEach((t=>{const{orient:e}=t;"left"===e&&(i=t),"bottom"===e&&(s=t)})),i||(i={orient:"left",visible:!1},t.axes.push(i)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),D(s.type)&&(s.type="band"),D(i.type)&&(i.type="linear");const n=NE(i,{min:0,max:1});D(i.min)&&(i.min=n.min),D(i.max)&&(i.max=n.max)}else{let e=null,s=null;(null!==(i=t.axes)&&void 0!==i?i:[]).forEach((t=>{const{orient:i}=t;"left"===i&&(e=t),"bottom"===i&&(s=t)})),e||(e={type:"band",orient:"left",visible:!1},t.axes.push(e)),s||(s={orient:"bottom",visible:!1},t.axes.push(s)),D(s.type)&&(s.type="linear"),D(e.type)&&(e.type="band");const n=NE(s,{min:0,max:1});D(s.min)&&(s.min=n.min),D(s.max)&&(s.max=n.max)}}}class Qj extends cO{constructor(){super(...arguments),this.transformerConstructor=Jj,this.type="linearProgress",this.seriesType=_l.linearProgress}}function tH(t,e,i,s,n,r,a,o,l){t.setMarkStyle(e,{textAlign:t=>{if("vertical"===l())return"center";const e=n(t),s=r(t);if("middle"===i)return"center";if(e>=s){if("start"===i)return"left";if("end"===i)return"right";if("outside"===i)return"left"}else{if("start"===i)return"right";if("end"===i)return"left";if("outside"===i)return"right"}return"center"},textBaseline:t=>{if("horizontal"===l())return"middle";const e=a(t),s=o(t);if("middle"===i)return"middle";if(s>=e){if("start"===i)return"bottom";if("end"===i)return"top";if("outside"===i)return"bottom"}else{if("start"===i)return"top";if("end"===i)return"bottom";if("outside"===i)return"top"}return"middle"}}),t.setMarkStyle(e,{x:t=>{const e=l(),a=n(t),o=r(t);if("vertical"===e)return(a+o)/2;if("middle"===i)return(a+o)/2;if(a>=o){if("start"===i)return o+s;if("end"===i)return a-s;if("outside"===i)return a+s}else{if("start"===i)return o-s;if("end"===i)return a+s;if("outside"===i)return a-s}return(a+o)/2},y:t=>{const e=l(),n=a(t),r=o(t);if("horizontal"===e)return(n+r)/2;if("middle"===i)return(n+r)/2;if(n>=r){if("start"===i)return r+s;if("end"===i)return n-s;if("outside"===i)return n+s}else{if("start"===i)return r-s;if("end"===i)return n+s;if("outside"===i)return n-s}return(n+r)/2}},"normal",Py.Series)}Qj.type="linearProgress",Qj.seriesType=_l.linearProgress,Qj.transformerConstructor=Jj,JA(Qj,gO);class eH extends UT{getDefaultTooltipPattern(t){return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{key:this.markTooltipKeyCallback,value:t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]],hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]}}}const iH=t=>({type:"growCenterIn",options:{direction:"horizontal"===t.direction?"x":"y"}}),sH={type:"fadeIn"},nH=t=>({type:"growCenterOut",options:{direction:"horizontal"===t.direction?"x":"y"}});function rH(t,e){return"fadeIn"===e?sH:iH(t)}const aH=Object.assign(Object.assign({},PO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}}),oH=Object.assign(Object.assign({},OO),{minLabel:{name:"minLabel",type:"text"},maxLabel:{name:"maxLabel",type:"text"}});class lH extends BO{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){var e;"bothEnd"!==(null===(e=t.label)||void 0===e?void 0:e.position)&&this._addMarkLabelSpec(t,"bar")}}class hH extends FO{constructor(){super(...arguments),this.type=_l.rangeColumn,this._barMarkType="rect",this._barName=_l.bar,this.transformerConstructor=lH}initMark(){var t,e,i,s,n,r,a,o,l,h;this._initBarBackgroundMark();const d=null===(t=this._spec.label)||void 0===t?void 0:t.position;this._barMark=this._createMark(hH.mark.bar,{morph:RC(this._spec,hH.mark.bar.name),defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:null===(e=this._spec.bar)||void 0===e?void 0:e.customShape,stateSort:null===(i=this._spec.bar)||void 0===i?void 0:i.stateSort}),!1!==(null===(s=this._spec.label)||void 0===s?void 0:s.visible)&&"bothEnd"===d&&(!1!==(null===(r=null===(n=this._spec.label)||void 0===n?void 0:n.minLabel)||void 0===r?void 0:r.visible)&&(this._minLabelMark=this._createMark(hH.mark.minLabel,{markSpec:null===(a=this._spec.label)||void 0===a?void 0:a.minLabel})),!1!==(null===(l=null===(o=this._spec.label)||void 0===o?void 0:o.maxLabel)||void 0===l?void 0:l.visible)&&(this._maxLabelMark=this._createMark(hH.mark.maxLabel,{markSpec:null===(h=this._spec.label)||void 0===h?void 0:h.maxLabel})))}initMarkStyle(){var t,e,i,s,n,r,a,o,l,h;super.initMarkStyle();const d=this._minLabelMark,c=null===(t=this._spec.label)||void 0===t?void 0:t.minLabel;d&&(this.setMarkStyle(d,{fill:null!==(i=null===(e=null==c?void 0:c.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[0]]:t[this._spec.yField[0]];return(null==c?void 0:c.formatMethod)?c.formatMethod(e,t):e}}),tH(this,d,null!==(s=null==c?void 0:c.position)&&void 0!==s?s:"end",null!==(n=null==c?void 0:c.offset)&&void 0!==n?n:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)));const u=this._maxLabelMark,p=null===(r=this._spec.label)||void 0===r?void 0:r.maxLabel;u&&(this.setMarkStyle(u,{fill:null!==(o=null===(a=null==p?void 0:p.style)||void 0===a?void 0:a.fill)&&void 0!==o?o:this.getColorAttribute(),text:t=>{const e="horizontal"===this._spec.direction?t[this._spec.xField[1]]:t[this._spec.yField[1]];return(null==p?void 0:p.formatMethod)?p.formatMethod(e,t):e}}),tH(this,u,null!==(l=null==p?void 0:p.position)&&void 0!==l?l:"start",null!==(h=null==p?void 0:p.offset)&&void 0!==h?h:"vertical"===this._direction?-20:-25,(t=>this._barMark.getAttribute("x",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("x",t)+this._barMark.getAttribute("width",t):this._barMark.getAttribute("x1",t)),(t=>this._barMark.getAttribute("y",t)),(t=>"vertical"===this._direction?this._barMark.getAttribute("y1",t):this._barMark.getAttribute("y",t)+this._barMark.getAttribute("height",t)),(()=>this._direction)))}initLabelMarkStyle(t){t&&(this.setMarkStyle(t,{text:t=>{let e,i;return"horizontal"===this._spec.direction?(e=t[this._spec.xField[0]],i=t[this._spec.xField[1]]):(e=t[this._spec.yField[0]],i=t[this._spec.yField[1]]),e+"-"+i},z:this._fieldZ?this.dataToPositionZ.bind(this):null}),this._labelMark=t)}_dataToPosX(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[0]),{bandPosition:this._bandPosition})}_dataToPosX1(t){return this._xAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}_dataToPosY(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[0]),{bandPosition:this._bandPosition})}_dataToPosY1(t){return this._yAxisHelper.dataToPosition(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}initAnimation(){var t,e,i,s,n;const r=zC(this),a=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._barMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("rangeColumn"))||void 0===i?void 0:i({direction:this.direction},a),DC("bar",this._spec,this._markAttributeContext),r)),this._minLabelMark&&this._minLabelMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),DC("label",this._spec,this._markAttributeContext),r)),this._maxLabelMark&&this._maxLabelMark.setAnimationConfig(EC(null===(n=$l.getAnimationInKey("fadeInOut"))||void 0===n?void 0:n(),DC("label",this._spec,this._markAttributeContext),r))}initTooltip(){this._tooltipHelper=new eH(this),this._barMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._barMark),this._minLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._minLabelMark),this._maxLabelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._maxLabelMark),this._labelMark&&this._tooltipHelper.ignoreTriggerSet.mark.add(this._labelMark)}}hH.type=_l.rangeColumn,hH.mark=aH,hH.transformerConstructor=lH;class dH extends aO{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barWidth:t.barWidth,barMaxWidth:t.barMaxWidth,barMinWidth:t.barMinWidth,barGapInGroup:t.barGapInGroup,barBackground:t.barBackground,barMinHeight:t.barMinHeight,stackCornerRadius:t.stackCornerRadius});return s.bar=t.bar,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}transformSpec(t){super.transformSpec(t),fy(t)}}class cH extends cO{constructor(){super(...arguments),this.transformerConstructor=dH,this.type="rangeColumn",this.seriesType=_l.rangeColumn}}cH.type="rangeColumn",cH.seriesType=_l.rangeColumn,cH.transformerConstructor=dH;class uH extends hH{constructor(){super(...arguments),this.type=_l.rangeColumn3d,this._barMarkType="rect3d",this._barName=_l.bar3d}}uH.type=_l.rangeColumn3d,uH.mark=oH;class pH extends aO{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{barGapInGroup:t.barGapInGroup});return s.bar3d=t.bar3d,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s}}class gH extends cO{constructor(){super(...arguments),this.transformerConstructor=pH,this.type="rangeColumn3d",this.seriesType=_l.rangeColumn3d}}gH.type="rangeColumn3d",gH.seriesType=_l.rangeColumn3d,gH.transformerConstructor=pH;const mH=(t,e)=>{const i=(t-e[0])/(e[1]-e[0]||1);return Math.max(0,Math.min(1,i))},_H=t=>{const e=t.mark.elements.filter((t=>t.diffState===Zd.update)),i=ja(e.map((t=>{var e;return null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth})));return e.filter((t=>{var e;return(null===(e=null==t?void 0:t.data)||void 0===e?void 0:e[0].depth)===i}))},fH=(t,e,i)=>Ym(t)?[e,i]:[ja(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),Ya(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],vH=t=>({channel:{startAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=_H(i),a=fH(r,s,n);return mH(e.startAngle,a)*(n-s)+s},to:t=>t.startAngle},endAngle:{from:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=_H(i),a=fH(r,s,n);return mH(e.endAngle,a)*(n-s)+s},to:t=>t.endAngle},outerRadius:{from:t=>t.innerRadius,to:t=>t.outerRadius},innerRadius:{from:t=>t.innerRadius,to:t=>t.innerRadius}}}),yH=t=>[ja(t.map((t=>1*t.getGraphicAttribute("startAngle",!1)))),Ya(t.map((t=>1*t.getGraphicAttribute("endAngle",!1))))],bH=t=>({channel:{startAngle:{from:(t,e)=>e.getGraphicAttribute("startAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=_H(i),a=yH(r);return mH(i.getGraphicAttribute("startAngle",!1),a)*(n-s)+s}},endAngle:{from:(t,e)=>e.getGraphicAttribute("endAngle",!1),to:(e,i)=>{const{startAngle:s,endAngle:n}=t.animationInfo(),r=_H(i),a=yH(r);return mH(i.getGraphicAttribute("endAngle",!1),a)*(n-s)+s}},outerRadius:{from:(t,e)=>e.getGraphicAttribute("outerRadius",!1),to:()=>t.animationInfo().innerRadius},innerRadius:{from:(t,e)=>e.getGraphicAttribute("innerRadius",!1),to:()=>t.animationInfo().innerRadius}}}),xH=(t,e)=>{switch(e){case"fadeIn":return{type:"fadeIn"};case"growAngle":return{type:"growAngleIn"};default:return{type:"growRadiusIn"}}},SH=(t,e=[],i)=>{const s=(null==i?void 0:i.maxDepth)>=0;return t.forEach((t=>{(!s||t.depth<=i.maxDepth)&&(e.push((null==i?void 0:i.callback)?i.callback(t):t),t.children&&(s&&t.depth===i.maxDepth?(t.children=null,t.isLeaf=!0):SH(t.children,e,i)))})),e},MH=(t,e={})=>{if(!t)return[];const i=[];return SH(t,i,e),i};function kH(t,e,i,s,n,r={x0:"x0",x1:"x1",y0:"y0",y1:"y1"}){const a=t.children;let o,l=-1;const h=a.length,d=t.value&&(s-e)/t.value;for(;++lD(t)?e:S(t)?e*parseFloat(t)/100:t;function wH(t){if(qo(t))return t;const e=+t;return qo(e)?e:0}const TH=(t,e,i=0,s=-1,n,r,a="value")=>{let o=0,l=null!=s?s:-1,h=i;return t.forEach(((t,s)=>{var d,c;const u={flattenIndex:++l,key:r?r(t):`${null!==(d=null==n?void 0:n.key)&&void 0!==d?d:""}-${s}`,maxDepth:-1,depth:i,index:s,value:t[a],isLeaf:!0,datum:n?n.datum.concat(t):[t],parentKey:null==n?void 0:n.key};if(null===(c=t.children)||void 0===c?void 0:c.length){u.children=[],u.isLeaf=!1;const e=TH(t.children,u.children,i+1,l,u,r,a);u.value=D(t[a])?e.sum:Math.max(e.sum,wH(t[a])),l=e.flattenIndex,h=Math.max(e.maxDepth,h)}else u.isLeaf=!0,u.value=wH(t[a]);o+=Math.abs(u.value),e.push(u)})),{sum:o,maxDepth:h,flattenIndex:l}},LH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;n=e(t,s,i,n),(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=LH(t.children,e,t,n))})),s},CH=(t,e,i,s)=>{let n=s;return t.forEach(((t,s)=>{var r;(null===(r=t.children)||void 0===r?void 0:r.length)&&(n=CH(t.children,e,t,n)),n=e(t,s,i,n)})),n},EH={x0:"startAngle",x1:"endAngle",y0:"innerRadius",y1:"outerRadius"};class DH{constructor(t){this._layoutNode=t=>{if(t.maxDepth=this._maxDepth,t.children){const e=this._parsedInnerRadius[t.depth+1],i=this._parsedOutterRadius[t.depth+1];kH(t,t.startAngle,Math.min(e,i),t.endAngle,Math.max(e,i),EH);const s=y(this.options.label)?this.options.label[t.depth+1]:this.options.label;t.children.forEach((t=>{if(t.x=this._parsedCenter[0],t.y=this._parsedCenter[1],s)return this._layoutLabel(t,v(s)?{align:"center",rotate:"radial"}:s)}))}},this.options=t?Object.assign({},DH.defaultOpionts,t):Object.assign({},DH.defaultOpionts);const e=this.options.nodeKey,i=ys(e)?e:e?Em(e):null;this._getNodeKey=i,this._maxDepth=-1}_parseRadius(t,e){const i=t.x0+AH(this.options.center[0],t.width),s=t.y0+AH(this.options.center[1],t.height),n=Math.min(t.width/2,t.height/2),r=this.options.innerRadius,a=this.options.outerRadius,o=y(r),l=o?r.map((t=>AH(t,n))):AH(r,n),h=y(a),d=this.options.gapRadius,c=h?a.map((t=>AH(t,n))):AH(a,n),u=tb(0,e+1);if(o)this._parsedInnerRadius=u.map(((t,e)=>{const i=l[e];return D(i)?n:i})),this._parsedOutterRadius=u.map(((t,i)=>{var s,r;return h?null!==(s=c[i])&&void 0!==s?s:n:iD(c[e])?n:c[e])),this._parsedInnerRadius=u.map(((t,e)=>{var i;return 0===e?l:this._parsedOutterRadius[e-1]-(y(d)?null!==(i=d[e])&&void 0!==i?i:0:d)}));else{const t=AH(r,n),i=(c-t)/(e+1);this._parsedInnerRadius=u.map(((e,s)=>t+s*i)),this._parsedOutterRadius=u.map(((t,e)=>{var s;return this._parsedInnerRadius[e]+i-(y(d)?null!==(s=d[e])&&void 0!==s?s:0:d)}))}this._parsedCenter=[i,s],this._maxRadius=n}layout(t,e){const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const s=[],n=TH(t,s,0,-1,null,this._getNodeKey);return this._parseRadius(i,n.maxDepth),this._maxDepth=n.maxDepth,this._layout(s,{flattenIndex:-1,maxDepth:-1,key:"-1",depth:-1,index:-1,value:n.sum,datum:null,children:s,startAngle:this.options.startAngle,endAngle:this.options.endAngle}),s}_layout(t,e){this._layoutNode(e),t.forEach((t=>{var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t.children,t):this._layoutNode(t)}))}_layoutLabel(t,e){var i;const s=(t.startAngle+t.endAngle)/2,n=("start"===e.align?t.innerRadius:"end"===e.align?t.outerRadius:(t.innerRadius+t.outerRadius)/2)+(null!==(i=e.offset)&&void 0!==i?i:0),r=Tt({x:this._parsedCenter[0],y:this._parsedCenter[1]},n,s);if(t.label={x:r.x,y:r.y,textBaseline:"middle"},"tangential"===e.rotate)t.label.angle=s-Math.PI/2,t.label.textAlign="center",t.label.maxLineWidth=Math.abs(t.endAngle-t.startAngle)*n;else{const i=s%(2*Math.PI),n=i<0?i+2*Math.PI:i;n>Math.PI/2&&n<1.5*Math.PI?(t.label.angle=n+Math.PI,t.label.textAlign="start"===e.align?"end":"end"===e.align?"start":"center"):(t.label.angle=n,t.label.textAlign=e.align),t.label.maxLineWidth=t.isLeaf?void 0:Math.abs(t.outerRadius-t.innerRadius)}}}DH.defaultOpionts={startAngle:Math.PI/2,endAngle:-3*Math.PI/2,center:["50%","50%"],gapRadius:0,innerRadius:0,outerRadius:"70%"};const PH=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return new DH(i).layout(t,{width:s,height:n})};class OH extends UT{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const RH=(t,e,i="key",s="children")=>{for(let n=0;n{for(let n=0;n{const r=Object.assign({},t);return Array.isArray(r[n])&&(r[n]=BH(r[n],e,i,s,n)),r})).filter((t=>+t[s]>=e&&+t[s]<=i||t[n]&&t[n].length>0)):t}var FH;!function(t){t.DrillDown="drillDown",t.DrillUp="drillUp"}(FH||(FH={}));const YH=(t,e)=>{const i=e.info(),s=e.keyField(),n=null==i?void 0:i.key;if(D(n))return t;if(i.type===FH.DrillDown)return Ba(RH(t,n,s,"children"));if(i.type===FH.DrillUp){const e=IH(t,n,s,"children");if(e)return Ba(e)}return t};class jH{_getDrillTriggerEvent(t){var e;const{mode:i}=this._drillParams;return null===(e=GI(i))||void 0===e?void 0:e[t]}_hideTooltip(){const t=this.getChart().getComponentsByType(r.tooltip)[0];t&&t.hideTooltip()}initDrillable(t){this._drillParams=t}initDrillableData(t){const{getRawData:e}=this._drillParams;Lp(t,"drillFilter",YH),e().transform({type:"drillFilter",options:{info:()=>this._drillInfo,keyField:()=>this._drillParams.drillField()}})}bindDrillEvent(){const{event:t,getRawData:e,drillField:i}=this._drillParams,s=i();this._getDrillTriggerEvent("start")&&t.on(this._getDrillTriggerEvent("start"),(t=>{var i,n,r;if(D(t.datum)||D(null===(i=t.datum)||void 0===i?void 0:i[s]))return void this.drillUp();this._hideTooltip();const a=t.datum[s],o=null!==(r=null===(n=this._drillInfo)||void 0===n?void 0:n.path)&&void 0!==r?r:[],l=((t,e,i="key",s="children")=>{const n=[],r=(t,a)=>{for(const o of t){if(o[i]===e)return n.push(...a,o[i].toString()),!0;if(o[s]){const t=r(o[s],[...a,o[i]]);if(!0===t)return t}}return!1};return r(t,[]),n})(e().rawData,a,s,"children");o[o.length-1]===l[l.length-1]?this.drillUp():this.drillDown(l)}))}drillDown(t=[]){const{getRawData:e,event:i}=this._drillParams;if(!y(t)||Ym(t))return t;const s=t[t.length-1];return this._drillInfo={key:s,path:t,type:FH.DrillDown},e().reRunAllTransform(),i.emit(Hd.drill,{value:{path:t,type:FH.DrillDown},model:this}),t}drillUp(){var t,e;const{getRawData:i,event:s}=this._drillParams,n=null!==(e=null===(t=this._drillInfo)||void 0===t?void 0:t.path)&&void 0!==e?e:[];if(!y(n)||Ym(n))return n;const r=n.pop();return this._drillInfo={key:r,path:n,type:FH.DrillUp},i().reRunAllTransform(),s.emit(Hd.drill,{value:{path:n,type:FH.DrillUp},model:this}),n}}const HH=Object.assign(Object.assign({},rL),{sunburst:{name:"sunburst",type:"arc"}});class zH extends iB{constructor(){super(...arguments),this.type=_l.sunburst}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:QT),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:yT},getRawData:()=>this.getRawData()}),this._startAngle=At(this._spec.startAngle),this._endAngle=At(this._spec.endAngle),this._centerX=this._spec.centerX,this._centerY=this._spec.centerY,this._offsetX=this._spec.offsetX,this._offsetY=this._spec.offsetY,this.__innerRadius=this._spec.innerRadius,this.__outerRadius=this._spec.outerRadius,this._gap=this._spec.gap,this._labelLayout=this._spec.labelLayout,this._sunburst=this._spec.sunburst,this._label=this._spec.label,this._labelAutoVisible=this._spec.labelAutoVisible}initData(){super.initData();const t=this.getRawData();t&&(this._spec.drill&&this.initDrillableData(this._dataSet),Lp(this._dataSet,"sunburstLayout",PH),Lp(this._dataSet,"flatten",MH),t.transform({type:"sunburstLayout",options:()=>{const{innerRadius:t,outerRadius:e,gap:i,label:s}=this._computeLevel();return{nodeKey:this._categoryField,width:this.getLayoutRect().width,height:this.getLayoutRect().height,center:[M(this._centerX)?this._centerX:this.getLayoutRect().width/2,M(this._centerY)?this._centerY:this.getLayoutRect().height/2],startAngle:this._startAngle,endAngle:this._endAngle,innerRadius:t,outerRadius:e,gapRadius:i,label:s}}}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:JT,operations:["max","min","values"]},{key:QT,operations:["values"]}])}_addDataIndexAndKey(){const t=this.getRawData();D(null==t?void 0:t.dataSet)||(Lp(t.dataSet,"addVChartProperty",WT),t.transform({type:"addVChartProperty",options:{beforeCall:sL.bind(this),call:nL}}))}initMark(){this._initArcMark(),this._initLabelMark()}initMarkStyle(){this._initArcMarkStyle(),this._initLabelMarkStyle()}_initArcMark(){var t,e;if(!1===this._sunburst.visible)return;const i=this._createMark(zH.mark.sunburst,{isSeriesMark:!0,customShape:null===(t=this._spec.sunburst)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.sunburst)||void 0===e?void 0:e.stateSort});this._sunburstMark=i}_initArcMarkStyle(){D(this._sunburstMark)||this.setMarkStyle(this._sunburstMark,{x:t=>t.x+(M(this._offsetX)?this._offsetX:0),y:t=>t.y+(M(this._offsetY)?this._offsetY:0),outerRadius:t=>t.outerRadius,innerRadius:t=>t.innerRadius,startAngle:t=>t.startAngle,endAngle:t=>t.endAngle,fill:this.getColorAttribute()},xy.STATE_NORMAL,Py.Series)}_initLabelMark(){if(!0!==this._label.visible)return;const t=this._createMark(zH.mark.label,{isSeriesMark:!1});this._labelMark=t}_initLabelMarkStyle(){D(this._labelMark)||this.setMarkStyle(this._labelMark,{visible:t=>{var e;const i=this._labelAutoVisible;return vs(i)&&!0===i.enable?(t.endAngle-t.startAngle)*(t.outerRadius-t.innerRadius)>(null!==(e=null==i?void 0:i.circumference)&&void 0!==e?e:10):this._spec.label.visible},x:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.x)+(M(this._offsetX)?this._offsetX:0)},y:t=>{var e;return(null===(e=t.label)||void 0===e?void 0:e.y)+(M(this._offsetY)?this._offsetY:0)},textBaseline:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textBaseline},textAlign:t=>{var e;return null===(e=t.label)||void 0===e?void 0:e.textAlign},angle:t=>{var e,i;return null!==(i=null===(e=t.label)||void 0===e?void 0:e.angle)&&void 0!==i?i:0},fontSize:10,text:t=>t.name},xy.STATE_NORMAL,Py.Series)}initTooltip(){this._tooltipHelper=new OH(this),this._sunburstMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._sunburstMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t,e;const i={animationInfo:()=>({innerRadius:this._computeRadius(Ba(this.__innerRadius))[0],outerRadius:this._computeRadius(Ba(this.__outerRadius))[0],startAngle:Ba(this._startAngle)[0],endAngle:Ba(this._endAngle)[0]})},s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("sunburst"))||void 0===e?void 0:e(i,s),DC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("fadeInOut"))||void 0===e?void 0:e(),DC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_computeRadius(t){return y(t)?t.map((t=>this._computeLayoutRadius()*t)):this._computeLayoutRadius()*t}_computeLevel(){return{innerRadius:this._computeRadius(this.__innerRadius),outerRadius:this._computeRadius(this.__outerRadius),gap:this._gap,label:this._labelLayout}}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._sunburstMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}zH.type=_l.sunburst,zH.mark=HH,JA(zH,jH);class NH extends rO{_getDefaultSeriesSpec(t){const e=M(t.startAngle)?t.startAngle:-90,i=M(t.endAngle)?t.endAngle:e+wt(2*Math.PI),s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,centerX:t.centerX,centerY:t.centerY,offsetX:t.offsetX,offsetY:t.offsetY,startAngle:e,endAngle:i,innerRadius:t.innerRadius,outerRadius:t.outerRadius,gap:t.gap,labelLayout:t.labelLayout,label:t.label,labelAutoVisible:t.labelAutoVisible,drill:t.drill,drillField:t.drillField}),n=_l.sunburst;return s.type=n,s[n]=t[n],s}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class VH extends cO{constructor(){super(...arguments),this.transformerConstructor=NH,this.type="sunburst",this.seriesType=_l.sunburst}}VH.type="sunburst",VH.seriesType=_l.sunburst,VH.transformerConstructor=NH;const WH=4294967296;function GH(t,e){let i,s;if(XH(e,t))return[e];for(i=0;i0&&i*i>s*s+n*n}function XH(t,e){for(let i=0;i1e-6?(T+Math.sqrt(T*T-4*w*L))/(2*w):L/T);return{x:s+S+M*C,y:n+k+A*C,radius:C}}function JH(t,e,i){const s=t.x-e.x;let n,r;const a=t.y-e.y;let o,l;const h=s*s+a*a;h?(r=e.radius+i.radius,r*=r,l=t.radius+i.radius,l*=l,r>l?(n=(h+l-r)/(2*h),o=Math.sqrt(Math.max(0,l/h-n*n)),i.x=t.x-n*s-o*a,i.y=t.y-n*a+o*s):(n=(h+r-l)/(2*h),o=Math.sqrt(Math.max(0,r/h-n*n)),i.x=e.x+n*s-o*a,i.y=e.y+n*a+o*s)):(i.x=e.x+i.radius,i.y=e.y)}function QH(t,e){const i=t.radius+e.radius-1e-6,s=e.x-t.x,n=e.y-t.y;return i>0&&i*i>s*s+n*n}function tz(t){const e=t._,i=t.next._,s=e.radius+i.radius,n=(e.x*i.radius+i.x*e.radius)/s,r=(e.y*i.radius+i.y*e.radius)/s;return n*n+r*r}function ez(t){return{_:t,next:null,prev:null}}function iz(t,e){const i=(t=Ba(t)).length;if(!i)return 0;let s=t[0];if(s.x=0,s.y=0,1===i)return s.radius;const n=t[1];if(s.x=-n.radius,n.x=s.radius,n.y=0,2===i)return s.radius+n.radius;let r=t[2];JH(n,s,r);let a,o,l,h,d,c,u,p=ez(s),g=ez(n),m=ez(r);p.next=g,m.prev=g,g.next=m,p.prev=m,m.next=p,g.prev=p;for(let e=3;et.padding:y(null==t?void 0:t.padding)?e=>{var i;return null!==(i=t.padding[e.depth+1])&&void 0!==i?i:0}:()=>0,this._maxDepth=-1}layout(t,e){var i;const s="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};if(!t||!t.length)return[];const n=[],r=TH(t,n,0,-1,null,this._getNodeKey);this._maxDepth=r.maxDepth;const a=function(t=1){let e=t;return()=>(e=(1664525*e+1013904223)%WH)/WH}(),o={flattenIndex:-1,maxDepth:-1,key:"root",depth:-1,index:-1,value:r.sum,datum:null,children:n,x:s.x0+s.width/2,y:s.y0+s.height/2},{nodeSort:l,setRadius:h,padding:d,includeRoot:c}=null!==(i=this.options)&&void 0!==i?i:{};if(!1!==l){const t=ys(l)?this.options.nodeKey:az.defaultOpionts.nodeSort;LH([o],(e=>{e.children&&e.children.length&&e.children.sort(t)}))}if(h)LH([o],sz(h)),CH([o],nz(this._getPadding,.5,a)),LH([o],rz(1,this._maxDepth));else{const t=Math.min(s.width,s.height);LH([o],sz(az.defaultOpionts.setRadius)),CH([o],nz(og,1,a)),d&&CH([o],nz(this._getPadding,o.radius/t,a)),LH([o],rz(t/(2*o.radius),this._maxDepth))}return c?[o]:n}}az.defaultOpionts={setRadius:t=>Math.sqrt(t.value),padding:0,nodeSort:(t,e)=>e.value-t.value};const oz=(t,e)=>{if(!t)return t;const i=e(),{width:s,height:n}=i;return 0===s||0===n?t:new az(i).layout(t,{width:s,height:n})};class lz extends UT{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>null==t?void 0:t[this.series.getDimensionField()[0]]}}const hz=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growRadiusIn"},dz=Object.assign(Object.assign({},rL),{circlePacking:{name:"circlePacking",type:"arc"}});class cz extends NC{constructor(){super(...arguments),this.type=_l.circlePacking}setCategoryField(t){return this._categoryField=t,this._categoryField}getCategoryField(){return this._categoryField}setValueField(t){return this._valueField=t,this._valueField}getValueField(){return this._valueField}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:QT),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t;return null!==(t=this._spec.drillField)&&void 0!==t?t:yT},getRawData:()=>this.getRawData()}),this._circlePacking=this._spec.circlePacking,this._label=this._spec.label,this._layoutPadding=this._spec.layoutPadding}initData(){super.initData();const t=this.getRawData();D(t)||(this._spec.drill&&this.initDrillableData(this._dataSet),Lp(this._dataSet,"circlePackingLayout",oz),Lp(this._dataSet,"flatten",MH),t.transform({type:"circlePackingLayout",options:()=>({nodeKey:this._categoryField,padding:this._layoutPadding,includeRoot:!1,width:this.getLayoutRect().width||1,height:this.getLayoutRect().height||1})}),t.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}}))}_addDataIndexAndKey(){const t=this.getRawData();D(null==t?void 0:t.dataSet)||(Lp(t.dataSet,"addVChartProperty",WT),t.transform({type:"addVChartProperty",options:{beforeCall:sL.bind(this),call:nL}}))}initMark(){this._initCirclePackingMark(),this._initLabelMark()}initMarkStyle(){this._initCirclePackingMarkStyle(),this._initLabelMarkStyle()}_initCirclePackingMark(){var t,e;if(!1===(null===(t=this._circlePacking)||void 0===t?void 0:t.visible))return;const i=this._createMark(cz.mark.circlePacking,{isSeriesMark:!0,customShape:null===(e=this._spec.circlePacking)||void 0===e?void 0:e.customShape});this._circlePackingMark=i}_initCirclePackingMarkStyle(){D(this._circlePackingMark)||this.setMarkStyle(this._circlePackingMark,{x:t=>t.x,y:t=>t.y,outerRadius:t=>t.radius,innerRadius:0,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),zIndex:t=>t.depth},xy.STATE_NORMAL,Py.Series)}_initLabelMark(){var t;if(!1===(null===(t=this._label)||void 0===t?void 0:t.visible))return;const e=this._createMark(cz.mark.label,{isSeriesMark:!1});this._labelMark=e}_initLabelMarkStyle(){D(this._labelMark)||this.setMarkStyle(this._labelMark,{x:t=>t.x,y:t=>t.y,text:t=>t.key,cursor:"pointer"},xy.STATE_NORMAL,Py.Series)}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:JT,operations:["max","min","values"]},{key:QT,operations:["values"]}])}initTooltip(){this._tooltipHelper=new lz(this),this._tooltipHelper.updateTooltipSpec(),this._circlePackingMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circlePackingMark),this._labelMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._labelMark)}initAnimation(){var t;const e=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this.getMarksInType("arc").forEach((t=>{var i;t.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("circlePacking"))||void 0===i?void 0:i(void 0,e),DC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("text").forEach((t=>{var e;t.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("scaleInOut"))||void 0===e?void 0:e(),DC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.drill&&this.bindDrillEvent()}onLayoutEnd(t){super.onLayoutEnd(t),this._rawData.reRunAllTransform()}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._circlePackingMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}cz.type=_l.circlePacking,cz.mark=dz,JA(cz,jH);class uz extends rO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,layoutPadding:t.layoutPadding,label:t.label,circlePacking:t.circlePacking,drill:t.drill,drillField:t.drillField}),i=_l.circlePacking;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class pz extends cO{constructor(){super(...arguments),this.transformerConstructor=uz,this.type="circlePacking",this.seriesType=_l.circlePacking}}function gz(t,e,i,s,n){const r=t.children;let a,o=-1;const l=r.length,h=t.value&&(n-i)/t.value;for(;++o{if(t>=e-1){const e=r[t];return e.x0=s,e.y0=n,e.x1=a,void(e.y1=o)}const d=l[t],c=i/2+d;let u=t+1,p=e-1;for(;u>>1;l[t]o-n){const r=i?(s*m+a*g)/i:a;h(t,u,g,s,n,r,o),h(u,e,m,r,n,a,o)}else{const r=i?(n*m+o*g)/i:o;h(t,u,g,s,n,a,r),h(u,e,m,s,r,a,o)}};h(0,a,t.value,e,i,s,n)},dice:kH,slice:gz,sliceDice:function(t,e,i,s,n){(t.depth%2==1?gz:kH)(t,e,i,s,n)}};class _z{constructor(t){var e;this._filterByArea=(t,e)=>{var i;const s=this._getMinAreaByDepth(t.depth);if(s>0&&t.value*ethis._filterByArea(t,e)));i.length?i.length!==t.children.length&&(t.children=i):(t.isLeaf=!0,t.children=null)}return!0},this._getMinAreaByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.minVisibleArea)?this.options.minVisibleArea[t]:this.options.minVisibleArea)&&void 0!==e?e:0},this._getGapWidthByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.gapWidth)?this.options.gapWidth[t]:this.options.gapWidth)&&void 0!==e?e:0},this._getPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.padding)?this.options.padding[t]:this.options.padding)&&void 0!==e?e:0},this._getLabelPaddingByDepth=t=>{var e;return t<0?0:null!==(e=y(this.options.labelPadding)?this.options.labelPadding[t]:this.options.labelPadding)&&void 0!==e?e:0},this._layoutNode=t=>{const e=this._getGapWidthByDepth(t.depth);let i=t.x0,s=t.y0,n=t.x1,r=t.y1;if(t.maxDepth=this._maxDepth,e>0&&(i+=e/2,n-=e/2,s+=e/2,r-=e/2,i>n&&(i=(i+n)/2,n=i),s>r&&(s=(s+r)/2,r=s),t.x0=i,t.x1=n,t.y0=s,t.y1=r),t.children){const e=this._getLabelPaddingByDepth(t.depth),a=this._getPaddingByDepth(t.depth);a>0&&a0&&("top"===this.options.labelPosition&&s+es?(t.labelRect={x0:i,y0:r-e,x1:n,y1:r},r-=e):"left"===this.options.labelPosition&&i+ei&&(t.labelRect={x0:n-e,y0:s,x1:n,y1:r},n-=e));const o=this._getGapWidthByDepth(t.depth+1);o>0&&(i-=o/2,n+=o/2,s-=o/2,r+=o/2),this._splitNode(t,i,s,n,r)}},this.options=Object.assign({},_z.defaultOpionts,t);const i=this.options.nodeKey,s=ys(i)?i:i?Em(i):null;var n;this._getNodeKey=s,this._splitNode="squarify"===this.options.splitType?(n=this.options.aspectRatio,(t,e,i,s,r)=>{!function(t,e,i,s,n,r){const a=[],o=e.children;let l,h,d=0,c=0;const u=o.length;let p,g,m,_,f,v,y,b,x,S=e.value;for(;df&&(f=h),x=m*m*b,v=Math.max(f/x,x/_),v>y){m-=h;break}y=v}l=Object.assign({},e,{value:m,children:o.slice(d,c)}),a.push(l),p=0&&t.depth>=e)return!1;const i=this.options.minChildrenVisibleArea;if(h(i)&&Math.abs((t.x1-t.x0)*(t.y1-t.y0)){var e;(null===(e=null==t?void 0:t.children)||void 0===e?void 0:e.length)?this._layout(t):this._layoutNode(t)}))}}_z.defaultOpionts={aspectRatio:(1+Math.sqrt(5))/2,gapWidth:0,labelPadding:0,labelPosition:"top",splitType:"binary",minVisibleArea:10};const fz=(t,e)=>{const i=new _z(t).layout(e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});if(t.flatten){const e=[];return SH(i,e,{maxDepth:null==t?void 0:t.maxDepth}),e}return i},vz=(t,e)=>{let i={},s=e.fields;if(ys(s)&&(s=s()),!(null==s?void 0:s.length)||!(null==t?void 0:t.length))return i;if(!t[0].latestData)return i;const n=t[0].latestData,r=MH(n);return i=XT([{latestData:r}],e),i};class yz extends UT{constructor(){super(...arguments),this.markTooltipKeyCallback=t=>{var e,i;return null===(i=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t))||void 0===i?void 0:i[this.series.getDimensionField()[0]]},this.markTooltipValueCallback=t=>{var e,i;const{measureFields:s}=this._seriesCacheInfo,n=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(s[0]&&n)return null!==(i=n[s[0]])&&void 0!==i?i:t.value},this.dimensionTooltipTitleCallback=t=>{var e;const{dimensionFields:i}=this._seriesCacheInfo,s=null===(e=this.series)||void 0===e?void 0:e.getMarkData(t);if(i[0]&&s)return s[i[0]]}}get defaultShapeType(){return"square"}}const bz=Object.assign(Object.assign({},rL),{nonLeaf:{name:"nonLeaf",type:"rect"},leaf:{name:"leaf",type:"rect"},nonLeafLabel:{name:"nonLeafLabel",type:"text"}}),xz=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"growCenterIn"};class Sz extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nonLeaf","nonLeafLabel","initNonLeafLabelMarkStyle"),this._addMarkLabelSpec(t,"leaf")}}class Mz extends NC{constructor(){super(...arguments),this.type=_l.treemap,this.transformerConstructor=Sz,this._categoryField="name",this._valueField="value",this._viewBox=new Kt,this._enableAnimationHook=this.enableMarkAnimation.bind(this),this.isHierarchyData=()=>!0}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:QT),this._spec.roam&&(this.initZoomable(this.event,this._option.mode),this._matrix=new Pt),this._spec.drill&&this.initDrillable({event:this.event,mode:this._option.mode,drillField:()=>{var t,e;return null!==(e=null!==(t=this._spec.drillField)&&void 0!==t?t:this._categoryField)&&void 0!==e?e:yT},getRawData:()=>this.getRawData()}),qo(this._spec.maxDepth)&&(this._maxDepth=this._spec.maxDepth-1)}initData(){super.initData(),this.getViewData()&&this._spec.drill&&this.initDrillableData(this._dataSet)}compile(){super.compile(),this._runTreemapTransform()}_runTreemapTransform(t=!1){var e,i,s,n;const r=this._data.getProduct();r&&r.transform([{type:"treemap",nameField:this._categoryField,valueField:this._valueField,x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,maxDepth:this._maxDepth,gapWidth:this._spec.gapWidth,padding:this._spec.nodePadding,splitType:this._spec.splitType,aspectRatio:this._spec.aspectRatio,labelPadding:(null===(e=this._spec.nonLeafLabel)||void 0===e?void 0:e.visible)?null===(i=this._spec.nonLeafLabel)||void 0===i?void 0:i.padding:0,labelPosition:null===(s=this._spec.nonLeafLabel)||void 0===s?void 0:s.position,minVisibleArea:null!==(n=this._spec.minVisibleArea)&&void 0!==n?n:10,minChildrenVisibleArea:this._spec.minChildrenVisibleArea,minChildrenVisibleSize:this._spec.minChildrenVisibleSize,flatten:!0},{type:"map",callback:t=>(t&&[QT,"name"].forEach((e=>{t[e]=t.datum[t.depth][this._categoryField]})),t)}]),t&&this.getCompiler().renderNextTick()}_addDataIndexAndKey(){var t;(null===(t=this._rawData)||void 0===t?void 0:t.dataSet)&&(Lp(this._rawData.dataSet,"addVChartProperty",WT),this._rawData.transform({type:"addVChartProperty",options:{beforeCall:sL.bind(this),call:nL}}))}getRawDataStatisticsByField(t,e){var i;if(this._rawStatisticsCache||(this._rawStatisticsCache={}),!this._rawStatisticsCache[t]&&this._rawData){const s=vz([this._rawData],{fields:[{key:t,operations:e?["min","max"]:["values"]}]})[t];this._rawStatisticsCache[t]=E(null!==(i=this._rawStatisticsCache[t])&&void 0!==i?i:{},s)}return this._rawStatisticsCache[t]}_createHierarchyDataStatistics(t,e){Lp(this._dataSet,"hierarchyDimensionStatistics",vz),Lp(this._dataSet,"flatten",MH);const i=new R(this._dataSet,{name:t});return i.parse(e,{type:"dataview"}),i.transform({type:"hierarchyDimensionStatistics",options:{fields:()=>{const t=this.getStatisticFields();return this._seriesField&&this._seriesField!==this._categoryField&&t.push({key:this._seriesField,operations:["values"]}),t}}},!1),i}getStatisticFields(){return super.getStatisticFields().concat([{key:this._categoryField,operations:["values"]},{key:this._valueField,operations:["max","min"]},{key:JT,operations:["max","min","values"]},{key:QT,operations:["values"]}])}initMark(){var t,e,i,s;const n=this._createMark(Mz.mark.nonLeaf,{isSeriesMark:!0,customShape:null===(t=this._spec.nonLeaf)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.nonLeaf)||void 0===e?void 0:e.stateSort});n&&(n.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"nonLeaf")}]),this._nonLeafMark=n);const r=this._createMark(Mz.mark.leaf,{isSeriesMark:!0,customShape:null===(i=this._spec.leaf)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.leaf)||void 0===s?void 0:s.stateSort});r&&(r.setTransform([{type:"filter",callback:t=>!this._shouldFilterElement(t,"leaf")}]),this._leafMark=r)}initMarkStyle(){this._initLeafMarkStyle(),this._initNonLeafMarkStyle()}_initLeafMarkStyle(){this._leafMark&&this.setMarkStyle(this._leafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},xy.STATE_NORMAL,Py.Series)}_initNonLeafMarkStyle(){this._nonLeafMark&&this.setMarkStyle(this._nonLeafMark,{x:t=>t.x0,y:t=>t.y0,x1:t=>t.x1,y1:t=>t.y1,fill:this.getColorAttribute()},xy.STATE_NORMAL,Py.Series)}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>(t.x0+t.x1)/2,y:t=>(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},xy.STATE_NORMAL,Py.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},xy.STATE_NORMAL,Py.Series))}initNonLeafLabelMarkStyle(t){t&&(this._nonLeafLabelMark=t,t.setRule("treemap"),this.setMarkStyle(t,{x:t=>t.labelRect?(t.labelRect.x0+t.labelRect.x1)/2:(t.x0+t.x1)/2,y:t=>t.labelRect?(t.labelRect.y0+t.labelRect.y1)/2:(t.y0+t.y1)/2,text:t=>{var e;return null===(e=t.datum[t.depth])||void 0===e?void 0:e[this.getDimensionField()[0]]},maxLineWidth:t=>t.x1===t.x0?Number.MIN_VALUE:t.x1-t.x0},xy.STATE_NORMAL,Py.Series),"rich"===t.getTextType()&&this.setMarkStyle(t,{maxWidth:t=>Math.abs(t.x0-t.x1),maxHeight:t=>Math.abs(t.y0-t.y1),ellipsis:!0},xy.STATE_NORMAL,Py.Series))}initAnimation(){this.getMarksInType("rect").forEach((t=>{var e;t.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("treemap"))||void 0===e?void 0:e(),DC(t.name,this._spec,this._markAttributeContext)))}))}initEvent(){super.initEvent(),this._spec.roam&&(this.initDragEventOfSeries(this),this.event.on("panmove",(t=>{this.handlePan(t)})),this.initZoomEventOfSeries(this),this.event.on("zoom",(t=>{this.handleZoom(t)}))),this._spec.drill&&this.bindDrillEvent()}_getDataIdKey(){return"key"}initTooltip(){this._tooltipHelper=new yz(this),this._leafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._leafMark),this._nonLeafMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nonLeafMark)}_shouldFilterElement(t,e){const i=t.isLeaf;return"leaf"===e?!i:i}handlePan(t){const{delta:e}=t;if(0===e[0]&&0===e[1])return;this._matrix.reset(),this._matrix.translate(e[0],e[1]);const{a:i,b:s,c:n,d:r,e:a,f:o}=this._matrix;this._matrix.multiply(i,s,n,r,a,o),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}handleZoom(t){const{scale:e,scaleCenter:i}=t;if(1===e)return;this._matrix.reset();const{x:s,y:n}=i;this._matrix.translate(s,n),this._matrix.scale(e,e),this._matrix.translate(-s,-n);const{a:r,b:a,c:o,d:l,e:h,f:d}=this._matrix;this._matrix.multiply(r,a,o,l,h,d),this.disableMarkAnimation(),this.event.on(lc.AFTER_DO_RENDER,this._enableAnimationHook),this._viewBox.transformWithMatrix(this._matrix),this._runTreemapTransform(!0)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runTreemapTransform()}enableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.enable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().enableAnimation()})),this.event.off(lc.AFTER_DO_RENDER,this._enableAnimationHook)}disableMarkAnimation(){this.getMarks().forEach((t=>{var e;null===(e=t.getProduct().animate)||void 0===e||e.disable()})),[this._labelMark,this._nonLeafLabelMark].forEach((t=>{t&&t.getComponent()&&t.getComponent().getProduct().getGroupGraphicItem().disableAnimation()}))}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._nonLeafMark,this._leafMark]}getMarkData(t){return(null==t?void 0:t.datum)?t.datum[t.datum.length-1]:t}}Mz.type=_l.treemap,Mz.mark=bz,Mz.transformerConstructor=Sz,JA(Mz,jH),JA(Mz,$I);class kz extends rO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,aspectRatio:t.aspectRatio,splitType:t.splitType,maxDepth:t.maxDepth,gapWidth:t.gapWidth,nodePadding:t.nodePadding,minVisibleArea:t.minVisibleArea,minChildrenVisibleArea:t.minChildrenVisibleArea,minChildrenVisibleSize:t.minChildrenVisibleSize,roam:t.roam,drill:t.drill,drillField:t.drillField,leaf:t.leaf,nonLeaf:t.nonLeaf,nonLeafLabel:t.nonLeafLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class Az extends cO{constructor(){super(...arguments),this.transformerConstructor=kz,this.type="treemap",this.seriesType=_l.treemap}}Az.type="treemap",Az.seriesType=_l.treemap,Az.transformerConstructor=kz;const wz=`${sh}_waterfall_default_seriesField`,Tz=(t,e)=>{if(!t||0===t.length)return t;const{indexField:i,total:s,groupData:n}=e,r=[],{dimensionValues:a,dimensionData:o}=n().latestData,l=Array.from(a[i]);let h={start:0,end:0,positive:0,negative:0,lastIndex:null};return l.forEach(((t,i)=>{const n={start:h.end,end:h.end,lastIndex:h.lastIndex,lastEnd:h.end,index:t,isTotal:!1,positive:h.end,negative:h.end},a=o[t];if(null==a||a.forEach(((t,e)=>{e===a.length-1?t[DT]=!0:delete t[DT]})),a.length>1){const o=t=>{if(s&&"end"!==s.type){if("field"===s.type||"custom"===s.type)return!!t[s.tagField]}else if(i===l.length-1)return!0;return!1};if(a.some((t=>o(t))))return h=function(t,e,i,s,n,r,a,o,l){i.isTotal=!0;const{valueField:h,startAs:d,endAs:c,total:u}=o,p=[],g=[];if(t.forEach((t=>{l(t)?g.push(t):p.push(t)})),g.length===t.length){const l=Lz([t[0]],e,i,s,n,r,a,o);return g.forEach((e=>{e[d]=t[0][d],e[c]=t[0][c],e[h]=t[0][h]})),l}const m=g[0];let{start:_,end:f}=Cz(m,i,s,n,u);i.start=_,i.end=f;let v=_,y=_,b=f-_;return p.forEach((t=>{const e=+t[h];e>=0?(t[d]=+v,v=Mt(v,e)):(t[d]=+y,y=Mt(y,e)),t[c]=Mt(t[d],e),_=Mt(_,e),b=kt(b,e)})),g.forEach((t=>{t[d]=+_,t[c]=Mt(t[d],b),t[h]=b})),Object.assign(Object.assign({},i),{lastIndex:e})}(a,t,n,r,h,l,i,e,o),void r.push(n)}h=Lz(a,t,n,r,h,l,i,e),r.push(n)})),r};function Lz(t,e,i,s,n,r,a,o){const{valueField:l,startAs:h,endAs:d,total:c,seriesField:u,seriesFieldName:p}=o;return t.forEach((t=>{let e=!1;if(c&&"end"!==c.type){if(("field"===c.type||"custom"===c.type)&&t[c.tagField]){e=!0;const{start:r,end:a}=Cz(t,i,s,n,c);t[h]=r,t[d]=a,t[l]=a-r,i.start=r,i.end=a}}else a===r.length-1&&(i.start=0,t[h]=i.start,t[d]=i.end,e=!0);if(!e){const e=+t[l];e>=0?(t[h]=+i.positive,i.positive=Mt(i.positive,e)):(t[h]=+i.negative,i.negative=Mt(i.negative,e)),t[d]=Mt(t[h],e),i.end=Mt(i.end,e)}i.isTotal=e,(D(u)||u===wz)&&(t[wz]=e?p.total:+t[l]>=0?p.increase:p.decrease)})),Object.assign(Object.assign({},i),{lastIndex:e})}function Cz(t,e,i,s,n){return n&&"end"!==n.type?"field"===n.type||"custom"===n.type?"custom"===n.type?function(t,e,i){return i.product(t,e)}(t,s,n):n.collectCountField&&!D(t[n.collectCountField])?function(t,e,i,s){let n=0,r=i.end;const a=e.length-+t[s.collectCountField],o=e.length-1;return a<0?pl("total.collectCountField error"):n=e[a].start,o<0?pl("total.collectCountField error"):r=e[o].end,{start:n,end:r}}(t,i,e,n):function(t,e,i){let s=0,n=e.end;return i.startField&&!D(t[i.startField])&&(s=+t[i.startField]),i.valueField&&!D(t[i.valueField])&&(n=Mt(s,+t[i.valueField])),{start:s,end:n}}(t,e,n):{start:0,end:0}:function(t){return{start:0,end:t.end}}(e)}const Ez=(t,e)=>{if(!t)return t;const{indexField:i,valueField:s,total:n,seriesField:r}=e,a={[i]:(null==n?void 0:n.text)||"total",[s]:t.reduce(((t,e)=>Mt(t,+e[s])),0)};return r&&(a[r]="total"),t.push(a),t},Dz={type:"fadeIn"},Pz={type:"growCenterIn"};function Oz(t,e){switch(e){case"fadeIn":return Dz;case"scaleIn":return Pz;default:return AO(t,!1)}}const Rz=Object.assign(Object.assign({},PO),{leaderLine:{name:"leaderLine",type:"rule"},stackLabel:{name:"stackLabel",type:"text"}}),Iz=(t,e)=>{if(!e.fields)return t;const i={};return{dimensionValues:i,dimensionData:Bz(t.map((t=>t.latestData)).flat(),e.fields,i)}};function Bz(t,e,i){if(0===e.length)return t;const s=e[0],n=e.slice(1);i[s]=new Set;const r=function(t,e,i){const s={};return t.forEach((t=>{const n=t[e];s[n]||(s[n]=[],i.add(n)),s[n].push(t)})),s}(t,s,i[s]);return n.length?(a=r,o=(t,e)=>Bz(t,n,i),Object.keys(a).reduce(((t,e)=>(t[e]=o(a[e]),t)),{})):r;var a,o}class Fz{get fields(){return this._fields}get groupData(){return this._groupData}constructor(t){this._fields=[],this._fields=t}initData(t,e){const i=t.name,s=new R(e instanceof f?e:t.dataSet);s.name=i,s.parse([t],{type:"dataview"}),Lp(e,"dimensionTree",Iz),s.transform({type:"dimensionTree",options:{fields:this._fields}},!1),s.target.addListener("change",this.groupDataUpdate.bind(this)),this._groupData=s}groupDataUpdate(){}getGroupValueInField(t){var e,i,s;const n=null===(s=null===(i=null===(e=this.groupData)||void 0===e?void 0:e.latestData)||void 0===i?void 0:i.dimensionValues)||void 0===s?void 0:s[t];return n?Array.from(n):[]}}class Yz extends BO{constructor(){super(...arguments),this._supportStack=!1}_transformLabelSpec(t){this._addMarkLabelSpec(t,"bar"),this._addMarkLabelSpec(t,"bar","stackLabel","initStackLabelMarkStyle")}}const jz={rect:Vz,symbol:Nz,arc:Gz,point:function(t){const{labelSpec:e}=t;let i;return i=!1!==e.overlap&&{avoidBaseMark:!1},{position:"center",overlap:i}},"line-data":function(t){const e=Nz(t);return v(e.overlap)||(e.overlap.avoidBaseMark=!1),e},stackLabel:Uz,line:$z,area:$z,rect3d:Vz,arc3d:Gz,treemap:function(t){return{customLayoutFunc:(t,e)=>e,overlap:!1}},venn:function(t){return{customLayoutFunc:(t,e)=>e,smartInvert:!0}}};function Hz(t,e,i,s){var n;const{labelMark:r,series:a}=t,o={text:e[a.getMeasureField()[0]],data:e,textType:null!==(n=t.labelSpec.textType)&&void 0!==n?n:"text"},l=Object.keys(r.stateStyle.normal);for(const t of l){const i=r.getAttribute(t,e);o[t]=i}if(a.type!==_l.sankey){const{formatFunc:t,args:n}=YE(i,s,o.text,e);t&&(o.text=t(...n,{series:a}))}return o}function zz(t){return ys(t)?e=>t(e.data):t}function Nz(t){var e,i,s;const{series:n,labelSpec:r}=t,a="horizontal"===n.direction?"right":"top",o=null!==(e=zz(r.position))&&void 0!==e?e:a;let l;return l=!1!==r.overlap&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:[{type:"position",position:["top","bottom","right","left","top-right","top-left","bottom-left","bottom-right"]}],avoidBaseMark:"center"!==o},{position:o,overlap:l}}function Vz(t){var e,i,s,n,r,a;const{series:o,labelSpec:l={}}=t,h=null!==(e=zz(l.position))&&void 0!==e?e:"outside",d=null!==(i=o.direction)&&void 0!==i?i:"vertical",c="horizontal"===o.direction?null===(s=o.getXAxisHelper())||void 0===s?void 0:s.isInverse():null===(n=o.getYAxisHelper())||void 0===n?void 0:n.isInverse();let u,p=h;p=t=>{var e;const{data:i}=t,s=null!==(e="function"==typeof l.position?l.position(i):l.position)&&void 0!==e?e:"outside";if("outside"===s){const t=o.getMeasureField()[0],e={vertical:["top","bottom"],horizontal:["right","left"]},s=(null==i?void 0:i[t])>=0&&c||(null==i?void 0:i[t])<0&&!c?1:0;return e[d][s]}return s},u=!1!==l.overlap&&{strategy:null!==(a=null===(r=l.overlap)||void 0===r?void 0:r.strategy)&&void 0!==a?a:Wz(o)};let g=!1;return S(h)&&h.includes("inside")&&(g=!0),{position:p,overlap:u,smartInvert:g}}function Wz(t){return[{type:"position",position:e=>{var i,s;const{data:n}=e,r=t.getMeasureField()[0];return("horizontal"===t.direction?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]:"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:(null==n?void 0:n[r])>=0?"horizontal"===t.direction?["right","inside-right"]:["top","inside-top"]:"horizontal"===t.direction?["left","inside-left"]:["bottom","inside-bottom"]}}]}function Gz(t){var e;const{labelSpec:i}=t,s=null!==(e=zz(i.position))&&void 0!==e?e:"outside",n=s;let r;return r=i.smartInvert?i.smartInvert:S(s)&&s.includes("inside"),{position:n,smartInvert:r}}function Uz(t,e,i){const s=t.series,n=t.labelSpec||{},r=s.getTotalData();return{customLayoutFunc:r=>r.map((r=>{const a=n.position||"withChange",o=n.offset||0,l=e?e(r.data):r.data,h=Hz(t,l,n.formatMethod);return h.x=function(t,e,i,s){return"horizontal"===e.direction?"middle"===i?.5*(e.totalPositionX(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionX(t,t.end>=t.start?"end":"start")+s:"min"===i?e.totalPositionX(t,t.end>=t.start?"start":"end")-s:e.totalPositionX(t,"end")+(t.end>=t.start?s:-s):e.totalPositionX(t,"index",.5)}(l,s,a,o),h.y=function(t,e,i,s){return"horizontal"===e.direction?e.totalPositionY(t,"index",.5):"middle"===i?.5*(e.totalPositionY(t,"end")+e.totalPositionY(t,"start")):"max"===i?e.totalPositionY(t,t.end>=t.start?"end":"start")-s:"min"===i?e.totalPositionY(t,t.end>=t.start?"start":"end")+s:e.totalPositionY(t,"end")+(t.end>=t.start?-s:s)}(l,s,a,o),"horizontal"===s.direction?h.textAlign="middle"===a?"center":"withChange"===a&&l.end-l.start>=0||"max"===a?"left":"right":h.textBaseline="middle"===a?a:"withChange"===a&&l.end-l.start>=0||"max"===a?"bottom":"top",null==i||i(r,l,h),__(Object.assign(Object.assign({},h),{id:r.id}))})),dataFilter:t=>{const e=[];return r.forEach((i=>{const n=t.find((t=>{var e;return i.index===(null===(e=t.data)||void 0===e?void 0:e[s.getDimensionField()[0]])}));n&&(n.data=i,e.push(n))})),e},overlap:{strategy:[]}}}function $z(t){var e,i,s,n;const{labelSpec:r,series:a}=t,o=null===(s=null===(i=null===(e=a.getViewDataStatistics)||void 0===e?void 0:e.call(a).latestData)||void 0===i?void 0:i[a.getSeriesField()])||void 0===s?void 0:s.values,l=o?o.map(((t,e)=>({[a.getSeriesField()]:t,index:e}))):[];return{position:null!==(n=r.position)&&void 0!==n?n:"end",data:l}}function Xz(t){return[{type:"position",position:e=>"horizontal"===t.direction?["right","left"]:["bottom","top"]}]}class Kz extends FO{constructor(){super(...arguments),this.type=_l.waterfall,this.transformerConstructor=Yz,this._leaderLineMark=null,this._stackLabelMark=null,this._labelMark=null}getTotalData(){var t;return null===(t=this._totalData)||void 0===t?void 0:t.getLatestData()}initGroups(){const t=this.getGroupFields();t&&t.length&&(this._groups=new Fz(t),this._data&&this._groups.initData(this._data.getDataView(),this._dataSet))}setAttrFromSpec(){super.setAttrFromSpec(),this.setValueFieldToStack(),this._fieldX=[this._fieldX[0]],this._fieldY=[this._fieldY[0]],D(this._seriesField)&&(this._seriesField=wz)}getSeriesKeys(){return this._seriesField===wz?[this._theme.seriesFieldName.increase,this._theme.seriesFieldName.decrease,this._theme.seriesFieldName.total]:super.getSeriesKeys()}initData(){var t;super.initData(),Lp(this._dataSet,"waterfallFillTotal",Ez),Lp(this._dataSet,"waterfall",Tz),(D(this._spec.total)||"end"===this._spec.total.type)&&(null===(t=this._rawData)||void 0===t||t.transform({type:"waterfallFillTotal",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,total:this._spec.total}},!1));const e=Fp(this.getViewData(),this._dataSet,{name:`${sh}_series_${this.id}_totalData`});this.getViewData().target.removeListener("change",e.reRunAllTransform),this._totalData=new ZT(this._option,e),e.transform({type:"waterfall",options:{indexField:this.getGroupFields()[0],valueField:this.getStackValueField(),seriesField:this.getSeriesField(),seriesFieldName:this._theme.seriesFieldName,startAs:MT,endAs:kT,total:this._spec.total,groupData:()=>this.getGroups().groupData}},!1)}initAnimation(){var t,e,i,s;const n={yField:"horizontal"===this.direction?this._fieldY[0]:this.getStackValueField(),xField:"horizontal"===this.direction?this.getStackValueField():this._fieldX[0],direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,a=zC(this);this._barMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("waterfall"))||void 0===i?void 0:i(n,r),DC("bar",this._spec,this._markAttributeContext),a)),this._leaderLineMark&&this._leaderLineMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("fadeInOut"))||void 0===s?void 0:s(),DC("leaderLine",this._spec,this._markAttributeContext)))}viewDataUpdate(t){this._totalData.getDataView().reRunAllTransform(),this._totalData.updateData(),super.viewDataUpdate(t)}addViewDataFilter(t){}reFilterViewData(){}onEvaluateEnd(t){super.onEvaluateEnd(t),this._totalData.updateData()}initMark(){var t,e;super.initMark();const i=this._createMark(Kz.mark.leaderLine,{key:"index",customShape:null===(t=this._spec.leaderLine)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.leaderLine)||void 0===e?void 0:e.stateSort});i&&(this._leaderLineMark=i,i.setDataView(this._totalData.getDataView(),this._totalData.getProductId()))}initLabelMarkStyle(t){var e;if(t)return!this._labelMark&&(null===(e=this._spec.label)||void 0===e?void 0:e.visible)?(super.initLabelMarkStyle(t),void(this._labelMark=t)):void 0}initStackLabelMarkStyle(t){t&&(this._stackLabelMark=t,t.skipEncode=!0,t.setRule("stackLabel"),t.setDataView(this._totalData.getDataView(),this._totalData.getProductId()),this.setMarkStyle(t,{text:t=>{var e;return"absolute"===(null===(e=this._spec.stackLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start)}}))}initTotalLabelMarkStyle(t){this.setMarkStyle(t,{text:t=>{var e;return"end"in t?"absolute"===(null===(e=this._spec.totalLabel)||void 0===e?void 0:e.valueType)?t.end:kt(t.end,t.start):"horizontal"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]]}})}getTotalLabelComponentStyle(t){return Uz(Object.assign(Object.assign({},t),{series:this,labelSpec:this._spec.totalLabel}),(t=>{const e="vertical"===this.direction?t[this._fieldX[0]]:t[this._fieldY[0]];return this._totalData.getLatestData().find((t=>t.index===e))}))}totalPositionX(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._xAxisHelper;return"horizontal"===this._direction?ax(s([t[e]],{bandPosition:this._bandPosition})):s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("width",t)*(.5-i)}totalPositionY(t,e,i=.5){const{dataToPosition:s,getBandwidth:n}=this._yAxisHelper;return"horizontal"===this._direction?s([t[e]],{bandPosition:this._bandPosition})+.5*n(0)-this._barMark.getAttribute("height",t)*(.5-i):ax(s([t[e]],{bandPosition:this._bandPosition}))}initMarkStyle(){super.initMarkStyle(),this._leaderLineMark&&("horizontal"===this._direction?this.setMarkStyle(this._leaderLineMark,{visible:t=>!D(t.lastIndex),x:t=>this.totalPositionX(t,"lastEnd",0),x1:t=>this.totalPositionX(t,t.isTotal?"end":"start",0),y:t=>t.lastIndex?this.totalPositionY(t,"lastIndex",1):0,y1:t=>this.totalPositionY(t,"index",0)},"normal",Py.Series):this.setMarkStyle(this._leaderLineMark,{visible:t=>!D(t.lastIndex),x:t=>t.lastIndex?this.totalPositionX(t,"lastIndex",1):0,x1:t=>this.totalPositionX(t,"index",0),y:t=>this.totalPositionY(t,"lastEnd",0),y1:t=>this.totalPositionY(t,t.isTotal?"end":"start",0)},"normal",Py.Series))}}Kz.type=_l.waterfall,Kz.mark=Rz,Kz.transformerConstructor=Yz;class qz extends jO{transformSpec(t){super.transformSpec(t),t.legends&&Ba(t.legends).forEach((t=>{t.select=!1,t.hover=!1,t.filter=!1})),fy(t)}_getDefaultSeriesSpec(t){return Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{bar:t.bar,stackLabel:t.stackLabel,leaderLine:t.leaderLine,total:t.total})}}class Zz extends HO{constructor(){super(...arguments),this.transformerConstructor=qz,this.type="waterfall",this.seriesType=_l.waterfall}}Zz.type="waterfall",Zz.seriesType=_l.waterfall,Zz.transformerConstructor=qz;const Jz=`${sh}_BOX_PLOT_OUTLIER_VALUE`;var Qz;!function(t){t.OUTLIER="outlier",t.MAX="max",t.MIN="min",t.MEDIAN="median",t.Q1="q1",t.Q3="q3",t.SERIES_FIELD="seriesField"}(Qz||(Qz={}));const tN=(t,e)=>{const i=[],{outliersField:s,dimensionField:n}=e;return(t[0].latestData||[]).forEach((t=>{let e=t[s];y(e)||(e=[e]),i.push(...e.map((e=>{const i={[Jz]:e};return n.forEach((e=>{i[e]=t[e]})),i})))})),i};class eN extends UT{constructor(){super(...arguments),this.getContentKey=t=>e=>{if(this.isOutlierMark(e))return t===Qz.OUTLIER?this.series.getOutliersField():t===Qz.SERIES_FIELD?this.series.getSeriesField():null;switch(t){case Qz.MIN:return this.series.getMinField();case Qz.MAX:return this.series.getMaxField();case Qz.MEDIAN:return this.series.getMedianField();case Qz.Q1:return this.series.getQ1Field();case Qz.Q3:return this.series.getQ3Field();case Qz.SERIES_FIELD:return this.series.getSeriesField()}return null},this.getContentValue=t=>e=>{if(this.isOutlierMark(e))return t===Qz.OUTLIER?e[Jz]:t===Qz.SERIES_FIELD?e[this.series.getSeriesField()]:null;switch(t){case Qz.MIN:return e[this.series.getMinField()];case Qz.MAX:return e[this.series.getMaxField()];case Qz.MEDIAN:return e[this.series.getMedianField()];case Qz.Q1:return e[this.series.getQ1Field()];case Qz.Q3:return e[this.series.getQ3Field()];case Qz.SERIES_FIELD:return e[this.series.getSeriesField()]}return null},this.shapeColorCallback=t=>"line"===this.series.getShaftShape()?this.series.getMarkInName("boxPlot").getAttribute("stroke",t):this.series.getMarkInName("boxPlot").getAttribute("fill",t),this.getOutlierFillColor=t=>{var e;const i=this.series.getOutliersStyle();return null!==(e=null==i?void 0:i.fill)&&void 0!==e?e:this.series.getMarkInName("outlier").getAttribute("fill",t)},this.isOutlierMark=t=>M(t[Jz])}getDefaultTooltipPattern(t){return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{key:this.getContentKey(Qz.OUTLIER),value:this.getContentValue(Qz.OUTLIER),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.getOutlierFillColor,shapeStroke:this.getOutlierFillColor,shapeHollow:!1},{key:this.getContentKey(Qz.MAX),value:this.getContentValue(Qz.MAX),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(Qz.Q3),value:this.getContentValue(Qz.Q3),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(Qz.MEDIAN),value:this.getContentValue(Qz.MEDIAN),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(Qz.Q1),value:this.getContentValue(Qz.Q1),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(Qz.MIN),value:this.getContentValue(Qz.MIN),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1},{key:this.getContentKey(Qz.SERIES_FIELD),value:this.getContentValue(Qz.SERIES_FIELD),hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]}}}function iN(t){return"horizontal"===t}function sN(t){return"vertical"===t}class nN extends Vm{constructor(t){super(t),this.getStateAttrs=(t,e)=>{var i,s,n,r;const a=!D(null===(i=this.runtimeStatesEncoder)||void 0===i?void 0:i[t]),o=a?Object.assign(Object.assign({},null===(s=this.mark.getSpec().encode)||void 0===s?void 0:s[t]),this.runtimeStatesEncoder[t]):null===(n=this.mark.getSpec().encode)||void 0===n?void 0:n[t],l={};if(!o)return l;if(ys(o))return l.attributes=o(this.getDatum(),this,t,e),l;if(!a&&(null===(r=this.graphicItem.glyphStates)||void 0===r?void 0:r[t]))return this.graphicItem.glyphStates[t];if(o){const e=this.items[0],i=[Object.assign({},e,{nextAttrs:{}})];return Dm(this,i,o,this.mark.parameters()),this.coordinateTransformEncode(i),l.attributes=i[0].nextAttrs,this.graphicItem.glyphStates?this.graphicItem.glyphStates[t]||(this.graphicItem.glyphStates[t]=l):this.graphicItem.glyphStates={[t]:l},l}return l},this.glyphMeta=this.mark.getGlyphMeta()}getGlyphGraphicItems(){return this.glyphGraphicItems}initGraphicItem(t={}){if(this.graphicItem)return;this.graphicItem=this.mark.addGraphicItem(t,this.groupKey),this.graphicItem[Vg]=this,this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1);const e=this.glyphMeta.getMarks();this.glyphGraphicItems={},this.graphicItem.getSubGraphic().forEach((t=>{const i=e[t.name];this.glyphGraphicItems[t.name]=t,t.onBeforeAttributeUpdate=e=>this.mark?ym(i,e,this,t.name):e})),this.clearGraphicAttributes()}useStates(t,e){if(!this.graphicItem)return!1;this.mark.emit(lc.BEFORE_ELEMENT_STATE,{states:t},this),this.states=t.slice();const i=v(e)?e:this.hasStateAnimation();return this.graphicItem.glyphStateProxy=this.getStateAttrs,this.graphicItem.useStates(this.states,i),this.mark.emit(lc.AFTER_ELEMENT_STATE,{states:t},this),!0}encodeGraphic(){this.coordinateTransformEncode(this.items);const t=this.transformElementItems(this.items,this.mark.markType),e=!this.graphicItem;this.graphicItem||this.initGraphicItem(),this.diffState===Zd.enter||e?(this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!0),this.applyGraphicAttributes(t),this.graphicItem.onBeforeAttributeUpdate=this._onGlyphAttributeUpdate(!1)):this.applyGraphicAttributes(t),this.diffState!==Zd.enter&&this.diffState!==Zd.update||!this.states.length||(Object.values(this.glyphGraphicItems).forEach((t=>{t.states={}})),this.useStates(this.states)),this.items.map((t=>{t.nextAttrs={}}))}encodeCustom(t){var e;let i={};const s=this.glyphMeta.getChannelEncoder(),n=this.glyphMeta.getFunctionEncoder();if(n&&(i=n.call(null,Object.assign({},null===(e=this.graphicItem)||void 0===e?void 0:e.attribute,t),this.getDatum(),this,this.mark.getGlyphConfig())),s){let e;Object.keys(s).forEach((n=>{var r;if(!D(t[n])){e||(e=Object.assign({},null===(r=this.graphicItem)||void 0===r?void 0:r.attribute,t));const a=s[n].call(null,n,t[n],e,this.getDatum(),this,this.mark.getGlyphConfig());Object.keys(null!=a?a:{}).forEach((t=>{var e;i[t]=Object.assign(null!==(e=i[t])&&void 0!==e?e:{},a[t])}))}}))}return i}encodeDefault(){const t={};if(this.glyphMeta.getDefaultEncoder()){const e=this.glyphMeta.getDefaultEncoder().call(null,this.getDatum(),this,this.mark.getGlyphConfig());Object.assign(t,e)}return t}_onGlyphAttributeUpdate(t=!1){return e=>{if(!this.mark)return e;const i=this.glyphMeta.getMarks(),s=ym(this.mark.getAttributeTransforms(),e,this),n=t?this.encodeDefault():null,r=this.encodeCustom(e);return Object.keys(i).forEach((s=>{const a=i[s],o=this.glyphGraphicItems[s],l=null==r?void 0:r[s],h=Object.assign({},l);if(t){const t=null==n?void 0:n[s];Object.keys(null!=t?t:{}).forEach((e=>{ms(this.items[0].nextAttrs,e)||ms(h,e)||(h[e]=t[e])}))}const d=Object.assign({},function(t,e){var i;return(null!==(i=vm[t])&&void 0!==i?i:[]).reduce(((t,i)=>(i.channels.forEach((i=>{ms(e,i)&&(t[i]=e[i])})),t)),{})}(a,e),h),c=this._generateGlyphItems(a,this.items,d);this.coordinateTransformEncode(c);const u=this.transformElementItems(c,a);this.applyGlyphGraphicAttributes(u,s,o),a===Jd.shape&&(o.datum=c[0].datum)})),s}}_generateGlyphItems(t,e,i){const s=e.map((t=>Object.assign({},t,{nextAttrs:i})));return Wg.includes(t)&&this.mark.getSpec().enableSegments&&s.forEach(((t,s)=>{t.nextAttrs=Object.assign({},e[s].nextAttrs,i)})),s}getGraphicAttribute(t,e=!1,i){if(!this.graphicItem)return;const s=this.getPrevGraphicAttributes(i);return e&&ms(s,t)?s[t]:(i?this.glyphGraphicItems[i]:this.graphicItem).attribute[t]}setGraphicAttribute(t,e,i=!0,s){if(!this.graphicItem)return;const n=s?this.glyphGraphicItems[s]:this.graphicItem,r=this.getFinalGraphicAttributes(s),a=this.getPrevGraphicAttributes(s);i&&(r[t]=e),ms(a,t)||(a[t]=n.attribute[t]),n.setAttribute(t,e)}setGraphicAttributes(t,e=!0,i){if(!this.graphicItem)return;const s=i?this.glyphGraphicItems[i]:this.graphicItem,n=this.getFinalGraphicAttributes(i),r=this.getPrevGraphicAttributes(i);Object.keys(t).forEach((i=>{e&&(n[i]=t[i]),ms(r,i)||(r[i]=s.attribute[i])})),s.setAttributes(t)}diffAttributes(t,e){const i={},s=this.getFinalGraphicAttributes(e);for(const e in t)ms(s,e)&&Im(s[e],t[e])||(i[e]=t[e]);return i}applyGlyphGraphicAttributes(t,e,i){var s,n;if(this.mark.needAnimate()){const r=this.diffAttributes(t,e),a=null!==(s=this.getPrevGraphicAttributes(e))&&void 0!==s?s:{},o=null!==(n=this.getFinalGraphicAttributes(e))&&void 0!==n?n:{};Object.keys(r).forEach((t=>{a[t]=i.attribute[t],o[t]=r[t]})),this.setNextGraphicAttributes(r,e),this.setPrevGraphicAttributes(a,e),this.setFinalGraphicAttributes(o,e),i.setAttributes(r)}else i.setAttributes(t)}getFinalGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).finalAttrs}setFinalGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).finalAttrs=t}getPrevGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).prevAttrs}setPrevGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).prevAttrs=t}getNextGraphicAttributes(t){return(t?this.glyphGraphicItems[t]:this.graphicItem).nextAttrs}setNextGraphicAttributes(t,e){(e?this.glyphGraphicItems[e]:this.graphicItem).nextAttrs=t}clearChangedGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t)}))}clearGraphicAttributes(){this.setPrevGraphicAttributes(null),this.setNextGraphicAttributes(null),this.setFinalGraphicAttributes(null),Object.keys(this.glyphGraphicItems).forEach((t=>{this.setPrevGraphicAttributes(null,t),this.setNextGraphicAttributes(null,t),this.setFinalGraphicAttributes(null,t)}))}remove(){this.glyphGraphicItems=null,super.remove()}release(){this.glyphGraphicItems&&(Object.values(this.glyphGraphicItems).forEach((t=>{t[Vg]=null})),this.glyphGraphicItems=null),super.release()}}class rN extends Wm{constructor(t,e,i){super(t,Jd.glyph,i),this.glyphType=e,this.glyphMeta=_c.getGlyph(e)}configureGlyph(t){return this.spec.glyphConfig=t,this.commit(),this}getGlyphMeta(){return this.glyphMeta}getGlyphConfig(){return this.spec.glyphConfig}addGraphicItem(t,e){const i=function(t,e,i={}){if(!_c.getGraphicType(Jd.glyph))return;const s=_c.createGraphic(Jd.glyph,i),n=e.getMarks(),r=Object.keys(n).map((t=>{if(_c.getGraphicType(n[t])){const e=_c.createGraphic(n[t]);if(e)return e.name=t,e}}));return s.setSubGraphic(r),s}(0,this.glyphMeta,t);return super.addGraphicItem(t,e,i)}createElement(){return new nN(this)}}rN.markType=Jd.glyph;const aN=()=>{_c.registerMark(Jd.glyph,rN)},oN=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!qo(l))return{};const h=e.getGraphicAttribute("x",!1),d=e.getGraphicAttribute("y",!1),c=e.getGraphicAttribute("min",!1),u=e.getGraphicAttribute("max",!1),p=e.getGraphicAttribute("q1",!1),g=e.getGraphicAttribute("q3",!1),m=e.getGraphicAttribute("median",!1),_={from:{x:h,y:d},to:{x:h,y:d}};return qo(c)&&(_.from.min=l,_.to.min=c),qo(u)&&(_.from.max=l,_.to.max=u),qo(p)&&(_.from.q1=l,_.to.q1=p),qo(g)&&(_.from.q3=l,_.to.q3=g),qo(m)&&(_.from.median=l,_.to.median=m),_},lN=t=>(e,i,s)=>{var n,r,a;const o=null!==(a=null!==(n=e.getGraphicAttribute("direction",!1))&&void 0!==n?n:null===(r=e.mark.getGlyphConfig())||void 0===r?void 0:r.direction)&&void 0!==a?a:"vertical",l=t(e,o,i);if(!qo(l))return{};const h=e.getGraphicAttribute("x",!0),d=e.getGraphicAttribute("y",!0),c=e.getGraphicAttribute("min",!0),u=e.getGraphicAttribute("max",!0),p=e.getGraphicAttribute("q1",!0),g=e.getGraphicAttribute("q3",!0),m=e.getGraphicAttribute("median",!0),_={from:{x:h,y:d},to:{x:h,y:d}};return qo(c)&&(_.to.min=l,_.from.min=c),qo(u)&&(_.to.max=l,_.from.max=u),qo(p)&&(_.to.q1=l,_.from.q1=p),qo(g)&&(_.to.q3=l,_.from.q3=g),qo(m)&&(_.to.median=l,_.from.median=m),_},hN=(t,e,i)=>{var s,n,r,a,o,l,h,d,c,u,p,g;if(i&&qo(i.center))return i.center;let m,_,f,v,y;if(iN(e)){m=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x,_=null===(a=null===(r=t.getGraphicAttribute("points",!1,"max"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.x,f=null===(l=null===(o=t.getGraphicAttribute("points",!1,"min"))||void 0===o?void 0:o[0])||void 0===l?void 0:l.x;const e=t.getGraphicAttribute("width",!1,"box"),i=t.getGraphicAttribute("x",!1,"box");v=i,y=i+e}else{m=null===(d=null===(h=t.getGraphicAttribute("points",!1,"median"))||void 0===h?void 0:h[0])||void 0===d?void 0:d.y,_=null===(u=null===(c=t.getGraphicAttribute("points",!1,"max"))||void 0===c?void 0:c[0])||void 0===u?void 0:u.y,f=null===(g=null===(p=t.getGraphicAttribute("points",!1,"min"))||void 0===p?void 0:p[0])||void 0===g?void 0:g.y;const e=t.getGraphicAttribute("height",!1,"box"),i=t.getGraphicAttribute("y",!1,"box");v=i,y=i+e}return qo(m)?m:qo(v)&&qo(y)?(v+y)/2:qo(_)&&qo(f)?(_+f)/2:qo(f)?f:qo(_)?_:NaN},dN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={shaft:{},box:{},max:{},min:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.height)&&void 0!==o?o:i.getGraphicAttribute("height",!1),f=null!==(l=t.boxWidth)&&void 0!==l?l:i.getGraphicAttribute("boxWidth",!1),v=null!==(h=t.boxHeight)&&void 0!==h?h:i.getGraphicAttribute("boxHeight",!1),y=null!==(d=t.ruleWidth)&&void 0!==d?d:i.getGraphicAttribute("ruleWidth",!1),b=null!==(c=t.ruleHeight)&&void 0!==c?c:i.getGraphicAttribute("ruleHeight",!1);return s&&iN(s.direction)?(qo(v)?(Object.assign(u.box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2})):(Object.assign(u.box,{y:g-_/2,y1:g+_/2}),Object.assign(u.median,{y:g-_/2,y1:g+_/2})),qo(b)?(Object.assign(u.max,{y:g-b/2,y1:g+b/2}),Object.assign(u.min,{y:g-b/2,y1:g+b/2})):(Object.assign(u.max,{y:g-_/2,y1:g+_/2}),Object.assign(u.min,{y:g-_/2,y1:g+_/2}))):(qo(f)?(Object.assign(u.box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2})),qo(y)?(Object.assign(u.max,{x:p-y/2,x1:p+y/2}),Object.assign(u.min,{x:p-y/2,x1:p+y/2})):(Object.assign(u.max,{x:p-m/2,x1:p+m/2}),Object.assign(u.min,{x:p-m/2,x1:p+m/2}))),u},cN=oN(hN),uN=lN(hN),pN=(t,e,i)=>{var s,n,r,a;if(qo(null==i?void 0:i.center))return i.center;let o,l,h,d,c;if(iN(e)){o=null===(n=null===(s=t.getGraphicAttribute("points",!1,"median"))||void 0===s?void 0:s[0])||void 0===n?void 0:n.x;const e=t.getGraphicAttribute("width",!1,"minMaxBox"),i=t.getGraphicAttribute("x",!1,"minMaxBox");h=i,l=i+e;const r=t.getGraphicAttribute("width",!1,"q1q3Box"),a=t.getGraphicAttribute("x",!1,"q1q3Box");d=a,c=a+r}else{o=null===(a=null===(r=t.getGraphicAttribute("points",!1,"median"))||void 0===r?void 0:r[0])||void 0===a?void 0:a.y;const e=t.getGraphicAttribute("height",!1,"minMaxBox"),i=t.getGraphicAttribute("y",!1,"minMaxBox");h=i,l=i+e;const s=t.getGraphicAttribute("height",!1,"q1q3Box"),n=t.getGraphicAttribute("y",!1,"q1q3Box");d=n,c=n+s}return qo(o)?o:qo(d)&&qo(c)?(d+c)/2:qo(l)&&qo(h)?(l+h)/2:qo(h)?h:qo(l)?l:NaN},gN=(t,e,i,s)=>{var n,r,a,o,l,h,d,c;const u={minMaxBox:{},q1q3Box:{},median:{}},p=null!==(n=t.x)&&void 0!==n?n:i.getGraphicAttribute("x",!1),g=null!==(r=t.y)&&void 0!==r?r:i.getGraphicAttribute("y",!1),m=null!==(a=t.width)&&void 0!==a?a:i.getGraphicAttribute("width",!1),_=null!==(o=t.minMaxWidth)&&void 0!==o?o:i.getGraphicAttribute("minMaxWidth",!1),f=null!==(l=t.q1q3Width)&&void 0!==l?l:i.getGraphicAttribute("q1q3Width",!1),v=null!==(h=t.height)&&void 0!==h?h:i.getGraphicAttribute("height",!1),y=null!==(d=t.minMaxHeight)&&void 0!==d?d:i.getGraphicAttribute("minMaxHeight",!1),b=null!==(c=t.q1q3Height)&&void 0!==c?c:i.getGraphicAttribute("q1q3Height",!1);return s&&iN(s.direction)?(qo(y)?Object.assign(u.minMaxBox,{y:g-y/2,y1:g+y/2}):Object.assign(u.minMaxBox,{y:g-v/2,y1:g+v/2}),qo(b)?(Object.assign(u.q1q3Box,{y:g-b/2,y1:g+b/2}),Object.assign(u.median,{y:g-b/2,y1:g+b/2})):(Object.assign(u.q1q3Box,{y:g-v/2,y1:g+v/2}),Object.assign(u.median,{y:g-v/2,y1:g+v/2}))):(qo(_)?Object.assign(u.minMaxBox,{x:p-_/2,x1:p+_/2}):Object.assign(u.minMaxBox,{x:p-m/2,x1:p+m/2}),qo(f)?(Object.assign(u.q1q3Box,{x:p-f/2,x1:p+f/2}),Object.assign(u.median,{x:p-f/2,x1:p+f/2})):(Object.assign(u.q1q3Box,{x:p-m/2,x1:p+m/2}),Object.assign(u.median,{x:p-m/2,x1:p+m/2}))),u},mN=oN(pN),_N=lN(pN);class fN extends vx{constructor(){super(...arguments),this.type=fN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{lineWidth:2,boxWidth:30,shaftWidth:20,shaftShape:"line"})}_initProduct(t){const e=this.getStyle("shaftShape"),i=this.getVGrammarView(),s=this.getProductId(),n="bar"===e?"barBoxplot":"boxplot",r=this.getStyle("direction");this._product=i.glyph(n,null!=t?t:i.rootMark).id(s).configureGlyph({direction:r}),this._compiledProductId=s}}fN.type="boxPlot";const vN=Object.assign(Object.assign({},rL),{boxPlot:{name:"boxPlot",type:"boxPlot"},outlier:{name:"outlier",type:"symbol"}});class yN extends NC{constructor(){super(...arguments),this.type=_l.boxPlot}getMinField(){return this._minField}getMaxField(){return this._maxField}getQ1Field(){return this._q1Field}getMedianField(){return this._medianField}getQ3Field(){return this._q3Field}getOutliersField(){return this._outliersField}getShaftShape(){return this._shaftShape}getBoxFillColor(){return this._boxFillColor}getStrokeColor(){return this._strokeColor}getOutliersStyle(){return this._outliersStyle}setAttrFromSpec(){var t,e,i,s,n;super.setAttrFromSpec();const r=null!==(e=null===(t=this._spec.boxPlot)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this._minField=this._spec.minField,this._maxField=this._spec.maxField,this._q1Field=this._spec.q1Field,this._medianField=this._spec.medianField,this._q3Field=this._spec.q3Field,this._outliersField=this._spec.outliersField,this._lineWidth=null!==(i=r.lineWidth)&&void 0!==i?i:2,this._boxWidth=r.boxWidth,this._shaftShape=null!==(s=r.shaftShape)&&void 0!==s?s:"line",this._shaftWidth=r.shaftWidth,this._boxFillColor=r.boxFill,this._strokeColor=r.stroke,this._shaftFillOpacity="bar"===this._shaftShape?null!==(n=r.shaftFillOpacity)&&void 0!==n?n:.5:void 0,this._outliersStyle=this._spec.outliersStyle}initMark(){const t={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._boxPlotMark=this._createMark(yN.mark.boxPlot,{isSeriesMark:!0,progressive:t}),this._outlierMark=this._createMark(yN.mark.outlier,{progressive:t,key:vT,dataView:this._outlierDataView.getDataView(),dataProductId:this._outlierDataView.getProductId()})}initMarkStyle(){var t,e,i,s,n;const r=this._boxPlotMark;if(r){const i={direction:this._direction,lineWidth:this._lineWidth,shaftShape:this._shaftShape,fill:null!==(t=this._boxFillColor)&&void 0!==t?t:"line"===this._shaftShape?"#FFF":this.getColorAttribute(),minMaxFillOpacity:this._shaftFillOpacity,stroke:null!==(e=this._strokeColor)&&void 0!==e?e:"line"===this._shaftShape?this.getColorAttribute():"#000"},s="horizontal"===this._direction?Object.assign(Object.assign({y:this.dataToPositionY.bind(this)},i),{boxHeight:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Height:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxHeight:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}}):Object.assign(Object.assign({x:this.dataToPositionX.bind(this)},i),{boxWidth:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},ruleWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()},q1q3Width:()=>{var t;return null!==(t=this._boxWidth)&&void 0!==t?t:this._getMarkWidth()},minMaxWidth:()=>{var t;return null!==(t=this._shaftWidth)&&void 0!==t?t:this._getMarkWidth()}});this.setMarkStyle(r,s,xy.STATE_NORMAL,Py.Series)}const a=this._outlierMark;a&&this.setMarkStyle(a,{fill:null!==(s=null===(i=this._outliersStyle)||void 0===i?void 0:i.fill)&&void 0!==s?s:this.getColorAttribute(),size:h(null===(n=this._outliersStyle)||void 0===n?void 0:n.size)?this._outliersStyle.size:10,symbolType:"circle"},xy.STATE_NORMAL,Py.Series)}initBoxPlotMarkStyle(){var t,e;const i=this._boxPlotMark,s="horizontal"===this._direction?this._xAxisHelper:this._yAxisHelper;if(i&&s){const{dataToPosition:e}=s,n=null===(t=null==s?void 0:s.getScale)||void 0===t?void 0:t.call(s,0);this.setMarkStyle(i,{min:t=>ax(e(this.getDatumPositionValues(t,this._minField),{bandPosition:this._bandPosition}),n),q1:t=>ax(e(this.getDatumPositionValues(t,this._q1Field),{bandPosition:this._bandPosition}),n),median:t=>ax(e(this.getDatumPositionValues(t,this._medianField),{bandPosition:this._bandPosition}),n),q3:t=>ax(e(this.getDatumPositionValues(t,this._q3Field),{bandPosition:this._bandPosition}),n),max:t=>ax(e(this.getDatumPositionValues(t,this._maxField),{bandPosition:this._bandPosition}),n)},xy.STATE_NORMAL,Py.Series)}const n=this._outlierMark;if(n&&s){const{dataToPosition:t}=s,i=null===(e=null==s?void 0:s.getScale)||void 0===e?void 0:e.call(s,0),r="horizontal"===this._direction?{y:this.dataToPositionY.bind(this),x:e=>ax(t(this.getDatumPositionValues(e,Jz),{bandPosition:this._bandPosition}),i)}:{x:this.dataToPositionX.bind(this),y:e=>ax(t(this.getDatumPositionValues(e,Jz),{bandPosition:this._bandPosition}),i)};this.setMarkStyle(n,r,xy.STATE_NORMAL,Py.Series)}}initData(){if(super.initData(),!this._data)return;Lp(this._dataSet,"foldOutlierData",tN),Lp(this._dataSet,"addVChartProperty",WT);const t=new R(this._dataSet,{name:`${this.type}_outlier_${this.id}_data`});t.parse([this.getViewData()],{type:"dataview"}),t.name=`${sh}_series_${this.id}_outlierData`,t.transform({type:"foldOutlierData",options:{dimensionField:"horizontal"===this._direction?this._fieldY:this._fieldX,outliersField:this._outliersField}}),t.transform({type:"addVChartProperty",options:{beforeCall:eL.bind(this),call:iL}},!1),this._outlierDataView=new ZT(this._option,t)}init(t){super.init(t),this.initBoxPlotMarkStyle()}_getMarkWidth(){if(this._autoBoxWidth)return this._autoBoxWidth;const t="horizontal"===this._direction?this._yAxisHelper:this._xAxisHelper,e="horizontal"===this._direction?this._fieldY:this._fieldX,i=t.getBandwidth(e.length-1)/e.length;return this._autoBoxWidth=i,this._autoBoxWidth}onLayoutEnd(t){super.onLayoutEnd(t),this._autoBoxWidth=null}_initAnimationSpec(t={}){const e=E({},t);return["appear","enter","update","exit","disappear"].forEach((t=>{e[t]&&"scaleIn"===e[t].type?e[t].type="line"===this._shaftShape?"boxplotScaleIn":"barBoxplotScaleIn":e[t]&&"scaleOut"===e[t].type&&(e[t].type="line"===this._shaftShape?"boxplotScaleOut":"barBoxplotScaleOut")})),e}initAnimation(){var t,e,i,s,n,r,a;const o=zC(this);if(this._boxPlotMark){const e=this._initAnimationSpec(null===(t=$l.getAnimationInKey("scaleInOut"))||void 0===t?void 0:t()),i=this._initAnimationSpec(DC("boxPlot",this._spec,this._markAttributeContext));this._boxPlotMark.setAnimationConfig(EC(e,i,o))}if(this._outlierMark){const t={appear:null===(e=this._spec.animationAppear)||void 0===e?void 0:e.symbol,disappear:null===(i=this._spec.animationDisappear)||void 0===i?void 0:i.symbol,enter:null===(s=this._spec.animationEnter)||void 0===s?void 0:s.symbol,exit:null===(n=this._spec.animationExit)||void 0===n?void 0:n.symbol,update:null===(r=this._spec.animationUpdate)||void 0===r?void 0:r.symbol};this._outlierMark.setAnimationConfig(EC(null===(a=$l.getAnimationInKey("scaleInOut"))||void 0===a?void 0:a(),t,o))}}initTooltip(){this._tooltipHelper=new eN(this),this._boxPlotMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._boxPlotMark),this._outlierMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._outlierMark)}getStatisticFields(){const t=super.getStatisticFields(),e=t.find((t=>t.key===this._outliersField));return e&&(e.operations=["array-min","array-max"]),t}onEvaluateEnd(t){super.onEvaluateEnd(t),this._outlierDataView.updateData()}getDefaultShapeType(){return"square"}getActiveMarks(){return[this._boxPlotMark]}}yN.type=_l.boxPlot,yN.mark=vN;class bN extends aO{_getDefaultSeriesSpec(t){var e;const i=[t.maxField,t.medianField,t.q1Field,t.q3Field,t.minField,t.outliersField],s=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{boxPlot:t.boxPlot,direction:null!==(e=t.direction)&&void 0!==e?e:"vertical",minField:t.minField,maxField:t.maxField,q1Field:t.q1Field,medianField:t.medianField,q3Field:t.q3Field,outliersField:t.outliersField,outliersStyle:t.outliersStyle});return s["horizontal"===s.direction?"xField":"yField"]=i,s}transformSpec(t){super.transformSpec(t),t.axes||(t.axes=[{orient:"bottom"},{orient:"left"}]),fy(t)}}class xN extends cO{constructor(){super(...arguments),this.transformerConstructor=bN,this.type="boxPlot",this.seriesType=_l.boxPlot}}xN.type="boxPlot",xN.seriesType=_l.boxPlot,xN.transformerConstructor=bN;const SN=t=>{let e=0;return t.forEach(((t,i)=>{var s;D(t.value)&&((null===(s=t.children)||void 0===s?void 0:s.length)?t.value=SN(t.children):t.value=0),e+=Math.abs(t.value)})),e};function MN(t){return t.depth}function kN(t,e){return e-1-t.endDepth}const AN=(t,e)=>(null==t?void 0:t.y0)-(null==e?void 0:e.y0),wN=(t,e)=>{if(D(t.value))return null;const i=(e?t.targetLinks:t.sourceLinks).reduce(((t,e)=>(D(e.value)?t.count+=1:t.sum+=e.value,t)),{sum:0,count:0});return i.count>0?(t.value-i.sum)/i.count:null},TN={left:MN,right:kN,justify:function(t,e){return t.sourceLinks.length?t.depth:e-1},center:function(t,e,i){return t.targetLinks.length?t.depth:t.sourceLinks.length?ja(t.sourceLinks.map((t=>i[t.target].depth)))-1:0},start:MN,end:kN},LN=Xb(0,1);class CN{constructor(t){this._ascendingSourceBreadth=(t,e)=>AN(this._nodeMap[t.source],this._nodeMap[e.source])||t.index-e.index,this._ascendingTargetBreadth=(t,e)=>AN(this._nodeMap[t.target],this._nodeMap[e.target])||t.index-e.index,this.options=Object.assign({},CN.defaultOptions,t);const e=this.options.nodeKey,i=ys(e)?e:e?Em(e):null;this._getNodeKey=i,this._logger=g.getInstance(),this._alignFunc=ys(this.options.setNodeLayer)?t=>this.options.setNodeLayer(t.datum):TN[this.options.nodeAlign]}layout(t,e){if(!t)return null;const i="width"in e?{x0:0,x1:e.width,y0:0,y1:e.height,width:e.width,height:e.height}:{x0:Math.min(e.x0,e.x1),x1:Math.max(e.x0,e.x1),y0:Math.min(e.y0,e.y1),y1:Math.max(e.y0,e.y1),width:Math.abs(e.x1-e.x0),height:Math.abs(e.y1-e.y0)};sN(this.options.direction)?this._viewBox={x0:i.y0,x1:i.y1,y0:i.x0,y1:i.x1,width:i.height,height:i.width}:this._viewBox=i;const s=this.computeNodeLinks(t),n=s.nodes;let r=s.links;if(this._nodeMap=s.nodeMap,this.computeNodeValues(n),this.computeNodeDepths(n),["right","end","justify"].includes(this.options.nodeAlign)&&this.computeNodeEndDepths(n),this._maxDepth<=1)return null;const a=this.computeNodeBreadths(n);if(this.computeLinkBreadths(n),n.forEach((t=>{t.sourceLinks=t.sourceLinks.filter((t=>!D(t.source)&&!D(t.target))),t.targetLinks=t.targetLinks.filter((t=>!D(t.source)&&!D(t.target)))})),r=r.filter((t=>!D(t.source)&&!D(t.target))),sN(this.options.direction))if(this.options.inverse){const t=this._viewBox.x1;n.forEach((e=>{const{y0:i,y1:s,x0:n,x1:r}=e;e.y0=t-r,e.y1=t-n,e.x0=i,e.x1=s})),r.forEach((e=>{e.vertical=!0;const{x0:i,x1:s,y0:n,y1:r}=e;e.x0=n,e.x1=r,e.y0=t-i,e.y1=t-s}))}else n.forEach((t=>{const{y0:e,y1:i}=t;t.y0=t.x0,t.y1=t.x1,t.x0=e,t.x1=i})),r.forEach((t=>{t.vertical=!0;const e=t.x0,i=t.x1;t.x0=t.y0,t.x1=t.y1,t.y0=e,t.y1=i}));else this.options.inverse&&(n.forEach((t=>{const{x0:e,x1:s}=t;t.x0=i.x1-s,t.x1=i.x1-e})),r.forEach((t=>{t.x0=i.x1-t.x0,t.x1=i.x1-t.x1})));return r.forEach((t=>{const e=this._nodeMap[t.source],i=this._nodeMap[t.target];t.sourceRect={x0:e.x0,x1:e.x1,y0:e.y0,y1:e.y1},t.targetRect={x0:i.x0,x1:i.x1,y1:i.y1,y0:i.y0}})),{nodes:n,links:r,columns:a}}computeHierarchicNodeLinks(t){const e=[],i=[],s={},n={},r=[];SN(t);const a=(t,i,n)=>{t.forEach(((t,o)=>{const l=this._getNodeKey?this._getNodeKey(t):n?`${n[n.length-1].key}-${o}`:`${i}-${o}`,h=D(t.value)?0:wH(t.value);if(s[l])s[l].value=void 0;else{const n={depth:i,datum:t,index:o,key:l,value:h,sourceLinks:[],targetLinks:[]};s[l]=n,e.push(n)}n&&r.push({source:n[n.length-1].key,target:l,value:h,parents:n}),t.children&&t.children.length&&a(t.children,i+1,n?n.concat([s[l]]):[s[l]])}))};return a(t,0,null),r.forEach(((t,e)=>{const r=`${t.source}-${t.target}`,a=eD(t,["parents"]);if(a.parents=t.parents.map((t=>eD(t,["sourceLinks","targetLinks"]))),n[r])return n[r].value+=wH(t.value),void n[r].datum.push(a);const o={index:e,key:`${t.source}-${t.target}`,source:t.source,target:t.target,datum:[a],value:t.value,parents:t.parents.map((t=>t.key))};i.push(o),s[t.source].sourceLinks.push(o),s[t.target].targetLinks.push(o),n[r]=o})),{nodes:e,links:i,nodeMap:s}}computeSourceTargetNodeLinks(t){const e=[],i=[],s={};t.nodes&&t.nodes.forEach(((t,i)=>{const n={depth:-1,datum:t,index:i,key:this._getNodeKey?this._getNodeKey(t):i,value:t.value,sourceLinks:[],targetLinks:[]};s[n.key]=n,e.push(n)}));const n=[];return t.links.forEach(((r,a)=>{const o=!D(r.source),l=!D(r.target);if(t.nodes&&(!s[r.source]||!s[r.target]))return;t.nodes||!o||s[r.source]||(s[r.source]={value:void 0,depth:-1,index:e.length,key:r.source,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.source])),t.nodes||!l||s[r.target]||(s[r.target]={value:void 0,depth:-1,index:e.length,key:r.target,datum:null,sourceLinks:[],targetLinks:[]},e.push(s[r.target]));const h={index:a,source:r.source,target:r.target,datum:r,value:r.value};this.options.divideNodeValueToLink&&D(r.value)&&n.push(h),i.push(h),o&&s[r.source].sourceLinks.push(h),l&&s[r.target].targetLinks.push(h)})),this.options.divideNodeValueToLink&&n.length&&n.forEach((t=>{const e=[wN(s[t.source]),wN(s[t.target],!0)].filter((t=>!D(t)));e.length&&(t.value=ja(e))})),{nodeMap:s,nodes:e,links:i}}computeNodeLinks(t){let e;"links"in t?e=this.computeSourceTargetNodeLinks(t):(this._isHierarchic=!0,e=this.computeHierarchicNodeLinks(t.nodes));let i=e.nodes;const s=e.links;if(this.options.linkSortBy)for(let t=0,e=i.length;tt.targetLinks.length||t.sourceLinks.length))),{nodes:i,links:s,nodeMap:e.nodeMap}}computeNodeValues(t){for(let e=0,i=t.length;e{var i;return t+(null!==(i=wH(e.value))&&void 0!==i?i:0)}),0),i.targetLinks.reduce(((t,e)=>{var i;return t+(null!==(i=wH(e.value))&&void 0!==i?i:0)}),0))}}computeNodeDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link"),this._maxDepth=r}computeNodeEndDepths(t){const e=t.length;let i,s,n=t,r=0;for(;n.length&&re&&this._logger.warn("Error: there is a circular link")}computeNodeLayers(t){const e=this.options.nodeWidth,i=this.options.linkWidth,s=this.options.minStepWidth,n=this._viewBox.width;let r=null,a=null,o=!1;if(S(e)){const t=Ps(parseFloat(e.replace("%",""))/100,0,1);let i=n/(this._maxDepth-1+t);s>0&&(i=Math.max(s,i)),r=i*t,a=i*(1-t),o=!0}else if(h(e)){if(r=e,h(i))a=i;else if(D(i)){let t=(n-e)/(this._maxDepth-1);s>0&&(t=Math.max(s,t)),a=t-e}o=!0}else ys(e)&&h(i)&&(a=i);const l=[];for(let e=0,i=t.length;e{const i=e.reduce(((t,e)=>t+e.value),0),s=e.reduce(((t,e)=>t+this.options.nodeGap(e)),0);return Math.min(t,(this._viewBox.height-s)/i)}),1/0);else{const e=t.reduce(((t,e)=>Math.max(t,e.length)),0),i=this._viewBox.height/e,s=Math.min(this.options.nodeGap,i);if(a=()=>s,this._gapY=s,(n+s)*e>this._viewBox.height&&(n=i-s),this.options.equalNodeHeight)o=this._viewBox.height/e-s;else{const e=n>0?Math.max(s,n):s;r=t.reduce(((t,i)=>{const s=i.reduce(((t,e)=>t+e.value),0);return Math.min(t,(this._viewBox.height-((i.length-1)*e+n))/s)}),1/0)}}const l="start"===this.options.gapPosition,d=!l&&"end"!==this.options.gapPosition,c=h(this.options.nodeHeight)?t=>this.options.nodeHeight:ys(this.options.nodeHeight)?this.options.nodeHeight:o>0?t=>o:t=>Math.max(t.value*r,0),u=h(this.options.linkHeight)?()=>this.options.linkHeight:ys(this.options.linkHeight)?this.options.linkHeight:(t,e,i)=>Math.max(e.value?i*LN(t.value/e.value):0,s,0);for(let e=0,i=t.length;e0)if("start"===this.options.crossNodeAlign);else if("end"===this.options.crossNodeAlign)for(let t=0,e=i.length;t1&&(p/=i.length-1,r+p>=0)){r+=p,this._gapY=Math.min(r);for(let t=1,e=i.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}D(this.options.nodeSortBy)&&n.sort(AN),this.resolveCollisions(n,i)}}relaxRightToLeft(t,e,i){for(let s=t.length-2;s>=0;--s){const n=t[s];for(let t=0,i=n.length;t0))continue;const a=(s/r-i.y0)*e;i.y0+=a,i.y1+=a,this.reorderNodeLinks(i)}void 0===this.options.nodeSortBy&&n.sort(AN),this.resolveCollisions(n,i)}}resolveCollisions(t,e){const i=t.length>>1,s=t[i];this.resolveCollisionsBottomToTop(t,s.y0-this._gapY,i-1,e),this.resolveCollisionsTopToBottom(t,s.y1+this._gapY,i+1,e),this.resolveCollisionsBottomToTop(t,this._viewBox.y1,t.length-1,e),this.resolveCollisionsTopToBottom(t,this._viewBox.y0,0,e)}resolveCollisionsTopToBottom(t,e,i,s){for(;i1e-6&&(n.y0+=r,n.y1+=r),e=n.y1+this._gapY}}resolveCollisionsBottomToTop(t,e,i,s){for(;i>=0;--i){const n=t[i],r=(n.y1-e)*s;r>1e-6&&(n.y0-=r,n.y1-=r),e=n.y0-this._gapY}}targetTop(t,e){let i,s,n,r=t.y0-(t.sourceLinks.length-1)*this._gapY/2;for(i=0,s=t.sourceLinks.length;ii.y1||n?(e.y0=i.y1-e.thickness/2,n=!0):s+=e.thickness}let r=i.y0;n=!1;for(let t=0,e=i.targetLinks.length;ti.y1||n?(e.y1=i.y1-e.thickness/2,n=!0):r+=e.thickness}}}computeLinkBreadthsOverlap(t){const e=this.options.linkOverlap;for(let i=0,s=t.length;i{const i=new CN(t).layout(Array.isArray(e)?e[0]:e,"width"in t?{width:t.width,height:t.height}:{x0:t.x0,x1:t.x1,y0:t.y0,y1:t.y1});return i?[i]:[]},DN=(t,e,i)=>{e.forEach((e=>{D(e[i])||t.add(e[i]),e.children&&e.children.length>0&&DN(t,e.children,i)}))},PN=t=>{var e;if(!t||!y(t))return[];if(t.length>1){const e={links:[],nodes:[]};return t.forEach((t=>{"links"!==t.id&&"nodes"!==t.id||(e[t.id]=t.values)})),[e]}return(null===(e=t[0])||void 0===e?void 0:e.latestData)?t[0].latestData:t},ON=(t,e)=>{if(!t||!(null==e?void 0:e.view)||!t.length)return[];const i=e.view();if(i.x1-i.x0==0||i.y1-i.y0==0||i.x1-i.x0==-1/0||i.x1-i.x0==1/0||i.y1-i.y0==-1/0||i.y1-i.y0==1/0)return[];const s=t[0];if(("source"!==e.sourceField||"target"!==e.targetField||"value"!==e.valueField)&&s.links){const t=[];s.links.forEach((i=>{const s={};for(const t in i)t===e.sourceField?s.source=i[e.sourceField]:t===e.targetField?s.target=i[e.targetField]:t===e.valueField?s.value=i[e.valueField]:s[t]=i[t];t.push(s)})),s.links=t}const n=new CN(e),r=[];return r.push(n.layout(s,i)),r},RN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].nodes)&&void 0!==i?i:[]},IN=t=>{var e,i;return t&&y(t)&&(null===(e=t[0])||void 0===e?void 0:e.latestData)&&t[0].latestData.length&&t[0].latestData[0]&&null!==(i=t[0].latestData[0].links)&&void 0!==i?i:[]};class BN extends UT{getDefaultTooltipPattern(t,e){switch(t){case"mark":return{visible:!0,activeType:t,title:{key:void 0,value:t=>{if(t.source){if(h(t.source)){const e=this.series.getSeriesKeys();return e[t.source]+" => "+e[t.target]}return t.source+" => "+t.target}return t.datum?t.datum[this.series.getSpec().categoryField]:t.key},hasShape:!1},content:[{key:this.markTooltipKeyCallback,value:t=>t.value,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"dimension":if(e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},s=[];return e.forEach((({data:t})=>t.forEach((({series:t})=>{s.push({seriesId:t.id,key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1})})))),{visible:!0,activeType:t,title:i,content:s}}}return null}}const FN=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:((t,e=!0)=>({type:"horizontal"===t.direction?"growWidthIn":"growHeightIn",options:{overall:e?t.growFrom():e,orient:"positive"}}))(t),YN=t=>"fadeIn"===t?{type:"fadeIn"}:{type:"linkPathGrowIn"},jN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.x0,a=t.x1,o=t.y0,l=t.y1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d),c=Math.round),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.y0-n/2),l=c(t.y1-n/2)):"end"===t.align?(o=c(t.y0+t.thickness/2-n),l=c(t.y1+t.thickness/2-n)):(o=c(t.y0-t.thickness/2),l=c(t.y1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${a},${c(l-n/2)}L${c(a+n)},${c((l+p)/2)}L${a},${c(p+n/2)}`:"",_=t.startArrow&&g?`L${r},${c(u+n/2)}L${c(r-n)},${c((o+u)/2)}L${r},${c(o-n/2)}`:"";return"line"===t.pathType?`M${r},${o}L${a},${l}${m}L${a},${p}L${r},${u}${_}Z`:"polyline"===t.pathType?`M${r},${o}L${h},${o}L${h},${l}L${a},${l}\n ${m}L${a},${p}L${h},${p}L${h},${u}L${r},${u}${_}Z`:`M${r},${o}C${h},${o},${d},${l},${a},${l}\n ${m}L${a},${p}C${d},${p},${h},${u},${r},${u}${_}Z`},HN=(t,e)=>{var i;const s=null!==(i=t.curvature)&&void 0!==i?i:.5,n="number"==typeof e?t.thickness*e:t.thickness;let r=t.y0,a=t.y1,o=t.x0,l=t.x1,h=r+s*(a-r),d=a+s*(r-a),c=t=>t;!1!==t.round&&(c=Math.round,r=Math.round(r),a=Math.round(a),o=Math.round(o),l=Math.round(l),h=Math.round(h),d=Math.round(d)),"line"===t.pathType||t.pathType,"center"===t.align?(o=c(t.x0-n/2),l=c(t.x1-n/2)):"end"===t.align?(o=c(t.x0+t.thickness/2-n),l=c(t.x1+t.thickness/2-n)):(o=c(t.x0-t.thickness/2),l=c(t.x1-t.thickness/2));const u=c(o+n),p=c(l+n),g=Math.abs(a-r)>1e-6,m=t.endArrow&&g?`L${c(l-n/2)},${a}L${c((l+p)/2)},${c(a+n)}L${c(p+n/2)},${a}`:"",_=t.startArrow&&g?`L${c(u+n/2)},${r}L${c((u+o)/2)},${c(r-n)}L${c(o-n/2)},${r}`:"";return"line"===t.pathType?`M${o},${r}L${l},${a}${m}L${p},${a}L${u},${r}${_}Z`:"polyline"===t.pathType?`M${o},${r}L${o},${h}L${l},${h}L${l},${a}\n ${m}L${p},${a}L${p},${h}L${u},${h}L${u},${r}${_}Z`:`M${o},${r}C${o},${h},${l},${d},${l},${a}\n ${m}L${p},${a}C${p},${d},${u},${h},${u},${r}${_}Z`},zN=(t,e,i,s)=>{var n;const r=null!==(n=t.direction)&&void 0!==n?n:null==s?void 0:s.direction,a=["vertical","TB","BT"].includes(r)?HN:jN,o="number"==typeof t.ratio&&t.ratio>=0&&t.ratio<=1,l=Object.keys(t);return["x0","y0","x1","y1"].every((t=>l.includes(t)))?{back:{path:o?a(t,1):""},front:{path:a(t,o?t.ratio:1)}}:{}},NN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1),thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:Object.assign({},s,{x1:s.x0,y1:s.y0}),to:s}},VN=(t,e,i)=>{const s={x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0),thickness:t.getGraphicAttribute("thickness",!0),round:t.getGraphicAttribute("round",!0),align:t.getGraphicAttribute("align",!0),pathType:t.getGraphicAttribute("pathType",!0),endArrow:t.getGraphicAttribute("endArrow",!0),startArrow:t.getGraphicAttribute("startArrow",!0)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:s,to:Object.assign({},s,{x1:s.x0,y1:s.y0})}},WN=(t,e,i)=>{const s={thickness:t.getGraphicAttribute("thickness",!1),round:t.getGraphicAttribute("round",!1),align:t.getGraphicAttribute("align",!1),pathType:t.getGraphicAttribute("pathType",!1),endArrow:t.getGraphicAttribute("endArrow",!1),startArrow:t.getGraphicAttribute("startArrow",!1)};return Object.keys(s).forEach((t=>{D(s[t])&&delete s[t]})),{from:Object.assign(Object.assign({x0:t.getGraphicAttribute("x0",!0),x1:t.getGraphicAttribute("x1",!0),y0:t.getGraphicAttribute("y0",!0),y1:t.getGraphicAttribute("y1",!0)},s),s),to:Object.assign({x0:t.getGraphicAttribute("x0",!1),x1:t.getGraphicAttribute("x1",!1),y0:t.getGraphicAttribute("y0",!1),y1:t.getGraphicAttribute("y1",!1)},s)}};class GN extends vx{constructor(){super(...arguments),this.type=GN.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,x0:0,y0:0,x1:100,y1:100,thickness:1,round:!0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId(),s=this.getStyle("direction");this._product=e.glyph("linkPath",null!=t?t:e.rootMark).id(i).configureGlyph({direction:s}),this._compiledProductId=i}}GN.type="linkPath";const UN=Object.assign(Object.assign({},rL),{node:{name:"node",type:"rect"},link:{name:"link",type:"linkPath"}});class $N extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"node")}}class XN extends NC{constructor(){super(...arguments),this.type=_l.sankey,this.transformerConstructor=$N,this._nodeLayoutZIndex=Ey.Node,this._labelLayoutZIndex=Ey.Label,this._viewBox=new Kt,this._fillByNode=t=>{var e,i,s,n,r;if(t&&t.sourceRect&&t.targetRect)return this._fillByLink(t);const a=null===(i=null===(e=this._spec.node)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(M(a))return a;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._option)||void 0===s?void 0:s.globalScale)||void 0===n?void 0:n.getScale("color"),i=(null==t?void 0:t.datum)?t.datum:t;return null==e?void 0:e.scale(null==i?void 0:i[this._spec.seriesField])}return null===(r=this._colorScale)||void 0===r?void 0:r.scale(this._getNodeNameFromData(t))},this._fillByLink=t=>{var e,i,s,n,r,a,o;const l=null===(i=null===(e=this._spec.link)||void 0===e?void 0:e.style)||void 0===i?void 0:i.fill;if(l)return l;if(M(this._spec.seriesField)){const e=null===(n=null===(s=this._nodesSeriesData)||void 0===s?void 0:s.getLatestData())||void 0===n?void 0:n.find((e=>t.source===e.key)),i=null==e?void 0:e.datum,o=null===(a=null===(r=this._option)||void 0===r?void 0:r.globalScale)||void 0===a?void 0:a.getScale("color");return null==o?void 0:o.scale(null==i?void 0:i[this._spec.seriesField])}const d=h(t.source)?this.getNodeList()[t.source]:t.source;return null===(o=this._colorScale)||void 0===o?void 0:o.scale(d)},this._handleEmphasisElement=t=>{var e,i,s,n,r;const a=null!==(e=this._spec.emphasis)&&void 0!==e?e:{},o=t.item;"adjacency"===a.effect?o&&o.mark===(null===(i=this._nodeMark)||void 0===i?void 0:i.getProduct())?this._handleNodeAdjacencyClick(o):o&&o.mark===(null===(s=this._linkMark)||void 0===s?void 0:s.getProduct())?this._handleLinkAdjacencyClick(o):this._handleClearEmpty():"related"===a.effect&&(o&&o.mark===(null===(n=this._nodeMark)||void 0===n?void 0:n.getProduct())?this._handleNodeRelatedClick(o):o&&o.mark===(null===(r=this._linkMark)||void 0===r?void 0:r.getProduct())?this._handleLinkRelatedClick(o):this._handleClearEmpty())},this._handleClearEmpty=()=>{var t,e;if(!this._needClear)return;const i=null===(t=this._nodeMark)||void 0===t?void 0:t.getProductElements();if(!i||!i.length)return;const s=null===(e=this._linkMark)||void 0===e?void 0:e.getProductElements();if(!s||!s.length)return;const n=[xy.STATE_SANKEY_EMPHASIS,xy.STATE_SANKEY_EMPHASIS_REVERSE];i.forEach((t=>{t.removeState(n)})),s.forEach((t=>{t.removeState(n)})),this._needClear=!1},this._handleNodeAdjacencyClick=t=>{const e=t.getDatum(),i=[e.key];if(this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,s)=>{const n=t.getDatum(),r=(null==n?void 0:n.parents)?"parents":"source";if(Ba(n[r]).includes(e.key)){let s;if(i.includes(n.source)||i.push(n.source),i.includes(n.target)||i.push(n.target),"parents"===r){const t=n.datum;s=(t?t.filter((t=>t.parents.some((t=>t.key===e.key)))).reduce(((t,e)=>t+e.value),0):0)/n.value}t.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(xy.STATE_SANKEY_EMPHASIS),t.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:s})}else n.target===e.key?i.includes(n.source)||i.push(n.source):(t.removeState(xy.STATE_SANKEY_EMPHASIS),t.addState(xy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleLinkAdjacencyClick=t=>{const e=t.getDatum(),i=[e.source,e.target];if(this._linkMark){const e=this._linkMark.getProductElements();if(!e||!e.length)return;e.forEach((e=>{e===t?(e.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),e.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:1})):(e.removeState(xy.STATE_SANKEY_EMPHASIS),e.addState(xy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),i),this._needClear=!0},this._handleNodeRelatedClick=t=>{var e;const i=t.getDatum(),s=this._nodeMark.getProductElements();if(!s||!s.length)return;const n=this._linkMark.getProductElements();if(n&&n.length){if("source"==((null===(e=n[0].getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[i.key],e=[];if(n.forEach(((n,r)=>{var a,o,l,h;const d=n.getDatum(),c=(null==d?void 0:d.parents)?"parents":"source";if(Ba(d[c]).includes(i.key)){if(e.includes(null!==(a=d.key)&&void 0!==a?a:d.index)||e.push(null!==(o=d.key)&&void 0!==o?o:d.index),t.includes(d.source)||t.push(d.source),!t.includes(d.target)){t.push(d.target);let i=s.find((t=>t.data[0].key===d.target)).data[0].sourceLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.target))){t.push(i.target);const e=s.find((t=>t.data[0].key===i.target));n.push(e.data[0].targetLinks)}})),void(i=n)}}}else if(d.target===i.key&&(e.includes(null!==(l=d.key)&&void 0!==l?l:d.index)||e.push(null!==(h=d.key)&&void 0!==h?h:d.index),!t.includes(d.source))){t.push(d.source);let i=s.find((t=>t.data[0].key===d.source)).data[0].targetLinks;for(;(null==i?void 0:i.length)>0;){const n=[];return i.forEach((i=>{var r,a;if(!e.includes(null!==(r=i.key)&&void 0!==r?r:i.index)&&(e.push(null!==(a=i.key)&&void 0!==a?a:i.index),!t.includes(i.source))){t.push(i.source);const e=s.find((t=>t.data[0].key===i.source));n.push(e.data[0].targetLinks)}})),void(i=n)}}})),this._linkMark){const t=this._linkMark.getProductElements();if(!t||!t.length)return;t.forEach(((t,i)=>{var s;e.includes(null!==(s=t.getDatum().key)&&void 0!==s?s:t.getDatum().index)?(t.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(xy.STATE_SANKEY_EMPHASIS)):(t.removeState(xy.STATE_SANKEY_EMPHASIS),t.addState(xy.STATE_SANKEY_EMPHASIS_REVERSE))}))}this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}else{const t=[i.key],e=i.targetLinks.reduce(((t,e)=>(Ba(e.datum).forEach((e=>{const s=e.parents,n=s.length;for(let r=0;rt.source===n&&t.target===a));l?l.value+=o:t.push({source:n,target:a,value:o})}})),t)),[]);n.forEach(((s,n)=>{const r=s.getDatum(),a=(null==r?void 0:r.parents)?"parents":"source",o=r.datum,l=o?o.filter((t=>t[a].some((t=>t.key===i.key)))):null,h=e.find((t=>t.source===r.source&&t.target===r.target));if(l&&l.length){t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target);const e=l.reduce(((t,e)=>t+e.value),0)/r.value;return s.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(xy.STATE_SANKEY_EMPHASIS),void s.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:e})}if(h)return t.includes(r.source)||t.push(r.source),t.includes(r.target)||t.push(r.target),s.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),s.addState(xy.STATE_SANKEY_EMPHASIS),void s.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:h.value/r.value});s.removeState(xy.STATE_SANKEY_EMPHASIS),s.addState(xy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._nodeMark&&this._highLightElements(this._nodeMark.getProductElements(),t)}this._needClear=!0}},this._handleLinkRelatedClick=t=>{var e;const i=this._nodeMark.getProductElements();if(!i||!i.length)return;const s=this._linkMark.getProductElements();if(s&&s.length){if("source"==((null===(e=t.getDatum())||void 0===e?void 0:e.parents)?"parents":"source")){const t=[xy.STATE_SANKEY_EMPHASIS,xy.STATE_SANKEY_EMPHASIS_REVERSE];this._linkMark&&s.forEach((e=>{e.removeState(t)})),this._nodeMark&&i.forEach((e=>{e.removeState(t)}))}else{const e=t.getDatum(),n=[e.source,e.target],r=[];Ba(e.datum).forEach((t=>{const e=t.parents,i=e.length;for(let s=0;st.source===i&&t.target===n));r.push({source:e[s].key,target:e[s+1].key,value:t.value}),o?o.value+=a:r.push({source:i,target:n,value:a})}})),s.forEach((t=>{const i=t.getDatum(),s=i.datum;if(i.source===e.source&&i.target===e.target)return t.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),void t.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:1});const a=s?s.filter((t=>{const i=t.parents.map((t=>t.key));return i.includes(e.source)&&i.includes(e.target)})):null;if(a&&a.length){n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target);const s=a.filter((t=>t.parents.some(((i,s)=>{var n;return i.key===e.source&&(null===(n=t.parents[s+1])||void 0===n?void 0:n.key)===e.target})))).reduce(((t,e)=>t+e.value),0),r=s/i.value;return t.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(xy.STATE_SANKEY_EMPHASIS),void t.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:r})}const o=r.find((t=>t.source===i.source&&t.target===i.target));if(o)return n.includes(i.source)||n.push(i.source),n.includes(i.target)||n.push(i.target),t.removeState(xy.STATE_SANKEY_EMPHASIS_REVERSE),t.addState(xy.STATE_SANKEY_EMPHASIS),void t.addState(xy.STATE_SANKEY_EMPHASIS,{ratio:o.value/i.value});t.removeState(xy.STATE_SANKEY_EMPHASIS),t.addState(xy.STATE_SANKEY_EMPHASIS_REVERSE)})),this._highLightElements(i,n)}this._needClear=!0}}}get direction(){var t;return null!==(t=this._spec.direction)&&void 0!==t?t:"horizontal"}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t;super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(null!==(t=this._spec.seriesField)&&void 0!==t?t:this._spec.categoryField)}initData(){var t,e,i,s;super.initData();const n=this.getViewData(),r=this.getRawData();if(r&&n){Lp(this._dataSet,"sankeyLayout",ON),Lp(this._dataSet,"sankeyFormat",PN),r.transform({type:"sankeyFormat"},!1),n.transform({type:"sankeyLayout",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),sourceField:this._spec.sourceField,targetField:this._spec.targetField,valueField:this._spec.valueField,direction:this.direction,crossNodeAlign:this._spec.crossNodeAlign,nodeAlign:null!==(t=this._spec.nodeAlign)&&void 0!==t?t:"justify",nodeGap:null!==(e=this._spec.nodeGap)&&void 0!==e?e:8,nodeWidth:null!==(i=this._spec.nodeWidth)&&void 0!==i?i:10,linkWidth:this._spec.linkWidth,minStepWidth:this._spec.minStepWidth,minNodeHeight:null!==(s=this._spec.minNodeHeight)&&void 0!==s?s:4,minLinkHeight:this._spec.minLinkHeight,iterations:this._spec.iterations,nodeKey:this._spec.nodeKey,linkSortBy:this._spec.linkSortBy,nodeSortBy:this._spec.nodeSortBy,setNodeLayer:this._spec.setNodeLayer,dropIsolatedNode:this._spec.dropIsolatedNode,nodeHeight:this._spec.nodeHeight,linkHeight:this._spec.linkHeight,equalNodeHeight:this._spec.equalNodeHeight,linkOverlap:this._spec.linkOverlap,inverse:this._spec.inverse},level:Hp.sankeyLayout});const{dataSet:a}=this._option;Lp(a,"sankeyNodes",RN),Lp(a,"flatten",MH);const o=new R(a,{name:`sankey-node-${this.id}-data`});o.parse([this.getViewData()],{type:"dataview"}),o.transform({type:"sankeyNodes"}),o.transform({type:"flatten",options:{callback:t=>{if(t.datum){const e=t.datum[t.depth];return Object.assign(Object.assign({},t),e)}return t}}},!1),o.transform({type:"addVChartProperty",options:{beforeCall:eL.bind(this),call:iL}},!1),this._nodesSeriesData=new ZT(this._option,o),Lp(a,"sankeyLinks",IN);const l=new R(a,{name:`sankey-link-${this.id}-data`});l.parse([this.getViewData()],{type:"dataview"}),l.transform({type:"sankeyLinks"}),l.transform({type:"addVChartProperty",options:{beforeCall:eL.bind(this),call:iL}},!1),this._linksSeriesData=new ZT(this._option,l)}}initMark(){var t,e,i,s;const n=this._createMark(XN.mark.node,{isSeriesMark:!0,dataView:this._nodesSeriesData.getDataView(),dataProductId:this._nodesSeriesData.getProductId(),customShape:null===(t=this._spec.node)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.node)||void 0===e?void 0:e.stateSort});n&&(n.setZIndex(this._nodeLayoutZIndex),this._nodeMark=n);const r=this._createMark(XN.mark.link,{dataView:this._linksSeriesData.getDataView(),dataProductId:this._linksSeriesData.getProductId(),customShape:null===(i=this._spec.link)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.link)||void 0===s?void 0:s.stateSort});r&&(this._linkMark=r)}_buildMarkAttributeContext(){super._buildMarkAttributeContext(),this._markAttributeContext.valueToNode=this.valueToNode.bind(this),this._markAttributeContext.valueToLink=this.valueToLink.bind(this)}valueToNode(t){const e=this._nodesSeriesData.getLatestData(),i=Ba(t)[0];return e&&e.find((t=>t.key===i))}valueToLink(t){const e=this._linksSeriesData.getLatestData(),i=Ba(t);return e&&e.find((t=>t&&t.source===i[0]&&t.target===i[1]))}valueToPositionX(t){const e=this.valueToNode(t);return null==e?void 0:e.x0}valueToPositionY(t){const e=this.valueToNode(t);return null==e?void 0:e.y0}initMarkStyle(){this._initNodeMarkStyle(),this._initLinkMarkStyle()}_initNodeMarkStyle(){var t,e;const i=this._nodeMark;i&&(this.setMarkStyle(i,{x:t=>t.x0,x1:t=>t.x1,y:t=>t.y0,y1:t=>t.y1},xy.STATE_NORMAL,Py.Mark),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.node.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByNode},"normal",Py.User_Mark))}_initLinkMarkStyle(){var t,e;const i=this._linkMark;i&&(this.setMarkStyle(i,{x0:t=>t.x0,x1:t=>t.x1,y0:t=>t.y0,y1:t=>t.y1,thickness:t=>t.thickness,direction:this.direction},xy.STATE_NORMAL,Py.Series),this.setMarkStyle(i,{fill:null!==(e=null===(t=this._spec.link.style)||void 0===t?void 0:t.fill)&&void 0!==e?e:this._fillByLink},"normal",Py.User_Mark))}initLabelMarkStyle(t,e){if(!t)return;const i=e.position;i&&i.includes("inside")?this.setMarkStyle(t,{fill:"#ffffff",text:t=>this._createText(t,e),maxLineWidth:t=>{var i;return null!==(i=e.limit)&&void 0!==i?i:t.x1-t.x0}}):this.setMarkStyle(t,{fill:this._fillByNode,text:t=>this._createText(t,e),maxLineWidth:e.limit}),t.setZIndex(this._labelLayoutZIndex)}_createText(t,e){if(D(t)||D(t.datum))return"";let i=t.datum[this._spec.categoryField]||"";const{formatMethod:s,formatter:n}=e||{},{formatFunc:r,args:a}=YE(s,n,i,t.datum);return r&&(i=r(...a,{series:this})),i}initAnimation(){var t,e,i,s;const n={direction:this.direction,growFrom:()=>{var t,e;return"horizontal"===this.direction?null===(t=this._xAxisHelper)||void 0===t?void 0:t.getScale(0).scale(0):null===(e=this._yAxisHelper)||void 0===e?void 0:e.getScale(0).scale(0)}},r=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset;this._nodeMark&&this._nodeMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("sankeyNode"))||void 0===i?void 0:i(n,r),DC("node",this._spec,this._markAttributeContext))),this._linkMark&&this._linkMark.setAnimationConfig(EC(null===(s=$l.getAnimationInKey("sankeyLinkPath"))||void 0===s?void 0:s(n,r),DC("link",this._spec,this._markAttributeContext)))}initEvent(){var t,e,i;super.initEvent(),null===(t=this._nodesSeriesData.getDataView())||void 0===t||t.target.addListener("change",this.nodesSeriesDataUpdate.bind(this)),null===(e=this._linksSeriesData.getDataView())||void 0===e||e.target.addListener("change",this.linksSeriesDataUpdate.bind(this));const s=null!==(i=this._spec.emphasis)&&void 0!==i?i:{};if(!0!==this._option.disableTriggerEvent&&s.enable&&("adjacency"===s.effect||"related"===s.effect)){const t="hover"===s.trigger?"pointerover":"pointerdown";this.event.on(t,{level:Nd.chart},this._handleEmphasisElement)}}nodesSeriesDataUpdate(){this._nodesSeriesData.updateData(),this._nodeList=null,this._setNodeOrdinalColorScale()}linksSeriesDataUpdate(){this._linksSeriesData.updateData()}_highLightElements(t,e){t&&t.length&&t.forEach((t=>{t.removeState([xy.STATE_SANKEY_EMPHASIS_REVERSE,xy.STATE_SANKEY_EMPHASIS]),e.includes(t.getDatum().key)||t.addState(xy.STATE_SANKEY_EMPHASIS_REVERSE)}))}initTooltip(){this._tooltipHelper=new BN(this),this._nodeMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodeMark),this._linkMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._linkMark)}_setNodeOrdinalColorScale(){var t,e,i,s,n;const r=null===(e=null===(t=this._option)||void 0===t?void 0:t.globalScale)||void 0===e?void 0:e.getScale("color");if(null==r?void 0:r._specified)return void(this._colorScale=r);let a,o;r&&(a=r.domain(),o=r.range()),o||(o=this._getDataScheme()),a&&!D(a[0])||(a=this.getNodeList(),a.length>10&&(o=null===(i=this._getDataScheme()[1])||void 0===i?void 0:i.scheme));const l=new sx;null===(n=(s=l.domain(a)).range)||void 0===n||n.call(s,o),this._colorScale=l}getNodeList(){var t,e;if(this._nodeList)return this._nodeList;const i=this._rawData.latestData[0],s=(null==i?void 0:i.nodes)?(null===(t=i.nodes[0])||void 0===t?void 0:t.children)?Array.from(this.extractNamesFromTree(i.nodes,this._spec.categoryField)):i.nodes.map(((t,e)=>t[this._spec.categoryField])):(null==i?void 0:i.links)?Array.from(this.extractNamesFromLink(i.links)):null===(e=null==i?void 0:i.values)||void 0===e?void 0:e.map(((t,e)=>t[this._spec.categoryField]));return this._nodeList=s,s}_getNodeNameFromData(t){var e;return(null==t?void 0:t.datum)?t.datum[this._spec.categoryField]:null!==(e=t.key)&&void 0!==e?e:t[this._spec.categoryField]}extractNamesFromTree(t,e){const i=new Set;return t.forEach((t=>{i.add(t[e]),t.children&&this.extractNamesFromTree(t.children,e).forEach((t=>i.add(t)))})),i}extractNamesFromLink(t){const e=new Set,{sourceField:i,targetField:s}=this._spec;return t.forEach((t=>{M(t[i])&&e.add(t[i]),M(t[s])&&e.add(t[s])})),e}getDimensionField(){return[this._spec.categoryField]}getMeasureField(){return[this._valueField]}getRawDataStatisticsByField(t,e){var i;return this._rawStatisticsCache||(this._rawStatisticsCache={}),this._rawStatisticsCache[t]||(this._viewDataStatistics&&this.getViewData().transformsArr.length<=1&&(null===(i=this._viewDataStatistics.latestData)||void 0===i?void 0:i[t])?this._rawStatisticsCache[t]=this._viewDataStatistics.latestData[t]:this._rawData&&(this._rawStatisticsCache[t]={values:this._collectByField(t)})),this._rawStatisticsCache[t]}_collectByField(t){var e,i,s;const n=[],r=null===(i=null===(e=this.getRawData())||void 0===e?void 0:e.latestData)||void 0===i?void 0:i[0];if(!r)return[];if(r.links)(null===(s=r.nodes)||void 0===s?void 0:s.length)&&r.nodes.forEach((t=>{t[this._seriesField]&&n.push(t[this._seriesField])}));else if(r.nodes){const t=new Set;return DN(t,r.nodes,this._seriesField),Array.from(t)}return n}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this.getViewData().reRunAllTransform()}getDefaultShapeType(){return"square"}_noAnimationDataKey(t,e){}getActiveMarks(){return[this._nodeMark,this._linkMark]}getMarkData(t){return t.datum?y(t.datum)?t.datum[t.datum.length-1]:t.datum:t}}XN.type=_l.sankey,XN.transformerConstructor=$N,XN.mark=UN;const KN=()=>{_c.registerTransform("sankey",{transform:EN,markPhase:"beforeJoin"},!0),DO(),_c.registerGlyph("linkPath",{back:"path",front:"path"}).registerFunctionEncoder(zN).registerChannelEncoder("backgroundStyle",((t,e)=>({back:e}))).registerDefaultEncoder((()=>({back:{zIndex:0},front:{zIndex:1}}))),_c.registerAnimationType("linkPathGrowIn",NN),_c.registerAnimationType("linkPathGrowOut",VN),_c.registerAnimationType("linkPathUpdate",WN),aN(),UA(),zA(),$l.registerMark(GN.type,GN),SF(),$l.registerAnimation("sankeyNode",((t,e)=>Object.assign({appear:FN(t,e)},bC))),$l.registerAnimation("sankeyLinkPath",((t,e)=>({appear:YN(e),enter:{type:"linkPathGrowIn"},exit:{type:"linkPathGrowOut"},disappear:{type:"linkPathGrowOut"}}))),SC(),$l.registerSeries(XN.type,XN)};class qN extends rO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,sourceField:t.sourceField,targetField:t.targetField,direction:t.direction,nodeAlign:t.nodeAlign,crossNodeAlign:t.crossNodeAlign,nodeGap:t.nodeGap,nodeWidth:t.nodeWidth,linkWidth:t.linkWidth,minStepWidth:t.minStepWidth,minNodeHeight:t.minNodeHeight,minLinkHeight:t.minLinkHeight,dropIsolatedNode:t.dropIsolatedNode,nodeHeight:t.nodeHeight,linkHeight:t.linkHeight,equalNodeHeight:t.equalNodeHeight,linkOverlap:t.linkOverlap,iterations:t.iterations,nodeKey:t.nodeKey,linkSortBy:t.linkSortBy,nodeSortBy:t.nodeSortBy,setNodeLayer:t.setNodeLayer,node:t.node,link:t.link,label:t.label,emphasis:t.emphasis,inverse:t.inverse}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class ZN extends cO{constructor(){super(...arguments),this.transformerConstructor=qN,this.type="sankey",this.seriesType=_l.sankey}_setStateInDatum(t,e,i,s,n){const r=y(i)?i[0]:i,a=r?Object.keys(r):null;this.getRegionsInQuerier(n).forEach((i=>{if(!r)return void i.interaction.clearEventElement(t,!0);let n=!1;i.getSeries().forEach((e=>{var o,l;let h=null;e.getMarksWithoutRoot().forEach((o=>{if("text"===o.type)return;let l=null;const d=o.getProduct();d&&((!s||ys(s)&&s(e,o))&&(l=d.elements.find((t=>a.every((e=>{var i;let s=null===(i=t.getDatum())||void 0===i?void 0:i.datum;return y(s)&&(s=s[0]),r[e]==(null==s?void 0:s[e])}))))),l&&(n=!0,i.interaction.startInteraction(t,l),(d.id().includes("node")||d.id().includes("link"))&&(h=l)))})),h&&(null===(l=(o=e)._handleEmphasisElement)||void 0===l||l.call(o,{item:h}))})),e&&n&&i.interaction.reverseEventElement(t)}))}}ZN.type="sankey",ZN.seriesType=_l.sankey,ZN.transformerConstructor=qN;class JN extends UT{getDefaultTooltipPattern(t,e){switch(t){case"mark":case"group":return{visible:!0,activeType:t,title:{key:void 0,value:this.dimensionTooltipTitleCallback,hasShape:!1},content:[{key:this.markTooltipKeyCallback,value:this.markTooltipValueCallback,hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1}]};case"dimension":if(e){const i={key:void 0,value:this._getDimensionData,hasShape:!1},s=[];return e.forEach((({data:t})=>t.forEach((({series:t})=>{"rangeArea"===t.type&&s.push({seriesId:t.id,key:this.markTooltipKeyCallback,value:t=>"horizontal"===this.series.getSpec().direction?t[this.series.getSpec().xField[0]]+"-"+t[this.series.getSpec().xField[1]]:t[this.series.getSpec().yField[0]]+"-"+t[this.series.getSpec().yField[1]],hasShape:!0,shapeType:this.shapeTypeCallback,shapeColor:this.shapeColorCallback,shapeStroke:this.shapeStrokeCallback,shapeHollow:!1})})))),{visible:!0,activeType:t,title:i,content:s}}}return null}}const QN=Object.assign({},yO);class tV extends xO{constructor(){super(...arguments),this.type=_l.rangeArea}initMark(){var t;const{customShape:e,stateSort:i}=null!==(t=this._spec.area)&&void 0!==t?t:{};this._areaMark=this._createMark(tV.mark.area,{defaultMorphElementKey:this.getDimensionField()[0],groupKey:this._seriesField,isSeriesMark:!0,customShape:e,stateSort:i})}initMarkStyle(){this.initAreaMarkStyle()}initAreaMarkStyle(){const t=this._areaMark;t&&(super.initAreaMarkStyle(),"horizontal"===this._direction?this.setMarkStyle(this._areaMark,{x1:t=>{if(!this._xAxisHelper)return Number.NaN;const{dataToPosition:e}=this._xAxisHelper;return e(this.getDatumPositionValues(t,this._spec.xField[1]),{bandPosition:this._bandPosition})}},"normal",Py.Series):this.setMarkStyle(this._areaMark,{y1:t=>{if(!this._yAxisHelper)return Number.NaN;const{dataToPosition:e}=this._yAxisHelper;return e(this.getDatumPositionValues(t,this._spec.yField[1]),{bandPosition:this._bandPosition})}},"normal",Py.Series),this.setMarkStyle(t,{stroke:!1},"normal",Py.Series))}initTooltip(){this._tooltipHelper=new JN(this)}_isFieldAllValid(){const t=this.getViewDataStatistics(),e=this.fieldY;return!!(t&&t.latestData&&e.length)&&e.every((e=>t.latestData[e]&&t.latestData[e].allValid))}}tV.type=_l.rangeArea,tV.mark=QN;class eV extends aO{_getDefaultSeriesSpec(t){var e,i;const s=Object.assign({},super._getDefaultSeriesSpec(t));return s.area=t.area,"horizontal"===t.direction?s.xField=null!==(e=t.xField)&&void 0!==e?e:[t.minField,t.maxField]:s.yField=null!==(i=t.yField)&&void 0!==i?i:[t.minField,t.maxField],s.stack=!1,s}transformSpec(t){super.transformSpec(t),fy(t)}}class iV extends cO{constructor(){super(...arguments),this.transformerConstructor=eV,this.type="rangeArea",this.seriesType=_l.rangeArea}}function sV(t){if(t)return t.type===Kh.Band?t.bandwidth():t.type===Kh.Point?t.step():void 0}iV.type="rangeArea",iV.seriesType=_l.rangeArea,iV.transformerConstructor=eV;class nV extends Wm{encodeState(t,e,i){return super.encodeState(t,e,i),this._updateComponentEncoders(t),this}_updateComponentEncoders(t){this._encoders||(this._encoders={});const e=this.spec.encode[t];if(e&&"update"===t){const i=this.parameters(),s=Wp(e)?null:Object.keys(e).reduce(((t,s)=>(km(e[s])&&(t[s]=Up(e[s].scale,i)),t)),{});this._encoders[t]={callback:(t,i,n)=>{const r=Pm(e,t,i,n);if(D(r.size)){const t=s.x?sV(s.x):void 0,e=s.y?sV(s.y):void 0;D(t)&&D(e)?r.size=10:D(t)?r.size=e:D(e)&&(r.size=t),r.size=[t,e]}return D(r.shape)&&(r.shape="rect"),r}}}else this._encoders[t]=e}_getEncoders(){var t;return null!==(t=this._encoders)&&void 0!==t?t:{}}getAttributeTransforms(){return[{channels:["size","padding"],transform:(t,e,i)=>{if(h(i.padding)&&i.padding>0)t.size=y(i.size)?i.size.map((t=>Math.max(t-i.padding,1))):Math.max(i.size-i.padding,1);else if(y(i.padding)&&2===i.padding.length){const e=y(i.size)?i.size:[i.size,i.size];t.size=[Math.max(e[0]-i.padding[0],1),Math.max(e[1]-i.padding[1],1)]}else t.size=i.size},storedAttrs:"paddingAttrs"}].concat(vm.symbol)}release(){super.release(),this._encoders=null}}nV.markType=Jd.cell;class rV extends ZC{constructor(){super(...arguments),this.type=rV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{padding:0})}}rV.type="cell";function aV(t){return!1===t?{}:{type:"fadeIn"}}class oV extends UT{getDefaultTooltipPattern(t,e){const i=super.getDefaultTooltipPattern(t,e);return M(i)&&"dimension"===t&&(i.visible=!1),i}}const lV=Object.assign(Object.assign({},rL),{cell:{name:"cell",type:"cell"},cellBackground:{name:"cellBackground",type:"cell"}});class hV extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"cell")}}class dV extends NC{constructor(){super(...arguments),this.type=_l.heatmap,this.transformerConstructor=hV}getFieldValue(){return this._fieldValue}setFieldValue(t){this._fieldValue=Ba(t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setFieldValue(this._spec.valueField)}initMark(){var t,e,i,s;const n={progressiveStep:this._spec.progressiveStep,progressiveThreshold:this._spec.progressiveThreshold,large:this._spec.large,largeThreshold:this._spec.largeThreshold};this._cellMark=this._createMark(dV.mark.cell,{morph:RC(this._spec,dV.mark.cell.name),defaultMorphElementKey:this.getDimensionField()[0],isSeriesMark:!0,progressive:n,customShape:null===(t=this._spec.cell)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.cell)||void 0===e?void 0:e.stateSort}),this._backgroundMark=this._createMark(dV.mark.cellBackground,{progressive:n,customShape:null===(i=this._spec.cellBackground)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.cellBackground)||void 0===s?void 0:s.stateSort})}initMarkStyle(){this.initCellMarkStyle(),this.initCellBackgroundMarkStyle()}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this.getMeasureField()[0]]})}initCellMarkStyle(){this.setMarkStyle(this._cellMark,{x:t=>this.dataToPositionX(t),y:t=>this.dataToPositionY(t),size:()=>[this.getCellSize(this._xAxisHelper),this.getCellSize(this._yAxisHelper)],fill:this.getColorAttribute()},"normal",Py.Series)}initCellBackgroundMarkStyle(){var t,e,i;const s=gD(null!==(i=null===(e=null===(t=this._spec.cellBackground)||void 0===t?void 0:t.style)||void 0===e?void 0:e.padding)&&void 0!==i?i:0);this.setMarkStyle(this._backgroundMark,{x:t=>{const e=this.getCellSize(this._xAxisHelper);return this.dataToPositionX(t)-e/2+s[3]},y:t=>{const e=this.getCellSize(this._yAxisHelper);return this.dataToPositionY(t)-e/2+s[0]},width:()=>this.getCellSize(this._xAxisHelper)-s[1]-s[3],height:()=>this.getCellSize(this._yAxisHelper)-s[0]-s[2]},"normal",Py.Series)}getColorAttribute(){var t;return{scale:null!==(t=this._option.globalScale.getScale("color"))&&void 0!==t?t:this._getDefaultColorScale(),field:this.getFieldValue[0]}}initInteraction(){this._parseInteractionConfig(this._cellMark?[this._cellMark]:[])}initAnimation(){var t,e,i;const s=null===(e=null===(t=this._spec)||void 0===t?void 0:t.animationAppear)||void 0===e?void 0:e.preset,n=zC(this);this._cellMark.setAnimationConfig(EC(null===(i=$l.getAnimationInKey("heatmap"))||void 0===i?void 0:i(s),DC("cell",this._spec,this._markAttributeContext),n))}getCellSize(t){var e,i;return null!==(i=null===(e=t.getBandwidth)||void 0===e?void 0:e.call(t,0))&&void 0!==i?i:6}initTooltip(){this._tooltipHelper=new oV(this),this._cellMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._cellMark)}getDefaultShapeType(){return"square"}getDimensionField(){return[].concat(this.fieldX,this.fieldY)}getMeasureField(){return this.getFieldValue()}getActiveMarks(){return[this._cellMark]}}dV.type=_l.heatmap,dV.mark=lV,dV.transformerConstructor=hV;const cV=()=>{SF(),$l.registerMark(rV.type,rV),Sx(),Gv(),YA(),_c.registerGraphic(Jd.cell,Cv),_c.registerMark(Jd.cell,nV),$l.registerAnimation("heatmap",((t,e)=>Object.assign(Object.assign({},bC),{appear:aV(e)}))),VP(),iO(),$l.registerSeries(dV.type,dV)};class uV extends aO{_getDefaultSeriesSpec(t){const e=super._getDefaultSeriesSpec(t);return Object.assign(Object.assign({},e),{valueField:t.valueField,cell:t.cell})}}class pV extends cO{constructor(){super(...arguments),this.transformerConstructor=uV,this.type="heatmap",this.seriesType=_l.heatmap}}pV.type="heatmap",pV.seriesType=_l.heatmap,pV.transformerConstructor=uV;const gV=Object.assign(Object.assign({},rL),{nodePoint:{name:"nodePoint",type:"symbol"},ripplePoint:{name:"ripplePoint",type:"ripple"},centerPoint:{name:"centerPoint",type:"symbol"},centerLabel:{name:"centerLabel",type:"text"}}),mV=(t,e)=>{const i=ys(e)?e:t=>t;let s,n;if(t&&t.length){const e=t.length;for(let r=0;r{var i,s,n,r,a,o,l,d,c,u,p,g,m,_,f;if(!t||!(null==e?void 0:e.view)||!y(t))return t;const v=e.view();if(v.x1-v.x0==0||v.y1-v.y0==0||v.x1-v.x0==-1/0||v.x1-v.x0==1/0||v.y1-v.y0==-1/0||v.y1-v.y0==1/0)return t;const b=At(null!==(i=e.startAngle)&&void 0!==i?i:-90),x=At(null!==(s=e.endAngle)&&void 0!==s?s:270),S=Math.max((v.x1-v.x0)/2,(v.y1-v.y0)/2),M=AH(null!==(n=e.innerRadius)&&void 0!==n?n:0,S),k=AH(e.outerRadius,S),A=[h(null===(r=e.center)||void 0===r?void 0:r[0])?e.center[0]:v.x0+AH(null!==(o=null===(a=e.center)||void 0===a?void 0:a[0])&&void 0!==o?o:"50%",v.x1-v.x0),h(null===(l=e.center)||void 0===l?void 0:l[1])?e.center[1]:v.y0+AH(null!==(c=null===(d=e.center)||void 0===d?void 0:d[1])&&void 0!==c?c:"50%",v.y1-v.y0)],w=Em(e.field),T=t.map(w),[L,C]=mV(T),E=L===C?t=>(M+k)/2:t=>M+(k-M)*(t-L)/(C-L),P=D(e.radiusField)?w:Em(e.radiusField),O=null!==(p=null===(u=null==e?void 0:e.radiusRange)||void 0===u?void 0:u[1])&&void 0!==p?p:5;let R=t=>O;if(P){const[i,s]=P!==w?mV(t.map(P)):[L,C],n=null!==(m=null===(g=e.radiusRange)||void 0===g?void 0:g[0])&&void 0!==m?m:5,r=null!==(f=null===(_=e.radiusRange)||void 0===_?void 0:_[1])&&void 0!==f?f:5;i!==s&&(R=t=>n+(r-n)*(P(t)-i)/(s-i))}const I=Math.min(b,x),B=Math.max(b,x),F=bV(I,B,t.length),Y=[],j=(B-I)/60;return t.forEach(((t,e)=>{const i=E(T[e]),s=R(t);let n,r,a=F[e];for(let t=0;t<60&&(n=A[0]+i*Math.cos(a),r=A[1]+i*Math.sin(a),xV({x:n,y:r,size:s},Y)||n-sv.x1||r-sv.y1);t++)t<59&&(a+=j,a>B?a=I:a{let s=0,n=Math.max(Math.ceil(2*(e-t)/Math.PI),2),r=(e-t)/n,a=0,o=1,l=0,h=0;const d=[];let c=t;for(;l=2&&(r/=2,n*=2));return d},xV=(t,e)=>!(!e||!e.length)&&e.some((e=>Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2){if(!t||!y(t))return[];const{keyword:i,categoryField:s}=e,n=t[0].latestData[0];return{[s]:i,[vT]:null==n?void 0:n[vT],[bT]:null==n?void 0:n[bT]}};class MV extends vx{constructor(){super(...arguments),this.type=MV.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{x:0,y:0,ripple:0})}_initProduct(t){const e=this.getVGrammarView(),i=this.getProductId();this._product=e.glyph("ripplePoint",null!=t?t:e.rootMark).id(i),this._compiledProductId=i}}MV.type="ripple";const kV=()=>{$l.registerMark(MV.type,MV),_c.registerGlyph("ripplePoint",{symbol:"symbol",ripple0:"symbol",ripple1:"symbol",ripple2:"symbol"}).registerFunctionEncoder(((t,e,i,s)=>{var n;const r=Math.max(0,Math.min(t.ripple,1)),a=null!==(n=t.size)&&void 0!==n?n:i.getGraphicAttribute("size"),o=.5*a;return{ripple0:{size:a+o*r,fillOpacity:.75-.25*r},ripple1:{size:a+o*(1+r),fillOpacity:.5-.25*r},ripple2:{size:a+o*(2+r),fillOpacity:.25-.25*r}}})).registerDefaultEncoder((()=>({ripple0:{fillOpacity:.75},ripple1:{fillOpacity:.5},ripple2:{fillOpacity:.25}}))),aN(),UA(),WA()},AV=(t,e)=>"fadeIn"===e?{type:"fadeIn"}:{type:"scaleIn"};class wV extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"nodePoint"),this._addMarkLabelSpec(t,"centerPoint","centerLabel")}}class TV extends iB{constructor(){super(...arguments),this.type=_l.correlation,this.transformerConstructor=wV,this._viewBox=new Kt}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}getSeriesField(){return this._seriesField}setSeriesField(t){M(t)&&(this._seriesField=t)}getSizeField(){return this._sizeField}setSizeField(t){M(t)&&(this._sizeField=t)}getSizeRange(){return this._sizeRange}setSizeRange(t){M(t)&&(this._sizeRange=t)}setAttrFromSpec(){super.setAttrFromSpec(),this.setCategoryField(this._spec.categoryField),this.setValueField(this._spec.valueField),this.setSeriesField(this._spec.seriesField),this.setSizeField(this._spec.sizeField),this.setSizeRange(this._spec.sizeRange)}initData(){var t,e,i;if(super.initData(),!this._data)return;Lp(this._dataSet,"correlation",yV);const s=new f;Cp(s,"dataview",b),Lp(s,"correlationCenter",SV);const n=new R(s,{name:`${this.type}_${this.id}_center`});n.parse([this.getViewData()],{type:"dataview"}),n.transform({type:"correlationCenter",options:{keyword:null!==(i=null===(e=null===(t=this._spec.centerLabel)||void 0===t?void 0:t.style)||void 0===e?void 0:e.text)&&void 0!==i?i:"",categoryField:this._spec.categoryField}}),this._centerSeriesData=new ZT(this._option,n)}_statisticViewData(){super._statisticViewData(),this._data.getDataView().transform({type:"correlation",options:{view:()=>({x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2}),field:this._spec.valueField,radiusRange:this._spec.sizeRange,radiusField:this._spec.sizeField,center:[this._spec.centerX,this._spec.centerY],innerRadius:this._spec.innerRadius,outerRadius:this._spec.outerRadius,startAngle:this._spec.startAngle,endAngle:this._spec.endAngle}})}initMark(){var t,e,i,s;const n=this._createMark(TV.mark.nodePoint,{groupKey:this._seriesField,isSeriesMark:!0,key:vT,customShape:null===(t=this._spec.nodePoint)||void 0===t?void 0:t.customShape,stateSort:null===(e=this._spec.nodePoint)||void 0===e?void 0:e.stateSort});n&&(n.setZIndex(Ey.Node),this._nodePointMark=n);const r=this._createMark(TV.mark.ripplePoint,{key:vT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId()});r&&(this._ripplePointMark=r);const a=this._createMark(TV.mark.centerPoint,{key:vT,dataView:this._centerSeriesData.getDataView(),dataProductId:this._centerSeriesData.getProductId(),customShape:null===(i=this._spec.centerPoint)||void 0===i?void 0:i.customShape,stateSort:null===(s=this._spec.centerPoint)||void 0===s?void 0:s.stateSort});a&&(a.setZIndex(Ey.Node),this._centerPointMark=a)}initMarkStyle(){this._initNodePointMarkStyle(),this._initRipplePointMarkStyle(),this._initCenterPointMarkStyle()}_initNodePointMarkStyle(){var t,e,i,s;const n=this._nodePointMark;if(!n)return;const r=null!==(e=null===(t=this._spec.nodePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(n,{x:t=>t[_V],y:t=>t[fV],size:t=>t[vV],fill:null!==(i=r.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(s=r.fillOpacity)&&void 0!==s?s:1,lineWidth:0},xy.STATE_NORMAL,Py.Series)}_initRipplePointMarkStyle(){var t,e,i,s,n;const r=this._ripplePointMark;if(!r)return;const a=null!==(e=null===(t=this._spec.ripplePoint)||void 0===t?void 0:t.style)&&void 0!==e?e:{};this.setMarkStyle(r,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=a.fill)&&void 0!==i?i:this.getColorAttribute(),opacity:null!==(s=a.fillOpacity)&&void 0!==s?s:.2,ripple:null!==(n=a.ripple)&&void 0!==n?n:0},xy.STATE_NORMAL,Py.Series)}_initCenterPointMarkStyle(){var t,e,i,s,n,r;const a=this._centerPointMark;a&&this.setMarkStyle(a,{x:()=>{var t;return null!==(t=this._spec.centerX)&&void 0!==t?t:(this._viewBox.x1+this._viewBox.x2)/2},y:()=>{var t;return null!==(t=this._spec.centerY)&&void 0!==t?t:(this._viewBox.y1+this._viewBox.y2)/2},size:()=>.2*Math.max(this._viewBox.x2-this._viewBox.x1,this._viewBox.y2-this._viewBox.y1)/2,fill:null!==(i=null===(e=null===(t=this._spec.centerPoint)||void 0===t?void 0:t.style)||void 0===e?void 0:e.fill)&&void 0!==i?i:this.getColorAttribute(),fillOpacity:null!==(r=null===(n=null===(s=this._spec.centerPoint)||void 0===s?void 0:s.style)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1},xy.STATE_NORMAL,Py.Series)}initTooltip(){super.initTooltip(),this._nodePointMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._nodePointMark)}initLabelMarkStyle(t){t&&this.setMarkStyle(t,{fill:this.getColorAttribute(),text:t=>t[this._categoryField],z:this.dataToPositionZ.bind(this)},xy.STATE_NORMAL,Py.Series)}initAnimation(){var t,e;const i=null===(t=this._spec.animationAppear)||void 0===t?void 0:t.preset;this._nodePointMark.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("correlation"))||void 0===e?void 0:e({},i),DC("nodePoint",this._spec,this._markAttributeContext)))}getGroupFields(){return[]}getStackGroupFields(){return[]}getStackValueField(){return""}getActiveMarks(){return[this._nodePointMark,this._centerPointMark]}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this._region.getLayoutRect().width,this._region.getLayoutRect().height),this._rawData.reRunAllTransform(),this.getViewData().reRunAllTransform()}}TV.type=_l.correlation,TV.mark=gV,TV.transformerConstructor=wV;class LV extends rO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,sizeField:t.sizeField,sizeRange:t.sizeRange,centerX:t.centerX,centerY:t.centerY,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,ripplePoint:t.ripplePoint,centerPoint:t.centerPoint,centerLabel:t.centerLabel,nodePoint:t.nodePoint,label:t.label}),i=_l.correlation;return e.type=i,e[i]=t[i],e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class CV extends cO{constructor(){super(...arguments),this.transformerConstructor=LV,this.type="correlation",this.seriesType=_l.correlation}}CV.type="correlation",CV.seriesType=_l.correlation,CV.transformerConstructor=LV;class EV extends eO{constructor(){super(...arguments),this.type=r.cartesianTimeAxis,this._zero=!1,this.effect={scaleUpdate:t=>{this.computeData(null==t?void 0:t.value),mE(this._regions,(t=>{kd(this.getOrient())?XE(t.getXAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setXAxisHelper(this.axisHelper()):XE(t.getYAxisHelper(),this.axisHelper(),M(this._seriesUserId)||M(this._seriesIndex))&&t.setYAxisHelper(this.axisHelper())}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._tick=Tl({},this._spec.tick,null===(t=this._spec.layers)||void 0===t?void 0:t[0])}_initData(){var t;if(super._initData(),null===(t=this._spec.layers)||void 0===t?void 0:t[1]){const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_layer_1_ticks`}).parse(this._scale,{type:"scale"}).transform({type:`${this.type}-ticks`,options:Object.assign(Object.assign({},this._tickTransformOption()),{tickCount:this._spec.layers[1].tickCount,forceTickCount:this._spec.layers[1].forceTickCount,tickStep:this._spec.layers[1].tickStep})},!1);this._layerTickData=new px(this._option,t)}}computeData(t){super.computeData(t),this._layerTickData&&(this._layerTickData.getDataView().reRunAllTransform(),this._layerTickData.updateData())}_getLabelFormatMethod(){var t,e,i,s,n,r,a,o;const l=cF.getInstance(),h=(null===(e=null===(t=this._spec.layers)||void 0===t?void 0:t[1])||void 0===e?void 0:e.timeFormat)||"%Y%m%d",d="local"===((null===(s=null===(i=this._spec.layers)||void 0===i?void 0:i[1])||void 0===s?void 0:s.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat,c=(null===(r=null===(n=this._spec.layers)||void 0===n?void 0:n[0])||void 0===r?void 0:r.timeFormat)||"%Y%m%d",u="local"===((null===(o=null===(a=this._spec.layers)||void 0===a?void 0:a[0])||void 0===o?void 0:o.timeFormatMode)||"local")?l.timeFormat:l.timeUTCFormat;return(t,e,i,s,n)=>{var r;let a;return a=0===n?u(c,t):d(h,t),(null===(r=this._spec.label)||void 0===r?void 0:r.formatMethod)?this._spec.label.formatMethod(a,e):a}}getLabelItems(t){var e,i;const s=[],n=null===(e=this.getTickData())||void 0===e?void 0:e.getLatestData();n&&n.length&&s.push(n.map((e=>$E(e.value,this._getNormalizedValue([e.value],t)))));const r=null===(i=this._layerTickData)||void 0===i?void 0:i.getLatestData();return r&&r.length&&s.push(r.map((e=>$E(e.value,this._getNormalizedValue([e.value],t))))),s}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,QP),t}transformScaleDomain(){}}EV.type=r.cartesianTimeAxis,EV.specKey="axes";class DV{nice(t=10,e){var i,s,n,r;const a=this._domain;let o=[],l=null;if(e){const t=Ib(a,e);if(o=t.niceMinMax,this._domainValidator=t.domainValidator,l=t.niceType,t.niceDomain)return this._niceDomain=t.niceDomain,this.rescale(),this}else l="all";if(l){const t=((t,e)=>{const i=t.slice();let s=0,n=i.length-1,r=i[s],a=i[n];return aMath.floor(t),ceil:t=>Math.ceil(t)});return"min"===l?t[t.length-1]=null!==(n=o[1])&&void 0!==n?n:t[t.length-1]:"max"===l&&(t[0]=null!==(r=o[0])&&void 0!==r?r:t[0]),this._niceDomain=t,this.rescale(),this}return this}niceMin(){const t=this._domain[this._domain.length-1];this.nice();const e=this._domain.slice();return this._domain&&(e[e.length-1]=t,this._niceDomain=e,this.rescale()),this}niceMax(){const t=this._domain[0];this.nice();const e=this._domain.slice();return this._domain&&(e[0]=t,this._niceDomain=e,this.rescale()),this}}function PV(t){return e=>-t(-e)}function OV(t=Number.EPSILON){return e=>Math.max(e,t)}class RV extends Kb{constructor(){super(ub(10),cb(10)),this.type=Kh.Log,this._limit=OV(),this._logs=this.transformer,this._pows=this.untransformer,this._domain=[1,10],this._base=10}clone(){return(new RV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).base(this._base)}rescale(t){var e;if(t)return this;super.rescale();const i=ub(this._base),s=cb(this._base);return(null!==(e=this._niceDomain)&&void 0!==e?e:this._domain)[0]<0?(this._logs=PV(i),this._pows=PV(s),this._limit=function(t=Number.EPSILON){return e=>Math.min(e,-t)}(),this.transformer=lb,this.untransformer=hb):(this._logs=i,this._pows=s,this._limit=OV(),this.transformer=this._logs,this.untransformer=s),this}scale(t){var e;if(t=Number(t),Number.isNaN(t)||this._domainValidator&&!this._domainValidator(t))return this._unknown;this._output||(this._output=this._piecewise((null!==(e=this._niceDomain)&&void 0!==e?e:this._domain).map(this._limit).map(this.transformer),this._calculateWholeRange(this._range),this._interpolate));const i=this._output(this.transformer(this._limit(this._clamp(t))));return this._fishEyeTransform?this._fishEyeTransform(i):i}base(t,e){return arguments.length?(this._base=t,this.rescale(e)):this._base}tickFormat(){return rb}d3Ticks(t=10,e){const i=this.domain(),s=this._limit(i[0]),n=this._limit(i[i.length-1]);return Fb(s,n,t,this._base,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Yb(this._limit(e[0]),this._limit(e[e.length-1]),t,this._base,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return jb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return jb(this._limit(e[0]),this._limit(e[e.length-1]),t,this.transformer,this.untransformer)}getNiceConfig(){return{floor:t=>this._pows(Math.floor(this._logs(this._limit(t)))),ceil:t=>Math.abs(t)>=1?Math.ceil(t):this._pows(Math.ceil(this._logs(this._limit(t))))}}}JA(RV,DV);class IV extends eO{constructor(){super(...arguments),this.type=r.cartesianLogAxis,this._zero=!1,this._scale=new RV}initScales(){var t;super.initScales(),this._scale.base(null!==(t=this._spec.base)&&void 0!==t?t:10),this._scale.clamp(!0,null,!1)}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,QP),t}transformScaleDomain(){}}IV.type=r.cartesianLogAxis,IV.specKey="axes",JA(IV,ZP);class BV extends qb{constructor(){super(pb(1),gb(1)),this.type=Kh.Symlog,this._const=1}clone(){return(new BV).domain(this._domain,!0).range(this._range,!0).unknown(this._unknown).clamp(this.clamp(),null,!0).interpolate(this._interpolate,!0).constant(this._const)}constant(t,e){return arguments.length?(this._const=t,this.transformer=pb(t),this.untransformer=gb(t),this.rescale(e)):this._const}d3Ticks(t=10,e){const i=this.domain(),s=i[0],n=i[i.length-1];return Fb(s,n,t,this._const,this.transformer,this.untransformer,e)}ticks(t=10){const e=this.calculateVisibleDomain(this._range);return Yb(e[0],e[e.length-1],t,this._const,this.transformer,this.untransformer)}forceTicks(t=10){const e=this.calculateVisibleDomain(this._range);return jb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}stepTicks(t){const e=this.calculateVisibleDomain(this._range);return jb(e[0],e[e.length-1],t,this.transformer,this.untransformer)}}JA(BV,DV);class FV extends eO{constructor(){super(...arguments),this.type=r.cartesianSymlogAxis,this._zero=!1,this._scale=new BV}initScales(){var t;super.initScales(),this._scale.constant(null!==(t=this._spec.constant)&&void 0!==t?t:10)}registerTicksTransform(){const t=`${this.type}-ticks`;return Lp(this._option.dataSet,t,QP),t}transformScaleDomain(){}}function YV(t){var e,i;const s=Object.assign({},t);return Ym(t.style)||(s.textStyle=BE(t.style)),Ym(t.textStyle)||Tl(s.textStyle,BE(t.textStyle)),(null===(e=t.shape)||void 0===e?void 0:e.style)&&BE(s.shape.style),(null===(i=t.background)||void 0===i?void 0:i.style)&&BE(s.background.style),s}FV.type=r.cartesianSymlogAxis,FV.specKey="axes",JA(FV,ZP);class jV extends Rk{constructor(){super(...arguments),this.name="legend",this._title=null}render(){this.removeAllChild(!0);const{interactive:t=!0,title:e,padding:i=0}=this.attribute,s=gD(i),n=ra.group({x:s[3],y:s[0],pickable:t,childrenPickable:t});n.name=cT.innerView,this.add(n),this._innerView=n,(null==e?void 0:e.visible)&&this._renderTitle(e),this._renderContent(),this._adjustLayout(),t&&this._bindEvents();const r=this._innerView.AABBBounds;this.attribute.width=r.width()+s[1]+s[3],this.attribute.height=r.height()+s[0]+s[2]}_renderTitle(t){const{text:e="",textStyle:i,padding:s=0,background:n,minWidth:r,maxWidth:a,shape:o}=t,l={x:0,y:0,text:e,textStyle:i,padding:gD(s),minWidth:r,maxWidth:a};o&&o.visible&&(l.shape=Object.assign({visible:!0},o.style),M(o.space)&&(l.space=o.space)),n&&n.visible&&(l.panel=Object.assign({visible:!0},n.style));const h=new TD(l);h.name=cT.title,this._title=h,this._innerView.add(h)}_adjustLayout(){var t;if(this._title){const e=this._innerView.AABBBounds.width(),i=this._title.AABBBounds.width(),s=null===(t=this.attribute.title)||void 0===t?void 0:t.align;"center"===s?this._title.setAttribute("x",(e-i)/2):"end"===s&&this._title.setAttribute("x",e-i)}}}function HV(){u_(),Gv(),df()}const zV={space:8,style:{fill:"rgb(47, 69, 84)",cursor:"pointer",size:15},state:{disable:{fill:"rgb(170, 170, 170)",cursor:"not-allowed"},hover:{}}};HV();class NV extends Rk{getCurrent(){return this._current}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},NV.defaultAttributes,t)),this.name="pager",this._current=1,this._onHover=t=>{const e=t.target;e.hasState("disable")||e.addState("hover")},this._onUnHover=t=>{t.target.removeState("hover")},this._onClick=t=>{const e=t.target;if("preHandler"===e.name){if(1===this._current)return;this._current-=1,1===this._current?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toPrev",{current:this._current,total:this._total,direction:"pre",event:t})}if("nextHandler"===e.name){if(this._current===this._total)return;this._current+=1,this._current===this._total?e.addState("disable"):e.removeState("disable"),this._dispatchEvent("toNext",{current:this._current,total:this._total,direction:"next",event:t})}this._current>1&&this.preHandler.removeState("disable"),this._current{let[s,n]=t;n=i-e?[e,i]:(s=Math.min(Math.max(s,e),i-r),[s,s+r])},$V={debounce:Xd,throttle:Kd};WV();class XV extends Rk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},XV.defaultAttributes,t)),this.name="scrollbar",this._onRailPointerDown=t=>{const{viewX:e,viewY:i}=t,{direction:s,width:n,height:r,range:a}=this.attribute,o=this._sliderSize,[l,h]=this._getScrollRange();let d;if("vertical"===s){const t=i-this._viewPosition.y,e=Ps(t-o/2,l,h);d=t/r,this._slider.setAttribute("y",e,!0)}else{const t=e-this._viewPosition.x,i=Ps(t-o/2,l,h);d=t/n,this._slider.setAttribute("x",i,!0)}this.setScrollRange([d-(a[1]-a[0])/2,d+(a[1]-a[0])/2],!1),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()},this._onSliderPointerDown=t=>{const{stopSliderDownPropagation:e=!0}=this.attribute;e&&t.stopPropagation();const{direction:i}=this.attribute,{x:s,y:n}=this.stage.eventPointTransform(t);this._prePos="horizontal"===i?s:n,this._dispatchEvent("scrollDown",{pos:this._prePos,event:t}),"browser"===zo.env?(zo.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),zo.addEventListener("pointerup",this._onSliderPointerUp)):(this.stage.addEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.addEventListener("pointerup",this._onSliderPointerUp),this.stage.addEventListener("pointerupoutside",this._onSliderPointerUp))},this._computeScrollValue=t=>{const{direction:e}=this.attribute,{x:i,y:s}=this.stage.eventPointTransform(t);let n,r,a=0;const{width:o,height:l}=this._getSliderRenderBounds();return"vertical"===e?(r=s,a=r-this._prePos,n=a/l):(r=i,a=r-this._prePos,n=a/o),[r,n]},this._onSliderPointerMove=t=>{const{stopSliderMovePropagation:e=!0}=this.attribute;e&&t.stopPropagation();const i=this.getScrollRange(),[s,n]=this._computeScrollValue(t);this.setScrollRange([i[0]+n,i[1]+n],!0),this._prePos=s},this._onSliderPointerMoveWithDelay=0===this.attribute.delayTime?this._onSliderPointerMove:$V[this.attribute.delayType](this._onSliderPointerMove,this.attribute.delayTime),this._onSliderPointerUp=t=>{t.preventDefault();const{realTime:e=!0,range:i,limitRange:s=[0,1]}=this.attribute,n=this.getScrollRange(),[r,a]=this._computeScrollValue(t),o=[n[0]+a,n[1]+a];this._dispatchEvent("scrollUp",{pre:i,value:UV(o,s[0],s[1])}),"browser"===zo.env?(zo.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),zo.removeEventListener("pointerup",this._onSliderPointerUp)):(this.stage.removeEventListener("pointermove",this._onSliderPointerMoveWithDelay,{capture:!0}),this.stage.removeEventListener("pointerup",this._onSliderPointerUp),this.stage.removeEventListener("pointerupoutside",this._onSliderPointerUp))}}setScrollRange(t,e=!0){const{direction:i="horizontal",limitRange:s=[0,1],range:n,realTime:r=!0}=this.attribute,a=UV(t,s[0],s[1]);if(e){const t=this._getSliderPos(a);if(this._slider){const e=t[1]-t[0];this._sliderSize=e,"horizontal"===i?this._slider.setAttributes({x:t[0],width:e},!0):this._slider.setAttributes({y:t[0],height:e},!0),this.stage&&!this.stage.autoRender&&this.stage.renderNextFrame()}}this.attribute.range=a,r&&this._dispatchEvent("scrollDrag",{pre:n,value:a})}getScrollRange(){return this.attribute.range}bindEvents(){if(this.attribute.disableTriggerEvent)return;const{delayType:t="throttle",delayTime:e=0}=this.attribute;this._rail&&this._rail.addEventListener("pointerdown",$V[t](this._onRailPointerDown,e)),this._slider&&this._slider.addEventListener("pointerdown",this._onSliderPointerDown)}render(){this._reset();const{direction:t="horizontal",width:e,height:i,range:s,limitRange:n=[0,1],railStyle:r,sliderStyle:a,padding:o=2}=this.attribute,l=this.createOrUpdateChild("scrollbar-container",{},"group"),h=l.createOrUpdateChild("scrollbar-rail",Object.assign({x:0,y:0,width:e,height:i},r),"rect");this._rail=h;const d=this._getSliderRenderBounds(),c=this._getSliderPos(UV(s,n[0],n[1])),u=c[1]-c[0];let p;this._sliderSize=u,p="horizontal"===t?{x:c[0],y:d.y1,width:u,height:d.height}:{x:d.x1,y:c[0],width:d.width,height:u};const g=l.createOrUpdateChild("slider",Object.assign(Object.assign(Object.assign(Object.assign({},p),{cornerRadius:this._getDefaultSliderCornerRadius()}),a),{boundsPadding:gD(o),pickMode:"imprecise"}),"rect");this._slider=g,this._container=l;const m=this._container.AABBBounds;this._viewPosition={x:m.x1,y:m.y1}}_getSliderRenderBounds(){if(this._sliderRenderBounds)return this._sliderRenderBounds;const{width:t,height:e,padding:i=2}=this.attribute,[s,n,r,a]=gD(i),o={x1:a,y1:s,x2:t-n,y2:e-r,width:Math.max(0,t-(a+n)),height:Math.max(0,e-(s+r))};return this._sliderRenderBounds=o,o}_getDefaultSliderCornerRadius(){const{direction:t,round:e}=this.attribute;if(e){const{width:e,height:i}=this._getSliderRenderBounds();return"horizontal"===t?i:e}return 0}_getSliderPos(t){const{direction:e}=this.attribute,{width:i,height:s,x1:n,y1:r}=this._getSliderRenderBounds();return"horizontal"===e?[i*t[0]+n,i*t[1]+n]:[s*t[0]+r,s*t[1]+r]}_getScrollRange(){if(this._sliderLimitRange)return this._sliderLimitRange;const{limitRange:t=[0,1],direction:e}=this.attribute,[i,s]=UV(t,0,1),{width:n,height:r,x1:a,y1:o}=this._getSliderRenderBounds(),l=this._sliderSize;return"horizontal"===e?UV([a+i*n,a+s*n],a,n-l):UV([o+i*r,o+s*r],o,r-l)}_reset(){this._sliderRenderBounds=null,this._sliderLimitRange=null}}XV.defaultAttributes={direction:"horizontal",round:!0,sliderSize:20,sliderStyle:{fill:"rgba(0, 0, 0, .5)"},railStyle:{fill:"rgba(0, 0, 0, .0)"},padding:2,scrollRange:[0,1],delayType:"throttle",delayTime:0,realTime:!0};var KV=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=t.target;if(e&&e.name&&e.name.startsWith(cT.item)){const i=e.delegate;if(this._lastActiveItem){if(this._lastActiveItem.id===i.id)return;this._unHover(this._lastActiveItem,t)}this._hover(i,t)}else this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onUnHover=t=>{this._lastActiveItem&&(this._unHover(this._lastActiveItem,t),this._lastActiveItem=null)},this._onClick=t=>{var e,i,s,n;const r=t.target;if(r&&r.name&&r.name.startsWith(cT.item)){const a=r.delegate,{selectMode:o="multiple"}=this.attribute;if(r.name===cT.focus||"focus"===o){const s=a.hasState(hT.focus);a.toggleState(hT.focus),s?null===(e=this._itemsContainer)||void 0===e||e.getChildren().forEach((e=>{this._removeLegendItemState(e,[hT.unSelected,hT.unSelectedHover,hT.focus],t),this._setLegendItemState(e,hT.selected,t)})):(this._setLegendItemState(a,hT.selected,t),this._removeLegendItemState(a,[hT.unSelected,hT.unSelectedHover],t),null===(i=this._itemsContainer)||void 0===i||i.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[hT.selected,hT.selectedHover,hT.focus],t),this._setLegendItemState(e,hT.unSelected,t))})))}else{null===(s=this._itemsContainer)||void 0===s||s.getChildren().forEach((t=>{t.removeState(hT.focus)}));const{allowAllCanceled:e=!0}=this.attribute,i=a.hasState(hT.selected),r=this._getSelectedLegends();if("multiple"===o){if(!1===e&&i&&1===r.length)return void this._dispatchLegendEvent(dT.legendItemClick,a,t);i?(this._removeLegendItemState(a,[hT.selected,hT.selectedHover],t),this._setLegendItemState(a,hT.unSelected,t)):(this._setLegendItemState(a,hT.selected,t),this._removeLegendItemState(a,[hT.unSelected,hT.unSelectedHover],t))}else this._setLegendItemState(a,hT.selected,t),this._removeLegendItemState(a,[hT.unSelected,hT.unSelectedHover],t),null===(n=this._itemsContainer)||void 0===n||n.getChildren().forEach((e=>{a!==e&&(this._removeLegendItemState(e,[hT.selected,hT.selectedHover],t),this._setLegendItemState(e,hT.unSelected,t))}))}this._dispatchLegendEvent(dT.legendItemClick,a,t)}}}render(){super.render(),this._lastActiveItem=null}setSelected(t){var e;(null===(e=this._itemsContainer)||void 0===e?void 0:e.getChildren()).forEach((e=>{const i=e.data;t.includes(i.label)?(this._setLegendItemState(e,hT.selected),this._removeLegendItemState(e,[hT.unSelected,hT.unSelectedHover])):(this._removeLegendItemState(e,[hT.selected,hT.selectedHover]),this._setLegendItemState(e,hT.unSelected))}))}_renderItems(){const{item:t={},maxCol:e=1,maxRow:i=2,maxWidth:s,maxHeight:n,defaultSelected:r,lazyload:a,autoPage:o}=this.attribute,{spaceCol:l=aT,spaceRow:h=oT}=t,d=this._itemsContainer,{items:c,isHorizontal:u,startIndex:p,isScrollbar:g}=this._itemContext,m=g?1:u?i:e;let _,{doWrap:f,maxWidthInCol:v,startX:b,startY:x,pages:S}=this._itemContext,k=0;for(let t=p,e=c.length;tthis._itemContext.currentPage*m);t++){a&&(this._itemContext.startIndex=t+1),_=c[t],_.id||(_.id=_.label),_.index=t;let e=!0;y(r)&&(e=r.includes(_.label));const i=this._renderEachItem(_,e,t,c),p=i.attribute.width,m=i.attribute.height;this._itemHeight=Math.max(this._itemHeight,m),v=Math.max(p,v),this._itemMaxWidth=Math.max(p,this._itemMaxWidth),u?(M(s)&&(g&&o?(S=Math.ceil((b+p)/s),f=S>1):b+p>s&&(f=!0,b>0&&(S+=1,b=0,x+=m+h))),0===b&&0===x||i.setAttributes({x:b,y:x}),b+=l+p):(M(n)&&(g&&o?(S=Math.ceil((x+m)/n),f=S>1):n<=m?(S+=1,f=!0,x=0,t>0&&(b+=k+l)):nthis._itemContext.maxPages&&(g=this._renderPagerComponent()),g||(r.setAttribute("y",this._title?this._title.AABBBounds.height()+Ud(this.attribute,"title.space",8):0),this._innerView.add(r))}_bindEvents(){if(this.attribute.disableTriggerEvent)return;if(!this._itemsContainer)return;const{hover:t=!0,select:e=!0}=this.attribute;t&&(this._itemsContainer.addEventListener("pointermove",this._onHover),this._itemsContainer.addEventListener("pointerleave",this._onUnHover)),e&&this._itemsContainer.addEventListener("pointerdown",this._onClick)}_autoEllipsis(t,e,i,s){var n,r;const{label:a,value:o}=this.attribute.item,l=s.AABBBounds,h=i.AABBBounds,d=l.width(),c=h.width();let u=!1;"labelFirst"===t?c>e?u=!0:s.setAttribute("maxLineWidth",e-c):"valueFirst"===t?d>e?u=!0:i.setAttribute("maxLineWidth",e-d):d+c>e&&(u=!0),u&&(s.setAttribute("maxLineWidth",Math.max(e*(null!==(n=a.widthRatio)&&void 0!==n?n:.5),e-c)),i.setAttribute("maxLineWidth",Math.max(e*(null!==(r=o.widthRatio)&&void 0!==r?r:.5),e-d)))}_renderEachItem(t,e,i,s){var n,r;const{id:a,label:o,value:l,shape:h}=t,{padding:d=0,focus:c,focusIconStyle:u,align:p,autoEllipsisStrategy:g}=this.attribute.item,{shape:m,label:_,value:f,background:v}=this.attribute.item,b=this._handleStyle(m,t,e,i,s),x=this._handleStyle(_,t,e,i,s),S=this._handleStyle(f,t,e,i,s),k=this._handleStyle(v,t,e,i,s),A=gD(d);let w;!1===v.visible?(w=ra.group({x:0,y:0,cursor:null===(n=k.style)||void 0===n?void 0:n.cursor}),this._appendDataToShape(w,cT.item,t,w)):(w=ra.group(Object.assign({x:0,y:0},k.style)),this._appendDataToShape(w,cT.item,t,w,k.state)),w.id=`${null!=a?a:o}-${i}`,w.addState(e?hT.selected:hT.unSelected);const T=ra.group({x:0,y:0,pickable:!1});w.add(T);let L,C=0,E=0,P=0;if(m&&!1!==m.visible){const i=Ud(b,"style.size",10);E=y(i)?i[0]||0:i,P=Ud(m,"space",8);const s=ra.symbol(Object.assign(Object.assign({x:0,y:0,symbolType:"circle",strokeBoundsBuffer:0},h),b.style));Object.keys(b.state||{}).forEach((t=>{const e=b.state[t].fill||b.state[t].stroke;h.fill&&D(b.state[t].fill)&&e&&(b.state[t].fill=e),h.stroke&&D(b.state[t].stroke)&&e&&(b.state[t].stroke=e)})),this._appendDataToShape(s,cT.itemShape,t,w,b.state),s.addState(e?hT.selected:hT.unSelected),T.add(s)}let O=0;if(c){const e=Ud(u,"size",10);L=ra.symbol(Object.assign(Object.assign({x:0,y:-e/2-1,strokeBoundsBuffer:0},u),{visible:!0,pickMode:"imprecise",boundsPadding:A})),this._appendDataToShape(L,cT.focus,t,w),O=e}const R=_.formatMethod?_.formatMethod(o,t,i):o,I=iA(Object.assign(Object.assign({x:E/2+P,y:0,textAlign:"start",textBaseline:"middle",lineHeight:null===(r=x.style)||void 0===r?void 0:r.fontSize},x.style),{text:R,_originText:_.formatMethod?o:void 0}));this._appendDataToShape(I,cT.itemLabel,t,w,x.state),I.addState(e?hT.selected:hT.unSelected),T.add(I);const B=Ud(_,"space",8);if(M(l)){const s=Ud(f,"space",c?8:0),n=f.formatMethod?f.formatMethod(l,t,i):l,r=iA(Object.assign(Object.assign({x:0,y:0,textAlign:"start",textBaseline:"middle",lineHeight:S.style.fontSize},S.style),{text:n,_originText:f.formatMethod?l:void 0}));if(this._appendDataToShape(r,cT.itemValue,t,w,S.state),r.addState(e?hT.selected:hT.unSelected),this._itemWidthByUser){const t=this._itemWidthByUser-A[1]-A[3]-E-P-B-O-s;this._autoEllipsis(g,t,I,r),f.alignRight?r.setAttributes({textAlign:"right",x:this._itemWidthByUser-E/2-A[1]-A[3]-O-s}):r.setAttribute("x",s+(I.AABBBounds.empty()?0:I.AABBBounds.x2))}else r.setAttribute("x",s+(I.AABBBounds.empty()?0:I.AABBBounds.x2));C=s+(r.AABBBounds.empty()?0:r.AABBBounds.x2),T.add(r)}else this._itemWidthByUser?(I.setAttribute("maxLineWidth",this._itemWidthByUser-A[1]-A[3]-E-P-O),C=B+(I.AABBBounds.empty()?0:I.AABBBounds.x2)):C=B+(I.AABBBounds.empty()?0:I.AABBBounds.x2);L&&(L.setAttribute("x",C),T.add(L));const F=T.AABBBounds,Y=F.width();if("right"===p){const t=F.x2,e=F.x1;T.forEachChildren(((i,s)=>{"symbol"!==i.type&&"right"!==i.attribute.textAlign||i===L?i.setAttribute("x",e+t-i.attribute.x-i.AABBBounds.width()):"symbol"!==i.type?i.setAttributes({x:e+t-i.attribute.x,textAlign:"left"}):i.setAttribute("x",e+t-i.attribute.x)}))}const j=F.height(),H=M(this.attribute.item.width)?this.attribute.item.width:Y+A[1]+A[3],z=this._itemHeightByUser||j+A[0]+A[2];return w.attribute.width=H,w.attribute.height=z,L&&L.setAttribute("visible",!1),T.translateTo(-F.x1+A[3],-F.y1+A[0]),w}_createPager(t){var e,i;const{disableTriggerEvent:s,maxRow:n}=this.attribute,r=t=>t<=99?99:t<=999?999:9999;return this._itemContext.isHorizontal?new NV(Object.assign(Object.assign({layout:1===n?"horizontal":"vertical",total:r(this._itemContext.pages)},E({handler:{preShape:"triangleUp",nextShape:"triangleDown"}},t)),{defaultCurrent:null===(e=this.attribute.pager)||void 0===e?void 0:e.defaultCurrent,disableTriggerEvent:s})):new NV(Object.assign({layout:"horizontal",total:r(this._itemContext.pages),disableTriggerEvent:s,defaultCurrent:null===(i=this.attribute.pager)||void 0===i?void 0:i.defaultCurrent},t))}_createScrollbar(t,e){const{disableTriggerEvent:i}=this.attribute;return this._itemContext.isHorizontal?new XV(Object.assign(Object.assign({direction:"horizontal",disableTriggerEvent:i,range:[0,.5],height:12},t),{width:e})):new XV(Object.assign(Object.assign({direction:"vertical",width:12,range:[0,.5]},t),{height:e,disableTriggerEvent:i}))}_updatePositionOfPager(t,e,i,s,n){const{maxHeight:r,pager:a}=this.attribute,{totalPage:o,isHorizontal:l}=this._itemContext,h=a&&a.position||"middle";if(this._pagerComponent.setTotal(o),l){let e;e="start"===h?i:"end"===h?i+n-this._pagerComponent.AABBBounds.height()/2:i+n/2-this._pagerComponent.AABBBounds.height()/2,this._pagerComponent.setAttributes({x:t,y:e})}else{let t;t="start"===h?0:"end"===h?s-this._pagerComponent.AABBBounds.width():(s-this._pagerComponent.AABBBounds.width())/2,this._pagerComponent.setAttributes({x:t,y:r-this._pagerComponent.AABBBounds.height()})}}_updatePositionOfScrollbar(t,e,i){const{currentPage:s,totalPage:n,isHorizontal:r}=this._itemContext;this._pagerComponent.setScrollRange([(s-1)/n,s/n]),r?this._pagerComponent.setAttributes({x:0,y:i+e}):this._pagerComponent.setAttributes({x:t,y:i})}_bindEventsOfPager(t,e){const i=this.attribute.pager||{},{animation:s=!0,animationDuration:n=450,animationEasing:r="quadIn"}=i,a=this._itemContext.isScrollbar?t=>{const{value:e}=t.detail;let s=e[0]*this._itemContext.totalPage;return i.scrollByPosition?s+=1:s=Math.floor(s)+1,s}:t=>t.detail.current,o=i=>{const o=a(i);if(o!==this._itemContext.currentPage){if(this._itemContext.currentPage=o,this._itemContext&&this._itemContext.startIndex{const{width:i,height:s}=t.attribute;f0&&t.setAttributes({x:y,y:b}),y+=o+i})),this._itemContext.startX=y,this._itemContext.startY=b,this._itemContext.pages=x;const i=Math.ceil(x/n);this._itemContext.totalPage=i,this._updatePositionOfPager(f,v,t,m,_)}else{if(m=this._itemMaxWidth*s+(s-1)*o,_=i,f=m,g=this._createPager(u),this._pagerComponent=g,this._innerView.add(g),v=i-g.AABBBounds.height()-d-t,v<=0)return this._innerView.removeChild(g),!1;h.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;v0&&t.setAttributes({x:y,y:b}),b+=l+i}));const e=Math.ceil(x/s);this._itemContext.totalPage=e,this._updatePositionOfPager(f,v,t,m,_)}c>1&&(p?h.setAttribute("y",-(c-1)*(_+l)):h.setAttribute("x",-(c-1)*(m+o)));const S=ra.group({x:0,y:t,width:p?f:m,height:p?_:v,clip:!0,pickable:!1});return S.add(h),this._innerView.add(S),this._bindEventsOfPager(p?_+l:m+o,p?"y":"x"),!0}_renderScrollbar(){const t=this._title?this._title.AABBBounds.height()+Ud(this.attribute,"title.space",8):0,{maxWidth:e,maxHeight:i,item:s={},pager:n={}}=this.attribute,{spaceCol:r=aT,spaceRow:a=oT}=s,o=this._itemsContainer,{space:l=lT,defaultCurrent:h=1}=n,d=KV(n,["space","defaultCurrent"]),{isHorizontal:c}=this._itemContext;let u,p=0,g=0,m=0,_=0,f=1;if(c)p=e,g=e,m=this._itemHeight,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),this._updatePositionOfScrollbar(g,m,t);else{if(p=i,u=this._createScrollbar(d,p),this._pagerComponent=u,this._innerView.add(u),m=i-t,g=this._itemMaxWidth,m<=0)return this._innerView.removeChild(u),!1;o.getChildren().forEach(((t,e)=>{const{height:i}=t.attribute;f=Math.floor((_+i)/m)+1,_+=a+i})),this._itemContext.totalPage=f,this._itemContext.pages=f,this._updatePositionOfScrollbar(g,m,t)}h>1&&(c?o.setAttribute("x",-(h-1)*(g+r)):o.setAttribute("y",-(h-1)*(m+a)));const v=ra.group({x:0,y:t,width:g,height:m,clip:!0,pickable:!1});return v.add(o),this._innerView.add(v),this._bindEventsOfPager(c?g:m,c?"x":"y"),!0}_renderPagerComponent(){return this._itemContext.isScrollbar?this._renderScrollbar():this._renderPager(),!0}_hover(t,e){this._lastActiveItem=t,t.hasState(hT.selected)?this._setLegendItemState(t,hT.selectedHover,e):this._setLegendItemState(t,hT.unSelectedHover,e);const i=t.getChildren()[0].find((t=>t.name===cT.focus),!1);i&&i.setAttribute("visible",!0),this._dispatchLegendEvent(dT.legendItemHover,t,e)}_unHover(t,e){let i=!1;(t.hasState(hT.unSelectedHover)||t.hasState(hT.selectedHover))&&(i=!0),t.removeState(hT.unSelectedHover),t.removeState(hT.selectedHover),t.getChildren()[0].getChildren().forEach((t=>{i||!t.hasState(hT.unSelectedHover)&&!t.hasState(hT.selectedHover)||(i=!0),t.removeState(hT.unSelectedHover),t.removeState(hT.selectedHover)}));const s=t.getChildren()[0].find((t=>t.name===cT.focus),!1);s&&s.setAttribute("visible",!1),i&&this._dispatchLegendEvent(dT.legendItemAttributeUpdate,t,e),this._dispatchLegendEvent(dT.legendItemUnHover,t,e)}_setLegendItemState(t,e,i){let s=!1;t.hasState(e)||(s=!0),t.addState(e,!0),t.getChildren()[0].getChildren().forEach((t=>{t.name!==cT.focus&&(s||t.hasState(e)||(s=!0),t.addState(e,!0))})),s&&this._dispatchLegendEvent(dT.legendItemAttributeUpdate,t,i)}_removeLegendItemState(t,e,i){let s=!1;e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)})),t.getChildren()[0].getChildren().forEach((t=>{t.name!==cT.focus&&e.forEach((e=>{!s&&t.hasState(e)&&(s=!0),t.removeState(e)}))})),s&&this._dispatchLegendEvent(dT.legendItemAttributeUpdate,t,i)}_getSelectedLegends(){var t;const e=[];return null===(t=this._itemsContainer)||void 0===t||t.getChildren().forEach((t=>{t.hasState(hT.selected)&&e.push(t.data)})),e}_appendDataToShape(t,e,i,s,n={}){t.name=e,t.data=i,t.delegate=s,t.states=E({},qV,n)}_dispatchLegendEvent(t,e,i){const s=this._getSelectedLegends();s.sort(((t,e)=>t.index-e.index));const n=s.map((t=>t.label));this._dispatchEvent(t,{item:e,data:e.data,selected:e.hasState(hT.selected),currentSelectedItems:s,currentSelected:n,event:i})}_handleStyle(t,e,i,s,n){const r={};return t.style&&(ys(t.style)?r.style=t.style(e,i,s,n):r.style=t.style),t.state&&(r.state={},Object.keys(t.state).forEach((a=>{t.state[a]&&(ys(t.state[a])?r.state[a]=t.state[a](e,i,s,n):r.state[a]=t.state[a])}))),r}}ZV.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"#2C3542"}},item:{spaceCol:aT,spaceRow:oT,shape:{space:8,style:{size:10,cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{opacity:.5}}},label:{space:8,style:{fontSize:12,fill:"#2C3542",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},value:{alignRight:!1,style:{fontSize:12,fill:"#ccc",cursor:"pointer"},state:{selectedHover:{opacity:.85},unSelected:{fill:"#D8D8D8"}}},background:{style:{cursor:"pointer"}},focus:!1,focusIconStyle:{size:10,symbolType:"M8 1C11.866 1 15 4.13401 15 8C15 11.866 11.866 15 8 15C4.13401 15 1 11.866 1 8C1 4.13401 4.13401 1 8 1ZM8.75044 2.55077L8.75 3.75H7.25L7.25006 2.5507C4.81247 2.88304 2.88304 4.81247 2.5507 7.25006L3.75 7.25V8.75L2.55077 8.75044C2.8833 11.1878 4.81264 13.117 7.25006 13.4493L7.25 12.25H8.75L8.75044 13.4492C11.1876 13.1167 13.1167 11.1876 13.4492 8.75044L12.25 8.75V7.25L13.4493 7.25006C13.117 4.81264 11.1878 2.8833 8.75044 2.55077ZM8 5.5C9.38071 5.5 10.5 6.61929 10.5 8C10.5 9.38071 9.38071 10.5 8 10.5C6.61929 10.5 5.5 9.38071 5.5 8C5.5 6.61929 6.61929 5.5 8 5.5ZM8 7C7.44772 7 7 7.44772 7 8C7 8.55228 7.44772 9 8 9C8.55228 9 9 8.55228 9 8C9 7.44772 8.55228 7 8 7Z",fill:"#333",cursor:"pointer"}},autoPage:!0,pager:{space:lT,handler:{style:{size:10},space:4}},hover:!0,select:!0,selectMode:"multiple",allowAllCanceled:!0};const JV=(t,e)=>{const i=[],s={},{series:n,seriesField:r}=e;return n().forEach((t=>{const e=r(t);let n;n=e===t.getSeriesField()?t.getSeriesInfoList():t.getSeriesInfoInField(e),n.forEach((t=>{s[t.key]||(s[t.key]=!0,i.push(t))}))})),i},QV=(t,e)=>{var i,s,n;const{series:r,selected:a,field:o,data:l}=e,h=a(),d=l();if(0===h.length&&d.length)return[];if(h.length===d.length)return t;const c={};h.forEach((t=>{c[t]=!0}));const u=null!==(i=o())&&void 0!==i?i:bT;return y(t)&&(null===(s=t[0])||void 0===s?void 0:s.nodes)?(t[0].nodes=t[0].nodes.filter((t=>!0===c[t.key])),(null===(n=t[0])||void 0===n?void 0:n.links)&&(t[0].links=t[0].links.filter((t=>!0===c[t.source]&&!0===c[t.target])))):M(u)&&(t=t.filter((t=>!0===c[r.getSeriesFieldValue(t,u)]))),t};class tW extends tD{constructor(){super(...arguments),this.layoutType="normal",this.layoutZIndex=Ey.Legend,this.layoutLevel=Dy.Legend,this.specKey="legends",this._orient="left",this._visible=!0,this._position="middle",this._preSelectedData=[],this._selectedData=[],this.effect={onSelectedDataChange:()=>{mE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),mE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}}}get orient(){return this._orient}get visible(){return this._visible}get position(){return this._position}getLegendData(){return this._legendData.getLatestData()}getSelectedData(){return this._selectedData}setAttrFromSpec(){var t;super.setAttrFromSpec(),this._orient=Qo(this._spec.orient)?this._spec.orient:"left",this._position=null!==(t=this._spec.position)&&void 0!==t?t:"middle",this._visible=!1!==this._spec.visible;const{regionId:e,regionIndex:i,seriesId:s,seriesIndex:n}=this._spec;M(s)&&(this._seriesUserId=Ba(s)),M(e)&&(this._regionUserId=Ba(e)),M(n)&&(this._seriesIndex=Ba(n)),M(i)&&(this._regionUserIndex=Ba(i)),this._regions=this._option.getRegionsInUserIdOrIndex(this._regionUserId,this._regionUserIndex)}created(){super.created(),this.initData()}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,(null==t?void 0:t.orient)!==(null==e?void 0:e.orient)?(i.reMake=!0,i):(Im(e,t)||(i.reCompile=!0),i)}changeRegions(t){}_bindLegendDataChange(){this._preSelectedData=this._selectedData.slice(),this._initSelectedData()}initData(){const t=this._initLegendData();t.target.addListener("change",this._bindLegendDataChange.bind(this)),this._legendData=new px(this._option,t),this._initSelectedData(),mE(this._regions,(t=>{t.event.on(Hd.rawDataUpdate,{filter:({model:e})=>(null==e?void 0:e.id)===t.id},(()=>{this._legendData.getDataView().reRunAllTransform()}))}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}setSelectedData(t){var e,i,s;const n=this._selectedData;D(t)||JSON.stringify(n)===JSON.stringify(t)||(mE(this._regions,(e=>{e.legendSelectedFilter&&(t=e.legendSelectedFilter(this,t))}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._selectedData=[...t],null===(i=(e=this.effect).onSelectedDataChange)||void 0===i||i.call(e),this.event.emit(Hd.legendSelectedDataChange,{model:this}),null===(s=this._legendComponent)||void 0===s||s.setSelected(this._selectedData))}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),this._legendComponent){const{x:e,y:i}=t;qo(e*i)&&this._legendComponent.setAttributes({x:e,y:i})}}getBoundsInRect(t,e){if(!this._visible)return this._legendComponent&&this._legendComponent.parent&&(this._legendComponent.parent.removeChild(this._legendComponent),this._legendComponent=null),{x1:0,y1:0,x2:0,y2:0};const i={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0},s=this._getLegendAttributes(t);if(s.disableTriggerEvent=this._option.disableTriggerEvent,this._legendComponent)Im(s,this._cacheAttrs)||this._legendComponent.setAttributes(Tl({},s,{defaultSelected:this._selectedData}));else{const t=new(this._getLegendConstructor())(Tl({},s,{defaultSelected:this._selectedData}));t.name="legend",this._legendComponent=t,this.getContainer().add(t),this._option.disableTriggerEvent||this._initEvent(),t.on("*",((t,e)=>this._delegateEvent(this._legendComponent,t,e)))}this._cacheAttrs=s;const n=isFinite(this._legendComponent.AABBBounds.width())?this._legendComponent.AABBBounds.width():0,r=isFinite(this._legendComponent.AABBBounds.height())?this._legendComponent.AABBBounds.height():0;if("normal-inline"!==this.layoutType){const t="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=this._position,{width:s,height:a}=e;let o=0,l=0;"horizontal"===t?"middle"===i?o=(s-n)/2:"end"===i&&(o=s-n):"middle"===i?l=(a-r)/2:"end"===i&&(l=a-r),this._legendComponent.setAttributes({dx:o,dy:l})}return i.x2=i.x1+n,i.y2=i.y1+r,i}onDataUpdate(){var t,e,i;if(JSON.stringify(this._preSelectedData)!==JSON.stringify(this._selectedData)){if(this._legendComponent){const t=this._getLegendAttributes(this.getLayoutRect());Im(t,this._cacheAttrs)||this._legendComponent.setAttributes(Tl({},t,{defaultSelected:this._selectedData}))}null===(e=(t=this.effect).onSelectedDataChange)||void 0===e||e.call(t),null===(i=this.getChart())||void 0===i||i.setLayoutTag(!0,null,!1),this.event.emit(Hd.legendSelectedDataChange,{model:this})}}_getNeedClearVRenderComponents(){return[this._legendComponent]}clear(){super.clear(),this._cacheAttrs=null,this._preSelectedData=null}}tW.specKey="legends";class eW extends tW{constructor(){super(...arguments),this.type=r.discreteLegend,this.name=r.discreteLegend}static getSpecInfo(t){return jE(t,this.specKey,this.type,(t=>!t.type||"discrete"===t.type))}init(t){super.init(t),mE(this._regions,(t=>{t.addViewDataFilter({type:"discreteLegendFilter",options:{series:t,selected:()=>this._selectedData,field:()=>this._getSeriesLegendField(t),data:()=>this.getLegendDefaultData()},level:Hp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_initLegendData(){Lp(this._option.dataSet,"discreteLegendFilter",QV),Lp(this._option.dataSet,"discreteLegendDataMake",JV);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"discreteLegendDataMake",options:{series:()=>{const t=[];return mE(this._regions,(e=>{t.push(e)}),{specIndex:this._spec.seriesIndex,userId:this._spec.seriesId}),t},seriesField:t=>this._getSeriesLegendField(t)}}),t}_getSeriesLegendField(t){var e,i,s;const n=t.getSeriesField(),r=null!==(e=this._spec.scaleName)&&void 0!==e?e:this._spec.scale;if(D(r))return n;if(!t.getRawData())return n;const a=this._option.globalScale.getScaleSpec(r);if(!a)return n;if(this._spec.field)return this._spec.field;if(!Jo(a.domain))return n;const o=a.domain.find((e=>e.dataId===t.getRawData().name));return o&&null!==(s=null===(i=o.fields)||void 0===i?void 0:i[0])&&void 0!==s?s:n}_initSelectedData(){const t=this.getLegendDefaultData();if(this._unselectedData){const e=[],i=[];t.forEach((t=>{this._unselectedData.includes(t)?i.push(t):e.push(t)})),this._selectedData=e,this._unselectedData=i}else this._spec.defaultSelected?this._selectedData=[...this._spec.defaultSelected]:this._selectedData=t}getLegendDefaultData(t){return ys(this._spec.data)?this._getLegendItems().map((t=>t.label)):this._legendData.getLatestData().map(t?t=>t.originalKey:t=>t.key)}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&D(t.title.text)&&D(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!e)return;t.title.text=FT(e.getRawData(),e.getSeriesField())}}_getLegendAttributes(t){const e="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",i=Object.assign(Object.assign({layout:e,items:this._getLegendItems(),zIndex:this.layoutZIndex},function(t,e){const{title:i={},item:s={},pager:n={},background:r={},type:a,id:o,visible:l,orient:h,position:d,data:c,filter:u,regionId:p,regionIndex:g,seriesIndex:m,seriesId:_,padding:f}=t,v=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n!t.includes(e)))),super.setSelectedData(t)}_initEvent(){if(this._legendComponent){const t=!1!==this._spec.filter;this._legendComponent.addEventListener(dT.legendItemClick,(e=>{const i=Ud(e,"detail.currentSelected");t&&this.setSelectedData(i),this.event.emit(Hd.legendItemClick,{model:this,value:i,event:e})})),this._legendComponent.addEventListener(dT.legendItemHover,(t=>{const e=Ud(t,"detail");this.event.emit(Hd.legendItemHover,{model:this,value:e,event:t})})),this._legendComponent.addEventListener(dT.legendItemUnHover,(t=>{const e=Ud(t,"detail");this.event.emit(Hd.legendItemUnHover,{model:this,value:e,event:t})}))}}_getLegendItems(){const t=(this._legendData.getLatestData()||[]).map((t=>{var e,i;const s=t.style("fillOpacity"),n=t.style("strokeOpacity"),r=t.style("opacity"),a=t.style("texture");return{label:t.key,shape:{symbolType:null!==(i=null!==(e=t.style("symbolType"))&&void 0!==e?e:t.shapeType)&&void 0!==i?i:"circle",fillOpacity:qo(s)?s:1,strokeOpacity:qo(n)?n:1,opacity:qo(r)?r:1,texturePadding:a?1:null,textureSize:a?4:null,texture:a,fill:t.style("fill"),stroke:t.style("stroke"),textureColor:t.style("textureColor"),innerBorder:t.style("innerBorder"),outerBorder:t.style("outerBorder"),lineDash:t.style("lineDash"),lineDashOffset:t.style("lineDashOffset"),lineWidth:t.style("lineWidth")}}}));return ys(this._spec.data)?this._spec.data(t,this._option.globalScale.getScale("color"),this._option.globalScale):t}_addLegendItemFormatMethods(t){var e,i,s,n;const{formatMethod:r,formatter:a}=null!==(i=null===(e=this._spec.item)||void 0===e?void 0:e.label)&&void 0!==i?i:{},{formatMethod:o,formatter:l}=null!==(n=null===(s=this._spec.item)||void 0===s?void 0:s.value)&&void 0!==n?n:{},{formatFunc:h}=YE(r,a);a&&!r&&h&&(t.item.label.formatMethod=(t,e)=>h(t,e,a));const{formatFunc:d}=YE(o,l);l&&!o&&d&&(t.item.value.formatMethod=(t,e)=>d(l,t,e,a))}}eW.specKey="legends",eW.type=r.discreteLegend;const iW=(t,e)=>{const{series:i,field:s,scale:n}=e,r=s();if(s&&r){let t=1/0,e=-1/0;return i().forEach((i=>{const s=i.getRawDataStatisticsByField(r,!0),n=null==s?void 0:s.min,a=null==s?void 0:s.max;qo(n)&&(t=Math.min(n,t)),qo(a)&&(e=Math.max(a,e))})),[t,e]}if(n){const t=n();return t?t.domain():[]}return[]},sW=(t,e)=>{const{selected:i,field:s,data:n,isHierarchyData:r}=e,a=i(),o=s(),l=r||(t=>t&&t.some((t=>t&&function(t,e="value",i="children"){return!!vs(t)&&!!t.hasOwnProperty(i)&&Array.isArray(t[i])}(t))));if(a===n())return t;if(o&&!Ym(a)){const[e,i]=a;return l(t)?BH(t,+e,+i,o):t.filter((t=>t[o]>=e&&t[o]<=i))}return t};var nW;function rW(t){return y(t)?t:[t,t]}function aW(t){return t?"ew-resize":"ns-resize"}!function(t){t.innerView="innerView",t.railContainer="sliderRailContainer",t.rail="sliderRail",t.startText="sliderStartText",t.endText="sliderEndText",t.startHandler="sliderStartHandler",t.startHandlerText="startHandlerText",t.endHandler="sliderEndHandler",t.endHandlerText="sliderEndHandlerText",t.track="sliderTrack",t.trackContainer="sliderTrackContainer"}(nW||(nW={})),VV();class oW extends Rk{get track(){return this._track}get currentValue(){return this._currentValue}get startHandler(){return this._startHandler}get endHandler(){return this._endHandler}get tooltipShape(){return this._tooltipShape}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},oW.defaultAttributes,t)),this.name="slider",this._isHorizontal=!0,this._startHandler=null,this._endHandler=null,this._startHandlerText=null,this._endHandlerText=null,this._currentHandler=null,this._currentValue={},this._onTooltipShow=t=>{this._isChanging||this._tooltipState&&this._tooltipState.isActive||(this._tooltipState?this._tooltipState.isActive=!0:this._tooltipState={isActive:!0},this._onTooltipUpdate(t),this._dispatchTooltipEvent("sliderTooltipShow"))},this._onTooltipUpdate=t=>{if(this._isChanging||!this._tooltipState||!this._tooltipState.isActive)return;const e=this._isHorizontal?this._rail.globalAABBBounds.width():this._rail.globalAABBBounds.height(),i=Ps(this._isHorizontal?(t.viewX-this._rail.globalAABBBounds.x1)/e:(t.viewY-this._rail.globalAABBBounds.y1)/e,0,1);i!==this._tooltipState.pos&&(this._tooltipState.pos=i,this._tooltipState.value=this.calculateValueByPos(i*e),this._updateTooltip(),this._dispatchTooltipEvent("sliderTooltipUpdate"))},this._onTooltipHide=()=>{const{tooltip:t}=this.attribute;t&&t.alwaysShow||(this._tooltipState=null,this._tooltipShape&&this._tooltipShape.setAttribute("visible",!1),this._tooltipText&&this._tooltipText.setAttribute("visible",!1),this._dispatchTooltipEvent("sliderTooltipHide"))},this._onHandlerPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._currentHandler=t.target,this._prePos=this._isHorizontal?e:i,"browser"===zo.env?(zo.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),zo.addEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onHandlerPointerUp),this.stage.addEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onHandlerPointerMove=t=>{var e,i;t.stopPropagation(),this._isChanging=!0;const{railWidth:s,railHeight:n,min:r,max:a}=this.attribute;if(a===r)return;const{x:o,y:l}=this.stage.eventPointTransform(t);let h,d,c,u=0;this._isHorizontal?(h=o,u=h-this._prePos,d=null===(i=this._currentHandler)||void 0===i?void 0:i.attribute.x,c=s):(h=l,u=h-this._prePos,d=null===(e=this._currentHandler)||void 0===e?void 0:e.attribute.y,c=n);const p=Ps(d+u,0,c),g=this.calculateValueByPos(p);"text"===this._currentHandler.type?this._updateHandlerText(this._currentHandler,p,g):this._updateHandler(this._currentHandler,p,g),this._updateTrack(),this._prePos=h,this._dispatchChangeEvent()},this._onHandlerPointerUp=t=>{t.preventDefault(),this._isChanging=!1,this._currentHandler=null,"browser"===zo.env?(zo.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),zo.removeEventListener("pointerup",this._onHandlerPointerUp)):(this.stage.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onHandlerPointerUp),this.stage.removeEventListener("pointerupoutside",this._onHandlerPointerUp))},this._onTrackPointerdown=t=>{t.stopPropagation(),this._isChanging=!0;const{x:e,y:i}=this.stage.eventPointTransform(t);this._prePos=this._isHorizontal?e:i,"browser"===zo.env?(zo.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),zo.addEventListener("pointerup",this._onTrackPointerUp)):(this.stage.addEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.addEventListener("pointerup",this._onTrackPointerUp),this.stage.addEventListener("pointerupoutside",this._onTrackPointerUp))},this._onTrackPointerMove=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n,inverse:r}=this.attribute;if(n===s)return;const{startHandler:a,endHandler:o}=this._getHandlers();let l,h,d;const{x:c,y:u}=this.stage.eventPointTransform(t);this._isHorizontal?(l=c,h=this._track.attribute.width,d=e):(l=u,h=this._track.attribute.height,d=i);const p=l-this._prePos;if(a){const t=this._isHorizontal?a.attribute.x:a.attribute.y,e=r?Ps(t+p,h,d):Ps(t+p,0,d-h),i=this.calculateValueByPos(e);this._updateHandler(a,e,i)}if(o){const t=this._isHorizontal?o.attribute.x:o.attribute.y,e=r?Ps(t+p,0,d-h):Ps(t+p,h,d),i=this.calculateValueByPos(e),s=null==a?void 0:a.attribute;this._updateHandler(o,e,i),this._track.setAttributes(this._isHorizontal?{x:Math.min(s.x,o.attribute.x),width:Math.abs(s.x-o.attribute.x)}:{y:Math.min(s.y,o.attribute.y),height:Math.abs(s.y-o.attribute.y)})}this._prePos=l,this._dispatchChangeEvent()},this._onTrackPointerUp=t=>{t.preventDefault(),this._isChanging=!1,"browser"===zo.env?(zo.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),zo.removeEventListener("pointerup",this._onTrackPointerUp)):(this.stage.removeEventListener("pointermove",this._onTrackPointerMove,{capture:!0}),this.stage.removeEventListener("pointerup",this._onTrackPointerUp),this.stage.removeEventListener("pointerupoutside",this._onTrackPointerUp))},this._onRailPointerDown=t=>{t.stopPropagation(),this._isChanging=!0;const{railWidth:e,railHeight:i,min:s,max:n}=this.attribute;if(n===s)return;const r=this._startHandler,a=this._endHandler;let o,l,h,d;this._isHorizontal?(o=t.viewX-this._rail.globalAABBBounds.x1,l=null==r?void 0:r.attribute.x,h=null==a?void 0:a.attribute.x,d=e):(o=t.viewY-this._rail.globalAABBBounds.y1,l=null==r?void 0:r.attribute.y,h=null==a?void 0:a.attribute.y,d=i);const c=this.calculateValueByPos(o);if(M(h)){const t=Math.abs(o-l)>Math.abs(o-h)?a:r;this._updateHandler(t,o,c)}else this._updateHandler(r,o,c);this._updateTrack(),this._dispatchChangeEvent()}}calculatePosByValue(t,e){const{layout:i,railWidth:s,railHeight:n,min:r,max:a,inverse:o}=this.attribute;let l=0;return l=r===a?"start"===e?0:"end"===e?1:0:(t-r)/(a-r),(o?1-l:l)*("vertical"===i?n:s)}calculateValueByPos(t){const{layout:e,railWidth:i,railHeight:s,min:n,max:r,inverse:a}=this.attribute,o="vertical"===e?s:i;return n+(r-n)*(a?1-t/o:t/o)}setValue(t){const{min:e,max:i}=this.attribute;if(i===e)return;const[s,n]=Ba(t),{startHandler:r,endHandler:a}=this._getHandlers();r&&this._updateHandler(r,this.calculatePosByValue(s),s),a&&this._updateHandler(a,this.calculatePosByValue(n),n),this._updateTrack()}render(){var t,e;this.removeAllChild(!0);const{layout:i="horizontal",railWidth:s,railHeight:n,startText:r,endText:a,min:o,max:l,showHandler:h=!0,showTooltip:d}=this.attribute;let{value:c}=this.attribute;D(c)&&(c=[o,l]),this._currentValue={startValue:rW(c)[0],endValue:rW(c)[1]};const u="horizontal"===i;this._isHorizontal=u;const p=ra.group({x:0,y:0});p.name=nW.innerView,this.add(p),this._innerView=p;let g,m=0;if(r&&r.visible){g=ra.text(Object.assign({x:u?0:s/2,y:u?n/2:0,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:r.text,lineHeight:null===(t=r.style)||void 0===t?void 0:t.fontSize},r.style)),g.name=nW.startText,p.add(g);const e=M(r.space)?r.space:0;m+=(u?g.AABBBounds.width():g.AABBBounds.height())+e}const _=ra.group({x:u?m:0,y:u?0:m});p.add(_);const f=ra.group({x:0,y:0});let v;if(f.name=nW.railContainer,this._railContainer=f,_.add(f),this._mainContainer=_,this._renderRail(f),m+=u?s:n,a&&a.visible){const t=M(a.space)?a.space:0;v=ra.text(Object.assign({x:u?m+t:s/2,y:u?n/2:m+t,textAlign:u?"start":"center",textBaseline:u?"middle":"top",text:a.text,lineHeight:null===(e=a.style)||void 0===e?void 0:e.fontSize},a.style)),v.name=nW.endText,p.add(v)}this._renderTrack(f),h&&(this._renderHandlers(_),this._bindEvents()),d&&(this._renderTooltip(),this._bindTooltipEvents())}_renderRail(t){const{railWidth:e,railHeight:i,railStyle:s,slidable:n}=this.attribute;let r="default";!1!==n&&(r="pointer");const a=ra.rect(Object.assign({x:0,y:0,width:e,height:i,cursor:r},s));return a.name=nW.rail,t.add(a),this._rail=a,a}_renderHandlers(t){const{range:e,min:i,max:s,handlerSize:n=14,handlerStyle:r,handlerText:a,railHeight:o,railWidth:l,slidable:h}=this.attribute;let{value:d}=this.attribute;D(d)&&(d=[i,s]);const c=a&&a.visible,u=this._isHorizontal,[p,g]=rW(d),m=this.calculatePosByValue(p,e?"start":"end"),_=this._renderHandler(Object.assign({x:u?m:l/2,y:u?o/2:m,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":aW(u)},r));if(_.name=nW.startHandler,this._startHandler=_,t.add(_),this._currentValue.startPos=m,c){const i=this._renderHandlerText(p,e?"start":"end");i.name=nW.startHandlerText,t.add(i),this._startHandlerText=i}if(e){const e=this.calculatePosByValue(g,"end"),i=this._renderHandler(Object.assign({x:u?e:l/2,y:u?o/2:e,size:n,strokeBoundsBuffer:0,cursor:!1===h?"default":aW(u)},r));if(i.name=nW.endHandler,this._endHandler=i,t.add(i),this._currentValue.endPos=e,c){const e=this._renderHandlerText(g,"end");e.name=nW.endHandlerText,t.add(e),this._endHandlerText=e}}}_renderTrack(t){const{range:e,min:i,max:s,railHeight:n,railWidth:r,trackStyle:a,railStyle:o,slidable:l,value:h}=this.attribute;let d,c;if(D(h))e?(d=i,c=s):d=c=i;else if(e){const t=UV(h,i,s);d=t[0],c=t[1]}else d=i,c=Ps(h,i,s);const u=this._isHorizontal;e||(d=i);const p=ra.group({x:0,y:0,width:r,height:n,cornerRadius:null==o?void 0:o.cornerRadius,clip:!0,pickable:!1});p.name=nW.trackContainer;const g=vs(e)&&!0===e.draggableTrack;let m;m=!1===l?"default":!1===e||!1===g?"pointer":aW(u);const _=this.calculatePosByValue(d,"start"),f=this.calculatePosByValue(c,e?"end":"start"),v=ra.rect(Object.assign({x:u?Math.min(_,f):0,y:u?0:Math.min(_,f),width:u?Math.abs(f-_):r,height:u?n:Math.abs(f-_),cursor:m},a));v.name=nW.track,this._track=v,p.add(v),t.add(p)}_renderHandler(t){return ra.symbol(t)}_renderHandlerText(t,e){var i,s,n;const{align:r,handlerSize:a=14,handlerText:o={},railHeight:l,railWidth:h,slidable:d}=this.attribute,c=this._isHorizontal,u=this.calculatePosByValue(t,e),p=null!==(i=o.space)&&void 0!==i?i:4,g={text:o.formatter?o.formatter(t):t.toFixed(null!==(s=o.precision)&&void 0!==s?s:0),lineHeight:null===(n=o.style)||void 0===n?void 0:n.lineHeight,cursor:!1===d?"default":aW(c)};return c?"top"===r?(g.textBaseline="bottom",g.textAlign="center",g.x=u,g.y=(l-a)/2-p):(g.textBaseline="top",g.textAlign="center",g.x=u,g.y=(l+a)/2+p):"left"===r?(g.textBaseline="middle",g.textAlign="end",g.x=(h-a)/2-p,g.y=u):(g.textBaseline="middle",g.textAlign="start",g.x=(h+a)/2+p,g.y=u),ra.text(Object.assign(Object.assign({},g),o.style))}_renderTooltip(){var t;const{tooltip:e,railHeight:i,railWidth:s,align:n}=this.attribute;e&&e.alwaysShow?this._tooltipState={value:this._currentValue.startValue,pos:this._currentValue.startPos}:this._tooltipState=null;const r=this._isHorizontal?0:s/2,a=this._isHorizontal?i/2:0;if(e&&e.shape){const t=ra.symbol(Object.assign({pickable:!1,visible:!!this._tooltipState,x:r,y:a,symbolType:"circle"},e.shapeStyle));this._tooltipShape=t,this._mainContainer.add(t)}const o=e&&e.text||{},l=null!==(t=o.space)&&void 0!==t?t:6,h={pickable:!1,visible:!!this._tooltipState,text:""};this._isHorizontal?(h.x=r,h.y="top"===n?a-i/2-l:a+i/2+l,h.textAlign="center",h.textBaseline="top"===n?"bottom":"top"):(h.y=a,h.x="left"===n?r-s/2-l:a+s/2+l,h.textAlign="left"===n?"end":"start",h.textBaseline="middle");const d=ra.text(Object.assign(Object.assign({},h),o.style));this._mainContainer.add(d),this._tooltipText=d,this._tooltipState&&this._updateTooltip()}_updateTooltip(){var t,e;if(!this._tooltipShape&&!this._tooltipText||!this._tooltipState)return;const{railWidth:i,railHeight:s}=this.attribute,n=this._isHorizontal?i:s,r=this._tooltipState.pos*n,a=this._isHorizontal?"x":"y";this._tooltipShape&&this._tooltipShape.setAttributes({visible:!0,[a]:r});const{align:o}=this.attribute;if(this._tooltipText){const i=this.attribute.tooltip&&this.attribute.tooltip.text||{};this._tooltipText.setAttributes({visible:!0,[a]:r,text:i.formatter?i.formatter(this._tooltipState.value):this._isHorizontal||"left"!==o?`≈ ${this._tooltipState.value.toFixed(null!==(e=i.precision)&&void 0!==e?e:0)}`:`${this._tooltipState.value.toFixed(null!==(t=i.precision)&&void 0!==t?t:0)} ≈`})}}_bindEvents(){if(this.attribute.disableTriggerEvent)return;const{slidable:t,range:e}=this.attribute;t&&(this._startHandler&&this._startHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._startHandlerText&&this._startHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandler&&this._endHandler.addEventListener("pointerdown",this._onHandlerPointerdown),this._endHandlerText&&this._endHandlerText.addEventListener("pointerdown",this._onHandlerPointerdown),vs(e)&&e.draggableTrack&&this._track.addEventListener("pointerdown",this._onTrackPointerdown),this._railContainer.addEventListener("pointerdown",this._onRailPointerDown))}_bindTooltipEvents(){this.attribute.disableTriggerEvent||(this._mainContainer.addEventListener("pointerenter",this._onTooltipShow),this._mainContainer.addEventListener("pointermove",this._onTooltipUpdate),this._mainContainer.addEventListener("pointerleave",this._onTooltipHide))}_updateTrack(){const{inverse:t,railWidth:e,railHeight:i}=this.attribute,s=this._startHandler,n=this._endHandler;if(this._isHorizontal){const i=null==s?void 0:s.attribute.x;if(n){const t=null==n?void 0:n.attribute.x;this._track.setAttributes({x:Math.min(i,t),width:Math.abs(i-t)})}else t?this._track.setAttributes({x:i,width:e-i}):this._track.setAttributes({width:i})}else{const e=null==s?void 0:s.attribute.y;if(n){const t=null==n?void 0:n.attribute.y;this._track.setAttributes({y:Math.min(e,t),height:Math.abs(e-t)})}else t?this._track.setAttributes({y:e,height:i-e}):this._track.setAttributes({height:e})}}_updateHandler(t,e,i){var s;const n=this._isHorizontal;t.setAttribute(n?"x":"y",e);const r=t.name===nW.startHandler?this._startHandlerText:this._endHandlerText;if(r){const{handlerText:t={}}=this.attribute;r.setAttributes({text:t.formatter?t.formatter(i):i.toFixed(null!==(s=t.precision)&&void 0!==s?s:0),[n?"x":"y"]:e})}t.name===nW.startHandler?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_updateHandlerText(t,e,i){var s;const n=this._isHorizontal,{handlerText:r={}}=this.attribute;t.setAttributes({[n?"x":"y"]:e,text:r.formatter?r.formatter(i):i.toFixed(null!==(s=r.precision)&&void 0!==s?s:0)});const a=t.name===nW.startHandlerText?this._startHandler:this._endHandler;a&&a.setAttributes({[n?"x":"y"]:e}),t.name===nW.startHandlerText?(this._currentValue.startValue=i,this._currentValue.startPos=e):(this._currentValue.endValue=i,this._currentValue.endPos=e)}_dispatchChangeEvent(){const t=!!this.attribute.range,e=this._currentValue;this._dispatchEvent("change",{value:t?[Math.min(e.endValue,e.startValue),Math.max(e.endValue,e.startValue)]:e.startValue,position:t?[Math.min(e.endPos,e.startPos),Math.max(e.endPos,e.startPos)]:e.startPos})}_dispatchTooltipEvent(t){this._dispatchEvent("sliderTooltip",{type:t,position:this._tooltipState&&this._tooltipState.pos,value:this._tooltipState&&this._tooltipState.value})}_getHandlers(){const{inverse:t}=this.attribute;let e=this._startHandler,i=this._endHandler;return i?(this._isHorizontal?(!t&&i.attribute.x<(null==e?void 0:e.attribute.x)||t&&i.attribute.x>(null==e?void 0:e.attribute.x))&&([e,i]=[i,e]):(!t&&i.attribute.y<(null==e?void 0:e.attribute.y)||t&&i.attribute.y>(null==e?void 0:e.attribute.y))&&([e,i]=[i,e]),{startHandler:e,endHandler:i}):{startHandler:e,endHandler:i}}}oW.defaultAttributes={slidable:!0,layout:"horizontal",align:"bottom",height:8,showHandler:!0,handlerSize:14,handlerStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},tooltip:{shapeStyle:{symbolType:"circle",fill:"#fff",stroke:"#91caff",lineWidth:2},text:{style:{fill:"#2C3542",fontSize:12}}},railStyle:{fill:"rgba(0,0,0,.04)"},trackStyle:{fill:"#91caff"},showValue:!0,valueStyle:{fill:"#2C3542",fontSize:12},startText:{style:{fill:"#2C3542",fontSize:12}},endText:{style:{fill:"#2C3542",fontSize:12}},handlerText:{visible:!0,space:4,precision:0,style:{fill:"#2C3542",fontSize:12}}},GV(),VV();class lW extends jV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},lW.defaultAttributes,t)),this.name="colorLegend",this._onSliderToolipChange=t=>{const e=this._slider.tooltipShape;if(e&&t.detail&&!D(t.detail.value)){const i=this._colorScale.scale(t.detail.value);e.setAttribute("fill",i)}this.dispatchEvent(t)},this._onSliderChange=t=>{this._updateColor(),this.dispatchEvent(t)}}setSelected(t){this._slider&&(this._slider.setValue(t),this._updateColor())}_renderContent(){const{colors:t,slidable:e,layout:i,align:s,min:n,max:r,value:a,railWidth:o,railHeight:l,showHandler:h=!0,handlerSize:d,handlerStyle:c,railStyle:u,trackStyle:p,startText:g,endText:m,handlerText:_,showTooltip:f,tooltip:v,inverse:y,disableTriggerEvent:b}=this.attribute,x=[],S=(r-n)/(t.length-1);for(let e=0;e1){const t=this._color.stops,e=Math.min(c,u),i=Math.max(c,u),s=e/g,n=i/g,r=n-s,a=t.filter((t=>t.offset>s&&t.offset{f.push({offset:(t.offset-s)/r,color:t.color})})),f.push({offset:1,color:_}),o.setAttribute("fill",Object.assign(Object.assign({},this._color),{stops:f}))}}}function hW(t="bottom"){let e=0;return"top"===t?`\n M${e},-6L${e-3.5},-2.5\n v5\n h7\n v-5\n Z\n`:"left"===t?(e=1,`\n M${e-6},0L${e-6+2.5},-3.5\n h5\n v7\n h-5\n Z\n`):"right"===t?(e=-1,`\n M${e+6},0L${e+6-2.5},-3.5\n h-5\n v7\n h5\n Z\n `):`\n M${e},6L${e-3.5},2.5\n v-5\n h7\n v5\n Z\n`}lW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{fill:null,lineWidth:4,stroke:"#fff",outerBorder:{distance:2,lineWidth:1,stroke:"#ccc"}},tooltip:{shapeStyle:{lineWidth:4,stroke:"#fff"}}},GV(),VV(),wM();class dW extends jV{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},dW.defaultAttributes,t)),this.name="sizeLegend",this._onSliderChange=t=>{this.dispatchEvent(t)},this._onSliderToolipChange=t=>{this.dispatchEvent(t)}}setSelected(t){this._slider&&this._slider.setValue(t)}_renderContent(){const{slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l=!0,handlerSize:h,handlerStyle:d,railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,sizeBackground:v,disableTriggerEvent:y,inverse:b}=this.attribute,x=ra.group({x:0,y:0});this._innerView.add(x);const S=new oW({x:0,y:0,zIndex:1,range:{draggableTrack:!0},slidable:t,layout:e,align:i,min:s,max:n,value:r,railWidth:a,railHeight:o,showHandler:l,handlerSize:h,handlerStyle:Object.assign({symbolType:hW(i)},d),railStyle:c,trackStyle:u,startText:p,endText:g,handlerText:m,showTooltip:_,tooltip:f,disableTriggerEvent:y,inverse:b});x.add(S);let M,k=0;"horizontal"===e?"top"===i?(M=`M0,0L${a},0L${b?0:a},12Z`,k=o):(M=`M0,12L${a},12L${b?0:a},0Z`,S.setAttribute("y",12)):"left"===i?M=`M${a},0L${a+12},${b?0:o}L${a},${o}Z`:(M=`M0,${b?0:o}L12,${o}L12,0Z`,S.setAttribute("x",12));const A=ra.path(Object.assign(Object.assign({x:0,y:k,path:M},v),{zIndex:0}));x.add(A);const w=this._title?this._title.AABBBounds.height()+Ud(this.attribute,"title.space",12):0;x.translate(0-x.AABBBounds.x1,w-x.AABBBounds.y1),this._slider=S}_bindEvents(){this.attribute.disableTriggerEvent||this._slider&&(this._slider.addEventListener("change",this._onSliderChange),this._slider.addEventListener("sliderTooltip",this._onSliderToolipChange))}}dW.defaultAttributes={layout:"horizontal",title:{align:"start",space:12,textStyle:{fontSize:12,fontWeight:"bold",fill:"rgba(46, 47, 50, 1)"}},handlerSize:10,handlerStyle:{lineWidth:1,stroke:"#ccc",fill:"#fff"},sizeBackground:{fill:"rgba(20,20,20,0.1)"}};const cW={color:lW,size:dW},uW=["#C4E7FF","#98CAFF","#75ACFF","#518FF9","#2775DC","#005CBE","#00429F","#00287E"],pW=[2,10];class gW extends tW{static getSpecInfo(t){const e=jE(t,this.specKey,this.type,(t=>{return"color"===(e=t.type)||"size"===e;var e}));return e&&e.forEach((t=>{t.type="color"===t.spec.type?r.colorLegend:r.sizeLegend})),e}constructor(t,e){super(t,e),this.type=r.colorLegend,this.name=r.colorLegend;const i="color"===this._spec.type?r.colorLegend:r.sizeLegend;this.type=i,this.name=i}setAttrFromSpec(){super.setAttrFromSpec(),this._field=this._spec.field,this._legendType=this._spec.type}init(t){super.init(t),mE(this._regions,(t=>{t.addViewDataFilter({type:"continuousLegendFilter",options:{selected:()=>this._selectedData,field:()=>this._field,data:()=>this._legendData.getLatestData(),isHierarchyData:t.isHierarchyData},level:Hp.legendFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}_getScaleInGlobal(){const t=this._option.globalScale;let e=this._spec.scale;return e||(e=this._legendType),t.getScale(e)}_initLegendData(){Lp(this._option.dataSet,"continuousLegendFilter",sW),Lp(this._option.dataSet,"continuousLegendDataMake",iW);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});return t.transform({type:"continuousLegendDataMake",options:{series:()=>_E(this._regions,{userId:this._seriesUserId,specIndex:this._seriesIndex}),field:()=>this._field,scale:this._getScaleInGlobal.bind(this)}}),t}_initSelectedData(){this._spec.defaultSelected?this._selectedData=this._spec.defaultSelected.slice():this._selectedData=this._legendData.getLatestData()}_addDefaultTitleText(t){var e,i,s,n;if((null===(e=t.title)||void 0===e?void 0:e.visible)&&D(t.title.text)&&D(null===(i=t.title.style)||void 0===i?void 0:i.text)){const e=this._field;if(e){const i=null===(n=null===(s=this._regions)||void 0===s?void 0:s[0])||void 0===n?void 0:n.getSeries()[0];if(!i)return;return void(t.title.text=FT(i.getRawData(),e))}let i=this._spec.scale;i||(i=this._legendType);const r=this._option.globalScale.getScaleSpec(i);if(!Jo(null==r?void 0:r.domain))return;const a=r.domain[0];if(0===a.fields.length)return;t.title.text=FT(this._option.dataSet.getDataView(a.dataId),a.fields[0])}}_getLegendAttributes(t){var e,i;const s="bottom"===this.layoutOrient||"top"===this.layoutOrient?"horizontal":"vertical",n="horizontal"===s?"bottom":this.layoutOrient;let r=[];const a=this._getScaleInGlobal();a&&"linear"===a.type&&(r=a.range()),Ym(r)&&(r="color"===this._legendType?uW:pW);let o=null!==(e=this._legendData.getLatestData()[0])&&void 0!==e?e:0,l=null!==(i=this._legendData.getLatestData()[1])&&void 0!==i?i:1;this._legendData.getLatestData()[0]===this._legendData.getLatestData()[1]&&(o=Math.min(0,this._legendData.getLatestData()[0]),l=0===this._legendData.getLatestData()[0]?1:Math.max(0,this._legendData.getLatestData()[0]));const h=Object.assign({layout:s,align:n,zIndex:this.layoutZIndex,min:o,max:l,value:this._spec.defaultSelected,["color"===this._legendType?"colors":"sizeRange"]:r},function(t){const e=Tl({},t),{title:i={},handler:s={},rail:n={},track:r={},startText:a,endText:o,handlerText:l,sizeBackground:h,background:d={},type:c,id:u,visible:p,orient:g,position:m,data:_,defaultSelected:f,field:v,filter:y,regionId:b,regionIndex:x,seriesIndex:S,seriesId:k,padding:A}=e,w=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const i=Ud(e,"detail.value");t&&this.setSelectedData(i),this.event.emit(Hd.legendFilter,{model:this,value:i,event:e})}),30))}}}gW.specKey="legends",gW.type=r.continuousLegend;const mW=(t,e)=>M(e)?t.map((t=>e[t])):void 0,_W=(t,e)=>i=>t.every(((t,s)=>i[t]===(null==e?void 0:e[s]))),fW=t=>!D(t)&&(y(t)?t.length>0&&t.every(M):Object.keys(t).length>0),vW=(t,e)=>!(e&&(!1===e.visible||e[t]&&!1===e[t].visible||e.activeType&&!e.activeType.includes(t)));function yW(t){if(!t||!t.length)return null;const e=[];return t.forEach((({content:t})=>{ys(t)?e.push(t):y(t)?t.forEach((t=>{e.push(t)})):t&&e.push(t)})),e.length?Object.assign(Object.assign({},t[0]),{content:e}):t[0]}const bW=t=>{const e=[];return t.forEach((t=>{t.data.forEach((t=>{M(t.series)&&e.push(t.series)}))})),e},xW=(t,e,i,s,n)=>{var r,a;i&&(i.shapeSize=null!==(r=i.shapeSize)&&void 0!==r?r:i.size);const o=s?null!==(a=s[null==t?void 0:t.seriesId])&&void 0!==a?a:s[-1]:null,l={};return[t,e,i,o,n].forEach((t=>{M(t)&&Object.keys(t).forEach((e=>{(t=>t.toLowerCase().includes("shape"))(e)&&D(l[e])&&!D(t[e])&&(l[e]=t[e])}))})),l},SW=(t,e,i)=>{const s=ys(e)?e(t):e;return i?Object.assign(Object.assign({},t),s):Object.assign(Object.assign({},s),t)},MW=(t,e,i)=>M(t)?ys(t)?(...s)=>SW(t(...s),e,i):SW(t,e,i):void 0,kW=(t,e,i)=>M(t)?Ba(t).map((t=>ys(t)?(...s)=>Ba(t(...s)).map((t=>SW(t,e,i))):SW(t,e,i))):void 0,AW=(t,e,i,s)=>{let n;if(n=ys(t)?t(e,i):t,s){const{formatFunc:i,args:r}=YE(void 0,s,t,e);i&&r&&(n=i(...r))}return n},wW=(t,e,i)=>D(t)?t:ys(t)?t(e,i):t;class TW{}TW.dom=`${sh}_TOOLTIP_HANDLER_DOM`,TW.canvas=`${sh}_TOOLTIP_HANDLER_CANVAS`;const LW=20,CW={key:"其他",value:"..."},EW=["group","mark","dimension"],DW=(t,e,i)=>{if(!e&&!i)return"object"!=typeof t?null==t?void 0:t.toString():t;const s=cF.getInstance();return e=e||"%Y%m%d",("local"===(i=i||"local")?s.timeFormat:s.timeUTCFormat)(e,t)},PW=(t,e,i)=>{const s=DW(AW(e.key,t,i,e.keyFormatter),e.keyTimeFormat,e.keyTimeFormatMode),n=DW(AW(e.value,t,i,e.valueFormatter),e.valueTimeFormat,e.valueTimeFormatMode),r=!1!==AW(e.visible,t,i)&&(M(s)||M(n)),a=AW(e.isKeyAdaptive,t,i),o=AW(e.spaceRow,t,i),l=AW(e.shapeType,t,i),h=AW(e.shapeColor,t,i),d=AW(e.shapeFill,t,i),c=AW(e.shapeStroke,t,i),u=AW(e.shapeLineWidth,t,i),p=AW(e.shapeHollow,t,i),g=AW(e.keyStyle,t,i),m=AW(e.valueStyle,t,i);return{key:s,value:n,visible:r,isKeyAdaptive:a,hasShape:e.hasShape,shapeType:l,shapeFill:d,shapeStroke:c,shapeLineWidth:u,shapeHollow:p,shapeColor:h,keyStyle:g,valueStyle:m,spaceRow:o,datum:t}};class OW{constructor(t){this._showTooltipByHandler=(t,e)=>{var i,s,n;if(D(t))return 1;e.changePositionOnly||this.clearCache(),this._updateViewSpec(e);const r=this._cacheViewSpec;if(D(null==r?void 0:r[this.activeType])||!1===r.visible)return 1;e.tooltipSpec=r,this._updateActualTooltip(t,e),e.tooltipActual=this._cacheActualTooltip;const{title:a,content:o}=this._cacheActualTooltip,l=D(null==a?void 0:a.key)&&D(null==a?void 0:a.value)&&!(null==o?void 0:o.length);if(this.component.event.emit(Hd.tooltipShow,Object.assign(Object.assign({},e),{isEmptyTooltip:D(null==a?void 0:a.key)&&D(null==a?void 0:a.value)&&!(null==o?void 0:o.length),tooltipData:t,activeType:this.activeType,tooltip:this.component})),l)return 1;let h;return(null===(i=r.handler)||void 0===i?void 0:i.showTooltip)?h=r.handler.showTooltip.bind(r.handler):(null===(s=this.component.tooltipHandler)||void 0===s?void 0:s.showTooltip)&&(h=this.component.tooltipHandler.showTooltip.bind(this.component.tooltipHandler)),h?null!==(n=h(this.activeType,t,e))&&void 0!==n?n:0:1},this.component=t}_preprocessDimensionInfo(t){const e=[];if(null==t||t.forEach((t=>{const i=Object.assign(Object.assign({},t),{data:t.data.filter((({series:t})=>{var e,i;return!1!==(null===(i=null===(e=t.getSpec())||void 0===e?void 0:e.tooltip)||void 0===i?void 0:i.visible)}))});i.data.length>0&&e.push(i)})),e.length>0)return e}_updateViewSpec(t){const{changePositionOnly:e,model:i,dimensionInfo:s}=t;e&&this._cacheViewSpec||(this._cacheViewSpec=((t,e,i,s)=>{var n,r,a,o,l,h;const d=Object.assign(Object.assign({},e),{activeType:t}),{style:c={}}=e;switch(t){case"mark":case"group":if(i){const t=null===(n=i.getSpec())||void 0===n?void 0:n.tooltip;if(d.visible=!0,d.handler=null!==(r=null==t?void 0:t.handler)&&void 0!==r?r:e.handler,null===(a=d.handler)||void 0===a?void 0:a.showTooltip)return d}break;case"dimension":if((null==s?void 0:s.length)&&(bW(s).every((t=>{var e;return!vW("dimension",null===(e=t.tooltipHelper)||void 0===e?void 0:e.spec)}))?d.visible=!1:d.visible=!0,d.handler=null!==(o=e.handler)&&void 0!==o?o:void 0,null===(l=d.handler)||void 0===l?void 0:l.showTooltip))return d}const u=null!==(h=((t,e,i)=>{switch(t){case"mark":case"group":if(e)return e.tooltipHelper.getDefaultTooltipPattern(t);break;case"dimension":if(null==i?void 0:i.length){const e=[];return i.forEach((i=>i.data.forEach((s=>{const{series:n}=s,r=[Object.assign(Object.assign({},i),{data:[s]})],a=n.tooltipHelper.getDefaultTooltipPattern(t,r);a&&e.push(a)})))),yW(e)}}})(t,i,s))&&void 0!==h?h:{},p=((t,e,i,s)=>{const n="dimension"===t&&(null==s?void 0:s.length)?bW(s):"mark"!==t&&"group"!==t||!i?null:[i];if(n&&n.length){const i=[];return n.forEach((s=>{var n;const r=null===(n=s.tooltipHelper)||void 0===n?void 0:n.spec;if(vW(t,r)){let n=r&&r[t]?Object.assign(Object.assign({},e[t]),r[t]):e[t];n&&(n=k(n),n.title&&(n.title=MW(n.title,{seriesId:s.id},!0)),n.content&&(n.content=kW(n.content,{seriesId:s.id},!0)),i.push(n))}})),i&&i.length?yW(i):null}})(t,e,i,s);if(p){const t=u.title,e=xW(void 0,p,c.shape,void 0,t);M(p.title)?p.title=MW(p.title,Object.assign(Object.assign({},t),e)):p.title=MW(t,e,!0);const i=Ba(u.content);if(M(p.content)){const t=(t=>{const e={};return t.forEach((t=>{const i=t.seriesId;M(i)&&!e[i]&&(e[i]=t),e[-1]||(e[-1]=t)})),e})(i);p.content=kW(p.content,(e=>xW(e,p,c.shape,t)))}else p.content=kW(i,(t=>xW(void 0,p,c.shape,void 0,t)),!0)}return d[t]=Object.assign(Object.assign(Object.assign({},u),p),{activeType:t}),d})(this.activeType,this.component.getSpec(),i,s))}_updateActualTooltip(t,e){var i,s,n,r;const a=this._cacheViewSpec[this.activeType],{changePositionOnly:o}=e;if(!o||!this._cacheActualTooltip){const o=((t,e,i)=>{var s,n,r,a;if(!e||"mouseout"===(null===(s=null==i?void 0:i.event)||void 0===s?void 0:s.type))return null;const o={title:{},content:[]},l=wW(t.title,e,i),{visible:h,value:d,valueTimeFormat:c,valueTimeFormatMode:u,valueStyle:p,hasShape:g,valueFormatter:m}=null!=l?l:{},_=!1!==AW(h,e,i);if(l&&_){const t=function(t){var e;const i=(null===(e=t[0])||void 0===e?void 0:e.series)?[{data:t,value:""}]:t;for(const{data:t}of i)for(const{datum:e}of t)for(const t of null!=e?e:[])if(t)return t}(e);o.title={value:DW(AW(d,t,i,m),c,u),valueStyle:AW(p,t,i),hasShape:g}}else o.title={hasShape:!1,visible:!1};const f=((t,e,i)=>{if(D(t))return t;let s=[];return Ba(t).forEach((t=>{ys(t)?s=s.concat(Ba(t(e,i))):s.push(t)})),s})(t.content,e,i),{maxLineCount:v=LW}=t,y=t.othersLine?Object.assign(Object.assign({},CW),t.othersLine):CW,b=t=>{if(null==t?void 0:t.length)for(const e of t)for(const t of null!=f?f:[]){const s=PW(e,t,i);if(!1!==s.visible){if(o.content.length===v-1){o.content.push(Object.assign(Object.assign({},s),y));break}if(!(o.content.lengthD(t.seriesId)||t.seriesId===s.id)))&&void 0!==a?a:[];for(const s of e){for(const e of t){const t=PW(s,e,i);if(!1!==t.visible){if(o.content.length===v-1){o.content.push(Object.assign(Object.assign({},t),y));break}if(!(o.content.length=v)break}if(o.content.length>=v)break}if(o.content.length>=v)break}}return o.title&&(o.content.length>0&&o.content[0].shapeType?(D(o.title.shapeType)&&(o.title.shapeType=o.content[0].shapeType),D(o.title.shapeColor)&&(o.title.shapeColor=o.content[0].shapeColor)):o.title.hasShape=!1),o})(a,t,e),l=!!M(o)&&!1!==wW(a.visible,t,e);this._cacheActualTooltip=Object.assign(Object.assign({},o),{visible:l,activeType:a.activeType,data:t});const{title:h,content:d}=this._cacheActualTooltip;this._cacheActualTooltip.title=null!==(s=null===(i=a.updateTitle)||void 0===i?void 0:i.call(a,h,t,e))&&void 0!==s?s:h,this._cacheActualTooltip.content=null!==(r=null===(n=a.updateContent)||void 0===n?void 0:n.call(a,d,t,e))&&void 0!==r?r:d}}shouldHandleTooltip(t,e){var i,s;return!D(e)&&vW(this.activeType,null===(s=null===(i=t.model)||void 0===i?void 0:i.tooltipHelper)||void 0===s?void 0:s.spec)}clearCache(){this._cacheViewSpec=void 0,this._cacheActualTooltip=void 0}}class RW extends OW{constructor(){super(...arguments),this.activeType="dimension"}showTooltip(t,e,i){const s=Object.assign(Object.assign({},e),{dimensionInfo:this._preprocessDimensionInfo(t),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(t,s)}_getDimensionInfo(t){var e,i;let s;const n=this.component.getChart(),r=n.getCompiler().getStage().getLayer(void 0),a={x:t.event.viewX,y:t.event.viewY};if(r.globalTransMatrix.transformPoint({x:t.event.viewX,y:t.event.viewY},a),s=[...null!==(e=Id(n,a,!0))&&void 0!==e?e:[],...null!==(i=Md(n,a))&&void 0!==i?i:[]],0===s.length)s=void 0;else if(s.length>1){const t=s.filter((t=>{var e;const i=t.axis;if(i.getSpec().hasDimensionTooltip)return!0;if(!td(i.getScale().type))return!1;let s;for(const t of null!==(e=null==i?void 0:i.getRegions())&&void 0!==e?e:[]){for(const e of t.getSeries())if("cartesian"===e.coordinate){s=e;break}if(M(s))break}return M(s)&&s.getDimensionField()[0]===s.fieldY[0]?"left"===i.getOrient()||"right"===i.getOrient():"bottom"===i.getOrient()||"top"===i.getOrient()}));if(s=t.length?t:s.slice(0,1),s.length>1){const t=new Set;s.forEach((e=>{e.data=e.data.filter((({key:e})=>!t.has(e)&&(t.add(e),!0)))}))}}return s}getMouseEventData(t){return{tooltipInfo:this._getDimensionInfo(t),ignore:!1}}}class IW extends OW{constructor(){super(...arguments),this.activeType="group"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:Ba(s),series:n}],a=Object.assign(Object.assign({},e),{groupDatum:this._getGroupDatum(e),changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e,i;let s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.group;if((null==r?void 0:r.has(t.model))||(null==r?void 0:r.has(t.mark))){const n=this.component.getSpec()[this.activeType];((null==n?void 0:n.triggerMark)?Ba(n.triggerMark):[]).includes(null===(i=t.mark)||void 0===i?void 0:i.name)&&(s={mark:t.mark,datum:t.datum,series:e})}}return{tooltipInfo:s,ignore:!1}}_getGroupDatum(t){const{model:e,mark:i,datum:s}=t,n=e;if(["line","area"].includes(i.type))return Ba(s);const r=n.getViewData().latestData,a=n.getSeriesField();if(!a)return r;const o=Ba(s)[0][a];return r.filter((t=>t[a]===o))}}class BW extends OW{constructor(){super(...arguments),this.activeType="mark"}showTooltip(t,e,i){const{datum:s,series:n}=t,r=[{datum:[s],series:n}],a=Object.assign(Object.assign({},e),{changePositionOnly:i,tooltip:this.component});return this._showTooltipByHandler(r,a)}getMouseEventData(t){var e;let i,s;if("series"===(null===(e=t.model)||void 0===e?void 0:e.modelType)){const e=t.model,n=e.tooltipHelper,r=null==n?void 0:n.activeTriggerSet.mark,a=null==n?void 0:n.ignoreTriggerSet.mark;(null==r?void 0:r.has(t.model))||(null==r?void 0:r.has(t.mark))?i={mark:t.mark,datum:t.datum,series:e}:((null==a?void 0:a.has(t.model))||(null==a?void 0:a.has(t.mark)))&&(s=!0)}return{tooltipInfo:i,ignore:s}}}const FW=t=>M(t)&&!y(t),YW=t=>M(t)&&y(t);class jW extends QE{_shouldMergeThemeToSpec(){return!1}_initTheme(t,e){var i;const{spec:s,theme:n}=super._initTheme(t,e);return s.style=Tl({},this._theme,s.style),s.offset=Tl({},n.offset,t.offset),s.transitionDuration=null!==(i=t.transitionDuration)&&void 0!==i?i:n.transitionDuration,{spec:s,theme:n}}_transformSpecAfterMergingTheme(t,e,i){var s,n,r,a,o,l,h,d;super._transformSpecAfterMergingTheme(t,e,i),t.visible=null===(s=t.visible)||void 0===s||s,t.activeType=(t=>{var e,i,s;if(!1===(null==t?void 0:t.visible))return[];const n={mark:!1!==(null===(e=null==t?void 0:t.mark)||void 0===e?void 0:e.visible),dimension:!1!==(null===(i=null==t?void 0:t.dimension)||void 0===i?void 0:i.visible),group:!1!==(null===(s=null==t?void 0:t.group)||void 0===s?void 0:s.visible)};return M(null==t?void 0:t.activeType)&&Object.keys(n).forEach((e=>{var i;n[e]=null===(i=null==t?void 0:t.activeType)||void 0===i?void 0:i.includes(e)})),Object.keys(n).filter((t=>n[t]))})(t),t.renderMode=null!==(n=t.renderMode)&&void 0!==n?n:ul(this._option.mode)||!dl(this._option.mode)?"canvas":"html",t.trigger=null!==(r=t.trigger)&&void 0!==r?r:"hover",t.className=null!==(a=t.className)&&void 0!==a?a:"vchart-tooltip-element",t.enterable=null!==(o=t.enterable)&&void 0!==o&&o,t.transitionDuration=null!==(l=t.transitionDuration)&&void 0!==l?l:150,t.triggerOff=null!==(h=t.triggerOff)&&void 0!==h?h:t.trigger,t.confine=null!==(d=t.confine)&&void 0!==d?d:"canvas"===t.renderMode,M(t.mark)&&(t.mark.activeType="mark"),M(t.dimension)&&(t.dimension.activeType="dimension"),M(t.parentElement)?S(t.parentElement)&&(t.parentElement=zo.getElementById(t.parentElement)):dl(this._option.mode)&&(t.parentElement=null==hl?void 0:hl.body)}}class HW extends tD{constructor(){super(...arguments),this.layoutZIndex=1,this.type=r.tooltip,this.name=r.tooltip,this.transformerConstructor=jW,this.specKey="tooltip",this.layoutType="none",this._alwaysShow=!1,this._eventList=[],this._isTooltipShown=!1,this._clickLock=!1,this._mountEvent=(t,e,i)=>{this.event.on(t,e,i),this._eventList.push({eventType:t,handler:i})},this._handleClickToLock=t=>{this._clickLock?(this._handleChartMouseOut(t),this._clickLock=!1):this._clickLock=!0},this._getMouseOutHandler=t=>e=>{var i,s,n;if(this._alwaysShow||this._clickLock)return;if(!this._isTooltipShown&&!(null===(s=null===(i=this.tooltipHandler)||void 0===i?void 0:i.isTooltipShown)||void 0===s?void 0:s.call(i)))return;const r=dl(null===(n=this._option)||void 0===n?void 0:n.mode),{clientX:a,clientY:o}=e.event;r&&this._isPointerOnTooltip(e)||r&&t&&this._isPointerInChart({x:a,y:o})||this._handleChartMouseOut(e)},this._handleChartMouseOut=t=>{this._alwaysShow||"none"!==this._spec.triggerOff&&(this._hideTooltipByHandler(Object.assign(Object.assign({},t),{tooltip:this})),this._cacheInfo=void 0,this._cacheParams=void 0,this._cacheActiveType=void 0)},this._getMouseMoveHandler=t=>e=>{if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),this._alwaysShow)return;if(this._isPointerOnTooltip(e))return;if(this._clickLock)return void(t&&(this._handleChartMouseOut(e),this._clickLock=!1));const i=this._getMouseEventData(e),{tooltipInfo:{dimension:s},ignore:{mark:n,dimension:r}}=i,a={mark:!1,dimension:!1,group:!1};for(let s=0,n=EW.length;s!t))&&!function(t){return D(t.mark)&&D(t.model)&&D(t.datum)}(e)&&(n&&FW(this._cacheInfo)?a.mark=this._showTooltipByMouseEvent("mark",i,e,t,!0):M(s)&&(a.dimension=this._showTooltipByMouseEvent("dimension",i,e,t))),a.mark||a.group||a.dimension&&!D(s)||this._handleChartMouseOut(e)},this._showTooltipByMouseEvent=(t,e,i,s,n)=>{var r;const a=this.processor[t];if(!a.shouldHandleTooltip(i,e.tooltipInfo[t]))return!1;let o;if(this._timer&&clearTimeout(this._timer),n)o=!a.showTooltip(this._cacheInfo,i,!0);else{const s=e.tooltipInfo[t],n=this._isSameAsCache(s,i,t);o=!a.showTooltip(s,i,n),o&&(this._cacheInfo=s,this._cacheParams=i,this._cacheActiveType=t)}o&&(this._isTooltipShown=!0,s&&this._spec.lockAfterClick&&!this._clickLock?this._clickLock=!0:Number.isFinite(this._spec.hideTimer)&&(this._timer=setTimeout((()=>{this._handleChartMouseOut()}),this._spec.hideTimer)));const l=null===(r=this._option)||void 0===r?void 0:r.globalInstance;return o&&fT.globalConfig.uniqueTooltip&&l&&fT.hideTooltip(l.id),o},this._getMouseEventData=t=>{const e={tooltipInfo:{},ignore:{}};return Object.keys(this.processor).forEach((i=>{const{tooltipInfo:s,ignore:n}=this.processor[i].getMouseEventData(t);e.tooltipInfo[i]=s,e.ignore[i]=n})),e},this._hideTooltipByHandler=t=>{var e,i,s;if(!this._isTooltipShown&&!(null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.isTooltipShown)||void 0===i?void 0:i.call(e)))return 0;this.event.emit(Hd.tooltipHide,Object.assign(Object.assign({},t),{source:zd.chart,tooltip:this})),Object.values(this.processor).forEach((t=>{t.clearCache()}));const n=null!==(s=this._spec.handler)&&void 0!==s?s:this.tooltipHandler;if(n.hideTooltip){const e=n.hideTooltip.call(n,t);return e||(this._isTooltipShown=!1),e}return 1}}isTooltipShown(){return this._isTooltipShown}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}_registerEvent(){}_releaseEvent(){}onLayout(t){}onLayoutEnd(t){}onRender(t){}created(){super.created(),this._regions=this._option.getAllRegions(),this._initEvent()}release(){var t,e;super.release(),this._timer&&clearTimeout(this._timer),this._eventList.forEach((({eventType:t,handler:e})=>{this.event.off(t,e)})),this._eventList=[],null===(e=null===(t=this.tooltipHandler)||void 0===t?void 0:t.release)||void 0===e||e.call(t),this._isTooltipShown=!1}beforeRelease(){this.event.emit(Hd.tooltipHide,{tooltip:this,chart:this.getChart()}),this.event.emit(Hd.tooltipRelease,{tooltip:this,chart:this.getChart()})}_initHandler(){var t,e,i;const s=null!==(t=this._spec.renderMode)&&void 0!==t?t:"html",n=this._option.globalInstance.getTooltipHandlerByUser();if(n)this.tooltipHandler=n;else{const t="canvas"===s?TW.canvas:TW.dom,n=$l.getComponentPluginInType(t);n||gl("Can not find tooltip handler: "+t);const r=new n;r.name=`${this._spec.className}-${null!==(e=this._option.globalInstance.id)&&void 0!==e?e:0}-${this.getSpecIndex()}`,null===(i=this.pluginService)||void 0===i||i.load([r]),this.tooltipHandler=r}}_initProcessor(){const t=this._spec.activeType;this.processor={},t.includes("dimension")&&(this.processor.dimension=new RW(this)),t.includes("group")&&(this.processor.group=new IW(this)),t.includes("mark")&&(this.processor.mark=new BW(this))}_initEvent(){var t;if(this._option.disableTriggerEvent)return;const e=Ba(null!==(t=this._spec.trigger)&&void 0!==t?t:"hover"),i=this._option.mode;e.includes("hover")&&(this._mountEvent("pointermove",{source:"chart"},this._getMouseMoveHandler(!1)),(cl(i)||ul(i))&&(this._mountEvent("pointerdown",{source:"chart"},this._getMouseMoveHandler(!1)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))),this._mountEvent("pointerout",{source:"canvas"},this._getMouseOutHandler(!1))),e.includes("click")?(this._mountEvent("pointertap",{source:"chart"},this._getMouseMoveHandler(!0)),this._mountEvent("pointerup",{source:"window"},this._getMouseOutHandler(!0))):this._spec.lockAfterClick&&this._mountEvent("pointertap",{source:"chart"},this._handleClickToLock)}reInit(t){var e,i;super.reInit(t),this.tooltipHandler?null===(i=(e=this.tooltipHandler).reInit)||void 0===i||i.call(e):this._initHandler()}showTooltip(t,e){var i;if(this.tooltipHandler||this._initHandler(),this.processor||this._initProcessor(),!(null===(i=this.tooltipHandler)||void 0===i?void 0:i.showTooltip))return!1;const s=function(t,e,i){var s,n,r;const a=Object.assign({regionIndex:0},e),o=i.getOption(),l=o.getRegionsInUserIdOrIndex(M(a.regionId)?[a.regionId]:void 0,M(a.regionIndex)?[a.regionIndex]:void 0)[0];if(!l)return"none";const h=((t,e)=>{const i=e.getSeries(),s=[];return i.forEach((e=>{var i,n,r,a,o,l,h;const d=e.getDimensionField(),c=e.getMeasureField(),u=e.getSeriesField(),p=M(u)?t[u]:void 0,g=M(u)&&null!==(a=null===(r=null===(n=null===(i=e.getViewDataStatistics)||void 0===i?void 0:i.call(e))||void 0===n?void 0:n.latestData[u])||void 0===r?void 0:r.values)&&void 0!==a?a:[],m=mW(d,t);let _=mW(c,t);const f=fW(_),v=!f&&M(u)&&D(p)&&g.length>0,y=()=>{var t;const i=null===(t=e.getViewData())||void 0===t?void 0:t.latestData.find(_W(d,m));if(!f&&(_=mW(c,i),!fW(_)))return;const n=e.type===_l.pie?e.dataToCentralPosition(i):e.dataToPosition(i);D(n)||isNaN(n.x)||isNaN(n.y)||s.push({pos:n,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},series:e})};if("cartesian"===e.coordinate){const t=e,i=td(null===(l=null===(o=e.getYAxisHelper())||void 0===o?void 0:o.getScale(0))||void 0===l?void 0:l.type)?"y":"x",n=d.map(((t,e)=>[t,e])).filter((([,t])=>D(null==m?void 0:m[t])));let r=[null!=m?m:[]];n.length>0&&n.forEach((([t,i])=>{var s,n,a,o;const l=null!==(o=null===(a=null===(n=null===(s=e.getViewDataStatistics)||void 0===s?void 0:s.call(e))||void 0===n?void 0:n.latestData[t])||void 0===a?void 0:a.values)&&void 0!==o?o:[],h=[];r.forEach((t=>{l.forEach((e=>{var s;const n=null!==(s=null==t?void 0:t.slice())&&void 0!==s?s:[];n[i]=e,h.push(n)}))})),r=h})),r.forEach((n=>{var r,a;if(v){const a=null===(r=t.getViewData())||void 0===r?void 0:r.latestData.filter(_W(d,n));g.forEach((r=>{const o=a.find((t=>t[u]===r));if(_=mW(c,o),!fW(_))return;const l=t.dataToPosition(o);D(l)||isNaN(l.x)||isNaN(l.y)||s.push({pos:l,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:r},series:e,dimType:i})}))}else{const r=null===(a=t.getViewData())||void 0===a?void 0:a.latestData.find(_W(d,n));if(!f&&(_=mW(c,r),!fW(_)))return;const o=t.dataToPosition(r);if(D(o)||isNaN(o.x)||isNaN(o.y))return;s.push({pos:o,data:{dimensionFields:d,dimensionData:n,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:p},dimType:i,series:e})}}))}else if("polar"===e.coordinate)if(e.type===_l.pie)y();else{const t=e;if(v){const i=(null===(h=t.getViewData())||void 0===h?void 0:h.latestData.filter(_W(d,m))).find((t=>t[u]===p));g.forEach((n=>{if(_=mW(c,i),!fW(_))return;const r=t.dataToPosition(i);D(r)||isNaN(r.x)||isNaN(r.y)||s.push({pos:r,data:{dimensionFields:d,dimensionData:m,measureFields:c,measureData:_,hasMeasureData:f,groupField:u,groupData:n},series:e})}))}else y()}else"geo"===e.coordinate&&y()})),s})(t,l),d=null!==(s=a.activeType)&&void 0!==s?s:h.length>1?"dimension":"mark",c=l.getLayoutStartPoint(),u=l.getLayoutRect(),p=o.globalInstance.getContainer(),g=Object.assign({x:0,y:0},p?function(t){const{x:e,y:i}=t.getBoundingClientRect();return{x:e,y:i}}(p):{}),m=t=>{var e;const{dimensionFields:i,dimensionData:s,measureFields:n,measureData:r,groupField:a,groupData:o}=t.data,l=null===(e=t.series.getViewData())||void 0===e?void 0:e.latestData.find((t=>_W(i,s)(t)&&_W(n,r)(t)&&(D(a)||_W([a],[o])(t))));return l},_=t=>{var e,i;const s=(t=>({x:Math.min(Math.max(t.x,0),u.width),y:Math.min(Math.max(t.y,0),u.height)}))(t),n=null!==(e=a.x)&&void 0!==e?e:c.x+s.x,r=null!==(i=a.y)&&void 0!==i?i:c.y+s.y;return{canvasX:n,canvasY:r,clientX:g.x+n,clientY:g.y+r}};if("dimension"===d){const e=h[0];if(!e)return"none";const s=new Map;h.forEach((t=>{var e;s.has(t.series)||s.set(t.series,[]),null===(e=s.get(t.series))||void 0===e||e.push(t)}));const r=[{value:t[e.data.dimensionFields[0]],data:[...s.keys()].map((t=>{var e,i;return{series:t,datum:null!==(i=null===(e=s.get(t))||void 0===e?void 0:e.map((t=>m(t))))&&void 0!==i?i:[]}}))}];M(e.dimType)&&(r[0].position=e.pos[e.dimType],r[0].dimType=e.dimType);const a={changePositionOnly:!1,action:"enter",tooltip:null,dimensionInfo:r,chart:null!==(n=o.globalInstance.getChart())&&void 0!==n?n:void 0,datum:void 0,model:void 0,source:zd.chart,event:_({x:h.reduce(((t,e)=>t+e.pos.x),0)/h.length,y:h.reduce(((t,e)=>t+e.pos.y),0)/h.length}),item:void 0,itemMap:new Map};i.processor.dimension.showTooltip(r,a,!1);const l=o.globalInstance;return fT.globalConfig.uniqueTooltip&&fT.hideTooltip(l.id),d}if("mark"===d){const e=h[0];if(!e)return"none";const s=Object.assign(Object.assign({},m(e)),t),n=[{datum:[s],series:e.series}],a={changePositionOnly:!1,tooltip:null,dimensionInfo:[{value:s[e.data.dimensionFields[0]],data:n}],chart:null!==(r=o.globalInstance.getChart())&&void 0!==r?r:void 0,datum:s,model:e.series,source:zd.chart,event:_(e.pos),item:void 0,itemMap:new Map};i.processor.mark.showTooltip({datum:s,mark:null,series:e.series},a,!1);const l=o.globalInstance;return fT.globalConfig.uniqueTooltip&&fT.hideTooltip(l.id),d}return"none"}(t,e,this);return"none"!==s&&(this._alwaysShow=!!(null==e?void 0:e.alwaysShow)),s}hideTooltip(){const t={changePositionOnly:!1,tooltip:this,item:void 0,datum:void 0,source:zd.chart};return this._alwaysShow=!1,!this._hideTooltipByHandler(t)}_isSameAsCache(t,e,i){if(i!==this._cacheActiveType)return!1;if(t===this._cacheInfo)return!0;if(D(this._cacheInfo)||D(t))return!1;if(YW(t)){if(FW(this._cacheInfo))return!1;const e=this._cacheInfo;if(e.length!==t.length||!t.every(((t,i)=>ed(t,e[i]))))return!1}else{if(YW(this._cacheInfo))return!1;const e=this._cacheInfo;if((null==t?void 0:t.datum)!==e.datum||(null==t?void 0:t.mark)!==e.mark||(null==t?void 0:t.series)!==e.series)return!1}const s=this._cacheParams;return!D(s)&&!D(e)&&s.mark===e.mark&&s.model===e.model&&s.datum===e.datum}_isPointerInChart(t){var e;const i=null===(e=this._option)||void 0===e?void 0:e.globalInstance;if(!i)return!1;if(!i.getChart())return!1;const{x:s,y:n}=t,r=i.getCanvas(),{x:a,y:o,width:l,height:h}=r.getBoundingClientRect();return s>=a&&s<=a+l&&n>=o&&n<=o+h}_isPointerOnTooltip(t){var e,i;if(this._spec.enterable&&"html"===this._spec.renderMode){const{event:s}=t;let n;if(M(s.nativeEvent)){const t=s.nativeEvent;n=t.relatedTarget,t.composedPath&&t.composedPath().length>0&&(n=t.composedPath()[0])}else n=s.relatedTarget;const r=null===(i=null===(e=this.tooltipHandler)||void 0===e?void 0:e.getTooltipContainer)||void 0===i?void 0:i.call(e);if(M(r)&&M(n)&&Qr(n,r))return!0}return!1}getVisible(){return!1!==this._spec.visible}}HW.type=r.tooltip,HW.transformerConstructor=jW,HW.specKey="tooltip";class zW extends Rk{constructor(){super(...arguments),this.name="crosshair"}render(){this.renderCrosshair(this)}}u_(),hM();class NW extends zW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},NW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-line",Object.assign({points:[e,i]},s),"line")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}NW.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},u_(),_y();class VW extends zW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},VW.defaultAttributes,t))}renderCrosshair(t){const{start:e,end:i,rectStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-rect",Object.assign({x:e.x,y:e.y,width:i.x-e.x,height:i.y-e.y},s),"rect")}setLocation(t){const{start:e,end:i}=t;this.setAttributes({start:e,end:i})}}var WW;VW.defaultAttributes={rectStyle:{fill:"#b2bacf",opacity:.2}},function(t){t[t.ALL=3]="ALL",t[t.HORIZONTAL=2]="HORIZONTAL",t[t.VERTICAL=1]="VERTICAL"}(WW||(WW={}));var GW=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if(!this._option)return;const{x:e,y:i}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(e,i);const s=this._getNeedClearVRenderComponents();this._hasActive=s.some((t=>t&&!1!==t.attribute.visible))},this._handleClickInEvent=t=>{if(!this._hasActive||!this._spec.lockAfterClick||this._clickLock)return this._clickLock?(this._clickLock=!1,void this._handleOutEvent()):void(this._onlyLockClick||(this._handleIn(t),h(this.triggerOff)&&(this._timer&&clearTimeout(this._timer),this._timer=setTimeout((()=>{this._handleOutEvent()}),this.triggerOff))));this._clickLock=!0},this._handleHoverInEvent=Kd((t=>{this._clickLock||this._handleIn(t)}),10),this._handleOutEvent=()=>{this.enableRemain||this._clickLock||!this._hasActive||(this.clearOutEvent(),this.hide())},this._handleTooltipShow=t=>{const e=t.tooltipData;if(t.isEmptyTooltip||!e||!e.length)return void this._handleTooltipHideOrRelease();if(vs(this._spec.followTooltip)&&!1===this._spec.followTooltip[t.activeType])return void this._handleTooltipHideOrRelease();const{x:i,y:s}=this.calculateTriggerPoint(t);this.showDefault=!1,this._layoutCrosshair(i,s,e,t.activeType);const n=this._getNeedClearVRenderComponents();this._hasActive=n.some((t=>t&&!1!==t.attribute.visible))},this._handleTooltipHideOrRelease=()=>{this.clearOutEvent(),this.hide()},this.enable=!0,this.showDefault=!0}_getLimitBounds(){var t,e;if(!this._limitBounds){const{width:i,height:s}=null!==(e=null===(t=this._option.globalInstance.getChart())||void 0===t?void 0:t.getViewRect())&&void 0!==e?e:{width:0,height:0};this._limitBounds={x1:0,y1:0,x2:i,y2:s}}return this._limitBounds}_showDefaultCrosshair(){this.showDefault&&this._showDefaultCrosshairBySpec()}setAttrFromSpec(){super.setAttrFromSpec(),this._parseCrosshairSpec()}created(){super.created(),this._initEvent()}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Im(e,t)||(i.reRender=!0,i.reMake=!0),i}_initEvent(){if(!this._option.disableTriggerEvent)if(this._spec.followTooltip)this._registerTooltipEvent();else{const t=this._getTriggerEvent();t&&t.forEach((t=>{this._registerEvent(t.in,!1,t.click),t.out&&this._registerEvent(t.out,!0)}))}}_registerEvent(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent,n=e?{level:Nd.chart}:{source:zd.chart};y(t)?t.forEach((t=>{this.event.on(t,n,s)})):this.event.on(t,n,s)}_eventOff(t,e,i){const s=e?this._handleOutEvent:i?this._handleClickInEvent:this._handleHoverInEvent;y(t)?t.forEach((t=>{this.event.off(t,s)})):this.event.off(t,s)}updateLayoutAttribute(){this._limitBounds=null,this._showDefaultCrosshair()}calculateTriggerPoint(t){const{event:e}=t,i=this._option.getCompiler().getStage().getLayer(void 0),s={x:e.viewX,y:e.viewY};return i.globalTransMatrix.transformPoint({x:e.viewX,y:e.viewY},s),{x:s.x-this.getLayoutStartPoint().x,y:s.y-this.getLayoutStartPoint().y}}_getTriggerEvent(){const{mode:t=n["desktop-browser"]}=this._option,e=function(t){return t===n["desktop-browser"]||t===n["desktop-miniApp"]?{click:"pointertap",hover:"pointermove",hoverOut:"pointerleave",clickOut:"pointerleave"}:cl(t)||ul(t)?{click:"tap",hover:["pointerdown","pointermove"],hoverOut:"pointerleave",clickOut:"pointerleave"}:null}(t);if(e){const t=Ba(this.trigger||"hover"),i=t=>"click"===t?"none"===this.triggerOff?null:e.clickOut:e.hoverOut;this._spec.lockAfterClick&&!t.includes("click")?(t.push("click"),this._onlyLockClick=!0):this._onlyLockClick=!1;const s=[];return t.forEach((t=>{s.push({click:"click"===t,in:e[t],out:i(t)})})),s}return null}_registerTooltipEvent(){this.event.on(Hd.tooltipHide,{source:zd.chart},this._handleTooltipHideOrRelease),this.event.on(Hd.tooltipShow,{source:zd.chart},this._handleTooltipShow),this.event.on(Hd.tooltipRelease,{source:zd.chart},this._handleTooltipHideOrRelease)}_getAxisInfoByField(t){var e,i;const s=null===(i=(e=this._option).getComponentsByKey)||void 0===i?void 0:i.call(e,"axes");if(!(null==s?void 0:s.length))return null;let n=Ud(this._spec,`${t}Field.bindingAxesIndex`);if(n||(n=[],s.forEach(((e,i)=>{UW[t].includes(e.getOrient())&&n.push(i)}))),!n.length)return null;const r=new Map;let a=1/0,o=1/0,l=-1/0,h=-1/0;const{x:d,y:c}=this.getLayoutStartPoint();return n.forEach((t=>{a=1/0,o=1/0,l=-1/0,h=-1/0;const e=s.find((e=>e.getSpecIndex()===t));e&&(e.getRegions().forEach((t=>{const{x:e,y:i}=t.getLayoutStartPoint();a=Math.min(a,e-d),o=Math.min(o,i-c),l=Math.max(l,e+t.getLayoutRect().width-d),h=Math.max(h,i+t.getLayoutRect().height-c)})),r.set(t,{x1:a,y1:o,x2:l,y2:h,axis:e}))})),r}changeRegions(t){}onLayoutEnd(t){const e=this._regions[0];this.setLayoutRect(e.getLayoutRect()),this.setLayoutStartPosition(e.getLayoutStartPoint()),super.onLayoutEnd(t)}onRender(t){}_releaseEvent(){this.clearOutEvent();const t=this._getTriggerEvent();t&&t.forEach((t=>{this._eventOff(t.in,!1,t.click),t.out&&this._eventOff(t.out,!0)}))}_parseCrosshairSpec(){this._parseFieldInfo();const{trigger:t,triggerOff:e,labelZIndex:i,gridZIndex:s}=this._spec;t&&(this.trigger=t),("none"===e||h(e)&&e>0)&&(this.triggerOff=e),void 0!==i&&(this.labelZIndex=i),void 0!==s&&(this.gridZIndex=s)}_parseField(t,e){var i,s,n;const r={},{line:a={},label:o={},visible:l}=t;if(r.visible=l,r.type=a.type||"line",!1===a.visible)r.style={visible:!1};else{const t=a.style||{},{stroke:o,fill:l,lineWidth:d}=t,c=t,{strokeOpacity:u,fillOpacity:p,opacity:g}=c,m=GW(c,["strokeOpacity","fillOpacity","opacity"]),_="line"===r.type;let f=_?u:p;if(h(g)&&(f=(null!=f?f:1)*g),r.style=Object.assign({opacity:f,pickable:!1,visible:!0},m),_)r.style.stroke=o||l,r.style.lineWidth=Ud(a,"width",d||2);else{r.style.fill=l||o,(null===(n=null===(s=null===(i=this._spec[e])||void 0===i?void 0:i.line)||void 0===s?void 0:s.style)||void 0===n?void 0:n.stroke)&&(r.style.stroke=this._spec[e].line.style.stroke);const t=Ud(a,"width");if("string"==typeof t){const e=parseInt(t.substring(0,t.length-1),10)/100;r.style.sizePercent=e}else"number"!=typeof t&&"function"!=typeof t||(r.style.size=t)}}if(o.visible){const t=o.labelBackground||{},e=o.style||{},i=t.style||{},{fill:s="rgba(47, 59, 82, 0.9)",stroke:n,outerBorder:a}=i,l=GW(i,["fill","stroke","outerBorder"]);r.label={visible:!0,formatMethod:o.formatMethod,formatter:o.formatter,minWidth:t.minWidth,maxWidth:t.maxWidth,padding:t.padding,textStyle:Object.assign(Object.assign({fontSize:14,pickable:!1},e),{fill:e.fill||"#fff",stroke:Ud(e,"stroke")}),panel:(v(t.visible)?t.visible:t)?Object.assign({visible:!0,pickable:!1,fill:s,stroke:n,outerBorder:Object.assign({stroke:s,distance:0,lineWidth:3},a)},l):{visible:!1},zIndex:this.labelZIndex,childrenPickable:!1,pickable:!1}}else r.label={visible:!1};return r}_filterAxisByPoint(t,e,i){return t&&t.forEach((s=>{const n=s.axis;if(function(t,e,i){return t.x1>e||t.x2i||t.y2a||o{const d=1&t,c=2&t;i||(i={x:0,y:0});let u=null,p=null,g=0,m=0;if(s.size){const t=Array.from(s.values())[0];g=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().x-i.x,u=t.axis}if(n.size){const t=Array.from(n.values())[0];m=t.axis.getScale().scale(t.value)+t.axis.getLayoutStartPoint().y-i.y,p=t.axis}const _=!!s.size&&Number.isFinite(g),f=!!n.size&&Number.isFinite(m),v=o&&!_&&M(l),y=o&&!f&&M(h);let b,x,S;d&&(b=v?l:{height:0,leftPos:0,rightPos:0,topPos:0,x:0,bottom:{visible:!1,text:"",dx:0,dy:0},top:{visible:!1,text:"",dx:0,dy:0},visible:_,axis:u}),c&&(x=y?h:{width:0,leftPos:0,topPos:0,bottomPos:0,y:0,left:{visible:!1,text:"",dx:0,dy:0},right:{visible:!1,text:"",dx:0,dy:0},visible:f,axis:p});let k,A=0,w=0;if(r&&s.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const a=t.getScale();if(td(a.type))S=a.bandwidth(),0===S&&a.step&&(A=a.step());else if(Jh(a.type)){const s=e.fieldX[0],r=e.fieldX2,a=ZE(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionX(a);r?(S=Math.abs(t-e.dataToPositionX1(a)),i=`${a[s]} ~ ${a[r]}`):S=1,g=t}n=t.niceLabelFormatter}if(b&&(null===(s=r.label)||void 0===s?void 0:s.visible)&&!v){const e=zE(t.getSpec());"bottom"===t.getOrient()?(b.bottom.visible=!0,b.bottom.defaultFormatter=n,b.bottom.text=i,b.bottom.dx=0,b.bottom.dy=e):"top"===t.getOrient()&&(b.top.visible=!0,b.top.defaultFormatter=n,b.top.text=i,b.top.dx=0,b.top.dy=-e)}})),a&&n.forEach((({axis:t,value:i})=>{var s;i=null!=i?i:"";let n=null;const r=t.getScale();if(td(r.type))k=r.bandwidth(),0===k&&r.step&&(w=r.step());else if(Jh(r.type)){const s=e.fieldY[0],r=e.fieldY2,a=ZE(e.getViewData().latestData,+i,s,r);if(a){const t=e.dataToPositionY(a);r?(k=Math.abs(t-e.dataToPositionY1(a)),i=`${a[s]} ~ ${a[r]}`):k=1,m=t}n=t.niceLabelFormatter}if(x&&(null===(s=a.label)||void 0===s?void 0:s.visible)&&!y){const e=zE(t.getSpec());"left"===t.getOrient()?(x.left.visible=!0,x.left.defaultFormatter=n,x.left.text=i,x.left.dx=-e,x.left.dy=0):"right"===t.getOrient()&&(x.right.visible=!0,x.right.defaultFormatter=n,x.right.text=i,x.right.dx=e,x.right.dy=0)}})),b&&!v){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if(qW(t,s),b.leftPos=t.x1,b.rightPos=t.x2,b.topPos=t.y1,b.height=t.y2-t.y1,b.x=g+i.x,r&&r.label){const{top:t,bottom:e}=b;t.visible&&KW(t,"top",r.label),e.visible&&KW(e,"bottom",r.label)}}if(x&&!y){const t={x1:1/0,y1:1/0,x2:-1/0,y2:-1/0};if(qW(t,n),x.leftPos=t.x1,x.topPos=t.y1,x.bottomPos=t.y2,x.width=t.x2-t.x1,x.y=m+i.y,a&&a.label){const{left:t,right:e}=x;t.visible&&KW(t,"left",a.label),e.visible&&KW(e,"right",a.label)}}return{x:d&&b?b:void 0,y:c&&x?x:void 0,offsetWidth:A,offsetHeight:w,bandWidth:null!=S?S:0,bandHeight:null!=k?k:0}},KW=(t,e,i)=>{const{formatMethod:s,formatter:n}=i,{formatFunc:r,args:a}=YE(s,n,t.text,{label:t.text,position:e});r?t.text=r(...a):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))},qW=(t,e)=>{e.forEach((({axis:e})=>{e.getRegions().forEach((e=>{t.x1=Math.min(t.x1,e.getLayoutStartPoint().x),t.y1=Math.min(t.y1,e.getLayoutStartPoint().y),t.x2=Math.max(t.x2,e.getLayoutStartPoint().x+e.getLayoutRect().width),t.y2=Math.max(t.y2,e.getLayoutStartPoint().y+e.getLayoutRect().height)}))}))},ZW=(t,e,i,s)=>{const{x:n,topPos:r,height:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n+i/2,y:r},end:{x:n+i/2,y:r+a}};else if("rect"===o){const o=QW(t,i,e.axis),{leftPos:h,rightPos:d}=e;l={visible:!0,start:{x:Math.max(n-o/2-s/2,h),y:r},end:{x:Math.min(n+i+o/2+s/2,d),y:r+a}}}return l},JW=(t,e,i,s)=>{const{leftPos:n,width:r,y:a}=e,o=t.type;let l;if("line"===o)l={visible:!0,start:{x:n,y:a+i/2},end:{x:n+r,y:a+i/2}};else if("rect"===o){const o=QW(t,i,e.axis),{topPos:h,bottomPos:d}=e;l={visible:!0,start:{x:n,y:Math.max(a-o/2-s/2,h)},end:{x:n+r,y:Math.min(a+i+o/2+s/2,d)}}}return l},QW=(t,e,i)=>{var s,n,r;let a=0;if(null===(s=t.style)||void 0===s?void 0:s.sizePercent)a=(t.style.sizePercent-1)*e;else if("number"==typeof(null===(n=t.style)||void 0===n?void 0:n.size))a=t.style.size-e;else if("function"==typeof(null===(r=t.style)||void 0===r?void 0:r.size)){const s=i.getLayoutRect();a=t.style.size(s,i)-e}return a};class tG extends $W{static getSpecInfo(t){return jE(t,this.specKey,this.type,(t=>t.xField&&!1!==t.xField.visible||t.yField&&!1!==t.yField.visible))}constructor(t,e){super(t,e),this.type=r.cartesianCrosshair,this.name=r.cartesianCrosshair,this._currValueX=new Map,this._currValueY=new Map}_showDefaultCrosshairBySpec(){const{xField:t,yField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));s&&(1===i?(this._currValueX.clear(),this._currValueX.set(t,{axis:s,value:e})):(this._currValueY.clear(),this._currValueY.set(t,{axis:s,value:e})),this.layoutByValue(i))}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("x"),s=this._getAxisInfoByField("y");return{xAxisMap:this._filterAxisByPoint(i,t,e),yAxisMap:this._filterAxisByPoint(s,t,e)}}_getValueAt(t,e){return t.getScale().invert(e)}clearAxisValue(){this._currValueX.clear(),this._currValueY.clear()}setAxisValue(t,e){kd(e.getOrient())?this._currValueX.set(e.getSpecIndex(),{value:t,axis:e}):this._currValueY.set(e.getSpecIndex(),{value:t,axis:e})}_getAllAxisValues(t,e,i,s){let n=!1;return t.forEach((t=>{td(t.axis.getScale().type)&&(n?this.enable=!1:n=!0)})),!!this.enable&&(t.forEach(((t,n)=>{const r=t.axis;i.set(n,{value:this._getValueAt(r,e-(s?r.getLayoutStartPoint().x-this.getLayoutStartPoint().x:r.getLayoutStartPoint().y-this.getLayoutStartPoint().y)),axis:r})})),!0)}_layoutCrosshair(t,e,i,s){var n;let r=t,a=e;if(i&&i.length)if("dimension"===s){const t=i[0],e=t.data.findIndex((t=>t.datum.length>0));let s;if(e>-1){const i=t.data[e];s=i.series.dataToPosition(i.datum[0])}(M(t.dimType)?"y"===t.dimType:Ad(null===(n=null==t?void 0:t.axis)||void 0===n?void 0:n.getOrient()))?a=null==s?void 0:s.y:r=null==s?void 0:s.x}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);r=null==e?void 0:e.x,a=null==e?void 0:e.y}const{xAxisMap:o,yAxisMap:l}=this._findAllAxisContains(r,a);if(o&&0===o.size||l&&0===l.size){if(this.enableRemain)return;this.hide()}else this._currValueX.clear(),this._currValueY.clear(),o&&o.size&&this._getAllAxisValues(o,r,this._currValueX,!0),l&&l.size&&this._getAllAxisValues(l,a,this._currValueY,!1),this.layoutByValue(3)}hide(){this._xCrosshair&&this._xCrosshair.hideAll(),this._xTopLabel&&this._xTopLabel.hideAll(),this._xBottomLabel&&this._xBottomLabel.hideAll(),this._yCrosshair&&this._yCrosshair.hideAll(),this._yLeftLabel&&this._yLeftLabel.hideAll(),this._yRightLabel&&this._yRightLabel.hideAll()}layoutByValue(t=3){if(!this.enable)return;const e=fE(this._regions,"cartesian");if(!e)return;const{x:i,y:s,offsetWidth:n,offsetHeight:r,bandWidth:a,bandHeight:o}=XW(t,e,this.getLayoutStartPoint(),this._currValueX,this._currValueY,this._xHair,this._yHair,this.enableRemain,this._cacheXCrossHairInfo,this._cacheYCrossHairInfo);this.enableRemain&&(i&&(this._cacheXCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0})),s&&(this._cacheYCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0}))),i&&this._layoutVertical(i,a,n),s&&this._layoutHorizontal(s,o,r)}_layoutVertical(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._xHair)return;const{x:r,topPos:a,height:o,top:l,bottom:h,visible:d}=t;if(d){const d=this._xHair.type,c=ZW(this._xHair,t,e,i);if(this._updateCrosshair("x",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a},l),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._xHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"center",textBaseline:"bottom"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xTopLabel,t,(t=>{t.name="crosshair-x-top-label",this._xTopLabel=t}))}else this._xTopLabel&&this._xTopLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+e/2,y:a+o},h),this._xHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._xHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"center",textBaseline:"top"}),zIndex:this.labelZIndex,visible:!0});this._updateCrosshairLabel(this._xBottomLabel,t,(t=>{t.name="crosshair-x-bottom-label",this._xBottomLabel=t}))}else this._xBottomLabel&&this._xBottomLabel.hideAll()}}_layoutHorizontal(t,e,i){var s,n;if(t._isCache&&this.enableRemain||!this._yHair)return;const{leftPos:r,width:a,y:o,left:l,right:h,visible:d}=t;if(d){const d=this._yHair.type,c=JW(this._yHair,t,e,i);if(this._updateCrosshair("y",d,c),l.visible){const t=Object.assign(Object.assign(Object.assign({x:r,y:o+e/2},l),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(s=this._yHair.label)||void 0===s?void 0:s.textStyle),{textAlign:"right",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yLeftLabel,t,(t=>{t.name="crosshair-y-left-label",this._yLeftLabel=t}))}else this._yLeftLabel&&this._yLeftLabel.hideAll();if(h.visible){const t=Object.assign(Object.assign(Object.assign({x:r+a,y:o+e},h),this._yHair.label),{textStyle:Object.assign(Object.assign({},null===(n=this._yHair.label)||void 0===n?void 0:n.textStyle),{textAlign:"left",textBaseline:"middle"}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._yRightLabel,t,(t=>{t.name="crosshair-y-right-label",this._yRightLabel=t}))}else this._yRightLabel&&this._yRightLabel.hideAll()}}_parseFieldInfo(){const{xField:t,yField:e}=this._spec;this._parseAndSetCrosshair(t,"x"),this._parseAndSetCrosshair(e,"y")}_parseAndSetCrosshair(t,e){const i=`_${e}Hair`,s=`_${e}Crosshair`;if(t&&t.visible){if(this[i]=this._parseField(t,`${e}Field`),this[s]){const{style:t,type:e}=this[i],n="rect"===e?"rectStyle":"lineStyle";this[s].setAttributes({[n]:t})}}else this[s]&&this[s].parent&&this[s].parent.removeChild(this[s])}_updateCrosshair(t,e,i){const s=this.getContainer();let n;if(n="x"===t?this._xCrosshair:this._yCrosshair,n)n.setAttributes(i);else{const r="x"===t?this._xHair.style:this._yHair.style;"line"===e?n=new NW(Object.assign(Object.assign({},i),{lineStyle:r,zIndex:this.gridZIndex+1,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1})):"rect"===e&&(n=new VW(Object.assign(Object.assign({},i),{rectStyle:r,zIndex:this.gridZIndex,disableTriggerEvent:this._option.disableTriggerEvent,pickable:!1}))),null==s||s.add(n),"x"===t?this._xCrosshair=n:this._yCrosshair=n}}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(i(t=new TD(e)),null==s||s.add(t)),qE(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._xCrosshair,this._xTopLabel,this._xBottomLabel,this._yCrosshair,this._yLeftLabel,this._yRightLabel]}}tG.specKey="crosshair",tG.type=r.cartesianCrosshair,u_(),Wx();class eG extends zW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},eG.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,innerRadius:s=0,sectorStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute;return t.createOrUpdateChild("crosshair-sector",Object.assign(Object.assign(Object.assign({},e),{outerRadius:i,innerRadius:s,startAngle:r,endAngle:a}),n),"arc")}setLocation(t){const{center:e,startAngle:i=Uk,endAngle:s=$k}=this.attribute,n=s-i,r=wt(Ct(e,t));this.setAttributes({startAngle:r-n/2,endAngle:r+n/2})}}eG.defaultAttributes={sectorStyle:{fill:"#b2bacf",opacity:.2}},u_(),wM();class iG extends zW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},iG.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,sides:s=6,lineStyle:n}=this.attribute,{startAngle:r,endAngle:a}=this.attribute,o=(a-r)%(2*Math.PI)==0,l=(a-r)/s;let h;for(let t=0;t<=s;t++){const n=Tt(e,i,r+l*t);0===t?h=`M${n.x},${n.y}`:h+=`L${n.x},${n.y}`,t===s&&o&&(h+="Z")}return t.createOrUpdateChild("crosshair-polygon",Object.assign({path:h},n),"path")}setLocation(t){const{center:e}=this.attribute,i=be.distancePP(t,e);this.setAttribute("radius",i)}}iG.defaultAttributes={lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},u_(),Wx();class sG extends zW{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},sG.defaultAttributes,t))}renderCrosshair(t){const{center:e,radius:i,lineStyle:s}=this.attribute;return t.createOrUpdateChild("crosshair-circle",Object.assign(Object.assign(Object.assign(Object.assign({},e),{outerRadius:i}),this.attribute),s),"arc")}setLocation(t){const{center:e}=this.attribute,i=be.distancePP(t,e);this.setAttribute("radius",i)}}sG.defaultAttributes={lineStyle:{stroke:["#b2bacf",!1,!1,!1],lineWidth:1,lineDash:[2]}};var nG=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nt.categoryField&&!1!==t.categoryField.visible||t.valueField&&!1!==t.valueField.visible))}constructor(t,e){super(t,e),this.type=r.polarCrosshair,this.name=r.polarCrosshair,this._currValueAngle=new Map,this._currValueRadius=new Map}_showDefaultCrosshairBySpec(){const{categoryField:t,valueField:e}=this._spec;if((null==t?void 0:t.visible)&&t.defaultSelect){const{axisIndex:e,datum:i}=t.defaultSelect;this._defaultCrosshair(e,i,1)}if((null==e?void 0:e.visible)&&e.defaultSelect){const{axisIndex:t,datum:i}=e.defaultSelect;this._defaultCrosshair(t,i,2)}}_defaultCrosshair(t,e,i){const s=this._option.getComponentsByKey("axes").find((e=>e.getSpecIndex()===t));if(s){if(1===i){this._currValueAngle.clear();const i={angle:s.valueToPosition(e),radius:s.getOuterRadius()},n=s.coordToPoint(i);this._currValueAngle.set(t,this._getValueByAxis(s,n))}else{this._currValueRadius.clear();const i={angle:s.startAngle,radius:s.valueToPosition(e)},n=s.coordToPoint(i);this._currValueRadius.set(t,this._getValueByAxis(s,n))}this.layoutByValue(3)}}hide(){this._radiusCrosshair&&this._radiusCrosshair.hideAll(),this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll(),this._angleCrosshair&&this._angleCrosshair.hideAll(),this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}_findAllAxisContains(t,e){const i=this._getAxisInfoByField("category"),s=this._getAxisInfoByField("value");return{angleAxisMap:this._filterAxisByPoint(i,t,e),radiusAxisMap:this._filterAxisByPoint(s,t,e)}}_getAllAxisValues(t,e,i){let s=!1;return t.forEach((t=>{td(t.axis.getScale().type)&&(s?this.enable=!1:s=!0)})),!!this.enable&&(t.forEach(((t,s)=>{const n=t.axis;i.set(s,this._getValueByAxis(n,e))})),!0)}_getValueByAxis(t,e){const{x:i,y:s}=t.getLayoutStartPoint(),{x:n,y:r}=this.getLayoutStartPoint(),a=t.positionToData({x:e.x-(i-n),y:e.y-(s-r)}),o={x:t.getCenter().x+this.getLayoutStartPoint().x,y:t.getCenter().y+this.getLayoutStartPoint().y};return{value:a,axis:t,center:o,innerRadius:t.getInnerRadius(),radius:t.getOuterRadius(),startAngle:t.startAngle,endAngle:t.endAngle,distance:be.distancePP(e,t.getCenter()),coord:t.pointToCoord(e),point:e}}_layoutCrosshair(t,e,i,s){let n=t,r=e;if(i&&i.length)if("dimension"===s){const t=i[0];if(t.axis){const e=t.axis.pointToCoord({x:n,y:r}),i="radius"===t.axis.getOrient()?{radius:t.position,angle:e.angle}:{radius:e.radius,angle:t.position},s=t.axis.coordToPoint(i);n=s.x,r=s.y}}else if("mark"===s){const t=i[0],e=t.series.dataToPosition(t.datum[0]);n=e.x,r=e.y}const{angleAxisMap:a,radiusAxisMap:o}=this._findAllAxisContains(n,r);if(0!==a.size||0!==o.size)this._currValueAngle.clear(),this._currValueRadius.clear(),a&&this._getAllAxisValues(a,{x:n,y:r},this._currValueAngle),o&&this._getAllAxisValues(o,{x:n,y:r},this._currValueRadius),this.layoutByValue(3);else{if(this.enableRemain)return;this.hide()}}layoutByValue(t=3){if(!this.enable)return;const e=fE(this._regions,"polar");if(!e)return;const{angle:i,radius:s}=((t,e,i,s,n,r=!1,a,o)=>{let l={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,label:{visible:!1,text:"",offset:0}},h={x:0,y:0,center:{x:0,y:0},radius:0,distance:0,startAngle:0,endAngle:0,innerRadius:0,visible:!1,sides:t.angleAxisHelper.getScale(0).domain().length,label:{visible:!1,text:"",offset:0}};if(s){l.visible=!!e.size;const i=t.angleAxisHelper.getBandwidth(0);e.forEach((e=>{var n,{axis:r,value:a,coord:o}=e,h=nG(e,["axis","value","coord"]);a=null!=a?a:"",Tl(l,h);const d=t.angleAxisHelper.dataToPosition([a]);l.angle=d;const c=r.niceLabelFormatter;(null===(n=s.label)||void 0===n?void 0:n.visible)&&(l.label.visible=!0,l.label.defaultFormatter=c,l.label.text=a,l.label.offset=zE(r.getSpec())),l.startAngle=d-i/2,l.endAngle=d+i/2}))}if(n&&(h.visible=!!i.size,i.forEach((t=>{var e,{axis:i,value:s,coord:r}=t,a=nG(t,["axis","value","coord"]);s=null!=s?s:"";const o=i.niceLabelFormatter;(null===(e=n.label)||void 0===e?void 0:e.visible)&&(h.label.visible=!0,h.label.defaultFormatter=o,h.label.text=s,h.label.offset=zE(i.getSpec())),h.angle=r.angle,h.axis=i,Tl(h,a)}))),r&&!l.visible&&M(a))l=a;else if(l.label.visible&&s&&s.label){const{label:t}=l,{formatMethod:e,formatter:i}=s.label,{formatFunc:n,args:r}=YE(e,i,t.text,{label:t.text,orient:"angle"});n?t.text=n(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}if(r&&!h.visible&&M(o))h=o;else if(h.label.visible&&n&&n.label){const{label:t}=h,{formatMethod:e,formatter:i}=n.label,{formatFunc:s,args:r}=YE(e,i,t.text,{label:t.text,orient:"radius"});s?t.text=s(...r):t.defaultFormatter&&(t.text=t.defaultFormatter(t.text))}return{angle:l,radius:h}})(e,this._currValueAngle,this._currValueRadius,this._angleHair,this._radiusHair,this.enableRemain,this._cacheAngleCrossHairInfo,this._cacheRadiusCrossHairInfo);this.enableRemain&&(this._cacheAngleCrossHairInfo=Object.assign(Object.assign({},i),{_isCache:!0}),this._cacheRadiusCrossHairInfo=Object.assign(Object.assign({},s),{_isCache:!0})),t&&(this._layoutRadius(s),this._layoutAngle(i))}_layoutAngle(t){var e;if(t._isCache&&this.enableRemain)return;const i=this.getContainer(),{angle:s,radius:n,label:r,center:a,visible:o}=t;if(o){const o="rect"===this._angleHair.type?"sector":"line",l=((t,e)=>{const{angle:i,innerRadius:s,radius:n,startAngle:r,endAngle:a,center:o}=e;let l;return l="sector"==("rect"===t.type?"sector":"line")?{center:o,innerRadius:s,radius:n,startAngle:r,endAngle:a}:{start:Tt(o,s,i),end:Tt(o,n,i)},l})(this._angleHair,t);if(this._angleCrosshair)this._angleCrosshair.setAttributes(l);else{let t;"line"===o?t=new NW(Object.assign(Object.assign({},l),{lineStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1})):"sector"===o&&(t=new eG(Object.assign(Object.assign({},l),{sectorStyle:this._angleHair.style,zIndex:this.gridZIndex,pickable:!1}))),this._angleCrosshair=t,i.add(t)}if(r.visible){const t=function(t){let e="center",i="middle";return e=(t=Et(t))>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"left":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"right":"center",i=t>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"bottom":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"top":"middle",{align:e,baseline:i}}(s),i=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(a,n+r.offset,s)),this._angleHair.label),r),{textStyle:Object.assign(Object.assign({},null===(e=this._angleHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._angleLabelCrosshair,i,(t=>{t.name="crosshair-angle-label",this._angleLabelCrosshair=t}))}else this._angleLabelCrosshair&&this._angleLabelCrosshair.hideAll()}}_layoutRadius(t){var e;if(t._isCache&&this.enableRemain)return;const{center:i,startAngle:s,label:n,visible:r}=t,a=this.getContainer();if(r){const r=this._radiusHair.smooth?"circle":"polygon",o=((t,e)=>{const{center:i,startAngle:s,endAngle:n,distance:r,sides:a,axis:o,point:l,radius:h,innerRadius:d}=e;let c=r;if("polygon"==(t.smooth?"circle":"polygon")){const t=o.getCenter(),e=Ct(t,l),i=(n-s)/a,u=Math.floor((e-s)/i),p=u*i+s,g=Math.min((u+1)*i+s,n),m=Tt(t,r,p),_=Tt(t,r,g),f=function(t,e,i,s){if(!Bt(t,e,i,s))return!1;const n=[0,0],r=[0,0],a=[0,0];if(It(n,e,t),It(r,s,i),ht((o=n)[0]-(l=r)[0])+ht(o[1]-l[1])<1e-12)return!0;var o,l;It(a,i,t);const h=yt(a,r)/yt(n,r);return h>=0&&h<=1&&[t[0]+n[0]*h,t[1]+n[1]*h]}([_.x,_.y],[m.x,m.y],[t.x,t.y],[l.x,l.y]);f&&(c=Ps(be.distancePN(l,f[0],f[1])+r,d,h))}return{center:i,startAngle:s,endAngle:n,radius:c,sides:a}})(this._radiusHair,t),l=o.radius;if(this._radiusCrosshair)this._radiusCrosshair.setAttributes(o);else{let t;t="polygon"===r?new iG(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex+1})):new sG(Object.assign(Object.assign({},o),{lineStyle:this._radiusHair.style,zIndex:this.gridZIndex})),this._radiusCrosshair=t,a.add(t)}if(n.visible){const t=function(t){let e="center",i="middle";return e=(t=Et(t))>=Math.PI*(7/6)&&t<=Math.PI*(11/6)?"right":t>=Math.PI*(1/6)&&t<=Math.PI*(5/6)?"left":"center",i=t>=Math.PI*(5/3)||t<=Math.PI*(1/3)?"bottom":t>=Math.PI*(2/3)&&t<=Math.PI*(4/3)?"top":"middle",{align:e,baseline:i}}(s),r=Object.assign(Object.assign(Object.assign(Object.assign({},Tt(i,l,s)),this._radiusHair.label),n),{textStyle:Object.assign(Object.assign({},null===(e=this._radiusHair.label)||void 0===e?void 0:e.textStyle),{textAlign:t.align,textBaseline:t.baseline}),zIndex:this.labelZIndex});this._updateCrosshairLabel(this._radiusLabelCrosshair,r,(t=>{t.name="crosshair-radius-label",this._radiusLabelCrosshair=t}))}else this._radiusLabelCrosshair&&this._radiusLabelCrosshair.hideAll()}}_parseFieldInfo(){var t;const{categoryField:e,valueField:i}=this._spec;e&&e.visible&&(this._angleHair=this._parseField(e,"categoryField")),i&&i.visible&&(this._radiusHair=this._parseField(i,"valueField"),this._radiusHair.smooth=null===(t=null==i?void 0:i.line)||void 0===t?void 0:t.smooth)}_updateCrosshairLabel(t,e,i){const s=this.getContainer();t?t.setAttributes(e):(t=new TD(e),null==s||s.add(t),i(t)),qE(t,this._getLimitBounds())}_getNeedClearVRenderComponents(){return[this._radiusCrosshair,this._radiusLabelCrosshair,this._angleCrosshair,this._angleLabelCrosshair]}}rG.specKey="crosshair",rG.type=r.polarCrosshair;const aG=(t,e)=>{const{getNewDomain:i,isContinuous:s,field:n}=e,r=n(),a=i();if(D(a)||D(r))return t;if(0===a.length)return[];const o={};a.forEach((t=>{o[t]||(o[t]=1)}));let l=null;return l=s()?t=>t[r]>=a[0]&&t[r]<=Fa(a):t=>o[t[r]+""]||o[t[r]],t.filter(l)},oG=(t,e)=>{const{stateFields:i,valueFields:s,dataCollection:n}=e.input,{stateField:r,valueField:a}=e.output,o={},l=[];return n.forEach(((t,e)=>{var n;if(D(i[e]))return;const r=null===(n=t.getFields())||void 0===n?void 0:n[i[e]];r&&r.lockStatisticsByDomain&&r.domain.forEach((t=>{o[t]=0})),t.latestData.forEach((t=>{Ba(i[e]).forEach((i=>{D(t[i])||(D(o[t[i]])&&(o[t[i]]=0),D(s[e])||(o[t[i]]+=isNaN(parseFloat(t[s[e]]))?1:parseFloat(t[s[e]])))}))}))})),Object.keys(o).forEach(((t,e)=>{const i={[r]:t};a&&(i[a]=o[t]),l.push(i)})),l};class lG extends tD{get relatedAxisComponent(){return this._relatedAxisComponent}setStartAndEnd(t,e,i=["percent","percent"]){const[s="percent",n="percent"]=i,r="percent"===s?t:this.dataToStatePoint(t),a="percent"===n?e:this.dataToStatePoint(e);this._handleChange(r,a,!0)}enableInteraction(){this._activeRoam=!0}disableInteraction(){this._activeRoam=!1}zoomIn(t){this._handleChartZoom({zoomDelta:1.2,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}zoomOut(t){this._handleChartZoom({zoomDelta:.8,zoomX:null==t?void 0:t.x,zoomY:null==t?void 0:t.y})}_handleChange(t,e,i){var s,n;null!==(n=null===(s=this._spec)||void 0===s?void 0:s.zoomLock)&&void 0!==n&&n||e-t!==this._spanCache&&(e-tthis._maxSpan)?this._shouldChange=!1:(this._shouldChange=!0,this._spanCache=e-t)}_isReverse(){const t=this._relatedAxisComponent;if(!t)return!1;const e=t.getScale();return e.range()[0]>e.range()[1]&&(!t.getInverse()||this._isHorizontal)}_updateRangeFactor(t){const e=this._relatedAxisComponent.getScale(),i=this._isReverse(),s=i?[1-this._end,1-this._start]:[this._start,this._end];if(i)switch(t){case"startHandler":e.rangeFactorEnd(s[1]);break;case"endHandler":e.rangeFactorStart(s[0]);break;default:e.rangeFactorStart(s[0],!0),e.rangeFactorEnd(s[1])}else switch(t){case"startHandler":e.rangeFactorStart(s[0]);break;case"endHandler":e.rangeFactorEnd(s[1]);break;default:e.rangeFactorEnd(s[1],!0),e.rangeFactorStart(s[0])}const n=e.rangeFactor();n?(this._start=i?1-n[1]:n[0],this._end=i?1-n[0]:n[1]):(this._start=0,this._end=1)}get visible(){return this._visible}constructor(t,e){super(t,e),this.layoutType="none",this._orient="left",this._cacheVisibility=void 0,this._dataUpdating=!1,this._shouldChange=!0,this._stateField="x",this._activeRoam=!0,this._zoomAttr={enable:!0,rate:1,focus:!0},this._dragAttr={enable:!0,rate:1,reverse:!0},this._scrollAttr={enable:!0,rate:1,reverse:!0},this.effect={onZoomChange:t=>{var e,i;const s=this._relatedAxisComponent;if(s&&"axis"===this._filterMode){const n=s.getScale(),r=s.getSpec();this._auto&&this._getAxisBandSize(r)&&this._spec.ignoreBandSize&&(n.bandwidth("auto"),n.maxBandwidth("auto"),n.minBandwidth("auto")),this._updateRangeFactor(t),this._auto&&(null===(i=null===(e=this._component)||void 0===e?void 0:e.setStartAndEnd)||void 0===i||i.call(e,this._start,this._end)),s.effect.scaleUpdate()}else mE(this._regions,(t=>{var e;null===(e=t.getViewData())||void 0===e||e.markRunning()}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),mE(this._regions,(t=>{t.reFilterViewData()}),{userId:this._seriesUserId,specIndex:this._seriesIndex})}},this._visible=!0,this._handleStateChange=(t,e,i)=>{var s,n;return this._startValue=t,this._endValue=e,this._newDomain=this._parseDomainFromState(this._startValue,this._endValue),null===(n=(s=this.effect).onZoomChange)||void 0===n||n.call(s,i),!0},this._handleChartZoom=t=>{var e,i;if(!this._activeRoam)return;const{zoomDelta:s,zoomX:n,zoomY:r}=t,{x:a,y:o}=this._regions[0].getLayoutStartPoint(),{width:l,height:h}=this._regions[0].getLayoutRect(),d=Math.abs(this._start-this._end),c=null!==(i=null===(e=this._spec.roamZoom)||void 0===e?void 0:e.rate)&&void 0!==i?i:1;if(d>=1&&s<1)return;if(d<=.01&&s>1)return;const u=this._isHorizontal?n:r,p=d*(s-1)*c;let g=p/2,m=p/2;if(u){const t=this._isHorizontal?a:o,e=this._isHorizontal?l:h;g=Math.abs(t-u)/Math.abs(e-t)*p,m=Math.abs(e-u)/Math.abs(e-t)*p}const _=Ps(this._start+g,0,1),f=Ps(this._end-m,0,1);this._handleChange(Math.min(_,f),Math.max(_,f),!0)},this._handleChartScroll=(t,e)=>{var i;if(!this._activeRoam)return!1;const{scrollX:s,scrollY:n}=t;let r=this._isHorizontal?s:n;const a=this._isHorizontal?ht(s/n)>=.5:ht(n/s)>=.5;this._scrollAttr.reverse||(r=-r),a&&this._handleChartMove(r,null!==(i=this._scrollAttr.rate)&&void 0!==i?i:1);const o=0!==this._start&&1!==this._end;return a&&o},this._handleChartDrag=(t,e)=>{var i;if(!this._activeRoam)return;const[s,n]=t;let r=this._isHorizontal?s:n;this._dragAttr.reverse&&(r=-r),this._handleChartMove(r,null!==(i=this._dragAttr.rate)&&void 0!==i?i:1)},this._handleChartMove=(t,e)=>{const i=this._isHorizontal?this.getLayoutRect().width:this.getLayoutRect().height;if(Math.abs(t)>=1e-6)if(t>0&&this._end<1){const s=Math.min(1-this._end,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}else if(t<0&&this._start>0){const s=Math.max(-this._start,t/i)*e;this._handleChange(this._start+s,this._end+s,!0)}return!1},this._orient=Td(t),this._isHorizontal="horizontal"===Ld(this._orient)}created(){super.created(),this._setAxisFromSpec(),this._setRegionsFromSpec(),this._initEvent(),this._initData(),this._initStateScale(),this._setStateFromSpec()}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}_setAxisFromSpec(){if(M(this._spec.axisId)?this._relatedAxisComponent=this._option.getComponentByUserId(this._spec.axisId):M(this._spec.axisIndex)&&(this._relatedAxisComponent=this._option.getComponentByIndex("axes",this._spec.axisIndex)),D(this._spec.field)&&!this._relatedAxisComponent){const t=this._option.getComponentsByKey("axes"),e=t.find((t=>t._orient===this._orient));if(e)this._relatedAxisComponent=e;else{const e=t.find((t=>!Jh(t.getScale().type)));this._relatedAxisComponent=e}}this._relatedAxisComponent&&"axis"===this._filterMode&&(this._relatedAxisComponent.autoIndentOnce=!0)}_setRegionsFromSpec(){var t,e;this._regions=this._relatedAxisComponent?this._relatedAxisComponent.getRegions():this._option.getAllRegions();const i=this._relatedAxisComponent?null===(e=(t=this._relatedAxisComponent).getBindSeriesFilter)||void 0===e?void 0:e.call(t):null;if(M(i)&&(M(i.userId)&&(this._seriesUserId=Ba(i.userId)),M(i.specIndex)&&(this._seriesIndex=Ba(i.specIndex))),M(this._spec.seriesId)){const t=Ba(this._spec.seriesId);this._seriesUserId?this._seriesUserId=this._seriesUserId.filter((e=>t.includes(e))):this._seriesUserId=t}if(M(this._spec.seriesIndex)){const t=Ba(this._spec.seriesIndex);this._seriesIndex?this._seriesIndex=this._seriesIndex.filter((e=>t.includes(e))):this._seriesIndex=t}if(M(this._spec.regionIndex)){const t=this._option.getRegionsInIndex(Ba(this._spec.regionIndex));this._regions=this._regions.filter((e=>t.includes(e)))}else if(M(this._spec.regionId)){const t=Ba(this._spec.regionId);this._regions=t.length?this._regions.filter((e=>t.includes(e.id))):[]}}onDataUpdate(){var t;const e=this._computeDomainOfStateScale(Jh(this._stateScale.type));this._stateScale.domain(e,!1),this._handleChange(this._start,this._end,!0),this._spec.auto&&(this._dataUpdating=!0,null===(t=this.getChart())||void 0===t||t.setLayoutTag(!0,null,!1))}_computeDomainOfStateScale(t){if(this._spec.customDomain)return this._spec.customDomain;const e=this._data.getLatestData().map((t=>t[this._stateField]));if(t){const t=e.map((t=>1*t));return e.length?[ja(t),Ya(t)]:[-1/0,1/0]}return e}_initEvent(){this._initCommonEvent()}_initData(){const t=[],e=[],i=[];if(this._relatedAxisComponent){const s={};mE(this._regions,(n=>{var r,a;const o="cartesian"===n.coordinate?n.getXAxisHelper():"polar"===n.coordinate?n.angleAxisHelper:null,l="cartesian"===n.coordinate?n.getYAxisHelper():"polar"===n.coordinate?n.radiusAxisHelper:null;if(!o||!l)return;const h=o.getAxisId()===this._relatedAxisComponent.id?o:l.getAxisId()===this._relatedAxisComponent.id?l:this._isHorizontal?o:l,d=h===o?l:o,c=Jh(d.getScale(0).type);t.push(n.getRawData());const u=n.getSpec(),p=Ba(u.xField),g=Ba(u.yField),m="cartesian"===n.coordinate?p[0]:null!==(r=u.angleField)&&void 0!==r?r:u.categoryField,_="cartesian"===n.coordinate?g[0]:null!==(a=u.radiusField)&&void 0!==a?a:u.valueField;if(s[n.id]="link"===n.type?"from_xField":h===o?m:_,e.push(s[n.id]),this._valueField){const t="link"===n.type?"from_yField":d===o?m:_;i.push(c?t:null)}}),{userId:this._seriesUserId,specIndex:this._seriesIndex}),this._originalStateFields=s}else mE(this._regions,(s=>{t.push(s.getRawData()),e.push(this._field),this._valueField&&i.push(this._spec.valueField)}),{userId:this._seriesUserId,specIndex:this._seriesIndex});const{dataSet:s}=this._option;Cp(s,"dataview",b),Lp(s,"dataFilterComputeDomain",oG);const n=new R(s,{name:`${this.type}_${this.id}_data`});n.transform({type:"dataFilterComputeDomain",options:{input:{dataCollection:t,stateFields:e,valueFields:i},output:{stateField:this._stateField,valueField:this._valueField}}},!1),this._data=new px(this._option,n),n.reRunAllTransform(),s.multipleDataViewAddListener(t,"change",this._handleDataCollectionChange.bind(this))}setAttrFromSpec(){var t;super.setAttrFromSpec(),!0===this._spec.roamZoom||this._spec.roamZoom?this._zoomAttr=E({},this._zoomAttr,this._spec.roamZoom):this._zoomAttr.enable=!1,!0===this._spec.roamDrag||this._spec.roamDrag?this._dragAttr=E({},this._dragAttr,this._spec.roamDrag):this._dragAttr.enable=!1,!0===this._spec.roamScroll||this._spec.roamScroll?this._scrollAttr=E({},this._scrollAttr,this._spec.roamScroll):this._scrollAttr.enable=!1,this._field=this._spec.field,this._width=this._computeWidth(),this._height=this._computeHeight(),this._visible=null===(t=this._spec.visible)||void 0===t||t}_statePointToData(t){const e=this._stateScale,i=e.domain();if(Jh(e.type))return this._isReverse()?i[0]+(Fa(i)-i[0])*(1-t):i[0]+(Fa(i)-i[0])*t;let s=e.range();this._isReverse()&&(s=s.slice().reverse());const n=s[0]+(Fa(s)-s[0])*t;return e.invert(n)}dataToStatePoint(t){const e=this._stateScale,i=e.scale(t);let s=e.range();return!this._isHorizontal&&Jh(e.type)&&(s=s.slice().reverse()),(i-s[0])/(Fa(s)-s[0])}_modeCheck(t,e){return"start"===t?"percent"===e&&M(this._spec.start)||"value"===e&&M(this._spec.startValue):"percent"===e&&M(this._spec.end)||"value"===e&&M(this._spec.endValue)}_setStateFromSpec(){var t,e;let i,s;if(this._auto=!!this._spec.auto,this._spec.rangeMode){const[t,e]=this._spec.rangeMode;this._modeCheck("start",t)&&this._modeCheck("end",e)&&(i="percent"===t?this._spec.start:this.dataToStatePoint(this._spec.startValue),s="percent"===e?this._spec.end:this.dataToStatePoint(this._spec.endValue))}else i=this._spec.start?this._spec.start:this._spec.startValue?this.dataToStatePoint(this._spec.startValue):0,s=this._spec.end?this._spec.end:this._spec.endValue?this.dataToStatePoint(this._spec.endValue):1;this._startValue=this._statePointToData(i),this._endValue=this._statePointToData(s),this._start=i,this._end=s,this._minSpan=null!==(t=this._spec.minSpan)&&void 0!==t?t:0,this._maxSpan=null!==(e=this._spec.maxSpan)&&void 0!==e?e:1,Jh(this._stateScale.type)&&this._stateScale.domain()[0]!==Fa(this._stateScale.domain())&&(this._spec.minValueSpan&&(this._minSpan=this._spec.minValueSpan/(Fa(this._stateScale.domain())-this._stateScale.domain()[0])),this._spec.maxValueSpan&&(this._maxSpan=this._spec.maxValueSpan/(Fa(this._stateScale.domain())-this._stateScale.domain()[0]))),this._minSpan=Math.max(0,this._minSpan),this._maxSpan=Math.min(this._maxSpan,1),this._relatedAxisComponent&&"axis"===this._filterMode||0===this._start&&1===this._end||(this._newDomain=this._parseDomainFromState(this._startValue,this._endValue))}_parseFieldOfSeries(t){var e;return null===(e=this._originalStateFields)||void 0===e?void 0:e[t.id]}_initStateScale(){const t=[0,1];if(this._relatedAxisComponent){const e=this._relatedAxisComponent.getScale(),i=Jh(e.type),s=this._computeDomainOfStateScale(i);if(this._stateScale=e.clone(),i){const e=s.map((t=>1*t));this._stateScale.domain(s.length?[ja(e),Ya(e)]:[0,1],!0).range(t)}else this._stateScale.domain(s,!0).range(t)}else this._stateScale=new ex,this._stateScale.domain(this._computeDomainOfStateScale(),!0).range(t)}init(t){super.init(t),this._addTransformToSeries(),0===this._start&&1===this._end||this.effect.onZoomChange()}_addTransformToSeries(){this._relatedAxisComponent&&"axis"===this._filterMode||(Lp(this._option.dataSet,"dataFilterWithNewDomain",aG),mE(this._regions,(t=>{t.addViewDataFilter({type:"dataFilterWithNewDomain",options:{getNewDomain:()=>this._newDomain,field:()=>{var e;return null!==(e=this._field)&&void 0!==e?e:this._parseFieldOfSeries(t)},isContinuous:()=>Jh(this._stateScale.type)},level:Hp.dataZoomFilter})}),{userId:this._seriesUserId,specIndex:this._seriesIndex}))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reMake||Im(e,t)||(i.reRender=!0,i.reMake=!0),i}reInit(t){super.reInit(t),this._marks.forEach((t=>{t.getMarks().forEach((t=>{this.initMarkStyleWithSpec(t,this._spec[t.name])}))}))}changeRegions(){}update(t){}resize(t){}_parseDomainFromState(t,e){if(Jh(this._stateScale.type))return[Math.min(e,t),Math.max(e,t)];const i=this._stateScale.domain(),s=i.indexOf(t),n=i.indexOf(e);return i.slice(Math.min(s,n),Math.max(s,n)+1)}_initCommonEvent(){var t,e,i,s,n,r,a;const o={delayType:null!==(e=null===(t=this._spec)||void 0===t?void 0:t.delayType)&&void 0!==e?e:"throttle",delayTime:M(null===(i=this._spec)||void 0===i?void 0:i.delayType)?null!==(n=null===(s=this._spec)||void 0===s?void 0:s.delayTime)&&void 0!==n?n:30:0,realTime:null===(a=null===(r=this._spec)||void 0===r?void 0:r.realTime)||void 0===a||a};this._zoomAttr.enable&&this.initZoomEventOfRegions(this._regions,null,this._handleChartZoom,o),this._scrollAttr.enable&&this.initScrollEventOfRegions(this._regions,null,this._handleChartScroll,o),this._dragAttr.enable&&this.initDragEventOfRegions(this._regions,null,this._handleChartDrag,o)}updateLayoutAttribute(){this._visible&&this._createOrUpdateComponent(),super.updateLayoutAttribute()}onLayoutStart(t,e,i){super.onLayoutStart(t,e,i);const s=this._autoUpdate(t),n=this._isHorizontal?"height":"width";this.layout.setLayoutRect({[n]:s?this[`_${n}`]:0},{[n]:Py.Built_In}),this._dataUpdating=!1}getBoundsInRect(t){const e={x1:this.getLayoutStartPoint().x,y1:this.getLayoutStartPoint().y,x2:0,y2:0};return this._isHorizontal?(e.y2=e.y1+this._height,e.x2=e.x1+t.width):(e.x2=e.x1+this._width,e.y2=e.y1+t.height),e}hide(){var t;null===(t=this._component)||void 0===t||t.hideAll()}show(){var t;null===(t=this._component)||void 0===t||t.showAll()}_getAxisBandSize(t){const e=null==t?void 0:t.bandSize,i=null==t?void 0:t.maxBandSize,s=null==t?void 0:t.minBandSize;if(e||s||i)return{bandSize:e,maxBandSize:i,minBandSize:s}}_autoUpdate(t){var e,i,s,n,a,o;if(!this._auto)return this._cacheVisibility=void 0,!0;const l=this._relatedAxisComponent,h=null==l?void 0:l.getSpec(),d=null==l?void 0:l.getScale(),c=this._getAxisBandSize(h);if(!this._dataUpdating&&td(d.type)&&(null==t?void 0:t.height)===(null===(e=this._cacheRect)||void 0===e?void 0:e.height)&&(null==t?void 0:t.width)===(null===(i=this._cacheRect)||void 0===i?void 0:i.width)&&this._fixedBandSize===(null==c?void 0:c.bandSize))return this._cacheVisibility;let u=!0;if(this._isHorizontal&&(null==t?void 0:t.width)!==(null===(s=this._cacheRect)||void 0===s?void 0:s.width)?d.range(l.getInverse()?[t.width,0]:[0,t.width]):(null==t?void 0:t.height)!==(null===(n=this._cacheRect)||void 0===n?void 0:n.height)&&d.range(l.getInverse()?[0,t.height]:[t.height,0]),this._cacheRect={width:null==t?void 0:t.width,height:null==t?void 0:t.height},this._fixedBandSize=null==c?void 0:c.bandSize,td(d.type)){c&&(this._start||this._end)&&(this.type===r.scrollBar&&(this._start=0,this._end=1),this._updateRangeFactor());const[t,e]=null!==(a=d.rangeFactor())&&void 0!==a?a:[];u=!(D(t)&&D(e)||0===t&&1===e)}else{const[t,e]=null!==(o=d.rangeFactor())&&void 0!==o?o:[this._start,this._end];u=!(0===t&&1===e)}return this.setStartAndEnd(this._start,this._end),u?this.show():this.hide(),this._cacheVisibility=u,u}_getNeedClearVRenderComponents(){return[this._component]}}function hG(t,e,i,s,n){let r=s,a=e;const o=t[e].x,l=t[e].y,h=t[i].x-o,d=t[i].y-l,c=h*h+d*d;let u,p,g,m,_;for(let s=e+1,n=i-1;sr&&(r=g,a=s);r>s&&(a-e>2&&hG(t,e,a,s,n),n.push(t[a],t[a+1]),i-a>2&&hG(t,a,i,s,n))}function dG(t,e){const i=t.length-1,s=[t[0]];return hG(t,0,i,e,s),s.push(t[i]),s}JA(lG,$I);const cG="M -0.0544 0.25 C -0.0742 0.25 -0.0901 0.234 -0.0901 0.2143 L -0.0901 -0.1786 C -0.0901 -0.1983 -0.0742 -0.2143 -0.0544 -0.2143 L -0.0187 -0.2143 L -0.0187 -0.5 L 0.017 -0.5 L 0.017 -0.2143 L 0.0527 -0.2143 C 0.0724 -0.2143 0.0884 -0.1983 0.0884 -0.1786 L 0.0884 0.2143 C 0.0884 0.234 0.0724 0.25 0.0527 0.25 L 0.017 0.25 L 0.017 0.5 L -0.0187 0.5 L -0.0187 0.25 L -0.0544 0.25 Z M -0.0187 -0.1429 L -0.0544 -0.1429 L -0.0544 0.1786 L -0.0187 0.1786 L -0.0187 -0.1429 Z M 0.0527 -0.1429 L 0.017 -0.1429 L 0.017 0.1786 L 0.0527 0.1786 L 0.0527 -0.1429 Z",uG={orient:"bottom",showDetail:"auto",brushSelect:!0,zoomLock:!1,minSpan:0,maxSpan:1,delayType:"throttle",delayTime:0,realTime:!0,backgroundStyle:{fill:"white",stroke:"#D1DBEE",lineWidth:1,cornerRadius:2},dragMaskStyle:{fill:"#B0C8F9",fillOpacity:.2},backgroundChartStyle:{area:{visible:!0,stroke:"#D1DBEE",lineWidth:1,fill:"#F6F8FC"},line:{visible:!0,stroke:"#D1DBEE",lineWidth:1}},selectedBackgroundStyle:{fill:"#B0C8F9",fillOpacity:.5},selectedBackgroundChartStyle:{area:{visible:!0,stroke:"#B0C8F9",lineWidth:1,fill:"#fbb934"},line:{visible:!0,stroke:"#fbb934",lineWidth:1}},middleHandlerStyle:{visible:!0,background:{size:8,style:{fill:"white",stroke:"#B0C8F9",cornerRadius:2}},icon:{size:6,fill:"white",stroke:"#B0C8F9",symbolType:"M 0.3 -0.5 C 0.41 -0.5 0.5 -0.41 0.5 -0.3 C 0.5 -0.3 0.5 0.3 0.5 0.3 C 0.5 0.41 0.41 0.5 0.3 0.5 C 0.3 0.5 -0.3 0.5 -0.3 0.5 C -0.41 0.5 -0.5 0.41 -0.5 0.3 C -0.5 0.3 -0.5 -0.3 -0.5 -0.3 C -0.5 -0.41 -0.41 -0.5 -0.3 -0.5 C -0.3 -0.5 0.3 -0.5 0.3 -0.5 Z",lineWidth:.5}},startHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:cG,fill:"white",stroke:"#B0C8F9",lineWidth:.5},endHandlerStyle:{visible:!0,triggerMinSize:0,symbolType:cG,fill:"white",stroke:"#B0C8F9",lineWidth:.5},startTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}},endTextStyle:{padding:4,textStyle:{fontSize:10,fill:"#6F6F6F"}}},pG={horizontal:{angle:0,strokeBoundsBuffer:0,boundsPadding:2,pickMode:"imprecise",cursor:"ew-resize"},vertical:{angle:Math.PI/180*90,cursor:"ns-resize",boundsPadding:2,pickMode:"imprecise",strokeBoundsBuffer:0}};var gG;!function(t){t.startHandler="startHandler",t.endHandler="endHandler",t.middleHandler="middleHandler",t.background="background"}(gG||(gG={}));var mG=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nt,this._onHandlerPointerDown=(t,e)=>{t.stopPropagation(),"start"===e?(this._activeTag=gG.startHandler,this._activeItem=this._startHandlerMask):"end"===e?(this._activeTag=gG.endHandler,this._activeItem=this._endHandlerMask):"middleRect"===e?(this._activeTag=gG.middleHandler,this._activeItem=this._middleHandlerRect):"middleSymbol"===e?(this._activeTag=gG.middleHandler,this._activeItem=this._middleHandlerSymbol):"background"===e&&(this._activeTag=gG.background,this._activeItem=this._background),this._activeState=!0,this._activeCache.startPos=this.eventPosToStagePos(t),this._activeCache.lastPos=this.eventPosToStagePos(t),"browser"===zo.env&&(zo.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),zo.addEventListener("pointerup",this._onHandlerPointerUp)),this.addEventListener("pointermove",this._onHandlerPointerMove,{capture:!0})},this._pointerMove=t=>{t.stopPropagation();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute,r=this.eventPosToStagePos(t),{attPos:a,max:o}=this._layoutCache,l=(r[a]-this._activeCache.lastPos[a])/o;let{start:h,end:d}=this.state;this._activeState&&(this._activeTag===gG.middleHandler?this.moveZoomWithMiddle((this.state.start+this.state.end)/2+l):this._activeTag===gG.startHandler?h+l>d?(h=d,d=h+l,this._activeTag=gG.endHandler):h+=l:this._activeTag===gG.endHandler&&(d+l{t.preventDefault();const{start:e,end:i,brushSelect:s,realTime:n=!0}=this.attribute;if(this._activeState&&this._activeTag===gG.background){const e=this.eventPosToStagePos(t);this.backgroundDragZoom(this._activeCache.startPos,e)}this._activeState=!1,s&&this.renderDragMask(),e===this.state.start&&i===this.state.end||(this.setStateAttr(this.state.start,this.state.end,!0),this._dispatchEvent("change",{start:this.state.start,end:this.state.end,tag:this._activeTag})),"browser"===zo.env&&(zo.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),zo.removeEventListener("pointerup",this._onHandlerPointerUp)),this.removeEventListener("pointermove",this._onHandlerPointerMove,{capture:!0}),this.removeEventListener("pointerup",this._onHandlerPointerUp)};const{position:i,showDetail:s}=t;this._activeCache.startPos=i,this._activeCache.lastPos=i,this._showText="auto"!==s&&s,this.setPropsFromAttrs()}setAttributes(t,e){super.setAttributes(t,e),this.setPropsFromAttrs()}bindEvents(){if(this.attribute.disableTriggerEvent)return void this.setAttribute("childrenPickable",!1);const{showDetail:t,brushSelect:e}=this.attribute;this._startHandlerMask&&this._startHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"start"))),this._endHandlerMask&&this._endHandlerMask.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"end"))),this._middleHandlerSymbol&&this._middleHandlerSymbol.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleSymbol"))),this._middleHandlerRect&&this._middleHandlerRect.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"middleRect")));const i=e?"background":"middleRect";this._selectedBackground&&this._selectedBackground.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),e&&this._background&&this._background.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),e&&this._previewGroup&&this._previewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,"background"))),this._selectedPreviewGroup&&this._selectedPreviewGroup.addEventListener("pointerdown",(t=>this._onHandlerPointerDown(t,i))),this.addEventListener("pointerup",this._onHandlerPointerUp),this.addEventListener("pointerupoutside",this._onHandlerPointerUp),"auto"===t&&(this.addEventListener("pointerenter",this._onHandlerPointerEnter),this.addEventListener("pointerleave",this._onHandlerPointerLeave))}dragMaskSize(){const{position:t}=this.attribute,{attPos:e,max:i}=this._layoutCache;return this._activeCache.lastPos[e]-t[e]>i?i+t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-t[e]<0?t[e]-this._activeCache.startPos[e]:this._activeCache.lastPos[e]-this._activeCache.startPos[e]}setStateAttr(t,e,i){const{zoomLock:s=!1,minSpan:n=0,maxSpan:r=1}=this.attribute,a=e-t;a!==this._spanCache&&(s||ar)||(this._spanCache=a,this.state.start=t,this.state.end=e,i&&this.setAttributes({start:t,end:e}))}eventPosToStagePos(t){return this.stage.eventPointTransform(t)}_onHandlerPointerEnter(t){t.stopPropagation(),this._showText=!0,this.renderText()}_onHandlerPointerLeave(t){t.stopPropagation(),this._showText=!1,this.renderText()}backgroundDragZoom(t,e){const{attPos:i,max:s}=this._layoutCache,{position:n}=this.attribute,r=t[i]-n[i],a=e[i]-n[i],o=Math.min(Math.max(Math.min(r,a)/s,0),1),l=Math.min(Math.max(Math.max(r,a)/s,0),1);Math.abs(o-l)<.01?this.moveZoomWithMiddle(o):this.setStateAttr(o,l,!1)}moveZoomWithMiddle(t){let e=t-(this.state.start+this.state.end)/2;0!==e&&(e>0?this.state.end+e>1&&(e=1-this.state.end):e<0&&this.state.start+e<0&&(e=-this.state.start),this.setStateAttr(this.state.start+e,this.state.end+e,!1))}renderDragMask(){const{dragMaskStyle:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();this._isHorizontal?this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:Ps(this.dragMaskSize()<0?this._activeCache.lastPos.x:this._activeCache.startPos.x,e.x,e.x+i),y:e.y,width:this._activeState&&this._activeTag===gG.background&&Math.abs(this.dragMaskSize())||0,height:s},t),"rect"):this._dragMask=this._container.createOrUpdateChild("dragMask",Object.assign({x:e.x,y:Ps(this.dragMaskSize()<0?this._activeCache.lastPos.y:this._activeCache.startPos.y,e.y,e.y+s),width:i,height:this._activeState&&this._activeTag===gG.background&&Math.abs(this.dragMaskSize())||0},t),"rect")}isTextOverflow(t,e,i){if(!e)return!1;if(this._isHorizontal){if("start"===i){if(e.x1t.x2)return!0}else if("start"===i){if(e.y1t.y2)return!0;return!1}setTextAttr(t,e){var i,s,n,r,a,o,l,h;const{startTextStyle:d,endTextStyle:c}=this.attribute,{formatMethod:u}=d,p=mG(d,["formatMethod"]),{formatMethod:g}=c,m=mG(c,["formatMethod"]),{start:_,end:f}=this.state;this._startValue=this._statePointToData(_),this._endValue=this._statePointToData(f);const{position:v,width:y,height:b}=this.getLayoutAttrFromConfig(),x=u?u(this._startValue):this._startValue,S=g?g(this._endValue):this._endValue,M={x1:v.x,y1:v.y,x2:v.x+y,y2:v.y+b};let k,A,w,T;this._isHorizontal?(k={x:v.x+_*y,y:v.y+b/2},A={x:v.x+f*y,y:v.y+b/2},w={textAlign:this.isTextOverflow(M,t,"start")?"left":"right",textBaseline:null!==(s=null===(i=null==p?void 0:p.textStyle)||void 0===i?void 0:i.textBaseline)&&void 0!==s?s:"middle"},T={textAlign:this.isTextOverflow(M,e,"end")?"right":"left",textBaseline:null!==(r=null===(n=null==m?void 0:m.textStyle)||void 0===n?void 0:n.textBaseline)&&void 0!==r?r:"middle"}):(k={x:v.x+y/2,y:v.y+_*b},A={x:v.x+y/2,y:v.y+f*b},w={textAlign:null!==(o=null===(a=null==p?void 0:p.textStyle)||void 0===a?void 0:a.textAlign)&&void 0!==o?o:"center",textBaseline:this.isTextOverflow(M,t,"start")?"top":"bottom"},T={textAlign:null!==(h=null===(l=null==m?void 0:m.textStyle)||void 0===l?void 0:l.textAlign)&&void 0!==h?h:"center",textBaseline:this.isTextOverflow(M,e,"end")?"bottom":"top"}),this._startText=this.maybeAddLabel(this._container,E({},p,{text:x,x:k.x,y:k.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:w}),`data-zoom-start-text-${v}`),this._endText=this.maybeAddLabel(this._container,E({},m,{text:S,x:A.x,y:A.y,visible:this._showText,pickable:!1,childrenPickable:!1,textStyle:T}),`data-zoom-end-text-${v}`)}renderText(){let t=null,e=null;this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds,this.setTextAttr(t,e),t=this._startText.AABBBounds,e=this._endText.AABBBounds;const{x1:i,x2:s,y1:n,y2:r}=t,{dx:a=0,dy:o=0}=this.attribute.startTextStyle;if((new Kt).set(i,n,s,r).intersects(e)){const t="bottom"===this.attribute.orient||"right"===this.attribute.orient?-1:1;this._isHorizontal?this._startText.setAttribute("dy",o+t*Math.abs(e.y1-e.y2)):this._startText.setAttribute("dx",a+t*Math.abs(e.x1-e.x2))}else this._isHorizontal?this._startText.setAttribute("dy",o):this._startText.setAttribute("dx",a)}getLayoutAttrFromConfig(){var t,e,i,s,n,r;if(this._layoutAttrFromConfig)return this._layoutAttrFromConfig;const{position:a,size:o,orient:l,middleHandlerStyle:h={},startHandlerStyle:d={},endHandlerStyle:c={},backgroundStyle:u={}}=this.attribute,{width:p,height:g}=o,m=null!==(e=null===(t=h.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10;let _,f,v;h.visible?this._isHorizontal?(_=p,f=g-m,v={x:a.x,y:a.y+m}):(_=p-m,f=g,v={x:a.x+("left"===l?m:0),y:a.y}):(_=p,f=g,v=a);const y=null!==(i=d.size)&&void 0!==i?i:this._isHorizontal?f:_,b=null!==(s=c.size)&&void 0!==s?s:this._isHorizontal?f:_;return d.visible&&(this._isHorizontal?(_-=(y+b)/2,v={x:v.x+y/2,y:v.y}):(f-=(y+b)/2,v={x:v.x,y:v.y+y/2})),f+=null!==(n=u.lineWidth/2)&&void 0!==n?n:1,_+=null!==(r=u.lineWidth/2)&&void 0!==r?r:1,this._layoutAttrFromConfig={position:v,width:_,height:f},this._layoutAttrFromConfig}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v,y,b,x,S,M,k,A,w,T,L,C,E,D,P,O;this._layoutAttrFromConfig=null;const{orient:R,backgroundStyle:I,backgroundChartStyle:B={},selectedBackgroundStyle:F={},selectedBackgroundChartStyle:Y={},middleHandlerStyle:j={},startHandlerStyle:H={},endHandlerStyle:z={},brushSelect:N,zoomLock:V}=this.attribute,{start:W,end:G}=this.state,{position:U,width:$,height:X}=this.getLayoutAttrFromConfig(),K=null!==(t=H.triggerMinSize)&&void 0!==t?t:40,q=null!==(e=z.triggerMinSize)&&void 0!==e?e:40,Z=this.createOrUpdateChild("dataZoom-container",{},"group");if(this._container=Z,this._background=Z.createOrUpdateChild("background",Object.assign(Object.assign({x:U.x,y:U.y,width:$,height:X,cursor:N?"crosshair":"auto"},I),{pickable:!V&&(null===(i=I.pickable)||void 0===i||i)}),"rect"),(null===(s=B.line)||void 0===s?void 0:s.visible)&&this.setPreviewAttributes("line",Z),(null===(n=B.area)||void 0===n?void 0:n.visible)&&this.setPreviewAttributes("area",Z),N&&this.renderDragMask(),this._isHorizontal?this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x+W*$,y:U.y,width:(G-W)*$,height:X,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(r=Y.pickable)||void 0===r||r)}),"rect"):this._selectedBackground=Z.createOrUpdateChild("selectedBackground",Object.assign(Object.assign({x:U.x,y:U.y+W*X,width:$,height:(G-W)*X,cursor:N?"crosshair":"move"},F),{pickable:!V&&(null===(a=F.pickable)||void 0===a||a)}),"rect"),(null===(o=Y.line)||void 0===o?void 0:o.visible)&&this.setSelectedPreviewAttributes("line",Z),(null===(l=Y.area)||void 0===l?void 0:l.visible)&&this.setSelectedPreviewAttributes("area",Z),this._isHorizontal){if(j.visible){const t=(null===(h=j.background)||void 0===h?void 0:h.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:U.x+W*$,y:U.y-t,width:(G-W)*$,height:t},null===(d=j.background)||void 0===d?void 0:d.style),{pickable:!V&&(null===(p=null===(u=null===(c=j.background)||void 0===c?void 0:c.style)||void 0===u?void 0:u.pickable)||void 0===p||p)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:U.x+(W+G)/2*$,y:U.y-t/2,strokeBoundsBuffer:0,angle:0,symbolType:null!==(m=null===(g=j.icon)||void 0===g?void 0:g.symbolType)&&void 0!==m?m:"square"},j.icon),{pickable:!V&&(null===(_=j.icon.pickable)||void 0===_||_)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+W*$,y:U.y+X/2,size:X,symbolType:null!==(f=H.symbolType)&&void 0!==f?f:"square"},pG.horizontal),H),{pickable:!V&&(null===(v=H.pickable)||void 0===v||v)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+G*$,y:U.y+X/2,size:X,symbolType:null!==(y=z.symbolType)&&void 0!==y?y:"square"},pG.horizontal),z),{pickable:!V&&(null===(b=z.pickable)||void 0===b||b)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),K),e=Math.max(this._startHandler.AABBBounds.height(),K),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+W*$-t/2,y:U.y+X/2-e/2,width:t,height:e,fill:"white",fillOpacity:0,zIndex:999},pG.horizontal),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+G*$-i/2,y:U.y+X/2-s/2,width:i,height:s,fill:"white",fillOpacity:0,zIndex:999},pG.horizontal),{pickable:!V}),"rect")}else{if(j.visible){const t=(null===(x=j.background)||void 0===x?void 0:x.size)||10;this._middleHandlerRect=Z.createOrUpdateChild("middleHandlerRect",Object.assign(Object.assign({x:"left"===R?U.x-t:U.x+$,y:U.y+W*X,width:t,height:(G-W)*X},null===(S=j.background)||void 0===S?void 0:S.style),{pickable:!V&&(null===(A=null===(k=null===(M=j.background)||void 0===M?void 0:M.style)||void 0===k?void 0:k.pickable)||void 0===A||A)}),"rect"),this._middleHandlerSymbol=Z.createOrUpdateChild("middleHandlerSymbol",Object.assign(Object.assign({x:"left"===R?U.x-t/2:U.x+$+t/2,y:U.y+(W+G)/2*X,angle:Math.PI/180*90,symbolType:null!==(T=null===(w=j.icon)||void 0===w?void 0:w.symbolType)&&void 0!==T?T:"square",strokeBoundsBuffer:0},j.icon),{pickable:!V&&(null===(C=null===(L=j.icon)||void 0===L?void 0:L.pickable)||void 0===C||C)}),"symbol")}this._startHandler=Z.createOrUpdateChild("startHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+W*X,size:$,symbolType:null!==(E=H.symbolType)&&void 0!==E?E:"square"},pG.vertical),H),{pickable:!V&&(null===(D=H.pickable)||void 0===D||D)}),"symbol"),this._endHandler=Z.createOrUpdateChild("endHandler",Object.assign(Object.assign(Object.assign({x:U.x+$/2,y:U.y+G*X,size:$,symbolType:null!==(P=z.symbolType)&&void 0!==P?P:"square"},pG.vertical),z),{pickable:!V&&(null===(O=z.pickable)||void 0===O||O)}),"symbol");const t=Math.max(this._startHandler.AABBBounds.width(),K),e=Math.max(this._startHandler.AABBBounds.height(),K),i=Math.max(this._endHandler.AABBBounds.width(),q),s=Math.max(this._endHandler.AABBBounds.height(),q);this._startHandlerMask=Z.createOrUpdateChild("startHandlerMask",Object.assign(Object.assign({x:U.x+$/2+t/2,y:U.y+W*X-e/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},pG.vertical),{pickable:!V}),"rect"),this._endHandlerMask=Z.createOrUpdateChild("endHandlerMask",Object.assign(Object.assign({x:U.x+$/2+i/2,y:U.y+G*X-s/2,width:s,height:i,fill:"white",fillOpacity:0,zIndex:999},pG.vertical),{pickable:!V}),"rect")}this._showText&&this.renderText()}computeBasePoints(){const{orient:t}=this.attribute,{position:e,width:i,height:s}=this.getLayoutAttrFromConfig();let n,r;return this._isHorizontal?(n=[{x:e.x,y:e.y+s}],r=[{x:e.x+i,y:e.y+s}]):"left"===t?(n=[{x:e.x+i,y:e.y}],r=[{x:e.x+i,y:e.y+s}]):(n=[{x:e.x,y:e.y+s}],r=[{x:e.x,y:e.y}]),{basePointStart:n,basePointEnd:r}}simplifyPoints(t){var e;return t.length>1e4?function(t,e){if(t.length<=10)return t;const i=void 0!==e?e*e:1;return dG(t=function(t,e){let i,s,n=t[0].x,r=t[0].y;const a=[t[0]];for(let o=1,l=t.length;oe&&(n=t[o].x,r=t[o].y,a.push(t[o]));return t[t.length-1].x===n&&t[t.length-1].y===r||a.push(t[t.length-1]),a}(t,i),i)}(t,null!==(e=this.attribute.tolerance)&&void 0!==e?e:this._previewData.length/1e4):t}getPreviewLinePoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}getPreviewAreaPoints(){let t=this._previewData.map((t=>({x:this._previewPointsX&&this._previewPointsX(t),y:this._previewPointsY&&this._previewPointsY(t),x1:this._previewPointsX1&&this._previewPointsX1(t),y1:this._previewPointsY1&&this._previewPointsY1(t)})));if(0===t.length)return t;t=this.simplifyPoints(t);const{basePointStart:e,basePointEnd:i}=this.computeBasePoints();return e.concat(t).concat(i)}setPreviewAttributes(t,e){this._previewGroup||(this._previewGroup=e.createOrUpdateChild("previewGroup",{pickable:!1},"group")),"line"===t?this._previewLine=this._previewGroup.createOrUpdateChild("previewLine",{},"line"):this._previewArea=this._previewGroup.createOrUpdateChild("previewArea",{curveType:"basis"},"area");const{backgroundChartStyle:i={}}=this.attribute;"line"===t&&this._previewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._previewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}setSelectedPreviewAttributes(t,e){this._selectedPreviewGroupClip||(this._selectedPreviewGroupClip=e.createOrUpdateChild("selectedPreviewGroupClip",{pickable:!1},"group"),this._selectedPreviewGroup=this._selectedPreviewGroupClip.createOrUpdateChild("selectedPreviewGroup",{},"group")),"line"===t?this._selectedPreviewLine=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewLine",{},"line"):this._selectedPreviewArea=this._selectedPreviewGroup.createOrUpdateChild("selectedPreviewArea",{curveType:"basis"},"area");const{selectedBackgroundChartStyle:i={}}=this.attribute,{start:s,end:n}=this.state,{position:r,width:a,height:o}=this.getLayoutAttrFromConfig();this._selectedPreviewGroupClip.setAttributes({x:this._isHorizontal?r.x+s*a:r.x,y:this._isHorizontal?r.y:r.y+s*o,width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,clip:!0,pickable:!1}),this._selectedPreviewGroup.setAttributes({x:-(this._isHorizontal?r.x+s*a:r.x),y:-(this._isHorizontal?r.y:r.y+s*o),width:this._isHorizontal?(n-s)*a:a,height:this._isHorizontal?o:(n-s)*o,pickable:!1}),"line"===t&&this._selectedPreviewLine.setAttributes(Object.assign({points:this.getPreviewLinePoints(),curveType:"basis",pickable:!1},i.line)),"area"===t&&this._selectedPreviewArea.setAttributes(Object.assign({points:this.getPreviewAreaPoints(),curveType:"basis",pickable:!1},i.area))}maybeAddLabel(t,e,i){let s=this.find((t=>t.name===i),!0);return s?s.setAttributes(e):(s=new TD(e),s.name=i),t.add(s),s}setStartAndEnd(t,e){const{start:i,end:s}=this.attribute;M(t)&&M(e)&&(t!==this.state.start||e!==this.state.end)&&(this.state.start=t,this.state.end=e,i===this.state.start&&s===this.state.end||(this.setStateAttr(t,e,!0),this._dispatchEvent("change",{start:t,end:e,tag:this._activeTag})))}setPreviewData(t){this._previewData=t}setText(t,e){"start"===e?this._startText.setAttribute("text",t):this._endText.setAttribute("text",t)}getStartValue(){return this._startValue}getEndTextValue(){return this._endValue}getMiddleHandlerSize(){var t,e,i,s;const{middleHandlerStyle:n={}}=this.attribute,r=null!==(e=null===(t=n.background)||void 0===t?void 0:t.size)&&void 0!==e?e:10,a=null!==(s=null===(i=n.icon)||void 0===i?void 0:i.size)&&void 0!==s?s:10;return Math.max(r,...Ba(a))}setPreviewPointsX(t){ys(t)&&(this._previewPointsX=t)}setPreviewPointsY(t){ys(t)&&(this._previewPointsY=t)}setPreviewPointsX1(t){ys(t)&&(this._previewPointsX1=t)}setPreviewPointsY1(t){ys(t)&&(this._previewPointsY1=t)}setStatePointToData(t){ys(t)&&(this._statePointToData=t)}}fG.defaultAttributes=uG;class vG extends QE{_mergeThemeToSpec(t,e){const i=this._theme;let s=t;if(this._shouldMergeThemeToSpec()){const e=t=>{const e=Tl({selectedBackgroundChart:{line:{},area:{}}},this._theme,t),{selectedBackgroundChart:i={}}=t,{line:s,area:n}=i;return s&&!1!==s.visible&&(e.selectedBackgroundChart.line.style=Object.assign(Object.assign({},e.selectedBackgroundChart.line.style),{visible:!0})),n&&!1!==n.visible&&(e.selectedBackgroundChart.area.style=Object.assign(Object.assign({},e.selectedBackgroundChart.area.style),{visible:!0})),e},i=t;s=y(i)?i.map((t=>e(t))):e(i)}return this._adjustPadding(s),{spec:s,theme:i}}}class yG extends lG{constructor(t,e){var i;super(t,e),this.type=r.dataZoom,this.name=r.dataZoom,this.transformerConstructor=vG,this.specKey="dataZoom",this.layoutZIndex=Ey.DataZoom,this.layoutLevel=Dy.DataZoom,this.layoutType="region-relative",this._isReverseCache=!1,this._dataToPositionX=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=this._isHorizontal?this._stateField:this._valueField;return s.scale(t[n])+this.getLayoutStartPoint().x+e+i},this._dataToPositionX2=t=>{const e="left"===this._orient?this._middleHandlerSize:0,i=this._isHorizontal?this._startHandlerSize/2:0,s=this._isHorizontal?this._stateScale:this._valueScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().x+e+i},this._dataToPositionY=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=this._isHorizontal?this._valueField:this._stateField;return s.scale(t[n])+this.getLayoutStartPoint().y+e+i},this._dataToPositionY2=t=>{const e=this._isHorizontal?this._middleHandlerSize:0,i=this._isHorizontal?0:this._startHandlerSize/2,s=this._isHorizontal?this._valueScale:this._stateScale,n=s.domain()[0];return s.scale(n)+this.getLayoutStartPoint().y+e+i},this._valueField="y",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"filter"}created(){super.created(),this._initValueScale()}setAttrFromSpec(){var t,e,i,s,n,r,a,o,l,h;super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=this._spec.roam,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode),this._backgroundSize=null!==(e=null===(t=this._spec.background)||void 0===t?void 0:t.size)&&void 0!==e?e:30,this._middleHandlerSize=this._computeMiddleHandlerSize(),this._width=this._computeWidth(),this._height=this._computeHeight(),D(null===(n=null===(s=null===(i=this._spec)||void 0===i?void 0:i.startHandler)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size)&&(this._spec.startHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize),D(null===(o=null===(a=null===(r=this._spec)||void 0===r?void 0:r.endHandler)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size)&&(this._spec.endHandler.style.size=this._isHorizontal?this._height-this._middleHandlerSize:this._width-this._middleHandlerSize);const d=null===(l=this._spec.startHandler.style.visible)||void 0===l||l,c=null===(h=this._spec.endHandler.style.visible)||void 0===h||h;this._startHandlerSize=d?this._spec.startHandler.style.size:0,this._endHandlerSize=c?this._spec.endHandler.style.size:0}onLayoutEnd(t){this._updateScaleRange(),this._isReverse()&&!this._isReverseCache&&(this._isReverseCache=this._isReverse(),this.effect.onZoomChange()),!1!==this._cacheVisibility&&super.onLayoutEnd(t)}_initValueScale(){const t=this._computeDomainOfValueScale();if(t){const e=new qb;e.domain(t),this._valueScale=e}}_updateScaleRange(){var t,e;const i=this._startHandlerSize+this._endHandlerSize;if(!this._stateScale||!this._valueScale)return;let s;const n=this._isHorizontal?this.getLayoutRect().width-i:this.getLayoutRect().height-i,r=null!==(e=null===(t=this._relatedAxisComponent)||void 0===t?void 0:t.getScale().range())&&void 0!==e?e:[this._startHandlerSize/2,n+this._startHandlerSize/2];this._isHorizontal?(s=this._visible?[this._startHandlerSize/2,this._computeWidth()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeHeight()-this._middleHandlerSize,0])):"left"===this.layoutOrient?(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([this._computeWidth()-this._middleHandlerSize,0])):(s=this._visible?[this._startHandlerSize/2,this._computeHeight()-i+this._startHandlerSize/2]:r,this._stateScale.range(s),this._valueScale.range([0,this._computeWidth()-this._middleHandlerSize])),this._component&&!1!==this._cacheVisibility&&this._component.setAttributes({size:{width:this._computeWidth(),height:this._computeHeight()},position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y}})}_computeDomainOfValueScale(){const t=this._data.getLatestData().map((t=>t[this._valueField])),e=t.map((t=>1*t));return t.length?[ja(e),Ya(e)]:null}_computeMiddleHandlerSize(){var t,e,i,s;let n=0;if(null===(e=null===(t=this._spec)||void 0===t?void 0:t.middleHandler)||void 0===e?void 0:e.visible){const t=null!==(i=this._spec.middleHandler.icon.style.size)&&void 0!==i?i:8,e=null!==(s=this._spec.middleHandler.background.size)&&void 0!==s?s:40;n+=Math.max(t,e)}return n}_computeWidth(){return!1===this._visible?0:h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:this._backgroundSize+this._middleHandlerSize}_computeHeight(){return!1===this._visible?0:h(this._spec.height)?this._spec.height:this._isHorizontal?this._backgroundSize+this._middleHandlerSize:this.getLayoutRect().height-(this._startHandlerSize+this._endHandlerSize)/2}_isScaleValid(t){if(!t||!t.domain())return!1;const e=t.domain();return!(Jh(t.type)&&e[0]===Fa(e)||td(t.type)&&1===(i=e,i&&y(i)?Array.from(new Set(Ba(i))):i).length);var i}_getAttrs(t){var e,i,s,n,r;const a=null!==(e=this._spec)&&void 0!==e?e:{};return Object.assign({zIndex:this.layoutZIndex,start:this._start,end:this._end,position:{x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y},orient:this._orient,size:{width:this.getLayoutRect().width,height:this.getLayoutRect().height},showDetail:a.showDetail,brushSelect:null!==(i=a.brushSelect)&&void 0!==i&&i,zoomLock:null!==(s=a.zoomLock)&&void 0!==s&&s,minSpan:this._minSpan,maxSpan:this._maxSpan,delayType:a.delayType,delayTime:M(a.delayType)?null!==(n=a.delayTime)&&void 0!==n?n:30:0,realTime:null===(r=a.realTime)||void 0===r||r,previewData:t&&this._data.getLatestData(),previewPointsX:t&&this._dataToPositionX,previewPointsY:t&&this._dataToPositionY,tolerance:this._spec.tolerance},this._getComponentAttrs(t))}_createOrUpdateComponent(){if(this._visible){const t=this._isHorizontal?this._stateScale:this._valueScale,e=this._isHorizontal?this._valueScale:this._stateScale,i=this._isScaleValid(t)&&this._isScaleValid(e)&&!1!==this._spec.showBackgroundChart,s=this._getAttrs(i);if(this._component)this._component.setAttributes(s);else{const t=this.getContainer();this._component=new fG(s),this._isHorizontal?i&&this._component.setPreviewPointsY1(this._dataToPositionY2):i&&this._component.setPreviewPointsX1(this._dataToPositionX2),this._component.setStatePointToData((t=>this._statePointToData(t))),this._component.addEventListener("change",(t=>{const{start:e,end:i,tag:s}=t.detail;this._handleChange(e,i,void 0,s)})),t.add(this._component),this._updateScaleRange()}}}_handleChange(t,e,i,s){if(super._handleChange(t,e,i),this._shouldChange){i&&this._component&&this._component.setStartAndEnd(t,e),this._start=t,this._end=e;const n=this._statePointToData(t),r=this._statePointToData(e);(ys(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,n,r):this._handleStateChange(n,r,s))&&this.event.emit(Hd.dataZoomChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:t,end:e,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){var t;const e=this._data.getDataView();if(e.reRunAllTransform(),null===(t=this._component)||void 0===t||t.setPreviewData(e.latestData),this._valueScale){const t=this._computeDomainOfValueScale();t&&this._valueScale.domain(t)}}_getComponentAttrs(t){var e,i,s,n,r,a,o,l,h,d,c;const{middleHandler:u={},startText:p={},endText:g={},backgroundChart:m={},selectedBackgroundChart:_={}}=this._spec;return{backgroundStyle:BE(null===(e=this._spec.background)||void 0===e?void 0:e.style),startHandlerStyle:BE(null===(i=this._spec.startHandler)||void 0===i?void 0:i.style),middleHandlerStyle:u.visible?{visible:!0,icon:BE(null===(s=u.icon)||void 0===s?void 0:s.style),background:{size:null===(n=u.background)||void 0===n?void 0:n.size,style:BE(null===(r=u.background)||void 0===r?void 0:r.style)}}:{visible:!1},endHandlerStyle:BE(null===(a=this._spec.endHandler)||void 0===a?void 0:a.style),startTextStyle:{padding:p.padding,formatMethod:this._getHandlerTextFormatMethod(p),textStyle:BE(p.style)},endTextStyle:{padding:g.padding,formatMethod:this._getHandlerTextFormatMethod(g),textStyle:BE(g.style)},selectedBackgroundStyle:BE(this._spec.selectedBackground.style),dragMaskStyle:BE(null===(o=this._spec.dragMask)||void 0===o?void 0:o.style),backgroundChartStyle:t?{line:Tl(BE(null===(l=m.line)||void 0===l?void 0:l.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},BE(null===(h=m.area)||void 0===h?void 0:h.style))}:{line:{visible:!1},area:{visible:!1}},selectedBackgroundChartStyle:t?{line:Tl(BE(null===(d=_.line)||void 0===d?void 0:d.style),{fill:!1}),area:Object.assign({curveType:"basis",visible:!0},BE(null===(c=_.area)||void 0===c?void 0:c.style))}:{line:{visible:!1},area:{visible:!1}},disableTriggerEvent:this._option.disableTriggerEvent}}_getHandlerTextFormatMethod(t){const{formatMethod:e,formatter:i}=t,{formatFunc:s}=YE(e,i);return s?t=>s(t,{label:t},i):void 0}_getNeedClearVRenderComponents(){return[this._component]}clear(){if(this._component){const t=this.getContainer();this._component.removeAllChild(),t&&t.removeChild(this._component),this._component=null}super.clear()}}yG.type=r.dataZoom,yG.transformerConstructor=vG,yG.specKey="dataZoom";class bG extends lG{constructor(t,e){var i;super(t,e),this.type=r.scrollBar,this.name=r.scrollBar,this.specKey="scrollBar",this.layoutZIndex=Ey.DataZoom,this.layoutLevel=Dy.DataZoom,this.layoutType="region-relative",this._filterMode=null!==(i=t.filterMode)&&void 0!==i?i:"axis"}setAttrFromSpec(){super.setAttrFromSpec(),v(this._spec.roam)&&(this._zoomAttr.enable=!1,this._dragAttr.enable=this._spec.roam,this._scrollAttr.enable=this._spec.roam),(this._zoomAttr.enable||this._dragAttr.enable||this._scrollAttr.enable)&&this.initZoomable(this.event,this._option.mode)}onLayoutEnd(t){var e,i;this._updateScaleRange(),null===(i=(e=this.effect).onZoomChange)||void 0===i||i.call(e),super.onLayoutEnd(t)}_updateScaleRange(){this._component&&this._component.setAttributes({x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height})}_computeWidth(){return h(this._spec.width)?this._spec.width:this._isHorizontal?this.getLayoutRect().width:12}_computeHeight(){return h(this._spec.height)?this._spec.height:this._isHorizontal?12:this.getLayoutRect().height}_getAttrs(){var t,e,i,s,n,r;return Object.assign({zIndex:this.layoutZIndex,x:this.getLayoutStartPoint().x,y:this.getLayoutStartPoint().y,width:this.getLayoutRect().width,height:this.getLayoutRect().height,range:[this._start,this._end],direction:this._isHorizontal?"horizontal":"vertical",delayType:null===(t=this._spec)||void 0===t?void 0:t.delayType,delayTime:M(null===(e=this._spec)||void 0===e?void 0:e.delayType)?null!==(s=null===(i=this._spec)||void 0===i?void 0:i.delayTime)&&void 0!==s?s:30:0,realTime:null===(r=null===(n=this._spec)||void 0===n?void 0:n.realTime)||void 0===r||r},this._getComponentAttrs())}_createOrUpdateComponent(){const t=this._getAttrs();if(this._component)this._component.setAttributes(t);else{const e=this.getContainer();this._component=new XV(t),this._component.addEventListener("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])})),e.add(this._component)}}_handleChange(t,e,i){super._handleChange(t,e,i);const s=gd(this._start,t)&&gd(this._end,e);if(this._shouldChange&&!s){i&&this._component&&this._component.setAttribute("range",[t,e]),this._start=t,this._end=e;const s=this._statePointToData(t),n=this._statePointToData(e);(ys(this._spec.updateDataAfterChange)?this._spec.updateDataAfterChange(t,e,s,n):this._handleStateChange(this._statePointToData(t),this._statePointToData(e)))&&this.event.emit(Hd.scrollBarChange,{model:this,value:{filterData:"axis"!==this._filterMode,start:this._start,end:this._end,startValue:this._startValue,endValue:this._endValue,newDomain:this._newDomain}})}}_handleDataCollectionChange(){}_initCommonEvent(){super._initCommonEvent(),this._component&&this._component.on("scrollDrag",(t=>{const e=t.detail.value;this._handleChange(e[0],e[1])}))}_getComponentAttrs(){const{rail:t,slider:e,innerPadding:i}=this._spec,s={};return D(i)||(s.padding=i),Ym(null==t?void 0:t.style)||(s.railStyle=BE(t.style)),Ym(null==e?void 0:e.style)||(s.sliderStyle=BE(e.style)),s.disableTriggerEvent=this._option.disableTriggerEvent,s}_getNeedClearVRenderComponents(){return[this._component]}}bG.type=r.scrollBar,bG.specKey="scrollBar";const xG=(t,e)=>{const{datum:i,title:s,content:n}=e,r=[],a=i.call(null);return s.visible&&r.push({type:"title",index:0,datum:a,spec:s}),Ba(n).forEach(((t,e)=>{t.visible&&r.push({type:"content",index:e,datum:a,spec:t})})),r},SG={title:{style:{text:"",fontSize:20,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}},content:{style:{text:"",fontSize:16,fill:"black",fontWeight:"normal",fillOpacity:1,textBaseline:"top",textAlign:"center"}}};u_(),df(),ek();class MG extends Rk{constructor(){super(...arguments),this.name="indicator"}_renderText(t,e,i,s,n,r){if(!1!==e.visible){const a=E({},Ud(SG,n),e.style,{visible:e.visible});a.lineHeight=M(a.lineHeight)?a.lineHeight:a.fontSize,e.formatMethod&&(a._originText=a.text,a.text=e.formatMethod(a.text,a));const o=iA(a);return o.name=r,t.appendChild(o),e.autoFit&&qo(i)&&this._setLocalAutoFit(i,o,e),e.autoLimit&&qo(s)&&o.setAttribute("maxLineWidth",i),o}}render(){var t,e;if(this.removeAllChild(!0),!0!==this.attribute.visible)return;const{title:i={},content:s,size:n,limitRatio:r=1/0}=this.attribute,a=Math.min(n.width,n.height)*r,o=this.createOrUpdateChild("indicator-container",{x:0,y:0,zIndex:1,pickable:null===(t=this.attribute.pickable)||void 0===t||t},"group");if(M(i)&&(this._title=this._renderText(o,i,a,r,"title.style","indicator-title")),M(s)){const t=Ba(s),e=[];t.forEach(((t,i)=>{!1!==t.visible&&e.push(this._renderText(o,t,a,r,"content.style","indicator-content-"+i))})),this._content=e}this._setGlobalAutoFit(a),this._setYPosition();const l=null!==(e=null==o?void 0:o.AABBBounds.height())&&void 0!==e?e:0;o.setAttribute("y",n.height/2-l/2),o.setAttribute("x",n.width/2)}_setLocalAutoFit(t,e,i){var s,n,r,a,o,l,h,d,c;if("default"!==(null!==(s=i.fitStrategy)&&void 0!==s?s:"default"))return;const u=Qk(null!==(r=null===(n=i.style)||void 0===n?void 0:n.text)&&void 0!==r?r:"",null!==(a=i.style)&&void 0!==a?a:{},null===(l=null===(o=this.stage)||void 0===o?void 0:o.getTheme())||void 0===l?void 0:l.text).width;if(u>0){const s=t*(null!==(h=i.fitPercent)&&void 0!==h?h:.5)/u,n=Math.floor((null!==(c=null===(d=i.style)||void 0===d?void 0:d.fontSize)&&void 0!==c?c:20)*s);e.setAttribute("fontSize",n),e.setAttribute("lineHeight",M(i.style.lineHeight)?i.style.lineHeight:n)}}_setGlobalAutoFit(t){var e,i,s,n,r,a,o;const l=t/2,h=[];let d=0;const c=null!==(e=this.attribute.title)&&void 0!==e?e:{};c.autoFit&&"inscribed"===c.fitStrategy?(this._title.setAttribute("fontSize",12),h.push({text:this._title,spec:null!==(i=this.attribute.title)&&void 0!==i?i:{}})):d+=null!==(a=null===(r=null===(n=null===(s=this._title)||void 0===s?void 0:s.AABBBounds)||void 0===n?void 0:n.height)||void 0===r?void 0:r.call(n))&&void 0!==a?a:0;const u=null!==(o=c.space)&&void 0!==o?o:0;if(d+=u,Ba(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i,s,n,r;const a=this._content[e];t.autoFit&&"inscribed"===t.fitStrategy?(a.setAttribute("fontSize",12),h.push({text:a,spec:t})):d+=null!==(n=null===(s=null===(i=null==a?void 0:a.AABBBounds)||void 0===i?void 0:i.height)||void 0===s?void 0:s.call(i))&&void 0!==n?n:0;const o=null!==(r=t.space)&&void 0!==r?r:0;d+=o})),h.length<=0)return;const p=12/h.reduce(((t,e)=>Math.max(t,e.text.AABBBounds.width())),0)*h.length,g=d/2,m=p**2+1,_=2*g*p,f=g**2-l**2,v=2*(p*((-_+Math.sqrt(_**2-4*m*f))/(2*m))+g),y=(v-d)/h.length;qo(v)&&h.forEach((t=>{var e;const i=null===(e=t.spec.style)||void 0===e?void 0:e.lineHeight;t.text.setAttribute("fontSize",y),t.text.setAttribute("lineHeight",M(i)?i:y)}))}_setYPosition(){var t,e,i,s,n,r;let a=0;const o=null!==(s=null===(i=null===(e=null===(t=this._title)||void 0===t?void 0:t.AABBBounds)||void 0===e?void 0:e.height)||void 0===i?void 0:i.call(e))&&void 0!==s?s:0,l=null!==(r=null===(n=this.attribute.title)||void 0===n?void 0:n.space)&&void 0!==r?r:0;Ba(this.attribute.content).filter((t=>!1!==t.visible)).forEach(((t,e)=>{var i;const s=this._content[e];s.setAttribute("y",o+l+a);const n=null!==(i=t.space)&&void 0!==i?i:0;a+=s.AABBBounds.height()+n}))}}class kG extends tD{constructor(){super(...arguments),this.type=r.indicator,this.name=r.indicator,this.specKey="indicator",this.layoutType="none",this.layoutZIndex=Ey.Indicator,this.layoutLevel=Dy.Indicator,this._gap=0,this._activeDatum=null}static getSpecInfo(t){return jE(t,this.specKey,this.type,(t=>t&&!1!==t.visible))}created(){super.created(),this.initData(),this.initEvent()}setAttrFromSpec(){super.setAttrFromSpec(),this._gap=this._spec.gap||0,this._title=this._spec.title,this._content=Ba(this._spec.content),this._regions=this._option.getRegionsInUserIdOrIndex(Ba(this._spec.regionId),Ba(this._spec.regionIndex))}onRender(t){}changeRegions(t){}initEvent(){var t;if(this._option.disableTriggerEvent)return;if("none"===this._spec.trigger)return;const e=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();e&&("hover"===this._spec.trigger?(e.addEventListener("element-highlight:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-highlight:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))):(e.addEventListener("element-select:start",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(t.elements[0].getDatum())})),e.addEventListener("element-select:reset",(t=>{this.isRelativeModel(t.options.regionId)&&this.updateDatum(null)}))))}updateDatum(t){this._activeDatum=t,this._displayData.updateData();const e=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(e)}initData(){Lp(this._option.dataSet,"indicatorFilter",xG);const t=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});t.transform({type:"indicatorFilter",options:{title:this._title,content:this._content,datum:()=>this._activeDatum}}),t.target.addListener("change",this.updateDatum.bind(this)),this._displayData=new px(this._option,t)}updateLayoutAttribute(){const t=this._getIndicatorAttrs();this._createOrUpdateIndicatorComponent(t),super.updateLayoutAttribute()}_getIndicatorAttrs(){if(!1===this._spec.visible||!1===this._spec.fixed&&null===this._activeDatum)return{visible:!1};const t=this._regions[0],{width:e,height:i}=t.getLayoutRect(),{x:s,y:n}=t.getLayoutStartPoint(),r=this._spec,{content:a,offsetX:o,offsetY:l,limitRatio:h,title:d}=r,c=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=Tl({},this._theme.content,t);u.push({visible:!1!==e.visible&&(!e.field||null!==this._activeDatum),space:e.space||this._gap,autoLimit:e.autoLimit,autoFit:e.autoFit,fitPercent:e.fitPercent,fitStrategy:e.fitStrategy,style:Object.assign(Object.assign({},IE(eD(e.style,["text"]),this._activeDatum)),{text:this._createText(e.field,e.style.text)})})})),Object.assign({visible:!0,size:{width:e,height:i},zIndex:this.layoutZIndex,x:s,y:n,dx:o?rl(o,this._computeLayoutRadius()):0,dy:l?rl(l,this._computeLayoutRadius()):0,limitRatio:h||1/0,title:{visible:!1!==d.visible&&(!M(d.field)||null!==this._activeDatum),space:d.space||this._gap,autoLimit:d.autoLimit,autoFit:d.autoFit,fitPercent:d.fitPercent,fitStrategy:d.fitStrategy,style:Object.assign(Object.assign({},IE(eD(d.style,["text"]),this._activeDatum)),{text:this._createText(d.field,d.style.text)})},content:u},c)}_createOrUpdateIndicatorComponent(t){if(this._indicatorComponent)Im(t,this._cacheAttrs)||this._indicatorComponent.setAttributes(t);else{const e=this.getContainer(),i=new MG(t);i.name="indicator",e.add(i),this._indicatorComponent=i,this._indicatorComponent.on("*",((t,e)=>this._delegateEvent(this._indicatorComponent,t,e)))}return this._cacheAttrs=t,this._indicatorComponent}_createText(t,e){var i;return t?this._activeDatum?this._activeDatum[t]:"":ys(e)?null!==(i=e(this._activeDatum,void 0))&&void 0!==i?i:"":null!=e?e:""}_computeLayoutRadius(){const t=this._regions[0],{width:e,height:i}=t.getLayoutRect();return Math.min(e/2,i/2)}isRelativeModel(t){return this._regions.some((e=>e.id===t))}_getNeedClearVRenderComponents(){return[this._indicatorComponent]}clear(){this._cacheAttrs=null,super.clear()}getIndicatorComponent(){return this._indicatorComponent}}kG.type=r.indicator,kG.specKey="indicator";const AG=["sum","average","min","max","variance","standardDeviation","median"];function wG(t,e,i){if(!i)return!1;const s=t.map((t=>1*t)),n=ja(s),r=Ya(s);return er}function TG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.x)&&wG(e,t.x,i)&&(null===(o=null==l?void 0:(a=l.getXAxisHelper()).setExtendDomain)||void 0===o||o.call(a,"marker_xAxis_extend",t.x)),d=tl(t.x)?DG(t.x,n)+r.x:l.getXAxisHelper().dataToPosition([t.x])+r.x,d}function LG(t,e,i,s,n,r){var a,o;const{relativeSeries:l}=s;let d;return h(t.y)&&wG(e,t.y,i)&&(null===(o=null===(a=l.getYAxisHelper())||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",t.y)),d=tl(t.y)?DG(t.y,n)+r.y:l.getYAxisHelper().dataToPosition([t.y])+r.y,d}function CG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.angle)&&wG(e,t.angle,i)&&(null===(r=null===(n=a.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_angleAxis_extend",t.angle)),a.angleAxisHelper.dataToPosition([t.angle])}function EG(t,e,i,s){var n,r;const{relativeSeries:a}=s;return h(t.radius)&&wG(e,t.radius,i)&&(null===(r=null===(n=a.radiusAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_radiusAxis_extend",t.radius)),a.radiusAxisHelper.dataToPosition([t.radius])}function DG(t,e){return Number(t.substring(0,t.length-1))*e/100}function PG(t){return AG.includes(t)}function OG(t,e,i,s,n){const r=e.getRegion(),a=r.getLayoutStartPoint(),o=i.getRegion(),l=o.getLayoutStartPoint(),h=Math.abs(Math.min(a.x,l.x)-Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width)),d=Math.abs(Math.min(a.y,l.y)-Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height)),c={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},u=[],p=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,g=s.getXAxisHelper().getScale(0).domain(),m=s.getYAxisHelper().getScale(0).domain();return p.forEach((t=>{const e=M(t.x),i=M(t.y);if(e&&i){const e=TG(t,g,n,c,h,a),i=LG(t,m,n,c,d,a);u.push([{x:e,y:i}])}else if(e){const e=TG(t,g,n,c,h,a),i=Math.max(a.y+r.getLayoutRect().height,l.y+o.getLayoutRect().height),s=Math.min(a.y,l.y);u.push([{x:e,y:i},{x:e,y:s}])}else if(i){const e=Math.min(a.x,l.x),i=LG(t,m,n,c,d,a),s=Math.max(a.x+r.getLayoutRect().width,l.x+o.getLayoutRect().width);u.push([{x:e,y:i},{x:s,y:i}])}})),u}function RG(t,e,i,s,n){const r={relativeSeries:s,startRelativeSeries:e,endRelativeSeries:i},a=[],o=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,l=s.angleAxisHelper.getScale(0).domain(),h=s.radiusAxisHelper.getScale(0).domain(),d=Math.min(s.getRegion().getLayoutRect().width/2,s.getRegion().getLayoutRect().height/2);return o.forEach((t=>{const e=M(t.angle),i=M(t.radius);if(e&&i){const e=CG(t,l,n,r),i=EG(t,h,n,r);a.push([{angle:e,radius:i}])}else if(e){const e=CG(t,l,n,r);a.push([{angle:e,radius:-d},{angle:e,radius:d}])}else if(i){const e=EG(t,h,n,r);a.push([{radius:e,angle:0},{radius:e,angle:2*Math.PI}])}})),a}function IG(t,e){const i=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{M(t.areaName)&&i.push([{x:e.nameValueToPosition(t.areaName).x+e.getRegion().getLayoutStartPoint().x,y:e.nameValueToPosition(t.areaName).y+e.getRegion().getLayoutStartPoint().y}])})),i}function BG(t,e,i,s){const n=[],r=t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData,a=y(s);return r.forEach(((t,r)=>{var o,l,d,c;const u=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,p=u.getRegion(),g=p.getLayoutStartPoint(),{width:m,height:_}=p.getLayoutRect();let f=0,v=0;if(s){const t=a?s[r]:s,e=t.x,i=t.y;e&&(f=tl(e)?Number(e.substring(0,e.length-1))*m/100:e),i&&(v=tl(i)?Number(i.substring(0,i.length-1))*_/100:i)}const y=u.getXAxisHelper().getScale(0).domain(),b=u.getYAxisHelper().getScale(0).domain(),x=Ba(t.x),S=Ba(t.y);1===x.length&&h(x[0])&&wG(y,x[0],i)&&(null===(l=null===(o=u.getXAxisHelper())||void 0===o?void 0:o.setExtendDomain)||void 0===l||l.call(o,"marker_xAxis_extend",x[0])),1===S.length&&h(S[0])&&wG(b,S[0],i)&&(null===(c=null===(d=u.getYAxisHelper())||void 0===d?void 0:d.setExtendDomain)||void 0===c||c.call(d,"marker_yAxis_extend",S[0])),n.push({x:u.getXAxisHelper().dataToPosition(x)+g.x+f,y:u.getYAxisHelper().dataToPosition(S)+g.y+v})})),n}function FG(t,e,i){const s=[];return(t.latestData[0]&&t.latestData[0].latestData?t.latestData[0].latestData:t.latestData).forEach((t=>{var n,r,a,o;const l=(null==t?void 0:t.getRefRelativeSeries)?t.getRefRelativeSeries():e,d=l.angleAxisHelper.getScale(0).domain(),c=l.radiusAxisHelper.getScale(0).domain(),u=Ba(t.angle),p=Ba(t.radius);1===u.length&&h(u[0])&&wG(d,u[0],i)&&(null===(r=null===(n=l.angleAxisHelper)||void 0===n?void 0:n.setExtendDomain)||void 0===r||r.call(n,"marker_xAxis_extend",u[0])),1===p.length&&h(p[0])&&wG(c,p[0],i)&&(null===(o=null===(a=l.radiusAxisHelper)||void 0===a?void 0:a.setExtendDomain)||void 0===o||o.call(a,"marker_yAxis_extend",p[0])),s.push({angle:l.angleAxisHelper.dataToPosition(u),radius:l.radiusAxisHelper.dataToPosition(p)})})),s}function YG(t,e,i){let{x:s,y:n}=t;return tl(s)&&(s=DG(s,e)),tl(n)&&(n=DG(n,i)),{x:s,y:n}}function jG(t,e,i){let s;if(s=ys(t)?Ba(t(e.getData().getLatestData(),e)):Ba(t),i){const t=e.getRegion(),{x:i,y:n}=t.getLayoutStartPoint(),{width:r,height:a}=t.getLayoutRect();return s.map((t=>{let{x:e,y:s}=YG(t,r,a);return e+=i,s+=n,{x:e,y:s}}))}const{width:n,height:r}=e.getOption().getChart().getViewRect();return s.map((t=>YG(t,n,r)))}function HG(t){let e=1/0,i=-1/0,s=1/0,n=-1/0;return t.forEach((t=>{const r=t.getLayoutStartPoint(),a=t.getLayoutRect();r.xi&&(i=r.x+a.width),r.yn&&(n=r.y+a.height)})),{minX:e,maxX:i,minY:s,maxY:n}}function zG(t,e){const{labelBackground:i={},style:s,shape:n}=t,r=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);nn&&(d=n-l),h>r&&(c=r-h),{dx:d,dy:c}}function ZG(t,e){const{dx:i,dy:s}=qG(t,e),{dx:n=0,dy:r=0}=t.attribute;i&&t.setAttribute("dx",i+n),s&&t.setAttribute("dy",s+r)}class JG extends Rk{constructor(){super(...arguments),this.name="marker",this._onHover=t=>{this._lastHover=OD(t,this._container,this._lastHover)},this._onUnHover=t=>{this._lastHover=RD(0,this._container,this._lastHover)},this._onClick=t=>{this._lastSelect=ID(t,this._container,this._lastSelect)}}transAnimationConfig(){var t,e,i;if(!1!==this.attribute.animation){const s=vs(this.attribute.animation)?this.attribute.animation:{};this._animationConfig={enter:E({},this.defaultUpdateAnimation,s,null!==(t=this.attribute.animationEnter)&&void 0!==t?t:{}),exit:E({},this.defaultExitAnimation,s,null!==(e=this.attribute.animationExit)&&void 0!==e?e:{}),update:E({},this.defaultUpdateAnimation,s,null!==(i=this.attribute.animationUpdate)&&void 0!==i?i:{})}}}setAttribute(t,e,i){super.setAttribute(t,e,i),"visible"===t&&this.render()}_bindEvent(){var t,e,i;if(!this.attribute.interactive)return;const{hover:s,select:n}=this.attribute;s&&(null===(t=this._container)||void 0===t||t.addEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.addEventListener("pointerout",this._onUnHover)),n&&(null===(i=this._container)||void 0===i||i.addEventListener("pointerdown",this._onClick))}_releaseEvent(){var t,e,i;null===(t=this._container)||void 0===t||t.removeEventListener("pointermove",this._onHover),null===(e=this._container)||void 0===e||e.removeEventListener("pointerout",this._onUnHover),null===(i=this._container)||void 0===i||i.removeEventListener("pointerdown",this._onClick)}_initContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;let n;if(s){const s=ra.group(Object.assign(Object.assign({},i),{clip:!0,pickable:!1}));n=ra.group({x:-(null!==(t=i.x)&&void 0!==t?t:0),y:-(null!==(e=i.y)&&void 0!==e?e:0),pickable:!1}),s.add(n),this._containerClip=s,this.add(s)}else n=ra.group({x:0,y:0,pickable:!1}),this.add(n);n.name="marker-container",this._container=n}_updateContainer(){var t,e;const{limitRect:i={},clipInRange:s}=this.attribute;this._containerClip&&this._containerClip.setAttributes(Object.assign({},i)),this._container.setAttributes({x:s?-(null!==(t=i.x)&&void 0!==t?t:0):0,y:s?-(null!==(e=i.y)&&void 0!==e?e:0):0})}render(){var t;this.transAnimationConfig(),this.setAttribute("pickable",!1);const e=null===(t=this.attribute.visible)||void 0===t||t;!1===this.attribute.interactive&&this.setAttribute("childrenPickable",!1),e&&this.isValidPoints()?this._container?(this._updateContainer(),this.updateMarker(),this.markerAnimate("update")):(this._initContainer(),this.initMarker(this._container),this.markerAnimate("enter")):(this.markerAnimate("exit"),this._container=null,this.removeAllChild(!0)),this._releaseEvent(),this._bindEvent()}release(){this.markerAnimate("exit"),super.release(),this._releaseEvent(),this._container=null}}function QG(t,e,i,s){var n,r,a,o,l;if(!t)return;null===(n=null==t?void 0:t.animates)||void 0===n||n.forEach((t=>t.stop("end")));const h=null!==(a=null===(r=t.attribute)||void 0===r?void 0:r.fillOpacity)&&void 0!==a?a:1,d=null!==(l=null===(o=t.attribute)||void 0===o?void 0:o.strokeOpacity)&&void 0!==l?l:1;t.setAttributes({fillOpacity:0,strokeOpacity:0}),t.animate().wait(e).to({fillOpacity:h,strokeOpacity:d},i,s)}function tU(t,e,i,s){t&&(QG(t.startSymbol,e,i,s),t.lines.forEach((t=>QG(t,e,i,s))),QG(t.line,e,i,s),QG(t.endSymbol,e,i,s))}function eU(t,e,i,s){t&&(QG(t.getTextShape(),e,i,s),QG(t.getBgRect(),e,i,s))}function iU(t,e,i,s){var n,r,a,o;t&&(t.setAttributes({fillOpacity:null!==(r=null===(n=t.attribute)||void 0===n?void 0:n.fillOpacity)&&void 0!==r?r:1,strokeOpacity:null!==(o=null===(a=t.attribute)||void 0===a?void 0:a.strokeOpacity)&&void 0!==o?o:1}),t.animate().wait(e).to({fillOpacity:0,strokeOpacity:0},i,s))}function sU(t,e,i,s){t&&(iU(t.startSymbol,e,i,s),t.lines.forEach((t=>iU(t,e,i,s))),iU(t.line,e,i,s),iU(t.endSymbol,e,i,s))}function nU(t,e,i,s){t&&(iU(t.getTextShape(),e,i,s),iU(t.getBgRect(),e,i,s))}function rU(t,e,i,s,n){const r=.1*i,a=.7*i,o=.1*i,l=.1*i;QG(t.startSymbol,s,r,n),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const o=a/t.lines.length;e.animate().wait(s+r+i*o).to({clipRange:1},o,n)})),QG(t.endSymbol,s+r+a,o,n),QG(e.getTextShape(),s+r+a+o,l,n),QG(e.getBgRect(),s+r+a+o,l,n)}function aU(t,e,i,s,n){tU(t,s,i,n),eU(e,s,i,n)}function oU(t,e,i,s,n){QG(t,s,i,n),eU(e,s,i,n)}function lU(t,e,i,s,n){QG(t,s,i,n),eU(e,s,i,n)}function hU(t,e,i,s,n,r){var a;tU(t,n,s,r),QG(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?eU(i,n,s,r):QG(i,n,s,r)}function dU(t,e,i,s,n,r){var a;const o=.1*s,l=.65*s,h=.05*s,d=.1*s,c=.1*s;QG(t.startSymbol,n,o,r),t.lines.forEach((t=>t.setAttribute("clipRange",0))),t.lines.forEach(((e,i)=>{const s=l/t.lines.length;e.animate().wait(n+o+i*s).to({clipRange:1},s,r)})),QG(e,n+o+l,h,r),QG(t.endSymbol,n+o+l+h,d,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?(QG(i.getTextShape(),n+o+l+h+d,c,r),QG(i.getBgRect(),n+o+l+d,c,r)):QG(i,n+o+l+d,c,r)}function cU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"clipIn"===i?rU(t,e,s,r,a):"fadeIn"===i&&aU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"clipIn"===i?rU(t,e,s,n,a):"fadeIn"===i&&aU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){sU(t,s,i,n),nU(e,s,i,n)}(t,e,i,s,n)}}function uU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&oU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&oU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){iU(t,s,i,n),nU(e,s,i,n)}(t,e,i,s,n)}}function pU(t,e,i,s){const{enter:n,update:r,exit:a}=i;if("enter"===s){const{type:i,duration:s,delay:r,easing:a}=n;"fadeIn"===i&&lU(t,e,s,r,a)}else if("update"===s){const{type:i,duration:s,delay:n,easing:a}=r;"fadeIn"===i&&lU(t,e,s,n,a)}else if("exit"===s){const{duration:i,delay:s,easing:n}=a;!function(t,e,i,s,n){iU(t,s,i,n),nU(e,s,i,n)}(t,e,i,s,n)}}function gU(t,e,i,s){const[n,r]=t,{enter:a,update:o,exit:l}=i;if("enter"===s){const{type:t,duration:i,delay:s,easing:o}=a;"fadeIn"===t?hU(n,r,e,i,s,o):"callIn"===t&&dU(n,r,e,i,s,o)}else if("update"===s){const{type:t,duration:i,delay:s,easing:a}=o;"fadeIn"===t?hU(n,r,e,i,s,a):"callIn"===t&&dU(n,r,e,i,s,a)}else if("exit"===s){const{duration:t,delay:i,easing:s}=l;!function(t,e,i,s,n,r){var a;sU(t,n,s,r),iU(e,n,s,r),(null===(a=i.getTextShape)||void 0===a?void 0:a.call(i))?nU(i,n,s,r):iU(i,n,s,r)}(n,r,e,t,i,s)}}const mU={type:"clipIn",duration:500,easing:"linear",delay:0},_U={type:"fadeIn",duration:500,easing:"linear",delay:0},fU={type:"callIn",duration:500,easing:"linear",delay:0},vU={type:"fadeOut",duration:500,easing:"linear",delay:0};class yU extends JG{constructor(){super(...arguments),this.name="markCommonLine",this.defaultUpdateAnimation=mU,this.defaultExitAnimation=vU}getLine(){return this._line}getLabel(){return this._label}setLabelPos(){const{label:t={},limitRect:e}=this.attribute,{position:i,confine:s,autoRotate:n}=t,r=this.getPointAttrByPosition(i),a=i.toString().toLocaleLowerCase().includes("start")?this._line.getStartAngle()||0:this._line.getEndAngle()||0;if(this._label.setAttributes(Object.assign(Object.assign({},r.position),{angle:n?this.getRotateByAngle(r.angle):0,textStyle:Object.assign(Object.assign({},this.getTextStyle(i,a,n)),t.textStyle)})),e&&s){const{x:t,y:i,width:s,height:n}=e;ZG(this._label,{x1:t,y1:i,x2:t+s,y2:i+n})}}initMarker(t){const{label:e,state:i}=this.attribute,s=this.createSegment();s.name="mark-common-line-line",this._line=s,t.add(s);const n=new TD(Object.assign(Object.assign({},e),{state:{panel:E({},qk,null==i?void 0:i.labelBackground),text:E({},qk,null==i?void 0:i.label)}}));n.name="mark-common-line-label",this._label=n,t.add(n),this.setLabelPos()}updateMarker(){const{label:t,state:e}=this.attribute;this.setLineAttributes(),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},t),{state:{panel:E({},qk,null==e?void 0:e.labelBackground),text:E({},qk,null==e?void 0:e.label)}})),this.setLabelPos())}}var bU,xU,SU,MU;!function(t){t.start="start",t.startTop="startTop",t.startBottom="startBottom",t.insideStart="insideStart",t.insideStartTop="insideStartTop",t.insideStartBottom="insideStartBottom",t.middle="middle",t.insideMiddleTop="insideMiddleTop",t.insideMiddleBottom="insideMiddleBottom",t.end="end",t.endTop="endTop",t.endBottom="endBottom",t.insideEnd="insideEnd",t.insideEndTop="insideEndTop",t.insideEndBottom="insideEndBottom"}(bU||(bU={})),function(t){t.left="left",t.right="right",t.top="top",t.bottom="bottom",t.middle="middle",t.insideLeft="insideLeft",t.insideRight="insideRight",t.insideTop="insideTop",t.insideBottom="insideBottom"}(xU||(xU={})),function(t){t.arcInnerStart="arcInnerStart",t.arcInnerEnd="arcInnerEnd",t.arcInnerMiddle="arcInnerMiddle",t.arcOuterStart="arcOuterStart",t.arcOuterEnd="arcOuterEnd",t.arcOuterMiddle="arcOuterMiddle",t.center="center"}(SU||(SU={})),function(t){t.top="top",t.bottom="bottom",t.middle="middle",t.insideTop="insideTop",t.insideBottom="insideBottom",t.insideMiddle="insideMiddle"}(MU||(MU={}));const kU=.001,AU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:bU.end,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},wU={postiveXAxis:{start:{textAlign:"left",textBaseline:"middle"},startTop:{textAlign:"left",textBaseline:"bottom"},startBottom:{textAlign:"left",textBaseline:"top"},insideStart:{textAlign:"right",textBaseline:"middle"},insideStartTop:{textAlign:"right",textBaseline:"bottom"},insideStartBottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"left",textBaseline:"middle"},endTop:{textAlign:"left",textBaseline:"bottom"},endBottom:{textAlign:"left",textBaseline:"top"},insideEnd:{textAlign:"right",textBaseline:"middle"},insideEndTop:{textAlign:"right",textBaseline:"bottom"},insideEndBottom:{textAlign:"right",textBaseline:"top"}},negativeXAxis:{start:{textAlign:"right",textBaseline:"middle"},startTop:{textAlign:"right",textBaseline:"bottom"},startBottom:{textAlign:"right",textBaseline:"top"},insideStart:{textAlign:"left",textBaseline:"middle"},insideStartTop:{textAlign:"left",textBaseline:"bottom"},insideStartBottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"center",textBaseline:"middle"},insideMiddleTop:{textAlign:"center",textBaseline:"bottom"},insideMiddleBottom:{textAlign:"center",textBaseline:"top"},end:{textAlign:"right",textBaseline:"middle"},endTop:{textAlign:"right",textBaseline:"bottom"},endBottom:{textAlign:"right",textBaseline:"top"},insideEnd:{textAlign:"left",textBaseline:"middle"},insideEndTop:{textAlign:"left",textBaseline:"bottom"},insideEndBottom:{textAlign:"left",textBaseline:"top"}}},TU={interactive:!0,startSymbol:{visible:!1,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},endSymbol:{visible:!0,symbolType:"triangle",size:12,fill:"rgba(46, 47, 50)",lineWidth:0},label:{position:SU.arcOuterMiddle,refX:0,refY:0,refAngle:0,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},lineStyle:{stroke:"#b2bacf",lineWidth:1,lineDash:[2]}},LU={interactive:!0,label:{position:xU.right,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},CU={interactive:!0,label:{position:SU.arcOuterMiddle,textStyle:{fill:"#fff",stroke:"#fff",lineWidth:0,fontSize:10,fontWeight:"normal",fontStyle:"normal"},padding:[2,2,4,4],panel:{visible:!0,cornerRadius:0,fill:"rgb(48, 115, 242)",fillOpacity:.8}},areaStyle:{fill:"#b2bacf",visible:!0}},EU={arcInnerStart:{textAlign:"center",textBaseline:"bottom"},arcInnerEnd:{textAlign:"center",textBaseline:"bottom"},arcInnerMiddle:{textAlign:"center",textBaseline:"bottom"},arcOuterStart:{textAlign:"center",textBaseline:"top"},arcOuterEnd:{textAlign:"center",textBaseline:"top"},arcOuterMiddle:{textAlign:"center",textBaseline:"top"},center:{textAlign:"center",textBaseline:"middle"}},DU={left:{textAlign:"right",textBaseline:"middle"},insideLeft:{textAlign:"left",textBaseline:"middle"},right:{textAlign:"left",textBaseline:"middle"},insideRight:{textAlign:"right",textBaseline:"middle"},top:{textAlign:"center",textBaseline:"bottom"},insideTop:{textAlign:"center",textBaseline:"top"},bottom:{textAlign:"center",textBaseline:"top"},insideBottom:{textAlign:"center",textBaseline:"bottom"},middle:{textAlign:"center",textBaseline:"middle"}},PU={postiveXAxis:{top:{textAlign:"left",textBaseline:"bottom"},bottom:{textAlign:"left",textBaseline:"top"},middle:{textAlign:"left",textBaseline:"middle"},insideTop:{textAlign:"right",textBaseline:"bottom"},insideBottom:{textAlign:"right",textBaseline:"top"},insideMiddle:{textAlign:"right",textBaseline:"middle"}},negativeXAxis:{top:{textAlign:"right",textBaseline:"bottom"},bottom:{textAlign:"right",textBaseline:"top"},middle:{textAlign:"right",textBaseline:"middle"},insideTop:{textAlign:"left",textBaseline:"bottom"},insideBottom:{textAlign:"left",textBaseline:"top"},insideMiddle:{textAlign:"left",textBaseline:"middle"}}};function OU(){RU._animate=cU}KG(),mD();class RU extends yU{markerAnimate(t){RU._animate&&this._animationConfig&&RU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},RU.defaultAttributes,t)),this.name="markLine"}getPointAttrByPosition(t){var e;const{label:i={}}=this.attribute,{refX:s=0,refY:n=0}=i,r=this._line.getMainSegmentPoints(),a=null!==(e=this._line.getEndAngle())&&void 0!==e?e:0,o=(Vk(a),a),l=s*Math.cos(o)+n*Math.cos(o-Math.PI/2),h=s*Math.sin(o)+n*Math.sin(o-Math.PI/2);return t.includes("start")||t.includes("Start")?{position:{x:r[0].x+l,y:r[0].y+h},angle:o}:t.includes("middle")||t.includes("Middle")?{position:{x:(r[0].x+r[r.length-1].x)/2+l,y:(r[0].y+r[r.length-1].y)/2+h},angle:o}:{position:{x:r[r.length-1].x+l,y:r[r.length-1].y+h},angle:o}}getRotateByAngle(t){var e;return(Vk(t)?t:t-Math.PI)+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}getTextStyle(t,e,i){return Wk(Math.abs(e),Math.PI/2,kU)||Wk(Math.abs(e),3*Math.PI/2,kU)?Gk(i,e,t):Vk(e)?wU.postiveXAxis[t]:wU.negativeXAxis[t]}createSegment(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;return new fD({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,pickable:!1,state:{line:E({},qk,null==a?void 0:a.line),startSymbol:E({},qk,null==a?void 0:a.lineStartSymbol),endSymbol:E({},qk,null==a?void 0:a.lineEndSymbol)}})}setLineAttributes(){const{points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:a}=this.attribute;this._line&&this._line.setAttributes({points:t,startSymbol:e,endSymbol:i,lineStyle:s,mainSegmentIndex:n,multiSegment:r,state:{line:E({},qk,null==a?void 0:a.line),startSymbol:E({},qk,null==a?void 0:a.lineStartSymbol),endSymbol:E({},qk,null==a?void 0:a.lineEndSymbol)}})}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<2)return!1;let e=!0;return t.forEach((t=>{if(t.length)t.forEach((t=>{qo(t.x)&&qo(t.y)||(e=!1)}));else if(!qo(t.x)||!qo(t.y))return void(e=!1)})),e}}RU.defaultAttributes=AU;function IU(t,e){let i;if(e.coordinates){const t=e,{coordinates:s,coordinateType:n,getSeriesByIdOrIndex:r}=t,a=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{const e=r(t.refRelativeSeriesId,t.refRelativeSeriesIndex);if("cartesian"===n){const{xField:i,yField:s}=e.getSpec(),{xFieldDim:n,xFieldIndex:r,yFieldDim:o,yFieldIndex:h}=t;let d=i;M(r)&&(d=Ba(i)[r]),n&&Ba(i).includes(n)&&(d=n);let c=s;M(h)&&(c=Ba(s)[h]),o&&Ba(s).includes(o)&&(c=o),l=Object.assign({x:void 0,y:void 0},a),S(t[d])&&PG(t[d])?l.x={field:d,aggrType:t[d]}:l.x=Ba(d).map((e=>t[e])),S(t[c])&&PG(t[c])?l.y={field:c,aggrType:t[c]}:l.y=Ba(c).map((e=>t[e]))}else if("polar"===n){const{valueField:i,categoryField:s}=e.getSpec(),{angleFieldDim:n,angleFieldIndex:r}=t;let o=s;M(r)&&(o=Ba(s)[r]),n&&Ba(s).includes(n)&&(o=n);const h=i;l=Object.assign({angle:void 0,radius:void 0},a),S(t[o])&&PG(t[o])?l.angle={field:o,aggrType:t[o]}:l.angle=Ba(o).map((e=>t[e])),S(t[h])&&PG(t[h])?l.radius={field:h,aggrType:t[h]}:l.radius=Ba(h).map((e=>t[e]))}return l.getRefRelativeSeries=()=>e,l}))}else i=e;const s=[];return i.forEach((e=>{const i={x:null,y:null,angle:null,radius:null,areaName:null};if(M(e.x)){const s=e.x;y(s)?i.x=s.map((i=>FU(i,t,e))):i.x=FU(s,t,e)}if(M(e.y)){const s=e.y;y(s)?i.y=s.map((i=>FU(i,t,e))):i.y=FU(s,t,e)}if(M(e.angle)){const s=e.angle;y(s)?i.angle=s.map((i=>FU(i,t,e))):i.angle=FU(s,t,e)}if(M(e.radius)){const s=e.radius;y(s)?i.radius=s.map((i=>FU(i,t,e))):i.radius=FU(s,t,e)}if(M(e.areaName)){const s=e.areaName;i.areaName=FU(s,t,e)}e.getRefRelativeSeries&&(i.getRefRelativeSeries=e.getRefRelativeSeries),s.push(i)})),s}const BU={min:(t,e)=>md(t[0].latestData,e.field),max:(t,e)=>_d(t[0].latestData,e.field),sum:function(t,e){return fd(t[0].latestData,e.field)},average:function(t,e){return vd(t[0].latestData,e.field)},variance:function(t,e){return yd(t[0].latestData,e.field)},standardDeviation:function(t,e){return function(t,e){return Math.sqrt(yd(t,e))}(t[0].latestData,e.field)},median:function(t,e){return function(t,e){return((t,e)=>{let i=t;return!0!==e&&(i=t.sort(ud)),function(t,e,i=pd){const s=t.length;if(!s)return;if(e<=0||s<2)return i(t[0],0,t);if(e>=1)return i(t[s-1],s-1,t);const n=(s-1)*e,r=Math.floor(n),a=i(t[r],r,t);return a+(i(t[r+1],r+1,t)-a)*(n-r)}(i,.5)})(t.map((t=>t[e])))}(t[0].latestData,e.field)}};function FU(t,e,i){const s=i.getRelativeSeries(),n=i.getStartRelativeSeries(),r=i.getEndRelativeSeries(),a=s.getData().getLatestData(),o=n.getData().getLatestData(),l=r.getData().getLatestData();if(ys(t))return t(a,o,l,s,n,r);if(w(t)){const{aggrType:i,field:s}=t;return BU[i](e,{field:s})}return t}class YU extends tD{constructor(){super(...arguments),this.layoutType="none",this._layoutOffsetX=0,this._layoutOffsetY=0}getRelativeSeries(){return this._relativeSeries}getMarkerData(){return this._markerData}static _getMarkerCoordinateType(t){return"cartesian"}static getSpecInfo(t){return jE(t,this.specKey,this.type,(t=>!1!==t.visible&&this._getMarkerCoordinateType(t)===this.coordinateType))}created(){super.created(),this._bindSeries(),this._initDataView(),this.initEvent()}_getAllRelativeSeries(){return{getRelativeSeries:()=>this._relativeSeries,getStartRelativeSeries:()=>this._startRelativeSeries,getEndRelativeSeries:()=>this._endRelativeSeries}}_getFieldInfoFromSpec(t,e,i){return S(e)&&PG(e)?{field:i.getSpec()[{x:"xField",y:"yField",radius:"valueField",angle:"categoryField",areaName:"nameField"}[t]],aggrType:e}:e}_processSpecByDims(t){const e=this._relativeSeries,i={};return t.forEach((t=>i[t.dim]=this._getFieldInfoFromSpec(t.dim,t.specValue,e))),Object.assign(Object.assign({},i),this._getAllRelativeSeries())}_processSpecCoo(t){return Object.assign(Object.assign({coordinates:t.coordinates||t.coordinate},this._getAllRelativeSeries()),{getSeriesByIdOrIndex:(t,e)=>this._getSeriesByIdOrIndex(t,e),coordinateType:this.coordinateType})}_getRelativeDataView(){if(this._specifiedDataSeries){let t=[];Ba(this._specifiedDataSeries).forEach((e=>{t=t.concat(e.getViewData().latestData)}));const i=new f;return i.registerParser("array",e),new R(i).parse(t,{type:"array"})}return this._relativeSeries.getViewData()}updateLayoutAttribute(){var t,e,i;if(null===(t=this._spec.visible)||void 0===t||t){if(!this._markerComponent){const t=this._createMarkerComponent();t.name=null!==(e=this._spec.name)&&void 0!==e?e:this.type,t.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.type}-${this.id}`,this._markerComponent=t,this.getContainer().add(this._markerComponent),this._markerComponent.on("*",((t,e)=>{this._delegateEvent(this._markerComponent,t,e,null,this.getMarkerData.bind(this))}))}this._markerLayout()}super.updateLayoutAttribute()}_getSeriesByIdOrIndex(t,e){var i,s;let n;return n=null===(i=this._option.getSeriesInUserIdOrIndex(M(t)?[t]:[],[e]))||void 0===i?void 0:i[0],n||(n=null!==(s=this._relativeSeries)&&void 0!==s?s:this._getFirstSeries()),n}_bindSeries(){const t=this._spec;this._relativeSeries=this._getSeriesByIdOrIndex(t.relativeSeriesId,t.relativeSeriesIndex),this._startRelativeSeries=this._getSeriesByIdOrIndex(t.startRelativeSeriesId,t.startRelativeSeriesIndex),this._endRelativeSeries=this._getSeriesByIdOrIndex(t.endRelativeSeriesId,t.endRelativeSeriesIndex),t.specifiedDataSeriesIndex&&"all"===t.specifiedDataSeriesIndex||t.specifiedDataSeriesId&&"all"===t.specifiedDataSeriesId?this._specifiedDataSeries=this._option.getAllSeries():(t.specifiedDataSeriesIndex||t.specifiedDataSeriesId)&&(this._specifiedDataSeries=this._getSeriesByIdOrIndex(t.specifiedDataSeriesId,t.specifiedDataSeriesIndex))}initEvent(){"cartesian"!==this._relativeSeries.coordinate&&(this._relativeSeries.event.on("zoom",this._markerLayout.bind(this)),this._relativeSeries.event.on("panmove",this._markerLayout.bind(this)),this._relativeSeries.event.on("scroll",this._markerLayout.bind(this)))}onRender(t){}changeRegions(t){}clear(){super.clear(),this._firstSeries=null}_getFirstSeries(){var t;if(this._firstSeries)return this._firstSeries;const e=fE(this._regions);return e?(this._firstSeries=e,e):(null===(t=this._option)||void 0===t||t.onError("need at least one series"),null)}_getNeedClearVRenderComponents(){return[this._markerComponent]}onLayoutStart(t,e,i){D(this._spec.offsetX)||(this._layoutOffsetX=el(this._spec.offsetX,e.width,e)),D(this._spec.offsetY)||(this._layoutOffsetY=el(this._spec.offsetY,e.height,e)),super.onLayoutStart(t,e,i)}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(e,t)||(i.reRender=!0,i.reMake=!0,i.change=!0),i}}function jU(t,e){return function(t,e,i){const{predict:s}=function(t,e=t=>t.x,i=t=>t.y){let s=0,n=0,r=0,a=0,o=0;rd(t,e,i,((t,e)=>{++o,s+=(t-s)/o,n+=(e-n)/o,r+=(t*e-r)/o,a+=(t*t-a)/o}));const l=function(t,e,i,s){const n=s-t*t,r=Math.abs(n)<1e-24?0:(i-t*e)/n;return[e-r*t,r]}(s,n,r,a),h=t=>l[0]+l[1]*t;return{coef:l,predict:h,rSquared:ad(t,e,i,n,h)}}(t,(t=>t[e]),(t=>t[i])),n=md(t,e),r=_d(t,e),a=s(n),o=s(r);return[{[e]:n,[i]:a},{[e]:r,[i]:o}]}(t[0].latestData,e.fieldX,e.fieldY)}function HU(t,e){if(e&&e.getRelativeSeries){const i=e.getRelativeSeries();if(i){const e=i.getViewData();return e&&e.latestData&&e.latestData.length?t:[]}}return t}class zU extends YU{constructor(){super(...arguments),this.specKey="markLine",this.layoutZIndex=Ey.MarkLine}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r}=UG(t);return"polar"===t.coordinateType||e||i||s||n||r?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f,v;const{label:y={},startSymbol:b={},endSymbol:x={}}=this._spec,S={zIndex:this.layoutZIndex,interactive:null===(t=this._spec.interactive)||void 0===t||t,hover:null===(e=this._spec.interactive)||void 0===e||e,select:null===(i=this._spec.interactive)||void 0===i||i,points:[{x:0,y:0},{x:0,y:0}],center:{x:0,y:0},radius:0,startAngle:0,endAngle:0,lineStyle:VG(BE(null===(s=this._spec.line)||void 0===s?void 0:s.style),this._markerData),clipInRange:null!==(n=this._spec.clip)&&void 0!==n&&n,label:zG(y,this._markerData),state:{line:NG(null!==(a=null===(r=this._spec.line)||void 0===r?void 0:r.state)&&void 0!==a?a:{},this._markerData),lineStartSymbol:NG(null!==(l=null===(o=this._spec.startSymbol)||void 0===o?void 0:o.state)&&void 0!==l?l:{},this._markerData),lineEndSymbol:NG(null!==(d=null===(h=this._spec.endSymbol)||void 0===h?void 0:h.state)&&void 0!==d?d:{},this._markerData),label:NG(null!==(p=null===(u=null===(c=this._spec)||void 0===c?void 0:c.label)||void 0===u?void 0:u.state)&&void 0!==p?p:{},this._markerData),labelBackground:NG(null!==(f=null===(_=null===(m=null===(g=this._spec)||void 0===g?void 0:g.label)||void 0===m?void 0:m.labelBackground)||void 0===_?void 0:_.state)&&void 0!==f?f:{},this._markerData)},animation:null!==(v=this._spec.animation)&&void 0!==v&&v,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return b.visible?S.startSymbol=Object.assign(Object.assign({},b),{visible:!0,style:BE(b.style)}):S.startSymbol={visible:!1},x.visible?S.endSymbol=Object.assign(Object.assign({},x),{visible:!0,style:BE(x.style)}):S.endSymbol={visible:!1},this._newMarkLineComponent(S)}_getUpdateMarkerAttrs(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=l.getViewData().latestData,c=r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=HG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}const p=null!==(i=null===(e=this._markerComponent)||void 0===e?void 0:e.attribute)&&void 0!==i?i:{},g=Object.assign(Object.assign({},p.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=p.label)||void 0===s?void 0:s.text});return Object.assign(Object.assign({},h),{label:g,limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}_markerLayout(){var t;const e=this._getUpdateMarkerAttrs();null===(t=this._markerComponent)||void 0===t||t.setAttributes(e)}_initDataView(){const t=this._spec,e="coordinates"in t,{doXProcess:i,doYProcess:s,doXYY1Process:n,doYXX1Process:r,doXYProcess:a,doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c}=UG(t);if(this._markerData=this._getRelativeDataView(),!(i||s||n||r||a||o||l||h||d||c||e))return;Lp(this._option.dataSet,"markerAggregation",IU),Lp(this._option.dataSet,"markerRegression",jU),Lp(this._option.dataSet,"markerFilter",HU);const{options:u,needAggr:p,needRegr:g,processData:m}=this._computeOptions(),_=new R(this._option.dataSet);_.parse([m],{type:"dataview"}),p&&_.transform({type:"markerAggregation",options:u}),g&&_.transform({type:"markerRegression",options:u}),_.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),_.target.on("change",(()=>{this._markerLayout()})),this._markerData=_}}zU.specKey="markLine";class NU extends zU{constructor(){super(...arguments),this.type=r.markLine,this.name=r.markLine,this.coordinateType="cartesian"}_newMarkLineComponent(t){return new RU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=M(e.coordinates),o=M(e.process),l=o&&M(e.process.x),h=o&&M(e.process.y),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t,{doXProcess:u,doYProcess:p,doXYY1Process:g,doYXX1Process:m,doXYProcess:_,doCoordinatesProcess:f}=UG(e);let v=[];if(u||g||p||m||_||a&&l||a&&h){const t=OG(i,s,n,r,c);v=1===t.length?t[0]:t.map((t=>t[0]))}else f?v=BG(i,r,c,e.coordinatesOffset):d&&(v=jG(e.positions,r,e.regionRelative));return{points:v}}_markerLayout(){var t,e,i,s,n,r,a,o;const l=this._getUpdateMarkerAttrs();if("type-step"===this._spec.type){const o=this._startRelativeSeries,h=this._endRelativeSeries,{multiSegment:d,mainSegmentIndex:c}=this._spec.line||{},{connectDirection:u,expandDistance:p=0}=this._spec;let g;if(tl(p)){const t=o.getRegion(),e=t.getLayoutStartPoint(),i=h.getRegion(),s=i.getLayoutStartPoint();if("bottom"===u||"top"===u){const n=Math.abs(Math.min(e.y,s.y)-Math.max(e.y+t.getLayoutRect().height,s.y+i.getLayoutRect().height));g=Number(p.substring(0,p.length-1))*n/100}else{const n=Math.abs(Math.min(e.x,s.x)-Math.max(e.x+t.getLayoutRect().width,s.x+i.getLayoutRect().width));g=Number(p.substring(0,p.length-1))*n/100}}else g=p;const{points:m,label:_,limitRect:f}=l,v=function(t,e,i,s=0){const n=[],r=t.y-e.y,a=t.x-e.x;switch(i){case"top":n.push(t),n.push({x:t.x,y:r>0?t.y-s-Math.abs(r):t.y-s}),n.push({x:e.x,y:r>0?e.y-s:e.y-s-Math.abs(r)}),n.push(e);break;case"bottom":n.push(t),n.push({x:t.x,y:r<0?t.y+s+Math.abs(r):t.y+s}),n.push({x:e.x,y:r<0?e.y+s:e.y+s+Math.abs(r)}),n.push(e);break;case"left":n.push(t),n.push({x:a>0?t.x-s-Math.abs(a):t.x-s,y:t.y}),n.push({x:a>0?e.x-s:e.x-s-Math.abs(a),y:e.y}),n.push(e);break;case"right":n.push(t),n.push({x:a>0?t.x+s:t.x+s+Math.abs(a),y:t.y}),n.push({x:a>0?e.x+s+Math.abs(a):e.x+s,y:e.y}),n.push(e)}return n}(m[0],m[1],u,g);let y;y=d&&M(c)?{position:"middle",autoRotate:!1,refX:0,refY:0}:Object.assign(Object.assign({position:"start",autoRotate:!1},function(t,e,i,s=0){const n=t.y-e.y,r=t.x-e.x;return"bottom"===i?{dx:r>0?-r/2:Math.abs(r/2),dy:n>0?s:Math.abs(n)+s}:"top"===i?{dx:r>0?-Math.abs(r/2):+Math.abs(r/2),dy:n>0?-(Math.abs(n)+s):-s}:"left"===i?{dx:r>0?-r-s:-s,dy:n>0?-n/2:Math.abs(n/2)}:"right"===i?{dx:r>0?s:Math.abs(r)+s,dy:n>0?-n/2:Math.abs(n/2)}:{}}(m[0],m[1],u,g)),{refX:0,refY:0}),qo(null===(t=this._spec.label)||void 0===t?void 0:t.refX)&&(y.refX+=this._spec.label.refX),qo(null===(e=this._spec.label)||void 0===e?void 0:e.refY)&&(y.refY+=this._spec.label.refY),qo(null===(i=this._spec.label)||void 0===i?void 0:i.dx)&&(y.dx=(y.dx||0)+this._spec.label.dx),qo(null===(s=this._spec.label)||void 0===s?void 0:s.dy)&&(y.dy=(y.dy||0)+this._spec.label.dy);const b=null!==(r=null===(n=this._markerComponent)||void 0===n?void 0:n.attribute)&&void 0!==r?r:{};null===(a=this._markerComponent)||void 0===a||a.setAttributes({points:d?[[v[0],v[1]],[v[1],v[2]],[v[2],v[3]]]:v,label:Object.assign(Object.assign(Object.assign({},_),y),{textStyle:Object.assign(Object.assign({},b.label.textStyle),{textAlign:"center",textBaseline:"middle"})}),limitRect:f,multiSegment:d,mainSegmentIndex:c,dx:this._layoutOffsetX,dy:this._layoutOffsetY})}else null===(o=this._markerComponent)||void 0===o||o.setAttributes(l)}_computeOptions(){let t,e=this._getRelativeDataView(),i=!0,s=!1;const n=this._spec,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYY1Process:l,doYXX1Process:h,doXYProcess:d,doCoordinatesProcess:c}=UG(n);if(d)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y1}])];else if(a)t=[this._processSpecByDims([{dim:"x",specValue:n.x}])];else if(o)t=[this._processSpecByDims([{dim:"y",specValue:n.y}])];else if(l)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y1}])];else if(h)t=[this._processSpecByDims([{dim:"x",specValue:n.x},{dim:"y",specValue:n.y}]),this._processSpecByDims([{dim:"x",specValue:n.x1},{dim:"y",specValue:n.y}])];else if(c){if(t=this._processSpecCoo(n),i=!1,e=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`}).parse([r.getViewData()],{type:"dataview"}).transform({type:"markerAggregation",options:t}),n.process&&"x"in n.process&&(t=[this._processSpecByDims([{dim:"x",specValue:n.process.x}])],i=!0),n.process&&"y"in n.process&&(t=t=[this._processSpecByDims([{dim:"y",specValue:n.process.y}])],i=!0),n.process&&"xy"in n.process){const{xField:e,yField:i}=r.getSpec();t={fieldX:e,fieldY:i},s=!0}}else i=!1;return{options:t,needAggr:i,needRegr:s,processData:e}}}NU.type=r.markLine,NU.coordinateType="cartesian",_D();class VU extends fD{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},fD.defaultAttributes,t)),this.name="arc-segment",this.key="arc-segment",this.isReverseArc=!1}getStartAngle(){const t=this.isReverseArc?this._startAngle+Math.PI/2:this._startAngle-Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getEndAngle(){const t=this.isReverseArc?this._endAngle-Math.PI/2:this._endAngle+Math.PI/2;return t<0?t+2*Math.PI:t>2*Math.PI?t-2*Math.PI:t}getMainSegmentPoints(){return this._mainSegmentPoints}_computeStartRotate(t){return this.isReverseArc?t+Math.PI:t}_computeEndRotate(t){return this.isReverseArc?t:t+Math.PI}render(){this.removeAllChild(!0),this._reset();const{startSymbol:t,endSymbol:e,lineStyle:i,state:s,visible:n=!0,radius:r,startAngle:a,endAngle:o,center:l}=this.attribute;if(!n)return;this._startAngle=a,this._endAngle=o,this.isReverseArc=a>o;const h={x:l.x+r*Math.cos(this._startAngle),y:l.y+r*Math.sin(this._startAngle)},d={x:l.x+r*Math.cos(this._endAngle),y:l.y+r*Math.sin(this._endAngle)};this._mainSegmentPoints=[h,d];const c=this._renderSymbol(t,this._mainSegmentPoints,"start"),u=this._renderSymbol(e,this._mainSegmentPoints,"end");this.startSymbol=c,this.endSymbol=u;const p=ra.arc(Object.assign({x:l.x,y:l.y,startAngle:a,endAngle:o,innerRadius:r,outerRadius:r},i));p.name=`${this.name}-line`,p.id=this._getNodeId("arc"),Ym(null==s?void 0:s.line)||(p.states=[].concat(s.line)[0]),this.add(p),this.line=p}}KG(),_D();class WU extends yU{markerAnimate(t){WU._animate&&this._animationConfig&&WU._animate(this._line,this._label,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},WU.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcLine"}getPointAttrByPosition(t){const{center:e,radius:i,startAngle:s,endAngle:n,label:r}=this.attribute,{refX:a=0,refY:o=0}=r;let l;switch(t){case SU.arcInnerStart:l=s;case SU.arcOuterStart:l=s;break;case SU.arcInnerEnd:l=n;case SU.arcOuterEnd:l=n;break;case SU.center:case SU.arcInnerMiddle:case SU.arcOuterMiddle:default:l=(s+n)/2}return{position:{x:e.x+(i+o)*Math.cos(l)+a*Math.cos(l-Math.PI/2),y:e.y+(i+o)*Math.sin(l)+a*Math.sin(l-Math.PI/2)},angle:l}}getTextStyle(t){return EU[t]}getRotateByAngle(t){var e;return t-Math.PI/2+(null!==(e=this.attribute.label.refAngle)&&void 0!==e?e:0)}createSegment(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;return new VU({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},qk,null==o?void 0:o.line),startSymbol:E({},qk,null==o?void 0:o.lineStartSymbol),endSymbol:E({},qk,null==o?void 0:o.lineEndSymbol)}})}setLineAttributes(){const{center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:o}=this.attribute;this._line&&this._line.setAttributes({center:t,radius:e,startAngle:i,endAngle:s,startSymbol:n,endSymbol:r,lineStyle:a,state:{line:E({},qk,null==o?void 0:o.line),startSymbol:E({},qk,null==o?void 0:o.lineStartSymbol),endSymbol:E({},qk,null==o?void 0:o.lineEndSymbol)}})}isValidPoints(){return!0}}WU.defaultAttributes=TU;class GU extends zU{constructor(){super(...arguments),this.type=r.polarMarkLine,this.name=r.polarMarkLine,this.coordinateType="polar"}_newMarkLineComponent(t){const{doRadiusProcess:e,doRadAngAng1Process:i}=UG(this._spec);return e||i?new WU(t):new RU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,a=null!==(t=e.autoRange)&&void 0!==t&&t,{doAngleProcess:o,doRadiusProcess:l,doAngRadRad1Process:h,doRadAngAng1Process:d,doRadAngProcess:c,doCoordinatesProcess:u}=UG(e);let p=[],g={};const m={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(o||l||h||d||c){const t=RG(i,s,n,r,a);p=1===t.length?t[0]:t.map((t=>t[0])),g=p[0].radius===p[1].radius?{radius:p[0].radius,startAngle:p[0].angle,endAngle:p[1].angle,center:m}:{points:p.map((t=>Tt(m,t.radius,t.angle)))}}else u&&(p=FG(i,r,a),g={points:p.map((t=>Tt(m,t.radius,t.angle)))});return g}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doAngRadRad1Process:s,doRadAngAng1Process:n,doRadAngProcess:r,doCoordinatesProcess:a}=UG(t);let o;const l=this._getRelativeDataView();return r?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle}])]:i?o=[this._processSpecByDims([{dim:"radius",specValue:t.radius}])]:s?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius1}])]:n?o=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:a&&(o=this._processSpecCoo(t)),{options:o,needAggr:!0,needRegr:!1,processData:l}}}GU.type=r.polarMarkLine,GU.coordinateType="polar",u_(),df(),ek();class UU extends Rk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},UU.defaultAttributes,t)),this.name="title"}render(){var t,e,i,s,n,r,a,o,l,h,d,c,u,p,g,m,_,f;const{textType:v,text:b,subtextType:x,textStyle:S={},subtext:k,subtextStyle:A={},width:w,height:T,minWidth:L,maxWidth:C,minHeight:E,maxHeight:D,align:P,verticalAlign:O,padding:R=0}=this.attribute,I=gD(R),B=this.createOrUpdateChild("title-container",{x:I[3],y:I[0],zIndex:1},"group");if(!1!==this.attribute.visible&&!1!==S.visible){const{width:o,height:l,maxHeight:h,maxWidth:d,x:c=0,y:u=0,ellipsis:p=!0,wordBreak:g="break-word",maxWidth:m,lineClamp:_}=S;if("rich"===v||M(S.character)){const s=Object.assign({x:c,y:u,width:null!==(t=null!=o?o:w)&&void 0!==t?t:0,height:null!==(e=null!=l?l:T)&&void 0!==e?e:0,ellipsis:null==p||p,wordBreak:null!=g?g:"break-word",maxHeight:null!=h?h:D,maxWidth:null!=d?d:m,textConfig:null!==(i=S.character)&&void 0!==i?i:b},S);this._mainTitle=B.createOrUpdateChild("mainTitle",s,"richtext")}else if("html"===v){const t=Object.assign({html:Object.assign(Object.assign({dom:b},Zk),S),x:c,y:u,width:null!==(s=null!=o?o:w)&&void 0!==s?s:0,height:null!==(n=null!=l?l:T)&&void 0!==n?n:0,ellipsis:p,wordBreak:g,maxHeight:null!=h?h:D,maxWidth:null!=d?d:m,textConfig:[]},S);this._mainTitle=B.createOrUpdateChild("mainTitle",t,"richtext")}else M(b)&&(this._mainTitle=B.createOrUpdateChild("mainTitle",Object.assign(Object.assign({text:y(b)?b:[b],whiteSpace:"normal"},S),{maxLineWidth:null!==(a=null!==(r=S.maxLineWidth)&&void 0!==r?r:o)&&void 0!==a?a:w,heightLimit:null!=l?l:D,lineClamp:_,ellipsis:p,x:c,y:u}),"text"))}const F=this._mainTitle?this._mainTitle.AABBBounds.height():0,Y=this._mainTitle?this._mainTitle.AABBBounds.width():0;if(!1!==this.attribute.visible&&!1!==A.visible){const{width:t,height:e,maxWidth:i,maxHeight:s,x:n=0,y:r=0,ellipsis:a=!0,wordBreak:g="break-word",lineClamp:m}=A,_=Math.max(Number.MIN_VALUE,D-F);if("rich"===x||M(A.character)){const d=Object.assign({x:n,y:r,width:null!==(o=null!=t?t:w)&&void 0!==o?o:0,height:null!==(l=null!=e?e:T)&&void 0!==l?l:0,ellipsis:a,wordBreak:g,maxHeight:null!=s?s:_,maxWidth:null!=i?i:C,textConfig:null!==(h=A.character)&&void 0!==h?h:k},A);this._subTitle=B.createOrUpdateChild("subTitle",d,"richtext")}else if("html"===x){const o=Object.assign({html:Object.assign(Object.assign({dom:k},Zk),A),x:n,y:r,width:null!==(d=null!=t?t:w)&&void 0!==d?d:0,height:null!==(c=null!=e?e:T)&&void 0!==c?c:0,ellipsis:a,wordBreak:g,maxHeight:null!=s?s:_,maxWidth:null!=i?i:C,textConfig:[]},A);this._subTitle=B.createOrUpdateChild("subTitle",o,"richtext")}else M(k)&&(this._subTitle=B.createOrUpdateChild("subTitle",Object.assign(Object.assign({text:y(k)?k:[k],whiteSpace:"normal"},A),{maxLineWidth:null!==(u=A.maxLineWidth)&&void 0!==u?u:w,heightLimit:null!==(p=A.heightLimit)&&void 0!==p?p:_,lineClamp:m,ellipsis:a,x:0,y:F}),"text"))}const j=this._subTitle?this._subTitle.AABBBounds.height():0,H=this._subTitle?this._subTitle.AABBBounds.width():0;let z=Math.max(Y,H),N=F+(null!==(g=A.height)&&void 0!==g?g:j);if(M(w)&&(z=w),M(T)&&(N=T),M(L)&&zC&&(z=C),M(E)&&ND&&(N=D),B.attribute.width=z,B.attribute.height=N,B.attribute.boundsPadding=I,this._mainTitle){if(M(P)||M(S.align)){const t=S.align?S.align:P,e=null!==(m=S.width)&&void 0!==m?m:Y;"left"===t?(this._mainTitle.setAttribute("x",0),this._mainTitle.setAttribute("textAlign","left")):"center"===t?(this._mainTitle.setAttribute("x",e/2),this._mainTitle.setAttribute("textAlign","center")):"right"===t&&(this._mainTitle.setAttribute("x",e),this._mainTitle.setAttribute("textAlign","right"))}if(M(O)||M(S.verticalAlign)){const t=S.verticalAlign?S.verticalAlign:O,e=S.height?S.height:N;"top"===t?(this._mainTitle.setAttribute("y",0),this._mainTitle.setAttribute("textBaseline","top")):"middle"===t?(this._mainTitle.setAttribute("y",e/2),this._mainTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._mainTitle.setAttribute("y",e),this._mainTitle.setAttribute("textBaseline","bottom"))}}if(this._subTitle){if(M(P)||M(A.align)){const t=A.align?A.align:P,e=null!==(_=A.width)&&void 0!==_?_:H;"left"===t?(this._subTitle.setAttribute("x",0),this._subTitle.setAttribute("textAlign","left")):"center"===t?(this._subTitle.setAttribute("x",e/2),this._subTitle.setAttribute("textAlign","center")):"right"===t&&(this._subTitle.setAttribute("x",e),this._subTitle.setAttribute("textAlign","right"))}if(M(O)||M(S.verticalAlign)){const t=A.verticalAlign?A.verticalAlign:O,e=F,i=null!==(f=A.height)&&void 0!==f?f:0;"top"===t?(this._subTitle.setAttribute("y",e),this._subTitle.setAttribute("textBaseline","top")):"middle"===t?(this._subTitle.setAttribute("y",e+i/2),this._subTitle.setAttribute("textBaseline","middle")):"bottom"===t&&(this._subTitle.setAttribute("y",e+i),this._subTitle.setAttribute("textBaseline","bottom"))}}}}UU.defaultAttributes={textStyle:{ellipsis:"...",fill:"#333",fontSize:20,fontWeight:"bold",textAlign:"left",textBaseline:"top"},subtextStyle:{ellipsis:"...",fill:"#6F6F6F",fontSize:16,fontWeight:"normal",textAlign:"left",textBaseline:"top"}};class $U extends tD{get orient(){return this._orient}constructor(t,e){super(t,e),this.type=r.title,this.specKey=r.title,this.layoutType="normal",this.layoutZIndex=Ey.Title,this.layoutLevel=Dy.Title,this._orient="top",this._orient=Qo(t.orient)?t.orient:"top"}initLayout(){super.initLayout(),this._layout&&(this._layout.layoutOrient=this._orient)}static getSpecInfo(t){return jE(t,this.specKey,r.title,(t=>!1!==t.visible))}onRender(t){}_compareSpec(t,e){const i=super._compareSpec(t,e);return(null==e?void 0:e.orient)===(null==t?void 0:t.orient)&&(null==e?void 0:e.visible)===t.visible||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}update(t){}resize(t){}afterSetLayoutStartPoint(t){qo(t.x)&&this._titleComponent&&this._titleComponent.setAttribute("x",t.x),qo(t.y)&&this._titleComponent&&this._titleComponent.setAttribute("y",t.y),super.afterSetLayoutStartPoint(t)}getBoundsInRect(t){let e={};this.setLayoutRect(t);const i=this._getTitleAttrs();this._createOrUpdateTitleComponent(i),e=this._getTitleLayoutRect();const{x:s,y:n}=this.getLayoutStartPoint();return{x1:s,y1:n,x2:s+e.width,y2:n+e.height}}_getTitleLayoutRect(){const t=this._titleComponent.AABBBounds;return{width:this._spec.width?this._spec.width:qo(t.width())?t.width():0,height:this._spec.height?this._spec.height:qo(t.height())?t.height():0}}_getTitleAttrs(){var t,e,i,s,n,r,a,o,l;const h=Math.max(0,null!==(t=this._spec.width)&&void 0!==t?t:this.getLayoutRect().width);return!1===this._spec.visible?{visible:!1}:Object.assign(Object.assign({},eD(this._spec,["padding"])),{textType:null!==(e=this._spec.textType)&&void 0!==e?e:"text",text:null!==(i=this._spec.text)&&void 0!==i?i:"",subtextType:null!==(s=this._spec.subtextType)&&void 0!==s?s:"text",subtext:null!==(n=this._spec.subtext)&&void 0!==n?n:"",x:null!==(r=this._spec.x)&&void 0!==r?r:0,y:null!==(a=this._spec.y)&&void 0!==a?a:0,width:h,height:this._spec.height,minWidth:this._spec.minWidth,maxWidth:this._spec.maxWidth,minHeight:this._spec.minHeight,maxHeight:this._spec.maxHeight,padding:this._spec.innerPadding,align:null!==(o=this._spec.align)&&void 0!==o?o:"left",verticalAlign:null!==(l=this._spec.verticalAlign)&&void 0!==l?l:"top",textStyle:Object.assign({width:h},this._spec.textStyle),subtextStyle:Object.assign({width:h},this._spec.subtextStyle)})}_createOrUpdateTitleComponent(t){if(this._titleComponent)Im(t,this._cacheAttrs)||this._titleComponent.setAttributes(t);else{const e=this.getContainer(),i=new UU(t);i.name="title",e.add(i),this._titleComponent=i,i.on("*",((t,e)=>this._delegateEvent(i,t,e)))}return this._cacheAttrs=t,this._titleComponent}_getNeedClearVRenderComponents(){return[this._titleComponent]}clear(){super.clear(),this._cacheAttrs=null}}function XU(){KU._animate=uU}$U.type=r.title,$U.specKey=r.title,KG(),vk();class KU extends JG{markerAnimate(t){KU._animate&&this._animationConfig&&KU._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},KU.defaultAttributes,t)),this.name="markArea",this.defaultUpdateAnimation=_U,this.defaultExitAnimation=vU}getPointAttrByPosition(t){const{x1:e,x2:i,y1:s,y2:n}=this._area.AABBBounds;return t.includes("left")||t.includes("Left")?{x:e,y:(s+n)/2}:t.includes("right")||t.includes("Right")?{x:i,y:(s+n)/2}:t.includes("top")||t.includes("Top")?{x:(e+i)/2,y:s}:t.includes("bottom")||t.includes("Bottom")?{x:(e+i)/2,y:n}:{x:(e+i)/2,y:(s+n)/2}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,i=null!==(t=e.position)&&void 0!==t?t:"middle",s=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},s),{textStyle:Object.assign(Object.assign({},DU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;ZG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{points:e,label:i,areaStyle:s,state:n}=this.attribute,r=ra.polygon(Object.assign({points:e},s));r.states=E({},qk,null==n?void 0:n.area),r.name="mark-area-polygon",this._area=r,t.add(r);const a=new TD(Object.assign(Object.assign({},i),{state:{panel:E({},qk,null==n?void 0:n.labelBackground),text:E({},qk,null==n?void 0:n.label)}}));a.name="mark-area-label",this._label=a,t.add(a),this.setLabelPos()}updateMarker(){const{points:t,label:e,areaStyle:i,state:s}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({points:t},i)),this._area.states=E({},qk,null==s?void 0:s.area)),this._label&&this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},e),{state:{panel:E({},qk,null==s?void 0:s.labelBackground),text:E({},qk,null==s?void 0:s.label)}})),this.setLabelPos()}isValidPoints(){const{points:t}=this.attribute;if(!t||t.length<3)return!1;let e=!0;return t.forEach((t=>{qo(t.x)&&qo(t.y)||(e=!1)})),e}}KU.defaultAttributes=LU;class qU extends YU{constructor(){super(...arguments),this.specKey="markArea",this.layoutZIndex=Ey.MarkArea}static _getMarkerCoordinateType(t){const{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s}=$G(t);return"polar"===t.coordinateType||e||i||s?"polar":"cartesian"}_createMarkerComponent(){var t,e,i,s,n,r,a,o,l,h,d,c;const u=null!==(t=this._spec.label)&&void 0!==t?t:{},p={zIndex:this.layoutZIndex,interactive:null===(e=this._spec.interactive)||void 0===e||e,hover:null===(i=this._spec.interactive)||void 0===i||i,select:null===(s=this._spec.interactive)||void 0===s||s,points:[{x:0,y:0}],center:{x:0,y:0},innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,areaStyle:VG(BE(null===(n=this._spec.area)||void 0===n?void 0:n.style),this._markerData),clipInRange:null!==(r=this._spec.clip)&&void 0!==r&&r,label:zG(u,this._markerData),state:{area:NG(null===(a=this._spec.area)||void 0===a?void 0:a.state,this._markerData),label:NG(null===(o=this._spec.label)||void 0===o?void 0:o.state,this._markerData),labelBackground:NG(null===(d=null===(h=null===(l=this._spec)||void 0===l?void 0:l.label)||void 0===h?void 0:h.labelBackground)||void 0===d?void 0:d.state,this._markerData)},animation:null!==(c=this._spec.animation)&&void 0!==c&&c,animationEnter:this._spec.animationEnter,animationExit:this._spec.animationExit,animationUpdate:this._spec.animationUpdate};return this._newMarkAreaComponent(p)}_markerLayout(){var t,e,i,s;const n=this._spec,r=this._markerData,a=this._startRelativeSeries,o=this._endRelativeSeries,l=this._relativeSeries,h=this._computePointsAttr(),d=this._getRelativeDataView().latestData,c=r?r.latestData[0]&&r.latestData[0].latestData?r.latestData[0].latestData:r.latestData:d;let u;if(n.clip||(null===(t=n.label)||void 0===t?void 0:t.confine)){const{minX:t,maxX:e,minY:i,maxY:s}=HG([a.getRegion(),o.getRegion(),l.getRegion()]);u={x:t,y:i,width:e-t,height:s-i}}this._markerComponent&&this._markerComponent.setAttributes(Object.assign(Object.assign({},h),{label:Object.assign(Object.assign({},null===(e=this._markerComponent.attribute)||void 0===e?void 0:e.label),{text:this._spec.label.formatMethod?this._spec.label.formatMethod(c,d):null===(s=null===(i=this._markerComponent.attribute)||void 0===i?void 0:i.label)||void 0===s?void 0:s.text}),limitRect:u,dx:this._layoutOffsetX,dy:this._layoutOffsetY}))}_initDataView(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doAngleProcess:n,doRadiusProcess:r,doRadAngProcess:a,doCoordinatesProcess:o}=$G(t);if(!(e||i||s||n||r||a||o))return null;const{options:l}=this._computeOptions(),h=this._getRelativeDataView();Lp(this._option.dataSet,"markerAggregation",IU),Lp(this._option.dataSet,"markerFilter",HU);const d=new R(this._option.dataSet,{name:`${this.type}_${this.id}_data`});d.parse([h],{type:"dataview"}),d.transform({type:"markerAggregation",options:l}),d.transform({type:"markerFilter",options:this._getAllRelativeSeries()}),d.target.on("change",(()=>{this._markerLayout()})),this._markerData=d}}qU.specKey="markArea";class ZU extends qU{constructor(){super(...arguments),this.type=r.markArea,this.name=r.markArea,this.coordinateType="cartesian"}_newMarkAreaComponent(t){return new KU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doXProcess:a,doYProcess:o,doXYProcess:l,doCoordinatesProcess:h}=$G(e),d=M(e.positions),c=null!==(t=e.autoRange)&&void 0!==t&&t;let u=[],p=[];if(l){p=OG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[{x:t[0].x,y:e[0].y},t[0],{x:e[0].x,y:t[0].y},e[0]])}else if(a||o){p=OG(i,s,n,r,c);const[t,e]=p;t&&t.length&&e&&e.length&&(u=[...t,e[1],e[0]])}else h?u=BG(i,r,c,e.coordinatesOffset):d&&(u=jG(e.positions,r,e.regionRelative));return{points:u}}_computeOptions(){const t=this._spec,{doXProcess:e,doYProcess:i,doXYProcess:s,doCoordinatesProcess:n}=$G(t);let r;return s?r=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"x",specValue:t.x1},{dim:"y",specValue:t.y1}])]:e?r=[this._processSpecByDims([{dim:"x",specValue:t.x}]),this._processSpecByDims([{dim:"x",specValue:t.x1}])]:i?r=[this._processSpecByDims([{dim:"y",specValue:t.y}]),this._processSpecByDims([{dim:"y",specValue:t.y1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}ZU.type=r.markArea,ZU.coordinateType="cartesian",KG(),Wx();class JU extends JG{markerAnimate(t){JU._animate&&this._animationConfig&&JU._animate(this._area,this._label,this._animationConfig,t)}getArea(){return this._area}getLabel(){return this._label}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},JU.defaultAttributes,t,{label:{autoRotate:!0}})),this.name="markArcArea",this.defaultUpdateAnimation=_U,this.defaultExitAnimation=vU}getPointAttrByPosition(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,label:a}=this.attribute,{refX:o=0,refY:l=0}=a;let h,d;switch(t){case SU.center:h=(i+s)/2,d=(n+r)/2;break;case SU.arcInnerStart:h=i,d=n;break;case SU.arcOuterStart:h=s,d=n;break;case SU.arcInnerEnd:h=i,d=r;break;case SU.arcOuterEnd:h=s,d=r;break;case SU.arcInnerMiddle:h=i,d=(n+r)/2;break;case SU.arcOuterMiddle:h=s,d=(n+r)/2;break;default:h=i,d=(n+r)/2}return{position:{x:e.x+(h+l)*Math.cos(d)+o*Math.cos(d-Math.PI/2),y:e.y+(h+l)*Math.sin(d)+o*Math.sin(d-Math.PI/2)},angle:d}}setLabelPos(){var t;if(this._label&&this._area){const{label:e={}}=this.attribute,{position:i="arcInnerMiddle",autoRotate:s}=e,n=this.getPointAttrByPosition(i);if(this._label.setAttributes(Object.assign(Object.assign({},n.position),{angle:s?n.angle-Math.PI/2+(null!==(t=e.refAngle)&&void 0!==t?t:0):0,textStyle:Object.assign(Object.assign({},EU[i]),e.textStyle)})),this.attribute.limitRect&&e.confine){const{x:t,y:e,width:i,height:s}=this.attribute.limitRect;ZG(this._label,{x1:t,y1:e,x2:t+i,y2:e+s})}}}initMarker(t){const{center:e,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r,areaStyle:a,label:o,state:l}=this.attribute,h=ra.arc(Object.assign({x:e.x,y:e.y,innerRadius:i,outerRadius:s,startAngle:n,endAngle:r},a));h.states=E({},qk,null==l?void 0:l.area),h.name="polar-mark-area-area",this._area=h,t.add(h);const d=new TD(Object.assign(Object.assign({},o),{state:{panel:E({},qk,null==l?void 0:l.labelBackground),text:E({},qk,null==l?void 0:l.label)}}));d.name="mark-area-label",this._label=d,t.add(d),this.setLabelPos()}updateMarker(){const{center:t,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n,areaStyle:r,label:a,state:o}=this.attribute;this._area&&(this._area.setAttributes(Object.assign({x:t.x,y:t.y,innerRadius:e,outerRadius:i,startAngle:s,endAngle:n},r)),this._area.states=E({},qk,null==o?void 0:o.area)),this._label&&(this._label.setAttributes(Object.assign(Object.assign({dx:0,dy:0},a),{state:{panel:E({},qk,null==o?void 0:o.labelBackground),text:E({},qk,null==o?void 0:o.label)}})),this.setLabelPos())}isValidPoints(){return!0}}JU.defaultAttributes=CU;class QU extends qU{constructor(){super(...arguments),this.type=r.polarMarkArea,this.name=r.polarMarkArea,this.coordinateType="polar"}_newMarkAreaComponent(t){const{doRadiusProcess:e,doAngleProcess:i,doRadAngProcess:s}=$G(this._spec);return i||e||s?new JU(t):new KU(t)}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._startRelativeSeries,n=this._endRelativeSeries,r=this._relativeSeries,{doAngleProcess:a,doRadiusProcess:o,doRadAngProcess:l,doCoordinatesProcess:h}=$G(e),d=null!==(t=e.autoRange)&&void 0!==t&&t;let c,u={};const p={x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y};if(a||o||l){const t=RG(i,s,n,r,d);l?u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][0].angle,center:p}:a?u={innerRadius:0,outerRadius:Math.abs(t[0][0].radius),startAngle:t[0][1].angle,endAngle:t[1][1].angle,center:p}:o&&(u={innerRadius:t[0][0].radius,outerRadius:t[1][0].radius,startAngle:t[0][0].angle,endAngle:t[1][1].angle,center:p})}else h&&(c=FG(i,r,d),u={points:c.map((t=>Tt(p,t.radius,t.angle)))});return u}_computeOptions(){const t=this._spec,{doAngleProcess:e,doRadiusProcess:i,doRadAngProcess:s,doCoordinatesProcess:n}=$G(t);let r;return s?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius1}])]:e?r=[this._processSpecByDims([{dim:"angle",specValue:t.angle},{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"angle",specValue:t.angle1},{dim:"radius",specValue:t.radius}])]:i?r=[this._processSpecByDims([{dim:"radius",specValue:t.radius}]),this._processSpecByDims([{dim:"radius",specValue:t.radius1}])]:n&&(r=this._processSpecCoo(t)),{options:r}}}QU.type=r.polarMarkArea,QU.coordinateType="polar";class t$ extends Lv{constructor(t){super(t)}}var e$,i$;!function(t){t.OnPlay="onPlay",t.OnPause="onPause",t.OnForward="onForward",t.OnBackward="onBackward"}(e$||(e$={})),function(t){t.Start="start",t.Pause="pause",t.Forward="forward",t.Backward="backward"}(i$||(i$={}));class s$ extends Rk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},s$.defaultAttributes,t)),this._isPaused=!0,this.updateAttributes=()=>{this._startAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -73.1429 161.4994 a 48.7619 48.7619 0 0 1 25.9901 7.5093 l 201.7524 127.1223 a 48.7619 48.7619 0 0 1 0.3657 82.2613 l -201.7524 129.6335 A 48.7619 48.7619 0 0 1 292.5952 540.1838 v -256.7314 a 48.7619 48.7619 0 0 1 48.7619 -48.7619 z m 24.381 92.9402 v 167.9116 l 131.9497 -84.7726 L 365.7381 327.6063 z"},s$.defaultControllerAttr),{visible:this.attribute.start.visible}),this.attribute.start.style)},this._pauseAttr={style:Object.assign(Object.assign(Object.assign({symbolType:"M 414.5 0.0238 c 228.9128 0 414.4762 185.5634 414.4762 414.4762 s -185.5634 414.4762 -414.4762 414.4762 S 0.0238 643.4128 0.0238 414.5 S 185.5872 0.0238 414.5 0.0238 z m 0 73.1429 C 225.9865 73.1667 73.1667 225.9865 73.1667 414.5 s 152.8198 341.3333 341.3333 341.3333 s 341.3333 -152.8198 341.3333 -341.3333 S 603.0135 73.1667 414.5 73.1667 z m -48.7619 195.0476 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z m 158.4762 0 v 316.9524 h -73.1429 V 268.2143 h 73.1429 z"},s$.defaultControllerAttr),{visible:this.attribute.pause.visible}),this.attribute.pause.style)},this._forwardAttr={style:Object.assign(Object.assign(Object.assign({},s$.defaultControllerAttr),{visible:this.attribute.forward.visible}),this.attribute.forward.style)},this._backwardAttr={style:Object.assign(Object.assign(Object.assign({},s$.defaultControllerAttr),{visible:this.attribute.backward.visible}),this.attribute.backward.style)},this.updateLayout()},this.updateLayout=()=>{var t,e,i,s;this._layout=this.attribute.layout,"horizontal"===this._layout?(this._backwardAttr.style.symbolType=null!==(t=this._backwardAttr.style.symbolType)&&void 0!==t?t:"M 521.29 734.276 L 230.929 448.019 L 521.29 161.762 c 37.685 -37.153 38.003 -97.625 0.707 -134.384 c -37.297 -36.758 -98.646 -36.435 -136.331 0.718 l -357.43 352.378 c -0.155 0.153 -0.297 0.314 -0.451 0.468 c -0.084 0.082 -0.172 0.157 -0.256 0.239 c -18.357 18.092 -27.581 41.929 -27.743 65.902 c -0.004 0.311 -0.017 0.623 -0.018 0.934 c 0.001 0.316 0.014 0.632 0.018 0.948 c 0.165 23.97 9.389 47.803 27.743 65.892 c 0.083 0.082 0.171 0.157 0.255 0.239 c 0.154 0.154 0.296 0.315 0.452 0.468 l 357.43 352.378 c 37.685 37.153 99.034 37.476 136.331 0.718 c 37.297 -36.758 36.979 -97.231 -0.707 -134.384 z",this._forwardAttr.style.symbolType=null!==(e=this._forwardAttr.style.symbolType)&&void 0!==e?e:"M 30 163 L 320.361 449.257 L 30 735.514 c -37.685 37.153 -38.003 97.625 -0.707 134.384 c 37.297 36.758 98.646 36.435 136.331 -0.718 l 357.43 -352.378 c 0.155 -0.153 0.297 -0.314 0.451 -0.468 c 0.084 -0.082 0.172 -0.157 0.256 -0.239 c 18.357 -18.092 27.581 -41.929 27.743 -65.902 c 0.004 -0.311 0.017 -0.623 0.018 -0.934 c -0.001 -0.316 -0.014 -0.632 -0.018 -0.948 c -0.165 -23.97 -9.389 -47.803 -27.743 -65.892 c -0.083 -0.082 -0.171 -0.157 -0.255 -0.239 c -0.154 -0.154 -0.296 -0.315 -0.452 -0.468 l -357.43 -352.378 c -37.685 -37.153 -99.034 -37.476 -136.331 -0.718 c -37.297 36.758 -36.979 97.231 0.707 134.384 z"):"vertical"===this._layout&&(this._backwardAttr.style.symbolType=null!==(i=this._backwardAttr.style.symbolType)&&void 0!==i?i:"m 161.724 521.29 l 286.257 -290.361 l 286.257 290.361 c 37.153 37.685 97.625 38.003 134.384 0.707 c 36.758 -37.297 36.435 -98.646 -0.718 -136.331 l -352.378 -357.43 c -0.153 -0.155 -0.314 -0.297 -0.468 -0.451 c -0.082 -0.084 -0.157 -0.172 -0.239 -0.256 c -18.092 -18.357 -41.929 -27.581 -65.902 -27.743 c -0.311 -0.004 -0.623 -0.017 -0.934 -0.018 c -0.316 0.001 -0.632 0.014 -0.948 0.018 c -23.97 0.165 -47.803 9.389 -65.892 27.743 c -0.082 0.083 -0.157 0.171 -0.239 0.255 c -0.154 0.154 -0.315 0.296 -0.468 0.452 l -352.378 357.43 c -37.153 37.685 -37.476 99.034 -0.718 136.331 c 36.758 37.297 97.231 36.979 134.384 -0.707 z",this._forwardAttr.style.symbolType=null!==(s=this._forwardAttr.style.symbolType)&&void 0!==s?s:"M 734.276 28.71 L 448.019 319.071 L 161.762 28.71 c -37.153 -37.685 -97.625 -38.003 -134.384 -0.707 c -36.758 37.297 -36.435 98.646 0.718 136.331 l 352.378 357.43 c 0.153 0.155 0.314 0.297 0.468 0.451 c 0.082 0.084 0.157 0.172 0.239 0.256 c 18.092 18.357 41.929 27.581 65.902 27.743 c 0.311 0.004 0.623 0.017 0.934 0.018 c 0.316 -0.001 0.632 -0.014 0.948 -0.018 c 23.97 -0.165 47.803 -9.389 65.892 -27.743 c 0.082 -0.083 0.157 -0.171 0.239 -0.255 c 0.154 -0.154 0.315 -0.296 0.468 -0.452 l 352.378 -357.43 c 37.153 -37.685 37.476 -99.034 0.718 -136.331 c -36.758 -37.297 -97.231 -36.979 -134.384 0.707 z")},this._initPlay=()=>{D(this._playController)&&(this._playController=new t$(Object.assign({},this._startAttr.style)),this.add(this._playController))},this._initBackward=()=>{D(this._backwardController)&&(this._backwardController=new t$(Object.assign({},this._backwardAttr.style)),this.add(this._backwardController))},this._initForward=()=>{D(this._forwardController)&&(this._forwardController=new t$(Object.assign({},this._forwardAttr.style)),this.add(this._forwardController))},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._playController.addEventListener("pointerdown",(t=>{t.stopPropagation(),!0===this._isPaused?this.play():this.pause()})),this._backwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.backward()})),this._forwardController.addEventListener("pointerdown",(t=>{t.stopPropagation(),this.forward()})))},this.renderPlay=()=>{this._isPaused?this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._startAttr.style)):this._playController.setAttributes(Object.assign({symbolType:this._playController.getComputedAttribute("symbolType")},this._pauseAttr.style))},this.renderBackward=()=>{this._backwardController.setAttributes(this._backwardAttr.style)},this.renderForward=()=>{this._forwardController.setAttributes(this._forwardAttr.style)},this.play=()=>{this._dispatchEvent(e$.OnPlay)},this.pause=()=>{this._dispatchEvent(e$.OnPause)},this.forward=()=>{this._dispatchEvent(e$.OnForward)},this.backward=()=>{this._dispatchEvent(e$.OnBackward)},this.togglePlay=()=>{this._playController.setAttributes(this._startAttr.style),this._isPaused=!0},this.togglePause=()=>{this._playController.setAttributes(this._pauseAttr.style),this._isPaused=!1},this.updateAttributes(),this._initPlay(),this._initBackward(),this._initForward(),this._initEvents()}render(){this.updateAttributes(),this.renderPlay(),this.renderBackward(),this.renderForward()}}s$.defaultControllerAttr={visible:!0,x:0,y:0,size:20,fill:"#91caff",pickMode:"imprecise",cursor:"pointer"},s$.defaultAttributes={[i$.Start]:{},[i$.Pause]:{},[i$.Backward]:{},[i$.Forward]:{}};const n$={visible:!0,style:{x:0,y:0,dx:0,dy:0,size:20},order:0,space:10},r$=[200,10];var a$,o$;(o$=a$||(a$={})).Default="default",o$.Reverse="reverse";const l$=t=>"top"===t||"bottom"===t;class h$ extends Rk{getMinIndex(){return this._minIndex}getMaxIndex(){return this._maxIndex}getDataIndex(){return this._dataIndex}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},h$.defaultAttributes,t)),this._data=[],this._dataIndex=0,this._layoutInfo={},this._updateSliderAttrs=()=>{var t,e;let i;qo(this._handlerStyle.size)?i=this._handlerStyle.size:this._handlerStyle.size&&this._handlerStyle.size.length&&(i=ut(this._handlerStyle.size[0],this._handlerStyle.size[1]));const s={visible:this._sliderVisible,min:this._minIndex,max:this._maxIndex,value:this._dataIndex,railWidth:this._railStyle.width,railHeight:this._railStyle.height,railStyle:this._railStyle,trackStyle:this._trackStyle,handlerSize:qo(i)?i:void 0,handlerStyle:this._handlerStyle,dy:this.attribute.slider.dy,dx:this.attribute.slider.dx,slidable:!0,range:!1,handlerText:{visible:!1},startText:{visible:!1},endText:{visible:!1},disableTriggerEvent:this.attribute.disableTriggerEvent};if(l$(this._orient)){const e=Math.max(0,this._layoutInfo.slider.size),i=null!==(t=this._railStyle.height)&&void 0!==t?t:r$[1];s.layout="horizontal",s.railHeight=i,s.railWidth=e,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}else{const t=Math.max(0,this._layoutInfo.slider.size),i=null!==(e=this._railStyle.width)&&void 0!==e?e:r$[1];s.layout="vertical",s.railWidth=i,s.railHeight=t,s.x=this._layoutInfo.slider.x,s.y=this._layoutInfo.slider.y}return s},this._initSlider=()=>{const t=this._updateSliderAttrs();this._slider=new oW(t),this._sliderVisible&&this.add(this._slider)},this._updateControllerAttrs=()=>{const t={start:this._start,pause:this._pause,forward:this._forward,backward:this._backward,disableTriggerEvent:this.attribute.disableTriggerEvent};return t.layout=l$(this._orient)?"horizontal":"vertical",t.start=Object.assign(Object.assign({},t.start),{style:Object.assign(Object.assign({},t.start.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.pause=Object.assign(Object.assign({},t.pause),{style:Object.assign(Object.assign({},t.pause.style),{x:this._layoutInfo.start.x,y:this._layoutInfo.start.y})}),t.backward=Object.assign(Object.assign({},t.backward),{style:Object.assign(Object.assign({},t.backward.style),{x:this._layoutInfo.backward.x,y:this._layoutInfo.backward.y})}),t.forward=Object.assign(Object.assign({},t.forward),{style:Object.assign(Object.assign({},t.forward.style),{x:this._layoutInfo.forward.x,y:this._layoutInfo.forward.y})}),t},this._initController=()=>{const t=this._updateControllerAttrs();this._controller=new s$(t),this._controllerVisible&&this.add(this._controller)},this._initAttributes(),this._initDataIndex(),this._initLayoutInfo(),this._initController(),this._initSlider()}_initAttributes(){this._size=this.attribute.size,this._orient=this.attribute.orient,this._data=this.attribute.data,this._minIndex=0,this._maxIndex=this._data.length-1;const{slider:t={},controller:e={}}=this.attribute;this._sliderVisible=t.visible,this._railStyle=Object.assign({},t.railStyle),this._trackStyle=Object.assign({},t.trackStyle),this._handlerStyle=Object.assign({},t.handlerStyle),this._controllerVisible=e.visible,this._start=Object.assign({},e.start),this._pause=Object.assign({},e.pause),this._forward=Object.assign({},e.forward),this._backward=Object.assign({},e.backward)}_initDataIndex(){var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0}_initLayoutInfo(){var t,e,i;const s=[this._start,this._backward,this._forward].sort(((t,e)=>t.order-e.order)),n=s.filter((t=>"end"!==t.position)),r=s.filter((t=>"end"===t.position)),a=null!==(t=l$(this._orient)?this._railStyle.height:this._railStyle.width)&&void 0!==t?t:r$[1],o=s.reduce(((t,e)=>{const i=e.style.size,s=h(i)?i:ut(i[0],i[1]);return t+e.space+s}),0),l=this._sliderVisible?(l$(this._orient)?null===(e=this._size)||void 0===e?void 0:e.width:null===(i=this._size)||void 0===i?void 0:i.height)-o:0,d=l-this.attribute.slider.space,c=n.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:l$(this._orient)?t+s:(this._size.width-r)/2,y:l$(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),0);this._layoutInfo.slider=Object.assign(Object.assign({},this._layoutInfo.slider),{size:d,x:l$(this._orient)?c+this.attribute.slider.space:(this._size.width-a)/2,y:l$(this._orient)?(this._size.height-a)/2:c+this.attribute.slider.space}),r.reduce(((t,e)=>{const{key:i,space:s,style:{size:n}}=e,r=h(n)?n:ut(n[0],n[1]);return this._layoutInfo[i]=Object.assign(Object.assign({},this._layoutInfo[i]),{size:r,x:l$(this._orient)?t+s:(this._size.width-r)/2,y:l$(this._orient)?(this._size.height-r)/2:t+s}),t+s+r}),c+l)}render(){this._initLayoutInfo(),this.renderSlider(),this.renderController()}renderSlider(){const t=this._updateSliderAttrs();this._slider.setAttributes(t)}renderController(){const t=this._updateControllerAttrs();this._controller.setAttributes(t)}dispatchCustomEvent(t,e){this._dispatchEvent(t,{eventType:t,index:e,value:this._data[e]})}}var d$;function c$(){VV(),u_(),Gv()}h$.defaultAttributes={visible:!0,data:[],interval:1e3,orient:"bottom",align:"center",size:{height:20,width:300},slider:{visible:!0,space:10,dx:0,dy:0,railStyle:{cornerRadius:5},trackStyle:{},handlerStyle:{}},controller:{visible:!0,start:Object.assign(Object.assign({},n$),{key:"start",position:"start",space:0}),pause:Object.assign(Object.assign({},n$),{key:"pause",position:"start"}),forward:Object.assign(Object.assign({},n$),{key:"forward",position:"end"}),backward:Object.assign(Object.assign({},n$),{key:"backward",position:"start"})}},function(t){t.change="change",t.play="play",t.pause="pause",t.backward="backward",t.forward="forward",t.end="end",t.OnChange="change",t.OnPlay="play",t.OnPause="pause",t.OnBackward="backward",t.OnForward="forward",t.OnEnd="end"}(d$||(d$={})),c$();class u$ extends h${constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},t)),this._activeIndex=-1,this._isReachEnd=!1,this._initAttributes=()=>{var t,e,i;super._initAttributes(),this._alternate=null!==(t=this.attribute.alternate)&&void 0!==t&&t,this._interval=null!==(e=this.attribute.interval)&&void 0!==e?e:1e3,this._direction=null!==(i=this.attribute.direction)&&void 0!==i?i:a$.Default},this._initDataIndex=()=>{var t;this._dataIndex=D(this.attribute.dataIndex)?"default"===this._direction?this._minIndex:this._maxIndex:null!==(t=this.attribute.dataIndex)&&void 0!==t?t:0,this._slider.setAttribute("value",this._dataIndex)},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(e$.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(e$.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(e$.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(e$.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{const e=Math.floor(t.detail.value)+.5;this._dataIndex=t.detail.value>=e?Math.ceil(t.detail.value):Math.floor(t.detail.value),this._slider.setValue(this._dataIndex),this.dispatchCustomEvent(d$.change)})))},this.play=()=>{this._isPlaying||1!==this._data.length&&(this._controller.togglePause(),this._isPlaying=!0,((({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,maxIndex:e,dataIndex:i})=>t===a$.Default&&i===e)({direction:t,maxIndex:e,dataIndex:s})||(({direction:t,minIndex:e,dataIndex:i})=>t===a$.Reverse&&i===e)({direction:t,minIndex:i,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction})||(({direction:t,maxIndex:e,minIndex:i,dataIndex:s})=>(({direction:t,minIndex:e,dataIndex:i})=>t===a$.Default&&i===e)({direction:t,minIndex:i,dataIndex:s})||(({direction:t,maxIndex:e,dataIndex:i})=>t===a$.Reverse&&i===e)({direction:t,maxIndex:e,dataIndex:s}))({dataIndex:this._dataIndex,maxIndex:this._maxIndex,minIndex:this._minIndex,direction:this._direction}))&&(this._direction===a$.Default?this._updateDataIndex(this._minIndex):this._updateDataIndex(this._maxIndex)),this.dispatchCustomEvent(d$.play),this._isReachEnd=!1,this._tickTime=Date.now(),this._rafId=zo.getRequestAnimationFrame()(this._play.bind(this,!0)))},this._play=t=>{const e=Date.now();if(this._isReachEnd&&e-this._tickTime>=this._interval)return this._isReachEnd=!1,void this._playEnd();t&&this._activeIndex!==this._dataIndex?(this.dispatchCustomEvent(d$.change),this._activeIndex=this._dataIndex):e-this._tickTime>=this._interval&&(this._tickTime=e,this._updateDataIndex(((t,e,i,s)=>"default"===t?Math.min(e+1,s):Math.max(e-1,i))(this._direction,this._dataIndex,this._minIndex,this._maxIndex)),this._activeIndex=this._dataIndex,this.dispatchCustomEvent(d$.change)),("default"===this._direction&&this._dataIndex>=this._maxIndex||"reverse"===this._direction&&this._dataIndex<=this._minIndex)&&(this._isReachEnd=!0),this._rafId=zo.getRequestAnimationFrame()(this._play.bind(this,!1))},this._updateDataIndex=t=>{this._dataIndex=t,this._slider.setValue(this._dataIndex)},this._playEnd=()=>{this._isPlaying=!1,this._controller.togglePlay(),zo.getCancelAnimationFrame()(this._rafId),this._activeIndex=-1,this.dispatchCustomEvent(d$.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,zo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(d$.pause))},this.backward=()=>{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex-1{const{loop:t=!1}=this.attribute;let e;e=t?this._dataIndex+1>this._maxIndex?this._minIndex:this._dataIndex+1:Math.min(this._dataIndex+1,this._maxIndex),this._updateDataIndex(e),this.dispatchCustomEvent(d$.change),this.dispatchCustomEvent(d$.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}setAttributes(t,e){super.setAttributes(t,e),this._initAttributes()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}}c$();class p$ extends h${constructor(t){super(t),this._isPlaying=!1,this._startTime=Date.now(),this._initAttributes=()=>{var t;super._initAttributes(),this._maxIndex=this._data.length,this._slider.setAttribute("max",this._maxIndex),this._isPlaying=!1,this._elapsed=0,this._interval=null!==(t=this.attribute.interval)&&void 0!==t?t:1e3;const e=this._data.length;this.attribute.totalDuration&&this._data.length?(this._totalDuration=this.attribute.totalDuration,this._interval=this._totalDuration/(null!=e?e:1)):(this._totalDuration=this._interval*e,this._interval=this.attribute.interval)},this._initDataIndex=()=>{var t;this._dataIndex=null!==(t=this.attribute.dataIndex)&&void 0!==t?t:this._minIndex},this._initEvents=()=>{this.attribute.disableTriggerEvent||(this._controller.addEventListener(e$.OnPlay,(t=>{t.stopPropagation(),this.play()})),this._controller.addEventListener(e$.OnPause,(t=>{t.stopPropagation(),this.pause()})),this._controller.addEventListener(e$.OnForward,(t=>{t.stopPropagation(),this.forward()})),this._controller.addEventListener(e$.OnBackward,(t=>{t.stopPropagation(),this.backward()})),this._slider.addEventListener("change",(t=>{var e;t.stopPropagation();const i=null===(e=t.detail)||void 0===e?void 0:e.value,s=i/this._maxIndex;this._elapsed=s*this._totalDuration,this._startTime=Date.now()-this._elapsed,this._dispatchChange(i)})))},this._getSliderValue=()=>{const t=this._elapsed/this._totalDuration;return Math.min(t*this._maxIndex,this._maxIndex)},this._updateSlider=()=>{const t=this._getSliderValue();this._dataIndex=Math.floor(t),this._slider.setValue(Math.min(t,this._maxIndex)),this._dispatchChange(Math.floor(t))},this._dispatchChange=t=>{const e=Math.floor(t);e!==this._activeIndex&&(this._dataIndex=e,this._activeIndex=e,e!==this._maxIndex&&this.dispatchCustomEvent(d$.change))},this.play=()=>{return t=this,e=void 0,s=function*(){this._isPlaying||(this._controller.togglePause(),this._isPlaying=!0,this._elapsed>=this._totalDuration&&(this._elapsed=0),this._startTime=Date.now()-this._elapsed,this.dispatchCustomEvent(d$.play),this._rafId=zo.getRequestAnimationFrame()(this._play.bind(this)))},new((i=void 0)||(i=Promise))((function(n,r){function a(t){try{l(s.next(t))}catch(t){r(t)}}function o(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i((function(t){t(e)}))).then(a,o)}l((s=s.apply(t,e||[])).next())}));var t,e,i,s},this._play=()=>{this._elapsed=Date.now()-this._startTime;const t=this._getSliderValue();this._updateSlider(),t>=this._maxIndex?this._playEnd():this._rafId=zo.getRequestAnimationFrame()(this._play.bind(this))},this._playEnd=()=>{this._isPlaying=!1,zo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(d$.end)},this.pause=()=>{this._isPlaying&&(this._isPlaying=!1,this._elapsed=Date.now()-this._startTime,zo.getCancelAnimationFrame()(this._rafId),this._controller.togglePlay(),this.dispatchCustomEvent(d$.pause))},this.backward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed-e;i<=0?(this._elapsed=0,this._startTime=t):(this._elapsed=i,this._startTime=this._startTime+this._interval),this._updateSlider(),this.dispatchCustomEvent(d$.backward)},this.forward=()=>{const t=Date.now(),e=1*this._interval,i=this._elapsed+e;i>=this._totalDuration?(this._startTime=t-this._totalDuration,this._elapsed=this._totalDuration):(this._startTime=this._startTime-e,this._elapsed=i),this._updateSlider(),this.dispatchCustomEvent(d$.forward)},this._initAttributes(),this._initDataIndex(),this._initEvents()}dispatchCustomEvent(t){super.dispatchCustomEvent(t,this._dataIndex)}render(){super.render()}}const g$=t=>BE(Object.assign({},t)),m$=t=>Object.assign(Object.assign({},t),{style:Object.assign({},BE(t.style))}),_$=t=>{var e,i,s,n,r,a,o,l,h,d,c,u,p,g,m;const _=g$(null!==(i=null===(e=null==t?void 0:t.slider)||void 0===e?void 0:e.trackStyle)&&void 0!==i?i:{}),f=g$(null!==(n=null===(s=null==t?void 0:t.slider)||void 0===s?void 0:s.railStyle)&&void 0!==n?n:{}),v=(k=null!==(a=null===(r=null==t?void 0:t.slider)||void 0===r?void 0:r.handlerStyle)&&void 0!==a?a:{},BE(Object.assign({},k))),y=m$(null!==(l=null===(o=null==t?void 0:t.controller)||void 0===o?void 0:o.start)&&void 0!==l?l:{}),b=m$(null!==(d=null===(h=null==t?void 0:t.controller)||void 0===h?void 0:h.pause)&&void 0!==d?d:{}),x=m$(null!==(u=null===(c=null==t?void 0:t.controller)||void 0===c?void 0:c.backward)&&void 0!==u?u:{}),S=m$(null!==(g=null===(p=null==t?void 0:t.controller)||void 0===p?void 0:p.forward)&&void 0!==g?g:{}),M=Object.assign(Object.assign({},t),{direction:t.direction,interval:t.interval,visible:t.visible,orient:null!==(m=t.orient)&&void 0!==m?m:"bottom",slider:Object.assign(Object.assign({},t.slider),{trackStyle:_,railStyle:f,handlerStyle:v}),controller:Object.assign(Object.assign({},t.controller),{start:y,pause:b,backward:x,forward:S})});var k;return t.visible||(M.controller.visible=!1,M.slider.visible=!1),M},f$=t=>"left"===t||"right"===t,v$=t=>"top"===t||"bottom"===t;class y$ extends tD{constructor(){super(...arguments),this.layoutZIndex=Ey.Player,this.layoutLevel=Dy.Player,this.specKey="player",this.type=r.player,this._orient="bottom",this._getPlayerAttrs=()=>{var t,e,i,s,n,r;const a=this._spec.type,o={size:{width:this._width,height:this._height},dx:null!==(t=this._spec.dx)&&void 0!==t?t:0+this._dx,dy:null!==(e=this._spec.dy)&&void 0!==e?e:0+this._dy};return"discrete"===a?Object.assign(Object.assign(Object.assign({},(l=this._spec,h=this._specs,Object.assign(Object.assign({},_$(l)),{data:h,type:"discrete"}))),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(s=null===(i=this._spec)||void 0===i?void 0:i.loop)||void 0===s||s}):Object.assign(Object.assign(Object.assign({},((t,e)=>Object.assign(Object.assign({},_$(t)),{data:e,type:"continuous"}))(this._spec,this._specs)),o),{disableTriggerEvent:this._option.disableTriggerEvent,loop:null===(r=null===(n=this._spec)||void 0===n?void 0:n.loop)||void 0===r||r});var l,h},this._createOrUpdatePlayerComponent=()=>{const t=Object.assign({},this._getPlayerAttrs()),e=this.getContainer();this._playerComponent?Im(t,this._cacheAttrs)||(this._cacheAttrs=t,this._playerComponent.setAttributes(t),this._playerComponent._initAttributes(),this._playerComponent.render()):("discrete"===t.type?this._playerComponent=new u$(t):this._playerComponent=new p$(t),this._cacheAttrs=t,this._playerComponent.name="player",e.add(this._playerComponent),this._initEvent())},this._maxSize=()=>{var t,e,i,s,n,r,a,o,l;return Math.max(...Ba(null===(e=null===(t=this._spec.controller.start)||void 0===t?void 0:t.style)||void 0===e?void 0:e.size),...Ba(null===(s=null===(i=this._spec.controller.pause)||void 0===i?void 0:i.style)||void 0===s?void 0:s.size),...Ba(null===(r=null===(n=this._spec.controller.backward)||void 0===n?void 0:n.style)||void 0===r?void 0:r.size),...Ba(null===(o=null===(a=this._spec.controller.forward)||void 0===a?void 0:a.style)||void 0===o?void 0:o.size),null!==(l=f$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==l?l:10)},this._sliderExceededSize=()=>{var t,e,i,s,n,r,a,o,l;const h=null!==(t=f$(this._orient)?this._spec.slider.railStyle.width:this._spec.slider.railStyle.height)&&void 0!==t?t:10,d=Math.max(...Ba(null===(i=null===(e=this._spec.controller.start)||void 0===e?void 0:e.style)||void 0===i?void 0:i.size),...Ba(null===(n=null===(s=this._spec.controller.pause)||void 0===s?void 0:s.style)||void 0===n?void 0:n.size),...Ba(null===(a=null===(r=this._spec.controller.backward)||void 0===r?void 0:r.style)||void 0===a?void 0:a.size),...Ba(null===(l=null===(o=this._spec.controller.forward)||void 0===o?void 0:o.style)||void 0===l?void 0:l.size));return h>=d?h-d:0},this._initEvent=()=>{this._option.disableTriggerEvent||(this._option.globalInstance.on(Hd.rendered,(()=>{var t;(null===(t=this._spec)||void 0===t?void 0:t.auto)&&this._playerComponent.play()})),this._playerComponent.addEventListener(d$.end,(()=>{var t;this.event.emit(Hd.playerEnd,{model:this}),this._alternate&&"discrete"===this._spec.type&&(this._direction="default"===this._direction?"reverse":"default",this._playerComponent.setAttributes({direction:this._direction,dataIndex:"reverse"===this._direction?this._specs.length-2:1})),(null===(t=this._spec)||void 0===t?void 0:t.loop)&&this._playerComponent.play()})),this._playerComponent.addEventListener(d$.change,(t=>{const{index:e}=t.detail;this.changePlayerIndex(e)})),this._playerComponent.addEventListener(d$.backward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(Hd.playerBackward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(d$.forward,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(Hd.playerForward,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(d$.play,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(Hd.playerPlay,{model:this,value:{spec:i,index:e,specs:this._specs}})})),this._playerComponent.addEventListener(d$.pause,(t=>{const{index:e}=t.detail,i=this._specs[e];this.event.emit(Hd.playerPause,{model:this,value:{spec:i,index:e,specs:this._specs}})})))}}get orient(){return this._orient}set layoutOrient(t){this._orient=t}setAttrFromSpec(){var t,e,i,s,n,r,a,o;super.setAttrFromSpec(),this._orient=null!==(t=this._spec.orient)&&void 0!==t?t:"bottom",this._specs=null!==(e=this._spec.specs)&&void 0!==e?e:[],this._direction=null!==(i=this._spec.direction)&&void 0!==i?i:"default",this._alternate=null!==(s=this._spec.alternate)&&void 0!==s&&s,this._dx=null!==(n=this._spec.dx)&&void 0!==n?n:0,this._dy=null!==(r=this._spec.dy)&&void 0!==r?r:0,this._position=null!==(a=this._spec.position)&&void 0!==a?a:"middle",this._visible=null===(o=this._spec.visible)||void 0===o||o}afterSetLayoutStartPoint(t){if(super.afterSetLayoutStartPoint(t),qo(t.x)){const e=f$(this._orient)?t.x+this._sliderExceededSize()/2:t.x;this._playerComponent&&this._playerComponent.setAttribute("x",e)}if(qo(t.y)){const e=v$(this._orient)?t.y+this._sliderExceededSize()/2:t.y;this._playerComponent&&this._playerComponent.setAttribute("y",e)}}getBoundsInRect(t,e){this._width=this._computeWidth(t),this._height=this._computeHeight(t),this._dx=this._computeDx(e),this._dy=this._computeDy(e);const i=this._computeLayoutRect(t,this._width,this._height);return this._createOrUpdatePlayerComponent(),i}changeRegions(t){}onRender(t){}_getNeedClearVRenderComponents(){return[this._playerComponent]}_computeLayoutRect(t,e,i){if(!1===this._visible)return{x1:0,x2:0,y1:0,y2:0};switch(this._orient){case"top":case"left":return{x1:0,y1:0,x2:e,y2:i};case"right":return{x1:t.width-e,y1:0,x2:t.width,y2:t.height};default:return{x1:0,y1:t.height-i,x2:t.width,y2:t.height}}}_computeWidth(t){return h(this._spec.width)?Math.min(t.width,Number(this._spec.width)):f$(this._orient)?this._maxSize():t.width}_computeHeight(t){return h(this._spec.height)?(this._height=this._spec.height,Math.min(t.height,Number(this._spec.height))):v$(this._orient)?this._maxSize():t.height}_computeDx(t){return f$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.width-this._width)/2:t.width-this._width}_computeDy(t){return v$(this._orient)||"start"===this._position?0:"middle"===this._position?(t.height-this._height)/2:t.height-this._height}changePlayerIndex(t){const e=this._specs[t];Ba(e.data).forEach((t=>{var e,i;null===(i=null===(e=this._option)||void 0===e?void 0:e.globalInstance)||void 0===i||i.updateData(t.id,t.values)})),this.event.emit(Hd.playerChange,{model:this,value:{spec:e,index:t,specs:this._specs}})}}y$.specKey="player",y$.type=r.player;class b$ extends Rk{constructor(t,e){const{dataLabels:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{l.get(e)||this.removeChild(t)})),this._componentMap=l}setLocation(t){this.translateTo(t.x,t.y)}disableAnimation(){this._componentMap.forEach((t=>{t.disableAnimation()}))}enableAnimation(){this._componentMap.forEach((t=>{t.enableAnimation()}))}}b$.defaultAttributes={pickable:!1};class x$ extends e_{constructor(t,e){super(t,Qd.label,e),this.spec.componentType=Qd.label}parseAddition(t){return super.parseAddition(t),this.labelStyle(t.labelStyle),this.size(t.size),this.target(t.target),this}labelStyle(t){return this.setFunctionSpec(t,"labelStyle")}size(t){return this.setFunctionSpec(t,"size")}target(t){if(this.spec.target){const t=Ba(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t));this.detach(t)}if(this.spec.target=t,t){const e=Ba(t).map((t=>S(t)?this.view.getMarkById(t):t));this.attach(e)}return this.commit(),this}_updateComponentEncoders(){const t=Object.assign({update:{}},this.spec.encode),e=Object.keys(t).reduce(((e,i)=>{const s=t[i];return s&&(e[i]={callback:(t,e,i)=>{var n,r,a,o;const l=Ba(this.spec.target).map((t=>S(t)?this.view.getMarkById(t):t)),h=null===(r=null===(n=this.group)||void 0===n?void 0:n.getGroupGraphicItem)||void 0===r?void 0:r.call(n);let d=Gp(this.spec.size,i);d||(d=h?{width:null!==(a=h.attribute.width)&&void 0!==a?a:h.AABBBounds.width(),height:null!==(o=h.attribute.height)&&void 0!==o?o:h.AABBBounds.height()}:{width:1/0,height:1/0});const c=this.spec.skipTheme?null:this.view.getCurrentTheme();return((t,e,i,s,n,r={})=>{var a;const o=null===(a=r.components)||void 0===a?void 0:a.dataLabel,l=t.map(((t,e)=>{var a,o,l,h,d;const c=Object.assign(Object.assign({},n),{labelIndex:e}),u=null!==(a=Gp(s,c,t))&&void 0!==a?a:{},{components:p={}}=r;let g={};switch(t.markType){case Jd.line:case Jd.area:g="line"===u.type?p.lineLabel:"area"===u.type?p.areaLabel:p.lineDataLabel;break;case Jd.rect:case Jd.rect3d:case Jd.interval:g=p.rectLabel;break;case Jd.symbol:case Jd.circle:case Jd.cell:g=p.symbolLabel;break;case Jd.arc:case Jd.arc3d:g=p.arcLabel;break;case Jd.polygon:case Jd.path:default:g=p.pointLabel}const m=null!==(o=u.data)&&void 0!==o?o:[],_=null!==(h=null===(l=null==g?void 0:g.data)||void 0===l?void 0:l[0])&&void 0!==h?h:{};if(m&&m.length>0)m.forEach(((e,s)=>{if(t.elements[s]){const n=Pm(i,e,t.elements[s],c);E(e,_,n)}}));else{const e=(t,e)=>{const{data:i}=t,s=function(t,e){var i={};for(var s in t)Object.prototype.hasOwnProperty.call(t,s)&&e.indexOf(s)<0&&(i[s]=t[s]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(s=Object.getOwnPropertySymbols(t);n{if("willRelease"!==s.getGraphicItem().releaseStatus)if(t.isCollectionMark())s.getDatum().forEach((t=>{const n=Pm(i,t,s,c);m.push(e(n,_))}));else{const t=Pm(i,s.getDatum(),s,c);m.push(e(t,_))}}))}const f=E({},g,{baseMarkGroupName:null===(d=t.graphicItem)||void 0===d?void 0:d.name,getBaseMarks:()=>t.elements.map((t=>t.getGraphicItem()))},null!=u?u:{});return f.data=null!=m?m:g.data,f})).filter((t=>!D(t))),h=E({},o,{size:e});return h.dataLabels=l,h})(l,d,s,this.spec.labelStyle,i,c)}}),e}),{});this._encoders=e}}x$.componentType=Qd.label;const S$=()=>{_c.registerGraphicComponent(Qd.label,(t=>new b$(t))),_c.registerComponent(Qd.label,x$)};class M$ extends tD{constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.layoutType="none",this.layoutZIndex=Ey.Label,this._regions=e.getRegionsInIndex(e.regionIndexes)}_interactiveConfig(t){const{interactive:e}=t,i={hover:!1,select:!1,state:t.state};if(!0!==e)return i;const{hover:s,select:n}=this._option.getChart().getSpec();return!1===s&&!1===s.enable||(i.hover=!0),!1===n&&!1===n.enable||(i.select=!0),i}_compareSpec(t,e){const i=super._compareSpec(t,e);return i.reRender=!0,Im(e,t)||(i.reMake=!0),i}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}}M$.type=r.label;class k$ extends xF{constructor(){super(...arguments),this.skipEncode=!1}getRule(){return this._rule}setRule(t){this._rule=t}getTarget(){return this._target}setTarget(t){this._target=t,this._rule||this.setRule(t.type)}getComponent(){return this._component}setComponent(t){this._component=t}}k$.type="text",k$.constructorType="label";const A$=()=>{$l.registerMark(k$.constructorType,k$),GA()};class w$ extends QE{_initTheme(t,e){return{spec:t,theme:this._theme}}}class T$ extends M${constructor(t,e){super(t,e),this.type=r.label,this.name=r.label,this.specKey="label",this.transformerConstructor=w$,this.layoutZIndex=Ey.Label,this._layoutRule=t.labelLayout||"series"}static getSpecInfo(t,e){const i=[];return((null==e?void 0:e.region)||[]).forEach(((s,n)=>{(s.seriesIndexes||[]).some((t=>{const i=e.series[t],{markLabelSpec:s={}}=i;return Object.values(s).some((t=>Array.isArray(t)&&(t=>t.some((t=>t.visible)))(t)))}))&&i.push({spec:t,type:r.label,specInfoPath:["component",this.specKey,n],regionIndexes:[n]})})),i}init(t){super.init(t),this.initEvent(),this._initTextMark(),this._initLabelComponent(),this._initTextMarkStyle()}reInit(t){super.reInit(t),this._labelInfoMap&&this._labelInfoMap.clear(),this._initTextMark(),this._initTextMarkStyle()}initEvent(){this.event.on(Hd.dataZoomChange,(()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.disableAnimation()})),this.event.on(lc.AFTER_MARK_RENDER_END,t)}));const t=()=>{this._labelComponentMap.forEach(((t,e)=>{const i=e.getProduct().getGroupGraphicItem();i&&i.enableAnimation()})),this.event.off(lc.AFTER_MARK_RENDER_END,t)}}_initTextMark(){this._labelInfoMap||(this._labelInfoMap=new Map),this._labelComponentMap||(this._labelComponentMap=new Map),mE(this._regions,(t=>{const{markLabelSpec:e={}}=t.getSpecInfo(),i=Object.keys(e),s=t.getRegion();this._labelInfoMap.get(s)||this._labelInfoMap.set(s,[]);for(let n=0;n{if(e.visible){const n=this._labelInfoMap.get(s),o=this._createMark({type:"label",name:`${r}-label-${i}`},{noSeparateStyle:!0,attributeContext:t.getMarkAttributeContext()});o.setTarget(a),n.push({labelMark:o,baseMark:a,series:t,labelSpec:e})}}))}}))}_initLabelComponent(){this._labelInfoMap.forEach(((t,e)=>{if("region"===this._layoutRule){const i=this._createMark({type:"component",name:`${e.getGroupMark().name}-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});i&&(i.setSkipBeforeLayouted(!0),t[0]&&M(t[0].labelSpec.zIndex)&&i.setZIndex(t[0].labelSpec.zIndex),this._marks.addMark(i),this._labelComponentMap.set(i,(()=>this._labelInfoMap.get(e))))}else t.forEach(((t,i)=>{const s=this._createMark({type:"component",name:`${t.labelMark.name}-component`},{componentType:"label",noSeparateStyle:!0,support3d:t.baseMark.getSupport3d()});s&&(M(t.labelSpec.zIndex)&&s.setZIndex(t.labelSpec.zIndex),s.setSkipBeforeLayouted(!0),this._marks.addMark(s),this._labelComponentMap.set(s,(()=>this._labelInfoMap.get(e)[i])),t.labelMark.setComponent(s))}))}))}_initTextMarkStyle(){this._labelInfoMap.forEach((t=>{t.forEach((t=>{var e,i;const{labelMark:s,labelSpec:n,series:r}=t;if(this.initMarkStyleWithSpec(s,n,void 0),ys(null==n?void 0:n.getStyleHandler)){const t=n.getStyleHandler(r);null==t||t.call(r,s,n)}(null===(i=null===(e=s.stateStyle)||void 0===e?void 0:e.normal)||void 0===i?void 0:i.lineWidth)&&s.setAttribute("stroke",r.getColorAttribute(),"normal",Py.Base_Series)}))}))}updateLayoutAttribute(){super.updateLayoutAttribute(),this._labelComponentMap.forEach(((t,e)=>{const i=t();y(i)?this._updateMultiLabelAttribute(i,e):this._updateSingleLabelAttribute(i,e)}))}_updateMultiLabelAttribute(t,e){this._updateLabelComponentAttribute(e.getProduct(),t.map((({baseMark:t})=>t.getProduct())),t)}_updateSingleLabelAttribute(t,e){const{baseMark:i}=t;this._updateLabelComponentAttribute(e.getProduct(),i.getProduct(),[t])}_updateLabelComponentAttribute(t,e,i){const s=this._option.getComponentsByType("totalLabel");t.target(e).configure({interactive:!1}).depend(s.map((t=>t.getMarks()[0].getProduct()))).labelStyle(((t,e)=>{var n,r;const a=i[e.labelIndex];if(a){const{labelSpec:t,labelMark:e,series:i}=a,o=e.getRule(),l=this._interactiveConfig(t),h=null!==(r=null===(n=this._spec)||void 0===n?void 0:n.centerOffset)&&void 0!==r?r:0;let d=Tl({textStyle:Object.assign({pickable:!0===t.interactive},t.style),overlap:{avoidMarks:s.map((t=>t.getMarks()[0].getProductId()))}},function(t,e){var i;const{labelSpec:s}=e;s.overlap&&!vs(s.overlap)&&(s.overlap={});const n=null!==(i=jz[t])&&void 0!==i?i:jz.point;return e.series.type===_l.sankey?function(t){var e,i,s;const{series:n,labelSpec:r={}}=t,a=null!==(e=zz(r.position))&&void 0!==e?e:"outside",o=n.direction;let l,h=a;return S(a)&&("vertical"===o?h="inside-start"===a?t=>"inside-left":"inside-middle"===a?t=>"center":"inside-end"===a?t=>"inside-right":t=>"bottom":"inside-start"===a?h=t=>"inside-left":"inside-middle"===a?h=t=>"center":"inside-end"===a?h=t=>"inside-right":"outside"===a&&(h=t=>"right")),l=!1!==r.overlap&&(!S(a)||!a.includes("inside"))&&{strategy:null!==(s=null===(i=r.overlap)||void 0===i?void 0:i.strategy)&&void 0!==s?s:Xz(n)},{position:h,overlap:l,smartInvert:!1,offset:0,syncState:!0}}(e):n(e)}(o,a),Object.assign(Object.assign(Object.assign({},eD(t,["position","style","state","type","stackDataFilterType","getStyleHandler"])),l),{centerOffset:h}),t.stackDataFilterType?{dataFilter:"min"===t.stackDataFilterType?t=>t.filter((t=>t.data[PT])):t=>t.filter((t=>t.data[DT]))}:{});return i&&i.parseLabelStyle&&(d=i.parseLabelStyle(d,t,e)),"line"!==o&&"area"!==o||(d.type=o),d}})).encode(((t,e,s)=>{if(i[s.labelIndex]){const{labelSpec:e,labelMark:n}=i[s.labelIndex];return n.skipEncode?{data:t}:Hz(i[s.labelIndex],t,e.formatMethod,e.formatter)}})).size((()=>i[0].series.getRegion().getLayoutRect()))}compileMarks(){this.getMarks().forEach((t=>{const e=this._labelComponentMap.get(t)();let i;i=y(e)?e[0].series.getRegion().getGroupMark().getProduct():e.series.getRegion().getGroupMark().getProduct(),t.compile({group:i,context:{model:this,labelInfo:e}})}))}getVRenderComponents(){const t=[];return this._labelComponentMap.forEach(((e,i)=>{const s=i.getProduct().getGroupGraphicItem();s&&t.push(s)})),t}}T$.type=r.label,T$.specKey="label",T$.transformerConstructor=w$;class L$ extends M${constructor(){super(...arguments),this.type=r.totalLabel,this.name=r.totalLabel,this.specKey="totalLabel",this.layoutZIndex=Ey.Label}static getSpecInfo(t,e){var i;const s=[];return null===(i=null==e?void 0:e.region)||void 0===i||i.forEach(((t,i)=>{var n;null===(n=t.seriesIndexes)||void 0===n||n.forEach((t=>{const{spec:n}=e.series[t],a=n[this.specKey];(null==a?void 0:a.visible)&&s.push({spec:a,type:r.totalLabel,specPath:["series",t,this.specKey],specInfoPath:["component",this.specKey,t],regionIndexes:[i],seriesIndexes:[t]})}))})),s}init(t){super.init(t),this._initTextMark(),this._initLabelComponent()}reInit(t){super.reInit(t),this._initTextMark()}_initTextMark(){var t;const e=this._getSeries();if(null===(t=e.getSpec().totalLabel)||void 0===t?void 0:t.visible){const t=e.getSeriesMark();if(t){const e=this._createMark({type:"label",name:`${t.name}-total-label`});this._baseMark=t,this._textMark=e,this._initTextMarkStyle()}}}_initTextMarkStyle(){var t;super.initMarkStyleWithSpec(this._textMark,this._spec),this.setMarkStyle(this._textMark,{text:t=>t[CT]},"normal",Py.Default);const e=this._getSeries();null===(t=e.initTotalLabelMarkStyle)||void 0===t||t.call(e,this._textMark)}_initLabelComponent(){const t=this._getSeries(),e=this._createMark({type:"component",name:`${t.name}-total-label-component`},{componentType:"label",noSeparateStyle:!0,support3d:this._spec.support3d});e&&this._marks.addMark(e)}updateLayoutAttribute(){super.updateLayoutAttribute();const t=this._getSeries();this._marks.forEach(((e,i)=>{e.getProduct().target(this._baseMark.getProduct()).configure({interactive:!1}).labelStyle((()=>{var e,i;if(this._baseMark){const{offset:s,animation:n,overlap:r}=this._spec,a=this._interactiveConfig(this._spec);return Tl({textStyle:{pickable:!0===this._spec.interactive},position:C$(t,this._baseMark.type),x:0,y:0},null!==(i=null===(e=t.getTotalLabelComponentStyle)||void 0===e?void 0:e.call(t,{baseMark:this._baseMark,labelMark:this._textMark}))&&void 0!==i?i:{},Object.assign({offset:s,animation:n,overlap:r,dataFilter:t=>t.filter((t=>t.data[DT]))},a))}})).encode((e=>Hz({baseMark:this._baseMark,labelMark:this._textMark,series:t,labelSpec:t.getSpec().totalLabel},e,this._spec.formatMethod))).size((()=>this._regions[0].getLayoutRect()))}))}compileMarks(){this.getMarks().forEach((t=>{const e=this._regions[0].getGroupMark().getProduct();t.compile({group:e,context:{model:this}})}))}getVRenderComponents(){const t=[];return this.getMarks().forEach((e=>{const i=e.getProduct().getGroupGraphicItem();i&&t.push(i)})),t}_getSeries(){return this._option.getSeriesInIndex([this.getSpecPath()[1]])[0]}}function C$(t,e){var i,s;let n;const{direction:r}=t,a={vertical:["top","bottom"],horizontal:["right","left"]},o=("horizontal"===r?null===(i=t.getXAxisHelper())||void 0===i?void 0:i.isInverse():null===(s=t.getYAxisHelper())||void 0===s?void 0:s.isInverse())?1:0;switch(e){case"rect":case"symbol":n=a[r][o];break;default:n="top"}return n}L$.type=r.totalLabel,L$.specKey="totalLabel";const E$=(t,e)=>{const i=Math.atan2(t,e);return i<0?i+2*Math.PI:i};function D$(){P$._animate=gU}KG(),mD(),_D(),Gv(),KS(),hM();class P$ extends JG{markerAnimate(t){P$._animate&&this._animationConfig&&P$._animate([this._line,this._decorativeLine],this._item,this._animationConfig,t)}constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},P$.defaultAttributes,t)),this.name="markPoint",this.defaultUpdateAnimation=fU,this.defaultExitAnimation=vU,this._isArcLine=!1,this._isStraightLine=!1}setLabelPos(){}getTextAlignAttr(t,e,i,s,n){return Wk(Math.abs(s),Math.PI/2,kU)||Wk(Math.abs(s),3*Math.PI/2,kU)?Gk(t,s,n):Vk(s)?PU.postiveXAxis[n]:PU.negativeXAxis[n]}setItemAttributes(t,e,i,s,n){var r,a;if(!t)return;const{autoRotate:o=!0,refX:l=0,refY:h=0,refAngle:d=0,textStyle:c={},richTextStyle:u={},imageStyle:p={},position:g=MU.middle}=e,{state:m}=this.attribute,_=(null===(r=this._line)||void 0===r?void 0:r.getEndAngle())||0,f=l*Math.cos(_)+h*Math.cos(_-Math.PI/2),v=l*Math.sin(_)+h*Math.sin(_-Math.PI/2);if("text"===n){const n=s.x-i.x,r=s.y-i.y;t.setAttributes(Object.assign(Object.assign({},c),{textStyle:Object.assign(Object.assign({},this.getTextAlignAttr(o,n,r,_,null!==(a=e.position)&&void 0!==a?a:"end")),c.textStyle),state:{panel:E({},qk,null==m?void 0:m.textBackground),text:E({},qk,null==m?void 0:m.text)}}))}else"richText"===n?(t.setAttributes({dx:this.getItemDx(t,g,u)+(u.dx||0),dy:this.getItemDy(t,g,u)+(u.dy||0)}),t.states=E({},qk,null==m?void 0:m.richText)):"image"===n&&(t.setAttributes({dx:this.getItemDx(t,g,p)+(p.dx||0),dy:this.getItemDy(t,g,p)+(p.dy||0)}),t.states=E({},qk,null==m?void 0:m.image));const y=Vk(_)?_:_-Math.PI;t.setAttributes({x:s.x+(f||0),y:s.y+(v||0),angle:o&&y+d})}getItemDx(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.width())&&void 0!==n?n:(null==i?void 0:i.width)||0;return e.includes("inside")?-r:0}getItemDy(t,e,i){var s,n;const r=null!==(n=null===(s=null==t?void 0:t.AABBBounds)||void 0===s?void 0:s.height())&&void 0!==n?n:(null==i?void 0:i.height)||0;return e.includes("top")||e.includes("Top")?-r:e.includes("middle")||e.includes("Middle")?-r/2:0}initItem(t,e,i){const{state:s}=this.attribute,{type:n="text",symbolStyle:r,richTextStyle:a,imageStyle:o,renderCustomCallback:l}=t;let h;return"symbol"===n?(h=ra.symbol(Object.assign(Object.assign({},i),r)),h.states=E({},qk,null==s?void 0:s.symbol)):"text"===n?h=new TD(Object.assign(Object.assign({},i),{state:{panel:E({},qk,null==s?void 0:s.textBackground),text:E({},qk,null==s?void 0:s.text)}})):"richText"===n?(h=ra.richtext(Object.assign(Object.assign({},i),a)),h.states=E({},qk,null==s?void 0:s.richText)):"image"===n?(h=ra.image(Object.assign(Object.assign({},i),o)),h.states=E({},qk,null==s?void 0:s.image)):"custom"===n&&l&&(h=l(),h.states=E({},qk,null==s?void 0:s.customMark)),h.name=`mark-point-${n}`,this.setItemAttributes(h,t,e,i,n),h}getItemLineAttr(t,e,i){let s=[],n={x:0,y:0},r=0,a=0,o=0;const{type:l="type-s",arcRatio:h=.8}=t,d=i.x-e.x,c=i.y-e.y;if(this._isStraightLine=Wk(d,0,kU)||Wk(c,0,kU),this._isArcLine){const{x:t,y:s}=e,{x:l,y:d}=i,c=(t+l)/2,u=c+h*(d>s?-1:1)*c,p=(s===d?0:-(t-l)/(s-d))*(u-c)+(s+d)/2;a=E$(s-p,t-u),o=E$(d-p,l-u),n={x:u,y:p},h>0?o{this._markerLayout()})),this._markerData=r}}R$.specKey="markPoint";class I$ extends R${constructor(){super(...arguments),this.type=r.markPoint,this.name=r.markPoint,this.coordinateType="cartesian"}_computePointsAttr(){var t;const e=this._spec,i=this._markerData,s=this._relativeSeries,n="x"in e&&"y"in e,r="coordinate"in e,a="position"in e,o=null!==(t=null==e?void 0:e.autoRange)&&void 0!==t&&t;let l;return n?l=OG(i,s,s,s,o)[0][0]:r?l=BG(i,s,o,e.coordinatesOffset)[0]:a&&(l=jG(e.position,s,e.regionRelative)[0]),{point:l}}_computeOptions(){const t=this._spec,{doXYProcess:e}=XG(t),i=M(t.coordinate);let s;return e?s=[this._processSpecByDims([{dim:"x",specValue:t.x},{dim:"y",specValue:t.y}])]:i&&(s=this._processSpecCoo(t)),{options:s}}}I$.type=r.markPoint,I$.coordinateType="cartesian";class B$ extends R${constructor(){super(...arguments),this.type=r.polarMarkPoint,this.name=r.polarMarkPoint,this.coordinateType="polar"}_computePointsAttr(){var t,e;const i=this._markerData,s=this._relativeSeries,n=RG(i,s,s,s,null!==(e=null===(t=this._spec)||void 0===t?void 0:t.autoRange)&&void 0!==e&&e)[0][0];return{point:Tt({x:this._relativeSeries.getRegion().getLayoutStartPoint().x+this._relativeSeries.angleAxisHelper.center().x,y:this._relativeSeries.getRegion().getLayoutStartPoint().y+this._relativeSeries.angleAxisHelper.center().y},n.radius,n.angle)}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"radius",specValue:t.radius},{dim:"angle",specValue:t.angle}])]}}}B$.type=r.polarMarkPoint,B$.coordinateType="polar";class F$ extends R${constructor(){super(...arguments),this.type=r.geoMarkPoint,this.name=r.geoMarkPoint,this.coordinateType="geo"}_computePointsAttr(){return{point:IG(this._markerData,this._relativeSeries)[0][0]}}_computeOptions(){const t=this._spec;return{options:[this._processSpecByDims([{dim:"areaName",specValue:t.areaName}])]}}}F$.type=r.geoMarkPoint,F$.coordinateType="geo";const Y$=1e-8;function j$(t,e,i,s,n){for(let r=0,a=n[n.length-1];re&&r>s||rn?o:0}function N$(t,e){return Math.abs(t-e)0&&j$(e[i-1].x,e[i-1].y,e[i].x,e[i].y,t))return!0}return!1}var W$;!function(t){t.drawStart="drawStart",t.drawEnd="drawEnd",t.drawing="drawing",t.moving="moving",t.moveStart="moveStart",t.moveEnd="moveEnd",t.brushClear="brushClear"}(W$||(W$={}));const G$={trigger:"pointerdown",updateTrigger:"pointermove",endTrigger:"pointerup",resetTrigger:"pointerupoutside",hasMask:!0,brushMode:"single",brushType:"rect",brushStyle:{fill:"#B0C8F9",fillOpacity:.2,stroke:"#B0C8F9",strokeWidth:2},brushMoved:!0,removeOnClick:!0,delayType:"throttle",delayTime:10,interactiveRange:{y1:-1/0,y2:1/0,x1:-1/0,x2:1/0}},U$=5,$$={debounce:Xd,throttle:Kd};u_(),vk();class X$ extends Rk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},X$.defaultAttributes,t)),this.name="brush",this._activeDrawState=!1,this._cacheDrawPoints=[],this._isDrawedBeforeEnd=!1,this._activeMoveState=!1,this._operatingMaskMoveDx=0,this._operatingMaskMoveDy=0,this._operatingMaskMoveRangeX=[-1/0,1/0],this._operatingMaskMoveRangeY=[-1/0,1/0],this._brushMaskAABBBoundsDict={},this._onBrushStart=t=>{var e;if(this._outOfInteractiveRange(t))return;t.stopPropagation();const i=null===(e=this.attribute.brushMoved)||void 0===e||e;this._activeMoveState=i&&this._isPosInBrushMask(t),this._activeDrawState=!this._activeMoveState,this._activeDrawState&&this._initDraw(t),this._activeMoveState&&this._initMove(t)},this._onBrushing=t=>{this._outOfInteractiveRange(t)||((this._activeDrawState||this._activeMoveState)&&t.stopPropagation(),this._activeDrawState&&this._drawing(t),this._activeMoveState&&this._moving(t))},this._onBrushingWithDelay=0===this.attribute.delayTime?this._onBrushing:$$[this.attribute.delayType](this._onBrushing,this.attribute.delayTime),this._onBrushEnd=t=>{var e;if(!this._activeDrawState&&!this._activeMoveState)return;t.preventDefault();const{removeOnClick:i=!0}=this.attribute;this._activeDrawState&&!this._isDrawedBeforeEnd&&i?((null===(e=this._operatingMask)||void 0===e?void 0:e._AABBBounds.empty())&&this._dispatchEvent(W$.brushClear,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._container.incrementalClearChild(),this._brushMaskAABBBoundsDict={}):(this._activeDrawState&&this._dispatchEvent(W$.drawEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}),this._activeMoveState&&this._dispatchEvent(W$.moveEnd,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})),this._activeDrawState=!1,this._activeMoveState=!1,this._isDrawedBeforeEnd=!1,this._operatingMask&&this._operatingMask.setAttribute("pickable",!1)}}_bindBrushEvents(){if(this.attribute.disableTriggerEvent)return;const{trigger:t=G$.trigger,updateTrigger:e=G$.updateTrigger,endTrigger:i=G$.endTrigger,resetTrigger:s=G$.resetTrigger}=this.attribute;this.stage.addEventListener(t,this._onBrushStart),this.stage.addEventListener(e,this._onBrushingWithDelay),this.stage.addEventListener(i,this._onBrushEnd),this.stage.addEventListener(s,this._onBrushEnd)}_isPosInBrushMask(t){const e=this.eventPosToStagePos(t),i=this._container.getChildren();for(let t=0;t({x:t.x+n,y:t.y+r}))),e.x,e.y))return this._operatingMask=i[t],!0}return!1}_initDraw(t){const{brushMode:e}=this.attribute,i=this.eventPosToStagePos(t);this._cacheDrawPoints=[i],this._isDrawedBeforeEnd=!1,"single"===e&&(this._brushMaskAABBBoundsDict={},this._container.incrementalClearChild()),this._addBrushMask(),this._dispatchEvent(W$.drawStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_initMove(t){var e,i;this._cacheMovePoint=this.eventPosToStagePos(t),this._operatingMaskMoveDx=null!==(e=this._operatingMask.attribute.dx)&&void 0!==e?e:0,this._operatingMaskMoveDy=null!==(i=this._operatingMask.attribute.dy)&&void 0!==i?i:0;const{interactiveRange:s}=this.attribute,{minY:n=-1/0,maxY:r=1/0,minX:a=-1/0,maxX:o=1/0}=s,{x1:l,x2:h,y1:d,y2:c}=this._operatingMask.globalAABBBounds,u=a-l,p=o-h,g=n-d,m=r-c;this._operatingMaskMoveRangeX=[u,p],this._operatingMaskMoveRangeY=[g,m],this._operatingMask.setAttribute("pickable",!0),this._dispatchEvent(W$.moveStart,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_drawing(t){var e,i;const s=this.eventPosToStagePos(t),{sizeThreshold:n=U$,brushType:r}=this.attribute,a=this._cacheDrawPoints.length;if(a>0){const t=null!==(e=this._cacheDrawPoints[this._cacheDrawPoints.length-1])&&void 0!==e?e:{};if(s.x===t.x&&s.y===t.y)return}"polygon"===r||a<=1?this._cacheDrawPoints.push(s):this._cacheDrawPoints[a-1]=s;const o=this._computeMaskPoints();this._operatingMask.setAttribute("points",o);const{x1:l=0,x2:h=0,y1:d=0,y2:c=0}=null===(i=this._operatingMask)||void 0===i?void 0:i._AABBBounds;this._isDrawedBeforeEnd=!this._operatingMask._AABBBounds.empty()&&!!(Math.abs(h-l)>n||Math.abs(d-c)>n),this._isDrawedBeforeEnd&&(this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(W$.drawing,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t}))}_moving(t){const e=this._cacheMovePoint,i=this.eventPosToStagePos(t);if(i.x===(null==e?void 0:e.x)&&i.y===(null==e?void 0:e.y))return;const s=i.x-e.x,n=i.y-e.y,r=Math.min(this._operatingMaskMoveRangeX[1],Math.max(this._operatingMaskMoveRangeX[0],s))+this._operatingMaskMoveDx,a=Math.min(this._operatingMaskMoveRangeY[1],Math.max(this._operatingMaskMoveRangeY[0],n))+this._operatingMaskMoveDy;this._operatingMask.setAttributes({dx:r,dy:a}),this._brushMaskAABBBoundsDict[this._operatingMask.name]=this._operatingMask.AABBBounds,this._dispatchEvent(W$.moving,{operateMask:this._operatingMask,operatedMaskAABBBounds:this._brushMaskAABBBoundsDict,event:t})}_computeMaskPoints(){const{brushType:t,xRange:e=[0,0],yRange:i=[0,0]}=this.attribute;let s=[];const n=this._cacheDrawPoints[0],r=this._cacheDrawPoints[this._cacheDrawPoints.length-1];return s="rect"===t?[n,{x:r.x,y:n.y},r,{x:n.x,y:r.y}]:"x"===t?[{x:n.x,y:i[0]},{x:r.x,y:i[0]},{x:r.x,y:i[1]},{x:n.x,y:i[1]}]:"y"===t?[{x:e[0],y:n.y},{x:e[0],y:r.y},{x:e[1],y:r.y},{x:e[1],y:n.y}]:k(this._cacheDrawPoints),s}_addBrushMask(){var t;const{brushStyle:e,hasMask:i}=this.attribute,s=ra.polygon(Object.assign(Object.assign({points:k(this._cacheDrawPoints),cursor:"move",pickable:!1},e),{opacity:i?null!==(t=e.opacity)&&void 0!==t?t:1:0}));s.name=`brush-${Date.now()}`,this._operatingMask=s,this._container.add(s),this._brushMaskAABBBoundsDict[s.name]=s.AABBBounds}_outOfInteractiveRange(t){const{interactiveRange:e}=this.attribute,{minY:i=-1/0,maxY:s=1/0,minX:n=-1/0,maxX:r=1/0}=e,a=this.eventPosToStagePos(t);return a.x>r||a.xs||a.y{i.getActiveMarks().forEach((s=>{s&&(i.setMarkStyle(s,Object.assign({},t),"inBrush",Py.Series),i.setMarkStyle(s,Object.assign({},e),"outOfBrush",Py.Series))}))}))}static getSpecInfo(t){return jE(t,this.specKey,this.type,(t=>!1!==t.visible))}created(){super.created(),this.initEvent(),this._bindRegions(),this._bindLinkedSeries(),this._initRegionAxisMap(),this._initAxisDataZoomMap(),this._initNeedOperatedItem()}_extendDataInBrush(t){const e=[];for(const i in t)for(const s in t[i])e.push(Object.assign({},t[i][s].data[0]));return e}_extendDatumOutOfBrush(t){var e;const i=[];for(const s in t)i.push(null===(e=t[s].data)||void 0===e?void 0:e[0]);return i}_getBrushInteractiveAttr(t){const e=t.getLayoutStartPoint(),i=t.getLayoutRect(),s=e.x,n=s+i.width,r=e.y,a=r+i.height;return{interactiveRange:{minY:r,maxY:a,minX:s,maxX:n},xRange:[s,n],yRange:[r,a]}}_updateBrushComponent(t,e){const i=this._getBrushInteractiveAttr(t),s=this._brushComponents[e];s.setAttributes(i),this._initMarkBrushState(e,""),s.children[0].removeAllChild(),this._needInitOutState=!0}_createBrushComponent(t,e){var i,s;const n=this._getBrushInteractiveAttr(t),r=new X$(Object.assign(Object.assign(Object.assign({zIndex:this.layoutZIndex,brushStyle:BE(null===(i=this._spec)||void 0===i?void 0:i.style)},n),this._spec),{disableTriggerEvent:this._option.disableTriggerEvent}));r.id=null!==(s=this._spec.id)&&void 0!==s?s:`brush-${this.id}`,this.getContainer().add(r);const{brushMode:a="single"}=this._spec;this._brushComponents.push(r),this._cacheInteractiveRangeAttrs.push(n),r.addEventListener(W$.drawStart,(e=>{this._emitEvent(Hd.brushStart,t)})),r.addEventListener(W$.moveStart,(e=>{this._emitEvent(Hd.brushStart,t)})),r.addEventListener(W$.drawing,(i=>{this._needInitOutState&&"single"===a&&this._initMarkBrushState(e,"outOfBrush"),this._needInitOutState=!1,this._needDisablePickable=!0,this._handleBrushChange(Hd.brushChange,t,i),this._emitEvent(Hd.brushChange,t)})),r.addEventListener(W$.moving,(e=>{this._handleBrushChange(Hd.brushChange,t,e),this._emitEvent(Hd.brushChange,t)})),r.addEventListener(W$.brushClear,(i=>{this._initMarkBrushState(e,""),this._needInitOutState=!0,this._needDisablePickable=!1,this._handleBrushChange(Hd.brushChange,t,i),this._handleBrushChange(Hd.brushClear,t,i),this._emitEvent(Hd.brushChange,t),this._emitEvent(Hd.brushClear,t)})),r.addEventListener(W$.drawEnd,(e=>{this._needInitOutState=!0,this._needDisablePickable=!1;const{operateMask:i}=e.detail;this._handleBrushChange(Hd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(Hd.brushEnd,t)})),r.addEventListener(W$.moveEnd,(e=>{const{operateMask:i}=e.detail;this._handleBrushChange(Hd.brushEnd,t,e);const s=this._extendDataInBrush(this._inBrushElementsMap);!this._spec.zoomWhenEmpty&&s.length>0&&this._setAxisAndDataZoom(i,t),this._emitEvent(Hd.brushEnd,t)}))}_handleBrushChange(t,e,i){const{operateMask:s}=i.detail;this._reconfigItem(s,e),this._reconfigLinkedItem(s,e)}_emitEvent(t,e){this.event.emit(t,{model:this,value:{operateType:t,operateRegion:e,inBrushData:this._extendDataInBrush(this._inBrushElementsMap),outOfBrushData:this._extendDatumOutOfBrush(this._outOfBrushElementsMap),linkInBrushData:this._extendDataInBrush(this._linkedInBrushElementsMap),linkOutOfBrushData:this._extendDatumOutOfBrush(this._linkedOutOfBrushElementsMap),inBrushElementsMap:this._inBrushElementsMap,outOfBrushElementsMap:this._outOfBrushElementsMap,linkedInBrushElementsMap:this._linkedInBrushElementsMap,linkedOutOfBrushElementsMap:this._linkedOutOfBrushElementsMap,zoomRecord:this._zoomRecord}})}_transformBrushedMarkAttr(t){const e={};return(null==t?void 0:t.symbol)&&(e.symbolType=t.symbol),(null==t?void 0:t.symbolSize)&&(e.size=t.symbolSize),(null==t?void 0:t.color)&&(e.fill=t.color),(null==t?void 0:t.colorAlpha)&&(e.fillOpacity=t.colorAlpha),Object.assign(Object.assign({},BE(t)),e)}_reconfigItem(t,e){this._itemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,n,r;const a=i.getGraphicItem(),o=e.id+"_"+i.key;(null===(s=this._outOfBrushElementsMap)||void 0===s?void 0:s[o])&&this._isBrushContainItem(t,a)?(i.addState("inBrush"),this._inBrushElementsMap[null==t?void 0:t.name]||(this._inBrushElementsMap[null==t?void 0:t.name]={}),this._inBrushElementsMap[null==t?void 0:t.name][o]=i,delete this._outOfBrushElementsMap[o]):(null===(r=null===(n=this._inBrushElementsMap)||void 0===n?void 0:n[null==t?void 0:t.name])||void 0===r?void 0:r[o])&&!this._isBrushContainItem(t,a)&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._outOfBrushElementsMap[o]=i,delete this._inBrushElementsMap[t.name][o]),a.setAttribute("pickable",!this._needDisablePickable)}))}))}_reconfigLinkedItem(t,e){const i=e.getLayoutStartPoint(),s=e.getSeries().map((t=>t.id));this._linkedSeries.forEach((e=>{if(!s.includes(e.id)){const s=e.getRegion().getLayoutStartPoint(),n=s.x-i.x,r=s.y-i.y;this._linkedItemMap[e.id].forEach((e=>{const i=e.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{var s,a,o;const l=i.getGraphicItem(),h=e.id+"_"+i.key;(null===(s=this._linkedOutOfBrushElementsMap)||void 0===s?void 0:s[h])&&this._isBrushContainItem(t,l,{dx:n,dy:r})?(i.addState("inBrush"),this._linkedInBrushElementsMap[null==t?void 0:t.name]||(this._linkedInBrushElementsMap[null==t?void 0:t.name]={}),this._linkedInBrushElementsMap[null==t?void 0:t.name][h]=i,delete this._linkedOutOfBrushElementsMap[h]):(null===(o=null===(a=this._linkedInBrushElementsMap)||void 0===a?void 0:a[null==t?void 0:t.name])||void 0===o?void 0:o[h])&&!this._isBrushContainItem(t,l,{dx:n,dy:r})&&(i.removeState("inBrush"),i.addState("outOfBrush"),this._linkedOutOfBrushElementsMap[h]=i),l.setAttribute("pickable",!this._needDisablePickable)}))}))}}))}_isBrushContainItem(t,e,i){var s,n,r;if(!(null==t?void 0:t.globalTransMatrix)||!(null===(s=null==t?void 0:t.attribute)||void 0===s?void 0:s.points))return!1;const a=null!==(r=null===(n=null==t?void 0:t.attribute)||void 0===n?void 0:n.points)&&void 0!==r?r:[],{a:o,b:l,c:h,d,e:c,f:u}=t.globalTransMatrix,p=(null==i?void 0:i.dx)||0,g=(null==i?void 0:i.dy)||0,m=a.map((t=>({x:o*t.x+h*t.y+c+p,y:l*t.x+d*t.y+u+g})));t.globalAABBBounds.clone().set(t.globalAABBBounds.x1+p,t.globalAABBBounds.y1+g,t.globalAABBBounds.x2+p,t.globalAABBBounds.y2+g);const _=e.globalTransMatrix.e,f=e.globalTransMatrix.f;let v=[];if("symbol"===e.type){const{size:t=0}=null==e?void 0:e.attribute,i=Ba(t)[0]/2;return v=[{x:_-i,y:f-i},{x:_+i,y:f-i},{x:_+i,y:f+i},{x:_-i,y:f+i}],V$(m,v)}if("rect"===e.type){const{x1:t,x2:i,y1:s,y2:n}=null==e?void 0:e.AABBBounds,r=Math.abs(t-i),a=Math.abs(s-n);return v=[{x:_,y:f},{x:_+r,y:f},{x:_+r,y:f+a},{x:_,y:f+a}],V$(m,v)}return t.globalAABBBounds.intersects(e.globalAABBBounds)}_stateClamp(t){return Math.min(Math.max(0,t),1)}_setAxisAndDataZoom(t,e){var i;if(this._zoomRecord=[],this._spec.zoomAfterBrush){const s=t.AABBBounds;null===(i=this._regionAxisMap["region_"+e.id])||void 0===i||i.forEach((t=>{var i,n;const r="bottom"===t.layoutOrient||"top"===t.layoutOrient,a=null!==(i=this._spec.axisRangeExpand)&&void 0!==i?i:0,{x1:o,x2:l,y1:h,y2:d}=s,c=r?"x":"y",u=r?o:h,p=r?l:d;if(this._axisDataZoomMap[t.id]){const i=this._axisDataZoomMap[t.id],s=i.relatedAxisComponent,n=s.getScale().invert(u-e.getLayoutStartPoint()[c]),r=s.getScale().invert(p-e.getLayoutStartPoint()[c]),o=i.dataToStatePoint(n),l=i.dataToStatePoint(r),h=this._stateClamp(o-a),d=this._stateClamp(l+a);i.setStartAndEnd(Math.min(h,d),Math.max(h,d),["percent","percent"]),this._zoomRecord.push({operateComponent:i,start:h,end:d})}else{const i=t.getScale().range(),s=null!==(n=t.getScale().rangeFactor())&&void 0!==n?n:[0,1],r=Fa(i){this._releatedAxes.push(this._option.getComponentByUserId(t))})):M(this._spec.axisIndex)?Ba(this._spec.axisIndex).forEach((t=>{this._releatedAxes.push(this._option.getComponentByIndex("axes",t))})):this._releatedAxes=this._option.getComponentsByKey("axes"),this._releatedAxes.forEach((t=>{null==t||t.getRegions().forEach((e=>{this._regionAxisMap["region_"+e.id]?this._regionAxisMap["region_"+e.id].push(t):this._regionAxisMap["region_"+e.id]=[t]}))}))}_initAxisDataZoomMap(){this._option.getComponentsByKey("dataZoom").forEach((t=>{t.relatedAxisComponent&&(this._axisDataZoomMap[t.relatedAxisComponent.id]=t)}))}_initNeedOperatedItem(){const t=this._spec.seriesId,e=this._spec.seriesIndex;this._relativeRegions.forEach((i=>{const s=[];i.getSeries().forEach((n=>{(t&&Ba(t).includes(n.userId.toString())||e&&Ba(e).includes(n.getSpecIndex())||!e&&!t)&&s.push(...n.getMarksWithoutRoot()),this._itemMap[i.id]=s}))})),this._linkedSeries.forEach((t=>{this._linkedItemMap[t.id]=t.getMarksWithoutRoot()}))}_initMarkBrushState(t,e){this._brushComponents.forEach(((e,i)=>{i!==t&&e.children[0].removeAllChild()})),this._inBrushElementsMap={},this._outOfBrushElementsMap={},this._linkedInBrushElementsMap={},this._linkedOutOfBrushElementsMap={},this._option.getAllSeries().forEach((t=>{t.getMarksWithoutRoot().forEach((t=>{const i=t.getProduct();i&&i.elements&&i.elements.length&&i.elements.forEach((i=>{const s=t.id+"_"+i.key;i.removeState("inBrush"),i.removeState("outOfBrush"),i.addState(e),this._outOfBrushElementsMap[s]=i,this._linkedOutOfBrushElementsMap[s]=i}))}))}))}initEvent(){}onRender(t){}changeRegions(t){}_getNeedClearVRenderComponents(){return this._brushComponents}_compareSpec(t,e){this._brushComponents&&this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)}));const i=super._compareSpec(t,e);return Im(e,t)||(i.reRender=!0,i.reMake=!0),i}onLayoutEnd(t){var e;super.onLayoutEnd(t),this._option.disableTriggerEvent||(null===(e=this._spec.visible)||void 0===e||e)&&(this._brushComponents?this._relativeRegions.forEach(((t,e)=>{this._updateBrushComponent(t,e)})):(this._brushComponents=[],this._relativeRegions.forEach(((t,e)=>{this._createBrushComponent(t,e)}))))}clearGraphic(){this._brushComponents&&this._brushComponents.forEach((t=>{t._container.incrementalClearChild()}))}clear(){if(this._brushComponents){const t=this.getContainer();this._brushComponents.forEach((e=>{e.removeAllChild(),e.releaseBrushEvents(),t&&t.removeChild(e)})),this._brushComponents=null}}}K$.type=r.brush,K$.specKey="brush";class q$ extends tD{constructor(){super(...arguments),this.type=r.customMark,this.specKey="customMark",this.layoutType="none",this.layoutZIndex=Ey.CustomMark,this.layoutLevel=Dy.CustomMark}created(){super.created(),this.initMarks(),this.initEvent()}getMarkAttributeContext(){return this._markAttributeContext}_buildMarkAttributeContext(){this._markAttributeContext={vchart:this._option.globalInstance,globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)}}}initMarks(){if(!this._spec)return;const t=this._option&&this._option.getAllSeries(),e=!1!==this._option.animation,i=[];t&&t.length&&t.forEach((t=>{const e=t&&t.getMarksWithoutRoot();e&&e.length&&e.forEach((t=>{i.push(t)}))})),this._createExtensionMark(this._spec,null,`${sh}_series_${this.id}_extensionMark`,0,{depend:i,hasAnimation:e})}_createExtensionMark(t,e,i,s=0,n){var r;const a=this._createMark({type:t.type,name:M(t.name)?`${t.name}`:`${i}_${s}`},{skipBeforeLayouted:!0,attributeContext:this._getMarkAttributeContext(),componentType:t.componentType,key:t.dataKey});if(a){if(M(t.id)&&a.setUserId(t.id),n.hasAnimation&&t.animation){const e=EC({},DC(t.type,t,this._markAttributeContext));a.setAnimationConfig(e)}if(n.depend&&n.depend.length&&a.setDepend(...n.depend),D(e)?this._marks.addMark(a):e&&e.addMark(a),this.initMarkStyleWithSpec(a,t),"group"===t.type&&(i=`${i}_${s}`,null===(r=t.children)||void 0===r||r.forEach(((t,e)=>{this._createExtensionMark(t,a,i,e,n)}))),M(t.dataId)||qo(t.dataIndex)){const e=this.getChart().getSeriesData(t.dataId,t.dataIndex);e&&(e.target.addListener("change",(()=>{a.getData().updateData()})),a.setDataView(e))}}}initEvent(){}_compareSpec(t,e){const i=super._compareSpec(t,e);return Im(e,t)||(i.reMake=!0),i.change=!0,i.reRender=!0,i}changeRegions(t){}_getNeedClearVRenderComponents(){return[]}onRender(t){}_getMarkAttributeContext(){return{vchart:this._option.globalInstance,chart:this.getChart(),globalScale:(t,e)=>{var i;return null===(i=this._option.globalScale.getScale(t))||void 0===i?void 0:i.scale(e)},getLayoutBounds:()=>{const{x:t,y:e}=this.getLayoutStartPoint(),{width:i,height:s}=this.getLayoutRect();return(new Kt).set(t,e,t+i,e+s)}}}_getLayoutRect(){const t=new Kt;return this.getMarks().forEach((e=>{const i=e.getProduct();i&&t.union(i.getBounds())})),t.empty()?{width:0,height:0}:{width:t.width(),height:t.height()}}getBoundsInRect(t){this.setLayoutRect(t);const e=this._getLayoutRect(),{x:i,y:s}=this.getLayoutStartPoint();return{x1:i,y1:s,x2:i+e.width,y2:s+e.height}}}let Z$,J$,Q$,tX;function eX(t){return Z$=1/0,J$=1/0,Q$=-1/0,tX=-1/0,t.forEach((t=>{Z$>t.x&&(Z$=t.x),Q$t.y&&(J$=t.y),tX({x:t[0],y:t[1]}))),t.x,t.y))return o=!0,o;return o}function sX(t,e,i,s={}){const n=At(t[0]),r=At(t[1]),a=At(i),o=function(t,e){void 0===e&&(e="kilometers");var i=np[e];if(!i)throw new Error(e+" units is invalid");return t/i}(e,s.units),l=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(a));return{x:wt(n+Math.atan2(Math.sin(a)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(l))),y:wt(l)}}function nX(t,e,i=0){return i>Math.max(e.x1-t.x2,t.x1-e.x2,e.y1-t.y2,t.y1-e.y2)}function rX(t){return{x1:t.x,x2:t.x+t.width,y1:t.y,y2:t.y+t.height}}function aX(t){var e;if(!t||0===t.length)return[];if(1===t.length)return[t[0].rect];const i=t.map((t=>{var e;return Object.assign(Object.assign({},t),{bound:rX(t.rect),anchorCandidates:cX(null!==(e=t.anchors)&&void 0!==e?e:[],t.point,t.rect,t.offset)})})),s=[];s.push(i[0].bound);for(let t=1;t<=i.length-1;t++){const n=i[t],r=n.bound;let a=s.some((t=>nX(t,r)));if(n.anchorCandidates)if(a&&(null===(e=n.anchorCandidates)||void 0===e?void 0:e.length)>0){for(let t=0;tnX(t,i)))){s.push(i),a=!1;break}}a&&s.push(n.bound)}else s.push(n.bound)}return s.map((t=>function(t){return{x:t.x1,y:t.y1,width:t.x2-t.x1,height:t.y2-t.y1}}(t)))}function oX(t){return t>180?t-360:t}function lX(t,e){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI+90}function hX(t,e){for(let i=0;i{const{x:r,y:a}=dX(Object.assign(Object.assign({},e),{width:i.width,height:i.height}),t,s);n.push({x:r,y:a})})),n}q$.type=r.customMark,q$.specKey="customMark";class uX extends tD{constructor(){super(...arguments),this.type=r.mapLabel,this.name=r.mapLabel,this.specKey="mapLabel",this.layoutType="none",this.layoutZIndex=Ey.MarkPoint,this._activeDatum=[]}static getSpecInfo(t){return jE(t,this.specKey,this.type,(t=>t.visible&&M(t.seriesId)))}setAttrFromSpec(){var t,e,i,s;this.nameField=null!==(t=this._spec.nameField)&&void 0!==t?t:null===(e=this._series)||void 0===e?void 0:e.getDimensionField()[0],this.valueField=null!==(i=this._spec.valueField)&&void 0!==i?i:null===(s=this._series)||void 0===s?void 0:s.getMeasureField()[0]}created(){super.created(),0!=!!this._spec.visible&&(this.initRelatedInfo(),this.initData(),this.initEvent())}initRelatedInfo(){var t,e,i,s,n,r,a,o;this._series=this._option.getSeriesInUserIdOrIndex([this._spec.seriesId])[0],"outer"===this._spec.position&&(this._map=null===(e=null===(t=this._regions[0].getSeriesInType("map")[0])||void 0===t?void 0:t.getMapViewData())||void 0===e?void 0:e.latestData,this._longitudeField=null===(n=null===(s=(i=this._regions[0]).getSpec)||void 0===s?void 0:s.call(i))||void 0===n?void 0:n.longitudeField,this._latitudeField=null===(o=null===(a=(r=this._regions[0]).getSpec)||void 0===a?void 0:a.call(r))||void 0===o?void 0:o.latitudeField)}initData(){const t=this._series;if(!t)return;const e=t.getViewData();if(e){const t=new R(this._option.dataSet,{name:`${this.name}_data`});t.parse([e],{type:"dataview"}),t.transform({type:"copyDataView",level:Hp.copyDataView},!1),this._data=new px(this._option,t),t.target.addListener("change",(()=>{"hover"!==this._spec.trigger&&"click"!==this._spec.trigger&&(this._activeDatum=this._data.getLatestData())}))}}initEvent(){var t;this.event.on("zoom",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handleZoom(t),!0))),this.event.on("panmove",{filter:t=>this._isRelativeModel(t.model)},(t=>(this.handlePan(t),!0)));const e=this._spec.trigger;if("none"===e)return;const i=null===(t=this.getCompiler())||void 0===t?void 0:t.getVGrammarView();i&&("hover"===e?(i.addEventListener("element-highlight:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("element-highlight:reset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(null)}))):"click"===e&&(i.addEventListener("element-select:start",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum(t.elements[0].getDatum())})),i.addEventListener("elementSelectReset",(t=>{this._isRelativeSeries(t.options.seriesId)&&this._updateDatum([])}))))}handlePan(t){const{delta:e}=t;this._markerComponents.forEach((t=>{t.translate(e[0],e[1])}))}handleZoom(t){this._updateMarkerLayoutAttribute()}_updateDatum(t){this._activeDatum=t,this._markerComponents.forEach(((t,e)=>{var i;const s=null===(i=this._data)||void 0===i?void 0:i.getLatestData()[e];this._activeDatum.includes(s)?t.setAttribute("visible",!0):t.setAttribute("visible",!1)}))}dataToPosition(t){return this._series.dataToPosition(t)}updateLayoutAttribute(){var t;const e=null===(t=this._data)||void 0===t?void 0:t.getLatestData();e&&0!==e.length&&(super.updateLayoutAttribute(),this._updateMarkerLayoutAttribute())}_updateMarkerLayoutAttribute(){var t;const e=[],i=[];this._markerComponents||(this._markerComponents=null===(t=this._data)||void 0===t?void 0:t.getLatestData().map(((t,e)=>{var i;const s=new P$({position:void 0,animation:!1});return s&&(s.name=`${this.name}_marker_${e}`,s.id=null!==(i=this._spec.id)&&void 0!==i?i:`${this.name}_marker_${this.id}`,s.setAttribute("zIndex",this.layoutZIndex)),s}))),this._markerComponents.forEach(((t,s)=>{t.removeAllChild();const{pairInfo:n,contentMarks:r}=this._evaluateMarker(this._data.getLatestData()[s],s);n&&e.push(n),r&&i.push(r)}));const s=this._layoutLabels(e);this._layoutMarkers(s,i),this._renderMarkers()}_evaluateMarker(t,e){var i,s,n,r,a,o,l,h,d,c,u,p;let g=0,m=0,_=0,f=0,v=0;const y=this._spec.position||"top",b=this._spec.offset,x=sl(null===(i=this._spec.background)||void 0===i?void 0:i.padding),S=this._spec.space||0;m+=((null==x?void 0:x.left)||0)+((null==x?void 0:x.right)||0),_+=((null==x?void 0:x.top)||0)+((null==x?void 0:x.bottom)||0);const k={},A=this.dataToPosition(t),w=tr({});if(w.name=`${this.name}_marker_itemContainer_${e}`,k.container=w,null===(s=this._spec.background)||void 0===s?void 0:s.visible){const t=Kv(BE(Object.assign({},this._spec.background.style)));t.setAttributes(A),k.labelBackground=t,w.appendChild(t)}if(null===(n=this._spec.icon)||void 0===n?void 0:n.visible){const t=Cv(BE(Object.assign({},this._spec.icon.style)));t.setAttributes(A),t.setAttribute("symbolType",null===(r=this._spec.icon.style)||void 0===r?void 0:r.shape);const e=t.AABBBounds,i=null!==(a=(null==e?void 0:e.y2)-(null==e?void 0:e.y1))&&void 0!==a?a:0,s=null!==(o=(null==e?void 0:e.x2)-(null==e?void 0:e.x1))&&void 0!==o?o:0;k.icon=t,w.appendChild(t),v=i,f+=s,g++}if(null===(l=this._spec.nameLabel)||void 0===l?void 0:l.visible){const e=__(BE(Object.assign({},this._spec.nameLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.nameField]);const i=e.AABBBounds,s=null!==(h=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==h?h:0,n=null!==(d=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==d?d:0;k.nameLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}if((null===(c=this._spec.valueLabel)||void 0===c?void 0:c.visible)&&M(t[this.valueField])){const e=__(BE(Object.assign({},this._spec.valueLabel.style)));e.setAttributes(A),e.setAttribute("text",t[this.valueField]);const i=e.AABBBounds,s=null!==(u=(null==i?void 0:i.y2)-(null==i?void 0:i.y1))&&void 0!==u?u:0,n=null!==(p=(null==i?void 0:i.x2)-(null==i?void 0:i.x1))&&void 0!==p?p:0;k.valueLabel=e,w.appendChild(e),v=Math.max(v,s),f+=n,g++}const T=Object.values(k).find((t=>!!t&&"group"!==t.type)),L={x:null==T?void 0:T.getComputedAttribute("x"),y:null==T?void 0:T.getComputedAttribute("y")},C={x:L.x,y:L.y,width:0,height:0};C.width=m+f+(g-1)*S,C.height=_+v;const E={rect:C,point:L,index:e};if("outer"!==y){const t=["top","right","left","bottom"].filter((t=>t!==y));E.rect=dX(C,y,b),E.anchors=t,E.offset=b}else E.pointCoord={x:+(null==t?void 0:t[this._longitudeField]),y:+(null==t?void 0:t[this._latitudeField])};return{pairInfo:E,contentMarks:k}}_layoutMarkers(t,e){var i,s,n;for(let r=0;r{var i,s;if(t){const n=t.AABBBounds;let r=0;"symbol"===t.type&&(r+=(null!==(i=n.x2-n.x1)&&void 0!==i?i:0)/2),t.setAttributes({x:m+r,y:g}),m+=null!==(s=n.x2-n.x1)&&void 0!==s?s:0,2!==e&&(m+=p)}})),null==h||h.setAttributes({x:0,y:0,width:c.width,height:c.height}),null==d||d.setAttributes({dx:-c.width/2,dy:-c.height/2});const _=this._data.getLatestData()[r],f=this.dataToPosition(_),v=this.getRegions()[0].getLayoutStartPoint(),y=!(!(null===(s=this._spec.leader)||void 0===s?void 0:s.visible)||!(a||o||l));this._markerComponents[r].setAttributes({x:v.x,y:v.y,position:f,visible:this._activeDatum.includes(_),itemContent:{refX:0,type:"custom",renderCustomCallback:()=>d,autoRotate:!1,offsetX:c.x+c.width/2-f.x,offsetY:c.y+c.height/2-f.y},itemLine:{visible:y,type:"type-po",lineStyle:BE(Object.assign({},null===(n=this._spec.leader)||void 0===n?void 0:n.style)),startSymbol:{visible:!1}}})}}_renderMarkers(){if(this._markerComponents&&this._markerComponents.length)for(let t=0;tt.pointCoord)),{x1:n,x2:r,y1:a,y2:o}=eX(s),l=i([(n+r)/2,(a+o)/2]);return l?aX(t.map((t=>{const s=t.rect,n=hX(e,t.pointCoord)?i(function(t,e,i,s=200){const n=5621/s;let r=e;for(let e=1;e<=n;e++){const e=sX(r,s,i);if(!hX(t,e))return[e.x,e.y];r=[e.x,e.y]}return e}(e,[t.pointCoord.x,t.pointCoord.y],oX(lX(t.point,l)))):t.point;n&&(s.x=n.x,s.y=n.y);const r=oX(lX(t.point,l));let a;const o=[];return r>=-45&&r<45?(a="top",o.push("left","right")):r>=45&&r<135?a="right":r>=-135&&r<-45?(a="left",o.push("left")):(a="bottom",o.push("left","right")),t.anchors=o,t.offset=20,t.rect=dX(t.rect,a,0),t}))):[]}(t,this._map,(t=>this._series.dataToPosition({[this._longitudeField]:t[0],[this._latitudeField]:t[1]}))):aX(t)}_isRelativeModel(t){var e,i,s;const n=null!==(i=null===(e=this._series.getXAxisHelper())||void 0===e?void 0:e.getAxisId())&&void 0!==i?i:null===(s=this._series.getCoordinateHelper())||void 0===s?void 0:s.getCoordinateId();return(null==t?void 0:t.id)===n}_isRelativeSeries(t){return(null==t?void 0:t.id)===this._series.id}onRender(t){}changeRegions(){}_getNeedClearVRenderComponents(){return this._markerComponents}}uX.type=r.mapLabel,uX.specKey="mapLabel";class pX{constructor(t,e){this._chartLayoutRect={x:0,y:0,width:1,height:1},this._col=1,this._row=1,this._elementMap=new Map,this.standardizationSpec(t),this._gridInfo=t,this._col=t.col,this._row=t.row,this._colSize=new Array(this._col).fill(null),this._rowSize=new Array(this._row).fill(null),this._colElements=new Array(this._col).fill([]),this._rowElements=new Array(this._row).fill([]),this._onError=null==e?void 0:e.onError,this.initUserSetting()}standardizationSpec(t){var e,i,s;t.col=null!==(e=t.col)&&void 0!==e?e:1,t.row=null!==(i=t.row)&&void 0!==i?i:1,t.elements=null!==(s=t.elements)&&void 0!==s?s:[]}initUserSetting(){this._gridInfo.colWidth&&this.setSizeFromUserSetting(this._gridInfo.colWidth,this._colSize,this._col,this._chartLayoutRect.width),this._gridInfo.rowHeight&&this.setSizeFromUserSetting(this._gridInfo.rowHeight,this._rowSize,this._row,this._chartLayoutRect.height),this._colSize.forEach(((t,e)=>{t||(this._colSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})})),this._rowSize.forEach(((t,e)=>{t||(this._rowSize[e]={value:0,isUserSetting:!1,isLayoutSetting:!1})}))}setSizeFromUserSetting(t,e,i,s){t.forEach((t=>{t.index<0&&t.index>=i||(qo(t.size)?e[t.index]={value:+t.size,isUserSetting:!0,isLayoutSetting:!1}:ys(t.size)&&(e[t.index]={value:t.size(s),isUserSetting:!0,isLayoutSetting:!1}))}))}clearLayoutSize(){this._colSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)})),this._rowSize.forEach((t=>{t.isLayoutSetting=!1,t.isUserSetting||(t.value=0)}))}getItemGridInfo(t){var e;const i=this._elementMap.get(t);if(i)return i;let s;return s=null===(e=this._gridInfo.elements)||void 0===e?void 0:e.find((e=>{var i;if("modelId"in e&&M(e.modelId)){if(M(t.model.userId)&&t.model.userId===e.modelId)return!0}else if("modelKey"in e&&M(e.modelKey)&&"modelIndex"in e&&M(e.modelIndex)&&(null!==(i=t.model.specKey)&&void 0!==i?i:t.model.type)===e.modelKey&&t.model.getSpecIndex()===e.modelIndex)return!0;return!1})),s||(s={col:0,colSpan:1,row:0,rowSpan:1}),this._elementMap.set(t,s),s}getSizeFromGrid(t,e){var i;const s="col"===e?this._colSize:this._rowSize;let n=0;for(let r=t[e];r1)return;if(this._colSize[e.col].isUserSetting)return;this._colSize[e.col].value=Math.max(this._colSize[e.col].value,t.getLayoutRect().width+t.layoutPaddingLeft+t.layoutPaddingRight),this._colSize[e.col].isLayoutSetting=!0}else{if(e.rowSpan&&e.rowSpan>1)return;if(this._rowSize[e.row].isUserSetting)return;this._rowSize[e.row].value=Math.max(this._rowSize[e.row].value,t.getLayoutRect().height+t.layoutPaddingTop+t.layoutPaddingBottom),this._rowSize[e.row].isLayoutSetting=!0}}layoutGrid(t){const e="col"===t?this._colSize:this._rowSize;let i="col"===t?this._chartLayoutRect.width:this._chartLayoutRect.height;const s=[];e.forEach((t=>{t.isUserSetting||t.isLayoutSetting?i-=t.value:s.push(t)})),i<0&&console.warn(`layout content ${t} size bigger than chart`),s.forEach((t=>t.value=i/s.length))}getItemPosition(t){const e=this.getItemGridInfo(t),i={x:this._chartLayoutRect.x,y:this._chartLayoutRect.y};for(let t=0;te.layoutLevel-t.layoutLevel));const n=e.filter((t=>"normal"===t.layoutType&&!1!==t.getModelVisible())),r=n.filter((t=>gX(t))),a=n.filter((t=>!gX(t)));n.forEach((t=>{this.layoutOneItem(t,"user",!1)}));const o=e.filter((t=>"region-relative"===t.layoutType)),l=o.filter((t=>gX(t))),h=o.filter((t=>!gX(t)));l.forEach((t=>this.layoutOneItem(t,"user",!1))),this.layoutGrid("col"),a.forEach((t=>this.layoutOneItem(t,"colGrid",!1))),h.forEach((t=>{this.layoutOneItem(t,"colGrid",!1)})),this.layoutGrid("row"),h.forEach((t=>{this.layoutOneItem(t,"grid",!1)})),r.forEach((t=>this.layoutOneItem(t,"grid",!1))),l.forEach((t=>{this.layoutOneItem(t,"grid",!0)})),this.layoutGrid("col"),e.filter((t=>"region"===t.layoutType)).forEach((t=>this.layoutOneItem(t,"grid",!1))),this.layoutAbsoluteItems(e.filter((t=>"absolute"===t.layoutType))),e.filter((t=>"absolute"!==t.layoutType)).forEach((t=>{t.setLayoutStartPosition(this.getItemPosition(t))}))}layoutAbsoluteItems(t){t.forEach((t=>{t.absoluteLayoutInRect(this._chartLayoutRect)}))}layoutOneItem(t,e,i){var s,n;const r="rowGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),a="colGrid"===e||"grid"===e?this.getSizeFromGrid.bind(this):this.getSizeFromUser.bind(this),o=this.getItemGridInfo(t),l={width:(null!==(s=a(o,"col"))&&void 0!==s?s:this._chartLayoutRect.width)-t.layoutPaddingLeft-t.layoutPaddingRight,height:(null!==(n=r(o,"row"))&&void 0!==n?n:this._chartLayoutRect.height)-t.layoutPaddingTop-t.layoutPaddingBottom},h=t.computeBoundsInRect(l);qo(h.width)||(h.width=l.width),qo(h.height)||(h.height=l.height),t.setLayoutRect("grid"!==e?h:l),this.setItemLayoutSizeToGrid(t,o)}}function gX(t){return"left"===t.layoutOrient||"right"===t.layoutOrient}pX.type="grid";class mX extends Qy{layoutItems(t,e,i,s){this._layoutInit(t,e,i,s),this._layoutNormalItems(e);const n={left:this.leftCurrent,top:this.topCurrent,right:this.rightCurrent,bottom:this.bottomCurrent},r=e.filter((t=>"absolute"===t.layoutType)),a=r.filter((t=>"z"===t.layoutOrient));let o={width:0,height:0};a.length&&(o=a[0].getLayoutRect()),this.leftCurrent+=o.width/8,this.rightCurrent-=o.width/8,this.topCurrent+=o.height/8,this.bottomCurrent-=o.height/8;const{regionItems:l,relativeItems:h,relativeOverlapItems:d,allRelatives:c,overlapItems:u}=this._groupItems(e);this.layoutRegionItems(l,h,d,u),this._processAutoIndent(l,h,d,u,c,n);const p=r.filter((t=>"z"!==t.layoutOrient));this.layoutAbsoluteItems(p);const g=h.filter((t=>"axes"===t.model.specKey&&kd(t.layoutOrient)))[0],m=h.filter((t=>"axes"===t.model.specKey&&Ad(t.layoutOrient)))[0];if(g&&a.length){const t=g.getLayoutStartPoint(),e=g.getLayoutRect(),i={x:"left"===m.layoutOrient?t.x+e.width:t.x,y:t.y,width:this._chartLayoutRect.width,height:this._chartLayoutRect.height};a[0].model.directionStr="left"===m.layoutOrient?"r2l":"l2r";const s=g.getLayoutRect(),n=m.getLayoutRect(),r={length:a[0].getLayoutRect().width,width:s.width,height:n.height};g.model.setLayout3dBox&&g.model.setLayout3dBox(r),m.model.setLayout3dBox&&m.model.setLayout3dBox(r),a[0].model.setLayout3dBox&&a[0].model.setLayout3dBox(r),this.layoutZAxisItems(a,i)}}layoutZAxisItems(t,e){t.forEach((t=>{t.absoluteLayoutInRect(e)}))}getItemComputeLayoutRect(t,e){return e||(e={offsetLeft:0,offsetRight:0,offsetTop:0,offsetBottom:0}),{width:this.rightCurrent-this.leftCurrent-t.layoutPaddingLeft-t.layoutPaddingRight-(e.offsetLeft+e.offsetRight),height:this.bottomCurrent-this.topCurrent-t.layoutPaddingTop-t.layoutPaddingBottom-(e.offsetTop+e.offsetBottom)}}_checkAutoIndent(t){const e={top:0,left:0,bottom:0,right:0},i=this._chartViewBox.x2-this._chartViewBox.x1-this.rightCurrent,s=this._chartViewBox.y2-this._chartViewBox.y1-this.bottomCurrent;return t.forEach((t=>{if(!t.getModelVisible()||!t.autoIndent)return;const n="left"===t.layoutOrient||"right"===t.layoutOrient,r=t.getLastComputeOutBounds();n?(e.top=Math.max(e.top,r.y1-this.topCurrent),e.bottom=Math.max(e.bottom,r.y2-s)):(e.left=Math.max(e.left,r.x1-this.leftCurrent),e.right=Math.max(e.right,r.x2-i))})),e}}mX.type="layout3d";const _X=new qt;u_(),df(),Gv(),_y();class fX extends Rk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},fX.defaultAttributes,t)),this.name="poptip",this.positionList=["top","tl","tr","bottom","bl","br","left","lt","lb","right","rt","rb"]}render(){var t,e,i,s,n,r,a,o;const{titleStyle:l={},position:h,contentStyle:d={},panel:c={},space:u=4,minWidth:p=0,maxWidth:g=1/0,padding:m=4,maxWidthPercent:_,visible:f,state:b,dx:x=0,dy:S=0}=this.attribute;let{title:k="",content:A=""}=this.attribute;k=this.attribute.titleFormatMethod?this.attribute.titleFormatMethod(k):k,A=this.attribute.contentFormatMethod?this.attribute.contentFormatMethod(A):A;const w=gD(m),T=this.createOrUpdateChild("poptip-content",{x:0,y:0,zIndex:1},"group"),L=g-w[1]-w[3],C=M(k)&&!1!==f,E=Object.assign(Object.assign({text:y(k)?k:[k],visible:C,wrap:!0},l),{x:w[3],y:w[0],maxLineWidth:L,textAlign:"left",textBaseline:"top"}),D=T.createOrUpdateChild("poptip-title",E,"text");Ym(null==b?void 0:b.title)||(D.states=b.title);const P=D.AABBBounds,O=P.height(),R=P.width();let I=O+u;C||(I=0);const B=M(A)&&!1!==f,F=Object.assign(Object.assign({text:y(A)?A:[A],visible:B,wrap:!0},d),{x:w[3],y:w[0]+I,maxLineWidth:L,textAlign:"left",textBaseline:"top"}),Y=T.createOrUpdateChild("poptip-content",F,"text");Ym(null==b?void 0:b.content)||(Y.states=b.content);const j=Y.AABBBounds,H=j.height(),z=j.width();B&&(I+=H);let N=ut(R+w[1]+w[3],z+w[1]+w[3]);N>g?N=g:NJ&&(J=n,Z=t)}}}}getAngleAndOffset(t,e,i,s){const n=s[1]/2;switch(t){case"tl":return{angle:rt/2*3,offset:[e/4,i+n],rectOffset:[-e/4,-i-s[1]]};case"top":return{angle:rt/2*3,offset:[e/2,i+n],rectOffset:[0,-i-s[1]]};case"tr":return{angle:rt/2*3,offset:[e/4*3,i+n],rectOffset:[e/4*3,-i-s[1]]};case"rt":return{angle:0,offset:[-n,i/5],rectOffset:[e/4*3,-i-s[1]]};case"right":return{angle:0,offset:[-n,i/2],rectOffset:[e/4*3,-i-s[1]]};case"rb":return{angle:0,offset:[-n,i/5*4],rectOffset:[e/4*3,-i-s[1]]};case"bl":return{angle:rt/2,offset:[e/4,-n],rectOffset:[-e/4,-i-s[1]]};case"bottom":return{angle:rt/2,offset:[e/2,-n],rectOffset:[0,-i-s[1]]};case"br":return{angle:rt/2,offset:[e/4*3,-n],rectOffset:[e/4*3,-i-s[1]]};case"lt":return{angle:rt,offset:[e+n,i/5],rectOffset:[-e/4,-i-s[1]]};case"left":return{angle:rt,offset:[e+n,i/2],rectOffset:[0,-i-s[1]]};case"lb":return{angle:rt,offset:[e+n,i/5*4],rectOffset:[e/4*3,-i-s[1]]}}}}fX.defaultAttributes={position:"rt",visible:!0,title:null,content:null,titleStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},contentStyle:{fontSize:12,fill:"#000",textAlign:"left",textBaseline:"top"},maxWidthPercent:.8,space:8,padding:10};let vX=class{render(t,e,i,s,n,r,a,o,l,h,d,c,u){var p,g;if(1===t._showPoptip){const{visible:e,visibleCb:i}=t.attribute.poptip||{};if(!1===e||i&&!1===i(t))return;const s={};E(s,fX.defaultAttributes,t.attribute.poptip?t.attribute.poptip:{}),this.poptipComponent?this.poptipComponent.initAttributes(s):this.poptipComponent=new fX(s);let n=t.attribute.poptip||{};if("text"===t.type&&null==n.title&&null==n.content){const e={};E(e,d_.poptip,n),n=e,n.content=null!==(p=n.content)&&void 0!==p?p:t.attribute.text}const r=t.globalTransMatrix;this.poptipComponent.setAttributes(Object.assign(Object.assign({visibleAll:!0,pickable:!1,childrenPickable:!1},n),{x:r.e,y:r.f})),h.stage.tryInitInteractiveLayer();const a=h.stage.getLayer("_builtin_interactive");a&&a.add(this.poptipComponent)}else 2===t._showPoptip&&(t._showPoptip=0,this.poptipComponent&&(this.poptipComponent.setAttributes({visibleAll:!1}),null===(g=this.poptipComponent.parent)||void 0===g||g.removeChild(this.poptipComponent),this.poptipComponent=null))}};vX=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a}([V()],vX);var yX=function(t,e,i,s){var n,r=arguments.length,a=r<3?e:null===s?s=Object.getOwnPropertyDescriptor(e,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(t,e,i,s);else for(var o=t.length-1;o>=0;o--)(n=t[o])&&(a=(r<3?n(a):r>3?n(e,i,a):n(e,i))||a);return r>3&&a&&Object.defineProperty(e,i,a),a};class bX{constructor(){this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.poptip=t=>{const e=t.target;this.needHide(e)?this.unpoptip(t):e!==this.activeGraphic&&(this.needShow(e)&&(e.setAttributes({}),e._showPoptip=1),this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2),this.setActiveGraphic(e,!0))},this.unpoptip=t=>{this.activeGraphic&&(this.activeGraphic.setAttributes({}),this.activeGraphic._showPoptip=2,this.setActiveGraphic(null,!0))}}activate(t){this.pluginService=t;const{stage:e}=this.pluginService;e.addEventListener("pointerover",this.poptip)}needHide(t){return t.isContainer||!t.attribute}needShow(t){return!!t.attribute.poptip}setActiveGraphic(t,e){this.activeGraphic=t,this.pluginService.stage.renderNextFrame()}deactivate(t){const{stage:e}=this.pluginService;e.removeEventListener("pointerover",this.poptip)}}let xX=class extends bX{constructor(){super(...arguments),this.name="poptip",this.key=this.name+this._uid}};xX=yX([V()],xX);let SX=class extends bX{constructor(){super(...arguments),this.name="poptipForText",this.key=this.name+this._uid,this.pointerlave=t=>{const{stage:e}=this.pluginService;t.target===e&&this.unpoptip(t)}}activate(t){super.activate(t);const{stage:e}=this.pluginService;e.addEventListener("pointerleave",this.pointerlave)}needHide(t){return"text"!==t.type||!t.cliped||t.isContainer||!t.attribute||t.attribute.disableAutoClipedPoptip}needShow(t){return!0}deactivate(t){const{stage:e}=this.pluginService;super.deactivate(t),e.removeEventListener("pointerleave",this.pointerlave)}};SX=yX([V()],SX);const MX=new B(((t,e,i,s)=>{i(vX)||(t(vX).toSelf().inSingletonScope(),t(co).toService(vX)),i(xX)||(t(xX).toSelf(),t(oa).toService(xX)),i(SX)||(t(SX).toSelf(),t(oa).toService(SX))})),kX=(t,e)=>t?(e||(e=t.getBoundingClientRect()),t.offsetWidth>0?e.width/t.offsetWidth:e.height/t.offsetHeight):1,AX=(t,e)=>{var i;let s,n;"rich"!==(null==t?void 0:t.type)&&"html"!==(null==t?void 0:t.type)?(t=(null!=t?t:"").toString(),e.multiLine?(s=t.split("\n"),s=s.map(((t,e)=>eObject.assign(Object.assign({},e),{text:t})))):(n=t.text,s=t);const r=(a={wordBreak:null!==(i=e.wordBreak)&&void 0!==i?i:"break-word",maxWidth:e.maxWidth?e.maxWidth:void 0,width:0,height:0,textConfig:n},v_||(v_=ra.CreateGraphic("richtext",{})),v_.setAttributes(a),v_.AABBBounds);var a;return{width:r.width(),height:r.height(),text:s}},wX="vchart-tooltip-container",TX={offsetX:10,offsetY:10,sanitize:function(t){return String(t).replace(/&/g,"&").replace(//g,">").replace(/\(/g,"(").replace(/ /g,"  ")}},LX=(t,e)=>{let i;if(M(t))if(h(t))i=t;else if(ys(t)){const s=t(e);h(s)&&(i=s)}return i},CX={left:["left","center"],right:["right","center"],top:["center","top"],lt:["left","top"],tl:["left","top"],rt:["right","top"],tr:["right","top"],bottom:["center","bottom"],bl:["left","bottom"],lb:["left","bottom"],br:["right","bottom"],rb:["right","bottom"],inside:["center","center"],center:["center","center"],centerBottom:["center","centerBottom"],centerTop:["center","centerTop"],centerLeft:["centerLeft","center"],centerRight:["centerRight","center"]},EX=(t,e)=>{var i,s;return null!==(s=null===(i=CX[t])||void 0===i?void 0:i[0])&&void 0!==s?s:e},DX=(t,e)=>{var i,s;return null!==(s=null===(i=CX[t])||void 0===i?void 0:i[1])&&void 0!==s?s:e},PX=(t,e)=>{var i;const s=new Map,n=new Map,{series:r,datum:a}=t,o="horizontal"===r.direction,l=(o?r.getYAxisHelper():r.getXAxisHelper()).getAxisId(),h=r.getChart().getComponentsByKey("axes").find((t=>t.id===l));if(!h)return;(o?n:s).set(h.getSpecIndex(),{value:null===(i=r.getDatumPositionValues(a[0],r.getDimensionField()))||void 0===i?void 0:i[0],axis:h});const d={visible:!!s.size,type:"rect"},c={visible:!!n.size,type:"rect"},{x:u,y:p,offsetWidth:g,offsetHeight:m,bandWidth:_,bandHeight:f}=XW(3,r,e,s,n,d,c);return u?ZW(d,u,_,g):p?JW(c,p,f,m):void 0},OX={fontFamily:Oh.fontFamily,spacing:10,wordBreak:"break-word"};function RX(t={},e,i){var s,n;return Object.assign(Object.assign({},null!=i?i:OX),{fill:null!==(s=t.fill)&&void 0!==s?s:t.fontColor,textAlign:t.textAlign,textBaseline:t.textBaseline,fontFamily:null!==(n=t.fontFamily)&&void 0!==n?n:null==e?void 0:e.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,lineHeight:t.lineHeight,spacing:t.spacing,multiLine:t.multiLine,maxWidth:t.maxWidth,wordBreak:t.wordBreak,autoWidth:t.autoWidth})}const IX=t=>{var e;const{backgroundColor:i,border:s,shadow:n}=t,r={lineWidth:null!==(e=null==s?void 0:s.width)&&void 0!==e?e:0,shadow:!!n};(null==s?void 0:s.color)&&(r.stroke=s.color),i&&(r.fill=i),n&&(r.shadowColor=n.color,r.shadowBlur=n.blur,r.shadowOffsetX=n.x,r.shadowOffsetY=n.y,r.shadowSpread=n.spread);const{radius:a}=null!=s?s:{};return M(a)&&(r.cornerRadius=[a,a,a,a]),r};class BX extends DE{constructor(){super(...arguments),this._visible=!0,this._attributes=null,this._isReleased=!1,this.showTooltip=(t,e,i)=>{const{changePositionOnly:s}=i;return s?this.changeTooltipPosition(i,e):this.changeTooltip(!0,i,e)},this._changeTooltip=(t,e,i)=>this._isReleased?1:t?this._changeTooltipPosition(e,i):(this._clearAllCache(),this._updateTooltip(!1,e),0),this._changeTooltipPosition=(t,e)=>{var i,s,n;if(this._isReleased)return 1;const r=t.event,{tooltipSpec:a,tooltipActual:o,changePositionOnly:l}=t;if(a.enterable){if(!this._isPointerEscaped&&this._isPointerMovingToTooltip(t))return this._isTooltipPaused||(this._isTooltipPaused=!0,this._cachePointerTimer=setTimeout((()=>{this._isPointerEscaped=!0}),300)),0;this._isTooltipPaused=!1,this._isPointerEscaped=!1,clearTimeout(this._cachePointerTimer),this._cachePointerPosition=this._getPointerPositionRelativeToTooltipParent(t)}const h=o.activeType;if(a.handler)return null!==(n=null===(s=(i=a.handler).showTooltip)||void 0===s?void 0:s.call(i,h,e,t))&&void 0!==n?n:0;const d=a[h];if(!d)return 1;const c=this._getActualTooltipPosition(o,t,this._getTooltipBoxSize(o,l));o.position=c,d.updatePosition&&(o.position=d.updatePosition(o.position,e,t));let u=!1!==(null==d?void 0:d.visible);return e&&"pointerout"!==r.type&&o.visible&&(o.title||o.content)||(u=!1),this._updateTooltip(u,Object.assign(Object.assign({},t),{changePositionOnly:l})),0},this._getActualTooltipPosition=(t,e,i)=>{var s,n,r,a,o,l,d,c,u;const{tooltipSpec:p}=e,g={x:1/0,y:1/0};if(!p)return this._cacheTooltipPosition=void 0,g;const m=e.event,{activeType:_,data:f}=t,v="dimension"===_?null===(n=null===(s=f[0])||void 0===s?void 0:s.data)||void 0===n?void 0:n[0]:null==f?void 0:f[0];let{offsetX:y,offsetY:b}=this._option;const x=p[_],S=wW(x.position,f,e),k=null!==(r=wW(x.positionMode,f,e))&&void 0!==r?r:"mark"===_?"mark":"pointer",{width:A=0,height:w=0}=null!=i?i:{},T="canvas"===p.renderMode,L=null===(a=null==e?void 0:e.chart)||void 0===a?void 0:a.getCanvasRect(),C=null!==(o=null==L?void 0:L.width)&&void 0!==o?o:nh,E=null!==(l=null==L?void 0:L.height)&&void 0!==l?l:rh;let D=!1;const P={width:0,height:0};let O={x:0,y:0},R={x:0,y:0},I=1,B=1;if(dl(this._env)&&!p.confine){if(P.width=window.innerWidth,P.height=window.innerHeight,!T){const t=this._getParentElement(p);R=null!==(c=null===(d=null==t?void 0:t.getBoundingClientRect)||void 0===d?void 0:d.call(t))&&void 0!==c?c:g;const e=null!==(u=this._compiler.getCanvas())&&void 0!==u?u:this._chartContainer,i=null==e?void 0:e.getBoundingClientRect();O={x:i.x-R.x,y:i.y-R.y},I=kX(e,i),B=kX(t,R)}}else P.width=C,P.height=E;const F=B/I;let Y,j,H,z,N=S,V=S;const W=({orient:t,mode:i,offset:s})=>{var n;let r,a;const o=e.model,l=null==o?void 0:o.getLayoutStartPoint();if(y=null!=s?s:y,"mark"===i){D=!0;const t=e.item,i=null==t?void 0:t.getBounds();i&&l&&(r=i.x1+l.x,a=i.x2+l.x)}else if("crosshair"===i&&"cartesian"===(null===(n=null==v?void 0:v.series)||void 0===n?void 0:n.coordinate)&&v.datum&&v.datum.length){D=!0;const t=PX(v,l);t&&(r=t.start.x,a=t.end.x)}else N=t;if(D)switch(EX(t)){case"left":Y=r-A*F-y;break;case"right":Y=a+y;break;case"center":Y=(r+a)/2-A*F/2;break;case"centerLeft":Y=(r+a)/2-A*F-y;break;case"centerRight":Y=(r+a)/2+y}},G=({orient:t,mode:i,offset:s})=>{var n;let r,a;const o=e.model,l=null==o?void 0:o.getLayoutStartPoint();if(b=null!=s?s:b,"mark"===i){D=!0;const t=e.item,i=null==t?void 0:t.getBounds();i&&l&&(r=i.y1+l.y,a=i.y2+l.y)}else if("crosshair"===i&&"cartesian"===(null===(n=null==v?void 0:v.series)||void 0===n?void 0:n.coordinate)&&v.datum&&v.datum.length){D=!0;const t=PX(v,l);t&&(r=t.start.y,a=t.end.y)}else V=t;if(D)switch(DX(t)){case"top":j=r-w*F-b;break;case"bottom":j=a+b;break;case"center":j=(r+a)/2-w*F/2;break;case"centerTop":j=(r+a)/2-w*F-b;break;case"centerBottom":j=(r+a)/2+b}};if(vs(S)){if(vs(U=S)&&(M(U.left)||M(U.right)||M(U.top)||M(U.bottom))){const{left:t,right:e,top:i,bottom:s}=S;Y=LX(t,m),j=LX(i,m),H=LX(e,m),z=LX(s,m)}else if((t=>vs(t)&&(M(t.x)||M(t.y)))(S)){const{x:t,y:e}=S;h(t)||ys(t)?Y=LX(t,m):W(t),h(e)||ys(e)?j=LX(e,m):G(e)}}else M(S)&&(W({orient:S,mode:k}),G({orient:S,mode:k}));var U;let $,X;const{canvasX:K,canvasY:q}=m;if(qo(Y))$=Y;else if(qo(H))$=C-A*F-H;else{const t=K;switch(EX(N,"right")){case"center":$=t-A*F/2;break;case"left":case"centerLeft":$=t-A*F-y;break;case"right":case"centerRight":$=t+y}}if(qo(j))X=j;else if(qo(z))X=E-w*F-z;else{const t=q;switch(DX(V,"bottom")){case"center":X=t-w*F/2;break;case"top":case"centerTop":X=t-w*F-b;break;case"bottom":case"centerBottom":X=t+b}}$*=I,X*=I,dl(this._env)&&($+=O.x,X+=O.y),$/=B,X/=B;const{width:Z,height:J}=P,Q=()=>$*B+R.x<0,tt=()=>($+A)*B+R.x>Z,et=()=>X*B+R.y<0,it=()=>(X+w)*B+R.y>J,st=EX(S,"right");"left"===st||st.includes("center")&&Q()?(Q()&&(D?$=-R.x/B:"center"===EX(S,"right")?$+=y+A/2:$+=2*y+A),tt()&&($=(Z-R.x)/B-A)):(tt()&&(D?$=(Z-R.x)/B-A:"center"===EX(S,"right")?$-=y+A/2:$-=2*y+A),Q()&&($=-R.x/B));const nt=DX(S,"bottom");"top"===nt||nt.includes("center")&&et()?(et()&&(D?X=-R.y/B:"center"===DX(S,"bottom")?X+=b+w/2:X+=2*b+w),it()&&(X=(J-R.y)/B-w)):(it()&&(D?X=(J-R.y)/B-w:"center"===DX(S,"bottom")?X-=b+w/2:X-=2*b+w),et()&&(X=0-R.y/B));const rt={x:$,y:X};return this._cacheTooltipPosition=rt,this._cacheTooltipSize={width:A,height:w},rt}}get env(){return this._env}onAdd(t){super.onAdd(t);const e=t.component;this._component=e,this._chartOption=e.getOption(),this._env=this._chartOption.mode,this._chartContainer=this._chartOption.globalInstance.getContainer(),this._compiler=e.getCompiler(),this._initFromSpec()}hideTooltip(t){return this.changeTooltip(!1,t)}release(){var t,e,i;this._clearAllCache();const s=null!==(t=this._component.getSpec())&&void 0!==t?t:{};s.handler?null===(i=(e=s.handler).release)||void 0===i||i.call(e):(this._removeTooltip(),this._isReleased=!0)}_clearAllCache(){this._isTooltipPaused=!1,this._isPointerEscaped=!1,clearTimeout(this._cachePointerTimer),this._cachePointerTimer=-1,this._cachePointerPosition=void 0,this._cacheTooltipPosition=void 0,this._cacheTooltipSize=void 0}_throttle(t){const e=this._component.getSpec();let i;return i=h(e.throttleInterval)?e.throttleInterval:"html"===e.renderMode&&e.transitionDuration?50:10,Kd(t,i)}_getDefaultOption(){var t,e;const{offset:i}=this._component.getSpec();return Object.assign(Object.assign({},TX),{offsetX:null!==(t=null==i?void 0:i.x)&&void 0!==t?t:TX.offsetX,offsetY:null!==(e=null==i?void 0:i.y)&&void 0!==e?e:TX.offsetY})}_getTooltipBoxSize(t,e){var i,s,n;if(!e||D(this._attributes)){const e=null!==(s=null===(i=this._chartOption)||void 0===i?void 0:i.getTheme())&&void 0!==s?s:{};this._attributes=((t,e,i)=>{var s,n,r,a,o;const{style:l={},enterable:h,transitionDuration:d}=e,{panel:c={},titleLabel:u,shape:p,keyLabel:g,valueLabel:m,spaceRow:_,maxContentHeight:f,align:v}=l,y=gD(c.padding),b=sl(c.padding),x=RX(Object.assign({textAlign:"right"===v?"right":"left"},u),i),S=RX(Object.assign({textAlign:"right"===v?"right":"left"},g),i),k=RX(m,i),A={fill:!0,size:null!==(s=null==p?void 0:p.size)&&void 0!==s?s:8,spacing:null!==(n=null==p?void 0:p.spacing)&&void 0!==n?n:6},w={panel:IX(c),padding:y,title:{},content:[],titleStyle:{value:x,spaceRow:_},contentStyle:{shape:A,key:S,value:k,spaceRow:_},hasContentShape:!1,keyWidth:0,valueWidth:0,maxContentHeight:f,enterable:h,transitionDuration:d,align:v},{title:T={},content:L=[]}=t;let C=b.left+b.right,E=b.top+b.bottom,D=b.top+b.bottom,P=0;const O=L.filter((t=>(t.key||t.value)&&!1!==t.visible)),R=!!O.length;let I=0,B=0,F=0,Y=0;if(R){const t=[],e=[],i=[],s=[];let n=0;w.content=O.map(((r,a)=>{let o=0;const{hasShape:l,key:h,shapeType:d="",shapeFill:c,shapeStroke:u,shapeLineWidth:p,shapeSize:g,value:m,isKeyAdaptive:f,spaceRow:v,keyStyle:y,valueStyle:b,shapeHollow:x,shapeColor:w}=r,T={height:0,spaceRow:null!=v?v:_};if(M(h)){const i=Tl({},S,RX(y,void 0,{})),{width:s,height:n,text:r}=AX(h,i);T.key=Object.assign(Object.assign({width:s,height:n},i),{text:r}),f?e.push(s):t.push(s),o=Math.max(o,n)}if(M(m)){const t=Tl({},k,RX(b,void 0,{})),{width:e,height:s,text:n}=AX(m,t);T.value=Object.assign(Object.assign({width:e,height:s},t),{text:n}),i.push(e),o=Math.max(o,s)}if(l){const t={visible:!0,symbolType:d},e=null!=c?c:w;x?t.stroke=e:t.fill=e,t.stroke=null!=u?u:e,t.lineWidth=p,T.shape=t;const i=null!=g?g:A.size;o=Math.max(i,o),s.push(i)}else T.shape={visible:!1};return T.height=o,n+=o,aU.autoWidth&&!1!==U.multiLine;if(N){U=Tl({},x,RX(W,void 0,{})),$()&&(U.multiLine=null===(r=U.multiLine)||void 0===r||r,U.maxWidth=null!==(a=U.maxWidth)&&void 0!==a?a:R?Math.ceil(P):void 0);const{text:t,width:e,height:i}=AX(V,U);w.title.value=Object.assign(Object.assign({width:$()?Math.min(e,null!==(o=U.maxWidth)&&void 0!==o?o:Number.MAX_VALUE):e,height:i},U),{text:t}),j=w.title.value.width,H=w.title.value.height,z=H+(R?w.title.spaceRow:0)}return E+=z,D+=z,w.title.width=j,w.title.height=H,$()?C+=P||j:C+=Math.max(j,P),R&&w.content.forEach((t=>{var e;const i=t.value;i&&(null===(e=i.autoWidth)||void 0===e||e)&&(i.width=C-b.left-b.right-Y-I-S.spacing-k.spacing,i.maxWidth||(i.maxWidth=Math.ceil(i.width)),w.valueWidth=Math.max(w.valueWidth,i.width))})),w.panel.width=C,w.panel.height=E,w.panelDomHeight=D,w})(t,this._component.getSpec(),e)}const{panel:r,panelDomHeight:a}=null!==(n=this._attributes)&&void 0!==n?n:{},o="canvas"===this._component.getSpec().renderMode;return{width:(null==r?void 0:r.width)+(o?r.lineWidth:0),height:(null!=a?a:null==r?void 0:r.height)+(o?r.lineWidth:0)}}_getPointerPositionRelativeToTooltipParent(t){var e,i;let{canvasX:s,canvasY:n}=t.event;const{tooltipSpec:r}=t,a={x:1/0,y:1/0},o="canvas"===r.renderMode,l=this._getParentElement(r);let h={x:0,y:0},d={x:0,y:0},c=1,u=1;if(dl(this._env)&&!r.confine&&!o){d=null!==(e=null==l?void 0:l.getBoundingClientRect())&&void 0!==e?e:a;const t=null!==(i=this._compiler.getCanvas())&&void 0!==i?i:this._chartContainer,s=null==t?void 0:t.getBoundingClientRect();h={x:s.x-d.x,y:s.y-d.y},c=kX(t,s),u=kX(l,d)}return s*=c,n*=c,dl(this._env)&&(s+=h.x,n+=h.y),s/=u,n/=u,{x:s,y:n}}_isPointerMovingToTooltip(t){if(!this._cacheTooltipPosition||!this._cacheTooltipSize||!this._cachePointerPosition)return!1;const{width:e,height:i}=this._cacheTooltipSize,{x:s=0,y:n}=this._cacheTooltipPosition,r=this._getPointerPositionRelativeToTooltipParent(t);if(Nt(r,{x1:s,y1:n,x2:s+e,y2:n+i},!1))return!0;const a={x:s,y:n},o={x:a.x+e,y:a.y},l={x:a.x,y:a.y+i},h={x:o.x,y:l.y},d=this._cachePointerPosition;return H$([d,a,o],r.x,r.y)||H$([d,l,h],r.x,r.y)||H$([d,a,h],r.x,r.y)||H$([d,o,l],r.x,r.y)}_getParentElement(t){return t.parentElement}getTooltipContainer(){return this._container}_initFromSpec(){this._option=this._getDefaultOption(),this.changeTooltip=this._throttle(this._changeTooltip),this.changeTooltipPosition=this._throttle(this._changeTooltipPosition)}reInit(){this._initFromSpec()}}BX.specKey="tooltip";const FX=(t,e)=>M(t)?y(t)?t.map((t=>`${t}px`)).join(" "):`${t}px`:null!=e?e:"initial",YX=t=>{const e=t.split(" ").map((t=>Number.isNaN(t)?Number.parseFloat(t.substring(0,t.length-2)):Number.parseFloat(t)));return 1===e.length?e[0]:e};let jX;const HX=(t=document.body)=>{if(D(jX)){const e=document.createElement("div");e.style.visibility="hidden",e.style.overflow="scroll",t.appendChild(e);const i=document.createElement("div");e.appendChild(i),jX=e.offsetWidth-i.offsetWidth,e.parentNode.removeChild(e)}return jX};function zX(t,e){if(!t)return;const{fontFamily:i,fontSize:s,fill:n,textAlign:r,lineHeight:a,fontWeight:o,multiLine:l,wordBreak:h,maxWidth:d}=Tl({},e,t),c={};return c.fontFamily=i,c.fontSize=FX(s),c.color=n,c.textAlign=r,c.lineHeight=FX(gn(a,s)),c.fontWeight=o,c.whiteSpace=l?"initial":"nowrap",c.wordBreak=l?null!=h?h:"break-word":"normal",c.maxWidth=FX(d),c}class NX{static isInstance(t){return!!t&&t.type===NX.type}setOption(t){this._option=t,Object.values(this.children).forEach((e=>e.setOption(t)))}getParentEl(){return NX.isInstance(this.parent)?this.parent.product:this.parent}constructor(t,e,i){this.type=NX.type,this._renderContentCache=null,this.children={},this.parent=t,this._option=e,this.childIndex=null!=i?i:0}init(t,e){}initAll(){this.init(),Object.values(this.children).forEach((t=>t.initAll()))}setStyle(t){this.product&&t&&Object.keys(t).forEach((e=>{this.product.style[e]!==t[e]&&(this.product.style[e]=t[e])}))}setContent(t){}setVisibility(t){if(!this.product)return;const{style:e}=this.product;e.visibility=t?"visible":"hidden",Object.values(this.children).forEach((e=>e.setVisibility(t)))}getVisibility(){var t,e;return!!(null===(e=null===(t=this.product)||void 0===t?void 0:t.style)||void 0===e?void 0:e.visibility)&&"hidden"!==this.product.style.visibility}release(){var t;if(Object.values(this.children).forEach((t=>t.release())),this.children={},this.product){try{null===(t=this.getParentEl())||void 0===t||t.removeChild(this.product)}catch(t){}this.product=null}}createElement(t,e,i,s){const n=null==hl?void 0:hl.createElement(t),r=this.getParentEl();if(!n||!r)return;e&&n.classList.add(...e),i&&Object.keys(i).forEach((t=>{n.style[t]=i[t]})),s&&(n.id=s);let a=this.childIndex;if(NX.isInstance(this.parent)){let t=Number.MAX_VALUE;for(let e=0;et.product===r.children[e]));i.childIndex>this.childIndex&&i.childIndex=r.children.length?r.appendChild(n):r.insertBefore(n,r.children[a]),n}}NX.type="tooltipModel";const VX={fontSize:"13px",marginBottom:"0px",fontWeight:"normal"},WX={boxSizing:"border-box"},GX={display:"inline-block",verticalAlign:"top"},UX={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},$X={paddingTop:"0px",paddingBottom:"0px",textAlign:"left",fontWeight:"normal"},XX={paddingTop:"0px",paddingBottom:"0px",textAlign:"right",fontWeight:"normal"},KX={lineHeight:"normal",boxSizing:"border-box"};class qX extends NX{init(t,e,i){if(!this.product){const s=this.createElement(null!=i?i:"div",[...null!=t?t:[],"shape"],void 0,e);this.product=s}}setStyle(t,e){super.setStyle(t),this.setSvg(e)}setContent(t){this.setSvg(t)}setSvg(t){const e=function(t,e){var i,s,n,r,a,o;if(!(null==t?void 0:t.hasShape)||!t.symbolType)return"";const{symbolType:l,fill:h,stroke:d,hollow:c=!1}=t,u=t.size?e(t.size):"8px",p=t.lineWidth?e(t.lineWidth)+"px":"0px";let g="currentColor";const m=()=>d?e(d):g,_=YX(u),f=t=>new Lv({symbolType:t,size:_,fill:!0});let v=f(l);const y=v.getParsedPath();y.path||(v=f(y.pathStr));const b=v.getParsedPath().path,x=b.toString(),M=b.bounds;let k=`${M.x1} ${M.y1} ${M.width()} ${M.height()}`;if("0px"!==p){const[t,e,i,s]=k.split(" ").map((t=>Number(t))),n=Number(p.slice(0,-2));k=`${t-n/2} ${e-n/2} ${i+n} ${s+n}`}if(!h||S(h)||c)return g=c?"none":h?e(h):"currentColor",`\n \n \n \n `;if(vs(h)){g=null!==(i="gradientColor"+t.index)&&void 0!==i?i:"";let l="";const d=(null!==(s=h.stops)&&void 0!==s?s:[]).map((t=>``)).join("");return"radial"===h.gradient?l=`\n ${d}\n `:"linear"===h.gradient&&(l=`\n ${d}\n `),`\n \n ${l}\n \n \n `}return""}(t,this._option.valueToHtml);this.product&&e!==this._svgHtmlCache&&(this._svgHtmlCache=e,this.product.innerHTML=e)}release(){super.release(),this._svgHtmlCache=""}}class ZX extends NX{init(t,e,i){this.product||(this.product=this.createElement(null!=i?i:"span",t,void 0,e))}setContent(t,e){if(!this.product)return;let i=this._option.valueToHtml(t);e&&(i=i.replaceAll("\n","
")),i!==this.product.innerHTML&&(this.product.innerHTML=i)}}const JX={overflowWrap:"normal",wordWrap:"normal"};class QX extends NX{constructor(t,e,i,s){super(t,e,s),this.className=i}init(){var t,e;this.product||(this.product=this.createElement("div",[this.className]));const i=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];if("shape-box"!==this.className||i.some((t=>t.hasShape&&t.shapeType))){Object.keys(this.children).forEach((t=>{const e=pd(t);e>=i.length&&(this.children[e].release(),delete this.children[e])}));for(let t=0;t{const e=pd(t);this.children[e].release(),delete this.children[e]}))}setStyle(){var t,e,i,s;const n=this._option.getTooltipStyle();super.setStyle(Tl({},GX,n.content,this._getContentColumnStyle()));const r=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[],a=null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[],o=(t,e)=>{var i,s;const{key:r,isKeyAdaptive:o}=t,{height:l}=a[e],{keyColumn:d}=n,c=Tl({},o?$X:UX,Object.assign(Object.assign(Object.assign({height:FX(l)},JX),d.common),null===(i=d.items)||void 0===i?void 0:i[e]));return S(r)&&""!==(null===(s=null==r?void 0:r.trim)||void 0===s?void 0:s.call(r))||h(r)||c.visibility?c.visibility="visible":c.visibility="hidden",c};r.forEach(((t,e)=>{var i;"key-box"===this.className?this.children[e].setStyle(o(t,e)):"value-box"===this.className?this.children[e].setStyle(((t,e)=>{var i;const{height:s}=a[e],{valueColumn:r}=n;return Tl({},XX,Object.assign(Object.assign(Object.assign({height:FX(s)},JX),r.common),null===(i=r.items)||void 0===i?void 0:i[e]))})(0,e)):"shape-box"===this.className&&(null===(i=this.children[e])||void 0===i||i.setStyle(((t,e)=>{var i,s,r,l;const{height:h}=a[e],{shapeColumn:d}=n,c=o(t,e),u=`calc((${null!==(s=null!==(i=c.lineHeight)&&void 0!==i?i:c.fontSize)&&void 0!==s?s:"18px"} - ${null!==(r=d.width)&&void 0!==r?r:"8px"}) / 2)`;return Tl({},KX,Object.assign(Object.assign({height:FX(h),paddingTop:u},d.common),null===(l=d.items)||void 0===l?void 0:l[e]))})(t,e),this._getShapeSvgOption(t,e)))}))}setContent(){var t,e,i,s;const n=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[],r=null!==(s=null===(i=this._option.getTooltipAttributes())||void 0===i?void 0:i.content)&&void 0!==s?s:[];n.forEach(((t,e)=>{var i,s,n,a,o,l,d;let c;if("key-box"===this.className){const a=t.key;c=S(a)&&""!==(null===(i=null==a?void 0:a.trim)||void 0===i?void 0:i.call(a))||h(a)?a:"",null===(s=this.children[e])||void 0===s||s.setContent(c,null===(n=r[e].key)||void 0===n?void 0:n.multiLine)}else if("value-box"===this.className){const i=t.value;c=S(i)&&""!==(null===(a=null==i?void 0:i.trim)||void 0===a?void 0:a.call(i))||h(i)?i:"",null===(o=this.children[e])||void 0===o||o.setContent(c,null===(l=r[e].value)||void 0===l?void 0:l.multiLine)}else"shape-box"===this.className&&(c=this._getShapeSvgOption(t,e),null===(d=this.children[e])||void 0===d||d.setContent(c))}))}_getContentColumnStyle(){var t,e;const i=this._option.getTooltipStyle();switch(this.className){case"shape-box":const s=null!==(e=null===(t=this._option.getTooltipActual())||void 0===t?void 0:t.content)&&void 0!==e?e:[];return Object.assign(Object.assign({},i.shapeColumn),"shape-box"!==this.className||s.some((t=>t.hasShape&&t.shapeType))?{}:{display:"none"});case"key-box":return i.keyColumn;case"value-box":return i.valueColumn}}_getShapeSvgOption(t,e){var i,s;const n=this._option.getTooltipStyle(),r=Object.assign(Object.assign({},n.shapeColumn),null===(i=n.shapeColumn.items)||void 0===i?void 0:i[e]);return{hasShape:t.hasShape,symbolType:t.shapeType,size:r.width,fill:null!==(s=t.shapeFill)&&void 0!==s?s:t.shapeColor,stroke:t.shapeStroke,lineWidth:t.shapeLineWidth,hollow:t.shapeHollow,index:e}}}class tK extends NX{init(){this.product||(this.product=this.createElement("div",["container-box"]));const{align:t}=this._option.getTooltipAttributes();"right"===t?(this.valueBox||(this.valueBox=this._initBox("value-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.shapeBox||(this.shapeBox=this._initBox("shape-box",2))):(this.shapeBox||(this.shapeBox=this._initBox("shape-box",0)),this.keyBox||(this.keyBox=this._initBox("key-box",1)),this.valueBox||(this.valueBox=this._initBox("value-box",2)))}_initBox(t,e){const i=new QX(this.product,this._option,t,e);return i.init(),this.children[i.childIndex]=i,i}setStyle(t){super.setStyle(Tl(this._getContentContainerStyle(),t)),Object.values(this.children).forEach((t=>{t.setStyle()}))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}_getContentContainerStyle(){const t={whiteSpace:"nowrap",lineHeight:"0px"},{panelDomHeight:e,panel:i,maxContentHeight:s}=this._option.getTooltipAttributes();if(M(s)&&et+YX(e)),0);return Object.assign(Object.assign({},t),{width:`${a+HX(this._option.getContainer())}px`,maxHeight:FX(s),overflow:"auto"})}return t}release(){super.release(),this.shapeBox=null,this.keyBox=null,this.valueBox=null}}class eK extends NX{init(){const t=this._option.getTooltipActual();this.product||(this.product=this.createElement("h2"));const{align:e}=this._option.getTooltipAttributes();"right"!==e||this.textSpan||this._initTextSpan(0);const{title:i}=t;(null==i?void 0:i.hasShape)&&(null==i?void 0:i.shapeType)?this.shape||this._initShape("right"===e?1:0):this.shape&&this._releaseShape(),"right"===e||this.textSpan||this._initTextSpan(1)}_initShape(t=0){const e=new qX(this.product,this._option,t);e.init(),this.shape=e,this.children[e.childIndex]=e}_releaseShape(){this.shape&&(this.shape.release(),delete this.children[this.shape.childIndex],this.shape=null)}_initTextSpan(t=1){const e=new ZX(this.product,this._option,t);e.init(),this.textSpan=e,this.children[e.childIndex]=e}setStyle(t){var e,i,s,n;const r=this._option.getTooltipStyle(),a=this._option.getTooltipActual(),{title:o}=a;super.setStyle(Tl({},VX,r.title,t)),null===(e=this.shape)||void 0===e||e.setStyle({paddingRight:null===(i=r.shapeColumn.common)||void 0===i?void 0:i.marginRight},{hasShape:null==o?void 0:o.hasShape,symbolType:null==o?void 0:o.shapeType,size:null===(s=r.shapeColumn.common)||void 0===s?void 0:s.width,fill:null==o?void 0:o.shapeColor,hollow:null==o?void 0:o.shapeHollow}),null===(n=this.textSpan)||void 0===n||n.setStyle({color:"inherit"})}setContent(){var t,e,i,s,n,r;const a=this._option.getTooltipStyle(),o=this._option.getTooltipActual(),l=this._option.getTooltipAttributes(),{title:h}=o;this.init(),null===(t=this.shape)||void 0===t||t.setStyle(void 0,{hasShape:null==h?void 0:h.hasShape,symbolType:null==h?void 0:h.shapeType,size:null===(e=a.shapeColumn.common)||void 0===e?void 0:e.width,fill:null==h?void 0:h.shapeColor,hollow:null==h?void 0:h.shapeHollow}),null===(i=this.textSpan)||void 0===i||i.setStyle({color:"inherit"}),null===(s=this.textSpan)||void 0===s||s.setContent(null==h?void 0:h.value,null===(r=null===(n=l.title)||void 0===n?void 0:n.value)||void 0===r?void 0:r.multiLine)}release(){super.release(),this.shape=null,this.textSpan=null}}const iK="99999999999999";class sK extends NX{constructor(t,e,i){super(t.getContainer(),t,0),this.title=null,this.content=null,this._classList=e,this._id=i}setVisibility(t){if(super.setVisibility(t),!this.product)return;const{classList:e}=this.product;t?e.add("visible"):e.remove("visible")}init(){var t;const e=this._option.getTooltipActual();this.product||this._initPanel(this._classList,this._id);const{title:i}=e;!1!==(null==i?void 0:i.visible)&&M(null==i?void 0:i.value)?this.title||this._initTitle():this.title&&this._releaseTitle(),(null!==(t=e.content)&&void 0!==t?t:[]).length>0?this.content||this._initContent():this.content&&this._releaseContent()}_initPanel(t,e){const i=this.createElement("div",t,{left:"0",top:"0",pointerEvents:"none",padding:"12px",position:"absolute",zIndex:iK,fontFamily:"sans-serif",fontSize:"11px",borderRadius:"3px",borderStyle:"solid",lineHeight:"initial",background:"#fff",boxShadow:"2px 2px 4px rgba(0, 0, 0, 0.1)",maxWidth:"100wh",maxHeight:"100vh"},e);this.product=i}_initTitle(){const t=new eK(this.product,this._option,0);t.init(),this.title=t,this.children[t.childIndex]=t}_releaseTitle(){this.title&&(this.title.release(),delete this.children[this.title.childIndex],this.title=null)}_initContent(){const t=new tK(this.product,this._option,1);t.init(),this.content=t,this.children[t.childIndex]=t}_releaseContent(){this.content&&(this.content.release(),delete this.children[this.content.childIndex],this.content=null)}setStyle(){const t=this._option.getTooltipStyle();super.setStyle(Tl({},WX,t.panel)),Object.values(this.children).forEach((t=>t.setStyle()))}setContent(){Object.values(this.children).forEach((t=>{t.setContent()}))}release(){super.release(),this.title=null,this.content=null}}const nK=t=>{$l.registerComponentPlugin(t.type,t)};class rK extends BX{getVisibility(){var t;return!!(null===(t=this.model)||void 0===t?void 0:t.getVisibility())}setVisibility(t){var e;t!==this.getVisibility()&&(null===(e=this.model)||void 0===e||e.setVisibility(t))}constructor(){super(rK.type),this.type=TW.dom,this._tooltipContainer=null==hl?void 0:hl.body}onAdd(t){super.onAdd(t),this._initStyle(),this.initEl()}initEl(){const t=this._component.getSpec(),e=t.parentElement;if(hl&&e&&e.children&&e.children.length){for(let t=0;tthis._domStyle,getTooltipActual:()=>this._tooltipActual,getTooltipAttributes:()=>this._attributes,getContainer:()=>this._container},[t.className],this.name)}}_removeTooltip(){var t;null===(t=this.model)||void 0===t||t.release(),this._container=null}_updateTooltip(t,e){var i,s;const{tooltipActual:n,tooltipSpec:r}=e;if(t&&this.model){if(!e.changePositionOnly){this._tooltipActual=n,this._initStyle();const t=!this.model.product;this.model.initAll(),t&&this._initEvent(this.model.product),this.model.setStyle(),this.model.setContent()}this.setVisibility(t);const a=this.model.product;if(a){const{x:t=0,y:o=0}=null!==(i=n.position)&&void 0!==i?i:{};if(r.updateElement){this._updatePosition(null!==(s=this._cacheCustomTooltipPosition)&&void 0!==s?s:{x:t,y:o}),r.updateElement(a,n,e);const i=this._getActualTooltipPosition(n,e,{width:a.offsetWidth,height:a.offsetHeight});this._updatePosition(i),this._cacheCustomTooltipPosition=i}else this._updatePosition({x:t,y:o})}}else this.setVisibility(t),this._cacheCustomTooltipPosition=void 0}_initStyle(){this._domStyle=function(t){var e,i,s;const{panel:n={},title:r,content:a,titleStyle:o={},contentStyle:l={},padding:h,keyWidth:d,valueWidth:c,enterable:u,transitionDuration:p,panelDomHeight:g=0,align:m="left"}=null!=t?t:{},{fill:_,shadow:f,shadowBlur:v,shadowColor:y,shadowOffsetX:b,shadowOffsetY:x,shadowSpread:S,cornerRadius:M,stroke:k,lineWidth:A=0,width:w=0}=n,{value:T={}}=o,{shape:L={},key:C={},value:E={}}=l,D=function(t){if(!t)return;const{size:e}=Tl({},void 0,t),i={};return i.width=FX(e),i}(L),P=zX(C),O=zX(E),{bottom:R,left:I,right:B,top:F}=sl(h),Y="right"===m?"marginLeft":"marginRight";return{align:m,panel:{width:FX(w+2*A),minHeight:FX(g+2*A),paddingBottom:FX(R),paddingLeft:FX(I),paddingRight:FX(B),paddingTop:FX(F),borderColor:k,borderWidth:FX(A),borderRadius:FX(M),backgroundColor:_?`${_}`:"transparent",boxShadow:f?`${b}px ${x}px ${v}px ${S}px ${y}`:"initial",pointerEvents:u?"auto":"none",transitionDuration:p?`${p}ms`:"initial",transitionProperty:p?"transform":"initial",transitionTimingFunction:p?"ease-out":"initial"},title:Object.assign({marginTop:"0px",marginBottom:(null==a?void 0:a.length)?FX(null==r?void 0:r.spaceRow):"0px"},zX(Tl({},T,null==r?void 0:r.value))),content:{},shapeColumn:{common:D,items:null==a?void 0:a.map((({spaceRow:t},e)=>({marginTop:"0px",marginBottom:eObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:iObject.assign(Object.assign(Object.assign({marginTop:"0px",marginBottom:i{const{renderMode:e,enterable:i}=this._component.getSpec(),s=t.relatedTarget;"html"===e&&i&&(D(s)||s!==this._compiler.getCanvas()&&!Qr(s,this.getTooltipContainer()))&&this._component.hideTooltip()}))}}rK.type=TW.dom;const aK=(t,...e)=>{const i=[t.shape,...e.map((t=>null==t?void 0:t.shape))],s=[t.key,...e.map((t=>null==t?void 0:t.key))],n=[t.value,...e.map((t=>null==t?void 0:t.value))];return E(t,...e,{shape:i.every(D)?void 0:E({},...i),key:s.every(D)?void 0:E({},...s),value:n.every(D)?void 0:E({},...n)})},oK=t=>{const{width:e,height:i,wordBreak:s="break-word",textAlign:n,textBaseline:r,text:a}=t;return Array.isArray(a)?{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:Ba(a).map((e=>Object.assign(Object.assign({},t),{text:e})))}:{width:e,height:i,wordBreak:s,textAlign:n,textBaseline:r,singleLine:!1,textConfig:null==a?void 0:a.text}},lK={panel:{visible:!0,cornerRadius:[3,3,3,3],fill:"white",shadow:!0,shadowBlur:12,shadowColor:"rgba(0, 0, 0, 0.1)",shadowOffsetX:0,shadowOffsetY:4,shadowSpread:0,stroke:"white"},titleStyle:{value:{fill:"#4E5969",fontFamily:Xk,fontSize:14,lineHeight:18,textAlign:"left",textBaseline:"middle"},spaceRow:6},contentStyle:{shape:{fill:"black",size:8,symbolType:"circle",spacing:6},key:{fill:"#4E5969",fontFamily:Xk,fontSize:12,lineHeight:18,textAlign:"left",textBaseline:"middle",spacing:26},value:{fill:"#4E5969",fontFamily:Xk,fontSize:12,lineHeight:18,textAlign:"right",textBaseline:"middle",spacing:0},spaceRow:6},padding:10,positionX:"right",positionY:"bottom",offsetX:10,offsetY:10,parentBounds:(new qt).setValue(Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY,Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY),autoCalculatePosition:!0,autoMeasure:!0,pickable:!1,childrenPickable:!1,zIndex:500},hK=["pointerX","pointerY","offsetX","offsetY","positionX","positionY","parentBounds"];u_(),_y(),Gv(),df(),ek();class dK extends Rk{constructor(t,e){super((null==e?void 0:e.skipDefault)?t:E({},dK.defaultAttributes,t),e),this.name="tooltip"}render(){var t;const{visible:e,content:i,panel:s,keyWidth:n,valueWidth:r,hasContentShape:a,autoCalculatePosition:o,autoMeasure:l,align:h}=this.attribute;if(!e)return void this.hideAll();l&&dK.measureTooltip(this.attribute),o&&dK.calculateTooltipPosition(this.attribute);const d=gD(this.attribute.padding);this._tooltipPanel=this.createOrUpdateChild("tooltip-background",Object.assign({visible:!0},s),"rect"),this._tooltipTitleContainer=this.createOrUpdateChild("tooltip-title",{visible:!0,x:d[3],y:d[0]},"group");const c=dK.getTitleAttr(this.attribute);this._tooltipTitleSymbol=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-shape",E({symbolType:"circle"},c.shape,{visible:Nk(c)&&Nk(c.shape)}),"symbol"),"object"!=typeof c.value.text||null===c.value.text||"rich"!==c.value.text.type&&"html"!==c.value.text.type?c.value.multiLine?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Nk(c)&&Nk(c.value)},oK(c.value)),"richtext"):this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({text:null!==(t=c.value.text)&&void 0!==t?t:"",visible:Nk(c)&&Nk(c.value)},c.value),"text"):"rich"===c.value.text.type?this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({visible:Nk(c)&&Nk(c.value)},oK(c.value)),"richtext"):"html"===c.value.text.type&&(this._tooltipTitle=this._tooltipTitleContainer.createOrUpdateChild("tooltip-title-value",Object.assign({html:Object.assign(Object.assign({dom:c.value.text.text},Zk),c.value),visible:Nk(c)&&Nk(c.value),width:c.value.width,height:c.value.height,wordBreak:c.value.wordBreak,textAlign:c.value.textAlign,textBaseline:c.value.textBaseline,singleLine:!1,textConfig:[]},c.value),"richtext"));const u=Nk(c.shape)?c.shape.size+c.shape.spacing:0,{textAlign:p,textBaseline:g}=c.value,m=s.width-d[3]-d[0]-u;"center"===p?this._tooltipTitle.setAttribute("x",u+m/2):"right"===p||"end"===p?this._tooltipTitle.setAttribute("x",u+m):this._tooltipTitle.setAttribute("x",u),"bottom"===g?this._tooltipTitle.setAttribute("y",c.height):"middle"===g?this._tooltipTitle.setAttribute("y",c.height/2):this._tooltipTitle.setAttribute("y",0);const _=Nk(c)?c.height+c.spaceRow:0;if(this._tooltipContent=this.createOrUpdateChild("tooltip-content",{visible:!0},"group"),this._tooltipContent.removeAllChild(!0),i&&i.length){this._tooltipContent.setAttribute("x",d[3]),this._tooltipContent.setAttribute("y",d[0]+_);let t=0;i.forEach(((e,i)=>{const s=dK.getContentAttr(this.attribute,i);if(!Nk(s))return;const o=`tooltip-content-${i}`,l=this._tooltipContent.createOrUpdateChild(o,{visible:!0,x:0,y:t},"group"),d=s.shape.size+s.shape.spacing;let c="right"===h?(a?d:0)+(Nk(s.key)?n+s.key.spacing:0)+(Nk(s.value)?r:0):0;this._createShape("right"===h?c-s.shape.size/2:c+s.shape.size/2,s,l,o),a&&("right"===h?c-=d:c+=d);const u=this._createKey(s,l,o);u&&(sA(h,u,s.key.textAlign,c,n),u.setAttribute("y",0),"right"===h?c-=n+s.key.spacing:c+=n+s.key.spacing);const p=this._createValue(s,l,o);if(p){let t="right";M(s.value.textAlign)?t=s.value.textAlign:Nk(s.key)||"right"===h||(t="left"),p.setAttribute("textAlign",t),sA(h,p,t,c,r),p.setAttribute("y",0)}t+=s.height+s.spaceRow}))}}_createShape(t,e,i,s){var n;if(Nk(e.shape))return i.createOrUpdateChild(`${s}-shape`,Object.assign({visible:!0,x:t,y:e.shape.size/2+((null!==(n=gn(e.key.lineHeight,e.key.fontSize))&&void 0!==n?n:e.key.fontSize)-e.shape.size)/2},e.shape),"symbol")}_createKey(t,e,i){var s;if(Nk(t.key)){let n;return n=t.key.multiLine?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0},oK(t.key)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.key.text||null===t.key.text||"rich"!==t.key.text.type&&"html"!==t.key.text.type?e.createOrUpdateChild(`${i}-key`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.key.text)&&void 0!==s?s:""},t.key),{textBaseline:"top"}),"text"):"rich"===t.key.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},oK(t.key)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign(Object.assign({dom:t.key.text.text},Zk),t.key)},"richtext"),n}}_createValue(t,e,i){var s;if(Nk(t.value)){let n;return n=t.value.multiLine?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},oK(t.value)),{textBaseline:"top"}),"richtext"):"object"!=typeof t.value.text||null===t.value.text||"rich"!==t.value.text.type&&"html"!==t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0,text:null!==(s=t.value.text)&&void 0!==s?s:""},t.value),{textBaseline:"top"}),"text"):"rich"===t.value.text.type?e.createOrUpdateChild(`${i}-value`,Object.assign(Object.assign({visible:!0},oK(t.value)),{textBaseline:"top"}),"richtext"):e.createOrUpdateChild(`${i}-value`,{html:Object.assign({dom:t.value.text.text,container:"",width:30,height:30,style:{}},t.value)},"richtext"),n}}setAttributes(t,e){const i=Object.keys(t);this.attribute.autoCalculatePosition&&i.every((t=>hK.includes(t)))?(this._mergeAttributes(t,i),D(this.attribute.panel.width)&&this.attribute.autoMeasure&&dK.measureTooltip(this.attribute),dK.calculateTooltipPosition(this.attribute),super.setAttributes({x:this.attribute.x,y:this.attribute.y},e)):super.setAttributes(t,e)}static calculateTooltipPosition(t){const{width:e=0,height:i=0}=t.panel,{offsetX:s,offsetY:n,pointerX:r,pointerY:a,positionX:o,positionY:l,parentBounds:h}=t;let d=r,c=a;return"left"===o?d-=e+s:"center"===o?d-=e/2:d+=s,"top"===l?c-=i+n:"middle"===l?c-=i/2:c+=n,d+e>h.x2&&(d-=e+s),c+i>h.y2&&(c-=i+n),d{const n=dK.getContentAttr(t,i);(e.key||e.value)&&Nk(n)&&s.push([e,n])})),s.length){let n=!1;const o=[],l=[],h=[];s.forEach((([t,e],r)=>{var d;const{key:c,value:u,shape:p,spaceRow:g}=e,m=Nk(p),_=null!==(d=null==p?void 0:p.symbolType)&&void 0!==d?d:"",f=Jk(c),v=Jk(u);let y=0;if(Nk(c)){const{width:t,height:e}=f.quickMeasure(c.text);l.push(t),y=Math.max(y,e)}if(Nk(u)){const{width:t,height:e}=v.quickMeasure(u.text);h.push(t),y=Math.max(y,e)}m&&uv[_]&&(n=!0,o.push(p.size),y=Math.max(p.size,y)),t.height=y,a+=y,r{t.width=r})),t.hasContentShape=n,t.keyWidth=c,t.valueWidth=u}}return t.panel.width=r+s[1]+s[3],t.panel.height=a,t}static getTitleAttr(t){return aK({},dK.defaultAttributes.titleStyle,dK.defaultAttributes.title,t.titleStyle,t.title)}static getContentAttr(t,e){return aK({},dK.defaultAttributes.contentStyle,t.contentStyle,t.content[e])}}dK.defaultAttributes=lK;class cK extends BX{constructor(){super(cK.type),this.type=TW.canvas}onAdd(t){var e;super.onAdd(t),this._tooltipCanvasId=null===(e=this._chartOption.modeParams)||void 0===e?void 0:e.tooltipCanvasId}_initTooltipComponent(t){const e=this._getLayer(t);this._tooltipComponent=new dK({autoCalculatePosition:!1,autoMeasure:!1}),e.add(this._tooltipComponent)}_getLayer(t){if(this._layer)return this._layer;this._layer=t.createLayer(this._tooltipCanvasId);const e=this._layer.layerHandler.canvas.nativeCanvas;return e&&e.style&&(e.style.touchAction="none",e.style.pointerEvents="none"),this._layer}_removeTooltip(){this._layer&&this._layer.removeAllChild(),this._attributes=null}_updateTooltip(t,e){this._visible=t;const i=this._compiler.getStage();if(!i)return;if(!t)return void(this._tooltipComponent&&this._tooltipComponent.attribute.visible&&(this._tooltipComponent.hideAll(),this._tooltipComponent.setAttributes({visibleAll:!1})));this._tooltipComponent||this._initTooltipComponent(i);const{tooltipActual:s}=e,n=s.position;e.changePositionOnly?M(n)&&this._tooltipComponent.setAttributes(n):this._tooltipComponent.setAttributes(Object.assign(Object.assign({},this._attributes),n)),this._tooltipComponent.attribute.visible||(this._tooltipComponent.showAll(),this._tooltipComponent.setAttributes({visibleAll:!0}))}isTooltipShown(){var t;return null===(t=this._tooltipComponent)||void 0===t?void 0:t.attribute.visibleAll}release(){var t;super.release(),null===(t=this._layer)||void 0===t||t.release()}}function uK(t,e){const i=e?t.toExponential(e-1):t.toExponential(),s=i.indexOf("e");if(s<0)return null;const n=i.slice(0,s);return[n.length>1?n[0]+n.slice(2):n,+i.slice(s+1)]}let pK;function gK(t,e){const i=uK(t,e);if(!i)return t+"";const s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}cK.type=TW.canvas;class mK{constructor(t={}){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}toString(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type}}const _K=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function fK(t){let e;if(e=_K.exec(t))return new mK({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]});g.getInstance().error("invalid format: "+t)}const vK=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];class yK{constructor(){var t,e,i;this.locale={thousands:",",grouping:[3],currency:["$",""]},this.group=void 0===this.locale.grouping||void 0===this.locale.thousands?t=>t:(e=[...this.locale.grouping].map(Number),i=`${this.locale.thousands}`,function(t,s){let n=t.length;const r=[];let a=0,o=e[0],l=0;for(;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),this.currencyPrefix=void 0===this.locale.currency?"":this.locale.currency[0]+"",this.currencySuffix=void 0===this.locale.currency?"":this.locale.currency[1]+"",this.decimal=void 0===this.locale.decimal?".":this.locale.decimal+"",this.numerals=void 0===this.locale.numerals?t=>t:(t=[...this.locale.numerals].map(String),function(e){return e.replace(/[0-9]/g,(e=>t[+e]))}),this.percent=void 0===this.locale.percent?"%":this.locale.percent+"",this.minus=void 0===this.locale.minus?"−":this.locale.minus+"",this.nan=void 0===this.locale.nan?"NaN":this.locale.nan+"",this.formatter=t=>this.newFormat(t),this.format=(t,e)=>this.formatter(t)(e),this.formatPrefix=(t,e)=>this._formatPrefix(t,e)}static getInstance(){return yK.instance||(yK.instance=new yK),yK.instance}newFormat(t){const e=fK(t);let i=e.fill,s=e.align;const n=e.sign,r=e.symbol;let a=e.zero;const o=e.width;let l=e.comma,h=e.precision,d=e.trim,c=e.type;"n"===c?(l=!0,c="g"):bK[c]||(void 0===h&&(h=12),d=!0,c="g"),(a||"0"===i&&"="===s)&&(a=!0,i="0",s="=");const u="$"===r?this.currencyPrefix:"#"===r&&/[boxX]/.test(c)?"0"+c.toLowerCase():"",p="$"===r?this.currencySuffix:/[%p]/.test(c)?this.percent:"",g=bK[c],m=/[defgprstz%]/.test(c);h=void 0===h?6:/[gprs]/.test(c)?Math.max(1,Math.min(21,h)):Math.max(0,Math.min(20,h));const{nan:_,minus:f,decimal:v,group:y,numerals:b}=this;function x(t){let e,r,x,S=u,M=p,k=t;if("c"===c)M=g(k)+M,k="";else{k=+k;let t=k<0||1/k<0;if(k=isNaN(k)?_:g(Math.abs(k),h),d&&(k=function(t){const e=t.length;let i,s=-1;t:for(let n=1;n0&&(s=0)}return s>0?t.slice(0,s)+t.slice(i+1):t}(k)),t&&0==+k&&"+"!==n&&(t=!1),S=(t?"("===n?n:f:"-"===n||"("===n?"":n)+S,M=("s"===c?vK[8+pK/3]:"")+M+(t&&"("===n?")":""),m)for(e=-1,r=k.length;++ex||x>57){M=(46===x?v+k.slice(e+1):k.slice(e))+M,k=k.slice(0,e);break}}l&&!a&&(k=y(k,1/0));let A=S.length+k.length+M.length,w=A>1)+S+k+M+w.slice(A);break;default:k=w+S+k+M}return b(k)}return x.toString=function(){return t+""},x}_formatPrefix(t,e){const i=fK(t);i.type="f";const s=this.newFormat(i.toString()),n=3*Math.max(-8,Math.min(8,Math.floor(function(t){const e=uK(Math.abs(t));return e?e[1]:NaN}(e)/3))),r=Math.pow(10,-n),a=vK[8+n/3];return function(t){return s(r*t)+a}}}const bK={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},f:(t,e)=>t.toFixed(e),e:(t,e)=>t.toExponential(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>gK(100*t,e),r:gK,s:function(t,e){const i=uK(t,e);if(!i)return t+"";const s=i[0],n=i[1],r=n-(pK=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+uK(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16),t:(t,e)=>Number.isInteger(t)?t.toFixed(2):Math.floor(t*Math.pow(10,e))/Math.pow(10,e)+"",z:(t,e)=>t%1==0?t+"":t.toFixed(e)},xK=/\{([^}]+)\}/,SK=/\{([^}]+)\}/g,MK=/:/;class kK extends DE{constructor(){super(kK.type),this.type="formatterPlugin",this._timeModeFormat={utc:cF.getInstance().timeUTCFormat,local:cF.getInstance().timeFormat},this._formatter=this._format,this._timeFormatter=this._timeModeFormat.local,this._numericFormatter=yK.getInstance().format,this._numericSpecifier=yK.getInstance().formatter,this._numericFormatterCache=new Map,this._isNumericFormatterCache=new Map}onInit(t,e){var i;const{globalInstance:s}=t;if(!s)return;this._spec=null!==(i=null==e?void 0:e[kK.specKey])&&void 0!==i?i:{};const{timeMode:n,customFormatter:r,numericFormatter:a,timeFormatter:o}=this._spec;ys(r)?this._formatter=r:(this._formatter=this._format.bind(this),ys(o)?this._timeFormatter=o:n&&this._timeModeFormat[n]&&(this._timeFormatter=this._timeModeFormat[n]),a&&(this._numericFormatter=a,this._numericSpecifier=null,this._numericFormatterCache=null)),$l.registerFormatter(this._formatter)}_format(t,e,i){return y(t)?t.map(((t,s)=>{const n=y(i)?i[s]:i;return n?this._formatSingleLine(t,e,n):t})):y(i)?i.map((i=>this._formatSingleLine(t,e,i))):this._formatSingleLine(t,e,i)}_formatSingleLine(t,e,i){let s;return this._isNumericFormatterCache&&(this._isNumericFormatterCache.get(i)?s=this._isNumericFormatterCache.get(i):(s=xK.test(i),this._isNumericFormatterCache.set(i,s))),s?i.replace(SK,((t,i)=>{if(!MK.test(i)){const s=e[i.trim()];return void 0!==s?s:t}const s=i.split(":"),n=e[s.shift()],r=s.join(":");return this._formatSingleText(n,r)})):this._formatSingleText(t,i)}_formatSingleText(t,e){if(_K.test(e)&&this._numericFormatter){let i;return this._numericFormatterCache&&this._numericSpecifier?(this._numericFormatterCache.get(e)?i=this._numericFormatterCache.get(e):(i=this._numericSpecifier(e),this._numericFormatterCache.set(e,i)),i(Number(t))):this._numericFormatter(e,Number(t))}return e.includes("%")&&this._timeFormatter?this._timeFormatter(e,t):t}release(){super.release(),this._format=null,this._timeFormatter=null,this._numericFormatter=null,this._numericSpecifier=null,this._numericFormatterCache=null,this._isNumericFormatterCache=null}}kK.pluginType="chart",kK.specKey="formatter",kK.type="formatterPlugin";class AK extends vx{constructor(){super(...arguments),this.type=AK.type}_getDefaultStyle(){return Object.assign(Object.assign({},super._getDefaultStyle()),{width:void 0,height:void 0,lineWidth:0})}}AK.type="image";class wK{constructor(){this.name="HtmlAttributePlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={},this.renderId=0}activate(t){this.pluginService=t,t.stage.hooks.afterRender.tap(this.key,(e=>{e&&e===this.pluginService.stage&&this.drawHTML(t.stage.renderService)}))}deactivate(t){t.stage.hooks.afterRender.taps=t.stage.hooks.afterRender.taps.filter((t=>t.name!==this.key)),xi.graphicService.hooks.onRemove.unTap(this.key),xi.graphicService.hooks.onRelease.unTap(this.key),this.release()}getWrapContainer(t,e,i){let s;return s=e?"string"==typeof e?xi.global.getElementById(e):e:t.window.getContainer(),{wrapContainer:xi.global.createDom(Object.assign({tagName:"div",parent:s},i)),nativeContainer:s}}parseDefaultStyleFromGraphic(t){return function(t){const e={},i=t=>/^\d+(\.\d+)?$/.test(`${t}`)?`${t}px`:`${t}`;return["textAlign","fontFamily","fontVariant","fontStyle","fontWeight"].forEach((i=>{t[i]&&(e[ta(i)]=t[i])})),["fontSize","lineHeight"].forEach((s=>{const n=ta(s);D(t[s])||(e[n]=i(t[s]))})),M(t.maxLineWidth)&&(e["max-width"]=i(t.maxLineWidth)),t.underline?e["text-decoration"]="underline":t.lineThrough&&(e["text-decoration"]="line-through"),t.fill&&S(t.fill)&&(e.color=t.fill),e}("text"===t.type&&t.attribute?t.attribute:ps(t).text)}getTransformOfText(t){const e=ps(t).text,{textAlign:i=e.textAlign,textBaseline:s=e.textBaseline}=t.attribute,n=t.globalTransMatrix.toTransformAttrs(),{rotateDeg:r,scaleX:a,scaleY:o}=n,l={left:"0",start:"0",end:"-100%",center:"-50%",right:"-100%",top:"0",middle:"-50%",bottom:"-100%",alphabetic:"-79%"},h={left:"0",start:"0",end:"100%",center:"50%",right:"100%",top:"0",middle:"50%",bottom:"100%",alphabetic:"79%"};return{textAlign:i,transform:`translate(${l[i]},${l[s]}) rotate(${r}deg) scaleX(${a}) scaleY(${o})`,transformOrigin:`${h[i]} ${h[s]}`}}updateStyleOfWrapContainer(t,e,i,s,n){const{pointerEvents:r}=n;let a=this.parseDefaultStyleFromGraphic(t);a.display=!1!==t.attribute.visible?"block":"none",a.pointerEvents=!0===r?"all":r||"none",i.style.position||(i.style.position="absolute",s.style.position="relative");let o=0,l=0;const h=t.globalAABBBounds;let d=n.anchorType;if(D(d)&&(d="text"===t.type?"position":"boundsLeftTop"),"boundsLeftTop"===d&&(d="top-left"),"position"===d||h.empty()){const e=t.globalTransMatrix;o=e.e,l=e.f}else{const t=jA(h,d);o=t.x,l=t.y}const c=xi.global.getElementTopLeft(s,!1),u=e.window.getTopLeft(!1),p=e.viewBox,g=o+u.left-c.left+p.x1,m=l+u.top-c.top+p.y1;if(a.left=`${g}px`,a.top=`${m}px`,"text"===t.type&&"position"===d&&(a=Object.assign(Object.assign({},a),this.getTransformOfText(t))),ys(n.style)){const e=n.style({top:m,left:g,width:h.width(),height:h.height()},t,i);e&&(a=Object.assign(Object.assign({},a),e))}else vs(n.style)?a=Object.assign(Object.assign({},a),n.style):S(n.style)&&n.style&&(a=Object.assign(Object.assign({},a),((t="")=>{const e={};return t.split(";").forEach((t=>{if(t){const i=t.split(":");if(2===i.length){const t=i[0].trim(),s=i[1].trim();t&&s&&(e[t]=s)}}})),e})(n.style)));xi.global.updateDom(i,{width:n.width,height:n.width,style:a})}clearCacheContainer(){this.htmlMap&&Object.keys(this.htmlMap).forEach((t=>{this.htmlMap[t]&&this.htmlMap[t].renderId!==this.renderId&&this.removeElement(t)})),this.renderId+=1}drawHTML(t){"browser"===xi.global.env&&(t.renderTreeRoots.sort(((t,e)=>{var i,s;return(null!==(i=t.attribute.zIndex)&&void 0!==i?i:ai.zIndex)-(null!==(s=e.attribute.zIndex)&&void 0!==s?s:ai.zIndex)})).forEach((t=>{this.renderGroupHTML(t)})),this.clearCacheContainer())}renderGroupHTML(t){this.renderGraphicHTML(t),t.forEachChildren((t=>{t.isContainer?this.renderGroupHTML(t):this.renderGraphicHTML(t)}))}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{wrapContainer:e}=this.htmlMap[t];e&&xi.global.removeDom(e),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{html:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const{dom:n,container:r}=i;if(!n)return;const a=D(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[a]&&r&&r!==this.htmlMap[a].container&&this.removeElement(a),this.htmlMap&&this.htmlMap[a])"string"==typeof n?this.htmlMap[a].wrapContainer.innerHTML=n:n!==this.htmlMap[a].wrapContainer.firstChild&&(this.htmlMap[a].wrapContainer.removeChild(this.htmlMap[a].wrapContainer.firstChild),this.htmlMap[a].wrapContainer.appendChild(n));else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,r);t&&("string"==typeof n?t.innerHTML=n:t.appendChild(n),this.htmlMap||(this.htmlMap={}),this.htmlMap[a]={wrapContainer:t,nativeContainer:e,container:r,renderId:this.renderId})}if(!this.htmlMap||!this.htmlMap[a])return;const{wrapContainer:o,nativeContainer:l}=this.htmlMap[a];this.updateStyleOfWrapContainer(t,s,o,l,i),this.htmlMap[a].renderId=this.renderId}release(){"browser"===xi.global.env&&this.removeAllDom(this.pluginService.stage.defaultLayer)}removeAllDom(t){this.htmlMap&&(Object.keys(this.htmlMap).forEach((t=>{this.removeElement(t)})),this.htmlMap=null)}}class TK extends wK{constructor(){super(...arguments),this.name="ReactAttributePlugin",this.activeEvent="onRegister",this._uid=I.GenAutoIncrementId(),this.key=this.name+this._uid,this.htmlMap={}}removeElement(t){if(!this.htmlMap||!this.htmlMap[t])return;const{root:e,wrapContainer:i,unmount:s}=this.htmlMap[t];e?xi.global.getRequestAnimationFrame()((()=>{e.unmount()})):s&&s(),i&&xi.global.removeDom(i),this.htmlMap[t]=null}renderGraphicHTML(t){var e;const{react:i}=t.attribute;if(!i)return;const s=t.stage;if(!s)return;const n=s.params.ReactDOM,{element:r,container:a}=i;if(!r||!n||!n.createRoot&&!n.render)return;const o=D(i.id)?`${null!==(e=t.id)&&void 0!==e?e:t._uid}_react`:i.id;if(this.htmlMap&&this.htmlMap[o]&&a&&a!==this.htmlMap[o].container&&this.removeElement(o),this.htmlMap&&this.htmlMap[o])n.createRoot?this.htmlMap[o].root.render(r):n.render(r,this.htmlMap[o].wrapContainer);else{const{wrapContainer:t,nativeContainer:e}=this.getWrapContainer(s,a);if(t)if(this.htmlMap||(this.htmlMap={}),n.createRoot){const i=n.createRoot(t);i.render(r),this.htmlMap[o]={root:i,wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId}}else n.render(r,t),this.htmlMap[o]={wrapContainer:t,nativeContainer:e,container:a,renderId:this.renderId,unmount:()=>{n.unmountComponentAtNode(t)}}}if(!this.htmlMap||!this.htmlMap[o])return;const{wrapContainer:l,nativeContainer:h}=this.htmlMap[o];this.updateStyleOfWrapContainer(t,s,l,h,i),this.htmlMap[o].renderId=this.renderId}}fT.useRegisters([()=>{uE(),pE(),qC(),QC(),kC(),xC(),VP(),iO(),$l.registerSeries(sO.type,sO),$l.registerChart(mO.type,mO)},()=>{uE(),pE(),qC(),fO(),QC(),$l.registerAnimation("area",MC),kC(),xC(),VP(),iO(),$l.registerSeries(xO.type,xO),$l.registerChart(MO.type,MO)},()=>{YO(),$l.registerChart(HO.type,HO)},()=>{QC(),$l.registerAnimation("scatter",((t,e)=>Object.assign({appear:tR(0,e)},yC))),VP(),iO(),$l.registerSeries(sR.type,sR),$l.registerChart(rR.type,rR)},()=>{gB(),$l.registerAnimation("pie",((t,e)=>({appear:cB(t,e),enter:lB(t),exit:hB(t),disappear:dB(t)}))),$l.registerAnimation("emptyCircle",((t,e)=>({appear:cB(t,e)}))),$l.registerSeries(xB.type,xB),$l.registerChart(AB.type,AB)},()=>{$l.registerSeries(KB.type,KB),gB(),$l.registerAnimation("rose",((t,e)=>({appear:FB(t,e),enter:RB(t),exit:IB(t),disappear:BB(t)}))),UB(),XB(),$l.registerChart(JB.type,JB)},()=>{$l.registerSeries(aF.type,aF),pE(),fO(),qC(),QC(),$l.registerAnimation("radar",((t,e)=>({appear:"clipIn"===e?void 0:iF(t,e,"in"),enter:iF(t,e,"in"),exit:iF(t,e,"out"),disappear:"clipIn"===e?void 0:iF(t,e,"out"),update:[{options:{excludeChannels:["points","defined","center"]}},{channel:["points","center"],custom:tF,customParameters:t,duration:vC.update.duration,easing:vC.update.easing}]}))),$l.registerAnimation("radarSymbol",((t,e)=>({appear:"clipIn"===e?void 0:sF(t,e,"in"),enter:{type:"scaleIn"},exit:{type:"scaleOut"},disappear:"clipIn"===e?void 0:sF(t,e,"out"),update:[{options:{excludeChannels:["x","y","center"]}},{channel:["x","y","center"],custom:QB,customParameters:t,duration:vC.update.duration,easing:vC.update.easing}]}))),$l.registerAnimation("radarGroup",((t,e)=>({appear:nF(t,"in"),disappear:nF(t,"out")}))),Wx(),UB(),XB(),$l.registerChart(lF.type,lF)},()=>{YO(),$l.registerChart(EF.type,EF)},()=>{_c.registerGrammar("projection",OI,"projections"),qI(),HI(),$l.registerSeries(JI.type,JI),$l.registerImplement("registerMap",Op),$l.registerImplement("unregisterMap",Rp),SC(),$l.registerChart(tB.type,tB)},()=>{KF(),$l.registerSeries(ZF.type,ZF),gB(),FF(),XB(),$l.registerChart(QF.type,QF)},()=>{dj(),$l.registerChart(uj.type,uj)},()=>{lj(),VY(),SF(),uY(),$l.registerSeries(hj.type,hj),dj(),$l.registerChart(uj.type,uj)},()=>{Oj(),SF(),gF(),$l.registerSeries(Fj.type,Fj),$l.registerAnimation("funnel",((t,e)=>Object.assign({appear:"clipIn"===e?void 0:{type:"fadeIn"}},bC))),$l.registerAnimation("cartesianGroupClip",(t=>({appear:{custom:yA,customParameters:(e,i)=>({animationType:"in",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})},disappear:{custom:yA,customParameters:(e,i)=>({animationType:"out",group:i.getGraphicItem(),direction:t.direction(),width:t.width(),height:t.height(),orient:t.orient()})}}))),SC(),$l.registerChart(jj.type,jj)},()=>{gF(),DO(),$l.registerAnimation("waterfall",((t,e)=>({appear:Oz(t,e),enter:AO(t,!1),exit:wO(t,!1),disappear:wO(t,!1)}))),SC(),VP(),iO(),$l.registerSeries(Kz.type,Kz),$l.registerChart(Zz.type,Zz)},()=>{$l.registerMark(fN.type,fN),_c.registerGlyph("boxplot",{shaft:"rule",box:"rect",max:"rule",min:"rule",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","boxWidth","boxHeight","ruleWidth","ruleHeight"]).registerFunctionEncoder(dN).registerChannelEncoder("x",((t,e,i,s,n,r)=>r&&iN(r.direction)?null:{shaft:{x:e,x1:e}})).registerChannelEncoder("y",((t,e,i,s,n,r)=>r&&iN(r.direction)?{shaft:{y:e,y1:e}}:null)).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&iN(r.direction)?{box:{x:e}}:{box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&iN(r.direction)?{box:{x1:e}}:{box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&iN(r.direction)?{shaft:{x:e},min:{x:e,x1:e,visible:!0}}:{shaft:{y:e},min:{y:e,y1:e,visible:!0}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&iN(r.direction)?{shaft:{x1:e},max:{x:e,x1:e,visible:!0}}:{shaft:{y1:e},max:{y:e,y1:e,visible:!0}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&iN(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=r&&iN(r.direction)?[(i.min+i.max)/2,i.y]:[i.x,(i.min+i.max)/2],l=null!==(a=i.anchor)&&void 0!==a?a:o;return{shaft:{angle:e,anchor:l},box:{angle:e,anchor:l},max:{angle:e,anchor:l},min:{angle:e,anchor:l},median:{angle:e,anchor:l}}})).registerDefaultEncoder((()=>({max:{visible:!1},min:{visible:!1},median:{visible:!1}}))),_c.registerAnimationType("boxplotScaleIn",cN),_c.registerAnimationType("boxplotScaleOut",uN),aN(),UA(),NA(),VA(),_c.registerGlyph("barBoxplot",{minMaxBox:"rect",q1q3Box:"rect",median:"rule"}).registerProgressiveChannels(["x","y","q1","q3","min","max","median","angle","width","height","minMaxWidth","q1q3Width","minMaxHeight","q1q3Height"]).registerFunctionEncoder(gN).registerChannelEncoder("q1",((t,e,i,s,n,r)=>r&&iN(r.direction)?{q1q3Box:{x:e}}:{q1q3Box:{y:e}})).registerChannelEncoder("q3",((t,e,i,s,n,r)=>r&&iN(r.direction)?{q1q3Box:{x1:e}}:{q1q3Box:{y1:e}})).registerChannelEncoder("min",((t,e,i,s,n,r)=>r&&iN(r.direction)?{minMaxBox:{x:e}}:{minMaxBox:{y:e}})).registerChannelEncoder("max",((t,e,i,s,n,r)=>r&&iN(r.direction)?{minMaxBox:{x1:e}}:{minMaxBox:{y1:e}})).registerChannelEncoder("median",((t,e,i,s,n,r)=>r&&iN(r.direction)?{median:{x:e,x1:e,visible:!0}}:{median:{y:e,y1:e,visible:!0}})).registerChannelEncoder("angle",((t,e,i,s,n,r)=>{var a;const o=null!==(a=i.anchor)&&void 0!==a?a:[i.x,(i.min+i.max)/2];return{minMaxBox:{angle:e,anchor:o},q1q3Box:{angle:e,anchor:o},median:{angle:e,anchor:o}}})).registerChannelEncoder("lineWidth",((t,e,i,s,n,r)=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0}}))).registerChannelEncoder("minMaxFillOpacity",((t,e,i,s,n,r)=>({minMaxBox:{fillOpacity:e}}))).registerChannelEncoder("stroke",((t,e,i,s,n,r)=>({minMaxBox:{stroke:!1},q1q3Box:{stroke:!1}}))).registerDefaultEncoder((()=>({minMaxBox:{lineWidth:0},q1q3Box:{lineWidth:0},median:{visible:!1}}))),_c.registerAnimationType("barBoxplotScaleIn",mN),_c.registerAnimationType("barBoxplotScaleOut",_N),aN(),UA(),NA(),VA(),QC(),xC(),VP(),iO(),$l.registerSeries(yN.type,yN),$l.registerChart(xN.type,xN)},()=>{$l.registerSeries(jF.type,jF),gB(),FF(),SC(),UB(),XB(),$l.registerChart(NF.type,NF)},()=>{DO(),$l.registerAnimation("linearProgress",((t,e)=>({appear:Xj(t,e),enter:{type:"grow"},disappear:Uj(t)}))),SC(),$l.registerSeries(Zj.type,Zj),$l.registerChart(Qj.type,Qj)},()=>{DO(),SF(),$l.registerAnimation("rangeColumn",((t,e)=>({appear:rH(t,e),enter:iH(t),exit:nH(t),disappear:nH(t)}))),SC(),VP(),iO(),$l.registerSeries(hH.type,hH),$l.registerChart(cH.type,cH)},()=>{fO(),VP(),iO(),$l.registerSeries(tV.type,tV),$l.registerChart(iV.type,iV)},()=>{$l.registerSeries(zH.type,zH),gB(),SF(),SC(),$l.registerAnimation("sunburst",((t,e)=>({appear:xH(0,e),enter:vH(t),exit:bH(t),disappear:bH(t)}))),$l.registerChart(VH.type,VH)},()=>{$l.registerSeries(cz.type,cz),gB(),SF(),xC(),$l.registerAnimation("circlePacking",((t,e)=>({appear:hz(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),$l.registerChart(pz.type,pz)},()=>{_c.registerTransform("filter",{transform:tE,markPhase:"beforeJoin"},!0),_c.registerTransform("map",{transform:eE,markPhase:"beforeJoin"},!0),DO(),SF(),$l.registerAnimation("treemap",((t,e)=>({appear:xz(e),enter:{type:"growCenterIn"},exit:{type:"growCenterOut"},disappear:{type:"growCenterOut"}}))),SC(),_c.registerTransform("treemap",{transform:fz,markPhase:"beforeJoin"},!0),$l.registerSeries(Mz.type,Mz),$l.registerChart(Az.type,Az)},()=>{KN(),$l.registerChart(ZN.type,ZN)},()=>{cV(),$l.registerChart(pV.type,pV)},()=>{QC(),gF(),DO(),SF(),$l.registerSeries(kF.type,kF),gF(),QC(),VP(),iO(),$l.registerSeries(fF.type,fF),VP(),iO(),$l.registerChart(wF.type,wF)},()=>{QC(),kV(),$l.registerSeries(TV.type,TV),$l.registerAnimation("correlation",((t,e)=>Object.assign({appear:AV(0,e)},yC))),$l.registerChart(CV.type,CV)},()=>{$l.registerChart(dF.type,dF)},()=>{$O(),WO(),$l.registerChart(XO.type,XO)},()=>{$O(),$l.registerAnimation("pie3d",((t,e)=>({appear:cB(t,e),enter:lB(t),exit:hB(t),disappear:dB(t)}))),TB(),$l.registerSeries(CB.type,CB),$l.registerChart(DB.type,DB)},()=>{$O(),WO(),$l.registerChart(DF.type,DF)},()=>{$O(),zj(),SF(),gF(),$l.registerSeries(Vj.type,Vj),$l.registerChart(Wj.type,Wj)},()=>{$O(),NO(),VP(),iO(),$l.registerSeries(uH.type,uH),$l.registerChart(gH.type,gH)},()=>{$O(),gj(),$l.registerChart(_j.type,_j)},()=>{$O(),lj(),VY(),SF(),pY(),$l.registerSeries(pj.type,pj),$O(),gj(),$l.registerChart(_j.type,_j)},iO,VP,()=>{TP(),IP(),hD(),$l.registerComponent(EV.type,EV)},()=>{TP(),IP(),hD(),$l.registerComponent(IV.type,IV)},()=>{TP(),IP(),hD(),$l.registerComponent(FV.type,FV)},UB,XB,()=>{$l.registerComponent(eW.type,eW)},()=>{$l.registerComponent(gW.type,gW)},()=>{$l.registerComponent(HW.type,HW)},()=>{$l.registerComponent(tG.type,tG)},()=>{$l.registerComponent(rG.type,rG)},()=>{$l.registerComponent(yG.type,yG)},()=>{$l.registerComponent(bG.type,bG)},()=>{$l.registerComponent(kG.type,kG)},qI,()=>{$l.registerComponent(NU.type,NU),OU()},()=>{$l.registerComponent(ZU.type,ZU),XU()},()=>{$l.registerComponent(I$.type,I$),D$()},()=>{$l.registerComponent(GU.type,GU),WU._animate=cU,OU()},()=>{$l.registerComponent(QU.type,QU),JU._animate=pU,XU()},()=>{$l.registerComponent(B$.type,B$),D$()},()=>{$l.registerComponent(F$.type,F$),D$()},()=>{$l.registerComponent($U.type,$U)},()=>{$l.registerComponent(y$.type,y$)},()=>{S$(),A$(),sD(),$l.registerComponent(T$.type,T$,!0)},()=>{S$(),A$(),sD(),$l.registerComponent(L$.type,L$,!0)},()=>{$l.registerComponent(K$.type,K$)},()=>{$l.registerComponent(q$.type,q$)},()=>{$l.registerComponent(uX.type,uX)},()=>{Ui.load(MX)},()=>{$l.registerLayout(pX.type,pX)},()=>{$l.registerLayout(mX.type,mX)},()=>{XA(),qC(),QC(),gF(),SF(),fO(),DO(),HI(),gB(),Oj(),$l.registerMark(AK.type,AK),Sx(),KS(),_c.registerGraphic(Jd.image,RS),kV(),sD(),TB(),NO(),zj()},()=>{nK(rK)},()=>{nK(cK)},()=>{var t;t=kK,$l.registerChartPlugin(t.type,t)},()=>{_c.registerInteraction(Qw.type,Qw)},()=>{_c.registerInteraction(uT.type,uT)},()=>{_c.registerInteraction(pT.type,pT)},()=>{_c.registerInteraction(gT.type,gT)},()=>{_c.registerInteraction(rT.type,rT)},()=>{_c.registerInteraction(nT.type,nT)},()=>{JA(n_,tw),JA(Wm,pw),n_.useRegisters([pC,gC,$L,XL,cC,uC,mC,_C,fC])},()=>{Lg.registerPlugin("ReactAttributePlugin",TK)},()=>{Lg.registerPlugin("HtmlAttributePlugin",wK)}]);const LK=fT,CK=t=>Ba(t).join(",");class EK extends UT{constructor(){super(...arguments),this.dimensionTooltipTitleCallback=t=>CK(null==t?void 0:t[this.series.getDimensionField()[0]]),this.markTooltipKeyCallback=t=>CK(null==t?void 0:t[this.series.getDimensionField()[0]])}}const DK=Object.assign(Object.assign({},rL),{circle:{name:"circle",type:"arc"},overlap:{name:"overlap",type:"path"},overlapLabel:{name:"overlapLabel",type:"text"}}),PK=1e-10;function OK(t,e){const i=function(t){const e=[];for(let i=0;ie[i].radius+PK)return!1;return!0}(e,t)}));let n=0,r=0;const a=[];if(s.length>1){const e=FK(s);for(let t=0;t-1){const s=t[o.parentIndex[e]],n=Math.atan2(o.x-s.x,o.y-s.y),r=Math.atan2(i.x-s.x,i.y-s.y);let a=r-n;a<0&&(a+=2*Math.PI);const d=r-a/2;let c=be.distancePP(l,{x:s.x+s.radius*Math.sin(d),y:s.y+s.radius*Math.cos(d)});c>2*s.radius&&(c=2*s.radius),(null===h||h.width>c)&&(h={circle:s,width:c,p1:o,p2:i})}null!==h&&(a.push(h),n+=RK(h.circle.radius,h.width),i=o)}}else{let e=t[0];for(let i=1;iMath.abs(e.radius-t[s].radius)){i=!0;break}i?n=r=0:(n=e.radius*e.radius*Math.PI,a.push({circle:e,p1:{x:e.x,y:e.y+e.radius},p2:{x:e.x-PK,y:e.y+e.radius},width:2*e.radius}))}return r/=2,e&&(e.area=n+r,e.arcArea=n,e.polygonArea=r,e.arcs=a,e.innerPoints=s,e.intersectionPoints=i),n+r}function RK(t,e){return t*t*Math.acos(1-e/t)-(t-e)*Math.sqrt(e*(2*t-e))}function IK(t,e,i){if(i>=t+e)return 0;if(i<=Math.abs(t-e))return Math.PI*Math.min(t,e)*Math.min(t,e);const s=e-(i*i-t*t+e*e)/(2*i);return RK(t,t-(i*i-e*e+t*t)/(2*i))+RK(e,s)}function BK(t,e){const i=be.distancePP(t,e),s=t.radius,n=e.radius;if(i>=s+n||i<=Math.abs(s-n))return[];const r=(s*s-n*n+i*i)/(2*i),a=Math.sqrt(s*s-r*r),o=t.x+r*(e.x-t.x)/i,l=t.y+r*(e.y-t.y)/i,h=-(e.y-t.y)*(a/i),d=-(e.x-t.x)*(a/i);return[{x:o+h,y:l-d},{x:o-h,y:l+d}]}function FK(t){const e={x:0,y:0};for(let i=0;i{const e={},i=Object.values(t);if(!i.length)return[];OK(i,e);const s=e.arcs.map((({p1:t,p2:e,circle:i,width:s})=>({p1:t,p2:e,radius:i.radius,setId:i.setId,largeArcFlag:s>i.radius}))),n=[];let r=0,a=s[0];for(;rbe.distancePP(e.p1,t){if(!(null==t?void 0:t.length))return"";let e=0,i=t[0];const{p1:s}=i;let n=`M${s.x},${s.y}`;for(;i;){const{p2:s,radius:r,largeArcFlag:a}=i;n+=`A${r},${r} 0 ${a?1:0},0 ${s.x},${s.y}`,i=t[++e]}return n+=" Z",n},HK=t=>{var e;return null!==(e=null==t?void 0:t.map((t=>{const{p1:e,p2:i,radius:s,largeArcFlag:n,setId:r}=t,{x:a,y:o}=e,{x:l,y:h}=i,d=((l-a)**2+(h-o)**2)**.5,c=(a+l)/2,u=(o+h)/2,p=(s**2-(d/2)**2)**.5;let g=c+p*(h-o)/d,m=u-p*(l-a)/d;return(yt([l-a,h-o],[g-a,m-o])>0||n)&&(g=c-p*(h-o)/d,m=u+p*(l-a)/d),{x:g,y:m,radius:s,setId:r}})))&&void 0!==e?e:[]};class zK extends Ts{onBind(){this.fromCircles={},HK(this.from.arcs).forEach((t=>{this.fromCircles[t.setId]=t})),this.toCircles={},HK(this.to.arcs).forEach((t=>{this.toCircles[t.setId]=t}))}onUpdate(t,e,i){const s=[];Object.keys(this.fromCircles).forEach((t=>{const i=this.fromCircles[t],n=this.toCircles[t];i&&n&&s.push({radius:i.radius+(n.radius-i.radius)*e,x:i.x+(n.x-i.x)*e,y:i.y+(n.y-i.y)*e,setId:t})}));const n=YK(s);i.arcs=n,i.path=jK(n)}}const NK=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"growIn":return{type:"growRadiusIn"};case"scaleIn":return{type:"scaleIn"}}},VK=t=>{switch(t){case"fadeIn":default:return{type:"fadeIn"};case"scaleIn":return{type:"scaleIn"}}};class WK extends YC{_transformLabelSpec(t){this._addMarkLabelSpec(t,"circle"),this._addMarkLabelSpec(t,"overlap","overlapLabel","initOverlapLabelMarkStyle")}}function GK(t,e){let i=0;for(let s=0;s0)return g.getInstance().error("Initial bisect points must have opposite signs"),NaN;if(0===r)return e;if(0===a)return i;for(let i=0;i=0&&(e=i),Math.abs(o)o+r*n*l||h>=p)u=n;else{if(Math.abs(c)<=-a*l)return n;c*(u-d)>=0&&(u=d),d=n,p=h}return 0}n=n||1,r=r||1e-6,a=a||.1;for(let g=0;g<10;++g){if(qK(s.x,1,i.x,n,e),h=s.fx=t(s.x,s.fxprime),c=bt(s.fxprime,e),h>o+r*n*l||g&&h>=d)return p(u,n,d);if(Math.abs(c)<=-a*l)return n;if(c>=0)return p(n,u,h);d=h,u=n,n*=2}return n}function QK(t,e,i){let s={x:e.slice(),fx:0,fxprime:e.slice()},n={x:e.slice(),fx:0,fxprime:e.slice()};const r=e.slice();let a,o=1;const l=(i=i||{}).maxIterations||20*e.length;s.fx=t(s.x,s.fxprime);const h=s.fxprime.slice();KK(h,s.fxprime,-1);for(let e=0;e=g[p-1].fx){let i=!1;if(v.fx>e.fx?(qK(y,1+d,f,-d,e),y.fx=t(y),y.fx=1)break;for(let e=1;e=Math.min(s[a].size,s[o].size)&&(r=0),n[a].push({set:o,size:i.size,weight:r}),n[o].push({set:a,size:i.size,weight:r})}const r=[];for(const t in n)if(n.hasOwnProperty(t)){let e=0;for(let i=0;i=8){const n=function(t,e){const i=(e=e||{}).restarts||10,s=[],n={};let r;for(r=0;r=Math.min(e[r].size,e[a].size)?l=1:t.size<=1e-10&&(l=-1),n[r][a]=n[a][r]=l})),{distances:s,constraints:n}}(t,s,n);let o=a.distances;const l=a.constraints,h=XK(o.map(XK))/o.length;o=o.map((t=>t.map((t=>t/h))));const d=function(t,e){return function(t,e,i,s){let n,r=0;for(n=0;n0&&g<=c||u<0&&g>=c||(r+=2*m*m,e[2*n]+=4*m*(a-h),e[2*n+1]+=4*m*(o-d),e[2*l]+=4*m*(h-a),e[2*l+1]+=4*m*(d-o))}}return r}(t,e,o,l)};let c,u;for(r=0;rvY(e)));u=QK(d,t,e),(!c||u.fx0){const e=t[0].x,i=t[0].y;for(s=0;s1){const i=Math.atan2(t[1].x,t[1].y)-e,n=Math.cos(i),r=Math.sin(i);let a,o;for(s=0;s2){let i=Math.atan2(t[2].x,t[2].y)-e;for(;i<0;)i+=2*Math.PI;for(;i>2*Math.PI;)i-=2*Math.PI;if(i>Math.PI){const e=t[1].y/(1e-10+t[1].x);for(s=0;s=n&&(s=i[r],n=a)}const r=tq((function(i){return-1*rq({x:i[0],y:i[1]},t,e)}),[s.x,s.y],{maxIterations:500,minErrorDelta:1e-10}).x;let a={x:r[0],y:r[1]},o=!0;for(let e=0;et[e].radius){o=!1;break}for(let t=0;t{const{x0:i,x1:s,y0:n,y1:r,setField:a="sets",valueField:o="size",orientation:l=Math.PI/2,orientationOrder:h=null}=t;let d={},c={};if(e.length>0){const u=e.map((t=>({sets:Ba(t[a]),size:t[o]})));let p=function(t,e){(e=e||{}).maxIterations=e.maxIterations||500;const i=e.initialLayout||eq,s=e.lossFunction||GK,n=i(t=function(t){t=t.slice();const e=[],i={};for(let s=0;se)}));for(let s=0;s0&&g.getInstance().error("Area "+r+" not represented on screen")}return i}(d,u)}return e.map((t=>{const e=Ba(t[a]),i=e.toString(),s=c[i],n=Object.assign(Object.assign({},t),{datum:t,sets:e,key:i,size:t[o],labelX:null==s?void 0:s.x,labelY:null==s?void 0:s.y}),r=d[i];if(r)return Object.assign(Object.assign({},n),{type:"circle",x:r.x,y:r.y,radius:r.radius});const l=YK(e.map((t=>d[t])));return Object.assign(Object.assign({},n),{type:"overlap",x:0,y:0,path:jK(l),arcs:l})}))},oq=(t,e)=>e.filter((e=>e.type===t.datumType));class lq extends jC{constructor(){super(...arguments),this.type=_l.venn,this.transformerConstructor=WK,this._viewBox=new Kt}getCategoryField(){return this._categoryField}setCategoryField(t){return this._categoryField=t,this._categoryField}getValueField(){return this._valueField}setValueField(t){return this._valueField=t,this._valueField}setAttrFromSpec(){var t,e,i;super.setAttrFromSpec(),this.setCategoryField(null!==(t=this._spec.categoryField)&&void 0!==t?t:"sets"),this.setValueField(null!==(e=this._spec.valueField)&&void 0!==e?e:"size"),this.setSeriesField(null!==(i=this._spec.seriesField)&&void 0!==i?i:yT)}compile(){super.compile(),this._runVennTransform()}_runVennTransform(t=!1){const e=this._data.getProduct();e&&e.transform([{type:"venn",x0:this._viewBox.x1,x1:this._viewBox.x2,y0:this._viewBox.y1,y1:this._viewBox.y2,setField:this._categoryField,valueField:this._valueField}]),t&&this.getCompiler().renderNextTick()}initMark(){const t=this._createMark(lq.mark.circle,{isSeriesMark:!0});t&&(t.setTransform([{type:"vennMark",datumType:"circle"}]),this._circleMark=t);const e=this._createMark(lq.mark.overlap,{isSeriesMark:!0});e&&(e.setTransform([{type:"vennMark",datumType:"overlap"}]),this._overlapMark=e)}initMarkStyle(){this._initCircleMarkStyle(),this._initOverlapMarkStyle()}_initCircleMarkStyle(){this._circleMark&&this.setMarkStyle(this._circleMark,{x:t=>t.x,y:t=>t.y,innerRadius:0,outerRadius:t=>t.radius,startAngle:0,endAngle:2*Math.PI,fill:this.getColorAttribute(),stroke:this.getColorAttribute()},xy.STATE_NORMAL,Py.Series)}_initOverlapMarkStyle(){this._overlapMark&&(this.setMarkStyle(this._overlapMark,{x:t=>t.x,y:t=>t.y,path:t=>t.path,arcs:t=>t.arcs,fill:this.getColorAttribute(),stroke:this.getColorAttribute(),zIndex:t=>100*t.sets.length},xy.STATE_NORMAL,Py.Series),this.setMarkStyle(this._overlapMark,{zIndex:t=>100*t.sets.length+1},xy.STATE_HOVER,Py.Series))}initLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>CK(t.sets),maxLineWidth:t=>{const{x:e,radius:i,labelX:s}=t,n=e-i,r=e+i;return Math.min(s-n,r-s)}},xy.STATE_NORMAL,Py.Series))}initOverlapLabelMarkStyle(t){t&&(this._labelMark=t,t.setRule("venn"),this.setMarkStyle(t,{x:t=>t.labelX,y:t=>t.labelY,text:t=>CK(t.sets)},xy.STATE_NORMAL,Py.Series))}initTooltip(){this._tooltipHelper=new EK(this),this._circleMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._circleMark),this._overlapMark&&this._tooltipHelper.activeTriggerSet.mark.add(this._overlapMark)}getDimensionField(){return[this._categoryField]}getMeasureField(){return[this._valueField]}onLayoutEnd(t){super.onLayoutEnd(t),this._viewBox.set(0,0,this.getLayoutRect().width,this.getLayoutRect().height),this._runVennTransform()}getDefaultShapeType(){return"circle"}getActiveMarks(){return[this._circleMark,this._overlapMark]}getStatisticFields(){const t=[];return t.push({key:this._categoryField,operations:["values"]}),t.push({key:this._valueField,operations:["max","min"]}),t}getGroupFields(){return null}dataToPosition(t,e){return{x:t.x,y:t.y}}dataToPositionX(t){return t.x}dataToPositionY(t){return t.y}valueToPosition(t,e){throw new Error("Method not implemented.")}getStackGroupFields(){return[]}getStackValueField(){return null}_getSeriesInfo(t,e){const i=this.getDefaultShapeType();return e.map((e=>({key:CK(e),originalKey:e,style:this.getSeriesStyle({[t]:e}),shapeType:i})))}getSeriesFieldValue(t,e){const i=super.getSeriesFieldValue(t,e);return CK(i)}legendSelectedFilter(t,e){if(t.type===r.discreteLegend){const i=t.getLegendDefaultData(!0);if(0===e.length&&i.length)return[];if(e.length===i.length)return e;const s={};e.forEach((t=>{s[t]=!0}));const n=i.filter((t=>!s[CK(t)])),r=i.filter((t=>!n.includes(t)&&n.some((e=>Ba(e).every((e=>t.includes(e)))))));e=e.slice(),r.forEach((t=>{e.splice(e.indexOf(CK(t)),1)}))}return e}initAnimation(){this.getMarksInType("arc").forEach((t=>{var e;t.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("vennCircle"))||void 0===e?void 0:e(),DC(t.name,this._spec,this._markAttributeContext)))})),this.getMarksInType("path").forEach((t=>{var e;t.setAnimationConfig(EC(null===(e=$l.getAnimationInKey("vennOverlap"))||void 0===e?void 0:e(),DC(t.name,this._spec,this._markAttributeContext)))}))}}lq.type=_l.venn,lq.mark=DK,lq.transformerConstructor=WK;class hq extends rO{_getDefaultSeriesSpec(t){const e=Object.assign(Object.assign({},super._getDefaultSeriesSpec(t)),{categoryField:t.categoryField,valueField:t.valueField,seriesField:t.seriesField,circle:t.circle,overlap:t.overlap,overlapLabel:t.overlapLabel}),i=this.seriesType;return i&&(e.type=i,e[i]=t[i]),e}transformSpec(t){super.transformSpec(t),this.transformSeriesSpec(t)}}class dq extends cO{constructor(){super(...arguments),this.transformerConstructor=hq,this.type="venn",this.seriesType=_l.venn}}dq.type="venn",dq.seriesType=_l.venn,dq.transformerConstructor=hq;var cq=i(4353),uq=i(3826),pq=i.n(uq),gq=i(8569),mq=i.n(gq);function _q(t,e){if((i=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var i,s=t.slice(0,i);return[s.length>1?s[0]+s.slice(2):s,+t.slice(i+1)]}i(5662),i(2355),i(8361),i(3309),i(9865),i(5592),i(1289),i(539),i(4405),i(2338),i(1130),i(1532),i(9990),i(5944),i(1092),i(4608),i(2509),i(9294),i(2745),i(5530),i(5993),i(9751),i(4780),i(5681),i(2706),i(2878),i(3672),i(494),i(2187),i(4072),i(9881),i(1995),i(2026),i(7329),i(7690),i(912),i(5571),i(2673),i(2619),i(5826),i(3713),i(1219),i(4719),i(3532),i(2498),i(7317),i(4288),i(4007),i(292),i(9964),i(7674),i(6290),i(3433),i(813),i(9836),i(4061),i(8418),i(3562),i(8660),i(7409),i(2010),i(2830),i(5811),i(8809),i(8298),i(4309),i(7420),i(5513),i(9286),i(3900),i(952),i(7741),i(6481),i(1335),i(6101),i(6364),i(8003),i(6605),i(4457),i(8615),i(3860),i(4485),i(6467),i(623),i(2739),i(5877),i(5376),i(2698),i(6462),i(6400),i(9677),i(9464),i(6803),i(7205),i(880),i(465),i(9423),i(3225),i(2218),i(2369),i(4509),i(4334),i(2796),i(5414),i(3222),i(5285),i(5665),i(6847),i(9998),i(5977),i(7439),i(5616),i(2487),i(9160),i(1340),i(2979),i(7250),i(7406),i(8928),i(5012),i(7081),i(2544),i(8142),i(321),i(4895),i(3187),i(8804),i(5084),i(9911),i(4173),i(1750),i(950),i(4734),i(860),i(5760),i(7933),i(6033),i(122),i(1349),i(6007),i(9252),i(225),i(3473);var fq,vq=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function yq(t){if(!(e=vq.exec(t)))throw new Error("invalid format: "+t);var e;return new bq({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}function bq(t){this.fill=void 0===t.fill?" ":t.fill+"",this.align=void 0===t.align?">":t.align+"",this.sign=void 0===t.sign?"-":t.sign+"",this.symbol=void 0===t.symbol?"":t.symbol+"",this.zero=!!t.zero,this.width=void 0===t.width?void 0:+t.width,this.comma=!!t.comma,this.precision=void 0===t.precision?void 0:+t.precision,this.trim=!!t.trim,this.type=void 0===t.type?"":t.type+""}function xq(t,e){var i=_q(t,e);if(!i)return t+"";var s=i[0],n=i[1];return n<0?"0."+new Array(-n).join("0")+s:s.length>n+1?s.slice(0,n+1)+"."+s.slice(n+1):s+new Array(n-s.length+2).join("0")}yq.prototype=bq.prototype,bq.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(void 0===this.width?"":Math.max(1,0|this.width))+(this.comma?",":"")+(void 0===this.precision?"":"."+Math.max(0,0|this.precision))+(this.trim?"~":"")+this.type};const Sq={"%":(t,e)=>(100*t).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:function(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)},e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>xq(100*t,e),r:xq,s:function(t,e){var i=_q(t,e);if(!i)return t+"";var s=i[0],n=i[1],r=n-(fq=3*Math.max(-8,Math.min(8,Math.floor(n/3))))+1,a=s.length;return r===a?s:r>a?s+new Array(r-a+1).join("0"):r>0?s.slice(0,r)+"."+s.slice(r):"0."+new Array(1-r).join("0")+_q(t,Math.max(0,e+r-1))[0]},X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function Mq(t){return t}var kq,Aq,wq=Array.prototype.map,Tq=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Lq(t){var e,i,s=void 0===t.grouping||void 0===t.thousands?Mq:(e=wq.call(t.grouping,Number),i=t.thousands+"",function(t,s){for(var n=t.length,r=[],a=0,o=e[0],l=0;n>0&&o>0&&(l+o+1>s&&(o=Math.max(1,s-l)),r.push(t.substring(n-=o,n+o)),!((l+=o+1)>s));)o=e[a=(a+1)%e.length];return r.reverse().join(i)}),n=void 0===t.currency?"":t.currency[0]+"",r=void 0===t.currency?"":t.currency[1]+"",a=void 0===t.decimal?".":t.decimal+"",o=void 0===t.numerals?Mq:function(t){return function(e){return e.replace(/[0-9]/g,(function(e){return t[+e]}))}}(wq.call(t.numerals,String)),l=void 0===t.percent?"%":t.percent+"",h=void 0===t.minus?"−":t.minus+"",d=void 0===t.nan?"NaN":t.nan+"";function c(t){var e=(t=yq(t)).fill,i=t.align,c=t.sign,u=t.symbol,p=t.zero,g=t.width,m=t.comma,_=t.precision,f=t.trim,v=t.type;"n"===v?(m=!0,v="g"):Sq[v]||(void 0===_&&(_=12),f=!0,v="g"),(p||"0"===e&&"="===i)&&(p=!0,e="0",i="=");var y="$"===u?n:"#"===u&&/[boxX]/.test(v)?"0"+v.toLowerCase():"",b="$"===u?r:/[%p]/.test(v)?l:"",x=Sq[v],S=/[defgprs%]/.test(v);function M(t){var n,r,l,u=y,M=b;if("c"===v)M=x(t)+M,t="";else{var k=(t=+t)<0||1/t<0;if(t=isNaN(t)?d:x(Math.abs(t),_),f&&(t=function(t){t:for(var e,i=t.length,s=1,n=-1;s0&&(n=0)}return n>0?t.slice(0,n)+t.slice(e+1):t}(t)),k&&0==+t&&"+"!==c&&(k=!1),u=(k?"("===c?c:h:"-"===c||"("===c?"":c)+u,M=("s"===v?Tq[8+fq/3]:"")+M+(k&&"("===c?")":""),S)for(n=-1,r=t.length;++n(l=t.charCodeAt(n))||l>57){M=(46===l?a+t.slice(n+1):t.slice(n))+M,t=t.slice(0,n);break}}m&&!p&&(t=s(t,1/0));var A=u.length+t.length+M.length,w=A>1)+u+t+M+w.slice(A);break;default:t=w+u+t+M}return o(t)}return _=void 0===_?6:/[gprs]/.test(v)?Math.max(1,Math.min(21,_)):Math.max(0,Math.min(20,_)),M.toString=function(){return t+""},M}return{format:c,formatPrefix:function(t,e){var i,s=c(((t=yq(t)).type="f",t)),n=3*Math.max(-8,Math.min(8,Math.floor((i=e,((i=_q(Math.abs(i)))?i[1]:NaN)/3)))),r=Math.pow(10,-n),a=Tq[8+n/3];return function(t){return s(r*t)+a}}}}kq=Lq({thousands:",",grouping:[3],currency:["$",""]}),Aq=kq.format,kq.formatPrefix,gB(),HI(),$l.registerAnimation("vennCircle",((t,e)=>({appear:NK(e),enter:{type:"growRadiusIn"},exit:{type:"growRadiusOut"},disappear:{type:"growRadiusOut"}}))),$l.registerAnimation("vennOverlap",((t,e)=>({appear:VK(e),update:{custom:zK},enter:{type:"fadeIn"},exit:{type:"fadeOut"},disappear:{type:"fadeOut"}}))),SC(),_c.registerTransform("venn",{transform:aq,markPhase:"beforeJoin"},!0),_c.registerTransform("vennMark",{transform:oq,markPhase:"beforeJoin"},!0),$l.registerSeries(lq.type,lq),$l.registerChart(dq.type,dq),cq.extend(pq()),cq.extend(mq()),HTMLWidgets.widget({name:"vchart",type:"output",factory:function(t,e,i){let s;return{renderValue:function(e){e.hasOwnProperty("map")&&LK.registerMap(e.map.name,e.map.topojson,{type:"topojson",object:"map"}),console.log(e.specs),void 0===s?(s=new LK(e.specs,{dom:t.id}),s.renderAsync()):s.updateSpec(e.specs),e.hasOwnProperty("theme")},resize:function(t,e){}}}})})();var n=window;for(var r in s)n[r]=s[r];s.__esModule&&Object.defineProperty(n,"__esModule",{value:!0})})(); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json index ed6f8d8..8749d68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "1.0.0", "license": "MIT", "devDependencies": { - "@visactor/vchart": "^1.12.1", + "@visactor/vchart": "^1.12.6", "@visactor/vchart-theme": "^1.11.6", "d3-format": "^3.1.0", "dayjs": "^1.11.12", @@ -430,26 +430,26 @@ } }, "node_modules/@visactor/vchart": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@visactor/vchart/-/vchart-1.12.2.tgz", - "integrity": "sha512-dFrw9XjoaBr+oVAOBxc6qn+54uR2yg7x05SiAqoOXSM9/zrTCLlqAsVo2OvZWclvhOVeDpA04cKIX+8CtUEFQw==", - "dev": true, - "dependencies": { - "@visactor/vdataset": "~0.18.15", - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-hierarchy": "0.14.2", - "@visactor/vgrammar-projection": "0.14.2", - "@visactor/vgrammar-sankey": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vgrammar-venn": "0.14.2", - "@visactor/vgrammar-wordcloud": "0.14.2", - "@visactor/vgrammar-wordcloud-shape": "0.14.2", - "@visactor/vrender-components": "0.20.1", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vscale": "~0.18.15", - "@visactor/vutils": "~0.18.15", - "@visactor/vutils-extension": "1.12.2" + "version": "1.12.6", + "resolved": "https://registry.npmjs.org/@visactor/vchart/-/vchart-1.12.6.tgz", + "integrity": "sha512-4mgzsWUuFHgFRYvZIWk18jn8y9wNdqU7u5ePW1jeVXbKYwCx7USGUx8umLmd6WfrAgJenPOtGxUWQekg5z9Jlw==", + "dev": true, + "dependencies": { + "@visactor/vdataset": "~0.18.16", + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-hierarchy": "0.14.7", + "@visactor/vgrammar-projection": "0.14.7", + "@visactor/vgrammar-sankey": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vgrammar-venn": "0.14.7", + "@visactor/vgrammar-wordcloud": "0.14.7", + "@visactor/vgrammar-wordcloud-shape": "0.14.7", + "@visactor/vrender-components": "0.20.5", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vscale": "~0.18.16", + "@visactor/vutils": "~0.18.16", + "@visactor/vutils-extension": "1.12.6" } }, "node_modules/@visactor/vchart-theme": { @@ -462,15 +462,15 @@ } }, "node_modules/@visactor/vdataset": { - "version": "0.18.15", - "resolved": "https://registry.npmjs.org/@visactor/vdataset/-/vdataset-0.18.15.tgz", - "integrity": "sha512-LWaaunGetH8ThWjz6CE7NMG/LcFS41lTl76UCNJM1msfQxyIsbtoHim7t+Hdvud76oRZM0rxX/V4iB/+JpMRfw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@visactor/vdataset/-/vdataset-0.18.17.tgz", + "integrity": "sha512-y5cy3ITmYl5G15qlYFXqcMFIPjhc06nsN8Y2Nuy/emAIWjzUYDOkOMpkquzBbs7ragr5Fv5lNixNVH0qh7OT0A==", "dev": true, "dependencies": { "@turf/flatten": "^6.5.0", "@turf/helpers": "^6.5.0", "@turf/rewind": "^6.5.0", - "@visactor/vutils": "0.18.15", + "@visactor/vutils": "0.18.17", "d3-dsv": "^2.0.0", "d3-geo": "^1.12.1", "d3-hexbin": "^0.2.2", @@ -487,166 +487,166 @@ } }, "node_modules/@visactor/vgrammar-coordinate": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-coordinate/-/vgrammar-coordinate-0.14.2.tgz", - "integrity": "sha512-lhBDjS+nZURx7/vYR9JLZJnsTfEC4JhCQ+SMwu2kugnU2aXWIUIR5RRQw/ZUF5MBCI6QF6Jn7sWmOnpqUEyaAA==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-coordinate/-/vgrammar-coordinate-0.14.7.tgz", + "integrity": "sha512-J/x3BtEnm8piHUrryMXRx8xdrD9tb3Rl8Dc88CAwF+YrR6nETjb2iglnBXkADRjAiwH6p0W5z03Ant4CCDNh9g==", "dev": true, "dependencies": { - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vutils": "~0.18.15" + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-core": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-core/-/vgrammar-core-0.14.2.tgz", - "integrity": "sha512-WOP1sm/MRhlFDgKwN+OeMW22+GJjvHUFRlbKEBBgNDhSSIYAtCNKvMb4Tj2NnFcScMxeAjUQ8+Sqv15BPt7RPA==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-core/-/vgrammar-core-0.14.7.tgz", + "integrity": "sha512-LAih5eFPvoih0KNFLPG3OuF2Hd5nfK5vtrPqBlq6ZNKnu0wAH+aPY5Y8qnsgKwS5P0qK71jlEL2zTl3vH0ngUQ==", "dev": true, "dependencies": { - "@visactor/vdataset": "~0.18.15", - "@visactor/vgrammar-coordinate": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vrender-components": "0.20.1", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vscale": "~0.18.15", - "@visactor/vutils": "~0.18.15" + "@visactor/vdataset": "~0.18.16", + "@visactor/vgrammar-coordinate": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vrender-components": "0.20.5", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vscale": "~0.18.16", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-hierarchy": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-hierarchy/-/vgrammar-hierarchy-0.14.2.tgz", - "integrity": "sha512-ISmD0AgdIaWIn+qthcA8aUiv5wgWHG/EIgHUVtO6SSzFyN09W87IberKzrsbHMMOOXXYp1Afo41w4nbTRbaUBQ==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-hierarchy/-/vgrammar-hierarchy-0.14.7.tgz", + "integrity": "sha512-TaADAMIAgcJNSWvSElsklwrV7Vid+qqWoAggTFAMQkbTmVJMCvo/NEqiWszSyPS8H7DQAwegGJLv0lga12P5Kg==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vutils": "~0.18.15" + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-projection": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-projection/-/vgrammar-projection-0.14.2.tgz", - "integrity": "sha512-BmCcw4gK6RYJbpmi1eRkdp5ShuCqRBAiktXb84K/m9I2GcdxIFcvAhEPlaKPdB4mjkp0Auojdt2815sB1xmwMQ==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-projection/-/vgrammar-projection-0.14.7.tgz", + "integrity": "sha512-LcVibkOW/usM1QldT4pnz3cYss4lHREA+FeMIgLo3b4X+dOKD4Epf3nlsAXlI0cIEXxwUaaFSHuEXoNEzvoqYQ==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vutils": "~0.18.15", + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vutils": "~0.18.16", "d3-geo": "^1.12.1" } }, "node_modules/@visactor/vgrammar-sankey": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-sankey/-/vgrammar-sankey-0.14.2.tgz", - "integrity": "sha512-+Xf1VAPNHAxTBm0EYg5cmjj0O2f7s6sEyYDsRgw/Fq/zZisYXtSEtvm3ypPsifohebexubrk3kImeqC5TaDrSg==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-sankey/-/vgrammar-sankey-0.14.7.tgz", + "integrity": "sha512-ZBSVjq2L14Vp5CIcaIyPpOz4EfbzTk6YXmLNokljfvrMheiFqbKVTRsG7glpM/5t1sA+gf3mzAY3CG3VzZO0aA==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vutils": "~0.18.15" + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-util": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-util/-/vgrammar-util-0.14.2.tgz", - "integrity": "sha512-/2h+qXPJEuGeSeC5+O98im4mvs+T41cmxH3LSSq+Ssf9i14LPsEmnAuvGuYl8+0L7VW53PVc71zbvbw9+Lg9Eg==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-util/-/vgrammar-util-0.14.7.tgz", + "integrity": "sha512-56i0P50mwEWlK1SUvgwrrPeww5xsYyB5DuV84Y+e+4WzLzwe1g2R2ZPBRSc8RGH7rkGv7v9ZINjzY7HVIK+UuQ==", "dev": true, "dependencies": { - "@visactor/vrender-core": "0.20.1", - "@visactor/vutils": "~0.18.15" + "@visactor/vrender-core": "0.20.5", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-venn": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-venn/-/vgrammar-venn-0.14.2.tgz", - "integrity": "sha512-T6L41kvP8IWonjoP/QBYmi3xcdoHJYM0WlxblEQA/rlRGhPDg54esYQNUOBqknsh3wWUGkiAMh20g25T7oi5BQ==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-venn/-/vgrammar-venn-0.14.7.tgz", + "integrity": "sha512-NUfAiV6FIJtHgwLu/ILlR9ekpOYBqH0XXkPP6sVd7f1Me9PcBzEnyqubdxYaA7iCqEX88LxSA6BtWunplB5FjQ==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vutils": "~0.18.15" + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-wordcloud": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud/-/vgrammar-wordcloud-0.14.2.tgz", - "integrity": "sha512-n85qdUOAlv5pXeTdDPfeHJmBzZTezh5iP0tzlr3+TjyjpV2WwhBfcIRUsS0yE0IF5F3FRbZ/guw33vig8Qj9/A==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud/-/vgrammar-wordcloud-0.14.7.tgz", + "integrity": "sha512-ERkyhhCfwmZheW7Vz1GLGSMekR+IqcdvdDP7dyMkNHqP4xUyVHNSbWoY/WQ28f16iUB/IYh5JnFvxQWE8uSvvQ==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vutils": "~0.18.15" + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vgrammar-wordcloud-shape": { - "version": "0.14.2", - "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud-shape/-/vgrammar-wordcloud-shape-0.14.2.tgz", - "integrity": "sha512-UQcw+4n/mDkMBkKTCBLYWOBIibzHWARmlcGe69Sh+zXyPh6XztOUchm8mhb75ugo67yUOiDYnl5ULi3xe9erkw==", + "version": "0.14.7", + "resolved": "https://registry.npmjs.org/@visactor/vgrammar-wordcloud-shape/-/vgrammar-wordcloud-shape-0.14.7.tgz", + "integrity": "sha512-xnzyFGEk49kd0VAM6SD17rQJnQJy1lUndel5rSoVfpuE6IW8RLY287zzSk0rpBKR2Kse6HzSvCGobrYrTZ0WiQ==", "dev": true, "dependencies": { - "@visactor/vgrammar-core": "0.14.2", - "@visactor/vgrammar-util": "0.14.2", - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vscale": "~0.18.15", - "@visactor/vutils": "~0.18.15" + "@visactor/vgrammar-core": "0.14.7", + "@visactor/vgrammar-util": "0.14.7", + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vscale": "~0.18.16", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vrender-components": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/@visactor/vrender-components/-/vrender-components-0.20.1.tgz", - "integrity": "sha512-VKjpViUpfadGjwyA44X+AWr3MnUmCDeszad41eslaamfORSgT4QJ0pNYuVvMTdUSucnaOFkGZWerfbNG0CEChQ==", + "version": "0.20.5", + "resolved": "https://registry.npmjs.org/@visactor/vrender-components/-/vrender-components-0.20.5.tgz", + "integrity": "sha512-xAknwgg/tZmSdCy5+JXh2hAC+dXGtOA2L3yV/j4AcNPXV5bjHYOJ5kDc7fGKUZQ+oAxu4bCTWipSy5S0TpvTZg==", "dev": true, "dependencies": { - "@visactor/vrender-core": "0.20.1", - "@visactor/vrender-kits": "0.20.1", - "@visactor/vscale": "~0.18.14", - "@visactor/vutils": "~0.18.14" + "@visactor/vrender-core": "0.20.5", + "@visactor/vrender-kits": "0.20.5", + "@visactor/vscale": "~0.18.16", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@visactor/vrender-core": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/@visactor/vrender-core/-/vrender-core-0.20.1.tgz", - "integrity": "sha512-bFui7C+iGNt3OiMRQvl8+uq25np3MGiUlpZJHfZfr71Itizf+jn4FrnSbfy3MgzIEamxhYOMwp7qBwzs0/p2vA==", + "version": "0.20.5", + "resolved": "https://registry.npmjs.org/@visactor/vrender-core/-/vrender-core-0.20.5.tgz", + "integrity": "sha512-ZWiTbeeLWGvFk+5nyQebDavznnOkTUrjpo5Dy3THYxTZ87rV6CJxEHnYd2vEYN15Ee083cmUR88/LdwOgcZn1w==", "dev": true, "dependencies": { - "@visactor/vutils": "~0.18.14", + "@visactor/vutils": "~0.18.16", "color-convert": "2.0.1" } }, "node_modules/@visactor/vrender-kits": { - "version": "0.20.1", - "resolved": "https://registry.npmjs.org/@visactor/vrender-kits/-/vrender-kits-0.20.1.tgz", - "integrity": "sha512-1l4GLMdESX+FAwBsZePyZqQKx7YBNDHJ+HGjeIxJVm5yrUQGC1T2P+Z3DVgWCh9clhNPCPwpMa6AC0a5RUXKSQ==", + "version": "0.20.5", + "resolved": "https://registry.npmjs.org/@visactor/vrender-kits/-/vrender-kits-0.20.5.tgz", + "integrity": "sha512-MEyXvgEF+dkmXDGFqAKhxUO67Hk0+Ewmrj9PHJIOAtDb9a2mL+6tsTy4CNXATh60VXZwy7DmN1uUtYcEqZKzpA==", "dev": true, "dependencies": { "@resvg/resvg-js": "2.4.1", - "@visactor/vrender-core": "0.20.1", - "@visactor/vutils": "~0.18.14", + "@visactor/vrender-core": "0.20.5", + "@visactor/vutils": "~0.18.16", "roughjs": "4.5.2" } }, "node_modules/@visactor/vscale": { - "version": "0.18.15", - "resolved": "https://registry.npmjs.org/@visactor/vscale/-/vscale-0.18.15.tgz", - "integrity": "sha512-09dDWc6muJbOMxzp4odCsyLjqAF6u3BOx9kAJJ0tEpKE1AuHL4BTejNe697mJAnXqAo2ynAA+dn+cgWYiW1WQg==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@visactor/vscale/-/vscale-0.18.17.tgz", + "integrity": "sha512-jChQ7kq2CN/i+BtQ9wA2B8Xqmlw2xQDARDrmiUszXtuki07zNvq39UiNiQLQQjPq1qXb5hHNY4h4Wsp6fUa/RQ==", "dev": true, "dependencies": { - "@visactor/vutils": "0.18.15" + "@visactor/vutils": "0.18.17" } }, "node_modules/@visactor/vutils": { - "version": "0.18.15", - "resolved": "https://registry.npmjs.org/@visactor/vutils/-/vutils-0.18.15.tgz", - "integrity": "sha512-gTw8n14SU4avmqZ6VwpHwqoDfOCq044M2QA43rViNaHBnOQ/ePOPRZHl0heSfGQoMIJSZUD7SowLnn5NJjVXYw==", + "version": "0.18.17", + "resolved": "https://registry.npmjs.org/@visactor/vutils/-/vutils-0.18.17.tgz", + "integrity": "sha512-V9KZTlqyjyKEnKqmH8n2VjxOKlR7bX07R7W8tgEV4andfCYG8ufbx+xniR3jYXxCtca4USAks2KwyJBj2H+Kww==", "dev": true, "dependencies": { "@turf/helpers": "^6.5.0", @@ -655,13 +655,13 @@ } }, "node_modules/@visactor/vutils-extension": { - "version": "1.12.2", - "resolved": "https://registry.npmjs.org/@visactor/vutils-extension/-/vutils-extension-1.12.2.tgz", - "integrity": "sha512-79JdieFcMWTvz6FuI1QhB2ssIOy+mu8chUfBCjYgmf9qOuD0fBzbQk1YmB3a17fNy3RQ+9w03ymzcBrl3J7Egw==", + "version": "1.12.6", + "resolved": "https://registry.npmjs.org/@visactor/vutils-extension/-/vutils-extension-1.12.6.tgz", + "integrity": "sha512-choCjBNW3zL8YyeqKNc7aa4iK1aEVG0rLWJ4K8rMvnOPN0Z3ljFZH/LupTnMjZuU5R+veYn9JRsxrkbv0S8tFg==", "dev": true, "dependencies": { - "@visactor/vdataset": "~0.18.15", - "@visactor/vutils": "~0.18.15" + "@visactor/vdataset": "~0.18.16", + "@visactor/vutils": "~0.18.16" } }, "node_modules/@webassemblyjs/ast": { diff --git a/package.json b/package.json index 1835223..fa7d655 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "author": "Victor PERRIER", "license": "MIT", "devDependencies": { - "@visactor/vchart": "^1.12.1", + "@visactor/vchart": "^1.12.6", "@visactor/vchart-theme": "^1.11.6", "d3-format": "^3.1.0", "dayjs": "^1.11.12",